Skip to content

Instantly share code, notes, and snippets.

@kouddy
Last active August 29, 2015 14:18
Show Gist options
  • Save kouddy/17703471852564a7eb41 to your computer and use it in GitHub Desktop.
Save kouddy/17703471852564a7eb41 to your computer and use it in GitHub Desktop.
(define (make-interval a b) (cons a b))
(define (lower-bound i) (car i))
(define (upper-bound i) (cdr i))
(define (mul-interval-small x y)
(let ((a (lower-bound x))
(b (upper-bound x))
(c (lower-bound y))
(d (upper-bound y))
(width-x (/ (- (upper-bound x) (lower-bound x)) 2))
(width-y (/ (- (upper-bound y) (lower-bound y)) 2)))
(make-interval (* a c)
(+ (* a c) (* (+ (* width-x c) (* width-y a)) 2)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment