Tue Oct 19 11:25:04 2021 cauchy_principal_value_test(): Python version: 3.6.9 Test cauchy_principal_value(). cauchy_principal_value_test01(): Python version: 3.6.9 cauchy_principal_value() for Integral ( -1 <= t <= 1 ) exp(t) / t dt N Estimate Error 2 2.112977728449278 0.00152402 4 2.114501718105385 3.26446e-08 6 2.114501750751336 1.33626e-12 8 2.114501750751458 1.4575e-12 cauchy_principal_value_test01(): Normal end of execution. cauchy_principal_value_test02(): Python version: 3.6.9 cauchy_principal_value ( Integral ( 1-delta <= t <= 1+delta ) 1/(1-t)^3 dt ) Try this for delta = 1, 1/2, 1/4. N Estimate Exact Error 2 -0.7397260273972603 -0.7363873204868445 0.00333871 4 -0.7364116807468272 -0.7363873204868445 2.43603e-05 6 -0.7363867923558026 -0.7363873204868445 5.28131e-07 8 -0.7363873252791506 -0.7363873204868445 4.79231e-09 2 -0.3425852498017447 -0.3425632583544805 2.19914e-05 4 -0.3425633493215302 -0.3425632583544805 9.0967e-08 6 -0.342563258302464 -0.3425632583544805 5.20165e-11 8 -0.342563258354488 -0.3425632583544805 7.54952e-15 2 -0.1678240178701501 -0.1678238552950642 1.62575e-07 4 -0.1678238554770549 -0.1678238552950642 1.81991e-10 6 -0.1678238552950588 -0.1678238552950642 5.38458e-15 8 -0.1678238552950641 -0.1678238552950642 1.38778e-16 cauchy_principal_value_test02(): Normal end of execution. legendre_set_test01(): Python version: 3.6.9 legendre_set() returns points and weights of a Gauss-Legendre quadrature rule. Gauss-Legendre rule of order 3: X W -0.7745966692414834 0.5555555555555556 0.0000000000000000 0.8888888888888888 0.7745966692414834 0.5555555555555556 Gauss-Legendre rule of order 6: X W -0.9324695142031521 0.1713244923791704 -0.6612093864662645 0.3607615730481386 -0.2386191860831969 0.4679139345726910 0.2386191860831969 0.4679139345726910 0.6612093864662645 0.3607615730481386 0.9324695142031521 0.1713244923791704 Gauss-Legendre rule of order 11: X W -0.9782286581460570 0.0556685671161737 -0.8870625997680953 0.1255803694649046 -0.7301520055740494 0.1862902109277343 -0.5190961292068118 0.2331937645919905 -0.2695431559523450 0.2628045445102467 0.0000000000000000 0.2729250867779006 0.2695431559523450 0.2628045445102467 0.5190961292068118 0.2331937645919905 0.7301520055740494 0.1862902109277343 0.8870625997680953 0.1255803694649046 0.9782286581460570 0.0556685671161737 legendre_set_test01(): Normal end of execution. cauchy_principal_value_test(): Normal end of execution. Tue Oct 19 11:25:04 2021