\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 r265124 = x;
double r265125 = cosh(r265124);
double r265126 = y;
double r265127 = r265126 / r265124;
double r265128 = r265125 * r265127;
double r265129 = z;
double r265130 = r265128 / r265129;
return r265130;
}
double f(double x, double y, double z) {
double r265131 = z;
double r265132 = -1.7488565710886653e+39;
bool r265133 = r265131 <= r265132;
double r265134 = 247753.5478154586;
bool r265135 = r265131 <= r265134;
double r265136 = !r265135;
bool r265137 = r265133 || r265136;
double r265138 = 0.5;
double r265139 = x;
double r265140 = 2.0;
double r265141 = pow(r265139, r265140);
double r265142 = y;
double r265143 = r265141 * r265142;
double r265144 = r265138 * r265143;
double r265145 = r265144 + r265142;
double r265146 = r265131 * r265139;
double r265147 = r265145 / r265146;
double r265148 = cosh(r265139);
double r265149 = r265148 * r265142;
double r265150 = r265149 / r265131;
double r265151 = r265150 / r265139;
double r265152 = r265137 ? r265147 : r265151;
return r265152;
}




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))