x + \frac{y \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;y \le -1.67441263003196253 \cdot 10^{-50} \lor \neg \left(y \le 1.8254784728229986 \cdot 10^{-242}\right):\\
\;\;\;\;\frac{z - t}{a - t} \cdot y + x\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(z - t\right) \cdot y}{a - t} + x\\
\end{array}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 temp;
if (((y <= -1.6744126300319625e-50) || !(y <= 1.8254784728229986e-242))) {
temp = ((((z - t) / (a - t)) * y) + x);
} else {
temp = ((((z - t) * y) / (a - t)) + x);
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 10.9 |
|---|---|
| Target | 1.4 |
| Herbie | 0.8 |
if y < -1.6744126300319625e-50 or 1.8254784728229986e-242 < y Initial program 15.1
Simplified2.7
rmApplied clear-num2.9
rmApplied fma-udef2.9
Simplified2.6
rmApplied associate-/r/0.9
if -1.6744126300319625e-50 < y < 1.8254784728229986e-242Initial program 0.4
Simplified3.6
rmApplied clear-num3.9
rmApplied fma-udef3.9
Simplified3.9
rmApplied associate-/r/2.9
rmApplied associate-*l/0.4
Final simplification0.8
herbie shell --seed 2020058 +o rules:numerics
(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))))