And does using:
(-1,0)*(-5,0)*(1,0)*(-1,0)
make any difference? Is it a problem with taking the real numbers and turning them into complex pairs?
Sorry, I wasn't writing exactly. The actual code is: a = 1, b = -5, g = 1, h = -1, j = 1/6 z = (-a*b*g*h)^j ; the expression in question ; -a*g*h = 1, so z =b^j [i.e. -5 ^(1/6)] z2 = b^j ; correct answer The calculation of z gives a different result than the calculation of z2. I instrumented the dStkPwr function in parser.c, and ran fractint with debug=90. I verified that the argment (-5,0) is the same when the StkPwr function is called in both cases. I don't mean to re-open this discussion (but I guess I have :-) because I have figured out almost everything about this problem. If you trace further down stream, the (-5,0) argument gets into ComplexPower() in mpmath_c.c, and then FPUcplxlog(&xx, &cLog); This is the function that returns different results. The (-5,0) argument lies on a discontinuity of the Log function which explains most of the mysterious behavior. The only thing I can't explain is why FPUcplxlog() returns different values with the identical argument (both results are "correct" mathematically). I am not suggesting this is worth a further look by you. But if it interests you enough to look further, go ahead. If you want the complete example, let me know. I have seen similar behavior with and without debug=90 and with Xfractint. However, if I replace the FPUcplxlog call in ComplexPower with a hand-coded Log (same code as in Xfractint) the symptoms go away. The two values returned by Log are both correct (or very very nearly so) - the mystery is only what is causing different answers. Tim