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




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.4 |
|---|---|
| Target | 0.5 |
| Herbie | 0.6 |
if z < -8.06565750284886438e27 or 2.0317376429161032e38 < z Initial program 12.0
rmApplied associate-*r/12.0
Applied associate-/l/0.4
rmApplied div-inv0.5
if -8.06565750284886438e27 < z < 2.0317376429161032e38Initial program 0.6
rmApplied associate-/l*0.7
Final simplification0.6
herbie shell --seed 2020149
(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))