\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.986686670783298043324591018464960578634 \cdot 10^{-19}:\\
\;\;\;\;\frac{y \cdot \cosh x}{x \cdot z}\\
\mathbf{elif}\;z \le 7.189025362679728768411324688191991410865 \cdot 10^{-40}:\\
\;\;\;\;\left(\frac{y}{x} \cdot \cosh x\right) \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \cosh x}{x \cdot z}\\
\end{array}double f(double x, double y, double z) {
double r25521041 = x;
double r25521042 = cosh(r25521041);
double r25521043 = y;
double r25521044 = r25521043 / r25521041;
double r25521045 = r25521042 * r25521044;
double r25521046 = z;
double r25521047 = r25521045 / r25521046;
return r25521047;
}
double f(double x, double y, double z) {
double r25521048 = z;
double r25521049 = -1.986686670783298e-19;
bool r25521050 = r25521048 <= r25521049;
double r25521051 = y;
double r25521052 = x;
double r25521053 = cosh(r25521052);
double r25521054 = r25521051 * r25521053;
double r25521055 = r25521052 * r25521048;
double r25521056 = r25521054 / r25521055;
double r25521057 = 7.189025362679729e-40;
bool r25521058 = r25521048 <= r25521057;
double r25521059 = r25521051 / r25521052;
double r25521060 = r25521059 * r25521053;
double r25521061 = 1.0;
double r25521062 = r25521061 / r25521048;
double r25521063 = r25521060 * r25521062;
double r25521064 = r25521058 ? r25521063 : r25521056;
double r25521065 = r25521050 ? r25521056 : r25521064;
return r25521065;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.5 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if z < -1.986686670783298e-19 or 7.189025362679729e-40 < z Initial program 10.8
rmApplied associate-*r/10.8
Applied associate-/l/0.4
if -1.986686670783298e-19 < z < 7.189025362679729e-40Initial program 0.3
rmApplied div-inv0.4
Final simplification0.4
herbie shell --seed 2019200
(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))