\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -6.434118062892472 \cdot 10^{+63}:\\
\;\;\;\;\frac{\cosh x \cdot y}{x \cdot z}\\
\mathbf{elif}\;z \le 4.1988639493302256 \cdot 10^{+51}:\\
\;\;\;\;\frac{\frac{y \cdot e^{x} + \frac{y}{e^{x}}}{z}}{x \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\left(\cosh x \cdot y\right) \cdot \frac{\frac{1}{z}}{x}\\
\end{array}double f(double x, double y, double z) {
double r26711607 = x;
double r26711608 = cosh(r26711607);
double r26711609 = y;
double r26711610 = r26711609 / r26711607;
double r26711611 = r26711608 * r26711610;
double r26711612 = z;
double r26711613 = r26711611 / r26711612;
return r26711613;
}
double f(double x, double y, double z) {
double r26711614 = z;
double r26711615 = -6.434118062892472e+63;
bool r26711616 = r26711614 <= r26711615;
double r26711617 = x;
double r26711618 = cosh(r26711617);
double r26711619 = y;
double r26711620 = r26711618 * r26711619;
double r26711621 = r26711617 * r26711614;
double r26711622 = r26711620 / r26711621;
double r26711623 = 4.1988639493302256e+51;
bool r26711624 = r26711614 <= r26711623;
double r26711625 = exp(r26711617);
double r26711626 = r26711619 * r26711625;
double r26711627 = r26711619 / r26711625;
double r26711628 = r26711626 + r26711627;
double r26711629 = r26711628 / r26711614;
double r26711630 = 2.0;
double r26711631 = r26711617 * r26711630;
double r26711632 = r26711629 / r26711631;
double r26711633 = 1.0;
double r26711634 = r26711633 / r26711614;
double r26711635 = r26711634 / r26711617;
double r26711636 = r26711620 * r26711635;
double r26711637 = r26711624 ? r26711632 : r26711636;
double r26711638 = r26711616 ? r26711622 : r26711637;
return r26711638;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.3 |
|---|---|
| Target | 0.5 |
| Herbie | 0.5 |
if z < -6.434118062892472e+63Initial program 12.8
rmApplied associate-*r/12.8
Applied associate-/l/0.2
if -6.434118062892472e+63 < z < 4.1988639493302256e+51Initial program 1.1
rmApplied associate-*r/1.1
Applied associate-/l/14.5
rmApplied clear-num14.6
rmApplied div-inv14.7
Applied add-cube-cbrt14.7
Applied times-frac15.8
Simplified15.8
Simplified15.7
rmApplied cosh-def15.7
Applied associate-*r/15.7
Applied frac-times1.0
Simplified0.8
if 4.1988639493302256e+51 < z Initial program 12.2
rmApplied associate-*r/12.2
Applied associate-/l/0.3
rmApplied clear-num0.6
rmApplied div-inv0.7
Applied add-cube-cbrt0.7
Applied times-frac0.4
Simplified0.4
Simplified0.4
Final simplification0.5
herbie shell --seed 2019163
(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))