1#ifndef MU_PARSER_TEMPLATE_MAGIC_H
2#define MU_PARSER_TEMPLATE_MAGIC_H
7std::complex<double>
intPower(
const std::complex<double>&,
int);
89 inline static T
Sin(
const T& v)
91 return v.imag() == 0.0 ? std::sin(v.real()) : std::sin(v);
95 inline static T
Cos(
const T& v)
97 return v.imag() == 0.0 ? std::cos(v.real()) : std::cos(v);
101 inline static T
Tan(
const T& v)
103 return v.imag() == 0.0 ? std::tan(v.real()) : std::tan(v);
106 inline static T
ASin(
const T& v)
108 return v.imag() == 0.0 ? std::asin(v.real()) : std::asin(v);
112 inline static T
ACos(
const T& v)
114 return v.imag() == 0.0 ? std::acos(v.real()) : std::acos(v);
118 inline static T
ATan(
const T& v)
122 : (v.imag() == 0.0 ? std::atan(v.real()) : std::atan(v));
126 inline static T
ATan2(
const T& v1,
const T& v2)
128 return std::atan2(v1, v2);
132 inline static T
Sinh(
const T& v)
134 return v.imag() == 0.0 ? std::sinh(v.real()) : std::sinh(v);
138 inline static T
Cosh(
const T& v)
140 return v.imag() == 0.0 ? std::cosh(v.real()) : std::cosh(v);
144 inline static T
Tanh(
const T& v)
146 return v.imag() == 0.0 ? std::tanh(v.real()) : std::tanh(v);
150 inline static T
Sqrt(
const T& v)
152 return v.imag() == 0.0 ? std::sqrt(v.real()) : std::sqrt(v);
156 inline static T
Log(
const T& v)
158 return v.imag() == 0.0 ? std::log(v.real()) : std::log(v);
162 inline static T
Log2(
const T& v)
164 return (v.imag() == 0.0 ? std::log(v.real()) : std::log(v))/std::log(2.0);
170 return v.imag() == 0.0 ? std::log10(v.real()) : std::log10(v);
176 return Log(v +
Sqrt(v * v + 1.0));
182 return Log(v +
Sqrt(v * v - 1.0));
188 return (0.5 *
Log((1.0 + v) / (1.0 - v)));
192 inline static T
Exp(
const T& v)
194 return v.imag() == 0 ? std::exp(v.real()) : std::exp(v);
198 inline static T
Rint(
const T& v)
204 inline static T
Sign(
const T& v)
206 return (T)((v<0.0) ? -1.0 : (v>0.0) ? 1.0 : 0.0);
210 inline static T
Pow(
const T& v1,
const T& v2)
212 return v2.imag() == 0.0 && v2.real() == (int)v2.real()
214 : (v1.imag() == 0.0 && v2.imag() == 0.0 ? std::pow(v1.real(), v2.real()) : std::pow(v1, v2));
This file defines the error class used by the parser.
std::complex< double > intPower(const std::complex< double > &, int)
This function calculates the power of a value with the specialization that the exponent is an integer...
CONSTCD14 std::enable_if< detail::no_overflow< Period, typenameTo::period >::value, To >::type floor(const std::chrono::duration< Rep, Period > &d)
Namespace for mathematical applications.
bool isnan(const value_type &v)
A template class for providing wrappers for essential math functions.
static T ACos(const T &v)
static T ASinh(const T &v)
static T Log10(const T &v)
static T Sign(const T &v)
static T Tanh(const T &v)
static T ATan(const T &v)
static T ATan2(const T &v1, const T &v2)
static T Sqrt(const T &v)
static T Pow(const T &v1, const T &v2)
static T ATanh(const T &v)
static T Cosh(const T &v)
static T Rint(const T &v)
static T Log2(const T &v)
static T Sinh(const T &v)
static T ACosh(const T &v)
static T ASin(const T &v)
A class singling out integer types at compile time using template meta programming.