4. Use two-year hair, iterative method, Newton 's method.

xiaoxiao2021-03-06  41

Solution between (-10, 10) between (-10, 10)

2x3-4x2 3x-6 = 0

#include {float x0, x1, x2, fx0, fx1, fx2; do {printf ("Enter x1 & x2"); scanf ("% f,% f" & x1, & x2); fx1 = x1 * ( (2 * x1-4) * x1 3) -6; fx2 = x2 * ((2 * x2-4) * x2 3) -6;} while (fx1 * fx2> 0) DO {

X0 = (x1 x2) / 2; fx0 = x0 * ((2 * x0-4) * x0 3) -6; if ((fx0 * fx1) <0) {x2 = x0; fx2 = fx0;} Else {x1 = x0; fx1 = fx0;

}}} While (FABS (FX0)> = 1e-5); Printf ("% f", X0);

}

转载请注明原文地址:https://www.9cbs.com/read-73569.html

New Post(0)