The npy_math.c is attached here.

Cheers,

Olivia


----- Original Message ----
> On Wed, Nov 25, 2009 at 6:42 PM, Olivia Cheronet
> wrote:
> > The crt0.o file was indeed missing. I have reinstalled cygwin from the 
> > cygwin 
> setup.exe (as it seemed to be included therein), and it seems to have solved 
> that.
> >
> > compile options: '-Inumpy/core/include 
> -Ibuild/src.cygwin-1.5.25-i686-2.5/numpy/
> > core/include/numpy -Inumpy/core/src -Inumpy/core/include 
> -I/usr/include/python2.
> > 5 -c'
> > gcc: build/src.cygwin-1.5.25-i686-2.5/numpy/core/src/npy_math.c
> > numpy/core/src/npy_math.c.src:186: error: parse error before '/' token
> > numpy/core/src/npy_math.c.src:186: error: parse error before '/' token
> > error: Command "gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall 
> -Wstrict-
> > prototypes -Inumpy/core/include 
> -Ibuild/src.cygwin-1.5.25-i686-2.5/numpy/core/in
> > clude/numpy -Inumpy/core/src -Inumpy/core/include -I/usr/include/python2.5 
> > -c 
> bu
> > ild/src.cygwin-1.5.25-i686-2.5/numpy/core/src/npy_math.c -o 
> build/temp.cygwin-1.
> > 5.25-i686-2.5/build/src.cygwin-1.5.25-i686-2.5/numpy/core/src/npy_math.o" 
> failed
> >  with exit status 1
> 
> Which version of the trunk are you using ? From the error, it looks
> like a C99-style // comment (which should not be there), but I don't
> see it in the last revision.
> 
> Could you put the content of the file
> build/src.cygwin-1.5.25-i686-2.5/numpy/core/src/npy_math.c as well ?
> 
> thanks,
> 
> David



      
#line 1 "numpy/core/src/npy_math.c.src"

/*
 *****************************************************************************
 **       This file was autogenerated from a template  DO NOT EDIT!!!!      **
 **       Changes should be made to the original source (.src) file         **
 *****************************************************************************
 */

#line 1
/*
 * vim:syntax=c
 * A small module to implement missing C99 math capabilities required by numpy
 *
 * Please keep this independant of python ! Only basic types (npy_longdouble)
 * can be used, otherwise, pure C, without any use of Python facilities
 *
 * How to add a function to this section
 * -------------------------------------
 *
 * Say you want to add `foo`, these are the steps and the reasons for them.
 *
 * 1) Add foo to the appropriate list in the configuration system. The
 *    lists can be found in numpy/core/setup.py lines 63-105. Read the
 *    comments that come with them, they are very helpful.
 *
 * 2) The configuration system will define a macro HAVE_FOO if your function
 *    can be linked from the math library. The result can depend on the
 *    optimization flags as well as the compiler, so can't be known ahead of
 *    time. If the function can't be linked, then either it is absent, defined
 *    as a macro, or is an intrinsic (hardware) function.
 *
 *    i) Undefine any possible macros:
 *
 *    #ifdef foo
 *    #undef foo
 *    #endif
 *
 *    ii) Avoid as much as possible to declare any function here. Declaring
 *    functions is not portable: some platforms define some function inline
 *    with a non standard identifier, for example, or may put another
 *    idendifier which changes the calling convention of the function. If you
 *    really have to, ALWAYS declare it for the one platform you are dealing
 *    with:
 *
 *    Not ok:
 *        double exp(double a);
 *
 *    Ok:
 *        #ifdef SYMBOL_DEFINED_WEIRD_PLATFORM
 *        double exp(double);
 *        #endif
 */

#include <Python.h>
#include <math.h>

#include "config.h"
#include "numpy/npy_math.h"

/*
 *****************************************************************************
 **                     BASIC MATH FUNCTIONS                                **
 *****************************************************************************
 */

/* Original code by Konrad Hinsen.  */
#ifndef HAVE_EXPM1
static double expm1(double x)
{
    double u = exp(x);
    if (u == 1.0) {
        return x;
    } else if (u-1.0 == -1.0) {
        return -1;
    } else {
        return (u-1.0) * x/log(u);
    }
}
#endif

#ifndef HAVE_LOG1P
static double log1p(double x)
{
    double u = 1. + x;
    if (u == 1.0) {
        return x;
    } else {
        return log(u) * x / (u - 1);
    }
}
#endif

#ifndef HAVE_HYPOT
static double hypot(double x, double y)
{
    double yx;

    x = fabs(x);
    y = fabs(y);
    if (x < y) {
        double temp = x;
        x = y;
        y = temp;
    }
    if (x == 0.)
        return 0.;
    else {
        yx = y/x;
        return x*sqrt(1.+yx*yx);
    }
}
#endif

#ifndef HAVE_ACOSH
static double acosh(double x)
{
    return 2*log(sqrt((x+1.0)/2)+sqrt((x-1.0)/2));
}
#endif

#ifndef HAVE_ASINH
static double asinh(double xx)
{
    double x, d;
    int sign;
    if (xx < 0.0) {
        sign = -1;
        x = -xx;
    }
    else {
        sign = 1;
        x = xx;
    }
    if (x > 1e8) {
        d = x;
    } else {
        d = sqrt(x*x + 1);
    }
    return sign*log1p(x*(1.0 + x/(d+1)));
}
#endif

#ifndef HAVE_ATANH
static double atanh(double x)
{
    if (x > 0) {
        return -0.5*log1p(-2.0*x/(1.0 + x));
    }
    else {
        return 0.5*log1p(2.0*x/(1.0 - x));
    }
}
#endif

#ifndef HAVE_RINT
static double rint(double x)
{
    double y, r;

    y = floor(x);
    r = x - y;

    if (r > 0.5) goto rndup;

    /* Round to nearest even */
    if (r==0.5) {
        r = y - 2.0*floor(0.5*y);
        if (r==1.0) {
        rndup:
            y+=1.0;
        }
    }
    return y;
}
#endif

#ifndef HAVE_TRUNC
static double trunc(double x)
{
    return x < 0 ? ceil(x) : floor(x);
}
#endif

#ifndef HAVE_EXP2
#define LOG2 0.69314718055994530943
static double exp2(double x)
{
    return exp(LOG2*x);
}
#undef LOG2
#endif

#ifndef HAVE_LOG2
#define INVLOG2 1.4426950408889634074
static double log2(double x)
{
    return INVLOG2*log(x);
}
#undef INVLOG2
#endif

/*
 *****************************************************************************
 **                     IEEE 754 FPU HANDLING                               **
 *****************************************************************************
 */
#if !defined(HAVE_DECL_SIGNBIT)
#include "_signbit.c"

int _npy_signbit_f (float x)
{
    return _npy_signbit_d((double)x);
}

int _npy_signbit_ld (long double x)
{
    return _npy_signbit_d((double)x);
}
#endif

/*
 * if C99 extensions not available then define dummy functions that use the
 * double versions for
 *
 * sin, cos, tan
 * sinh, cosh, tanh,
 * fabs, floor, ceil, rint, trunc
 * sqrt, log10, log, exp, expm1
 * asin, acos, atan,
 * asinh, acosh, atanh
 *
 * hypot, atan2, pow, fmod, modf
 *
 * We assume the above are always available in their double versions.
 *
 * NOTE: some facilities may be available as macro only  instead of functions.
 * For simplicity, we define our own functions and undef the macros. We could
 * instead test for the macro, but I am lazy to do that for now.
 */

#line 238

#line 245

#ifdef sinl
#undef sinl
#endif
#ifndef HAVE_SINL
static npy_longdouble sinl(npy_longdouble x)
{
    return (npy_longdouble) sin((double)x);
}
#endif


#line 245

#ifdef cosl
#undef cosl
#endif
#ifndef HAVE_COSL
static npy_longdouble cosl(npy_longdouble x)
{
    return (npy_longdouble) cos((double)x);
}
#endif


#line 245

#ifdef tanl
#undef tanl
#endif
#ifndef HAVE_TANL
static npy_longdouble tanl(npy_longdouble x)
{
    return (npy_longdouble) tan((double)x);
}
#endif


#line 245

#ifdef sinhl
#undef sinhl
#endif
#ifndef HAVE_SINHL
static npy_longdouble sinhl(npy_longdouble x)
{
    return (npy_longdouble) sinh((double)x);
}
#endif


#line 245

#ifdef coshl
#undef coshl
#endif
#ifndef HAVE_COSHL
static npy_longdouble coshl(npy_longdouble x)
{
    return (npy_longdouble) cosh((double)x);
}
#endif


#line 245

#ifdef tanhl
#undef tanhl
#endif
#ifndef HAVE_TANHL
static npy_longdouble tanhl(npy_longdouble x)
{
    return (npy_longdouble) tanh((double)x);
}
#endif


#line 245

#ifdef fabsl
#undef fabsl
#endif
#ifndef HAVE_FABSL
static npy_longdouble fabsl(npy_longdouble x)
{
    return (npy_longdouble) fabs((double)x);
}
#endif


#line 245

#ifdef floorl
#undef floorl
#endif
#ifndef HAVE_FLOORL
static npy_longdouble floorl(npy_longdouble x)
{
    return (npy_longdouble) floor((double)x);
}
#endif


#line 245

#ifdef ceill
#undef ceill
#endif
#ifndef HAVE_CEILL
static npy_longdouble ceill(npy_longdouble x)
{
    return (npy_longdouble) ceil((double)x);
}
#endif


#line 245

#ifdef rintl
#undef rintl
#endif
#ifndef HAVE_RINTL
static npy_longdouble rintl(npy_longdouble x)
{
    return (npy_longdouble) rint((double)x);
}
#endif


#line 245

#ifdef truncl
#undef truncl
#endif
#ifndef HAVE_TRUNCL
static npy_longdouble truncl(npy_longdouble x)
{
    return (npy_longdouble) trunc((double)x);
}
#endif


#line 245

#ifdef sqrtl
#undef sqrtl
#endif
#ifndef HAVE_SQRTL
static npy_longdouble sqrtl(npy_longdouble x)
{
    return (npy_longdouble) sqrt((double)x);
}
#endif


#line 245

#ifdef log10l
#undef log10l
#endif
#ifndef HAVE_LOG10L
static npy_longdouble log10l(npy_longdouble x)
{
    return (npy_longdouble) log10((double)x);
}
#endif


#line 245

#ifdef logl
#undef logl
#endif
#ifndef HAVE_LOGL
static npy_longdouble logl(npy_longdouble x)
{
    return (npy_longdouble) log((double)x);
}
#endif


#line 245

#ifdef expl
#undef expl
#endif
#ifndef HAVE_EXPL
static npy_longdouble expl(npy_longdouble x)
{
    return (npy_longdouble) exp((double)x);
}
#endif


#line 245

#ifdef expm1l
#undef expm1l
#endif
#ifndef HAVE_EXPM1L
static npy_longdouble expm1l(npy_longdouble x)
{
    return (npy_longdouble) expm1((double)x);
}
#endif


#line 245

#ifdef asinl
#undef asinl
#endif
#ifndef HAVE_ASINL
static npy_longdouble asinl(npy_longdouble x)
{
    return (npy_longdouble) asin((double)x);
}
#endif


#line 245

#ifdef acosl
#undef acosl
#endif
#ifndef HAVE_ACOSL
static npy_longdouble acosl(npy_longdouble x)
{
    return (npy_longdouble) acos((double)x);
}
#endif


#line 245

#ifdef atanl
#undef atanl
#endif
#ifndef HAVE_ATANL
static npy_longdouble atanl(npy_longdouble x)
{
    return (npy_longdouble) atan((double)x);
}
#endif


#line 245

#ifdef asinhl
#undef asinhl
#endif
#ifndef HAVE_ASINHL
static npy_longdouble asinhl(npy_longdouble x)
{
    return (npy_longdouble) asinh((double)x);
}
#endif


#line 245

#ifdef acoshl
#undef acoshl
#endif
#ifndef HAVE_ACOSHL
static npy_longdouble acoshl(npy_longdouble x)
{
    return (npy_longdouble) acosh((double)x);
}
#endif


#line 245

#ifdef atanhl
#undef atanhl
#endif
#ifndef HAVE_ATANHL
static npy_longdouble atanhl(npy_longdouble x)
{
    return (npy_longdouble) atanh((double)x);
}
#endif


#line 245

#ifdef log1pl
#undef log1pl
#endif
#ifndef HAVE_LOG1PL
static npy_longdouble log1pl(npy_longdouble x)
{
    return (npy_longdouble) log1p((double)x);
}
#endif


#line 245

#ifdef exp2l
#undef exp2l
#endif
#ifndef HAVE_EXP2L
static npy_longdouble exp2l(npy_longdouble x)
{
    return (npy_longdouble) exp2((double)x);
}
#endif


#line 245

#ifdef log2l
#undef log2l
#endif
#ifndef HAVE_LOG2L
static npy_longdouble log2l(npy_longdouble x)
{
    return (npy_longdouble) log2((double)x);
}
#endif



#line 262
#ifdef atan2l
#undef atan2l
#endif
#ifndef HAVE_ATAN2L
static npy_longdouble atan2l(npy_longdouble x, npy_longdouble y)
{
    return (npy_longdouble) atan2((double)x, (double) y);
}
#endif

#line 262
#ifdef hypotl
#undef hypotl
#endif
#ifndef HAVE_HYPOTL
static npy_longdouble hypotl(npy_longdouble x, npy_longdouble y)
{
    return (npy_longdouble) hypot((double)x, (double) y);
}
#endif

#line 262
#ifdef powl
#undef powl
#endif
#ifndef HAVE_POWL
static npy_longdouble powl(npy_longdouble x, npy_longdouble y)
{
    return (npy_longdouble) pow((double)x, (double) y);
}
#endif

#line 262
#ifdef fmodl
#undef fmodl
#endif
#ifndef HAVE_FMODL
static npy_longdouble fmodl(npy_longdouble x, npy_longdouble y)
{
    return (npy_longdouble) fmod((double)x, (double) y);
}
#endif


#ifdef modfl
#undef modfl
#endif
#ifndef HAVE_MODFL
static npy_longdouble modfl(npy_longdouble x, npy_longdouble *iptr)
{
    double niptr;
    double y = modf((double)x, &niptr);
    *iptr = (npy_longdouble) niptr;
    return (npy_longdouble) y;
}
#endif


#line 238

#line 245

#ifdef sinf
#undef sinf
#endif
#ifndef HAVE_SINF
static float sinf(float x)
{
    return (float) sin((double)x);
}
#endif


#line 245

#ifdef cosf
#undef cosf
#endif
#ifndef HAVE_COSF
static float cosf(float x)
{
    return (float) cos((double)x);
}
#endif


#line 245

#ifdef tanf
#undef tanf
#endif
#ifndef HAVE_TANF
static float tanf(float x)
{
    return (float) tan((double)x);
}
#endif


#line 245

#ifdef sinhf
#undef sinhf
#endif
#ifndef HAVE_SINHF
static float sinhf(float x)
{
    return (float) sinh((double)x);
}
#endif


#line 245

#ifdef coshf
#undef coshf
#endif
#ifndef HAVE_COSHF
static float coshf(float x)
{
    return (float) cosh((double)x);
}
#endif


#line 245

#ifdef tanhf
#undef tanhf
#endif
#ifndef HAVE_TANHF
static float tanhf(float x)
{
    return (float) tanh((double)x);
}
#endif


#line 245

#ifdef fabsf
#undef fabsf
#endif
#ifndef HAVE_FABSF
static float fabsf(float x)
{
    return (float) fabs((double)x);
}
#endif


#line 245

#ifdef floorf
#undef floorf
#endif
#ifndef HAVE_FLOORF
static float floorf(float x)
{
    return (float) floor((double)x);
}
#endif


#line 245

#ifdef ceilf
#undef ceilf
#endif
#ifndef HAVE_CEILF
static float ceilf(float x)
{
    return (float) ceil((double)x);
}
#endif


#line 245

#ifdef rintf
#undef rintf
#endif
#ifndef HAVE_RINTF
static float rintf(float x)
{
    return (float) rint((double)x);
}
#endif


#line 245

#ifdef truncf
#undef truncf
#endif
#ifndef HAVE_TRUNCF
static float truncf(float x)
{
    return (float) trunc((double)x);
}
#endif


#line 245

#ifdef sqrtf
#undef sqrtf
#endif
#ifndef HAVE_SQRTF
static float sqrtf(float x)
{
    return (float) sqrt((double)x);
}
#endif


#line 245

#ifdef log10f
#undef log10f
#endif
#ifndef HAVE_LOG10F
static float log10f(float x)
{
    return (float) log10((double)x);
}
#endif


#line 245

#ifdef logf
#undef logf
#endif
#ifndef HAVE_LOGF
static float logf(float x)
{
    return (float) log((double)x);
}
#endif


#line 245

#ifdef expf
#undef expf
#endif
#ifndef HAVE_EXPF
static float expf(float x)
{
    return (float) exp((double)x);
}
#endif


#line 245

#ifdef expm1f
#undef expm1f
#endif
#ifndef HAVE_EXPM1F
static float expm1f(float x)
{
    return (float) expm1((double)x);
}
#endif


#line 245

#ifdef asinf
#undef asinf
#endif
#ifndef HAVE_ASINF
static float asinf(float x)
{
    return (float) asin((double)x);
}
#endif


#line 245

#ifdef acosf
#undef acosf
#endif
#ifndef HAVE_ACOSF
static float acosf(float x)
{
    return (float) acos((double)x);
}
#endif


#line 245

#ifdef atanf
#undef atanf
#endif
#ifndef HAVE_ATANF
static float atanf(float x)
{
    return (float) atan((double)x);
}
#endif


#line 245

#ifdef asinhf
#undef asinhf
#endif
#ifndef HAVE_ASINHF
static float asinhf(float x)
{
    return (float) asinh((double)x);
}
#endif


#line 245

#ifdef acoshf
#undef acoshf
#endif
#ifndef HAVE_ACOSHF
static float acoshf(float x)
{
    return (float) acosh((double)x);
}
#endif


#line 245

#ifdef atanhf
#undef atanhf
#endif
#ifndef HAVE_ATANHF
static float atanhf(float x)
{
    return (float) atanh((double)x);
}
#endif


#line 245

#ifdef log1pf
#undef log1pf
#endif
#ifndef HAVE_LOG1PF
static float log1pf(float x)
{
    return (float) log1p((double)x);
}
#endif


#line 245

#ifdef exp2f
#undef exp2f
#endif
#ifndef HAVE_EXP2F
static float exp2f(float x)
{
    return (float) exp2((double)x);
}
#endif


#line 245

#ifdef log2f
#undef log2f
#endif
#ifndef HAVE_LOG2F
static float log2f(float x)
{
    return (float) log2((double)x);
}
#endif



#line 262
#ifdef atan2f
#undef atan2f
#endif
#ifndef HAVE_ATAN2F
static float atan2f(float x, float y)
{
    return (float) atan2((double)x, (double) y);
}
#endif

#line 262
#ifdef hypotf
#undef hypotf
#endif
#ifndef HAVE_HYPOTF
static float hypotf(float x, float y)
{
    return (float) hypot((double)x, (double) y);
}
#endif

#line 262
#ifdef powf
#undef powf
#endif
#ifndef HAVE_POWF
static float powf(float x, float y)
{
    return (float) pow((double)x, (double) y);
}
#endif

#line 262
#ifdef fmodf
#undef fmodf
#endif
#ifndef HAVE_FMODF
static float fmodf(float x, float y)
{
    return (float) fmod((double)x, (double) y);
}
#endif


#ifdef modff
#undef modff
#endif
#ifndef HAVE_MODFF
static float modff(float x, float *iptr)
{
    double niptr;
    double y = modf((double)x, &niptr);
    *iptr = (float) niptr;
    return (float) y;
}
#endif



/* 
 * Useful constants in three precisions: 
 * XXX: those should really be in the header
 */

#line 297
#define NPY_Ef        2.7182818284590452353602874713526625F /* e */
#define NPY_LOG2Ef    1.4426950408889634073599246810018921F /* log_2 e */
#define NPY_LOG10Ef   0.4342944819032518276511289189166051F /* log_10 e */
#define NPY_LOGE2f    0.6931471805599453094172321214581766F /* log_e 2 */
#define NPY_LOGE10f   2.3025850929940456840179914546843642F /* log_e 10 */
#define NPY_PIf       3.1415926535897932384626433832795029F /* pi */
#define NPY_PI_2f     1.5707963267948966192313216916397514F /* pi/2 */
#define NPY_PI_4f     0.7853981633974483096156608458198757F /* pi/4 */
#define NPY_1_PIf     0.3183098861837906715377675267450287F /* 1/pi */
#define NPY_2_PIf     0.6366197723675813430755350534900574F /* 2/pi */

#line 297
#define NPY_E        2.7182818284590452353602874713526625 /* e */
#define NPY_LOG2E    1.4426950408889634073599246810018921 /* log_2 e */
#define NPY_LOG10E   0.4342944819032518276511289189166051 /* log_10 e */
#define NPY_LOGE2    0.6931471805599453094172321214581766 /* log_e 2 */
#define NPY_LOGE10   2.3025850929940456840179914546843642 /* log_e 10 */
#define NPY_PI       3.1415926535897932384626433832795029 /* pi */
#define NPY_PI_2     1.5707963267948966192313216916397514 /* pi/2 */
#define NPY_PI_4     0.7853981633974483096156608458198757 /* pi/4 */
#define NPY_1_PI     0.3183098861837906715377675267450287 /* 1/pi */
#define NPY_2_PI     0.6366197723675813430755350534900574 /* 2/pi */

#line 297
#define NPY_El        2.7182818284590452353602874713526625L /* e */
#define NPY_LOG2El    1.4426950408889634073599246810018921L /* log_2 e */
#define NPY_LOG10El   0.4342944819032518276511289189166051L /* log_10 e */
#define NPY_LOGE2l    0.6931471805599453094172321214581766L /* log_e 2 */
#define NPY_LOGE10l   2.3025850929940456840179914546843642L /* log_e 10 */
#define NPY_PIl       3.1415926535897932384626433832795029L /* pi */
#define NPY_PI_2l     1.5707963267948966192313216916397514L /* pi/2 */
#define NPY_PI_4l     0.7853981633974483096156608458198757L /* pi/4 */
#define NPY_1_PIl     0.3183098861837906715377675267450287L /* 1/pi */
#define NPY_2_PIl     0.6366197723675813430755350534900574L /* 2/pi */


/*
 * Non standard functions
 */

#line 318

#define LOGE2    NPY_LOGE2f
#define LOG2E    NPY_LOG2Ef
#define RAD2DEG  (180.0f/NPY_PIf)
#define DEG2RAD  (NPY_PIf/180.0f)

static float rad2degf(float x) 
{
    return x*RAD2DEG;
}

static float deg2radf(float x) 
{
    return x*DEG2RAD;
}

static float log2_1pf(float x)
{
    float u = 1 + x;
    if (u == 1) {
        return LOG2E*x;
    } else {
        return npy_log2f(u) * x / (u - 1);
    }
}

static float exp2_1mf(float x)
{
    float u = expf(x);
    if (u == 1.0) {
        return LOGE2*x;
    } else if (u - 1 == -1) {
        return -LOGE2;
    } else {
        return (u - 1) * x/npy_log2f(u);
    }
}

static float logaddexpf(float x, float y)
{
    const float tmp = x - y;
    if (tmp > 0) {
        return x + npy_log1pf(npy_expf(-tmp));
    }
    else {
        return y + npy_log1pf(npy_expf(tmp));
    }
}

static float logaddexp2f(float x, float y)
{
    const float tmp = x - y;
    if (tmp > 0) {
        return x + log2_1pf(npy_exp2f(-tmp));
    }
    else {
        return y + log2_1pf(npy_exp2f(tmp));
    }
}

#define degreesf rad2degf
#define radiansf deg2radf

#undef LOGE2
#undef LOG2E
#undef RAD2DEG
#undef DEG2RAD


#line 318

#define LOGE2    NPY_LOGE2
#define LOG2E    NPY_LOG2E
#define RAD2DEG  (180.0/NPY_PI)
#define DEG2RAD  (NPY_PI/180.0)

static double rad2deg(double x) 
{
    return x*RAD2DEG;
}

static double deg2rad(double x) 
{
    return x*DEG2RAD;
}

static double log2_1p(double x)
{
    double u = 1 + x;
    if (u == 1) {
        return LOG2E*x;
    } else {
        return npy_log2(u) * x / (u - 1);
    }
}

static double exp2_1m(double x)
{
    double u = exp(x);
    if (u == 1.0) {
        return LOGE2*x;
    } else if (u - 1 == -1) {
        return -LOGE2;
    } else {
        return (u - 1) * x/npy_log2(u);
    }
}

static double logaddexp(double x, double y)
{
    const double tmp = x - y;
    if (tmp > 0) {
        return x + npy_log1p(npy_exp(-tmp));
    }
    else {
        return y + npy_log1p(npy_exp(tmp));
    }
}

static double logaddexp2(double x, double y)
{
    const double tmp = x - y;
    if (tmp > 0) {
        return x + log2_1p(npy_exp2(-tmp));
    }
    else {
        return y + log2_1p(npy_exp2(tmp));
    }
}

#define degrees rad2deg
#define radians deg2rad

#undef LOGE2
#undef LOG2E
#undef RAD2DEG
#undef DEG2RAD


#line 318

#define LOGE2    NPY_LOGE2l
#define LOG2E    NPY_LOG2El
#define RAD2DEG  (180.0l/NPY_PIl)
#define DEG2RAD  (NPY_PIl/180.0l)

static npy_longdouble rad2degl(npy_longdouble x) 
{
    return x*RAD2DEG;
}

static npy_longdouble deg2radl(npy_longdouble x) 
{
    return x*DEG2RAD;
}

static npy_longdouble log2_1pl(npy_longdouble x)
{
    npy_longdouble u = 1 + x;
    if (u == 1) {
        return LOG2E*x;
    } else {
        return npy_log2l(u) * x / (u - 1);
    }
}

static npy_longdouble exp2_1ml(npy_longdouble x)
{
    npy_longdouble u = expl(x);
    if (u == 1.0) {
        return LOGE2*x;
    } else if (u - 1 == -1) {
        return -LOGE2;
    } else {
        return (u - 1) * x/npy_log2l(u);
    }
}

static npy_longdouble logaddexpl(npy_longdouble x, npy_longdouble y)
{
    const npy_longdouble tmp = x - y;
    if (tmp > 0) {
        return x + npy_log1pl(npy_expl(-tmp));
    }
    else {
        return y + npy_log1pl(npy_expl(tmp));
    }
}

static npy_longdouble logaddexp2l(npy_longdouble x, npy_longdouble y)
{
    const npy_longdouble tmp = x - y;
    if (tmp > 0) {
        return x + log2_1pl(npy_exp2l(-tmp));
    }
    else {
        return y + log2_1pl(npy_exp2l(tmp));
    }
}

#define degreesl rad2degl
#define radiansl deg2radl

#undef LOGE2
#undef LOG2E
#undef RAD2DEG
#undef DEG2RAD



/*
 * Decorate all the functions: those are the public ones
 */

#line 396
#line 401

npy_longdouble npy_sinl(npy_longdouble x)
{
    return sinl(x);
}


#line 401

npy_longdouble npy_cosl(npy_longdouble x)
{
    return cosl(x);
}


#line 401

npy_longdouble npy_tanl(npy_longdouble x)
{
    return tanl(x);
}


#line 401

npy_longdouble npy_sinhl(npy_longdouble x)
{
    return sinhl(x);
}


#line 401

npy_longdouble npy_coshl(npy_longdouble x)
{
    return coshl(x);
}


#line 401

npy_longdouble npy_tanhl(npy_longdouble x)
{
    return tanhl(x);
}


#line 401

npy_longdouble npy_fabsl(npy_longdouble x)
{
    return fabsl(x);
}


#line 401

npy_longdouble npy_floorl(npy_longdouble x)
{
    return floorl(x);
}


#line 401

npy_longdouble npy_ceill(npy_longdouble x)
{
    return ceill(x);
}


#line 401

npy_longdouble npy_rintl(npy_longdouble x)
{
    return rintl(x);
}


#line 401

npy_longdouble npy_truncl(npy_longdouble x)
{
    return truncl(x);
}


#line 401

npy_longdouble npy_sqrtl(npy_longdouble x)
{
    return sqrtl(x);
}


#line 401

npy_longdouble npy_log10l(npy_longdouble x)
{
    return log10l(x);
}


#line 401

npy_longdouble npy_logl(npy_longdouble x)
{
    return logl(x);
}


#line 401

npy_longdouble npy_expl(npy_longdouble x)
{
    return expl(x);
}


#line 401

npy_longdouble npy_expm1l(npy_longdouble x)
{
    return expm1l(x);
}


#line 401

npy_longdouble npy_asinl(npy_longdouble x)
{
    return asinl(x);
}


#line 401

npy_longdouble npy_acosl(npy_longdouble x)
{
    return acosl(x);
}


#line 401

npy_longdouble npy_atanl(npy_longdouble x)
{
    return atanl(x);
}


#line 401

npy_longdouble npy_asinhl(npy_longdouble x)
{
    return asinhl(x);
}


#line 401

npy_longdouble npy_acoshl(npy_longdouble x)
{
    return acoshl(x);
}


#line 401

npy_longdouble npy_atanhl(npy_longdouble x)
{
    return atanhl(x);
}


#line 401

npy_longdouble npy_log1pl(npy_longdouble x)
{
    return log1pl(x);
}


#line 401

npy_longdouble npy_exp2l(npy_longdouble x)
{
    return exp2l(x);
}


#line 401

npy_longdouble npy_log2l(npy_longdouble x)
{
    return log2l(x);
}


#line 401

npy_longdouble npy_rad2degl(npy_longdouble x)
{
    return rad2degl(x);
}


#line 401

npy_longdouble npy_deg2radl(npy_longdouble x)
{
    return deg2radl(x);
}


#line 401

npy_longdouble npy_exp2_1ml(npy_longdouble x)
{
    return exp2_1ml(x);
}



#line 412
npy_longdouble npy_atan2l(npy_longdouble x, npy_longdouble y)
{
    return atan2l(x, y);
}

#line 412
npy_longdouble npy_hypotl(npy_longdouble x, npy_longdouble y)
{
    return hypotl(x, y);
}

#line 412
npy_longdouble npy_powl(npy_longdouble x, npy_longdouble y)
{
    return powl(x, y);
}

#line 412
npy_longdouble npy_fmodl(npy_longdouble x, npy_longdouble y)
{
    return fmodl(x, y);
}

#line 412
npy_longdouble npy_logaddexpl(npy_longdouble x, npy_longdouble y)
{
    return logaddexpl(x, y);
}

#line 412
npy_longdouble npy_logaddexp2l(npy_longdouble x, npy_longdouble y)
{
    return logaddexp2l(x, y);
}


npy_longdouble npy_modfl(npy_longdouble x, npy_longdouble *iptr)
{
    return modfl(x, iptr);
}


#line 396
#line 401

double npy_sin(double x)
{
    return sin(x);
}


#line 401

double npy_cos(double x)
{
    return cos(x);
}


#line 401

double npy_tan(double x)
{
    return tan(x);
}


#line 401

double npy_sinh(double x)
{
    return sinh(x);
}


#line 401

double npy_cosh(double x)
{
    return cosh(x);
}


#line 401

double npy_tanh(double x)
{
    return tanh(x);
}


#line 401

double npy_fabs(double x)
{
    return fabs(x);
}


#line 401

double npy_floor(double x)
{
    return floor(x);
}


#line 401

double npy_ceil(double x)
{
    return ceil(x);
}


#line 401

double npy_rint(double x)
{
    return rint(x);
}


#line 401

double npy_trunc(double x)
{
    return trunc(x);
}


#line 401

double npy_sqrt(double x)
{
    return sqrt(x);
}


#line 401

double npy_log10(double x)
{
    return log10(x);
}


#line 401

double npy_log(double x)
{
    return log(x);
}


#line 401

double npy_exp(double x)
{
    return exp(x);
}


#line 401

double npy_expm1(double x)
{
    return expm1(x);
}


#line 401

double npy_asin(double x)
{
    return asin(x);
}


#line 401

double npy_acos(double x)
{
    return acos(x);
}


#line 401

double npy_atan(double x)
{
    return atan(x);
}


#line 401

double npy_asinh(double x)
{
    return asinh(x);
}


#line 401

double npy_acosh(double x)
{
    return acosh(x);
}


#line 401

double npy_atanh(double x)
{
    return atanh(x);
}


#line 401

double npy_log1p(double x)
{
    return log1p(x);
}


#line 401

double npy_exp2(double x)
{
    return exp2(x);
}


#line 401

double npy_log2(double x)
{
    return log2(x);
}


#line 401

double npy_rad2deg(double x)
{
    return rad2deg(x);
}


#line 401

double npy_deg2rad(double x)
{
    return deg2rad(x);
}


#line 401

double npy_exp2_1m(double x)
{
    return exp2_1m(x);
}



#line 412
double npy_atan2(double x, double y)
{
    return atan2(x, y);
}

#line 412
double npy_hypot(double x, double y)
{
    return hypot(x, y);
}

#line 412
double npy_pow(double x, double y)
{
    return pow(x, y);
}

#line 412
double npy_fmod(double x, double y)
{
    return fmod(x, y);
}

#line 412
double npy_logaddexp(double x, double y)
{
    return logaddexp(x, y);
}

#line 412
double npy_logaddexp2(double x, double y)
{
    return logaddexp2(x, y);
}


double npy_modf(double x, double *iptr)
{
    return modf(x, iptr);
}


#line 396
#line 401

float npy_sinf(float x)
{
    return sinf(x);
}


#line 401

float npy_cosf(float x)
{
    return cosf(x);
}


#line 401

float npy_tanf(float x)
{
    return tanf(x);
}


#line 401

float npy_sinhf(float x)
{
    return sinhf(x);
}


#line 401

float npy_coshf(float x)
{
    return coshf(x);
}


#line 401

float npy_tanhf(float x)
{
    return tanhf(x);
}


#line 401

float npy_fabsf(float x)
{
    return fabsf(x);
}


#line 401

float npy_floorf(float x)
{
    return floorf(x);
}


#line 401

float npy_ceilf(float x)
{
    return ceilf(x);
}


#line 401

float npy_rintf(float x)
{
    return rintf(x);
}


#line 401

float npy_truncf(float x)
{
    return truncf(x);
}


#line 401

float npy_sqrtf(float x)
{
    return sqrtf(x);
}


#line 401

float npy_log10f(float x)
{
    return log10f(x);
}


#line 401

float npy_logf(float x)
{
    return logf(x);
}


#line 401

float npy_expf(float x)
{
    return expf(x);
}


#line 401

float npy_expm1f(float x)
{
    return expm1f(x);
}


#line 401

float npy_asinf(float x)
{
    return asinf(x);
}


#line 401

float npy_acosf(float x)
{
    return acosf(x);
}


#line 401

float npy_atanf(float x)
{
    return atanf(x);
}


#line 401

float npy_asinhf(float x)
{
    return asinhf(x);
}


#line 401

float npy_acoshf(float x)
{
    return acoshf(x);
}


#line 401

float npy_atanhf(float x)
{
    return atanhf(x);
}


#line 401

float npy_log1pf(float x)
{
    return log1pf(x);
}


#line 401

float npy_exp2f(float x)
{
    return exp2f(x);
}


#line 401

float npy_log2f(float x)
{
    return log2f(x);
}


#line 401

float npy_rad2degf(float x)
{
    return rad2degf(x);
}


#line 401

float npy_deg2radf(float x)
{
    return deg2radf(x);
}


#line 401

float npy_exp2_1mf(float x)
{
    return exp2_1mf(x);
}



#line 412
float npy_atan2f(float x, float y)
{
    return atan2f(x, y);
}

#line 412
float npy_hypotf(float x, float y)
{
    return hypotf(x, y);
}

#line 412
float npy_powf(float x, float y)
{
    return powf(x, y);
}

#line 412
float npy_fmodf(float x, float y)
{
    return fmodf(x, y);
}

#line 412
float npy_logaddexpf(float x, float y)
{
    return logaddexpf(x, y);
}

#line 412
float npy_logaddexp2f(float x, float y)
{
    return logaddexp2f(x, y);
}


float npy_modff(float x, float *iptr)
{
    return modff(x, iptr);
}



_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to