\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.93577210121831744 \cdot 10^{80} \lor \neg \left(z \le 2.60686388496247717 \cdot 10^{-42}\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x}{\frac{z}{y} \cdot x}\\
\end{array}double f(double x, double y, double z) {
double r523537 = x;
double r523538 = cosh(r523537);
double r523539 = y;
double r523540 = r523539 / r523537;
double r523541 = r523538 * r523540;
double r523542 = z;
double r523543 = r523541 / r523542;
return r523543;
}
double f(double x, double y, double z) {
double r523544 = z;
double r523545 = -1.9357721012183174e+80;
bool r523546 = r523544 <= r523545;
double r523547 = 2.6068638849624772e-42;
bool r523548 = r523544 <= r523547;
double r523549 = !r523548;
bool r523550 = r523546 || r523549;
double r523551 = x;
double r523552 = cosh(r523551);
double r523553 = y;
double r523554 = r523551 * r523544;
double r523555 = r523553 / r523554;
double r523556 = r523552 * r523555;
double r523557 = r523544 / r523553;
double r523558 = r523557 * r523551;
double r523559 = r523552 / r523558;
double r523560 = r523550 ? r523556 : r523559;
return r523560;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.7 |
if z < -1.9357721012183174e+80 or 2.6068638849624772e-42 < z Initial program 12.0
rmApplied *-un-lft-identity12.0
Applied times-frac12.0
Simplified12.0
Simplified0.4
if -1.9357721012183174e+80 < z < 2.6068638849624772e-42Initial program 1.3
rmApplied associate-/l*1.4
Simplified1.2
Final simplification0.7
herbie shell --seed 2020047
(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))