/* polevll.c
* p1evll . c
*
* Evaluate polynomial
*
*
*
* SYNOPSIS :
*
* int N ;
* long double x , y , coef [ N + 1 ] , polevl [ ] ;
*
* y = polevll ( x , coef , N ) ;
*
*
*
* DESCRIPTION :
*
* Evaluates polynomial of degree N :
*
* 2 N
* y = C + C x + C x + . . . + C x
* 0 1 2 N
*
* Coefficients are stored in reverse order :
*
* coef [ 0 ] = C , . . . , coef [ N ] = C .
* N 0
*
* The function p1evll ( ) assumes that coef [ N ] = 1 . 0 and is
* omitted from the array . Its calling arguments are
* otherwise the same as polevll ( ) .
*
* This module also contains the following globally declared constants :
* MAXNUML = 1 . 189731495357231765021263853 E4932L ;
* MACHEPL = 5 . 42101086242752217003726400434970855712890625 E - 20 L ;
* MAXLOGL = 1 . 1356523406294143949492 E4L ;
* MINLOGL = - 1 . 1355137111933024058873 E4L ;
* LOGE2L = 6 . 9314718055994530941723 E - 1 L ;
* LOG2EL = 1 . 4426950408889634073599 E0L ;
* PIL = 3 . 1415926535897932384626 L ;
* PIO2L = 1 . 5707963267948966192313 L ;
* PIO4L = 7 . 8539816339744830961566 E - 1 L ;
*
* SPEED :
*
* In the interest of speed , there are no checks for out
* of bounds arithmetic . This routine is used by most of
* the functions in the library . Depending on available
* equipment features , the user may wish to rewrite the
* program in microcode or assembly language .
*
*/
/*
Cephes Math Library Release 2 . 2 : July , 1992
Copyright 1984 , 1987 , 1988 , 1992 by Stephen L . Moshier
Direct inquiries to 30 Frost Street , Cambridge , MA 02140
*/
#include "mconf.h"
#if UNK
/* almost 2^16384 */
long double MAXNUML = 1 .189731495357231765021263853 E4932L;
/* 2^-64 */
long double MACHEPL = 5 .42101086242752217003726400434970855712890625 E-20 L;
/* log( MAXNUML ) */
long double MAXLOGL = 1 .1356523406294143949492 E4L;
#ifdef DENORMAL
/* log(smallest denormal number = 2^-16446) */
long double MINLOGL = -1 .13994985314888605586758 E4L;
#else
/* log( underflow threshold = 2^(-16382) ) */
long double MINLOGL = -1 .1355137111933024058873 E4L;
#endif
long double LOGE2L = 6 .9314718055994530941723 E-1 L;
long double LOG2EL = 1 .4426950408889634073599 E0L;
long double PIL = 3 .1415926535897932384626 L;
long double PIO2L = 1 .5707963267948966192313 L;
long double PIO4L = 7 .8539816339744830961566 E-1 L;
#ifdef INFINITIES
long double NANL = 0 .0 L / 0 .0 L;
long double INFINITYL = 1 .0 L / 0 .0 L;
#else
long double INFINITYL = 1 .189731495357231765021263853 E4932L;
long double NANL = 0 .0 L;
#endif
#endif
#if IBMPC
short MAXNUML[] = {0 xffff,0 xffff,0 xffff,0 xffff,0 x7ffe, XPD};
short MAXLOGL[] = {0 x79ab,0 xd1cf,0 x17f7,0 xb172,0 x400c, XPD};
#ifdef INFINITIES
short INFINITYL[] = {0 ,0 ,0 ,0 x8000,0 x7fff, XPD};
short NANL[] = {0 ,0 ,0 ,0 xc000,0 x7fff, XPD};
#else
short INFINITYL[] = {0 xffff,0 xffff,0 xffff,0 xffff,0 x7ffe, XPD};
long double NANL = 0 .0 L;
#endif
#ifdef DENORMAL
short MINLOGL[] = {0 xbaaa,0 x09e2,0 xfe7f,0 xb21d,0 xc00c, XPD};
#else
short MINLOGL[] = {0 xeb2f,0 x1210,0 x8c67,0 xb16c,0 xc00c, XPD};
#endif
short MACHEPL[] = {0 x0000,0 x0000,0 x0000,0 x8000,0 x3fbf, XPD};
short LOGE2L[] = {0 x79ac,0 xd1cf,0 x17f7,0 xb172,0 x3ffe, XPD};
short LOG2EL[] = {0 xf0bc,0 x5c17,0 x3b29,0 xb8aa,0 x3fff, XPD};
short PIL[] = {0 xc235,0 x2168,0 xdaa2,0 xc90f,0 x4000, XPD};
short PIO2L[] = {0 xc235,0 x2168,0 xdaa2,0 xc90f,0 x3fff, XPD};
short PIO4L[] = {0 xc235,0 x2168,0 xdaa2,0 xc90f,0 x3ffe, XPD};
#endif
#if MIEEE
long MAXNUML[] = {0 x7ffe0000,0 xffffffff,0 xffffffff};
long MAXLOGL[] = {0 x400c0000,0 xb17217f7,0 xd1cf79ab};
#ifdef INFINITIES
long INFINITY[] = {0 x7fff0000,0 x80000000,0 x00000000};
long NANL[] = {0 x7fff0000,0 xffffffff,0 xffffffff};
#else
long INFINITYL[] = {0 x7ffe0000,0 xffffffff,0 xffffffff};
long double NANL = 0 .0 L;
#endif
#ifdef DENORMAL
long MINLOGL[] = {0 xc00c0000,0 xb21dfe7f,0 x09e2baaa};
#else
long MINLOGL[] = {0 xc00c0000,0 xb16c8c67,0 x1210eb2f};
#endif
long MACHEPL[] = {0 x3fbf0000,0 x80000000,0 x00000000};
long LOGE2L[] = {0 x3ffe0000,0 xb17217f7,0 xd1cf79ac};
long LOG2EL[] = {0 x3fff0000,0 xb8aa3b29,0 x5c17f0bc};
long PIL[] = {0 x40000000,0 xc90fdaa2,0 x2168c235};
long PIO2L[] = {0 x3fff0000,0 xc90fdaa2,0 x2168c235};
long PIO4L[] = {0 x3ffe0000,0 xc90fdaa2,0 x2168c235};
#endif
#ifdef MINUSZERO
long double NEGZEROL = -0 .0 L;
#else
long double NEGZEROL = 0 .0 L;
#endif
/* Polynomial evaluator:
* P [ 0 ] x ^ n + P [ 1 ] x ^ ( n - 1 ) + . . . + P [ n ]
*/
long double polevll( x, p, n )
long double x;
void *p;
int n;
{
register long double y;
register long double *P = (long double *)p;
y = *P++;
do
{
y = y * x + *P++;
}
while ( --n );
return (y);
}
/* Polynomial evaluator:
* x ^ n + P [ 0 ] x ^ ( n - 1 ) + P [ 1 ] x ^ ( n - 2 ) + . . . + P [ n ]
*/
long double p1evll( x, p, n )
long double x;
void *p;
int n;
{
register long double y;
register long double *P = (long double *)p;
n -= 1 ;
y = x + *P++;
do
{
y = y * x + *P++;
}
while ( --n );
return ( y );
}
Messung V0.5 in Prozent C=96 H=92 G=93
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-13)
¤
*© Formatika GbR, Deutschland