\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -1.0432260555262782 \cdot 10^{-16}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\mathbf{elif}\;y \le 2922533292505.41:\\
\;\;\;\;\frac{\frac{y}{x} \cdot \cosh x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\end{array}double f(double x, double y, double z) {
double r21964569 = x;
double r21964570 = cosh(r21964569);
double r21964571 = y;
double r21964572 = r21964571 / r21964569;
double r21964573 = r21964570 * r21964572;
double r21964574 = z;
double r21964575 = r21964573 / r21964574;
return r21964575;
}
double f(double x, double y, double z) {
double r21964576 = y;
double r21964577 = -1.0432260555262782e-16;
bool r21964578 = r21964576 <= r21964577;
double r21964579 = x;
double r21964580 = cosh(r21964579);
double r21964581 = r21964580 * r21964576;
double r21964582 = z;
double r21964583 = r21964581 / r21964582;
double r21964584 = r21964583 / r21964579;
double r21964585 = 2922533292505.41;
bool r21964586 = r21964576 <= r21964585;
double r21964587 = r21964576 / r21964579;
double r21964588 = r21964587 * r21964580;
double r21964589 = r21964588 / r21964582;
double r21964590 = r21964586 ? r21964589 : r21964584;
double r21964591 = r21964578 ? r21964584 : r21964590;
return r21964591;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.3 |
|---|---|
| Target | 0.5 |
| Herbie | 0.3 |
if y < -1.0432260555262782e-16 or 2922533292505.41 < y Initial program 20.1
rmApplied associate-*r/20.1
Applied associate-/l/0.3
rmApplied associate-/r*0.3
if -1.0432260555262782e-16 < y < 2922533292505.41Initial program 0.3
Final simplification0.3
herbie shell --seed 2019163 +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))