\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.3159694493115124 \cdot 10^{88}:\\
\;\;\;\;\frac{\cosh x \cdot y}{z \cdot x}\\
\mathbf{elif}\;z \le 3.7391398403450612 \cdot 10^{37}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\cosh x}{z \cdot x}}{\frac{1}{y}}\\
\end{array}double f(double x, double y, double z) {
double r540694 = x;
double r540695 = cosh(r540694);
double r540696 = y;
double r540697 = r540696 / r540694;
double r540698 = r540695 * r540697;
double r540699 = z;
double r540700 = r540698 / r540699;
return r540700;
}
double f(double x, double y, double z) {
double r540701 = z;
double r540702 = -1.3159694493115124e+88;
bool r540703 = r540701 <= r540702;
double r540704 = x;
double r540705 = cosh(r540704);
double r540706 = y;
double r540707 = r540705 * r540706;
double r540708 = r540701 * r540704;
double r540709 = r540707 / r540708;
double r540710 = 3.739139840345061e+37;
bool r540711 = r540701 <= r540710;
double r540712 = r540707 / r540701;
double r540713 = r540712 / r540704;
double r540714 = r540705 / r540708;
double r540715 = 1.0;
double r540716 = r540715 / r540706;
double r540717 = r540714 / r540716;
double r540718 = r540711 ? r540713 : r540717;
double r540719 = r540703 ? r540709 : r540718;
return r540719;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.6 |
|---|---|
| Target | 0.4 |
| Herbie | 0.7 |
if z < -1.3159694493115124e+88Initial program 13.4
rmApplied associate-*r/13.4
Applied associate-/l/0.4
if -1.3159694493115124e+88 < z < 3.739139840345061e+37Initial program 1.5
rmApplied associate-*r/1.5
Applied associate-/l/14.2
rmApplied associate-/r*1.1
if 3.739139840345061e+37 < z Initial program 12.8
rmApplied associate-*r/12.8
Applied associate-/l/0.3
rmApplied associate-/l*0.8
rmApplied div-inv0.9
Applied associate-/r*0.5
Final simplification0.7
herbie shell --seed 2020025 +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))