\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y = -\infty:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\mathbf{elif}\;x \cdot y \le -1.441956668272939099348463004765207941311 \cdot 10^{-215} \lor \neg \left(x \cdot y \le 3.896140158292728048846350005738913745263 \cdot 10^{-268}\right):\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}double f(double x, double y, double z) {
double r441795 = x;
double r441796 = y;
double r441797 = r441795 * r441796;
double r441798 = z;
double r441799 = r441797 / r441798;
return r441799;
}
double f(double x, double y, double z) {
double r441800 = x;
double r441801 = y;
double r441802 = r441800 * r441801;
double r441803 = -inf.0;
bool r441804 = r441802 <= r441803;
double r441805 = z;
double r441806 = r441800 / r441805;
double r441807 = r441806 * r441801;
double r441808 = -1.441956668272939e-215;
bool r441809 = r441802 <= r441808;
double r441810 = 3.896140158292728e-268;
bool r441811 = r441802 <= r441810;
double r441812 = !r441811;
bool r441813 = r441809 || r441812;
double r441814 = r441802 / r441805;
double r441815 = r441805 / r441800;
double r441816 = r441801 / r441815;
double r441817 = r441813 ? r441814 : r441816;
double r441818 = r441804 ? r441807 : r441817;
return r441818;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.4 |
|---|---|
| Target | 6.5 |
| Herbie | 2.2 |
if (* x y) < -inf.0Initial program 64.0
rmApplied div-inv64.0
Taylor expanded around 0 64.0
Simplified0.2
if -inf.0 < (* x y) < -1.441956668272939e-215 or 3.896140158292728e-268 < (* x y) Initial program 2.8
if -1.441956668272939e-215 < (* x y) < 3.896140158292728e-268Initial program 11.5
rmApplied div-inv11.5
Taylor expanded around 0 11.5
Simplified0.3
rmApplied add-cube-cbrt0.8
Applied associate-*r*0.8
Simplified6.2
Taylor expanded around 0 11.5
Simplified0.3
Final simplification2.2
herbie shell --seed 2019174 +o rules:numerics
(FPCore (x y z)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, A"
:herbie-target
(if (< z -4.262230790519429e-138) (/ (* x y) z) (if (< z 1.7042130660650472e-164) (/ x (/ z y)) (* (/ x z) y)))
(/ (* x y) z))