| 1 |
/* sys/prec.c |
| 2 |
* |
| 3 |
* Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Gerard Jungman, Brian Gough |
| 4 |
* |
| 5 |
* This program is free software; you can redistribute it and/or modify |
| 6 |
* it under the terms of the GNU General Public License as published by |
| 7 |
* the Free Software Foundation; either version 3 of the License, or (at |
| 8 |
* your option) any later version. |
| 9 |
* |
| 10 |
* This program is distributed in the hope that it will be useful, but |
| 11 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
* General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this program; if not, write to the Free Software |
| 17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 18 |
*/ |
| 19 |
|
| 20 |
/* Author: G. Jungman */ |
| 21 |
|
| 22 |
#include "gsl__config.h" |
| 23 |
#include "gsl_machine.h" |
| 24 |
#include "gsl_precision.h" |
| 25 |
|
| 26 |
const double gsl_prec_eps[_GSL_PREC_T_NUM] = { |
| 27 |
GSL_DBL_EPSILON, |
| 28 |
GSL_FLT_EPSILON, |
| 29 |
GSL_SFLT_EPSILON |
| 30 |
}; |
| 31 |
|
| 32 |
const double gsl_prec_sqrt_eps[_GSL_PREC_T_NUM] = { |
| 33 |
GSL_SQRT_DBL_EPSILON, |
| 34 |
GSL_SQRT_FLT_EPSILON, |
| 35 |
GSL_SQRT_SFLT_EPSILON |
| 36 |
}; |
| 37 |
|
| 38 |
const double gsl_prec_root3_eps[_GSL_PREC_T_NUM] = { |
| 39 |
GSL_ROOT3_DBL_EPSILON, |
| 40 |
GSL_ROOT3_FLT_EPSILON, |
| 41 |
GSL_ROOT3_SFLT_EPSILON |
| 42 |
}; |
| 43 |
|
| 44 |
const double gsl_prec_root4_eps[_GSL_PREC_T_NUM] = { |
| 45 |
GSL_ROOT4_DBL_EPSILON, |
| 46 |
GSL_ROOT4_FLT_EPSILON, |
| 47 |
GSL_ROOT4_SFLT_EPSILON |
| 48 |
}; |
| 49 |
|
| 50 |
const double gsl_prec_root5_eps[_GSL_PREC_T_NUM] = { |
| 51 |
GSL_ROOT5_DBL_EPSILON, |
| 52 |
GSL_ROOT5_FLT_EPSILON, |
| 53 |
GSL_ROOT5_SFLT_EPSILON |
| 54 |
}; |
| 55 |
|
| 56 |
const double gsl_prec_root6_eps[_GSL_PREC_T_NUM] = { |
| 57 |
GSL_ROOT6_DBL_EPSILON, |
| 58 |
GSL_ROOT6_FLT_EPSILON, |
| 59 |
GSL_ROOT6_SFLT_EPSILON |
| 60 |
}; |
| 61 |
|
| 62 |
typedef unsigned int gsl_mode_t; |
| 63 |
|
| 64 |
#ifndef HIDE_INLINE_STATIC |
| 65 |
/* We need this somewhere, in case the inline is ignored. |
| 66 |
*/ |
| 67 |
|
| 68 |
unsigned int GSL_MODE_PREC(gsl_mode_t mt); |
| 69 |
|
| 70 |
unsigned int |
| 71 |
GSL_MODE_PREC(gsl_mode_t mt) |
| 72 |
{ |
| 73 |
return (mt & (unsigned int)7); |
| 74 |
} |
| 75 |
#endif |