Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <stdexcept>
  3. #include <limits>
  4.  
  5. extern "C" __declspec(dllexport)
  6. double myf_math(double a, double x)
  7. {
  8. return 1 / sqrt(1 - x);
  9. }
  10.  
  11. extern "C" __declspec(dllexport)
  12. double myf_1(double eps, double a, double x)
  13. {
  14. if (x >= 1)
  15. return std::numeric_limits<double>::infinity();
  16. double sum = 1, q = 1;
  17. for (int n = 1; fabs(q) >= eps; n++)
  18. {
  19. q *= (2 * n - 1)*x / 2 / n;
  20. sum += q;
  21. }
  22. return sum;
  23. }
  24.  
  25. extern "C" __declspec(dllexport)
  26. const char* FName()
  27. {
  28. return "1/sqrt(1-x)";
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement