\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 -4.388929419357894 \cdot 10^{+57}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{\frac{\left(z \cdot 3\right) \cdot y}{t}}\\
\mathbf{elif}\;z \cdot 3 \leq 2.0555027465377215 \cdot 10^{-40}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t \cdot \frac{0.3333333333333333}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + t \cdot \frac{\frac{1}{z \cdot 3}}{y}\\
\end{array}(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
(FPCore (x y z t)
:precision binary64
(if (<= (* z 3.0) -4.388929419357894e+57)
(+ (- x (/ y (* z 3.0))) (/ 1.0 (/ (* (* z 3.0) y) t)))
(if (<= (* z 3.0) 2.0555027465377215e-40)
(+ (- x (/ y (* z 3.0))) (/ (* t (/ 0.3333333333333333 y)) z))
(+ (- x (/ y (* z 3.0))) (* t (/ (/ 1.0 (* z 3.0)) y))))))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 tmp;
if ((z * 3.0) <= -4.388929419357894e+57) {
tmp = (x - (y / (z * 3.0))) + (1.0 / (((z * 3.0) * y) / t));
} else if ((z * 3.0) <= 2.0555027465377215e-40) {
tmp = (x - (y / (z * 3.0))) + ((t * (0.3333333333333333 / y)) / z);
} else {
tmp = (x - (y / (z * 3.0))) + (t * ((1.0 / (z * 3.0)) / y));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.6 |
|---|---|
| Target | 1.6 |
| Herbie | 0.5 |
if (*.f64 z 3) < -4.38892941935789372e57Initial program 0.6
rmApplied clear-num_binary64_184910.6
if -4.38892941935789372e57 < (*.f64 z 3) < 2.05550274653772154e-40Initial program 9.2
rmApplied associate-/r*_binary64_184362.4
rmApplied associate-/r*_binary64_184362.4
rmApplied *-un-lft-identity_binary64_184922.4
Applied div-inv_binary64_184892.5
Applied times-frac_binary64_184982.5
Simplified2.5
Simplified2.5
rmApplied associate-*l/_binary64_184350.5
if 2.05550274653772154e-40 < (*.f64 z 3) Initial program 0.5
rmApplied associate-/r*_binary64_184361.0
rmApplied *-un-lft-identity_binary64_184921.0
Applied div-inv_binary64_184891.0
Applied times-frac_binary64_184980.5
Final simplification0.5
herbie shell --seed 2021015
(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))))