\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;\frac{\cosh x \cdot \frac{y}{x}}{z} \le -3.58400891098028717 \cdot 10^{108}:\\
\;\;\;\;\frac{1}{\frac{z}{\cosh x \cdot y} \cdot x}\\
\mathbf{elif}\;\frac{\cosh x \cdot \frac{y}{x}}{z} \le 1.5273947602591855 \cdot 10^{302}:\\
\;\;\;\;\frac{\cosh x \cdot \frac{y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x}{1} \cdot \frac{y}{x \cdot z}\\
\end{array}double f(double x, double y, double z) {
double r395321 = x;
double r395322 = cosh(r395321);
double r395323 = y;
double r395324 = r395323 / r395321;
double r395325 = r395322 * r395324;
double r395326 = z;
double r395327 = r395325 / r395326;
return r395327;
}
double f(double x, double y, double z) {
double r395328 = x;
double r395329 = cosh(r395328);
double r395330 = y;
double r395331 = r395330 / r395328;
double r395332 = r395329 * r395331;
double r395333 = z;
double r395334 = r395332 / r395333;
double r395335 = -3.584008910980287e+108;
bool r395336 = r395334 <= r395335;
double r395337 = 1.0;
double r395338 = r395329 * r395330;
double r395339 = r395333 / r395338;
double r395340 = r395339 * r395328;
double r395341 = r395337 / r395340;
double r395342 = 1.5273947602591855e+302;
bool r395343 = r395334 <= r395342;
double r395344 = r395329 / r395337;
double r395345 = r395328 * r395333;
double r395346 = r395330 / r395345;
double r395347 = r395344 * r395346;
double r395348 = r395343 ? r395334 : r395347;
double r395349 = r395336 ? r395341 : r395348;
return r395349;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.2 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if (/ (* (cosh x) (/ y x)) z) < -3.584008910980287e+108Initial program 19.0
rmApplied div-inv19.1
Applied associate-*r*19.1
rmApplied clear-num19.1
Simplified0.6
if -3.584008910980287e+108 < (/ (* (cosh x) (/ y x)) z) < 1.5273947602591855e+302Initial program 0.2
rmApplied div-inv0.3
Applied associate-*r*0.3
rmApplied associate-*l*0.3
Simplified0.2
if 1.5273947602591855e+302 < (/ (* (cosh x) (/ y x)) z) Initial program 60.5
rmApplied div-inv60.5
Applied associate-*r*60.5
rmApplied clear-num60.5
Simplified0.8
rmApplied add-cube-cbrt0.8
Applied times-frac1.0
Simplified1.0
Simplified1.0
rmApplied *-un-lft-identity1.0
Applied times-frac1.0
Applied associate-*l*0.8
Simplified2.2
Final simplification0.4
herbie shell --seed 2020062 +o rules:numerics
(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))