(P0 <- poly_orth(0:5, norm = FALSE))
(P1 <- poly_orth_general(Discrete, degree = 5, x = 0:5, norm = FALSE))
sapply(P0-P1, function(x) max(abs(coef(x)))) ## visual check for equality
(P0 <- poly_orth_general(Legendre, 5))
### should be same as P0, up to roundoff
(P1 <- poly_orth_general(Jacobi, 5, alpha = 0, beta = 0))
### check
sapply(P0-P1, function(x) max(abs(coef(x))))
Run the code above in your browser using DataLab