\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -27156977852.05674 \lor \neg \left(z \le 1.53951426725456284 \cdot 10^{-49}\right):\\
\;\;\;\;\sqrt{\cosh x} \cdot \left(\sqrt{\cosh x} \cdot \frac{y}{x \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x}{z \cdot \frac{x}{y}}\\
\end{array}double f(double x, double y, double z) {
double r594507 = x;
double r594508 = cosh(r594507);
double r594509 = y;
double r594510 = r594509 / r594507;
double r594511 = r594508 * r594510;
double r594512 = z;
double r594513 = r594511 / r594512;
return r594513;
}
double f(double x, double y, double z) {
double r594514 = z;
double r594515 = -27156977852.05674;
bool r594516 = r594514 <= r594515;
double r594517 = 1.5395142672545628e-49;
bool r594518 = r594514 <= r594517;
double r594519 = !r594518;
bool r594520 = r594516 || r594519;
double r594521 = x;
double r594522 = cosh(r594521);
double r594523 = sqrt(r594522);
double r594524 = y;
double r594525 = r594521 * r594514;
double r594526 = r594524 / r594525;
double r594527 = r594523 * r594526;
double r594528 = r594523 * r594527;
double r594529 = r594521 / r594524;
double r594530 = r594514 * r594529;
double r594531 = r594522 / r594530;
double r594532 = r594520 ? r594528 : r594531;
return r594532;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if z < -27156977852.05674 or 1.5395142672545628e-49 < z Initial program 11.5
rmApplied *-un-lft-identity11.5
Applied times-frac11.5
Simplified11.5
Simplified0.4
rmApplied add-sqr-sqrt0.5
Applied associate-*l*0.5
if -27156977852.05674 < z < 1.5395142672545628e-49Initial program 0.3
rmApplied associate-/l*0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2020042 +o rules:numerics
(FPCore (x y z)
:name "Linear.Quaternion:$ctan from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< y -4.618902267687042e-52) (* (/ (/ y z) x) (cosh x)) (if (< y 1.0385305359351529e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))
(/ (* (cosh x) (/ y x)) z))