Skip to content

Commit 8f0f3d0

Browse files
committed
Provide both abs and ABS, and document them
1 parent 6258684 commit 8f0f3d0

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

HOPS/GF/Transform.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ laplacei f = f ./ facSeries
210210

211211
associations :: KnownNat n => [(ByteString, Transform n)]
212212
associations =
213-
[ ("AERATE1", \f -> f `o` x^(2::Int))
213+
[ ("ABS", \(Series v) -> Series (V.map abs v))
214+
, ("AERATE1", \f -> f `o` x^(2::Int))
214215
, ("AERATE2", \f -> f `o` x^(3::Int))
215216
, ("BARRY1", \f -> 1 / (1 - x - x*x*f)) -- Named after Paul Barry
216217
, ("BARRY2", \f -> 1 / (1 + x + x*x*f)) -- Named after Paul Barry

docs/language.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ integral(f) | integral of *f*
3535
Function | Meaning
3636
---------------|----------------------------------------
3737
`sqrt(f)` | `f^(1/2)`
38-
`abs(f)` | coefficient-wise absolute value
38+
`abs(f)` | `f` multiplied by the sign of its leading coefficient
3939
`log(f)` | logarithmic function
4040
`exp(f)` | exponential function
4141
`sin(f)` | sine function
@@ -59,6 +59,7 @@ Function | Meaning
5959

6060
Transform | Meaning
6161
---------------|----------------------------------------
62+
`ABS(f)` | coefficient-wise absolute value
6263
`AERATE1(f)` | `f(x^2)`
6364
`AERATE2(f)` | `f(x^3)`
6465
`BARRY1(f)` | `1/(1-x-x^2*f)`
@@ -68,9 +69,9 @@ Transform | Meaning
6869
`BIN1(f)` | `g={(-1)^n/n!}*((laplacei(x*f))@(-x));LEFT(laplace(-g))`
6970
`BISECT0(f)` | if `f={a0,a1,a2,a3,a4,...}` then `BISECT0(f)={a0,a2,a4,...}`
7071
`BISECT1(f)` | if `f={a0,a1,a2,a3,a4,...}` then `BISECT1(f)={a1,a3,a5,...}`
71-
`BOUS2(f)` | See [[1](https://oeis.org/transforms.txt)]
72-
`BOUS2i(f)` | See [[1](https://oeis.org/transforms.txt)]
73-
`BOUS(f)` | See [[1](https://oeis.org/transforms.txt)]
72+
`BOUS2(f)` | see [[1](https://oeis.org/transforms.txt)]
73+
`BOUS2i(f)` | see [[1](https://oeis.org/transforms.txt)]
74+
`BOUS(f)` | see [[1](https://oeis.org/transforms.txt)]
7475
`CATALAN(f)` | `C=1+x*C^2;f@(x*C)`
7576
`CATALANi(f)` | `f@(x*(1-x))`
7677
`CONV(f)` | `f^2`

0 commit comments

Comments
 (0)