\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.083751370533967347078416018295024354878 \cdot 10^{-102}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{\sin y}{y}\\
\mathbf{elif}\;z \le 3.193474315482475654610578332547852767746 \cdot 10^{-129}:\\
\;\;\;\;\frac{\frac{\sin y}{y}}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{\sin y}{y}\\
\end{array}double f(double x, double y, double z) {
double r24887584 = x;
double r24887585 = y;
double r24887586 = sin(r24887585);
double r24887587 = r24887586 / r24887585;
double r24887588 = r24887584 * r24887587;
double r24887589 = z;
double r24887590 = r24887588 / r24887589;
return r24887590;
}
double f(double x, double y, double z) {
double r24887591 = z;
double r24887592 = -1.0837513705339673e-102;
bool r24887593 = r24887591 <= r24887592;
double r24887594 = x;
double r24887595 = r24887594 / r24887591;
double r24887596 = y;
double r24887597 = sin(r24887596);
double r24887598 = r24887597 / r24887596;
double r24887599 = r24887595 * r24887598;
double r24887600 = 3.1934743154824757e-129;
bool r24887601 = r24887591 <= r24887600;
double r24887602 = r24887598 / r24887591;
double r24887603 = r24887602 * r24887594;
double r24887604 = r24887601 ? r24887603 : r24887599;
double r24887605 = r24887593 ? r24887599 : r24887604;
return r24887605;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.6 |
if z < -1.0837513705339673e-102 or 3.1934743154824757e-129 < z Initial program 0.8
rmApplied *-commutative0.8
rmApplied *-un-lft-identity0.8
Applied times-frac0.6
Simplified0.6
if -1.0837513705339673e-102 < z < 3.1934743154824757e-129Initial program 8.1
rmApplied *-un-lft-identity8.1
Applied times-frac0.4
Simplified0.4
Final simplification0.6
herbie shell --seed 2019170
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:herbie-target
(if (< z -4.2173720203427147e-29) (/ (* x (/ 1.0 (/ y (sin y)))) z) (if (< z 4.446702369113811e+64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1.0 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))