Handbook
Glossary
(gini) ( seq -- x )
Vocabulary
math
.
extras
.
private
Inputs
seq
an
object
Outputs
x
an
object
Definition
USING:
math
math.extras
sequences
sorting
;
IN:
math.extras.private
::
(gini)
( seq -- x )
seq
sort
:>
sorted seq
length
:>
len sorted 0
[
+
]
cum-reduce
:>
( a b ) b len a
*
/
:>
c 1 len
recip
+
2 c
*
-
;