Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Pi approximation function optimization
Date: Sat, 13 Mar 2010 21:40:26 +0000 (UTC)
Organization: Magma Geosciences Inc.
Lines: 25
Message-ID: <hnh0oa$5v8$1@fred.mathworks.com>
References: <hner7u$r8m$1@fred.mathworks.com> <hng3aa$fr9$1@fred.mathworks.com> <hng5dq$h4b$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1268516426 6120 172.30.248.35 (13 Mar 2010 21:40:26 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 13 Mar 2010 21:40:26 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 872154
Xref: news.mathworks.com comp.soft-sys.matlab:616581

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <hng5dq$h4b$1@fred.mathworks.com>...
> "Sadik " <sadik.hava@gmail.com> wrote in message <hng3aa$fr9$1@fred.mathworks.com>...
> > Hi Jared,
> > 
> > Here is my version of it. The operation is limited by the available memory, as well as the maximum number of elements allowed by matlab. Therefore, the following may not be the best solution, but it could hopefully show you another direction of doing it. [It seems that the search for the optimal combination is going to take about 10 hours!]
> > 
> 
> But then your solution will take a half day to solve.
> Since I don't believe that giving a solution to someone
> who is trying to learn actually helps them at all, all I
> will do is to suggest that there are far better ways to
> approach it.
> 
> Be creative. There is at least one solution with error
> as low as:
> 
> error =
>      -8.49968984084626e-11
> 
> This took 11 lines of code to generate, and 0.23
> seconds of cpu time.
> 
> John

Hi John. I managed to do it in 4 lines, also 0.23 seconds on a dual core CPU. Hope the OP puts a working solution up, so we can compare.