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

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

Open
Happypig375 opened this issue Aug 4, 2020 · 19 comments
Open

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

Happypig375 opened this issue Aug 4, 2020 · 19 comments

Comments

@Happypig375
Copy link
Member

.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...

@WhiteBlackGoose
Copy link
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.

@MomoDeve
Copy link
Member

MomoDeve commented Aug 4, 2020

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

@WhiteBlackGoose
Copy link
Member

WhiteBlackGoose commented Aug 4, 2020

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

@Happypig375
Copy link
Member Author

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.

@WhiteBlackGoose
Copy link
Member

In what way you want to refactor it?

@Happypig375
Copy link
Member Author

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

@Happypig375
Copy link
Member Author

Happypig375 commented Aug 5, 2020

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.

@WhiteBlackGoose
Copy link
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.

@Happypig375
Copy link
Member Author

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.

@WhiteBlackGoose
Copy link
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

@Happypig375
Copy link
Member Author

Happypig375 commented Aug 5, 2020

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?

@WhiteBlackGoose
Copy link
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

@Happypig375
Copy link
Member Author

@Happypig375
Copy link
Member Author

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.

@WhiteBlackGoose
Copy link
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

@MomoDeve
Copy link
Member

MomoDeve commented Aug 5, 2020

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

@WhiteBlackGoose
Copy link
Member

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

@Happypig375
Copy link
Member Author

Ewwwwww GPL

@MomoDeve
Copy link
Member

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

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

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

No branches or pull requests

3 participants