title: How to obtain a taylor series of sine in Fortran
body: <p>My goal is to find a Maclaurin series of sine, where the program return 3 things: the expansion of an angle in degrees provided by the user with the precision of 10^⁻15, the first term discard to get that precision and the sine calculated from the function sine(x). Here is my program:</p>
  
  <pre><code>          program serie de taylor seno
               implicit none 
               integer*8  N, i, j
               real*8  serie, x, xrad
               real*8 xtest, pi, senx, func, ten, fat
               write(*,*)"Choose en angle in degrees"
               read(5,*) x
               fat = 1.d0
               ten = 10**(-15)
               senx = 0.d0
               pi= datan2(0.d0,-1.d0)
               xrad = (x*pi)/180.d0
               xtest = (x*pi)/180.d0
               func =dsin(xtest)
               i = 0
               do while (serie .ge. ten)
                     do j = 1, 2*i +1
                        fat = fat*j
                     end do
                     N = (2*i)+1
                     serie = (((-1)**i)*(xrad**N))/fat
                     senx = senx + serie
                     i = i + 1
                     fat = 1
               end do
               write(*,*)senx
               write (*,*) i
               write(*,*)func
            end program serie de taylor seno
  </code></pre>
  
  <p>My problem is that the loop of do while only runs twice for any angle. What did I do wrong?</p>