\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \le -5.390377895817917772419668299668841422542 \cdot 10^{281} \lor \neg \left(x \cdot y \le -4.298687061087267567138297560273868903463 \cdot 10^{-207} \lor \neg \left(x \cdot y \le 2.409831597479541575498163389776208009711 \cdot 10^{-281}\right) \land x \cdot y \le 1.63604859057193362863482232436108847646 \cdot 10^{179}\right):\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\end{array}double f(double x, double y, double z) {
double r471998 = x;
double r471999 = y;
double r472000 = r471998 * r471999;
double r472001 = z;
double r472002 = r472000 / r472001;
return r472002;
}
double f(double x, double y, double z) {
double r472003 = x;
double r472004 = y;
double r472005 = r472003 * r472004;
double r472006 = -5.390377895817918e+281;
bool r472007 = r472005 <= r472006;
double r472008 = -4.2986870610872676e-207;
bool r472009 = r472005 <= r472008;
double r472010 = 2.4098315974795416e-281;
bool r472011 = r472005 <= r472010;
double r472012 = !r472011;
double r472013 = 1.6360485905719336e+179;
bool r472014 = r472005 <= r472013;
bool r472015 = r472012 && r472014;
bool r472016 = r472009 || r472015;
double r472017 = !r472016;
bool r472018 = r472007 || r472017;
double r472019 = z;
double r472020 = r472019 / r472004;
double r472021 = r472003 / r472020;
double r472022 = r472005 / r472019;
double r472023 = r472018 ? r472021 : r472022;
return r472023;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.0 |
|---|---|
| Target | 6.5 |
| Herbie | 0.4 |
if (* x y) < -5.390377895817918e+281 or -4.2986870610872676e-207 < (* x y) < 2.4098315974795416e-281 or 1.6360485905719336e+179 < (* x y) Initial program 18.5
rmApplied clear-num18.8
rmApplied *-un-lft-identity18.8
Applied add-cube-cbrt18.8
Applied times-frac18.8
Simplified18.8
Simplified18.5
rmApplied associate-/l*0.7
if -5.390377895817918e+281 < (* x y) < -4.2986870610872676e-207 or 2.4098315974795416e-281 < (* x y) < 1.6360485905719336e+179Initial program 0.2
rmApplied clear-num0.6
rmApplied *-un-lft-identity0.6
Applied add-cube-cbrt0.6
Applied times-frac0.6
Simplified0.6
Simplified0.2
Final simplification0.4
herbie shell --seed 2019322
(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))