Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Matlab: a) Write a function that computes the natural logarithm of x, using the Taylor's Series (TS) for log(x) ( natural log). The basic

Using Matlab:image text in transcribedimage text in transcribedimage text in transcribed

a) Write a function that computes the natural logarithm of x, using the Taylor's Series (TS) for log(x) ( natural log). The basic definition is given in the following formula. (10 points) log(x)=(-1)(k+ 1)*(x-1),k for 0 2, then you should use the identity of log(x) - log(2) + log(x/2). Do not compute log(2), but use a constant of 0.69314718055994529 We will want to return the number of iterations required to attain the solution, since this shows how well the algorithm converges Prototype function [y, terms] = TS-log ( x, MaxTerms % [y, terms] = TS-log (x, MaxTerms ) ) % Computes log of the number x, using a maximum of MaxTerms in % the Taylor's Series. % Input: x -Number that we want the natural log of. MaxTerms - The maximum number of terms that are to be used. [default: 1000] % Output: y- log of x terms- number of terms used. a) Write a function that computes the natural logarithm of x, using the Taylor's Series (TS) for log(x) ( natural log). The basic definition is given in the following formula. (10 points) log(x)=(-1)(k+ 1)*(x-1),k for 0 2, then you should use the identity of log(x) - log(2) + log(x/2). Do not compute log(2), but use a constant of 0.69314718055994529 We will want to return the number of iterations required to attain the solution, since this shows how well the algorithm converges Prototype function [y, terms] = TS-log ( x, MaxTerms % [y, terms] = TS-log (x, MaxTerms ) ) % Computes log of the number x, using a maximum of MaxTerms in % the Taylor's Series. % Input: x -Number that we want the natural log of. MaxTerms - The maximum number of terms that are to be used. [default: 1000] % Output: y- log of x terms- number of terms used

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Web Database Development Step By Step

Authors: Jim Buyens

1st Edition

0735609667, 978-0735609662

More Books

Students also viewed these Databases questions