\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\begin{array}{l}
t_1 := \frac{y}{\frac{a - t}{z}}\\
t_2 := \left(\mathsf{fma}\left(\frac{y}{a - t}, t, y\right) + x\right) - t_1\\
\mathbf{if}\;a \leq -1.6426802885300486 \cdot 10^{-35}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := x - \frac{a \cdot y}{t}\\
\mathbf{if}\;a \leq -3.405149008362116 \cdot 10^{-109}:\\
\;\;\;\;t_3 - \frac{y \cdot z}{a - t}\\
\mathbf{elif}\;a \leq -4.3030892615262975 \cdot 10^{-119}:\\
\;\;\;\;\left(y + x\right) - t_1\\
\mathbf{elif}\;a \leq 1.1785256264895896 \cdot 10^{-269}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - a\right)\\
\mathbf{elif}\;a \leq 7.886165021559944 \cdot 10^{+50}:\\
\;\;\;\;t_3 - t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}\\
\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
(let* ((t_1 (/ y (/ (- a t) z))) (t_2 (- (+ (fma (/ y (- a t)) t y) x) t_1)))
(if (<= a -1.6426802885300486e-35)
t_2
(let* ((t_3 (- x (/ (* a y) t))))
(if (<= a -3.405149008362116e-109)
(- t_3 (/ (* y z) (- a t)))
(if (<= a -4.3030892615262975e-119)
(- (+ y x) t_1)
(if (<= a 1.1785256264895896e-269)
(+ x (* (/ y t) (- z a)))
(if (<= a 7.886165021559944e+50) (- t_3 t_1) t_2))))))))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 t_1 = y / ((a - t) / z);
double t_2 = (fma((y / (a - t)), t, y) + x) - t_1;
double tmp;
if (a <= -1.6426802885300486e-35) {
tmp = t_2;
} else {
double t_3 = x - ((a * y) / t);
double tmp_1;
if (a <= -3.405149008362116e-109) {
tmp_1 = t_3 - ((y * z) / (a - t));
} else if (a <= -4.3030892615262975e-119) {
tmp_1 = (y + x) - t_1;
} else if (a <= 1.1785256264895896e-269) {
tmp_1 = x + ((y / t) * (z - a));
} else if (a <= 7.886165021559944e+50) {
tmp_1 = t_3 - t_1;
} else {
tmp_1 = t_2;
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 15.9 |
|---|---|
| Target | 8.5 |
| Herbie | 8.0 |
if a < -1.64268028853004857e-35 or 7.8861650215599438e50 < a Initial program 13.5
Simplified5.6
Taylor expanded in y around 0 13.2
Applied associate-/l*_binary649.5
Applied associate-+r+_binary648.8
Simplified5.7
if -1.64268028853004857e-35 < a < -3.40514900836211584e-109Initial program 16.8
Simplified16.2
Taylor expanded in y around 0 15.1
Taylor expanded in t around inf 14.1
if -3.40514900836211584e-109 < a < -4.3030892615262975e-119Initial program 16.5
Simplified15.3
Taylor expanded in y around 0 12.6
Applied associate-/l*_binary6414.6
Taylor expanded in t around 0 17.5
if -4.3030892615262975e-119 < a < 1.17852562648959e-269Initial program 20.2
Simplified19.1
Taylor expanded in t around inf 8.3
Simplified7.6
if 1.17852562648959e-269 < a < 7.8861650215599438e50Initial program 17.8
Simplified16.2
Taylor expanded in y around 0 16.1
Applied associate-/l*_binary6416.7
Taylor expanded in t around inf 11.0
Simplified11.0
Final simplification8.0
herbie shell --seed 2022117
(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))))