Skip to content

Adding asin / "configuration is invalid" error #345

Answered by MilesCranmer
benlabbeus asked this question in Q&A
Discussion options

You must be logged in to vote

You are almost there. Since asin is not valid for abs(x)>1, you need to create a new operator that either (1) clips the input to be valid, or (2) returns a NaN for invalid input.

I generally prefer (2) as the output equations won't have weird steps in them. You could do this:

"my_asin(x) = abs(x) > 1 ? convert(typeof(x), NaN) : asin(x)"

and then just give it the normal sympy definition by for "my_asin" instead.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@benlabbeus
Comment options

Answer selected by benlabbeus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
PySR PySR-related discussion SymbolicRegression.jl SymbolicRegression.jl-related discussion
2 participants