\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \leq -1.421844084123241 \cdot 10^{-106} \lor \neg \left(z \leq 3.816061514969669 \cdot 10^{-14}\right):\\
\;\;\;\;\frac{\cosh x \cdot y}{z \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\cosh x \cdot \frac{\frac{y}{x}}{z}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
(FPCore (x y z) :precision binary64 (if (or (<= z -1.421844084123241e-106) (not (<= z 3.816061514969669e-14))) (/ (* (cosh x) y) (* z x)) (* (cosh x) (/ (/ y x) z))))
double code(double x, double y, double z) {
return (cosh(x) * (y / x)) / z;
}
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.421844084123241e-106) || !(z <= 3.816061514969669e-14)) {
tmp = (cosh(x) * y) / (z * x);
} else {
tmp = cosh(x) * ((y / x) / z);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.7 |
if z < -1.421844084123241e-106 or 3.8160615149696689e-14 < z Initial program 10.6
rmApplied associate-*r/_binary64_1297810.6
Applied associate-/l/_binary64_129830.8
Simplified0.8
if -1.421844084123241e-106 < z < 3.8160615149696689e-14Initial program 0.3
rmApplied *-un-lft-identity_binary64_130360.3
Applied times-frac_binary64_130420.3
Simplified0.3
Final simplification0.7
herbie shell --seed 2020355
(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))