x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a - t}, x\right)\\
\mathbf{elif}\;t_1 \leq -6.911634280618228 \cdot 10^{-289}:\\
\;\;\;\;t_1 + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{1}{\frac{a - t}{z - t}}, x\right)\\
\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 (/ (* y (- z t)) (- a t))))
(if (<= t_1 (- INFINITY))
(fma y (/ (- z t) (- a t)) x)
(if (<= t_1 -6.911634280618228e-289)
(+ t_1 x)
(fma y (/ 1.0 (/ (- a t) (- z t))) x)))))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 = (y * (z - t)) / (a - t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma(y, ((z - t) / (a - t)), x);
} else if (t_1 <= -6.911634280618228e-289) {
tmp = t_1 + x;
} else {
tmp = fma(y, (1.0 / ((a - t) / (z - t))), x);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 10.3 |
|---|---|
| Target | 1.2 |
| Herbie | 0.7 |
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -inf.0Initial program 64.0
Simplified0.1
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -6.9116342806182276e-289Initial program 0.1
Simplified2.0
Taylor expanded in y around 0 0.1
Simplified3.5
Applied *-un-lft-identity_binary643.5
Applied associate-*l*_binary643.5
Simplified0.1
if -6.9116342806182276e-289 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 9.1
Simplified1.0
Applied clear-num_binary641.1
Final simplification0.7
herbie shell --seed 2022077
(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))))