\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\begin{array}{l}
\mathbf{if}\;t \leq -2.2944451371658341 \cdot 10^{+77}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - a\right)\\
\mathbf{elif}\;t \leq 5.1285840833626966 \cdot 10^{+75}:\\
\;\;\;\;\left(y + \left(x + \frac{t \cdot y}{a - t}\right)\right) - \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{a - z}}\\
\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 -2.2944451371658341e+77)
(+ x (* (/ y t) (- z a)))
(if (<= t 5.1285840833626966e+75)
(- (+ y (+ x (/ (* t y) (- a t)))) (/ (* y z) (- a t)))
(- x (/ y (/ t (- a z)))))))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 <= -2.2944451371658341e+77) {
tmp = x + ((y / t) * (z - a));
} else if (t <= 5.1285840833626966e+75) {
tmp = (y + (x + ((t * y) / (a - t)))) - ((y * z) / (a - t));
} else {
tmp = x - (y / (t / (a - z)));
}
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.0 |
|---|---|
| Target | 7.9 |
| Herbie | 6.5 |
if t < -2.29444513716583415e77Initial program 28.7
Simplified20.5
Taylor expanded in t around inf 15.7
Simplified8.3
if -2.29444513716583415e77 < t < 5.1285840833626966e75Initial program 6.8
Simplified5.2
Taylor expanded in y around 0 5.6
if 5.1285840833626966e75 < t Initial program 28.3
Simplified20.6
Taylor expanded in t around inf 14.5
Simplified7.9
Taylor expanded in t around -inf 14.5
Simplified7.7
Final simplification6.5
herbie shell --seed 2022088
(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-7) (- (+ 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))))