Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Math128A: Numerical Analysis

Programming Assignment, Due Nov.  22, 2023

Implement the modifed zeroin algorithm discussed in class.

You should turn in a .m ile modifiedzeroinxxx.m which contains a matlab function of the form

function  [root,info]  = modifiedzeroin(@func,Int,params)

where xxx is your student id.   On  input,  func  is  a function handle,  Int  is the  initial inter- val, [Int:a; Int:b], containing a root, and params is an object that contains at least three ields params. root tol , params. func tol and params. maxit .  Your algorithm should terminate once the interval containing the root is at most params. root tol in length, or the function value at the current iterate is at most params. func tol in absolute value.  On output, root is the computed root, and info should have at least one ield info. flag, which is 0 for a successful execution, and 1 otherwise.

Your program will be tested against a few functions of our choice, against the following criteria:

1.  (60 points) A zero is found within given tolerances for each function tested.

2.  (40 points) One zero is found within the right number of function calls for each function tested.

Your program will receive 0 points if it is found to be highly similar to the matlab built-in function fzero. You must do all your programming work by yourself.

Submit your .m ile on gradescope by 23:59PM, Nov. 22, 2023.