Interface CalculusFieldElement<T extends FieldElement<T>>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      T abs()
      absolute value.
      T acos()
      Arc cosine operation.
      T acosh()
      Inverse hyperbolic cosine operation.
      T add​(double a)
      '+' operator.
      T asin()
      Arc sine operation.
      T asinh()
      Inverse hyperbolic sine operation.
      T atan()
      Arc tangent operation.
      T atan2​(T x)
      Two arguments arc tangent operation.
      T atanh()
      Inverse hyperbolic tangent operation.
      T cbrt()
      Cubic root.
      T ceil()
      Get the smallest whole number larger than instance.
      T copySign​(double sign)
      Returns the instance with the sign of the argument.
      T copySign​(T sign)
      Returns the instance with the sign of the argument.
      T cos()
      Cosine operation.
      T cosh()
      Hyperbolic cosine operation.
      T divide​(double a)
      '÷' operator.
      T exp()
      Exponential.
      T expm1()
      Exponential minus 1.
      T floor()
      Get the largest whole number smaller than instance.
      default int getExponent()
      Return the exponent of the instance, removing the bias.
      T getPi()
      Get the Archimedes constant π.
      T hypot​(T y)
      Returns the hypotenuse of a triangle with sides this and y - sqrt(this2 +y2) avoiding intermediate overflow or underflow.
      default boolean isFinite()
      Check if the instance is finite (neither infinite nor NaN).
      default boolean isInfinite()
      Check if the instance is infinite.
      default boolean isNaN()
      Check if the instance is Not a Number.
      T linearCombination​(double[] a, T[] b)
      Compute a linear combination.
      T linearCombination​(double a1, T b1, double a2, T b2)
      Compute a linear combination.
      T linearCombination​(double a1, T b1, double a2, T b2, double a3, T b3)
      Compute a linear combination.
      T linearCombination​(double a1, T b1, double a2, T b2, double a3, T b3, double a4, T b4)
      Compute a linear combination.
      T linearCombination​(T[] a, T[] b)
      Compute a linear combination.
      T linearCombination​(T a1, T b1, T a2, T b2)
      Compute a linear combination.
      T linearCombination​(T a1, T b1, T a2, T b2, T a3, T b3)
      Compute a linear combination.
      T linearCombination​(T a1, T b1, T a2, T b2, T a3, T b3, T a4, T b4)
      Compute a linear combination.
      T log()
      Natural logarithm.
      T log10()
      Base 10 logarithm.
      T log1p()
      Shifted natural logarithm.
      T multiply​(double a)
      '×' operator.
      T newInstance​(double value)
      Create an instance corresponding to a constant real value.
      default double norm()
      norm.
      T pow​(double p)
      Power operation.
      T pow​(int n)
      Integer power operation.
      T pow​(T e)
      Power operation.
      T reciprocal()
      Returns the multiplicative inverse of this element.
      T remainder​(double a)
      IEEE remainder operator.
      T remainder​(T a)
      IEEE remainder operator.
      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.
      T rootN​(int n)
      Nth root.
      default long round()
      Get the closest long to instance real value.
      T scalb​(int n)
      Multiply the instance by a power of 2.
      T sign()
      Compute the sign of the instance.
      T sin()
      Sine operation.
      FieldSinCos<T> sinCos()
      Combined Sine and Cosine operation.
      T sinh()
      Hyperbolic sine operation.
      FieldSinhCosh<T> sinhCosh()
      Combined hyperbolic sine and sosine operation.
      T sqrt()
      Square root.
      T subtract​(double a)
      '-' operator.
      T tan()
      Tangent operation.
      T tanh()
      Hyperbolic tangent operation.
      T toDegrees()
      Convert radians to degrees, with error of less than 0.5 ULP
      T toRadians()
      Convert degrees to radians, with error of less than 0.5 ULP
      T ulp()
      Compute least significant bit (Unit in Last Position) for a number.
    • Method Detail

      • getPi

        T getPi()
        Get the Archimedes constant π.

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

        Returns:
        Archimedes constant π
        Since:
        2.0
      • newInstance

        T newInstance​(double value)
        Create an instance corresponding to a constant real value.
        Parameters:
        value - constant real value
        Returns:
        instance corresponding to a constant real value
      • add

        T add​(double a)
        '+' operator.
        Parameters:
        a - right hand side parameter of the operator
        Returns:
        this+a
      • subtract

        T subtract​(double a)
        '-' operator.
        Parameters:
        a - right hand side parameter of the operator
        Returns:
        this-a
      • multiply

        T multiply​(double a)
        '×' operator.
        Parameters:
        a - right hand side parameter of the operator
        Returns:
        this×a
      • divide

        T divide​(double a)
        '÷' operator.
        Parameters:
        a - right hand side parameter of the operator
        Returns:
        this÷a
      • getExponent

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

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

        Returns:
        exponent for the instance, without bias
      • scalb

        T scalb​(int n)
        Multiply the instance by a power of 2.
        Parameters:
        n - power of 2
        Returns:
        this × 2n
      • ulp

        T ulp()
        Compute least significant bit (Unit in Last Position) for a number.
        Returns:
        ulp(this)
        Since:
        2.0
      • hypot

        T hypot​(T y)
         throws MathIllegalArgumentException
        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.
        Parameters:
        y - a value
        Returns:
        sqrt(this2 +y2)
        Throws:
        MathIllegalArgumentException - if number of free parameters or orders are inconsistent
      • reciprocal

        T reciprocal()
        Returns the multiplicative inverse of this element.
        Specified by:
        reciprocal in interface FieldElement<T extends FieldElement<T>>
        Returns:
        the inverse of this.
      • sqrt

        T sqrt()
        Square root.
        Returns:
        square root of the instance
      • cbrt

        T cbrt()
        Cubic root.
        Returns:
        cubic root of the instance
      • rootN

        T rootN​(int n)
        Nth root.
        Parameters:
        n - order of the root
        Returns:
        nth root of the instance
      • pow

        T pow​(double p)
        Power operation.
        Parameters:
        p - power to apply
        Returns:
        thisp
      • pow

        T pow​(int n)
        Integer power operation.
        Parameters:
        n - power to apply
        Returns:
        thisn
      • exp

        T exp()
        Exponential.
        Returns:
        exponential of the instance
      • expm1

        T expm1()
        Exponential minus 1.
        Returns:
        exponential minus one of the instance
      • log

        T log()
        Natural logarithm.
        Returns:
        logarithm of the instance
      • log1p

        T log1p()
        Shifted natural logarithm.
        Returns:
        logarithm of one plus the instance
      • log10

        T log10()
        Base 10 logarithm.
        Returns:
        base 10 logarithm of the instance
      • cos

        T cos()
        Cosine operation.
        Returns:
        cos(this)
      • sin

        T sin()
        Sine operation.
        Returns:
        sin(this)
      • sinCos

        FieldSinCos<T> sinCos()
        Combined Sine and Cosine operation.
        Returns:
        [sin(this), cos(this)]
        Since:
        1.4
      • tan

        T tan()
        Tangent operation.
        Returns:
        tan(this)
      • acos

        T acos()
        Arc cosine operation.
        Returns:
        acos(this)
      • asin

        T asin()
        Arc sine operation.
        Returns:
        asin(this)
      • atan

        T atan()
        Arc tangent operation.
        Returns:
        atan(this)
      • atan2

        T atan2​(T x)
         throws MathIllegalArgumentException
        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.

        Parameters:
        x - second argument of the arc tangent
        Returns:
        atan2(this, x)
        Throws:
        MathIllegalArgumentException - if number of free parameters or orders are inconsistent
      • cosh

        T cosh()
        Hyperbolic cosine operation.
        Returns:
        cosh(this)
      • sinh

        T sinh()
        Hyperbolic sine operation.
        Returns:
        sinh(this)
      • sinhCosh

        FieldSinhCosh<T> sinhCosh()
        Combined hyperbolic sine and sosine operation.
        Returns:
        [sinh(this), cosh(this)]
        Since:
        2.0
      • tanh

        T tanh()
        Hyperbolic tangent operation.
        Returns:
        tanh(this)
      • acosh

        T acosh()
        Inverse hyperbolic cosine operation.
        Returns:
        acosh(this)
      • asinh

        T asinh()
        Inverse hyperbolic sine operation.
        Returns:
        asin(this)
      • atanh

        T atanh()
        Inverse hyperbolic tangent operation.
        Returns:
        atanh(this)
      • toDegrees

        T toDegrees()
        Convert radians to degrees, with error of less than 0.5 ULP
        Returns:
        instance converted into degrees
      • toRadians

        T toRadians()
        Convert degrees to radians, with error of less than 0.5 ULP
        Returns:
        instance converted into radians
      • ceil

        T ceil()
        Get the smallest whole number larger than instance.
        Returns:
        ceil(this)
      • floor

        T floor()
        Get the largest whole number smaller than instance.
        Returns:
        floor(this)
      • rint

        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.
        Returns:
        a double number r such that r is an integer r - 0.5 ≤ this ≤ r + 0.5
      • remainder

        T remainder​(double 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
      • remainder

        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
      • sign

        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)
        Returns:
        -1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a
      • copySign

        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

        T copySign​(double 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
      • isInfinite

        default boolean isInfinite()
        Check if the instance is infinite.
        Returns:
        true if the instance is infinite
      • isFinite

        default boolean isFinite()
        Check if the instance is finite (neither infinite nor NaN).
        Returns:
        true if the instance is finite (neither infinite nor NaN)
        Since:
        2.0
      • isNaN

        default boolean isNaN()
        Check if the instance is Not a Number.
        Returns:
        true if the instance is Not a Number
      • norm

        default double norm()
        norm.
        Returns:
        norm(this)
        Since:
        2.0
      • abs

        T abs()
        absolute value.

        Just another name for norm()

        Returns:
        abs(this)
      • round

        default long round()
        Get the closest long to instance real value.
        Returns:
        closest long to FieldElement.getReal()