Skip to content

Let's compare ourselves to alternatives... #184

Description

@Happypig375

.NET

https://github.com/mathnet/mathnet-symbolics

  • Is most popular .NET computer algebra library
  • Written in F# (less code to maintain but harder for outsiders to contribute)
  • Has sec, csc, asec, acsc, hyperbolic and abs nodes plus some special functions but no factorials (ha)
  • Separates ComplexInfinity from Undefined
  • Can output MathML but splits simplify, collapse and expand into 3 separate modules (bruh)
  • No limits nor arbitrary-precision arithmetic

https://github.com/dharmatech/Symbolism

  • Supports boolean algebra but can't parse expressions from string
  • Only algebra, no calculus
  • No arbitrary-precision arithmetic and separates floating-points from fractions
  • Doesn't even have an arccosine function (Missing Arccos func ? dharmatech/Symbolism#12)
  • Has more stars and watchers but less NuGet downloads (lol)

https://github.com/sympy/sympy

  • Most popular open-source computer algebra library but is Python so no type safety
  • This is our dream to reach

JavaScript and friends

https://github.com/davidedc/Algebrite

  • Has integration, summation, product, erf.. but no limits (ha)
  • CoffeeScript? Not TypeScript -1
  • Availability of functions is not bad

https://github.com/aantthony/javascript-cas

  • Is dead
  • Is GPL

https://github.com/MatthewJA/Coffeequate

  • Is dead
  • Very basic, no trig
  • Symbolic constants need to be prepended by a backslash (no one wants that)

https://github.com/nicolewhite/algebra.js

  • A waste of 1.3k stars
  • No trig again
  • Has summation though

https://github.com/jiggzson/nerdamer

  • Can do limits, differentiation, calculus and even trig integral functions
  • Fake arbitrary precision (aka only double precision but shows 100 digits so asin(1)*2 is only correct to ~15 digits)
  • Availability of functions is not bad

There are probably more out there...

Activity

  1. WhiteBlackGoose commented on Aug 4, 2020

    @WhiteBlackGoose
    Member

    Nice!
    You compiled a long list.

    SymPy I guess is half-way, the goal is WolframAlpha. For example, recently I wanted to see how SymPy solves a trigonometric equation and guess what? It couldn't solve it. I think SymPy is rather a mess of genious mathematical ideas mixed into something that works sometimes. Of course, we're still far from that, but it might be not the finish-line for us :).

    I think we can indeed surpass Math.Net, even if it's so popular and etc. We can integrate things way faster than big boys.

    Thank you for the list again, mb we will add some more to it.

  2. MomoDeve commented on Aug 4, 2020

    @MomoDeve
    Member

    sec, csc, asec, acsc

    useless functions. They exist because someone was so stupid to suggest sin^-1(x) mean other than power. Why not have asin, acos, atan, acot as inverse functions and write 1/sin 1/cos and etc?

    Supports boolean algebra but can't parse expressions from string

    We also support it, doesn't we? @WhiteBlackGoose
    lol it was in our old website codebase

    Has more stars and watchers but less NuGet downloads (lol)

    Nuget downloads also come from CI systems so its hard to judge how many people use the library

    https://github.com/sympy/sympy This is our dream to reach

    Actually we noticed that sympy cannot solve 4-th degree polynoms with non-numeric constants and trigonometric equations like
    sin(2x + 2) + sin(x + 1) - a

  3. WhiteBlackGoose commented on Aug 4, 2020

    @WhiteBlackGoose
    Member

    Also I think we gotta dig deeper into our alternative's simplification algorithms, because even though I've been working on it since AM's start, it seems to suck 😢

    @MomoDeve you're probably referring to this https://github.com/WhiteBlackGoose/asc-community/blob/master/ascsite/Core/AscSci/AscMath/BoolEng.cs

  4. Happypig375 commented on Aug 4, 2020

    @Happypig375
    MemberAuthor

    C# 9 will come with Visual Studio 16.7 and with the and, or, not patterns, records, and covariant returns I'll refactor AngouriMath into a much cleaner state.

  5. WhiteBlackGoose commented on Aug 4, 2020

    @WhiteBlackGoose
    Member

    In what way you want to refactor it?

  6. Happypig375 commented on Aug 5, 2020

    @Happypig375
    MemberAuthor

    From Discord

    So I've been thinking of replacing Pattern objects with C# Patterns because they are type-unsafe and replacing Entity.Children with properties that match the functions, e.g. Logf as a class has Base and Num as properties

  7. Happypig375 commented on Aug 5, 2020

    @Happypig375
    MemberAuthor

    They exist because someone was so stupid to suggest sin^-1(x) mean other than power.

    Just wait till you see https://en.wikipedia.org/wiki/Versine and https://en.wikipedia.org/wiki/Exsecant

    Nuget downloads also come from CI systems so its hard to judge how many people use the library

    Stars and watchers also don't translate to actual uses. People could leave a star then go onto other projects to star. There doesn't seem to be a better metric to use.

  8. WhiteBlackGoose commented on Aug 5, 2020

    @WhiteBlackGoose
    Member

    Stars and watchers also don't translate to actual uses. People could leave a star then go onto other projects to star. There doesn't seem to be a better metric to use.

    Of course, we do not judge by any of those numbers, but they enourage us to keep working on AM.

  9. Happypig375 commented on Aug 5, 2020

    @Happypig375
    MemberAuthor

    Why not have asin, acos, atan, acot as inverse functions and write 1/sin 1/cos and etc?

    @WhiteBlackGoose Why did we skip sec and csc but kept cot? cot(x) = 1/tan(x) so there is an inconsistency here.

  10. WhiteBlackGoose commented on Aug 5, 2020

    @WhiteBlackGoose
    Member

    We don't have a separate node for sec and csc, but so far I don't see the reason we should have it. It's not hard to implement them though

  11. Happypig375 commented on Aug 5, 2020

    @Happypig375
    MemberAuthor

    But cot falls into the same bucket as sec and csc in that they are inverted tan, cos, sin respectively so why did we keep cot as a node?

  12. WhiteBlackGoose commented on Aug 5, 2020

    @WhiteBlackGoose
    Member

    Not really the same "bucket". Tan and cot are opposite on the triangle but symmetric. The same way sin and cos are. While sec and csc are way more rarely used & are inverted (as ^(-1)) of sine and cosine, so I didn't think we really need them

  13. Happypig375 commented on Aug 5, 2020

    @Happypig375
    MemberAuthor
  14. Happypig375 commented on Aug 5, 2020

    @Happypig375
    MemberAuthor

    When we say "trigonometric functions", we either mean the 3-function group (sin, cos, tan) or the 6-function group (sin, cos, tan, cot, sec, csc). The 3-function group is taught in basic Trigonometry classes and are the group present in basic calculators. The 6-function group is taught in basic Calculus classes and are the group used in Wikipedia, on the Windows calculator, Wolfram Alpha, etc.

    I have never heard of the 4-function group (sin, cos, tan, cot) excluding sec and csc until now. If we use the definition of trig functions in basic Trigonometry classes, we would not simplify 1/sin, 1/cos and 1/tan. If we use the definition of trig functions in basic Calculus classes, we would simplify 1/sin, 1/cos, 1/tan to csc, sec and cot respectively. However, with our current definition, we would see 1/sin, 1/cos and cot respectively. This is confusing behaviour and we should pick a side.

  15. WhiteBlackGoose commented on Aug 5, 2020

    @WhiteBlackGoose
    Member

    I see where you came from, and yes, I'm surely more used to what you call "4-function group". But I think we still can add secant and cosecant as nodes

  16. MomoDeve commented on Aug 5, 2020

    @MomoDeve
    Member

    I am just afraid that existance of many trigonometrc functions will complicate trigonometric solver and simlificator. We of course can do substitution right at the beginnig of solving, but its a weird solution

  17. WhiteBlackGoose commented on Oct 14, 2020

    @WhiteBlackGoose
    Member
  18. Happypig375 commented on Oct 14, 2020

    @Happypig375
    MemberAuthor

    Ewwwwww GPL

  19. MomoDeve commented on Oct 14, 2020

    @MomoDeve
    Member

    https://github.com/axkr/symja_android_library this might be also worth consideration

    Cannot solve 2^x + 4^x + c, bruh

  20. Rafael-SOWNet commented on Aug 5, 2026

    @Rafael-SOWNet
    Member

    Measured rather than argued. Full write-up below; everything in it comes from running both libraries on the same inputs on .NET 10.0.10, with AngouriMath built from master, MathNet.Symbolics 0.25.0 and Symbolism 1.0.4. The Math.NET column of the capability table was filled in by reflecting over its assembly, not by reading its docs.

    Capability matrix

    The Math.NET Symbolics column is filled in by reflecting over its assembly,
    not by reading its documentation.

    Capability AngouriMath Math.NET Symbolics Symbolism
    Parse infix string yes yes no (expression trees only)
    Print infix yes yes yes
    LaTeX output yes yes no
    MathML output no yes no
    Differentiate yes yes yes
    Integrate (symbolic) yes no no
    Limits yes no no
    Solve equations yes no yes (basic)
    Solve inequalities yes no no
    Systems of equations yes no no
    Expand yes yes yes
    Rational simplify / cancel yes yes yes
    Polynomial GCD, division, partial fractions partial yes no
    Taylor series yes yes no
    Matrices / linear algebra yes no no
    Sets, intervals, set algebra yes no no
    Boolean algebra and predicates yes no no
    Piecewise functions yes no no
    Compile expression to delegate yes yes no
    Arbitrary-precision arithmetic yes (PeterO.Numbers) no (BigRational + double) no (double)
    Complex numbers yes, first class partial partial
    Multithreading / cancellation controls yes no no
    F# wrapper yes (AngouriMath.FSharp) native F# no
    Interactive/notebook integration yes (.NET Interactive) no no

    Downloads on nuget.org at time of writing: MathNet.Symbolics 748k,
    AngouriMath 311k, Symbolism 54k. The purely numeric MathNet.Numerics
    (71.5M) is not a symbolic library and is a complement, not a competitor.

    The decisive result: AngouriMath is the only actively maintained .NET library
    in this set that does symbolic integration, limits, inequalities, sets and
    matrices at all.
    Math.NET Symbolics is deliberately a smaller tool --
    algebraic manipulation and differentiation, done cleanly -- and it wins on
    polynomial infrastructure (GCD, partial fractions) and MathML.

    Same task, both libraries

    Task Input AngouriMath Math.NET Symbolics
    differentiate x^3 + 2*x^2 + x + 1 1 + 3 * x ^ 2 + 4 * x 1 + 4*x + 3*x^2
    differentiate sin(x)*cos(x) cos(2 * x) -(sin(x))^2 + (cos(x))^2
    differentiate ln(x)/x (1 - ln(x)) / x ^ 2 provided x > 0 and not x = 0 1/x^2 - ln(x)/x^2
    differentiate (x^2+1)/(x-1) 1 + (-2) / (x - 1) ^ 2 (2*x)/(-1 + x) - (1 + x^2)/(-1 + x)^2
    differentiate x^x (1 + ln(x)) * x ^ x provided not x = 0 x^x + x^x*ln(x)
    expand (x + 1)^3 1 + x ^ 3 + 3 * (x + x ^ 2) 1 + 3*x + 3*x^2 + x^3
    expand (a + b)*(c + d) a * (c + d) + b * c + b * d a*c + b*c + a*d + b*d
    expand (x + 1)^2*(x + 2)^2 4 + x ^ 4 + 6 * x ^ 3 + 13 * x ^ 2 + 12 * x 4 + 12*x + 13*x^2 + 6*x^3 + x^4
    simplify (x^2 - 1)/(x - 1) x + 1 provided not x - 1 = 0 1 + x
    simplify x/x + 0*y 1 provided not x = 0 1
    simplify 2*x + 3*x - x 4 * x 4*x
    simplify a*c + a*d + b*c + b*d a * (c + d) + b * c + b * d a*c + b*c + a*d + b*d

    What the table shows

    Math.NET Symbolics returns tidier output on every shared task -- its results
    are collected and ordered, where AngouriMath leaves 1 + x ^ 3 + 3 * (x + x ^ 2)
    for an expanded cube and fails to collect a*c + a*d + b*c + b*d.
    That is a real, user-visible weakness and it is what issues #531, #177 and
    #164 are about.

    The trade runs the other way on soundness. For (x^2 - 1)/(x - 1)
    Math.NET answers 1 + x unconditionally, which is wrong at x = 1 where the
    input is undefined. AngouriMath answers x + 1 provided not x - 1 = 0 and
    carries the domain condition through. Same for x/x, and for d/dx ln(x)/x,
    where AngouriMath records x > 0. Tracking removable singularities is a
    deliberate design choice that costs output tidiness and buys correctness.

    Performance on shared operations

    Median of 15 runs after 5 warm-up runs, microseconds per operation, lower is
    better. These cover only what both libraries can do, so they say nothing
    about the capability gaps above -- which matter far more.

    Operation AngouriMath (us) Math.NET Symbolics (us) Verdict
    parse a fresh polynomial 618.3 8.7 Math.NET 71.1x faster
    differentiate sin(x)*cos(x) 8.9 2.0 Math.NET 4.5x faster
    expand (x + 1)^5 41.9 9.5 Math.NET 4.4x faster
    simplify (x^2 - 1)/(x - 1) 2438.2 24.8 Math.NET 98.3x faster

    Since this was measured

    a*c + a*d + b*c + b*d now collects to (a + b) * (c + d) -- that was #531 and it is fixed, so the "fails to collect" line above is out of date. The polynomial-infrastructure gap (multivariate GCD, cancelling (x^2+2xy+y^2)/(x^2-y^2)) is real and is #55.

    The honest summary for anyone choosing between them: AngouriMath is the only actively maintained .NET library in this set that does symbolic integration, limits, inequalities, sets and matrices at all. Math.NET Symbolics is a deliberately smaller tool that is faster on the operations it shares and returns tidier output, and it answers (x^2-1)/(x-1) as 1 + x unconditionally where AngouriMath carries the domain condition. Which of those is the right trade depends on what you are building.

  21. added this to the Future milestone on Sep 18, 2026
  22. Happypig375 commented on Sep 18, 2026

    @Happypig375
    MemberAuthor

    This is really an Epic that is a proper superset of #717. This also needs to reach for the stars, i.e. Maple, MATLAB, Mathematica...

  23. modified the milestones: Future, on Sep 18, 2026
  24. added theissue type on Sep 22, 2026
  25. removed this from the milestone on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions