Guest User

Untitled

a guest
Jan 13th, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. while(abs(x1-x2)>epsilon){
  2. std::cout.setf(std::ios::fixed, std::ios::floatfield );
  3. std::cout.precision(20);
  4. y1=x1*(x1*x1-1)*sin(x1)*sin(x1);
  5. y2=x2*(x2*x2-1)*sin(x2)*sin(x2);
  6. x0=x1-(y1*(x1-x2)/(y1-y2));
  7. x2=x1;
  8. x1=x0;
  9. y0=(x0*x0*x0-x0)*sin(x0)*sin(x0);
  10. y2=y1;
  11. y1=y0;
  12. j++;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment