Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication8
- {
- class Program
- {
- static void Main()
- {
- double Fx = 0, fx = 0, X_prev = 0, epsilone_requested = 0.02D, epsilone = 0, X = 0.5D;
- do
- {
- X_prev = X;
- Fx = Math.Cos(X) - Math.Pow(X, 3);
- fx = -Math.Sin(X) - 3 * Math.Pow(X, 2);
- X -= Fx / fx;
- epsilone = Math.Abs(X - X_prev);
- Console.WriteLine("X = {0}\nEpsilone = {1}\n", X, epsilone);
- }
- while (epsilone > epsilone_requested);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement