logoalt Hacker News

burnt-resistortoday at 8:30 AM2 repliesview on HN

That's not what it simplifies to using a real or complex number domains for x, it's abs(x). CAS need type inference assumptions and/or type qualifiers to be more powerful.

Edit: Fixed stuff.


Replies

yorwbatoday at 10:21 AM

For x = -i, square(x) = -1, sqrt(square(x)) = i. Meanwhile, abs(x) = 1. You're right that it simplifies to abs(x) for real x, but that no longer holds for arbitrary complex values.

jstanleytoday at 8:56 AM

Right, that's why you need further assumptions on x in order for that simplification to hold.

show 1 reply