Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses math;
- const
- x0 = 0;
- y0 = 1;
- b = 1;
- h = 0.0001;
- function f(x, y : real) : real;
- begin
- f := x*y;
- end;
- function Y_(x : real) : real;
- begin
- Y_ := exp(x*x/2);
- end;
- var
- i, n : integer;
- x, y : real;
- begin
- n := trunc((b - x0) / h);
- x := x0;
- y := y0;
- for i := 1 to n do begin
- y += f(x, y) * h;
- x := x0 + i*h;
- end;
- writeln(abs(Y_(b) - y):0:6);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement