Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double f(double x, double e) {
- double last_val = -1, current_val = x / 2;
- double sum = current_val;
- int k = 1;
- do {
- last_val = current_val;
- current_val *= x * k / (k + 2);
- sum += current_val;
- k++;
- } while (abs(current_val - last_val) >= e);
- return 1 - sum;
- }
- double F(double x) {
- return ((1 - x) / x) * log(1 / (1 - x));
- }
- double delta(double f, double F) {
- return abs(f * f - F * F);
- }
Advertisement
Add Comment
Please, Sign In to add comment