FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Forum index » Science and Technology » Math » Symbolic
Semi-tough simplify test
Post new topic   Reply to topic Page 1 of 1 [5 Posts] View previous topic :: View next topic
Author Message
carlos@colorado.edu
science forum Guru Wannabe


Joined: 11 Sep 2005
Posts: 198

PostPosted: Wed Mar 29, 2006 10:21 pm    Post subject: Semi-tough simplify test Reply with quote

This "simplify challenge" from the internet is semi-tough (not
as good as VB's, but scalable) Using Mathematica notation:

xnum=((6-4*Sqrt[2])*Log[3-2*Sqrt[2]]+(3-2*Sqrt[2])*
Log[17-12*Sqrt[2]]+32-24*Sqrt[2]);
xden=(48*Sqrt[2]-72)*(Log[Sqrt[2]+1]+Sqrt[2])/3;
x=xnum/xden;

The answer is x=1. If you dont believe me, print N[x,300]//InputForm

Mathematica is unable to complete the simplification of
Expand[{x, x^2, x^4, ... }], etc. Typically the leafcount is
cut by about 1/3 before it gives up.

Quote:
From extrapolation I estimate that
FullSimplify[Expand[x^32]] (* leafcount= a miserly 60432 *)

will take 10^33 years on my Mac G5. Can't wait that long,
this Universe will endure only about 10^11 more yrs and the
license will have expired. Can maple or maxima do it quicker?
Back to top
Peter L. Montgomery
science forum Guru Wannabe


Joined: 01 May 2005
Posts: 181

PostPosted: Thu Mar 30, 2006 3:17 am    Post subject: Re: Semi-tough simplify test Reply with quote

In article <1143670905.230279.20010@g10g2000cwb.googlegroups.com>
carlos@colorado.edu writes:
Quote:
This "simplify challenge" from the internet is semi-tough (not
as good as VB's, but scalable) Using Mathematica notation:

xnum=((6-4*Sqrt[2])*Log[3-2*Sqrt[2]]+(3-2*Sqrt[2])*
Log[17-12*Sqrt[2]]+32-24*Sqrt[2]);
xden=(48*Sqrt[2]-72)*(Log[Sqrt[2]+1]+Sqrt[2])/3;
x=xnum/xden;

The answer is x=1. If you dont believe me, print N[x,300]//InputForm

Mathematica is unable to complete the simplification of
Expand[{x, x^2, x^4, ... }], etc. Typically the leafcount is
cut by about 1/3 before it gives up.

From extrapolation I estimate that
FullSimplify[Expand[x^32]] (* leafcount= a miserly 60432 *)
will take 10^33 years on my Mac G5. Can't wait that long,
this Universe will endure only about 10^11 more yrs and the
license will have expired. Can maple or maxima do it quicker?


Maple 10 does it instantly:

|\^/| Maple 10 (SUN SPARC SOLARIS)
.._|\| |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2005
\ MAPLE / All rights reserved. Maple is a trademark of
<____ ____> Waterloo Maple Inc.
| Type ? for help.
Quote:
Sqrt := sqrt;
Sqrt := sqrt


Quote:
Log := log;
Log := log


Quote:
xnum:=((6-4*Sqrt(2))*Log(3-2*Sqrt(2))+(3-2*Sqrt(2))*
Log(17-12*Sqrt(2))+32-24*Sqrt(2));
xnum :=


1/2 1/2 1/2 1/2 1/2
(6 - 4 2 ) ln(3 - 2 2 ) + (3 - 2 2 ) ln(17 - 12 2 ) + 32 - 24 2

Quote:
xden:=(48*Sqrt(2)-72)*(Log(Sqrt(2)+1)+Sqrt(2))/3;
1/2 1/2 1/2

xden := 1/3 (48 2 - 72) (ln(2 + 1) + 2 )

Quote:
x:=xnum/xden;
x := 3 (


1/2 1/2 1/2 1/2 1/2
(6 - 4 2 ) ln(3 - 2 2 ) + (3 - 2 2 ) ln(17 - 12 2 ) + 32 - 24 2 )

/ 1/2 1/2 1/2
/ ((48 2 - 72) (ln(2 + 1) + 2 ))
/

Quote:


simplify(x);
bytes used=4001356, alloc=3538296, time=0.83

1

Quote:
evalf(x);
0.9999999807


Quote:

;quit;
bytes used=4904128, alloc=3538296, time=1.02

--
VP Cheney Burr-ed his gun as a bird flew past The nation responds "burr"
as we await bird flu shots and fight a real cold war.

pmontgom@cwi.nl Microsoft Research and CWI Home: Bellevue, WA
Back to top
carlos@colorado.edu
science forum Guru Wannabe


Joined: 11 Sep 2005
Posts: 198

PostPosted: Thu Mar 30, 2006 4:36 am    Post subject: Re: Semi-tough simplify test Reply with quote

But Maple did not explicitly produce x=1 (integer 1). At least
I didnt see it in your post.

Mathematica's FullSimplify gives (after 2.3 sec) for x:

(8*Sqrt[2] + (7 + 6*Sqrt[2])*Log[17 - 12*Sqrt[2]] -
6*(3 + 2*Sqrt[2])*Log[3 - 2*Sqrt[2]])/(8*(Sqrt[2] + ArcSinh[1]))

which has about 1/4 of the original leafcount. Complexity is
similar to maple's result.

How about Macsyma and Axiom? Can they produce the
integer one?
Back to top
carlos@colorado.edu
science forum Guru Wannabe


Joined: 11 Sep 2005
Posts: 198

PostPosted: Thu Mar 30, 2006 4:46 am    Post subject: Re: Semi-tough simplify test Reply with quote

My apologies. I see the 1 in the row after bytes used =
So Maple wins this one. Canada 1, USA 0.
Back to top
astanoff@yahoo.fr
science forum beginner


Joined: 21 Oct 2005
Posts: 17

PostPosted: Tue Apr 04, 2006 9:22 am    Post subject: Re: Semi-tough simplify test Reply with quote

My mma solution with help of FindInstance :

In[1]:=
myFactor[(x_Integer) + (y_Integer)*Sqrt[z_Integer]] :=
Module[{ex, coe, fi, a, b, c, d},
ex = (Collect[#1, Sqrt[z]] & )[x + y*Sqrt[z] -
Expand[(a + b*Sqrt[z])*(c + d*Sqrt[z])]];
coe = (CoefficientList[#1, Sqrt[z]] & )[ex];
fi = FindInstance[coe[[1]] == 0 && coe[[2]] == 0,
{a, b, c, d}, Integers];
First[(a + b*Sqrt[z])*(c + d*Sqrt[z]) /. fi]];
In[2]:=
xnum=((6-4*Sqrt[2])*Log[3-2*Sqrt[2]]+(3-2*Sqrt[2])*
Log[17-12*Sqrt[2]]+32-24*Sqrt[2]);
xden=(48*Sqrt[2]-72)*(Log[Sqrt[2]+1]+Sqrt[2])/3;
x=xnum/xden ;
In[5]:=
x//.Log[a_+b_ Sqrt[z_]]:>Log[myFactor[a+b Sqrt[z]]] //
FunctionExpand//FullSimplify
Out[5]=
1

V.Astanoff
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [5 Posts] View previous topic :: View next topic
The time now is Tue Mar 28, 2017 11:27 pm | All times are GMT
Forum index » Science and Technology » Math » Symbolic
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts How does a CAS simplify complicated expressions? xyz91234@yahoo.com Symbolic 4 Tue Jul 18, 2006 12:59 am
No new posts test bill11 Math 1 Fri Jul 14, 2006 8:44 pm
No new posts test lesterzick@cableone.net Math 0 Wed Jul 12, 2006 5:48 pm
No new posts test - ignore matt271829-news@yahoo.co. Undergraduate 1 Mon Jul 10, 2006 10:32 pm
No new posts Tough Galois theory problem. Doug B Math 6 Mon Jul 10, 2006 12:10 am

Copyright © 2004-2005 DeniX Solutions SRL
Other DeniX Solutions sites: Electronics forum |  Medicine forum |  Unix/Linux blog |  Unix/Linux documentation |  Unix/Linux forums  |  send newsletters
 


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0828s ][ Queries: 16 (0.0552s) ][ GZIP on - Debug on ]