x + y \cdot \frac{z - t}{z - a}\begin{array}{l}
\mathbf{if}\;z \le -7.0231454598615249 \cdot 10^{-277}:\\
\;\;\;\;\frac{y}{\frac{z - a}{z - t}} + x\\
\mathbf{elif}\;z \le 2.80308765864311706 \cdot 10^{-161}:\\
\;\;\;\;\frac{y}{z - a} \cdot \left(z - t\right) + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)\\
\end{array}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 VAR;
if ((z <= -7.023145459861525e-277)) {
VAR = ((y / ((z - a) / (z - t))) + x);
} else {
double VAR_1;
if ((z <= 2.803087658643117e-161)) {
VAR_1 = (((y / (z - a)) * (z - t)) + x);
} else {
VAR_1 = fma(y, ((z - t) / (z - a)), 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 | 1.5 |
|---|---|
| Target | 1.4 |
| Herbie | 1.3 |
if z < -7.023145459861525e-277Initial program 1.4
Simplified1.4
rmApplied clear-num1.4
rmApplied fma-udef1.4
Simplified1.2
if -7.023145459861525e-277 < z < 2.803087658643117e-161Initial program 4.5
Simplified4.5
rmApplied clear-num4.6
rmApplied fma-udef4.6
Simplified4.2
rmApplied associate-/r/3.2
if 2.803087658643117e-161 < z Initial program 0.7
Simplified0.7
Final simplification1.3
herbie shell --seed 2020103 +o rules:numerics
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))