48 if (is_exactly_a<numeric>(
x))
49 return exp(ex_to<numeric>(
x));
81 return exp(ex_to<numeric>(
x));
95 && is_exactly_a<add>(exp_arg)) {
97 prodseq.reserve(exp_arg.
nops());
99 prodseq.push_back(
exp(*i));
172 latex_name(
"\\exp"));
180 if (is_exactly_a<numeric>(
x))
181 return log(ex_to<numeric>(
x));
202 return log(ex_to<numeric>(
x));
207 const ex &t =
x.
op(0);
230 bool must_expand_arg =
false;
235 must_expand_arg =
true;
239 must_expand_arg =
true;
245 if (must_expand_arg) {
255 unsigned extra_ord = 0;
262 const symbol &s = ex_to<symbol>(rel.
lhs());
263 const ex &point = rel.
rhs();
278 if (
n == 0 &&
coeff == 1) {
280 ex acc = dynallocate<pseries>(rel,
epvector());
281 for (
int i =
order-1; i>0; --i) {
284 acc = (ex_to<pseries>(rest)).mul_series(ex_to<pseries>(acc));
291 return pseries(rel, std::move(seq));
298 const symbol &s = ex_to<symbol>(rel.
lhs());
299 const ex &point = rel.
rhs();
333 sumseq.reserve(arg.
nops());
334 prodseq.reserve(arg.
nops());
345 sumseq.push_back(
log(e));
347 sumseq.push_back(
log(-e));
350 prodseq.push_back(e);
353 if (sumseq.size() > 0) {
361 return add(sumseq)+
log(newarg);
381 if (is_exactly_a<numeric>(
x) &&
385 return conjugate_function(
log(
x)).hold();
417 if (is_exactly_a<numeric>(
x))
418 return sin(ex_to<numeric>(
x));
459 if (is_exactly_a<function>(
x)) {
460 const ex &t =
x.
op(0);
477 return sin(ex_to<numeric>(
x));
528 latex_name(
"\\sin"));
536 if (is_exactly_a<numeric>(
x))
537 return cos(ex_to<numeric>(
x));
578 if (is_exactly_a<function>(
x)) {
579 const ex &t =
x.
op(0);
596 return cos(ex_to<numeric>(
x));
636 latex_name(
"\\cos"));
644 if (is_exactly_a<numeric>(
x))
645 return tan(ex_to<numeric>(
x));
679 throw (
pole_error(
"tan_eval(): simple pole",1));
682 if (is_exactly_a<function>(
x)) {
683 const ex &t =
x.
op(0);
700 return tan(ex_to<numeric>(
x));
762 latex_name(
"\\tan"));
770 if (is_exactly_a<numeric>(
x))
771 return asin(ex_to<numeric>(
x));
802 return asin(ex_to<numeric>(
x));
824 if (is_exactly_a<numeric>(
x) &&
828 return conjugate_function(
asin(
x)).hold();
846 latex_name(
"\\arcsin"));
854 if (is_exactly_a<numeric>(
x))
855 return acos(ex_to<numeric>(
x));
886 return acos(ex_to<numeric>(
x));
908 if (is_exactly_a<numeric>(
x) &&
912 return conjugate_function(
acos(
x)).hold();
920 latex_name(
"\\arccos"));
928 if (is_exactly_a<numeric>(
x))
929 return atan(ex_to<numeric>(
x));
951 throw (
pole_error(
"atan_eval(): logarithmic pole",0));
955 return atan(ex_to<numeric>(
x));
999 const symbol &s = ex_to<symbol>(rel.
lhs());
1000 const ex &point = rel.
rhs();
1004 if ((
I*arg_pt)<
_ex0)
1011 seq.push_back(
expair(Order0correction,
_ex0));
1025 if (is_exactly_a<numeric>(
x)) {
1032 return conjugate_function(
atan(
x)).hold();
1056 latex_name(
"\\arctan"));
1064 if (is_exactly_a<numeric>(y) && is_exactly_a<numeric>(
x))
1065 return atan(ex_to<numeric>(y), ex_to<numeric>(
x));
1067 return atan2(y,
x).hold();
1123 return atan(ex_to<numeric>(y), ex_to<numeric>(
x));
1138 return atan2(y,
x).
hold();
1145 if (deriv_param==0) {
1181 if (is_exactly_a<numeric>(
x))
1182 return sinh(ex_to<numeric>(
x));
1197 return sinh(ex_to<numeric>(
x));
1208 if (is_exactly_a<function>(
x)) {
1209 const ex &t =
x.
op(0);
1258 latex_name(
"\\sinh"));
1266 if (is_exactly_a<numeric>(
x))
1267 return cosh(ex_to<numeric>(
x));
1282 return cosh(ex_to<numeric>(
x));
1293 if (is_exactly_a<function>(
x)) {
1294 const ex &t =
x.
op(0);
1343 latex_name(
"\\cosh"));
1351 if (is_exactly_a<numeric>(
x))
1352 return tanh(ex_to<numeric>(
x));
1367 return tanh(ex_to<numeric>(
x));
1378 if (is_exactly_a<function>(
x)) {
1379 const ex &t =
x.
op(0);
1449 latex_name(
"\\tanh"));
1457 if (is_exactly_a<numeric>(
x))
1458 return asinh(ex_to<numeric>(
x));
1473 return asinh(ex_to<numeric>(
x));
1497 if (is_exactly_a<numeric>(
x)) {
1504 return conjugate_function(
asinh(
x)).hold();
1519 if (is_exactly_a<numeric>(
x))
1520 return acosh(ex_to<numeric>(
x));
1543 return acosh(ex_to<numeric>(
x));
1565 if (is_exactly_a<numeric>(
x) &&
1569 return conjugate_function(
acosh(
x)).hold();
1584 if (is_exactly_a<numeric>(
x))
1585 return atanh(ex_to<numeric>(
x));
1600 throw (
pole_error(
"atanh_eval(): logarithmic pole",0));
1604 return atanh(ex_to<numeric>(
x));
1648 const symbol &s = ex_to<symbol>(rel.
lhs());
1649 const ex &point = rel.
rhs();
1660 seq.push_back(
expair(Order0correction,
_ex0));
1672 if (is_exactly_a<numeric>(
x) &&
1676 return conjugate_function(
atanh(
x)).hold();
Interface to GiNaC's sums of expressions.
#define GINAC_ASSERT(X)
Assertion macro for checking invariances.
const basic & setflag(unsigned f) const
Set some status_flags.
const basic & hold() const
Stop further evaluation.
Exception class thrown by classes which provide their own series expansion to signal that ordinary Ta...
Lightweight wrapper for GiNaC's symbolic objects.
const_iterator begin() const noexcept
ex diff(const symbol &s, unsigned nth=1) const
Compute partial derivative of an expression.
ex expand(unsigned options=0) const
Expand an expression.
bool is_equal(const ex &other) const
const_iterator end() const noexcept
ex series(const ex &r, int order, unsigned options=0) const
Compute the truncated series expansion of an expression.
ex subs(const exmap &m, unsigned options=0) const
bool info(unsigned inf) const
@ expand_transcendental
expands transcendental functions like log and exp
@ expand_function_args
expands the arguments of functions
This class is a wrapper around CLN-numbers within the GiNaC class hierarchy.
bool is_equal(const numeric &other) const
bool is_zero() const
True if object is zero.
Exception class thrown when a singularity is encountered.
This class holds a two-component object, a basis and and exponent representing exponentiation.
This class holds a extended truncated power series (positive and negative integer powers).
int ldegree(const ex &s) const override
Return degree of lowest power of the series.
ex coeff(const ex &s, int n=1) const override
Return coefficient of degree n in power series if s is the expansion variable.
size_t nops() const override
Return the number of operands including a possible order term.
bool is_terminating() const
Returns true if there is no order term, i.e.
ex add_series(const pseries &other) const
Add one series object to another, producing a pseries object that represents the sum.
This class holds a relation consisting of two expressions and a logical relation between them.
@ suppress_branchcut
Suppress branch cuts in series expansion.
@ expanded
.expand(0) has already done its job (other expand() options ignore this flag)
@ no_pattern
disable pattern matching
Interface to GiNaC's constant types and some special constants.
Interface to GiNaC's light-weight expression handles.
#define is_ex_the_function(OBJ, FUNCNAME)
Interface to GiNaC's initially known functions.
Interface to GiNaC's products of expressions.
static ex atan_eval(const ex &x)
bool is_zero(const ex &thisex)
const numeric I
Imaginary unit.
const numeric atan(const numeric &x)
Numeric arcustangent.
ex real_part(const ex &thisex)
static ex acosh_eval(const ex &x)
static ex atanh_series(const ex &arg, const relational &rel, int order, unsigned options)
const numeric pow(const numeric &x, const numeric &y)
static ex atanh_deriv(const ex &x, unsigned deriv_param)
static ex log_eval(const ex &x)
static ex tanh_eval(const ex &x)
static ex asinh_eval(const ex &x)
static ex atanh_conjugate(const ex &x)
static ex asin_evalf(const ex &x)
const numeric cosh(const numeric &x)
Numeric hyperbolic cosine (trigonometric function).
static ex atan_deriv(const ex &x, unsigned deriv_param)
static ex tan_eval(const ex &x)
std::vector< expair > epvector
expair-vector
static ex cosh_eval(const ex &x)
const numeric mod(const numeric &a, const numeric &b)
Modulus (in positive representation).
static ex log_deriv(const ex &x, unsigned deriv_param)
static ex asin_deriv(const ex &x, unsigned deriv_param)
const numeric abs(const numeric &x)
Absolute value.
static ex sinh_conjugate(const ex &x)
const numeric asin(const numeric &x)
Numeric inverse sine (trigonometric function).
static bool atan2_info(const ex &y, const ex &x, unsigned inf)
const numeric tanh(const numeric &x)
Numeric hyperbolic tangent (trigonometric function).
static ex tan_evalf(const ex &x)
int csgn(const numeric &x)
const numeric acos(const numeric &x)
Numeric inverse cosine (trigonometric function).
static ex tan_real_part(const ex &x)
static ex atan_conjugate(const ex &x)
static bool asin_info(const ex &x, unsigned inf)
static ex tan_deriv(const ex &x, unsigned deriv_param)
const numeric sqrt(const numeric &x)
Numeric square root.
static ex acos_conjugate(const ex &x)
ex series(const ex &thisex, const ex &r, int order, unsigned options=0)
static bool trig_info(const ex &x, unsigned inf)
const numeric sinh(const numeric &x)
Numeric hyperbolic sine (trigonometric function).
static ex asin_eval(const ex &x)
static ex atan_evalf(const ex &x)
const numeric exp(const numeric &x)
Exponential function.
static ex cosh_conjugate(const ex &x)
static ex atan2_eval(const ex &y, const ex &x)
static ex sinh_deriv(const ex &x, unsigned deriv_param)
static ex sin_conjugate(const ex &x)
static bool log_info(const ex &x, unsigned inf)
static ex exp_real_part(const ex &x)
static ex tanh_deriv(const ex &x, unsigned deriv_param)
static ex acosh_evalf(const ex &x)
const numeric acosh(const numeric &x)
Numeric inverse hyperbolic cosine (trigonometric function).
const numeric cos(const numeric &x)
Numeric cosine (trigonometric function).
static ex cos_imag_part(const ex &x)
static ex atanh_evalf(const ex &x)
static ex cos_conjugate(const ex &x)
static ex acosh_deriv(const ex &x, unsigned deriv_param)
static ex acos_evalf(const ex &x)
const constant Pi("Pi", PiEvalf, "\\pi", domain::positive)
Pi.
static ex exp_eval(const ex &x)
static ex cosh_evalf(const ex &x)
const numeric atanh(const numeric &x)
Numeric inverse hyperbolic tangent (trigonometric function).
static ex exp_expand(const ex &arg, unsigned options)
static ex cosh_real_part(const ex &x)
static ex atan_series(const ex &arg, const relational &rel, int order, unsigned options)
static bool exp_info(const ex &x, unsigned inf)
static ex acos_eval(const ex &x)
static ex sinh_imag_part(const ex &x)
static ex cos_real_part(const ex &x)
static ex tanh_conjugate(const ex &x)
const numeric log(const numeric &x)
Natural logarithm.
const numeric real(const numeric &x)
const numeric sin(const numeric &x)
Numeric sine (trigonometric function).
static ex cos_evalf(const ex &x)
static ex atan2_evalf(const ex &y, const ex &x)
static ex atan2_deriv(const ex &y, const ex &x, unsigned deriv_param)
static ex sin_evalf(const ex &x)
static ex log_real_part(const ex &x)
ex coeff(const ex &thisex, const ex &s, int n=1)
static ex exp_power(const ex &x, const ex &a)
static ex sin_deriv(const ex &x, unsigned deriv_param)
static ex cos_eval(const ex &x)
static ex asinh_evalf(const ex &x)
static ex sinh_eval(const ex &x)
static ex tanh_evalf(const ex &x)
static ex sinh_evalf(const ex &x)
static ex exp_imag_part(const ex &x)
const numeric asinh(const numeric &x)
Numeric inverse hyperbolic sine (trigonometric function).
static ex sin_imag_part(const ex &x)
const numeric tan(const numeric &x)
Numeric tangent (trigonometric function).
static ex tan_series(const ex &x, const relational &rel, int order, unsigned options)
static ex tan_conjugate(const ex &x)
static ex tan_imag_part(const ex &x)
static ex log_expand(const ex &arg, unsigned options)
static ex log_evalf(const ex &x)
static ex cosh_imag_part(const ex &x)
static ex exp_evalf(const ex &x)
static ex acos_deriv(const ex &x, unsigned deriv_param)
static ex log_conjugate(const ex &x)
REGISTER_FUNCTION(conjugate_function, eval_func(conjugate_eval). evalf_func(conjugate_evalf). expl_derivative_func(conjugate_expl_derivative). info_func(conjugate_info). print_func< print_latex >(conjugate_print_latex). conjugate_func(conjugate_conjugate). real_part_func(conjugate_real_part). imag_part_func(conjugate_imag_part). set_name("conjugate","conjugate"))
static ex sinh_real_part(const ex &x)
static ex log_series(const ex &arg, const relational &rel, int order, unsigned options)
static ex sin_eval(const ex &x)
static ex asinh_conjugate(const ex &x)
static ex asin_conjugate(const ex &x)
static ex cosh_deriv(const ex &x, unsigned deriv_param)
static ex acosh_conjugate(const ex &x)
static bool atan_info(const ex &x, unsigned inf)
const numeric * _num120_p
std::vector< ex > exvector
static ex log_imag_part(const ex &x)
static ex tanh_series(const ex &x, const relational &rel, int order, unsigned options)
static ex tanh_real_part(const ex &x)
ex imag_part(const ex &thisex)
static ex tanh_imag_part(const ex &x)
static ex cos_deriv(const ex &x, unsigned deriv_param)
static ex sin_real_part(const ex &x)
static ex exp_deriv(const ex &x, unsigned deriv_param)
static ex exp_conjugate(const ex &x)
static ex atanh_eval(const ex &x)
static ex asinh_deriv(const ex &x, unsigned deriv_param)
ex expand(const ex &thisex, unsigned options=0)
Makes the interface to the underlying bignum package available.
Interface to GiNaC's overloaded operators.
Interface to GiNaC's symbolic exponentiation (basis^exponent).
Interface to class for extended truncated power series.
Interface to relations between expressions.
Interface to GiNaC's symbolic objects.
Interface to several small and furry utilities needed within GiNaC but not of any interest to the use...