\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\begin{array}{l}
\mathbf{if}\;x \le 1.94081360655672242 \cdot 10^{-258} \lor \neg \left(x \le 6.24118608736230798 \cdot 10^{-59}\right):\\
\;\;\;\;\left(x - \frac{\frac{y}{3}}{z}\right) + \frac{\frac{t}{z \cdot 3}}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(3 \cdot y\right)}\\
\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 (((x <= 1.9408136065567224e-258) || !(x <= 6.241186087362308e-59))) {
VAR = ((double) (((double) (x - ((double) (((double) (y / 3.0)) / z)))) + ((double) (((double) (t / ((double) (z * 3.0)))) / y))));
} else {
VAR = ((double) (((double) (x - ((double) (y / ((double) (z * 3.0)))))) + ((double) (t / ((double) (z * ((double) (3.0 * y))))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.7 |
|---|---|
| Target | 1.8 |
| Herbie | 1.9 |
if x < 1.94081360655672242e-258 or 6.24118608736230798e-59 < x Initial program 3.7
rmApplied associate-/r*1.5
rmApplied *-un-lft-identity1.5
Applied times-frac1.6
rmApplied associate-*l/1.5
Simplified1.5
if 1.94081360655672242e-258 < x < 6.24118608736230798e-59Initial program 3.5
rmApplied associate-*l*3.5
Final simplification1.9
herbie shell --seed 2020161
(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))))