\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -280311605560231821312:\\
\;\;\;\;\cosh x \cdot \frac{\frac{y}{z}}{x}\\
\mathbf{elif}\;y \le 3.959780483839766565551118859398086167973 \cdot 10^{-53}:\\
\;\;\;\;\frac{\left(\cosh x \cdot y\right) \cdot \frac{1}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\cosh x \cdot \frac{\frac{y}{z}}{x}\\
\end{array}double f(double x, double y, double z) {
double r34062647 = x;
double r34062648 = cosh(r34062647);
double r34062649 = y;
double r34062650 = r34062649 / r34062647;
double r34062651 = r34062648 * r34062650;
double r34062652 = z;
double r34062653 = r34062651 / r34062652;
return r34062653;
}
double f(double x, double y, double z) {
double r34062654 = y;
double r34062655 = -2.8031160556023182e+20;
bool r34062656 = r34062654 <= r34062655;
double r34062657 = x;
double r34062658 = cosh(r34062657);
double r34062659 = z;
double r34062660 = r34062654 / r34062659;
double r34062661 = r34062660 / r34062657;
double r34062662 = r34062658 * r34062661;
double r34062663 = 3.9597804838397666e-53;
bool r34062664 = r34062654 <= r34062663;
double r34062665 = r34062658 * r34062654;
double r34062666 = 1.0;
double r34062667 = r34062666 / r34062657;
double r34062668 = r34062665 * r34062667;
double r34062669 = r34062668 / r34062659;
double r34062670 = r34062664 ? r34062669 : r34062662;
double r34062671 = r34062656 ? r34062662 : r34062670;
return r34062671;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 8.0 |
|---|---|
| Target | 0.5 |
| Herbie | 0.5 |
if y < -2.8031160556023182e+20 or 3.9597804838397666e-53 < y Initial program 19.6
rmApplied associate-*r/19.6
Applied associate-/l/0.7
rmApplied associate-/l*0.6
rmApplied div-inv0.6
Simplified0.6
if -2.8031160556023182e+20 < y < 3.9597804838397666e-53Initial program 0.4
rmApplied div-inv0.5
Applied associate-*r*0.5
Final simplification0.5
herbie shell --seed 2019174
(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))