\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -2.56082919711251703348519476677496253443 \cdot 10^{-15} \lor \neg \left(z \le 4.489894380771518759583953311198839017656 \cdot 10^{-96}\right):\\
\;\;\;\;\frac{y}{\frac{\frac{x}{\sqrt[3]{\cosh x} \cdot \sqrt[3]{\cosh x}}}{\sqrt[3]{\cosh x}} \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{\frac{x}{\cosh x}}\\
\end{array}double f(double x, double y, double z) {
double r468680 = x;
double r468681 = cosh(r468680);
double r468682 = y;
double r468683 = r468682 / r468680;
double r468684 = r468681 * r468683;
double r468685 = z;
double r468686 = r468684 / r468685;
return r468686;
}
double f(double x, double y, double z) {
double r468687 = z;
double r468688 = -2.560829197112517e-15;
bool r468689 = r468687 <= r468688;
double r468690 = 4.489894380771519e-96;
bool r468691 = r468687 <= r468690;
double r468692 = !r468691;
bool r468693 = r468689 || r468692;
double r468694 = y;
double r468695 = x;
double r468696 = cosh(r468695);
double r468697 = cbrt(r468696);
double r468698 = r468697 * r468697;
double r468699 = r468695 / r468698;
double r468700 = r468699 / r468697;
double r468701 = r468700 * r468687;
double r468702 = r468694 / r468701;
double r468703 = r468694 / r468687;
double r468704 = r468695 / r468696;
double r468705 = r468703 / r468704;
double r468706 = r468693 ? r468702 : r468705;
return r468706;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.8 |
|---|---|
| Target | 0.5 |
| Herbie | 0.7 |
if z < -2.560829197112517e-15 or 4.489894380771519e-96 < z Initial program 10.5
Simplified10.5
rmApplied div-inv10.6
Applied associate-/l*0.9
Simplified0.8
rmApplied add-cube-cbrt0.9
Applied associate-/r*0.8
if -2.560829197112517e-15 < z < 4.489894380771519e-96Initial program 0.3
Simplified0.3
rmApplied div-inv0.4
Applied associate-/l*23.9
Simplified23.8
rmApplied associate-/r*0.3
Final simplification0.7
herbie shell --seed 2019194 +o rules:numerics
(FPCore (x y z)
:name "Linear.Quaternion:$ctan from linear-1.19.1.3"
:herbie-target
(if (< y -4.618902267687042e-52) (* (/ (/ y z) x) (cosh x)) (if (< y 1.038530535935153e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))
(/ (* (cosh x) (/ y x)) z))