Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I can't figure out a working function to use Newton Raphson to approximate arctan(x). I am using f = arctan(x) and df = 1/(1+x^2), and

I can't figure out a working function to use Newton Raphson to approximate arctan(x). I am using f = arctan(x) and df = 1/(1+x^2), and it just keeps converging to 0 or diverging to infinity. Here's the prototype: function [y,terms] = invtanNR( x, tol, numTerms) % [y,terms] = invtanNR(x, tol, numTerms) % % Finds arctan of the number x using NR % using either MaxTerms passes or % having a relative step size < Tolerance % relative step size = abs( yOld y ) / abs( y ) % % input: % x Find arctan of this number % tol Step size % numTerms Max number of terms to use ( 500 ) % % output: % y our resultant (arctan(x)) % terms num of terms %

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions