1 /* Ergo, version 3.8, a program for linear scaling electronic structure
2  * calculations.
3  * Copyright (C) 2019 Elias Rudberg, Emanuel H. Rubensson, Pawel Salek,
4  * and Anastasia Kruchinina.
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Primary academic reference:
20  * Ergo: An open-source program for linear-scaling electronic structure
21  * calculations,
22  * Elias Rudberg, Emanuel H. Rubensson, Pawel Salek, and Anastasia
23  * Kruchinina,
24  * SoftwareX 7, 107 (2018),
25  * <http://dx.doi.org/10.1016/j.softx.2018.03.005>
26  *
27  * For further information about Ergo, see <http://www.ergoscf.org>.
28  */
29 
30 /** @file pi.h
31 
32     @brief Constants for the number pi and some related numbers like
33     sqrt(pi).
34 
35     @author: Elias Rudberg <em>responsible</em>
36 */
37 
38 #ifndef PI_HEADER
39 #define PI_HEADER
40 
41 #include "config.h" // need config.h to get PRECISION_QUAD_FLT128 macro
42 
43 /* ELIAS NOTE 2016-08-30: the numbers below were produced using the
44    quadmath library, by running the program in
45    source/standalone/pi_quadmath.c */
46 
47 #ifdef PRECISION_QUAD_FLT128
48 
49 /* __float128 case: use suffix 'Q' */
50 #define pi         3.1415926535897932384626433832795028Q
51 #define sqrtpi     1.7724538509055160272981674833411451Q
52 #define pitopow52 17.4934183276248628462628216798715544Q
53 
54 #else
55 
56 /* regular, non-__float128 case: use suffix 'L' */
57 #define pi         3.1415926535897932384626433832795028L
58 #define sqrtpi     1.7724538509055160272981674833411451L
59 #define pitopow52 17.4934183276248628462628216798715544L
60 
61 #endif
62 
63 #endif
64