\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -13294780528925495035856397041561239552:\\
\;\;\;\;\frac{\cosh x \cdot y}{x \cdot z}\\
\mathbf{elif}\;y \le 1.449820321413413963499843591018471786151 \cdot 10^{72}:\\
\;\;\;\;\frac{\frac{y}{x} \cdot \left(\frac{\frac{1}{2}}{e^{x}} + e^{x} \cdot \frac{1}{2}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x \cdot y}{x \cdot z}\\
\end{array}double f(double x, double y, double z) {
double r27162409 = x;
double r27162410 = cosh(r27162409);
double r27162411 = y;
double r27162412 = r27162411 / r27162409;
double r27162413 = r27162410 * r27162412;
double r27162414 = z;
double r27162415 = r27162413 / r27162414;
return r27162415;
}
double f(double x, double y, double z) {
double r27162416 = y;
double r27162417 = -1.3294780528925495e+37;
bool r27162418 = r27162416 <= r27162417;
double r27162419 = x;
double r27162420 = cosh(r27162419);
double r27162421 = r27162420 * r27162416;
double r27162422 = z;
double r27162423 = r27162419 * r27162422;
double r27162424 = r27162421 / r27162423;
double r27162425 = 1.449820321413414e+72;
bool r27162426 = r27162416 <= r27162425;
double r27162427 = r27162416 / r27162419;
double r27162428 = 0.5;
double r27162429 = exp(r27162419);
double r27162430 = r27162428 / r27162429;
double r27162431 = r27162429 * r27162428;
double r27162432 = r27162430 + r27162431;
double r27162433 = r27162427 * r27162432;
double r27162434 = r27162433 / r27162422;
double r27162435 = r27162426 ? r27162434 : r27162424;
double r27162436 = r27162418 ? r27162424 : r27162435;
return r27162436;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.5 |
|---|---|
| Target | 0.4 |
| Herbie | 0.7 |
if y < -1.3294780528925495e+37 or 1.449820321413414e+72 < y Initial program 26.9
rmApplied associate-*r/26.9
Applied associate-/l/0.4
if -1.3294780528925495e+37 < y < 1.449820321413414e+72Initial program 0.8
rmApplied associate-*r/0.8
Applied associate-/l/9.5
rmApplied associate-/r*9.2
Taylor expanded around inf 9.5
Simplified0.8
Final simplification0.7
herbie shell --seed 2019171
(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))