Home
last modified time | relevance | path

Searched refs:factorial (Results 1 – 25 of 38) sorted by relevance

12

/external/guava/guava-tests/benchmark/com/google/common/math/
DIntMathBenchmark.java37 private static int[] factorial = new int[ARRAY_SIZE]; field in IntMathBenchmark
47 factorial[i] = RANDOM_SOURCE.nextInt(50); in setUp()
48 binomial[i] = RANDOM_SOURCE.nextInt(factorial[i] + 1); in setUp()
82 @Benchmark int factorial(int reps) { in factorial() method in IntMathBenchmark
86 tmp += IntMath.factorial(factorial[j]); in factorial()
95 tmp += IntMath.binomial(factorial[j], binomial[j]); in binomial()
DBigIntegerMathBenchmark.java60 return BigInteger.valueOf(LongMath.factorial(n)); in oldSlowFactorial()
63 return BigInteger.valueOf(LongMath.factorial(k)).multiply(oldSlowFactorial(k, n)); in oldSlowFactorial()
98 @Benchmark int factorial(int reps) { in factorial() method in BigIntegerMathBenchmark
102 tmp += BigIntegerMath.factorial(factorials[j]).intValue(); in factorial()
DDoubleMathBenchmark.java56 @Benchmark long factorial(int reps) { in factorial() method in DoubleMathBenchmark
60 tmp += Double.doubleToRawLongBits(DoubleMath.factorial(factorials[j])); in factorial()
DLongMathBenchmark.java85 @Benchmark int factorial(int reps) { in factorial() method in LongMathBenchmark
89 tmp += LongMath.factorial(factorialArguments[j]); in factorial()
DApacheBenchmark.java44 return DoubleMath.factorial(n); in factorialDouble()
/external/clang/test/Analysis/
Dinline.c37 unsigned factorial(unsigned x) { in factorial() function
40 return x * factorial(x - 1); in factorial()
44 if (factorial(3) == 6) { in test_factorial()
55 unsigned x = factorial(3); in test_factorial_2()
56 if (x == factorial(3)) { in test_factorial_2()
/external/guava/guava-gwt/test-super/com/google/common/math/super/com/google/common/math/
DBigIntegerMathTest.java154 assertEquals(expected, BigIntegerMath.factorial(i)); in testFactorial()
159 assertEquals(BigInteger.ONE, BigIntegerMath.factorial(0)); in testFactorial0()
164 BigIntegerMath.factorial(-1); in testFactorialNegative()
178 .factorial(n) in runBinomialTest()
179 .divide(BigIntegerMath.factorial(k)) in runBinomialTest()
180 .divide(BigIntegerMath.factorial(n - k)); in runBinomialTest()
DIntMathTest.java298 BigInteger expectedBig = BigIntegerMath.factorial(n); in testFactorial()
300 assertEquals(expectedInt, IntMath.factorial(n)); in testFactorial()
307 IntMath.factorial(n); in testFactorialNegative()
/external/vixl/examples/
Dfactorial.cc65 Label factorial; in main() local
66 masm.Bind(&factorial); in main()
73 simulator.RunFrom(masm.GetLabelAddress<Instruction*>(&factorial)); in main()
/external/v8/test/mjsunit/
Dsin-cos.js71 var factorial = [1]; variable
74 factorial[i] = factorial[i-1] * i;
92 terms.push(sign * x / factorial[i]);
105 terms.push(sign * x / factorial[i]);
/external/libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/
Dprev_permutation.pass.cpp25 int factorial(int x) in factorial() function
57 assert(count == factorial(e)); in test()
Dnext_permutation.pass.cpp25 int factorial(int x) in factorial() function
57 assert(count == factorial(e)); in test()
Dprev_permutation_comp.pass.cpp26 int factorial(int x) in factorial() function
59 assert(count == factorial(e)); in test()
Dnext_permutation_comp.pass.cpp26 int factorial(int x) in factorial() function
59 assert(count == factorial(e)); in test()
/external/guava/guava-tests/test/com/google/common/math/
DDoubleMathTest.java69 assertTrue(BigIntegerMath.factorial(DoubleMath.MAX_FACTORIAL).compareTo(maxDoubleValue) <= 0); in testConstantsMaxFactorial()
71 BigIntegerMath.factorial(DoubleMath.MAX_FACTORIAL + 1).compareTo(maxDoubleValue) > 0); in testConstantsMaxFactorial()
77 BigIntegerMath.factorial(n).doubleValue(), DoubleMath.everySixteenthFactorial[i]); in testConstantsEverySixteenthFactorial()
457 double actual = BigIntegerMath.factorial(i).doubleValue();
458 double result = DoubleMath.factorial(i);
464 assertEquals(Double.POSITIVE_INFINITY, DoubleMath.factorial(DoubleMath.MAX_FACTORIAL + 1));
465 assertEquals(Double.POSITIVE_INFINITY, DoubleMath.factorial(DoubleMath.MAX_FACTORIAL + 20));
471 DoubleMath.factorial(n);
DBigIntegerMathTest.java410 assertEquals(expected, BigIntegerMath.factorial(i));
415 assertEquals(BigInteger.ONE, BigIntegerMath.factorial(0));
420 BigIntegerMath.factorial(-1);
439 .factorial(n)
440 .divide(BigIntegerMath.factorial(k))
441 .divide(BigIntegerMath.factorial(n - k));
DIntMathTest.java465 BigInteger expectedBig = BigIntegerMath.factorial(n); in testFactorial()
467 assertEquals(expectedInt, IntMath.factorial(n)); in testFactorial()
474 IntMath.factorial(n); in testFactorialNegative()
DLongMathTest.java543 BigInteger expectedBig = BigIntegerMath.factorial(n); in testFactorial()
545 assertEquals(expectedLong, LongMath.factorial(n)); in testFactorial()
553 LongMath.factorial(n); in testFactorialNegative()
/external/jemalloc/test/unit/
Dmath.c24 factorial(unsigned x) in factorial() function
42 (double)factorial(x-1), MAX_REL_ERR, MAX_ABS_ERR), in TEST_BEGIN()
/external/vixl/test/examples/
Dtest-examples.cc201 TEST_FUNCTION(factorial); \
205 TEST(factorial) { in TEST() argument
208 Label factorial; in TEST() local
209 masm.Bind(&factorial); in TEST()
/external/clang/test/CodeGenCXX/
Dconst-init-cxx11.cpp274 constexpr int factorial(int n) { in factorial() function
275 return n ? factorial(n-1) * n : 1; in factorial()
280 constexpr NonTrivialDtor() : n(factorial(5)), p(&n) {} in NonTrivialDtor()
/external/guava/guava-gwt/src-super/com/google/common/math/super/com/google/common/math/
DDoubleMath.java79 public static double factorial(int n) { in factorial() method in DoubleMath
DIntMath.java376 public static int factorial(int n) {
DBigIntegerMath.java133 public static BigInteger factorial(int n) { in factorial() method in BigIntegerMath
/external/apache-commons-math/src/main/java/org/apache/commons/math/util/
DMathUtils.java794 public static long factorial(final int n) {
834 return factorial(n);
859 return FastMath.log(factorial(n));

12