Handbook
Glossary
grad ( hash v -- gradient )
Vocabulary
noise
Inputs
hash
an
object
v
an
object
Outputs
gradient
an
object
Definition
USING:
kernel
math
sequences
;
IN:
noise
::
grad
( hash v -- gradient )
hash 8
bitand
zero?
[
v
first
]
[
v
second
]
if
:>
u hash 12
bitand
zero?
[
v
second
]
[
hash 13
bitand
12
=
[
v
first
]
[
v
third
]
if
]
if
:>
v hash 1
bitand
zero?
[
u
]
[
u
neg
]
if
hash 2
bitand
zero?
[
v
]
[
v
neg
]
if
+
;
inline