\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.3352148123811325 \cdot 10^{50} \lor \neg \left(z \le 1397296929.3794756\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 r323607 = x;
double r323608 = cosh(r323607);
double r323609 = y;
double r323610 = r323609 / r323607;
double r323611 = r323608 * r323610;
double r323612 = z;
double r323613 = r323611 / r323612;
return r323613;
}
double f(double x, double y, double z) {
double r323614 = z;
double r323615 = -1.3352148123811325e+50;
bool r323616 = r323614 <= r323615;
double r323617 = 1397296929.3794756;
bool r323618 = r323614 <= r323617;
double r323619 = !r323618;
bool r323620 = r323616 || r323619;
double r323621 = x;
double r323622 = exp(r323621);
double r323623 = -r323621;
double r323624 = exp(r323623);
double r323625 = r323622 + r323624;
double r323626 = y;
double r323627 = r323625 * r323626;
double r323628 = 2.0;
double r323629 = r323628 * r323621;
double r323630 = r323614 * r323629;
double r323631 = r323627 / r323630;
double r323632 = r323627 / r323614;
double r323633 = r323632 / r323629;
double r323634 = r323620 ? r323631 : r323633;
return r323634;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 8.0 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if z < -1.3352148123811325e+50 or 1397296929.3794756 < z Initial program 13.1
rmApplied cosh-def13.1
Applied frac-times13.1
Applied associate-/l/0.3
if -1.3352148123811325e+50 < z < 1397296929.3794756Initial program 0.6
rmApplied cosh-def0.6
Applied frac-times0.6
Applied associate-/l/17.3
rmApplied associate-/r*0.5
Final simplification0.4
herbie shell --seed 2019199 +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))