Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program p421_15;
- type
- mas=array[1..100] of real;
- func=function(x:real):real;
- func2=function(x:real):real;
- var
- a, b, a2,b2, c, eps:real;
- function f(x:real):real;
- begin //свою формулу вписать
- 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);
- end;
- function ff(x:real):real;
- begin //свою формулу вписать
- ff:=power(x, 1.0/3) - abs(14*sin((x + 2.0/3)/(x + Pi))) + exp(1.9*x) + x*sqrt(x);
- end;
- procedure found(var a,b,c:real; eps:real; f:func);
- var
- fa,fc:real;
- begin
- repeat
- c := (a + b)/2;
- fa := f(a);
- fc := f(c);
- if(fa * fc > 0) then
- a := c
- else
- b := c;
- until ((b-a) < eps);
- end;
- begin
- writeln('vvedite granici poiska a, b ');
- readln(a, b);
- a2:=a;
- b2:=b;
- writeln('vvedite pogreshnoct e = ');
- readln(eps);
- found(a,b,c,eps,f);
- writeln('na zadannom intervale 0 funkcii v = ', c);
- writeln('znachenie funkcii v ', c,' = ', f(c));
- found(a2,b2,c,eps,ff);
- writeln('na zadannom intervale 0 funkcii 2 v = ', c);
- writeln('znachenie funkcii v ', c,' = ', ff(c));
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement