\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\begin{array}{l}
t_1 := x - {\left(3 \cdot \frac{z}{y}\right)}^{-1}\\
\mathbf{if}\;z \cdot 3 \leq -1.3444085709928015 \cdot 10^{-66}:\\
\;\;\;\;\left(x - \frac{0.3333333333333333}{\frac{z}{y}}\right) + \frac{t}{z \cdot 3} \cdot \frac{1}{y}\\
\mathbf{elif}\;z \cdot 3 \leq 9.590884663341987 \cdot 10^{+90}:\\
\;\;\;\;t_1 + \frac{\frac{\frac{t}{y}}{z}}{3}\\
\mathbf{else}:\\
\;\;\;\;t_1 + \frac{t}{\left(z \cdot 3\right) \cdot 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
(let* ((t_1 (- x (pow (* 3.0 (/ z y)) -1.0))))
(if (<= (* z 3.0) -1.3444085709928015e-66)
(+ (- x (/ 0.3333333333333333 (/ z y))) (* (/ t (* z 3.0)) (/ 1.0 y)))
(if (<= (* z 3.0) 9.590884663341987e+90)
(+ t_1 (/ (/ (/ t y) z) 3.0))
(+ t_1 (/ t (* (* 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 t_1 = x - pow((3.0 * (z / y)), -1.0);
double tmp;
if ((z * 3.0) <= -1.3444085709928015e-66) {
tmp = (x - (0.3333333333333333 / (z / y))) + ((t / (z * 3.0)) * (1.0 / y));
} else if ((z * 3.0) <= 9.590884663341987e+90) {
tmp = t_1 + (((t / y) / z) / 3.0);
} else {
tmp = t_1 + (t / ((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.7 |
|---|---|
| Target | 1.8 |
| Herbie | 0.9 |
if (*.f64 z 3) < -1.3444085709928015e-66Initial program 0.7
Applied egg-rr1.1
Applied egg-rr1.2
Applied egg-rr1.2
Applied egg-rr1.2
if -1.3444085709928015e-66 < (*.f64 z 3) < 9.59088466334198744e90Initial program 9.0
Applied egg-rr2.8
Applied egg-rr2.9
Applied egg-rr2.9
Applied egg-rr1.0
if 9.59088466334198744e90 < (*.f64 z 3) Initial program 0.4
Applied egg-rr1.4
Applied egg-rr1.4
Applied egg-rr1.4
Applied egg-rr0.5
Final simplification0.9
herbie shell --seed 2022130
(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))))