\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\begin{array}{l}
\mathbf{if}\;t \le -3.1738446400054502 \cdot 10^{-58}:\\
\;\;\;\;\left(x - \frac{1}{z} \cdot \frac{y}{3}\right) + 0.333333333333333315 \cdot \frac{t}{z \cdot y}\\
\mathbf{elif}\;t \le 5.128060230407144 \cdot 10^{45}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{z \cdot 3} \cdot \frac{t}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{\frac{y}{z}}{3}\right) + \frac{\frac{\frac{t}{z}}{3}}{y}\\
\end{array}double code(double x, double y, double z, double t) {
return ((x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)));
}
double code(double x, double y, double z, double t) {
double temp;
if ((t <= -3.17384464000545e-58)) {
temp = ((x - ((1.0 / z) * (y / 3.0))) + (0.3333333333333333 * (t / (z * y))));
} else {
double temp_1;
if ((t <= 5.128060230407144e+45)) {
temp_1 = ((x - (y / (z * 3.0))) + ((1.0 / (z * 3.0)) * (t / y)));
} else {
temp_1 = ((x - ((y / z) / 3.0)) + (((t / z) / 3.0) / y));
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.7 |
|---|---|
| Target | 1.6 |
| Herbie | 0.9 |
if t < -3.17384464000545e-58Initial program 0.8
rmApplied associate-/r*1.8
rmApplied *-un-lft-identity1.8
Applied times-frac1.8
rmApplied associate-/r*1.8
Taylor expanded around 0 0.8
if -3.17384464000545e-58 < t < 5.128060230407144e+45Initial program 6.0
rmApplied *-un-lft-identity6.0
Applied times-frac0.4
if 5.128060230407144e+45 < t Initial program 0.7
rmApplied associate-/r*2.7
rmApplied *-un-lft-identity2.7
Applied times-frac2.8
rmApplied associate-/r*2.7
rmApplied associate-*r/2.8
Simplified2.8
Final simplification0.9
herbie shell --seed 2020053
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y))
(+ (- x (/ y (* z 3))) (/ t (* (* z 3) y))))