\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(3.9999999999999997 \cdot 10^{-32} \cdot \left(3.9999999999999997 \cdot 10^{-32} \cdot {t}^{4}\right)\right)}^{\frac{1}{2}}double f(double t) {
double r58033 = 1.0;
double r58034 = t;
double r58035 = 2e-16;
double r58036 = r58034 * r58035;
double r58037 = r58033 + r58036;
double r58038 = r58037 * r58037;
double r58039 = -1.0;
double r58040 = 2.0;
double r58041 = r58040 * r58036;
double r58042 = r58039 - r58041;
double r58043 = r58038 + r58042;
return r58043;
}
double f(double t) {
double r58044 = 3.9999999999999997e-32;
double r58045 = t;
double r58046 = 4.0;
double r58047 = pow(r58045, r58046);
double r58048 = r58044 * r58047;
double r58049 = r58044 * r58048;
double r58050 = 0.5;
double r58051 = pow(r58049, r58050);
return r58051;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.3 |
Initial program 61.8
Taylor expanded around 0 0.4
rmApplied add-sqr-sqrt0.4
Applied add-sqr-sqrt0.4
Applied unswap-sqr0.4
rmApplied pow1/20.4
Applied pow1/20.4
Applied pow-prod-down0.4
Applied pow1/20.4
Applied pow1/20.4
Applied pow-prod-down0.6
Applied pow-prod-down0.4
Simplified0.3
Final simplification0.3
herbie shell --seed 2020034
(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)))))