unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Math;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  Edit1.Text:='-4.5';
  Edit2.Text:='0.75 * exp(ln(10)*-4)';
  Edit3.Text:='0.845 * exp(ln(10)*-2)';
  Memo1.Clear;
  Memo1.Lines.Add('Лаб. раб. N1. Гр. 020601 Махонь Д.И.');
end;


procedure TForm1.Button1Click(Sender: TObject);
var
  x,y,z, a,b,c,d,v:extended;
begin
  x:=StrToFloat(Edit1.Text);
  Memo1.Lines.Add('X = '+Edit1.Text);
  y:=StrToFloat(Edit2.Text);
  Memo1.Lines.Add('Y = '+Edit2.Text);
  z:=StrToFloat(Edit3.Text);
  Memo1.Lines.Add('Z = '+Edit3.Text);

  a:=(a+sqr(sin(x+y)))*Exp(abs(y)*Ln(x));
  b:=abs( x-(2*y)/(1+sqr(x*y))  );
  if b=0 then Memo1.Lines.Add('Error: Divizion by zero') else
  begin
    c:=a/b;
    d:=sqr(cos(arctan(1/z)));
    v:=c+d;
    Memo1.Lines.Add('Результат V='+FloatToStrF(v,fffixed,8,3));
  end;  
end;



end.
