x + y \cdot \frac{z - t}{a - t}\begin{array}{l}
\mathbf{if}\;y \le -1.6662664711442952 \cdot 10^{-34} \lor \neg \left(y \le 1.9897176974016923 \cdot 10^{-212}\right):\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t} - \frac{1}{\frac{z - t}{t}}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{a - t} \cdot \left(y \cdot \left(z - t\right)\right)\\
\end{array}double code(double x, double y, double z, double t, double a) {
return (x + (y * ((z - t) / (a - t))));
}
double code(double x, double y, double z, double t, double a) {
double temp;
if (((y <= -1.6662664711442952e-34) || !(y <= 1.9897176974016923e-212))) {
temp = (x + (y / ((a / (z - t)) - (1.0 / ((z - t) / t)))));
} else {
temp = (x + ((1.0 / (a - t)) * (y * (z - t))));
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 1.4 |
|---|---|
| Target | 0.5 |
| Herbie | 0.8 |
if y < -1.6662664711442952e-34 or 1.9897176974016923e-212 < y Initial program 0.9
rmApplied clear-num1.0
Applied un-div-inv0.9
rmApplied div-sub0.9
rmApplied clear-num0.9
if -1.6662664711442952e-34 < y < 1.9897176974016923e-212Initial program 2.5
rmApplied clear-num2.5
Applied un-div-inv2.3
rmApplied div-inv2.3
Applied *-un-lft-identity2.3
Applied times-frac0.5
Simplified0.4
Final simplification0.8
herbie shell --seed 2020066 +o rules:numerics
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))