APBS 3.0.0
Loading...
Searching...
No Matches
vcap.c
Go to the documentation of this file.
1
57#include "vcap.h"
58
59VPUBLIC double Vcap_exp(double x, int *ichop) {
60
61 /* The two chopped arguments */
62 if (x > EXPMAX) {
63 (*ichop) = 1;
64 return VEXP(EXPMAX);
65 } else if (x < EXPMIN) {
66 (*ichop) = 1;
67 return VEXP(EXPMIN);
68 }
69
70 /* The normal EXP */
71 (*ichop) = 0;
72 return VEXP(x);
73}
74
75VPUBLIC double Vcap_sinh(double x, int *ichop) {
76
77 /* The two chopped arguments */
78 if (x > EXPMAX) {
79 (*ichop) = 1;
80 return VSINH(EXPMAX);
81 } else if (x < EXPMIN) {
82 (*ichop) = 1;
83 return VSINH(EXPMIN);
84 }
85
86 /* The normal SINH */
87 (*ichop) = 0;
88 return VSINH(x);
89}
90
91VPUBLIC double Vcap_cosh(double x, int *ichop) {
92
93 /* The two chopped arguments */
94 if (x > EXPMAX) {
95 (*ichop) = 1;
96 return VCOSH(EXPMAX);
97 } else if (x < EXPMIN) {
98 (*ichop) = 1;
99 return VCOSH(EXPMIN);
100 }
101
102 /* The normal COSH */
103 (*ichop) = 0;
104 return VCOSH(x);
105}
#define EXPMAX
Maximum argument for exp(), sinh(), or cosh()
Definition vcap.h:72
VPUBLIC double Vcap_cosh(double x, int *ichop)
Provide a capped cosh() function.
Definition vcap.c:91
VPUBLIC double Vcap_exp(double x, int *ichop)
Provide a capped exp() function.
Definition vcap.c:59
#define EXPMIN
Minimum argument for exp(), sinh(), or cosh()
Definition vcap.h:77
VPUBLIC double Vcap_sinh(double x, int *ichop)
Provide a capped sinh() function.
Definition vcap.c:75
Contains declarations for class Vcap.