47 if (is_exactly_a<numeric>(
x))
48 return exp(ex_to<numeric>(
x));
80 return exp(ex_to<numeric>(
x));
94 && is_exactly_a<add>(exp_arg)) {
96 prodseq.reserve(exp_arg.
nops());
98 prodseq.push_back(
exp(*i));
171 latex_name(
"\\exp"));
179 if (is_exactly_a<numeric>(
x))
180 return log(ex_to<numeric>(
x));
201 return log(ex_to<numeric>(
x));
206 const ex &t =
x.
op(0);
229 bool must_expand_arg =
false;
234 must_expand_arg =
true;
238 must_expand_arg =
true;
244 if (must_expand_arg) {
254 unsigned extra_ord = 0;
261 const symbol &s = ex_to<symbol>(rel.
lhs());
262 const ex &point = rel.
rhs();
277 if (
n == 0 &&
coeff == 1) {
279 ex acc = dynallocate<pseries>(rel,
epvector());
280 for (
int i =
order-1; i>0; --i) {
283 acc = (ex_to<pseries>(rest)).mul_series(ex_to<pseries>(acc));
290 return pseries(rel, std::move(seq));
297 const symbol &s = ex_to<symbol>(rel.
lhs());
298 const ex &point = rel.
rhs();
332 sumseq.reserve(arg.
nops());
333 prodseq.reserve(arg.
nops());
344 sumseq.push_back(
log(e));
346 sumseq.push_back(
log(-e));
349 prodseq.push_back(e);
352 if (sumseq.size() > 0) {
360 return add(sumseq)+
log(newarg);
380 if (is_exactly_a<numeric>(
x) &&
384 return conjugate_function(
log(
x)).hold();
416 if (is_exactly_a<numeric>(
x))
417 return sin(ex_to<numeric>(
x));
458 if (is_exactly_a<function>(
x)) {
459 const ex &t =
x.
op(0);
476 return sin(ex_to<numeric>(
x));
527 latex_name(
"\\sin"));
535 if (is_exactly_a<numeric>(
x))
536 return cos(ex_to<numeric>(
x));
577 if (is_exactly_a<function>(
x)) {
578 const ex &t =
x.
op(0);
595 return cos(ex_to<numeric>(
x));
635 latex_name(
"\\cos"));
643 if (is_exactly_a<numeric>(
x))
644 return tan(ex_to<numeric>(
x));
678 throw (
pole_error(
"tan_eval(): simple pole",1));
681 if (is_exactly_a<function>(
x)) {
682 const ex &t =
x.
op(0);
699 return tan(ex_to<numeric>(
x));
761 latex_name(
"\\tan"));
769 if (is_exactly_a<numeric>(
x))
770 return asin(ex_to<numeric>(
x));
801 return asin(ex_to<numeric>(
x));
823 if (is_exactly_a<numeric>(
x) &&
827 return conjugate_function(
asin(
x)).hold();
845 latex_name(
"\\arcsin"));
853 if (is_exactly_a<numeric>(
x))
854 return acos(ex_to<numeric>(
x));
885 return acos(ex_to<numeric>(
x));
907 if (is_exactly_a<numeric>(
x) &&
911 return conjugate_function(
acos(
x)).hold();
919 latex_name(
"\\arccos"));
927 if (is_exactly_a<numeric>(
x))
928 return atan(ex_to<numeric>(
x));
950 throw (
pole_error(
"atan_eval(): logarithmic pole",0));
954 return atan(ex_to<numeric>(
x));
998 const symbol &s = ex_to<symbol>(rel.
lhs());
999 const ex &point = rel.
rhs();
1003 if ((
I*arg_pt)<
_ex0)
1010 seq.push_back(
expair(Order0correction,
_ex0));
1024 if (is_exactly_a<numeric>(
x)) {
1031 return conjugate_function(
atan(
x)).hold();
1055 latex_name(
"\\arctan"));
1063 if (is_exactly_a<numeric>(y) && is_exactly_a<numeric>(
x))
1064 return atan(ex_to<numeric>(y), ex_to<numeric>(
x));
1066 return atan2(y,
x).hold();
1122 return atan(ex_to<numeric>(y), ex_to<numeric>(
x));
1137 return atan2(y,
x).
hold();
1144 if (deriv_param==0) {
1180 if (is_exactly_a<numeric>(
x))
1181 return sinh(ex_to<numeric>(
x));
1196 return sinh(ex_to<numeric>(
x));
1207 if (is_exactly_a<function>(
x)) {
1208 const ex &t =
x.
op(0);
1257 latex_name(
"\\sinh"));
1265 if (is_exactly_a<numeric>(
x))
1266 return cosh(ex_to<numeric>(
x));
1281 return cosh(ex_to<numeric>(
x));
1292 if (is_exactly_a<function>(
x)) {
1293 const ex &t =
x.
op(0);
1342 latex_name(
"\\cosh"));
1350 if (is_exactly_a<numeric>(
x))
1351 return tanh(ex_to<numeric>(
x));
1366 return tanh(ex_to<numeric>(
x));
1377 if (is_exactly_a<function>(
x)) {
1378 const ex &t =
x.
op(0);
1448 latex_name(
"\\tanh"));
1456 if (is_exactly_a<numeric>(
x))
1457 return asinh(ex_to<numeric>(
x));
1472 return asinh(ex_to<numeric>(
x));
1496 if (is_exactly_a<numeric>(
x)) {
1503 return conjugate_function(
asinh(
x)).hold();
1518 if (is_exactly_a<numeric>(
x))
1519 return acosh(ex_to<numeric>(
x));
1542 return acosh(ex_to<numeric>(
x));
1564 if (is_exactly_a<numeric>(
x) &&
1568 return conjugate_function(
acosh(
x)).hold();
1583 if (is_exactly_a<numeric>(
x))
1584 return atanh(ex_to<numeric>(
x));
1599 throw (
pole_error(
"atanh_eval(): logarithmic pole",0));
1603 return atanh(ex_to<numeric>(
x));
1647 const symbol &s = ex_to<symbol>(rel.
lhs());
1648 const ex &point = rel.
rhs();
1659 seq.push_back(
expair(Order0correction,
_ex0));
1671 if (is_exactly_a<numeric>(
x) &&
1675 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 REGISTER_FUNCTION(NAME, OPT)
#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)
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...