\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -1.72843423949862217 \cdot 10^{-14}:\\
\;\;\;\;\frac{\cosh x}{\frac{x \cdot z}{y}}\\
\mathbf{elif}\;y \le 6802291.148674449:\\
\;\;\;\;\frac{\cosh x \cdot \frac{y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2} \cdot \frac{x \cdot y}{z} + \frac{\frac{y}{z}}{x}\\
\end{array}double f(double x, double y, double z) {
double r577075 = x;
double r577076 = cosh(r577075);
double r577077 = y;
double r577078 = r577077 / r577075;
double r577079 = r577076 * r577078;
double r577080 = z;
double r577081 = r577079 / r577080;
return r577081;
}
double f(double x, double y, double z) {
double r577082 = y;
double r577083 = -1.7284342394986222e-14;
bool r577084 = r577082 <= r577083;
double r577085 = x;
double r577086 = cosh(r577085);
double r577087 = z;
double r577088 = r577085 * r577087;
double r577089 = r577088 / r577082;
double r577090 = r577086 / r577089;
double r577091 = 6802291.148674449;
bool r577092 = r577082 <= r577091;
double r577093 = r577082 / r577085;
double r577094 = r577086 * r577093;
double r577095 = r577094 / r577087;
double r577096 = 0.5;
double r577097 = r577085 * r577082;
double r577098 = r577097 / r577087;
double r577099 = r577096 * r577098;
double r577100 = r577082 / r577087;
double r577101 = r577100 / r577085;
double r577102 = r577099 + r577101;
double r577103 = r577092 ? r577095 : r577102;
double r577104 = r577084 ? r577090 : r577103;
return r577104;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.5 |
if y < -1.7284342394986222e-14Initial program 19.8
rmApplied associate-/l*19.9
Simplified18.2
rmApplied pow118.2
Applied pow118.2
Applied pow-prod-down18.2
Simplified0.4
if -1.7284342394986222e-14 < y < 6802291.148674449Initial program 0.3
if 6802291.148674449 < y Initial program 22.1
Taylor expanded around 0 1.5
rmApplied clear-num1.6
Taylor expanded around 0 1.5
Simplified1.5
Final simplification0.5
herbie shell --seed 2020042
(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))