module pa7_tools contains real function my_cos(x) implicit none real, intent(in)::x real::x2,x4,x6 x2=x**2 my_cos = 1.+x2*(-1./2.+x2*(1./24.+& x2*(-1./720.+x2*(1./40320.-x2*(1./3628800.))))) return end function my_cos end module pa7_tools program pa7 use pa7_tools real::x=3.14159265/4. write(*,*)"cos(",x,")=" write(*,*)my_cos(x) stop end program pa7