\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -7333611518295001906581357141952796033024:\\
\;\;\;\;\cosh x \cdot \left(\frac{\frac{1}{z}}{x} \cdot y\right)\\
\mathbf{elif}\;z \le 3.874474762317707999930582517660829469561 \cdot 10^{-25}:\\
\;\;\;\;\frac{\frac{y}{\frac{x}{\mathsf{fma}\left(\frac{1}{2}, e^{x}, \frac{\frac{1}{2}}{e^{x}}\right)}}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x \cdot y}{x \cdot z}\\
\end{array}double f(double x, double y, double z) {
double r377780 = x;
double r377781 = cosh(r377780);
double r377782 = y;
double r377783 = r377782 / r377780;
double r377784 = r377781 * r377783;
double r377785 = z;
double r377786 = r377784 / r377785;
return r377786;
}
double f(double x, double y, double z) {
double r377787 = z;
double r377788 = -7.333611518295002e+39;
bool r377789 = r377787 <= r377788;
double r377790 = x;
double r377791 = cosh(r377790);
double r377792 = 1.0;
double r377793 = r377792 / r377787;
double r377794 = r377793 / r377790;
double r377795 = y;
double r377796 = r377794 * r377795;
double r377797 = r377791 * r377796;
double r377798 = 3.874474762317708e-25;
bool r377799 = r377787 <= r377798;
double r377800 = 0.5;
double r377801 = exp(r377790);
double r377802 = r377800 / r377801;
double r377803 = fma(r377800, r377801, r377802);
double r377804 = r377790 / r377803;
double r377805 = r377795 / r377804;
double r377806 = r377805 / r377787;
double r377807 = r377791 * r377795;
double r377808 = r377790 * r377787;
double r377809 = r377807 / r377808;
double r377810 = r377799 ? r377806 : r377809;
double r377811 = r377789 ? r377797 : r377810;
return r377811;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 7.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.5 |
if z < -7.333611518295002e+39Initial program 12.7
rmApplied associate-/l*13.1
Simplified12.8
rmApplied div-inv12.8
Simplified11.7
rmApplied *-un-lft-identity11.7
Applied div-inv11.8
Applied times-frac0.4
Simplified0.4
if -7.333611518295002e+39 < z < 3.874474762317708e-25Initial program 0.6
rmApplied associate-/l*0.7
Simplified0.5
Taylor expanded around inf 19.7
Simplified0.6
if 3.874474762317708e-25 < z Initial program 11.3
rmApplied associate-*r/11.3
Applied associate-/l/0.3
Final simplification0.5
herbie shell --seed 2019196 +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))