\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \le -2.4829212502580601 \cdot 10^{-130}:\\
\;\;\;\;\frac{1}{z} \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;x \cdot y \le 4.09359032056483698 \cdot 10^{-135}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;x \cdot y \le 1.48436680561384441 \cdot 10^{38}:\\
\;\;\;\;\frac{1}{z} \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}double f(double x, double y, double z) {
double r733980 = x;
double r733981 = y;
double r733982 = r733980 * r733981;
double r733983 = z;
double r733984 = r733982 / r733983;
return r733984;
}
double f(double x, double y, double z) {
double r733985 = x;
double r733986 = y;
double r733987 = r733985 * r733986;
double r733988 = -2.48292125025806e-130;
bool r733989 = r733987 <= r733988;
double r733990 = 1.0;
double r733991 = z;
double r733992 = r733990 / r733991;
double r733993 = r733992 * r733987;
double r733994 = 4.093590320564837e-135;
bool r733995 = r733987 <= r733994;
double r733996 = r733986 / r733991;
double r733997 = r733985 * r733996;
double r733998 = 1.4843668056138444e+38;
bool r733999 = r733987 <= r733998;
double r734000 = r733991 / r733986;
double r734001 = r733985 / r734000;
double r734002 = r733999 ? r733993 : r734001;
double r734003 = r733995 ? r733997 : r734002;
double r734004 = r733989 ? r733993 : r734003;
return r734004;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.0 |
|---|---|
| Target | 6.6 |
| Herbie | 3.4 |
if (* x y) < -2.48292125025806e-130 or 4.093590320564837e-135 < (* x y) < 1.4843668056138444e+38Initial program 3.7
rmApplied associate-/l*10.2
rmApplied clear-num10.5
rmApplied *-un-lft-identity10.5
Applied div-inv10.5
Applied times-frac3.8
Applied add-cube-cbrt3.8
Applied times-frac4.0
Simplified4.0
Simplified3.8
if -2.48292125025806e-130 < (* x y) < 4.093590320564837e-135Initial program 7.5
rmApplied associate-/l*1.5
rmApplied *-un-lft-identity1.5
Applied *-un-lft-identity1.5
Applied times-frac1.5
Applied *-un-lft-identity1.5
Applied times-frac1.5
Simplified1.5
Simplified1.4
if 1.4843668056138444e+38 < (* x y) Initial program 9.3
rmApplied associate-/l*6.2
Final simplification3.4
herbie shell --seed 2020046
(FPCore (x y z)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< z -4.262230790519429e-138) (/ (* x y) z) (if (< z 1.7042130660650472e-164) (/ x (/ z y)) (* (/ x z) y)))
(/ (* x y) z))