x + \frac{y \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq -\infty:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\
\mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq 7.83158727753076 \cdot 10^{+265}:\\
\;\;\;\;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}(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
(FPCore (x y z t a)
:precision binary64
(if (<= (/ (* y (- z t)) (- a t)) (- INFINITY))
(+ x (/ y (/ (- a t) (- z t))))
(if (<= (/ (* y (- z t)) (- a t)) 7.83158727753076e+265)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
(+ x (* y (/ (- z t) (- a t)))))))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 tmp;
if (((y * (z - t)) / (a - t)) <= -((double) INFINITY)) {
tmp = x + (y / ((a - t) / (z - t)));
} else if (((y * (z - t)) / (a - t)) <= 7.83158727753076e+265) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = x + (y * ((z - t) / (a - t)));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 10.8 |
|---|---|
| Target | 1.3 |
| Herbie | 0.4 |
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -inf.0Initial program 64.0
rmApplied associate-/l*_binary64_161920.1
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 7.8315872775307596e265Initial program 0.2
rmApplied div-inv_binary64_162440.3
if 7.8315872775307596e265 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 57.9
rmApplied *-un-lft-identity_binary64_1624757.9
Applied times-frac_binary64_162531.3
Simplified1.3
Final simplification0.4
herbie shell --seed 2020277
(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))))