Created
January 29, 2015 18:32
-
-
Save simonbyrne/d2c84417dd831dfea8fb to your computer and use it in GitHub Desktop.
try to recreate https://github.com/JuliaLang/julia/pull/9925 in C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
int main() { | |
volatile double a = 0.1; | |
volatile double x = a + 0.2; | |
printf("%.20f\n", x); | |
volatile double y = fma(a, 1.0, 0.0); | |
printf("%.20f\n", y); | |
volatile double z = y + 0.2; | |
printf("%.20f\n", z); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiled with
gcc fmatest.c -o fmatest -lm
, on GCC 4.8.2, gives: