\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 -1.4034157054147832 \cdot 10^{-28}:\\
\;\;\;\;t_1 + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\mathbf{elif}\;z \cdot 3 \leq 0.16956904717494958:\\
\;\;\;\;t_1 + \frac{\frac{1}{z}}{\frac{y}{\frac{t}{3}}}\\
\mathbf{else}:\\
\;\;\;\;t_1 + t \cdot \frac{0.3333333333333333}{z \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 (/ y (* z 3.0)))))
(if (<= (* z 3.0) -1.4034157054147832e-28)
(+ t_1 (/ t (* (* z 3.0) y)))
(if (<= (* z 3.0) 0.16956904717494958)
(+ t_1 (/ (/ 1.0 z) (/ y (/ t 3.0))))
(+ t_1 (* t (/ 0.3333333333333333 (* z 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) <= -1.4034157054147832e-28) {
tmp = t_1 + (t / ((z * 3.0) * y));
} else if ((z * 3.0) <= 0.16956904717494958) {
tmp = t_1 + ((1.0 / z) / (y / (t / 3.0)));
} else {
tmp = t_1 + (t * (0.3333333333333333 / (z * 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.9 |
| Herbie | 0.4 |
if (*.f64 z 3) < -1.40341570541478325e-28Initial program 0.5
if -1.40341570541478325e-28 < (*.f64 z 3) < 0.16956904717494958Initial program 10.5
Applied associate-/r*_binary643.4
Applied *-un-lft-identity_binary643.4
Applied times-frac_binary643.4
Applied associate-/l*_binary640.3
if 0.16956904717494958 < (*.f64 z 3) Initial program 0.5
Applied div-inv_binary640.5
Simplified0.5
Final simplification0.4
herbie shell --seed 2021329
(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))))