Skip to content

Commit

Permalink
Merge pull request #28 from bennn/lang
Browse files Browse the repository at this point in the history
#lang mechanics
  • Loading branch information
bennn committed Jan 10, 2016
2 parents a112cda + 4d46d43 commit dc83d5e
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 35 deletions.
7 changes: 7 additions & 0 deletions lang/main.rkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#lang racket/base

(require mechanics)

(provide
(all-from-out racket/base)
(all-from-out mechanics))
2 changes: 2 additions & 0 deletions lang/reader.rkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#lang s-exp syntax/module-reader
mechanics/lang/main
3 changes: 1 addition & 2 deletions private/kernel/interval.rkt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#lang racket/base
#lang mechanics

;; Utilities for working with subsets of the real line.
;; Alternatively, for representing data points that have a tolerance.
Expand All @@ -11,7 +11,6 @@
;; (arranged from lowest lo bound upward, all intervals disjoint)

(require
mechanics
(for-syntax racket/base syntax/parse)
(only-in racket/match match-define)
)
Expand Down
2 changes: 1 addition & 1 deletion private/kernel/vector.rkt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#lang racket/base
#lang mechanics

;; Vector functions missing from racket & racket/math

Expand Down
11 changes: 1 addition & 10 deletions private/numerics/functions/bessel.rkt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#lang racket/base
#lang mechanics

;; This module defines the bessel functions of integer order
(require racket/contract/base)
(provide
(contract-out
[bessj₀ (-> number? number?)]
Expand All @@ -14,14 +13,6 @@
[bessh₁ (-> number? complex?)]
[bessh (-> integer? number? complex?)]))

(require
(only-in mechanics
π
π/4
π/2
3π/4
2/π))

(require
(only-in math/number-theory factorial))

Expand Down
4 changes: 1 addition & 3 deletions private/numerics/functions/bessjs.rkt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#lang racket/base
#lang mechanics

;;;; Bessel Functions:

Expand All @@ -10,7 +10,6 @@
;;; ( J0(x) ... Jn(x) )
;;; that is good to machine precision for x < 2 and large n.

(require racket/contract/base)
(provide
(contract-out
[bessjs (-> exact-nonnegative-integer? positive? (listof number?))]))
Expand Down Expand Up @@ -67,7 +66,6 @@
(module+ test
(require rackunit
rackunit/text-ui
(only-in mechanics π/2 π 3π/2 2π)
math/matrix
(only-in racket/vector vector-map)
(only-in racket/format ~a)
Expand Down
6 changes: 1 addition & 5 deletions private/numerics/functions/elliptic-flo.rkt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#lang racket/base

(require racket/contract/base)
#lang mechanics

(provide
(contract-out
Expand All @@ -21,8 +19,6 @@
fl*
fl-))

(require (only-in mechanics π π/2 *machine-ε*))

(define (first-elliptic-integral k)
(let loop ([a 1.0]
[b (flsqrt (fl- 1.0
Expand Down
13 changes: 3 additions & 10 deletions private/numerics/functions/elliptic.rkt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#lang racket/base
#lang mechanics

;; Consult "Numerical Computation of Real or Complex Elliptic
;; Integrals" Carlson (1994) http://arxiv.org/pdf/math/9409227v1.pdf
Expand All @@ -8,7 +8,6 @@
;;
;; Consider also exporting under the more familiar names Rf, Rj, Rc,
;; Rd. Is there any input method that gets those names as subscripts.
(require racket/contract/base)
(provide
(contract-out
;; Carlson elliptic integrals R_F
Expand Down Expand Up @@ -72,12 +71,7 @@
number?))

(require
(only-in mechanics π π/2 square *machine-ε*))

(require
(only-in racket/math cosh tanh))

(require
(only-in racket/math cosh tanh)
(only-in racket/fixnum fx< fx+))

(define (Rf x y z)
Expand Down Expand Up @@ -307,8 +301,7 @@

(module+ test
(require rackunit
rackunit/text-ui
(only-in mechanics π/2))
rackunit/text-ui)

(define test-suite-ε 1e-7)
(run-tests
Expand Down
3 changes: 1 addition & 2 deletions private/numerics/integer/continued-fractions.rkt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#lang racket/base
#lang mechanics

;; Continued Fractions stream approximations of real numbers.
;; http://en.wikipedia.org/wiki/Continued_fraction

(require mechanics)
(provide/api
continued-fraction
#:contract (-> real? (sequenceof integer?))
Expand Down
3 changes: 1 addition & 2 deletions private/numerics/integer/farey.rkt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#lang racket/base
#lang mechanics

;; Farey Trees (aka Stern-Brocot Trees)
;; http://mathworld.wolfram.com/FareySequence.html
Expand All @@ -10,7 +10,6 @@
;; Because the mediants are always between the given fractions
;; the levels are ordered if the first one is ordered.

(require mechanics)
(provide/api
farey
#:contract (-> natural? natural? (-> natural? (listof exact-rational?)))
Expand Down

0 comments on commit dc83d5e

Please sign in to comment.