Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. program p421_15;
  2. type
  3. mas=array[1..100] of real;
  4. func=function(x:real):real;
  5. func2=function(x:real):real;
  6. var
  7. a, b, a2,b2, c, eps:real;
  8. function f(x:real):real;
  9. begin //свою формулу вписать
  10. f:=1.0/(x*sqrt(x)) - exp(ln((x/5)*(x/5))*(1.0/3))*ln(abs(0.2 + sin(x)))*ln(abs(0.2 + sin(x))) - (3*Pi/4);
  11. end;
  12. function ff(x:real):real;
  13. begin //свою формулу вписать
  14. ff:=power(x, 1.0/3) - abs(14*sin((x + 2.0/3)/(x + Pi))) + exp(1.9*x) + x*sqrt(x);
  15. end;
  16. procedure found(var a,b,c:real; eps:real; f:func);
  17. var
  18. fa,fc:real;
  19. begin
  20. repeat
  21. c := (a + b)/2;
  22. fa := f(a);
  23. fc := f(c);
  24. if(fa * fc > 0) then
  25. a := c
  26. else
  27. b := c;
  28. until ((b-a) < eps);
  29. end;
  30. begin
  31. writeln('vvedite granici poiska a, b ');
  32. readln(a, b);
  33. a2:=a;
  34. b2:=b;
  35. writeln('vvedite pogreshnoct e = ');
  36. readln(eps);
  37. found(a,b,c,eps,f);
  38. writeln('na zadannom intervale 0 funkcii v = ', c);
  39. writeln('znachenie funkcii v ', c,' = ', f(c));
  40. found(a2,b2,c,eps,ff);
  41. writeln('na zadannom intervale 0 funkcii 2 v = ', c);
  42. writeln('znachenie funkcii v ', c,' = ', ff(c));
  43. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement