\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - a\right)\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_2 := \frac{y \cdot z}{a - t}\\
\mathbf{if}\;t_1 \leq -6.1628842594079744 \cdot 10^{-226}:\\
\;\;\;\;\left(y + \left(x + \frac{y \cdot t}{a - t}\right)\right) - t_2\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\left(1 + \frac{a}{t}\right) \cdot \frac{y \cdot z}{t} + \left(x - \frac{y \cdot a}{t}\right)\\
\mathbf{elif}\;t_1 \leq 8.005786514802402 \cdot 10^{+307}:\\
\;\;\;\;\left(y + \left(x + \frac{y}{\frac{a - t}{t}}\right)\right) - t_2\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := \sqrt[3]{t - z}\\
\mathsf{fma}\left(y, \left(t_3 \cdot t_3\right) \cdot \frac{t_3}{a - t}, x + y\right)
\end{array}\\
\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 (- (+ x y) (/ (* y (- z t)) (- a t)))))
(if (<= t_1 (- INFINITY))
(+ x (* (/ y t) (- z a)))
(let* ((t_2 (/ (* y z) (- a t))))
(if (<= t_1 -6.1628842594079744e-226)
(- (+ y (+ x (/ (* y t) (- a t)))) t_2)
(if (<= t_1 0.0)
(+ (* (+ 1.0 (/ a t)) (/ (* y z) t)) (- x (/ (* y a) t)))
(if (<= t_1 8.005786514802402e+307)
(- (+ y (+ x (/ y (/ (- a t) t)))) t_2)
(let* ((t_3 (cbrt (- t z))))
(fma y (* (* t_3 t_3) (/ t_3 (- a t))) (+ x 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 t_1 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + ((y / t) * (z - a));
} else {
double t_2 = (y * z) / (a - t);
double tmp_1;
if (t_1 <= -6.1628842594079744e-226) {
tmp_1 = (y + (x + ((y * t) / (a - t)))) - t_2;
} else if (t_1 <= 0.0) {
tmp_1 = ((1.0 + (a / t)) * ((y * z) / t)) + (x - ((y * a) / t));
} else if (t_1 <= 8.005786514802402e+307) {
tmp_1 = (y + (x + (y / ((a - t) / t)))) - t_2;
} else {
double t_3 = cbrt(t - z);
tmp_1 = fma(y, ((t_3 * t_3) * (t_3 / (a - t))), (x + y));
}
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 | 16.4 |
|---|---|
| Target | 8.2 |
| Herbie | 4.8 |
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0Initial program 64.0
Simplified30.2
Taylor expanded in t around inf 40.1
Simplified18.8
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -6.16288425940797438e-226Initial program 1.4
Simplified2.7
Taylor expanded in y around 0 1.3
Applied pow1_binary641.3
if -6.16288425940797438e-226 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 57.2
Simplified57.2
Taylor expanded in a around 0 5.2
Simplified2.9
if 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 8.0057865148024021e307Initial program 1.6
Simplified3.0
Taylor expanded in y around 0 1.5
Applied associate-/l*_binary641.3
if 8.0057865148024021e307 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 63.8
Simplified24.8
Applied *-un-lft-identity_binary6424.8
Applied add-cube-cbrt_binary6425.0
Applied times-frac_binary6425.0
Simplified25.0
Final simplification4.8
herbie shell --seed 2021340
(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))))