\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \le -2.9384494790728711 \cdot 10^{-282}:\\
\;\;\;\;\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1} \cdot \left(\frac{\sqrt[3]{y}}{a - t} \cdot \left(t - z\right)\right) + \left(x + y\right)\\
\mathbf{elif}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \le 1.04412 \cdot 10^{-305}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \left(\frac{\sqrt[3]{y}}{\sqrt[3]{a - t}} \cdot \left(t - z\right)\right) + \left(x + y\right)\\
\end{array}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 VAR;
if ((((x + y) - (((z - t) * y) / (a - t))) <= -2.938449479072871e-282)) {
VAR = ((((cbrt(y) * cbrt(y)) / 1.0) * ((cbrt(y) / (a - t)) * (t - z))) + (x + y));
} else {
double VAR_1;
if ((((x + y) - (((z - t) * y) / (a - t))) <= 1.0441159081045042e-305)) {
VAR_1 = x;
} else {
VAR_1 = ((((cbrt(y) * cbrt(y)) / (cbrt((a - t)) * cbrt((a - t)))) * ((cbrt(y) / cbrt((a - t))) * (t - z))) + (x + y));
}
VAR = VAR_1;
}
return VAR;
}




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 (- (+ x y) (/ (* (- z t) y) (- a t))) < -2.938449479072871e-282Initial program 12.3
Simplified8.1
rmApplied fma-udef8.1
rmApplied *-un-lft-identity8.1
Applied add-cube-cbrt8.3
Applied times-frac8.3
Applied associate-*l*7.3
if -2.938449479072871e-282 < (- (+ x y) (/ (* (- z t) y) (- a t))) < 1.0441159081045042e-305Initial program 60.5
Simplified60.6
Taylor expanded around 0 35.5
if 1.0441159081045042e-305 < (- (+ x y) (/ (* (- z t) y) (- a t))) Initial program 12.4
Simplified7.9
rmApplied fma-udef7.9
rmApplied add-cube-cbrt8.1
Applied add-cube-cbrt8.1
Applied times-frac8.1
Applied associate-*l*6.7
Final simplification9.1
herbie shell --seed 2020105 +o rules:numerics
(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 (- 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 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))