Procedure ZBRAC(var X1, X2:real; SUCCES:boolean); var NTRY,J:integer; FACTOR,F1,F2:real; begin FACTOR:=1.6; NTRY:=50; If X1 = X2 Then ShowMessage('you have to guess an initial range'); F1:=FUN(X1); F2:=FUN(X2); SUCCES:=True; For J:=1 To NTRY do begin If F1 * F2 < 0 Then Exit; If Abs(F1) < Abs(F2) Then begin X1:=X1 + FACTOR * (X1 - X2); F1:=FUN(X1); end Else begin X2:=X2 + FACTOR * (X2 - X1); F2:=FUN(X2); end; end; SUCCES:=False; end;