\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -1.749876674636675285330697870290708089216 \cdot 10^{-11}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\mathbf{elif}\;y \le 521563463103.41900634765625:\\
\;\;\;\;\frac{\frac{\left(e^{x} + e^{-x}\right) \cdot \frac{y}{x}}{2}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x}{\frac{z \cdot x}{y}}\\
\end{array}double f(double x, double y, double z) {
double r363428 = x;
double r363429 = cosh(r363428);
double r363430 = y;
double r363431 = r363430 / r363428;
double r363432 = r363429 * r363431;
double r363433 = z;
double r363434 = r363432 / r363433;
return r363434;
}
double f(double x, double y, double z) {
double r363435 = y;
double r363436 = -1.7498766746366753e-11;
bool r363437 = r363435 <= r363436;
double r363438 = x;
double r363439 = cosh(r363438);
double r363440 = r363439 * r363435;
double r363441 = z;
double r363442 = r363440 / r363441;
double r363443 = r363442 / r363438;
double r363444 = 521563463103.419;
bool r363445 = r363435 <= r363444;
double r363446 = exp(r363438);
double r363447 = -r363438;
double r363448 = exp(r363447);
double r363449 = r363446 + r363448;
double r363450 = r363435 / r363438;
double r363451 = r363449 * r363450;
double r363452 = 2.0;
double r363453 = r363451 / r363452;
double r363454 = r363453 / r363441;
double r363455 = r363441 * r363438;
double r363456 = r363455 / r363435;
double r363457 = r363439 / r363456;
double r363458 = r363445 ? r363454 : r363457;
double r363459 = r363437 ? r363443 : r363458;
return r363459;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.8 |
|---|---|
| Target | 0.5 |
| Herbie | 0.3 |
if y < -1.7498766746366753e-11Initial program 20.4
rmApplied associate-*r/20.4
Applied associate-/l/0.3
rmApplied associate-/r*0.3
if -1.7498766746366753e-11 < y < 521563463103.419Initial program 0.3
rmApplied cosh-def0.3
Applied associate-*l/0.3
if 521563463103.419 < y Initial program 23.6
rmApplied associate-*r/23.6
Applied associate-/l/0.3
rmApplied associate-/l*0.4
Final simplification0.3
herbie shell --seed 2019303
(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.03853053593515302e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))
(/ (* (cosh x) (/ y x)) z))