[Jprogramming] Tacit series
Raul Miller
rauldmiller at gmail.com
Sun Dec 22 17:10:58 UTC 2013
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 <rogerhui.canada at gmail.com> 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 <rauldmiller at gmail.com> wrote:
>
>> On Sun, Dec 22, 2013 at 10:50 AM, Roger Hui <rogerhui.canada at gmail.com>
>> 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.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003059921817413596629043572900334295260595630738132328627943490763233829880753195251019011573834187930702154089149934884167509244761460668082264800168477411853742345442437107539077744992069551702761838606261331384583000752044933826560297606737113200709328709127443747047230696977209310141692836819025515108657463772111252389784425056953696770785449969967946864454905987931636889230098793127736178215424999229576351482208269895193668033182528869398496465105820939239829488793320362509443117301238197068416140397019837679320683282376464804295311802328782509819455815301756717361332069811250996181881593041690351598888519345807273866738589422879228499892086805825749279610484198444363463244968487560233624827041978623209002160990235304369941849146314093431738143640546253152096183690888707016768396424378140592714563549061303107208510383750510115747704171898610687396965521267154688957
> 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
More information about the Programming
mailing list