x + \frac{y \cdot \left(z - t\right)}{z - a}\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{z - a} \le -6.848064445188812 \cdot 10^{179}:\\
\;\;\;\;\mathsf{fma}\left(\left(z - t\right) \cdot \frac{1}{z - a}, y, x\right)\\
\mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{z - a} \le 3.25382333353132745 \cdot 10^{246}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{z - a}, y, x\right)\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (x + ((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a))))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a)))) <= -6.848064445188812e+179)) {
VAR = ((double) fma(((double) (((double) (z - t)) * ((double) (1.0 / ((double) (z - a)))))), y, x));
} else {
double VAR_1;
if ((((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a)))) <= 3.2538233335313274e+246)) {
VAR_1 = ((double) (x + ((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a))))));
} else {
VAR_1 = ((double) fma(((double) (((double) (z - t)) / ((double) (z - a)))), y, x));
}
VAR = VAR_1;
}
return VAR;
}




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.2 |
| Herbie | 0.7 |
if (/ (* y (- z t)) (- z a)) < -6.848064445188812e+179Initial program 44.9
Simplified3.9
rmApplied clear-num4.0
rmApplied fma-udef4.0
Simplified3.6
rmApplied associate-/r/3.0
Applied fma-def3.0
rmApplied div-inv3.1
if -6.848064445188812e+179 < (/ (* y (- z t)) (- z a)) < 3.2538233335313274e+246Initial program 0.3
if 3.2538233335313274e+246 < (/ (* y (- z t)) (- z a)) Initial program 55.0
Simplified2.3
rmApplied clear-num2.5
rmApplied fma-udef2.5
Simplified2.1
rmApplied associate-/r/1.5
Applied fma-def1.5
Final simplification0.7
herbie shell --seed 2020123 +o rules:numerics
(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))))