summaryrefslogtreecommitdiff
path: root/series.mac
diff options
context:
space:
mode:
authorThomas Guillermo Albers Raviola <thomas@thomaslabs.org>2026-08-03 20:35:22 +0200
committerThomas Guillermo Albers Raviola <thomas@thomaslabs.org>2026-08-03 20:35:22 +0200
commit48ddc9c304eabd9b57e3fe07ff72de511a060dc4 (patch)
treebfda2b4a3aec6bc5bb32e5130cd5f1f3c921c066 /series.mac
parent43c59fba759dea5b34c2f81e427348d19fb77c3d (diff)
Refactor conditionals
Diffstat (limited to 'series.mac')
-rw-r--r--series.mac16
1 files changed, 8 insertions, 8 deletions
diff --git a/series.mac b/series.mac
index 57eb528..791bc06 100644
--- a/series.mac
+++ b/series.mac
@@ -7,12 +7,12 @@ neg_pow_series(c, r, a, b) := sum(c[i] / r^i, i, a, b);
filter_order(expr, x, a, b) := block([acc, len],
acc : 0,
- len : if atom(expr) or not(op(expr) = "+") then 1 else length(expr),
+ len : if atom(expr) or op(expr) # "+" then 1 else length(expr),
for i thru len do block([deg, p],
- p : if len=1 then expr else part(expr, i),
+ p : if len = 1 then expr else part(expr, i),
deg : hipow(partition([p], x)[2], x),
- if (deg >= a and deg <= b) then acc : acc + p),
+ if deg >= a and deg <= b then acc : acc + p),
acc);
@@ -33,7 +33,7 @@ exp_series(expr, x, n, a, b) := block([acc, xn, len],
expr : expand(expr),
xn : 1,
acc : 1,
- len : if atom(expr) or not(is(op(expr)="+")) then 1 else length(expr),
+ len : if atom(expr) or op(expr) # "+" then 1 else length(expr),
/* Assume a, b < 0 for now */
for i thru n do block([subexpr],
/* Discard terms that would end up creating terms outside range */
@@ -96,7 +96,7 @@ __fill_term_table(table, factors, t_min, t_max, len) := block(
/* Initialize table row with 0s */
for j : 0 thru len-1 do table[i, j] : 0,
/**/
- if not atom(factors[i+1]) and op(factors[i+1])="+" then (
+ if not atom(factors[i+1]) and op(factors[i+1]) = "+" then (
for term in args(factors[i+1]) do block(
[j, n],
n : lopow(term, r),
@@ -111,7 +111,7 @@ __fill_term_table(table, factors, t_min, t_max, len) := block(
__mul_series_level(table, max_order, i, stack, nfactors, len, t_min) := block(
[],
- if is(i = nfactors) then block(
+ if i = nfactors then block(
[order, acc],
order : 0,
for j : 0 thru nfactors-1 do order : order + stack[j] + t_min,
@@ -208,7 +208,7 @@ split_prod(expr, funcs) := block(
push(expr, deps_on_funcs),
expr : 1),
return())
- elseif op(expr)="*" then block(
+ elseif op(expr) = "*" then block(
[split : partition(expr, f)],
expr : split[1],
push(split[2], deps_on_funcs))
@@ -293,7 +293,7 @@ expand_equation(expr, coeffs) := (
expr : rhs(expr) - lhs(expr),
0 = if atom(expr) then (
expr)
- elseif op(expr)="+" then block(
+ elseif op(expr) = "+" then block(
[i : 0, len : length(args(expr))],
apply("+", map(lambda([term],
i : i+1,