x + \frac{y \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;z \le -4.7559515486135571 \cdot 10^{160}:\\
\;\;\;\;\frac{y}{a - t} \cdot \left(z - t\right) + x\\
\mathbf{elif}\;z \le 2.9821745485608074 \cdot 10^{182}:\\
\;\;\;\;y \cdot \frac{z - t}{a - t} + 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(z - t\right)\right) + x\\
\end{array}double code(double x, double y, double z, double t, double a) {
return (x + ((y * (z - t)) / (a - t)));
}
double code(double x, double y, double z, double t, double a) {
double temp;
if ((z <= -4.755951548613557e+160)) {
temp = (((y / (a - t)) * (z - t)) + x);
} else {
double temp_1;
if ((z <= 2.9821745485608074e+182)) {
temp_1 = ((y * ((z - t) / (a - t))) + x);
} else {
temp_1 = ((((cbrt(y) * cbrt(y)) / (cbrt((a - t)) * cbrt((a - t)))) * ((cbrt(y) / cbrt((a - t))) * (z - t))) + x);
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 10.7 |
|---|---|
| Target | 1.4 |
| Herbie | 0.9 |
if z < -4.755951548613557e+160Initial program 16.6
Simplified2.8
rmApplied fma-udef2.8
if -4.755951548613557e+160 < z < 2.9821745485608074e+182Initial program 9.1
Simplified2.7
rmApplied fma-udef2.7
rmApplied div-inv2.8
Applied associate-*l*0.6
Simplified0.6
if 2.9821745485608074e+182 < z Initial program 19.5
Simplified4.1
rmApplied fma-udef4.1
rmApplied add-cube-cbrt4.7
Applied add-cube-cbrt4.8
Applied times-frac4.8
Applied associate-*l*1.2
Final simplification0.9
herbie shell --seed 2020066 +o rules:numerics
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))