49 template <
typename FloatType>
50 static FloatType
cosh (FloatType x)
noexcept
53 auto numerator = -(39251520 + x2 * (18471600 + x2 * (1075032 + 14615 * x2)));
54 auto denominator = -39251520 + x2 * (1154160 + x2 * (-16632 + 127 * x2));
55 return numerator / denominator;
64 template <
typename FloatType>
65 static void cosh (FloatType* values,
size_t numValues)
noexcept
67 for (
size_t i = 0; i < numValues; ++i)
77 template <
typename FloatType>
78 static FloatType
sinh (FloatType x)
noexcept
81 auto numerator = -x * (11511339840 + x2 * (1640635920 + x2 * (52785432 + x2 * 479249)));
82 auto denominator = -11511339840 + x2 * (277920720 + x2 * (-3177720 + x2 * 18361));
83 return numerator / denominator;
92 template <
typename FloatType>
93 static void sinh (FloatType* values,
size_t numValues)
noexcept
95 for (
size_t i = 0; i < numValues; ++i)
105 template <
typename FloatType>
106 static FloatType
tanh (FloatType x)
noexcept
109 auto numerator = x * (135135 + x2 * (17325 + x2 * (378 + x2)));
110 auto denominator = 135135 + x2 * (62370 + x2 * (3150 + 28 * x2));
111 return numerator / denominator;
120 template <
typename FloatType>
121 static void tanh (FloatType* values,
size_t numValues)
noexcept
123 for (
size_t i = 0; i < numValues; ++i)
134 template <
typename FloatType>
135 static FloatType
cos (FloatType x)
noexcept
138 auto numerator = -(-39251520 + x2 * (18471600 + x2 * (-1075032 + 14615 * x2)));
139 auto denominator = 39251520 + x2 * (1154160 + x2 * (16632 + x2 * 127));
140 return numerator / denominator;
149 template <
typename FloatType>
150 static void cos (FloatType* values,
size_t numValues)
noexcept
152 for (
size_t i = 0; i < numValues; ++i)
162 template <
typename FloatType>
163 static FloatType
sin (FloatType x)
noexcept
166 auto numerator = -x * (-11511339840 + x2 * (1640635920 + x2 * (-52785432 + x2 * 479249)));
167 auto denominator = 11511339840 + x2 * (277920720 + x2 * (3177720 + x2 * 18361));
168 return numerator / denominator;
177 template <
typename FloatType>
178 static void sin (FloatType* values,
size_t numValues)
noexcept
180 for (
size_t i = 0; i < numValues; ++i)
190 template <
typename FloatType>
191 static FloatType
tan (FloatType x)
noexcept
194 auto numerator = x * (-135135 + x2 * (17325 + x2 * (-378 + x2)));
195 auto denominator = -135135 + x2 * (62370 + x2 * (-3150 + 28 * x2));
196 return numerator / denominator;
205 template <
typename FloatType>
206 static void tan (FloatType* values,
size_t numValues)
noexcept
208 for (
size_t i = 0; i < numValues; ++i)
219 template <
typename FloatType>
220 static FloatType
exp (FloatType x)
noexcept
222 auto numerator = 1680 + x * (840 + x * (180 + x * (20 + x)));
223 auto denominator = 1680 + x *(-840 + x * (180 + x * (-20 + x)));
224 return numerator / denominator;
233 template <
typename FloatType>
234 static void exp (FloatType* values,
size_t numValues)
noexcept
236 for (
size_t i = 0; i < numValues; ++i)
246 template <
typename FloatType>
249 auto numerator = x * (7560 + x * (15120 + x * (9870 + x * (2310 + x * 137))));
250 auto denominator = 7560 + x * (18900 + x * (16800 + x * (6300 + x * (900 + 30 * x))));
251 return numerator / denominator;
260 template <
typename FloatType>
261 static void logNPlusOne (FloatType* values,
size_t numValues)
noexcept
263 for (
size_t i = 0; i < numValues; ++i)
This class contains various fast mathematical function approximations.
static void cos(FloatType *values, size_t numValues) noexcept
Provides a fast approximation of the function cos(x) using a Pade approximant continued fraction,...
static FloatType tanh(FloatType x) noexcept
Provides a fast approximation of the function tanh(x) using a Pade approximant continued fraction,...
static void tanh(FloatType *values, size_t numValues) noexcept
Provides a fast approximation of the function tanh(x) using a Pade approximant continued fraction,...
static FloatType sinh(FloatType x) noexcept
Provides a fast approximation of the function sinh(x) using a Pade approximant continued fraction,...
static FloatType sin(FloatType x) noexcept
Provides a fast approximation of the function sin(x) using a Pade approximant continued fraction,...
static FloatType logNPlusOne(FloatType x) noexcept
Provides a fast approximation of the function log(x+1) using a Pade approximant continued fraction,...
static void sin(FloatType *values, size_t numValues) noexcept
Provides a fast approximation of the function sin(x) using a Pade approximant continued fraction,...
static FloatType exp(FloatType x) noexcept
Provides a fast approximation of the function exp(x) using a Pade approximant continued fraction,...
static void logNPlusOne(FloatType *values, size_t numValues) noexcept
Provides a fast approximation of the function log(x+1) using a Pade approximant continued fraction,...
static FloatType cos(FloatType x) noexcept
Provides a fast approximation of the function cos(x) using a Pade approximant continued fraction,...
static FloatType tan(FloatType x) noexcept
Provides a fast approximation of the function tan(x) using a Pade approximant continued fraction,...
static void cosh(FloatType *values, size_t numValues) noexcept
Provides a fast approximation of the function cosh(x) using a Pade approximant continued fraction,...
static void sinh(FloatType *values, size_t numValues) noexcept
Provides a fast approximation of the function sinh(x) using a Pade approximant continued fraction,...
static void exp(FloatType *values, size_t numValues) noexcept
Provides a fast approximation of the function exp(x) using a Pade approximant continued fraction,...
static FloatType cosh(FloatType x) noexcept
Provides a fast approximation of the function cosh(x) using a Pade approximant continued fraction,...
static void tan(FloatType *values, size_t numValues) noexcept
Provides a fast approximation of the function tan(x) using a Pade approximant continued fraction,...