procedure sabs(var x1,x2: scalar);
begin { sabs }
  with x1 do begin
    if l.si>=0 then x2:=x1
    else if u.si<=0 then begin
      x2.l:=u;
      x2.l.si:=-u.si;
      x2.u:=l;
      x2.u.si:=-l.si;
    end
    else begin
      x2.l.si:=0;
      l.si:=-l.si;
      if irdiff(u,l)>0 then x2.u:=u else x2.u:=l;
      l.si:=-l.si;
    end;
  end;
end { sabs };

