\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;\left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t} \leq -4.434491333044746 \cdot 10^{-219}:\\
\;\;\;\;x + \left(y + y \cdot \left(\frac{z}{t - a} - \frac{t}{t - a}\right)\right)\\
\mathbf{elif}\;\left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t} \leq 5.324556684443852 \cdot 10^{-130}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \frac{y}{\sqrt[3]{t - a} \cdot \sqrt[3]{t - a}} \cdot \frac{z - t}{\sqrt[3]{t - a}}\right)\\
\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 (<= (+ (+ x y) (/ (* y (- t z)) (- a t))) -4.434491333044746e-219)
(+ x (+ y (* y (- (/ z (- t a)) (/ t (- t a))))))
(if (<= (+ (+ x y) (/ (* y (- t z)) (- a t))) 5.324556684443852e-130)
(+ x (* y (/ z t)))
(+
x
(+
y
(*
(/ y (* (cbrt (- t a)) (cbrt (- t a))))
(/ (- z t) (cbrt (- t a)))))))))double code(double x, double y, double z, double t, double a) {
return ((double) (((double) (x + y)) - (((double) (((double) (z - t)) * y)) / ((double) (a - t)))));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((((double) (((double) (x + y)) + (((double) (y * ((double) (t - z)))) / ((double) (a - t))))) <= -4.434491333044746e-219)) {
tmp = ((double) (x + ((double) (y + ((double) (y * ((double) ((z / ((double) (t - a))) - (t / ((double) (t - a)))))))))));
} else {
double tmp_1;
if ((((double) (((double) (x + y)) + (((double) (y * ((double) (t - z)))) / ((double) (a - t))))) <= 5.324556684443852e-130)) {
tmp_1 = ((double) (x + ((double) (y * (z / t)))));
} else {
tmp_1 = ((double) (x + ((double) (y + ((double) ((y / ((double) (((double) cbrt(((double) (t - a)))) * ((double) cbrt(((double) (t - a))))))) * (((double) (z - t)) / ((double) cbrt(((double) (t - a)))))))))));
}
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
Results
| Original | 17.1 |
|---|---|
| Target | 9.0 |
| Herbie | 8.1 |
if (- (+ x y) (/ (* (- z t) y) (- a t))) < -4.43449133304474629e-219Initial program Error: 13.7 bits
SimplifiedError: 5.2 bits
rmApplied div-subError: 5.2 bits
if -4.43449133304474629e-219 < (- (+ x y) (/ (* (- z t) y) (- a t))) < 5.32455668444e-130Initial program Error: 43.8 bits
SimplifiedError: 24.0 bits
Taylor expanded around inf Error: 20.9 bits
SimplifiedError: 21.2 bits
if 5.32455668444e-130 < (- (+ x y) (/ (* (- z t) y) (- a t))) Initial program Error: 13.7 bits
SimplifiedError: 5.6 bits
rmApplied add-cube-cbrtError: 7.9 bits
Applied *-un-lft-identityError: 7.9 bits
Applied times-fracError: 7.8 bits
Applied associate-*r*Error: 7.7 bits
SimplifiedError: 7.6 bits
Final simplificationError: 8.1 bits
herbie shell --seed 2020204
(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))))