Group Abstract Group Abstract

Message Boards Message Boards

0
|
7.4K Views
|
9 Replies
|
6 Total Likes
View groups...
Share
Share this post:

FullSimplify issue in Mathematica 8.0.1

Posted 12 years ago

Input:

FullSimplify[5916 + 5 Sqrt[606] >= Sqrt[6 (5835701 + 9860 Sqrt[606])]]

Output:

{} <= 5916 + 5 Sqrt[606]
POSTED BY: Mario Weitzer
9 Replies

Isn't Block faster because it doesn't create a lot of new variables?

POSTED BY: Frank Kampas

Nope. The opposite. Though in most cases there is no practical difference.

POSTED BY: David Reiss

I thought Block was recommended unless you need Module.

POSTED BY: Frank Kampas

Consider

In[4]:= f[x_] := D[x a, a]

In[5]:= f[b]
Out[5]= b

In[6]:= f[a]
Out[6]= 2 a

which is just one simple example of why Block doesn't localize the "usual way" (it uses dynamic scoping).

Block does have its uses. If we were to implement something similar to Table and localize the iterator, Block would be the choice.

Choose between Module and Block depending on what they do, not performance. They are quite different.

Reading: What are the use cases for different scoping constructs?

POSTED BY: Szabolcs Horvát
Posted 12 years ago
Attachments:
POSTED BY: Mario Weitzer
POSTED BY: Szabolcs Horvát
Posted 12 years ago

That's interesting. I restarted the kernel and now I also get the correct result. I will try to reproduce the error.

POSTED BY: Mario Weitzer
Posted 12 years ago

I get the correct answer (True) in both 9.0.1.0 and 10.0.0.0 (Windows 7) with the same warning as above.

POSTED BY: Jim Baldwin

It is generally a good idea to upgrade to the latest bugfix release of whichever version you have ... with Mathematica 8.0.4 I get True with the warning that

N::meprec: "Internal precision limit $MaxExtraPrecision = 50.` reached while evaluating 5916+5\ Sqrt[606]-Sqrt[6\(5835701+9860\Sqrt[606])]."

5916 + 5 Sqrt[606] - Sqrt[6 (5835701 + 9860 Sqrt[606])] // FullSimplify gives 0.

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