\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -1.978520408058128474686070432017731650003 \cdot 10^{51} \lor \neg \left(y \le 3539127650907089920\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\cosh x} \cdot \left(\sqrt{\cosh x} \cdot \frac{y}{x}\right)}{z}\\
\end{array}double f(double x, double y, double z) {
double r407711 = x;
double r407712 = cosh(r407711);
double r407713 = y;
double r407714 = r407713 / r407711;
double r407715 = r407712 * r407714;
double r407716 = z;
double r407717 = r407715 / r407716;
return r407717;
}
double f(double x, double y, double z) {
double r407718 = y;
double r407719 = -1.9785204080581285e+51;
bool r407720 = r407718 <= r407719;
double r407721 = 3.53912765090709e+18;
bool r407722 = r407718 <= r407721;
double r407723 = !r407722;
bool r407724 = r407720 || r407723;
double r407725 = x;
double r407726 = cosh(r407725);
double r407727 = z;
double r407728 = r407725 * r407727;
double r407729 = r407718 / r407728;
double r407730 = r407726 * r407729;
double r407731 = sqrt(r407726);
double r407732 = r407718 / r407725;
double r407733 = r407731 * r407732;
double r407734 = r407731 * r407733;
double r407735 = r407734 / r407727;
double r407736 = r407724 ? r407730 : r407735;
return r407736;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.5 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if y < -1.9785204080581285e+51 or 3.53912765090709e+18 < y Initial program 24.4
rmApplied *-un-lft-identity24.4
Applied times-frac24.4
Simplified24.4
Simplified0.3
if -1.9785204080581285e+51 < y < 3.53912765090709e+18Initial program 0.5
rmApplied add-sqr-sqrt0.5
Applied associate-*l*0.5
Final simplification0.4
herbie shell --seed 2019356 +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))