x + \frac{y \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;y \le -2.7620314914513706 \cdot 10^{-14} \lor \neg \left(y \le 3.8207927840147822 \cdot 10^{-149}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)\\
\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 <= -2.7620314914513706e-14) || !(y <= 3.820792784014782e-149))) {
temp = fma((y / (a - t)), (z - t), 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.8 |
|---|---|
| Target | 1.3 |
| Herbie | 1.8 |
if y < -2.7620314914513706e-14 or 3.820792784014782e-149 < y Initial program 17.6
Simplified2.7
if -2.7620314914513706e-14 < y < 3.820792784014782e-149Initial program 0.4
Simplified3.7
rmApplied add-cube-cbrt3.9
rmApplied fma-udef3.9
Simplified0.4
Final simplification1.8
herbie shell --seed 2020057 +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))))