x + y \cdot \frac{z - t}{z - a}\begin{array}{l}
\mathbf{if}\;y \leq -6.850122719949887 \cdot 10^{-23}:\\
\;\;\;\;x + y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)\\
\mathbf{elif}\;y \leq 1.3883953432163486 \cdot 10^{-108}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{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 -6.850122719949887e-23)
(+ x (* y (- (/ z (- z a)) (/ t (- z a)))))
(if (<= y 1.3883953432163486e-108)
(+ x (/ (* y (- z t)) (- z a)))
(+ x (* (- z t) (/ y (- 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 <= -6.850122719949887e-23) {
tmp = x + (y * ((z / (z - a)) - (t / (z - a))));
} else if (y <= 1.3883953432163486e-108) {
tmp = x + ((y * (z - t)) / (z - a));
} else {
tmp = x + ((z - t) * (y / (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.3 |
|---|---|
| Target | 1.2 |
| Herbie | 1.1 |
if y < -6.85012271994988688e-23Initial program 0.6
rmApplied div-sub_binary64_176060.6
if -6.85012271994988688e-23 < y < 1.3883953432163486e-108Initial program 2.2
rmApplied associate-*r/_binary64_175450.3
if 1.3883953432163486e-108 < y Initial program 0.7
rmApplied div-sub_binary64_176060.7
rmApplied div-inv_binary64_175980.7
Applied div-inv_binary64_175980.7
Applied distribute-rgt-out--_binary64_175570.7
Applied associate-*r*_binary64_175432.6
Simplified2.5
Final simplification1.1
herbie shell --seed 2020281
(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)))))