\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1414753649.7641225 \lor \neg \left(z \le 9.6976854422407266 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{\left(e^{x} + e^{-x}\right) \cdot y}{z \cdot \left(2 \cdot x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(e^{x} + e^{-x}\right) \cdot y}{z}}{2 \cdot x}\\
\end{array}double f(double x, double y, double z) {
double r446498 = x;
double r446499 = cosh(r446498);
double r446500 = y;
double r446501 = r446500 / r446498;
double r446502 = r446499 * r446501;
double r446503 = z;
double r446504 = r446502 / r446503;
return r446504;
}
double f(double x, double y, double z) {
double r446505 = z;
double r446506 = -1414753649.7641225;
bool r446507 = r446505 <= r446506;
double r446508 = 9.697685442240727e-08;
bool r446509 = r446505 <= r446508;
double r446510 = !r446509;
bool r446511 = r446507 || r446510;
double r446512 = x;
double r446513 = exp(r446512);
double r446514 = -r446512;
double r446515 = exp(r446514);
double r446516 = r446513 + r446515;
double r446517 = y;
double r446518 = r446516 * r446517;
double r446519 = 2.0;
double r446520 = r446519 * r446512;
double r446521 = r446505 * r446520;
double r446522 = r446518 / r446521;
double r446523 = r446518 / r446505;
double r446524 = r446523 / r446520;
double r446525 = r446511 ? r446522 : r446524;
return r446525;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.3 |
if z < -1414753649.7641225 or 9.697685442240727e-08 < z Initial program 11.7
rmApplied cosh-def11.7
Applied frac-times11.7
Applied associate-/l/0.3
if -1414753649.7641225 < z < 9.697685442240727e-08Initial program 0.4
rmApplied cosh-def0.4
Applied frac-times0.4
Applied associate-/l/18.6
rmApplied associate-/r*0.3
Final simplification0.3
herbie shell --seed 2020003
(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))