\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 \le -5.0687222687147228 \cdot 10^{90}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + 0.333333333333333315 \cdot \frac{t}{z \cdot y}\\
\mathbf{elif}\;z \cdot 3 \le 4.3835756084570872 \cdot 10^{-50}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{z \cdot \left(3 \cdot \frac{y}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{1}{z} \cdot \frac{y}{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 - ((double) (y / ((double) (z * 3.0)))))) + ((double) (t / ((double) (((double) (z * 3.0)) * y))))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((((double) (z * 3.0)) <= -5.068722268714723e+90)) {
VAR = ((double) (((double) (x - ((double) (y / ((double) (z * 3.0)))))) + ((double) (0.3333333333333333 * ((double) (t / ((double) (z * y))))))));
} else {
double VAR_1;
if ((((double) (z * 3.0)) <= 4.383575608457087e-50)) {
VAR_1 = ((double) (((double) (x - ((double) (y / ((double) (z * 3.0)))))) + ((double) (1.0 / ((double) (z * ((double) (3.0 * ((double) (y / t))))))))));
} else {
VAR_1 = ((double) (((double) (x - ((double) (((double) (1.0 / z)) * ((double) (y / 3.0)))))) + ((double) (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.8 |
|---|---|
| Target | 1.7 |
| Herbie | 0.5 |
if (* z 3.0) < -5.0687222687147228e90Initial program 0.6
Taylor expanded around 0 0.6
if -5.0687222687147228e90 < (* z 3.0) < 4.3835756084570872e-50Initial program 9.4
rmApplied associate-/r*2.7
rmApplied clear-num2.7
Simplified0.6
if 4.3835756084570872e-50 < (* z 3.0) Initial program 0.4
rmApplied *-un-lft-identity0.4
Applied times-frac0.4
Final simplification0.5
herbie shell --seed 2020184
(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))))