roots ( x t -- seq ) (original) (raw)
Inputs
x | a number |
---|---|
t | an integer |
Outputs
seq | a sequence |
---|
Word description
Outputs the t roots of a number x.
Notes
The results are not necessarily real.
Definition
USING: kernel math math.constants sequences ;
: roots ( x t -- seq )
[ [ log ] [ recip ] bi* * e^ ]
[ recip 2pi * 0 swap complex boa e^ ]
[ [ ^ * ] 2with map ] tri ;