\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -6.8080066842813633 \cdot 10^{50} \lor \neg \left(z \le 4.55122421414426669 \cdot 10^{48}\right):\\
\;\;\;\;\frac{\cosh x \cdot y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x \cdot \frac{y}{z}}{x}\\
\end{array}double f(double x, double y, double z) {
double r592374 = x;
double r592375 = cosh(r592374);
double r592376 = y;
double r592377 = r592376 / r592374;
double r592378 = r592375 * r592377;
double r592379 = z;
double r592380 = r592378 / r592379;
return r592380;
}
double f(double x, double y, double z) {
double r592381 = z;
double r592382 = -6.808006684281363e+50;
bool r592383 = r592381 <= r592382;
double r592384 = 4.551224214144267e+48;
bool r592385 = r592381 <= r592384;
double r592386 = !r592385;
bool r592387 = r592383 || r592386;
double r592388 = x;
double r592389 = cosh(r592388);
double r592390 = y;
double r592391 = r592389 * r592390;
double r592392 = r592388 * r592381;
double r592393 = r592391 / r592392;
double r592394 = r592390 / r592381;
double r592395 = r592389 * r592394;
double r592396 = r592395 / r592388;
double r592397 = r592387 ? r592393 : r592396;
return r592397;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.7 |
|---|---|
| Target | 0.5 |
| Herbie | 0.5 |
if z < -6.808006684281363e+50 or 4.551224214144267e+48 < z Initial program 13.0
rmApplied *-un-lft-identity13.0
Applied times-frac13.0
Simplified13.0
Simplified0.3
rmApplied associate-*r/0.3
if -6.808006684281363e+50 < z < 4.551224214144267e+48Initial program 0.9
rmApplied *-un-lft-identity0.9
Applied times-frac0.9
Simplified0.9
Simplified15.6
rmApplied *-un-lft-identity15.6
Applied times-frac0.7
Applied associate-*r*0.7
Simplified0.7
rmApplied associate-*l/0.7
Final simplification0.5
herbie shell --seed 2020100
(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))