08-Jan-2022 09:09:16 r8poly_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test r8poly(). R8_SIGN_TEST R8_SIGN returns the sign of an R8. R8 R8_SIGN(R8) -1.250000 -1.000000 -0.250000 -1.000000 0.000000 1.000000 0.500000 1.000000 9.000000 1.000000 R82POLY2_PRINT_TEST R82POLY2_PRINT prints an R82POLY2, a quadratic polynomial in x and y. Coefficients a, b, c, d, e, f: 1 2 3 4 5 6 p(x,y) = 1 * x^2 + 2 * y^2 + 3 * xy + 4 * x + 5 * y + 6 R82POLY2_TYPE_TEST R82POLY2_TYPE determines the type of a second order equation in two variables. p(x,y) = 9 * x^2 + -4 * y^2 + 0 * xy + -36 * x + -24 * y + -36 Type = 1 The set of solutions forms a hyperbola. p(x,y) = 4 * x^2 + 1 * y^2 + -4 * xy + 3 * x + -4 * y + 1 Type = 2 The set of solutions forms a parabola. p(x,y) = 9 * x^2 + 16 * y^2 + 0 * xy + 36 * x + -32 * y + -92 Type = 3 The set of solutions forms an ellipse. p(x,y) = 1 * x^2 + 1 * y^2 + 0 * xy + -6 * x + -10 * y + 115 Type = 4 The set of solutions forms an imaginary ellipse. (There are no real solutions). p(x,y) = 0 * x^2 + 0 * y^2 + 1 * xy + 3 * x + -1 * y + -3 Type = 5 The set of solutions forms a pair of intersecting lines. p(x,y) = 1 * x^2 + 2 * y^2 + 0 * xy + -2 * x + 16 * y + 33 Type = 6 The set of solutions is a single point. p(x,y) = 0 * x^2 + 1 * y^2 + 0 * xy + 0 * x + -6 * y + 8 Type = 7 The set of solutions form a pair of distinct parallel lines. p(x,y) = 0 * x^2 + 1 * y^2 + 0 * xy + 0 * x + -6 * y + 10 Type = 8 The set of solutions forms a pair of imaginary parallel lines. (There are no real solutions). p(x,y) = 0 * x^2 + 1 * y^2 + 0 * xy + 0 * x + -2 * y + 1 Type = 9 The set of solutions forms a pair of coincident lines. p(x,y) = 0 * x^2 + 0 * y^2 + 0 * xy + 2 * x + -1 * y + 1 Type = 10 The set of solutions forms a single line. p(x,y) = 0 * x^2 + 0 * y^2 + 0 * xy + 0 * x + 0 * y + 0 Type = 11 The set of solutions is all space. p(x,y) = 0 * x^2 + 0 * y^2 + 0 * xy + 0 * x + 0 * y + 1 Type = 12 The set of solutions is empty. R8MAT_INVERSE_3D_TEST R8MAT_INVERSE_3D inverts a 3 by 3 matrix. Matrix A to be inverted: Col: 1 2 3 Row 1 : 1 2 3 2 : 4 5 6 3 : 7 8 0 Inverse matrix B: Col: 1 2 3 Row 1 : -1.77778 0.888889 -0.111111 2 : 1.55556 -0.777778 0.222222 3 : -0.111111 0.222222 -0.111111 Product C = A * B: Col: 1 2 3 Row 1 : 1 -1.11022e-16 0 2 : 3.33067e-16 1 1.11022e-16 3 : 1.77636e-15 -8.88178e-16 1 R8MAT_PRINT_TEST R8MAT_PRINT prints an R8MAT. The R8MAT: Col: 1 2 3 4 Row 1 : 11 12 13 14 2 : 21 22 23 24 3 : 31 32 33 34 4 : 41 42 43 44 5 : 51 52 53 54 6 : 61 62 63 64 R8MAT_PRINT_SOME_TEST R8MAT_PRINT_SOME prints some of an R8MAT. The R8MAT, rows 2:4, cols 1:2: Col: 1 2 Row 2 : 21 22 3 : 31 32 4 : 41 42 r8poly_add_test r8poly_add() adds two polynomials. Polynomial A: = +5.500000 * x^5 +4.400000 * x^4 +3.300000 * x^3 +2.200000 * x^2 +1.100000 * x Polynomial B: = -5.500000 * x^5 +8.300000 * x^3 +7.200000 * x^2 -2.100000 * x +1.000000 Polynomial C = A+B: = +4.400000 * x^4 +11.600000 * x^3 +9.400000 * x^2 -1.000000 * x +1.000000 r8poly_ant_coef_test r8poly_ant_coef() computes the coefficients of the antiderivative of a polynomial; Polynomial p(x): = +5.000000 * x^4 +4.000000 * x^3 +3.000000 * x^2 +2.000000 * x +1.000000 Antideriv(p(x)): = +1.000000 * x^5 +1.000000 * x^4 +1.000000 * x^3 +1.000000 * x^2 +1.000000 * x r8poly_ant_value_test r8poly_ant_value() evaluates the antiderivative of a polynomial at one point. The polynomial coefficients: = +1.000000 * x^4 -10.000000 * x^3 +35.000000 * x^2 -50.000000 * x +24.000000 I X antiP(X) 1 0.0000 0 2 0.3333 5.62428 3 0.6667 7.87819 4 1.0000 8.36667 5 1.3333 8.15144 6 1.6667 7.84979 7 2.0000 7.73333 8 2.3333 7.82675 9 2.6667 8.00658 10 3.0000 8.1 11 3.3333 7.98354 12 3.6667 7.68189 13 4.0000 7.46667 14 4.3333 7.95514 15 4.6667 10.2091 16 5.0000 15.8333 r8poly_chebyshev_test r8poly_chebyshev(d) returns the Chebyshev polynomial of degree d. T0(x) = +1.000000 T1(x) = +1.000000 * x T2(x) = +2.000000 * x^2 -1.000000 T3(x) = +4.000000 * x^3 -3.000000 * x T4(x) = +8.000000 * x^4 -8.000000 * x^2 +1.000000 T5(x) = +16.000000 * x^5 -20.000000 * x^3 +5.000000 * x T6(x) = +32.000000 * x^6 -48.000000 * x^4 +18.000000 * x^2 -1.000000 T7(x) = +64.000000 * x^7 -112.000000 * x^5 +56.000000 * x^3 -7.000000 * x T8(x) = +128.000000 * x^8 -256.000000 * x^6 +160.000000 * x^4 -32.000000 * x^2 +1.000000 T9(x) = +256.000000 * x^9 -576.000000 * x^7 +432.000000 * x^5 -120.000000 * x^3 +9.000000 * x T10(x) = +512.000000 * x^10 -1280.000000 * x^8 +1120.000000 * x^6 -400.000000 * x^4 +50.000000 * x^2 -1.000000 R8POLY_DEGREE_TEST R8POLY_DEGREE determines the degree of an R8POLY. The R8POLY: = +4.000000 * x^3 +3.000000 * x^2 +2.000000 * x +1.000000 Dimensioned degree = 3, Actual degree = 3 The R8POLY: = +3.000000 * x^2 +2.000000 * x +1.000000 Dimensioned degree = 3, Actual degree = 2 The R8POLY: = +4.000000 * x^3 +2.000000 * x +1.000000 Dimensioned degree = 3, Actual degree = 3 The R8POLY: = +1.000000 Dimensioned degree = 3, Actual degree = 0 The R8POLY: = 0 Dimensioned degree = 3, Actual degree = 0 r8poly_deriv_coef_test r8poly_deriv_coef computes the coefficients of the derivative of a polynomial. The initial polynomial = +1.000000 * x^4 -10.000000 * x^3 +35.000000 * x^2 -50.000000 * x +24.000000 The derivative of order 0 = +1.000000 * x^4 -10.000000 * x^3 +35.000000 * x^2 -50.000000 * x +24.000000 The derivative of order 1 = +4.000000 * x^3 -30.000000 * x^2 +70.000000 * x -50.000000 The derivative of order 2 = +12.000000 * x^2 -60.000000 * x +70.000000 The derivative of order 3 = +24.000000 * x -60.000000 The derivative of order 4 = +24.000000 The derivative of order 5 = 0 r8poly_deriv_value_test r8poly_deriv_value evaluates the derivative of a polynomial. The polynomial = +1.000000 * x^4 -10.000000 * x^3 +35.000000 * x^2 -50.000000 * x +24.000000 A table of derivative values: 0.0000 -50.0000 0.5000 -22.0000 1.0000 -6.0000 1.5000 1.0000 2.0000 2.0000 2.5000 0.0000 3.0000 -2.0000 3.5000 -1.0000 4.0000 6.0000 r8poly_division_test r8poly_division computes the quotient and remainder for polynomial division. The polynomial to be divided, A: = +1.000000 * x^3 +2.000000 * x^2 -5.000000 * x -6.000000 The divisor polynomial, B: = +1.000000 * x -2.000000 The quotient polynomial, Q: = +1.000000 * x^2 +4.000000 * x +3.000000 The remainder polynomial, R: = 0 The polynomial to be divided, A: = +1.000000 * x^4 +3.000000 * x^3 +2.000000 * x^2 +5.000000 * x -2.000000 The divisor polynomial, B: = +1.000000 * x^2 +1.000000 * x -3.000000 The quotient polynomial, Q: = +1.000000 * x^2 +2.000000 * x +3.000000 The remainder polynomial, R: = +8.000000 * x +7.000000 The polynomial to be divided, A: = +1.000000 * x^4 +1.000000 * x^3 -2.000000 * x^2 -4.000000 The divisor polynomial, B: = +1.000000 * x^2 +1.000000 * x -3.000000 The quotient polynomial, Q: = +1.000000 * x^2 +1.000000 * x +3.000000 The remainder polynomial, R: = +5.000000 r8poly_hermite_test r8poly_hermite(d) returns the hermite polynomial of degree d. H0(x) = +1.000000 H1(x) = +2.000000 * x H2(x) = +4.000000 * x^2 -2.000000 H3(x) = +8.000000 * x^3 -12.000000 * x H4(x) = +16.000000 * x^4 -48.000000 * x^2 +12.000000 H5(x) = +32.000000 * x^5 -160.000000 * x^3 +120.000000 * x H6(x) = +64.000000 * x^6 -480.000000 * x^4 +720.000000 * x^2 -120.000000 H7(x) = +128.000000 * x^7 -1344.000000 * x^5 +3360.000000 * x^3 -1680.000000 * x H8(x) = +256.000000 * x^8 -3584.000000 * x^6 +13440.000000 * x^4 -13440.000000 * x^2 +1680.000000 H9(x) = +512.000000 * x^9 -9216.000000 * x^7 +48384.000000 * x^5 -80640.000000 * x^3 +30240.000000 * x H10(x) = +1024.000000 * x^10 -23040.000000 * x^8 +161280.000000 * x^6 -403200.000000 * x^4 +302400.000000 * x^2 -30240.000000 r8poly_integral_test r8poly_integral() computes the integral of a polynomial. The polynomial: = -2.000000 * x +3.000000 Computed integral over [0,1] = 2 Correct integral over [0,1] = 2 r8poly_is_zero_test r8poly_is_zero is true if a polynomial is equivalent to the zero polynomial. The R8POLY: = Zero polynomial r8poly_is_zero = true The R8POLY: = 0 r8poly_is_zero = true The R8POLY: = +2.000000 * x r8poly_is_zero = false The R8POLY: = +3.000000 * x^2 +2.000000 * x +1.000000 r8poly_is_zero = false The R8POLY: = 0 r8poly_is_zero = true R8POLY_LAGRANGE_COEF_TEST R8POLY_LAGRANGE_COEF returns the coefficients for a Lagrange basis polynomial. Abscissas: 1: 1 2: 2 3: 3 4: 4 5: 5 The Lagrange basis polynomial: = +0.041667 * x^4 -0.583333 * x^3 +2.958333 * x^2 -6.416667 * x +5.000000 The Lagrange basis polynomial: = -0.166667 * x^4 +2.166667 * x^3 -9.833333 * x^2 +17.833333 * x -10.000000 The Lagrange basis polynomial: = +0.250000 * x^4 -3.000000 * x^3 +12.250000 * x^2 -19.500000 * x +10.000000 The Lagrange basis polynomial: = -0.166667 * x^4 +1.833333 * x^3 -6.833333 * x^2 +10.166667 * x -5.000000 The Lagrange basis polynomial: = +0.041667 * x^4 -0.416667 * x^3 +1.458333 * x^2 -2.083333 * x +1.000000 R8POLY_LAGRANGE_0_TEST R8POLY_LAGRANGE_0 evaluates the Lagrange factor W(X) at a point. The number of data points is 5 Abscissas: 1: 0 2: 1 3: 2 4: 3 5: 4 X W(X) 0.000000 0.000000e+00 0.222222 3.224441e+00 0.444444 3.489983e+00 0.666667 2.304527e+00 0.888889 7.207573e-01 1.111111 -5.988247e-01 1.333333 -1.316872e+00 1.555556 -1.356162e+00 1.777778 -8.345611e-01 2.000000 0.000000e+00 2.222222 8.345611e-01 2.444444 1.356162e+00 2.666667 1.316872e+00 2.888889 5.988247e-01 3.111111 -7.207573e-01 3.333333 -2.304527e+00 3.555556 -3.489983e+00 3.777778 -3.224441e+00 4.000000 0.000000e+00 R8POLY_LAGRANGE_1_TEST R8POLY_LAGRANGE_1 evaluates the Lagrange factor W'(X) at a point. The number of data points is 5 Abscissas: 1: 0 2: 1 3: 2 4: 3 5: 4 X W'(X) 0.000000 2.400000e+01 0.222222 6.536199e+00 0.444444 -3.020271e+00 0.666667 -6.864198e+00 0.888889 -6.897729e+00 1.111111 -4.730376e+00 1.333333 -1.679012e+00 1.555556 1.232129e+00 1.777778 3.271453e+00 2.000000 4.000000e+00 2.222222 3.271453e+00 2.444444 1.232129e+00 2.666667 -1.679012e+00 2.888889 -4.730376e+00 3.111111 -6.897729e+00 3.333333 -6.864198e+00 3.555556 -3.020271e+00 3.777778 6.536199e+00 4.000000 2.400000e+01 R8POLY_LAGRANGE_2_TEST R8POLY_LAGRANGE_2 evaluates the Lagrange factor W"(X) at a point. The number of data points is 5 Abscissas: 1: 0 2: 1 3: 2 4: 3 5: 4 X W"(X) 0.000000 -1.000000e+02 0.222222 -5.903978e+01 0.444444 -2.861454e+01 0.666667 -7.407407e+00 0.888889 5.898491e+00 1.111111 1.262003e+01 1.333333 1.407407e+01 1.555556 1.157750e+01 1.777778 6.447188e+00 2.000000 0.000000e+00 2.222222 -6.447188e+00 2.444444 -1.157750e+01 2.666667 -1.407407e+01 2.888889 -1.262003e+01 3.111111 -5.898491e+00 3.333333 7.407407e+00 3.555556 2.861454e+01 3.777778 5.903978e+01 4.000000 1.000000e+02 R8POLY_LAGRANGE_FACTOR_TEST R8POLY_LAGRANGE_FACTOR evaluates the Lagrange factor W(X) at a point. For this test, we use 5 functions. Abscissas: 1: 0 2: 0.8 3: 1.6 4: 2.4 5: 3.2 X W(X) W'(X) 4.500000 131.818050 274.542900 4.000000 39.321600 112.230400 3.500000 5.925150 32.142900 3.000000 -1.108800 2.030400 2.500000 -0.267750 -2.857100 2.000000 0.460800 0.230400 1.500000 -0.160650 1.542900 1.000000 -0.369600 -1.169600 0.500000 0.846450 -2.657100 0.000000 0.000000 9.830400 r8poly_lagrange_value_test r8poly_lagrange_value() evaluates a Lagrange interpolating polynomial at a point. Number of data points = 5 Abscissas: 1: 0 2: 1 3: 2 4: 3 5: 4 Here are the values of the functions at several points: X L1 L2 L3 L4 L5 0.000000 1.000000 0.000000 -0.000000 0.000000 -0.000000 0.500000 0.273438 1.093750 -0.546875 0.218750 -0.039062 1.000000 -0.000000 1.000000 0.000000 -0.000000 0.000000 1.500000 -0.039062 0.468750 0.703125 -0.156250 0.023438 2.000000 0.000000 -0.000000 1.000000 0.000000 -0.000000 2.500000 0.023438 -0.156250 0.703125 0.468750 -0.039062 3.000000 -0.000000 0.000000 -0.000000 1.000000 0.000000 3.500000 -0.039062 0.218750 -0.546875 1.093750 0.273438 4.000000 0.000000 -0.000000 0.000000 -0.000000 1.000000 And the derivatives: X L'1 L'2 L'3 L'4 L'5 0.000000 -2.083333 4.000000 -3.000000 1.333333 -0.250000 0.500000 -0.916667 0.708333 0.375000 -0.208333 0.041667 1.000000 -0.250000 -0.833333 1.500000 -0.500000 0.083333 1.500000 0.041667 -1.125000 1.125000 -0.041667 0.000000 2.000000 0.083333 -0.666667 0.000000 0.666667 -0.083333 2.500000 0.000000 0.041667 -1.125000 1.125000 -0.041667 3.000000 -0.083333 0.500000 -1.500000 0.833333 0.250000 3.500000 -0.041667 0.208333 -0.375000 -0.708333 0.916667 4.000000 0.250000 -1.333333 3.000000 -4.000000 2.083333 r8poly_legendre_test r8poly_legendre_test computes a Legendre polynomial. P0(x): = +1.000000 P1(x): = +1.000000 * x P2(x): = +1.500000 * x^2 -0.500000 P3(x): = +2.500000 * x^3 -1.500000 * x P4(x): = +4.375000 * x^4 -3.750000 * x^2 +0.375000 P5(x): = +7.875000 * x^5 -8.750000 * x^3 +1.875000 * x P6(x): = +14.437500 * x^6 -19.687500 * x^4 +6.562500 * x^2 -0.312500 P7(x): = +26.812500 * x^7 -43.312500 * x^5 +19.687500 * x^3 -2.187500 * x P8(x): = +50.273438 * x^8 -93.843750 * x^6 +54.140625 * x^4 -9.843750 * x^2 +0.273438 P9(x): = +94.960938 * x^9 -201.093750 * x^7 +140.765625 * x^5 -36.093750 * x^3 +2.460938 * x P10(x): = +180.425781 * x^10 -427.324219 * x^8 +351.914062 * x^6 -117.304688 * x^4 +13.535156 * x^2 -0.246094 r8poly_multiply_test r8poly_multiply() multiplies two polynomials. The factor A: = +1.000000 * x +1.000000 The factor B: = +1.000000 * x -1.000000 The product C = A*B: = +1.000000 * x^2 -1.000000 The factor A: = +1.000000 * x^2 +2.000000 * x +3.000000 The factor B: = +1.000000 * x -2.000000 The product C = A*B: = +1.000000 * x^3 -1.000000 * x -6.000000 r8poly_norm_test r8poly_norm() computes the norm of a polynomial. The polynomial: = -2.000000 * x +3.000000 Computed norm over [0,1] = 2.08167 Correct norm over [0,1] = 2.08167 r8poly_power_test r8poly_power() takes a polynomial to a power. The polynomial A: = -1.000000 * x +2.000000 Raised to the power 3: = -1.000000 * x^3 +6.000000 * x^2 -12.000000 * x +8.000000 Correct result: = -1.000000 * x^3 +6.000000 * x^2 -12.000000 * x +8.000000 The polynomial A: = +1.000000 * x^2 +1.000000 * x Raised to the power 2: = +1.000000 * x^4 +2.000000 * x^3 +1.000000 * x^2 Correct result: = +1.000000 * x^4 +2.000000 * x^3 +1.000000 * x^2 R8POLY_PRINT_TEST R8POLY_PRINT prints an R8POLY. The R8POLY: = +9.000000 * x^5 +0.780000 * x^4 +56.000000 * x^2 -3.400000 * x +12.000000 The R8POLY: = +0.780000 * x^4 +56.000000 * x^2 -3.400000 * x +12.000000 The R8POLY: = +1.000000 * x^5 +0.780000 * x^4 +56.000000 * x^2 +12.000000 The R8POLY: = 0 R8POLY_SHIFT_TEST R8POLY_SHIFT shifts an R8POLY p(x) to q(z) where z=scale*x+shift. p(x): = +2.000000 * x^2 -1.000000 * x +6.000000 z = scale * x + shift Scale = 2 Shift = 3 q(z): = +1.000000 * x^2 -6.500000 * x +10.500000 Expected q(z): = +0.500000 * x^2 -3.500000 * x +12.000000 R8POLY_VALUE_TEST R8POLY_VALUE evaluates a polynomial at one point. The polynomial coefficients: = +1.000000 * x^4 -10.000000 * x^3 +35.000000 * x^2 -50.000000 * x +24.000000 I X P(X) 1 0.0000 24 2 0.3333 10.8642 3 0.6667 3.45679 4 1.0000 0 5 1.3333 -0.987654 6 1.6667 -0.691358 7 2.0000 0 8 2.3333 0.493827 9 2.6667 0.493827 10 3.0000 0 11 3.3333 -0.691358 12 3.6667 -0.987654 13 4.0000 0 14 4.3333 3.45679 15 4.6667 10.8642 16 5.0000 24 R8POLY_VALUE_FAST_TEST() R8POLY_VALUE_FAST evaluates a polynomial at several points. The polynomial coefficients: = +1.000000 * x^4 -10.000000 * x^3 +35.000000 * x^2 -50.000000 * x +24.000000 Table of values i, x(i), p(x(i)): 1: 0 24 2: 0.333333 10.8642 3: 0.666667 3.45679 4: 1 0 5: 1.33333 -0.987654 6: 1.66667 -0.691358 7: 2 0 8: 2.33333 0.493827 9: 2.66667 0.493827 10: 3 0 11: 3.33333 -0.691358 12: 3.66667 -0.987654 13: 4 0 14: 4.33333 3.45679 15: 4.66667 10.8642 16: 5 24 R8POLY_VALUE_HORNER_TEST R8POLY_VALUE_HORNER evaluates a polynomial at one point, using Horner's method. The polynomial coefficients: = +1.000000 * x^4 -10.000000 * x^3 +35.000000 * x^2 -50.000000 * x +24.000000 I X P(X) 1 0.0000 24 2 0.3333 10.8642 3 0.6667 3.45679 4 1.0000 0 5 1.3333 -0.987654 6 1.6667 -0.691358 7 2.0000 0 8 2.3333 0.493827 9 2.6667 0.493827 10 3.0000 0 11 3.3333 -0.691358 12 3.6667 -0.987654 13 4.0000 0 14 4.3333 3.45679 15 4.6667 10.8642 16 5.0000 24 R8POLY_VALUES_HORNER_TEST R8POLY_VALUES_HORNER evaluates a polynomial at a point, using Horner's method. The polynomial: = +1.000000 * x^4 -10.000000 * x^3 +35.000000 * x^2 -50.000000 * x +24.000000 X, P(X): 1: 0 24 2: 0.333333 10.8642 3: 0.666667 3.45679 4: 1 0 5: 1.33333 -4.14815 6: 1.66667 -8.40741 7: 2 -16 8: 2.33333 -29.1481 9: 2.66667 -50.0741 10: 3 -81 11: 3.33333 -124.148 12: 3.66667 -181.741 13: 4 -256 14: 4.33333 -349.148 15: 4.66667 -463.407 16: 5 -601 R8POLY2_EX_TEST R8POLY2_EX finds the extreme value of a parabola determined by three points. Parabolic coefficients: A = 2.000000, B = -4.000000, C = 10.000000 Point 1 : ( 1, 8 ) Point 2 : ( 2, 10 ) Point 3 : ( 3, 16 ) R8POLY2_EX returns XMIN = 1.000000, YMIN = 8.000000 R8POLY2_EX2_TEST R8POLY2_EX2 finds the extreme value of a parabola determined by three points. Parabolic coefficients: A = 2.000000, B = -4.000000, C = 10.000000 Point 1 : ( 1, 8 ) Point 2 : ( 2, 10 ) Point 3 : ( 3, 16 ) R8POLY2_EX2 returns XMIN = 1.000000, YMIN = 8.000000 and A = 2.000000, B = -4.000000, C = 10.000000 R8POLY2_ROOT_TEST R8POLY2_ROOT finds quadratic equation roots. A B C R1 R2 2.000000 -2.000000 -24.000000 4.000000 -3.000000 1.000000 -20.000000 100.000000 10.000000 10.000000 1.000000 -2.000000 10.000000 1.000000 1.000000 R8POLY2_RROOT_TEST R8POLY2_RROOT finds the real parts of quadratic equation roots. A B C R1 R2 2.000000 -2.000000 -24.000000 4.000000 -3.000000 1.000000 -20.000000 100.000000 10.000000 10.000000 1.000000 -2.000000 10.000000 1.000000 1.000000 1.000000 0.000000 1.000000 -0.000000 -0.000000 1.000000 -6.000000 10.000000 3.000000 3.000000 R8POLY2_VAL_TEST R8POLY2_VAL evaluates a parabola given 3 data points. Our parabola will be 2*x^2 + 3 * x + 1. Case 1: 3 distinct data points: -1.000000 0.000000 1.000000 6.000000 3.000000 28.000000 Sampled data: X, Y, Y', Y" 0.000000 1.000000 3.000000 4.000000 1.000000 6.000000 7.000000 4.000000 2.000000 15.000000 11.000000 4.000000 3.000000 28.000000 15.000000 4.000000 Case 2: X1=X2, X3 distinct: -1.000000 0.000000 -1.000000 -1.000000 3.000000 28.000000 Sampled data: X, Y, Y', Y" 0.000000 1.000000 3.000000 4.000000 1.000000 6.000000 7.000000 4.000000 2.000000 15.000000 11.000000 4.000000 3.000000 28.000000 15.000000 4.000000 Case 3: X1=X2=X3: -1.000000 0.000000 -1.000000 -1.000000 -1.000000 4.000000 Sampled data: X, Y, Y', Y" 0.000000 1.000000 3.000000 4.000000 1.000000 6.000000 7.000000 4.000000 2.000000 15.000000 11.000000 4.000000 3.000000 28.000000 15.000000 4.000000 R8POLY2_VAL2_TEST R8POLY2_VAL2 evaluates parabolas through 3 points in a table Our data tables will actually be parabolas: A: 2*x^2 + 3 * x + 1. B: 4*x^2 - 2 * x + 5. 1 2.000000 15.000000 17.000000 2 4.000000 45.000000 61.000000 3 6.000000 91.000000 137.000000 4 8.000000 153.000000 245.000000 5 10.000000 231.000000 385.000000 Interpolated data: LEFT, X, Y1, Y2 1 1.000000 6.000000 7.000000 2 3.000000 28.000000 35.000000 3 5.000000 66.000000 95.000000 3 7.000000 120.000000 187.000000 3 9.000000 190.000000 311.000000 R8POLY3_ROOT_TEST R8POLY3_ROOT finds roots of cubic equations. Polynomial coefficients: A = 1.000000, B = -6.000000, C = 11.000000, D = -6.000000 Roots: 1.000000 3.000000 2.000000 Polynomial coefficients: A = 9.000000, B = -36.000000, C = 54.000000, D = -27.000000 Roots: 1.000000 1.500000 1.500000 Polynomial coefficients: A = 1.000000, B = -5.000000, C = 8.000000, D = -4.000000 Roots: 1.000000 2.000000 2.000000 Polynomial coefficients: A = 1.000000, B = -8.000000, C = 25.000000, D = -26.000000 Roots: 2.000000 3.000000 3.000000 R8POLY4_ROOT_TEST R8POLY4_ROOT finds roots of quartic equations. A = 1.000000 B = -10.000000 C = 35.000000 D = -50.000000 E = 24.000000 Roots: 4.000000 1.000000 3.000000 2.000000 A = 1.000000 B = -5.000000 C = 1.000000 D = 21.000000 E = -18.000000 Roots: 3.000000 3.000000 1.000000 -2.000000 A = 1.000000 B = -22.000000 C = 141.000000 D = -220.000000 E = 100.000000 Roots: 10.000000 10.000000 1.000000 1.000000 A = 1.000000 B = -16.000000 C = 72.000000 D = -128.000000 E = 80.000000 Roots: 10.000000 2.000000 2.000000 2.000000 A = 1.000000 B = -20.000000 C = 150.000000 D = -500.000000 E = 625.000000 Roots: 5.000000 5.000000 5.000000 5.000000 A = 1.000000 B = 2.000000 C = 1.000000 D = 8.000000 E = -12.000000 Roots: -0.000000 -0.000000 1.000000 -3.000000 A = 1.000000 B = 0.000000 C = 13.000000 D = 0.000000 E = 36.000000 Roots: 0.000000 0.000000 0.000000 -0.000000 R8R8_PRINT_TEST R8R8_PRINT prints a pair of R8's with a label. Center : ( 1.23, 7.45 ) ( 1.23, 7.45 ) Focus : ( 1.23457, 7.45679e+06 ) R8VEC_EVEN_SELECT_TEST R8VEC_EVEN_SELECT returns the I-th of N evenly spaced values between XLO and XHI. XLO = 0.000000 XHI = 99.000000 while N = 10 X(2) = 11 X(5) = 44 X(8) = 77 R8VEC_INDICATOR1_TEST R8VEC_INDICATOR1 returns a 1-based indicator vector. The indicator1 vector: 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 7: 7 8: 8 9: 9 10: 10 R8VEC_IS_DISTINCT_TEST R8VEC_IS_DISTINCT is TRUE if an R8VEC only contains distinct entries. X: 0 1 3 X is distinct X: 1.5 1.6 1.5 X is NOT distinct. X: -1 1 10 X is distinct R8VEC_PRINT_TEST R8VEC_PRINT prints an R8VEC. The R8VEC: 1: 123.456 2: 5e-06 3: -1e+06 4: 3.14159 R8VEC_TRANSPOSE_PRINT_TEST R8VEC_TRANSPOSE_PRINT prints an R8VEC "tranposed", that is, placing multiple entries on a line. The vector X: 1 2.2 -3.3 4.45 5.678 600 0.0078 8.123 9.45 10.03 11.1 12.99 ROOTS_TO_R8POLY_TEST: ROOTS_TO_R8POLY is given N real roots, and constructs the coefficient vector of the corresponding polynomial. N real roots: 1: 1 2: -4 3: 3 4: 0 5: 3 Corresponding polynomial: = +1.000000 * x^5 -3.000000 * x^4 -13.000000 * x^3 +51.000000 * x^2 -36.000000 * x r8poly_test(): Normal end of execution. 08-Jan-2022 09:09:17