program laba2
 real, parameter:: x1=-0.2, x2=0.2, dx=0.05
 real, parameter:: n=(x2-x1)/(dx)+1 
 real, dimension(n):: x, fx
 do i=1, n 
  x(i)=x1+dx*(i-1)
  if (x(i)>0) then 
   a=1+sin(x(i))
   g=1+0.3*(x(i)**2)
  else 
   a=cos(x(i))
   g=1-0.3*(x(i)**2)
  end if 
 fx(i)=a*(exp(x(i))) + log(abs(x(i)+0.1)))+g*(a**2+1)*sin(x(i))
 print*, x(i), fx(i)
 end do
end program laba2