\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)\sqrt{3.999999999999999676487027278085939408227 \cdot 10^{-32}} \cdot \left(t \cdot \left(t \cdot \sqrt{3.999999999999999676487027278085939408227 \cdot 10^{-32}}\right)\right)double f(double t) {
double r3345378 = 1.0;
double r3345379 = t;
double r3345380 = 2e-16;
double r3345381 = r3345379 * r3345380;
double r3345382 = r3345378 + r3345381;
double r3345383 = r3345382 * r3345382;
double r3345384 = -1.0;
double r3345385 = 2.0;
double r3345386 = r3345385 * r3345381;
double r3345387 = r3345384 - r3345386;
double r3345388 = r3345383 + r3345387;
return r3345388;
}
double f(double t) {
double r3345389 = 3.9999999999999997e-32;
double r3345390 = sqrt(r3345389);
double r3345391 = t;
double r3345392 = r3345391 * r3345390;
double r3345393 = r3345391 * r3345392;
double r3345394 = r3345390 * r3345393;
return r3345394;
}




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.4
Simplified0.4
rmApplied add-sqr-sqrt0.4
Applied associate-*l*0.4
rmApplied associate-*r*0.3
Final simplification0.3
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)))))