Lines Matching refs:Fibonacci
55 Let's have a look how a naive Fibonacci implementation could be benchmarked:
57 std::uint64_t Fibonacci(std::uint64_t number) {
58 return number < 2 ? 1 : Fibonacci(number - 1) + Fibonacci(number - 2);
63 TEST_CASE("Fibonacci") {
64 CHECK(Fibonacci(0) == 1);
66 CHECK(Fibonacci(5) == 8);
70 BENCHMARK("Fibonacci 20") {
71 return Fibonacci(20);
74 BENCHMARK("Fibonacci 25") {
75 return Fibonacci(25);
78 BENCHMARK("Fibonacci 30") {
79 return Fibonacci(30);
82 BENCHMARK("Fibonacci 35") {
83 return Fibonacci(35);
95 Fibonacci
103 Fibonacci 20 100 416439 83.2878 ms
107 Fibonacci 25 100 400776 80.1552 ms
111 Fibonacci 30 100 396873 79.3746 ms
115 Fibonacci 35 100 145169 87.1014 ms