public class BigDecimalMath
extends java.lang.Object
Constructor and Description |
---|
BigDecimalMath() |
Modifier and Type | Method and Description |
---|---|
static java.math.BigDecimal |
acosh(java.math.BigDecimal x)
The inverse hyperbolic cosine.
|
static java.math.BigDecimal |
addRound(java.math.BigDecimal x,
java.math.BigDecimal y)
Add and round according to the larger of the two ulp’s.
|
static java.math.BigDecimal |
asin(java.math.BigDecimal x)
The inverse trigonometric sine.
|
static java.math.BigDecimal |
asinh(java.math.BigDecimal x)
The inverse hyperbolic sine.
|
static java.math.BigDecimal |
atan(java.math.BigDecimal x)
The inverse trigonometric tangent.
|
protected static java.math.BigDecimal |
broadhurstBBP(int n,
int p,
int[] a,
java.math.MathContext mc)
Broadhurst ladder sequence.
|
static java.math.BigDecimal |
cbrt(java.math.BigDecimal x)
The cube root.
|
static java.math.BigDecimal |
cos(java.math.BigDecimal x)
Trigonometric cosine.
|
static java.math.BigDecimal |
cosh(java.math.BigDecimal x)
The hyperbolic cosine.
|
static java.math.BigDecimal |
cot(java.math.BigDecimal x)
The trigonometric co-tangent.
|
static java.math.BigDecimal |
divideRound(java.math.BigDecimal x,
java.math.BigDecimal y)
Divide and round.
|
static java.math.BigDecimal |
divideRound(java.math.BigDecimal x,
java.math.BigInteger n)
Divide and round.
|
static java.math.BigDecimal |
divideRound(java.math.BigDecimal x,
int n)
Divide and round.
|
static java.math.BigDecimal |
divideRound(java.math.BigInteger n,
java.math.BigDecimal x)
Divide and round.
|
static java.math.BigDecimal |
divideRound(int n,
java.math.BigDecimal x)
Divide and round.
|
static int |
err2prec(java.math.BigDecimal x,
java.math.BigDecimal xerr)
Convert an absolute error to a precision.
|
static int |
err2prec(double xerr)
Convert a relative error to a precision.
|
static int |
err2prec(double x,
double xerr)
Convert an absolute error to a precision.
|
static java.math.BigDecimal |
exp(java.math.BigDecimal x)
The exponential function.
|
static java.math.BigDecimal |
exp(java.math.MathContext mc)
The base of the natural logarithm.
|
static java.math.BigDecimal |
Gamma(java.math.BigDecimal x)
The Gamma function.
|
static java.math.BigDecimal |
gamma(java.math.MathContext mc)
Euler-Mascheroni constant.
|
static java.math.BigDecimal |
hypot(java.math.BigDecimal x,
java.math.BigDecimal y)
The hypotenuse.
|
static java.math.BigDecimal |
hypot(int n,
java.math.BigDecimal x)
The hypotenuse.
|
static java.math.BigDecimal |
log(java.math.BigDecimal x)
The natural logarithm.
|
static java.math.BigDecimal |
log(int n,
java.math.MathContext mc)
The natural logarithm.
|
static java.math.BigDecimal |
log(org.nd4j.linalg.util.Rational r,
java.math.MathContext mc)
The natural logarithm.
|
static java.math.BigDecimal |
mod2pi(java.math.BigDecimal x)
Reduce value to the interval [0,2*Pi].
|
static java.math.BigDecimal |
modpi(java.math.BigDecimal x)
Reduce value to the interval [-Pi/2,Pi/2].
|
static java.math.BigDecimal |
multiplyRound(java.math.BigDecimal x,
java.math.BigDecimal y)
Multiply and round.
|
static java.math.BigDecimal |
multiplyRound(java.math.BigDecimal x,
java.math.BigInteger n)
Multiply and round.
|
static java.math.BigDecimal |
multiplyRound(java.math.BigDecimal x,
int n)
Multiply and round.
|
static java.math.BigDecimal |
multiplyRound(java.math.BigDecimal x,
org.nd4j.linalg.util.Rational f)
Multiply and round.
|
static java.math.BigDecimal |
pi(java.math.MathContext mc)
Euler’s constant.
|
static java.math.BigDecimal |
pochhammer(java.math.BigDecimal x,
int n)
Pochhammer’s function.
|
static java.math.BigDecimal |
pow(java.math.BigDecimal x,
java.math.BigDecimal y)
Power function.
|
static java.math.BigDecimal |
powRound(java.math.BigDecimal x,
int n)
Raise to an integer power and round.
|
static double |
prec2err(double x,
int prec)
Convert a precision (relative error) to an absolute error.
|
static java.math.BigDecimal |
root(int n,
java.math.BigDecimal x)
The integer root.
|
static java.math.BigDecimal |
scalePrec(java.math.BigDecimal x,
int d)
Append decimal zeros to the value.
|
static java.math.BigDecimal |
scalePrec(java.math.BigDecimal x,
java.math.MathContext mc)
Boost the precision by appending decimal zeros to the value.
|
static java.math.BigDecimal |
sin(java.math.BigDecimal x)
Trigonometric sine.
|
static java.math.BigDecimal |
sinh(java.math.BigDecimal x)
The hyperbolic sine.
|
static java.math.BigDecimal |
sqrt(java.math.BigDecimal x)
The square root.
|
static java.math.BigDecimal |
subtractRound(java.math.BigDecimal x,
java.math.BigDecimal y)
Subtract and round according to the larger of the two ulp’s.
|
static java.math.BigDecimal |
tan(java.math.BigDecimal x)
The trigonometric tangent.
|
static java.math.BigDecimal |
tanh(java.math.BigDecimal x)
The hyperbolic tangent.
|
static java.math.BigDecimal |
zeta(int n,
java.math.MathContext mc)
Riemann zeta function.
|
static double |
zeta1(int n)
Riemann zeta function.
|
public static java.math.BigDecimal pi(java.math.MathContext mc)
mc
- The required precision of the result.public static java.math.BigDecimal gamma(java.math.MathContext mc)
mc
- The required precision of the result.public static java.math.BigDecimal sqrt(java.math.BigDecimal x)
x
- the non-negative argument.public static java.math.BigDecimal cbrt(java.math.BigDecimal x)
x
- The argument.public static java.math.BigDecimal root(int n, java.math.BigDecimal x)
n
- the positive argument.x
- the non-negative argument.public static java.math.BigDecimal hypot(java.math.BigDecimal x, java.math.BigDecimal y)
x
- the first argument.y
- the second argument.public static java.math.BigDecimal hypot(int n, java.math.BigDecimal x)
n
- the first argument.x
- the second argument.public static java.math.BigDecimal exp(java.math.BigDecimal x)
x
- the argument.public static java.math.BigDecimal exp(java.math.MathContext mc)
mc
- the required precision of the resultpublic static java.math.BigDecimal log(java.math.BigDecimal x)
x
- the argument.public static java.math.BigDecimal log(int n, java.math.MathContext mc)
n
- The main argument, a strictly positive integer.mc
- The requirements on the precision.public static java.math.BigDecimal log(org.nd4j.linalg.util.Rational r, java.math.MathContext mc)
r
- The main argument, a strictly positive value.mc
- The requirements on the precision.public static java.math.BigDecimal pow(java.math.BigDecimal x, java.math.BigDecimal y)
x
- Base of the power.y
- Exponent of the power.public static java.math.BigDecimal powRound(java.math.BigDecimal x, int n)
x
- The base.n
- The exponent.public static java.math.BigDecimal sin(java.math.BigDecimal x)
x
- The argument in radians.public static java.math.BigDecimal cos(java.math.BigDecimal x)
x
- The argument in radians.public static java.math.BigDecimal tan(java.math.BigDecimal x)
x
- the argument in radians.public static java.math.BigDecimal cot(java.math.BigDecimal x)
x
- the argument in radians.public static java.math.BigDecimal asin(java.math.BigDecimal x)
x
- the argument.public static java.math.BigDecimal atan(java.math.BigDecimal x)
x
- the argument.public static java.math.BigDecimal cosh(java.math.BigDecimal x)
x
- The argument.public static java.math.BigDecimal sinh(java.math.BigDecimal x)
x
- the argument.public static java.math.BigDecimal tanh(java.math.BigDecimal x)
x
- The argument.public static java.math.BigDecimal asinh(java.math.BigDecimal x)
x
- The argument.public static java.math.BigDecimal acosh(java.math.BigDecimal x)
x
- The argument.public static java.math.BigDecimal Gamma(java.math.BigDecimal x)
x
- The argument.public static java.math.BigDecimal pochhammer(java.math.BigDecimal x, int n)
x
- The main argument.n
- The non-negative index.public static java.math.BigDecimal mod2pi(java.math.BigDecimal x)
x
- the original valuepublic static java.math.BigDecimal modpi(java.math.BigDecimal x)
x
- The original valuepublic static java.math.BigDecimal zeta(int n, java.math.MathContext mc)
n
- The positive integer argument.
32mc
- Specification of the accuracy of the result.public static double zeta1(int n)
n
- The positive integer argument.protected static java.math.BigDecimal broadhurstBBP(int n, int p, int[] a, java.math.MathContext mc)
a
- The vector of 8 integer argumentsmc
- Specification of the accuracy of the resultwidth0pt\protect\href{http://arxiv.org/abs/math/9803067}{arXiv:math/9803067}
public static java.math.BigDecimal addRound(java.math.BigDecimal x, java.math.BigDecimal y)
x
- The left summandy
- The right summandpublic static java.math.BigDecimal subtractRound(java.math.BigDecimal x, java.math.BigDecimal y)
x
- The left term.y
- The right term.public static java.math.BigDecimal multiplyRound(java.math.BigDecimal x, java.math.BigDecimal y)
x
- The left factor.y
- The right factor.public static java.math.BigDecimal multiplyRound(java.math.BigDecimal x, org.nd4j.linalg.util.Rational f)
x
- The left factor.f
- The right factor.public static java.math.BigDecimal multiplyRound(java.math.BigDecimal x, int n)
x
- The left factor.n
- The right factor.public static java.math.BigDecimal multiplyRound(java.math.BigDecimal x, java.math.BigInteger n)
x
- The left factor.n
- The right factor.public static java.math.BigDecimal divideRound(java.math.BigDecimal x, java.math.BigDecimal y)
x
- The numeratory
- The denominatorpublic static java.math.BigDecimal divideRound(java.math.BigDecimal x, int n)
x
- The numeratorn
- The denominatorpublic static java.math.BigDecimal divideRound(java.math.BigDecimal x, java.math.BigInteger n)
x
- The numeratorn
- The denominatorpublic static java.math.BigDecimal divideRound(java.math.BigInteger n, java.math.BigDecimal x)
n
- The numeratorx
- The denominatorpublic static java.math.BigDecimal divideRound(int n, java.math.BigDecimal x)
n
- The numerator.x
- The denominator.public static java.math.BigDecimal scalePrec(java.math.BigDecimal x, int d)
x
- The input valued
- The (positive) value of zeros to be added as least significant digits.public static java.math.BigDecimal scalePrec(java.math.BigDecimal x, java.math.MathContext mc)
x
- The input valuemc
- The requirement on the minimum precision on return.public static int err2prec(java.math.BigDecimal x, java.math.BigDecimal xerr)
x
- The value of the variablexerr
- The absolute error in the variablepublic static int err2prec(double x, double xerr)
x
- The value of the variable
The value returned depends only on the absolute value, not on the sign.xerr
- The absolute error in the variable
The value returned depends only on the absolute value, not on the sign.public static int err2prec(double xerr)
xerr
- The relative error in the variable.
The value returned depends only on the absolute value, not on the sign.public static double prec2err(double x, int prec)
x
- The value of the variable
The value returned depends only on the absolute value, not on the sign.prec
- The number of valid digits of the variable.Copyright © 2014. All Rights Reserved.