Sunday's Exercises Exercise 1: Write a procedure that when given an a,b,c, computes the (more) positive root of the quadratic polynomial ax^2+bx+c. If the root is complex signal an error: (error "Complex roots!") (quad-roots 1 -3 2) ;Value: 2 (quad-roots 1 2 1) ;Value: -1 (quad-roots 1 1 1) ;Error: Complex roots! Exercise 2: Write a procedure that uses Euclid's algorithm to compute the GCD of two numbers. Euclid's algorithm (according to Knuth it's the oldest known algorithm) goes as follows: if r is the remainder of a divided by b, then the common divisors of a and b are the same as those of b and r. Additionally, the gcd of a number and 0 is the number. (gcd 206 40) ;Value: 2 Exercise 3: We can approximate sin x using a recursive process: if x is close to zero (< .1 for example), sin x = x if x is greater reduce using trig: sin x = 3 sin (x/3) - 4 (sin (x/3))^3 (the end reads: minus sin cubed of x over 3) Suggested plan: A) write cube B) write a procedure that computes sin x given sin (x/3) C) write a procedure that combines the two. (sine 0) ;Value: 0 (sine 3.14159) ;Value: -0.000785519012433511 (sine (/ 3.14159 2.0)) ;Value: 0.9999999999991198