\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -1.0432260555262782 \cdot 10^{-16}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\mathbf{elif}\;y \le 2922533292505.41:\\
\;\;\;\;\frac{\frac{y}{x} \cdot \cosh x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\end{array}double f(double x, double y, double z) {
double r10982124 = x;
double r10982125 = cosh(r10982124);
double r10982126 = y;
double r10982127 = r10982126 / r10982124;
double r10982128 = r10982125 * r10982127;
double r10982129 = z;
double r10982130 = r10982128 / r10982129;
return r10982130;
}
double f(double x, double y, double z) {
double r10982131 = y;
double r10982132 = -1.0432260555262782e-16;
bool r10982133 = r10982131 <= r10982132;
double r10982134 = x;
double r10982135 = cosh(r10982134);
double r10982136 = r10982135 * r10982131;
double r10982137 = z;
double r10982138 = r10982136 / r10982137;
double r10982139 = r10982138 / r10982134;
double r10982140 = 2922533292505.41;
bool r10982141 = r10982131 <= r10982140;
double r10982142 = r10982131 / r10982134;
double r10982143 = r10982142 * r10982135;
double r10982144 = r10982143 / r10982137;
double r10982145 = r10982141 ? r10982144 : r10982139;
double r10982146 = r10982133 ? r10982139 : r10982145;
return r10982146;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.3 |
|---|---|
| Target | 0.5 |
| Herbie | 0.3 |
if y < -1.0432260555262782e-16 or 2922533292505.41 < y Initial program 20.1
rmApplied associate-*r/20.1
Applied associate-/l/0.3
rmApplied associate-/r*0.3
if -1.0432260555262782e-16 < y < 2922533292505.41Initial program 0.3
Final simplification0.3
herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y z)
:name "Linear.Quaternion:$ctan from linear-1.19.1.3"
: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))