Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing builtins #1133

Merged
merged 51 commits into from
Oct 22, 2024
Merged

Add missing builtins #1133

merged 51 commits into from
Oct 22, 2024

Conversation

davidar
Copy link
Collaborator

@davidar davidar commented Oct 19, 2024

I added a bunch of WMA builtins that aren't in Mathics yet:

  • NumberDigit
  • BellB
  • EulerE
  • JacobiSymbol
  • KroneckerSymbol
  • LucasL
  • PolygonalNumber
  • SquaresR
  • LinearRecurrence
  • RootSum I think this one needs some more work for converting to sympy
  • SeriesCoefficient
  • DivisorSigma
  • DivisorSum
  • IntegerPart
  • IntegerPartitions
  • MersennePrimeExponent
  • MoebiusMu
  • PowersRepresentations
  • HypergeometricU
  • LambertW
  • Subfactorial
  • PolyLog
  • ReverseSort

I also expanded the functionality of a few existing builtins to match the behaviour of WMA:

  • handle non-integer bounds in Sum
  • fixed a bug in RealDigits where it would report the wrong number of digits for powers of 10 (or whatever base is specified)
  • support Fibonacci polynomials
  • support symbolic bounds in Table (and other IterationFunctions)
  • support providing SeriesData to CoefficientList
  • added the listable attribute to a few functions
  • allow supplying a precision when calling N[] on a complex number

I can split some of these out into separate PRs if they need more work to merge.

I've started setting up some automated tests to pull all the Mathematica programs listed in OEIS and check that Mathics can evaluate them to the correct sequence values - these are all just the low hanging fruit that fell out of doing that for the first couple of hundred sequences.

@rocky
Copy link
Member

rocky commented Oct 19, 2024

Wow - thanks. I'll try to look at over the weekend.

@rocky
Copy link
Member

rocky commented Oct 20, 2024

Ok, in that case, keep what indicates your version.

Ultimately it would be ideal if we could start noting somewhere (if this doesn't already exist), the differences between versions so that someone might start a "version compatibility" package. Then packages that are written for a specific version would work.

@mmatera
Copy link
Contributor

mmatera commented Oct 20, 2024

Maybe just adding a comment above the attribute definition, inside the class?

@davidar
Copy link
Collaborator Author

davidar commented Oct 20, 2024

I split out the major groups of changes into separate PRs as suggested: #1134, #1135, #1136

mmatera pushed a commit that referenced this pull request Oct 20, 2024
I pulled out just the combinatorial functions from #1133, knocks a
couple of items off the list in #500
mmatera pushed a commit that referenced this pull request Oct 20, 2024
I pulled out just the number theory builtins (and ReverseSort) from
#1133
@rocky
Copy link
Member

rocky commented Oct 20, 2024

LGTM

@rocky rocky merged commit 8c1295c into Mathics3:master Oct 22, 2024
11 checks passed
@davidar davidar deleted the builtins branch October 23, 2024 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants