\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -5.90737577331802458 \cdot 10^{-57} \lor \neg \left(z \le 1.0700912275797494 \cdot 10^{36}\right):\\
\;\;\;\;\left(\cosh x \cdot y\right) \cdot \frac{\frac{1}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(\cosh x \cdot \frac{y}{x}\right) \cdot \frac{1}{z}\\
\end{array}double f(double x, double y, double z) {
double r512574 = x;
double r512575 = cosh(r512574);
double r512576 = y;
double r512577 = r512576 / r512574;
double r512578 = r512575 * r512577;
double r512579 = z;
double r512580 = r512578 / r512579;
return r512580;
}
double f(double x, double y, double z) {
double r512581 = z;
double r512582 = -5.907375773318025e-57;
bool r512583 = r512581 <= r512582;
double r512584 = 1.0700912275797494e+36;
bool r512585 = r512581 <= r512584;
double r512586 = !r512585;
bool r512587 = r512583 || r512586;
double r512588 = x;
double r512589 = cosh(r512588);
double r512590 = y;
double r512591 = r512589 * r512590;
double r512592 = 1.0;
double r512593 = r512592 / r512588;
double r512594 = r512593 / r512581;
double r512595 = r512591 * r512594;
double r512596 = r512590 / r512588;
double r512597 = r512589 * r512596;
double r512598 = r512592 / r512581;
double r512599 = r512597 * r512598;
double r512600 = r512587 ? r512595 : r512599;
return r512600;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.6 |
|---|---|
| Target | 0.4 |
| Herbie | 0.5 |
if z < -5.907375773318025e-57 or 1.0700912275797494e+36 < z Initial program 11.2
rmApplied div-inv11.2
Applied associate-*r*11.2
rmApplied *-un-lft-identity11.2
Applied times-frac0.6
Simplified0.6
if -5.907375773318025e-57 < z < 1.0700912275797494e+36Initial program 0.4
rmApplied div-inv0.5
Final simplification0.5
herbie shell --seed 2020045 +o rules:numerics
(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))