\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\begin{array}{l}
\mathbf{if}\;t \le -1707856.4708140502:\\
\;\;\;\;\left(x - \frac{1}{z} \cdot \frac{y}{3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\mathbf{elif}\;t \le 4.3721129338620636 \cdot 10^{-16}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{y}}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{{\left(3 \cdot \left(z \cdot y\right)\right)}^{1}}\\
\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 VAR;
if ((t <= -1707856.4708140502)) {
VAR = ((x - ((1.0 / z) * (y / 3.0))) + (t / ((z * 3.0) * y)));
} else {
double VAR_1;
if ((t <= 4.3721129338620636e-16)) {
VAR_1 = ((x - (y / (z * 3.0))) + ((t / y) / (z * 3.0)));
} else {
VAR_1 = ((x - (y / (z * 3.0))) + (t / pow((3.0 * (z * y)), 1.0)));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.6 |
|---|---|
| Target | 1.8 |
| Herbie | 0.3 |
if t < -1707856.4708140502Initial program 0.4
rmApplied *-un-lft-identity0.4
Applied times-frac0.5
if -1707856.4708140502 < t < 4.3721129338620636e-16Initial program 5.9
rmApplied add-cube-cbrt6.0
Applied times-frac0.8
rmApplied associate-*l/0.4
Simplified0.2
if 4.3721129338620636e-16 < t Initial program 0.6
rmApplied pow10.6
Applied pow10.6
Applied pow10.6
Applied pow-prod-down0.6
Applied pow-prod-down0.6
Simplified0.6
Final simplification0.3
herbie shell --seed 2020075 +o rules:numerics
(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))))