ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_mathConst.F90
Go to the documentation of this file.
1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3!!!! !!!!
4!!!! ParaMonte: Parallel Monte Carlo and Machine Learning Library. !!!!
5!!!! !!!!
6!!!! Copyright (C) 2012-present, The Computational Data Science Lab !!!!
7!!!! !!!!
8!!!! This file is part of the ParaMonte library. !!!!
9!!!! !!!!
10!!!! LICENSE !!!!
11!!!! !!!!
12!!!! https://github.com/cdslaborg/paramonte/blob/main/LICENSE.md !!!!
13!!!! !!!!
14!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16
33
34!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
35
37
38 use pm_kind, only: SK, RKB
39
40 implicit none
41
42 character(*,SK), parameter :: MODULE_NAME = "@pm_mathConst"
43
44 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
45 ! \pi-related constants.
46 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47
48 real(RKB) , parameter :: PI = acos(-1._RKB)
49 real(RKB) , parameter :: TWO_PI = 2 * PI
50 real(RKB) , parameter :: HALF_PI = .5_RKB * PI
51 real(RKB) , parameter :: INVERSE_PI = 1._RKB / PI
52 real(RKB) , parameter :: QUARTER_PI = .25_RKB * PI
53 real(RKB) , parameter :: LOG_PI = log(PI)
54 real(RKB) , parameter :: SQRT_PI = sqrt(PI)
55 real(RKB) , parameter :: LOG_TWO_PI = log(TWO_PI)
56 real(RKB) , parameter :: SQRT_TWO_PI = sqrt(TWO_PI)
57 real(RKB) , parameter :: SQRT_HALF_PI = sqrt(HALF_PI)
58 real(RKB) , parameter :: INVERSE_SQRT_PI = sqrt(INVERSE_PI)
59 real(RKB) , parameter :: INVERSE_SQRT_TWO_PI = 1._RKB / SQRT_TWO_PI
61
62 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
63 ! Common numeric constants.
64 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65
66 real(RKB) , parameter :: NAPIER = exp(1._RKB)
67 real(RKB) , parameter :: LOG_TWO = log(2._RKB)
68 real(RKB) , parameter :: LOG_TEN = log(1.e1_RKB)
69 real(RKB) , parameter :: LOG_HALF = log(0.5_RKB)
70 real(RKB) , parameter :: SQRT_TWO = sqrt(2._RKB)
71 real(RKB) , parameter :: LOG10_NAPIER = log10(NAPIER)
72 real(RKB) , parameter :: INVERSE_LOG_TWO = 1._RKB / LOG_TWO
73 real(RKB) , parameter :: INVERSE_SQRT_TWO = 1._RKB / SQRT_TWO
74
75!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
76
102 type :: origin_type; end type
103
104!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
105
131 type(origin_type), parameter :: ORIGIN = origin_type()
132
133!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
134
189 real(RKB) , parameter :: EULER_CONST = 0.577215664901532860606512090082402431042159335939923598805767234884867726777664670936947063291746749_RKB
190
191!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
192
222 real(RKB) , parameter :: APERY_CONST = 1.20205690315959428539973816151144999076498629234049888179227155534183820578631309018645587360933525814619915_RKB
223
224!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
225
246 real(RKB) , parameter :: PRIME_CONST = .414682509851111660248109622154307708365774238137916977868245414488640960619357334196290048428475777939616_RKB
247
248!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
249
283 real(RKB) , parameter :: GOLDEN_RATIO = .5_RKB * (1._RKB + sqrt(5._RKB))
284
285!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
286
329 real(RKB) , parameter :: SILVER_RATIO = 1._RKB + sqrt(2._RKB)
330
331!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
332
379 real(RKB) , parameter :: SUPER_GOLDEN_RATIO = (2._RKB * cosh(acosh(29._RKB / 2._RKB) / 3._RKB) + 1._RKB) / 3._RKB
380
381!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
382
406 type :: ninf_type
407 end type
408
423 type(ninf_type) , parameter :: ninf = ninf_type()
424#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
425 !DIR$ ATTRIBUTES DLLEXPORT :: ninf
426#endif
427
428!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
429
453 type :: pinf_type
454 end type
455
470 type(pinf_type) , parameter :: pinf = pinf_type()
471#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
472 !DIR$ ATTRIBUTES DLLEXPORT :: pinf
473#endif
474
475!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
476
477end module pm_mathConst ! LCOV_EXCL_LINE
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter RKB
The scalar integer constant of intrinsic default kind, representing the Best-precision real kind supp...
Definition: pm_kind.F90:1371
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539
This module contains relevant mathematical constants.
real(RKB), parameter INVERSE_PI
The scalar real constant of kind with highest available precision RKB representing the inverse of the...
real(RKB), parameter INVERSE_SQRT_TWO_PI
The scalar real constant of kind with highest available precision RKB representing .
real(RKB), parameter SUPER_GOLDEN_RATIO
The scalar real constant of kind with highest available precision RKB representing the Supergolden Ra...
real(RKB), parameter SQRT_PI
The scalar real constant of kind with highest available precision RKB representing .
real(RKB), parameter LOG_TEN
The scalar real constant of kind with highest available precision RKB representing .
real(RKB), parameter SQRT_TWO
The scalar real constant of kind with highest available precision RKB representing .
character(*, SK), parameter MODULE_NAME
real(RKB), parameter SQRT_HALF_PI
The scalar real constant of kind with highest available precision RKB representing .
real(RKB), parameter QUARTER_PI
The scalar real constant of kind with highest available precision RKB representing a quarter of the i...
real(RKB), parameter LOG_TWO_PI
The scalar real constant of kind with highest available precision RKB representing .
real(RKB), parameter TWO_PI
The scalar real constant of kind with highest available precision RKB representing twice the irration...
real(RKB), parameter LOG_PI
The scalar real constant of kind with highest available precision RKB representing .
type(origin_type), parameter ORIGIN
The scalar constant object of type origin_type representing the geometric origin of the coordinates.
real(RKB), parameter INVERSE_SQRT_PI
The scalar real constant of kind with highest available precision RKB representing .
real(RKB), parameter HALF_PI
The scalar real constant of kind with highest available precision RKB representing half the irrationa...
real(RKB), parameter PRIME_CONST
The scalar real constant of kind with highest available precision RKB representing the irrational Pri...
real(RKB), parameter SQRT_TWO_PI
The scalar real constant of kind with highest available precision RKB representing .
real(RKB), parameter SILVER_RATIO
The scalar real constant of kind with highest available precision RKB representing the Silver Ratio c...
real(RKB), parameter LOG_HALF
The scalar real constant of kind with highest available precision RKB representing .
real(RKB), parameter LOG_INVERSE_SQRT_TWO_PI
The scalar real constant of kind with highest available precision RKB representing ,...
real(RKB), parameter PI
The scalar real constant of kind with highest available precision RKB representing the irrational num...
real(RKB), parameter GOLDEN_RATIO
The scalar real constant of kind with highest available precision RKB representing the Golden Ratio c...
type(ninf_type), parameter ninf
The scalar constant object of type ninf_type that indicates the use of the negative infinity as an i...
real(RKB), parameter INVERSE_SQRT_TWO
The scalar real constant of kind with highest available precision RKB representing .
real(RKB), parameter APERY_CONST
The scalar real constant of kind with highest available precision RKB representing the Apery constant...
real(RKB), parameter NAPIER
The scalar real constant of kind with highest available precision RKB representing the Napier constan...
real(RKB), parameter LOG_TWO
The scalar real constant of kind with highest available precision RKB representing .
real(RKB), parameter LOG10_NAPIER
The scalar real constant of kind with highest available precision RKB representing .
type(pinf_type), parameter pinf
The scalar constant object of type pinf_type that indicates the use of the positive infinity as an i...
real(RKB), parameter INVERSE_LOG_TWO
The scalar real constant of kind with highest available precision RKB representing .
real(RKB), parameter EULER_CONST
The scalar real constant of kind with highest available precision RKB representing the Euler-Maschero...
This is the indicator type for generating instances of objects that indicate the use of the negative ...
This is the derived type origin_type representing the geometric origin of the coordinates.
This is the indicator type for generating instances of objects that indicate the use of the positive ...