Bug introduced in 7.0 or earlier and fixed in 10.0.0
I have a rather ugly Mathematica expression (edit: shown below) that I would like to simplify with a time constraint; simplifying without a time constraint or memory constraint does not return as long as I've had the patience to wait (a couple of hours).
The problem, which I have not seen before, is that when I execute
Simplify[ expression, TimeConstraint -> 3]
I get an output that contains things like
...10000 E^(29599743/514000) Removed[$$Failure]...
The only warning message I receive during execution is
Simplify::time: Time spent on a transformation exceeded 3.` seconds, and the transformation was aborted. Increasing the value of TimeConstraint option may improve the result of simplification
Is this a known issue? I can't find anything about it. I expect when using TimeConstraint
that I will not get the simplest answer back, but I also expect to get a usable answer (which this is not).
If you think it would be helpful to see the expression I'm trying to simplify, I can post it here. The simplest example in which I've had this problem has a LeafCount
of 651
and ByteCount
of 17312
.
EDIT
On the suggestion of @JacobAkkerboom, I am adding some more information so someone can try to reproduce the effect. Here is a compressed version of expression
.
expression=Uncompress["1:eJxTTMoPSmNiYGAoZgESATmlxWnMIB4rkAjJzE0thkhyAImgxJLM/LzEnMzEyQoMnsJAEUNzYzNDQ0MDS2NzUwMIgCgH6Q7IL08tKmYEslwzf////x/Vlsz/cCF0xSA+YUc84Q5hygwEKUV1PaZKT6CxnjxAEZgbwe5kJWQBJycDQ6bFLnV1NFdmcsEtRVEP8lAmEw4H4bNo/Xnbn5kNH34xYQ0OLBoMjgFtYmSE2YTP7MJrq5hIMlvgDobZ+DV8UAYGEzYNIG5AZuY/jKgn7Oqp3w4yeEoCRYxMTAxNDMyMkGMOWzIbTQODPg1AMjzBEG9YqMGYqc+AYdRoDA+NGAabUIk/8ghFiicfKBoNLUwQEQmOXmIdeyAW6liwiqo0RpjtzvnFGVjUg+QzL7ADLcCiEl+4gzWCEgo4GPxd0thQdGQm3sZRx5EQwqMJf0glfHgKCs7MIzKtIVSSktYg5SkzSRkrs/7wt/+eQkARYwNTQ3NTcwtDI7wNN4KJD57VCHtAnuvXf3CDDZZZsFhYiQhKUrItwcYiKI9kMoS80kINMLARhHVfff3nP7i9ixxeFAUbllQFKTHA3scaPqPlwNAoB9CSE85+DvakTrDUIBifoLaTJzeQMDQ2RU2ko2lnEKcdUkPkctGr/55iQBFjy9H+0XBIANgKDyxG/QQp/UKC3WiORRl/wdpYRyqd0GJptHU7YhMmeuuWzP4R9eq5QdBHJK/dDgDIdwSQ"];
As mentioned, I get the problem simply by running
Simplify[ expression, TimeConstraint -> 3 ]
(or any other value of TimeConstraint
I've bothered to check)
expression
contains standard arithmetic operations, the constants E
and Pi
, the operations Cosh
and Sinh
, and three variables named y
, z
, and OD
(and yes, I should make OD
lower case, but it's hard for me to see optical depth as anything but capitals).
FURTHER EDIT
I have now reproduced the problem in an expression without a time constraint. The new expression1
has a LeafCount
of 186
, so it's not really that complicated.
expression1=Uncompress["1:eJxTTMoPSmNiYGAoZgESATmlxWnMIB4rkAjJzE0thkhyAImgxJLM/LzEnMzEyQoMnsJAEUNzYzNDQ0MDS2NzUwMIgCgH6Q7IL08tKmYEslwzf////x/Vlsz/cCF0xSA+QgaXI36KMDBkNmjAlMJdj6myeas0g6cQUMTY3MTU0NDc0ALhWhYC1oD1WZobGaCCzO03mRnAzq1E8wOaa1gJmc8P5JgaWpggG+7JiBwASEGDxXMHYoHBwAiUBauoSmOEWe+cX5yBRT1IPvMCO9ACLCrxhTdYIxdIGCTn70LYa4JAjq6JGSK0wZ4DxRuxnvugjOy5SoSTgzPziPQcQiUpnoOkTmaSojKz/vC3/5B0ZmBqaG5qbmFohDdXEEy48Lgl7AGZL6v/ZgYixQ4WCyvBviI5nRAsDkDJNZMh5JUWaoCBjSDs8quv//z35AGKWBhbWBqYQYKMvPCCJxc0WyH+hgYMM6YU8YFFMN0RKk/ABYenGFDEDCVbGKAkFDx+BAcXH6jQsLQ0QpRkhGPpJ9A7mV9IKFkE7gA1IEITpeDGWvQhhRuppSANiwoySzfio3woFPHklYIAG9m/tw=="]; Simplify[ expression1 ]
This returns nearly instantly with three instances of Removed[$$Failure]
. Since there is no TimeConstraint
set here, I have no idea what the problem is. I submitted a help request to Mathematica, and I'll let you know if they give any useful response. In the meantime, thoughts are most welcome. Especially if you can tell me if the problem exists (or not) in other versions of Mathematica. I am running 9.0.1 on Mac OS 10.8.3. Thank you to Mr. Wizard for verifying the problem exists in MMA 7 on Windows.
Union @ Cases[expression, _Symbol, {-1}, Heads -> True]
? $\endgroup${Cosh, E, OD, \[Pi], Plus, Power, Sinh, Times, y, z}
$\endgroup$Cosh
?) we may be able to shield it. $\endgroup$