\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -1.749876674636675285330697870290708089216 \cdot 10^{-11}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\mathbf{elif}\;y \le 521563463103.41900634765625:\\
\;\;\;\;\frac{\left(\left(e^{x} + e^{-x}\right) \cdot \frac{1}{2}\right) \cdot \frac{y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x}{\frac{z \cdot x}{y}}\\
\end{array}double f(double x, double y, double z) {
double r299583 = x;
double r299584 = cosh(r299583);
double r299585 = y;
double r299586 = r299585 / r299583;
double r299587 = r299584 * r299586;
double r299588 = z;
double r299589 = r299587 / r299588;
return r299589;
}
double f(double x, double y, double z) {
double r299590 = y;
double r299591 = -1.7498766746366753e-11;
bool r299592 = r299590 <= r299591;
double r299593 = x;
double r299594 = cosh(r299593);
double r299595 = r299594 * r299590;
double r299596 = z;
double r299597 = r299595 / r299596;
double r299598 = r299597 / r299593;
double r299599 = 521563463103.419;
bool r299600 = r299590 <= r299599;
double r299601 = exp(r299593);
double r299602 = -r299593;
double r299603 = exp(r299602);
double r299604 = r299601 + r299603;
double r299605 = 0.5;
double r299606 = r299604 * r299605;
double r299607 = r299590 / r299593;
double r299608 = r299606 * r299607;
double r299609 = r299608 / r299596;
double r299610 = r299596 * r299593;
double r299611 = r299610 / r299590;
double r299612 = r299594 / r299611;
double r299613 = r299600 ? r299609 : r299612;
double r299614 = r299592 ? r299598 : r299613;
return r299614;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.8 |
|---|---|
| Target | 0.5 |
| Herbie | 0.3 |
if y < -1.7498766746366753e-11Initial program 20.4
rmApplied associate-*r/20.4
Applied associate-/l/0.3
rmApplied associate-/r*0.3
if -1.7498766746366753e-11 < y < 521563463103.419Initial program 0.3
Taylor expanded around inf 0.3
Simplified0.3
if 521563463103.419 < y Initial program 23.6
rmApplied associate-*r/23.6
Applied associate-/l/0.3
rmApplied associate-/l*0.4
Final simplification0.3
herbie shell --seed 2019303
(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.03853053593515302e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))
(/ (* (cosh x) (/ y x)) z))