Root finding program Newton's Method?

I need help writing a root finding problem using Newton's Method for the following equation:
y = sin(x) − 0.15x + 1.5
I want to use a tolerance of 1.0e-4 and double precision to find all roots (5 total) of the equation.

I would like some assistance on how to go about writing the derivative function to better understand the main program too. Any help is appreciated.

Cynthia JoubiAsked:
Who is Participating?
I presume that you mean sin(x) - 0.15x + 1.5 = 0?

But oh my! How Fortran has changed since my day :

This is a bit more old fashioned (you'll need to change the real*8)

Incidentally the derivative is cos(x) -0.15.
Cynthia JoubiAuthor Commented:
Thank you BigRat for the information! It really helped me and I think I got a working code.
Much appreciated.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.