summaryrefslogtreecommitdiff
path: root/series.mac
diff options
context:
space:
mode:
Diffstat (limited to 'series.mac')
-rw-r--r--series.mac10
1 files changed, 7 insertions, 3 deletions
diff --git a/series.mac b/series.mac
index c542144..7e44e9b 100644
--- a/series.mac
+++ b/series.mac
@@ -241,10 +241,14 @@ __expand_term_prod(expr, coeffs) := block(
of funcs*/
block([split : split_prod(expr, funcs)],
free : split[1],
- if not atom(split[2]) and op(split[2])="*" then (
- factors : args(split[2]))
+ /* TODO: Handle diff as operator */
+ if atom(split[2]) or (op(split[2]) # "*" and op(split[2]) # "^") then (
+ factors : [split[2]])
+ elseif op(split[2]) = "*" then (
+ factors : mappend(split_exponent, args(split[2])))
else (
- factors : [split[2]])),
+ /* Only op = "^" is possible at this point */
+ factors : split_exponent(split[2]))),
/* Substitute funcs factors by expansion */
factors : __expand_term_subst(factors, coeffs),
/* Total product using series optimization */