\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -0.48421412719263424:\\
\;\;\;\;\cosh x \cdot \frac{1}{\frac{x \cdot z}{y}}\\
\mathbf{elif}\;z \le 9.40222425595707568 \cdot 10^{29}:\\
\;\;\;\;\frac{\cosh x \cdot \frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\cosh x \cdot \left(y \cdot \frac{1}{x \cdot z}\right)\\
\end{array}double code(double x, double y, double z) {
return ((double) (((double) (((double) cosh(x)) * ((double) (y / x)))) / z));
}
double code(double x, double y, double z) {
double VAR;
if ((z <= -0.48421412719263424)) {
VAR = ((double) (((double) cosh(x)) * ((double) (1.0 / ((double) (((double) (x * z)) / y))))));
} else {
double VAR_1;
if ((z <= 9.402224255957076e+29)) {
VAR_1 = ((double) (((double) (((double) cosh(x)) * ((double) (y / z)))) / x));
} else {
VAR_1 = ((double) (((double) cosh(x)) * ((double) (y * ((double) (1.0 / ((double) (x * z))))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.4 |
|---|---|
| Target | 0.5 |
| Herbie | 0.5 |
if z < -0.48421412719263424Initial program 10.7
rmApplied *-un-lft-identity10.7
Applied times-frac10.6
Simplified10.6
Simplified0.4
rmApplied clear-num0.8
if -0.48421412719263424 < z < 9.402224255957076e+29Initial program 0.4
rmApplied *-un-lft-identity0.4
Applied times-frac0.4
Simplified0.4
Simplified18.2
rmApplied *-un-lft-identity18.2
Applied times-frac0.5
Applied associate-*r*0.5
Simplified0.5
rmApplied associate-*l/0.3
if 9.402224255957076e+29 < z Initial program 13.0
rmApplied *-un-lft-identity13.0
Applied times-frac12.9
Simplified12.9
Simplified0.4
rmApplied div-inv0.5
Final simplification0.5
herbie shell --seed 2020148
(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))