x + y \cdot \frac{z - t}{a - t}\begin{array}{l}
\mathbf{if}\;\frac{z - t}{a - t} \leq 4.104134791311347 \cdot 10^{+142}:\\
\;\;\;\;x + y \cdot \left(\frac{z}{a - t} - \frac{t}{a - t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (x + ((double) (y * (((double) (z - t)) / ((double) (a - t)))))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if (((((double) (z - t)) / ((double) (a - t))) <= 4.104134791311347e+142)) {
VAR = ((double) (x + ((double) (y * ((double) ((z / ((double) (a - t))) - (t / ((double) (a - t)))))))));
} else {
VAR = ((double) (x + ((double) (((double) (z - t)) * (y / ((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 | 0.8 |
if (/ (- z t) (- a t)) < 4.104134791311347e142Initial program 0.8
rmApplied div-sub0.8
if 4.104134791311347e142 < (/ (- z t) (- a t)) Initial program 13.6
rmApplied div-sub13.6
rmApplied div-inv13.6
Applied div-inv13.7
Applied distribute-rgt-out--13.7
Applied associate-*r*1.0
Simplified0.9
Final simplification0.8
herbie shell --seed 2020196
(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)))))