Mail Archives: cygwin/2007/10/10/17:28:24
For the sake of completeness I want to flag this.
A recent failure of GFortran tests, regarding the usage of GAMMA
functions, results in the following problem with 'tgamma' on Cygwin
(gcc-3.4.4-3):
=============================================================
/*
gcc --std=c99 test_tgamma.c -lm && ./a.out
*/
#include <math.h>
#include <stdio.h>
#define N_MAX 34
#undef M_PI
#define M_PI 3.14159265358979323846
int main()
{
float c[N_MAX+1];
float xs, ts;
float diff;
int i;
c[0] = 1.;
for (i=1; i<=N_MAX; i++)
c[i] = (2*i-1)*c[i-1]*0.5;
for (i=1; i<=N_MAX; i++)
{
xs = i + 0.5f; /* argument to the gamma function */
ts = c[i] * sqrtf(M_PI);
diff = fabsf(tgammaf(xs)-ts)/ts;
if (diff > 1e-6)
printf("Arg: %g, Exact: %12.8g, tgamma: %12.8g, diff: %12.8g\n",
xs, ts, tgammaf(xs), diff);
}
return 0;
}
=============================================================
$ ./a.exe
Segmentation fault (core dumped)
Cheers,
Angelo.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -