\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.752728493811186 \cdot 10^{+20}:\\
\;\;\;\;\frac{\left(e^{x} + \frac{1}{e^{x}}\right) \cdot y}{\left(x \cdot 2\right) \cdot z}\\
\mathbf{elif}\;z \le 2.180956969076489 \cdot 10^{-33}:\\
\;\;\;\;\frac{\frac{\frac{1}{2} \cdot \mathsf{fma}\left(e^{x}, y, \frac{y}{e^{x}}\right)}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(e^{x} + \frac{1}{e^{x}}\right) \cdot y}{\left(x \cdot 2\right) \cdot z}\\
\end{array}double f(double x, double y, double z) {
double r25069949 = x;
double r25069950 = cosh(r25069949);
double r25069951 = y;
double r25069952 = r25069951 / r25069949;
double r25069953 = r25069950 * r25069952;
double r25069954 = z;
double r25069955 = r25069953 / r25069954;
return r25069955;
}
double f(double x, double y, double z) {
double r25069956 = z;
double r25069957 = -1.752728493811186e+20;
bool r25069958 = r25069956 <= r25069957;
double r25069959 = x;
double r25069960 = exp(r25069959);
double r25069961 = 1.0;
double r25069962 = r25069961 / r25069960;
double r25069963 = r25069960 + r25069962;
double r25069964 = y;
double r25069965 = r25069963 * r25069964;
double r25069966 = 2.0;
double r25069967 = r25069959 * r25069966;
double r25069968 = r25069967 * r25069956;
double r25069969 = r25069965 / r25069968;
double r25069970 = 2.180956969076489e-33;
bool r25069971 = r25069956 <= r25069970;
double r25069972 = 0.5;
double r25069973 = r25069964 / r25069960;
double r25069974 = fma(r25069960, r25069964, r25069973);
double r25069975 = r25069972 * r25069974;
double r25069976 = r25069975 / r25069959;
double r25069977 = r25069976 / r25069956;
double r25069978 = r25069971 ? r25069977 : r25069969;
double r25069979 = r25069958 ? r25069969 : r25069978;
return r25069979;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 7.3 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if z < -1.752728493811186e+20 or 2.180956969076489e-33 < z Initial program 11.1
rmApplied div-inv11.1
rmApplied cosh-def11.1
Applied frac-times11.1
Applied frac-times0.4
Simplified0.4
if -1.752728493811186e+20 < z < 2.180956969076489e-33Initial program 0.3
rmApplied *-un-lft-identity0.3
Applied associate-/r*0.3
Simplified0.4
rmApplied div-inv0.5
Applied *-un-lft-identity0.5
Applied times-frac0.5
Simplified0.4
Taylor expanded around inf 0.3
Simplified0.3
Final simplification0.4
herbie shell --seed 2019158 +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))