pymbolic
pymbolic copied to clipboard
A simple package to do symbolic math (focus on code gen and DSLs)
Added an `EqualityMapper` similar to the one in inducer/pytato#166. This seems a bit slower than the current version (benchmarked against inducer/pytential#121): it went from 5.3s-ish to 6.6s-ish. - [x] Rebase...
Continuation of #62 Addresses https://github.com/inducer/pytato/issues/162 in part. Needed by: - https://github.com/inducer/pytato/pull/334
- This will need `super().__init__()` changes in (at least) loopy
It was suggested in https://github.com/inducer/pytato/pull/217 that we should preserve the structure of the expressions. This PR implements the points discussed over there. Draft because: - [ ] Fails CI
Right now, the `Sum` and `Product` primitives do a little bit of calculation on their own. For example, `Sum(, 0) === `. Unfortunately, this process is already carried out in...
This was a dead-end while debugging #77. No need for it currently, but who knows? Maybe we'll need it sometime.
The analogous issue to https://github.com/inducer/pytato/issues/163 also exists in pymbolic. cc @alexfikl
```python >>> import pymbolic.primitives as p >>> a = p.Variable("a") >>> b = p.Variable("b") >>> c = p.Variable("c") >>> print(a * (b * c)) a*b*c # Should have been 'a*(b*c)'...
FP arithmetic isn't associative, after all.
cc: @inducer