Package org.apfloat
Class ApcomplexMath
- java.lang.Object
-
- org.apfloat.ApcomplexMath
-
public class ApcomplexMath extends java.lang.ObjectVarious mathematical functions for arbitrary precision complex numbers.- Version:
- 1.14.0
- See Also:
ApfloatMath
-
-
Constructor Summary
Constructors Modifier Constructor Description privateApcomplexMath()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Apfloatabs(Apcomplex z)Absolute value.static Apcomplexacos(Apcomplex z)Inverse cosine.(package private) static Apcomplexacos(Apcomplex z, long precision)static Apcomplexacosh(Apcomplex z)Inverse hyperbolic cosine.(package private) static Apcomplexacosh(Apcomplex z, long precision)static Apcomplexagm(Apcomplex a, Apcomplex b)Arithmetic-geometric mean.(package private) static Apcomplexagm(Apcomplex a, Apcomplex b, java.util.function.Consumer<Apcomplex> consumer)private static ApcomplexagmConsume(java.util.function.Consumer<Apcomplex> consumer, Apcomplex a, Apcomplex c2, long workingPrecision)private static Apcomplexairy(java.util.function.Function<java.lang.Long,Apcomplex> f, long targetPrecision, int radix)static ApcomplexairyAi(Apcomplex z)Airy function Ai.(package private) static ApcomplexairyAi(Apcomplex z0, long targetPrecision)static ApcomplexairyAiPrime(Apcomplex z)Derivative of the Airy function Ai.(package private) static ApcomplexairyAiPrime(Apcomplex z0, long targetPrecision)static ApcomplexairyBi(Apcomplex z)Airy function Bi.(package private) static ApcomplexairyBi(Apcomplex z0, long targetPrecision)static ApcomplexairyBiPrime(Apcomplex z)Derivative of the Airy function Bi.(package private) static ApcomplexairyBiPrime(Apcomplex z0, long targetPrecision)static Apcomplex[]allRoots(Apcomplex z, int n)All values of the positive integer root.static Apfloatarg(Apcomplex z)Angle of the complex vector in the complex plane.static Apcomplexasin(Apcomplex z)Inverse sine.static Apcomplexasinh(Apcomplex z)Inverse hyperbolic sine.static Apcomplexatan(Apcomplex z)Inverse tangent.static Apcomplexatanh(Apcomplex z)Inverse hyperbolic tangent.static ApcomplexbernoulliB(long n, Apcomplex z)Bernoulli polynomial.(package private) static ApcomplexbernoulliB(long n, Apcomplex z, long precision)static ApcomplexbesselI(Apcomplex ν, Apcomplex z)Modified Bessel function of the first kind.static ApcomplexbesselJ(Apcomplex ν, Apcomplex z)Bessel function of the first kind.static ApcomplexbesselK(Apcomplex ν, Apcomplex z)Modified Bessel function of the second kind.static ApcomplexbesselY(Apcomplex ν, Apcomplex z)Bessel function of the second kind.static Apcomplexbeta(Apcomplex a, Apcomplex b)Beta function.static Apcomplexbeta(Apcomplex z, Apcomplex a, Apcomplex b)Incomplete beta function.static Apcomplexbeta(Apcomplex z1, Apcomplex z2, Apcomplex a, Apcomplex b)Generalized incomplete beta function.static Apcomplexbinomial(Apcomplex n, Apcomplex k)Binomial coefficient.static Apcomplexcbrt(Apcomplex z)Cube root.static ApcomplexchebyshevT(Apcomplex ν, Apcomplex z)Chebyshev function of the first kind.static ApcomplexchebyshevU(Apcomplex ν, Apcomplex z)Chebyshev function of the second kind.static Apcomplexcos(Apcomplex z)Cosine.static Apcomplexcosh(Apcomplex z)Hyperbolic cosine.static ApcomplexcoshIntegral(Apcomplex z)Hyperbolic cosine integral.static ApcomplexcosIntegral(Apcomplex z)Cosine integral.(package private) static Apcomplexcot(Apcomplex z)static Apcomplexdigamma(Apcomplex z)Digamma function.static ApcomplexellipticE(Apcomplex z)Complete elliptic integral of the second kind.(package private) static ApcomplexellipticE(Apcomplex z, long precision)static ApcomplexellipticK(Apcomplex z)Complete elliptic integral of the first kind.(package private) static ApcomplexellipticK(Apcomplex z, long precision)(package private) static ApcomplexellipticK(Apcomplex z, long precision, java.util.function.Consumer<Apcomplex> consumer)static Apcomplexerf(Apcomplex z)Error function.static Apcomplexerfc(Apcomplex z)Complementary error function.(package private) static ApcomplexerfcFixedPrecision(Apcomplex z)(package private) static ApcomplexerfFixedPrecision(Apcomplex z)static Apcomplexerfi(Apcomplex z)Imaginary error function.(package private) static ApcomplexerfiFixedPrecision(Apcomplex z)static ApcomplexeulerE(long n, Apcomplex z)Euler polynomial.(package private) static ApcomplexeulerE(long n, Apcomplex z, long precision)static Apcomplexexp(Apcomplex z)Exponent function.static ApcomplexexpIntegralE(Apcomplex ν, Apcomplex z)Exponential integral E.static ApcomplexexpIntegralEi(Apcomplex z)Exponential integral Ei.private static ApcomplexexpNoLoP(Apcomplex z)static Apcomplexfibonacci(Apcomplex ν, Apcomplex z)Fibonacci function.static ApcomplexfresnelC(Apcomplex z)Fresnel integral C.static ApcomplexfresnelS(Apcomplex z)Fresnel integral S.private static ApcomplexfresnelTerm(Apint one, Apfloat half, Apfloat invSqrtPi, Apcomplex iz2, Apcomplex iHalfPiZ2)static Apcomplexgamma(Apcomplex z)Gamma function.static Apcomplexgamma(Apcomplex a, Apcomplex z)Incomplete gamma function.static Apcomplexgamma(Apcomplex a, Apcomplex z0, Apcomplex z1)Generalized incomplete gamma function.private static ApcomplexgegenbauerC(long n, Apcomplex λ, Apcomplex z)static ApcomplexgegenbauerC(Apcomplex ν, Apcomplex z)Renormalized Gegenbauer function.static ApcomplexgegenbauerC(Apcomplex ν, Apcomplex λ, Apcomplex z)Gegenbauer function.static ApcomplexharmonicNumber(Apcomplex z)Harmonic number.static ApcomplexharmonicNumber(Apcomplex z, Apcomplex r)Generalized harmonic number.static ApcomplexhermiteH(Apcomplex ν, Apcomplex z)Hermite function.static Apcomplexhypergeometric0F1(Apcomplex a, Apcomplex z)Confluent hypergeometric function 0F1.static Apcomplexhypergeometric0F1Regularized(Apcomplex a, Apcomplex z)Regularized confluent hypergeometric function 0F̃1.static Apcomplexhypergeometric1F1(Apcomplex a, Apcomplex b, Apcomplex z)Kummer confluent hypergeometric function 1F1.static Apcomplexhypergeometric1F1Regularized(Apcomplex a, Apcomplex b, Apcomplex z)Regularized Kummer confluent hypergeometric function 1F̃1.static Apcomplexhypergeometric2F1(Apcomplex a, Apcomplex b, Apcomplex c, Apcomplex z)Hypergeometric function 2F1.static Apcomplexhypergeometric2F1Regularized(Apcomplex a, Apcomplex b, Apcomplex c, Apcomplex z)Regularized hypergeometric function 2F̃1.static ApcomplexhypergeometricU(Apcomplex a, Apcomplex b, Apcomplex z)Tricomi's confluent hypergeometric function U.static ApcomplexinverseRoot(Apcomplex z, long n)Inverse positive integer root.static ApcomplexinverseRoot(Apcomplex z, long n, long k)Inverse positive integer root.private static ApcomplexinverseRootAbs(Apcomplex z, long n, long k)(package private) static booleanisNonPositiveInteger(Apcomplex z)private static ApcomplexjacobiP(long n, Apcomplex a, Apcomplex b, Apcomplex z)static ApcomplexjacobiP(Apcomplex ν, Apcomplex a, Apcomplex b, Apcomplex z)Jacobi function.static ApcomplexlaguerreL(Apcomplex ν, Apcomplex z)Laguerre function.static ApcomplexlaguerreL(Apcomplex ν, Apcomplex λ, Apcomplex z)Generalized Laguerre function.private static ApcomplexlastIterationExtendPrecision(int iterations, int precisingIteration, Apcomplex z)static ApcomplexlegendreP(Apcomplex ν, Apcomplex z)Legendre function.static ApcomplexlegendreP(Apcomplex ν, Apcomplex μ, Apcomplex z)Associated Legendre function of the first kind.static ApcomplexlegendreQ(Apcomplex ν, Apcomplex z)Legendre function of the second kind.static ApcomplexlegendreQ(Apcomplex ν, Apcomplex μ, Apcomplex z)Associated Legendre function of the second kind.private static ApcomplexlimitPrecision(Apcomplex z)static Apcomplexlog(Apcomplex z)Natural logarithm.static Apcomplexlog(Apcomplex z, Apcomplex w)Logarithm in arbitrary base.static ApcomplexlogGamma(Apcomplex z)Logarithm of the gamma function.static ApcomplexlogIntegral(Apcomplex z)Logarithmic integral.static ApcomplexlogisticSigmoid(Apcomplex z)Logistic sigmoid.private static ApcomplexlogPochhammer(Apcomplex z, long n)private static ApcomplexlogSin(Apcomplex z)static Apcomplexnegate(Apcomplex z)Deprecated.UseApcomplex.negate().static Apfloatnorm(Apcomplex z)Norm.(package private) static Apcomplexpochhammer(Apcomplex z, long n)static Apcomplexpochhammer(Apcomplex z, Apcomplex n)Pochhammer symbol.static Apcomplexpolygamma(long n, Apcomplex z)Polygamma function.static Apcomplexpolylog(Apcomplex ν, Apcomplex z)Polylogarithm.static Apcomplexpow(Apcomplex z, long n)Integer power.static Apcomplexpow(Apcomplex z, Apcomplex w)Arbitrary power.private static ApcomplexpowAbs(Apcomplex z, long n)static Apcomplexproduct(Apcomplex... z)Product of numbers.private static ApcomplexrawLog(Apcomplex z)private static ApcomplexrightSqrt(Apcomplex z, Apcomplex reference)static Apcomplexroot(Apcomplex z, long n)Positive integer root.static Apcomplexroot(Apcomplex z, long n, long k)Positive integer root.static Apcomplexscale(Apcomplex z, long scale)Multiply by a power of the radix.static Apcomplexsin(Apcomplex z)Sine.static Apcomplexsinc(Apcomplex z)Sinc.static Apcomplexsinh(Apcomplex z)Hyperbolic sine.static ApcomplexsinhIntegral(Apcomplex z)Hyperbolic sine integral.static ApcomplexsinIntegral(Apcomplex z)Sine integral.static ApcomplexsphericalHarmonicY(Apcomplex λ, Apcomplex μ, Apcomplex ϑ, Apcomplex ϕ)Spherical harmonic function.private static ApcomplexsphericalHarmonicY(Apint n, Apint m, Apcomplex ϑ, Apcomplex ϕ)static Apcomplexsqrt(Apcomplex z)Square root.static Apcomplexsum(Apcomplex... z)Sum of numbers.static Apcomplextan(Apcomplex z)Tangent.(package private) static Apcomplextan(Apcomplex z, boolean negate)(package private) static ApcomplextanFixedPrecision(Apcomplex z)static Apcomplextanh(Apcomplex z)Hyperbolic tangent.private static Apcomplextanh(Apcomplex z, boolean negate)(package private) static ApcomplextanhFixedPrecision(Apcomplex z)static Apfloatulp(Apcomplex z)Returns the unit in the last place of the argument, considering the scale and precision.static Apcomplexw(Apcomplex z)Lambert W function.static Apcomplexw(Apcomplex z, long k)Lambert W function for the specified branch.static Apcomplexzeta(Apcomplex s)Riemann zeta function.static Apcomplexzeta(Apcomplex s, Apcomplex a)Hurwitz zeta function.
-
-
-
Method Detail
-
negate
@Deprecated public static Apcomplex negate(Apcomplex z) throws ApfloatRuntimeException
Deprecated.UseApcomplex.negate().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), wherez = 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, wherez = x + i y.- Throws:
ApfloatRuntimeException
-
arg
public static Apfloat arg(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Angle of the complex vector in the complex plane.- Parameters:
z- The argument.- Returns:
arctan(y / x)from the appropriate branch, wherez = x + i y.- Throws:
java.lang.ArithmeticException- Ifzis 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 java.lang.ArithmeticException, ApfloatRuntimeException
Integer power.- Parameters:
z- Base of the power operator.n- Exponent of the power operator.- Returns:
zto then:th power, that iszn.- Throws:
java.lang.ArithmeticException- If bothzandnare zero.ApfloatRuntimeException
-
powAbs
private static Apcomplex powAbs(Apcomplex z, long n) throws java.lang.ArithmeticException, ApfloatRuntimeException
- Throws:
java.lang.ArithmeticExceptionApfloatRuntimeException
-
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 java.lang.ArithmeticException, ApfloatRuntimeException
Positive integer root. The branch that has the smallest angle and same sign of imaginary part aszis always chosen.- Parameters:
z- The argument.n- Which root to take.- Returns:
n:th root ofz, that isz1/n.- Throws:
java.lang.ArithmeticException- Ifnis zero.ApfloatRuntimeException
-
root
public static Apcomplex root(Apcomplex z, long n, long k) throws java.lang.ArithmeticException, ApfloatRuntimeException
Positive integer root. The specified branch counting from the smallest angle and same sign of imaginary part aszis chosen.- Parameters:
z- The argument.n- Which root to take.k- Which branch to take.- Returns:
n:th root ofz, that isz1/nei2πsk/nwheresis the signum of the imaginary part ofz.- Throws:
java.lang.ArithmeticException- Ifnis zero.ApfloatRuntimeException- Since:
- 1.5
-
inverseRoot
public static Apcomplex inverseRoot(Apcomplex z, long n) throws java.lang.ArithmeticException, ApfloatRuntimeException
Inverse positive integer root. The branch that has the smallest angle and different sign of imaginary part thanzis always chosen.- Parameters:
z- The argument.n- Which inverse root to take.- Returns:
- Inverse
n:th root ofz, that isz-1/n. - Throws:
java.lang.ArithmeticException- Ifzornis zero.ApfloatRuntimeException
-
inverseRoot
public static Apcomplex inverseRoot(Apcomplex z, long n, long k) throws java.lang.ArithmeticException, ApfloatRuntimeException
Inverse positive integer root. The specified branch counting from the smallest angle and different sign of imaginary part thanzis chosen.- Parameters:
z- The argument.n- Which inverse root to take.k- Which branch to take.- Returns:
- Inverse
n:th root ofz, that isz-1/ne-i2πk/n. - Throws:
java.lang.ArithmeticException- Ifzornis zero.ApfloatRuntimeException
-
inverseRootAbs
private static Apcomplex inverseRootAbs(Apcomplex z, long n, long k) throws java.lang.ArithmeticException, ApfloatRuntimeException
- Throws:
java.lang.ArithmeticExceptionApfloatRuntimeException
-
allRoots
public static Apcomplex[] allRoots(Apcomplex z, int n) throws java.lang.ArithmeticException, ApfloatRuntimeException
All values of the positive integer root.Returns all of the
nvalues of the root, in the order of the angle, starting from the smallest angle and same sign of imaginary part asz.- Parameters:
z- The argument.n- Which root to take.- Returns:
- All values of the
n:th root ofz, that isz1/n, in the order of the angle. - Throws:
java.lang.ArithmeticException- Ifnis 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
aandb. - Throws:
ApfloatRuntimeException
-
agm
static Apcomplex agm(Apcomplex a, Apcomplex b, java.util.function.Consumer<Apcomplex> consumer) throws ApfloatRuntimeException
- Throws:
ApfloatRuntimeException
-
agmConsume
private static Apcomplex agmConsume(java.util.function.Consumer<Apcomplex> consumer, Apcomplex a, Apcomplex c2, long workingPrecision)
-
log
public static Apcomplex log(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
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:
java.lang.ArithmeticException- Ifzis zero.ApfloatRuntimeException
-
log
public static Apcomplex log(Apcomplex z, Apcomplex w) throws java.lang.ArithmeticException, ApfloatRuntimeException
Logarithm in arbitrary base.- Parameters:
z- The argument.w- The base.- Returns:
- Base-
wlogarithm ofz. - Throws:
java.lang.ArithmeticException- Ifzorwis zero.ApfloatRuntimeException- Since:
- 1.6
-
rawLog
private static Apcomplex rawLog(Apcomplex z) throws ApfloatRuntimeException
- Throws:
ApfloatRuntimeException
-
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 usinglog()andexp().- Parameters:
z- The base.w- The exponent.- Returns:
zw.- Throws:
java.lang.ArithmeticException- If bothzandware zero.ApfloatRuntimeException
-
acos
public static Apcomplex acos(Apcomplex z) throws ApfloatRuntimeException
Inverse cosine. Calculated usinglog().- Parameters:
z- The argument.- Returns:
- Inverse cosine of
z. - Throws:
ApfloatRuntimeException
-
acosh
public static Apcomplex acosh(Apcomplex z) throws ApfloatRuntimeException
Inverse hyperbolic cosine. Calculated usinglog().- Parameters:
z- The argument.- Returns:
- Inverse hyperbolic cosine of
z. - Throws:
ApfloatRuntimeException
-
asin
public static Apcomplex asin(Apcomplex z) throws ApfloatRuntimeException
Inverse sine. Calculated usinglog().- Parameters:
z- The argument.- Returns:
- Inverse sine of
z. - Throws:
ApfloatRuntimeException
-
asinh
public static Apcomplex asinh(Apcomplex z) throws ApfloatRuntimeException
Inverse hyperbolic sine. Calculated usinglog().- Parameters:
z- The argument.- Returns:
- Inverse hyperbolic sine of
z. - Throws:
ApfloatRuntimeException
-
atan
public static Apcomplex atan(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Inverse tangent. Calculated usinglog().- Parameters:
z- The argument.- Returns:
- Inverse tangent of
z. - Throws:
java.lang.ArithmeticException- Ifz == i.ApfloatRuntimeException
-
atanh
public static Apcomplex atanh(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Inverse hyperbolic tangent. Calculated usinglog().- Parameters:
z- The argument.- Returns:
- Inverse hyperbolic tangent of
z. - Throws:
java.lang.ArithmeticException- Ifzis 1 or -1.ApfloatRuntimeException
-
cos
public static Apcomplex cos(Apcomplex z) throws ApfloatRuntimeException
Cosine. Calculated usingexp().- Parameters:
z- The argument.- Returns:
- Cosine of
z. - Throws:
ApfloatRuntimeException
-
cosh
public static Apcomplex cosh(Apcomplex z) throws ApfloatRuntimeException
Hyperbolic cosine. Calculated usingexp().- Parameters:
z- The argument.- Returns:
- Hyperbolic cosine of
z. - Throws:
ApfloatRuntimeException
-
sin
public static Apcomplex sin(Apcomplex z) throws ApfloatRuntimeException
Sine. Calculated usingexp().- Parameters:
z- The argument.- Returns:
- Sine of
z. - Throws:
ApfloatRuntimeException
-
sinh
public static Apcomplex sinh(Apcomplex z) throws ApfloatRuntimeException
Hyperbolic sine. Calculated usingexp().- Parameters:
z- The argument.- Returns:
- Hyperbolic sine of
z. - Throws:
ApfloatRuntimeException
-
tan
public static Apcomplex tan(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Tangent. Calculated usingexp().- Parameters:
z- The argument.- Returns:
- Tangent of
z. - Throws:
java.lang.ArithmeticException- Ifzis π/2 + n π where n is an integer.ApfloatRuntimeException
-
tanFixedPrecision
static Apcomplex tanFixedPrecision(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
- Throws:
java.lang.ArithmeticExceptionApfloatRuntimeException
-
tan
static Apcomplex tan(Apcomplex z, boolean negate) throws java.lang.ArithmeticException, ApfloatRuntimeException
- Throws:
java.lang.ArithmeticExceptionApfloatRuntimeException
-
tanh
public static Apcomplex tanh(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Hyperbolic tangent. Calculated usingexp().- Parameters:
z- The argument.- Returns:
- Hyperbolic tangent of
z. - Throws:
java.lang.ArithmeticException- Ifzis i (π/2 + n π) where n is an integer.ApfloatRuntimeException
-
tanhFixedPrecision
static Apcomplex tanhFixedPrecision(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
- Throws:
java.lang.ArithmeticExceptionApfloatRuntimeException
-
tanh
private static Apcomplex tanh(Apcomplex z, boolean negate) throws java.lang.ArithmeticException, ApfloatRuntimeException
- Throws:
java.lang.ArithmeticExceptionApfloatRuntimeException
-
cot
static Apcomplex cot(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
- Throws:
java.lang.ArithmeticExceptionApfloatRuntimeException
-
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 equationW 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 java.lang.ArithmeticException, ApfloatRuntimeException
Lambert W function for the specified branch.- Parameters:
z- The argument.k- The branch.- Returns:
Wk(z).- Throws:
java.lang.ArithmeticException- Ifzis zero andkis not zero.ApfloatRuntimeException- Since:
- 1.8.0
- See Also:
w(Apcomplex)
-
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
public static Apcomplex gamma(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Gamma function.- Parameters:
z- The argument.- Returns:
Γ(z)- Throws:
java.lang.ArithmeticException- Ifzis a nonpositive integer.ApfloatRuntimeException- Since:
- 1.9.0
-
gamma
public static Apcomplex gamma(Apcomplex a, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Incomplete gamma function.- Parameters:
a- The first argument.z- The second argument.- Returns:
Γ(a, z)- Throws:
java.lang.ArithmeticException- If the real part ofais nonpositive andzis zero.ApfloatRuntimeException- Since:
- 1.10.0
-
gamma
public static Apcomplex gamma(Apcomplex a, Apcomplex z0, Apcomplex z1) throws java.lang.ArithmeticException, ApfloatRuntimeException
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:
java.lang.ArithmeticException- If the real part ofais nonpositive and eitherz0orz1is zero. For the lower gamma function ifais a nonpositive integer.ApfloatRuntimeException- Since:
- 1.10.0
-
logGamma
public static Apcomplex logGamma(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Logarithm of the gamma function. Note that this function has a different branch structure thanlog(gamma(z)).- Parameters:
z- The argument.- Returns:
logΓ(z)- Throws:
java.lang.ArithmeticException- Ifzis a nonpositive integer.ApfloatRuntimeException- Since:
- 1.11.0
-
digamma
public static Apcomplex digamma(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Digamma function.- Parameters:
z- The argument.- Returns:
ψ(z)- Throws:
java.lang.ArithmeticException- Ifzis a nonpositive integer.ApfloatRuntimeException- Since:
- 1.11.0
-
polygamma
public static Apcomplex polygamma(long n, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Polygamma function.- Parameters:
n- The order.z- The argument.- Returns:
ψ(n)(z)- Throws:
java.lang.ArithmeticException- Ifnis negative orzis a nonpositive integer.ApfloatRuntimeException- Since:
- 1.13.0
-
beta
public static Apcomplex beta(Apcomplex a, Apcomplex b) throws java.lang.ArithmeticException, ApfloatRuntimeException
Beta function.- Parameters:
a- The first argument.b- The second argument.- Returns:
- B(a, b)
- Throws:
java.lang.ArithmeticException- Ifaorbis a nonpositive integer buta + bis not. Also if bothaandbare nonpositive integers.ApfloatRuntimeException- Since:
- 1.13.0
-
beta
public static Apcomplex beta(Apcomplex z, Apcomplex a, Apcomplex b) throws java.lang.ArithmeticException, ApfloatRuntimeException
Incomplete beta function.- Parameters:
z- The first argument.a- The second argument.b- The third argument.- Returns:
- Bz(a, b)
- Throws:
java.lang.ArithmeticException- Ifais a nonpositive integer orzis zero andahas nonpositive real part.ApfloatRuntimeException- Since:
- 1.13.0
-
beta
public static Apcomplex beta(Apcomplex z1, Apcomplex z2, Apcomplex a, Apcomplex b) throws java.lang.ArithmeticException, ApfloatRuntimeException
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:
java.lang.ArithmeticException- Ifais a nonpositive integer orz1orz2is zero andahas nonpositive real part.ApfloatRuntimeException- Since:
- 1.13.0
-
pochhammer
public static Apcomplex pochhammer(Apcomplex z, Apcomplex n) throws java.lang.ArithmeticException, ApfloatRuntimeException
Pochhammer symbol.- Parameters:
z- The first argument.n- The second argument.- Returns:
(z)n- Throws:
java.lang.ArithmeticException- Ifz + nis a nonpositive integer butzis not.ApfloatRuntimeException- Since:
- 1.13.0
-
binomial
public static Apcomplex binomial(Apcomplex n, Apcomplex k) throws java.lang.ArithmeticException, ApfloatRuntimeException
Binomial coefficient. Calculated using thegamma(Apcomplex)function.- Parameters:
n- The first argument.k- The second argument.- Returns:
- Throws:
java.lang.ArithmeticException- Ifnis a negative integer andkis noninteger.ApfloatRuntimeException- Since:
- 1.11.0
-
zeta
public static Apcomplex zeta(Apcomplex s) throws java.lang.ArithmeticException, ApfloatRuntimeException
Riemann zeta function.- Parameters:
s- The argument.- Returns:
ζ(s)- Throws:
java.lang.ArithmeticException- Ifsis1.ApfloatRuntimeException- Since:
- 1.11.0
-
zeta
public static Apcomplex zeta(Apcomplex s, Apcomplex a) throws java.lang.ArithmeticException, ApfloatRuntimeException
Hurwitz zeta function.- Parameters:
s- The first argument.a- The second argument.- Returns:
ζ(s, a)- Throws:
java.lang.ArithmeticException- Ifsis1or ifais a nonpositive integer.ApfloatRuntimeException- Since:
- 1.11.0
-
hypergeometric0F1
public static Apcomplex hypergeometric0F1(Apcomplex a, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Confluent hypergeometric function 0F1.- Parameters:
a- The first argument.z- The second argument.- Returns:
- 0F1(; a; z)
- Throws:
java.lang.ArithmeticException- If the function value is not finite.ApfloatRuntimeException- Since:
- 1.11.0
-
hypergeometric0F1Regularized
public static Apcomplex hypergeometric0F1Regularized(Apcomplex a, Apcomplex z) throws ApfloatRuntimeException
Regularized confluent hypergeometric function 0F̃1.- Parameters:
a- The first argument.z- The second argument.- Returns:
- 0F̃1(; a; z)
- Throws:
ApfloatRuntimeException- Since:
- 1.13.0
-
hypergeometric1F1
public static Apcomplex hypergeometric1F1(Apcomplex a, Apcomplex b, Apcomplex z) throws java.lang.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:
java.lang.ArithmeticException- If the function value is not finite.ApfloatRuntimeException- Since:
- 1.11.0
-
hypergeometric1F1Regularized
public static Apcomplex hypergeometric1F1Regularized(Apcomplex a, Apcomplex b, Apcomplex z) throws ApfloatRuntimeException
Regularized Kummer confluent hypergeometric function 1F̃1. 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:
- 1F̃1(a; b; z)
- Throws:
ApfloatRuntimeException- Since:
- 1.13.0
-
hypergeometric2F1
public static Apcomplex hypergeometric2F1(Apcomplex a, Apcomplex b, Apcomplex c, Apcomplex z) throws java.lang.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:
java.lang.ArithmeticException- If the function value is not finite.ApfloatRuntimeException- Since:
- 1.11.0
-
hypergeometric2F1Regularized
public static Apcomplex hypergeometric2F1Regularized(Apcomplex a, Apcomplex b, Apcomplex c, Apcomplex z) throws ApfloatRuntimeException
Regularized hypergeometric function 2F̃1. 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:
- 2F̃1(a, b; c; z)
- Throws:
ApfloatRuntimeException- Since:
- 1.13.0
-
hypergeometricU
public static Apcomplex hypergeometricU(Apcomplex a, Apcomplex b, Apcomplex z) throws java.lang.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:
java.lang.ArithmeticException- If the result is not finite.ApfloatRuntimeException- Since:
- 1.13.0
-
erf
public static Apcomplex erf(Apcomplex z) throws ApfloatRuntimeException
Error function.- Parameters:
z- The argument.- Returns:
- erf(z)
- Throws:
ApfloatRuntimeException- Since:
- 1.13.0
-
erfFixedPrecision
static Apcomplex erfFixedPrecision(Apcomplex z) throws ApfloatRuntimeException
- Throws:
ApfloatRuntimeException
-
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
-
erfcFixedPrecision
static Apcomplex erfcFixedPrecision(Apcomplex z) throws ApfloatRuntimeException
- Throws:
ApfloatRuntimeException
-
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
-
erfiFixedPrecision
static Apcomplex erfiFixedPrecision(Apcomplex z) throws ApfloatRuntimeException
- Throws:
ApfloatRuntimeException
-
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
-
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
-
fresnelTerm
private static Apcomplex fresnelTerm(Apint one, Apfloat half, Apfloat invSqrtPi, Apcomplex iz2, Apcomplex iHalfPiZ2) throws ApfloatRuntimeException
- Throws:
ApfloatRuntimeException
-
expIntegralE
public static Apcomplex expIntegralE(Apcomplex ν, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Exponential integral E.- Parameters:
\u03bd- The first argument.z- The second argument.- Returns:
- Eν(z)
- Throws:
java.lang.ArithmeticException- If real part ofνis ≤ 1 andzis zero.ApfloatRuntimeException- Since:
- 1.13.0
-
expIntegralEi
public static Apcomplex expIntegralEi(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Exponential integral Ei.- Parameters:
z- The argument.- Returns:
- Ei(z)
- Throws:
java.lang.ArithmeticException- Ifzis zero.ApfloatRuntimeException- Since:
- 1.13.0
-
logIntegral
public static Apcomplex logIntegral(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Logarithmic integral.- Parameters:
z- The argument.- Returns:
- li(z)
- Throws:
java.lang.ArithmeticException- Ifzis zero.ApfloatRuntimeException- Since:
- 1.13.0
-
sinIntegral
public static Apcomplex sinIntegral(Apcomplex z) throws ApfloatRuntimeException
Sine integral.- Parameters:
z- The argument.- Returns:
- Si(z)
- Throws:
ApfloatRuntimeException- Since:
- 1.13.0
-
cosIntegral
public static Apcomplex cosIntegral(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Cosine integral.- Parameters:
z- The argument.- Returns:
- Ci(z)
- Throws:
java.lang.ArithmeticException- Ifzis zero.ApfloatRuntimeException- Since:
- 1.13.0
-
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
-
coshIntegral
public static Apcomplex coshIntegral(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Hyperbolic cosine integral.- Parameters:
z- The argument.- Returns:
- Chi(z)
- Throws:
java.lang.ArithmeticException- Ifzis zero.ApfloatRuntimeException- Since:
- 1.13.0
-
airyAi
public static Apcomplex airyAi(Apcomplex z) throws ApfloatRuntimeException
Airy function Ai.- Parameters:
z- The argument.- Returns:
- Ai(z)
- Throws:
InfiniteExpansionException- Ifzis zero.ApfloatRuntimeException- Since:
- 1.13.0
-
airyAi
static Apcomplex airyAi(Apcomplex z0, long targetPrecision) throws ApfloatRuntimeException
- Throws:
ApfloatRuntimeException
-
airyAiPrime
public static Apcomplex airyAiPrime(Apcomplex z) throws ApfloatRuntimeException
Derivative of the Airy function Ai.- Parameters:
z- The argument.- Returns:
- Ai′(z)
- Throws:
InfiniteExpansionException- Ifzis zero.ApfloatRuntimeException- Since:
- 1.13.0
-
airyAiPrime
static Apcomplex airyAiPrime(Apcomplex z0, long targetPrecision) throws ApfloatRuntimeException
- Throws:
ApfloatRuntimeException
-
airyBi
public static Apcomplex airyBi(Apcomplex z) throws ApfloatRuntimeException
Airy function Bi.- Parameters:
z- The argument.- Returns:
- Bi(z)
- Throws:
InfiniteExpansionException- Ifzis zero.ApfloatRuntimeException- Since:
- 1.13.0
-
airyBi
static Apcomplex airyBi(Apcomplex z0, long targetPrecision) throws ApfloatRuntimeException
- Throws:
ApfloatRuntimeException
-
airyBiPrime
public static Apcomplex airyBiPrime(Apcomplex z) throws ApfloatRuntimeException
Derivative of the Airy function Bi.- Parameters:
z- The argument.- Returns:
- Bi′(z)
- Throws:
InfiniteExpansionException- Ifzis zero.ApfloatRuntimeException- Since:
- 1.13.0
-
airyBiPrime
static Apcomplex airyBiPrime(Apcomplex z0, long targetPrecision) throws ApfloatRuntimeException
- Throws:
ApfloatRuntimeException
-
airy
private static Apcomplex airy(java.util.function.Function<java.lang.Long,Apcomplex> f, long targetPrecision, int radix)
-
besselJ
public static Apcomplex besselJ(Apcomplex ν, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Bessel function of the first kind.- Parameters:
\u03bd- The order.z- The argument.- Returns:
- Jν(z)
- Throws:
java.lang.ArithmeticException- If the real part ofνis < 0 andνis not an integer andzis zero. Also if the real part ofνis zero but the imaginary part is not, andzis zero.ApfloatRuntimeException- Since:
- 1.13.0
-
besselI
public static Apcomplex besselI(Apcomplex ν, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Modified Bessel function of the first kind.- Parameters:
\u03bd- The order.z- The argument.- Returns:
- Iν(z)
- Throws:
java.lang.ArithmeticException- If the real part ofνis < 0 andνis not an integer andzis zero. Also if the real part ofνis zero but the imaginary part is not, andzis zero.ApfloatRuntimeException- Since:
- 1.13.0
-
besselY
public static Apcomplex besselY(Apcomplex ν, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Bessel function of the second kind.- Parameters:
\u03bd- The order.z- The argument.- Returns:
- Yν(z)
- Throws:
java.lang.ArithmeticException- Ifzis zero.ApfloatRuntimeException- Since:
- 1.13.0
-
besselK
public static Apcomplex besselK(Apcomplex ν, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Modified Bessel function of the second kind.- Parameters:
\u03bd- The order.z- The argument.- Returns:
- Kν(z)
- Throws:
java.lang.ArithmeticException- Ifzis zero.ApfloatRuntimeException- Since:
- 1.13.0
-
ellipticK
public static Apcomplex ellipticK(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Complete elliptic integral of the first kind.Note that this function uses the definition:
- Parameters:
z- The argument.- Returns:
- K(z)
- Throws:
InfiniteExpansionException- Ifzis zero.java.lang.ArithmeticException- Ifzis one.ApfloatRuntimeException- Since:
- 1.13.0
-
ellipticK
static Apcomplex ellipticK(Apcomplex z, long precision) throws java.lang.ArithmeticException, ApfloatRuntimeException
- Throws:
java.lang.ArithmeticExceptionApfloatRuntimeException
-
ellipticK
static Apcomplex ellipticK(Apcomplex z, long precision, java.util.function.Consumer<Apcomplex> consumer) throws java.lang.ArithmeticException, ApfloatRuntimeException
- Throws:
java.lang.ArithmeticExceptionApfloatRuntimeException
-
ellipticE
public static Apcomplex ellipticE(Apcomplex z) throws ApfloatRuntimeException
Complete elliptic integral of the second kind.Note that this function uses the definition:
- Parameters:
z- The argument.- Returns:
- E(z)
- Throws:
InfiniteExpansionException- Ifzis zero.ApfloatRuntimeException- Since:
- 1.13.0
-
ellipticE
static Apcomplex ellipticE(Apcomplex z, long precision) throws ApfloatRuntimeException
- Throws:
ApfloatRuntimeException
-
hermiteH
public static Apcomplex hermiteH(Apcomplex ν, Apcomplex z) throws ApfloatRuntimeException
Hermite function. For integer values ofνgives the Hermite polynomial.- Parameters:
\u03bd- The first argument.z- The second argument.- Returns:
- Hν(z)
- Throws:
ApfloatRuntimeException- Since:
- 1.14.0
-
laguerreL
public static Apcomplex laguerreL(Apcomplex ν, Apcomplex z) throws ApfloatRuntimeException
Laguerre function. For integer values ofνgives the Laguerre polynomial.- Parameters:
\u03bd- The first argument.z- The second argument.- Returns:
- Lν(z)
- Throws:
ApfloatRuntimeException- Since:
- 1.14.0
-
laguerreL
public static Apcomplex laguerreL(Apcomplex ν, Apcomplex λ, Apcomplex z) throws ApfloatRuntimeException
Generalized Laguerre function. For integer values ofνgives the generalized Laguerre polynomial.- Parameters:
\u03bd- The first argument.\u03bb- The second argument.z- The third argument.- Returns:
- Lνλ(z)
- Throws:
ApfloatRuntimeException- Since:
- 1.14.0
-
legendreP
public static Apcomplex legendreP(Apcomplex ν, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Legendre function. For integer values ofνgives the Legendre polynomial.- Parameters:
\u03bd- The first argument.z- The second argument.- Returns:
- Pν(z)
- Throws:
java.lang.ArithmeticException- Ifνis not an integer andzis -1.ApfloatRuntimeException- Since:
- 1.14.0
-
legendreP
public static Apcomplex legendreP(Apcomplex ν, Apcomplex μ, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Associated Legendre function of the first kind. Gives Legendre functions of type 2.- Parameters:
\u03bd- The first argument.\u03bc- The second argument.z- The third argument.- Returns:
- Pνμ(z)
- Throws:
java.lang.ArithmeticException- Ifνis not an integer andzis -1.ApfloatRuntimeException- Since:
- 1.14.0
-
legendreQ
public static Apcomplex legendreQ(Apcomplex ν, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Legendre function of the second kind.- Parameters:
\u03bd- The first argument.z- The second argument.- Returns:
- Qν(z)
- Throws:
java.lang.ArithmeticException- Ifzis 1 or -1.ApfloatRuntimeException- Since:
- 1.14.0
-
legendreQ
public static Apcomplex legendreQ(Apcomplex ν, Apcomplex μ, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Associated Legendre function of the second kind. Gives Legendre functions of type 2.- Parameters:
\u03bd- The first argument.\u03bc- The second argument.z- The third argument.- Returns:
- Qνμ(z)
- Throws:
java.lang.ArithmeticException- Ifzis 1 or -1.ApfloatRuntimeException- Since:
- 1.14.0
-
sphericalHarmonicY
public static Apcomplex sphericalHarmonicY(Apcomplex λ, Apcomplex μ, Apcomplex ϑ, Apcomplex ϕ) throws java.lang.ArithmeticException, ApfloatRuntimeException
Spherical harmonic function.- Parameters:
\u03bb- The first argument.\u03bc- The second argument.\u03d1- The third argument.\u03d5- The fourth argument.- Returns:
- Yλμ(ϑ, φ)
- Throws:
java.lang.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
-
sphericalHarmonicY
private static Apcomplex sphericalHarmonicY(Apint n, Apint m, Apcomplex ϑ, Apcomplex ϕ) throws java.lang.ArithmeticException, ApfloatRuntimeException
- Throws:
java.lang.ArithmeticExceptionApfloatRuntimeException
-
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:
\u03bd- 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 java.lang.ArithmeticException, ApfloatRuntimeException
Chebyshev function of the second kind. For integer values ofνgives the Chebyshev polynomial of the second kind.- Parameters:
\u03bd- The first argument.z- The second argument.- Returns:
- Uν(z)
- Throws:
java.lang.ArithmeticException- Ifzis -1 andνis not an integer.ApfloatRuntimeException- Since:
- 1.14.0
-
gegenbauerC
public static Apcomplex gegenbauerC(Apcomplex ν, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Renormalized Gegenbauer function.- Parameters:
\u03bd- The first argument.z- The second argument.- Returns:
- Cν(0)(z)
- Throws:
java.lang.ArithmeticException- Ifνis zero.ApfloatRuntimeException- Since:
- 1.14.0
-
gegenbauerC
public static Apcomplex gegenbauerC(Apcomplex ν, Apcomplex λ, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Gegenbauer function. For nonnegative integer values ofνgives the Gegenbauer polynomial.- Parameters:
\u03bd- The first argument.\u03bb- The second argument.z- The third argument.- Returns:
- Cνλ(z)
- Throws:
java.lang.ArithmeticException- Ifzis -1 and real part ofλis > 1/2. Also ifzis -1 andλis 1/2 andνis not an integer.ApfloatRuntimeException- Since:
- 1.14.0
-
gegenbauerC
private static Apcomplex gegenbauerC(long n, Apcomplex λ, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
- Throws:
java.lang.ArithmeticExceptionApfloatRuntimeException
-
jacobiP
public static Apcomplex jacobiP(Apcomplex ν, Apcomplex a, Apcomplex b, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Jacobi function. For nonnegative integer values ofνgives the Jacobi polynomial.- Parameters:
\u03bd- The first argument.a- The second argument.b- The third argument.z- The fourth argument.- Returns:
- Pν(a,b)(z)
- Throws:
java.lang.ArithmeticException- Ifzis -1 and real part ofbis > 0 andνis not a positive integer. Also ifν + ais a negative integer andνis not an integer.ApfloatRuntimeException- Since:
- 1.14.0
-
jacobiP
private static Apcomplex jacobiP(long n, Apcomplex a, Apcomplex b, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
- Throws:
java.lang.ArithmeticExceptionApfloatRuntimeException
-
fibonacci
public static Apcomplex fibonacci(Apcomplex ν, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Fibonacci function. For nonnegative integer values ofνgives the Fibonacci polynomial.- Parameters:
\u03bd- The first argument.z- The second argument.- Returns:
- Fν(z)
- Throws:
java.lang.ArithmeticException- Ifzis -1 andνis not an integer.ApfloatRuntimeException- Since:
- 1.14.0
-
eulerE
public static Apcomplex eulerE(long n, Apcomplex z) throws java.lang.IllegalArgumentException, ApfloatRuntimeException
Euler polynomial.- Parameters:
n- The first argument.z- The second argument.- Returns:
- En(z)
- Throws:
java.lang.IllegalArgumentException- Ifn< 0.ApfloatRuntimeException- Since:
- 1.14.0
-
eulerE
static Apcomplex eulerE(long n, Apcomplex z, long precision) throws java.lang.IllegalArgumentException, ApfloatRuntimeException
- Throws:
java.lang.IllegalArgumentExceptionApfloatRuntimeException
-
bernoulliB
public static Apcomplex bernoulliB(long n, Apcomplex z) throws java.lang.IllegalArgumentException, ApfloatRuntimeException
Bernoulli polynomial.- Parameters:
n- The first argument.z- The second argument.- Returns:
- Bn(z)
- Throws:
java.lang.IllegalArgumentException- Ifn< 0.ApfloatRuntimeException- Since:
- 1.14.0
-
bernoulliB
static Apcomplex bernoulliB(long n, Apcomplex z, long precision) throws java.lang.IllegalArgumentException, ApfloatRuntimeException
- Throws:
java.lang.IllegalArgumentExceptionApfloatRuntimeException
-
harmonicNumber
public static Apcomplex harmonicNumber(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Harmonic number.- Parameters:
z- The argument.- Returns:
- Hz
- Throws:
java.lang.ArithmeticException- Ifzis a negative integer.ApfloatRuntimeException- Since:
- 1.14.0
-
harmonicNumber
public static Apcomplex harmonicNumber(Apcomplex z, Apcomplex r) throws java.lang.ArithmeticException, ApfloatRuntimeException
Generalized harmonic number.- Parameters:
z- The first argument.r- The second argument.- Returns:
- Hz(r)
- Throws:
java.lang.ArithmeticException- Ifzis a negative integer, unlessrhas a negative real part or is zero.ApfloatRuntimeException- Since:
- 1.14.0
-
polylog
public static Apcomplex polylog(Apcomplex ν, Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Polylogarithm.- Parameters:
\u03bd- The first argument.z- The second argument.- Returns:
- Liν(z)
- Throws:
java.lang.ArithmeticException- If the real part ofνis ≤ 1 andzis 1.ApfloatRuntimeException- Since:
- 1.14.0
-
logisticSigmoid
public static Apcomplex logisticSigmoid(Apcomplex z) throws java.lang.ArithmeticException, ApfloatRuntimeException
Logistic sigmoid.- Parameters:
z- The argument.- Returns:
- σ(z)
- Throws:
java.lang.ArithmeticException- Ifzis 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
-
lastIterationExtendPrecision
private static Apcomplex lastIterationExtendPrecision(int iterations, int precisingIteration, Apcomplex z)
-
isNonPositiveInteger
static boolean isNonPositiveInteger(Apcomplex z)
-
-