\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -0.17773348789390944:\\
\;\;\;\;\frac{y}{z \cdot \frac{x}{\cosh x}}\\
\mathbf{elif}\;z \le 7.165052739410651 \cdot 10^{-33}:\\
\;\;\;\;\frac{\frac{1}{\frac{\frac{x}{\cosh x}}{y}}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{x}{\cosh x}}\\
\end{array}double f(double x, double y, double z) {
double r29085927 = x;
double r29085928 = cosh(r29085927);
double r29085929 = y;
double r29085930 = r29085929 / r29085927;
double r29085931 = r29085928 * r29085930;
double r29085932 = z;
double r29085933 = r29085931 / r29085932;
return r29085933;
}
double f(double x, double y, double z) {
double r29085934 = z;
double r29085935 = -0.17773348789390944;
bool r29085936 = r29085934 <= r29085935;
double r29085937 = y;
double r29085938 = x;
double r29085939 = cosh(r29085938);
double r29085940 = r29085938 / r29085939;
double r29085941 = r29085934 * r29085940;
double r29085942 = r29085937 / r29085941;
double r29085943 = 7.165052739410651e-33;
bool r29085944 = r29085934 <= r29085943;
double r29085945 = 1.0;
double r29085946 = r29085940 / r29085937;
double r29085947 = r29085945 / r29085946;
double r29085948 = r29085947 / r29085934;
double r29085949 = r29085944 ? r29085948 : r29085942;
double r29085950 = r29085936 ? r29085942 : r29085949;
return r29085950;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.3 |
|---|---|
| Target | 0.4 |
| Herbie | 0.3 |
if z < -0.17773348789390944 or 7.165052739410651e-33 < z Initial program 10.8
rmApplied *-un-lft-identity10.8
Applied associate-/r*10.8
Simplified10.8
rmApplied associate-/l/0.3
if -0.17773348789390944 < z < 7.165052739410651e-33Initial program 0.3
rmApplied *-un-lft-identity0.3
Applied associate-/r*0.3
Simplified0.3
rmApplied clear-num0.4
Final simplification0.3
herbie shell --seed 2019158
(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))