/* Power series summation for confluent hypergeometric function */
staticlongdouble hy1f1pl( a, b, x, err ) longdouble a, b, x; longdouble *err;
{ longdouble n, a0, sum, t, u, temp; longdouble an, bn, maxt, pcanc;
/* set up for power series summation */
an = a;
bn = b;
a0 = 1.0L;
sum = 1.0L;
n = 1.0L;
t = 1.0L;
maxt = 0.0L;
while( t > MACHEPL )
{ if( bn == 0 ) /* check bn first since if both */
{
mtherr( "hypergl", SING ); return( MAXNUML ); /* an and bn are zero it is */
} if( an == 0 ) /* a singularity */ return( sum ); if( n > 200 ) goto pdone;
u = x * ( an / (bn * n) );
if( a < 0 )
temp = expl(t) / gammal(a); else
temp = expl( t - lgaml(a) );
h2 *= temp;
err2 *= temp;
if( x < 0.0L )
asum = h1; else
asum = h2;
acanc = fabsl(err1) + fabsl(err2);
if( b < 0.0L )
{
temp = gammal(b);
asum *= temp;
acanc *= fabsl(temp);
}
if( asum != 0.0L )
acanc /= fabsl(asum);
acanc *= 30.0L; /* fudge factor, since error of asymptotic formula
* often seems this much larger than advertised */
adone:
*err = acanc; return( asum );
}
/* hyp2f0() */
longdouble hyp2f0l( a, b, x, type, err ) longdouble a, b, x; int type; /* determines what converging factor to use */ longdouble *err;
{ longdouble a0, alast, t, tlast, maxt; longdouble n, an, bn, u, sum, temp;
an = a;
bn = b;
a0 = 1.0e0L;
alast = 1.0e0L;
sum = 0.0L;
n = 1.0e0L;
t = 1.0e0L;
tlast = 1.0e9L;
maxt = 0.0L;
do
{ if( an == 0.0L ) goto pdone; if( bn == 0.0L ) goto pdone;
/* terminating condition for asymptotic series */ if( t > tlast ) goto ndone;
tlast = t;
sum += alast; /* the sum is one term behind */
alast = a0;
if( n > 200 ) goto ndone;
an += 1.0e0L;
bn += 1.0e0L;
n += 1.0e0L; if( t > maxt )
maxt = t;
} while( t > MACHEPL );
pdone: /* series converged! */
/* estimate error due to roundoff and cancellation */
*err = fabsl( MACHEPL * (n + maxt) );
alast = a0; goto done;
ndone: /* series did not converge */
/* The following "Converging factors" are supposed to improve accuracy,
* but do not actually seem to accomplish very much. */
n -= 1.0L;
x = 1.0L/x;
switch( type ) /* "type" given as subroutine argument */
{ case1:
alast *= ( 0.5L + (0.125L + 0.25L*b - 0.5L*a + 0.25L*x - 0.25L*n)/x ); break;
case2:
alast *= 2.0L/3.0L - b + 2.0L*a + x - n; break;
default:
;
}
/* estimate error due to roundoff, cancellation, and nonconvergence */
*err = MACHEPL * (n + maxt) + fabsl ( a0 );
done:
sum += alast; return( sum );
/* series blew up: */
error:
*err = MAXNUML;
mtherr( "hypergl", TLOSS ); return( sum );
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.12Bemerkung:
(vorverarbeitet am 2026-06-14)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.