Answered step by step
Verified Expert Solution
Question
1 Approved Answer
i need a code to calculate forward error and backward error USE FOLLOWING FORM format long e %call fzero for first initial guess [rootest1, fval1]
i need a code to calculate forward error and backward error
USE FOLLOWING FORM
format long e
%call fzero for first initial guess
[rootest1, fval1] =fzero(@(x)exp(x-1)-1,5)
%show output
rootest1
fval1
%compute errors
forerr1 =
backerr1 =
In the script file, first compute the root of f(x) =er1-1 using fzero with initial guesses xo = 5 and x, = 5+10-10. For each initial guess, show the values of rootest and fval, and use these to compute and show the forward and backward absolute errors for each initial guess, using the exact root for the errors. The input func is the function et-1-1 enclosed by apostrophes. The outputs are the final root estimate and f(x) evaluated at this estimate. Use exp() for the exponential functionStep 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