summaryrefslogtreecommitdiff
path: root/series.mac
diff options
context:
space:
mode:
authorThomas Guillermo Albers Raviola <thomas@thomaslabs.org>2026-07-30 19:12:55 +0200
committerThomas Guillermo Albers Raviola <thomas@thomaslabs.org>2026-07-30 19:12:55 +0200
commit76ae7694728ba01724382c52d6edd7d6b7833850 (patch)
treea0c0fb3671a3f7873e55fc8c351fe80ea7d6abaf /series.mac
parent979bcda06f44fb2c92aca36b2f3c41943bf189ea (diff)
Add split_exponent
Diffstat (limited to 'series.mac')
-rw-r--r--series.mac7
1 files changed, 7 insertions, 0 deletions
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(