x + \frac{y \cdot \left(z - t\right)}{z - a}\begin{array}{l}
\mathbf{if}\;y \leq -1.0867585865650249 \cdot 10^{+71}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z - a}\\
\mathbf{elif}\;y \leq 1.5516949149729753 \cdot 10^{-09}:\\
\;\;\;\;\left(x + \frac{y \cdot z}{z - a}\right) - \frac{y \cdot t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{1}{\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 -1.0867585865650249e+71)
(+ x (* y (/ (- z t) (- z a))))
(if (<= y 1.5516949149729753e-09)
(- (+ x (/ (* y z) (- z a))) (/ (* y t) (- z a)))
(+ x (/ y (/ 1.0 (/ (- 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 <= -1.0867585865650249e+71) {
tmp = x + (y * ((z - t) / (z - a)));
} else if (y <= 1.5516949149729753e-09) {
tmp = (x + ((y * z) / (z - a))) - ((y * t) / (z - a));
} else {
tmp = x + (y / (1.0 / ((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 | 10.9 |
|---|---|
| Target | 1.1 |
| Herbie | 0.8 |
if y < -1.0867585865650249e71Initial program 29.4
rmApplied *-un-lft-identity_binary64_1371829.4
Applied times-frac_binary64_137240.5
Simplified0.5
if -1.0867585865650249e71 < y < 1.5516949149729753e-9Initial program 1.1
Taylor expanded around 0 1.1
if 1.5516949149729753e-9 < y Initial program 21.7
rmApplied associate-/l*_binary64_136630.3
rmApplied clear-num_binary64_137170.4
Final simplification0.8
herbie shell --seed 2021093
(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))))