C: Using Newton's Iterative method to find the root of the equation near 1.5:2x^3-4x^2+3x-6=0.

Source: Internet
Author: User

Newton's Iterative method was used to find the root of the equation near 1.5:2x^3-4x^2+3x-6=0.

Solution: Newton's Iterative method is also called Newton tangent method. Setf =2x^3-4x^2+3x-6,F1 is the derivative of the equation, thef1 = 6x^2-8x+3, and f1= (f (x0) -0)/(X0-X1), deduced:x1 = x0-f/F1

Program:

#include <stdio.h>

#include <math.h>

int main ()

{

Double x0,x1,f,f1;

x1 = 1.5;

Do

{

x0 = x1;

f = 2*x0*x0*x0-4 * x0*x0 + 3 * x0-6;

F1 = 6 * x0*x0-8 * x0 + 3;

X1 = x0-f/F1;

} while (Fabs (x0-x1) >= 1e-5);

printf ("The root of equation is%5.2f\n", x1);//the root of equation is the root of the equation

return 0;

}

Results:

The root of equation is 2.00

Please press any key to continue ...


This article is from the "Rock Owl" blog, please be sure to keep this source http://yaoyaolx.blog.51cto.com/10732111/1742876

C: Using Newton's Iterative method to find the root of the equation near 1.5:2x^3-4x^2+3x-6=0.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.