public class FixedPrecisionApcomplexHelper extends Object
All results of the mathematical operations are set to have the specified precision.
Also all input arguments are set to the specified precision before the operation.
If the specified precision is not infinite, this helper class also avoids
InfiniteExpansionException
e.g. in case where it would happen with
ApcomplexMath.acos(Apcomplex.ZERO)
.
Constructor and Description |
---|
FixedPrecisionApcomplexHelper(long precision)
Constructs an apcomplex fixed-precison helper with the specified precision.
|
Modifier and Type | Method and Description |
---|---|
Apfloat |
abs(Apcomplex z)
Absolute value.
|
Apcomplex |
acos(Apcomplex z)
Arc cosine.
|
Apcomplex |
acosh(Apcomplex z)
Hyperbolic arc cosine.
|
Apcomplex |
add(Apcomplex z,
Apcomplex w)
Addition.
|
Apcomplex |
agm(Apcomplex a,
Apcomplex b)
Arithmetic-geometric mean.
|
Apcomplex[] |
allRoots(Apcomplex z,
int n)
All branches of a root.
|
Apfloat |
arg(Apcomplex z)
Complex angle.
|
Apcomplex |
asin(Apcomplex z)
Arc sine.
|
Apcomplex |
asinh(Apcomplex z)
Hyperbolic arc sine.
|
Apcomplex |
atan(Apcomplex z)
Arc tangent.
|
Apcomplex |
atanh(Apcomplex z)
Hyperbolic arc tangent.
|
Apcomplex |
cbrt(Apcomplex z)
Cube root.
|
Apcomplex |
conj(Apcomplex z)
Complex conjugate.
|
Apcomplex |
cos(Apcomplex z)
Cosine.
|
Apcomplex |
cosh(Apcomplex z)
Hyperbolic cosine.
|
Apcomplex |
divide(Apcomplex z,
Apcomplex w)
Division.
|
Apcomplex |
exp(Apcomplex z)
Exponential function.
|
Apfloat |
imag(Apcomplex z)
Imaginary part.
|
Apcomplex |
inverseRoot(Apcomplex z,
long n)
Inverse root.
|
Apcomplex |
inverseRoot(Apcomplex z,
long n,
long k)
Inverse root with branch.
|
Apcomplex |
log(Apcomplex z)
Natural logarithm.
|
Apcomplex |
log(Apcomplex z,
Apcomplex w)
Logarithm in specified base.
|
Apcomplex |
multiply(Apcomplex z,
Apcomplex w)
Multiplication.
|
Apcomplex |
negate(Apcomplex z)
Negation.
|
Apfloat |
norm(Apcomplex z)
Norm.
|
Apcomplex |
pow(Apcomplex z,
Apcomplex w)
Power.
|
Apcomplex |
pow(Apcomplex z,
long n)
Integer power.
|
long |
precision()
Returns the precision, which is used for the results.
|
Apcomplex |
product(Apcomplex... z)
Product.
|
Apfloat |
real(Apcomplex z)
Real part.
|
Apcomplex |
root(Apcomplex z,
long n)
Root.
|
Apcomplex |
root(Apcomplex z,
long n,
long k)
Root with branch.
|
Apcomplex |
scale(Apcomplex z,
long scale)
Move the radix point.
|
Apcomplex |
sin(Apcomplex z)
Sine.
|
Apcomplex |
sinh(Apcomplex z)
Hyperbolic sine.
|
Apcomplex |
sqrt(Apcomplex z)
Square root.
|
Apcomplex |
subtract(Apcomplex z,
Apcomplex w)
Subtraction.
|
Apcomplex |
sum(Apcomplex... z)
Sum.
|
Apcomplex |
tan(Apcomplex z)
Tangent.
|
Apcomplex |
tanh(Apcomplex z)
Hyperbolic tangent.
|
Apcomplex |
valueOf(Apcomplex z)
Returns the value with the specified precision.
|
Apcomplex |
w(Apcomplex z)
Lambert W function.
|
Apcomplex |
w(Apcomplex z,
long k)
Lambert W function for the specified branch.
|
public FixedPrecisionApcomplexHelper(long precision) throws IllegalArgumentException
precision
- The precision of the results.IllegalArgumentException
- In case the precision is invalid.public Apcomplex valueOf(Apcomplex z) throws ApfloatRuntimeException
z
- The value.ApfloatRuntimeException
public Apcomplex negate(Apcomplex z) throws ApfloatRuntimeException
z
- The value to negate.-z
.ApfloatRuntimeException
public Apcomplex conj(Apcomplex z) throws ApfloatRuntimeException
z
- The operand.x - i y
where z
is x + i y
.ApfloatRuntimeException
public Apcomplex add(Apcomplex z, Apcomplex w) throws ApfloatRuntimeException
z
- The first operand.w
- The second operand.z + w
.ApfloatRuntimeException
public Apcomplex subtract(Apcomplex z, Apcomplex w) throws ApfloatRuntimeException
z
- The first operand.w
- The second operand.z - w
.ApfloatRuntimeException
public Apcomplex multiply(Apcomplex z, Apcomplex w) throws ApfloatRuntimeException
z
- The first operand.w
- The second operand.z * w
.ApfloatRuntimeException
public Apcomplex divide(Apcomplex z, Apcomplex w) throws ArithmeticException, ApfloatRuntimeException
z
- The first operand.w
- The second operand.z / w
.ArithmeticException
- If w
is zero.ApfloatRuntimeException
public Apcomplex pow(Apcomplex z, Apcomplex w) throws ArithmeticException, ApfloatRuntimeException
z
- The first operand.w
- The second operand.zw
.ArithmeticException
- If z
and w
are zero.ApfloatRuntimeException
public Apcomplex pow(Apcomplex z, long n) throws ArithmeticException, ApfloatRuntimeException
z
- The first operand.n
- The first operand.zn
.ArithmeticException
- If z
and n
are zero, or z
is zero and n
is negative.ApfloatRuntimeException
public Apfloat arg(Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
z
- The operand.z
on the complex plane.ArithmeticException
- If z
is zero.ApfloatRuntimeException
public Apfloat imag(Apcomplex z)
z
- The operand.z
.public Apfloat real(Apcomplex z)
z
- The operand.z
.public Apfloat abs(Apcomplex z) throws ApfloatRuntimeException
z
- The operand.z
.ApfloatRuntimeException
public Apfloat norm(Apcomplex z) throws ApfloatRuntimeException
z
- The operand.x2 + y2
where z
is x + i y
.ApfloatRuntimeException
public Apcomplex acos(Apcomplex z) throws ApfloatRuntimeException
z
- The operand.z
.ApfloatRuntimeException
public Apcomplex acosh(Apcomplex z) throws ApfloatRuntimeException
z
- The operand.z
.ApfloatRuntimeException
public Apcomplex asin(Apcomplex z) throws ApfloatRuntimeException
z
- The operand.z
.ApfloatRuntimeException
public Apcomplex asinh(Apcomplex z) throws ApfloatRuntimeException
z
- The operand.z
.ApfloatRuntimeException
public Apcomplex atan(Apcomplex z) throws ApfloatRuntimeException
z
- The operand.z
.ArithmeticException
- If z
is i
.ApfloatRuntimeException
public Apcomplex atanh(Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
z
- The operand.z
.ArithmeticException
- If z
is 1 or -1.ApfloatRuntimeException
public Apcomplex cbrt(Apcomplex z) throws ApfloatRuntimeException
z
- The operand.z
.ApfloatRuntimeException
public Apcomplex cos(Apcomplex z) throws ApfloatRuntimeException
z
- The operand.z
.ApfloatRuntimeException
public Apcomplex cosh(Apcomplex z) throws ApfloatRuntimeException
z
- The operand.z
.ApfloatRuntimeException
public Apcomplex exp(Apcomplex z) throws ApfloatRuntimeException
z
- The operand.ez
.ApfloatRuntimeException
public Apcomplex log(Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
z
- The operand.z
.ArithmeticException
- If z
is zero.ApfloatRuntimeException
public Apcomplex log(Apcomplex z, Apcomplex w) throws ArithmeticException, ApfloatRuntimeException
z
- The operand.w
- The base.w
logarithm of z
.ArithmeticException
- If z
or w
is zero.ApfloatRuntimeException
public Apcomplex sin(Apcomplex z) throws ApfloatRuntimeException
z
- The operand.z
.ApfloatRuntimeException
public Apcomplex sinh(Apcomplex z) throws ApfloatRuntimeException
z
- The operand.z
.ApfloatRuntimeException
public Apcomplex sqrt(Apcomplex z) throws ApfloatRuntimeException
z
- The operand.z
.ApfloatRuntimeException
public Apcomplex tan(Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
z
- The operand.z
.ArithmeticException
- If z
is π/2 + n π where n is an integer.ApfloatRuntimeException
public Apcomplex tanh(Apcomplex z) throws ArithmeticException, ApfloatRuntimeException
z
- The operand.z
.ArithmeticException
- If z
is i (π/2 + n π) where n is an integer.ApfloatRuntimeException
public Apcomplex agm(Apcomplex a, Apcomplex b) throws ApfloatRuntimeException
a
- The first operand.b
- The first operand.a
and b
.ApfloatRuntimeException
public Apcomplex inverseRoot(Apcomplex z, long n) throws ArithmeticException, ApfloatRuntimeException
z
- The operand.n
- Which inverse root to take.z-1/n
.ArithmeticException
- If z
or n
is zero.ApfloatRuntimeException
public Apcomplex inverseRoot(Apcomplex z, long n, long k) throws ArithmeticException, ApfloatRuntimeException
z
- The operand.n
- Which inverse root to take.k
- Which branch to take.z-1/ne-i2πk/n
.ArithmeticException
- If z
or n
is zero.ApfloatRuntimeException
public Apcomplex root(Apcomplex z, long n) throws ArithmeticException, ApfloatRuntimeException
z
- The operand.n
- Which root to take.z1/n
.ArithmeticException
- If n
is zero, or z
is zero and n
is negative.ApfloatRuntimeException
public Apcomplex root(Apcomplex z, long n, long k) throws ArithmeticException, ApfloatRuntimeException
z
- The operand.n
- Which root to take.k
- Which branch to take.z1/nei2πsk/n
where s
is the signum of the imaginary part of z
.ArithmeticException
- If n
is zero, or z
is zero and n
is negative.ApfloatRuntimeException
public Apcomplex[] allRoots(Apcomplex z, int n) throws ArithmeticException, ApfloatRuntimeException
z
- The operand.n
- Which root to take.z1/n
.ArithmeticException
- If n
is zero, or z
is zero and n
is negative.ApfloatRuntimeException
public Apcomplex scale(Apcomplex z, long scale) throws ApfloatRuntimeException
z
- The operand.scale
- The amount to move the radix point.z * z.radix()scale
.ApfloatRuntimeException
public Apcomplex w(Apcomplex z) throws ApfloatRuntimeException
z
- The operand.W0(z)
.ApfloatRuntimeException
public Apcomplex w(Apcomplex z, long k) throws ApfloatRuntimeException
z
- The operand.k
- The branch.Wk(z)
.ApfloatRuntimeException
public Apcomplex product(Apcomplex... z) throws ApfloatRuntimeException
z
- The operand(s).ApfloatRuntimeException
public Apcomplex sum(Apcomplex... z) throws ApfloatRuntimeException
z
- The operand(s).ApfloatRuntimeException
public long precision()
Copyright © 2018. All rights reserved.