I can't believe what a relief this is:
iroots
[: ,. _1 ^ [: +: i. % ]
iroots ttem
3 : 0
r0=. i. y
q0=. +: r0 % y
,. (_1) ^ q0
)
irootse=: 13 :',.(_1)^+:(i.y)%y'
irootse
[: ,. _1 ^ [: +: i. % ]
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Linda Alvord
Sent: Wednesday, July 18, 2012 1:38 AM
To: [email protected]
Subject: Re: [Jprogramming] jwiki/Essays/FFT
Or maybe imaginary roots:
Iroots=: 13 :',._1^+:(i.y)%y'
iroots
[: ,. _1 ^ [: +: i. % ]
iroots 3
1
_0.5j0.866025
_0.5j_0.866025
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Bo Jacoby
Sent: Wednesday, July 18, 2012 1:09 AM
To: [email protected]
Subject: Re: [Jprogramming] jwiki/Essays/FFT
<[email protected]> wrote: "My roots-of-unity verb was designed to get
higher accuracy than simpler approaches."
The verb
PoU=:_1^+: NB. Power of Unity
is not contaminated by transcendental numbers such as (2p1) or
transcendental functions such as monadic (^). If (y) is rational then (PoU
y) is algebraic, so transcendence is not needed. The precision seems OK,
even without the use of ((**|)&.+.)
n,.PoU(n=.i.8)%8
0 1
1 0.707107j0.707107
2 0j1
3 _0.707107j0.707107
4 _1
5 _0.707107j_0.707107
6 0j_1
7 0.707107j_0.707107
----------------------------------------------------------------------
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