At 01:32 PM 11/20/2007, Fredrik Johansson wrote:
On Nov 20, 2007 10:00 PM, Dick Moores [EMAIL PROTECTED] wrote:
And also with the amazing Chudnovsky algorithm for pi. See
http://python.pastebin.com/f4410f3dc
Nice! I'd like to suggest two improvements for speed.
First, the Chudnovsky
On Nov 25, 7:00 pm, Dick Moores [EMAIL PROTECTED] wrote:
At 01:32 PM 11/20/2007, Fredrik Johansson wrote:
On Nov 20, 2007 10:00 PM, Dick Moores [EMAIL PROTECTED] wrote:
And also with the amazing Chudnovsky algorithm for pi. See
http://python.pastebin.com/f4410f3dc
Nice! I'd like
On Nov 25, 2007 9:00 AM, Dick Moores [EMAIL PROTECTED] wrote:
Fredrik,
I'm afraid I'm just too dumb to see how to use your first suggestion
of cached_factorials. Where do I put it and def()? Could you show me,
even on-line, what to do? http://py77.python.pastebin.com/f48e4151c
You (or
At 03:26 AM 11/25/2007, Fredrik Johansson wrote:
On Nov 25, 2007 9:00 AM, Dick Moores [EMAIL PROTECTED] wrote:
Fredrik,
I'm afraid I'm just too dumb to see how to use your first suggestion
of cached_factorials. Where do I put it and def()? Could you show me,
even on-line, what to do?
On Nov 25, 2007 2:47 PM, Dick Moores [EMAIL PROTECTED] wrote:
Wow. your f() is ingenious, Frederik. Thanks very much.
Any more tricks up your sleeve? You did say a post or so ago,
Further improvements are possible.
The next improvement would be to find a recurrence formula for the
terms
At 12:45 AM 11/20/2007, Dennis Lee Bieber wrote:
On Mon, 19 Nov 2007 23:41:02 -0800, Dick Moores [EMAIL PROTECTED]
declaimed the following in comp.lang.python:
a way to get it to break where I want it to, i.e., when the sum
equals the limit as closely as the precision allows?
if sum
On Nov 20, 2007 8:41 AM, Dick Moores [EMAIL PROTECTED] wrote:
I'm writing a demo of the infinite series
x**0/0! + x**1/1! + x**2/2! + x**3/3! + ... = e**x (x is non-negative)
It works OK for many x, but for many the loop doesn't break. Is there
a way to get it to break where I want it
Instead of comparing sum to the known value of e**x, why not test
for convergence? I.e., if sum == last_sum: break. Seems like that
would be more robust (you don't need to know the answer to computer
the answer), since it seems like it should converge.
--Nathan Davis
On Nov 20, 1:41 am, Dick
At 03:53 AM 11/20/2007, Fredrik Johansson wrote:
On Nov 20, 2007 8:41 AM, Dick Moores [EMAIL PROTECTED] wrote:
I'm writing a demo of the infinite series
x**0/0! + x**1/1! + x**2/2! + x**3/3! + ... = e**x (x is non-negative)
It works OK for many x, but for many the loop doesn't break.
At 10:42 AM 11/20/2007, [EMAIL PROTECTED] wrote:
Instead of comparing sum to the known value of e**x, why not test
for convergence? I.e., if sum == last_sum: break. Seems like that
would be more robust (you don't need to know the answer to computer
the answer), since it seems like it should
On Nov 20, 2007 10:00 PM, Dick Moores [EMAIL PROTECTED] wrote:
And also with the amazing Chudnovsky algorithm for pi. See
http://python.pastebin.com/f4410f3dc
Nice! I'd like to suggest two improvements for speed.
First, the Chudnovsky algorithm uses lots of factorials, and it's
rather
On Tue, 20 Nov 2007 10:42:48 -0800, [EMAIL PROTECTED] wrote:
Instead of comparing sum to the known value of e**x, why not test for
convergence? I.e., if sum == last_sum: break. Seems like that would be
more robust (you don't need to know the answer to computer the answer),
since it seems
I'm writing a demo of the infinite series
x**0/0! + x**1/1! + x**2/2! + x**3/3! + ... = e**x (x is non-negative)
It works OK for many x, but for many the loop doesn't break. Is there
a way to get it to break where I want it to, i.e., when the sum
equals the limit as closely as the
13 matches
Mail list logo