\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)\left(t \cdot \left(t \cdot \sqrt{3.999999999999999676487027278085939408227 \cdot 10^{-32}}\right)\right) \cdot \sqrt{3.999999999999999676487027278085939408227 \cdot 10^{-32}}double f(double t) {
double r56962 = 1.0;
double r56963 = t;
double r56964 = 2e-16;
double r56965 = r56963 * r56964;
double r56966 = r56962 + r56965;
double r56967 = r56966 * r56966;
double r56968 = -1.0;
double r56969 = 2.0;
double r56970 = r56969 * r56965;
double r56971 = r56968 - r56970;
double r56972 = r56967 + r56971;
return r56972;
}
double f(double t) {
double r56973 = t;
double r56974 = 3.9999999999999997e-32;
double r56975 = sqrt(r56974);
double r56976 = r56973 * r56975;
double r56977 = r56973 * r56976;
double r56978 = r56977 * r56975;
return r56978;
}




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