\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -7.807003819640308 \cdot 10^{-86}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\mathbf{elif}\;y \le 1.0579617958619699 \cdot 10^{-66}:\\
\;\;\;\;\frac{\frac{\cosh x}{z}}{\frac{x}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2} \cdot \frac{x \cdot y}{z} + \frac{y}{x \cdot z}\\
\end{array}double f(double x, double y, double z) {
double r407828 = x;
double r407829 = cosh(r407828);
double r407830 = y;
double r407831 = r407830 / r407828;
double r407832 = r407829 * r407831;
double r407833 = z;
double r407834 = r407832 / r407833;
return r407834;
}
double f(double x, double y, double z) {
double r407835 = y;
double r407836 = -7.807003819640308e-86;
bool r407837 = r407835 <= r407836;
double r407838 = x;
double r407839 = cosh(r407838);
double r407840 = r407839 * r407835;
double r407841 = z;
double r407842 = r407840 / r407841;
double r407843 = r407842 / r407838;
double r407844 = 1.0579617958619699e-66;
bool r407845 = r407835 <= r407844;
double r407846 = r407839 / r407841;
double r407847 = r407838 / r407835;
double r407848 = r407846 / r407847;
double r407849 = 0.5;
double r407850 = r407838 * r407835;
double r407851 = r407850 / r407841;
double r407852 = r407849 * r407851;
double r407853 = r407838 * r407841;
double r407854 = r407835 / r407853;
double r407855 = r407852 + r407854;
double r407856 = r407845 ? r407848 : r407855;
double r407857 = r407837 ? r407843 : r407856;
return r407857;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.5 |
|---|---|
| Target | 0.4 |
| Herbie | 1.0 |
if y < -7.807003819640308e-86Initial program 14.5
rmApplied associate-*r/14.5
Applied associate-/l/1.4
rmApplied associate-/r*1.7
if -7.807003819640308e-86 < y < 1.0579617958619699e-66Initial program 0.3
rmApplied associate-*r/0.3
Applied associate-/l/12.7
rmApplied clear-num13.2
rmApplied *-un-lft-identity13.2
Applied add-cube-cbrt13.2
Applied times-frac13.2
Simplified13.2
Simplified0.4
if 1.0579617958619699e-66 < y Initial program 15.8
rmApplied associate-*r/15.8
Applied associate-/l/1.1
rmApplied clear-num1.2
rmApplied *-un-lft-identity1.2
Applied add-cube-cbrt1.2
Applied times-frac1.2
Simplified1.2
Simplified14.4
Taylor expanded around 0 1.7
Final simplification1.0
herbie shell --seed 2019198
(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))