25 April 2024 11:47:22 AM polynomial_conversion_test ( ): C++ version Test polynomial_conversion(). bernstein_to_legendre01_test ( ): bernstein_to_legendre01() converts a polynomial from Bernstein form to Legendre01 form. P0(X) P1(X) P2(X) P3(X) P4(X) P5(X) P6(X) B0(x) = 1 B1(x) = 0.5 0.5 B2(x) = 0.333333 0.5 0.166667 B3(x) = 0.25 0.45 0.25 0.05 B4(x) = 0.2 0.4 0.285714 0.1 0.0142857 B5(x) = 0.166667 0.357143 0.297619 0.138889 0.0357143 0.00396825 B6(x) = 0.142857 0.321429 0.297619 0.166667 0.0584416 0.0119048 0.00108225 bernstein_to_legendre01_matrix_test ( ): bernstein_to_legendre01_matrix() returns the matrix which converts a polynomial from Bernstein form to Legendre01 form. A: 0.166667 0.166667 0.166667 0.166667 0.166667 0.166667 -0.357143 -0.214286 -0.0714286 0.0714286 0.214286 0.357143 0.297619 -0.0595238 -0.238095 -0.238095 -0.0595238 0.297619 -0.138889 0.194444 0.111111 -0.111111 -0.194444 0.138889 0.0357143 -0.107143 0.0714286 0.0714286 -0.107143 0.0357143 -0.00396825 0.0198413 -0.0396825 0.0396825 -0.0198413 0.00396825 legendre01_to_bernstein_test ( ): legendre01_to_bernstein() converts a polynomial from Legendre01 form to Bernstein form. B0(x) B1(x) B2(x) B3(x) B4(x) B5(x) B6(x) P010(X) = 1 P011(X) = -1 1 P012(X) = 1 -2 1 P013(X) = -1 3 -3 1 P014(X) = 1 -4 6 -4 1 P015(X) = -1 5 -10 10 -5 1 P016(X) = 1 -6 15 -20 15 -6 1 legendre01_to_bernstein_matrix_test ( ): legendre01_to_bernstein_matrix() returns the matrix which converts a polynomial from Legendre01 form to Bernstein form. A: 1 -1 1 -1 1 -1 1 -0.6 -0.2 1.4 -3 5 1 -0.2 -0.8 0.8 2 -10 1 0.2 -0.8 -0.8 2 10 1 0.6 -0.2 -1.4 -3 -5 1 1 1 1 1 1 bernstein_legendre01_bernstein_test ( ): Convert a polynomial from Bernstein form to Legendre01 form and back. L2 difference = 1.51247e-12 bernstein_to_monomial_test ( ): bernstein_to_monomial() converts a polynomial from Bernstein form to monomial form. X^0 X^1 X^2 X^3 X^4 X^5 X^6 B0(x) = 1 B1(x) = -1 1 B2(x) = 1 -2 1 B3(x) = -1 3 -3 1 B4(x) = 1 -4 6 -4 1 B5(x) = -1 5 -10 10 -5 1 B6(x) = 1 -6 15 -20 15 -6 1 bernstein_to_monomial_matrix_test ( ): bernstein_to_monomial_matrix() returns the matrix which converts a polynomial from Bernstein form to monomial form. A: 1 -4 6 -4 1 0 4 -12 12 -4 0 0 6 -12 6 0 0 0 4 -4 0 0 0 0 1 monomial_to_bernstein_test ( ): monomial_to_bernstein() converts a polynomial from monomial form to Bernstein form. B0(x) B1(x) B2(x) B3(x) B4(x) B5(x) B6(x) X^0 = 1 X^1 = 1 1 X^2 = 1 1 1 X^3 = 1 1 1 1 X^4 = 1 1 1 1 1 X^5 = 1 1 1 1 1 1 X^6 = 1 1 1 1 1 1 1 monomial_to_bernstein_matrix_test ( ): monomial_to_bernstein_matrix() returns the matrix which converts a polynomial from monomial form to Bernstein form. A: 1 1 1 1 1 1 0 0.2 0.4 0.6 0.8 1 0 0 0.1 0.3 0.6 1 0 0 0 0.1 0.4 1 0 0 0 0 0.2 1 0 0 0 0 0 1 bernstein_monomial_bernstein_test ( ): Convert a polynomial from Bernstein form to monomial form and back. L2 difference = 2.98039e-13 chebyshev_to_monomial_test ( ): chebyshev_to_monomial() converts a polynomial from Chebyshev form to monomial form. X^0 X^1 X^2 X^3 X^4 X^5 X^6 T0(x) = 1 T1(x) = 0 1 T2(x) = -1 0 2 T3(x) = 0 -3 0 4 T4(x) = 1 0 -8 0 8 T5(x) = 0 5 0 -20 0 16 T6(x) = -1 0 18 0 -48 0 32 monomial_to_chebyshev_test ( ): monomial_to_chebyshev() converts a polynomial from monomial form to Chebyshev form. T0(x) T1(x) T2(x) T3(x) T4(x) T5(x) T6(x) X^0 = 2 X^1 = 0 1 X^2 = 0.5 0 0.5 X^3 = 0 0.75 0 0.25 X^4 = 0.375 0 0.5 0 0.125 X^5 = 0 0.625 0 0.3125 0 0.0625 X^6 = 0.3125 0 0.46875 0 0.1875 0 0.03125 chebyshev_monomial_chebyshev_test ( ): Convert a polynomial from Chebyshev form to monomial form and back. L2 difference = 0 gegenbauer_to_monomial_test ( ): gegenbauer_to_monomial() converts a polynomial from Gegenbauer form to monomial form. Using Gegenbauer parameter alpha = 0.5 X^0 X^1 X^2 X^3 X^4 X^5 X^6 C0(x) = 1 C1(x) = 0 1 C2(x) = -0.5 0 1.5 C3(x) = 0 -1.5 0 2.5 C4(x) = 0.375 0 -3.75 0 4.375 C5(x) = 0 1.875 0 -8.75 0 7.875 C6(x) = -0.3125 0 6.5625 0-19.6875 0 14.4375 gegenbauer_to_monomial_matrix_test ( ): gegenbauer_to_monomial_matrix() returns the matrix which converts a polynomial from Gegenbauer form to monomial form. A (alpha = 0.5): 1 0 -0.5 0 0.375 0 1 0 -1.5 0 0 0 1.5 0 -3.75 0 0 0 2.5 0 0 0 0 0 4.375 monomial_to_gegenbauer_test ( ): monomial_to_gegenbauer() converts a polynomial from monomial form to Gegenbauer form. Using Gegenbauer parameter alpha = 0.5 C0(x) C1(x) C2(x) C3(x) C4(x) C5(x) C6(x) X^0 = 1 X^1 = 0 1 X^2 = 0.333333 0 0.666667 X^3 = 0 0.6 0 0.4 X^4 = 0.2 0 0.571429 0 0.228571 X^5 = 0 0.428571 0 0.444444 0 0.126984 X^6 = 0.142857 0 0.47619 0 0.311688 00.0692641 monomial_to_gegenbauer_matrix_test ( ): monomial_to_gegenbauer_matrix() returns the matrix which converts a polynomial from monomial form to Gegenbauer form. A (alpha = 0.5: 1 0 0.333333 0 0.2 0 1 0 0.6 0 0 0 0.666667 0 0.571429 0 0 0 0.4 0 0 0 0 0 0.228571 gegenbauer_monomial_gegenbauer_test ( ): Convert a polynomial from Gegenbauer form to monomial form and back. L2 difference = 1.82581e-14 hermite_to_monomial_test ( ): hermite_to_monomial() converts a polynomial from Hermite form to monomial form. X^0 X^1 X^2 X^3 X^4 X^5 X^6 H0(x) = 1 H1(x) = 0 2 H2(x) = -2 0 4 H3(x) = 0 -12 0 8 H4(x) = 12 0 -48 0 16 H5(x) = 0 120 0 -160 0 32 H6(x) = -120 0 720 0 -480 0 64 hermite_to_monomial_matrix_test ( ): hermite_to_monomial_matrix() returns the matrix which converts a polynomial from Hermite form to monomial form. A: 1 0 -2 -0 12 0 2 0 -12 -0 0 0 4 0 -48 0 0 0 8 0 0 0 0 0 16 monomial_to_hermite_test ( ): monomial_to_hermite() converts a polynomial from monomial form to Hermite form. H0(x) H1(x) H2(x) H3(x) H4(x) H5(x) H6(x) X^0 = 1 X^1 = 0 0.5 X^2 = 0.5 0 0.25 X^3 = 0 0.75 0 0.125 X^4 = 0.75 0 0.75 0 0.0625 X^5 = 0 1.875 0 0.625 0 0.03125 X^6 = 1.875 0 2.8125 0 0.46875 0 0.015625 monomial_to_hermite_matrix_test ( ): monomial_to_hermite_matrix() returns the matrix which converts a polynomial from monomial form to Hermite form. A: 1 0 0.5 0 0.75 0 0.5 0 0.75 0 0 0 0.25 0 0.75 0 0 0 0.125 0 0 0 0 0 0.0625 hermite_monomial_hermite_test ( ): Convert a polynomial from Hermite form to monomial form and back. L2 difference = 1.84932e-11 laguerre_to_monomial_test ( ): laguerre_to_monomial() converts a polynomial from Laguerre form to monomial form. X^0 X^1 X^2 X^3 X^4 X^5 L0(x) = 1 L1(x) = 1 -1 L2(x) = 1 -2 0.5 L3(x) = 1 -3 1.5 -0.166667 L4(x) = 1 -4 3 -0.666667 0.0416667 L5(x) = 1 -5 5 -1.66667 0.208333 -0.00833333 laguerre_to_monomial_matrix_test ( ): hermite_to_monomial_matrix() returns the matrix which converts a polynomial from Laguerre form to monomial form. A: 1 1 1 1 1 1 0 -1 -2 -3 -4 -5 0 0 0.5 1.5 3 5 0 0 0 -0.166667 -0.666667 -1.66667 0 0 0 0 0.0416667 0.208333 0 0 0 0 0 -0.00833333 monomial_to_laguerre_test ( ): monomial_to_laguerre() converts a polynomial from monomial form to Laguerre form. L0(x) L1(x) L2(x) L3(x) L4(x) L5(x) L6(x) X^0 = 1 X^1 = 1 -1 X^2 = 2 -4 2 X^3 = 6 -18 18 -6 X^4 = 24 -96 144 -96 24 X^5 = 120 -600 1200 -1200 600 -120 X^6 = 720 -4320 10800 -14400 10800 -4320 720 monomial_to_laguerre_matrix_test ( ): monomial_to_laguerre_matrix() returns the matrix which converts a polynomial from monomial form to Laguerre form. A: 1 1 2 6 24 0 -1 -4 -18 -96 0 0 2 18 144 0 0 0 -6 -96 0 0 0 0 24 laguerre_monomial_laguerre_test ( ): Convert a polynomial from Laguerre form to monomial form and back. L2 difference = 5.5219e-13 legendre_to_monomial_test ( ): legendre_to_monomial() converts a polynomial from Legendre form to monomial form. X^0 X^1 X^2 X^3 X^4 X^5 X^6 P0(x) = 1 P1(x) = 0 1 P2(x) = -0.5 0 1.5 P3(x) = 0 -1.5 0 2.5 P4(x) = 0.375 0 -3.75 0 4.375 P5(x) = 0 1.875 0 -8.75 0 7.875 P6(x) = -0.3125 0 6.5625 0-19.6875 0 14.4375 legendre_to_monomial_matrix_test ( ): legendre_to_monomial_matrix() returns the matrix which converts a polynomial from Legendre form to monomial form. A: 1 0 -0.5 -0 0.375 0 1 0 -1.5 -0 0 0 1.5 0 -3.75 0 0 0 2.5 0 0 0 0 0 4.375 monomial_to_legendre_test ( ): monomial_to_legendre() converts a polynomial from monomial form to Legendre form. P0(x) P1(x) P2(x) P3(x) P4(x) P5(x) P6(x) X^0 = 1 X^1 = 0 1 X^2 = 0.333333 00.666667 X^3 = 0 0.6 0 0.4 X^4 = 0.2 00.571429 00.228571 X^5 = 00.428571 00.444444 00.126984 X^6 = 0.142857 0 0.47619 00.311688 00.0692641 monomial_to_legendre_matrix_test ( ): monomial_to_legendre_matrix() returns the matrix which converts a polynomial from monomial form to Legendre form. A: 1 0 0.333333 0 0.2 0 1 0 0.6 0 0 0 0.666667 0 0.571429 0 0 0 0.4 0 0 0 0 0 0.228571 legendre_monomial_legendre_test ( ): Convert a polynomial from Legendre form to monomial form and back. L2 difference = 1.36246e-14 polynomial_conversion_test(): Normal end of execution. 25 April 2024 11:47:22 AM