MilesCranmer commited on
Commit
5438f2f
1 Parent(s): 2bd241a

Add `cond` operator to built-in mappings

Browse files
Files changed (1) hide show
  1. pysr/export_sympy.py +1 -0
pysr/export_sympy.py CHANGED
@@ -50,6 +50,7 @@ sympy_mappings = {
50
  "max": lambda x, y: sympy.Piecewise((y, x < y), (x, True)),
51
  "min": lambda x, y: sympy.Piecewise((x, x < y), (y, True)),
52
  "round": lambda x: sympy.ceiling(x - 0.5),
 
53
  }
54
 
55
 
 
50
  "max": lambda x, y: sympy.Piecewise((y, x < y), (x, True)),
51
  "min": lambda x, y: sympy.Piecewise((x, x < y), (y, True)),
52
  "round": lambda x: sympy.ceiling(x - 0.5),
53
+ "cond": lambda x, y: sympy.Heaviside(x, H0=0) * y,
54
  }
55
 
56