\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -1.87988751982939395 \cdot 10^{-85} \lor \neg \left(y \le 2.9332543178834714 \cdot 10^{-108}\right):\\
\;\;\;\;{\left(\frac{1}{2} \cdot \frac{y \cdot \left(e^{-1 \cdot x} + e^{x}\right)}{x \cdot z}\right)}^{1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{1}{2} \cdot \left(e^{-1 \cdot x} + e^{x}\right)}{\frac{x}{y}}}{z}\\
\end{array}double f(double x, double y, double z) {
double r576217 = x;
double r576218 = cosh(r576217);
double r576219 = y;
double r576220 = r576219 / r576217;
double r576221 = r576218 * r576220;
double r576222 = z;
double r576223 = r576221 / r576222;
return r576223;
}
double f(double x, double y, double z) {
double r576224 = y;
double r576225 = -1.879887519829394e-85;
bool r576226 = r576224 <= r576225;
double r576227 = 2.9332543178834714e-108;
bool r576228 = r576224 <= r576227;
double r576229 = !r576228;
bool r576230 = r576226 || r576229;
double r576231 = 0.5;
double r576232 = -1.0;
double r576233 = x;
double r576234 = r576232 * r576233;
double r576235 = exp(r576234);
double r576236 = exp(r576233);
double r576237 = r576235 + r576236;
double r576238 = r576224 * r576237;
double r576239 = z;
double r576240 = r576233 * r576239;
double r576241 = r576238 / r576240;
double r576242 = r576231 * r576241;
double r576243 = 1.0;
double r576244 = pow(r576242, r576243);
double r576245 = r576231 * r576237;
double r576246 = r576233 / r576224;
double r576247 = r576245 / r576246;
double r576248 = r576247 / r576239;
double r576249 = r576230 ? r576244 : r576248;
return r576249;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.8 |
|---|---|
| Target | 0.4 |
| Herbie | 1.1 |
if y < -1.879887519829394e-85 or 2.9332543178834714e-108 < y Initial program 14.4
Taylor expanded around inf 14.4
Simplified14.5
rmApplied *-un-lft-identity14.5
Applied div-inv14.5
Applied times-frac14.5
Applied times-frac1.9
Simplified1.9
Simplified2.2
rmApplied pow12.2
Applied pow12.2
Applied pow-prod-down2.2
Simplified1.8
if -1.879887519829394e-85 < y < 2.9332543178834714e-108Initial program 0.3
Taylor expanded around inf 0.3
Simplified0.4
Final simplification1.1
herbie shell --seed 2020083
(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.0385305359351529e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))
(/ (* (cosh x) (/ y x)) z))