\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -9.689094535544859 \lor \neg \left(z \le 4.3133036925259257 \cdot 10^{-14}\right):\\
\;\;\;\;\frac{\cosh x \cdot y}{z \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\end{array}double code(double x, double y, double z) {
return ((cosh(x) * (y / x)) / z);
}
double code(double x, double y, double z) {
double VAR;
if (((z <= -9.689094535544859) || !(z <= 4.313303692525926e-14))) {
VAR = ((cosh(x) * y) / (z * x));
} else {
VAR = (((cosh(x) * y) / z) / x);
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.5 |
|---|---|
| Target | 0.5 |
| Herbie | 0.3 |
if z < -9.689094535544859 or 4.313303692525926e-14 < z Initial program 11.2
rmApplied associate-*r/11.2
Applied associate-/l/0.3
if -9.689094535544859 < z < 4.313303692525926e-14Initial program 0.3
rmApplied associate-*r/0.3
Applied associate-/l/19.5
rmApplied associate-/r*0.3
Final simplification0.3
herbie shell --seed 2020105 +o rules:numerics
(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))