x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
t_1 := x + \frac{y}{\frac{a - t}{z - t}}\\
\mathbf{if}\;y \leq -4.292063565913367 \cdot 10^{-41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.3766154638147954 \cdot 10^{-20}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ y (/ (- a t) (- z t))))))
(if (<= y -4.292063565913367e-41)
t_1
(if (<= y 5.3766154638147954e-20) (+ x (/ (* y (- z t)) (- a t))) t_1))))double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / ((a - t) / (z - t)));
double tmp;
if (y <= -4.292063565913367e-41) {
tmp = t_1;
} else if (y <= 5.3766154638147954e-20) {
tmp = x + ((y * (z - t)) / (a - t));
} else {
tmp = t_1;
}
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.8 |
|---|---|
| Target | 1.3 |
| Herbie | 0.4 |
if y < -4.2920635659133672e-41 or 5.3766154638147954e-20 < y Initial program 21.0
Applied associate-/l*_binary640.6
if -4.2920635659133672e-41 < y < 5.3766154638147954e-20Initial program 0.3
Final simplification0.4
herbie shell --seed 2022097
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))