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$>
References: <hner7u$r8m$> <hng3aa$fr9$> <hng5dq$h4b$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1268516426 6120 (13 Mar 2010 21:40:26 GMT)
NNTP-Posting-Date: Sat, 13 Mar 2010 21:40:26 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 872154
Xref: comp.soft-sys.matlab:616581

"John D'Errico" <> wrote in message <hng5dq$h4b$>...
> "Sadik " <> wrote in message <hng3aa$fr9$>...
> > 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.