(lambda (x0 x1 k f) (let ((dx (/ (- x1 x0) k))) (* dx (let t ((x (+ x0 dx)) (s (* 1/2 (f x0))) (k (- k 1))) (if (= k 0) (+ s (* 1/2 (f x1))) (t (+ x dx) (+ (f x) s) (- k 1))))))) (define int (fileVal "int")) (int 0 5 100 (lambda (x) x)) (int 0 10 10 (lambda (x) 1)) (int 0 10 103 (lambda (x) 2.2))