summaryrefslogtreecommitdiff
path: root/series.mac
diff options
context:
space:
mode:
authorThomas Guillermo Albers Raviola <thomas@thomaslabs.org>2026-08-04 14:50:19 +0200
committerThomas Guillermo Albers Raviola <thomas@thomaslabs.org>2026-08-04 14:50:19 +0200
commit926cc111eb68762d1fb0447128f996e21cdc4297 (patch)
treeefd3963949ecd496e8b65587a0266c4d5d297f7f /series.mac
parentd590d54167ddf2d1d44723cf1f0b74a7b3fa72ef (diff)
Handle single constant in exponent
Diffstat (limited to 'series.mac')
-rw-r--r--series.mac9
1 files changed, 6 insertions, 3 deletions
diff --git a/series.mac b/series.mac
index 791bc06..538b646 100644
--- a/series.mac
+++ b/series.mac
@@ -173,12 +173,13 @@ mul_series(factors, max_order) := block(
matchdeclare(m_any1, lambda ([e], freeof(β, γ, Φ, e)));
matchdeclare(m_any2, lambda ([e], freeof(β, γ, Φ, e)));
matchdeclare(m_any3, lambda ([e], freeof(β, γ, Φ, e)));
+matchdeclare(m_any4, lambda ([e], freeof(β, γ, Φ, e)));
matchdeclare(m_exp_expr, lambda ([e], e = β_expr or e = γ_expr or e = Φ_expr));
/* Replace β, γ and Φ expressions into a symbolic representation */
defrule(r_wrap_exp,
- exp(m_any1*β + m_any2*γ + m_any3*Φ),
- β_expr(m_any1)*γ_expr(m_any2)*Φ_expr(m_any3));
+ exp(m_any1*β + m_any2*γ + m_any3*Φ + m_any4),
+ β_expr(m_any1)*γ_expr(m_any2)*Φ_expr(m_any3)*e_expr(m_any4));
defrule(r_simp_exp_expr, m_exp_expr(0), 1);
@@ -190,8 +191,10 @@ expansions */
defrule(r_exp_β_val, β_expr(m_any1), β_expr_val(m_any1, expansion_order));
defrule(r_exp_γ_val, γ_expr(m_any1), γ_expr_val(m_any1, expansion_order));
defrule(r_exp_Φ_val, Φ_expr(m_any1), Φ_expr_val(m_any1, expansion_order));
+defrule(r_exp_e_val, e_expr(m_any1), exp(m_any));
-unwrap_exp(expr) := apply1(expr, r_exp_β_val, r_exp_γ_val, r_exp_Φ_val);
+unwrap_exp(expr) := (
+ apply1(expr, r_exp_β_val, r_exp_γ_val, r_exp_Φ_val, r_exp_e_val));
/**/