\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -2548401331254628.0:\\
\;\;\;\;\frac{y}{\frac{x \cdot z}{\mathsf{fma}\left(e^{x}, \frac{1}{2}, \frac{\frac{1}{2}}{e^{x}}\right)}}\\
\mathbf{elif}\;z \le 4.164739628396679 \cdot 10^{+36}:\\
\;\;\;\;\frac{\frac{\frac{\mathsf{fma}\left(y, e^{x}, \frac{y}{e^{x}}\right)}{x}}{2}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{x \cdot z}{\mathsf{fma}\left(e^{x}, \frac{1}{2}, \frac{\frac{1}{2}}{e^{x}}\right)}}\\
\end{array}double f(double x, double y, double z) {
double r8634977 = x;
double r8634978 = cosh(r8634977);
double r8634979 = y;
double r8634980 = r8634979 / r8634977;
double r8634981 = r8634978 * r8634980;
double r8634982 = z;
double r8634983 = r8634981 / r8634982;
return r8634983;
}
double f(double x, double y, double z) {
double r8634984 = z;
double r8634985 = -2548401331254628.0;
bool r8634986 = r8634984 <= r8634985;
double r8634987 = y;
double r8634988 = x;
double r8634989 = r8634988 * r8634984;
double r8634990 = exp(r8634988);
double r8634991 = 0.5;
double r8634992 = r8634991 / r8634990;
double r8634993 = fma(r8634990, r8634991, r8634992);
double r8634994 = r8634989 / r8634993;
double r8634995 = r8634987 / r8634994;
double r8634996 = 4.164739628396679e+36;
bool r8634997 = r8634984 <= r8634996;
double r8634998 = r8634987 / r8634990;
double r8634999 = fma(r8634987, r8634990, r8634998);
double r8635000 = r8634999 / r8634988;
double r8635001 = 2.0;
double r8635002 = r8635000 / r8635001;
double r8635003 = r8635002 / r8634984;
double r8635004 = r8634997 ? r8635003 : r8634995;
double r8635005 = r8634986 ? r8634995 : r8635004;
return r8635005;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 7.3 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if z < -2548401331254628.0 or 4.164739628396679e+36 < z Initial program 11.6
rmApplied div-inv11.7
Applied associate-*r*11.7
Taylor expanded around inf 0.3
Simplified0.3
if -2548401331254628.0 < z < 4.164739628396679e+36Initial program 0.6
rmApplied div-inv0.8
Applied associate-*r*0.8
rmApplied cosh-def0.8
Applied associate-*l/0.8
Applied associate-*l/0.8
Simplified0.6
Final simplification0.4
herbie shell --seed 2019156 +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))