Skip to content

Commit

Permalink
change aliases to use rename-out
Browse files Browse the repository at this point in the history
and delete duplicate definition from bessel.rkt
  • Loading branch information
bkc39 authored and bennn committed Aug 25, 2017
1 parent dc83d5e commit b18b0e7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 69 deletions.
26 changes: 21 additions & 5 deletions numerics.rkt
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
#lang racket/base

;; TODO import the rest of numerics/functions
;; rename conflicting identifiers (between elliptic & elliptic-flo, etc)

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

(rename-out
[bessj₀ bessj_0]
[bessj₁ bessj_1]

[bessy₀ bessy_0]
[bessy₁ bessy_1]
[bessh₀ bessh_0]
[bessh₁ bessh_1]

[Rf Carlson-elliptic₁]
[Rf Carlson-elliptic_1]

[Carlson-elliptic₁-simple Carlson-elliptic_1-simple]

[Rd Carlson-elliptic₂]
[Rd Carlson-elliptic_2]))

(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))
60 changes: 0 additions & 60 deletions private/numerics/functions/bessel.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -91,66 +91,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
4 changes: 0 additions & 4 deletions private/numerics/functions/elliptic.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,11 @@
(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 b18b0e7

Please sign in to comment.