(Free42) roundoff for complex SQRT

02122021, 02:45 PM
Post: #21




RE: (Free42) roundoff for complex SQRT
Resurrecting this old thread ...
When X = 0+iB, SQRT(X) should have equal real and imaginary parts (apart from the sign). But that is (still) not the case. The 48G algorithm I posted gives the correct result  in the 48, with its 3 extra digits, but not in Free42. Example: 1E12 SQRT SQRT COMPLEX  equals 1E37, exactly what you get when you follow the 48G algorithm. Cheers, Werner 

02122021, 07:44 PM
Post: #22




RE: (Free42) roundoff for complex SQRT
(02122021 02:45 PM)Werner Wrote: When X = 0+iB, SQRT(X) should have equal real and imaginary parts (apart from the sign). I don't think that is something I ever tested. I implemented your algorithm in 2.0.21 and verified that it gave the desired result for 0+iB when B/2 is a perfect square... I suppose this means an explicit check for Re(X)=0 will be needed after all. 

02122021, 08:12 PM
Post: #23




RE: (Free42) roundoff for complex SQRT
according to the thread, you implemented a specific Re()=0 test?


02122021, 09:35 PM
Post: #24




RE: (Free42) roundoff for complex SQRT
That's what I was thinking of doing at first, but then you suggested the 48G algorithm, and I implemented that instead. There is no check for pure imaginary.
free42/common/core_commands6.cc Code: static int mappable_sqrt_c(phloat xre, phloat xim, phloat *yre, phloat *yim) { 

« Next Oldest  Next Newest »

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