I know this simple formulas:
S=(4/3)*(m(m-ma)(m-mb)(m-mc))^(1/2) , where m=(ma+mb+mc)/2;
a=(2/3)*(2mb^2+2mc^2-ma^2)^(1/2);
Am I wrong?
But my program is wrong

[pascal]Program p10347;
Const Eps = 1e-10;
Var m1,m2,m3,m,a,b,c : Extended;
begin
While Not Eof do begin
Read(m1,m2,m3);
While Eoln do begin
if Eof then Break;
Readln;
end;
m:=(m1+m2+m3)/2;
if 2*m1*m1+2*m2*m2-m3*m3>-Eps then a:=2/3*sqrt(Abs(2*m1*m1+2*m2*m2-m3*m3)) else a:=-1;
if 2*m2*m2+2*m3*m3-m1*m1>-Eps then b:=2/3*sqrt(Abs(2*m2*m2+2*m3*m3-m1*m1)) else b:=-1;
if 2*m3*m3+2*m1*m1-m2*m2>-Eps then c:=2/3*sqrt(Abs(2*m3*m3+2*m1*m1-m2*m2)) else c:=-1;
if (a<-0.5) or (b<-0.5) or (c<-0.5) or
(m1<-Eps) or (m2<-Eps) or (m3<-Eps) or
(a+b<c) or (a+c<b) or (b+c<a) then
Writeln('-1')
else
Writeln(4/3*sqrt(m*(m-m1)*(m-m2)*(m-m3)):0:3);
end;
end.[/pascal]