Fortran Routines

This is the documentation of the Fortran routines for calculating the Wright function. Unlike their counterpart in C, they use ordinary arithmetic with different types of precision (32,64,128) for the calculation.

We have implemented both the scalar version of the function, and the vectorized counterparts with respect to the \(x\) variable. They are all private inside the module, and are accesible from a unique interface called wright.

Module

Description

Module containg the implementation of the routines for computing the Wright function on the real line.

Quick access

Variables

d_pi, done, donei, s_pi, sone, sonei, t_pi, tone, tonei

Routines

dwright(), dwright_vec(), swright(), swright_vec(), twright(), twright_vec()

Needed modules

  • iso_fortran_env (real32(), real64(), real128(), error_unit())

  • brentmod (fminbnd()): This module contains the implementation of Brent’s algorithm for the minimization of a function \(f(x)\) in the interval \([a,b]\).

Variables

  • wrightmod/d_pi [real,private/parameter/optional/default=3.141592653589793_real64]
  • wrightmod/done [real,private/parameter/optional/default=1.0_real64]
  • wrightmod/donei [complex,private/parameter/optional/default=(0.0,1.0_real64)]
  • wrightmod/s_pi [real,private/parameter/optional/default=3.14159265_real32]
  • wrightmod/sone [real,private/parameter/optional/default=1.0_real32]
  • wrightmod/sonei [complex,private/parameter/optional/default=(0.0,1.0_real32)]
  • wrightmod/t_pi [real,private/parameter/optional/default=3.1415926535897932384626433832795_real128]
  • wrightmod/tone [real,private/parameter/optional/default=1.0_real128]
  • wrightmod/tonei [complex,private/parameter/optional/default=(0.0,1.0_real128)]

Subroutines and functions

function  wrightmod/dwright(x, t, lambda, mu[, n])
Parameters
  • x [real] :: The x in the argument \(-|x|t^\lambda\)

  • t [real] :: The t in the argument \(-|x|t^\lambda\) ( \(t > 0\) )

  • lambda [real] :: First parameter of the Wright function

  • mu [real] :: Second parameter of the Wright function

  • n [integer] :: Optional, number of quadrature points

Return

w [real] :: \(t^{\mu - 1} W_{\lambda,\mu} (-|x|t^{\lambda})\)

function  wrightmod/swright(x, t, lambda, mu[, n])
Parameters
  • x [real] :: The x in the argument \(-|x|t^\lambda\)

  • t [real] :: The t in the argument \(-|x|t^\lambda\) ( \(t > 0\) )

  • lambda [real] :: First parameter of the Wright function

  • mu [real] :: Second parameter of the Wright function

  • n [integer] :: Optional, number of quadrature points

Return

w [real] :: \(t^{\mu - 1} W_{\lambda,\mu} (-|x|t^{\lambda})\)

function  wrightmod/twright(x, t, lambda, mu[, n])
Parameters
  • x [real] :: The x in the argument \(-|x|t^\lambda\)

  • t [real] :: The t in the argument \(-|x|t^\lambda\) ( \(t > 0\) )

  • lambda [real] :: First parameter of the Wright function

  • mu [real] :: Second parameter of the Wright function

  • n [integer] :: Optional, number of quadrature points

Return

w [real] :: \(t^{\mu - 1} W_{\lambda,\mu} (-|x|t^{\lambda})\)

function  wrightmod/dwright_vec(x, t, lambda, mu[, n])
Parameters
  • x (*) [real] :: The x in the argument \(-|x|t^\lambda\)

  • t [real] :: The t in the argument \(-|x|t^\lambda\) ( \(t > 0\) )

  • lambda [real] :: First parameter of the Wright function

  • mu [real] :: Second parameter of the Wright function

  • n [integer] :: Optional to arbitrarly set the number of quadrature points

Return

w (*) [real,allocatable] :: \(t^{\mu - 1} W_{\lambda,\mu} (-|x|t^{\lambda})\)

function  wrightmod/swright_vec(x, t, lambda, mu[, n])
Parameters
  • x (*) [real] :: The x in the argument \(-|x|t^\lambda\)

  • t [real] :: The t in the argument \(-|x|t^\lambda\) ( \(t > 0\) )

  • lambda [real] :: First parameter of the Wright function

  • mu [real] :: Second parameter of the Wright function

  • n [integer] :: Optional to arbitrarly set the number of quadrature points

Return

w (*) [real,allocatable] :: \(t^{\mu - 1} W_{\lambda,\mu} (-|x|t^{\lambda})\)

function  wrightmod/twright_vec(x, t, lambda, mu[, n])
Parameters
  • x (*) [real] :: The x in the argument \(-|x|t^\lambda\)

  • t [real] :: The t in the argument \(-|x|t^\lambda\) ( \(t > 0\) )

  • lambda [real] :: First parameter of the Wright function

  • mu [real] :: Second parameter of the Wright function

  • n [integer] :: Optional to arbitrarly set the number of quadrature points

Return

w (*) [real,allocatable] :: \(t^{\mu - 1} W_{\lambda,\mu} (-|x|t^{\lambda})\)

Brent’s algorithm for constrained minimization

To compute the \(\xi\) parameter needed for the parabolic contour we need to solve a box-constrained optimization problem. For this task we use Brent’s algorithm for optimization without derivatives.

Module

Description

This module contains the implementation of Brent’s algorithm for the minimization of a function \(f(x)\) in the interval \([a,b]\).

The implementation is the one from:

Note

Original FORTRAN77 version by Richard Brent. FORTRAN90 version by John Burkardt.

See: https://people.math.sc.edu/Burkardt/f_src/brent/brent.html

Quick access

Routines

dglomin(), dlocal_min(), dlocal_min_rc(), dzero(), dzero_rc(), sglomin(), slocal_min(), slocal_min_rc(), szero(), szero_rc(), tglomin(), tlocal_min(), tlocal_min_rc(), tzero(), tzero_rc()

Needed modules

  • iso_fortran_env (real32(), real64(), real128())

Variables

Subroutines and functions

function  brentmod/dglomin(a, b, c, m, machep, e, t, f, x)
Parameters
  • a [real]

  • b [real]

  • c [real]

  • m [real]

  • machep [real]

  • e [real]

  • t [real]

  • f [real]

  • x [real]

Return

dglomin [real]

Call to

dlocal_min(), dzero(), sglomin(), slocal_min(), szero(), tglomin(), tlocal_min(), tzero()

function  brentmod/dlocal_min(a, b, eps, t, f, x)
Parameters
  • a [real]

  • b [real]

  • eps [real]

  • t [real]

  • f [real]

  • x [real]

Return

dlocal_min [real]

Called from

dglomin()

Call to

dzero(), sglomin(), slocal_min(), szero(), tglomin(), tlocal_min(), tzero()

subroutine  brentmod/dlocal_min_rc(a, b, arg, status, value)
Parameters
  • a [real]

  • b [real]

  • arg [real]

  • status [integer]

  • value [real]

Call to

dzero(), sglomin(), slocal_min(), szero(), tglomin(), tlocal_min(), tzero()

function  brentmod/dzero(a, b, machep, t, f)
Parameters
  • a [real]

  • b [real]

  • machep [real]

  • t [real]

  • f [real]

Return

dzero [real]

Called from

dglomin(), dlocal_min(), dlocal_min_rc()

Call to

sglomin(), slocal_min(), szero(), tglomin(), tlocal_min(), tzero()

subroutine  brentmod/dzero_rc(a, b, t, arg, status, value)
Parameters
  • a [real]

  • b [real]

  • t [real]

  • arg [real]

  • status [integer]

  • value [real]

Call to

sglomin(), slocal_min(), szero(), tglomin(), tlocal_min(), tzero()

function  brentmod/sglomin(a, b, c, m, machep, e, t, f, x)
Parameters
  • a [real]

  • b [real]

  • c [real]

  • m [real]

  • machep [real]

  • e [real]

  • t [real]

  • f [real]

  • x [real]

Return

sglomin [real]

Called from

dglomin(), dlocal_min(), dlocal_min_rc(), dzero(), dzero_rc()

Call to

slocal_min(), szero(), tglomin(), tlocal_min(), tzero()

function  brentmod/slocal_min(a, b, eps, t, f, x)
Parameters
  • a [real]

  • b [real]

  • eps [real]

  • t [real]

  • f [real]

  • x [real]

Return

slocal_min [real]

Called from

dglomin(), dlocal_min(), dlocal_min_rc(), dzero(), dzero_rc(), sglomin()

Call to

szero(), tglomin(), tlocal_min(), tzero()

subroutine  brentmod/slocal_min_rc(a, b, arg, status, value)
Parameters
  • a [real]

  • b [real]

  • arg [real]

  • status [integer]

  • value [real]

Call to

szero(), tglomin(), tlocal_min(), tzero()

function  brentmod/szero(a, b, machep, t, f)
Parameters
  • a [real]

  • b [real]

  • machep [real]

  • t [real]

  • f [real]

Return

szero [real]

Called from

dglomin(), dlocal_min(), dlocal_min_rc(), dzero(), dzero_rc(), sglomin(), slocal_min(), slocal_min_rc()

Call to

tglomin(), tlocal_min(), tzero()

subroutine  brentmod/szero_rc(a, b, t, arg, status, value)
Parameters
  • a [real]

  • b [real]

  • t [real]

  • arg [real]

  • status [integer]

  • value [real]

Call to

tglomin(), tlocal_min(), tzero()

function  brentmod/tglomin(a, b, c, m, machep, e, t, f, x)
Parameters
  • a [real]

  • b [real]

  • c [real]

  • m [real]

  • machep [real]

  • e [real]

  • t [real]

  • f [real]

  • x [real]

Return

tglomin [real]

Called from

dglomin(), dlocal_min(), dlocal_min_rc(), dzero(), dzero_rc(), sglomin(), slocal_min(), slocal_min_rc(), szero(), szero_rc()

Call to

tlocal_min(), tzero()

function  brentmod/tlocal_min(a, b, eps, t, f, x)
Parameters
  • a [real]

  • b [real]

  • eps [real]

  • t [real]

  • f [real]

  • x [real]

Return

tlocal_min [real]

Called from

dglomin(), dlocal_min(), dlocal_min_rc(), dzero(), dzero_rc(), sglomin(), slocal_min(), slocal_min_rc(), szero(), szero_rc(), tglomin()

Call to

tzero()

subroutine  brentmod/tlocal_min_rc(a, b, arg, status, value)
Parameters
  • a [real]

  • b [real]

  • arg [real]

  • status [integer]

  • value [real]

Call to

tzero()

function  brentmod/tzero(a, b, machep, t, f)
Parameters
  • a [real]

  • b [real]

  • machep [real]

  • t [real]

  • f [real]

Return

tzero [real]

Called from

dglomin(), dlocal_min(), dlocal_min_rc(), dzero(), dzero_rc(), sglomin(), slocal_min(), slocal_min_rc(), szero(), szero_rc(), tglomin(), tlocal_min(), tlocal_min_rc()

subroutine  brentmod/tzero_rc(a, b, t, arg, status, value)
Parameters
  • a [real]

  • b [real]

  • t [real]

  • arg [real]

  • status [integer]

  • value [real]