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 \lor \neg \left(\frac{y \cdot \left(z - t\right)}{a - t} \leq 8.36607743914692 \cdot 10^{+265}\right):\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(z - t\right)}{a - t} + x\\
\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 (or (<= (/ (* y (- z t)) (- a t)) (- INFINITY))
(not (<= (/ (* y (- z t)) (- a t)) 8.36607743914692e+265)))
(+ x (/ y (/ (- a t) (- z t))))
(+ (/ (* y (- z t)) (- a t)) x)))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)) || !(((y * (z - t)) / (a - t)) <= 8.36607743914692e+265)) {
tmp = x + (y / ((a - t) / (z - t)));
} else {
tmp = ((y * (z - t)) / (a - t)) + x;
}
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.9 |
|---|---|
| Target | 1.2 |
| Herbie | 0.3 |
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -inf.0 or 8.3660774391469199e265 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 61.1
Simplified0.5
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 8.3660774391469199e265Initial program 0.2
Final simplification0.3
herbie shell --seed 2021176
(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))))