\left(1 + t \cdot 1.999999999999999958195573448069207123682 \cdot 10^{-16}\right) \cdot \left(1 + t \cdot 1.999999999999999958195573448069207123682 \cdot 10^{-16}\right) + \left(-1 - 2 \cdot \left(t \cdot 1.999999999999999958195573448069207123682 \cdot 10^{-16}\right)\right)3.999999999999999676487027278085939408227 \cdot 10^{-32} \cdot \left(t \cdot t\right)double f(double t) {
double r3716938 = 1.0;
double r3716939 = t;
double r3716940 = 2e-16;
double r3716941 = r3716939 * r3716940;
double r3716942 = r3716938 + r3716941;
double r3716943 = r3716942 * r3716942;
double r3716944 = -1.0;
double r3716945 = 2.0;
double r3716946 = r3716945 * r3716941;
double r3716947 = r3716944 - r3716946;
double r3716948 = r3716943 + r3716947;
return r3716948;
}
double f(double t) {
double r3716949 = 3.9999999999999997e-32;
double r3716950 = t;
double r3716951 = r3716950 * r3716950;
double r3716952 = r3716949 * r3716951;
return r3716952;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.4 |
Initial program 61.8
Simplified50.6
Taylor expanded around 0 0.4
Simplified0.3
rmApplied add-sqr-sqrt0.6
Taylor expanded around 0 0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2019171 +o rules:numerics
(FPCore (t)
:name "fma_test1"
:pre (<= 0.9 t 1.1)
:herbie-target
(fma (+ 1.0 (* t 2e-16)) (+ 1.0 (* t 2e-16)) (- -1.0 (* 2.0 (* t 2e-16))))
(+ (* (+ 1.0 (* t 2e-16)) (+ 1.0 (* t 2e-16))) (- -1.0 (* 2.0 (* t 2e-16)))))