Mantid
Loading...
Searching...
No Matches
Framework
Kernel
inc
MantidKernel
Fast_Exponential.h
Go to the documentation of this file.
1
// Mantid Repository : https://github.com/mantidproject/mantid
2
//
3
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4
// NScD Oak Ridge National Laboratory, European Spallation Source,
5
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6
// SPDX - License - Identifier: GPL - 3.0 +
7
#pragma once
8
9
namespace
Mantid
{
10
namespace
Kernel {
11
26
#define EXP_A (1048576 / M_LN2)
27
#define EXP_C 60801
28
29
inline
double
fast_exp
(
double
y
) {
30
static
union
{
31
double
d
;
32
#ifdef LITTLE_ENDIAN
33
struct
{
34
int
j, i;
35
}
n
;
36
#else
37
struct
{
38
int
i, j;
39
}
n
;
40
#endif
41
} _eco;
42
43
_eco.n.i = (int)(
EXP_A
* (
y
)) + (1072693248 -
EXP_C
);
44
_eco.n.j = 0;
45
46
return
_eco.d;
47
}
48
49
}
// Namespace Kernel
50
}
// Namespace Mantid
n
size_t n
Definition:
AugmentedLagrangianOptimizer.cpp:42
EXP_A
#define EXP_A
Based on the article: A Fast, Compact Approximation of the Exponential Function by Nicol N.
Definition:
Fast_Exponential.h:26
EXP_C
#define EXP_C
Definition:
Fast_Exponential.h:27
Mantid::Geometry::y
I a m y
Definition:
SpaceGroupFactory.cpp:675
Mantid::Geometry::d
I a m d
Definition:
SpaceGroupFactory.cpp:674
Mantid::Kernel::fast_exp
double fast_exp(double y)
Definition:
Fast_Exponential.h:29
Mantid
Helper class which provides the Collimation Length for SANS instruments.
Definition:
AbsorptionCorrection.h:18
Generated on Tue Jan 3 2023 11:57:50 for Mantid by
1.9.5