o
    X۷iV                     @  s8   d Z ddlmZ ddlmZ dZejdddedd	Zd
S )aV  
The source code here is an adaptation with minimal changes from the following
file in SciPy's bundled Cephes library:

https://github.com/scipy/scipy/blob/master/scipy/special/cephes/gammasgn.c

Cephes Math Library Release 2.0:  April, 1987
Copyright 1984, 1987 by Stephen L. Moshier
Direct inquiries to 30 Frost Street, Cambridge, MA 02140
    )annotations)_corear  
__device__ double gammasgn(double x)
{
    double fx;

    if (isnan(x)) {
      return x;
    }
    if (x >= 0) {
        return 1.0;
    }
    else {
        fx = floor(x);
        if (x - fx == 0.0) {
            return CUDART_NAN;
        }
        else if ((int)fx % 2) {
            return -1.0;
        }
        else {
            return 1.0;
        }
    }
}
cupyx_scipy_gammasgn)zl->dzL->dze->dzf->fzd->dz out0 = out0_type(gammasgn(in0));zfElementwise function for scipy.special.gammasgn

    .. seealso:: :meth:`scipy.special.gammasgn`

    )preambledocN)__doc__
__future__r   cupyr   gammasgn_definitioncreate_ufuncgammasgn r   r   S/home/ubuntu/vllm_env/lib/python3.10/site-packages/cupyx/scipy/special/_gammasgn.py<module>   s    

