On Thu, 7 Mar 2019, Michael Ferguson wrote:

#include <math.h>
#include <stdio.h>

int main() {
 double y = 0x1.0p-1044;
 double cbrtX = cbrt(0x1.0p-1044);
 double cbrtY = cbrt(y);
 printf("cbrtX=%a\n", cbrtX);
 printf("cbrtY=%a\n", cbrtY);
 return 0;
}

In my experience with 'nextafter', the compile-time optimized version was wrong. Which is understandable because the compiler does not necessarily follow all the rules.

In this case, the run-time optimized version is wrong and this is the one which should have all the checks-and-balances in place.

Sooo weird.

Also, the whole idea of the standard is that the libraries should behave the same way from one machine to the other.

However, some builds end up using FMA so you get (normally) improved
accuracy. Others compute at the next highest accuracy than declared.

Regards - Damian

Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037
Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here
Views & opinions here are mine and not those of any past or present employer


_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to