15-May-2025 08:54:36 least_squares_approximant_test(): MATLAB/Octave version 6.4.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 0 1.3400 5.0000 5.0000 8.6600 10.0000 10.0000 10.6000 10.4000 10.7000 12.0000 10.7050 28.6000 10.8000 30.2000 11.4000 30.6000 19.6000 30.6000 20.2000 30.2000 20.2950 28.6000 20.3000 12.0000 20.4000 10.4000 21.0000 10.0000 26.0000 8.6600 29.6600 5.0000 31.0000 0 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 0 1.3400 5.0000 5.0000 8.6600 10.0000 10.0000 10.6000 10.4000 10.7000 12.0000 10.7050 28.6000 10.8000 30.2000 11.4000 30.6000 19.6000 30.6000 20.2000 30.2000 20.2950 28.6000 20.3000 12.0000 20.4000 10.4000 21.0000 10.0000 26.0000 8.6600 29.6600 5.0000 31.0000 0 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 0 1.3400 5.0000 5.0000 8.6600 10.0000 10.0000 10.6000 10.4000 10.7000 12.0000 10.7050 28.6000 10.8000 30.2000 11.4000 30.6000 19.6000 30.6000 20.2000 30.2000 20.2950 28.6000 20.3000 12.0000 20.4000 10.4000 21.0000 10.0000 26.0000 8.6600 29.6600 5.0000 31.0000 0 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 0 1.3400 5.0000 5.0000 8.6600 10.0000 10.0000 10.6000 10.4000 10.7000 12.0000 10.7050 28.6000 10.8000 30.2000 11.4000 30.6000 19.6000 30.6000 20.2000 30.2000 20.2950 28.6000 20.3000 12.0000 20.4000 10.4000 21.0000 10.0000 26.0000 8.6600 29.6600 5.0000 31.0000 0 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 0 1.3400 5.0000 5.0000 8.6600 10.0000 10.0000 10.6000 10.4000 10.7000 12.0000 10.7050 28.6000 10.8000 30.2000 11.4000 30.6000 19.6000 30.6000 20.2000 30.2000 20.2950 28.6000 20.3000 12.0000 20.4000 10.4000 21.0000 10.0000 26.0000 8.6600 29.6600 5.0000 31.0000 0 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 0 1.3400 5.0000 5.0000 8.6600 10.0000 10.0000 10.6000 10.4000 10.7000 12.0000 10.7050 28.6000 10.8000 30.2000 11.4000 30.6000 19.6000 30.6000 20.2000 30.2000 20.2950 28.6000 20.3000 12.0000 20.4000 10.4000 21.0000 10.0000 26.0000 8.6600 29.6600 5.0000 31.0000 0 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 0 2.0000 10.0000 3.0000 10.0000 5.0000 10.0000 6.0000 10.0000 8.0000 10.0000 9.0000 10.5000 11.0000 15.0000 12.0000 50.0000 14.0000 60.0000 15.0000 85.0000 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 0 2.0000 10.0000 3.0000 10.0000 5.0000 10.0000 6.0000 10.0000 8.0000 10.0000 9.0000 10.5000 11.0000 15.0000 12.0000 50.0000 14.0000 60.0000 15.0000 85.0000 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 0 2.0000 10.0000 3.0000 10.0000 5.0000 10.0000 6.0000 10.0000 8.0000 10.0000 9.0000 10.5000 11.0000 15.0000 12.0000 50.0000 14.0000 60.0000 15.0000 85.0000 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 0 2.0000 10.0000 3.0000 10.0000 5.0000 10.0000 6.0000 10.0000 8.0000 10.0000 9.0000 10.5000 11.0000 15.0000 12.0000 50.0000 14.0000 60.0000 15.0000 85.0000 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 0 2.0000 10.0000 3.0000 10.0000 5.0000 10.0000 6.0000 10.0000 8.0000 10.0000 9.0000 10.5000 11.0000 15.0000 12.0000 50.0000 14.0000 60.0000 15.0000 85.0000 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 0 2.0000 10.0000 3.0000 10.0000 5.0000 10.0000 6.0000 10.0000 8.0000 10.0000 9.0000 10.5000 11.0000 15.0000 12.0000 50.0000 14.0000 60.0000 15.0000 85.0000 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 0 0.0500 0.7000 0.1000 1.0000 0.2000 1.0000 0.8000 0.3000 0.8500 0.0500 0.9000 0.1000 1.0000 1.0000 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 0 0.0500 0.7000 0.1000 1.0000 0.2000 1.0000 0.8000 0.3000 0.8500 0.0500 0.9000 0.1000 1.0000 1.0000 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 0 0.0500 0.7000 0.1000 1.0000 0.2000 1.0000 0.8000 0.3000 0.8500 0.0500 0.9000 0.1000 1.0000 1.0000 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 0 0.0500 0.7000 0.1000 1.0000 0.2000 1.0000 0.8000 0.3000 0.8500 0.0500 0.9000 0.1000 1.0000 1.0000 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 0 0.0500 0.7000 0.1000 1.0000 0.2000 1.0000 0.8000 0.3000 0.8500 0.0500 0.9000 0.1000 1.0000 1.0000 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 0 0.0500 0.7000 0.1000 1.0000 0.2000 1.0000 0.8000 0.3000 0.8500 0.0500 0.9000 0.1000 1.0000 1.0000 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 0 0.1000 0.9000 0.2000 0.9500 0.3000 0.9000 0.4000 0.1000 0.5000 0.0500 0.6000 0.0500 0.8000 0.2000 1.0000 1.0000 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 0 0.1000 0.9000 0.2000 0.9500 0.3000 0.9000 0.4000 0.1000 0.5000 0.0500 0.6000 0.0500 0.8000 0.2000 1.0000 1.0000 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 0 0.1000 0.9000 0.2000 0.9500 0.3000 0.9000 0.4000 0.1000 0.5000 0.0500 0.6000 0.0500 0.8000 0.2000 1.0000 1.0000 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 0 0.1000 0.9000 0.2000 0.9500 0.3000 0.9000 0.4000 0.1000 0.5000 0.0500 0.6000 0.0500 0.8000 0.2000 1.0000 1.0000 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 0 0.1000 0.9000 0.2000 0.9500 0.3000 0.9000 0.4000 0.1000 0.5000 0.0500 0.6000 0.0500 0.8000 0.2000 1.0000 1.0000 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 0 0.1000 0.9000 0.2000 0.9500 0.3000 0.9000 0.4000 0.1000 0.5000 0.0500 0.6000 0.0500 0.8000 0.2000 1.0000 1.0000 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: 5.9500e+02 6.4400e-01 6.0500e+02 6.2200e-01 6.1500e+02 6.3800e-01 6.2500e+02 6.4900e-01 6.3500e+02 6.5200e-01 6.4500e+02 6.3900e-01 6.5500e+02 6.4600e-01 6.6500e+02 6.5700e-01 6.7500e+02 6.5200e-01 6.8500e+02 6.5500e-01 6.9500e+02 6.4400e-01 7.0500e+02 6.6300e-01 7.1500e+02 6.6300e-01 7.2500e+02 6.6800e-01 7.3500e+02 6.7600e-01 7.4500e+02 6.7600e-01 7.5500e+02 6.8600e-01 7.6500e+02 6.7900e-01 7.7500e+02 6.7800e-01 7.8500e+02 6.8300e-01 7.9500e+02 6.9400e-01 8.0500e+02 6.9900e-01 8.1500e+02 7.1000e-01 8.2500e+02 7.3000e-01 8.3500e+02 7.6300e-01 8.4500e+02 8.1200e-01 8.5500e+02 9.0700e-01 8.6500e+02 1.0440e+00 8.7500e+02 1.3360e+00 8.8500e+02 1.8810e+00 8.9500e+02 2.1690e+00 9.0500e+02 2.0750e+00 9.1500e+02 1.5980e+00 9.2500e+02 1.2110e+00 9.3500e+02 9.1600e-01 9.4500e+02 7.4600e-01 9.5500e+02 6.7200e-01 9.6500e+02 6.2700e-01 9.7500e+02 6.1500e-01 9.8500e+02 6.0700e-01 9.9500e+02 6.0600e-01 1.0050e+03 6.0900e-01 1.0150e+03 6.0300e-01 1.0250e+03 6.0100e-01 1.0350e+03 6.0300e-01 1.0450e+03 6.0100e-01 1.0550e+03 6.1100e-01 1.0650e+03 6.0100e-01 1.0750e+03 6.0800e-01 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: 5.9500e+02 6.4400e-01 6.0500e+02 6.2200e-01 6.1500e+02 6.3800e-01 6.2500e+02 6.4900e-01 6.3500e+02 6.5200e-01 6.4500e+02 6.3900e-01 6.5500e+02 6.4600e-01 6.6500e+02 6.5700e-01 6.7500e+02 6.5200e-01 6.8500e+02 6.5500e-01 6.9500e+02 6.4400e-01 7.0500e+02 6.6300e-01 7.1500e+02 6.6300e-01 7.2500e+02 6.6800e-01 7.3500e+02 6.7600e-01 7.4500e+02 6.7600e-01 7.5500e+02 6.8600e-01 7.6500e+02 6.7900e-01 7.7500e+02 6.7800e-01 7.8500e+02 6.8300e-01 7.9500e+02 6.9400e-01 8.0500e+02 6.9900e-01 8.1500e+02 7.1000e-01 8.2500e+02 7.3000e-01 8.3500e+02 7.6300e-01 8.4500e+02 8.1200e-01 8.5500e+02 9.0700e-01 8.6500e+02 1.0440e+00 8.7500e+02 1.3360e+00 8.8500e+02 1.8810e+00 8.9500e+02 2.1690e+00 9.0500e+02 2.0750e+00 9.1500e+02 1.5980e+00 9.2500e+02 1.2110e+00 9.3500e+02 9.1600e-01 9.4500e+02 7.4600e-01 9.5500e+02 6.7200e-01 9.6500e+02 6.2700e-01 9.7500e+02 6.1500e-01 9.8500e+02 6.0700e-01 9.9500e+02 6.0600e-01 1.0050e+03 6.0900e-01 1.0150e+03 6.0300e-01 1.0250e+03 6.0100e-01 1.0350e+03 6.0300e-01 1.0450e+03 6.0100e-01 1.0550e+03 6.1100e-01 1.0650e+03 6.0100e-01 1.0750e+03 6.0800e-01 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: 5.9500e+02 6.4400e-01 6.0500e+02 6.2200e-01 6.1500e+02 6.3800e-01 6.2500e+02 6.4900e-01 6.3500e+02 6.5200e-01 6.4500e+02 6.3900e-01 6.5500e+02 6.4600e-01 6.6500e+02 6.5700e-01 6.7500e+02 6.5200e-01 6.8500e+02 6.5500e-01 6.9500e+02 6.4400e-01 7.0500e+02 6.6300e-01 7.1500e+02 6.6300e-01 7.2500e+02 6.6800e-01 7.3500e+02 6.7600e-01 7.4500e+02 6.7600e-01 7.5500e+02 6.8600e-01 7.6500e+02 6.7900e-01 7.7500e+02 6.7800e-01 7.8500e+02 6.8300e-01 7.9500e+02 6.9400e-01 8.0500e+02 6.9900e-01 8.1500e+02 7.1000e-01 8.2500e+02 7.3000e-01 8.3500e+02 7.6300e-01 8.4500e+02 8.1200e-01 8.5500e+02 9.0700e-01 8.6500e+02 1.0440e+00 8.7500e+02 1.3360e+00 8.8500e+02 1.8810e+00 8.9500e+02 2.1690e+00 9.0500e+02 2.0750e+00 9.1500e+02 1.5980e+00 9.2500e+02 1.2110e+00 9.3500e+02 9.1600e-01 9.4500e+02 7.4600e-01 9.5500e+02 6.7200e-01 9.6500e+02 6.2700e-01 9.7500e+02 6.1500e-01 9.8500e+02 6.0700e-01 9.9500e+02 6.0600e-01 1.0050e+03 6.0900e-01 1.0150e+03 6.0300e-01 1.0250e+03 6.0100e-01 1.0350e+03 6.0300e-01 1.0450e+03 6.0100e-01 1.0550e+03 6.1100e-01 1.0650e+03 6.0100e-01 1.0750e+03 6.0800e-01 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: 5.9500e+02 6.4400e-01 6.0500e+02 6.2200e-01 6.1500e+02 6.3800e-01 6.2500e+02 6.4900e-01 6.3500e+02 6.5200e-01 6.4500e+02 6.3900e-01 6.5500e+02 6.4600e-01 6.6500e+02 6.5700e-01 6.7500e+02 6.5200e-01 6.8500e+02 6.5500e-01 6.9500e+02 6.4400e-01 7.0500e+02 6.6300e-01 7.1500e+02 6.6300e-01 7.2500e+02 6.6800e-01 7.3500e+02 6.7600e-01 7.4500e+02 6.7600e-01 7.5500e+02 6.8600e-01 7.6500e+02 6.7900e-01 7.7500e+02 6.7800e-01 7.8500e+02 6.8300e-01 7.9500e+02 6.9400e-01 8.0500e+02 6.9900e-01 8.1500e+02 7.1000e-01 8.2500e+02 7.3000e-01 8.3500e+02 7.6300e-01 8.4500e+02 8.1200e-01 8.5500e+02 9.0700e-01 8.6500e+02 1.0440e+00 8.7500e+02 1.3360e+00 8.8500e+02 1.8810e+00 8.9500e+02 2.1690e+00 9.0500e+02 2.0750e+00 9.1500e+02 1.5980e+00 9.2500e+02 1.2110e+00 9.3500e+02 9.1600e-01 9.4500e+02 7.4600e-01 9.5500e+02 6.7200e-01 9.6500e+02 6.2700e-01 9.7500e+02 6.1500e-01 9.8500e+02 6.0700e-01 9.9500e+02 6.0600e-01 1.0050e+03 6.0900e-01 1.0150e+03 6.0300e-01 1.0250e+03 6.0100e-01 1.0350e+03 6.0300e-01 1.0450e+03 6.0100e-01 1.0550e+03 6.1100e-01 1.0650e+03 6.0100e-01 1.0750e+03 6.0800e-01 Averaged L2 approximation error at data nodes = 0.0424429 Normalized length of piecewise linear interpolant = 2.68209 Normalized length of least squares approximant = 1.51608 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: 5.9500e+02 6.4400e-01 6.0500e+02 6.2200e-01 6.1500e+02 6.3800e-01 6.2500e+02 6.4900e-01 6.3500e+02 6.5200e-01 6.4500e+02 6.3900e-01 6.5500e+02 6.4600e-01 6.6500e+02 6.5700e-01 6.7500e+02 6.5200e-01 6.8500e+02 6.5500e-01 6.9500e+02 6.4400e-01 7.0500e+02 6.6300e-01 7.1500e+02 6.6300e-01 7.2500e+02 6.6800e-01 7.3500e+02 6.7600e-01 7.4500e+02 6.7600e-01 7.5500e+02 6.8600e-01 7.6500e+02 6.7900e-01 7.7500e+02 6.7800e-01 7.8500e+02 6.8300e-01 7.9500e+02 6.9400e-01 8.0500e+02 6.9900e-01 8.1500e+02 7.1000e-01 8.2500e+02 7.3000e-01 8.3500e+02 7.6300e-01 8.4500e+02 8.1200e-01 8.5500e+02 9.0700e-01 8.6500e+02 1.0440e+00 8.7500e+02 1.3360e+00 8.8500e+02 1.8810e+00 8.9500e+02 2.1690e+00 9.0500e+02 2.0750e+00 9.1500e+02 1.5980e+00 9.2500e+02 1.2110e+00 9.3500e+02 9.1600e-01 9.4500e+02 7.4600e-01 9.5500e+02 6.7200e-01 9.6500e+02 6.2700e-01 9.7500e+02 6.1500e-01 9.8500e+02 6.0700e-01 9.9500e+02 6.0600e-01 1.0050e+03 6.0900e-01 1.0150e+03 6.0300e-01 1.0250e+03 6.0100e-01 1.0350e+03 6.0300e-01 1.0450e+03 6.0100e-01 1.0550e+03 6.1100e-01 1.0650e+03 6.0100e-01 1.0750e+03 6.0800e-01 Averaged L2 approximation error at data nodes = 0.041494 Normalized length of piecewise linear interpolant = 2.68209 Normalized length of least squares approximant = 1.55215 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: 5.9500e+02 6.4400e-01 6.0500e+02 6.2200e-01 6.1500e+02 6.3800e-01 6.2500e+02 6.4900e-01 6.3500e+02 6.5200e-01 6.4500e+02 6.3900e-01 6.5500e+02 6.4600e-01 6.6500e+02 6.5700e-01 6.7500e+02 6.5200e-01 6.8500e+02 6.5500e-01 6.9500e+02 6.4400e-01 7.0500e+02 6.6300e-01 7.1500e+02 6.6300e-01 7.2500e+02 6.6800e-01 7.3500e+02 6.7600e-01 7.4500e+02 6.7600e-01 7.5500e+02 6.8600e-01 7.6500e+02 6.7900e-01 7.7500e+02 6.7800e-01 7.8500e+02 6.8300e-01 7.9500e+02 6.9400e-01 8.0500e+02 6.9900e-01 8.1500e+02 7.1000e-01 8.2500e+02 7.3000e-01 8.3500e+02 7.6300e-01 8.4500e+02 8.1200e-01 8.5500e+02 9.0700e-01 8.6500e+02 1.0440e+00 8.7500e+02 1.3360e+00 8.8500e+02 1.8810e+00 8.9500e+02 2.1690e+00 9.0500e+02 2.0750e+00 9.1500e+02 1.5980e+00 9.2500e+02 1.2110e+00 9.3500e+02 9.1600e-01 9.4500e+02 7.4600e-01 9.5500e+02 6.7200e-01 9.6500e+02 6.2700e-01 9.7500e+02 6.1500e-01 9.8500e+02 6.0700e-01 9.9500e+02 6.0600e-01 1.0050e+03 6.0900e-01 1.0150e+03 6.0300e-01 1.0250e+03 6.0100e-01 1.0350e+03 6.0300e-01 1.0450e+03 6.0100e-01 1.0550e+03 6.1100e-01 1.0650e+03 6.0100e-01 1.0750e+03 6.0800e-01 Averaged L2 approximation error at data nodes = 0.0400821 Normalized length of piecewise linear interpolant = 2.68209 Normalized length of least squares approximant = 1.61201 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 = 1.37131e-15 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.0000 1.0000 -0.8000 0.6400 -0.6000 0.3600 -0.4000 0.1600 -0.2000 0.0400 0 0 0.2000 0.0400 0.2000 0.0500 0.4000 0.1600 0.6000 0.3600 0.8000 0.6400 1.0000 1.0000 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.0000 1.0000 -0.8000 0.6400 -0.6000 0.3600 -0.4000 0.1600 -0.2000 0.0400 0 0 0.2000 0.0400 0.2000 0.0500 0.4000 0.1600 0.6000 0.3600 0.8000 0.6400 1.0000 1.0000 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.0000 1.0000 -0.8000 0.6400 -0.6000 0.3600 -0.4000 0.1600 -0.2000 0.0400 0 0 0.2000 0.0400 0.2000 0.0500 0.4000 0.1600 0.6000 0.3600 0.8000 0.6400 1.0000 1.0000 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.0000 1.0000 -0.8000 0.6400 -0.6000 0.3600 -0.4000 0.1600 -0.2000 0.0400 0 0 0.2000 0.0400 0.2000 0.0500 0.4000 0.1600 0.6000 0.3600 0.8000 0.6400 1.0000 1.0000 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.0000 1.0000 -0.8000 0.6400 -0.6000 0.3600 -0.4000 0.1600 -0.2000 0.0400 0 0 0.2000 0.0400 0.2000 0.0500 0.4000 0.1600 0.6000 0.3600 0.8000 0.6400 1.0000 1.0000 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.0000 1.0000 -0.8000 0.6400 -0.6000 0.3600 -0.4000 0.1600 -0.2000 0.0400 0 0 0.2000 0.0400 0.2000 0.0500 0.4000 0.1600 0.6000 0.3600 0.8000 0.6400 1.0000 1.0000 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. 15-May-2025 08:54:52