maxima:issue-4257-integrate-subst-with-diff

Last commit made on 2024-01-31
Get this branch:
git clone -b issue-4257-integrate-subst-with-diff https://git.launchpad.net/maxima

Branch merges

Branch information

Name:
issue-4257-integrate-subst-with-diff
Repository:
lp:maxima

Recent commits

63b1b1d... by Raymond Toy <email address hidden>

Fix #4257: Remove code applying the subst y=c*x+b

The code in `monstertrig` that applied the substitution `y=c*x+b` was
to fix an issue with integrating `x*sin(n*x)` which used to take
longer and longer as the integer `n` became larger.

However, it appears this is no longer the case. As mentioned in
[#4257], even really large numbers are integrated instantly.

Remove this code. And add a test for this in rtest15.mac

Full testsuite + share passes.

be9074f... by Raymond Toy <email address hidden>

Fix error in previous commit confusing pl and pl*

In renaming `pl*` to `pl`, we got confused because `logcpi0` already
has a lexical named `pl`. Surprisingly, the testsuite passes with
this error, but we should fix it. `pl` was supposed to be the result
from `polelist-var`. So name it `polelist` instead of `pl`, leaving
the renaming of `pl*` to `pl`.

While we're at it fix a compiler warning about unused vars `pl*`,
`rl*`, `pl*1`, and `rl*1` in `log*rat`. We made these lexical, so we
don't need these anymore.

Full testsuite + share passes with cmucl.

6807ff1... by Raymond Toy <email address hidden>

Rename p* and pe* to pp and pe

Rename to prevent possible confusion that the variables are
special. (Maxima often uses foo* or *foo to denote special
variables.)

0ab95ef... by Raymond Toy <email address hidden>

Make p* and pe* lexicals

These are set in `mtoinf` and used and modified in `p*pin%ex`. Since
`p*pin%ex` is only used by `mtoinf`, we can move it into `mtoinf`.
Then `p*pin%ex` can close over `p*` and `pe*`. Thus, no special
variables needed.

Because `p*pin%ex` sometimes returns `p*` or `pe*` or a list (from
`andmapcar`), I think it would be complicated to have the function
return the modified values of `p*` and `pe*`.

Full testsuite + share passes with cmucl.

c96b402... by Raymond Toy <email address hidden>

Remove special decls for pl*, rl*, pl*1, rl*1

e8d2176... by Raymond Toy <email address hidden>

Make pl*, rl*, pl*1, rl*1 lexicals

These variables are set in `logcpi0`. `log*rat` calls `logcpi0` (via
`logcpi`). These are then used in `lognx2` which is called from
`logcpj` in `log*rat`.

We can make these lexical by having `locpi0` return these 4 variables
as additional values. `log*rat` is updated to receive these. Then
`logcpj` has these 4 extra variables so it can call `lognx2`.

Rename the variables to remove the "*" so that they won't possibly be
confused with special variables.

(I wonder if using a structure to hold these, along with `plm` and
`factors` would be worth doing?)

Full testsuite + share passes with cmucl.

b9ae6ab... by Raymond Toy <email address hidden>

Remove nil'ed out declaration of factors.

699f4e9... by Raymond Toy <email address hidden>

Make factors a lexical variable

`factors` is set in `logcpi0`, so return as the 3rd value from
`logcpi0`. It's also returned as the third value from `logcpi`.
Update the code to accept this third value. It was already passed as
an arg to `logcpj`.

Full testsuite + share passes with cmucl.

6948f2e... by Raymond Toy <email address hidden>

Rename plm* to plm and remove special declarations

Rename the variable so we don't accidentally think it is a special
variable. And remove the (two!) special declarations for it.

Full testsuite + share passes with cmucl.

3182cbd... by Raymond Toy <email address hidden>

Make plm* a lexical instead of special

`plm*` is initialized in `log*rat` and the value is set in `logcpi0`.

To make it lexical, have `logcpi0` return `plm*` as the second value.
This is called by `logcpi` and returns immediately, so `logcpi` will
return 2 values too in this case. In `log*rat`, update the call to
`logcpi` to accept the two return values, updating the array and
`plm*` appropriately. We also call `logcpi` when the `dotimes` loop
is done, but we don't need to do anything with the second value.

`logcpj` references `plm*`, so pass it as an additional arg.

Full testsuite + share passes with cmucl.