File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -387,7 +387,7 @@ function airy_large_arg_a(x::ComplexOrReal{T}) where T
387
387
xsqr = sqrt (x)
388
388
389
389
out = zero (S)
390
- t = gamma ( one ( T) / 6 ) * gamma ( T ( 5 ) / 6 ) / 4
390
+ t = GAMMA_ONE_SIXTH ( T) * GAMMA_FIVE_SIXTHS (T ) / 4
391
391
a = 4 * xsqr* x
392
392
for i in 0 : MaxIter
393
393
out += t
@@ -403,7 +403,7 @@ function airy_large_arg_b(x::ComplexOrReal{T}) where T
403
403
xsqr = sqrt (x)
404
404
405
405
out = zero (S)
406
- t = gamma ( one ( T) / 6 ) * gamma ( T ( 5 ) / 6 ) / 4
406
+ t = GAMMA_ONE_SIXTH ( T) * GAMMA_FIVE_SIXTHS (T ) / 4
407
407
a = 4 * xsqr* x
408
408
for i in 0 : MaxIter
409
409
out += t
@@ -419,7 +419,9 @@ function airy_large_arg_c(x::ComplexOrReal{T}) where T
419
419
xsqr = sqrt (x)
420
420
421
421
out = zero (S)
422
- t = gamma (- one (T) / 6 ) * gamma (T (7 ) / 6 ) / 4
422
+ # use identities of gamma to relate to defined constants
423
+ # t = gamma(-one(T) / 6) * gamma(T(7) / 6) / 4
424
+ t = - GAMMA_FIVE_SIXTHS (T) * GAMMA_ONE_SIXTH (T) / 4
423
425
a = 4 * xsqr* x
424
426
for i in 0 : MaxIter
425
427
out += t
@@ -435,7 +437,9 @@ function airy_large_arg_d(x::ComplexOrReal{T}) where T
435
437
xsqr = sqrt (x)
436
438
437
439
out = zero (S)
438
- t = gamma (- one (T) / 6 ) * gamma (T (7 ) / 6 ) / 4
440
+ # use identities of gamma to relate to defined constants
441
+ # t = gamma(-one(T) / 6) * gamma(T(7) / 6) / 4
442
+ t = - GAMMA_FIVE_SIXTHS (T) * GAMMA_ONE_SIXTH (T) / 4
439
443
a = 4 * xsqr* x
440
444
for i in 0 : MaxIter
441
445
out += t
Original file line number Diff line number Diff line change @@ -66,4 +66,3 @@ function small_gamma(x)
66
66
q = evalpoly (x, Q)
67
67
return z * p / q
68
68
end
69
-
Original file line number Diff line number Diff line change @@ -25,5 +25,10 @@ const SQPIO2(::Type{Float32}) = 1.25331413731550025f0
25
25
26
26
const GAMMA_TWO_THIRDS (:: Type{Float64} ) = 1.3541179394264005
27
27
const GAMMA_ONE_THIRD (:: Type{Float64} ) = 2.6789385347077475
28
+ const GAMMA_ONE_SIXTH (:: Type{Float64} ) = 5.566316001780235
29
+ const GAMMA_FIVE_SIXTHS (:: Type{Float64} ) = 1.128787029908126
30
+
28
31
const GAMMA_TWO_THIRDS (:: Type{Float32} ) = 1.3541179394264005f0
29
32
const GAMMA_ONE_THIRD (:: Type{Float32} ) = 2.6789385347077475f0
33
+ const GAMMA_ONE_SIXTH (:: Type{Float32} ) = 5.566316001780235f0
34
+ const GAMMA_FIVE_SIXTHS (:: Type{Float32} ) = 1.128787029908126f0
You can’t perform that action at this time.
0 commit comments