Anutosh Bhat
Anutosh Bhat
Addressing https://github.com/lcompilers/lpython/issues/2614#issuecomment-2035025925 We have been using the `basic_free_stack` out of symengine's C wrapper untill now. But before freeing out variables we need to check if they have been stack allocated...
What doesn't work ``` from lpython import S from sympy import Symbol, log, E, Pow, exp, pi def mmrv(e: S, x: S) -> list[S]: if e.args[0] != E: e1: S...
So the case overall from sympy's gruntz.py looks like ``` elif e.is_Pow and e.base != S.Exp1: e1 = S.One while e.is_Pow: b1 = e.base e1 *= e.exp e = b1...
Consider the following example ``` (lf) anutosh491@spbhat68:~/lpython/lpython$ cat examples/expr2.py from lpython import i32 def main0(): x: i32 x = -1 if x < 0: raise Exception("Sorry, no numbers below zero")...
Having a term `c*x**n`, it would be nice to have a method to return `(c, n)` as how sympy does ``` >>> 2*x**3 2*x**3 >>> _.as_coeff_exponent(x) (2, 3) ```
This is inspired by sympy where usually every assumption maps to a query method ``` >>> x = Symbol('x',positive=True) >>> assumptions(x + I) {'commutative': True, 'complex': True, 'composite': False, 'even':...
This is a function which frees the basic variable only if it has been allocated. The use case comes from [here](https://github.com/lcompilers/lpython/issues/2614#issuecomment-2009981787)