\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;a \leq -2.9145917653947573 \cdot 10^{-227} \lor \neg \left(a \leq 2.9004516489965834 \cdot 10^{-122}\right):\\
\;\;\;\;x + \left(y + y \cdot \left(\frac{z}{t - a} - \frac{t}{t - a}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.9145917653947573e-227) (not (<= a 2.9004516489965834e-122))) (+ x (+ y (* y (- (/ z (- t a)) (/ t (- t a)))))) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
return ((double) (((double) (x + y)) - (((double) (((double) (z - t)) * y)) / ((double) (a - t)))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if (((a <= -2.9145917653947573e-227) || !(a <= 2.9004516489965834e-122))) {
VAR = ((double) (x + ((double) (y + ((double) (y * ((double) ((z / ((double) (t - a))) - (t / ((double) (t - a)))))))))));
} else {
VAR = ((double) (x + ((double) (y * (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 | 16.7 |
|---|---|
| Target | 8.5 |
| Herbie | 7.0 |
if a < -2.91459176539475726e-227 or 2.90045164899658335e-122 < a Initial program 15.5
Simplified6.7
rmApplied div-sub6.7
if -2.91459176539475726e-227 < a < 2.90045164899658335e-122Initial program 21.5
Simplified12.1
Taylor expanded around inf 9.3
Simplified8.4
Final simplification7.0
herbie shell --seed 2020198
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-07) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))