(+%)/cv_e y and ecf y where ecf=: 3 : '1+2*(+%)/0 1,6+4*i.y' 
give roughly the same number of correct digits.
The fewer number of terms in the continued fraction for
ecf makes a substantial difference in execution time.   e.g.

   timer '(+%)/cv_e 200x'
1.45177
   timer 'ecf 200x'
0.258876



----- Original Message -----
From: Cliff Reiter <[email protected]>
Date: Saturday, February 27, 2010 9:27
Subject: Re: [Jprogramming] extrended precision e
To: Programming forum <[email protected]>

> Also using continued fractions:
> 
>     cv_e=:3 : '2,,1,.~1,.+:>:i.y'
> 
>     cv_e 5x     NB. coef's 
> for e are nice
> 2 1 2 1 1 4 1 1 6 1 1 8 1 1 10 1
> 
>     (+%)/cv_e 5x
> 566827r208524
>     18j16":(+%)/cv_e 5x
> 2.7182818284705837
>     18j16":^1
> 2.7182818284590451
> 
>     den2_dp=:<:@#@":@*:@{:@:(2&x:)
>     fmte=:j.@:den2_dp ": ]
> 
>     fmte (+%)/cv_e 5x   NB. show 
> correct digits (last rounded)
> 2.7182818285
> 
>     6!:2 'e=:fmte (+%)/cv_e 170x'
> 0.966068
>     #e      NB. 820 
> digits in under a second
> 822
>     e
> 2.71828182845904523536028747135266249775724709369995957496696762772407663035354759457138217852516642742746639193200305992181741359662904357290033429526059563073813232862794349076323382988075319525101901157383418793070215408914993488416750924476146066808226...
> 
> 
> Roger Hui wrote:
> >    0j140 ": 1+2*(+%)/0 1,6+4*i.20x
> > 
> 2.71828182845904523536028747135266249775724709369995957496696762780815565912122705251606184329220759673523337928244478046337596165670491497455>   
>  0j140 ": 1+2*(+%)/0 1,6+4*i.40x
> > 
> 2.71828182845904523536028747135266249775724709369995957496696762772407663035354759457138217852516642742746639193200305992181741359662904357290>
>  
> > 
> > 
> > ----- Original Message -----
> > From: "R.E. Boss" <[email protected]>
> > Date: Saturday, February 27, 2010 8:35
> > Subject: [Jprogramming] extrended precision e
> > To: 'Programming forum' <[email protected]>
> > 
> >>    100<....@%~+/(10^101x)*%!i.75x
> >> 
> 2718281828459045235360287471352662497757247093699959574966967627724076630353>>
>  547594571382178525166427
> >>
> >> gives the first 100 digits of ^1 
> >>
> >> For N digits, find k such that (10^N)<!k and determine
> >> 100<....@%~+/(10^x:1+N)*%!i.x:k
> >>
> >> The first 1e5 digits can be found at 
> >> http://www.mu.org/~doug/exp/100000.html
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to