\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\begin{array}{l}
t_1 := x - \frac{y}{z \cdot 3}\\
\mathbf{if}\;z \cdot 3 \leq -545059296815.9845:\\
\;\;\;\;t_1 + \frac{t}{3 \cdot \left(z \cdot y\right)}\\
\mathbf{elif}\;z \cdot 3 \leq 5.132963417392212 \cdot 10^{-49}:\\
\;\;\;\;t_1 + \frac{1}{z \cdot 3} \cdot \frac{t}{y}\\
\mathbf{else}:\\
\;\;\;\;t_1 + \frac{t}{z \cdot \left(3 \cdot y\right)}\\
\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 (/ y (* z 3.0)))))
(if (<= (* z 3.0) -545059296815.9845)
(+ t_1 (/ t (* 3.0 (* z y))))
(if (<= (* z 3.0) 5.132963417392212e-49)
(+ t_1 (* (/ 1.0 (* z 3.0)) (/ t y)))
(+ 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 - (y / (z * 3.0));
double tmp;
if ((z * 3.0) <= -545059296815.9845) {
tmp = t_1 + (t / (3.0 * (z * y)));
} else if ((z * 3.0) <= 5.132963417392212e-49) {
tmp = t_1 + ((1.0 / (z * 3.0)) * (t / y));
} 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.5 |
|---|---|
| Target | 1.8 |
| Herbie | 0.4 |
if (*.f64 z 3) < -545059296815.9845Initial program 0.4
Taylor expanded in z around 0 0.4
if -545059296815.9845 < (*.f64 z 3) < 5.13296341739221169e-49Initial program 10.9
Applied *-un-lft-identity_binary6410.9
Applied times-frac_binary640.3
if 5.13296341739221169e-49 < (*.f64 z 3) Initial program 0.5
Applied associate-*l*_binary640.5
Simplified0.5
Final simplification0.4
herbie shell --seed 2021275
(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))))