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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 10.7 |
|---|---|
| Target | 1.4 |
| Herbie | 0.3 |
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0Initial program 64.0
Simplified0.1
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 5.4138140960026674e297Initial program 0.2
Simplified1.8
Taylor expanded in y around 0 0.2
Applied associate-/l*_binary640.4
if 5.4138140960026674e297 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 62.7
Simplified0.4
Taylor expanded in y around 0 62.7
Applied add-cube-cbrt_binary6462.7
Applied times-frac_binary6427.1
Applied associate-/l*_binary641.4
Applied div-inv_binary641.4
Applied associate-*l*_binary641.1
Simplified0.4
Final simplification0.3
herbie shell --seed 2021340
(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))))