ROOT  6.06/09
Reference Guide
const.h
Go to the documentation of this file.
1 /* This file is part of the Vc library. {{{
2 
3  Copyright (C) 2012 Matthias Kretz <kretz@kde.org>
4 
5  Vc is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as
7  published by the Free Software Foundation, either version 3 of
8  the License, or (at your option) any later version.
9 
10  Vc is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with Vc. If not, see <http://www.gnu.org/licenses/>.
17 
18 }}}*/
19 
20 #ifndef VC_TESTS_CONST_H_
21 #define VC_TESTS_CONST_H_
22 
23 #include <Vc/common/macros.h>
24 
25 namespace ROOT {
26 namespace Vc
27 {
28  template<typename T> struct Math;
29  template<> struct Math<float>
30  {
31  static _VC_CONSTEXPR float e() { return 2.7182818284590452353602874713526625f; }
32  static _VC_CONSTEXPR float log2e() { return 1.4426950408889634073599246810018921f; }
33  static _VC_CONSTEXPR float log10e() { return 0.4342944819032518276511289189166051f; }
34  static _VC_CONSTEXPR float ln2() { return Vc_buildFloat(1, 0x317218, -1); } // .693147182464599609375
35  static _VC_CONSTEXPR float ln10() { return 2.3025850929940456840179914546843642f; }
36  static _VC_CONSTEXPR float pi() { return 3.1415926535897932384626433832795029f; }
37  static _VC_CONSTEXPR float pi_2() { return 1.5707963267948966192313216916397514f; }
38  static _VC_CONSTEXPR float pi_4() { return 0.7853981633974483096156608458198757f; }
39  static _VC_CONSTEXPR float _1_pi() { return 0.3183098861837906715377675267450287f; }
40  static _VC_CONSTEXPR float _2_pi() { return 0.6366197723675813430755350534900574f; }
41  static _VC_CONSTEXPR float _2_sqrtpi() { return 1.1283791670955125738961589031215452f; }
42  static _VC_CONSTEXPR float sqrt2() { return 1.4142135623730950488016887242096981f; }
43  static _VC_CONSTEXPR float sqrt1_2() { return 0.7071067811865475244008443621048490f; }
44  };
45  template<> struct Math<double>
46  {
47  static _VC_CONSTEXPR double e() { return 2.7182818284590452353602874713526625; }
48  static _VC_CONSTEXPR double log2e() { return 1.4426950408889634073599246810018921; }
49  static _VC_CONSTEXPR double log10e() { return 0.4342944819032518276511289189166051; }
50  static _VC_CONSTEXPR double ln2() { return Vc_buildDouble(1, 0x62E42FEFA39EFull, -1); } // .69314718055994528622676398299518041312694549560546875
51  static _VC_CONSTEXPR double ln10() { return 2.3025850929940456840179914546843642; }
52  static _VC_CONSTEXPR double pi() { return 3.1415926535897932384626433832795029; }
53  static _VC_CONSTEXPR double pi_2() { return 1.5707963267948966192313216916397514; }
54  static _VC_CONSTEXPR double pi_4() { return 0.7853981633974483096156608458198757; }
55  static _VC_CONSTEXPR double _1_pi() { return 0.3183098861837906715377675267450287; }
56  static _VC_CONSTEXPR double _2_pi() { return 0.6366197723675813430755350534900574; }
57  static _VC_CONSTEXPR double _2_sqrtpi() { return 1.1283791670955125738961589031215452; }
58  static _VC_CONSTEXPR double sqrt2() { return 1.4142135623730950488016887242096981; }
59  static _VC_CONSTEXPR double sqrt1_2() { return 0.7071067811865475244008443621048490; }
60  };
61 } // namespace Vc
62 } // namespace ROOT
63 
64 #include <Vc/common/undomacros.h>
65 
66 #endif // VC_TESTS_CONST_H_
static _VC_CONSTEXPR double sqrt2()
Definition: const.h:58
static _VC_CONSTEXPR double log10e()
Definition: const.h:49
static _VC_CONSTEXPR float e()
Definition: const.h:31
static _VC_CONSTEXPR double pi()
Definition: const.h:52
Namespace for new ROOT classes and functions.
Definition: ROOT.py:1
static _VC_CONSTEXPR float log10e()
Definition: const.h:33
static _VC_CONSTEXPR float pi_4()
Definition: const.h:38
static _VC_CONSTEXPR float sqrt2()
Definition: const.h:42
static _VC_CONSTEXPR float ln10()
Definition: const.h:35
static _VC_CONSTEXPR float _2_sqrtpi()
Definition: const.h:41
static _VC_CONSTEXPR double pi_4()
Definition: const.h:54
static _VC_CONSTEXPR float pi()
Definition: const.h:36
static _VC_CONSTEXPR double _2_pi()
Definition: const.h:56
static _VC_CONSTEXPR double pi_2()
Definition: const.h:53
static _VC_CONSTEXPR float sqrt1_2()
Definition: const.h:43
static _VC_CONSTEXPR double _2_sqrtpi()
Definition: const.h:57
static _VC_CONSTEXPR float _2_pi()
Definition: const.h:40
static _VC_CONSTEXPR double e()
Definition: const.h:47
#define Vc_buildDouble(sign, mantissa, exponent)
Definition: macros.h:283
static _VC_CONSTEXPR double log2e()
Definition: const.h:48
static _VC_CONSTEXPR double ln2()
Definition: const.h:50
static _VC_CONSTEXPR float log2e()
Definition: const.h:32
static _VC_CONSTEXPR double sqrt1_2()
Definition: const.h:59
static _VC_CONSTEXPR float pi_2()
Definition: const.h:37
static _VC_CONSTEXPR double ln10()
Definition: const.h:51
#define Vc_buildFloat(sign, mantissa, exponent)
Definition: macros.h:294
static _VC_CONSTEXPR float _1_pi()
Definition: const.h:39
static _VC_CONSTEXPR double _1_pi()
Definition: const.h:55
Namespace for new Math classes and functions.
#define _VC_CONSTEXPR
Definition: macros.h:154
static _VC_CONSTEXPR float ln2()
Definition: const.h:34
Definition: casts.h:28