\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.150123078305551352915999172151981233547 \cdot 10^{-8} \lor \neg \left(z \le 1.096497473325428813191452397318998843153 \cdot 10^{72}\right):\\
\;\;\;\;\frac{\cosh x \cdot 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 r389222 = x;
double r389223 = cosh(r389222);
double r389224 = y;
double r389225 = r389224 / r389222;
double r389226 = r389223 * r389225;
double r389227 = z;
double r389228 = r389226 / r389227;
return r389228;
}
double f(double x, double y, double z) {
double r389229 = z;
double r389230 = -1.1501230783055514e-08;
bool r389231 = r389229 <= r389230;
double r389232 = 1.0964974733254288e+72;
bool r389233 = r389229 <= r389232;
double r389234 = !r389233;
bool r389235 = r389231 || r389234;
double r389236 = x;
double r389237 = cosh(r389236);
double r389238 = y;
double r389239 = r389237 * r389238;
double r389240 = r389229 * r389236;
double r389241 = r389239 / r389240;
double r389242 = r389239 / r389229;
double r389243 = r389242 / r389236;
double r389244 = r389235 ? r389241 : r389243;
return r389244;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if z < -1.1501230783055514e-08 or 1.0964974733254288e+72 < z Initial program 12.5
rmApplied associate-*r/12.5
Applied associate-/l/0.3
if -1.1501230783055514e-08 < z < 1.0964974733254288e+72Initial program 0.8
rmApplied associate-*r/0.8
Applied associate-/l/17.0
rmApplied associate-/r*0.6
Final simplification0.4
herbie shell --seed 2019212 +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.03853053593515302e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))
(/ (* (cosh x) (/ y x)) z))