\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -5.90737577331802458 \cdot 10^{-57} \lor \neg \left(z \le 1.0700912275797494 \cdot 10^{36}\right):\\
\;\;\;\;\left(\cosh x \cdot y\right) \cdot \frac{\frac{1}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(\cosh x \cdot \frac{y}{x}\right) \cdot \frac{1}{z}\\
\end{array}double f(double x, double y, double z) {
double r581176 = x;
double r581177 = cosh(r581176);
double r581178 = y;
double r581179 = r581178 / r581176;
double r581180 = r581177 * r581179;
double r581181 = z;
double r581182 = r581180 / r581181;
return r581182;
}
double f(double x, double y, double z) {
double r581183 = z;
double r581184 = -5.907375773318025e-57;
bool r581185 = r581183 <= r581184;
double r581186 = 1.0700912275797494e+36;
bool r581187 = r581183 <= r581186;
double r581188 = !r581187;
bool r581189 = r581185 || r581188;
double r581190 = x;
double r581191 = cosh(r581190);
double r581192 = y;
double r581193 = r581191 * r581192;
double r581194 = 1.0;
double r581195 = r581194 / r581190;
double r581196 = r581195 / r581183;
double r581197 = r581193 * r581196;
double r581198 = r581192 / r581190;
double r581199 = r581191 * r581198;
double r581200 = r581194 / r581183;
double r581201 = r581199 * r581200;
double r581202 = r581189 ? r581197 : r581201;
return r581202;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.6 |
|---|---|
| Target | 0.4 |
| Herbie | 0.5 |
if z < -5.907375773318025e-57 or 1.0700912275797494e+36 < z Initial program 11.2
rmApplied div-inv11.2
Applied associate-*r*11.2
rmApplied *-un-lft-identity11.2
Applied times-frac0.6
Simplified0.6
if -5.907375773318025e-57 < z < 1.0700912275797494e+36Initial program 0.4
rmApplied div-inv0.5
Final simplification0.5
herbie shell --seed 2020045
(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))