x + y \cdot \frac{z - t}{a - t}\begin{array}{l}
\mathbf{if}\;y \le -1.74547300710632633 \cdot 10^{-55} \lor \neg \left(y \le 1.4339579110756609 \cdot 10^{-126}\right):\\
\;\;\;\;\frac{y}{\frac{a - t}{z - t}} + x\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{a - t}{y \cdot \left(z - t\right)}} + x\\
\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 (((y <= -1.7454730071063263e-55) || !(y <= 1.4339579110756609e-126))) {
VAR = ((double) (((double) (y / ((double) (((double) (a - t)) / ((double) (z - t)))))) + x));
} else {
VAR = ((double) (((double) (1.0 / ((double) (((double) (a - t)) / ((double) (y * ((double) (z - t)))))))) + x));
}
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.3 |
|---|---|
| Target | 0.4 |
| Herbie | 0.6 |
if y < -1.7454730071063263e-55 or 1.4339579110756609e-126 < y Initial program 0.6
Simplified0.6
rmApplied clear-num0.7
rmApplied fma-udef0.7
Simplified0.6
if -1.7454730071063263e-55 < y < 1.4339579110756609e-126Initial program 2.4
Simplified2.4
rmApplied clear-num2.4
rmApplied fma-udef2.4
Simplified2.0
rmApplied clear-num2.1
rmApplied div-inv2.1
Applied associate-/l*0.5
Simplified0.5
Final simplification0.6
herbie shell --seed 2020123 +o rules:numerics
(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 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))