function gauss_table(x) parameter (n = 2000) ! Reproduces exp(-x*x) to within 1% over [-4,+4] parameter (s = 0.002) parameter (m = 2*n+1) real table(-n:n) /m*0.0/ save table xx = x/s if ( abs(xx) .gt. n ) then gauss_table = 0.0 else gauss_table = table(nint(xx)) end if return entry gauss_init() if (table(0) .eq. 0.0) then do i=-n,n xx = float(i)*s table(i) = exp(-xx*xx) end do end if gauss_init = 1 return end