diff options
| author | Thomas Guillermo Albers Raviola <thomas@thomaslabs.org> | 2026-07-30 19:15:44 +0200 |
|---|---|---|
| committer | Thomas Guillermo Albers Raviola <thomas@thomaslabs.org> | 2026-07-30 19:15:44 +0200 |
| commit | 66d27d73d6b30a54bb577edf2df662f34da9190f (patch) | |
| tree | f956de996f0c7867f0aab84fdf691e2b70f2cc3a | |
| parent | 76ae7694728ba01724382c52d6edd7d6b7833850 (diff) | |
Split powers into multiple factors
| -rw-r--r-- | series.mac | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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 */ |
