\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -4.00597623580221341 \cdot 10^{-28} \lor \neg \left(z \le 9.9511128109062228 \cdot 10^{-6}\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{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 <= -4.0059762358022134e-28) || !(z <= 9.951112810906223e-06))) {
VAR = ((double) (((double) cosh(x)) * ((double) (y / ((double) (x * z))))));
} else {
VAR = ((double) (((double) (((double) (((double) cosh(x)) * y)) / z)) / x));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.6 |
|---|---|
| Target | 0.4 |
| Herbie | 0.3 |
if z < -4.0059762358022134e-28 or 9.951112810906223e-06 < z Initial program 11.3
rmApplied *-un-lft-identity11.3
Applied times-frac11.3
Simplified11.3
Simplified0.4
if -4.0059762358022134e-28 < z < 9.951112810906223e-06Initial program 0.3
rmApplied div-inv0.4
Applied associate-*r*0.4
rmApplied clear-num0.5
Simplified0.4
rmApplied associate-/r*0.4
Simplified0.3
Final simplification0.3
herbie shell --seed 2020123
(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))