|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.examples.pi.math.Bellard
public final class Bellard
Bellard's BBP-type Pi formula 1/2^6 \sum_{n=0}^\infty (-1)^n/2^{10n} (-2^5/(4n+1) -1/(4n+3) +2^8/(10n+1) -2^6/(10n+3) -2^2/(10n+5) -2^2/(10n+7) +1/(10n+9)) References: [1] David H. Bailey, Peter B. Borwein and Simon Plouffe. On the Rapid Computation of Various Polylogarithmic Constants. Math. Comp., 66:903-913, 1996. [2] Fabrice Bellard. A new formula to compute the n'th binary digit of pi, 1997. Available at http://fabrice.bellard.free.fr/pi .
| Nested Class Summary | |
|---|---|
static class |
Bellard.Parameter
Parameters for the sums |
static class |
Bellard.Sum
The sums in the Bellard's formula |
| Constructor Summary | |
|---|---|
Bellard()
|
|
| Method Summary | ||
|---|---|---|
static long |
bit2terms(long b)
Estimate the number of terms. |
|
static double |
computePi(long b)
Compute bits of Pi in the local machine. |
|
static
|
computePi(long b,
Map<Bellard.Parameter,T> results)
Compute bits of Pi from the results. |
|
static
|
getSums(long b,
int partsPerSum,
Map<Bellard.Parameter,List<T>> existing)
Get the sums for the Bellard formula. |
|
static void |
main(String[] args)
main |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Bellard()
| Method Detail |
|---|
public static <T extends Container<Summation>> Map<Bellard.Parameter,Bellard.Sum> getSums(long b,
int partsPerSum,
Map<Bellard.Parameter,List<T>> existing)
public static <T extends Container<Summation>> double computePi(long b,
Map<Bellard.Parameter,T> results)
public static double computePi(long b)
public static long bit2terms(long b)
public static void main(String[] args)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||