\left(1 + t \cdot 2 \cdot 10^{-16}\right) \cdot \left(1 + t \cdot 2 \cdot 10^{-16}\right) + \left(-1 - 2 \cdot \left(t \cdot 2 \cdot 10^{-16}\right)\right)\left(t \cdot \left(t \cdot {\left(\sqrt{3.9999999999999997 \cdot 10^{-32}}\right)}^{1.5}\right)\right) \cdot \sqrt{\sqrt{3.9999999999999997 \cdot 10^{-32}}}double code(double t) {
return ((double) (((double) (((double) (1.0 + ((double) (t * 2e-16)))) * ((double) (1.0 + ((double) (t * 2e-16)))))) + ((double) (-1.0 - ((double) (2.0 * ((double) (t * 2e-16))))))));
}
double code(double t) {
return ((double) (((double) (t * ((double) (t * ((double) pow(((double) sqrt(3.9999999999999997e-32)), 1.5)))))) * ((double) sqrt(((double) sqrt(3.9999999999999997e-32))))));
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.5 |
| Herbie | 0.4 |
Initial program 61.8
Taylor expanded around 0 0.4
Simplified0.3
rmApplied associate-*r*0.4
rmApplied add-sqr-sqrt0.4
Applied associate-*r*0.4
Simplified0.3
rmApplied add-sqr-sqrt0.3
Applied sqrt-prod0.3
Applied associate-*r*0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2020196
(FPCore (t)
:name "fma_test1"
:precision binary64
: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)))))