Jonathan, I thought I understood the "conjbug", but I discovered I don't completely. I am convinced that it is no big deal, but I don't understand why FPUcplxlog() is not behaving deterministically. When (-5,0) is passed to ComplexPower() in mpmath_c.c, sometimes the imaginary part is PI and sometimes -PI. As I explained elsewhere, the -5 argument is right on the edge of a discontinuity, so these two values aren't really different, but since I have verified that the argument is EXACTLY the same in both cases, I don't see why the same result is not returned. I'll try to make a little test case that duplicates the problem. I wonder if there could be some FPU status flag that gets set by some multiplies that happen first in one case but not the other. I'll try to make a little test program that illustrates the problem. If you have a chance, look at FPUcplxlog and tell me if you see anything suspect in the logic that determines the sign of the imaginary component. Tim
On Saturday 31 May 2003 12:46 am, Tim Wegner wrote:
Jonathan, I thought I understood the "conjbug", but I discovered I don't completely. I am convinced that it is no big deal, but I don't understand why FPUcplxlog() is not behaving deterministically.
When (-5,0) is passed to ComplexPower() in mpmath_c.c, sometimes the imaginary part is PI and sometimes -PI. As I explained elsewhere, the -5 argument is right on the edge of a discontinuity, so these two values aren't really different, but since I have verified that the argument is EXACTLY the same in both cases, I don't see why the same result is not returned.
I'll try to make a little test case that duplicates the problem. I wonder if there could be some FPU status flag that gets set by some multiplies that happen first in one case but not the other.
I'll try to make a little test program that illustrates the problem. If you have a chance, look at FPUcplxlog and tell me if you see anything suspect in the logic that determines the sign of the imaginary component.
A brief look didn't turn up anything (as expected). I'll look at it later this afternoon, after I return from a trip to the Kankakee library. We only set the rounding flag in a few instances, and always set it back when we are done (in the assembly code). Does using debugflag=90 make any difference? Jonathan
We only set the rounding flag in a few instances, and always set it back when we are done (in the assembly code). Does using debugflag=90 make any difference?
I have to use debug=90 in order to instrument the code. Otherwise ComplexPower() in mpmath_c.c is not called. Otherwise I would have to debug the assembler directly. However, I don't think this is a fruitful line of investigation, because we can see this phenomenon in many different circumstances, even completely different code in Xfractint. So even though there are things I don't understand (e.g. at least one example of an assembler routine that returns different results at different times with the identical inputs), this really isn't a big deal, since I KNOW the math is such that any bit being different will push the function over to a very different value. Tim
participants (2)
-
Jonathan Osuch -
Tim Wegner