def dup_laguerre(n, alpha, K):
 seq = [[K.zero], [K.one]]
 for i in range(1, (n + 1)):
  a = dup_mul(seq[(-1)], [((- K.one) / i), ((alpha / i) + (K(((2 * i) - 1)) / i))], K)
  b = dup_mul_ground(seq[(-2)], ((alpha / i) + (K((i - 1)) / i)), K)
  seq.append(dup_sub(a, b, K))
 return seq[(-1)]

def dup_laguerre ( n , alpha , K ) : seq = [ [ K . zero ] , [ K . one ] ] for i in range ( 1 , ( n + 1 ) ) : a = dup_mul ( seq [ ( - 1 ) ] , [ ( ( - K . one ) / i ) , ( ( alpha / i ) + ( K ( ( ( 2 * i ) - 1 ) ) / i ) ) ] , K ) b = dup_mul_ground ( seq [ ( - 2 ) ] , ( ( alpha / i ) + ( K ( ( i - 1 ) ) / i ) ) , K ) seq . append ( dup_sub ( a , b , K ) ) return seq [ ( - 1 ) ]
low-level implementation of laguerre polynomials .