As I understand it, you have a software implementation of a transcendental function, such as sin (x), expressed in terms of standard IEEE operations, such as adding and multiplying with a floating point, and you want to make sure that you get the same answer to all machines ( or at least all the cars you care about).
-, : . . IBM IEEE . , IEEEE, FP.
, , , IEEE. , NaNs, NaNs IEEE 754-1985, : HP MIPS, vedrsus . 1
, ?
(1) . , . ( , .) FP. , , , parallelism, FP .
(2) , .
. 32 64 ( C 64- "", Intel x86/x87 80 64 32 . 1 , x86/x87 80 64 , . , , , 32 64 , 80 x87.
(, x86 SSE FP, Intel x87 FP (, () 64 , 80 , , , , , ))
. , underflow . , " ". : , , . . IEEE FORMATS, IEEE ( ). druther IEEE denorms, , .
(3) , ioptions. Older C "" (64-), . , .
(4) :
, ( FP-)
,
double a = ...;
double b = ...;
double c = a *b;
double d = ...;
double e = a*d;
double f = c + e;
f = (a*b) + (a*c);
f = a*(b+c);
, .
, . IEEE - . IEEE FP, .
. , . : ....
(2) , - . , , FP.
, , sin.
, .
, . . gcc:
-ffp-contract = off --- disable fused multiply add, .
-fexcess precision = standard --- Intel x86/x87
-std = c99 --- C. , , google
, , -funsafe-math -fassociativbe-math