\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -0.0040413612276975971 \lor \neg \left(y \le 1.58436151836249327 \cdot 10^{-57}\right):\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\sqrt{\cosh x} \cdot \sqrt{\cosh x}\right) \cdot \frac{y}{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 (((y <= -0.004041361227697597) || !(y <= 1.5843615183624933e-57))) {
VAR = ((double) (((double) (((double) (((double) cosh(x)) * y)) / z)) / x));
} else {
VAR = ((double) (((double) (((double) (((double) sqrt(((double) cosh(x)))) * ((double) sqrt(((double) cosh(x)))))) * ((double) (y / x)))) / z));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.3 |
|---|---|
| Target | 0.5 |
| Herbie | 0.5 |
if y < -0.0040413612276975971 or 1.58436151836249327e-57 < y Initial program 17.6
rmApplied associate-*r/17.6
Applied associate-/l/0.5
rmApplied associate-/r*0.7
if -0.0040413612276975971 < y < 1.58436151836249327e-57Initial program 0.3
rmApplied add-sqr-sqrt0.3
Final simplification0.5
herbie shell --seed 2020173
(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))