Class ApcomplexMath

java.lang.Object
org.apfloat.ApcomplexMath

public class ApcomplexMath extends Object
Various mathematical functions for arbitrary precision complex numbers.
Version:
1.15.0
Author:
Mikko Tommila
See Also:
  • Method Details

    • negate

      @Deprecated public static Apcomplex negate(Apcomplex z) throws ApfloatRuntimeException
      Deprecated.
      Negative value.
      Parameters:
      z - The argument.
      Returns:
      -z.
      Throws:
      ApfloatRuntimeException
    • abs

      public static Apfloat abs(Apcomplex z) throws ApfloatRuntimeException
      Absolute value.
      Parameters:
      z - The argument.
      Returns:
      sqrt(x2 + y2), where z = x + i y.
      Throws:
      ApfloatRuntimeException
    • norm

      public static Apfloat norm(Apcomplex z) throws ApfloatRuntimeException
      Norm. Square of the magnitude.
      Parameters:
      z - The argument.
      Returns:
      x2 + y2, where z = x + i y.
      Throws:
      ApfloatRuntimeException
    • arg

      Angle of the complex vector in the complex plane.
      Parameters:
      z - The argument.
      Returns:
      arctan(y / x) from the appropriate branch, where z = x + i y.
      Throws:
      ArithmeticException - If z is zero.
      ApfloatRuntimeException
    • scale

      public static Apcomplex scale(Apcomplex z, long scale) throws ApfloatRuntimeException
      Multiply by a power of the radix.
      Parameters:
      z - The argument.
      scale - The scaling factor.
      Returns:
      z * z.radix()scale.
      Throws:
      ApfloatRuntimeException
    • pow

      public static Apcomplex pow(Apcomplex z, long n) throws ArithmeticException, ApfloatRuntimeException
      Integer power.
      Parameters:
      z - Base of the power operator.
      n - Exponent of the power operator.
      Returns:
      z to the n:th power, that is zn.
      Throws:
      ArithmeticException - If both z and n are zero.
      ApfloatRuntimeException
    • sqrt

      public static Apcomplex sqrt(Apcomplex z) throws ApfloatRuntimeException
      Square root.
      Parameters:
      z - The argument.
      Returns:
      Square root of z.
      Throws:
      ApfloatRuntimeException
    • cbrt

      public static Apcomplex cbrt(Apcomplex z) throws ApfloatRuntimeException
      Cube root.
      Parameters:
      z - The argument.
      Returns:
      Cube root of z.
      Throws:
      ApfloatRuntimeException
    • root

      public static Apcomplex root(Apcomplex z, long n) throws ArithmeticException, ApfloatRuntimeException
      Positive integer root. The branch that has the smallest angle and same sign of imaginary part as z is always chosen.
      Parameters:
      z - The argument.
      n - Which root to take.
      Returns:
      n:th root of z, that is z1/n.
      Throws:
      ArithmeticException - If n is zero.
      ApfloatRuntimeException
    • root

      public static Apcomplex root(Apcomplex z, long n, long k) throws ArithmeticException, ApfloatRuntimeException
      Positive integer root. The specified branch counting from the smallest angle and same sign of imaginary part as z is chosen.
      Parameters:
      z - The argument.
      n - Which root to take.
      k - Which branch to take.
      Returns:
      n:th root of z, that is z1/nei2πsk/n where s is the signum of the imaginary part of z.
      Throws:
      ArithmeticException - If n is zero.
      ApfloatRuntimeException
      Since:
      1.5
    • inverseRoot

      public static Apcomplex inverseRoot(Apcomplex z, long n) throws ArithmeticException, ApfloatRuntimeException
      Inverse positive integer root. The branch that has the smallest angle and different sign of imaginary part than z is always chosen.
      Parameters:
      z - The argument.
      n - Which inverse root to take.
      Returns:
      Inverse n:th root of z, that is z-1/n.
      Throws:
      ArithmeticException - If z or n is zero.
      ApfloatRuntimeException
    • inverseRoot

      public static Apcomplex inverseRoot(Apcomplex z, long n, long k) throws ArithmeticException, ApfloatRuntimeException
      Inverse positive integer root. The specified branch counting from the smallest angle and different sign of imaginary part than z is chosen.
      Parameters:
      z - The argument.
      n - Which inverse root to take.
      k - Which branch to take.
      Returns:
      Inverse n:th root of z, that is z-1/ne-i2πk/n.
      Throws:
      ArithmeticException - If z or n is zero.
      ApfloatRuntimeException
    • allRoots

      public static Apcomplex[] allRoots(Apcomplex z, int n) throws ArithmeticException, ApfloatRuntimeException
      All values of the positive integer root.

      Returns all of the n values of the root, in the order of the angle, starting from the smallest angle and same sign of imaginary part as z.

      Parameters:
      z - The argument.
      n - Which root to take.
      Returns:
      All values of the n:th root of z, that is z1/n, in the order of the angle.
      Throws:
      ArithmeticException - If n is zero.
      ApfloatRuntimeException
      Since:
      1.5
    • agm

      public static Apcomplex agm(Apcomplex a, Apcomplex b) throws ApfloatRuntimeException
      Arithmetic-geometric mean.
      Parameters:
      a - First argument.
      b - Second argument.
      Returns:
      Arithmetic-geometric mean of a and b.
      Throws:
      ApfloatRuntimeException
    • log

      Natural logarithm.

      The logarithm is calculated using the arithmetic-geometric mean. See the Borweins' book for the formula.

      Parameters:
      z - The argument.
      Returns:
      Natural logarithm of z.
      Throws:
      ArithmeticException - If z is zero.
      ApfloatRuntimeException
    • log

      Logarithm in arbitrary base.

      Parameters:
      z - The argument.
      w - The base.
      Returns:
      Base-w logarithm of z.
      Throws:
      ArithmeticException - If z or w is zero.
      ApfloatRuntimeException
      Since:
      1.6
    • exp

      public static Apcomplex exp(Apcomplex z) throws ApfloatRuntimeException
      Exponent function. Calculated using Newton's iteration for the inverse of logarithm.
      Parameters:
      z - The argument.
      Returns:
      ez.
      Throws:
      ApfloatRuntimeException
    • pow

      public static Apcomplex pow(Apcomplex z, Apcomplex w) throws ApfloatRuntimeException
      Arbitrary power. Calculated using log() and exp().

      Parameters:
      z - The base.
      w - The exponent.
      Returns:
      zw.
      Throws:
      ArithmeticException - If both z and w are zero.
      ApfloatRuntimeException
    • acos

      public static Apcomplex acos(Apcomplex z) throws ApfloatRuntimeException
      Inverse cosine. Calculated using log().
      Parameters:
      z - The argument.
      Returns:
      Inverse cosine of z.
      Throws:
      InfiniteExpansionException - If z is zero.
      ApfloatRuntimeException
    • acosh

      public static Apcomplex acosh(Apcomplex z) throws ApfloatRuntimeException
      Inverse hyperbolic cosine. Calculated using log().
      Parameters:
      z - The argument.
      Returns:
      Inverse hyperbolic cosine of z.
      Throws:
      InfiniteExpansionException - If z is zero.
      ApfloatRuntimeException
    • asin

      public static Apcomplex asin(Apcomplex z) throws ApfloatRuntimeException
      Inverse sine. Calculated using log().
      Parameters:
      z - The argument.
      Returns:
      Inverse sine of z.
      Throws:
      ApfloatRuntimeException
    • asinh

      public static Apcomplex asinh(Apcomplex z) throws ApfloatRuntimeException
      Inverse hyperbolic sine. Calculated using log().
      Parameters:
      z - The argument.
      Returns:
      Inverse hyperbolic sine of z.
      Throws:
      ApfloatRuntimeException
    • atan

      Inverse tangent. Calculated using log().
      Parameters:
      z - The argument.
      Returns:
      Inverse tangent of z.
      Throws:
      ArithmeticException - If z == i.
      ApfloatRuntimeException
    • atanh

      Inverse hyperbolic tangent. Calculated using log().
      Parameters:
      z - The argument.
      Returns:
      Inverse hyperbolic tangent of z.
      Throws:
      ArithmeticException - If z is 1 or -1.
      ApfloatRuntimeException
    • cos

      public static Apcomplex cos(Apcomplex z) throws ApfloatRuntimeException
      Cosine. Calculated using exp().
      Parameters:
      z - The argument.
      Returns:
      Cosine of z.
      Throws:
      ApfloatRuntimeException
    • cosh

      public static Apcomplex cosh(Apcomplex z) throws ApfloatRuntimeException
      Hyperbolic cosine. Calculated using exp().
      Parameters:
      z - The argument.
      Returns:
      Hyperbolic cosine of z.
      Throws:
      ApfloatRuntimeException
    • sin

      public static Apcomplex sin(Apcomplex z) throws ApfloatRuntimeException
      Sine. Calculated using exp().
      Parameters:
      z - The argument.
      Returns:
      Sine of z.
      Throws:
      ApfloatRuntimeException
    • sinh

      public static Apcomplex sinh(Apcomplex z) throws ApfloatRuntimeException
      Hyperbolic sine. Calculated using exp().
      Parameters:
      z - The argument.
      Returns:
      Hyperbolic sine of z.
      Throws:
      ApfloatRuntimeException
    • tan

      Tangent. Calculated using exp().
      Parameters:
      z - The argument.
      Returns:
      Tangent of z.
      Throws:
      ArithmeticException - If z is π/2 + n π where n is an integer.
      ApfloatRuntimeException
    • tanh

      Hyperbolic tangent. Calculated using exp().
      Parameters:
      z - The argument.
      Returns:
      Hyperbolic tangent of z.
      Throws:
      ArithmeticException - If z is i (π/2 + n π) where n is an integer.
      ApfloatRuntimeException
    • sinc

      public static Apcomplex sinc(Apcomplex z) throws ApfloatRuntimeException
      Sinc.
      Parameters:
      z - The argument.
      Returns:
      sinc(z)
      Throws:
      ApfloatRuntimeException
      Since:
      1.14.0
    • w

      public static Apcomplex w(Apcomplex z) throws ApfloatRuntimeException
      Lambert W function. The W function gives the solution to the equation W eW = z. Also known as the product logarithm.

      This function gives the solution to the principal branch, W0.

      Parameters:
      z - The argument.
      Returns:
      W0(z).
      Throws:
      ApfloatRuntimeException
      Since:
      1.8.0
    • w

      public static Apcomplex w(Apcomplex z, long k) throws ArithmeticException, ApfloatRuntimeException
      Lambert W function for the specified branch.

      Parameters:
      z - The argument.
      k - The branch.
      Returns:
      Wk(z).
      Throws:
      ArithmeticException - If z is zero and k is not zero.
      ApfloatRuntimeException
      Since:
      1.8.0
      See Also:
    • product

      public static Apcomplex product(Apcomplex... z) throws ApfloatRuntimeException
      Product of numbers. The precision used in the multiplications is only what is needed for the end result. This method may perform significantly better than simply multiplying the numbers sequentially.

      If there are no arguments, the return value is 1.

      Parameters:
      z - The argument(s).
      Returns:
      The product of the given numbers.
      Throws:
      ApfloatRuntimeException
      Since:
      1.3
    • sum

      public static Apcomplex sum(Apcomplex... z) throws ApfloatRuntimeException
      Sum of numbers. The precision used in the additions is only what is needed for the end result. This method may perform significantly better than simply adding the numbers sequentially.

      If there are no arguments, the return value is 0.

      Parameters:
      z - The argument(s).
      Returns:
      The sum of the given numbers.
      Throws:
      ApfloatRuntimeException
      Since:
      1.3
    • gamma

      Gamma function.

      Parameters:
      z - The argument.
      Returns:
      Γ(z)
      Throws:
      ArithmeticException - If z is a nonpositive integer.
      ApfloatRuntimeException
      Since:
      1.9.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. The asymptotic complexity is at least O(n2log n) and it is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the gamma function.
    • gamma

      Incomplete gamma function.

      Parameters:
      a - The first argument.
      z - The second argument.
      Returns:
      Γ(a, z)
      Throws:
      ArithmeticException - If the real part of a is nonpositive and z is zero.
      ApfloatRuntimeException
      Since:
      1.10.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. The asymptotic complexity is at least O(n2log n) and it is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the incomplete gamma function.
    • gamma

      Generalized incomplete gamma function.

      This function is defined as: Γ(a, z0, z1) = Γ(a, z0) - Γ(a, z1)

      The lower gamma function can be calculated with: γ(a, z) = Γ(a, 0, z)

      Parameters:
      a - The first argument.
      z0 - The second argument.
      z1 - The third argument.
      Returns:
      Γ(a, z0, z1)
      Throws:
      ArithmeticException - If the real part of a is nonpositive and either z0 or z1 is zero. For the lower gamma function if a is a nonpositive integer.
      ApfloatRuntimeException
      Since:
      1.10.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. The asymptotic complexity is at least O(n2log n) and it is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the incomplete gamma function.
    • logGamma

      public static Apcomplex logGamma(Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Logarithm of the gamma function. Note that this function has a different branch structure than log(gamma(z)).

      Parameters:
      z - The argument.
      Returns:
      logΓ(z)
      Throws:
      ArithmeticException - If z is a nonpositive integer.
      ApfloatRuntimeException
      Since:
      1.11.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. The asymptotic complexity is at least O(n2log n) and it is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the gamma function.
    • digamma

      Digamma function.

      Parameters:
      z - The argument.
      Returns:
      ψ(z)
      Throws:
      ArithmeticException - If z is a nonpositive integer.
      ApfloatRuntimeException
      Since:
      1.11.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. The asymptotic complexity is at least O(n2log n) and it is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the digamma function.
    • polygamma

      public static Apcomplex polygamma(long n, Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Polygamma function.

      Parameters:
      n - The order.
      z - The argument.
      Returns:
      ψ(n)(z)
      Throws:
      ArithmeticException - If n is negative or z is a nonpositive integer.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. The asymptotic complexity is at least O(n2log n) and it is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the polygamma function.
    • beta

      Beta function.

      Parameters:
      a - The first argument.
      b - The second argument.
      Returns:
      B(a, b)
      Throws:
      ArithmeticException - If a or b is a nonpositive integer but a + b is not. Also if both a and b are nonpositive integers.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. The asymptotic complexity is at least O(n2log n) and it is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the beta function.
    • beta

      Incomplete beta function.

      Parameters:
      z - The first argument.
      a - The second argument.
      b - The third argument.
      Returns:
      Bz(a, b)
      Throws:
      ArithmeticException - If a is a nonpositive integer or z is zero and a has nonpositive real part.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. The asymptotic complexity is at least O(n2log n) and it is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • beta

      Generalized incomplete beta function.

      Parameters:
      z1 - The first argument.
      z2 - The second argument.
      a - The third argument.
      b - The fourth argument.
      Returns:
      B(z1, z2)(a, b)
      Throws:
      ArithmeticException - If a is a nonpositive integer or z1 or z2 is zero and a has nonpositive real part.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. The asymptotic complexity is at least O(n2log n) and it is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • pochhammer

      public static Apcomplex pochhammer(Apcomplex z, Apcomplex n) throws ArithmeticException, ApfloatRuntimeException
      Pochhammer symbol.

      Parameters:
      z - The first argument.
      n - The second argument.
      Returns:
      (z)n
      Throws:
      ArithmeticException - If z + n is a nonpositive integer but z is not.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. The asymptotic complexity is at least O(n2log n) and it is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the pochhammer symbol.
    • binomial

      Binomial coefficient. Calculated using the gamma(Apcomplex) function.
      Parameters:
      n - The first argument.
      k - The second argument.
      Returns:
      ( n k )
      Throws:
      ArithmeticException - If n is a negative integer and k is noninteger.
      ApfloatRuntimeException
      Since:
      1.11.0
    • zeta

      Riemann zeta function.

      Parameters:
      s - The argument.
      Returns:
      ζ(s)
      Throws:
      ArithmeticException - If s is 1.
      ApfloatRuntimeException
      Since:
      1.11.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few hundred digits. At the time of implementation no generic fast algorithm is known for the zeta function.
    • zeta

      Hurwitz zeta function.

      Parameters:
      s - The first argument.
      a - The second argument.
      Returns:
      ζ(s, a)
      Throws:
      ArithmeticException - If s is 1 or if a is a nonpositive integer.
      ApfloatRuntimeException
      Since:
      1.11.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few hundred digits. At the time of implementation no generic fast algorithm is known for the zeta function.
    • hypergeometric0F1

      public static Apcomplex hypergeometric0F1(Apcomplex a, Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Confluent hypergeometric function 0F1.

      Parameters:
      a - The first argument.
      z - The second argument.
      Returns:
      0F1(; a; z)
      Throws:
      ArithmeticException - If the function value is not finite.
      ApfloatRuntimeException
      Since:
      1.11.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • hypergeometric0F1Regularized

      public static Apcomplex hypergeometric0F1Regularized(Apcomplex a, Apcomplex z) throws ApfloatRuntimeException
      Regularized confluent hypergeometric function 01.

      Parameters:
      a - The first argument.
      z - The second argument.
      Returns:
      01(; a; z)
      Throws:
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • hypergeometric1F1

      public static Apcomplex hypergeometric1F1(Apcomplex a, Apcomplex b, Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Kummer confluent hypergeometric function 1F1. Also known as the confluent hypergeometric function of the first kind.

      Parameters:
      a - The first argument.
      b - The second argument.
      z - The third argument.
      Returns:
      1F1(a; b; z)
      Throws:
      ArithmeticException - If the function value is not finite.
      ApfloatRuntimeException
      Since:
      1.11.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • hypergeometric1F1Regularized

      public static Apcomplex hypergeometric1F1Regularized(Apcomplex a, Apcomplex b, Apcomplex z) throws ApfloatRuntimeException
      Regularized Kummer confluent hypergeometric function 11. Also known as the regularized confluent hypergeometric function of the first kind.

      Parameters:
      a - The first argument.
      b - The second argument.
      z - The third argument.
      Returns:
      11(a; b; z)
      Throws:
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • hypergeometric2F1

      public static Apcomplex hypergeometric2F1(Apcomplex a, Apcomplex b, Apcomplex c, Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Hypergeometric function 2F1. Also known as the Gaussian or ordinary hypergeometric function.

      Parameters:
      a - The first argument.
      b - The second argument.
      c - The third argument.
      z - The fourth argument.
      Returns:
      2F1(a, b; c; z)
      Throws:
      ArithmeticException - If the function value is not finite.
      ApfloatRuntimeException
      Since:
      1.11.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • hypergeometric2F1Regularized

      public static Apcomplex hypergeometric2F1Regularized(Apcomplex a, Apcomplex b, Apcomplex c, Apcomplex z) throws ApfloatRuntimeException
      Regularized hypergeometric function 21. Also known as the regularized Gaussian or ordinary hypergeometric function.

      Parameters:
      a - The first argument.
      b - The second argument.
      c - The third argument.
      z - The fourth argument.
      Returns:
      21(a, b; c; z)
      Throws:
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • hypergeometricU

      public static Apcomplex hypergeometricU(Apcomplex a, Apcomplex b, Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Tricomi's confluent hypergeometric function U. Also known as the confluent hypergeometric function of the second kind.

      Parameters:
      a - The first argument.
      b - The second argument.
      z - The third argument.
      Returns:
      U(a, b, z)
      Throws:
      ArithmeticException - If the result is not finite.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • erf

      public static Apcomplex erf(Apcomplex z) throws ApfloatRuntimeException
      Error function.

      Parameters:
      z - The argument.
      Returns:
      erf(z)
      Throws:
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • erfc

      public static Apcomplex erfc(Apcomplex z) throws ApfloatRuntimeException
      Complementary error function.

      Parameters:
      z - The argument.
      Returns:
      erfc(z)
      Throws:
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • erfi

      public static Apcomplex erfi(Apcomplex z) throws ApfloatRuntimeException
      Imaginary error function.

      Parameters:
      z - The argument.
      Returns:
      erfi(z)
      Throws:
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • fresnelS

      public static Apcomplex fresnelS(Apcomplex z) throws ApfloatRuntimeException
      Fresnel integral S.

      Parameters:
      z - The argument.
      Returns:
      S(z)
      Throws:
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • fresnelC

      public static Apcomplex fresnelC(Apcomplex z) throws ApfloatRuntimeException
      Fresnel integral C.

      Parameters:
      z - The argument.
      Returns:
      C(z)
      Throws:
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • expIntegralE

      public static Apcomplex expIntegralE(Apcomplex ν, Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Exponential integral E.

      Parameters:
      ν - The first argument.
      z - The second argument.
      Returns:
      Eν(z)
      Throws:
      ArithmeticException - If real part of ν is ≤ 1 and z is zero.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • expIntegralEi

      public static Apcomplex expIntegralEi(Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Exponential integral Ei.

      Parameters:
      z - The argument.
      Returns:
      Ei(z)
      Throws:
      ArithmeticException - If z is zero.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • logIntegral

      public static Apcomplex logIntegral(Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Logarithmic integral.

      Parameters:
      z - The argument.
      Returns:
      li(z)
      Throws:
      ArithmeticException - If z is zero.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • sinIntegral

      public static Apcomplex sinIntegral(Apcomplex z) throws ApfloatRuntimeException
      Sine integral.

      Parameters:
      z - The argument.
      Returns:
      Si(z)
      Throws:
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • cosIntegral

      public static Apcomplex cosIntegral(Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Cosine integral.

      Parameters:
      z - The argument.
      Returns:
      Ci(z)
      Throws:
      ArithmeticException - If z is zero.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • sinhIntegral

      public static Apcomplex sinhIntegral(Apcomplex z) throws ApfloatRuntimeException
      Hyperbolic sine integral.

      Parameters:
      z - The argument.
      Returns:
      Shi(z)
      Throws:
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • coshIntegral

      public static Apcomplex coshIntegral(Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Hyperbolic cosine integral.

      Parameters:
      z - The argument.
      Returns:
      Chi(z)
      Throws:
      ArithmeticException - If z is zero.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • airyAi

      public static Apcomplex airyAi(Apcomplex z) throws ApfloatRuntimeException
      Airy function Ai.

      Parameters:
      z - The argument.
      Returns:
      Ai(z)
      Throws:
      InfiniteExpansionException - If z is zero.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • airyAiPrime

      public static Apcomplex airyAiPrime(Apcomplex z) throws ApfloatRuntimeException
      Derivative of the Airy function Ai.

      Parameters:
      z - The argument.
      Returns:
      Ai′(z)
      Throws:
      InfiniteExpansionException - If z is zero.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • airyBi

      public static Apcomplex airyBi(Apcomplex z) throws ApfloatRuntimeException
      Airy function Bi.

      Parameters:
      z - The argument.
      Returns:
      Bi(z)
      Throws:
      InfiniteExpansionException - If z is zero.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • airyBiPrime

      public static Apcomplex airyBiPrime(Apcomplex z) throws ApfloatRuntimeException
      Derivative of the Airy function Bi.

      Parameters:
      z - The argument.
      Returns:
      Bi′(z)
      Throws:
      InfiniteExpansionException - If z is zero.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • besselJ

      Bessel function of the first kind.

      Parameters:
      ν - The order.
      z - The argument.
      Returns:
      Jν(z)
      Throws:
      ArithmeticException - If the real part of ν is < 0 and ν is not an integer and z is zero. Also if the real part of ν is zero but the imaginary part is not, and z is zero.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • besselI

      Modified Bessel function of the first kind.

      Parameters:
      ν - The order.
      z - The argument.
      Returns:
      Iν(z)
      Throws:
      ArithmeticException - If the real part of ν is < 0 and ν is not an integer and z is zero. Also if the real part of ν is zero but the imaginary part is not, and z is zero.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • besselY

      Bessel function of the second kind.

      Parameters:
      ν - The order.
      z - The argument.
      Returns:
      Yν(z)
      Throws:
      ArithmeticException - If z is zero.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • besselK

      Modified Bessel function of the second kind.

      Parameters:
      ν - The order.
      z - The argument.
      Returns:
      Kν(z)
      Throws:
      ArithmeticException - If z is zero.
      ApfloatRuntimeException
      Since:
      1.13.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • struveH

      Struve function 𝐇.

      Parameters:
      ν - The order.
      z - The argument.
      Returns:
      𝐇ν(z)
      Throws:
      ArithmeticException - If z is zero and real part of ν is ≤ -1.
      ApfloatRuntimeException
      Since:
      1.15.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • struveL

      Modified Struve function 𝐋.

      Parameters:
      ν - The order.
      z - The argument.
      Returns:
      𝐋ν(z)
      Throws:
      ArithmeticException - If z is zero and real part of ν is ≤ -1.
      ApfloatRuntimeException
      Since:
      1.15.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • angerJ

      public static Apcomplex angerJ(Apcomplex ν, Apcomplex z) throws ApfloatRuntimeException
      Anger function 𝐉.

      Parameters:
      ν - The order.
      z - The argument.
      Returns:
      𝐉ν(z)
      Throws:
      ApfloatRuntimeException
      Since:
      1.15.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • weberE

      public static Apcomplex weberE(Apcomplex ν, Apcomplex z) throws ApfloatRuntimeException
      Weber function 𝐄.

      Parameters:
      ν - The order.
      z - The argument.
      Returns:
      𝐄ν(z)
      Throws:
      ApfloatRuntimeException
      Since:
      1.15.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • ellipticK

      public static Apcomplex ellipticK(Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Complete elliptic integral of the first kind.

      Note that this function uses the definition: K ( z ) 0 π 2 1 1 - z sin 2 ( t ) t

      Parameters:
      z - The argument.
      Returns:
      K(z)
      Throws:
      InfiniteExpansionException - If z is zero.
      ArithmeticException - If z is one.
      ApfloatRuntimeException
      Since:
      1.13.0
    • ellipticE

      public static Apcomplex ellipticE(Apcomplex z) throws ApfloatRuntimeException
      Complete elliptic integral of the second kind.

      Note that this function uses the definition: E ( z ) 0 π 2 1 - z sin 2 ( t ) t

      Parameters:
      z - The argument.
      Returns:
      E(z)
      Throws:
      InfiniteExpansionException - If z is zero.
      ApfloatRuntimeException
      Since:
      1.13.0
    • hermiteH

      public static Apcomplex hermiteH(Apcomplex ν, Apcomplex z) throws ApfloatRuntimeException
      Hermite function. For integer values of ν gives the Hermite polynomial.

      Parameters:
      ν - The first argument.
      z - The second argument.
      Returns:
      Hν(z)
      Throws:
      ApfloatRuntimeException
      Since:
      1.14.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • laguerreL

      public static Apcomplex laguerreL(Apcomplex ν, Apcomplex z) throws ApfloatRuntimeException
      Laguerre function. For integer values of ν gives the Laguerre polynomial.

      Parameters:
      ν - The first argument.
      z - The second argument.
      Returns:
      Lν(z)
      Throws:
      ApfloatRuntimeException
      Since:
      1.14.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • laguerreL

      public static Apcomplex laguerreL(Apcomplex ν, Apcomplex λ, Apcomplex z) throws ApfloatRuntimeException
      Generalized Laguerre function. For integer values of ν gives the generalized Laguerre polynomial.

      Parameters:
      ν - The first argument.
      λ - The second argument.
      z - The third argument.
      Returns:
      Lνλ(z)
      Throws:
      ApfloatRuntimeException
      Since:
      1.14.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • legendreP

      public static Apcomplex legendreP(Apcomplex ν, Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Legendre function. For integer values of ν gives the Legendre polynomial.

      Parameters:
      ν - The first argument.
      z - The second argument.
      Returns:
      Pν(z)
      Throws:
      ArithmeticException - If ν is not an integer and z is -1.
      ApfloatRuntimeException
      Since:
      1.14.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • legendreP

      public static Apcomplex legendreP(Apcomplex ν, Apcomplex μ, Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Associated Legendre function of the first kind. Gives Legendre functions of type 2.

      Parameters:
      ν - The first argument.
      μ - The second argument.
      z - The third argument.
      Returns:
      Pνμ(z)
      Throws:
      ArithmeticException - If ν is not an integer and z is -1.
      ApfloatRuntimeException
      Since:
      1.14.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • legendreQ

      public static Apcomplex legendreQ(Apcomplex ν, Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Legendre function of the second kind.

      Parameters:
      ν - The first argument.
      z - The second argument.
      Returns:
      Qν(z)
      Throws:
      ArithmeticException - If z is 1 or -1.
      ApfloatRuntimeException
      Since:
      1.14.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • legendreQ

      public static Apcomplex legendreQ(Apcomplex ν, Apcomplex μ, Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Associated Legendre function of the second kind. Gives Legendre functions of type 2.

      Parameters:
      ν - The first argument.
      μ - The second argument.
      z - The third argument.
      Returns:
      Qνμ(z)
      Throws:
      ArithmeticException - If z is 1 or -1.
      ApfloatRuntimeException
      Since:
      1.14.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • sphericalHarmonicY

      public static Apcomplex sphericalHarmonicY(Apcomplex λ, Apcomplex μ, Apcomplex ϑ, Apcomplex ϕ) throws ArithmeticException, ApfloatRuntimeException
      Spherical harmonic function.

      Parameters:
      λ - The first argument.
      μ - The second argument.
      ϑ - The third argument.
      ϕ - The fourth argument.
      Returns:
      Yλμ(ϑ, φ)
      Throws:
      ArithmeticException - If ϑ is π plus a multiple of 2 π and μ is not an integer and has a negative real part, or if λ - μ is a negative integer.
      ApfloatRuntimeException
      Since:
      1.14.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • chebyshevT

      public static Apcomplex chebyshevT(Apcomplex ν, Apcomplex z) throws ApfloatRuntimeException
      Chebyshev function of the first kind. For integer values of ν gives the Chebyshev polynomial of the first kind.

      Parameters:
      ν - The first argument.
      z - The second argument.
      Returns:
      Tν(z)
      Throws:
      ApfloatRuntimeException
      Since:
      1.14.0
    • chebyshevU

      public static Apcomplex chebyshevU(Apcomplex ν, Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Chebyshev function of the second kind. For integer values of ν gives the Chebyshev polynomial of the second kind.

      Parameters:
      ν - The first argument.
      z - The second argument.
      Returns:
      Uν(z)
      Throws:
      ArithmeticException - If z is -1 and ν is not an integer.
      ApfloatRuntimeException
      Since:
      1.14.0
    • gegenbauerC

      public static Apcomplex gegenbauerC(Apcomplex ν, Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Renormalized Gegenbauer function.

      Parameters:
      ν - The first argument.
      z - The second argument.
      Returns:
      Cν(0)(z)
      Throws:
      ArithmeticException - If ν is zero.
      ApfloatRuntimeException
      Since:
      1.14.0
    • gegenbauerC

      public static Apcomplex gegenbauerC(Apcomplex ν, Apcomplex λ, Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Gegenbauer function. For nonnegative integer values of ν gives the Gegenbauer polynomial.

      Parameters:
      ν - The first argument.
      λ - The second argument.
      z - The third argument.
      Returns:
      Cνλ(z)
      Throws:
      ArithmeticException - If z is -1 and real part of λ is > 1/2. Also if z is -1 and λ is 1/2 and ν is not an integer.
      ApfloatRuntimeException
      Since:
      1.14.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • jacobiP

      Jacobi function. For nonnegative integer values of ν gives the Jacobi polynomial.

      Parameters:
      ν - The first argument.
      a - The second argument.
      b - The third argument.
      z - The fourth argument.
      Returns:
      Pν(a,b)(z)
      Throws:
      ArithmeticException - If z is -1 and real part of b is > 0 and ν is not a positive integer. Also if ν + a is a negative integer and ν is not an integer.
      ApfloatRuntimeException
      Since:
      1.14.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • fibonacci

      public static Apcomplex fibonacci(Apcomplex ν, Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Fibonacci function. For nonnegative integer values of ν gives the Fibonacci polynomial.

      Parameters:
      ν - The first argument.
      z - The second argument.
      Returns:
      Fν(z)
      Throws:
      ArithmeticException - If z is -1 and ν is not an integer.
      ApfloatRuntimeException
      Since:
      1.14.0
    • eulerE

      public static Apcomplex eulerE(long n, Apcomplex z) throws IllegalArgumentException, ApfloatRuntimeException
      Euler polynomial.

      Parameters:
      n - The first argument.
      z - The second argument.
      Returns:
      En(z)
      Throws:
      IllegalArgumentException - If n < 0.
      ApfloatRuntimeException
      Since:
      1.14.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • bernoulliB

      public static Apcomplex bernoulliB(long n, Apcomplex z) throws IllegalArgumentException, ApfloatRuntimeException
      Bernoulli polynomial.

      Parameters:
      n - The first argument.
      z - The second argument.
      Returns:
      Bn(z)
      Throws:
      IllegalArgumentException - If n < 0.
      ApfloatRuntimeException
      Since:
      1.14.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • harmonicNumber

      public static Apcomplex harmonicNumber(Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Harmonic number.

      Parameters:
      z - The argument.
      Returns:
      Hz
      Throws:
      ArithmeticException - If z is a negative integer.
      ApfloatRuntimeException
      Since:
      1.14.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • harmonicNumber

      public static Apcomplex harmonicNumber(Apcomplex z, Apcomplex r) throws ArithmeticException, ApfloatRuntimeException
      Generalized harmonic number.

      Parameters:
      z - The first argument.
      r - The second argument.
      Returns:
      Hz(r)
      Throws:
      ArithmeticException - If z is a negative integer, unless r has a negative real part or is zero.
      ApfloatRuntimeException
      Since:
      1.14.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • polylog

      Polylogarithm.

      Parameters:
      ν - The first argument.
      z - The second argument.
      Returns:
      Liν(z)
      Throws:
      ArithmeticException - If the real part of ν is ≤ 1 and z is 1.
      ApfloatRuntimeException
      Since:
      1.14.0
      Implementation notes:
      This implementation is slow, meaning that it isn't a fast algorithm. It is impractically slow beyond a precision of a few thousand digits. At the time of implementation no generic fast algorithm is known for the function.
    • logisticSigmoid

      public static Apcomplex logisticSigmoid(Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
      Logistic sigmoid.
      Parameters:
      z - The argument.
      Returns:
      σ(z)
      Throws:
      ArithmeticException - If z is an odd integer multiple of π i.
      ApfloatRuntimeException
      Since:
      1.14.0
    • ulp

      public static Apfloat ulp(Apcomplex z)
      Returns the unit in the last place of the argument, considering the scale and precision. This is maximum of the ulps of the real and imaginary part of the argument. If the precision of the argument is infinite, zero is returned.
      Parameters:
      z - The argument.
      Returns:
      The ulp of the argument.
      Since:
      1.10.0