Tim Wegner wrote:
1. The "bug" is not a bug!!! 2. Fractint is cleared of the unjust accusation! The
verdict: INNOCENT! An interesting and entertaining analysis, Tim! But hang on just one minute!!!! We agree that log(x+iy) = (1/2)log(x^2 + y^2) + i(atan2(y,x) + 2kPi) (I'll use "atan2(y,x)" because it's less ambiguous) It's standard practice in mathematical libraries that when a single-valued result is required, the "principal value" is returned, which in this case is to set k=0. (aka "2*PI normalisation"). So for everyday single-valued use, the formula becomes log(x+iy) = (1/2)log(x^2 + y^2) + i * atan2(y,x)
log(-5.0, 0.0) The assembler log function gives: (1.6094379124341,-PI) Coding by hand in C gives: (1.6094379124341, PI) BOTH ANSWERS ARE RIGHT!!! The imaginary parts differ by 2*PI, which is acceptable.
I'm sorry, I can't agree! atan2(0,-5) is (by ANSI definition), +PI. A value of -PI is of course "correct", but not the "principal value". It corresponds to selecting k = -1 in the log function, a strange choice indeed. And I've plotted log(-5) with (in both int and float modes) in Fractint using that plotting formula, and it gives the right answer in both cases!
Jim's fatal mistake was when he assumed that, given a = 1, b = -5, g = 1, h = -1 that (-a*b*g*h) is -5. Yes, it's very close to -5
In 30 years of programming, I've yet to come across a system that does not produce EXACTLY -5 from these values. So, IMHO, Fracint does have a problem, and as far as I can see, the POWER operator is still under suspicion. Ball's in your court, Tim! Cheers Jim White __________________________________________________ Yahoo! Plus - For a better Internet experience http://uk.promotions.yahoo.com/yplus/yoffer.html