(define(product term a next b)(if(> a b)1(*(term a)(product term (next a) next b))))(define(product_1 term a next b)(define(iter a result)(if(> a b)
result
(iter(next a)(*(term a) result))))(iter a 1))(define(calc-pi n)(define(even? n)(=(remainder n 2)0))(define(f n)(if(even? n)(/ n (+ n 1))(/(+ n 1) n)))(define(inc n)(+ n 1))(*4.0(product f 2 inc n)))(define(calc-pi_1 n)(define(even? n)(=(remainder n 2)0))(define(f n)(if(even? n)(/ n (+ n 1))(/(+ n 1) n)))(define(inc n)(+ n 1))(*4.0(product_1 f 2 inc n)))(newline)(display(calc-pi1000))(newline)(display(calc-pi_11000))