## 1 Introduction

Fractional calculus may be described as an extension of the concept of a derivative operator from integer order *n* to arbitrary order *ν*, where *ν* is a real or complex value or a complex valued function *ν* = *ν*(*x,t*) [1]:

Beginnings of fractional calculus indeed date to the same time as classical calculus. However, the question of consequences of “taking square root of 1* ^{st}* derivative” arose in 1695 [2] is not to be discussed for more than 100 years. Well known Riemann-Liouville definition of fractional derivative and integral was reported by Liouville in 1832 and by Riemann in 1876. Grünwald introduced the idea of fractional derivative as the limit of a sum in 1867 [3].

The most rapid interest grow of this new topic can be observed in the last 40 years. The first conference “International Conference of Fractional Calculus and Its Applications” entirely dedicated to it took place in 1974 at the University of New Heaven, Connecticut, USA [4]. The first monograph dedicated to fractional calculus was published the same year [5].

From that time on, the topic won interest of scientists from various areas of mathematics, physics, chemistry, electrical engineering, economy, biological sciences. Initial works had a pure theoretical character. However, lately, can be noticed intensification of research on practical application of this tool in physics, technical, biological and economical sciences. In technical sciences, application of fractional calculus is mostly applied for areas of electrical engineering, electronics and control systems as well as image analysis and processing.

Fractional calculus requires extensive application of numerical methods, e.g. numerical integration. However, commonly applied numerical methods are not suitable for that purpose in their existing form.

Effectiveness of fractional derivatives and integrals practical applications can be increased by improving their computational accuracy. Thus, increasing computational accuracy of fractional order derivatives and integrals became a very important task to study for many computer scientists. Increasing it as high as possible and by using as little as possible hardware resources and time is a matter of aptly selected method, applied hardware, programming language and programming techniques in the process.

Growing popularity of computer as a tool for scientific research led to essential advancements of existing programming languages. C++ can be considered as best example in this context. C++ is a general purpose programming language, which enable hardware speed optimization. It is a flexible language with great versatility and it has huge function library which can be used for developing system software, e.g. operating systems, compilers, editors and data bases.

To be able to solve difficult numerical problem according to a set goal, a scientist has to make some crucial decisions regarding applied for that purpose hardware, programming tools and techniques. They include appropriate selection of computer programming languages because their abilities to process numerical data determine how accurate the solution will be.

The selection of uniform C++ equipped with standard mathematical library as a main programming tool is not enough nowadays to solve numerical problems with satisfactory accuracy.

Double precision arithmetic commonly applied in scientific numerical calculations has many flaws which influences negatively the accuracy of computations, e.g. limitations of number values which double precision variables can hold or no influence of programmer on mathematical operations rounding.

Arbitrary precision mathematical library GNU MPFR [6], built upon GNU GMP library [7] application enable any computation to be performed with any precision limited only by hardware, with either real or complex numbers. The library supports proper rounding of all mathematical operations as wel, which is crucial because most of inaccuracies, errors and limitations in scientific computations is caused by finite precision arithmetic and a lack of proper rounding of mathematical operations. The library has also at their disposal many ready to use functions, for example gamma function and reciprocal gamma function, which are extensively used for fractional order derivatives and integrals computations.

## 2 The Definitions of Fractional Order Derivatives and Integrals

English term *the fractional calculus* is misleading because it suggests that differentiation and integration orders may only assume non-integer values only. The more appropriate description of this branch of mathematics would be differentiation and integration of any order. In practice, both integration as well as differentiation order may assume irrational or rational, real or complex values [8], [9]. Differentiation operator of non-integer order may be represented with a help of generalized operator

in which:

*ν* is an order of differentiation and integration (it may assume as well real as complex values), *t*_{0}, *t* are the interval limit of differentiation or integration.

Fractional derivative or integral is determined in [*t*_{0}, *t*] interval, which narrows to a point in case of integer order. To differentiate between non-integer and integer orders, non-integer orders are commonly denoted by the Greek letters *ν* and *μ* and integer orders by the letters *m* and *n*.

The following definitions of fractional order differentiation and integration are the scope of the following paper:

- Riemann-Liouville (RL) fractional derivative [10], [11]in which
$${}_{{t}_{0}}^{RL}{\text{D}}_{t}^{\left(\nu \right)}f\left(t\right)={\left({\displaystyle \frac{d}{dt}}\right)}^{n}{\displaystyle \frac{1}{\Gamma (n-\nu )}}{\displaystyle {\int}_{{t}_{0}}^{t}{\displaystyle \frac{f\left(\tau \right)}{{(t-\tau )}^{\nu -n+1}}}}d\tau ,\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{for}(n-1<\nu <n),$$ *n*is an integer number*n*= ⌈*ν*⌉ and Γ(*x*) denotes Euler’s Gamma function. - Caputo (C) fractional derivative [10]Formulas (2) and (3) are related by
$${}_{0}^{C}{\text{D}}_{t}^{\left(\nu \right)}f\left(t\right)={\displaystyle \frac{1}{\Gamma (n-\nu )}}{\displaystyle {\int}_{0}^{t}{\displaystyle \frac{{f}^{\left(n\right)}\left(\tau \right)}{{(t-\tau )}^{\nu -n+1}}}}d\tau ,\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{for}(n-1<\nu <n).$$ $${}_{{t}_{0}}^{RL}{D}_{t}^{\left(\nu \right)}f\left(t\right){=}_{0}^{C}{D}_{t}^{\left(\nu \right)}f\left(t\right)+{\displaystyle \sum _{k=0}^{n-1}{\displaystyle \frac{{t}^{k-\nu}}{\Gamma (k-\nu +1)}}}{f}^{k}\left(0\right).$$ - Riemann-Liouville fractional derivative equivalent to (7), [12], [13]
$${}_{{t}_{0}}^{RL}{\text{D}}_{t}^{\left(\nu \right)}f\left(t\right)={\displaystyle \sum _{k=0}^{n-1}{\displaystyle \frac{{(t-{t}_{0})}^{k-\nu}{f}^{\left(k\right)}\left({t}_{0}\right)}{\Gamma (k-\nu +1)}}}+{\displaystyle \frac{1}{\Gamma (n-\nu )}}{\displaystyle {\int}_{{t}_{0}}^{t}{\displaystyle \frac{{f}^{\left(n\right)}\left(\tau \right)}{{(t-\tau )}^{\nu -n+1}}}}d\tau ,\text{\hspace{0.17em}}\text{for}(n-1<\nu <n).$$ - Riemann-Liouville fractional integral (RL) [10], [14]
$${}_{{t}_{0}}^{RL}{\text{D}}_{t}^{(-\nu )}f\left(t\right)={\displaystyle \frac{1}{\Gamma \left(\nu \right)}}{\displaystyle {\int}_{{t}_{0}}^{t}{\displaystyle \frac{f\left(\tau \right)}{{(t-\tau )}^{n-\nu}}}}d\tau ,\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{for}(n-1<\nu <n).$$

Additionally, for comparison purposes there is also applied the Grünwald-Letnikov (GL) formula of fractional order backward difference/sum [15], [13], [16]

where *t*_{0},*t* is the integration interval.

## 3 Problems of Fractional Order Derivatives and Integrals Numerical Calculations

Fractional order derivatives and integrals computational formulas (3), (5) and (6) consist of ordinary integrals. However, the integrals are difficult to compute due to presence of singularity at the end of integration interval preceded by rapid values increase (stiffness).

Each integrand included in the formulas can be divided into a kernel and a function, i.e.

Plot of the kernel of the integrand is presented in Fig. 1. Gray area denotes integral to compute.

Stiffness of the integrand can increase or decrease according to a value of power and a character of a function.

This characteristics of the kernel determines accuracy of computations.

To compute fractional order derivatives and integrals with help of formulas (3), (5) and (6) there can be applied commonly used methods of numerical integration, e.g. Midpoint Rule, Trapezoidal Rule as well as Gauss-Legendre and Gauss-Kronrod Quadratures (more informations on the methods can be found in [17] and [18]).

Due to the singularity problem in the integrand there can be applied some techniques advised in the literature [19], [20], [21], [22]: (i) Increasing of subintervals amount, (ii) Exclusion of singularity from integration, (iii) *Stretching* difficult section and application of adaptive algorithm to it (an amount of subintervals adjusted to variability of an integrand) and (iv) Integrating of reciprocal function.

Unfortunately excluding the singularity from the integration decreases in this case accuracy even more because area which contributes to integral value at most proceeds it directly.

Stretching the difficult section even many times and using an appropriately increased amount of subintervals does not effect accuracy satisfyingly. The end section of the integrand is too stiff for the listed methods of numerical integration.

Reciprocal function integration can be applied to simple, one-valued functions only. Therefore, it may not be applied as a general solution of the problem.

Another solution can be an application of numerical methods which have been developed or modified particularly for application with (3), (5) and (6). There exist only a few such methods. They are based on: (i) Extrapolation [23], (ii) Trapezoidal Rule [24], (iii) Modified Trapezoidal Rule for Caputo derivatives only [25], (iii) Mollification techniques [26], (iv) Chebyshev polynomials (for fractional integrals only) [27].

However, the only one algorithm which can be considered as significant is the one based on the Trapezoidal Rule.

Diethelm removed analytically the singularity from the integrand by applying integrating by parts and calculating some quadrature coefficients. Resulting accuracy of fractional order derivatives and integrals computations can be additionally improved by application of the Richardson Extrapolation.

Diethelm’s method has been redesigned by Odibat for application for Caputo fractional derivatives only [25]. His modifications are of minor importance and did not increased overall accuracy capabilities of the method.

Maximum of available computational accuracy of fractional order derivatives and integrals calculations applying formulas (5) and (6) and presently available methods of numerical integration is presented in the tables 1-3.

*D*^{(1/2)}*f*(*t*), *f*(*t*) = *t*, *t* ∈ (0,1), relative error in %

N | GL | NCm | Diet | Odiba |
---|---|---|---|---|

8 | 8.11 | 10.68 | 0.0004 | 0.0024 |

15 | 4.25 | 7.81 | 0.0004 | 0.0023 |

21 | 3.02 | 6.6 | 0.0004 | 0.0023 |

61 | 1.03 | 3.88 | 0.0004 | 0.0022 |

300 | 0.21 | 1.75 | 0.0002 | 0.0021 |

600 | 0.11 | 1.24 | 0.0002 | 0.0021 |

1000 | 0.06 | 0.96 | 0.0002 | 0.0021 |

*D*^{(1/2)}*f*(*t*), *f*(*t*) = *e ^{−t}, t* ∈ (0,5), relative error in %

N | GL | NCm |
---|---|---|

8 | 61.87 | 13.52 |

15 | 29.32 | 5.88 |

21 | 20.17 | 4.12 |

61 | 6.54 | 1.81 |

300 | 1.3 | 0.76 |

600 | 0.65 | 0.53 |

1000 | 0.39 | 0.41 |

*D*^{(1/2)}*f*(*t*), *f*(*t*) = sin(*t*), *t* ∈ (0,2*π*), relative error in %

N | GL | NCm | Diet | Odiba |
---|---|---|---|---|

8 | 130.03 | 45.42 | 17.67 | 5.78 |

15 | 66.14 | 33.64 | 7.95 | 3.46 |

21 | 46.09 | 28.77 | 5.18 | 2.94 |

61 | 16.1 | 17.84 | 1.53 | 2.94 |

300 | 5.02 | 9.35 | 0.62 | 2.43 |

600 | 3.67 | 7.29 | 0.56 | 2.35 |

1000 | 3.14 | 6.18 | 0.55 | 2.35 |

Applied methods include the Grünwald-Letnikov method (GL) (7), Newton-Cotes Midpoint Rule (NCm) and modified Trapezoidal Rule by Diethelm (Diet) and Odibat (Odiba). There are not included any results for Gauss Quadratures because they are not suitable for this kind of calculations (relative error exceeding 90%). The same applies to Diethelm’s and Odibat’s method applied for fractional derivative of the exponential function.

The programs for this part has been created by the author using algorithms described in the freely available papers and literature of the subject.

Computational accuracy measure assumed in the following section is percentage relative error. Computer programs are written using C++ with double precision and complied applying GNU GCC compiler.

Computer configuration include Intel i7 processor, 8GB of RAM and Linux Ubuntu 14.04 LTS 64-bit operating system.

The results presented in the Tables 1-3 suggest that increasing an amount of subintervals N does not improve computational accuracy satisfyingly.

The method by Diethelm and its modification by Odibat enable to calculate fractional derivatives and integrals of some orders and of some functions with accuracy limited at best to 3-4 decimal places.

Therefore, the conclusion is that none of the presently available methods can be considered as a method of general use which assures computations of fractional derivatives and integrals with high accuracy independently from order, interval and type of the function.

## 4 Three Approaches to the Accuracy Increase for Riemann-Liouville and Caputo Formulas

Conducted survey suggests that to calculate fractional order derivatives and integrals with higher accuracy than presently is possible either an applied method of numerical integration must be adapted to handle with high-accuracy an integrand with the difficult feature or an integrand must be transformed to fit into a numerical method’s of integration requirements for high accuracy of computations.

In the next three subsections there are presented various approaches to the subject of accuracy increase of fractional order derivatives and integrals computations for application with the Riemann-Liouville and Caputo formulas.

### 4.1 Analytical Integrand Transformation Prior Numerical Integration

A method of transforming an integrand is analytical integrand transformation via independent variable substitution. It has to be conducted prior numerical integration.

Its rules are well known from analytical integration. However, this time instead of transforming an integrand into one which is analytically easier integrable, the goal is to obtain an integrand with a shape which fits into requirements of a selected method of numerical integration for high accuracy of computations.

- Application of variable change
$$1-\tau \to {e}^{1-1/u}$$

in kernel of formula (5) and (6) removes singularity from the integrand and it makes it smoother.

For an example function *f*(*t*) = **1**(*t*), *t*_{0} = 0,*t* = 1 and fractional order of integral *ν* = 0.5 we calculate

Transformation (9) and integration interval change (10) is presented in Fig. 2.

Transformation (9) is now applied for practical accuracy increase using two periodic functions:

Fractional order integration formula (6) for the function (11) and order (−*ν*) assumes the following form

and for the function (12) assumes the form

The accuracy of computations are presented in Figs 3(a) and 3(b). Due to similar performance of the methods for all three evaluated orders *ν* = 0.2,0.5,0.8, there are presented only plots for fractional order integrals of order *ν* = −0.5 and derivatives of order *ν* = 0.5.

For accuracy increase evaluation there are applied well known quadratures. They are considered as highly accurate and efficient if an integrand fulfills their requirements. The methods include: Newton-Cotes Midpoint Rule (NCm), Gauss-Legendre Quadrature (GLeg), Gauss-Kronrod Quadrature (GKr), Gauss-Laguerre Quadrature (GLag), Gauss-Jacobi Quadrature (GJ).

The Grünwald-Letnikov formula (GL) (7) is applied for comparison purposes. Although it operates strictly on a integrated function’s values and can not be tested on transformed integrand, its accuracy can be considered as a point of reference.

Exact values required for error computation are calculated using analytical formulas to be found in [28], [3] and [12]. If a formula is not to be found, there is applied a novel approach to the accuracy assessment of fractional order derivatives and integrals using generalized fractional operators concatenation rules [29].

In the plots with results, accuracy of integration applying unchanged integrands are denoted with prefix RL, e.g. RL GKr and with modifications applied to the integrand - with prefix mRL, e.g. mRL GKr.

For fractional derivatives of order (*ν*), differentiation formula (5) for the function (11) assumes the following form

and for the function (12) assumes the form

The accuracy of computations are presented in Figs 4(a) and 4(b).

**Final remark:**

Analytical independent variable substitution in the integrand is a very effective method of accuracy increase. An average four times accuracy increase of the transformed integrand integration proves it. Application of the technique improves efficiency as well; the increased accuracy is obtained by using half of the sampling points required by the same numerical integration method applied to the unchanged integrand.

How high the accuracy increase actually is depends on the shape of the transformed integrand and how much it agrees with an “optimal” shape for high accuracy integration by applying particular method of integration.

Nevertheless, “manual” transformation is arduous and time consuming, which can hinder some applications.

### 4.2 Integrand Transformation as a Numerical Quadrature. The Double Exponential Transformation

Transformation of an integrand via independent variable substitution can also be applied in form of a numerical quadrature. Such approach enables to omit arduous analytical transformation of each integrand and automate the whole transformation process.

An efficient and universal method of an integrand transformation is known as the Double Exponential Transformation (DE). The DE Transformation is a joint of hyperbolic function independent variable substitution in the integrand and the Trapezoidal Rule.

Such transformed form will be referred as the Double Exponential Quadrature (the DE Quadrature).

The general idea of this kind of variable transformation was proposed for the first time by Korbov [30]. It also became a subject of works of Schwartz [31], Stenger [32], Takahasi [33], Mori [34], Haber [35] and others, who gave it different names.

The DE transformation never achieved a wider popularity due to poor publicity and some drawbacks. The drawbacks are mainly associated with the limitations of the single and double precision arithmetic applied in the initial programming at the time of development, e.g. limited range of applied single and double precision variables which can cause under- and over-flow when calculating weights required for the quadrature.

Two solutions of this problem, which involve another substitution at the singularity point have been published in [36], [37], [34] and lately in [38].

Unfortunately, application of the solutions decrease overall accuracy abilities of the method.

The problem can also be solved by applying arbitrary precision variables and arbitrary precision mathematical library GNU MPFR, which improves accuracy of the DE Transformation.

In the following section, the DE Transformation is applied to calculate fractional orders derivatives and integrands applying formulas (5) and (6).

The DE Transformation implemented for the purpose of fractional orders derivatives and integrands computations is based on the transformation, which was proposed by Schwartz [31] as the Tanh Rule. It can be described as follows:

Let us consider the integral

where *f*(*x*) is integrable on interval (*a*,*b*). The function *f*(*x*) may have singularity at *x* = *a* or *x* = *b* or at both ends.

First we apply the following variable transformation

We obtain

It is important that *ϕ*(*t*) possesses the property such as *ϕ*′(*t*) converges at least at single exponential rate as *t* → ±∞

where *c* is some constant. After that, it is best to apply the Trapezoidal Rule to the transformed integrand expression [32], [39]

where *h* is subinterval width. Due to the property (16) truncation of the summation process can be done at some arbitrarily chosen *n* = −*N* and *n* = +*N*

where *N* states the amount of subintervals.

Since *ϕ*′(*nh*) as well as the whole expression *f*(*ϕ*(*nh*))*ϕ*′ (*nh*) converges at least at exponential rate at large |*n*|, the quadrature formula (17) is called the Double Exponential [34].

Due to truncation of the summation process in (17) at some arbitrary chosen *n* = −*N, n* = +*N*, function *f*(*x*) can have singularities at *x* = *a* and/or *x* = *b* as long as it is integrable over the integration interval.

Two kinds of errors should be taken into consideration when implementing the DE Formula: discretization error, due to the use of the Trapezoidal Rule to approximate an integral and truncation error, because of truncation of infinite sum at some *N*. The optimal strategy is to get both errors equal [38], [34].

The subinterval width *h*, that defines the evaluation step and the number of sampling points are key values in such strategy. The source [38] suggests the following value of *h* for the DE Formula

where *c* is some constant to be taken, usually 1 or *π*/2 and *ω* is the distance to the nearest singularity of the integrand defined in [38], [34].

The following equations (18)-(20) present three different transformations with varied convergence rate [33], [38]. Transformation (18) has the slowest convergence and transformation (20), the fastest respectively:

Applying the transformation (19) to a function according to the formula (17), we obtain the following trapezoidal form

where

are the nodes, the sampling points and the weights of the DE Quadrature respectively.

Parameter *t _{a}* can be calculated using the following formula [34]

According to [34] asymptotic error of the formula (21) in terms of subinterval width *h* of the Trapezoidal Rule is expressed as

and asymptotic error in terms of the number *N* of the functions evaluations is

### 4.2.1 Programming Issues

Calculation of the DE Quadrature weights from the formula (21) can cross the double precision variables limits. First, the denominator in the weight function formula sec^{2} (*c*sinh *t*) can overflow. Second, the selection of the parameter *t _{a}* > 3 (22) can cause underflow and the occurrence of uncontrolled errors (the computed integral values replaced by random numbers).

Increasing value of the parameter *t _{a}* we can integrate further left and right from y axis (see Fig. 5(c)) and it increases the accuracy. However, values of integrated function can assume very small values. Too small for double precision variables to distinguish them from 0. The underflow occurs. This negative process can be eliminated by applying high precision variables. Application of GNU MPFR library makes it possible. The library have also at their disposal many mathematical functions which can be used with the high precision variables.

For *t _{a}* = 4.97 there are required 100-digits variables, for

*t*= 5.5 - 200-digits variables, for

_{a}*t*= 6.5 - 500-digits variables, for

_{a}*t*= 7.5 - 1500-digits variables and for

_{a}*t*= 8.7 - 5000-digits variables.

_{a}Another parameter which influence accuracy of the DE Quadrature (21) is an amount N of subintervals for integration applying the Trapezoidal Rule.

### 4.2.2 Accuracy of the DE Transformation for Fractional Derivatives and Integrals Computations

For accuracy assessment of the DE Transformation there are selected three functions:

and four fractional orders:

- Fractional derivative of order:
*ν*= 0.9 and*ν*= 0.5 - Fractional integral of order:
*ν*= −0.1 and*ν*= −0.0001,

Results are presented in Figs. 6, 7 and 8.

**Final remarks:**

Independent variable substitution in integrand in a form of a numerical quadrature has even more advantages than its “manual” counterpart presented in the previous subsection: it can be applied automatically during the integration, the nodes and the weights of the DE Quadrature can be computed only once and applied many times. Their computation is not difficult.

How high the accuracy increase actually can be depends on the shape of the transformed integrand and how much it agrees with an “optimal” shape for high accuracy integration by applying the Trapezoidal Rule and how “far” left and right from the *y* axis it is possible to integrate. The latter is difficult due to very small values occurrence on both ends of the transformed integration interval which cause underflows applying standard precision in computations.

The accuracy increase up to ∼ 10^{−50} can be obtained by careful programming applying variables with increased precision. Still, some orders are out of reach as for example the order *ν* = −0.0001, calculation of which ends up with 90% relative error.

The reason for the unsatisfactory accuracy for the orders near 0 and 1 is the decreasing value of power in the denominator in the Riemann-Liouville/Caputo formulas and limitations of the applied substitution expression.

Using the DE Transformation with the double precision, the accuracy is limited to two decimal places.

Despite the obvious advantages of arbitrary precision application, the user must be aware that they extend immensely time required for computations if amount of precision digits applied in calculations is greater that 100 (see Fig. 8).

### 4.3 The Gauss-Jacobi Quadrature

There exists a wide range of numerical methods for solutions of singularities and infinite limits issues in numerical integration, e.g. the Gauss Quadratures. They involve application of polynomials in an integral approximation. The polynomials’ properties are selected for the specific integration problem and thereby they assure high accuracy results. The problematic area for integration is computed differently, which assures high accuracy.

Generally, the Gauss Quadratures can be applied to a specific types of integrands only. It is conditioned by the linkage to their weight functions (with exclusion of the Gauss-Legendre Quadrature with the weight function equals 1).

The Gauss Quadratures are commonly applied to compute most difficult integrals, e.g. the improper integrals and integrals with end point singularities.

The ordinarily sufficient method of the Gauss Quadratures application is reduced to the use of tabulated values of nodes and weights. They are freely available [28], [40] and easy to incorporate into a computer program. However, the integration process can become difficult if nodes and weights must be computed, an integrand does not meet exactly or at all requirements of an quadrature’s weight function or an integration interval is different than assumed.

The first case requires the application of mathematical formulas for nodes and weights.

The second issue solution involves manual extraction of a weight function from an integrand or a weight function adjustment to a problematic integrand.

Changing integration interval from default to arbitrary selected involves a conversion if a quadrature’s requirements permit it.

Next there are presented some important details to the Gauss-Jacobi Quadrature numerical application requirements as well as the formulas for the nodes and the weights computations.

A weight function which eliminates definite integration range endpoints singularities is Jacobi weight function

General, well known formula of approximate calculation of definite integral

with the weight function (26) assumes the form:

in which *x _{k}* are zeros of Jacobi polynomial

*n*.

The Jacobi Polynomial can be determined by applying Rodrigues formula

and weights

in which *n* and

is the remainder of integral approximation.

### 4.3.1 Approximation of Fractional Derivatives and Integrals

Substituting with *λ* = 1 − *ν*,*β* = 0 in the weight formula (29) we obtain

and relation [41]

Transforming the interval [*t*_{0},*t*] into [−1,1], the integral

in which

Applying (31) we can express Riemann-Liouville fractional order integral formula (6) as

To calculate fractional order derivatives we proceed the similar way

where

The Riemann-Liouville fractional order derivative formula (5) assumes the following form

in which *n* = ⌈*ν*⌉.

**Programming Issues**

The Gauss-Jacobi Quadrature (27) requires computation of polynomial of order *n*, its derivative, nodes and weights.

Existing approaches to nodes and weights computing, some of which have been widely used for many years, suffer from 𝒪(*n*^{2}) complexity or error which grows with *n*. With some optimizations, e.g. application of technique which utilizes asymptotic formulas for accurate initial guesses of the roots and efficient evaluations of the degree *n* Jacobi polynomial (28), it can be reduced to 𝒪(*n*) [42].

### 4.4 Accuracy of the Gauss-Jacobi Quadrature for Fractional Order Derivatives and Integrals Computations

Accuracy of the method is conducted in the similar conditions as in the case of DE Transformation. First, there is assessed accuracy for double precision (denoted as 16-digits precision) and high precision calculations. Wherein, it is only required to 100-digit variables increase in high precision calculations for GJ to achieve the highest possible accuracy for the method. Hence the lack of results for other precision options present in the DE Transformation accuracy assessment. Results are presented in Figs. 9 and 10.

The Gauss Jacobi Quadrature is applied for calculations of fractional order integrals *ν* = −0.0001, *ν* = −0.1 and derivatives *ν* = 0.5, *ν* = 0.9 of exponential function (23), trigonometric function (24) and the function (25).

Next, GJ is evaluated with *N* = 32 degree of polynomial applied in integral approximation. The value is an outcome from the results of the next part accuracy assessment of the method, i.e. comparison of accuracy performance of GJ for various degree of polynomial. It is presented in Figs. 11 and 12.

Now, GJ is evaluated for accuracy of calculations for different fractional orders 0 < *ν* < 1 and different integration intervals (1(1)6). Results are presented in Figs. 13.

Fig. 14 presents comparison of rough time complexity of calculations for GJ, DE Transformation (DE) and Grünwald-Letnikov method (GL) applied with double and 100-digits precision.

**Final remarks:**

Approximation of fractional order derivatives and integrals applying the Gauss-Jacobi Quadrature is the most effective method of accuracy increase from all presented in the paper. The integrand is left intact and instead, the weights are changed according to its properties; the computation of the difficult kernel in the Riemann-Liuoville/Caputo formulas is removed from the integration (it is now calculated using the weight function). Programming the quadrature applying variables with increased precision ascertain constant high accuracy of computations, independently from integrated function, fractional order and interval. Wherein difficult fractional orders of integrals near 0 and fractional orders of derivatives near 1, which are out of reach for any other methods can also be calculated with similar high accuracy.

The degree N of polynomial applied in integral approximation and an amount of digits of precision used for calculation are the only factors which influence calculation accuracy.

Another advantage of the method is that application of high order polynomial *N* = 32 and 100-digit precision does not extend significantly time complexity of calculations (see Fig. 14).

## 5 Conclusions

The problems associated with singularities are the most difficult to solve in numerical integration. However, application of a proper transformation to the integrand in the Riemann-Liouville/Caputo formulas or a correct selection of parameters for the weight function of the Gauss-Jacobi Quadrature make possible to calculate fractional order derivatives and integrals with high-accuracy. The accuracy gain can be improved by application of arbitrary precision in computations.

Analytical integrand transformation applying appropriate in context of a selected method of integration substitution expression is very effective and can increase accuracy of numerical integration significantly. However, the method is arduous because it requires manual transformation of each integrand.

Transformation of the integrand via independent variable substitution applied in a form of a numerical quadrature enables to omit arduous analytical transformation of an integrand and automate the whole substitution process.

Application of the DE Quadrature turned the integration process into automatic one. It is effective under the condition of finding and applying substitution expression which transforms an integrand into one which matches optimal requirements of the Trapezoidal Rule.

Approximation of fractional order derivatives and integrals by applying the Gauss-Jacobi Quadrature is the most effective method which assures high-accuracy results up to ∼ 10^{−120} mark independently from fractional order, integration interval and a type of a function.

^{}

Communicated by Juan L.G. Guirao

## References

- [1]↑
R. Herrmann. Fractional Calculus. An Introduction for Physicists, 2nd. ed. World Scientific, Singapore, 2014.

- [2]↑
G. W. Leibniz. Letter from hannover, germany, to g. f. a. l’hôpital, september 30. 1695. In Mathematische Schriften, 1849, pages 301–302. Olms Verlag, Hildesheim, Germany, 1695. Reprint 1962.

- [3]↑
L. Debnath and D. Bhatta. Integral Transforms and Their Applications, Third Edition. CRC Press, Taylor & Francis Group, Boca Raton London New York, 2015.

- [4]↑
B. Ross. Proceedings to the international conference on fractional calculus and its applications. June 1975.

- [5]↑
K. Oldham and J. Spanier. The Fractional Calculus. Theory and Applications of Differentiation and Integration to Arbitrary Order. Academic Press, INC, San Diego Ca, 1974.

- [6]↑
Guillaume Hanrot et al. mpfr: The MPFR library for multiple-precision floating-point computations with correct rounding. (version 3.13), 2015. http://www.mpfr.org/.

- [7]↑
Torbjörn Granlund et al. gmp: GMP is a free library for arbitrary precision arithmetic (version 6.0.0a), 2015. https://gmplib.org/.

- [8]↑
K. S. Miller and B. Ross. An Introduction to the Fractional Calculus and Fractional Differential Equations. John Wiley & Sons, Inc., New York, NY, 1993.

- [9]↑
M. D. Ortigueira, J. A. T. Machado, and J. Sa da Costa. Which differintegration? IEE Proceedings - Vision, Image and Signal Processing, 152(6), 2005.

- [10]↑
S. Samko, A. Kilbas, and O. Marichev. Fractional Integrals and Derivatives: Theory and Applications. Gordon and Breach, London, 1993.

- [11]↑
J. T. Machado. Numerical calculation of the left and right fractional derivatives. Journal of Computational Physics, 293:96–103, 2015.

- [13]↑
Piotr Ostalczyk. Zarys rachunku ró˙zniczkowego i całkowego ułamkowych rze¸dów. Wydawnictwo Politechniki Łódzkiej, Łódź, Poland, 2006.

- [14]↑
D. Valerio, J. J. Trujillo, M. Rivero, J. A. T. Machado, and D. Baleanu. Fractional calculus: A survey of useful formulas. The European Physical Journal Special Topics, 222:1827–1846, 2013.

- [15]↑
M. D. Ortigueira. Fractional central differences and derivatives. Journal of Vibration and Control, 14(9-10):1255–1266, 2008.

- [16]↑
Piotr Ostalczyk. Discrete Fractional Calculus. Applications in Control and Image Processing. World Scientific, 2016.

- [17]↑
P. K. Kythe and M. R. Schaferkotter. Handbook of Computational Methods for Integration. Chapman & Hall/CRC, 2005.

- [18]↑
R. L. Burden and J.D. Faires. Numerical Analysis, 5th ed. Brooks/Cole Cengage Learning, Boston, 2003.

- [19]↑
B.P. Demidowicz, I.A. Maron, and E.Z. Szuwałowa. Metody Numeryczne. Państwowe Wydawnictwo Naukowe, Warszawa, Poland, 1965.

- [20]↑
S. C. Chapra and R. P. Canale. Numerical Methods for Engineers, 6th Ed. McGraw-Hill Companies, Inc., 2010.

- [23]↑
K. Diethelm and G. Walz. Numerical solution of fractional order differential equations by extrapolation. Numerical Algorithms, 16:231–253, 1997.

- [24]↑
K. Diethelm, N.J. Ford, A.D. Freed, and Yu. Luchko. Algorithms for the fractional calculus: A selection of numerical methods. Comput. Methods Appl. Engrg., 194:743–773, 2005.

- [25]↑
Z. Odibat. Approximation of fractional integrals and caputo fractional derivatives. Applied Mathematics and Computation, 178:527–533, 2006.

- [26]↑
D. A. Murio. On the stable numerical evaluation of caputo fractional derivatives. An International Journal: Computers & Mathematics with Applications, 51:1539–1550, 2006.

- [27]↑
H. Sugiura and T. Hasegawa. Quadrature rule for abel’s equations: Uniformly approximating fractional derivatives. Journal of Computational and Applied Mathematics, 223(1):459–468, 2009.

- [28]↑
H. Bateman. Tables of Integral Transforms, vol. II. Mc Graw-Hill Book Company, Inc., New York, Tornoto, London, 1954.

- [29]↑
D. W. Brzeziński and P. Ostalczyk. Accuracy assessment of fractional order derivatives and integrals numerical computations. Journal of Applied Nonlinear Dynamics, 4(1):53–65, 2015.

- [30]↑
N. M. Korobov. Teoretikocislwyje metody w priblizennom analize. Gosudarstwennoe Izdatelstwo FizykoMatematiceskoj Literatury, Mockba, 1963.

- [31]↑
C. Schwartz. Numerical integration of analytic functions. Journal of Computational Physics, 4:19–29, 1969.

- [32]↑
F. Stenger. Integration formulae based on the trapezoidal formula. J. Inst. Math. Appl., 12:103–114, 1973.

- [33]↑
H. Takahashi. Quadrature formulas obtained by variable transformation. Numer. Math, 21:206–219, 1973.

- [34]↑
M. Mori. Developments in the double exponential formulas for numerical integration. In Proceedings of the International Congress of Mathematicians, pages 1585–1594, Kyoto, Japan, 1990.

- [36]↑
H. Takahashi and M. Mori. Double exponential formulas for numerical integration. Publ. RIMS, 9:721–744, 1974.

- [37]↑
T. Watanabe. On the double exponential formula for numerical integration. Kakuyugokenkyu, 63(5):397–411, 1990.

- [38]↑
W. H. Press, S. A. Teukolsky, W. T. Vetterling, and B. P. Flannery. Numerical Recipes. The Art of Scientific Computing, Third Edition. Cambridge University Press, 2007.

- [39]↑
J. Waldvogel. Towards a general error theory of the trapezoidal rule. Approximation and Computation, 42:267–282, 2011.

- [40]↑
M. Abramowitz and I. A. Stegun. Handbook of Mathematical Functions. Applied Mathematics Series. Cambridge University Press, 1968.

- [42]↑
N. Hale and A. Townsend. Fast and accurate computation of gauss-legendre and gauss-jacobi quadrature nodes and weights. Oxford Centre for Collaborative Applied Mathematics, 2012. OCCAM Preprint Number 12/79.