This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

sparc-solaris failure



(Repeat.  egcs-bugs email seems not to be working)

The snapshot egcs-19990716 on sparc-sun-solaris2.7 goes into an
endless loop trying to compile this C program with -O2.

An installed recent egcs compiler works fine, so this is apparently
a regression.

The June 29 snapshot fails also, on a sparc-solaris2.5.

Here is the .i file:
-------
# 1 "mtstl.c"
 
 





































 





# 1 "/usr/include/stdio.h" 1 3
 
 

 
 
 

 




 






#pragma ident	"@(#)stdio.h	1.69	98/07/13 SMI"	

# 1 "/usr/include/sys/feature_tests.h" 1 3
 




 
 
 




#pragma ident	"@(#)feature_tests.h	1.17	97/12/04 SMI"

# 1 "/usr/include/sys/isa_defs.h" 1 3
 







#pragma ident	"@(#)isa_defs.h	1.15	97/11/22 SMI"

 






































































































































 






# 211 "/usr/include/sys/isa_defs.h" 3


 






 






 









 
















 






 





 







 








 



# 309 "/usr/include/sys/isa_defs.h" 3


 















# 15 "/usr/include/sys/feature_tests.h" 2 3






 












 








































 



























 



















 






















 
































# 22 "/usr/include/stdio.h" 2 3

# 1 "/usr/include/sys/va_list.h" 1 3
 







#pragma ident	"@(#)va_list.h	1.11	97/11/22 SMI"

 














typedef void *__va_list;









# 23 "/usr/include/stdio.h" 2 3

# 1 "/usr/include/stdio_tag.h" 1 3
 







#pragma ident	"@(#)stdio_tag.h	1.3	98/04/20 SMI"











typedef struct __FILE  __FILE;







# 24 "/usr/include/stdio.h" 2 3

# 1 "/usr/include/stdio_impl.h" 1 3
 







#pragma ident	"@(#)stdio_impl.h	1.7	98/04/17 SMI"












typedef int	ssize_t;		 



# 36 "/usr/include/stdio_impl.h" 3


struct __FILE 	 
{




	ssize_t		_cnt;	 
	unsigned char	*_ptr;	 

	unsigned char	*_base;	 
	unsigned char	_flag;	 
	unsigned char	_file;	 
	unsigned	__orientation:2;  
	unsigned	__filler:6;
};








# 25 "/usr/include/stdio.h" 2 3


 













typedef	__FILE FILE;







typedef unsigned int	size_t;		 




 





typedef	long long	__longlong_t;













typedef long		off_t;







typedef __longlong_t	off64_t;






typedef long		fpos_t;







typedef __longlong_t	fpos64_t;













 










 


































































extern FILE	__iob[20 ];











extern unsigned char	 _sibuf[], _sobuf[];


 
# 227 "/usr/include/stdio.h" 3



extern unsigned char	*_bufendtab[];
extern FILE		*_lastbuf;


 
# 257 "/usr/include/stdio.h" 3




extern int	remove(const char *);
extern int	rename(const char *, const char *);
extern FILE	*tmpfile(void);
extern char	*tmpnam(char *);



extern int	fclose(FILE *);
extern int	fflush(FILE *);
extern FILE	*fopen(const char *, const char *);
extern FILE	*freopen(const char *, const char *, FILE *);
extern void	setbuf(FILE *, char *);


extern void setbuffer(FILE *, char *, size_t);
extern int setlinebuf(FILE *);

extern int	setvbuf(FILE *, char *, int, size_t);
 
extern int	fprintf(FILE *, const char *, ...);
 
extern int	fscanf(FILE *, const char *, ...);
 
extern int	printf(const char *, ...);
 
extern int	scanf(const char *, ...);



 
extern int	snprintf(char *, size_t, const char *, ...);

 
extern int	sprintf(char *, const char *, ...);
 
extern int	sscanf(const char *, const char *, ...);
extern int	vfprintf(FILE *, const char *, __va_list);
extern int	vprintf(const char *, __va_list);



extern int	vsnprintf(char *, size_t, const char *, __va_list);

extern int	vsprintf(char *, const char *, __va_list);
extern int	fgetc(FILE *);
extern char	*fgets(char *, int, FILE *);
extern int	fputc(int, FILE *);
extern int	fputs(const char *, FILE *);
extern int	getc(FILE *);
extern int	getchar(void);
extern char	*gets(char *);
extern int	putc(int, FILE *);
extern int	putchar(int);
extern int	puts(const char *);
extern int	ungetc(int, FILE *);
extern size_t	fread(void *, size_t, size_t, FILE *);
extern size_t	fwrite(const void *, size_t, size_t, FILE *);
extern int	fgetpos(FILE *, fpos_t *);
extern int	fseek(FILE *, long, int);
extern int	fsetpos(FILE *, const fpos_t *);
extern long	ftell(FILE *);
extern void	rewind(FILE *);
extern void	clearerr(FILE *);
extern int	feof(FILE *);
extern int	ferror(FILE *);
extern void	perror(const char *);


extern int	__filbuf(FILE *);
extern int	__flsbuf(int, FILE *);


 





extern FILE	*fdopen(int, const char *);
extern char	*ctermid(char *);
extern int	fileno(FILE *);



 


# 358 "/usr/include/stdio.h" 3


 




extern FILE	*popen(const char *, const char *);
extern char	*cuserid(char *);
extern char	*tempnam(const char *, const char *);
extern int	getopt(int, char *const *, const char *);

extern int	getsubopt(char **, char *const *, char **);

extern char	*optarg;
extern int	optind, opterr, optopt;
extern int	getw(FILE *);
extern int	putw(int, FILE *);
extern int	pclose(FILE *);



 



extern int	fseeko(FILE *, off_t, int);
extern off_t	ftello(FILE *);


 





extern FILE	*fopen64(const char *, const char *);
extern FILE	*freopen64(const char *, const char *, FILE *);
extern FILE	*tmpfile64(void);
extern int	fgetpos64(FILE *, fpos64_t *);
extern int	fsetpos64(FILE *, const fpos64_t *);
extern int	fseeko64(FILE *, off64_t, int);
extern off64_t	ftello64(FILE *);


# 515 "/usr/include/stdio.h" 3





























# 567 "/usr/include/stdio.h" 3









# 46 "mtstl.c" 2

# 1 "/usr/include/stdlib.h" 1 3
 




 
 

 
 
 




#pragma ident	"@(#)stdlib.h	1.44	98/01/22 SMI"	












typedef	struct {
	int	quot;
	int	rem;
} div_t;

typedef struct {
	long	quot;
	long	rem;
} ldiv_t;


typedef struct {
	long long	quot;
	long long	rem;
} lldiv_t;
















typedef long	uid_t;			 




















typedef long	wchar_t;





 
# 101 "/usr/include/stdlib.h" 3


 
# 117 "/usr/include/stdlib.h" 3


extern unsigned char	__ctype[];



extern double atof(const char *);
extern int atoi(const char *);
extern long int atol(const char *);
extern double strtod(const char *, char **);
extern long int strtol(const char *, char **, int);
extern unsigned long int strtoul(const char *, char **, int);

extern int rand(void);
extern void srand(unsigned int);





extern void *calloc(size_t, size_t);
extern void free(void *);
extern void *malloc(size_t);
extern void *realloc(void *, size_t);

extern void abort(void);
extern int atexit(void (*)(void));
extern void exit(int);
extern void _exithandle(void);
extern char *getenv(const char *);
extern int system(const char *);

extern void *bsearch(const void *, const void *, size_t, size_t,
	int (*)(const void *, const void *));
extern void qsort(void *, size_t, size_t,
	int (*)(const void *, const void *));

extern int abs(int);
extern div_t div(int, int);
extern long int labs(long);
extern ldiv_t ldiv(long, long);

extern int mbtowc(wchar_t *, const char *, size_t);
extern int mblen(const char *, size_t);
extern int wctomb(char *, wchar_t);

extern size_t mbstowcs(wchar_t *, const char *, size_t);
extern size_t wcstombs(char *, const wchar_t *, size_t);




extern double drand48(void);
extern double erand48(unsigned short *);
extern long jrand48(unsigned short *);
extern void lcong48(unsigned short *);
extern long lrand48(void);
extern long mrand48(void);
extern long nrand48(unsigned short *);
extern unsigned short *seed48(unsigned short *);
extern void srand48(long);
extern int putenv(char *);
extern void setkey(const char *);





extern void swab(const char *, char *, int);




extern int	mkstemp(char *);


extern int	mkstemp64(char *);






extern long a64l(const char *);
extern char *ecvt(double, int, int *, int *);
extern char *fcvt(double, int, int *, int *);
extern char *gcvt(double, int, char *);
extern int getsubopt(char **, char *const *, char **);
extern int  grantpt(int);
extern char *initstate(unsigned, char *, size_t);
extern char *l64a(long);
extern char *mktemp(char *);
extern char *ptsname(int);
extern long random(void);
extern char *realpath(const char *, char *);
extern char *setstate(const char *);
extern void srandom(unsigned);
extern int ttyslot(void);
extern int  unlockpt(int);
extern void *valloc(size_t);




extern int dup2(int, int);
extern char *qecvt(long double, int, int *, int *);
extern char *qfcvt(long double, int, int *, int *);
extern char *qgcvt(long double, int, char *);
extern char *getcwd(char *, size_t);
extern const char *getexecname(void);
extern char *getlogin(void);
extern int getopt(int, char *const *, const char *);
extern char *optarg;
extern int optind, opterr, optopt;
extern char *getpass(const char *);
extern char *getpassphrase(const char *);
extern int getpw(uid_t, char *);
extern int isatty(int);
extern void *memalign(size_t, size_t);
extern char *ttyname(int);


extern long long atoll(const char *);
extern long long llabs(long long);
extern lldiv_t lldiv(long long, long long);
extern char *lltostr(long long, char *);
extern long long strtoll(const char *, char **, int);
extern unsigned long long strtoull(const char *, char **, int);
extern char *ulltostr(unsigned long long, char *);




# 380 "/usr/include/stdlib.h" 3







# 47 "mtstl.c" 2

# 1 "complex.h" 1
 







 

 





 
 

 

 


extern double atan2 (double, double);


 


 




 

extern double cabs ( double __complex__  z );
extern double hypot ( double x, double y );

 

extern double __complex__  clog ( double __complex__  z );
extern double __complex__  cexp ( double __complex__  z );
extern double __complex__  csqrt ( double __complex__  z );
extern double __complex__  csin ( double __complex__  z );
extern double __complex__  ccos ( double __complex__  z );
extern double __complex__  ctan ( double __complex__  z );
extern double __complex__  ccot ( double __complex__  z );
extern double __complex__  casin ( double __complex__  z );
extern double __complex__  cacos ( double __complex__  z );
extern double __complex__  catan ( double __complex__  z );
extern double __complex__  csinh ( double __complex__  z );
extern double __complex__  casinh ( double __complex__  z );
extern double __complex__  ccosh ( double __complex__  z );
extern double __complex__  cacosh ( double __complex__  z );
extern double __complex__  ctanh ( double __complex__  z );
extern double __complex__  catanh ( double __complex__  z );
extern double __complex__  cpow (double __complex__  a, double __complex__  z);

 

extern double __complex__  cadd ( double __complex__  a, double __complex__  b );
extern double __complex__  csub ( double __complex__  a, double __complex__  b );
extern double __complex__  cmul ( double __complex__  a, double __complex__  b );
extern double __complex__  cdiv ( double __complex__  a, double __complex__  b );

 


extern float atan2f (float, float);

extern float cabsf ( float __complex__  z );
extern float __complex__  clogf ( float __complex__  z );
extern float __complex__  cexpf ( float __complex__  z );
extern float __complex__  csqrtf ( float __complex__  z );
extern float __complex__  csinf ( float __complex__  z );
extern float __complex__  ccosf ( float __complex__  z );
extern float __complex__  ctanf ( float __complex__  z );
extern float __complex__  ccotf ( float __complex__  z );
extern float __complex__  casinf ( float __complex__  z );
extern float __complex__  cacosf ( float __complex__  z );
extern float __complex__  catanf ( float __complex__  z );
extern float __complex__  csinhf ( float __complex__  z );
extern float __complex__  casinhf ( float __complex__  z );
extern float __complex__  ccoshf ( float __complex__  z );
extern float __complex__  cacoshf ( float __complex__  z );
extern float __complex__  ctanhf ( float __complex__  z );
extern float __complex__  catanhf ( float __complex__  z );
extern float __complex__  cpowf (float __complex__  a, float __complex__  z);



extern long double atan2l (long double, long double);

extern long double cabsl ( long double __complex__  z );
extern long double __complex__  clogl ( long double __complex__  z );
extern long double __complex__  cexpl ( long double __complex__  z );
extern long double __complex__  csqrtl ( long double __complex__  z );
extern long double __complex__  csinl ( long double __complex__  z );
extern long double __complex__  ccosl ( long double __complex__  z );
extern long double __complex__  ctanl ( long double __complex__  z );
extern long double __complex__  ccotl ( long double __complex__  z );
extern long double __complex__  casinl ( long double __complex__  z );
extern long double __complex__  cacosl ( long double __complex__  z );
extern long double __complex__  catanl ( long double __complex__  z );
extern long double __complex__  csinhl ( long double __complex__  z );
extern long double __complex__  casinhl ( long double __complex__  z );
extern long double __complex__  ccoshl ( long double __complex__  z );
extern long double __complex__  cacoshl ( long double __complex__  z );
extern long double __complex__  ctanhl ( long double __complex__  z );
extern long double __complex__  catanhl ( long double __complex__  z );
extern long double __complex__  cpowl (long double __complex__  a, long double __complex__  z);
extern float __complex__  clgamf ( float __complex__  z );
extern double __complex__  clgam ( double __complex__  z );
extern long double __complex__  clgaml ( long double __complex__  z );
extern float __complex__  cgammaf ( float __complex__  z );
extern double __complex__  cgamma ( double __complex__  z );
extern long double __complex__  cgammal ( long double __complex__  z );
# 48 "mtstl.c" 2

# 1 "mconf.h" 1
 





























































 





 












 
typedef struct
	{
	double r;
	double i;
	}cmplx;

typedef struct
	{
	float r;
	float i;
	} cmplxf;

 

typedef struct
	{
	long double r;
	long double i;
	} cmplxl;

 

 

 

 

 

 


 

 







 


 




 








 
 

 










 

 


 


 



 


 


# 1 "protos.h" 1
 





extern double acosh ( double x );
extern int airy ( double x, double *ai, double *aip, double *bi, double *bip );
extern double asin ( double x );
extern double acos ( double x );
extern double asinh ( double x );
extern double atan ( double x );
extern double atan2 ( double y, double x );
extern double atanh ( double x );
extern double bdtrc ( int k, int n, double p );
extern double bdtr ( int k, int n, double p );
extern double bdtri ( int k, int n, double y );
extern double beta ( double a, double b );
extern double lbeta ( double a, double b );
extern double btdtr ( double a, double b, double x );
extern double cbrt ( double x );
extern double chbevl ( double x, void *P, int n );
extern double chdtrc ( double df, double x );
extern double chdtr ( double df, double x );
extern double chdtri ( double df, double y );
extern double cosh ( double x );
extern double dawsn ( double xx );
extern void eigens ( double A[], double RR[], double E[], int N );
extern double ellie ( double phi, double m );
extern double ellik ( double phi, double m );
extern double ellpe ( double x );
extern int ellpj ( double u, double m, double *sn, double *cn, double *dn, double *ph );
extern double ellpk ( double x );
extern double exp ( double x );
extern double exp10 ( double x );
extern double exp1m ( double x );
extern double exp2 ( double x );
extern double expn ( int n, double x );
extern double fabs ( double x );
extern double fac ( int i );
extern double fdtrc ( int ia, int ib, double x );
extern double fdtr ( int ia, int ib, double x );
extern double fdtri ( int ia, int ib, double y );
extern int fftr ( double x[], int m0, double sine[] );
extern double ceil ( double x );
extern double floor ( double x );
extern double frexp ( double x, int *pw2 );
extern double ldexp ( double x, int pw2 );
extern int signbit ( double x );
extern int isnan ( double x );
extern int isfinite ( double x );
extern int fresnl ( double xxa, double *ssa, double *cca );
extern double gamma ( double x );
extern double lgam ( double x );
extern double gdtr ( double a, double b, double x );
extern double gdtrc ( double a, double b, double x );
extern int gels ( double A[], double R[], int M, double EPS, double AUX[] );
extern double hyp2f1 ( double a, double b, double c, double x );
extern double hyperg ( double a, double b, double x );
extern double hyp2f0 ( double a, double b, double x, int type, double *err );
extern double i0 ( double x );
extern double i0e ( double x );
extern double i1 ( double x );
extern double i1e ( double x );
extern double igamc ( double a, double x );
extern double igam ( double a, double x );
extern double igami ( double a, double y0 );
extern double incbet ( double aa, double bb, double xx );
extern double incbi ( double aa, double bb, double yy0 );
extern double iv ( double v, double x );
extern double j0 ( double x );
extern double y0 ( double x );
extern double j1 ( double x );
extern double y1 ( double x );
extern double jn ( int n, double x );
extern double jv ( double n, double x );
extern double k0 ( double x );
extern double k0e ( double x );
extern double k1 ( double x );
extern double k1e ( double x );
extern double kn ( int nn, double x );
extern int levnsn ( int n, double r[], double a[], double e[], double refl[] );
extern double log ( double x );
extern double log10 ( double x );
extern double log2 ( double x );
extern long lrand ( void );
extern long lsqrt ( long x );
extern int minv ( double A[], double X[], int n, double B[], int IPS[] );
extern int mmmpy ( int r, int c, double *A, double *B, double *Y );
extern int mtherr ( char *name, int code );
extern double polevl ( double x, void *P, int N );
extern double p1evl ( double x, void *P, int N );
extern int mtransp ( int n, double *A, double *T );
extern int mvmpy ( int r, int c, double *A, double *V, double *Y );
extern double nbdtrc ( int k, int n, double p );
extern double nbdtr ( int k, int n, double p );
extern double nbdtri ( int k, int n, double p );
extern double ndtr ( double a );
extern double erfc ( double a );
extern double erf ( double x );
extern double ndtri ( double y0 );
extern double pdtrc ( int k, double m );
extern double pdtr ( int k, double m );
extern double pdtri ( int k, double y );
extern double pow ( double x, double y );
extern double powi ( double x, int nn );
extern double psi ( double x );
extern void revers ( double y[], double x[], int n );
extern double rgamma ( double x );
extern double round ( double x );
extern int sprec ( void );
extern int dprec ( void );
extern int ldprec ( void );
extern int shichi ( double x, double *si, double *ci );
extern int sici ( double x, double *si, double *ci );
extern double simpsn ( double f[], double delta );
extern int simq ( double A[], double B[], double X[], int n, int flag, int IPS[] );
extern double sin ( double x );
extern double cos ( double x );
extern double radian ( double d, double m, double s );
 


extern double sindg ( double x );
extern double cosdg ( double x );
extern double sinh ( double x );
extern double spence ( double x );
extern double sqrt ( double x );
extern double stdtr ( int k, double t );
extern double stdtri ( int k, double p );
extern double onef2 ( double a, double b, double c, double x, double *err );
extern double threef0 ( double a, double b, double c, double x, double *err );
extern double struve ( double v, double x );
extern double tan ( double x );
extern double cot ( double x );
extern double tandg ( double x );
extern double cotdg ( double x );
extern double tanh ( double x );
extern double log1p ( double x );
extern double expm1 ( double x );
extern double cosm1 ( double x );
extern double yn ( int n, double x );
extern double zeta ( double x, double q );
extern double zetac ( double x );
extern int drand ( double *a );

extern float floorf (float);
extern float logf (float);
extern float fabsf (float);
extern long double floorl (long double);
extern long double logl (long double);
extern long double fabsl (long double);
extern long double sinl (long double);
extern long double cosl (long double);
extern long double sqrtl (long double);
# 175 "mconf.h" 2





 
extern int merror;
# 49 "mtstl.c" 2















# 76 "mtstl.c"

long double expl(long double);
long double sqrtl(long double);



int ldprec();


int drand();
 
 


 
long double __complex__ 
csquarel(long double __complex__  x)
{
  return( x * x );
}

long double __complex__ 
ccubel(long double __complex__  x)
{
  return( x * x * x );
}

 
struct fundef
	{
	char *nam1;		 
	long double __complex__  (*name )();
	char *nam2;		 
	long double __complex__  (*inv )();
	int nargs;		 
	int tstyp;		 
	long ctrl;		 
	long double arg1w;		 
	long double arg1l;		 
	long arg1f;		 
	long double arg2w;		 
	long double arg2l;
	long arg2f;
 







	};


 


 








 



extern long double MINLOGL;
extern long double MAXLOGL;
extern long double PIL;
extern long double PIO2L;
 







struct fundef defs[10 ] = {
{"csquarel",csquarel,  "  csqrtl",  csqrtl, 1, 7 , 1, 20.0,  -10.0, 4 ,
0.0, 0.0, 0},
{"  casinl",  casinl,   "   csinl",   csinl, 1, 0, 1,   3.14,      -1.57,  0,
0.0, 0.0, 0},
{"   ctanl",   ctanl,   "  catanl",  catanl, 1, 0, 1,  3.14,  -1.57,  0,
0.0, 0.0, 0},
{"  cacosl",  cacosl,   "   ccosl",   ccosl, 1, 0, 1,   3.14,      -1.57,  0,
0.0, 0.0, 0},
{" casinhl", casinhl,   "  csinhl",  csinhl, 1, 0, 1, 3.14,   -1.57,  0,
0.0, 0.0, 0},
{" catanhl", catanhl,   "  ctanhl",  ctanhl, 1, 0, 1, 3.14,   -1.57,  0,
0.0, 0.0, 0},
{" cacoshl", cacoshl,   "  ccoshl",  ccoshl, 1, 0, 1, 3.14,   -1.57,  0,
0.0, 0.0, 0},
{"   clogl",   clogl,   "   cexpl",   cexpl, 1, 0, 0, 340.0,    -170.0,  0,
0.0, 0.0, 0},
{"cpowl",      cpowl,     "cpowl",   cpowl, 2, 1 , 1, 2.0, 0.1,   0,
2.0, -1.0, 0},
{"clgaml",   clgaml,    "cgammal", cgammal, 1, 3 , 0, 40.0, -20.0,   0,
0.0, 0.0, 0},





};

static char *headrs[] = {
"x = %s( %s(x) ): ",
"x = %s( %s(x,a),1/a ): ",	 
"Legendre %s, %s: ",		 
"%s(x) = exp(%s(x)): ",		 
"Wronksian of %s, %s: ",
"Wronksian of %s, %s: ",
"Wronksian of %s, %s: ",
"z = %s( %s(z) ): ",
};
 
static long double __complex__  yy1;
static long double __complex__  y2;
static long double __complex__  y3;
static long double __complex__  y4;
static long double __complex__  a;
static long double __complex__  x;
static long double __complex__  y;
static long double __complex__  z;
static long double __complex__  e;
static long double de;
static long double max;
static long double rmsa;
static long double rms;
static long double ave;
static double dr, di;

int main()
{
long double __complex__  (*fun )();
long double __complex__  (*ifun )();
struct fundef *d;
int i, k, itst;
int m, ntr;


ldprec();   

ntr = 10000 ;
printf( "Consistency test of complex math functions.\n" );
printf( "Max and rms relative errors for %d random arguments.\n",
	ntr );






 













 

for( itst= 0 ; itst< 10 ; itst++ )
{
d = &defs[itst];
k = 0;
m = 0;
max = 0.0L;
rmsa = 0.0L;
ave = 0.0L;
fun = d->name;
ifun = d->inv;









 


if( d->tstyp == 4  )
	{
	ntr = (10000 /5) ;
	printf( "Absolute error and only %d trials:\n", ntr );
	}

printf( headrs[d->tstyp], d->nam2, d->nam1 );

for( i=0; i<ntr; i++ )
{
m++;

 
switch( d->nargs )
{

default:
goto illegn;
	
case 2:
drand( &dr );
drand( &di );
dr = d->arg2w *  ( dr - 1.0 )  +  d->arg2l;
di = d->arg2w *  ( di - 1.0 )  +  d->arg2l;
a = (long double) dr + (long double) di * (1.0fi)  ;

if( d->arg2f & 4  )
	{
	a = expl((long double) dr) + (1.0fi)   * expl((long double) di);
	drand( &dr );
	drand( &di );
	y2 = (long double) dr + (long double) di * (1.0fi)  ;
	a -= 1.0e-13L * a * y2;
	}
if( d->arg2f & 2  )
	{
	k = cabsl(a) + 0.25f;
	a = k;
	}

case 1:
drand( &dr );
drand( &di );
dr = d->arg1w *  ( dr - 1.0 )  +  d->arg1l;
di = d->arg1w *  ( di - 1.0 )  +  d->arg1l;
x = (long double) dr + (long double) di * (1.0fi)  ;
if( d->arg1f & 4  )
	{
	x = expl((long double) dr) + (1.0fi)   * expl((long double) di);
	drand( &dr );
	drand( &di );
	a = (long double) dr + (long double) di * (1.0fi)  ;
	x += 1.0e-13L * x * a;
	}
}


 
switch( d->nargs )
	{
	case 1:
	switch( d->tstyp )
		{
		case 2 :
		yy1 = ( *(fun) )(x);
		y2 = ( *(fun) )(1.0L-x);
		y3 = ( *(ifun) )(x);
		y4 = ( *(ifun) )(1.0L-x);
		break;

		case 3 :
		z = cgammal(x);
		y = cexpl(clgaml(x));
		x = z;   
		break;

		default:
		z = ( *(fun) )(x);
		y = ( *(ifun) )(z);
		}
	break;
	
	case 2:
	if( d->arg2f & 2  )
		{
		switch( d->tstyp )
			{
			case 4 :
			yy1 = (*fun)( k, x );  
			y2 = (*fun)( k+1, x );
			y3 = (*ifun)( k, x );  
			y4 = (*ifun)( k+1, x );	
			break;

			case 5 :
			yy1 = (*fun)( a, x );  
			y2 = (*fun)( a+1.0L, x );
			y3 = (*ifun)( k, x );  	
			y4 = (*ifun)( k+1, x );	
			break;

			default:
			z = (*fun)( k, x );
			y = (*ifun)( k, z );
			}
		}
	else
		{
		if( d->tstyp == 1  )
			{
			z = (*fun)( x, a );
			y = (*ifun)( z, 1.0L/a );
			}
		else
			{
			z = (*fun)( a, x );
			y = (*ifun)( a, z );
			}
		}
	break;


	default:
illegn:
	printf( "Illegal nargs= %d", d->nargs );
	exit(1);
	}	

switch( d->tstyp )
	{
	case 4 :
	e = (y2*y3 - yy1*y4) - 2.0L/(PIL*x);  
	break;

	case 5 :
	e = (y2*y3 + yy1*y4) - 1.0L/x;  
	break;
	
	case 2 :
	e = (yy1-y3)*y4 + y3*y2 - PIO2L;
	break;

	case 7 :
	   
	de = cabsl ((y - x) / x);
	if (de > 1.5L)
	  {
	     
	    dr = cabsl ((-y - x) / x);
	    if (dr < de)
	      {
		y = -y;
		de = dr;
	      }
	  }
	goto statistics;

	default:
	e = y - x;
	break;
	}

if( d->ctrl & 1  )
	e /= x;
else
	{
	if( cabsl(x) > 1.0L )
		e /= x;
	}

de = cabsl(e);

statistics:

ave +=de;
 
if( de < 0 )
	de = -de;

 
if( de > max )
	{
	max = de;

	if( de > 4.0e-16L )
		{






                printf(
   "x (%.6e,%.6e) z (%.6e,%.6e) y (%.6e,%.6e) max %.4e\n",
                       (double) ((long double) __real__ ( x )) , (double) ((long double) __imag__ ( x )) ,
                       (double) ((long double) __real__ ( z )) , (double) ((long double) __imag__ ( z )) ,
                       (double) ((long double) __real__ ( y )) , (double) ((long double) __imag__ ( y )) ,
                       (double) max);

		if( d->tstyp == 1  )
			{
			printf( "a (%.6Le,%.6Le)\n", ((long double) __real__ ( a )) , ((long double) __imag__ ( a ))  );
			}
		if( d->tstyp >= 4  )
			{
		printf(
 "yy1 (%.4Le,%.4Le) y2 (%.4Le,%.4Le) y3 (%.4Le,%.4Le) y4 (%.4Le,%.4Le) k %d x (%.4Le,%.4Le)\n",
 (__real__ ( yy1 )) , (__imag__ ( yy1 )) , (__real__ ( y2 )) , (__imag__ ( y2 )) ,
 (__real__ ( y3 )) , (__imag__ ( y3 )) , (__real__ ( y4 )) , (__imag__ ( y4 )) , k, (__real__ ( x )) , (__imag__ ( x ))  );
			}
		}

 







	}

 
de *= 1.0e16L;	 
rmsa += de * de;	 
}

 
rms = 1.0e-16L * sqrtl( rmsa/m );
if(d->ctrl & 1 )
	printf(" max = %.2Le   rms = %.2Le\n", max, rms );
else
	printf(" max = %.2Le A rms = %.2Le A\n", max, rms );
}  

exit(0);
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]