bug fix to polygamma for order > 1, found by @andreasnoackjensen in #7033