News for hackers. Stuff that matters.
Re:Translating math into code with examples in Java, Racket,... by ivan_ah on Tuesday May 28, 2019 @11:42AM (#20031243)
I tried something along these lines based on the computer algebra system SymPy [1,2]. The syntax is Python so feels a little weird for doing math, but the SymPy function names match very closely to the math verbs like solve, expand, simplify, factor, which is very good for learning.

For example, factoring a polynomial can be done by calling the `factor` function:

   >>> factor(x**2 - 5*x + 6, x)
   (x-3)*(x-2)
see https://live.sympy.org/?evaluate=factor(x**2%20-%205*x%20%2B...

Suddenly all the boring and fear-inducing math operations are available to you after a few simple calculations in a REPL! That's a huge win if you ask me ;)

______

[1] Printable math+SymPy tutorial https://minireference.com/static/tutorials/sympy_tutorial.pd... [2] Notebook version of [1] https://nbviewer.jupyter.org/github/minireference/SymPyTut/b...

There are no comments on this comment yet.