\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;t \leq -8.703056610822989 \cdot 10^{+228}:\\
\;\;\;\;x + \frac{z \cdot y}{t}\\
\mathbf{elif}\;t \leq 6.965175920449405 \cdot 10^{+180}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z - t}{a - t}\\
\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 (<= t -8.703056610822989e+228)
(+ x (/ (* z y) t))
(if (<= t 6.965175920449405e+180)
(- (+ 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 (t <= -8.703056610822989e+228) {
tmp = x + ((z * y) / t);
} else if (t <= 6.965175920449405e+180) {
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 | 15.9 |
|---|---|
| Target | 8.7 |
| Herbie | 9.1 |
if t < -8.7030566108229891e228Initial program 33.4
Taylor expanded around inf 14.6
Simplified14.6
if -8.7030566108229891e228 < t < 6.9651759204494053e180Initial program 12.0
rmApplied associate-/l*_binary64_165368.5
rmApplied associate-/r/_binary64_165378.4
if 6.9651759204494053e180 < t Initial program 33.2
rmApplied associate-/l*_binary64_1653624.4
Taylor expanded around inf 15.8
Simplified10.7
Final simplification9.1
herbie shell --seed 2020277
(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))))