x + \frac{y \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;y \le -5.97293961226197812 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)\\
\mathbf{elif}\;y \le 6.9730623938921107 \cdot 10^{-103}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a - t}\\
\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 VAR;
if ((y <= -5.972939612261978e-06)) {
VAR = fma((y / (a - t)), (z - t), x);
} else {
double VAR_1;
if ((y <= 6.973062393892111e-103)) {
VAR_1 = (x + ((y * (z - t)) * (1.0 / (a - t))));
} else {
VAR_1 = (x + (y * ((z - t) / (a - t))));
}
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.5 |
|---|---|
| Target | 1.4 |
| Herbie | 0.9 |
if y < -5.972939612261978e-06Initial program 22.0
Simplified2.6
if -5.972939612261978e-06 < y < 6.973062393892111e-103Initial program 0.2
rmApplied div-inv0.2
if 6.973062393892111e-103 < y Initial program 16.4
rmApplied *-un-lft-identity16.4
Applied times-frac0.6
Simplified0.6
Final simplification0.9
herbie shell --seed 2020105 +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))))