org.hipparchus.analysis.differentiation

• ### Constructor Summary

Constructors
Constructor and Description
FieldGradient(FieldDerivativeStructure<T> ds)
Build an instance from a DerivativeStructure.
FieldGradient(T value, T... gradient)
Build an instance with values and derivative.
• ### Method Summary

All Methods
Modifier and Type Method and Description
FieldGradient<T> abs()
absolute value.
FieldGradient<T> acos()
Arc cosine operation.
FieldGradient<T> acosh()
Inverse hyperbolic cosine operation.
FieldGradient<T> add(double a)
'+' operator.
FieldGradient<T> add(FieldGradient<T> a)
Compute this + a.
FieldGradient<T> add(T a)
'+' operator.
FieldGradient<T> asin()
Arc sine operation.
FieldGradient<T> asinh()
Inverse hyperbolic sine operation.
FieldGradient<T> atan()
Arc tangent operation.
FieldGradient<T> atan2(FieldGradient<T> x)
Two arguments arc tangent operation.
FieldGradient<T> atanh()
Inverse hyperbolic tangent operation.
FieldGradient<T> cbrt()
Cubic root.
FieldGradient<T> ceil()
Get the smallest whole number larger than instance.
FieldGradient<T> compose(T g0, T g1)
Compute composition of the instance by a function.
static <T extends CalculusFieldElement<T>>FieldGradient<T> constant(int freeParameters, T value)
Build an instance corresponding to a constant value.
FieldGradient<T> copySign(double sign)
Returns the instance with the sign of the argument.
FieldGradient<T> copySign(FieldGradient<T> sign)
Returns the instance with the sign of the argument.
FieldGradient<T> copySign(T sign)
Returns the instance with the sign of the argument.
FieldGradient<T> cos()
Cosine operation.
FieldGradient<T> cosh()
Hyperbolic cosine operation.
FieldGradient<T> divide(double a)
'÷' operator.
FieldGradient<T> divide(FieldGradient<T> a)
Compute this ÷ a.
FieldGradient<T> divide(T a)
'÷' operator.
boolean equals(Object other)
Test for the equality of two univariate derivatives.
FieldGradient<T> exp()
Exponential.
FieldGradient<T> expm1()
Exponential minus 1.
FieldGradient<T> floor()
Get the largest whole number smaller than instance.
int getExponent()
Return the exponent of the instance, removing the bias.
FieldGradientField<T> getField()
Get the Field to which the instance belongs.
int getFreeParameters()
Get the number of free parameters.
T[] getGradient()
Get the gradient part of the function.
int getOrder()
Get the derivation order.
T getPartialDerivative(int... orders)
Get a partial derivative.
T getPartialDerivative(int n)
Get the partial derivative with respect to one parameter.
FieldGradient<T> getPi()
Get the Archimedes constant π.
double getReal()
Get the real value of the number.
T getValue()
Get the value part of the function.
Field<T> getValueField()
Get the Field the value and parameters of the function belongs to.
int hashCode()
Get a hashCode for the univariate derivative.
FieldGradient<T> hypot(FieldGradient<T> y)
Returns the hypotenuse of a triangle with sides this and y - sqrt(this2 +y2) avoiding intermediate overflow or underflow.
FieldGradient<T> linearCombination(double[] a, FieldGradient<T>[] b)
Compute a linear combination.
FieldGradient<T> linearCombination(double a1, FieldGradient<T> b1, double a2, FieldGradient<T> b2)
Compute a linear combination.
FieldGradient<T> linearCombination(double a1, FieldGradient<T> b1, double a2, FieldGradient<T> b2, double a3, FieldGradient<T> b3)
Compute a linear combination.
FieldGradient<T> linearCombination(double a1, FieldGradient<T> b1, double a2, FieldGradient<T> b2, double a3, FieldGradient<T> b3, double a4, FieldGradient<T> b4)
Compute a linear combination.
FieldGradient<T> linearCombination(FieldGradient<T>[] a, FieldGradient<T>[] b)
Compute a linear combination.
FieldGradient<T> linearCombination(FieldGradient<T> a1, FieldGradient<T> b1, FieldGradient<T> a2, FieldGradient<T> b2)
Compute a linear combination.
FieldGradient<T> linearCombination(FieldGradient<T> a1, FieldGradient<T> b1, FieldGradient<T> a2, FieldGradient<T> b2, FieldGradient<T> a3, FieldGradient<T> b3)
Compute a linear combination.
FieldGradient<T> linearCombination(FieldGradient<T> a1, FieldGradient<T> b1, FieldGradient<T> a2, FieldGradient<T> b2, FieldGradient<T> a3, FieldGradient<T> b3, FieldGradient<T> a4, FieldGradient<T> b4)
Compute a linear combination.
FieldGradient<T> linearCombination(T[] a, FieldGradient<T>[] b)
Compute a linear combination.
FieldGradient<T> linearCombination(T a1, FieldGradient<T> b1, T a2, FieldGradient<T> b2, T a3, FieldGradient<T> b3)
Compute a linear combination.
FieldGradient<T> log()
Natural logarithm.
FieldGradient<T> log10()
Base 10 logarithm.
FieldGradient<T> log1p()
Shifted natural logarithm.
FieldGradient<T> multiply(double a)
'×' operator.
FieldGradient<T> multiply(FieldGradient<T> a)
Compute this × a.
FieldGradient<T> multiply(int n)
Compute n × this.
FieldGradient<T> multiply(T n)
'×' operator.
FieldGradient<T> negate()
Returns the additive inverse of this element.
FieldGradient<T> newInstance(double c)
Create an instance corresponding to a constant real value.
FieldGradient<T> newInstance(T c)
Create an instance corresponding to a constant real value.
FieldGradient<T> pow(double p)
Power operation.
static <T extends CalculusFieldElement<T>>FieldGradient<T> pow(double a, FieldGradient<T> x)
Compute ax where a is a double and x a FieldGradient
FieldGradient<T> pow(FieldGradient<T> e)
Power operation.
FieldGradient<T> pow(int n)
Integer power operation.
FieldGradient<T> reciprocal()
Returns the multiplicative inverse of this element.
FieldGradient<T> remainder(double a)
IEEE remainder operator.
FieldGradient<T> remainder(FieldGradient<T> a)
IEEE remainder operator.
FieldGradient<T> remainder(T a)
IEEE remainder operator.
FieldGradient<T> rint()
Get the whole number that is the nearest to the instance, or the even one if x is exactly half way between two integers.
FieldGradient<T> rootN(int n)
Nth root.
FieldGradient<T> scalb(int n)
Multiply the instance by a power of 2.
FieldGradient<T> sign()
Compute the sign of the instance.
FieldGradient<T> sin()
Sine operation.
FieldSinCos<FieldGradient<T>> sinCos()
Combined Sine and Cosine operation.
FieldGradient<T> sinh()
Hyperbolic sine operation.
FieldSinhCosh<FieldGradient<T>> sinhCosh()
Combined hyperbolic sine and sosine operation.
FieldGradient<T> sqrt()
Square root.
FieldGradient<T> subtract(double a)
'-' operator.
FieldGradient<T> subtract(FieldGradient<T> a)
Compute this - a.
FieldGradient<T> subtract(T a)
'-' operator.
FieldGradient<T> tan()
Tangent operation.
FieldGradient<T> tanh()
Hyperbolic tangent operation.
T taylor(double... delta)
Evaluate Taylor expansion of a gradient.
T taylor(T... delta)
Evaluate Taylor expansion of a gradient.
FieldGradient<T> toDegrees()
Convert radians to degrees, with error of less than 0.5 ULP
FieldDerivativeStructure<T> toDerivativeStructure()
Convert the instance to a FieldDerivativeStructure.
FieldGradient<T> toRadians()
Convert degrees to radians, with error of less than 0.5 ULP
FieldGradient<T> ulp()
Compute least significant bit (Unit in Last Position) for a number.
static <T extends CalculusFieldElement<T>>FieldGradient<T> variable(int freeParameters, int index, T value)
Build a Gradient representing a variable.
• ### Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
• ### Methods inherited from interface org.hipparchus.CalculusFieldElement

isFinite, isInfinite, isNaN, norm, round
• ### Methods inherited from interface org.hipparchus.FieldElement

isZero
• ### Constructor Detail

@SafeVarargs
T... gradient)
Build an instance with values and derivative.
Parameters:
value - value of the function
gradient - gradient of the function

public FieldGradient(FieldDerivativeStructure<T> ds)
throws MathIllegalArgumentException
Build an instance from a DerivativeStructure.
Parameters:
ds - derivative structure
Throws:
MathIllegalArgumentException - if ds order is not 1
• ### Method Detail

• #### constant

public static <T extends CalculusFieldElement<T>> FieldGradient<T> constant(int freeParameters,
T value)
Build an instance corresponding to a constant value.
Type Parameters:
T - the type of the function parameters and value
Parameters:
freeParameters - number of free parameters (i.e. dimension of the gradient)
value - constant value of the function
Returns:
a FieldGradient with a constant value and all derivatives set to 0.0
• #### variable

public static <T extends CalculusFieldElement<T>> FieldGradient<T> variable(int freeParameters,
int index,
T value)
Build a Gradient representing a variable.

Instances built using this method are considered to be the free variables with respect to which differentials are computed. As such, their differential with respect to themselves is +1.

Type Parameters:
T - the type of the function parameters and value
Parameters:
freeParameters - number of free parameters (i.e. dimension of the gradient)
index - index of the variable (from 0 to getFreeParameters() - 1)
value - value of the variable
Returns:
a FieldGradient with a constant value and all derivatives set to 0.0 except the one at index which will be set to 1.0
• #### getValueField

public Field<T> getValueField()
Get the Field the value and parameters of the function belongs to.
Returns:
Field the value and parameters of the function belongs to
• #### newInstance

public FieldGradient<T> newInstance(double c)
Create an instance corresponding to a constant real value.
Specified by:
newInstance in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
c - constant real value
Returns:
instance corresponding to a constant real value
• #### newInstance

public FieldGradient<T> newInstance(T c)
Create an instance corresponding to a constant real value.

The default implementation creates the instance by adding the value to getField().getZero(). This is not optimal and does not work when called with a negative zero as the sign of zero is lost with the addition. The default implementation should therefore be overridden in concrete classes. The default implementation will be removed at the next major version.

Parameters:
c - constant real value
Returns:
instance corresponding to a constant real value
• #### getReal

public double getReal()
Get the real value of the number.
Specified by:
getReal in interface FieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
real value
• #### getValue

public T getValue()
Get the value part of the function.
Specified by:
getValue in interface FieldDerivative<T extends CalculusFieldElement<T>,FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
value part of the value of the function

public T[] getGradient()
Get the gradient part of the function.
Returns:
gradient part of the value of the function
• #### getFreeParameters

public int getFreeParameters()
Get the number of free parameters.
Specified by:
getFreeParameters in interface FieldDerivative<T extends CalculusFieldElement<T>,FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
number of free parameters
• #### getOrder

public int getOrder()
Get the derivation order.
Specified by:
getOrder in interface FieldDerivative<T extends CalculusFieldElement<T>,FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
derivation order
• #### getPartialDerivative

public T getPartialDerivative(int... orders)
throws MathIllegalArgumentException
Get a partial derivative.
Specified by:
getPartialDerivative in interface FieldDerivative<T extends CalculusFieldElement<T>,FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
orders - derivation orders with respect to each variable (if all orders are 0, the value is returned)
Returns:
partial derivative
Throws:
MathIllegalArgumentException - if the numbers of variables does not match the instance
FieldDerivative.getValue()
• #### getPartialDerivative

public T getPartialDerivative(int n)
throws MathIllegalArgumentException
Get the partial derivative with respect to one parameter.
Parameters:
n - index of the parameter (counting from 0)
Returns:
partial derivative with respect to the nth parameter
Throws:
MathIllegalArgumentException - if n is either negative or larger or equal to getFreeParameters()
• #### toDerivativeStructure

public FieldDerivativeStructure<T> toDerivativeStructure()
Convert the instance to a FieldDerivativeStructure.
Returns:
derivative structure with same value and derivative as the instance

public FieldGradient<T> add(T a)
'+' operator.
Parameters:
a - right hand side parameter of the operator
Returns:
this+a

public FieldGradient<T> add(double a)
'+' operator.
Specified by:
add in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
a - right hand side parameter of the operator
Returns:
this+a

public FieldGradient<T> add(FieldGradient<T> a)
Compute this + a.
Specified by:
add in interface FieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
a - element to add
Returns:
a new element representing this + a
• #### subtract

public FieldGradient<T> subtract(T a)
'-' operator.
Parameters:
a - right hand side parameter of the operator
Returns:
this-a
• #### subtract

public FieldGradient<T> subtract(double a)
'-' operator.
Specified by:
subtract in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
a - right hand side parameter of the operator
Returns:
this-a
• #### subtract

public FieldGradient<T> subtract(FieldGradient<T> a)
Compute this - a.
Specified by:
subtract in interface FieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
a - element to subtract
Returns:
a new element representing this - a
• #### multiply

public FieldGradient<T> multiply(T n)
'×' operator.
Parameters:
n - right hand side parameter of the operator
Returns:
this×n
• #### multiply

public FieldGradient<T> multiply(int n)
Compute n × this. Multiplication by an integer number is defined as the following sum
n × this = ∑i=1n this.
Specified by:
multiply in interface FieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
n - Number of times this must be added to itself.
Returns:
A new element representing n × this.
• #### multiply

public FieldGradient<T> multiply(double a)
'×' operator.
Specified by:
multiply in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
a - right hand side parameter of the operator
Returns:
this×a
• #### multiply

public FieldGradient<T> multiply(FieldGradient<T> a)
Compute this × a.
Specified by:
multiply in interface FieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
a - element to multiply
Returns:
a new element representing this × a
• #### divide

public FieldGradient<T> divide(T a)
'÷' operator.
Parameters:
a - right hand side parameter of the operator
Returns:
this÷a
• #### divide

public FieldGradient<T> divide(double a)
'÷' operator.
Specified by:
divide in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
a - right hand side parameter of the operator
Returns:
this÷a
• #### divide

public FieldGradient<T> divide(FieldGradient<T> a)
Compute this ÷ a.
Specified by:
divide in interface FieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
a - element to divide by
Returns:
a new element representing this ÷ a
• #### remainder

public FieldGradient<T> remainder(T a)
IEEE remainder operator.
Parameters:
a - right hand side parameter of the operator
Returns:
this - n × a where n is the closest integer to this/a (the even integer is chosen for n if this/a is halfway between two integers)
• #### remainder

public FieldGradient<T> remainder(double a)
IEEE remainder operator.
Specified by:
remainder in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
a - right hand side parameter of the operator
Returns:
this - n × a where n is the closest integer to this/a
• #### remainder

public FieldGradient<T> remainder(FieldGradient<T> a)
IEEE remainder operator.
Specified by:
remainder in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
a - right hand side parameter of the operator
Returns:
this - n × a where n is the closest integer to this/a
• #### negate

public FieldGradient<T> negate()
Returns the additive inverse of this element.
Specified by:
negate in interface FieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
the opposite of this.
• #### abs

public FieldGradient<T> abs()
absolute value.

Just another name for CalculusFieldElement.norm()

Specified by:
abs in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
abs(this)
• #### ceil

public FieldGradient<T> ceil()
Get the smallest whole number larger than instance.
Specified by:
ceil in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
ceil(this)
• #### floor

public FieldGradient<T> floor()
Get the largest whole number smaller than instance.
Specified by:
floor in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
floor(this)
• #### rint

public FieldGradient<T> rint()
Get the whole number that is the nearest to the instance, or the even one if x is exactly half way between two integers.
Specified by:
rint in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
a double number r such that r is an integer r - 0.5 ≤ this ≤ r + 0.5
• #### sign

public FieldGradient<T> sign()
Compute the sign of the instance. The sign is -1 for negative numbers, +1 for positive numbers and 0 otherwise, for Complex number, it is extended on the unit circle (equivalent to z/|z|, with special handling for 0 and NaN)
Specified by:
sign in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
-1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a
• #### copySign

public FieldGradient<T> copySign(T sign)
Returns the instance with the sign of the argument. A NaN sign argument is treated as positive.
Parameters:
sign - the sign for the returned value
Returns:
the instance with the same sign as the sign argument
• #### copySign

public FieldGradient<T> copySign(FieldGradient<T> sign)
Returns the instance with the sign of the argument. A NaN sign argument is treated as positive.
Specified by:
copySign in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
sign - the sign for the returned value
Returns:
the instance with the same sign as the sign argument
• #### copySign

public FieldGradient<T> copySign(double sign)
Returns the instance with the sign of the argument. A NaN sign argument is treated as positive.
Specified by:
copySign in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
sign - the sign for the returned value
Returns:
the instance with the same sign as the sign argument
• #### getExponent

public int getExponent()
Return the exponent of the instance, removing the bias.

For double numbers of the form 2x, the unbiased exponent is exactly x.

Specified by:
getExponent in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
exponent for the instance, without bias
• #### scalb

public FieldGradient<T> scalb(int n)
Multiply the instance by a power of 2.
Specified by:
scalb in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
n - power of 2
Returns:
this × 2n
• #### ulp

public FieldGradient<T> ulp()
Compute least significant bit (Unit in Last Position) for a number.

The ulp function is a step function, hence all its derivatives are 0.

Specified by:
ulp in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
ulp(this)
Since:
2.0
• #### hypot

public FieldGradient<T> hypot(FieldGradient<T> y)
Returns the hypotenuse of a triangle with sides this and y - sqrt(this2 +y2) avoiding intermediate overflow or underflow.
• If either argument is infinite, then the result is positive infinity.
• else, if either argument is NaN then the result is NaN.
Specified by:
hypot in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
y - a value
Returns:
sqrt(this2 +y2)
• #### reciprocal

public FieldGradient<T> reciprocal()
Returns the multiplicative inverse of this element.
Specified by:
reciprocal in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Specified by:
reciprocal in interface FieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
the inverse of this.
• #### compose

public FieldGradient<T> compose(T g0,
T g1)
Compute composition of the instance by a function.
Parameters:
g0 - value of the function at the current point (i.e. at g(getValue()))
g1 - first derivative of the function at the current point (i.e. at g'(getValue()))
Returns:
g(this)
• #### sqrt

public FieldGradient<T> sqrt()
Square root.
Specified by:
sqrt in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
square root of the instance
• #### cbrt

public FieldGradient<T> cbrt()
Cubic root.
Specified by:
cbrt in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
cubic root of the instance
• #### rootN

public FieldGradient<T> rootN(int n)
Nth root.
Specified by:
rootN in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
n - order of the root
Returns:
nth root of the instance
• #### getField

public FieldGradientField<T> getField()
Get the Field to which the instance belongs.
Specified by:
getField in interface FieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
Field to which the instance belongs
• #### pow

public static <T extends CalculusFieldElement<T>> FieldGradient<T> pow(double a,
FieldGradient<T> x)
Compute ax where a is a double and x a FieldGradient
Type Parameters:
T - the type of the function parameters and value
Parameters:
a - number to exponentiate
x - power to apply
Returns:
ax
• #### pow

public FieldGradient<T> pow(double p)
Power operation.
Specified by:
pow in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
p - power to apply
Returns:
thisp
• #### pow

public FieldGradient<T> pow(int n)
Integer power operation.
Specified by:
pow in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
n - power to apply
Returns:
thisn
• #### pow

public FieldGradient<T> pow(FieldGradient<T> e)
Power operation.
Specified by:
pow in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
e - exponent
Returns:
thise
• #### exp

public FieldGradient<T> exp()
Exponential.
Specified by:
exp in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
exponential of the instance
• #### expm1

public FieldGradient<T> expm1()
Exponential minus 1.
Specified by:
expm1 in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
exponential minus one of the instance
• #### log

public FieldGradient<T> log()
Natural logarithm.
Specified by:
log in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
logarithm of the instance
• #### log1p

public FieldGradient<T> log1p()
Shifted natural logarithm.
Specified by:
log1p in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
logarithm of one plus the instance
• #### log10

public FieldGradient<T> log10()
Base 10 logarithm.
Specified by:
log10 in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
base 10 logarithm of the instance
• #### cos

public FieldGradient<T> cos()
Cosine operation.
Specified by:
cos in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
cos(this)
• #### sin

public FieldGradient<T> sin()
Sine operation.
Specified by:
sin in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
sin(this)
• #### sinCos

public FieldSinCos<FieldGradient<T>> sinCos()
Combined Sine and Cosine operation.
Specified by:
sinCos in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
[sin(this), cos(this)]
• #### tan

public FieldGradient<T> tan()
Tangent operation.
Specified by:
tan in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
tan(this)
• #### acos

public FieldGradient<T> acos()
Arc cosine operation.
Specified by:
acos in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
acos(this)
• #### asin

public FieldGradient<T> asin()
Arc sine operation.
Specified by:
asin in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
asin(this)
• #### atan

public FieldGradient<T> atan()
Arc tangent operation.
Specified by:
atan in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
atan(this)
• #### atan2

public FieldGradient<T> atan2(FieldGradient<T> x)
Two arguments arc tangent operation.

Beware of the order or arguments! As this is based on a two-arguments functions, in order to be consistent with arguments order, the instance is the first argument and the single provided argument is the second argument. In order to be consistent with programming languages atan2, this method computes atan2(this, x), i.e. the instance represents the y argument and the x argument is the one passed as a single argument. This may seem confusing especially for users of Wolfram alpha, as this site is not consistent with programming languages atan2 two-arguments arc tangent and puts x as its first argument.

Specified by:
atan2 in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
x - second argument of the arc tangent
Returns:
atan2(this, x)
• #### cosh

public FieldGradient<T> cosh()
Hyperbolic cosine operation.
Specified by:
cosh in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
cosh(this)
• #### sinh

public FieldGradient<T> sinh()
Hyperbolic sine operation.
Specified by:
sinh in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
sinh(this)
• #### sinhCosh

public FieldSinhCosh<FieldGradient<T>> sinhCosh()
Combined hyperbolic sine and sosine operation.
Specified by:
sinhCosh in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
[sinh(this), cosh(this)]
• #### tanh

public FieldGradient<T> tanh()
Hyperbolic tangent operation.
Specified by:
tanh in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
tanh(this)
• #### acosh

public FieldGradient<T> acosh()
Inverse hyperbolic cosine operation.
Specified by:
acosh in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
acosh(this)
• #### asinh

public FieldGradient<T> asinh()
Inverse hyperbolic sine operation.
Specified by:
asinh in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
asin(this)
• #### atanh

public FieldGradient<T> atanh()
Inverse hyperbolic tangent operation.
Specified by:
atanh in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
atanh(this)
• #### toDegrees

public FieldGradient<T> toDegrees()
Convert radians to degrees, with error of less than 0.5 ULP
Specified by:
toDegrees in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
instance converted into degrees

public FieldGradient<T> toRadians()
Convert degrees to radians, with error of less than 0.5 ULP
Specified by:
toRadians in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
• #### taylor

public T taylor(double... delta)
Evaluate Taylor expansion of a gradient.
Parameters:
delta - parameters offsets (Δx, Δy, ...)
Returns:
value of the Taylor expansion at x + Δx, y + Δy, ...
• #### taylor

public T taylor(T... delta)
Evaluate Taylor expansion of a gradient.
Parameters:
delta - parameters offsets (Δx, Δy, ...)
Returns:
value of the Taylor expansion at x + Δx, y + Δy, ...
• #### linearCombination

public FieldGradient<T> linearCombination(FieldGradient<T>[] a,
FieldGradient<T>[] b)
Compute a linear combination.
Specified by:
linearCombination in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
a - Factors.
b - Factors.
Returns:
Σi ai bi.
• #### linearCombination

public FieldGradient<T> linearCombination(T[] a,
FieldGradient<T>[] b)
Compute a linear combination.
Parameters:
a - Factors.
b - Factors.
Returns:
Σi ai bi.
Throws:
MathIllegalArgumentException - if arrays dimensions don't match
• #### linearCombination

public FieldGradient<T> linearCombination(double[] a,
FieldGradient<T>[] b)
Compute a linear combination.
Specified by:
linearCombination in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
a - Factors.
b - Factors.
Returns:
Σi ai bi.
• #### linearCombination

public FieldGradient<T> linearCombination(double a1,
double a2,
double a3,
double a4,
FieldGradient<T> b4)
Compute a linear combination.
Specified by:
linearCombination in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Parameters:
a1 - first factor of the first term
b1 - second factor of the first term
a2 - first factor of the second term
b2 - second factor of the second term
a3 - first factor of the third term
b3 - second factor of the third term
a4 - first factor of the fourth term
b4 - second factor of the fourth term
Returns:
a1×b1 + a2×b2 + a3×b3 + a4×b4
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement), CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement)
• #### getPi

public FieldGradient<T> getPi()
Get the Archimedes constant π.

Archimedes constant is the ratio of a circle's circumference to its diameter.

Specified by:
getPi in interface CalculusFieldElement<FieldGradient<T extends CalculusFieldElement<T>>>
Returns:
Archimedes constant π
• #### equals

public boolean equals(Object other)
Test for the equality of two univariate derivatives.

univariate derivatives are considered equal if they have the same derivatives.

Overrides:
equals in class Object
Parameters:
other - Object to test for equality to this
Returns:
true if two univariate derivatives are equal
• #### hashCode

public int hashCode()
Get a hashCode for the univariate derivative.
Overrides:
hashCode in class Object
Returns:
a hash code value for this object