You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Suppose we call Function('sin') to create an UndefinedFunction. It has
a suspicious name but is nevertheless still an undefined function and so
it should not evalf. Add tests. Fixes#6938.
The fix is to return early in the _eval_evalf if the func is an UndefinedFunction, instead of looking through mpmath tables for a match etc.
Thanks to @smichr for this hint.
Note I first tried to fix this by introducing UndefinedFunction._eval_evalf.
The reason that does not work is that f(x) is not itself an UndefinedFunction (only f is).
Release Notes
functions
UndefinedFunctions which coincidentally match known functions no longer evaluate numerically
Suppose we call `Function('sin')` to create an UndefinedFunction. It has
a suspcious name but is nevertheless still an undefined function and so
it should not evalf. Add tests. Fixessympy#6938.
The fix is to return early in the `_eval_evalf` if the `func` is an
`UndefinedFunction`, instead of looking through mpmath tables for a match etc.
Thanks to @smichr for this hint.
Note I first tried to fix this by introducing `UndefinedFunction._eval_evalf`.
The reason that does not work is that `f(x)` is not itself an
`UndefinedFunction` (only `f` is).
Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it.
Click here to see the pull request description that was parsed.
Suppose we call `Function('sin')` to create an UndefinedFunction. It has
a suspicious name but is nevertheless still an undefined function and so
it should not evalf. Add tests. Fixes #6938.
The fix is to return early in the `_eval_evalf` if the `func` is an
`UndefinedFunction`, instead of looking through mpmath tables for a match etc.
Thanks to @smichr for this hint.
Note I first tried to fix this by introducing `UndefinedFunction._eval_evalf`.
The reason that does not work is that `f(x)` is not itself an
`UndefinedFunction` (only `f` is).
#### Release Notes
<!-- BEGIN RELEASE NOTES -->
* functions
* UndefinedFunctions which coincidentally match known functions no longer evaluate numerically
<!-- END RELEASE NOTES -->
The lambdify machinary has `implemented_function` to add implementation
to an UndefinedFunction: not quite sure why we need this but since its
there let's not break it. If an UndefinedFunction has an `._imp_`
method, than we should let it evalf. But we still shouldn't look it up
in mpmath so add a test for an UndefinedFunction with a suspicious name
and a `._imp_`.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Suppose we call
Function('sin')
to create an UndefinedFunction. It hasa suspicious name but is nevertheless still an undefined function and so
it should not evalf. Add tests. Fixes #6938.
The fix is to return early in the
_eval_evalf
if thefunc
is anUndefinedFunction
, instead of looking through mpmath tables for a match etc.Thanks to @smichr for this hint.
Note I first tried to fix this by introducing
UndefinedFunction._eval_evalf
.The reason that does not work is that
f(x)
is not itself anUndefinedFunction
(onlyf
is).Release Notes