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));
157 latex_name(
"\\exp"));
165 if (is_exactly_a<numeric>(
x))
166 return log(ex_to<numeric>(
x));
187 return log(ex_to<numeric>(
x));
192 const ex &t =
x.
op(0);
215 bool must_expand_arg =
false;
220 must_expand_arg =
true;
224 must_expand_arg =
true;
230 if (must_expand_arg) {
240 unsigned extra_ord = 0;
247 const symbol &s = ex_to<symbol>(rel.
lhs());
248 const ex &point = rel.
rhs();
263 if (
n == 0 &&
coeff == 1) {
265 ex acc = dynallocate<pseries>(rel,
epvector());
266 for (
int i =
order-1; i>0; --i) {
269 acc = (ex_to<pseries>(rest)).mul_series(ex_to<pseries>(acc));
276 return pseries(rel, std::move(seq));
283 const symbol &s = ex_to<symbol>(rel.
lhs());
284 const ex &point = rel.
rhs();
318 sumseq.reserve(arg.
nops());
319 prodseq.reserve(arg.
nops());
330 sumseq.push_back(
log(e));
332 sumseq.push_back(
log(-e));
335 prodseq.push_back(e);
338 if (sumseq.size() > 0) {
346 return add(sumseq)+
log(newarg);
366 if (is_exactly_a<numeric>(
x) &&
370 return conjugate_function(
log(
x)).hold();
389 if (is_exactly_a<numeric>(
x))
390 return sin(ex_to<numeric>(
x));
431 if (is_exactly_a<function>(
x)) {
432 const ex &t =
x.
op(0);
449 return sin(ex_to<numeric>(
x));
488 latex_name(
"\\sin"));
496 if (is_exactly_a<numeric>(
x))
497 return cos(ex_to<numeric>(
x));
538 if (is_exactly_a<function>(
x)) {
539 const ex &t =
x.
op(0);
556 return cos(ex_to<numeric>(
x));
595 latex_name(
"\\cos"));
603 if (is_exactly_a<numeric>(
x))
604 return tan(ex_to<numeric>(
x));
638 throw (
pole_error(
"tan_eval(): simple pole",1));
641 if (is_exactly_a<function>(
x)) {
642 const ex &t =
x.
op(0);
659 return tan(ex_to<numeric>(
x));
720 latex_name(
"\\tan"));
728 if (is_exactly_a<numeric>(
x))
729 return asin(ex_to<numeric>(
x));
760 return asin(ex_to<numeric>(
x));
782 if (is_exactly_a<numeric>(
x) &&
786 return conjugate_function(
asin(
x)).hold();
793 latex_name(
"\\arcsin"));
801 if (is_exactly_a<numeric>(
x))
802 return acos(ex_to<numeric>(
x));
833 return acos(ex_to<numeric>(
x));
855 if (is_exactly_a<numeric>(
x) &&
859 return conjugate_function(
acos(
x)).hold();
866 latex_name(
"\\arccos"));
874 if (is_exactly_a<numeric>(
x))
875 return atan(ex_to<numeric>(
x));
897 throw (
pole_error(
"atan_eval(): logarithmic pole",0));
901 return atan(ex_to<numeric>(
x));
945 const symbol &s = ex_to<symbol>(rel.
lhs());
946 const ex &point = rel.
rhs();
957 seq.push_back(
expair(Order0correction,
_ex0));
971 if (is_exactly_a<numeric>(
x)) {
978 return conjugate_function(
atan(
x)).hold();
986 latex_name(
"\\arctan"));
994 if (is_exactly_a<numeric>(y) && is_exactly_a<numeric>(
x))
995 return atan(ex_to<numeric>(y), ex_to<numeric>(
x));
997 return atan2(y,
x).hold();
1053 return atan(ex_to<numeric>(y), ex_to<numeric>(
x));
1068 return atan2(y,
x).
hold();
1075 if (deriv_param==0) {
1093 if (is_exactly_a<numeric>(
x))
1094 return sinh(ex_to<numeric>(
x));
1109 return sinh(ex_to<numeric>(
x));
1120 if (is_exactly_a<function>(
x)) {
1121 const ex &t =
x.
op(0);
1169 latex_name(
"\\sinh"));
1177 if (is_exactly_a<numeric>(
x))
1178 return cosh(ex_to<numeric>(
x));
1193 return cosh(ex_to<numeric>(
x));
1204 if (is_exactly_a<function>(
x)) {
1205 const ex &t =
x.
op(0);
1253 latex_name(
"\\cosh"));
1261 if (is_exactly_a<numeric>(
x))
1262 return tanh(ex_to<numeric>(
x));
1277 return tanh(ex_to<numeric>(
x));
1288 if (is_exactly_a<function>(
x)) {
1289 const ex &t =
x.
op(0);
1358 latex_name(
"\\tanh"));
1366 if (is_exactly_a<numeric>(
x))
1367 return asinh(ex_to<numeric>(
x));
1382 return asinh(ex_to<numeric>(
x));
1406 if (is_exactly_a<numeric>(
x)) {
1413 return conjugate_function(
asinh(
x)).hold();
1427 if (is_exactly_a<numeric>(
x))
1428 return acosh(ex_to<numeric>(
x));
1451 return acosh(ex_to<numeric>(
x));
1473 if (is_exactly_a<numeric>(
x) &&
1477 return conjugate_function(
acosh(
x)).hold();
1491 if (is_exactly_a<numeric>(
x))
1492 return atanh(ex_to<numeric>(
x));
1507 throw (
pole_error(
"atanh_eval(): logarithmic pole",0));
1511 return atanh(ex_to<numeric>(
x));
1555 const symbol &s = ex_to<symbol>(rel.
lhs());
1556 const ex &point = rel.
rhs();
1567 seq.push_back(
expair(Order0correction,
_ex0));
1579 if (is_exactly_a<numeric>(
x) &&
1583 return conjugate_function(
atanh(
x)).hold();
Interface to GiNaC's sums of expressions.
#define GINAC_ASSERT(X)
Assertion macro for checking invariances.
const basic & hold() const
Stop further evaluation.
const basic & setflag(unsigned f) const
Set some status_flags.
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
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).
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 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)
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 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 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)
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...