Use a Better Algorithm and Beat Haskell Today!
Note: This refers to the article “Use those extra cores and beat C today! (Parallel Haskell redux)”, and should be viewed as a good-natured ribbing!
I’ll see your sensational headline and raise you a better algorithm!
The Code:
#include "gmpxx.h"
#include <iostream>
#include <sys/time.h>
using namespace std;
mpz_class fib(unsigned int num)
{
mpz_class a(1), b(1);
mpz_class temp;
while(num– > 1)
[...]
Popularity: 19% [?]
