#include <math.h>
#define SQR(x) ((x)*(x))
#define FMAX(x,y) ((x)>(y)?(x):(y))
#define FMIN(x,y) ((x)<(y)?(x):(y))
#define SIGN(a,b) ((b)>=0.0 ? fabs(a) : -fabs(a))
#define DDABS(a) ((a)>=doubledouble(0) ? (a) : -(a))
#define DDSIGN(a,b) ((b)>=doubledouble(0) ? DDABS(a) : -DDABS(a))

doubledouble *ddvector(int nl,int nh);
doubledouble **ddmatrix(int nrl,int nrh,int ncl,int nch);
void free_ddvector(doubledouble *v, int nl,int nh);
void free_ddmatrix(doubledouble **m, int nrl,int nrh,int ncl,int nch);
