\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -5.663392033250732015294860045286254482681 \cdot 10^{67} \lor \neg \left(z \le 1.854353753596801523136697556389482635506 \cdot 10^{70}\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\cosh x \cdot \left(1 \cdot \frac{\frac{y}{z}}{x}\right)\\
\end{array}double f(double x, double y, double z) {
double r457981 = x;
double r457982 = cosh(r457981);
double r457983 = y;
double r457984 = r457983 / r457981;
double r457985 = r457982 * r457984;
double r457986 = z;
double r457987 = r457985 / r457986;
return r457987;
}
double f(double x, double y, double z) {
double r457988 = z;
double r457989 = -5.663392033250732e+67;
bool r457990 = r457988 <= r457989;
double r457991 = 1.8543537535968015e+70;
bool r457992 = r457988 <= r457991;
double r457993 = !r457992;
bool r457994 = r457990 || r457993;
double r457995 = x;
double r457996 = cosh(r457995);
double r457997 = y;
double r457998 = r457995 * r457988;
double r457999 = r457997 / r457998;
double r458000 = r457996 * r457999;
double r458001 = 1.0;
double r458002 = r457997 / r457988;
double r458003 = r458002 / r457995;
double r458004 = r458001 * r458003;
double r458005 = r457996 * r458004;
double r458006 = r457994 ? r458000 : r458005;
return r458006;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 8.1 |
|---|---|
| Target | 0.4 |
| Herbie | 0.7 |
if z < -5.663392033250732e+67 or 1.8543537535968015e+70 < z Initial program 14.6
rmApplied *-un-lft-identity14.6
Applied times-frac14.6
Simplified14.6
Simplified0.3
rmApplied *-un-lft-identity0.3
Applied times-frac11.7
rmApplied frac-times0.3
Simplified0.3
if -5.663392033250732e+67 < z < 1.8543537535968015e+70Initial program 1.4
rmApplied *-un-lft-identity1.4
Applied times-frac1.4
Simplified1.4
Simplified13.9
rmApplied *-un-lft-identity13.9
Applied times-frac1.3
rmApplied *-un-lft-identity1.3
Applied *-un-lft-identity1.3
Applied times-frac1.3
Applied associate-*l*1.3
Simplified1.2
Final simplification0.7
herbie shell --seed 2020001
(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))