\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -4.752843063664083532852082831670826586888 \cdot 10^{-45}:\\
\;\;\;\;\frac{\cosh x \cdot y}{x \cdot z}\\
\mathbf{elif}\;z \le 1.114682748693406571974173160313674566142 \cdot 10^{-11}:\\
\;\;\;\;\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 r24033634 = x;
double r24033635 = cosh(r24033634);
double r24033636 = y;
double r24033637 = r24033636 / r24033634;
double r24033638 = r24033635 * r24033637;
double r24033639 = z;
double r24033640 = r24033638 / r24033639;
return r24033640;
}
double f(double x, double y, double z) {
double r24033641 = z;
double r24033642 = -4.7528430636640835e-45;
bool r24033643 = r24033641 <= r24033642;
double r24033644 = x;
double r24033645 = cosh(r24033644);
double r24033646 = y;
double r24033647 = r24033645 * r24033646;
double r24033648 = r24033644 * r24033641;
double r24033649 = r24033647 / r24033648;
double r24033650 = 1.1146827486934066e-11;
bool r24033651 = r24033641 <= r24033650;
double r24033652 = r24033647 / r24033644;
double r24033653 = r24033652 / r24033641;
double r24033654 = r24033651 ? r24033653 : r24033649;
double r24033655 = r24033643 ? r24033649 : r24033654;
return r24033655;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 8.0 |
|---|---|
| Target | 0.4 |
| Herbie | 0.3 |
if z < -4.7528430636640835e-45 or 1.1146827486934066e-11 < z Initial program 11.4
rmApplied associate-*r/11.4
Applied associate-/l/0.4
if -4.7528430636640835e-45 < z < 1.1146827486934066e-11Initial program 0.3
rmApplied *-un-lft-identity0.3
Applied associate-/r*0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019168
(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))