I think I understand what you are saying.
http://www.jsoftware.com/jwiki/Essays/Extended%20Precision%20Functions

Nevertheless, I'm a bit concerned about the way you have stated your
point. Consider, for example:

   (%!i.432x)&p. x:1e6

Like you mention in the second half of your paragraph, the issue is
not "computing" so much as it is "convergence".

Of course, I could also do something like this:

   ((%!i.512x)&p.1) ^ x:1e6

Here, convergence is decent but of course speed might not be so hot.
I'm also not sure if ^ for extended precision integer exponents takes
advantage repeated squaring (where #:1e6 would select the relevant
"[repeated] squares").

Then again, I tried the exp defined on the extended precision
functions page: The first issue I ran into was that it did not work -
it gave me a domain error. One issue is that one must redefine all the
verbs when one changes the DP value. Another issue is that exp 1 with
DP defined as 1160 gave me a domain error. Another issue is that exp 1
with exp defined for DP=:200 took something over 8 minutes to
complete.

So ... I really am not patient enough to do a timing comparison
between "my approach" and that approach for result with over a
thousand digits of accuracy.

Thanks,

-- 
Raul

On Sun, Dec 22, 2013 at 11:35 AM, Roger Hui <[email protected]> wrote:
> This is what the Extended Precision Functions page does with more finesse.
>  For example, computing ^1e6 with your approach would take many terms.
>  Instead, one can scale the argument so that you only need to do the series
> on a very restricted domain (for exp, bounded by 2%~^.2, approximately
> 0.35), on which convergence is very fast.
>
>
> On Sun, Dec 22, 2013 at 8:13 AM, Raul Miller <[email protected]> wrote:
>
>> On Sun, Dec 22, 2013 at 10:50 AM, Roger Hui <[email protected]>
>> wrote:
>> > I expect exp can be improved.  The details are left as an exercise for
>> the
>> > reader. :-)
>>
>> And, perhaps, the concept of what "improved" means can be an exercise
>> for the reader? Here, I'll optimize for useless accuracy (or at least
>> accuracy which I have no immediate use for) at the expense of speed
>> and space:
>>
>>   1163j1160":(%!i.512x)&p. 1
>>
>>  
>> 2.71828182845904523536028747135266249775724709369995957496696762772407663035354759457138217852516642742746639193200305992181741359662904357290033429526059563073813232862794349076323382988075319525101901157383418793070215408914993488416750924476146066808226480016847741185374234544243710753907774499206955170276183860626133138458300075204493382656029760673711320070932870912744374704723069697720931014169283681902551510865746377211125238978442505695369677078544996996794686445490598793163688923009879312773617821542499922957635148220826989519366803318252886939849646510582093923982948879332036250944311730123819706841614039701983767932068328237646480429531180232878250981945581530175671736133206981125099618188159304169035159888851934580727386673858942287922849989208680582574927961048419844436346324496848756023362482704197862320900216099023530436994184914631409343173814364054625315209618369088870701676839642437814059271456354906130310720851038375051011574770417189861068739696552126715468895
 7
>  03
>>  50354021234078498193343210...
>>
>> I've left three extra characters to the left of the fractional part:
>> one for the decimal point, one for the 2 and one for the absence of a
>> negative sign.
>>
>> Thanks,
>>
>> --
>> Raul
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to