Blame specfunc/test_sf.h

Packit 67cb25
/* specfunc/test_sf.h
Packit 67cb25
 * 
Packit 67cb25
 * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman
Packit 67cb25
 * 
Packit 67cb25
 * This program is free software; you can redistribute it and/or modify
Packit 67cb25
 * it under the terms of the GNU General Public License as published by
Packit 67cb25
 * the Free Software Foundation; either version 3 of the License, or (at
Packit 67cb25
 * your option) any later version.
Packit 67cb25
 * 
Packit 67cb25
 * This program is distributed in the hope that it will be useful, but
Packit 67cb25
 * WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 67cb25
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 67cb25
 * General Public License for more details.
Packit 67cb25
 * 
Packit 67cb25
 * You should have received a copy of the GNU General Public License
Packit 67cb25
 * along with this program; if not, write to the Free Software
Packit 67cb25
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Packit 67cb25
 */
Packit 67cb25
Packit 67cb25
/* Author:  G. Jungman */
Packit 67cb25
Packit 67cb25
#ifndef TEST_SF_H
Packit 67cb25
#define TEST_SF_H
Packit 67cb25
Packit 67cb25
#include <gsl/gsl_math.h>
Packit 67cb25
#include <gsl/gsl_errno.h>
Packit 67cb25
#include <gsl/gsl_machine.h>
Packit 67cb25
#include <gsl/gsl_sf_result.h>
Packit 67cb25
Packit 67cb25
double test_sf_frac_diff(double x1, double x2);
Packit 67cb25
int test_sf_check_result(char * message_buff, gsl_sf_result r, double val, double tol);
Packit 67cb25
int test_sf_check_val(char * message_buff, double rval, double val, double tol);
Packit 67cb25
int test_sf_check_return(char * message_buff, int val_return, int expected_return);
Packit 67cb25
int test_sf_check_result_relax(char * message_buff, gsl_sf_result r, double val, double tol);
Packit 67cb25
Packit 67cb25
/* Include an overall test factor to allow for differences between
Packit 67cb25
   compilers, otherwise there are too many bug reports on the released
Packit 67cb25
   versions.  Turn this value down to 1.0 for development purposes */
Packit 67cb25
Packit 67cb25
Packit 67cb25
#ifndef TEST_FACTOR
Packit 67cb25
#ifdef RELEASED
Packit 67cb25
#define TEST_FACTOR 100.0  
Packit 67cb25
#else
Packit 67cb25
#define TEST_FACTOR 1.0
Packit 67cb25
#endif
Packit 67cb25
#endif
Packit 67cb25
Packit 67cb25
#ifndef TEST_SIGMA
Packit 67cb25
#ifdef RELEASED
Packit 67cb25
#define TEST_SIGMA 1.5  
Packit 67cb25
#else
Packit 67cb25
#define TEST_SIGMA 1.0
Packit 67cb25
#endif
Packit 67cb25
#endif
Packit 67cb25
Packit 67cb25
#define TEST_TOL0  (2.0*GSL_DBL_EPSILON)
Packit 67cb25
#define TEST_TOL1  (16.0*GSL_DBL_EPSILON)
Packit 67cb25
#define TEST_TOL2  (256.0*GSL_DBL_EPSILON)
Packit 67cb25
#define TEST_TOL3  (2048.0*GSL_DBL_EPSILON)
Packit 67cb25
#define TEST_TOL4  (16384.0*GSL_DBL_EPSILON)
Packit 67cb25
#define TEST_TOL5  (131072.0*GSL_DBL_EPSILON)
Packit 67cb25
#define TEST_TOL6  (1048576.0*GSL_DBL_EPSILON)
Packit 67cb25
#define TEST_SQRT_TOL0 (2.0*GSL_SQRT_DBL_EPSILON)
Packit 67cb25
#define TEST_SNGL  (1.0e-06)
Packit 67cb25
Packit 67cb25
#define TEST_SF_INCONS  1
Packit 67cb25
#define TEST_SF_ERRNEG  2
Packit 67cb25
#define TEST_SF_TOLBAD  4
Packit 67cb25
#define TEST_SF_RETBAD  8
Packit 67cb25
#define TEST_SF_ERRBAD  16
Packit 67cb25
#define TEST_SF_ERRBIG  32
Packit 67cb25
#define TEST_SF_EXPBAD  64
Packit 67cb25
Packit 67cb25
int test_sf (gsl_sf_result r, double val_in, double tol, int status, int expect_return, const char * desc);
Packit 67cb25
int test_sf_e10 (gsl_sf_result_e10 r, double val_in, int e10_in, double tol, int status, int expect_return, const char * desc);
Packit 67cb25
int test_sf_val (double val, double val_in, double tol, const char * desc);
Packit 67cb25
int test_sf_rlx (gsl_sf_result r, double val_in, double tol, int status, int expect_return, const char * desc);
Packit 67cb25
int test_sf_2 (gsl_sf_result r1, double val1, double tol1, gsl_sf_result r2, double val2, double tol2, int status, int expect_return, const char * desc);
Packit 67cb25
int test_sf_sgn (gsl_sf_result r, double sgn, double val_in, double tol, double expect_sgn, int status, int expect_return, const char * desc);
Packit 67cb25
Packit 67cb25
#define TEST_SF(stat, func, args, val_in, tol, expect_return) { int status = func args; stat += test_sf(r, val_in, tol, status, expect_return, #func #args); }
Packit 67cb25
Packit 67cb25
#define TEST_SF_E10(stat, func, args, val_in, e10_in, tol, expect_return) { int status = func args; stat += test_sf_e10(re, val_in, e10_in, tol, status, expect_return, #func #args); }
Packit 67cb25
Packit 67cb25
#define TEST_SF_VAL(stat, func, args, val_in, tol) { double val = func args; stat += test_sf_val(val, val_in, tol, #func #args); }
Packit 67cb25
Packit 67cb25
#define TEST_SF_RLX(stat, func, args, val_in, tol, expect_return) { int status = func args; stat += test_sf_rlx(r, val_in, tol, status, expect_return, #func #args); }
Packit 67cb25
Packit 67cb25
#define TEST_SF_2(stat, func, args, val1, tol1, val2, tol2, expect_return) { int status = func args; stat += test_sf_2(r1, val1, tol1, r2, val2, tol2, status, expect_return, #func #args); }
Packit 67cb25
Packit 67cb25
#define TEST_SF_SGN(stat, func, args, val_in, tol, expect_sgn, expect_return) { int status = func args; stat += test_sf_sgn(r, sgn, val_in, tol, expect_sgn, status, expect_return, #func #args); }
Packit 67cb25
Packit 67cb25
#define TEST_SF_THETA(stat, func, args, val_in, tol) { int status; theta=args; status = func (&theta);  stat += test_sf_val(theta, val_in, tol, #func #args); }
Packit 67cb25
Packit 67cb25
int test_airy(void);
Packit 67cb25
int test_bessel(void);
Packit 67cb25
int test_coulomb(void);
Packit 67cb25
int test_dilog(void);
Packit 67cb25
int test_gamma(void);
Packit 67cb25
int test_mathieu(void);
Packit 67cb25
int test_hermite(void);
Packit 67cb25
int test_hyperg(void);
Packit 67cb25
int test_legendre(void);
Packit 67cb25
int test_sincos_pi(void);
Packit 67cb25
Packit 67cb25
Packit 67cb25
#endif /* !TEST_SF_H */