\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -1.35750180424885101 \cdot 10^{-17} \lor \neg \left(y \le 1.2052909119810524 \cdot 10^{57}\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\cosh x \cdot \frac{\frac{y}{x}}{z}\\
\end{array}double f(double x, double y, double z) {
double r416335 = x;
double r416336 = cosh(r416335);
double r416337 = y;
double r416338 = r416337 / r416335;
double r416339 = r416336 * r416338;
double r416340 = z;
double r416341 = r416339 / r416340;
return r416341;
}
double f(double x, double y, double z) {
double r416342 = y;
double r416343 = -1.357501804248851e-17;
bool r416344 = r416342 <= r416343;
double r416345 = 1.2052909119810524e+57;
bool r416346 = r416342 <= r416345;
double r416347 = !r416346;
bool r416348 = r416344 || r416347;
double r416349 = x;
double r416350 = cosh(r416349);
double r416351 = z;
double r416352 = r416349 * r416351;
double r416353 = r416342 / r416352;
double r416354 = r416350 * r416353;
double r416355 = r416342 / r416349;
double r416356 = r416355 / r416351;
double r416357 = r416350 * r416356;
double r416358 = r416348 ? r416354 : r416357;
return r416358;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.7 |
|---|---|
| Target | 0.5 |
| Herbie | 0.5 |
if y < -1.357501804248851e-17 or 1.2052909119810524e+57 < y Initial program 22.2
rmApplied *-un-lft-identity22.2
Applied times-frac22.1
Simplified22.1
Simplified0.3
if -1.357501804248851e-17 < y < 1.2052909119810524e+57Initial program 0.6
rmApplied *-un-lft-identity0.6
Applied times-frac0.6
Simplified0.6
Simplified10.3
rmApplied associate-/r*0.6
Final simplification0.5
herbie shell --seed 2020100 +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))