\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -3.139482297119390755310250707982414236905 \cdot 10^{-45}:\\
\;\;\;\;\frac{\cosh x \cdot y}{x \cdot z}\\
\mathbf{elif}\;z \le 1.084913602950906459652906504493151559031 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{\frac{z}{y}}, \frac{1}{2}, \frac{\frac{y}{x}}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x \cdot y}{x \cdot z}\\
\end{array}double f(double x, double y, double z) {
double r23381931 = x;
double r23381932 = cosh(r23381931);
double r23381933 = y;
double r23381934 = r23381933 / r23381931;
double r23381935 = r23381932 * r23381934;
double r23381936 = z;
double r23381937 = r23381935 / r23381936;
return r23381937;
}
double f(double x, double y, double z) {
double r23381938 = z;
double r23381939 = -3.139482297119391e-45;
bool r23381940 = r23381938 <= r23381939;
double r23381941 = x;
double r23381942 = cosh(r23381941);
double r23381943 = y;
double r23381944 = r23381942 * r23381943;
double r23381945 = r23381941 * r23381938;
double r23381946 = r23381944 / r23381945;
double r23381947 = 1.0849136029509065e-11;
bool r23381948 = r23381938 <= r23381947;
double r23381949 = r23381938 / r23381943;
double r23381950 = r23381941 / r23381949;
double r23381951 = 0.5;
double r23381952 = r23381943 / r23381941;
double r23381953 = r23381952 / r23381938;
double r23381954 = fma(r23381950, r23381951, r23381953);
double r23381955 = r23381948 ? r23381954 : r23381946;
double r23381956 = r23381940 ? r23381946 : r23381955;
return r23381956;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 8.0 |
|---|---|
| Target | 0.4 |
| Herbie | 0.6 |
if z < -3.139482297119391e-45 or 1.0849136029509065e-11 < z Initial program 11.4
rmApplied associate-*r/11.4
Applied associate-/l/0.4
if -3.139482297119391e-45 < z < 1.0849136029509065e-11Initial program 0.3
Taylor expanded around 0 22.6
Simplified1.3
Final simplification0.6
herbie shell --seed 2019168 +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))