\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \le -1.7213465425126525 \cdot 10^{+172}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;x \cdot y \le -3.4578769880757935 \cdot 10^{-115}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;x \cdot y \le 1.3508925074839404 \cdot 10^{-153}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;x \cdot y \le 6.859366357865012 \cdot 10^{+120}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\end{array}double f(double x, double y, double z) {
double r34998678 = x;
double r34998679 = y;
double r34998680 = r34998678 * r34998679;
double r34998681 = z;
double r34998682 = r34998680 / r34998681;
return r34998682;
}
double f(double x, double y, double z) {
double r34998683 = x;
double r34998684 = y;
double r34998685 = r34998683 * r34998684;
double r34998686 = -1.7213465425126525e+172;
bool r34998687 = r34998685 <= r34998686;
double r34998688 = z;
double r34998689 = r34998684 / r34998688;
double r34998690 = r34998683 * r34998689;
double r34998691 = -3.4578769880757935e-115;
bool r34998692 = r34998685 <= r34998691;
double r34998693 = r34998685 / r34998688;
double r34998694 = 1.3508925074839404e-153;
bool r34998695 = r34998685 <= r34998694;
double r34998696 = 6.859366357865012e+120;
bool r34998697 = r34998685 <= r34998696;
double r34998698 = r34998683 / r34998688;
double r34998699 = r34998698 * r34998684;
double r34998700 = r34998697 ? r34998693 : r34998699;
double r34998701 = r34998695 ? r34998690 : r34998700;
double r34998702 = r34998692 ? r34998693 : r34998701;
double r34998703 = r34998687 ? r34998690 : r34998702;
return r34998703;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.2 |
|---|---|
| Target | 5.9 |
| Herbie | 1.1 |
if (* x y) < -1.7213465425126525e+172 or -3.4578769880757935e-115 < (* x y) < 1.3508925074839404e-153Initial program 10.2
rmApplied *-un-lft-identity10.2
Applied times-frac1.6
Simplified1.6
if -1.7213465425126525e+172 < (* x y) < -3.4578769880757935e-115 or 1.3508925074839404e-153 < (* x y) < 6.859366357865012e+120Initial program 0.2
rmApplied *-un-lft-identity0.2
Applied times-frac11.2
Simplified11.2
rmApplied associate-*r/0.2
if 6.859366357865012e+120 < (* x y) Initial program 15.6
rmApplied associate-/l*4.1
rmApplied associate-/r/3.1
Final simplification1.1
herbie shell --seed 2019163
(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))