PROGRAM simplelimite
! Author: J-B Madeleine, based on a class by J. Chang (NASA Ames)
! Estimate limit as X approaches infinity; notice:
!   - the effect of forgetting the IMPLICIT NONE
!   - the difference in two writings of the same equation
!   - the difference between SINGLE and DOUBLE precision
!IMPLICIT NONE
INTEGER :: i
!REAL :: x, y1, y2
!DOUBLE PRECISION :: x, y1, y2

x = 1.0d0
!do i = 1,30
do i = 1,10
  y1 = sqrt(x*x + 3.0d0*x) - sqrt(x*x + 2.d0*x)
!  y2 = 1 / (sqrt(1.d0 + 3.0d0/x) + sqrt(1.d0 + 2.d0/x) )
!  print *, 'x,y1,y2 = ',x,y1,y2
!  print *, 'x,y1 = ',x,y1
  x = x*10.0d0
enddo
print *, 'x,y1 = ',x,y1
END
