\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -130312301642489093169348608 \lor \neg \left(z \le 1.127503885584835035756866392214263129945 \cdot 10^{69}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y}{\sin y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \frac{y}{\sin y}}\\
\end{array}double f(double x, double y, double z) {
double r996603 = x;
double r996604 = y;
double r996605 = sin(r996604);
double r996606 = r996605 / r996604;
double r996607 = r996603 * r996606;
double r996608 = z;
double r996609 = r996607 / r996608;
return r996609;
}
double f(double x, double y, double z) {
double r996610 = z;
double r996611 = -1.303123016424891e+26;
bool r996612 = r996610 <= r996611;
double r996613 = 1.127503885584835e+69;
bool r996614 = r996610 <= r996613;
double r996615 = !r996614;
bool r996616 = r996612 || r996615;
double r996617 = x;
double r996618 = r996617 / r996610;
double r996619 = y;
double r996620 = sin(r996619);
double r996621 = r996619 / r996620;
double r996622 = r996618 / r996621;
double r996623 = r996610 * r996621;
double r996624 = r996617 / r996623;
double r996625 = r996616 ? r996622 : r996624;
return r996625;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if z < -1.303123016424891e+26 or 1.127503885584835e+69 < z Initial program 0.1
rmApplied associate-/l*6.2
Simplified6.2
rmApplied associate-/r*0.1
if -1.303123016424891e+26 < z < 1.127503885584835e+69Initial program 4.7
rmApplied associate-/l*0.4
Simplified0.4
Final simplification0.3
herbie shell --seed 2019303 +o rules:numerics
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< z -4.21737202034271466e-29) (/ (* x (/ 1 (/ y (sin y)))) z) (if (< z 4.44670236911381103e64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))