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




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 8.1 |
|---|---|
| Target | 0.5 |
| Herbie | 0.4 |
if z < -1.1115719021710903e-29Initial program 11.7
rmApplied *-un-lft-identity11.7
Applied times-frac11.7
Simplified11.7
Simplified0.4
rmApplied div-inv0.6
if -1.1115719021710903e-29 < z < 7.221163952708297e-16Initial program 0.3
rmApplied div-inv0.4
Applied associate-*r*0.4
if 7.221163952708297e-16 < z Initial program 11.3
rmApplied *-un-lft-identity11.3
Applied times-frac11.3
Simplified11.3
Simplified0.3
Final simplification0.4
herbie shell --seed 2020182
(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))