HP Forums
Possible bug in CAS? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Possible bug in CAS? (/thread-5591.html)



Possible bug in CAS? - MrMcChicken - 01-25-2016 08:14 PM

Hello,
I am doing some really basic calculations with complex numbers. After entering some random stuff I think I found a bug.
If I enter: simplify(squareroot(x^2*y^2)) my Prime shows: -x*y.
The emulator shows: abs(x)*abs (y) which is fine.
Both run on the latest Firmware (8151).
Can somebody confirm this issue?

Greetings, MrMcChicken

Edit: It happens too with simplify(squareroot((x^4*y^4)) = -x^2*y^2


RE: Possible bug in CAS? - primer - 01-25-2016 09:24 PM

(01-25-2016 08:14 PM)MrMcChicken Wrote:  If I enter: simplify(squareroot(x^2*y^2)) my Prime shows: -x*y.
mine gives expected result : abs(x)*abs(y)


RE: Possible bug in CAS? - salvomic - 01-25-2016 09:58 PM

(01-25-2016 09:24 PM)primer Wrote:  mine gives expected result : abs(x)*abs(y)
mine also.
Please, check the CAS Settings: I've Exact, Use √, Principal, not: Complex, use i, increasing. Simplify minimum...

Salvo


RE: Possible bug in CAS? - primer - 01-25-2016 11:46 PM

(01-25-2016 09:58 PM)salvomic Wrote:  I've Exact, Use √, Principal, not: Complex, use i, increasing. Simplify minimum...
same as you : three options on left are checked (exact...)
and three ones on the right are not.

Maybe you defined an "assume" ? or something like that ?
I never remember where we can see existing assumes, but I think purge() cmd does remove all of them, check help before usage, just in case...

Regards.


RE: Possible bug in CAS? - MrMcChicken - 01-26-2016 09:13 AM

I found the source of the problem. If "use i" is checked i get -x*y as a result.
Why is this so? Is this a bug? Thanks for help so far.

Greetings, MrMcChicken


RE: Possible bug in CAS? - parisse - 01-26-2016 11:41 AM

If you set complex mode on ("use i" on the Prime), then sqrt(x^2) is no more equal to |x| and the system chooses one of the two complex square roots.
Should perhaps be somewhere in a FAQ.