module RemiMath
Extended Modules
Defined in:
remilib/math/arraymath.crremilib/math/math.cr
Constant Summary
-
FOUR_PI =
::Math::PI * 4.0
-
The value of pi multiplied by 4.
-
HALF_PI =
::Math::PI / 2.0
-
The value of pi divided by 2.
-
QUARTER_PI =
::Math::PI / 4.0
-
The value of pi divided by 4.
-
TWO_PI =
::Math::PI * 2.0
-
The value of pi multiplied by 2.
Instance Method Summary
-
#fastAtan(x : Float64) : Float64
A version of arc tangent that trades accuracy for speed.
-
#fastCos(val)
A version of cosine that trades accuracy for speed.
-
#fasterCos(val)
A version of cosine that trades even more accuracy for speed.
-
#fasterInvTan(val)
A version of inverse tangent that trades even more accuracy for speed.
-
#fasterSin(val)
A version of sine that trades even more accuracy for speed.
-
#fasterTan(val)
A version of tangent that trades even more accuracy for speed.
-
#fastInvCos(val)
A version of inverse cosine that trades accuracy for speed.
-
#fastInvSin(val)
A version of inverse sine that trades accuracy for speed.
-
#fastInvTan(val)
A version of inverse tangent that trades accuracy for speed.
-
#fastSin(val)
A version of sine that trades accuracy for speed.
-
#fastTan(val)
A version of tangent that trades accuracy for speed.
-
#fastTanh(x : Float64) : Float64
A version of inverse hyperbolic tangent that trades accuracy for speed.
-
#multiplyAdd(a : T, x1 : Array(T), x2 : Array(T), dest1 : Array(T), dest2 : Array(T)) forall T
Implements a multiply-accumulate operation over two arrays at the same time.
-
#multiplyAdd(a : T, x1 : Slice(T), x2 : Slice(T), dest1 : Slice(T), dest2 : Slice(T)) forall T
Implements a multiply-accumulate operation over two arrays at the same time.
-
#multiplyAdd(a : T, step : T, x : Array(T), dest : Array(T)) forall T
Implements a multiply-accumulate operation that applies a step to the accumulator
a
each iteration. -
#multiplyAdd(a : T, step : T, x : Slice(T), dest : Slice(T)) forall T
Implements a multiply-accumulate operation that applies a step to the accumulator
a
each iteration. -
#multiplyAdd(a : T, x : Array(T), dest : Array(T)) forall T
Implements a multiply-accumulate operation.
-
#multiplyAdd(a : T, x : Slice(T), dest : Slice(T)) forall T
Implements a multiply-accumulate operation.
-
#multiplyAdd!(a : T, x1 : Array(T), x2 : Array(T), dest1 : Array(T), dest2 : Array(T)) forall T
Implements a multiply-accumulate operation over two arrays at the same time.
-
#multiplyAdd!(a : T, x1 : Slice(T), x2 : Slice(T), dest1 : Slice(T), dest2 : Slice(T)) forall T
Implements a multiply-accumulate operation over two arrays at the same time.
-
#multiplyAdd!(a : T, step : T, x : Array(T), dest : Array(T)) forall T
Implements a multiply-accumulate operation that applies a step to the accumulator
a
each iteration. -
#multiplyAdd!(a : T, step : T, x : Slice(T), dest : Slice(T)) forall T
Implements a multiply-accumulate operation that applies a step to the accumulator
a
each iteration. -
#multiplyAdd!(a : T, x : Array(T), dest : Array(T)) forall T
Implements a multiply-accumulate operation.
-
#multiplyAdd!(a : T, x : Slice(T), dest : Slice(T)) forall T
Implements a multiply-accumulate operation.
Instance Method Detail
A version of arc tangent that trades accuracy for speed. The intended domain is [-1, 1]. The maximum error in this range is about 0.0015089 radians.
A version of cosine that trades accuracy for speed. The intended domain is [0, pi/2].
A version of cosine that trades even more accuracy for speed. The intended domain is [0, pi/2].
A version of inverse tangent that trades even more accuracy for speed. The intended domain is [-1, 1]
A version of sine that trades even more accuracy for speed. The intended domain is [0, pi/2].
A version of tangent that trades even more accuracy for speed. The intended domain is [0, pi/4].
A version of inverse cosine that trades accuracy for speed. The intended domain is [0, 1]
A version of inverse sine that trades accuracy for speed. The intended domain is [0, 1]
A version of inverse tangent that trades accuracy for speed. The intended domain is [-1, 1]
A version of sine that trades accuracy for speed. The intended domain is [0, pi/2].
A version of tangent that trades accuracy for speed. The intended domain is [0, pi/4].
A version of inverse hyperbolic tangent that trades accuracy for speed. The intended domain is [-3, 3]. The minimum error in this range is about 0.0, and the maximum error is about 0.024.
Note: This enforces its intended domain. If x
is less than -3, then this
always returns -1.0. Likewise, if x
is greater than 3, this always
returns 1.0.
Implements a multiply-accumulate operation over two arrays at the same time.
Implements a multiply-accumulate operation over two arrays at the same time.
Implements a multiply-accumulate operation that applies a step to the
accumulator a
each iteration.
Implements a multiply-accumulate operation that applies a step to the
accumulator a
each iteration.
Implements a multiply-accumulate operation.
Implements a multiply-accumulate operation.
Implements a multiply-accumulate operation over two arrays at the same
time. This is an unsafe version that uses Array#unsafe_fetch
and
Array#unsafe_put
internally for greater performance.
Implements a multiply-accumulate operation over two arrays at the same
time. This is an unsafe version that uses Array#unsafe_fetch
and
Array#unsafe_put
internally for greater performance.
Implements a multiply-accumulate operation that applies a step to the
accumulator a
each iteration. This is an unsafe version that uses
Array#unsafe_fetch
and Array#unsafe_put
internally for greater
performance.
Implements a multiply-accumulate operation that applies a step to the
accumulator a
each iteration. This is an unsafe version that uses
Array#unsafe_fetch
and Array#unsafe_put
internally for greater
performance.
Implements a multiply-accumulate operation. This is an unsafe version that
uses Array#unsafe_fetch
and Array#unsafe_put
internally for greater
performance.
Implements a multiply-accumulate operation. This is an unsafe version that
uses Array#unsafe_fetch
and Array#unsafe_put
internally for greater
performance.