Revert "std.math: proper support for 64-bit real in exp()"#3483
Revert "std.math: proper support for 64-bit real in exp()"#3483
Conversation
There was a problem hiding this comment.
To re-cap what I've already raised - for the third time.
This line is not using the RealFormat enum, it should be F.realFormat == RealFormat.ieeeExtended, likewise the static if below too (F.realFormat == RealFormat.ieeeDouble)
There was a problem hiding this comment.
Don't you think performing these 2 changes in a proper commit would be just as much work as this revert+description?
There was a problem hiding this comment.
I raised a PR 1 month ago. (#3388) - no one responded.
|
Revert of fix (#3514), your decision. |
|
Is this PR still necessary? I don't understand the code enough to tell. |
|
The |
Compile with |
|
I still get |
|
@kinke - How does |
|
BTW: The limits/values I have for The first two shouldn't make a difference, as the 80-bit literals should round correctly to them. |
|
The 2 latter literals make a difference for me - I get 0 when using them. ;) I don't know how you handle the details in GDC with |
Yes, you are correct! That serves me right from assuming the documentation is correct. :-D Actual limits for Sorry about that. |
Yes, I seem to have forgotten that we are talking about |
Should be identical to using |
|
Yep, ARM results would be nice (for both GDC and LDC). But I'm pretty sure ...4 is correct, given that MS returns it too. I'm just wondering where the divergence comes from (still present with your actual constants). |
|
bool feqrel(T)(T a, T b, int maxDifferingBits);would be more convenient. Edit: Oh This also means that the test would currently pass on Win64 LDC anyway when using |
Yeah, just making sure that it's not a value that's out of bounds from what it is meant to handle. I'll see if I have an ARM virtual machine lingering around... |
|
I needed to apply #3386 ARM passes the tests. Hmm... |
Why not? If it returns ...4 instead of the expected ...3, feqrel() returns 51 = real.mant_dig - 2, and the assert isn't triggered. |
The 'hmmm' was because on x86 using doubles it asserts. Using x86 with reals asserts for me too, I'll get a full report table going on the matter. |
|
After some more testing, it seems that Oh well, here's the
|
|
So the only minor divergences of your ARM results from my Win64 results are for
How can that be? So you only changed the return type from real to double, casting the 80-bit result down to 64-bit? I'll create a table for LDC (x86 Win64 with 64-bit reals, and x86 Linux with 80-bit reals) too once I'm home. Also note that libm's |
No, by using the 64-bit branch explicitly. |
Correct. GDC don't do DMD-style inline assembly. I'm testing the generic version, which shows that we can only guarantee double precision in the near overflow/underflow tests. |
|
I'm pretty sure it's the other way around: the expected values for 80-bit reals seem crappy. If using DMD-style inline assembly, |
|
It's probably obvious to you anyway, but I'd not trust the |
|
LDC results for
|
|
Updated my table with results for libm tests (slash GCC builtins). |
OK, so my ARM tests, libm, and llvm intrinsics all seem to agree on this. So shall we just alter the expected value to |
|
Yep, perfectly fine with that. But more importantly, what about the 80-bit reference results? There's 2 options:
The latter will probably result in more failing assertions. And obviously require your pull for the IEEE flags. |
Well, what I read from it is that it's not clear how accurate the x87 test/expected pairs are. If libm disagrees with a divergence of up to 13 mantissa bits, maybe they are just plain wrong? |
Of course they are. I bet they've just been obtained by running the current implementation, which multiplies the value and feeds |
Actually, what's the result of feqrel with |
|
I've replied to your new pull. Given the diff of one subnormal unit, feqrel() returns |
|
I have raised a new bug: https://issues.dlang.org/show_bug.cgi?id=15365 So I guess this is good for closure. |
Reverts #3285
Because no one has responded to any of my complaints or concerns for over a month. @kinke @WalterBright @MartinNowak