\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 r2686 = x;
double r2687 = cosh(r2686);
double r2688 = y;
double r2689 = r2688 / r2686;
double r2690 = r2687 * r2689;
double r2691 = z;
double r2692 = r2690 / r2691;
return r2692;
}
double f(double x, double y, double z) {
double r2693 = z;
double r2694 = -1.3159694493115124e+88;
bool r2695 = r2693 <= r2694;
double r2696 = x;
double r2697 = cosh(r2696);
double r2698 = y;
double r2699 = r2697 * r2698;
double r2700 = r2693 * r2696;
double r2701 = r2699 / r2700;
double r2702 = 3.739139840345061e+37;
bool r2703 = r2693 <= r2702;
double r2704 = r2699 / r2693;
double r2705 = r2704 / r2696;
double r2706 = r2697 / r2700;
double r2707 = 1.0;
double r2708 = r2707 / r2698;
double r2709 = r2706 / r2708;
double r2710 = r2703 ? r2705 : r2709;
double r2711 = r2695 ? r2701 : r2710;
return r2711;
}




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))