Class Agm
- java.lang.Object
-
- de.tilman_neumann.jml.transcendental.Agm
-
public class Agm extends Object
-
-
Constructor Summary
Constructors Constructor Description Agm()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BigDecimal
agm(BigDecimal a, BigDecimal b, Scale outScale)
Arithmetic-geometric mean of a and b.static int
getResultMagnitude(BigDecimal a, BigDecimal b)
Computes an estimate of the size of agm(a, b) in decimal digits.static void
main(String[] args)
-
-
-
Method Detail
-
agm
public static BigDecimal agm(BigDecimal a, BigDecimal b, Scale outScale)
Arithmetic-geometric mean of a and b. The core is computed in BigIntegers, which is much faster than a BigDecimal-core. agm(a, b) will be pretty slow if |ln(|a/b|)| is large, because then the initial sqrt guess is not good enough.- Parameters:
a
-b
-outScale
- desired precision in after-floating point digits- Returns:
- agm(a, b)
-
getResultMagnitude
public static int getResultMagnitude(BigDecimal a, BigDecimal b)
Computes an estimate of the size of agm(a, b) in decimal digits.- Parameters:
a
-b
-- Returns:
- estimated magnitude of agm(a, b)
-
main
public static void main(String[] args)
-
-