x + y \cdot \frac{z - t}{z - a}\begin{array}{l}
\mathbf{if}\;y \le 7.24164925083284105 \cdot 10^{-306}:\\
\;\;\;\;x + y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z - a} \cdot \left(z - t\right)\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (x + ((double) (y * ((double) (((double) (z - t)) / ((double) (z - a))))))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((y <= 7.241649250832841e-306)) {
VAR = ((double) (x + ((double) (y * ((double) (((double) (z / ((double) (z - a)))) - ((double) (t / ((double) (z - a))))))))));
} else {
VAR = ((double) (x + ((double) (((double) (y / ((double) (z - a)))) * ((double) (z - 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.5 |
|---|---|
| Target | 1.3 |
| Herbie | 2.3 |
if y < 7.24164925083284105e-306Initial program 1.6
rmApplied div-sub1.6
if 7.24164925083284105e-306 < y Initial program 1.3
rmApplied div-sub1.3
rmApplied div-inv1.3
Applied div-inv1.4
Applied distribute-rgt-out--1.4
Applied associate-*r*3.0
Simplified3.0
Final simplification2.3
herbie shell --seed 2020152
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))