\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.3159694493115124 \cdot 10^{88}:\\
\;\;\;\;\frac{\cosh x \cdot y}{z \cdot x}\\
\mathbf{elif}\;z \le 3.7180943296009127 \cdot 10^{45}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{\frac{1}{2} \cdot \left(e^{x} + e^{-x}\right)}{x}}{z}}{\frac{1}{y}}\\
\end{array}double f(double x, double y, double z) {
double r2237 = x;
double r2238 = cosh(r2237);
double r2239 = y;
double r2240 = r2239 / r2237;
double r2241 = r2238 * r2240;
double r2242 = z;
double r2243 = r2241 / r2242;
return r2243;
}
double f(double x, double y, double z) {
double r2244 = z;
double r2245 = -1.3159694493115124e+88;
bool r2246 = r2244 <= r2245;
double r2247 = x;
double r2248 = cosh(r2247);
double r2249 = y;
double r2250 = r2248 * r2249;
double r2251 = r2244 * r2247;
double r2252 = r2250 / r2251;
double r2253 = 3.7180943296009127e+45;
bool r2254 = r2244 <= r2253;
double r2255 = r2250 / r2244;
double r2256 = r2255 / r2247;
double r2257 = 0.5;
double r2258 = exp(r2247);
double r2259 = -r2247;
double r2260 = exp(r2259);
double r2261 = r2258 + r2260;
double r2262 = r2257 * r2261;
double r2263 = r2262 / r2247;
double r2264 = r2263 / r2244;
double r2265 = 1.0;
double r2266 = r2265 / r2249;
double r2267 = r2264 / r2266;
double r2268 = r2254 ? r2256 : r2267;
double r2269 = r2246 ? r2252 : r2268;
return r2269;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.6 |
|---|---|
| Target | 0.4 |
| Herbie | 0.7 |
if z < -1.3159694493115124e+88Initial program 13.4
rmApplied associate-*r/13.4
Applied associate-/l/0.4
if -1.3159694493115124e+88 < z < 3.7180943296009127e+45Initial program 1.6
rmApplied associate-*r/1.6
Applied associate-/l/14.0
rmApplied associate-/r*1.1
if 3.7180943296009127e+45 < z Initial program 12.9
rmApplied associate-*r/13.0
Applied associate-/l/0.3
rmApplied associate-/l*0.8
rmApplied div-inv0.9
Applied associate-/r*0.5
Taylor expanded around inf 0.5
Simplified0.4
Final simplification0.7
herbie shell --seed 2020025
(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.0385305359351529e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))
(/ (* (cosh x) (/ y x)) z))