Skip to content

Commit

Permalink
Added "min" and "max" sympy mapping (#473)
Browse files Browse the repository at this point in the history
* Added "min" and "max" sympy mapping

To overcome the sympy bug while using Min/Max operators as discussed under this issue: #183

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
tanweer-mahdi and pre-commit-ci[bot] committed Nov 24, 2023
1 parent 06a70dd commit 2e51033
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pysr/export_sympy.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
"ceil": sympy.ceiling,
"sign": sympy.sign,
"gamma": sympy.gamma,
"max": lambda x, y: sympy.Piecewise((y, x < y), (x, True)),
"min": lambda x, y: sympy.Piecewise((x, x < y), (y, True)),
}


Expand Down

0 comments on commit 2e51033

Please sign in to comment.