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 + \left(z - t\right) \cdot \frac{y}{a - t}\\
\mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq -7.047401359513392 \cdot 10^{-174}:\\
\;\;\;\;\frac{y \cdot \left(z - t\right)}{a - t} + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - 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 (* (- z t) (/ y (- a t))))
(if (<= (/ (* y (- z t)) (- a t)) -7.047401359513392e-174)
(+ (/ (* y (- z t)) (- a t)) x)
(+ x (/ y (/ (- a t) (- z 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 + ((z - t) * (y / (a - t)));
} else if (((y * (z - t)) / (a - t)) <= -7.047401359513392e-174) {
tmp = ((y * (z - t)) / (a - t)) + x;
} else {
tmp = x + (y / ((a - t) / (z - 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.5 |
|---|---|
| Target | 1.3 |
| Herbie | 0.7 |
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -inf.0Initial program 64.0
rmApplied associate-/l*_binary64_129810.1
rmApplied associate-/r/_binary64_129820.2
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -7.0474013595133918e-174Initial program 0.1
if -7.0474013595133918e-174 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 8.4
rmApplied associate-/l*_binary64_129811.1
Final simplification0.7
herbie shell --seed 2021090
(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))))