Skip to content

Commit

Permalink
Merge 288a7df into a112cda
Browse files Browse the repository at this point in the history
  • Loading branch information
bkc39 committed Oct 14, 2015
2 parents a112cda + 288a7df commit f28af39
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 73 deletions.
30 changes: 22 additions & 8 deletions numerics.rkt
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
#lang racket/base

;; TODO import the rest of numerics/functions
;; rename conflicting identifiers (between elliptic & elliptic-flo, etc)
(require
mechanics/private/numerics/functions/bessel
mechanics/private/numerics/functions/bessjs
mechanics/private/numerics/functions/elliptic
(prefix-in flo: mechanics/private/numerics/functions/elliptic-flo))

(provide
(all-from-out mechanics/private/numerics/functions/bessel)
)

(require
mechanics/private/numerics/functions/bessel
)
(all-from-out mechanics/private/numerics/functions/bessel)
(all-from-out mechanics/private/numerics/functions/bessjs)

(rename-out
[bessj₀ bessj0]
[bessj₁ bessj1]
[bessy₀ bessy0]
[bessy₁ bessy1]
[bessh₀ bessh0]
[bessh₁ bessh1])

(rename-out
[Rf Carlson-elliptic₁]
[Rf Carlson-elliptic-1]
[Carlson-elliptic₁-simple Carlson-elliptic-1-simple]
[Rd Carlson-elliptic₂]
[Rd Carlson-elliptic-2]))
60 changes: 0 additions & 60 deletions private/numerics/functions/bessel.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -100,66 +100,6 @@
(- (* (cos ax-π/4) p₀)
(* z (sin ax-π/4) q₀)))))))

(define (bessj1 x)
(let ((ax (magnitude x)))
(if (< ax 8.0) ;Jone 6045
(let ((y (* x x)))
(/ (* x
(poly-by-coeffs->value y
+.695364226329838502166085207e+8
-.8356785487348914291918495672e+7
+.3209027468853947029888682298e+6
-.58787877666568200462723094e+4
+.6121876997356943874446879769e+2
-.3983107983952332023421699105e+0
+.1705769264349617107854016566e-2
-.4910599276555129440130592573e-5
+.9382193365140744507653268479e-8
-.1107352224453730633782671362e-10
+.63194310317443161294700346e-14))
(poly-by-coeffs->value y
+.139072845265967685120764336e+9
+.6705346835482299302199750802e+6
+.1284593453966301898121332163e+4
+.1e+1)))
(let* ((z (/ 8.0 ax))
(y (* z z))
(xx (- ax 3π/4))
(p1 ;Pone 6747
(/ (poly-by-coeffs->value y
+.1290918471896188077350689e+5
+.1309042051103506486292571e+5
+.313275295635506951011069e+4
+.17431379748379024599685e+3
+.122850537643590432633e+1)
(poly-by-coeffs->value y
+.1290918471896187879332737e+5
+.1306678308784402036110575e+5
+.310928141677002883350924e+4
+.16904721775008609992033e+3
+.1e+1)))
(q1 ;Qone 7147
(/ (poly-by-coeffs->value y
;+.14465282874995208675225e+3 ;This line or the next is in error
+.14465282874995208765225e+3
+.1744291689092425885102e+3
+.5173653281836591636536e+2
+.379944537969806734901e+1
+.36363466476034710809e-1)
(poly-by-coeffs->value y
+.308592701333231723110639e+4
+.373434010601630179517765e+4
+.11191098527047487025919e+4
+.8522392064341340397334e+2
+.1e+1)))
(ans
(* (sqrt (/ 2/π ax))
(- (* (cos xx) p1)
(* z (sin xx) q1)))))
(if (< x 0.0)
(- ans)
ans)))))

(define (bessj₁ x)
(let ([ax (magnitude x)])
(if (< ax 8.0)
Expand Down
5 changes: 0 additions & 5 deletions private/numerics/functions/elliptic.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,10 @@
(contract-out
;; Carlson elliptic integrals R_F
[Rf three-nonnegative-reals->number]
[Carlson-elliptic₁ three-nonnegative-reals->number]
[Carlson-elliptic-1 three-nonnegative-reals->number]
[Carlson-elliptic₁-simple three-nonnegative-reals->number]
[Carlson-elliptic-1-simple three-nonnegative-reals->number]

;; R_D
[Rd three-nonnegative-reals->number]
[Carlson-elliptic₂ three-nonnegative-reals->number]
[Carlson-elliptic-2 three-nonnegative-reals->number]

;; Elliptic integrals of the first kind: F(φ,k)

Expand Down

0 comments on commit f28af39

Please sign in to comment.