News for hackers. Stuff that matters.
Re:SymPy: Symbolic Mathematics in Python by exDM69 on Wednesday February 28, 2024 @10:33AM (#39539248)
I've used SymPy in a very similar way, in my case it was some nasty derivatives that were needed for some orbital mechanics calculations.

First write down the equations, then let SymPy do the laborious math part and turn the output into C code.

I'm guessing this is why you don't see a lot of SymPy projects in the wild. It was used for some intermediate calculations, and the results were turned into the product's code and the symbolic code is thrown away.

Re:SymPy: Symbolic Mathematics in Python by analog31 on Wednesday February 28, 2024 @10:55AM (#39539583)
There might be a better way, but my habit is to include the symbolic code as a comment in the C. I've thanked myself for doing this.
Re:SymPy: Symbolic Mathematics in Python by abricq on Wednesday February 28, 2024 @10:59AM (#39539643)
I commit the symbolic code on its own file, in the same commit which adds the c code.
Re:SymPy: Symbolic Mathematics in Python by lucioperca on Wednesday February 28, 2024 @11:33AM (#39540274)
I guess a hypermodern solution would be to produce the parts of the C code with CI/CD from the SymPy Code.