13 January 2017 08:11:44 PM TEST_INTERP_1D_TEST C version Test the TEST_INTERP_1D library. The R8LIB library is needed. TEST01 Print the title of each function. There are 8 functions available: Index Title 1 f(x) = steps -1/2/1 at [0,1/3], [1/3,4/5], [4/5,1]. 2 f(x) = (1-3x), x < 1/3 (6x-2) if 1/3 < x 3 f(x) = x (10*x-1) (5x-2) (5x-2) (4x-3.4) (x-1) 4 f(x) = atan ( 40 * x - 15 ) 5 f(x) = cos(7*x)+5*cos(11.2*x)-2*cos(14*x)+5*cos(31.5*x)+7*cos(63*x). 6 f(x) = exp ( - ( 4*x-1 )^2 ) 7 f(x) = exp ( 2 x ) if x < 0.5, 0 otherwise 8 f(x) = 1 / ( 1 + ( 10 * (x-1/2) )^2 ) TEST_INTERP_1D_TEST02 Use P00_F to sample each function. X, F(X) for problem 1 0 0.000000 -1 1 0.100000 -1 2 0.200000 -1 3 0.300000 -1 4 0.400000 2 5 0.500000 2 6 0.600000 2 7 0.700000 2 8 0.800000 2 9 0.900000 1 10 1.000000 1 X, F(X) for problem 2 0 0.000000 1 1 0.100000 0.7 2 0.200000 0.4 3 0.300000 0.1 4 0.400000 0.4 5 0.500000 1 6 0.600000 1.6 7 0.700000 2.2 8 0.800000 2.8 9 0.900000 3.4 10 1.000000 4 X, F(X) for problem 3 0 0.000000 -0 1 0.100000 0 2 0.200000 0.416 3 0.300000 0.231 4 0.400000 0 5 0.500000 0.35 6 0.600000 1.2 7 0.700000 1.701 8 0.800000 0.896 9 0.900000 -0.9 10 1.000000 0 X, F(X) for problem 4 0 0.000000 -1.50423 1 0.100000 -1.48014 2 0.200000 -1.4289 3 0.300000 -1.24905 4 0.400000 0.785398 5 0.500000 1.3734 6 0.600000 1.46014 7 0.700000 1.49402 8 0.800000 1.51204 9 0.900000 1.52321 10 1.000000 1.53082 X, F(X) for problem 5 0 0.000000 16 1 0.100000 4.60251 2 0.200000 10.9479 3 0.300000 -2.41286 4 0.400000 8.33648 5 0.500000 3.41326 6 0.600000 17.0369 7 0.700000 4.07749 8 0.800000 7.82541 9 0.900000 -3.02927 10 1.000000 13.3791 X, F(X) for problem 6 0 0.000000 0.367879 1 0.100000 0.697676 2 0.200000 0.960789 3 0.300000 0.960789 4 0.400000 0.697676 5 0.500000 0.367879 6 0.600000 0.140858 7 0.700000 0.0391639 8 0.800000 0.00790705 9 0.900000 0.00115923 10 1.000000 0.00012341 X, F(X) for problem 7 0 0.000000 1 1 0.100000 1.49182 2 0.200000 2.22554 3 0.300000 3.32012 4 0.400000 4.95303 5 0.500000 0 6 0.600000 0 7 0.700000 0 8 0.800000 0 9 0.900000 0 10 1.000000 0 X, F(X) for problem 8 0 0.000000 0.0384615 1 0.100000 0.0588235 2 0.200000 0.1 3 0.300000 0.2 4 0.400000 0.5 5 0.500000 1 6 0.600000 0.5 7 0.700000 0.2 8 0.800000 0.1 9 0.900000 0.0588235 10 1.000000 0.0384615 TEST_INTERP_1D_TEST Normal end of execution. 13 January 2017 08:11:44 PM