05-Jun-2023 22:11:23 least_squares_approximant_test(): MATLAB/Octave version 5.2.0 Test least_squares_approximant(). least_squares_approximant_test01(): Approximate data from test_interp() problem #1 using a least squares polynomial of degree 1 Number of data points = 18 Data array: 0 4 1 5 2 6 4 6 5 5 6 3 7 1 8 1 9 1 10 3 11 4 12 4 13 3 14 3 15 4 16 4 17 3 18 0 Averaged L2 approximation error at data nodes = 0.350074 Normalized length of piecewise linear interpolant = 3.13553 Normalized length of least squares approximant = 1.08357 Graphics saved as "p01_data.png". Graphics saved as "p01_d01.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #1 using a least squares polynomial of degree 2 Number of data points = 18 Data array: 0 4 1 5 2 6 4 6 5 5 6 3 7 1 8 1 9 1 10 3 11 4 12 4 13 3 14 3 15 4 16 4 17 3 18 0 Averaged L2 approximation error at data nodes = 0.344057 Normalized length of piecewise linear interpolant = 3.13553 Normalized length of least squares approximant = 1.12211 Graphics saved as "p01_data.png". Graphics saved as "p01_d02.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #1 using a least squares polynomial of degree 3 Number of data points = 18 Data array: 0 4 1 5 2 6 4 6 5 5 6 3 7 1 8 1 9 1 10 3 11 4 12 4 13 3 14 3 15 4 16 4 17 3 18 0 Averaged L2 approximation error at data nodes = 0.332868 Normalized length of piecewise linear interpolant = 3.13553 Normalized length of least squares approximant = 1.31026 Graphics saved as "p01_data.png". Graphics saved as "p01_d03.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #1 using a least squares polynomial of degree 4 Number of data points = 18 Data array: 0 4 1 5 2 6 4 6 5 5 6 3 7 1 8 1 9 1 10 3 11 4 12 4 13 3 14 3 15 4 16 4 17 3 18 0 Averaged L2 approximation error at data nodes = 0.199123 Normalized length of piecewise linear interpolant = 3.13553 Normalized length of least squares approximant = 2.51647 Graphics saved as "p01_data.png". Graphics saved as "p01_d04.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #1 using a least squares polynomial of degree 5 Number of data points = 18 Data array: 0 4 1 5 2 6 4 6 5 5 6 3 7 1 8 1 9 1 10 3 11 4 12 4 13 3 14 3 15 4 16 4 17 3 18 0 Averaged L2 approximation error at data nodes = 0.190907 Normalized length of piecewise linear interpolant = 3.13553 Normalized length of least squares approximant = 2.60932 Graphics saved as "p01_data.png". Graphics saved as "p01_d05.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #1 using a least squares polynomial of degree 6 Number of data points = 18 Data array: 0 4 1 5 2 6 4 6 5 5 6 3 7 1 8 1 9 1 10 3 11 4 12 4 13 3 14 3 15 4 16 4 17 3 18 0 Averaged L2 approximation error at data nodes = 0.189739 Normalized length of piecewise linear interpolant = 3.13553 Normalized length of least squares approximant = 2.59548 Graphics saved as "p01_data.png". Graphics saved as "p01_d06.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #2 using a least squares polynomial of degree 1 Number of data points = 18 Data array: 0.00000 0.00000 1.34000 5.00000 5.00000 8.66000 10.00000 10.00000 10.60000 10.40000 10.70000 12.00000 10.70500 28.60000 10.80000 30.20000 11.40000 30.60000 19.60000 30.60000 20.20000 30.20000 20.29500 28.60000 20.30000 12.00000 20.40000 10.40000 21.00000 10.00000 26.00000 8.66000 29.66000 5.00000 31.00000 0.00000 Averaged L2 approximation error at data nodes = 2.58162 Normalized length of piecewise linear interpolant = 2.66086 Normalized length of least squares approximant = 1 Graphics saved as "p02_data.png". Graphics saved as "p02_d01.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #2 using a least squares polynomial of degree 2 Number of data points = 18 Data array: 0.00000 0.00000 1.34000 5.00000 5.00000 8.66000 10.00000 10.00000 10.60000 10.40000 10.70000 12.00000 10.70500 28.60000 10.80000 30.20000 11.40000 30.60000 19.60000 30.60000 20.20000 30.20000 20.29500 28.60000 20.30000 12.00000 20.40000 10.40000 21.00000 10.00000 26.00000 8.66000 29.66000 5.00000 31.00000 0.00000 Averaged L2 approximation error at data nodes = 1.80946 Normalized length of piecewise linear interpolant = 2.66086 Normalized length of least squares approximant = 1.88131 Graphics saved as "p02_data.png". Graphics saved as "p02_d02.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #2 using a least squares polynomial of degree 3 Number of data points = 18 Data array: 0.00000 0.00000 1.34000 5.00000 5.00000 8.66000 10.00000 10.00000 10.60000 10.40000 10.70000 12.00000 10.70500 28.60000 10.80000 30.20000 11.40000 30.60000 19.60000 30.60000 20.20000 30.20000 20.29500 28.60000 20.30000 12.00000 20.40000 10.40000 21.00000 10.00000 26.00000 8.66000 29.66000 5.00000 31.00000 0.00000 Averaged L2 approximation error at data nodes = 1.80946 Normalized length of piecewise linear interpolant = 2.66086 Normalized length of least squares approximant = 1.88131 Graphics saved as "p02_data.png". Graphics saved as "p02_d03.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #2 using a least squares polynomial of degree 4 Number of data points = 18 Data array: 0.00000 0.00000 1.34000 5.00000 5.00000 8.66000 10.00000 10.00000 10.60000 10.40000 10.70000 12.00000 10.70500 28.60000 10.80000 30.20000 11.40000 30.60000 19.60000 30.60000 20.20000 30.20000 20.29500 28.60000 20.30000 12.00000 20.40000 10.40000 21.00000 10.00000 26.00000 8.66000 29.66000 5.00000 31.00000 0.00000 Averaged L2 approximation error at data nodes = 1.76341 Normalized length of piecewise linear interpolant = 2.66086 Normalized length of least squares approximant = 1.90124 Graphics saved as "p02_data.png". Graphics saved as "p02_d04.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #2 using a least squares polynomial of degree 5 Number of data points = 18 Data array: 0.00000 0.00000 1.34000 5.00000 5.00000 8.66000 10.00000 10.00000 10.60000 10.40000 10.70000 12.00000 10.70500 28.60000 10.80000 30.20000 11.40000 30.60000 19.60000 30.60000 20.20000 30.20000 20.29500 28.60000 20.30000 12.00000 20.40000 10.40000 21.00000 10.00000 26.00000 8.66000 29.66000 5.00000 31.00000 0.00000 Averaged L2 approximation error at data nodes = 1.76341 Normalized length of piecewise linear interpolant = 2.66086 Normalized length of least squares approximant = 1.90124 Graphics saved as "p02_data.png". Graphics saved as "p02_d05.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #2 using a least squares polynomial of degree 6 Number of data points = 18 Data array: 0.00000 0.00000 1.34000 5.00000 5.00000 8.66000 10.00000 10.00000 10.60000 10.40000 10.70000 12.00000 10.70500 28.60000 10.80000 30.20000 11.40000 30.60000 19.60000 30.60000 20.20000 30.20000 20.29500 28.60000 20.30000 12.00000 20.40000 10.40000 21.00000 10.00000 26.00000 8.66000 29.66000 5.00000 31.00000 0.00000 Averaged L2 approximation error at data nodes = 1.63488 Normalized length of piecewise linear interpolant = 2.66086 Normalized length of least squares approximant = 3.36199 Graphics saved as "p02_data.png". Graphics saved as "p02_d06.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #3 using a least squares polynomial of degree 1 Number of data points = 11 Data array: 0.00000 0.00000 2.00000 10.00000 3.00000 10.00000 5.00000 10.00000 6.00000 10.00000 8.00000 10.00000 9.00000 10.50000 11.00000 15.00000 12.00000 50.00000 14.00000 60.00000 15.00000 85.00000 Averaged L2 approximation error at data nodes = 4.4679 Normalized length of piecewise linear interpolant = 1.68472 Normalized length of least squares approximant = 1.28026 Graphics saved as "p03_data.png". Graphics saved as "p03_d01.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #3 using a least squares polynomial of degree 2 Number of data points = 11 Data array: 0.00000 0.00000 2.00000 10.00000 3.00000 10.00000 5.00000 10.00000 6.00000 10.00000 8.00000 10.00000 9.00000 10.50000 11.00000 15.00000 12.00000 50.00000 14.00000 60.00000 15.00000 85.00000 Averaged L2 approximation error at data nodes = 2.59431 Normalized length of piecewise linear interpolant = 1.68472 Normalized length of least squares approximant = 1.48631 Graphics saved as "p03_data.png". Graphics saved as "p03_d02.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #3 using a least squares polynomial of degree 3 Number of data points = 11 Data array: 0.00000 0.00000 2.00000 10.00000 3.00000 10.00000 5.00000 10.00000 6.00000 10.00000 8.00000 10.00000 9.00000 10.50000 11.00000 15.00000 12.00000 50.00000 14.00000 60.00000 15.00000 85.00000 Averaged L2 approximation error at data nodes = 1.74627 Normalized length of piecewise linear interpolant = 1.68472 Normalized length of least squares approximant = 1.58943 Graphics saved as "p03_data.png". Graphics saved as "p03_d03.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #3 using a least squares polynomial of degree 4 Number of data points = 11 Data array: 0.00000 0.00000 2.00000 10.00000 3.00000 10.00000 5.00000 10.00000 6.00000 10.00000 8.00000 10.00000 9.00000 10.50000 11.00000 15.00000 12.00000 50.00000 14.00000 60.00000 15.00000 85.00000 Averaged L2 approximation error at data nodes = 1.68297 Normalized length of piecewise linear interpolant = 1.68472 Normalized length of least squares approximant = 1.61226 Graphics saved as "p03_data.png". Graphics saved as "p03_d04.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #3 using a least squares polynomial of degree 5 Number of data points = 11 Data array: 0.00000 0.00000 2.00000 10.00000 3.00000 10.00000 5.00000 10.00000 6.00000 10.00000 8.00000 10.00000 9.00000 10.50000 11.00000 15.00000 12.00000 50.00000 14.00000 60.00000 15.00000 85.00000 Averaged L2 approximation error at data nodes = 1.66663 Normalized length of piecewise linear interpolant = 1.68472 Normalized length of least squares approximant = 1.59507 Graphics saved as "p03_data.png". Graphics saved as "p03_d05.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #3 using a least squares polynomial of degree 6 Number of data points = 11 Data array: 0.00000 0.00000 2.00000 10.00000 3.00000 10.00000 5.00000 10.00000 6.00000 10.00000 8.00000 10.00000 9.00000 10.50000 11.00000 15.00000 12.00000 50.00000 14.00000 60.00000 15.00000 85.00000 Averaged L2 approximation error at data nodes = 1.64323 Normalized length of piecewise linear interpolant = 1.68472 Normalized length of least squares approximant = 1.62067 Graphics saved as "p03_data.png". Graphics saved as "p03_d06.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #4 using a least squares polynomial of degree 1 Number of data points = 8 Data array: 0.00000 0.00000 0.05000 0.70000 0.10000 1.00000 0.20000 1.00000 0.80000 0.30000 0.85000 0.05000 0.90000 0.10000 1.00000 1.00000 Averaged L2 approximation error at data nodes = 0.146011 Normalized length of piecewise linear interpolant = 3.25908 Normalized length of least squares approximant = 1.02803 Graphics saved as "p04_data.png". Graphics saved as "p04_d01.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #4 using a least squares polynomial of degree 2 Number of data points = 8 Data array: 0.00000 0.00000 0.05000 0.70000 0.10000 1.00000 0.20000 1.00000 0.80000 0.30000 0.85000 0.05000 0.90000 0.10000 1.00000 1.00000 Averaged L2 approximation error at data nodes = 0.14598 Normalized length of piecewise linear interpolant = 3.25908 Normalized length of least squares approximant = 1.03194 Graphics saved as "p04_data.png". Graphics saved as "p04_d02.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #4 using a least squares polynomial of degree 3 Number of data points = 8 Data array: 0.00000 0.00000 0.05000 0.70000 0.10000 1.00000 0.20000 1.00000 0.80000 0.30000 0.85000 0.05000 0.90000 0.10000 1.00000 1.00000 Averaged L2 approximation error at data nodes = 0.0559589 Normalized length of piecewise linear interpolant = 3.25908 Normalized length of least squares approximant = 3.3304 Graphics saved as "p04_data.png". Graphics saved as "p04_d03.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #4 using a least squares polynomial of degree 4 Number of data points = 8 Data array: 0.00000 0.00000 0.05000 0.70000 0.10000 1.00000 0.20000 1.00000 0.80000 0.30000 0.85000 0.05000 0.90000 0.10000 1.00000 1.00000 Averaged L2 approximation error at data nodes = 0.0559577 Normalized length of piecewise linear interpolant = 3.25908 Normalized length of least squares approximant = 3.32957 Graphics saved as "p04_data.png". Graphics saved as "p04_d04.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #4 using a least squares polynomial of degree 5 Number of data points = 8 Data array: 0.00000 0.00000 0.05000 0.70000 0.10000 1.00000 0.20000 1.00000 0.80000 0.30000 0.85000 0.05000 0.90000 0.10000 1.00000 1.00000 Averaged L2 approximation error at data nodes = 0.00829484 Normalized length of piecewise linear interpolant = 3.25908 Normalized length of least squares approximant = 3.58478 Graphics saved as "p04_data.png". Graphics saved as "p04_d05.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #4 using a least squares polynomial of degree 6 Number of data points = 8 Data array: 0.00000 0.00000 0.05000 0.70000 0.10000 1.00000 0.20000 1.00000 0.80000 0.30000 0.85000 0.05000 0.90000 0.10000 1.00000 1.00000 Averaged L2 approximation error at data nodes = 0.0065995 Normalized length of piecewise linear interpolant = 3.25908 Normalized length of least squares approximant = 4.43914 Graphics saved as "p04_data.png". Graphics saved as "p04_d06.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #5 using a least squares polynomial of degree 1 Number of data points = 9 Data array: 0.00000 0.00000 0.10000 0.90000 0.20000 0.95000 0.30000 0.90000 0.40000 0.10000 0.50000 0.05000 0.60000 0.05000 0.80000 0.20000 1.00000 1.00000 Averaged L2 approximation error at data nodes = 0.143322 Normalized length of piecewise linear interpolant = 3.2218 Normalized length of least squares approximant = 1.00003 Graphics saved as "p05_data.png". Graphics saved as "p05_d01.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #5 using a least squares polynomial of degree 2 Number of data points = 9 Data array: 0.00000 0.00000 0.10000 0.90000 0.20000 0.95000 0.30000 0.90000 0.40000 0.10000 0.50000 0.05000 0.60000 0.05000 0.80000 0.20000 1.00000 1.00000 Averaged L2 approximation error at data nodes = 0.13517 Normalized length of piecewise linear interpolant = 3.2218 Normalized length of least squares approximant = 1.31038 Graphics saved as "p05_data.png". Graphics saved as "p05_d02.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #5 using a least squares polynomial of degree 3 Number of data points = 9 Data array: 0.00000 0.00000 0.10000 0.90000 0.20000 0.95000 0.30000 0.90000 0.40000 0.10000 0.50000 0.05000 0.60000 0.05000 0.80000 0.20000 1.00000 1.00000 Averaged L2 approximation error at data nodes = 0.0717904 Normalized length of piecewise linear interpolant = 3.2218 Normalized length of least squares approximant = 3.05546 Graphics saved as "p05_data.png". Graphics saved as "p05_d03.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #5 using a least squares polynomial of degree 4 Number of data points = 9 Data array: 0.00000 0.00000 0.10000 0.90000 0.20000 0.95000 0.30000 0.90000 0.40000 0.10000 0.50000 0.05000 0.60000 0.05000 0.80000 0.20000 1.00000 1.00000 Averaged L2 approximation error at data nodes = 0.0391096 Normalized length of piecewise linear interpolant = 3.2218 Normalized length of least squares approximant = 3.42544 Graphics saved as "p05_data.png". Graphics saved as "p05_d04.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #5 using a least squares polynomial of degree 5 Number of data points = 9 Data array: 0.00000 0.00000 0.10000 0.90000 0.20000 0.95000 0.30000 0.90000 0.40000 0.10000 0.50000 0.05000 0.60000 0.05000 0.80000 0.20000 1.00000 1.00000 Averaged L2 approximation error at data nodes = 0.03589 Normalized length of piecewise linear interpolant = 3.2218 Normalized length of least squares approximant = 3.41454 Graphics saved as "p05_data.png". Graphics saved as "p05_d05.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #5 using a least squares polynomial of degree 6 Number of data points = 9 Data array: 0.00000 0.00000 0.10000 0.90000 0.20000 0.95000 0.30000 0.90000 0.40000 0.10000 0.50000 0.05000 0.60000 0.05000 0.80000 0.20000 1.00000 1.00000 Averaged L2 approximation error at data nodes = 0.0297341 Normalized length of piecewise linear interpolant = 3.2218 Normalized length of least squares approximant = 3.79663 Graphics saved as "p05_data.png". Graphics saved as "p05_d06.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #6 using a least squares polynomial of degree 1 Number of data points = 49 Data array: 595.00000 0.64400 605.00000 0.62200 615.00000 0.63800 625.00000 0.64900 635.00000 0.65200 645.00000 0.63900 655.00000 0.64600 665.00000 0.65700 675.00000 0.65200 685.00000 0.65500 695.00000 0.64400 705.00000 0.66300 715.00000 0.66300 725.00000 0.66800 735.00000 0.67600 745.00000 0.67600 755.00000 0.68600 765.00000 0.67900 775.00000 0.67800 785.00000 0.68300 795.00000 0.69400 805.00000 0.69900 815.00000 0.71000 825.00000 0.73000 835.00000 0.76300 845.00000 0.81200 855.00000 0.90700 865.00000 1.04400 875.00000 1.33600 885.00000 1.88100 895.00000 2.16900 905.00000 2.07500 915.00000 1.59800 925.00000 1.21100 935.00000 0.91600 945.00000 0.74600 955.00000 0.67200 965.00000 0.62700 975.00000 0.61500 985.00000 0.60700 995.00000 0.60600 1005.00000 0.60900 1015.00000 0.60300 1025.00000 0.60100 1035.00000 0.60300 1045.00000 0.60100 1055.00000 0.61100 1065.00000 0.60100 1075.00000 0.60800 Averaged L2 approximation error at data nodes = 0.0525121 Normalized length of piecewise linear interpolant = 2.68209 Normalized length of least squares approximant = 1.0062 Graphics saved as "p06_data.png". Graphics saved as "p06_d01.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #6 using a least squares polynomial of degree 2 Number of data points = 49 Data array: 595.00000 0.64400 605.00000 0.62200 615.00000 0.63800 625.00000 0.64900 635.00000 0.65200 645.00000 0.63900 655.00000 0.64600 665.00000 0.65700 675.00000 0.65200 685.00000 0.65500 695.00000 0.64400 705.00000 0.66300 715.00000 0.66300 725.00000 0.66800 735.00000 0.67600 745.00000 0.67600 755.00000 0.68600 765.00000 0.67900 775.00000 0.67800 785.00000 0.68300 795.00000 0.69400 805.00000 0.69900 815.00000 0.71000 825.00000 0.73000 835.00000 0.76300 845.00000 0.81200 855.00000 0.90700 865.00000 1.04400 875.00000 1.33600 885.00000 1.88100 895.00000 2.16900 905.00000 2.07500 915.00000 1.59800 925.00000 1.21100 935.00000 0.91600 945.00000 0.74600 955.00000 0.67200 965.00000 0.62700 975.00000 0.61500 985.00000 0.60700 995.00000 0.60600 1005.00000 0.60900 1015.00000 0.60300 1025.00000 0.60100 1035.00000 0.60300 1045.00000 0.60100 1055.00000 0.61100 1065.00000 0.60100 1075.00000 0.60800 Averaged L2 approximation error at data nodes = 0.0473605 Normalized length of piecewise linear interpolant = 2.68209 Normalized length of least squares approximant = 1.2402 Graphics saved as "p06_data.png". Graphics saved as "p06_d02.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #6 using a least squares polynomial of degree 3 Number of data points = 49 Data array: 595.00000 0.64400 605.00000 0.62200 615.00000 0.63800 625.00000 0.64900 635.00000 0.65200 645.00000 0.63900 655.00000 0.64600 665.00000 0.65700 675.00000 0.65200 685.00000 0.65500 695.00000 0.64400 705.00000 0.66300 715.00000 0.66300 725.00000 0.66800 735.00000 0.67600 745.00000 0.67600 755.00000 0.68600 765.00000 0.67900 775.00000 0.67800 785.00000 0.68300 795.00000 0.69400 805.00000 0.69900 815.00000 0.71000 825.00000 0.73000 835.00000 0.76300 845.00000 0.81200 855.00000 0.90700 865.00000 1.04400 875.00000 1.33600 885.00000 1.88100 895.00000 2.16900 905.00000 2.07500 915.00000 1.59800 925.00000 1.21100 935.00000 0.91600 945.00000 0.74600 955.00000 0.67200 965.00000 0.62700 975.00000 0.61500 985.00000 0.60700 995.00000 0.60600 1005.00000 0.60900 1015.00000 0.60300 1025.00000 0.60100 1035.00000 0.60300 1045.00000 0.60100 1055.00000 0.61100 1065.00000 0.60100 1075.00000 0.60800 Averaged L2 approximation error at data nodes = 0.0437687 Normalized length of piecewise linear interpolant = 2.68209 Normalized length of least squares approximant = 1.43902 Graphics saved as "p06_data.png". Graphics saved as "p06_d03.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #6 using a least squares polynomial of degree 4 Number of data points = 49 Data array: 595.00000 0.64400 605.00000 0.62200 615.00000 0.63800 625.00000 0.64900 635.00000 0.65200 645.00000 0.63900 655.00000 0.64600 665.00000 0.65700 675.00000 0.65200 685.00000 0.65500 695.00000 0.64400 705.00000 0.66300 715.00000 0.66300 725.00000 0.66800 735.00000 0.67600 745.00000 0.67600 755.00000 0.68600 765.00000 0.67900 775.00000 0.67800 785.00000 0.68300 795.00000 0.69400 805.00000 0.69900 815.00000 0.71000 825.00000 0.73000 835.00000 0.76300 845.00000 0.81200 855.00000 0.90700 865.00000 1.04400 875.00000 1.33600 885.00000 1.88100 895.00000 2.16900 905.00000 2.07500 915.00000 1.59800 925.00000 1.21100 935.00000 0.91600 945.00000 0.74600 955.00000 0.67200 965.00000 0.62700 975.00000 0.61500 985.00000 0.60700 995.00000 0.60600 1005.00000 0.60900 1015.00000 0.60300 1025.00000 0.60100 1035.00000 0.60300 1045.00000 0.60100 1055.00000 0.61100 1065.00000 0.60100 1075.00000 0.60800 Averaged L2 approximation error at data nodes = 0.0424429 Normalized length of piecewise linear interpolant = 2.68209 Normalized length of least squares approximant = 1.51609 Graphics saved as "p06_data.png". Graphics saved as "p06_d04.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #6 using a least squares polynomial of degree 5 Number of data points = 49 Data array: 595.00000 0.64400 605.00000 0.62200 615.00000 0.63800 625.00000 0.64900 635.00000 0.65200 645.00000 0.63900 655.00000 0.64600 665.00000 0.65700 675.00000 0.65200 685.00000 0.65500 695.00000 0.64400 705.00000 0.66300 715.00000 0.66300 725.00000 0.66800 735.00000 0.67600 745.00000 0.67600 755.00000 0.68600 765.00000 0.67900 775.00000 0.67800 785.00000 0.68300 795.00000 0.69400 805.00000 0.69900 815.00000 0.71000 825.00000 0.73000 835.00000 0.76300 845.00000 0.81200 855.00000 0.90700 865.00000 1.04400 875.00000 1.33600 885.00000 1.88100 895.00000 2.16900 905.00000 2.07500 915.00000 1.59800 925.00000 1.21100 935.00000 0.91600 945.00000 0.74600 955.00000 0.67200 965.00000 0.62700 975.00000 0.61500 985.00000 0.60700 995.00000 0.60600 1005.00000 0.60900 1015.00000 0.60300 1025.00000 0.60100 1035.00000 0.60300 1045.00000 0.60100 1055.00000 0.61100 1065.00000 0.60100 1075.00000 0.60800 Averaged L2 approximation error at data nodes = 0.0415323 Normalized length of piecewise linear interpolant = 2.68209 Normalized length of least squares approximant = 1.53927 Graphics saved as "p06_data.png". Graphics saved as "p06_d05.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #6 using a least squares polynomial of degree 6 Number of data points = 49 Data array: 595.00000 0.64400 605.00000 0.62200 615.00000 0.63800 625.00000 0.64900 635.00000 0.65200 645.00000 0.63900 655.00000 0.64600 665.00000 0.65700 675.00000 0.65200 685.00000 0.65500 695.00000 0.64400 705.00000 0.66300 715.00000 0.66300 725.00000 0.66800 735.00000 0.67600 745.00000 0.67600 755.00000 0.68600 765.00000 0.67900 775.00000 0.67800 785.00000 0.68300 795.00000 0.69400 805.00000 0.69900 815.00000 0.71000 825.00000 0.73000 835.00000 0.76300 845.00000 0.81200 855.00000 0.90700 865.00000 1.04400 875.00000 1.33600 885.00000 1.88100 895.00000 2.16900 905.00000 2.07500 915.00000 1.59800 925.00000 1.21100 935.00000 0.91600 945.00000 0.74600 955.00000 0.67200 965.00000 0.62700 975.00000 0.61500 985.00000 0.60700 995.00000 0.60600 1005.00000 0.60900 1015.00000 0.60300 1025.00000 0.60100 1035.00000 0.60300 1045.00000 0.60100 1055.00000 0.61100 1065.00000 0.60100 1075.00000 0.60800 Averaged L2 approximation error at data nodes = 0.0400821 Normalized length of piecewise linear interpolant = 2.68209 Normalized length of least squares approximant = 1.61198 Graphics saved as "p06_data.png". Graphics saved as "p06_d06.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #7 using a least squares polynomial of degree 1 Number of data points = 4 Data array: 0 1 1 2 4 2 5 1 Averaged L2 approximation error at data nodes = 0.25 Normalized length of piecewise linear interpolant = 2.63961 Normalized length of least squares approximant = 1 Graphics saved as "p07_data.png". Graphics saved as "p07_d01.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #7 using a least squares polynomial of degree 2 Number of data points = 4 Data array: 0 1 1 2 4 2 5 1 Averaged L2 approximation error at data nodes = 6.75322e-16 Normalized length of piecewise linear interpolant = 2.63961 Normalized length of least squares approximant = 3.36731 Graphics saved as "p07_data.png". Graphics saved as "p07_d02.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #7 using a least squares polynomial of degree 3 Number of data points = 4 Data array: 0 1 1 2 4 2 5 1 Averaged L2 approximation error at data nodes = 0 Normalized length of piecewise linear interpolant = 2.63961 Normalized length of least squares approximant = 3.36731 Graphics saved as "p07_data.png". Graphics saved as "p07_d03.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #7 using a least squares polynomial of degree 4 Number of data points = 4 Data array: 0 1 1 2 4 2 5 1 Averaged L2 approximation error at data nodes = 0 Normalized length of piecewise linear interpolant = 2.63961 Normalized length of least squares approximant = 3.36731 Graphics saved as "p07_data.png". Graphics saved as "p07_d04.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #7 using a least squares polynomial of degree 5 Number of data points = 4 Data array: 0 1 1 2 4 2 5 1 Averaged L2 approximation error at data nodes = 0 Normalized length of piecewise linear interpolant = 2.63961 Normalized length of least squares approximant = 3.36731 Graphics saved as "p07_data.png". Graphics saved as "p07_d05.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #7 using a least squares polynomial of degree 6 Number of data points = 4 Data array: 0 1 1 2 4 2 5 1 Averaged L2 approximation error at data nodes = 0 Normalized length of piecewise linear interpolant = 2.63961 Normalized length of least squares approximant = 3.36731 Graphics saved as "p07_data.png". Graphics saved as "p07_d06.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #8 using a least squares polynomial of degree 1 Number of data points = 12 Data array: -1.00000 1.00000 -0.80000 0.64000 -0.60000 0.36000 -0.40000 0.16000 -0.20000 0.04000 0.00000 0.00000 0.20000 0.04000 0.20001 0.05000 0.40000 0.16000 0.60000 0.36000 0.80000 0.64000 1.00000 1.00000 Averaged L2 approximation error at data nodes = 0.101522 Normalized length of piecewise linear interpolant = 2.31939 Normalized length of least squares approximant = 1.00042 Graphics saved as "p08_data.png". Graphics saved as "p08_d01.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #8 using a least squares polynomial of degree 2 Number of data points = 12 Data array: -1.00000 1.00000 -0.80000 0.64000 -0.60000 0.36000 -0.40000 0.16000 -0.20000 0.04000 0.00000 0.00000 0.20000 0.04000 0.20001 0.05000 0.40000 0.16000 0.60000 0.36000 0.80000 0.64000 1.00000 1.00000 Averaged L2 approximation error at data nodes = 0.000762201 Normalized length of piecewise linear interpolant = 2.31939 Normalized length of least squares approximant = 2.31944 Graphics saved as "p08_data.png". Graphics saved as "p08_d02.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #8 using a least squares polynomial of degree 3 Number of data points = 12 Data array: -1.00000 1.00000 -0.80000 0.64000 -0.60000 0.36000 -0.40000 0.16000 -0.20000 0.04000 0.00000 0.00000 0.20000 0.04000 0.20001 0.05000 0.40000 0.16000 0.60000 0.36000 0.80000 0.64000 1.00000 1.00000 Averaged L2 approximation error at data nodes = 0.000748027 Normalized length of piecewise linear interpolant = 2.31939 Normalized length of least squares approximant = 2.31959 Graphics saved as "p08_data.png". Graphics saved as "p08_d03.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #8 using a least squares polynomial of degree 4 Number of data points = 12 Data array: -1.00000 1.00000 -0.80000 0.64000 -0.60000 0.36000 -0.40000 0.16000 -0.20000 0.04000 0.00000 0.00000 0.20000 0.04000 0.20001 0.05000 0.40000 0.16000 0.60000 0.36000 0.80000 0.64000 1.00000 1.00000 Averaged L2 approximation error at data nodes = 0.000731706 Normalized length of piecewise linear interpolant = 2.31939 Normalized length of least squares approximant = 2.32028 Graphics saved as "p08_data.png". Graphics saved as "p08_d04.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #8 using a least squares polynomial of degree 5 Number of data points = 12 Data array: -1.00000 1.00000 -0.80000 0.64000 -0.60000 0.36000 -0.40000 0.16000 -0.20000 0.04000 0.00000 0.00000 0.20000 0.04000 0.20001 0.05000 0.40000 0.16000 0.60000 0.36000 0.80000 0.64000 1.00000 1.00000 Averaged L2 approximation error at data nodes = 0.000704364 Normalized length of piecewise linear interpolant = 2.31939 Normalized length of least squares approximant = 2.32052 Graphics saved as "p08_data.png". Graphics saved as "p08_d05.png". least_squares_approximant_test01(): Approximate data from test_interp() problem #8 using a least squares polynomial of degree 6 Number of data points = 12 Data array: -1.00000 1.00000 -0.80000 0.64000 -0.60000 0.36000 -0.40000 0.16000 -0.20000 0.04000 0.00000 0.00000 0.20000 0.04000 0.20001 0.05000 0.40000 0.16000 0.60000 0.36000 0.80000 0.64000 1.00000 1.00000 Averaged L2 approximation error at data nodes = 0.000701156 Normalized length of piecewise linear interpolant = 2.31939 Normalized length of least squares approximant = 2.32008 Graphics saved as "p08_data.png". Graphics saved as "p08_d06.png". least_squares_approximant_test(): Normal end of execution. 05-Jun-2023 22:11:44