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 -2.5690390576883054 \cdot 10^{+262}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{1}{\frac{z - a}{z - t}}, x\right)\\
\mathbf{elif}\;t_1 \leq 3.850864673207466 \cdot 10^{+236}:\\
\;\;\;\;t_1 + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \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
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (<= t_1 -2.5690390576883054e+262)
(fma y (/ 1.0 (/ (- z a) (- z t))) x)
(if (<= t_1 3.850864673207466e+236)
(+ t_1 x)
(+ x (* y (/ (- 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 t_1 = (y * (z - t)) / (z - a);
double tmp;
if (t_1 <= -2.5690390576883054e+262) {
tmp = fma(y, (1.0 / ((z - a) / (z - t))), x);
} else if (t_1 <= 3.850864673207466e+236) {
tmp = t_1 + x;
} else {
tmp = x + (y * ((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
| Original | 11.0 |
|---|---|
| Target | 1.3 |
| Herbie | 0.4 |
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -2.5690390576883054e262Initial program 57.4
Simplified1.0
Applied clear-num_binary641.1
if -2.5690390576883054e262 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 3.8508646732074662e236Initial program 0.2
if 3.8508646732074662e236 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 54.1
Simplified1.8
Applied fma-udef_binary641.8
Final simplification0.4
herbie shell --seed 2022125
(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))))