x + \frac{y \cdot \left(z - t\right)}{z - a}\begin{array}{l}
\mathbf{if}\;y \leq -3.448631571517119 \cdot 10^{-115}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z - a}\\
\mathbf{elif}\;y \leq 1.4127159396366662 \cdot 10^{-101}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\
\end{array}(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
(FPCore (x y z t a)
:precision binary64
(if (<= y -3.448631571517119e-115)
(+ x (* y (/ (- z t) (- z a))))
(if (<= y 1.4127159396366662e-101)
(+ x (* (* y (- z t)) (/ 1.0 (- z a))))
(+ x (/ y (/ (- z a) (- z t)))))))double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.448631571517119e-115) {
tmp = x + (y * ((z - t) / (z - a)));
} else if (y <= 1.4127159396366662e-101) {
tmp = x + ((y * (z - t)) * (1.0 / (z - a)));
} else {
tmp = x + (y / ((z - a) / (z - t)));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 10.6 |
|---|---|
| Target | 1.4 |
| Herbie | 0.7 |
if y < -3.4486315715171189e-115Initial program 16.8
rmApplied *-un-lft-identity_binary64_1693516.8
Applied times-frac_binary64_169410.8
Simplified0.8
if -3.4486315715171189e-115 < y < 1.41271593963666615e-101Initial program 0.3
rmApplied div-inv_binary64_169320.3
if 1.41271593963666615e-101 < y Initial program 16.0
rmApplied associate-/l*_binary64_168800.9
Final simplification0.7
herbie shell --seed 2020277
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))