\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 -8.33671520602323282 \cdot 10^{-240}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;x \cdot y \le 0.0:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;x \cdot y \le 4.84544495544772851 \cdot 10^{177}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}double f(double x, double y, double z) {
double r790931 = x;
double r790932 = y;
double r790933 = r790931 * r790932;
double r790934 = z;
double r790935 = r790933 / r790934;
return r790935;
}
double f(double x, double y, double z) {
double r790936 = x;
double r790937 = y;
double r790938 = r790936 * r790937;
double r790939 = -inf.0;
bool r790940 = r790938 <= r790939;
double r790941 = z;
double r790942 = r790936 / r790941;
double r790943 = r790942 * r790937;
double r790944 = -8.336715206023233e-240;
bool r790945 = r790938 <= r790944;
double r790946 = r790938 / r790941;
double r790947 = 0.0;
bool r790948 = r790938 <= r790947;
double r790949 = r790937 / r790941;
double r790950 = r790936 * r790949;
double r790951 = 4.8454449554477285e+177;
bool r790952 = r790938 <= r790951;
double r790953 = r790941 / r790937;
double r790954 = r790936 / r790953;
double r790955 = r790952 ? r790946 : r790954;
double r790956 = r790948 ? r790950 : r790955;
double r790957 = r790945 ? r790946 : r790956;
double r790958 = r790940 ? r790943 : r790957;
return r790958;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.4 |
|---|---|
| Target | 6.4 |
| Herbie | 0.4 |
if (* x y) < -inf.0Initial program 64.0
rmApplied associate-/l*0.3
rmApplied associate-/r/0.3
if -inf.0 < (* x y) < -8.336715206023233e-240 or 0.0 < (* x y) < 4.8454449554477285e+177Initial program 0.4
if -8.336715206023233e-240 < (* x y) < 0.0Initial program 16.4
rmApplied associate-/l*0.2
rmApplied *-un-lft-identity0.2
Applied *-un-lft-identity0.2
Applied times-frac0.2
Applied *-un-lft-identity0.2
Applied times-frac0.2
Simplified0.2
Simplified0.2
if 4.8454449554477285e+177 < (* x y) Initial program 20.2
rmApplied associate-/l*1.3
Final simplification0.4
herbie shell --seed 2020043 +o rules:numerics
(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))