Message Boards Message Boards

0
|
3783 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

[Edit: Solved, Not a Bug] Report a Bug in Mathematica 10.0?

Posted 9 years ago

I have found a bug in Mathematica 10.0. I'm not sure where to report it, but here is Mathematica input that will generate it:

TestFunc1 = x;
TestFunc2 = y + y^2;

(*This simplify uses the 'local' x value and returns "1" *)
x = 2;
Simplify[TestFunc1 /. x -> 1]

(*This simplify uses the 'global' y value and returns "6" *)
y = 2;
Simplify[TestFunc2 /. y -> 1]

Note that the (assumptively) local/global variables "x" and "y" are treated differently depending on the form of the function they are in. I have also found hybrid behavior where a larger function of x will use the 'global' x value for some x's and the 'local' x value for others.

Obviously using variables in this way is not good practice, but Mathematica should fail more gracefully/consistently.

POSTED BY: George Hartman
2 Replies
Posted 9 years ago

You're absolutely right; I didn't realize that Mathematica would order the operation that way. Thanks!

POSTED BY: George Hartman

The results seem fine, given what is being evaluated in both cases: 2 /. 2 -> 1 and 6 /. 2 -> 1 respectively.

POSTED BY: Ilian Gachevski
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract