Post Reply 
(Free42) roundoff for complex SQRT
04-04-2018, 07:11 AM
Post: #6
RE: (Free42) roundoff for complex SQRT
This is the algorithm for complex square root as used in the 48G and up - it's probably the same as in the 42S:

Code:
*   Let R = SQRT(X^2+Y^2), A = SQRT((R+ABS(X))/2), B = Y/(2*A)
*       Then
*                     { (0,0)                   (X,Y) = (0,0)
*       SQRT((X,Y)) = { (A,B)                   X >= 0
*                     { (ABS(B), SIGN(B)*A)     X < 0

So no exception needs to be made for X=0 to get exact results for Y/2 being a perfect square.
BTW the 42S is bound to exhibit less roundoff errors (meaning, exact results where possible) as all functions are computed using higher internal precision - what Free42 does not do. But in this case, it can be avoided ;-)

Cheers, Werner
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (Free42) roundoff for complex SQRT - Werner - 04-04-2018 07:11 AM



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