Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I4), | intent(in) | :: | n |
degré du polynôme |
||
real(kind=R8), | intent(in) | :: | x |
variable |
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