#825 complex sqrt not accurate

closed
nobody
Lisp Core (471)
5
2006-01-06
2005-11-30
Raymond Toy
No

Complex sqrt is not accurate:

(%i38) display2d:false;

(%o38) false
(%i39) fpprec;

(%o39) 16
(%i40) rectform(sqrt(1b0+%i*1b-5)),bfloat;

(%o40) 5.000000206850923b-6*%i+1.0000000000125b0
(%i41) rectform(sqrt(1d0+%i*1d-5)),numer;

(%o41) 4.9999999999375005e-6*%i+1.0000000000125
(%i42) :lisp (sqrt #c(1d0 1d-5))

#C(1.0000000000125 4.9999999999375e-6)

%o41 and %o42 are more accurate.

Discussion

  • Raymond Toy

    Raymond Toy - 2006-01-06
    • status: open --> closed
     
  • Raymond Toy

    Raymond Toy - 2006-01-06

    Logged In: YES
    user_id=28849

    Fixed in CVS:

    (%i24) sqrt(1b0+%i*1b-5);
    (%o24) 4.9999999999375b-6 %i + 1.0000000000125b0

     

Log in to post a comment.