Category: Numerical Methods
-
Monte Carlo Simulation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters (define random-init 7) ;**not in book** (define rand (let ((x random-init)) (lambda ()…
-
Simpson’s Rule for Integration
Implementation of simpson’s rule for integration This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters (define (even? n) (= (remainder n 2) 0))…
-
Square-root using Newton’s Method
The following uses Newton’s Method to find square root. It keeps record of how guess changes from one iteration to the next and stops when the change is a very small fraction of the guess. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To…
-
Continued Fraction For Tangent Function
A continued fraction representation of the tangent using J.H. Lambert’s formula: where x is in radians. k specifies the number of terms to compute: This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode…