\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)\sqrt{3.9999999999999997 \cdot 10^{-32}} \cdot \left(\sqrt{3.9999999999999997 \cdot 10^{-32}} \cdot \left(t \cdot t\right)\right)double f(double t) {
double r18153955 = 1.0;
double r18153956 = t;
double r18153957 = 2e-16;
double r18153958 = r18153956 * r18153957;
double r18153959 = r18153955 + r18153958;
double r18153960 = r18153959 * r18153959;
double r18153961 = -1.0;
double r18153962 = 2.0;
double r18153963 = r18153962 * r18153958;
double r18153964 = r18153961 - r18153963;
double r18153965 = r18153960 + r18153964;
return r18153965;
}
double f(double t) {
double r18153966 = 3.9999999999999997e-32;
double r18153967 = sqrt(r18153966);
double r18153968 = t;
double r18153969 = r18153968 * r18153968;
double r18153970 = r18153967 * r18153969;
double r18153971 = r18153967 * r18153970;
return r18153971;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.4 |
Initial program 61.8
Simplified50.3
Taylor expanded around 0 0.3
Simplified0.3
rmApplied add-sqr-sqrt0.3
Applied associate-*r*0.4
Final simplification0.4
herbie shell --seed 2019112 +o rules:numerics
(FPCore (t)
:name "fma_test1"
: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)))))