OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libm/] [math/] [wf_tgamma.c] - Diff between revs 207 and 345

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 207 Rev 345
/* w_gammaf.c -- float version of w_gamma.c.
/* w_gammaf.c -- float version of w_gamma.c.
 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
 */
 */
 
 
/*
/*
 * ====================================================
 * ====================================================
 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
 *
 *
 * Developed at SunPro, a Sun Microsystems, Inc. business.
 * Developed at SunPro, a Sun Microsystems, Inc. business.
 * Permission to use, copy, modify, and distribute this
 * Permission to use, copy, modify, and distribute this
 * software is freely granted, provided that this notice
 * software is freely granted, provided that this notice
 * is preserved.
 * is preserved.
 * ====================================================
 * ====================================================
 */
 */
 
 
#include "math.h"
#include "math.h"
#include "fdlibm.h"
#include "fdlibm.h"
 
 
#ifdef __STDC__
#ifdef __STDC__
        float tgammaf(float x)
        float tgammaf(float x)
#else
#else
        float tgammaf(x)
        float tgammaf(x)
        float x;
        float x;
#endif
#endif
{
{
        float y;
        float y;
        int local_signgam;
        int local_signgam;
        y = __ieee754_gammaf_r(x,&local_signgam);
        y = __ieee754_gammaf_r(x,&local_signgam);
        if (local_signgam < 0) y = -y;
        if (local_signgam < 0) y = -y;
#ifdef _IEEE_LIBM
#ifdef _IEEE_LIBM
        return y;
        return y;
#else
#else
        if(_LIB_VERSION == _IEEE_) return y;
        if(_LIB_VERSION == _IEEE_) return y;
 
 
        if(!finitef(y)&&finitef(x)) {
        if(!finitef(y)&&finitef(x)) {
          if(floorf(x)==x&&x<=(float)0.0)
          if(floorf(x)==x&&x<=(float)0.0)
            /* tgammaf pole */
            /* tgammaf pole */
            return (float)__kernel_standard((double)x,(double)x,141);
            return (float)__kernel_standard((double)x,(double)x,141);
          else
          else
            /* tgammaf overflow */
            /* tgammaf overflow */
            return (float)__kernel_standard((double)x,(double)x,140);
            return (float)__kernel_standard((double)x,(double)x,140);
        }
        }
        return y;
        return y;
#endif
#endif
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.