HP Forums

Full Version: Solve App and ABS() and IP()
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

I have two equations.
E1: S=(IP(X/L)*IP(Y/M)+IP(X/M)*IP(Y/L)+ABS(IP(X/L)*IP(Y/M)-IP(X/M)*IP(Y/L)))*0.5

E2:C=IP(X/L)*IP(Y/(2*M-2) )+IP(X/(2*M-2))*IP(Y/L)+ABS(IP(X/L)*IP(Y/(2*M-2))-IP(X/(2*M-2))*IP(Y/L))

When I solve them one by one, the answer is correct:

But, if I solve them at the same time, the answer of E2 is not correct.

Is it a bug?
21-10-2015 attachment updated

Updated on 22-10-2015
I modify the equations to as follows. They have the same problem.

If solve E1 and E2 at the same time, the answer or E1 is not correct.
Replace every instance of IP() with hIP() where hIP() is defined:

 return IP(x);

You will then get the correct answer. I believe your problem is because sometimes the calculator is deciding to use CAS to calculate the integer part. The program forces the calculator to use HOME for that calculation.

That should work in your other post with a similar issue but I haven't tried it.


It works, amazing.

Thank you very much!

In Solve app,
When solving a single equation, Prime uses a numerical Zero finder (inherited from the HP48 and previous calculators).
When solving multiple equations, it uses the CAS.

This has 2 side effects:
1) the CAS is not great at dealing with discontinuities in solving (Discontinuities are very hard!)
2) Cas version of the functions are used, nor numerical ones. As a general rules, this is not a problem as they yield identical results. But this is only a general rules as some edge cases for lesser used function might differ.

Reference URL's