\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;a \leq -5.872757969820095 \cdot 10^{-163} \lor \neg \left(a \leq 5.980147012370445 \cdot 10^{-155}\right):\\
\;\;\;\;x + \left(y - y \cdot \frac{z - t}{a - t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{t}{y}}\\
\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 -5.872757969820095e-163) (not (<= a 5.980147012370445e-155))) (+ x (- y (* y (/ (- z t) (- a t))))) (+ x (/ z (/ t y)))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5.872757969820095e-163) || !(a <= 5.980147012370445e-155)) {
tmp = x + (y - (y * ((z - t) / (a - t))));
} else {
tmp = x + (z / (t / y));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 16.4 |
|---|---|
| Target | 8.5 |
| Herbie | 6.9 |
if a < -5.87283e-163 or 5.98012e-155 < a Initial program 15.2
rmApplied associate--l+_binary64_512413.7
Simplified7.8
rmApplied div-inv_binary64_50698.2
Applied associate-*l*_binary64_51286.8
Simplified6.3
if -5.87283e-163 < a < 5.98012e-155Initial program 20.5
rmApplied associate-/l*_binary64_513219.5
Taylor expanded around inf 9.8
Simplified8.7
Final simplification6.9
herbie shell --seed 2020231
(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))))