\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;t \le -5.01778378545867122 \cdot 10^{90} \lor \neg \left(t \le 6.40427683306346665 \cdot 10^{118}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{1}{\sqrt[3]{y} \cdot \sqrt[3]{y}}}, \frac{\frac{t - z}{\frac{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}{\sqrt[3]{\sqrt[3]{y}} \cdot \sqrt[3]{\sqrt[3]{y}}}}}{\frac{\sqrt[3]{a - t}}{\sqrt[3]{\sqrt[3]{y}}}}, 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 temp;
if (((t <= -5.017783785458671e+90) || !(t <= 6.404276833063467e+118))) {
temp = fma((z / t), y, x);
} else {
temp = fma((1.0 / (1.0 / (cbrt(y) * cbrt(y)))), (((t - z) / ((cbrt((a - t)) * cbrt((a - t))) / (cbrt(cbrt(y)) * cbrt(cbrt(y))))) / (cbrt((a - t)) / cbrt(cbrt(y)))), (x + y));
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 16.4 |
|---|---|
| Target | 8.5 |
| Herbie | 8.0 |
if t < -5.017783785458671e+90 or 6.404276833063467e+118 < t Initial program 29.8
Simplified20.7
rmApplied clear-num20.8
rmApplied fma-udef20.9
Simplified20.9
Taylor expanded around inf 17.3
Simplified12.0
if -5.017783785458671e+90 < t < 6.404276833063467e+118Initial program 9.0
Simplified6.3
rmApplied clear-num6.4
rmApplied fma-udef6.4
Simplified6.2
rmApplied add-cube-cbrt6.4
Applied *-un-lft-identity6.4
Applied times-frac6.4
Applied *-un-lft-identity6.4
Applied times-frac5.8
Applied fma-def5.7
rmApplied add-cube-cbrt5.8
Applied add-cube-cbrt5.9
Applied times-frac5.9
Applied associate-/r*5.8
Final simplification8.0
herbie shell --seed 2020060 +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))))