\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -4.1179437477253498797497071716188107059 \cdot 10^{-81} \lor \neg \left(x \le 5.715011145653865345597923439061032092042 \cdot 10^{-24}\right):\\
\;\;\;\;\frac{x \cdot \left(\sin y \cdot \frac{1}{y}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\frac{z}{x}}{\frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r544505 = x;
double r544506 = y;
double r544507 = sin(r544506);
double r544508 = r544507 / r544506;
double r544509 = r544505 * r544508;
double r544510 = z;
double r544511 = r544509 / r544510;
return r544511;
}
double f(double x, double y, double z) {
double r544512 = x;
double r544513 = -4.11794374772535e-81;
bool r544514 = r544512 <= r544513;
double r544515 = 5.715011145653865e-24;
bool r544516 = r544512 <= r544515;
double r544517 = !r544516;
bool r544518 = r544514 || r544517;
double r544519 = y;
double r544520 = sin(r544519);
double r544521 = 1.0;
double r544522 = r544521 / r544519;
double r544523 = r544520 * r544522;
double r544524 = r544512 * r544523;
double r544525 = z;
double r544526 = r544524 / r544525;
double r544527 = r544525 / r544512;
double r544528 = r544520 / r544519;
double r544529 = r544527 / r544528;
double r544530 = r544521 / r544529;
double r544531 = r544518 ? r544526 : r544530;
return r544531;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.7 |
if x < -4.11794374772535e-81 or 5.715011145653865e-24 < x Initial program 0.5
rmApplied div-inv0.6
if -4.11794374772535e-81 < x < 5.715011145653865e-24Initial program 5.3
rmApplied div-inv5.4
rmApplied clear-num5.9
Simplified0.9
Final simplification0.7
herbie shell --seed 2020002
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< z -4.2173720203427147e-29) (/ (* x (/ 1 (/ y (sin y)))) z) (if (< z 4.446702369113811e+64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))