Collection of routines which cap certain exponential and hyperbolic functions.
More...
|
file | vcap.c |
| Class Vcap methods.
|
|
file | vcap.h |
| Contains declarations for class Vcap.
|
|
|
#define | EXPMAX 85.00 |
| Maximum argument for exp(), sinh(), or cosh()
|
|
#define | EXPMIN -85.00 |
| Minimum argument for exp(), sinh(), or cosh()
|
|
|
VEXTERNC double | Vcap_exp (double x, int *ichop) |
| Provide a capped exp() function.
|
|
VEXTERNC double | Vcap_sinh (double x, int *ichop) |
| Provide a capped sinh() function.
|
|
VEXTERNC double | Vcap_cosh (double x, int *ichop) |
| Provide a capped cosh() function.
|
|
Collection of routines which cap certain exponential and hyperbolic functions.
- Note
- These routines are based on FORTRAN code by Mike Holst
◆ EXPMAX
Maximum argument for exp(), sinh(), or cosh()
Definition at line 72 of file vcap.h.
◆ EXPMIN
Minimum argument for exp(), sinh(), or cosh()
Definition at line 77 of file vcap.h.
◆ Vcap_cosh()
VEXTERNC double Vcap_cosh |
( |
double | x, |
|
|
int * | ichop ) |
Provide a capped cosh() function.
If the argument x of Vcap_cosh() exceeds EXPMAX or EXPMIN, then we
return cosh(EXPMAX) or cosh(EXPMIN) rather than cosh(x).
- Note
- Original FORTRAN routine from PMG library by Mike Holst Original notes: to control overflow in the hyperbolic and exp functions, note that the following are the argument limits of the various functions on various machines after which overflow occurs: Convex C240, Sun 3/60, Sun SPARC, IBM RS/6000: sinh, cosh, exp: maximal argument (abs value) = 88.0d0 dsinh, dcosh, dexp: maximal argument (abs value) = 709.0d0
- Author
- Nathan Baker (based on FORTRAN code by Mike Holst)
- Returns
- cosh(x) or capped equivalent
- Parameters
-
x | Argument to cosh() |
ichop | Set to 1 if function capped, 0 otherwise |
Definition at line 91 of file vcap.c.
◆ Vcap_exp()
VEXTERNC double Vcap_exp |
( |
double | x, |
|
|
int * | ichop ) |
Provide a capped exp() function.
If the argument x of Vcap_exp() exceeds EXPMAX or EXPMIN, then we
return exp(EXPMAX) or exp(EXPMIN) rather than exp(x).
- Note
- Original FORTRAN routine from PMG library by Mike Holst Original notes: to control overflow in the hyperbolic and exp functions, note that the following are the argument limits of the various functions on various machines after which overflow occurs: Convex C240, Sun 3/60, Sun SPARC, IBM RS/6000: sinh, cosh, exp: maximal argument (abs value) = 88.0d0 dsinh, dcosh, dexp: maximal argument (abs value) = 709.0d0
- Author
- Nathan Baker (based on FORTRAN code by Mike Holst)
- Returns
- exp(x) or capped equivalent
- Parameters
-
x | Argument to exp() |
ichop | Set to 1 if function capped, 0 otherwise |
Definition at line 59 of file vcap.c.
◆ Vcap_sinh()
VEXTERNC double Vcap_sinh |
( |
double | x, |
|
|
int * | ichop ) |
Provide a capped sinh() function.
If the argument x of Vcap_sinh() exceeds EXPMAX or EXPMIN, then we
return sinh(EXPMAX) or sinh(EXPMIN) rather than sinh(x).
- Note
- Original FORTRAN routine from PMG library by Mike Holst Original notes: to control overflow in the hyperbolic and exp functions, note that the following are the argument limits of the various functions on various machines after which overflow occurs: Convex C240, Sun 3/60, Sun SPARC, IBM RS/6000: sinh, cosh, exp: maximal argument (abs value) = 88.0d0 dsinh, dcosh, dexp: maximal argument (abs value) = 709.0d0
- Author
- Nathan Baker (based on FORTRAN code by Mike Holst)
- Returns
- sinh(x) or capped equivalent
- Parameters
-
x | Argument to sinh() |
ichop | Set to 1 if function capped, 0 otherwise |
Definition at line 75 of file vcap.c.