x + y \cdot \frac{z - t}{z - a}\begin{array}{l}
\mathbf{if}\;y \leq -3.2104700123273477 \cdot 10^{-99}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\
\mathbf{elif}\;y \leq 4.588785361859496 \cdot 10^{-172}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z - a}\\
\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.2104700123273477e-99)
(+ x (/ y (/ (- z a) (- z t))))
(if (<= y 4.588785361859496e-172)
(+ x (/ (* y (- z t)) (- z a)))
(+ x (* y (/ (- z t) (- z a)))))))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.2104700123273477e-99) {
tmp = x + (y / ((z - a) / (z - t)));
} else if (y <= 4.588785361859496e-172) {
tmp = x + ((y * (z - t)) / (z - a));
} else {
tmp = x + (y * ((z - t) / (z - a)));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 1.2 |
|---|---|
| Target | 1.1 |
| Herbie | 0.7 |
if y < -3.21047001232734775e-99Initial program 0.6
rmApplied associate-*r/_binary64_1586016.7
rmApplied associate-/l*_binary64_158630.6
if -3.21047001232734775e-99 < y < 4.58878536185949592e-172Initial program 2.3
rmApplied associate-*r/_binary64_158600.6
if 4.58878536185949592e-172 < y Initial program 0.9
Final simplification0.7
herbie shell --seed 2020292
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))