\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -1.331687176622029 \cdot 10^{-240}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt[3]{t - z} \cdot \sqrt[3]{t - z}}{\frac{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}{\sqrt[3]{y} \cdot \sqrt[3]{y}}}, \frac{\sqrt[3]{t - z}}{\frac{\sqrt[3]{a - t}}{\sqrt[3]{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \sqrt[3]{\sqrt[3]{y}}}}, x + y\right)\\
\mathbf{elif}\;a \le 1.92285616397135727 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{a - t}, y, x\right) + y\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (((double) (x + y)) - ((double) (((double) (((double) (z - t)) * y)) / ((double) (a - t))))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((a <= -1.331687176622029e-240)) {
VAR = ((double) fma(((double) (((double) (((double) cbrt(((double) (t - z)))) * ((double) cbrt(((double) (t - z)))))) / ((double) (((double) (((double) cbrt(((double) (a - t)))) * ((double) cbrt(((double) (a - t)))))) / ((double) (((double) cbrt(y)) * ((double) cbrt(y)))))))), ((double) (((double) cbrt(((double) (t - z)))) / ((double) (((double) cbrt(((double) (a - t)))) / ((double) (((double) cbrt(((double) (((double) cbrt(y)) * ((double) cbrt(y)))))) * ((double) cbrt(((double) cbrt(y)))))))))), ((double) (x + y))));
} else {
double VAR_1;
if ((a <= 1.9228561639713573e-07)) {
VAR_1 = ((double) fma(((double) (z / t)), y, x));
} else {
VAR_1 = ((double) (((double) fma(((double) (((double) (t - z)) / ((double) (a - t)))), y, 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 | 16.0 |
|---|---|
| Target | 8.4 |
| Herbie | 9.5 |
if a < -1.331687176622029e-240Initial program 15.8
Simplified11.0
rmApplied clear-num11.1
rmApplied fma-udef11.1
Simplified11.0
rmApplied add-cube-cbrt11.2
Applied add-cube-cbrt11.2
Applied times-frac11.2
Applied add-cube-cbrt11.2
Applied times-frac10.1
Applied fma-def10.0
rmApplied add-cube-cbrt10.1
Applied cbrt-prod10.1
if -1.331687176622029e-240 < a < 1.9228561639713573e-07Initial program 19.4
Simplified17.9
rmApplied clear-num18.0
rmApplied fma-udef18.0
Simplified17.8
Taylor expanded around inf 13.8
Simplified12.1
if 1.9228561639713573e-07 < a Initial program 12.7
Simplified6.6
rmApplied clear-num6.7
rmApplied fma-udef6.7
Simplified6.7
rmApplied associate-+r+6.7
Simplified5.8
Final simplification9.5
herbie shell --seed 2020122 +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))))