#include "power.h"
#include "relational.h"
#include "symbol.h"
+#include "pseries.h"
#include "utils.h"
#ifndef NO_NAMESPACE_GINAC
return power(x, _ex_1());
}
+static ex log_series(const ex & x, const symbol & s, const ex & pt, int order)
+{
+ if (x.subs(s == pt).is_zero()) {
+ epvector seq;
+ seq.push_back(expair(log(x), _ex0()));
+ return pseries(s, pt, seq);
+ } else
+ throw do_taylor();
+}
+
REGISTER_FUNCTION(log, eval_func(log_eval).
evalf_func(log_evalf).
- derivative_func(log_deriv));
+ derivative_func(log_deriv).
+ series_func(log_series));
//////////
// sine (trigonometric function)
ex ex::series(const symbol &s, const ex &point, int order) const
{
GINAC_ASSERT(bp!=0);
- return bp->series(s, point, order);
+ ex e;
+ try {
+ e = bp->series(s, point, order);
+ } catch (exception &x) {
+ throw (std::logic_error(string("unable to compute series (") + x.what() + ")"));
+ }
+ return e;
}