From 76ae7694728ba01724382c52d6edd7d6b7833850 Mon Sep 17 00:00:00 2001 From: Thomas Guillermo Albers Raviola Date: Thu, 30 Jul 2026 19:12:55 +0200 Subject: Add split_exponent --- series.mac | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/series.mac b/series.mac index 581f88c..c542144 100644 --- a/series.mac +++ b/series.mac @@ -219,6 +219,13 @@ split_prod(expr, funcs) := block( return())), [expr, apply("*", deps_on_funcs)]); +/* Return a list of factors with length given by exponent */ +split_exponent(x) := ( + if atom(x) or op(x) # "^" then ( + [x]) + else ( + makelist(part(x, 1), part(x, 2)))); + /* Substitute functions by their series expansions and apply substitutions in coeffs */ __expand_term_subst(expr, coeffs) := block( -- cgit v1.3