x + y \cdot \frac{z - t}{a - t}\begin{array}{l}
\mathbf{if}\;t \le -1.4811076684293724 \cdot 10^{-46} \lor \neg \left(t \le 6.14088417278226504 \cdot 10^{-47}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (x + ((double) (y * ((double) (((double) (z - t)) / ((double) (a - t))))))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if (((t <= -1.4811076684293724e-46) || !(t <= 6.140884172782265e-47))) {
VAR = ((double) (x + ((double) (y * ((double) (((double) (z - t)) / ((double) (a - t))))))));
} else {
VAR = ((double) (x + ((double) (((double) (y * ((double) (z - t)))) * ((double) (1.0 / ((double) (a - t))))))));
}
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.4 |
|---|---|
| Target | 0.5 |
| Herbie | 1.5 |
if t < -1.4811076684293724e-46 or 6.14088417278226504e-47 < t Initial program 0.2
if -1.4811076684293724e-46 < t < 6.14088417278226504e-47Initial program 3.4
rmApplied div-inv3.5
Applied associate-*r*3.5
Final simplification1.5
herbie shell --seed 2020163
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))