x + \frac{y \cdot \left(z - t\right)}{z - a}\begin{array}{l}
\mathbf{if}\;y \leq -5.4288497895092806 \cdot 10^{+17}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z - a}\\
\mathbf{elif}\;y \leq 1.63191112146173 \cdot 10^{-35}:\\
\;\;\;\;x + \frac{y \cdot z - y \cdot t}{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 -5.4288497895092806e+17)
(+ x (* y (/ (- z t) (- z a))))
(if (<= y 1.63191112146173e-35)
(+ x (/ (- (* y z) (* y 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 <= -5.4288497895092806e+17) {
tmp = x + (y * ((z - t) / (z - a)));
} else if (y <= 1.63191112146173e-35) {
tmp = x + (((y * z) - (y * 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 | 11.1 |
|---|---|
| Target | 1.2 |
| Herbie | 0.4 |
if y < -542884978950928064 or 1.63191112146173009e-35 < y Initial program 22.8
rmApplied *-un-lft-identity_binary6422.8
Applied times-frac_binary640.4
Simplified0.4
if -542884978950928064 < y < 1.63191112146173009e-35Initial program 0.4
rmApplied sub-neg_binary640.4
Applied distribute-rgt-in_binary640.4
Simplified0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2020273
(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))))