Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- double f(double x)
- {
- return exp(x) + log(x) - 10 * x;
- }
- double F(double x)
- {
- return exp(x) + (1/x) - 10;
- }
- int main()
- {
- double x = 3.5265, eps = 0.0001, h;
- h = f(x) / F(x);
- while (abs(h) >= eps)
- {
- h = f(x)/F(x);
- x = x - h;
- }
- cout << x << endl << F(x);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement