Hi
I have been wondering if there one can speed up calculating small powers
of numbers such as x^8 using multiplication.
In addition, one can be a bit clever and calculate x^8 using only 3
multiplies.
look at this:
f1 - function(x){x*x*x*x*x*x*x*x}
f2 - function(x){x^8}
f3 -
Something like this is exploited very nicely in the mtx.exp
for matrix powers in the Malmig package, actually.
Hi
I have been wondering if there one can speed up calculating small powers
of numbers such as x^8 using multiplication.
In addition, one can be a bit
-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robin Hankin
Sent: Wednesday, June 29, 2005 7:32 AM
To: r-help
Subject: [R] x*x*x*... vs x^n
Hi
I have been wondering if there one can speed up calculating small powers of
numbers such as x^8 using multiplication.
In addition, one can
On 6/29/2005 7:32 AM, Robin Hankin wrote:
Hi
I have been wondering if there one can speed up calculating small powers
of numbers such as x^8 using multiplication.
In addition, one can be a bit clever and calculate x^8 using only 3
multiplies.
look at this:
f1 -
Hi Duncan
On Jun 29, 2005, at 02:04 pm, Duncan Murdoch wrote:
On 6/29/2005 7:32 AM, Robin Hankin wrote:
Hi
I have been wondering if there one can speed up calculating small
powers
of numbers such as x^8 using multiplication.
In addition, one can be a bit clever and calculate x^8 using
On Wed, 29 Jun 2005, Duncan Murdoch wrote:
On 6/29/2005 7:32 AM, Robin Hankin wrote:
I have been wondering if there one can speed up calculating small powers
of numbers such as x^8 using multiplication.
In addition, one can be a bit clever and calculate x^8 using only 3
multiplies.
look
On 6/29/2005 9:31 AM, Robin Hankin wrote:
Hi Duncan
On Jun 29, 2005, at 02:04 pm, Duncan Murdoch wrote:
On 6/29/2005 7:32 AM, Robin Hankin wrote:
Hi
I have been wondering if there one can speed up calculating small
powers
of numbers such as x^8 using multiplication.
In addition,
On Jun 29, 2005, at 02:47 pm, Duncan Murdoch wrote:
On 6/29/2005 9:31 AM, Robin Hankin wrote:
Hi Duncan
library(gsl)
system.time(ignore - pow_int(a,8))
[1] 1.07 1.11 3.08 0.00 0.00
why the slow execution time?
Shouldn't you ask the gsl maintainer that? :-)
well I did ask myself,
PROTECTED] [mailto:r-help-
[EMAIL PROTECTED] On Behalf Of Tuszynski, Jaroslaw W.
Sent: Wednesday, June 29, 2005 8:25 AM
To: 'Robin Hankin'; r-help
Subject: Re: [R] x*x*x*... vs x^n
I tried your code and got different results:
system.time(ignore - f1(a))
[1] 0.83 0.09 1.08 NA NA
: [EMAIL PROTECTED] [mailto:r-help-
[EMAIL PROTECTED] On Behalf Of Robin Hankin
Sent: Wednesday, June 29, 2005 9:13 AM
To: Duncan Murdoch
Cc: r-help; Robin Hankin
Subject: Re: [R] x*x*x*... vs x^n
On Jun 29, 2005, at 02:47 pm, Duncan Murdoch wrote:
On 6/29/2005 9:31 AM, Robin Hankin wrote
-Original Message-
From: [EMAIL PROTECTED] [mailto:r-help-
[EMAIL PROTECTED] On Behalf Of Robin Hankin
Sent: Wednesday, June 29, 2005 9:13 AM
To: Duncan Murdoch
Cc: r-help; Robin Hankin
Subject: Re: [R] x*x*x*... vs x^n
On Jun 29, 2005, at 02:47 pm, Duncan Murdoch wrote
] [mailto:r-help-
[EMAIL PROTECTED] On Behalf Of David Reiner
[EMAIL PROTECTED]
Sent: Wednesday, June 29, 2005 10:24 AM
To: r-help
Subject: Re: [R] x*x*x*... vs x^n
Looking at the code for gsl_pow_int, I see they do use that method.
David L. Reiner
-Original Message-
From
12 matches
Mail list logo