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));
939 if (arg_pt.is_equal(
I) || arg_pt.is_equal(-
I))
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)) {
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) &&
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) &&
static ex exp_deriv(const ex &x, unsigned deriv_param)
static ex sinh_evalf(const ex &x)
const numeric exp(const numeric &x)
Exponential function.
const numeric asinh(const numeric &x)
Numeric inverse hyperbolic sine (trigonometric function).
static ex exp_evalf(const ex &x)
Exception class thrown by classes which provide their own series expansion to signal that ordinary Ta...
ex coeff(const ex &s, int n=1) const override
Return coefficient of degree n in power series if s is the expansion variable.
static ex sin_conjugate(const ex &x)
Interface to GiNaC's symbolic exponentiation (basis^exponent).
const numeric sinh(const numeric &x)
Numeric hyperbolic sine (trigonometric function).
static ex acos_evalf(const ex &x)
static ex atanh_series(const ex &arg, const relational &rel, int order, unsigned options)
Interface to GiNaC's symbolic objects.
static ex atan_deriv(const ex &x, unsigned deriv_param)
static ex atan2_eval(const ex &y, const ex &x)
int csgn(const numeric &x)
const_iterator end() const noexcept
static ex atan_series(const ex &arg, const relational &rel, int order, unsigned options)
static ex log_evalf(const ex &x)
static ex log_imag_part(const ex &x)
static ex asinh_eval(const ex &x)
const numeric acos(const numeric &x)
Numeric inverse cosine (trigonometric function).
ex subs(const exmap &m, unsigned options=0) const
const basic & hold() const
Stop further evaluation.
static ex tanh_conjugate(const ex &x)
bool is_equal(const ex &other) const
ex expand(unsigned options=0) const
Interface to GiNaC's constant types and some special constants.
static ex sinh_deriv(const ex &x, unsigned deriv_param)
static ex tan_series(const ex &x, const relational &rel, int order, unsigned options)
This class holds a relation consisting of two expressions and a logical relation between them...
Suppress branch cuts in series expansion.
static ex atan_conjugate(const ex &x)
static ex tan_evalf(const ex &x)
const numeric sin(const numeric &x)
Numeric sine (trigonometric function).
static ex sinh_eval(const ex &x)
static ex exp_conjugate(const ex &x)
Interface to GiNaC's sums of expressions.
static ex exp_power(const ex &x, const ex &a)
static ex sin_imag_part(const ex &x)
static ex atan_evalf(const ex &x)
#define is_ex_the_function(OBJ, FUNCNAME)
static ex exp_expand(const ex &arg, unsigned options)
static ex acosh_conjugate(const ex &x)
Interface to GiNaC's products of expressions.
const numeric asin(const numeric &x)
Numeric inverse sine (trigonometric function).
bool is_terminating() const
Returns true if there is no order term, i.e.
static ex acos_conjugate(const ex &x)
static ex asin_eval(const ex &x)
static ex tanh_imag_part(const ex &x)
const numeric * _num120_p
static ex tanh_evalf(const ex &x)
bool info(unsigned inf) const
Interface to several small and furry utilities needed within GiNaC but not of any interest to the use...
bool is_equal(const numeric &other) const
static ex atanh_eval(const ex &x)
static ex asin_deriv(const ex &x, unsigned deriv_param)
const_iterator begin() const noexcept
This class is a wrapper around CLN-numbers within the GiNaC class hierarchy.
static ex tan_imag_part(const ex &x)
static ex atanh_deriv(const ex &x, unsigned deriv_param)
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 log_eval(const ex &x)
static ex sinh_real_part(const ex &x)
#define GINAC_ASSERT(X)
Assertion macro for checking invariances.
This class holds a extended truncated power series (positive and negative integer powers)...
const numeric acosh(const numeric &x)
Numeric inverse hyperbolic cosine (trigonometric function).
ex imag_part(const ex &thisex)
static ex tan_deriv(const ex &x, unsigned deriv_param)
static ex asinh_evalf(const ex &x)
expands transcendental functions like log and exp
static ex tan_eval(const ex &x)
const numeric log(const numeric &x)
Natural logarithm.
static ex cosh_real_part(const ex &x)
const numeric tanh(const numeric &x)
Numeric hyperbolic tangent (trigonometric function).
static ex sin_evalf(const ex &x)
expands the arguments of functions
ex diff(const symbol &s, unsigned nth=1) const
Compute partial derivative of an expression.
static ex asin_conjugate(const ex &x)
static ex log_expand(const ex &arg, unsigned options)
const numeric abs(const numeric &x)
Absolute value.
std::vector< ex > exvector
static ex atan2_evalf(const ex &y, const ex &x)
const numeric cosh(const numeric &x)
Numeric hyperbolic cosine (trigonometric function).
ex add_series(const pseries &other) const
Add one series object to another, producing a pseries object that represents the sum.
Interface to GiNaC's overloaded operators.
static ex acosh_deriv(const ex &x, unsigned deriv_param)
const numeric sqrt(const numeric &x)
Numeric square root.
static ex exp_real_part(const ex &x)
static ex cosh_deriv(const ex &x, unsigned deriv_param)
static ex tan_real_part(const ex &x)
static ex acos_eval(const ex &x)
static ex cos_real_part(const ex &x)
Interface to GiNaC's light-weight expression handles.
ex series(const ex &r, int order, unsigned options=0) const
Compute the truncated series expansion of an expression.
const numeric I
Imaginary unit.
const numeric cos(const numeric &x)
Numeric cosine (trigonometric function).
static ex cos_conjugate(const ex &x)
const numeric pow(const numeric &x, const numeric &y)
Exception class thrown when a singularity is encountered.
static ex asin_evalf(const ex &x)
size_t nops() const override
Return the number of operands including a possible order term.
static ex exp_imag_part(const ex &x)
static ex cosh_imag_part(const ex &x)
static ex acos_deriv(const ex &x, unsigned deriv_param)
bool is_zero() const
True if object is zero.
static ex tanh_eval(const ex &x)
static ex sin_eval(const ex &x)
static ex atan2_deriv(const ex &y, const ex &x, unsigned deriv_param)
static ex tan_conjugate(const ex &x)
Lightweight wrapper for GiNaC's symbolic objects.
const numeric atanh(const numeric &x)
Numeric inverse hyperbolic tangent (trigonometric function).
static ex asinh_conjugate(const ex &x)
This class holds a two-component object, a basis and and exponent representing exponentiation.
const constant Pi("Pi", PiEvalf, "\i", domain::positive)
Pi.
static ex asinh_deriv(const ex &x, unsigned deriv_param)
Interface to GiNaC's initially known functions.
ex coeff(const ex &thisex, const ex &s, int n=1)
static ex sinh_conjugate(const ex &x)
static ex log_real_part(const ex &x)
static ex log_series(const ex &arg, const relational &rel, int order, unsigned options)
static ex log_conjugate(const ex &x)
int ldegree(const ex &s) const override
Return degree of lowest power of the series.
Interface to class for extended truncated power series.
const numeric mod(const numeric &a, const numeric &b)
Modulus (in positive representation).
static ex tanh_real_part(const ex &x)
static ex tanh_deriv(const ex &x, unsigned deriv_param)
static ex sinh_imag_part(const ex &x)
.expand(0) has already done its job (other expand() options ignore this flag)
static ex atanh_evalf(const ex &x)
Interface to relations between expressions.
Makes the interface to the underlying bignum package available.
const numeric real(const numeric &x)
static ex cosh_evalf(const ex &x)
const numeric atan(const numeric &x)
Numeric arcustangent.
static ex log_deriv(const ex &x, unsigned deriv_param)
ex series(const ex &thisex, const ex &r, int order, unsigned options=0)
std::vector< expair > epvector
expair-vector
static ex cos_eval(const ex &x)
static ex atan_eval(const ex &x)
static ex sin_real_part(const ex &x)
static ex cos_evalf(const ex &x)
static ex cosh_eval(const ex &x)
static ex acosh_eval(const ex &x)
static ex acosh_evalf(const ex &x)
static ex tanh_series(const ex &x, const relational &rel, int order, unsigned options)
static ex cos_deriv(const ex &x, unsigned deriv_param)
ex real_part(const ex &thisex)
static ex cosh_conjugate(const ex &x)
static ex exp_eval(const ex &x)
static ex sin_deriv(const ex &x, unsigned deriv_param)
ex expand(const ex &thisex, unsigned options=0)
static ex cos_imag_part(const ex &x)
static ex atanh_conjugate(const ex &x)
const numeric tan(const numeric &x)
Numeric tangent (trigonometric function).