PyFiberModes 0.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- PyFiberModes/.DS_Store +0 -0
- PyFiberModes/VERSION +1 -0
- PyFiberModes/__init__.py +38 -0
- PyFiberModes/constants.py +32 -0
- PyFiberModes/fiber/.DS_Store +0 -0
- PyFiberModes/fiber/__init__.py +0 -0
- PyFiberModes/fiber/factory.py +448 -0
- PyFiberModes/fiber/fiber.py +317 -0
- PyFiberModes/fiber/geometry/__init__.py +10 -0
- PyFiberModes/fiber/geometry/geometry.py +33 -0
- PyFiberModes/fiber/geometry/stepindex.py +181 -0
- PyFiberModes/fiber/geometry/supergaussian.py +193 -0
- PyFiberModes/fiber/material/__init__.py +13 -0
- PyFiberModes/fiber/material/air.py +20 -0
- PyFiberModes/fiber/material/claussiusmossotti.py +40 -0
- PyFiberModes/fiber/material/compmaterial.py +60 -0
- PyFiberModes/fiber/material/fixed.py +36 -0
- PyFiberModes/fiber/material/germania.py +14 -0
- PyFiberModes/fiber/material/material.py +107 -0
- PyFiberModes/fiber/material/sellmeier.py +47 -0
- PyFiberModes/fiber/material/sellmeiercomp.py +42 -0
- PyFiberModes/fiber/material/silica.py +15 -0
- PyFiberModes/fiber/material/sio2f.py +34 -0
- PyFiberModes/fiber/material/sio2geo2.py +36 -0
- PyFiberModes/fiber/material/sio2geo2cm.py +43 -0
- PyFiberModes/fiber/solver/__init__.py +12 -0
- PyFiberModes/fiber/solver/cuda.py +124 -0
- PyFiberModes/fiber/solver/cudasrc/besseldiff.c +28 -0
- PyFiberModes/fiber/solver/cudasrc/chareq.c +314 -0
- PyFiberModes/fiber/solver/cudasrc/constf.c +20 -0
- PyFiberModes/fiber/solver/cudasrc/hypergf.c +264 -0
- PyFiberModes/fiber/solver/cudasrc/ivf.c +49 -0
- PyFiberModes/fiber/solver/cudasrc/knf.c +166 -0
- PyFiberModes/fiber/solver/mlsif.py +289 -0
- PyFiberModes/fiber/solver/solver.py +119 -0
- PyFiberModes/fiber/solver/ssif.py +275 -0
- PyFiberModes/fiber/solver/tlsif.py +266 -0
- PyFiberModes/field.py +405 -0
- PyFiberModes/functions.py +137 -0
- PyFiberModes/mode.py +186 -0
- PyFiberModes/simulator/.DS_Store +0 -0
- PyFiberModes/simulator/__init__.py +15 -0
- PyFiberModes/simulator/psimulator.py +41 -0
- PyFiberModes/simulator/simulator.py +288 -0
- PyFiberModes/slrc.py +291 -0
- PyFiberModes/tools/__init__.py +0 -0
- PyFiberModes/tools/directories.py +41 -0
- PyFiberModes/wavelength.py +109 -0
- PyFiberModes-0.2.1.dist-info/METADATA +158 -0
- PyFiberModes-0.2.1.dist-info/RECORD +52 -0
- PyFiberModes-0.2.1.dist-info/WHEEL +5 -0
- PyFiberModes-0.2.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
|
|
2
|
+
/* hyp2f0() */
|
|
3
|
+
|
|
4
|
+
__device__ float hyp2f0f(float a, float b, float x, int type, float *err)
|
|
5
|
+
{
|
|
6
|
+
float a0, alast, t, tlast, maxt;
|
|
7
|
+
float n, an, bn, u, sum, temp;
|
|
8
|
+
|
|
9
|
+
an = a;
|
|
10
|
+
bn = b;
|
|
11
|
+
a0 = 1.0;
|
|
12
|
+
alast = 1.0;
|
|
13
|
+
sum = 0.0;
|
|
14
|
+
n = 1.0;
|
|
15
|
+
t = 1.0;
|
|
16
|
+
tlast = 1.0e9;
|
|
17
|
+
maxt = 0.0;
|
|
18
|
+
|
|
19
|
+
do
|
|
20
|
+
{
|
|
21
|
+
if( an == 0 )
|
|
22
|
+
goto pdone;
|
|
23
|
+
if( bn == 0 )
|
|
24
|
+
goto pdone;
|
|
25
|
+
|
|
26
|
+
u = an * (bn * x / n);
|
|
27
|
+
|
|
28
|
+
/* check for blowup */
|
|
29
|
+
temp = fabsf(u);
|
|
30
|
+
if( (temp > 1.0 ) && (maxt > (MAXNUMF/temp)) )
|
|
31
|
+
goto error;
|
|
32
|
+
|
|
33
|
+
a0 *= u;
|
|
34
|
+
t = fabsf(a0);
|
|
35
|
+
|
|
36
|
+
/* terminating condition for asymptotic series */
|
|
37
|
+
if( t > tlast )
|
|
38
|
+
goto ndone;
|
|
39
|
+
|
|
40
|
+
tlast = t;
|
|
41
|
+
sum += alast; /* the sum is one term behind */
|
|
42
|
+
alast = a0;
|
|
43
|
+
|
|
44
|
+
if( n > 200 )
|
|
45
|
+
goto ndone;
|
|
46
|
+
|
|
47
|
+
an += 1.0;
|
|
48
|
+
bn += 1.0;
|
|
49
|
+
n += 1.0;
|
|
50
|
+
if( t > maxt )
|
|
51
|
+
maxt = t;
|
|
52
|
+
}
|
|
53
|
+
while( t > MACHEPF );
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
pdone: /* series converged! */
|
|
57
|
+
|
|
58
|
+
/* estimate error due to roundoff and cancellation */
|
|
59
|
+
*err = fabsf( MACHEPF * (n + maxt) );
|
|
60
|
+
|
|
61
|
+
alast = a0;
|
|
62
|
+
goto done;
|
|
63
|
+
|
|
64
|
+
ndone: /* series did not converge */
|
|
65
|
+
|
|
66
|
+
/* The following "Converging factors" are supposed to improve accuracy,
|
|
67
|
+
* but do not actually seem to accomplish very much. */
|
|
68
|
+
|
|
69
|
+
n -= 1.0;
|
|
70
|
+
x = 1.0/x;
|
|
71
|
+
|
|
72
|
+
switch( type ) /* "type" given as subroutine argument */
|
|
73
|
+
{
|
|
74
|
+
case 1:
|
|
75
|
+
alast *= ( 0.5 + (0.125 + 0.25*b - 0.5*a + 0.25*x - 0.25*n)/x );
|
|
76
|
+
break;
|
|
77
|
+
|
|
78
|
+
case 2:
|
|
79
|
+
alast *= 2.0/3.0 - b + 2.0*a + x - n;
|
|
80
|
+
break;
|
|
81
|
+
|
|
82
|
+
default:
|
|
83
|
+
;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* estimate error due to roundoff, cancellation, and nonconvergence */
|
|
87
|
+
*err = MACHEPF * (n + maxt) + fabsf( a0 );
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
done:
|
|
91
|
+
sum += alast;
|
|
92
|
+
return( sum );
|
|
93
|
+
|
|
94
|
+
/* series blew up: */
|
|
95
|
+
error:
|
|
96
|
+
*err = MAXNUMF;
|
|
97
|
+
/* mtherr( "hypergf", TLOSS ); */
|
|
98
|
+
return( sum );
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
__device__ float hy1f1af( float a, float b, float x, float *err )
|
|
102
|
+
{
|
|
103
|
+
float h1, h2, t, u, temp, acanc, asum, err1, err2;
|
|
104
|
+
|
|
105
|
+
if( x == 0 )
|
|
106
|
+
{
|
|
107
|
+
acanc = 1.0;
|
|
108
|
+
asum = MAXNUMF;
|
|
109
|
+
goto adone;
|
|
110
|
+
}
|
|
111
|
+
temp = logf( fabsf(x) );
|
|
112
|
+
t = x + temp * (a-b);
|
|
113
|
+
u = -temp * a;
|
|
114
|
+
|
|
115
|
+
if( b > 0 )
|
|
116
|
+
{
|
|
117
|
+
temp = lgammaf(b);
|
|
118
|
+
t += temp;
|
|
119
|
+
u += temp;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
h1 = hyp2f0f( a, a-b+1, -1.0/x, 1, &err1 );
|
|
123
|
+
|
|
124
|
+
temp = expf(u) / tgammaf(b-a);
|
|
125
|
+
h1 *= temp;
|
|
126
|
+
err1 *= temp;
|
|
127
|
+
|
|
128
|
+
h2 = hyp2f0f( b-a, 1.0-a, 1.0/x, 2, &err2 );
|
|
129
|
+
|
|
130
|
+
if( a < 0 )
|
|
131
|
+
temp = expf(t) / tgammaf(a);
|
|
132
|
+
else
|
|
133
|
+
temp = expf( t - lgammaf(a) );
|
|
134
|
+
|
|
135
|
+
h2 *= temp;
|
|
136
|
+
err2 *= temp;
|
|
137
|
+
|
|
138
|
+
if( x < 0.0 )
|
|
139
|
+
asum = h1;
|
|
140
|
+
else
|
|
141
|
+
asum = h2;
|
|
142
|
+
|
|
143
|
+
acanc = fabsf(err1) + fabsf(err2);
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
if( b < 0 )
|
|
147
|
+
{
|
|
148
|
+
temp = tgammaf(b);
|
|
149
|
+
asum *= temp;
|
|
150
|
+
acanc *= fabsf(temp);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
if( asum != 0.0 )
|
|
155
|
+
acanc /= fabsf(asum);
|
|
156
|
+
|
|
157
|
+
acanc *= 30.0; /* fudge factor, since error of asymptotic formula
|
|
158
|
+
* often seems this much larger than advertised */
|
|
159
|
+
|
|
160
|
+
adone:
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
*err = acanc;
|
|
164
|
+
return( asum );
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* Power series summation for confluent hypergeometric function */
|
|
168
|
+
__device__ float hy1f1pf( float a, float b, float x, float *err )
|
|
169
|
+
{
|
|
170
|
+
float n, a0, sum, t, u, temp;
|
|
171
|
+
float an, bn, maxt, pcanc;
|
|
172
|
+
|
|
173
|
+
/* set up for power series summation */
|
|
174
|
+
an = a;
|
|
175
|
+
bn = b;
|
|
176
|
+
a0 = 1.0;
|
|
177
|
+
sum = 1.0;
|
|
178
|
+
n = 1.0;
|
|
179
|
+
t = 1.0;
|
|
180
|
+
maxt = 0.0;
|
|
181
|
+
|
|
182
|
+
while( t > MACHEPF )
|
|
183
|
+
{
|
|
184
|
+
if( bn == 0 ) /* check bn first since if both */
|
|
185
|
+
{
|
|
186
|
+
/* mtherr( "hypergf", SING ); */
|
|
187
|
+
return( MAXNUMF ); /* an and bn are zero it is */
|
|
188
|
+
}
|
|
189
|
+
if( an == 0 ) /* a singularity */
|
|
190
|
+
return( sum );
|
|
191
|
+
if( n > 200 )
|
|
192
|
+
goto pdone;
|
|
193
|
+
u = x * ( an / (bn * n) );
|
|
194
|
+
|
|
195
|
+
/* check for blowup */
|
|
196
|
+
temp = fabsf(u);
|
|
197
|
+
if( (temp > 1.0 ) && (maxt > (MAXNUMF/temp)) )
|
|
198
|
+
{
|
|
199
|
+
pcanc = 1.0; /* estimate 100% error */
|
|
200
|
+
goto blowup;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
a0 *= u;
|
|
204
|
+
sum += a0;
|
|
205
|
+
t = fabsf(a0);
|
|
206
|
+
if( t > maxt )
|
|
207
|
+
maxt = t;
|
|
208
|
+
/*
|
|
209
|
+
if( (maxt/fabsf(sum)) > 1.0e17 )
|
|
210
|
+
{
|
|
211
|
+
pcanc = 1.0;
|
|
212
|
+
goto blowup;
|
|
213
|
+
}
|
|
214
|
+
*/
|
|
215
|
+
an += 1.0;
|
|
216
|
+
bn += 1.0;
|
|
217
|
+
n += 1.0;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
pdone:
|
|
221
|
+
|
|
222
|
+
/* estimate error due to roundoff and cancellation */
|
|
223
|
+
if( sum != 0.0 )
|
|
224
|
+
maxt /= fabsf(sum);
|
|
225
|
+
maxt *= MACHEPF; /* this way avoids multiply overflow */
|
|
226
|
+
pcanc = fabsf( MACHEPF * n + maxt );
|
|
227
|
+
|
|
228
|
+
blowup:
|
|
229
|
+
|
|
230
|
+
*err = pcanc;
|
|
231
|
+
|
|
232
|
+
return( sum );
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
__device__ float hypergf( float a, float b, float x ) {
|
|
236
|
+
float asum, psum, acanc, pcanc, temp;
|
|
237
|
+
|
|
238
|
+
/* See if a Kummer transformation will help */
|
|
239
|
+
temp = b - a;
|
|
240
|
+
if( fabsf(temp) < 0.001 * fabsf(a) )
|
|
241
|
+
return( expf(x) * hypergf( temp, b, -x ) );
|
|
242
|
+
|
|
243
|
+
psum = hy1f1pf( a, b, x, &pcanc );
|
|
244
|
+
if( pcanc < 1.0e-6 )
|
|
245
|
+
goto done;
|
|
246
|
+
|
|
247
|
+
/* try asymptotic series */
|
|
248
|
+
|
|
249
|
+
asum = hy1f1af( a, b, x, &acanc );
|
|
250
|
+
|
|
251
|
+
/* Pick the result with less estimated error */
|
|
252
|
+
|
|
253
|
+
if( acanc < pcanc )
|
|
254
|
+
{
|
|
255
|
+
pcanc = acanc;
|
|
256
|
+
psum = asum;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
done:
|
|
260
|
+
/* if( pcanc > 1.0e-3 )
|
|
261
|
+
mtherr( "hyperg", PLOSS ); */
|
|
262
|
+
|
|
263
|
+
return( psum );
|
|
264
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
|
|
2
|
+
__device__ float ivf( float v, float x )
|
|
3
|
+
{
|
|
4
|
+
int sign;
|
|
5
|
+
float t, ax;
|
|
6
|
+
|
|
7
|
+
/* If v is a negative integer, invoke symmetry */
|
|
8
|
+
t = floorf(v);
|
|
9
|
+
if( v < 0.0 )
|
|
10
|
+
{
|
|
11
|
+
if( t == v )
|
|
12
|
+
{
|
|
13
|
+
v = -v; /* symmetry */
|
|
14
|
+
t = -t;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/* If x is negative, require v to be an integer */
|
|
18
|
+
sign = 1;
|
|
19
|
+
if( x < 0.0 )
|
|
20
|
+
{
|
|
21
|
+
if( t != v )
|
|
22
|
+
{
|
|
23
|
+
/* mtherr( "ivf", DOMAIN ); */
|
|
24
|
+
return( 0.0 );
|
|
25
|
+
}
|
|
26
|
+
if( v != 2.0 * floorf(v/2.0) )
|
|
27
|
+
sign = -1;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Avoid logarithm singularity */
|
|
31
|
+
if( x == 0.0 )
|
|
32
|
+
{
|
|
33
|
+
if( v == 0.0 )
|
|
34
|
+
return( 1.0 );
|
|
35
|
+
if( v < 0.0 )
|
|
36
|
+
{
|
|
37
|
+
/* mtherr( "ivf", OVERFLOW ); */
|
|
38
|
+
return( MAXNUMF );
|
|
39
|
+
}
|
|
40
|
+
else
|
|
41
|
+
return( 0.0 );
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
ax = fabsf(x);
|
|
45
|
+
t = v * logf( 0.5 * ax ) - x;
|
|
46
|
+
t = sign * expf(t) / tgammaf( v + 1.0 );
|
|
47
|
+
ax = v + 0.5;
|
|
48
|
+
return( t * hypergf( ax, 2.0 * ax, 2.0 * x ) );
|
|
49
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
|
|
2
|
+
#define EUL 5.772156649015328606065e-1
|
|
3
|
+
#define MAXFAC 31
|
|
4
|
+
|
|
5
|
+
__device__ float knf( int nn, float x )
|
|
6
|
+
{
|
|
7
|
+
float k, kf, nk1f, nkf, zn, t, s, z0, z;
|
|
8
|
+
float ans, fn, pn, pk, zmn, tlg, tox;
|
|
9
|
+
int i, n;
|
|
10
|
+
|
|
11
|
+
if( nn < 0 )
|
|
12
|
+
n = -nn;
|
|
13
|
+
else
|
|
14
|
+
n = nn;
|
|
15
|
+
|
|
16
|
+
if( n > MAXFAC )
|
|
17
|
+
{
|
|
18
|
+
overf:
|
|
19
|
+
/* mtherr( "knf", OVERFLOW ); */
|
|
20
|
+
return( MAXNUMF );
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if( x <= 0.0 )
|
|
24
|
+
{
|
|
25
|
+
/*
|
|
26
|
+
if( x < 0.0 )
|
|
27
|
+
mtherr( "knf", DOMAIN );
|
|
28
|
+
else
|
|
29
|
+
mtherr( "knf", SING );
|
|
30
|
+
*/
|
|
31
|
+
return( MAXNUMF );
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
if( x > 9.55 )
|
|
36
|
+
goto asymp;
|
|
37
|
+
|
|
38
|
+
ans = 0.0;
|
|
39
|
+
z0 = 0.25 * x * x;
|
|
40
|
+
fn = 1.0;
|
|
41
|
+
pn = 0.0;
|
|
42
|
+
zmn = 1.0;
|
|
43
|
+
tox = 2.0/x;
|
|
44
|
+
|
|
45
|
+
if( n > 0 )
|
|
46
|
+
{
|
|
47
|
+
/* compute factorial of n and psi(n) */
|
|
48
|
+
pn = -EUL;
|
|
49
|
+
k = 1.0;
|
|
50
|
+
for( i=1; i<n; i++ )
|
|
51
|
+
{
|
|
52
|
+
pn += 1.0/k;
|
|
53
|
+
k += 1.0;
|
|
54
|
+
fn *= k;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
zmn = tox;
|
|
58
|
+
|
|
59
|
+
if( n == 1 )
|
|
60
|
+
{
|
|
61
|
+
ans = 1.0/x;
|
|
62
|
+
}
|
|
63
|
+
else
|
|
64
|
+
{
|
|
65
|
+
nk1f = fn/n;
|
|
66
|
+
kf = 1.0;
|
|
67
|
+
s = nk1f;
|
|
68
|
+
z = -z0;
|
|
69
|
+
zn = 1.0;
|
|
70
|
+
for( i=1; i<n; i++ )
|
|
71
|
+
{
|
|
72
|
+
nk1f = nk1f/(n-i);
|
|
73
|
+
kf = kf * i;
|
|
74
|
+
zn *= z;
|
|
75
|
+
t = nk1f * zn / kf;
|
|
76
|
+
s += t;
|
|
77
|
+
if( (MAXNUMF - fabsf(t)) < fabsf(s) )
|
|
78
|
+
goto overf;
|
|
79
|
+
if( (tox > 1.0) && ((MAXNUMF/tox) < zmn) )
|
|
80
|
+
goto overf;
|
|
81
|
+
zmn *= tox;
|
|
82
|
+
}
|
|
83
|
+
s *= 0.5;
|
|
84
|
+
t = fabsf(s);
|
|
85
|
+
if( (zmn > 1.0) && ((MAXNUMF/zmn) < t) )
|
|
86
|
+
goto overf;
|
|
87
|
+
if( (t > 1.0) && ((MAXNUMF/t) < zmn) )
|
|
88
|
+
goto overf;
|
|
89
|
+
ans = s * zmn;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
tlg = 2.0 * logf( 0.5 * x );
|
|
95
|
+
pk = -EUL;
|
|
96
|
+
if( n == 0 )
|
|
97
|
+
{
|
|
98
|
+
pn = pk;
|
|
99
|
+
t = 1.0;
|
|
100
|
+
}
|
|
101
|
+
else
|
|
102
|
+
{
|
|
103
|
+
pn = pn + 1.0/n;
|
|
104
|
+
t = 1.0/fn;
|
|
105
|
+
}
|
|
106
|
+
s = (pk+pn-tlg)*t;
|
|
107
|
+
k = 1.0;
|
|
108
|
+
do
|
|
109
|
+
{
|
|
110
|
+
t *= z0 / (k * (k+n));
|
|
111
|
+
pk += 1.0/k;
|
|
112
|
+
pn += 1.0/(k+n);
|
|
113
|
+
s += (pk+pn-tlg)*t;
|
|
114
|
+
k += 1.0;
|
|
115
|
+
}
|
|
116
|
+
while( fabsf(t/s) > MACHEPF );
|
|
117
|
+
|
|
118
|
+
s = 0.5 * s / zmn;
|
|
119
|
+
if( n & 1 )
|
|
120
|
+
s = -s;
|
|
121
|
+
ans += s;
|
|
122
|
+
|
|
123
|
+
return(ans);
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
/* Asymptotic expansion for Kn(x) */
|
|
128
|
+
/* Converges to 1.4e-17 for x > 18.4 */
|
|
129
|
+
|
|
130
|
+
asymp:
|
|
131
|
+
|
|
132
|
+
if( x > MAXLOGF )
|
|
133
|
+
{
|
|
134
|
+
/* mtherr( "knf", UNDERFLOW ); */
|
|
135
|
+
return(0.0);
|
|
136
|
+
}
|
|
137
|
+
k = n;
|
|
138
|
+
pn = 4.0 * k * k;
|
|
139
|
+
pk = 1.0;
|
|
140
|
+
z0 = 8.0 * x;
|
|
141
|
+
fn = 1.0;
|
|
142
|
+
t = 1.0;
|
|
143
|
+
s = t;
|
|
144
|
+
nkf = MAXNUMF;
|
|
145
|
+
i = 0;
|
|
146
|
+
do
|
|
147
|
+
{
|
|
148
|
+
z = pn - pk * pk;
|
|
149
|
+
t = t * z /(fn * z0);
|
|
150
|
+
nk1f = fabsf(t);
|
|
151
|
+
if( (i >= n) && (nk1f > nkf) )
|
|
152
|
+
{
|
|
153
|
+
goto adone;
|
|
154
|
+
}
|
|
155
|
+
nkf = nk1f;
|
|
156
|
+
s += t;
|
|
157
|
+
fn += 1.0;
|
|
158
|
+
pk += 2.0;
|
|
159
|
+
i += 1;
|
|
160
|
+
}
|
|
161
|
+
while( fabsf(t/s) > MACHEPF );
|
|
162
|
+
|
|
163
|
+
adone:
|
|
164
|
+
ans = expf(-x) * sqrtf( PIF/(2.0*x) ) * s;
|
|
165
|
+
return(ans);
|
|
166
|
+
}
|