Question: > Write a function in Dr Racket that finds a zero of a polynomial using the bisection method: > The function takes 3 parameters: The

> Write a function in Dr Racket that finds a zero of a polynomial using the bisection method:

> The function takes 3 parameters: The polynomial function and two starting values

> For the function y = 5x2 - x 8, you can use starting values 1 and 2:

> Which evaluate to -8 and 10 respectively

> You can assume that the two starting x values evaluate to y values that are on opposite sides of the x axis. (i.e. one y value is positive, the other negative)

Helpful subfunctions:

> a subfunction to decide if the current y value is accurate enough. The accuracy can be hard coded (0.1 or 0.01 or so) or can be a parameter

> a subfunction that calculates the average of 2 numbers

I got this far but would need help with the rest.

#lang racket

(define (myPolynomial x) (- (- (* 5 (* x x )) x) 8))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!