Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <stdexcept>
  3.  
  4. double karimli_func(double init, const double eps, const double x) // функция считает косинус
  5. {
  6. double q = init;
  7. for (int n = 1; fabs(q) >= eps; n++)
  8. {
  9. q *= -x * x / 2 / n / (2 * n - 1);
  10. init += q;
  11. }
  12. return init;
  13. }
  14.  
  15. extern "C" __declspec(dllexport)
  16. double myf_math(double x, double a) // функция считает косинус в кубе
  17. {
  18. return cos(x)*cos(x)*cos(x);
  19. }
  20.  
  21. extern "C" __declspec(dllexport)
  22. double myf_1(double eps, double x, double a) // функция считает косинус в кубе
  23. {
  24. double cos = karimli_func(1, eps, x);
  25. return cos*cos*cos;
  26. }
  27.  
  28. extern "C" __declspec(dllexport) // функция возвращает имя мат функции
  29. const char* FName()
  30. {
  31. return "cos^3(x)";
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement