7
Estimating the number of Prime numbers less than a given positive integer by a novel quadrature method: A study of Accuracy and Convergence. Mushtaque Ahamed A, Snehanshu Saha (communicating author) Department of Computer Science, PES Institute of Technology-South Campus, Bangalore, Karnataka, India. Email:mushtaqueahamed4 [email protected] Email:[email protected] Abstract-The role of Numerical Integration in the evaluation of definite improper integrals is being increasingly appreciated as there are no simple analytical results available. In this paper the authors explore four such quadrature formulae and their performance in evaluating Logarithmic integrals, a class of definite improper integrals and one of the important integrals in Number Theory. The performance of the proposed methods are compared with some well known quadrature formulae like Simpson's rule, apezoidal rule , Weddle's rule etc. AMS Subject Classifiction : 65D30 Numerical integration, 65D32 Quadrature formulae. Keywords-Quadrature formu, Logarithmic integl, Degree of Accuracy. INTRODUCTION An analytical formula for estimating the exact number of prime numbers less than a given positive integer is not known. But Several approximations exist. (x) is a theoretical function that denote number of prime numbers less than the positive integer x. The best known approximation to (x) is Li(x) , which is an improper definite integral. There is no known analytical approximation to Li(x )[5], [6], [7], [S] either. Here we explore a novel quadrature method to evaluate this integral. THE TEN PARTS RULE FOR NUMERICAL INTEGRATION The quadrature formula for numerical integration with 10 parts is the following : lX10 f(x)dx = Xo where 5h 299376 [16067(yo + YlO ) +106300( Yl + yg ) -48525(Y2 + Ys ) +272400( Y3 + Y7 ) -260550(Y4 + Y6 ) + 427368Y5] h= XlO - Xo 10 Xi =X o + ih 978-1-4799-3080-7114/$31.00 ©2014 IEEE for i=0,1,oo.1O and It is exact for a polynomial integrand of degree equal to eleven. By approximating the fractional values to simpler fractions using continued fractions [2],we obtain a simpler version of above rule as the second approximation lXlO f(x)dx = Xo h [(Yo + YlO ) + 7( Yl + yg) - 3 Y2 +Ys ) + 18( Y3 + Y7 ) - 17(Y4 + Y6 ) +28Y5] and the first approximation respectively. lx10 h 128 245 f(x)dx = [ 477 (yo + ylO ) + 138 ( Yl + yg ) Xo RELATED WORK Some of the most used and cited quadrature rules are the Simpson's 1I3rd rule, the Simpson's 3/Sth rule, the Trapizoidal rule and the Weddle's rule among others [ 1] with degree of accuracy of 3, 3, 1 and 6 respectively. The rules are stated for convenience below. Simpson's 1I3rd rule : Simpson's 3/Sth rule : lX 3 3h f(x)dx= -[yO + 3 Yl + 3 Y2 + Y3] Xo 8 Trapizoidal rule: 415

lXlO rule as the second approximation Xo Xo 477 (yo +ylO ...h = XlO - Xo 10 Xi = Xo + ih 978-1-4799-3080-7114/$31.00 ©2014 IEEE for i=0,1,oo.1O and It is exact for a polynomial integrand

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: lXlO rule as the second approximation Xo Xo 477 (yo +ylO ...h = XlO - Xo 10 Xi = Xo + ih 978-1-4799-3080-7114/$31.00 ©2014 IEEE for i=0,1,oo.1O and It is exact for a polynomial integrand

Estimating the number of Prime numbers less than a

given positive integer by a novel quadrature method:

A study of Accuracy and Convergence.

Mushtaque Ahamed A, Snehanshu Saha (communicating author) Department of Computer Science,

PES Institute of Technology-South Campus, Bangalore, Karnataka, India.

Email:mushtaqueahamed4 [email protected] Email:[email protected]

Abstract-The role of Numerical Integration in the evaluation of definite improper integrals is being increasingly appreciated as there are no simple analytical results available. In this paper the authors explore four such quadrature formulae and their performance in evaluating Logarithmic integrals, a class of definite improper integrals and one of the important integrals in Number Theory. The performance of the proposed methods are compared with some well known quadrature formulae like Simpson's rule, Trapezoidal rule , Weddle's rule etc.

AMS Subject Classifiction : 65D30 Numerical integration, 65D32 Quadrature formulae.

Keywords-Quadrature formula, Logarithmic integral, Degree of Accuracy.

INTRODUCTION

An analytical formula for estimating the exact number of prime numbers less than a given positive integer is not known. But Several approximations exist. 1l'(x) is a theoretical function that denote number of prime numbers less than the positive integer x. The best known approximation to 1l'(x) is Li(x), which is an improper definite integral. There is no known analytical approximation to Li(x )[5], [6], [7], [S] either. Here we explore a novel quadrature method to evaluate this integral.

THE TEN PARTS RULE FOR

NUMERICAL INTEGRATION

The quadrature formula for numerical integration with 10 parts is the following : lX10

f(x)dx = Xo

where

5h 299376 [16067(yo + YlO)

+106300(Yl + yg) -48525(Y2 + Ys) +272400(Y3 + Y7) -260550(Y4 + Y6) + 427368Y5]

h = XlO - Xo 10

Xi = Xo + ih

978-1-4799-3080-7114/$31.00 ©2014 IEEE

for i=0,1,oo.1O

and

It is exact for a polynomial integrand of degree equal to eleven. By approximating the fractional values to simpler fractions using continued fractions [2],we obtain a simpler version of above rule as the second approximation lXlO

f(x)dx = Xo h "4 [(Yo + YlO) + 7(Yl + yg) - 3Y2

+Ys) + 18(Y3 + Y7) - 17(Y4 + Y6) +28Y5]

and the first approximation respectively. lx10 h 128 245 f(x)dx = [477

(yo + ylO) + 138(Yl + yg) Xo

RELATED WORK

Some of the most used and cited quadrature rules are the Simpson's 1I3rd rule, the Simpson's 3/Sth rule, the Trapizoidal rule and the Weddle's rule among others [ 1] with degree of accuracy of 3, 3, 1 and 6 respectively. The rules are stated for convenience below. Simpson's 1I3rd rule :

Simpson's 3/Sth rule : lX3 3h f(x)dx = -[yO + 3Yl + 3Y2 + Y3] Xo 8

Trapizoidal rule:

415

Page 2: lXlO rule as the second approximation Xo Xo 477 (yo +ylO ...h = XlO - Xo 10 Xi = Xo + ih 978-1-4799-3080-7114/$31.00 ©2014 IEEE for i=0,1,oo.1O and It is exact for a polynomial integrand

Weddle's rule:

The efficacy and effectiveness of our method has been com­pared with these rules. The rest of the paper is organized as follows: A formal proof of the "ten parts rule" is enunciated with the derivation of the first and the second approximations. Next, the "twelve parts" rule has been stated as a matter of fact while omitting the obviously similar proof! The authors then proceed to derive the theoretical proof of the accuracy and present the formal algorithm. The implementation uses the case study mentioned earlier and graphical/tabular illustrations and comparisons are provided to compare and contrast the method proposed and the existing ones. The paper concludes with satisfying benchmarks, namely convergence and accuracy.

PROOF OF TEN PARTS RULE

Proof Let us consider the closed newton-cotes (n+ 1)­points quadrature formula [ 1]

lxo+nh f(x)dx = Xo lxo+nh ( CXJ (t::,.k k-l ))

Xo Yo + {; kro }] (r - i) dr

where

and

x - xo r=--h

k t::,.kyO = L C(k,j)( _l)k-jYj

j=O For a 10 parts rule n = 10. The first 10 terms of the summation are sufficient. This gives us,

lXlO 110 f(x)dx = Yo dr Xo 0 10 ("'k_ C(k J·)(-l)k-jy. rlO k-l )

+ L DJ-O '

k! J In II (r - i)dr k=O

0 i=O

The above equation needs to be simplified and this requires expanding the inner most product and then evaluating its integral. Next, we multiply the integral with the summation term. This results in the terms getting summed up to yield the final result. The required expansions of the integral of the product are as follows.

J dr=r

J rdr = r;

J r3 r2 r(r - l)dr = - - -3 2

J X4 3 2 r(r - l)(r - 2)dr = 4 - r + r

J r5 3r4 11r3 r(r - l)(r - 2)(r - 3)dr = - - - + - - 3r2 5 2 3

J r6 35r4 r(r - l)(r - 2)(r - 3)(r - 4)dr = - - 2r5 + -

6 4 50r3

--- + 12r2 3

j. . ? �

r(r - 1)(r - 2)(r - 3)(r - 4)(r - 5)dr = - - -7 2

5 225r4 274r3 2 +17r - -- + -- - 60r 4 4

J r(r - l)(r - 2)(r - 3)(r - 4)(r - 5)(r - 6)dr =

r8 175r6 '8 - 3r7 + -6- - 147r5 + 406r4 - 588r3 + 360r2

J r(r - l)(r - 2)(r - 3)(r - 4)(r - 5)(r - 6) r9 7r8 980r6 6769r5 (r - 7)dr = - - - + 46r7 - -- + --9 2 3 5

-3283r4 + 4356r3 - 2520r2

J r(r - l)(r - 2)(r - 3)(r - 4)(r - 5)(r - 6) rIO 273r8 (r - 7)(r - 8)dr = - - 4r9 + -- - 648r7 10 4

7483r6 67284 5 + __ _ r

+ 29531r4 _ 36528r3 2 5

+20160r2

j' r(r - l)(r - 2)(r - 3)(r - 4)(r - 5)(r - 6) rll 9rlO 290r9 (r - 7)(r - 8)(r - 9)dr = - - - + --11 2 3

4725r8 89775r6 --4- + 9039r7 2 + 144736r5

-293175r4 + 342192r3 - 181440r2

Evaluating the above integrals with limits 0 to 10 produces the following values

rIO Jo

dr = 10

rIO 0 Jr II (r - i)dr = 50 o i=O

rIO I 425 In

II(r - i)dr = 3 o t=O

rIO 2 800 In

II(r - i)dr = 3 o t=O

416 20 J 4 International Conference on Advances in Computing, Communications and Informatics (ICACCI)

Page 3: lXlO rule as the second approximation Xo Xo 477 (yo +ylO ...h = XlO - Xo 10 Xi = Xo + ih 978-1-4799-3080-7114/$31.00 ©2014 IEEE for i=0,1,oo.1O and It is exact for a polynomial integrand

riO 3 6275 Jo

II (r - i)dr = 18 o i=O

riO 4 625 Jo

II (r - i)dr = 2 o i=O 10 5

r II (r - i)dr = 158975

Jo 756 i=O j.10 6 . 17800 II(r - z)dr =--o 189 i=O j.10 7 . 123575 II(r - z)dr =--o 4536 i=O j.lO S . 20225

II(r - z)dr = --o i=O 4536 10 9 r II(r _ i)dr = 80335 Jo i=O 299376

Using the above values, the ten parts rule is obtained as,

f(x)dx = lOYo + 50�yo + _�2yO + _�3yO lX10 425 800 � 3 3 6725

�4 625 �5 158957

�6 17800 �7 +18 Yo + 2 Yo + � Yo + 189 Yo

123575 �s 20225

�g 80335 �10 + 4536 Yo + 4536 Yo + 299376 Yo

Now, we evaluate �kyO = L�=o C(k,j)( _1)k-jYj for k = 1,2, .. ,10

�Yo = YI - Yo

� 7 Yo = Y7 - 7Y6 + 21Y5 - 35Y4 + 35Y3 -21Y2 + 7Y1 - Yo

�syo = Ys - 8Y7 + 28Y6 - 56Y5 + 70Y4 -56Y3 + 28Y2 - 8Y1 + Yo

�gyO = yg - 9ys + 36Y7 - 84Y6 + 126Y5 -126Y4 + 84Y3 - 36Y2 + 9YI - Yo

� 10

Yo = YlO - lOyg + 45ys - 120Y7 + 21OY6 -252Y5 + 21OY4 - 120Y3 + 45Y2 - lOYl + Yo

Further simplification the above equations results in the ten parts rule as follows.

lXlO f(x)dx Xo 5h

299376 [16067(yo + YlO)

+106300(Yl + yg) -48525(Y2 + Ys) +272400(Y3 + Y7) -260550(Y4 + Y6) + 427368Y5]

This completes the proof.

DERIVATION OF THE FIRST

ApPROXIMATION

Consider the ten parts rule. The numerical coefficients of each of the Yi for i = 0,1, ... , 10 can be expressed by simpler fractions obtained by the method of continued fractions. The idea presents itself. Given a number N, it may be expressed as

1 N=no+ 1 nl + 1 n2+ fi3+'"

and may be represented as

for simplicity.

Let N be a rational number such that ni = 0 , Vi > k in its "continued fraction" form. Then a simpler rational approximation for N is obtained by choosing j < k terms of that continued fraction and further simplifying the reduced continued fraction to another fraction. The process mentioned above is carried out for the numerical coefficients of the terms Yi where i = 0,1, ... , 10 as N with a suitable value of j. We

II h D II . . I'fi d f . eventua Iy et t e o owmg slmpll e ractIOns. i

o and 10 1 and 9 2 and 8 3 and 7 4 and 6 5

co-eff of Yi 0.2683 ... l.7753 ... -0.8104 ... 4.5494 ... -4.35 15 ... 7.l376 ...

Continued rational fraction form [0;3, 1,2, 1, 1, 1, 1 1] 128/477 [ 1; 1,3,2,4, 1,2] 245/ 138 -[0; 1 ,4,3, 1, 1, 1,2] - 124/ 153 [4; 1, 1,4, 1, 1,4] 4 14/9 1 -[4;2, 1 ,5,2,3] -557/ 128 [7;7,3, 1,3,2,2] 4304/603

The contmued tractIOns are a roxlmated to a SUItable nu pp mber of terms. By using these simpler fractions in the ten parts rule as a substitute for the original coefficients, we obtain the first approximation.

DERIVATION OF SECOND

ApPROXIMATION

Consider the ten parts rule. The numerical coefficients of each of the Yi for i = 0,1, ... , 10 in their decimal forms and their rational approximations are as follows.

2014 International Conference on Advances in Computing, Communications and Informatics (ICACCI) 417

Page 4: lXlO rule as the second approximation Xo Xo 477 (yo +ylO ...h = XlO - Xo 10 Xi = Xo + ih 978-1-4799-3080-7114/$31.00 ©2014 IEEE for i=0,1,oo.1O and It is exact for a polynomial integrand

i

0 1 2 3 4 5 6 7 8 9 10

Total

co-eff. of Yi

0.2683 l.7753 -0.8lO4 4.5494 -4.35 15 7. 1376 -4.35 15 4.5494 -0.8lO4 l.7753 0.2683

lO

decimal rational approx. form 0.25 114 1.75 7/4 -0.75 -3/4 4.50 18/4 -4.25 - 17/4 7.00 28/4 -4.25 - 17/4 4.50 18/4 -0.75 -3/4 1.75 7/4 0.25 1/4 lO lO

The a roxImatlOn was achIeved III de pp cimal form to a value close to the multiple of 0.25 so as to write those in fractions with 4 in the denominator. Moreover the adjustment is tuned in a way that the result turns out to be exact for the integral

1lO dx = lO

This is the sum of the approximated coefficients which is equal to the sum of coefficients(which equal lO). This yields the second approximation as follows. lXlO

Xo f(x)dx = h 4 [(yO + YlO) + 7(Yl + yg) - 3Y2

+Ys) + 18(Y3 + Y7) - 17(Y4 + Y6) +28Y5]

THE TWELVE PARTS RULE FOR

NUMERICAL INTEGRATION

Similar evaluation with n = 12 leads us to the following result. lX12

Xo f(x)dx = h

5255250 [1364651(yo + yd

+9903168(Yl + Yll) -7587864(Y2 + YlO) +35725120(Y3 + yg) -51491295(Y4 + Ys) +87516288(Y5 + Y7) - 87797136Y6]

DEGREE OF ACCURACY

The degree of accuracy, or precision of a quadrature formula is the largest positive integer n such that the formula is exact for xk,for each k = 0,1, ... , n, and for our method, it turns out to be equal to eleven.

Proof of Degree of Accuracy

Theorem 1: Suppose, 2:7=0 ad(xi) denotes (n+1) - points Newton cotes formula with Xo = a, Xn = band h = (b-a)jn. Then there exists E E (a, b) for which

lb n hn+3 fn+2(E) jn f(x)dx = L ad(xi) + ( )'

t2(t - 1) a i=O n + 2 . 0

···(t- n)dt

I: procedure LI(x) [> Input: Upper limit of logarithmic integral, x [> Output: Value of the integral Li(x)

2: n f- 10000 [> number of partitions 3: coef f [ ] f- (1,7, -3, 18, -17,28, -17, 18, -3,7,1) [>

Array of co-efficients for Second approximation 4: h f- (x - 2)jn [> step size 5: for if-I to n do 6: Z f- 2 + i * h 7: t [i] f- 1jln(z) 8: end for 9: sum f- t [l] + t [n]

10: for i f- 2 to n - 1 do II: sum f- sum + coef f [i( mod 10) ] * t [i] 12: end for 13: return sumj 4 [> value of Li(x) 14: end procedure

Fig. l. Algorithm for Li(x), implementing the Second Approximation of Ten parts rule with n = 10000

,if n is even and f E Cn+2 [a, b] . [ 1] The error term of function f is

hn+3 r+2(E) r 2 E(f) = (n + 2)! Jo

t (t - 1) .. · (t - n)dt

Now, consider f(x) to be a polynomial of degree k. This implies that the k + 1 th derivative of f(x) is OThe error term is zero when fn+2(E) is O. This is true when f(x) is a polynomial of degree < n + 2. Therefore the degree of f(x) is at-most n + 1 so as to render the error term to zero and the quadrature formula to be exact.Thus at-most k = n + 1 and n = 1O( by construction ) . Hence, at the most, the value of k is 1 1. This completes the proof.

ALGORITHM

The algorithm uses the second approximation of the ten parts rule. Similar algorithm with coefficients corresponding to other quadrature methods can be used to evaluate Li(x). The algorithm has O(n) time complexity, and O(n) space complex­ity, where n is the number of partitions. The Algorithm can also be executed in parallel as a large fraction of the algorithm is embarrassingly parallel. No tolerance criterion is included as the result depends on the number of partitions, and we needed to sum up all n terms to arrive at the result.

CASE S TUDY

Consider the problem of estimating of number of prime numbers less than given positive integer x. Theoretically it is given by 1r(x). Evaluation of1r(x) is not simple. But a simple approximation such as 1r(x) = Ir� x exists. But this method does not possess the desired accuracy. A more accurate approximation is

1 1 1r(x) = Li(x) - "2Li(vx) - 3Li({YX) - ...

or simply 1r(x) ::::; Li(x) where lx dt Li(x) = -1

2 n t

418 20 J 4 International Conference on Advances in Computing, Communications and Informatics (ICACCI)

Page 5: lXlO rule as the second approximation Xo Xo 477 (yo +ylO ...h = XlO - Xo 10 Xi = Xo + ih 978-1-4799-3080-7114/$31.00 ©2014 IEEE for i=0,1,oo.1O and It is exact for a polynomial integrand

is the logarithmic integral[3]. This is an definite improper integral, by definition. The following table shows the value of Li(x) and the approximate values obtained by the above mentioned formula with 10000 partions.

x 10

102 103 104 105

IAtlLl

x 10

102 103 104 105

Li(x) 10 parts 12 parts

mle rule

5. 120435 5. 120548 5. 121651

29.080977 29.080844 29.088422

176.564494 176.563309 176.615036

1245.092052 1245.088082 1245.474715

9628.763837 9630.073073 9632.924792

L. VALUES OBTAINED BY IV PART S RU LE AND 12 PART S RULE

UP TO SIX DECIMAL PLACES.

First Second Simpson's

approx. approx. 113rd rule

5. 120349 5.120301 5. 120320

29.080442 29.080170 29.080268

176.560477 176.559177 176.559682

1245.051814 1245.056336 1245.068788

9629.516111 9629.642260 9630.211977

TABLE II. VALUES OBTAINED BY FIRS T AND SECOND

APPROXIMATIONS AND SIMPSON'S 1I3RD UP TO SIX DECIMAL PLACES.

x Simpson's Weddle's Trapezoidal 3/8lh rule rule rule

10 5. 120219 5.120401 5. 120262

102 29.079648 29.080765 29.079922

103 176.555472 176.563050 176.558133

104 1245.044568 1245.088164 1245.118324

105 9630.321006 9630.124754 9631.706689

AtlLE III. VALUES OBTAINED BY :SIMPS ON'S 3/STH RULE

,WEDDLE'S RULE AND TRAPEZOIDAL RULE UP TO SIX DECIMAL PLACES.

It is evident from the above calculations that the most accurate formula is the Second approximation of the 10 parts rule.

ACCURACY

Further investigation with various number of partitIOns gives a clear picture. Relative error gives a measure of accuracy of the method. A comparison of relative error between different methods for various values of upper limit x and various number of partitions is shown in the following graphs The closer a

240 220 200

h 180 , 160 0 � 140 � ll0 1i 100 .. a: 80

60 40 lO

1

Accuracy of various Quadrarure Formula wilh 10 partitions

1.5 l.S

10 pa rt rule -­First 2tppro xlmBtlon

Secon(approE£na tl n --2::'f)lHts Jul� -­

W eddle's -rule Simpson's 3/Bth -rule

TrapizOidaCrule -­Simpson's_l/Jrd _rule --

3.5 4.5 Common LogariChm of Upper Umit (x) ->

Fig. 2. Accuracy of various Quadrature Fonnula with 10 partitions

line is to the line Relative Error = 100, more accurate is the result and better is its performance. We see that, in figures 1 to 5 , the graph of second approximation (blue line) is closest to the line Relative Error = 100. Although Weddle's rule (sky

Accuracy of varlou5 Quadrature Formula with 100 partitions I llr----,-----r-----r----�----r_--_,----_r----�

10 part ��!� � 110 F lrscapprOXim��� 108 s ec:on d_appro:�a:r� === 106 eddle's-rule

mpson's 3/8th -rute 104 Trapizoldal-rule --102 Simpson's_l}3rd:rule --IOO �======������ ____ __

98r---------________ __ 96 94 92 L-__ � ____ _L ____ _L ____ � ____ L-__ � ____ _L ____ �

I 1.5 l.S 3.5 4.5 Common Logarltl'lm of upper Umit (x) ->

Fig. 3. Accuracy of various Quadrature Fonnula with 100 partitions

101

100.8 100.6

1 � 100.'

100.2 � :; 100 .. '" 99.8

99.6

99 .• I

Accuracy of varloLJs Quadrature formul211 with 1000 partitions

1.5 2.5

10jlan_rule -­first_approximation

Second approximation -llJlarts_ I --Weddle" Ie

Simpson's 3 h -rule Trapf oldal-rule -­Sim OO' s_1/3r(ru l e

3.5 4.5 Common logarithm of Upper Umit (xl u>

Fig. 4. Accuracy of various Quadrature Fonnula with 1000 partitions

Accuracy of var i ous Quadra.tur� Formula with 10000 partitions 100.05 100.04 100.03

h , 100.02

� 100.01 100 � 1i 99.99

.. 99.96 a: 99.97

99.96

99.95 I 1.5 l.S 3.5 '.5

Common lOgarilhm or upper Umll (:t) .. >

Fig. 5. Accuracy of various Quadrature Fonnula with 10000 partitions

$ � > 'iii .. 0:

Fig. 6.

100

99.9995

99.999

99.9985

99.998

99.9975

99.997

99.9965

Acc.uracy of various Ouadrature Formula with 100000 partitions

I __________________ �s::.:co:n::d-::iappfoxlmatlo I - I'=PO _rule --

1 1.5

-------Weddle!-s rule SlmpSCIn'S_3/8th:rule

Traplzoidal rule -­Simp500n'5_l/3rd:rule --

2.5 3.5 Common Logarithm of Upper Umit (x)->

4.5

Accuracy of various Quadrature Fonnula with 100000 partitions

2014 International Conference on Advances in Computing, Communications and Informatics (lCACCl) 419

Page 6: lXlO rule as the second approximation Xo Xo 477 (yo +ylO ...h = XlO - Xo 10 Xi = Xo + ih 978-1-4799-3080-7114/$31.00 ©2014 IEEE for i=0,1,oo.1O and It is exact for a polynomial integrand

blue line) seems to be closest, it quickly falls off and then the blue line takes over. The Simpson's 1I3rd rule (orange line) has the worst performance of all. It shoots up rapidly, as seen from the graph. In figures 1 to 3, the graph of 10 parts rule(red line) and the second approximation overlap, but the distinction is clear in figures 4 and 5. This indicates that the 10 parts rule and the second approximation have similar performance in term of accuracy. Comparing all the methods, we see that the second approximation of the 10 parts rule has the best performance.

Note:Here all the relative errors are normalized to 100.

ORDER OF CONVERGENCE

Convergence is measure of variation in absolute error with the variation in the number of partitions. So, a graph of absolute error versus number of partitions for various methods and values of the upper limit x, demonstrates the convergence. The following graphs make the above points clear.

� -1

i ·2 '0 .3 E :; -I: .4 j � -5 E

Order of Convergence with upper limit x = 10

10-P8rt_rule -­First 3pproxlmation

Second:approxlmation --12yartsJuie -­

Weddle's rule Simpson's 3/81h -rule Trapiioida'-rul@ --Simp 3rd:rule --

8 -6�-�--�--�--�--�-��-�--� I 1.5 2.5 3,5 4.5

Common logarithm of Partition •. >

Fig. 7. Convergence when Upper limit x = 10

� 0 � S .1 � '0 .2 E :; � -3 S � .. �

Order of Convergence with Upper limit J( "" 100

lOyan_rule -­First_approximation

Second approximation -­- 12JNU1s_,ule -­

Weddle's rule Slmpson'S_318t(rule

Traplzoldal rule -­n'S_1/3r(rule --

u .5�-�--�--�--�--�-��-�--� I 1,5 2.5 3,5 4.5

Common logarithm of PanItion .• >

Fig. 8. Convergence when Upper limit x = 100

j 1

� � 0 � a .1 � 'C & -2 .9 � ·3 �

Order of Convergence with upper limit x • 1000

lOyCirt_rule -­first QlPpr-oximation

Second-approximation -­- 12J>art5_rule -­

Weddle's rule Simpson's 3/8th -l1Jle

Trapizoidal-rule -­son'S_1/3r(rule --

u ,,� __ � ____ � ____ -L ____ � ____ � ____ � __ � ____ � 1 2,5 3,5 4,5

Common Logarithm of Partition -->

Fig. 9, Convergence when Upper limit x = 1000

! 2

i '0 0 E :; '� ·1 .9 c � -2 �

Order of Convergence with Upper limit x "" 10000

IOJlart_rul� -­First approximation

Second:approxfmation --12

-parts_rule -­

Weddle's rule Simpson's 3J8th -�ule

Traptzoiclal-�ule -­pson's 1/3rd -rule

u .3�--�----�-----L----�----�--��--�----� 1 3.5 4.5

Common logarithm of Partition •. :>

Fig. 10, Convergence when Upper limit x = 10000

For a given number of partitions, the method with higher order of convergence shows a smaller absolute error in the result. In figures 6 to 10 we see that the method with smallest absolute error for a given upper limit x and a small number of partitions, is the second approximation of the 10 part rule. There is a trade off between absolute error and the number of partitions. The optimal method is the one that generates smallest absolute error possible with the least number of partitions. The least number of partitions imply that the computational time is less. Thus the method converges faster. These parameters help us deduce that the best method is the second approximation of the 10 part rule.

420 20 J 4 International Conference on Advances in Computing, Communications and Informatics (ICACCI)

Page 7: lXlO rule as the second approximation Xo Xo 477 (yo +ylO ...h = XlO - Xo 10 Xi = Xo + ih 978-1-4799-3080-7114/$31.00 ©2014 IEEE for i=0,1,oo.1O and It is exact for a polynomial integrand

A ,

� 3

� " 51 � I '0 E 0 £ � '" ·1 S " 0 ·2 E E 0 u ·3

I 1.5

Order of Convergence with Upper limit x _ 100000

2.5

IOy.rt_Nle -­First approximatIon Secon(.-approximatlon -­- 12_pcutsJule -­Weddle's rule Simpson's 3/8th -rule

Trapiioidar rule -­-......���lL3r(rul. --

3.5 4.5 Common logarithm of Ftartition u>

Fig. 11. Convergence when Upper limit x = 100000

REMARK

The Second approximation of 10 parts rule has remarkably simple numerical coefficients and boasts of better performance than the original 10 part rule. Moreover, the formula is comparatively better as it has the highest accuracy and order of convergence. The method is highly stable and its stability increases with larger number of partitions. For any numerical integration problem, the exact behavior of the method in terms of accuracy and convergence depends on the integrand being integrated. In the case of the integral Li(x), the second approximation of the 10 parts rule has the best performance. Hence we conclude that our method is a better alternative to various standard quadrature formulae for the numerical computation of Li(x).

REFERENCES

[I] Burden, R. and Faires, J.,Numerical Analysis,Cengage Learning(201O).

[2] Hensley, D .. Continued Fractions.Worid Scientific(2006).

[3] Crandall, R. and Pomerance, C.B .. Prime Numbers: A Computational Perspective,Lecture notes in statistics, Springer(2006).

[4] Cojocaru, AC. and Murty, R. and London Mathematical Society,An Introduction to Sieve Methods and Their Applications,London Mathe­matical Society Student Texts,Cambridge University Press(2006).

[5] Bach, E. and Shall it, J.O.,Algorithmic Number Theory: Efficient algo­rithms, v. I,Algorithmic Number Theory,MIT Press(l996).

[6] Dickson, L.B.,History of the Theory of Numbers, Volume I: Divisibility and Primality,Dover Publications(2012).

[7] Computing 1r(x): The Meissel, Lehmer, Lagarias, Miller, Odlyzko method. Marc Delglise and Jel Rivat, Mathematics of Computation, vol. 65, number 33, January 1996, pages 235245. Retrieved 2008-09-14.

[8] Barkley Rosser, J and Schoenfeld, Lowell,Approximate formulas for some functions of prime numbers,voI.6,pg.no.64-94,Illinois J. Math(l962).

20 i4 international Conference on Advances in Computing, Communications and informatics (iCACCi) 421