\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -2.3801516175586775 \cdot 10^{-8} \lor \neg \left(z \le 4.3196785162675307 \cdot 10^{97}\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\cosh x \cdot y\right) \cdot \frac{1}{x}}{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 (((z <= -2.3801516175586775e-08) || !(z <= 4.319678516267531e+97))) {
VAR = ((double) (((double) cosh(x)) * ((double) (y / ((double) (x * z))))));
} else {
VAR = ((double) (((double) (((double) (((double) cosh(x)) * y)) * ((double) (1.0 / x)))) / z));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.3 |
|---|---|
| Target | 0.4 |
| Herbie | 0.8 |
if z < -2.3801516175586775e-08 or 4.319678516267531e+97 < z Initial program 12.0
rmApplied *-un-lft-identity12.0
Applied times-frac12.0
Simplified12.0
Simplified0.4
if -2.3801516175586775e-08 < z < 4.319678516267531e+97Initial program 1.2
rmApplied div-inv1.3
Applied associate-*r*1.3
Final simplification0.8
herbie shell --seed 2020129
(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))