2004-06-12 19:59:30 +02:00
|
|
|
/* Implementation of various C99 functions
|
2013-01-14 19:20:58 +01:00
|
|
|
Copyright (C) 2004-2013 Free Software Foundation, Inc.
|
2004-06-12 19:59:30 +02:00
|
|
|
|
|
|
|
This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
|
|
|
|
|
|
|
Libgfortran is free software; you can redistribute it and/or
|
2005-01-12 22:27:33 +01:00
|
|
|
modify it under the terms of the GNU General Public
|
2004-06-12 19:59:30 +02:00
|
|
|
License as published by the Free Software Foundation; either
|
2009-04-09 17:00:19 +02:00
|
|
|
version 3 of the License, or (at your option) any later version.
|
2004-06-12 19:59:30 +02:00
|
|
|
|
|
|
|
Libgfortran is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2005-01-12 22:27:33 +01:00
|
|
|
GNU General Public License for more details.
|
2004-06-12 19:59:30 +02:00
|
|
|
|
2009-04-09 17:00:19 +02:00
|
|
|
Under Section 7 of GPL version 3, you are granted additional
|
|
|
|
permissions described in the GCC Runtime Library Exception, version
|
|
|
|
3.1, as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License and
|
|
|
|
a copy of the GCC Runtime Library Exception along with this program;
|
|
|
|
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
2004-06-12 19:59:30 +02:00
|
|
|
|
|
|
|
#include "config.h"
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
|
|
|
|
#define C99_PROTOS_H WE_DONT_WANT_PROTOS_NOW
|
2004-06-12 19:59:30 +02:00
|
|
|
#include "libgfortran.h"
|
|
|
|
|
2009-07-27 11:24:41 +02:00
|
|
|
/* On a C99 system "I" (with I*I = -1) should be defined in complex.h;
|
|
|
|
if not, we define a fallback version here. */
|
|
|
|
#ifndef I
|
|
|
|
# if defined(_Imaginary_I)
|
|
|
|
# define I _Imaginary_I
|
|
|
|
# elif defined(_Complex_I)
|
|
|
|
# define I _Complex_I
|
|
|
|
# else
|
|
|
|
# define I (1.0fi)
|
|
|
|
# endif
|
|
|
|
#endif
|
2006-01-12 18:37:47 +01:00
|
|
|
|
2009-07-27 11:24:41 +02:00
|
|
|
/* Prototypes are included to silence -Wstrict-prototypes
|
|
|
|
-Wmissing-prototypes. */
|
2006-01-12 18:37:47 +01:00
|
|
|
|
2006-11-25 18:22:53 +01:00
|
|
|
|
|
|
|
/* Wrappers for systems without the various C99 single precision Bessel
|
|
|
|
functions. */
|
|
|
|
|
|
|
|
#if defined(HAVE_J0) && ! defined(HAVE_J0F)
|
|
|
|
#define HAVE_J0F 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float j0f (float);
|
2006-11-25 18:22:53 +01:00
|
|
|
|
|
|
|
float
|
|
|
|
j0f (float x)
|
|
|
|
{
|
|
|
|
return (float) j0 ((double) x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_J1) && !defined(HAVE_J1F)
|
|
|
|
#define HAVE_J1F 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float j1f (float);
|
2006-11-25 18:22:53 +01:00
|
|
|
|
|
|
|
float j1f (float x)
|
|
|
|
{
|
|
|
|
return (float) j1 ((double) x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_JN) && !defined(HAVE_JNF)
|
|
|
|
#define HAVE_JNF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float jnf (int, float);
|
2006-11-25 18:22:53 +01:00
|
|
|
|
|
|
|
float
|
|
|
|
jnf (int n, float x)
|
|
|
|
{
|
|
|
|
return (float) jn (n, (double) x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_Y0) && !defined(HAVE_Y0F)
|
|
|
|
#define HAVE_Y0F 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float y0f (float);
|
2006-11-25 18:22:53 +01:00
|
|
|
|
|
|
|
float
|
|
|
|
y0f (float x)
|
|
|
|
{
|
|
|
|
return (float) y0 ((double) x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_Y1) && !defined(HAVE_Y1F)
|
|
|
|
#define HAVE_Y1F 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float y1f (float);
|
2006-11-25 18:22:53 +01:00
|
|
|
|
|
|
|
float
|
|
|
|
y1f (float x)
|
|
|
|
{
|
|
|
|
return (float) y1 ((double) x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_YN) && !defined(HAVE_YNF)
|
|
|
|
#define HAVE_YNF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float ynf (int, float);
|
2006-11-25 18:22:53 +01:00
|
|
|
|
|
|
|
float
|
|
|
|
ynf (int n, float x)
|
|
|
|
{
|
|
|
|
return (float) yn (n, (double) x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* Wrappers for systems without the C99 erff() and erfcf() functions. */
|
|
|
|
|
|
|
|
#if defined(HAVE_ERF) && !defined(HAVE_ERFF)
|
|
|
|
#define HAVE_ERFF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float erff (float);
|
2006-11-25 18:22:53 +01:00
|
|
|
|
|
|
|
float
|
|
|
|
erff (float x)
|
|
|
|
{
|
|
|
|
return (float) erf ((double) x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_ERFC) && !defined(HAVE_ERFCF)
|
|
|
|
#define HAVE_ERFCF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float erfcf (float);
|
2006-11-25 18:22:53 +01:00
|
|
|
|
|
|
|
float
|
|
|
|
erfcf (float x)
|
|
|
|
{
|
|
|
|
return (float) erfc ((double) x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
#ifndef HAVE_ACOSF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_ACOSF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float acosf (float x);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
acosf (float x)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) acos (x);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2006-10-08 20:39:18 +02:00
|
|
|
#if HAVE_ACOSH && !HAVE_ACOSHF
|
2009-07-27 11:24:41 +02:00
|
|
|
float acoshf (float x);
|
|
|
|
|
2006-10-08 20:39:18 +02:00
|
|
|
float
|
|
|
|
acoshf (float x)
|
|
|
|
{
|
|
|
|
return (float) acosh ((double) x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
#ifndef HAVE_ASINF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_ASINF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float asinf (float x);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
asinf (float x)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) asin (x);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2006-10-08 20:39:18 +02:00
|
|
|
#if HAVE_ASINH && !HAVE_ASINHF
|
2009-07-27 11:24:41 +02:00
|
|
|
float asinhf (float x);
|
|
|
|
|
2006-10-08 20:39:18 +02:00
|
|
|
float
|
|
|
|
asinhf (float x)
|
|
|
|
{
|
|
|
|
return (float) asinh ((double) x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
#ifndef HAVE_ATAN2F
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_ATAN2F 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float atan2f (float y, float x);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
atan2f (float y, float x)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) atan2 (y, x);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_ATANF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_ATANF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float atanf (float x);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
atanf (float x)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) atan (x);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2006-10-08 20:39:18 +02:00
|
|
|
#if HAVE_ATANH && !HAVE_ATANHF
|
2009-07-27 11:24:41 +02:00
|
|
|
float atanhf (float x);
|
|
|
|
|
2006-10-08 20:39:18 +02:00
|
|
|
float
|
|
|
|
atanhf (float x)
|
|
|
|
{
|
|
|
|
return (float) atanh ((double) x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
#ifndef HAVE_CEILF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CEILF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float ceilf (float x);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
ceilf (float x)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) ceil (x);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_COPYSIGNF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_COPYSIGNF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float copysignf (float x, float y);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
copysignf (float x, float y)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) copysign (x, y);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_COSF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_COSF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float cosf (float x);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
cosf (float x)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) cos (x);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_COSHF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_COSHF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float coshf (float x);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
coshf (float x)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) cosh (x);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_EXPF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_EXPF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float expf (float x);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
expf (float x)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) exp (x);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-12-08 00:43:40 +01:00
|
|
|
#ifndef HAVE_FABSF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_FABSF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float fabsf (float x);
|
|
|
|
|
2004-12-08 00:43:40 +01:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
fabsf (float x)
|
2004-12-08 00:43:40 +01:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) fabs (x);
|
2004-12-08 00:43:40 +01:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
#ifndef HAVE_FLOORF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_FLOORF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float floorf (float x);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
floorf (float x)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) floor (x);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2006-12-06 22:49:55 +01:00
|
|
|
#ifndef HAVE_FMODF
|
|
|
|
#define HAVE_FMODF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float fmodf (float x, float y);
|
|
|
|
|
2006-12-06 22:49:55 +01:00
|
|
|
float
|
|
|
|
fmodf (float x, float y)
|
|
|
|
{
|
|
|
|
return (float) fmod (x, y);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
#ifndef HAVE_FREXPF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_FREXPF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float frexpf (float x, int *exp);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
frexpf (float x, int *exp)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) frexp (x, exp);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_HYPOTF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_HYPOTF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float hypotf (float x, float y);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
hypotf (float x, float y)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) hypot (x, y);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_LOGF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_LOGF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float logf (float x);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
logf (float x)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) log (x);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_LOG10F
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_LOG10F 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float log10f (float x);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
log10f (float x)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) log10 (x);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2005-06-15 10:40:35 +02:00
|
|
|
#ifndef HAVE_SCALBN
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_SCALBN 1
|
2009-07-27 11:24:41 +02:00
|
|
|
double scalbn (double x, int y);
|
|
|
|
|
2005-06-15 10:40:35 +02:00
|
|
|
double
|
2009-07-27 11:24:41 +02:00
|
|
|
scalbn (double x, int y)
|
2005-06-15 10:40:35 +02:00
|
|
|
{
|
2007-09-21 12:54:20 +02:00
|
|
|
#if (FLT_RADIX == 2) && defined(HAVE_LDEXP)
|
|
|
|
return ldexp (x, y);
|
|
|
|
#else
|
2009-07-27 11:24:41 +02:00
|
|
|
return x * pow (FLT_RADIX, y);
|
2007-09-21 12:54:20 +02:00
|
|
|
#endif
|
2005-06-15 10:40:35 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
#ifndef HAVE_SCALBNF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_SCALBNF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float scalbnf (float x, int y);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
scalbnf (float x, int y)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) scalbn (x, y);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_SINF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_SINF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float sinf (float x);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
sinf (float x)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) sin (x);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_SINHF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_SINHF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float sinhf (float x);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
sinhf (float x)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) sinh (x);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_SQRTF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_SQRTF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float sqrtf (float x);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
sqrtf (float x)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) sqrt (x);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_TANF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_TANF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float tanf (float x);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
tanf (float x)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) tan (x);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_TANHF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_TANHF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float tanhf (float x);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
tanhf (float x)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) tanh (x);
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2005-05-21 08:44:50 +02:00
|
|
|
#ifndef HAVE_TRUNC
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_TRUNC 1
|
2009-07-27 11:24:41 +02:00
|
|
|
double trunc (double x);
|
|
|
|
|
2005-05-21 08:44:50 +02:00
|
|
|
double
|
2009-07-27 11:24:41 +02:00
|
|
|
trunc (double x)
|
2005-05-21 08:44:50 +02:00
|
|
|
{
|
|
|
|
if (!isfinite (x))
|
|
|
|
return x;
|
|
|
|
|
|
|
|
if (x < 0.0)
|
|
|
|
return - floor (-x);
|
|
|
|
else
|
|
|
|
return floor (x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_TRUNCF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_TRUNCF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float truncf (float x);
|
|
|
|
|
2005-05-21 08:44:50 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
truncf (float x)
|
2005-05-21 08:44:50 +02:00
|
|
|
{
|
|
|
|
return (float) trunc (x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
#ifndef HAVE_NEXTAFTERF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_NEXTAFTERF 1
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
/* This is a portable implementation of nextafterf that is intended to be
|
|
|
|
independent of the floating point format or its in memory representation.
|
2004-08-09 23:09:41 +02:00
|
|
|
This implementation works correctly with denormalized values. */
|
2009-07-27 11:24:41 +02:00
|
|
|
float nextafterf (float x, float y);
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
nextafterf (float x, float y)
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
{
|
2004-08-09 23:09:41 +02:00
|
|
|
/* This variable is marked volatile to avoid excess precision problems
|
|
|
|
on some platforms, including IA-32. */
|
|
|
|
volatile float delta;
|
|
|
|
float absx, denorm_min;
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
|
2009-07-27 11:24:41 +02:00
|
|
|
if (isnan (x) || isnan (y))
|
2004-08-09 23:09:41 +02:00
|
|
|
return x + y;
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
if (x == y)
|
|
|
|
return x;
|
2005-02-21 22:39:33 +01:00
|
|
|
if (!isfinite (x))
|
|
|
|
return x > 0 ? __FLT_MAX__ : - __FLT_MAX__;
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
|
2004-08-09 23:09:41 +02:00
|
|
|
/* absx = fabsf (x); */
|
|
|
|
absx = (x < 0.0) ? -x : x;
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
|
2004-08-09 23:09:41 +02:00
|
|
|
/* __FLT_DENORM_MIN__ is non-zero iff the target supports denormals. */
|
|
|
|
if (__FLT_DENORM_MIN__ == 0.0f)
|
|
|
|
denorm_min = __FLT_MIN__;
|
|
|
|
else
|
|
|
|
denorm_min = __FLT_DENORM_MIN__;
|
|
|
|
|
|
|
|
if (absx < __FLT_MIN__)
|
|
|
|
delta = denorm_min;
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
else
|
|
|
|
{
|
2004-08-09 23:09:41 +02:00
|
|
|
float frac;
|
|
|
|
int exp;
|
|
|
|
|
|
|
|
/* Discard the fraction from x. */
|
|
|
|
frac = frexpf (absx, &exp);
|
|
|
|
delta = scalbnf (0.5f, exp);
|
|
|
|
|
|
|
|
/* Scale x by the epsilon of the representation. By rights we should
|
|
|
|
have been able to combine this with scalbnf, but some targets don't
|
|
|
|
get that correct with denormals. */
|
|
|
|
delta *= __FLT_EPSILON__;
|
|
|
|
|
|
|
|
/* If we're going to be reducing the absolute value of X, and doing so
|
|
|
|
would reduce the exponent of X, then the delta to be applied is
|
|
|
|
one exponent smaller. */
|
|
|
|
if (frac == 0.5f && (y < x) == (x > 0))
|
|
|
|
delta *= 0.5f;
|
|
|
|
|
|
|
|
/* If that underflows to zero, then we're back to the minimum. */
|
|
|
|
if (delta == 0.0f)
|
|
|
|
delta = denorm_min;
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
2004-08-09 23:09:41 +02:00
|
|
|
|
|
|
|
if (y < x)
|
|
|
|
delta = -delta;
|
|
|
|
|
|
|
|
return x + delta;
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 15:28:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-09-26 16:52:04 +02:00
|
|
|
|
|
|
|
#ifndef HAVE_POWF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_POWF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float powf (float x, float y);
|
|
|
|
|
2004-09-26 16:52:04 +02:00
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
powf (float x, float y)
|
2004-09-26 16:52:04 +02:00
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return (float) pow (x, y);
|
2004-09-26 16:52:04 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-06-14 19:27:20 +02:00
|
|
|
|
2011-11-08 11:31:04 +01:00
|
|
|
#ifndef HAVE_ROUND
|
|
|
|
#define HAVE_ROUND 1
|
|
|
|
/* Round to nearest integral value. If the argument is halfway between two
|
|
|
|
integral values then round away from zero. */
|
|
|
|
double round (double x);
|
|
|
|
|
|
|
|
double
|
|
|
|
round (double x)
|
|
|
|
{
|
|
|
|
double t;
|
|
|
|
if (!isfinite (x))
|
|
|
|
return (x);
|
|
|
|
|
|
|
|
if (x >= 0.0)
|
|
|
|
{
|
|
|
|
t = floor (x);
|
|
|
|
if (t - x <= -0.5)
|
|
|
|
t += 1.0;
|
|
|
|
return (t);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
t = floor (-x);
|
|
|
|
if (t + x <= -0.5)
|
|
|
|
t += 1.0;
|
|
|
|
return (-t);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2004-06-12 19:59:30 +02:00
|
|
|
/* Algorithm by Steven G. Kargl. */
|
|
|
|
|
2007-08-06 00:14:34 +02:00
|
|
|
#if !defined(HAVE_ROUNDL)
|
re PR fortran/31202 (Incorrect rounding generated for NINT)
PR fortran/31202
* f95-lang.c (gfc_init_builtin_functions): Defin builtins for
lround{f,,l} and llround{f,,l}.
* trans-intrinsic.c (build_fix_expr): Generate calls to the
{l,}round{f,,l} functions.
* intrinsics/c99_functions.c (roundl,lroundf,lround,lroundl,
llroundf,llround,llroundl): New functions.
* c99_protos.h (roundl,lroundf,lround,lroundl,llroundf,llround,
llroundl): New prototypes.
* configure.ac: Check for lroundf, lround, lroundl, llroundf,
llround and llroundl.
* configure: Regenerate.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* gfortran.dg/nint_2.f90: New test.
From-SVN: r127185
2007-08-03 23:26:10 +02:00
|
|
|
#define HAVE_ROUNDL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long double roundl (long double x);
|
|
|
|
|
2007-08-06 00:14:34 +02:00
|
|
|
#if defined(HAVE_CEILL)
|
re PR fortran/31202 (Incorrect rounding generated for NINT)
PR fortran/31202
* f95-lang.c (gfc_init_builtin_functions): Defin builtins for
lround{f,,l} and llround{f,,l}.
* trans-intrinsic.c (build_fix_expr): Generate calls to the
{l,}round{f,,l} functions.
* intrinsics/c99_functions.c (roundl,lroundf,lround,lroundl,
llroundf,llround,llroundl): New functions.
* c99_protos.h (roundl,lroundf,lround,lroundl,llroundf,llround,
llroundl): New prototypes.
* configure.ac: Check for lroundf, lround, lroundl, llroundf,
llround and llroundl.
* configure: Regenerate.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* gfortran.dg/nint_2.f90: New test.
From-SVN: r127185
2007-08-03 23:26:10 +02:00
|
|
|
/* Round to nearest integral value. If the argument is halfway between two
|
|
|
|
integral values then round away from zero. */
|
|
|
|
|
|
|
|
long double
|
2009-07-27 11:24:41 +02:00
|
|
|
roundl (long double x)
|
re PR fortran/31202 (Incorrect rounding generated for NINT)
PR fortran/31202
* f95-lang.c (gfc_init_builtin_functions): Defin builtins for
lround{f,,l} and llround{f,,l}.
* trans-intrinsic.c (build_fix_expr): Generate calls to the
{l,}round{f,,l} functions.
* intrinsics/c99_functions.c (roundl,lroundf,lround,lroundl,
llroundf,llround,llroundl): New functions.
* c99_protos.h (roundl,lroundf,lround,lroundl,llroundf,llround,
llroundl): New prototypes.
* configure.ac: Check for lroundf, lround, lroundl, llroundf,
llround and llroundl.
* configure: Regenerate.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* gfortran.dg/nint_2.f90: New test.
From-SVN: r127185
2007-08-03 23:26:10 +02:00
|
|
|
{
|
|
|
|
long double t;
|
|
|
|
if (!isfinite (x))
|
|
|
|
return (x);
|
|
|
|
|
|
|
|
if (x >= 0.0)
|
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
t = ceill (x);
|
re PR fortran/31202 (Incorrect rounding generated for NINT)
PR fortran/31202
* f95-lang.c (gfc_init_builtin_functions): Defin builtins for
lround{f,,l} and llround{f,,l}.
* trans-intrinsic.c (build_fix_expr): Generate calls to the
{l,}round{f,,l} functions.
* intrinsics/c99_functions.c (roundl,lroundf,lround,lroundl,
llroundf,llround,llroundl): New functions.
* c99_protos.h (roundl,lroundf,lround,lroundl,llroundf,llround,
llroundl): New prototypes.
* configure.ac: Check for lroundf, lround, lroundl, llroundf,
llround and llroundl.
* configure: Regenerate.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* gfortran.dg/nint_2.f90: New test.
From-SVN: r127185
2007-08-03 23:26:10 +02:00
|
|
|
if (t - x > 0.5)
|
|
|
|
t -= 1.0;
|
|
|
|
return (t);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
t = ceill (-x);
|
re PR fortran/31202 (Incorrect rounding generated for NINT)
PR fortran/31202
* f95-lang.c (gfc_init_builtin_functions): Defin builtins for
lround{f,,l} and llround{f,,l}.
* trans-intrinsic.c (build_fix_expr): Generate calls to the
{l,}round{f,,l} functions.
* intrinsics/c99_functions.c (roundl,lroundf,lround,lroundl,
llroundf,llround,llroundl): New functions.
* c99_protos.h (roundl,lroundf,lround,lroundl,llroundf,llround,
llroundl): New prototypes.
* configure.ac: Check for lroundf, lround, lroundl, llroundf,
llround and llroundl.
* configure: Regenerate.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* gfortran.dg/nint_2.f90: New test.
From-SVN: r127185
2007-08-03 23:26:10 +02:00
|
|
|
if (t + x > 0.5)
|
|
|
|
t -= 1.0;
|
|
|
|
return (-t);
|
|
|
|
}
|
|
|
|
}
|
2007-08-06 00:14:34 +02:00
|
|
|
#else
|
|
|
|
|
|
|
|
/* Poor version of roundl for system that don't have ceill. */
|
|
|
|
long double
|
2009-07-27 11:24:41 +02:00
|
|
|
roundl (long double x)
|
2007-08-06 00:14:34 +02:00
|
|
|
{
|
|
|
|
if (x > DBL_MAX || x < -DBL_MAX)
|
|
|
|
{
|
|
|
|
#ifdef HAVE_NEXTAFTERL
|
2011-02-22 13:37:12 +01:00
|
|
|
long double prechalf = nextafterl (0.5L, LDBL_MAX);
|
2007-08-06 00:14:34 +02:00
|
|
|
#else
|
|
|
|
static long double prechalf = 0.5L;
|
|
|
|
#endif
|
|
|
|
return (GFC_INTEGER_LARGEST) (x + (x > 0 ? prechalf : -prechalf));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
/* Use round(). */
|
2009-07-27 11:24:41 +02:00
|
|
|
return round ((double) x);
|
2007-08-06 00:14:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
re PR fortran/31202 (Incorrect rounding generated for NINT)
PR fortran/31202
* f95-lang.c (gfc_init_builtin_functions): Defin builtins for
lround{f,,l} and llround{f,,l}.
* trans-intrinsic.c (build_fix_expr): Generate calls to the
{l,}round{f,,l} functions.
* intrinsics/c99_functions.c (roundl,lroundf,lround,lroundl,
llroundf,llround,llroundl): New functions.
* c99_protos.h (roundl,lroundf,lround,lroundl,llroundf,llround,
llroundl): New prototypes.
* configure.ac: Check for lroundf, lround, lroundl, llroundf,
llround and llroundl.
* configure: Regenerate.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* gfortran.dg/nint_2.f90: New test.
From-SVN: r127185
2007-08-03 23:26:10 +02:00
|
|
|
#endif
|
|
|
|
|
2004-06-12 19:59:30 +02:00
|
|
|
#ifndef HAVE_ROUNDF
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_ROUNDF 1
|
2004-06-12 19:59:30 +02:00
|
|
|
/* Round to nearest integral value. If the argument is halfway between two
|
|
|
|
integral values then round away from zero. */
|
2009-07-27 11:24:41 +02:00
|
|
|
float roundf (float x);
|
2004-06-12 19:59:30 +02:00
|
|
|
|
|
|
|
float
|
2009-07-27 11:24:41 +02:00
|
|
|
roundf (float x)
|
2004-06-12 19:59:30 +02:00
|
|
|
{
|
|
|
|
float t;
|
2005-09-27 23:12:52 +02:00
|
|
|
if (!isfinite (x))
|
2004-06-12 19:59:30 +02:00
|
|
|
return (x);
|
|
|
|
|
|
|
|
if (x >= 0.0)
|
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
t = floorf (x);
|
2009-03-28 22:15:45 +01:00
|
|
|
if (t - x <= -0.5)
|
|
|
|
t += 1.0;
|
2004-06-12 19:59:30 +02:00
|
|
|
return (t);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
t = floorf (-x);
|
2009-03-28 22:15:45 +01:00
|
|
|
if (t + x <= -0.5)
|
|
|
|
t += 1.0;
|
2004-06-12 19:59:30 +02:00
|
|
|
return (-t);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
2005-06-23 20:50:25 +02:00
|
|
|
|
re PR fortran/31202 (Incorrect rounding generated for NINT)
PR fortran/31202
* f95-lang.c (gfc_init_builtin_functions): Defin builtins for
lround{f,,l} and llround{f,,l}.
* trans-intrinsic.c (build_fix_expr): Generate calls to the
{l,}round{f,,l} functions.
* intrinsics/c99_functions.c (roundl,lroundf,lround,lroundl,
llroundf,llround,llroundl): New functions.
* c99_protos.h (roundl,lroundf,lround,lroundl,llroundf,llround,
llroundl): New prototypes.
* configure.ac: Check for lroundf, lround, lroundl, llroundf,
llround and llroundl.
* configure: Regenerate.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* gfortran.dg/nint_2.f90: New test.
From-SVN: r127185
2007-08-03 23:26:10 +02:00
|
|
|
|
|
|
|
/* lround{f,,l} and llround{f,,l} functions. */
|
|
|
|
|
|
|
|
#if !defined(HAVE_LROUNDF) && defined(HAVE_ROUNDF)
|
|
|
|
#define HAVE_LROUNDF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long int lroundf (float x);
|
|
|
|
|
re PR fortran/31202 (Incorrect rounding generated for NINT)
PR fortran/31202
* f95-lang.c (gfc_init_builtin_functions): Defin builtins for
lround{f,,l} and llround{f,,l}.
* trans-intrinsic.c (build_fix_expr): Generate calls to the
{l,}round{f,,l} functions.
* intrinsics/c99_functions.c (roundl,lroundf,lround,lroundl,
llroundf,llround,llroundl): New functions.
* c99_protos.h (roundl,lroundf,lround,lroundl,llroundf,llround,
llroundl): New prototypes.
* configure.ac: Check for lroundf, lround, lroundl, llroundf,
llround and llroundl.
* configure: Regenerate.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* gfortran.dg/nint_2.f90: New test.
From-SVN: r127185
2007-08-03 23:26:10 +02:00
|
|
|
long int
|
|
|
|
lroundf (float x)
|
|
|
|
{
|
|
|
|
return (long int) roundf (x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_LROUND) && defined(HAVE_ROUND)
|
|
|
|
#define HAVE_LROUND 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long int lround (double x);
|
|
|
|
|
re PR fortran/31202 (Incorrect rounding generated for NINT)
PR fortran/31202
* f95-lang.c (gfc_init_builtin_functions): Defin builtins for
lround{f,,l} and llround{f,,l}.
* trans-intrinsic.c (build_fix_expr): Generate calls to the
{l,}round{f,,l} functions.
* intrinsics/c99_functions.c (roundl,lroundf,lround,lroundl,
llroundf,llround,llroundl): New functions.
* c99_protos.h (roundl,lroundf,lround,lroundl,llroundf,llround,
llroundl): New prototypes.
* configure.ac: Check for lroundf, lround, lroundl, llroundf,
llround and llroundl.
* configure: Regenerate.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* gfortran.dg/nint_2.f90: New test.
From-SVN: r127185
2007-08-03 23:26:10 +02:00
|
|
|
long int
|
|
|
|
lround (double x)
|
|
|
|
{
|
|
|
|
return (long int) round (x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_LROUNDL) && defined(HAVE_ROUNDL)
|
|
|
|
#define HAVE_LROUNDL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long int lroundl (long double x);
|
|
|
|
|
re PR fortran/31202 (Incorrect rounding generated for NINT)
PR fortran/31202
* f95-lang.c (gfc_init_builtin_functions): Defin builtins for
lround{f,,l} and llround{f,,l}.
* trans-intrinsic.c (build_fix_expr): Generate calls to the
{l,}round{f,,l} functions.
* intrinsics/c99_functions.c (roundl,lroundf,lround,lroundl,
llroundf,llround,llroundl): New functions.
* c99_protos.h (roundl,lroundf,lround,lroundl,llroundf,llround,
llroundl): New prototypes.
* configure.ac: Check for lroundf, lround, lroundl, llroundf,
llround and llroundl.
* configure: Regenerate.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* gfortran.dg/nint_2.f90: New test.
From-SVN: r127185
2007-08-03 23:26:10 +02:00
|
|
|
long int
|
|
|
|
lroundl (long double x)
|
|
|
|
{
|
|
|
|
return (long long int) roundl (x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_LLROUNDF) && defined(HAVE_ROUNDF)
|
|
|
|
#define HAVE_LLROUNDF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long long int llroundf (float x);
|
|
|
|
|
re PR fortran/31202 (Incorrect rounding generated for NINT)
PR fortran/31202
* f95-lang.c (gfc_init_builtin_functions): Defin builtins for
lround{f,,l} and llround{f,,l}.
* trans-intrinsic.c (build_fix_expr): Generate calls to the
{l,}round{f,,l} functions.
* intrinsics/c99_functions.c (roundl,lroundf,lround,lroundl,
llroundf,llround,llroundl): New functions.
* c99_protos.h (roundl,lroundf,lround,lroundl,llroundf,llround,
llroundl): New prototypes.
* configure.ac: Check for lroundf, lround, lroundl, llroundf,
llround and llroundl.
* configure: Regenerate.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* gfortran.dg/nint_2.f90: New test.
From-SVN: r127185
2007-08-03 23:26:10 +02:00
|
|
|
long long int
|
|
|
|
llroundf (float x)
|
|
|
|
{
|
|
|
|
return (long long int) roundf (x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_LLROUND) && defined(HAVE_ROUND)
|
|
|
|
#define HAVE_LLROUND 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long long int llround (double x);
|
|
|
|
|
re PR fortran/31202 (Incorrect rounding generated for NINT)
PR fortran/31202
* f95-lang.c (gfc_init_builtin_functions): Defin builtins for
lround{f,,l} and llround{f,,l}.
* trans-intrinsic.c (build_fix_expr): Generate calls to the
{l,}round{f,,l} functions.
* intrinsics/c99_functions.c (roundl,lroundf,lround,lroundl,
llroundf,llround,llroundl): New functions.
* c99_protos.h (roundl,lroundf,lround,lroundl,llroundf,llround,
llroundl): New prototypes.
* configure.ac: Check for lroundf, lround, lroundl, llroundf,
llround and llroundl.
* configure: Regenerate.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* gfortran.dg/nint_2.f90: New test.
From-SVN: r127185
2007-08-03 23:26:10 +02:00
|
|
|
long long int
|
|
|
|
llround (double x)
|
|
|
|
{
|
|
|
|
return (long long int) round (x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_LLROUNDL) && defined(HAVE_ROUNDL)
|
|
|
|
#define HAVE_LLROUNDL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long long int llroundl (long double x);
|
|
|
|
|
re PR fortran/31202 (Incorrect rounding generated for NINT)
PR fortran/31202
* f95-lang.c (gfc_init_builtin_functions): Defin builtins for
lround{f,,l} and llround{f,,l}.
* trans-intrinsic.c (build_fix_expr): Generate calls to the
{l,}round{f,,l} functions.
* intrinsics/c99_functions.c (roundl,lroundf,lround,lroundl,
llroundf,llround,llroundl): New functions.
* c99_protos.h (roundl,lroundf,lround,lroundl,llroundf,llround,
llroundl): New prototypes.
* configure.ac: Check for lroundf, lround, lroundl, llroundf,
llround and llroundl.
* configure: Regenerate.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* gfortran.dg/nint_2.f90: New test.
From-SVN: r127185
2007-08-03 23:26:10 +02:00
|
|
|
long long int
|
|
|
|
llroundl (long double x)
|
|
|
|
{
|
|
|
|
return (long long int) roundl (x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2005-06-23 20:50:25 +02:00
|
|
|
#ifndef HAVE_LOG10L
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_LOG10L 1
|
2005-06-23 20:50:25 +02:00
|
|
|
/* log10 function for long double variables. The version provided here
|
|
|
|
reduces the argument until it fits into a double, then use log10. */
|
2009-07-27 11:24:41 +02:00
|
|
|
long double log10l (long double x);
|
|
|
|
|
2005-06-23 20:50:25 +02:00
|
|
|
long double
|
2009-07-27 11:24:41 +02:00
|
|
|
log10l (long double x)
|
2005-06-23 20:50:25 +02:00
|
|
|
{
|
|
|
|
#if LDBL_MAX_EXP > DBL_MAX_EXP
|
|
|
|
if (x > DBL_MAX)
|
|
|
|
{
|
|
|
|
double val;
|
|
|
|
int p2_result = 0;
|
|
|
|
if (x > 0x1p16383L) { p2_result += 16383; x /= 0x1p16383L; }
|
|
|
|
if (x > 0x1p8191L) { p2_result += 8191; x /= 0x1p8191L; }
|
|
|
|
if (x > 0x1p4095L) { p2_result += 4095; x /= 0x1p4095L; }
|
|
|
|
if (x > 0x1p2047L) { p2_result += 2047; x /= 0x1p2047L; }
|
|
|
|
if (x > 0x1p1023L) { p2_result += 1023; x /= 0x1p1023L; }
|
|
|
|
val = log10 ((double) x);
|
|
|
|
return (val + p2_result * .30102999566398119521373889472449302L);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#if LDBL_MIN_EXP < DBL_MIN_EXP
|
|
|
|
if (x < DBL_MIN)
|
|
|
|
{
|
|
|
|
double val;
|
|
|
|
int p2_result = 0;
|
|
|
|
if (x < 0x1p-16380L) { p2_result += 16380; x /= 0x1p-16380L; }
|
|
|
|
if (x < 0x1p-8189L) { p2_result += 8189; x /= 0x1p-8189L; }
|
|
|
|
if (x < 0x1p-4093L) { p2_result += 4093; x /= 0x1p-4093L; }
|
|
|
|
if (x < 0x1p-2045L) { p2_result += 2045; x /= 0x1p-2045L; }
|
|
|
|
if (x < 0x1p-1021L) { p2_result += 1021; x /= 0x1p-1021L; }
|
2009-07-27 11:24:41 +02:00
|
|
|
val = fabs (log10 ((double) x));
|
2005-06-23 20:50:25 +02:00
|
|
|
return (- val - p2_result * .30102999566398119521373889472449302L);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
return log10 (x);
|
|
|
|
}
|
|
|
|
#endif
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
|
|
|
|
|
2006-12-06 22:49:55 +01:00
|
|
|
#ifndef HAVE_FLOORL
|
|
|
|
#define HAVE_FLOORL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long double floorl (long double x);
|
|
|
|
|
2006-12-06 22:49:55 +01:00
|
|
|
long double
|
|
|
|
floorl (long double x)
|
|
|
|
{
|
|
|
|
/* Zero, possibly signed. */
|
|
|
|
if (x == 0)
|
|
|
|
return x;
|
|
|
|
|
|
|
|
/* Large magnitude. */
|
|
|
|
if (x > DBL_MAX || x < (-DBL_MAX))
|
|
|
|
return x;
|
|
|
|
|
|
|
|
/* Small positive values. */
|
|
|
|
if (x >= 0 && x < DBL_MIN)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* Small negative values. */
|
|
|
|
if (x < 0 && x > (-DBL_MIN))
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
return floor (x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef HAVE_FMODL
|
|
|
|
#define HAVE_FMODL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long double fmodl (long double x, long double y);
|
|
|
|
|
2006-12-06 22:49:55 +01:00
|
|
|
long double
|
|
|
|
fmodl (long double x, long double y)
|
|
|
|
{
|
|
|
|
if (y == 0.0L)
|
|
|
|
return 0.0L;
|
|
|
|
|
|
|
|
/* Need to check that the result has the same sign as x and magnitude
|
|
|
|
less than the magnitude of y. */
|
|
|
|
return x - floorl (x / y) * y;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
#if !defined(HAVE_CABSF)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CABSF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float cabsf (float complex z);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
float
|
|
|
|
cabsf (float complex z)
|
|
|
|
{
|
|
|
|
return hypotf (REALPART (z), IMAGPART (z));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CABS)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CABS 1
|
2009-07-27 11:24:41 +02:00
|
|
|
double cabs (double complex z);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
double
|
|
|
|
cabs (double complex z)
|
|
|
|
{
|
|
|
|
return hypot (REALPART (z), IMAGPART (z));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CABSL) && defined(HAVE_HYPOTL)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CABSL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long double cabsl (long double complex z);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
long double
|
|
|
|
cabsl (long double complex z)
|
|
|
|
{
|
|
|
|
return hypotl (REALPART (z), IMAGPART (z));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(HAVE_CARGF)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CARGF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float cargf (float complex z);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
float
|
|
|
|
cargf (float complex z)
|
|
|
|
{
|
|
|
|
return atan2f (IMAGPART (z), REALPART (z));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CARG)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CARG 1
|
2009-07-27 11:24:41 +02:00
|
|
|
double carg (double complex z);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
double
|
|
|
|
carg (double complex z)
|
|
|
|
{
|
|
|
|
return atan2 (IMAGPART (z), REALPART (z));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CARGL) && defined(HAVE_ATAN2L)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CARGL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long double cargl (long double complex z);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
long double
|
|
|
|
cargl (long double complex z)
|
|
|
|
{
|
|
|
|
return atan2l (IMAGPART (z), REALPART (z));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* exp(z) = exp(a)*(cos(b) + i sin(b)) */
|
|
|
|
#if !defined(HAVE_CEXPF)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CEXPF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float complex cexpf (float complex z);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
float complex
|
|
|
|
cexpf (float complex z)
|
|
|
|
{
|
|
|
|
float a, b;
|
|
|
|
float complex v;
|
|
|
|
|
|
|
|
a = REALPART (z);
|
|
|
|
b = IMAGPART (z);
|
|
|
|
COMPLEX_ASSIGN (v, cosf (b), sinf (b));
|
|
|
|
return expf (a) * v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CEXP)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CEXP 1
|
2009-07-27 11:24:41 +02:00
|
|
|
double complex cexp (double complex z);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
double complex
|
|
|
|
cexp (double complex z)
|
|
|
|
{
|
|
|
|
double a, b;
|
|
|
|
double complex v;
|
|
|
|
|
|
|
|
a = REALPART (z);
|
|
|
|
b = IMAGPART (z);
|
|
|
|
COMPLEX_ASSIGN (v, cos (b), sin (b));
|
|
|
|
return exp (a) * v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CEXPL) && defined(HAVE_COSL) && defined(HAVE_SINL) && defined(EXPL)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CEXPL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long double complex cexpl (long double complex z);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
long double complex
|
|
|
|
cexpl (long double complex z)
|
|
|
|
{
|
|
|
|
long double a, b;
|
|
|
|
long double complex v;
|
|
|
|
|
|
|
|
a = REALPART (z);
|
|
|
|
b = IMAGPART (z);
|
|
|
|
COMPLEX_ASSIGN (v, cosl (b), sinl (b));
|
|
|
|
return expl (a) * v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* log(z) = log (cabs(z)) + i*carg(z) */
|
|
|
|
#if !defined(HAVE_CLOGF)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CLOGF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float complex clogf (float complex z);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
float complex
|
|
|
|
clogf (float complex z)
|
|
|
|
{
|
|
|
|
float complex v;
|
|
|
|
|
|
|
|
COMPLEX_ASSIGN (v, logf (cabsf (z)), cargf (z));
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CLOG)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CLOG 1
|
2009-07-27 11:24:41 +02:00
|
|
|
double complex clog (double complex z);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
double complex
|
|
|
|
clog (double complex z)
|
|
|
|
{
|
|
|
|
double complex v;
|
|
|
|
|
|
|
|
COMPLEX_ASSIGN (v, log (cabs (z)), carg (z));
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CLOGL) && defined(HAVE_LOGL) && defined(HAVE_CABSL) && defined(HAVE_CARGL)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CLOGL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long double complex clogl (long double complex z);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
long double complex
|
|
|
|
clogl (long double complex z)
|
|
|
|
{
|
|
|
|
long double complex v;
|
|
|
|
|
|
|
|
COMPLEX_ASSIGN (v, logl (cabsl (z)), cargl (z));
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* log10(z) = log10 (cabs(z)) + i*carg(z) */
|
|
|
|
#if !defined(HAVE_CLOG10F)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CLOG10F 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float complex clog10f (float complex z);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
float complex
|
|
|
|
clog10f (float complex z)
|
|
|
|
{
|
|
|
|
float complex v;
|
|
|
|
|
|
|
|
COMPLEX_ASSIGN (v, log10f (cabsf (z)), cargf (z));
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CLOG10)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CLOG10 1
|
2009-07-27 11:24:41 +02:00
|
|
|
double complex clog10 (double complex z);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
double complex
|
|
|
|
clog10 (double complex z)
|
|
|
|
{
|
|
|
|
double complex v;
|
|
|
|
|
|
|
|
COMPLEX_ASSIGN (v, log10 (cabs (z)), carg (z));
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CLOG10L) && defined(HAVE_LOG10L) && defined(HAVE_CABSL) && defined(HAVE_CARGL)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CLOG10L 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long double complex clog10l (long double complex z);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
long double complex
|
|
|
|
clog10l (long double complex z)
|
|
|
|
{
|
|
|
|
long double complex v;
|
|
|
|
|
|
|
|
COMPLEX_ASSIGN (v, log10l (cabsl (z)), cargl (z));
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* pow(base, power) = cexp (power * clog (base)) */
|
|
|
|
#if !defined(HAVE_CPOWF)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CPOWF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float complex cpowf (float complex base, float complex power);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
float complex
|
|
|
|
cpowf (float complex base, float complex power)
|
|
|
|
{
|
|
|
|
return cexpf (power * clogf (base));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CPOW)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CPOW 1
|
2009-07-27 11:24:41 +02:00
|
|
|
double complex cpow (double complex base, double complex power);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
double complex
|
|
|
|
cpow (double complex base, double complex power)
|
|
|
|
{
|
|
|
|
return cexp (power * clog (base));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CPOWL) && defined(HAVE_CEXPL) && defined(HAVE_CLOGL)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CPOWL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long double complex cpowl (long double complex base, long double complex power);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
long double complex
|
|
|
|
cpowl (long double complex base, long double complex power)
|
|
|
|
{
|
|
|
|
return cexpl (power * clogl (base));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* sqrt(z). Algorithm pulled from glibc. */
|
|
|
|
#if !defined(HAVE_CSQRTF)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CSQRTF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float complex csqrtf (float complex z);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
float complex
|
|
|
|
csqrtf (float complex z)
|
|
|
|
{
|
|
|
|
float re, im;
|
|
|
|
float complex v;
|
|
|
|
|
|
|
|
re = REALPART (z);
|
|
|
|
im = IMAGPART (z);
|
|
|
|
if (im == 0)
|
|
|
|
{
|
|
|
|
if (re < 0)
|
|
|
|
{
|
|
|
|
COMPLEX_ASSIGN (v, 0, copysignf (sqrtf (-re), im));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
COMPLEX_ASSIGN (v, fabsf (sqrtf (re)), copysignf (0, im));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (re == 0)
|
|
|
|
{
|
|
|
|
float r;
|
|
|
|
|
|
|
|
r = sqrtf (0.5 * fabsf (im));
|
|
|
|
|
2005-10-12 01:35:27 +02:00
|
|
|
COMPLEX_ASSIGN (v, r, copysignf (r, im));
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
float d, r, s;
|
|
|
|
|
|
|
|
d = hypotf (re, im);
|
|
|
|
/* Use the identity 2 Re res Im res = Im x
|
|
|
|
to avoid cancellation error in d +/- Re x. */
|
|
|
|
if (re > 0)
|
|
|
|
{
|
|
|
|
r = sqrtf (0.5 * d + 0.5 * re);
|
|
|
|
s = (0.5 * im) / r;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
s = sqrtf (0.5 * d - 0.5 * re);
|
|
|
|
r = fabsf ((0.5 * im) / s);
|
|
|
|
}
|
|
|
|
|
|
|
|
COMPLEX_ASSIGN (v, r, copysignf (s, im));
|
|
|
|
}
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CSQRT)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CSQRT 1
|
2009-07-27 11:24:41 +02:00
|
|
|
double complex csqrt (double complex z);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
double complex
|
|
|
|
csqrt (double complex z)
|
|
|
|
{
|
|
|
|
double re, im;
|
|
|
|
double complex v;
|
|
|
|
|
|
|
|
re = REALPART (z);
|
|
|
|
im = IMAGPART (z);
|
|
|
|
if (im == 0)
|
|
|
|
{
|
|
|
|
if (re < 0)
|
|
|
|
{
|
|
|
|
COMPLEX_ASSIGN (v, 0, copysign (sqrt (-re), im));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
COMPLEX_ASSIGN (v, fabs (sqrt (re)), copysign (0, im));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (re == 0)
|
|
|
|
{
|
|
|
|
double r;
|
|
|
|
|
|
|
|
r = sqrt (0.5 * fabs (im));
|
|
|
|
|
2005-10-12 01:35:27 +02:00
|
|
|
COMPLEX_ASSIGN (v, r, copysign (r, im));
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
double d, r, s;
|
|
|
|
|
|
|
|
d = hypot (re, im);
|
|
|
|
/* Use the identity 2 Re res Im res = Im x
|
|
|
|
to avoid cancellation error in d +/- Re x. */
|
|
|
|
if (re > 0)
|
|
|
|
{
|
|
|
|
r = sqrt (0.5 * d + 0.5 * re);
|
|
|
|
s = (0.5 * im) / r;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
s = sqrt (0.5 * d - 0.5 * re);
|
|
|
|
r = fabs ((0.5 * im) / s);
|
|
|
|
}
|
|
|
|
|
|
|
|
COMPLEX_ASSIGN (v, r, copysign (s, im));
|
|
|
|
}
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CSQRTL) && defined(HAVE_COPYSIGNL) && defined(HAVE_SQRTL) && defined(HAVE_FABSL) && defined(HAVE_HYPOTL)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CSQRTL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long double complex csqrtl (long double complex z);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
long double complex
|
|
|
|
csqrtl (long double complex z)
|
|
|
|
{
|
|
|
|
long double re, im;
|
|
|
|
long double complex v;
|
|
|
|
|
|
|
|
re = REALPART (z);
|
|
|
|
im = IMAGPART (z);
|
|
|
|
if (im == 0)
|
|
|
|
{
|
|
|
|
if (re < 0)
|
|
|
|
{
|
|
|
|
COMPLEX_ASSIGN (v, 0, copysignl (sqrtl (-re), im));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
COMPLEX_ASSIGN (v, fabsl (sqrtl (re)), copysignl (0, im));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (re == 0)
|
|
|
|
{
|
|
|
|
long double r;
|
|
|
|
|
|
|
|
r = sqrtl (0.5 * fabsl (im));
|
|
|
|
|
|
|
|
COMPLEX_ASSIGN (v, copysignl (r, im), r);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
long double d, r, s;
|
|
|
|
|
|
|
|
d = hypotl (re, im);
|
|
|
|
/* Use the identity 2 Re res Im res = Im x
|
|
|
|
to avoid cancellation error in d +/- Re x. */
|
|
|
|
if (re > 0)
|
|
|
|
{
|
|
|
|
r = sqrtl (0.5 * d + 0.5 * re);
|
|
|
|
s = (0.5 * im) / r;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
s = sqrtl (0.5 * d - 0.5 * re);
|
|
|
|
r = fabsl ((0.5 * im) / s);
|
|
|
|
}
|
|
|
|
|
|
|
|
COMPLEX_ASSIGN (v, r, copysignl (s, im));
|
|
|
|
}
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* sinh(a + i b) = sinh(a) cos(b) + i cosh(a) sin(b) */
|
|
|
|
#if !defined(HAVE_CSINHF)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CSINHF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float complex csinhf (float complex a);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
float complex
|
|
|
|
csinhf (float complex a)
|
|
|
|
{
|
|
|
|
float r, i;
|
|
|
|
float complex v;
|
|
|
|
|
|
|
|
r = REALPART (a);
|
|
|
|
i = IMAGPART (a);
|
|
|
|
COMPLEX_ASSIGN (v, sinhf (r) * cosf (i), coshf (r) * sinf (i));
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CSINH)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CSINH 1
|
2009-07-27 11:24:41 +02:00
|
|
|
double complex csinh (double complex a);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
double complex
|
|
|
|
csinh (double complex a)
|
|
|
|
{
|
|
|
|
double r, i;
|
|
|
|
double complex v;
|
|
|
|
|
|
|
|
r = REALPART (a);
|
|
|
|
i = IMAGPART (a);
|
|
|
|
COMPLEX_ASSIGN (v, sinh (r) * cos (i), cosh (r) * sin (i));
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CSINHL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CSINHL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long double complex csinhl (long double complex a);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
long double complex
|
|
|
|
csinhl (long double complex a)
|
|
|
|
{
|
|
|
|
long double r, i;
|
|
|
|
long double complex v;
|
|
|
|
|
|
|
|
r = REALPART (a);
|
|
|
|
i = IMAGPART (a);
|
|
|
|
COMPLEX_ASSIGN (v, sinhl (r) * cosl (i), coshl (r) * sinl (i));
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2009-07-10 17:25:31 +02:00
|
|
|
/* cosh(a + i b) = cosh(a) cos(b) + i sinh(a) sin(b) */
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
#if !defined(HAVE_CCOSHF)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CCOSHF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float complex ccoshf (float complex a);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
float complex
|
|
|
|
ccoshf (float complex a)
|
|
|
|
{
|
|
|
|
float r, i;
|
|
|
|
float complex v;
|
|
|
|
|
|
|
|
r = REALPART (a);
|
|
|
|
i = IMAGPART (a);
|
2009-07-10 17:25:31 +02:00
|
|
|
COMPLEX_ASSIGN (v, coshf (r) * cosf (i), sinhf (r) * sinf (i));
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CCOSH)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CCOSH 1
|
2009-07-27 11:24:41 +02:00
|
|
|
double complex ccosh (double complex a);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
double complex
|
|
|
|
ccosh (double complex a)
|
|
|
|
{
|
|
|
|
double r, i;
|
|
|
|
double complex v;
|
|
|
|
|
|
|
|
r = REALPART (a);
|
|
|
|
i = IMAGPART (a);
|
2009-07-10 17:25:31 +02:00
|
|
|
COMPLEX_ASSIGN (v, cosh (r) * cos (i), sinh (r) * sin (i));
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CCOSHL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CCOSHL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long double complex ccoshl (long double complex a);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
long double complex
|
|
|
|
ccoshl (long double complex a)
|
|
|
|
{
|
|
|
|
long double r, i;
|
|
|
|
long double complex v;
|
|
|
|
|
|
|
|
r = REALPART (a);
|
|
|
|
i = IMAGPART (a);
|
2009-07-10 17:25:31 +02:00
|
|
|
COMPLEX_ASSIGN (v, coshl (r) * cosl (i), sinhl (r) * sinl (i));
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2009-07-10 17:25:31 +02:00
|
|
|
/* tanh(a + i b) = (tanh(a) + i tan(b)) / (1 + i tanh(a) tan(b)) */
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
#if !defined(HAVE_CTANHF)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CTANHF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float complex ctanhf (float complex a);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
float complex
|
|
|
|
ctanhf (float complex a)
|
|
|
|
{
|
|
|
|
float rt, it;
|
|
|
|
float complex n, d;
|
|
|
|
|
|
|
|
rt = tanhf (REALPART (a));
|
|
|
|
it = tanf (IMAGPART (a));
|
|
|
|
COMPLEX_ASSIGN (n, rt, it);
|
2009-07-10 17:25:31 +02:00
|
|
|
COMPLEX_ASSIGN (d, 1, rt * it);
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
|
|
|
|
return n / d;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CTANH)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CTANH 1
|
2009-07-27 11:24:41 +02:00
|
|
|
double complex ctanh (double complex a);
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
double complex
|
|
|
|
ctanh (double complex a)
|
|
|
|
{
|
|
|
|
double rt, it;
|
|
|
|
double complex n, d;
|
|
|
|
|
|
|
|
rt = tanh (REALPART (a));
|
|
|
|
it = tan (IMAGPART (a));
|
|
|
|
COMPLEX_ASSIGN (n, rt, it);
|
2009-07-10 17:25:31 +02:00
|
|
|
COMPLEX_ASSIGN (d, 1, rt * it);
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
|
|
|
|
return n / d;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CTANHL) && defined(HAVE_TANL) && defined(HAVE_TANHL)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CTANHL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long double complex ctanhl (long double complex a);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
long double complex
|
|
|
|
ctanhl (long double complex a)
|
|
|
|
{
|
|
|
|
long double rt, it;
|
|
|
|
long double complex n, d;
|
|
|
|
|
|
|
|
rt = tanhl (REALPART (a));
|
|
|
|
it = tanl (IMAGPART (a));
|
|
|
|
COMPLEX_ASSIGN (n, rt, it);
|
2009-07-10 17:25:31 +02:00
|
|
|
COMPLEX_ASSIGN (d, 1, rt * it);
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
|
|
|
|
return n / d;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* sin(a + i b) = sin(a) cosh(b) + i cos(a) sinh(b) */
|
|
|
|
#if !defined(HAVE_CSINF)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CSINF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float complex csinf (float complex a);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
float complex
|
|
|
|
csinf (float complex a)
|
|
|
|
{
|
|
|
|
float r, i;
|
|
|
|
float complex v;
|
|
|
|
|
|
|
|
r = REALPART (a);
|
|
|
|
i = IMAGPART (a);
|
|
|
|
COMPLEX_ASSIGN (v, sinf (r) * coshf (i), cosf (r) * sinhf (i));
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CSIN)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CSIN 1
|
2009-07-27 11:24:41 +02:00
|
|
|
double complex csin (double complex a);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
double complex
|
|
|
|
csin (double complex a)
|
|
|
|
{
|
|
|
|
double r, i;
|
|
|
|
double complex v;
|
|
|
|
|
|
|
|
r = REALPART (a);
|
|
|
|
i = IMAGPART (a);
|
|
|
|
COMPLEX_ASSIGN (v, sin (r) * cosh (i), cos (r) * sinh (i));
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CSINL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CSINL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long double complex csinl (long double complex a);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
long double complex
|
|
|
|
csinl (long double complex a)
|
|
|
|
{
|
|
|
|
long double r, i;
|
|
|
|
long double complex v;
|
|
|
|
|
|
|
|
r = REALPART (a);
|
|
|
|
i = IMAGPART (a);
|
|
|
|
COMPLEX_ASSIGN (v, sinl (r) * coshl (i), cosl (r) * sinhl (i));
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* cos(a + i b) = cos(a) cosh(b) - i sin(a) sinh(b) */
|
|
|
|
#if !defined(HAVE_CCOSF)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CCOSF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float complex ccosf (float complex a);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
float complex
|
|
|
|
ccosf (float complex a)
|
|
|
|
{
|
|
|
|
float r, i;
|
|
|
|
float complex v;
|
|
|
|
|
|
|
|
r = REALPART (a);
|
|
|
|
i = IMAGPART (a);
|
|
|
|
COMPLEX_ASSIGN (v, cosf (r) * coshf (i), - (sinf (r) * sinhf (i)));
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CCOS)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CCOS 1
|
2009-07-27 11:24:41 +02:00
|
|
|
double complex ccos (double complex a);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
double complex
|
|
|
|
ccos (double complex a)
|
|
|
|
{
|
|
|
|
double r, i;
|
|
|
|
double complex v;
|
|
|
|
|
|
|
|
r = REALPART (a);
|
|
|
|
i = IMAGPART (a);
|
|
|
|
COMPLEX_ASSIGN (v, cos (r) * cosh (i), - (sin (r) * sinh (i)));
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CCOSL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CCOSL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long double complex ccosl (long double complex a);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
long double complex
|
|
|
|
ccosl (long double complex a)
|
|
|
|
{
|
|
|
|
long double r, i;
|
|
|
|
long double complex v;
|
|
|
|
|
|
|
|
r = REALPART (a);
|
|
|
|
i = IMAGPART (a);
|
|
|
|
COMPLEX_ASSIGN (v, cosl (r) * coshl (i), - (sinl (r) * sinhl (i)));
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* tan(a + i b) = (tan(a) + i tanh(b)) / (1 - i tan(a) tanh(b)) */
|
|
|
|
#if !defined(HAVE_CTANF)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CTANF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float complex ctanf (float complex a);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
float complex
|
|
|
|
ctanf (float complex a)
|
|
|
|
{
|
|
|
|
float rt, it;
|
|
|
|
float complex n, d;
|
|
|
|
|
|
|
|
rt = tanf (REALPART (a));
|
|
|
|
it = tanhf (IMAGPART (a));
|
|
|
|
COMPLEX_ASSIGN (n, rt, it);
|
|
|
|
COMPLEX_ASSIGN (d, 1, - (rt * it));
|
|
|
|
|
|
|
|
return n / d;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CTAN)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CTAN 1
|
2009-07-27 11:24:41 +02:00
|
|
|
double complex ctan (double complex a);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
double complex
|
|
|
|
ctan (double complex a)
|
|
|
|
{
|
|
|
|
double rt, it;
|
|
|
|
double complex n, d;
|
|
|
|
|
|
|
|
rt = tan (REALPART (a));
|
|
|
|
it = tanh (IMAGPART (a));
|
|
|
|
COMPLEX_ASSIGN (n, rt, it);
|
|
|
|
COMPLEX_ASSIGN (d, 1, - (rt * it));
|
|
|
|
|
|
|
|
return n / d;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CTANL) && defined(HAVE_TANL) && defined(HAVE_TANHL)
|
2005-10-19 11:45:27 +02:00
|
|
|
#define HAVE_CTANL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
long double complex ctanl (long double complex a);
|
|
|
|
|
c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
* libgfortran.h: Include complex.h before c99_protos.h.
* intrinsics/c99_functions.c: Define HAVE_ macros for the
fallback functions we provide.
(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
ccosl, ctanf, ctan, ctanl): New fallback functions.
* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
* Makefile.in: Regenerate.
* configure.ac: Remove checks for csin. Add checks for all C99
complex functions.
* config.h.in: Regenerate.
* configure: Regenerate.
* aclocal.m4: Regenerate.
From-SVN: r104626
2005-09-25 23:39:58 +02:00
|
|
|
long double complex
|
|
|
|
ctanl (long double complex a)
|
|
|
|
{
|
|
|
|
long double rt, it;
|
|
|
|
long double complex n, d;
|
|
|
|
|
|
|
|
rt = tanl (REALPART (a));
|
|
|
|
it = tanhl (IMAGPART (a));
|
|
|
|
COMPLEX_ASSIGN (n, rt, it);
|
|
|
|
COMPLEX_ASSIGN (d, 1, - (rt * it));
|
|
|
|
|
|
|
|
return n / d;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
re PR libfortran/33583 (FAIL: gfortran.dg/gamma_1.f90)
PR libfortran/33583
PR libfortran/33698
* intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf):
New fallback functions.
* c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes.
* configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma,
lgammaf and lgammal.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r130245
2007-11-16 23:31:28 +01:00
|
|
|
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
/* Complex ASIN. Returns wrongly NaN for infinite arguments.
|
|
|
|
Algorithm taken from Abramowitz & Stegun. */
|
|
|
|
|
|
|
|
#if !defined(HAVE_CASINF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
|
|
|
|
#define HAVE_CASINF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
complex float casinf (complex float z);
|
|
|
|
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
complex float
|
|
|
|
casinf (complex float z)
|
|
|
|
{
|
|
|
|
return -I*clogf (I*z + csqrtf (1.0f-z*z));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(HAVE_CASIN) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
|
|
|
|
#define HAVE_CASIN 1
|
2009-07-27 11:24:41 +02:00
|
|
|
complex double casin (complex double z);
|
|
|
|
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
complex double
|
|
|
|
casin (complex double z)
|
|
|
|
{
|
|
|
|
return -I*clog (I*z + csqrt (1.0-z*z));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(HAVE_CASINL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
|
|
|
|
#define HAVE_CASINL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
complex long double casinl (complex long double z);
|
|
|
|
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
complex long double
|
|
|
|
casinl (complex long double z)
|
|
|
|
{
|
|
|
|
return -I*clogl (I*z + csqrtl (1.0L-z*z));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* Complex ACOS. Returns wrongly NaN for infinite arguments.
|
|
|
|
Algorithm taken from Abramowitz & Stegun. */
|
|
|
|
|
|
|
|
#if !defined(HAVE_CACOSF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
|
|
|
|
#define HAVE_CACOSF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
complex float cacosf (complex float z);
|
|
|
|
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
complex float
|
|
|
|
cacosf (complex float z)
|
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
return -I*clogf (z + I*csqrtf (1.0f-z*z));
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(HAVE_CACOS) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
|
|
|
|
#define HAVE_CACOS 1
|
2009-07-27 11:24:41 +02:00
|
|
|
complex double cacos (complex double z);
|
|
|
|
|
|
|
|
complex double
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
cacos (complex double z)
|
|
|
|
{
|
|
|
|
return -I*clog (z + I*csqrt (1.0-z*z));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(HAVE_CACOSL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
|
|
|
|
#define HAVE_CACOSL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
complex long double cacosl (complex long double z);
|
|
|
|
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
complex long double
|
|
|
|
cacosl (complex long double z)
|
|
|
|
{
|
|
|
|
return -I*clogl (z + I*csqrtl (1.0L-z*z));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* Complex ATAN. Returns wrongly NaN for infinite arguments.
|
|
|
|
Algorithm taken from Abramowitz & Stegun. */
|
|
|
|
|
|
|
|
#if !defined(HAVE_CATANF) && defined(HAVE_CLOGF)
|
|
|
|
#define HAVE_CACOSF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
complex float catanf (complex float z);
|
|
|
|
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
complex float
|
|
|
|
catanf (complex float z)
|
|
|
|
{
|
|
|
|
return I*clogf ((I+z)/(I-z))/2.0f;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(HAVE_CATAN) && defined(HAVE_CLOG)
|
|
|
|
#define HAVE_CACOS 1
|
2009-07-27 11:24:41 +02:00
|
|
|
complex double catan (complex double z);
|
|
|
|
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
complex double
|
|
|
|
catan (complex double z)
|
|
|
|
{
|
|
|
|
return I*clog ((I+z)/(I-z))/2.0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(HAVE_CATANL) && defined(HAVE_CLOGL)
|
|
|
|
#define HAVE_CACOSL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
complex long double catanl (complex long double z);
|
|
|
|
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
complex long double
|
|
|
|
catanl (complex long double z)
|
|
|
|
{
|
|
|
|
return I*clogl ((I+z)/(I-z))/2.0L;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* Complex ASINH. Returns wrongly NaN for infinite arguments.
|
|
|
|
Algorithm taken from Abramowitz & Stegun. */
|
|
|
|
|
|
|
|
#if !defined(HAVE_CASINHF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
|
|
|
|
#define HAVE_CASINHF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
complex float casinhf (complex float z);
|
|
|
|
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
complex float
|
|
|
|
casinhf (complex float z)
|
|
|
|
{
|
|
|
|
return clogf (z + csqrtf (z*z+1.0f));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(HAVE_CASINH) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
|
|
|
|
#define HAVE_CASINH 1
|
2009-07-27 11:24:41 +02:00
|
|
|
complex double casinh (complex double z);
|
|
|
|
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
complex double
|
|
|
|
casinh (complex double z)
|
|
|
|
{
|
|
|
|
return clog (z + csqrt (z*z+1.0));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(HAVE_CASINHL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
|
|
|
|
#define HAVE_CASINHL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
complex long double casinhl (complex long double z);
|
|
|
|
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
complex long double
|
|
|
|
casinhl (complex long double z)
|
|
|
|
{
|
|
|
|
return clogl (z + csqrtl (z*z+1.0L));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* Complex ACOSH. Returns wrongly NaN for infinite arguments.
|
|
|
|
Algorithm taken from Abramowitz & Stegun. */
|
|
|
|
|
|
|
|
#if !defined(HAVE_CACOSHF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
|
|
|
|
#define HAVE_CACOSHF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
complex float cacoshf (complex float z);
|
|
|
|
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
complex float
|
|
|
|
cacoshf (complex float z)
|
|
|
|
{
|
|
|
|
return clogf (z + csqrtf (z-1.0f) * csqrtf (z+1.0f));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(HAVE_CACOSH) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
|
|
|
|
#define HAVE_CACOSH 1
|
2009-07-27 11:24:41 +02:00
|
|
|
complex double cacosh (complex double z);
|
|
|
|
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
complex double
|
|
|
|
cacosh (complex double z)
|
|
|
|
{
|
|
|
|
return clog (z + csqrt (z-1.0) * csqrt (z+1.0));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(HAVE_CACOSHL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
|
|
|
|
#define HAVE_CACOSHL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
complex long double cacoshl (complex long double z);
|
|
|
|
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
complex long double
|
|
|
|
cacoshl (complex long double z)
|
|
|
|
{
|
|
|
|
return clogl (z + csqrtl (z-1.0L) * csqrtl (z+1.0L));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* Complex ATANH. Returns wrongly NaN for infinite arguments.
|
|
|
|
Algorithm taken from Abramowitz & Stegun. */
|
|
|
|
|
|
|
|
#if !defined(HAVE_CATANHF) && defined(HAVE_CLOGF)
|
|
|
|
#define HAVE_CATANHF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
complex float catanhf (complex float z);
|
|
|
|
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
complex float
|
|
|
|
catanhf (complex float z)
|
|
|
|
{
|
|
|
|
return clogf ((1.0f+z)/(1.0f-z))/2.0f;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(HAVE_CATANH) && defined(HAVE_CLOG)
|
|
|
|
#define HAVE_CATANH 1
|
2009-07-27 11:24:41 +02:00
|
|
|
complex double catanh (complex double z);
|
|
|
|
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
complex double
|
|
|
|
catanh (complex double z)
|
|
|
|
{
|
|
|
|
return clog ((1.0+z)/(1.0-z))/2.0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_CATANHL) && defined(HAVE_CLOGL)
|
|
|
|
#define HAVE_CATANHL 1
|
2009-07-27 11:24:41 +02:00
|
|
|
complex long double catanhl (complex long double z);
|
|
|
|
|
re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25 Tobias Burnus <burnus@net-b.de>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Support complex arguments for
acos,acosh,asin,asinh,atan,atanh.
* invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
complex arguments.
* simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
gfc_simplify_acosh,gfc_simplify_atanh): Support
complex arguments.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
* c99_protos.h: Add prototypes for those.
2009-07-25 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gfortran.dg/complex_intrinsic_5.f90: New test.
* gfortran.dg/complex_intrinsic_7.f90: New test.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r150087
2009-07-25 21:39:07 +02:00
|
|
|
complex long double
|
|
|
|
catanhl (complex long double z)
|
|
|
|
{
|
|
|
|
return clogl ((1.0L+z)/(1.0L-z))/2.0L;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
re PR libfortran/33583 (FAIL: gfortran.dg/gamma_1.f90)
PR libfortran/33583
PR libfortran/33698
* intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf):
New fallback functions.
* c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes.
* configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma,
lgammaf and lgammal.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r130245
2007-11-16 23:31:28 +01:00
|
|
|
#if !defined(HAVE_TGAMMA)
|
|
|
|
#define HAVE_TGAMMA 1
|
2009-07-27 11:24:41 +02:00
|
|
|
double tgamma (double);
|
re PR libfortran/33583 (FAIL: gfortran.dg/gamma_1.f90)
PR libfortran/33583
PR libfortran/33698
* intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf):
New fallback functions.
* c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes.
* configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma,
lgammaf and lgammal.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r130245
2007-11-16 23:31:28 +01:00
|
|
|
|
|
|
|
/* Fallback tgamma() function. Uses the algorithm from
|
|
|
|
http://www.netlib.org/specfun/gamma and references therein. */
|
|
|
|
|
|
|
|
#undef SQRTPI
|
|
|
|
#define SQRTPI 0.9189385332046727417803297
|
|
|
|
|
|
|
|
#undef PI
|
|
|
|
#define PI 3.1415926535897932384626434
|
|
|
|
|
|
|
|
double
|
|
|
|
tgamma (double x)
|
|
|
|
{
|
|
|
|
int i, n, parity;
|
|
|
|
double fact, res, sum, xden, xnum, y, y1, ysq, z;
|
|
|
|
|
|
|
|
static double p[8] = {
|
|
|
|
-1.71618513886549492533811e0, 2.47656508055759199108314e1,
|
|
|
|
-3.79804256470945635097577e2, 6.29331155312818442661052e2,
|
|
|
|
8.66966202790413211295064e2, -3.14512729688483675254357e4,
|
|
|
|
-3.61444134186911729807069e4, 6.64561438202405440627855e4 };
|
|
|
|
|
|
|
|
static double q[8] = {
|
|
|
|
-3.08402300119738975254353e1, 3.15350626979604161529144e2,
|
|
|
|
-1.01515636749021914166146e3, -3.10777167157231109440444e3,
|
|
|
|
2.25381184209801510330112e4, 4.75584627752788110767815e3,
|
|
|
|
-1.34659959864969306392456e5, -1.15132259675553483497211e5 };
|
|
|
|
|
|
|
|
static double c[7] = { -1.910444077728e-03,
|
|
|
|
8.4171387781295e-04, -5.952379913043012e-04,
|
|
|
|
7.93650793500350248e-04, -2.777777777777681622553e-03,
|
|
|
|
8.333333333333333331554247e-02, 5.7083835261e-03 };
|
|
|
|
|
|
|
|
static const double xminin = 2.23e-308;
|
|
|
|
static const double xbig = 171.624;
|
|
|
|
static const double xnan = __builtin_nan ("0x0"), xinf = __builtin_inf ();
|
|
|
|
static double eps = 0;
|
|
|
|
|
|
|
|
if (eps == 0)
|
2009-07-27 11:24:41 +02:00
|
|
|
eps = nextafter (1., 2.) - 1.;
|
re PR libfortran/33583 (FAIL: gfortran.dg/gamma_1.f90)
PR libfortran/33583
PR libfortran/33698
* intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf):
New fallback functions.
* c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes.
* configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma,
lgammaf and lgammal.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r130245
2007-11-16 23:31:28 +01:00
|
|
|
|
|
|
|
parity = 0;
|
|
|
|
fact = 1;
|
|
|
|
n = 0;
|
|
|
|
y = x;
|
|
|
|
|
2010-09-09 20:47:11 +02:00
|
|
|
if (isnan (x))
|
re PR libfortran/33583 (FAIL: gfortran.dg/gamma_1.f90)
PR libfortran/33583
PR libfortran/33698
* intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf):
New fallback functions.
* c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes.
* configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma,
lgammaf and lgammal.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r130245
2007-11-16 23:31:28 +01:00
|
|
|
return x;
|
|
|
|
|
|
|
|
if (y <= 0)
|
|
|
|
{
|
|
|
|
y = -x;
|
2009-07-27 11:24:41 +02:00
|
|
|
y1 = trunc (y);
|
re PR libfortran/33583 (FAIL: gfortran.dg/gamma_1.f90)
PR libfortran/33583
PR libfortran/33698
* intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf):
New fallback functions.
* c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes.
* configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma,
lgammaf and lgammal.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r130245
2007-11-16 23:31:28 +01:00
|
|
|
res = y - y1;
|
|
|
|
|
|
|
|
if (res != 0)
|
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
if (y1 != trunc (y1*0.5l)*2)
|
re PR libfortran/33583 (FAIL: gfortran.dg/gamma_1.f90)
PR libfortran/33583
PR libfortran/33698
* intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf):
New fallback functions.
* c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes.
* configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma,
lgammaf and lgammal.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r130245
2007-11-16 23:31:28 +01:00
|
|
|
parity = 1;
|
2009-07-27 11:24:41 +02:00
|
|
|
fact = -PI / sin (PI*res);
|
re PR libfortran/33583 (FAIL: gfortran.dg/gamma_1.f90)
PR libfortran/33583
PR libfortran/33698
* intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf):
New fallback functions.
* c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes.
* configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma,
lgammaf and lgammal.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r130245
2007-11-16 23:31:28 +01:00
|
|
|
y = y + 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return x == 0 ? copysign (xinf, x) : xnan;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (y < eps)
|
|
|
|
{
|
|
|
|
if (y >= xminin)
|
|
|
|
res = 1 / y;
|
|
|
|
else
|
|
|
|
return xinf;
|
|
|
|
}
|
|
|
|
else if (y < 13)
|
|
|
|
{
|
|
|
|
y1 = y;
|
|
|
|
if (y < 1)
|
|
|
|
{
|
|
|
|
z = y;
|
|
|
|
y = y + 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
n = (int)y - 1;
|
|
|
|
y = y - n;
|
|
|
|
z = y - 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
xnum = 0;
|
|
|
|
xden = 1;
|
|
|
|
for (i = 0; i < 8; i++)
|
|
|
|
{
|
|
|
|
xnum = (xnum + p[i]) * z;
|
|
|
|
xden = xden * z + q[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
res = xnum / xden + 1;
|
|
|
|
|
|
|
|
if (y1 < y)
|
|
|
|
res = res / y1;
|
|
|
|
else if (y1 > y)
|
|
|
|
for (i = 1; i <= n; i++)
|
|
|
|
{
|
|
|
|
res = res * y;
|
|
|
|
y = y + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (y < xbig)
|
|
|
|
{
|
|
|
|
ysq = y * y;
|
|
|
|
sum = c[6];
|
|
|
|
for (i = 0; i < 6; i++)
|
|
|
|
sum = sum / ysq + c[i];
|
|
|
|
|
|
|
|
sum = sum/y - y + SQRTPI;
|
2009-07-27 11:24:41 +02:00
|
|
|
sum = sum + (y - 0.5) * log (y);
|
|
|
|
res = exp (sum);
|
re PR libfortran/33583 (FAIL: gfortran.dg/gamma_1.f90)
PR libfortran/33583
PR libfortran/33698
* intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf):
New fallback functions.
* c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes.
* configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma,
lgammaf and lgammal.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r130245
2007-11-16 23:31:28 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
return x < 0 ? xnan : xinf;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parity)
|
|
|
|
res = -res;
|
|
|
|
if (fact != 1)
|
|
|
|
res = fact / res;
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(HAVE_LGAMMA)
|
|
|
|
#define HAVE_LGAMMA 1
|
2009-07-27 11:24:41 +02:00
|
|
|
double lgamma (double);
|
re PR libfortran/33583 (FAIL: gfortran.dg/gamma_1.f90)
PR libfortran/33583
PR libfortran/33698
* intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf):
New fallback functions.
* c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes.
* configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma,
lgammaf and lgammal.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r130245
2007-11-16 23:31:28 +01:00
|
|
|
|
|
|
|
/* Fallback lgamma() function. Uses the algorithm from
|
|
|
|
http://www.netlib.org/specfun/algama and references therein,
|
|
|
|
except for negative arguments (where netlib would return +Inf)
|
|
|
|
where we use the following identity:
|
|
|
|
lgamma(y) = log(pi/(|y*sin(pi*y)|)) - lgamma(-y)
|
|
|
|
*/
|
|
|
|
|
|
|
|
double
|
|
|
|
lgamma (double y)
|
|
|
|
{
|
|
|
|
|
|
|
|
#undef SQRTPI
|
|
|
|
#define SQRTPI 0.9189385332046727417803297
|
|
|
|
|
|
|
|
#undef PI
|
|
|
|
#define PI 3.1415926535897932384626434
|
|
|
|
|
|
|
|
#define PNT68 0.6796875
|
|
|
|
#define D1 -0.5772156649015328605195174
|
|
|
|
#define D2 0.4227843350984671393993777
|
|
|
|
#define D4 1.791759469228055000094023
|
|
|
|
|
|
|
|
static double p1[8] = {
|
|
|
|
4.945235359296727046734888e0, 2.018112620856775083915565e2,
|
|
|
|
2.290838373831346393026739e3, 1.131967205903380828685045e4,
|
|
|
|
2.855724635671635335736389e4, 3.848496228443793359990269e4,
|
|
|
|
2.637748787624195437963534e4, 7.225813979700288197698961e3 };
|
|
|
|
static double q1[8] = {
|
|
|
|
6.748212550303777196073036e1, 1.113332393857199323513008e3,
|
|
|
|
7.738757056935398733233834e3, 2.763987074403340708898585e4,
|
|
|
|
5.499310206226157329794414e4, 6.161122180066002127833352e4,
|
|
|
|
3.635127591501940507276287e4, 8.785536302431013170870835e3 };
|
|
|
|
static double p2[8] = {
|
|
|
|
4.974607845568932035012064e0, 5.424138599891070494101986e2,
|
|
|
|
1.550693864978364947665077e4, 1.847932904445632425417223e5,
|
|
|
|
1.088204769468828767498470e6, 3.338152967987029735917223e6,
|
|
|
|
5.106661678927352456275255e6, 3.074109054850539556250927e6 };
|
|
|
|
static double q2[8] = {
|
|
|
|
1.830328399370592604055942e2, 7.765049321445005871323047e3,
|
|
|
|
1.331903827966074194402448e5, 1.136705821321969608938755e6,
|
|
|
|
5.267964117437946917577538e6, 1.346701454311101692290052e7,
|
|
|
|
1.782736530353274213975932e7, 9.533095591844353613395747e6 };
|
|
|
|
static double p4[8] = {
|
|
|
|
1.474502166059939948905062e4, 2.426813369486704502836312e6,
|
|
|
|
1.214755574045093227939592e8, 2.663432449630976949898078e9,
|
|
|
|
2.940378956634553899906876e10, 1.702665737765398868392998e11,
|
|
|
|
4.926125793377430887588120e11, 5.606251856223951465078242e11 };
|
|
|
|
static double q4[8] = {
|
|
|
|
2.690530175870899333379843e3, 6.393885654300092398984238e5,
|
|
|
|
4.135599930241388052042842e7, 1.120872109616147941376570e9,
|
|
|
|
1.488613728678813811542398e10, 1.016803586272438228077304e11,
|
|
|
|
3.417476345507377132798597e11, 4.463158187419713286462081e11 };
|
|
|
|
static double c[7] = {
|
|
|
|
-1.910444077728e-03, 8.4171387781295e-04,
|
|
|
|
-5.952379913043012e-04, 7.93650793500350248e-04,
|
|
|
|
-2.777777777777681622553e-03, 8.333333333333333331554247e-02,
|
|
|
|
5.7083835261e-03 };
|
|
|
|
|
|
|
|
static double xbig = 2.55e305, xinf = __builtin_inf (), eps = 0,
|
|
|
|
frtbig = 2.25e76;
|
|
|
|
|
|
|
|
int i;
|
|
|
|
double corr, res, xden, xm1, xm2, xm4, xnum, ysq;
|
|
|
|
|
|
|
|
if (eps == 0)
|
2009-07-27 11:24:41 +02:00
|
|
|
eps = __builtin_nextafter (1., 2.) - 1.;
|
re PR libfortran/33583 (FAIL: gfortran.dg/gamma_1.f90)
PR libfortran/33583
PR libfortran/33698
* intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf):
New fallback functions.
* c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes.
* configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma,
lgammaf and lgammal.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r130245
2007-11-16 23:31:28 +01:00
|
|
|
|
|
|
|
if ((y > 0) && (y <= xbig))
|
|
|
|
{
|
|
|
|
if (y <= eps)
|
2009-07-27 11:24:41 +02:00
|
|
|
res = -log (y);
|
re PR libfortran/33583 (FAIL: gfortran.dg/gamma_1.f90)
PR libfortran/33583
PR libfortran/33698
* intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf):
New fallback functions.
* c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes.
* configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma,
lgammaf and lgammal.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r130245
2007-11-16 23:31:28 +01:00
|
|
|
else if (y <= 1.5)
|
|
|
|
{
|
|
|
|
if (y < PNT68)
|
|
|
|
{
|
2009-07-27 11:24:41 +02:00
|
|
|
corr = -log (y);
|
re PR libfortran/33583 (FAIL: gfortran.dg/gamma_1.f90)
PR libfortran/33583
PR libfortran/33698
* intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf):
New fallback functions.
* c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes.
* configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma,
lgammaf and lgammal.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r130245
2007-11-16 23:31:28 +01:00
|
|
|
xm1 = y;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
corr = 0;
|
|
|
|
xm1 = (y - 0.5) - 0.5;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((y <= 0.5) || (y >= PNT68))
|
|
|
|
{
|
|
|
|
xden = 1;
|
|
|
|
xnum = 0;
|
|
|
|
for (i = 0; i < 8; i++)
|
|
|
|
{
|
|
|
|
xnum = xnum*xm1 + p1[i];
|
|
|
|
xden = xden*xm1 + q1[i];
|
|
|
|
}
|
|
|
|
res = corr + (xm1 * (D1 + xm1*(xnum/xden)));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
xm2 = (y - 0.5) - 0.5;
|
|
|
|
xden = 1;
|
|
|
|
xnum = 0;
|
|
|
|
for (i = 0; i < 8; i++)
|
|
|
|
{
|
|
|
|
xnum = xnum*xm2 + p2[i];
|
|
|
|
xden = xden*xm2 + q2[i];
|
|
|
|
}
|
|
|
|
res = corr + xm2 * (D2 + xm2*(xnum/xden));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (y <= 4)
|
|
|
|
{
|
|
|
|
xm2 = y - 2;
|
|
|
|
xden = 1;
|
|
|
|
xnum = 0;
|
|
|
|
for (i = 0; i < 8; i++)
|
|
|
|
{
|
|
|
|
xnum = xnum*xm2 + p2[i];
|
|
|
|
xden = xden*xm2 + q2[i];
|
|
|
|
}
|
|
|
|
res = xm2 * (D2 + xm2*(xnum/xden));
|
|
|
|
}
|
|
|
|
else if (y <= 12)
|
|
|
|
{
|
|
|
|
xm4 = y - 4;
|
|
|
|
xden = -1;
|
|
|
|
xnum = 0;
|
|
|
|
for (i = 0; i < 8; i++)
|
|
|
|
{
|
|
|
|
xnum = xnum*xm4 + p4[i];
|
|
|
|
xden = xden*xm4 + q4[i];
|
|
|
|
}
|
|
|
|
res = D4 + xm4*(xnum/xden);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
res = 0;
|
|
|
|
if (y <= frtbig)
|
|
|
|
{
|
|
|
|
res = c[6];
|
|
|
|
ysq = y * y;
|
|
|
|
for (i = 0; i < 6; i++)
|
|
|
|
res = res / ysq + c[i];
|
|
|
|
}
|
|
|
|
res = res/y;
|
2009-07-27 11:24:41 +02:00
|
|
|
corr = log (y);
|
re PR libfortran/33583 (FAIL: gfortran.dg/gamma_1.f90)
PR libfortran/33583
PR libfortran/33698
* intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf):
New fallback functions.
* c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes.
* configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma,
lgammaf and lgammal.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r130245
2007-11-16 23:31:28 +01:00
|
|
|
res = res + SQRTPI - 0.5*corr;
|
|
|
|
res = res + y*(corr-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (y < 0 && __builtin_floor (y) != y)
|
|
|
|
{
|
|
|
|
/* lgamma(y) = log(pi/(|y*sin(pi*y)|)) - lgamma(-y)
|
|
|
|
For abs(y) very close to zero, we use a series expansion to
|
|
|
|
the first order in y to avoid overflow. */
|
|
|
|
if (y > -1.e-100)
|
|
|
|
res = -2 * log (fabs (y)) - lgamma (-y);
|
|
|
|
else
|
|
|
|
res = log (PI / fabs (y * sin (PI * y))) - lgamma (-y);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
res = xinf;
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(HAVE_TGAMMA) && !defined(HAVE_TGAMMAF)
|
|
|
|
#define HAVE_TGAMMAF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float tgammaf (float);
|
re PR libfortran/33583 (FAIL: gfortran.dg/gamma_1.f90)
PR libfortran/33583
PR libfortran/33698
* intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf):
New fallback functions.
* c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes.
* configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma,
lgammaf and lgammal.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r130245
2007-11-16 23:31:28 +01:00
|
|
|
|
|
|
|
float
|
|
|
|
tgammaf (float x)
|
|
|
|
{
|
|
|
|
return (float) tgamma ((double) x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_LGAMMA) && !defined(HAVE_LGAMMAF)
|
|
|
|
#define HAVE_LGAMMAF 1
|
2009-07-27 11:24:41 +02:00
|
|
|
float lgammaf (float);
|
re PR libfortran/33583 (FAIL: gfortran.dg/gamma_1.f90)
PR libfortran/33583
PR libfortran/33698
* intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf):
New fallback functions.
* c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes.
* configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma,
lgammaf and lgammal.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r130245
2007-11-16 23:31:28 +01:00
|
|
|
|
|
|
|
float
|
|
|
|
lgammaf (float x)
|
|
|
|
{
|
|
|
|
return (float) lgamma ((double) x);
|
|
|
|
}
|
|
|
|
#endif
|