Subroutine to differentiate polynomial (in place)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=pfqp), | intent(inout) | :: | p(0:n) | |||
integer, | intent(in), | value | :: | n |
subroutine poly_diff(p, n)
integer, intent(in), value :: n
real(pfqp), intent(inout) :: p(0:n)
integer :: j
real(pfdp) :: pp(0:n)
pp = 0.0_pfqp
do j = 1, n
pp(j-1) = j * p(j)
end do
p = pp
end subroutine poly_diff