\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 -6.46146349214255 \cdot 10^{+19}:\\
\;\;\;\;t_1 + \frac{\frac{t}{z \cdot 3}}{y}\\
\mathbf{elif}\;z \cdot 3 \leq 4.143106767245704 \cdot 10^{-55}:\\
\;\;\;\;\mathsf{fma}\left(0.3333333333333333, \frac{1}{\frac{z}{\frac{t}{y} - y}}, x\right)\\
\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 (/ y (* z 3.0)))))
(if (<= (* z 3.0) -6.46146349214255e+19)
(+ t_1 (/ (/ t (* z 3.0)) y))
(if (<= (* z 3.0) 4.143106767245704e-55)
(fma 0.3333333333333333 (/ 1.0 (/ z (- (/ t y) y))) x)
(+ 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) <= -6.46146349214255e+19) {
tmp = t_1 + ((t / (z * 3.0)) / y);
} else if ((z * 3.0) <= 4.143106767245704e-55) {
tmp = fma(0.3333333333333333, (1.0 / (z / ((t / y) - y))), x);
} 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
| Original | 2.5 |
|---|---|
| Target | 2.6 |
| Herbie | 0.6 |
if (*.f64 z 3) < -64614634921425502000Initial program 0.4
Applied associate-/r*_binary641.3
if -64614634921425502000 < (*.f64 z 3) < 4.143106767245704e-55Initial program 5.0
Simplified0.2
Applied fma-udef_binary640.2
Simplified0.2
Applied div-inv_binary640.2
Applied fma-def_binary640.2
if 4.143106767245704e-55 < (*.f64 z 3) Initial program 0.5
Final simplification0.6
herbie shell --seed 2022068
(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))))