c = 1.0f;
p = 0.0f;
u = x; while( crealf(u) < 13.0f )
{ if ((crealf(u) == 0.0f) && (cimagf(u) == 0.0f)) goto cgoverf;
c *= u;
p += 1.0f;
u = x + p;
}
u = cstirf(u); return( u / c );
}
float complex clgamf(x) float complex x;
{ float complex c, w, u, v; float p, q, a; int i, cj;
cj = 0; if (cimagf(x) < 0)
{
cj = 1;
x = conj(x);
}
/* Reflection formula -z gamma(-z) gamma(z) = pi / sin(pi z) */ if((crealf(x) < -7.0f) || (cimagf(x) < -7.0f))
{
q = crealf(x);
p = floorf(q); if( p == q ) goto loverf; if (fabsf(cimag(x)) > 18.4f)
{ /* sin z grows exponentially with Im(z). Find ln sin(pi z) from|sinz|=sqrt(sin^2x+sinh^2y),
arg sin z = arctan(tanh y / tan x). */
c = PIF * cimagf(x) - 0.6931471805599453094f
+ I * PIF * (0.5f - q);
c = LOGPI - c - clgamf(1.0f - x);
} else
{ /* Reduce sine arg mod pi. */
u = csinf( PIF * (x - p) ); if( u == 0.0f ) goto loverf;
w = clgamf(1.0f - x);
c = LOGPI - clogf( u ) - w; /* Adjust for reduced sine arg. */
cimagf(c) += PIF * p;
} goto ldone;
}
w = 0.0f; if( crealf(x) < 7.0f )
{ /* To satisfy Im {clgam(z)} = arg cgamma(z), accumulate
arg u during the recurrence. */
a = 0.0f;
w = 1.0f;
p = 0.0f;
u = x; while( crealf(u) < 7.0f )
{ if( u == 0.0f ) goto loverf;
w *= u;
a += cargf(u);
p += 1.0f;
u = x + p;
}
x = u;
w = -logf(cabsf(w)) - I * a;
}
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.