Question
Need a basic javascript program for the following problem: Bracketed roots. Input: (1) Define a function f(x) (2) Find left and right brackets for a
Need a basic javascript program for the following problem:
Bracketed roots.
Input:
(1) Define a function f(x)
(2) Find left and right brackets for a root, call them LL and UL
(3) Assign a value to the tolerance HH
output: two values for R, such that there is a value of x in the open interval defined by R - HH/2 < x < R + HH/2 where f(x) = 0
Note that x may be irrational of something else that does not exist in our number space.
One of these values needs to be calculated using the binary search algorithm and the other one should use the false position algorithm. Be careful with false position to make sure that you start with an interval on which the algorithm terminates. When you are in class, let's talk about different ways we could terminate the algorithm, such as interval width (like bisection), proximity of y-value to zero, or a combination of these?
A very basic program is good enough. Thanks.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started