Solve App and ABS() and IP()
10-20-2015, 12:53 PM (This post was last modified: 10-22-2015 05:06 PM by cclinus.)
Post: #1
 cclinus Junior Member Posts: 40 Joined: Oct 2015
Solve App and ABS() and IP()
Hello,

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?

Solve1.hpappdir.zip (Size: 833 bytes / Downloads: 4)
21-10-2015 attachment updated

Updated on 22-10-2015
I modify the equations to as follows. They have the same problem.
E1:C=IP(X/(2*M-2))*IP(Y/L)*2
E2:B=A

If solve E1 and E2 at the same time, the answer or E1 is not correct.
10-24-2015, 11:04 AM
Post: #2
 roadrunner Senior Member Posts: 442 Joined: Jun 2015
RE: Solve App and ABS() and IP()
Replace every instance of IP() with hIP() where hIP() is defined:

Code:
EXPORT hIP(x) BEGIN  return IP(x); END;

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.

-road
10-24-2015, 03:28 PM
Post: #3
 cclinus Junior Member Posts: 40 Joined: Oct 2015
RE: Solve App and ABS() and IP()
Hi,

It works, amazing.

Thank you very much!
10-26-2015, 06:41 AM
Post: #4
 cyrille de brĂ©bisson Senior Member Posts: 1,047 Joined: Dec 2013
RE: Solve App and ABS() and IP()
Hello,

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.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)