\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -2.594701495792515057480404720241474555947 \cdot 10^{144} \lor \neg \left(x \le 131028341213362427538349437327769600\right):\\
\;\;\;\;\frac{1}{z} \cdot \left(\frac{\sin y}{y} \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin y}{y} \cdot \frac{x}{z}\\
\end{array}double f(double x, double y, double z) {
double r323659 = x;
double r323660 = y;
double r323661 = sin(r323660);
double r323662 = r323661 / r323660;
double r323663 = r323659 * r323662;
double r323664 = z;
double r323665 = r323663 / r323664;
return r323665;
}
double f(double x, double y, double z) {
double r323666 = x;
double r323667 = -2.594701495792515e+144;
bool r323668 = r323666 <= r323667;
double r323669 = 1.3102834121336243e+35;
bool r323670 = r323666 <= r323669;
double r323671 = !r323670;
bool r323672 = r323668 || r323671;
double r323673 = 1.0;
double r323674 = z;
double r323675 = r323673 / r323674;
double r323676 = y;
double r323677 = sin(r323676);
double r323678 = r323677 / r323676;
double r323679 = r323678 * r323666;
double r323680 = r323675 * r323679;
double r323681 = r323666 / r323674;
double r323682 = r323678 * r323681;
double r323683 = r323672 ? r323680 : r323682;
return r323683;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.2 |
| Herbie | 0.6 |
if x < -2.594701495792515e+144 or 1.3102834121336243e+35 < x Initial program 0.2
Simplified8.0
rmApplied div-inv8.0
Applied associate-*r*0.4
if -2.594701495792515e+144 < x < 1.3102834121336243e+35Initial program 3.6
Simplified0.7
Taylor expanded around inf 11.1
Simplified0.7
Final simplification0.6
herbie shell --seed 2019179 +o rules:numerics
(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))