tcheby Function

public function tcheby(n, x)

Note

Valeur en x du polynôme de Tchebichev de degré n

Site

Arguments

Type IntentOptional Attributes Name
integer(kind=I4), intent(in) :: n

degré du polynôme

real(kind=R8), intent(in) :: x

variable

Return Value real(kind=R8)


Called by

proc~~tcheby~~CalledByGraph proc~tcheby tcheby proc~genere_surf_poly genere_surf_poly proc~genere_surf_poly->proc~tcheby proc~tab_tcheby tab_tcheby proc~tab_tcheby->proc~tcheby proc~least_squares_tcheby least_squares_tcheby proc~least_squares_tcheby->proc~tab_tcheby program~test_tchebychev test_tchebychev program~test_tchebychev->proc~genere_surf_poly program~test_tchebychev->proc~least_squares_tcheby

Source Code

   function tcheby(n, x)
   implicit none
   real(kind=R8) :: tcheby
   integer(kind=I4), intent(in) :: n !! *degré du polynôme*
   real(kind=R8), intent(in)    :: x !! *variable*

      integer(kind=I4) :: k, kk
      real(kind=R8)    :: y, tmp

      if (n==0) then
         tcheby = 1._R8
         return
      endif
      tmp = 0.
      do k = 1, n/2
         y = 1._R8
         do kk = 1, k-1
            y = y*(real((n-k -kk),kind = R8)/kk)
         enddo
         tmp = tmp + y*((-1)**k)*((2*x)**(n -2*k))/k
      enddo
      tcheby = ((2*x)**n)/2 +n*tmp/2.

   return
   endfunction tcheby