\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1748856571088665297207486973462200713216 \lor \neg \left(z \le 247753.5478154585871379822492599487304688\right):\\
\;\;\;\;\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right) + y}{z \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\end{array}double f(double x, double y, double z) {
double r334939 = x;
double r334940 = cosh(r334939);
double r334941 = y;
double r334942 = r334941 / r334939;
double r334943 = r334940 * r334942;
double r334944 = z;
double r334945 = r334943 / r334944;
return r334945;
}
double f(double x, double y, double z) {
double r334946 = z;
double r334947 = -1.7488565710886653e+39;
bool r334948 = r334946 <= r334947;
double r334949 = 247753.5478154586;
bool r334950 = r334946 <= r334949;
double r334951 = !r334950;
bool r334952 = r334948 || r334951;
double r334953 = 0.5;
double r334954 = x;
double r334955 = 2.0;
double r334956 = pow(r334954, r334955);
double r334957 = y;
double r334958 = r334956 * r334957;
double r334959 = r334953 * r334958;
double r334960 = r334959 + r334957;
double r334961 = r334946 * r334954;
double r334962 = r334960 / r334961;
double r334963 = cosh(r334954);
double r334964 = r334963 * r334957;
double r334965 = r334964 / r334946;
double r334966 = r334965 / r334954;
double r334967 = r334952 ? r334962 : r334966;
return r334967;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.7 |
|---|---|
| Target | 0.5 |
| Herbie | 0.7 |
if z < -1.7488565710886653e+39 or 247753.5478154586 < z Initial program 12.6
rmApplied associate-*r/12.6
Applied associate-/l/0.3
Taylor expanded around 0 1.0
if -1.7488565710886653e+39 < z < 247753.5478154586Initial program 0.4
rmApplied associate-*r/0.4
Applied associate-/l/17.3
rmApplied associate-/r*0.4
Final simplification0.7
herbie shell --seed 2019325
(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.038530535935153e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))
(/ (* (cosh x) (/ y x)) z))