\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -2.3374584650492343 \cdot 10^{57}:\\
\;\;\;\;\frac{\cosh x}{x} \cdot \frac{y}{z}\\
\mathbf{elif}\;y \le 2.31023204346366546 \cdot 10^{-13}:\\
\;\;\;\;\frac{\sqrt{\cosh x} \cdot \left(\sqrt{\cosh x} \cdot \frac{y}{x}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\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 ((y <= -2.3374584650492343e+57)) {
VAR = ((double) (((double) (((double) cosh(x)) / x)) * ((double) (y / z))));
} else {
double VAR_1;
if ((y <= 2.3102320434636655e-13)) {
VAR_1 = ((double) (((double) (((double) sqrt(((double) cosh(x)))) * ((double) (((double) sqrt(((double) cosh(x)))) * ((double) (y / x)))))) / z));
} else {
VAR_1 = ((double) (((double) cosh(x)) * ((double) (y / ((double) (x * z))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.8 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if y < -2.3374584650492343e+57Initial program 28.7
rmApplied *-un-lft-identity28.7
Applied times-frac28.4
Simplified28.4
Simplified0.3
rmApplied *-un-lft-identity0.3
Applied times-frac0.3
Applied associate-*r*0.3
Simplified0.3
if -2.3374584650492343e+57 < y < 2.3102320434636655e-13Initial program 0.5
rmApplied add-sqr-sqrt0.5
Applied associate-*l*0.5
if 2.3102320434636655e-13 < y Initial program 20.4
rmApplied *-un-lft-identity20.4
Applied times-frac20.3
Simplified20.3
Simplified0.3
Final simplification0.4
herbie shell --seed 2020124
(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))