\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -5.69050507587288648 \cdot 10^{36}:\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{elif}\;y \le 1.53812960369040041 \cdot 10^{30}:\\
\;\;\;\;\frac{\cosh x \cdot \frac{y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\end{array}double code(double x, double y, double z) {
return ((cosh(x) * (y / x)) / z);
}
double code(double x, double y, double z) {
double VAR;
if ((y <= -5.690505075872886e+36)) {
VAR = (cosh(x) * (y / (x * z)));
} else {
double VAR_1;
if ((y <= 1.5381296036904004e+30)) {
VAR_1 = ((cosh(x) * (y / x)) / z);
} else {
VAR_1 = (((cosh(x) * y) / z) / x);
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.5 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if y < -5.690505075872886e+36Initial program 25.2
rmApplied *-un-lft-identity25.2
Applied times-frac25.1
Simplified25.1
Simplified0.3
if -5.690505075872886e+36 < y < 1.5381296036904004e+30Initial program 0.5
if 1.5381296036904004e+30 < y Initial program 23.6
rmApplied div-inv23.6
rmApplied associate-*r/23.6
Applied associate-*l/0.4
Simplified0.3
Final simplification0.4
herbie shell --seed 2020106
(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))