\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -40510205393232588192078396191825461248:\\
\;\;\;\;\frac{\cosh x \cdot y}{x \cdot z}\\
\mathbf{elif}\;y \le 7.039456669498942289348721752920549611426 \cdot 10^{-17}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x \cdot y}{x \cdot z}\\
\end{array}double f(double x, double y, double z) {
double r11881180 = x;
double r11881181 = cosh(r11881180);
double r11881182 = y;
double r11881183 = r11881182 / r11881180;
double r11881184 = r11881181 * r11881183;
double r11881185 = z;
double r11881186 = r11881184 / r11881185;
return r11881186;
}
double f(double x, double y, double z) {
double r11881187 = y;
double r11881188 = -4.051020539323259e+37;
bool r11881189 = r11881187 <= r11881188;
double r11881190 = x;
double r11881191 = cosh(r11881190);
double r11881192 = r11881191 * r11881187;
double r11881193 = z;
double r11881194 = r11881190 * r11881193;
double r11881195 = r11881192 / r11881194;
double r11881196 = 7.039456669498942e-17;
bool r11881197 = r11881187 <= r11881196;
double r11881198 = r11881192 / r11881190;
double r11881199 = r11881198 / r11881193;
double r11881200 = r11881197 ? r11881199 : r11881195;
double r11881201 = r11881189 ? r11881195 : r11881200;
return r11881201;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 8.0 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if y < -4.051020539323259e+37 or 7.039456669498942e-17 < y Initial program 22.7
rmApplied associate-*r/22.7
Applied associate-/l/0.3
if -4.051020539323259e+37 < y < 7.039456669498942e-17Initial program 0.4
rmApplied div-inv0.5
Applied associate-*r*0.5
rmApplied un-div-inv0.4
Final simplification0.4
herbie shell --seed 2019179
(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))