# HP Forums

Full Version: Possible bug in CAS?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
(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)
(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
(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.
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
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.
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :