\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1.2187058822034261 \cdot 10^{+68}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{3 \cdot \frac{z \cdot y}{t}}\\
\mathbf{elif}\;z \cdot 3 \leq 4.524571068069238 \cdot 10^{-86}:\\
\;\;\;\;\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{t}{\left(z \cdot 3\right) \cdot y}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (((double) (x - (y / ((double) (z * 3.0))))) + (t / ((double) (((double) (z * 3.0)) * y)))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((((double) (z * 3.0)) <= -1.2187058822034261e+68)) {
VAR = ((double) (((double) (x - (y / ((double) (z * 3.0))))) + (1.0 / ((double) (3.0 * (((double) (z * y)) / t))))));
} else {
double VAR_1;
if ((((double) (z * 3.0)) <= 4.524571068069238e-86)) {
VAR_1 = ((double) (((double) (x - (y / ((double) (z * 3.0))))) + ((double) ((1.0 / ((double) (z * 3.0))) * (t / y)))));
} else {
VAR_1 = ((double) (((double) (x - ((y / z) / 3.0))) + (t / ((double) (((double) (z * 3.0)) * y)))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.7 |
|---|---|
| Target | 1.7 |
| Herbie | 0.6 |
if (* z 3.0) < -1.218705882203426e68Initial program Error: 0.5 bits
rmApplied clear-numError: 0.5 bits
SimplifiedError: 0.5 bits
if -1.218705882203426e68 < (* z 3.0) < 4.5245710680692381e-86Initial program Error: 10.2 bits
rmApplied *-un-lft-identityError: 10.2 bits
Applied times-fracError: 0.7 bits
if 4.5245710680692381e-86 < (* z 3.0) Initial program Error: 0.7 bits
rmApplied associate-/r*Error: 0.7 bits
Final simplificationError: 0.6 bits
herbie shell --seed 2020200
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))