From 66d27d73d6b30a54bb577edf2df662f34da9190f Mon Sep 17 00:00:00 2001 From: Thomas Guillermo Albers Raviola Date: Thu, 30 Jul 2026 19:15:44 +0200 Subject: Split powers into multiple factors --- series.mac | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'series.mac') 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 */ -- cgit v1.3