\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -2.283612116277876309196541517459782371519 \cdot 10^{-42}:\\
\;\;\;\;\frac{\frac{\frac{1}{e^{x}} + e^{x}}{\frac{z}{y}}}{x \cdot 2}\\
\mathbf{elif}\;y \le 1.743933658318041395875089693172887195128 \cdot 10^{-58}:\\
\;\;\;\;\frac{y \cdot \frac{\mathsf{fma}\left(\frac{1}{2}, e^{x}, \frac{\frac{1}{2}}{e^{x}}\right)}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(e^{x} + e^{-x}\right)}{\left(x \cdot 2\right) \cdot z}\\
\end{array}double f(double x, double y, double z) {
double r23344599 = x;
double r23344600 = cosh(r23344599);
double r23344601 = y;
double r23344602 = r23344601 / r23344599;
double r23344603 = r23344600 * r23344602;
double r23344604 = z;
double r23344605 = r23344603 / r23344604;
return r23344605;
}
double f(double x, double y, double z) {
double r23344606 = y;
double r23344607 = -2.2836121162778763e-42;
bool r23344608 = r23344606 <= r23344607;
double r23344609 = 1.0;
double r23344610 = x;
double r23344611 = exp(r23344610);
double r23344612 = r23344609 / r23344611;
double r23344613 = r23344612 + r23344611;
double r23344614 = z;
double r23344615 = r23344614 / r23344606;
double r23344616 = r23344613 / r23344615;
double r23344617 = 2.0;
double r23344618 = r23344610 * r23344617;
double r23344619 = r23344616 / r23344618;
double r23344620 = 1.7439336583180414e-58;
bool r23344621 = r23344606 <= r23344620;
double r23344622 = 0.5;
double r23344623 = r23344622 / r23344611;
double r23344624 = fma(r23344622, r23344611, r23344623);
double r23344625 = r23344624 / r23344610;
double r23344626 = r23344606 * r23344625;
double r23344627 = r23344626 / r23344614;
double r23344628 = -r23344610;
double r23344629 = exp(r23344628);
double r23344630 = r23344611 + r23344629;
double r23344631 = r23344606 * r23344630;
double r23344632 = r23344618 * r23344614;
double r23344633 = r23344631 / r23344632;
double r23344634 = r23344621 ? r23344627 : r23344633;
double r23344635 = r23344608 ? r23344619 : r23344634;
return r23344635;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 7.8 |
|---|---|
| Target | 0.4 |
| Herbie | 0.5 |
if y < -2.2836121162778763e-42Initial program 17.7
rmApplied cosh-def17.7
Applied frac-times17.7
Applied associate-/l/0.8
rmApplied associate-/r*0.6
Simplified0.7
if -2.2836121162778763e-42 < y < 1.7439336583180414e-58Initial program 0.2
Taylor expanded around inf 11.4
Simplified11.9
rmApplied add-cube-cbrt12.7
Applied *-un-lft-identity12.7
Applied times-frac12.7
Applied associate-*r*10.1
Simplified10.1
rmApplied frac-times1.3
Simplified0.3
if 1.7439336583180414e-58 < y Initial program 16.7
rmApplied cosh-def16.7
Applied frac-times16.7
Applied associate-/l/0.6
Final simplification0.5
herbie shell --seed 2019170 +o rules:numerics
(FPCore (x y z)
:name "Linear.Quaternion:$ctan from linear-1.19.1.3"
:herbie-target
(if (< y -4.618902267687042e-52) (* (/ (/ y z) x) (cosh x)) (if (< y 1.038530535935153e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))
(/ (* (cosh x) (/ y x)) z))