Maybe you could use the fact that comb(n, r) == comb(n, n - r), and transform the "r" parameter on the fly to use the smallest of both values. Don't know if that would really save you something in the end, but I think it might. Try it and see 
Edit: What I meant:
Edit: What I meant:
You should also check (at least initially in a wrapper function) that r is valid for the given n. It is often assumed in statistics that the value of this function will be 0 if the input is invalid.code:<HR>Code:double comb3(int n, int r) { // Your base cases, as before if (r > (n / 2)) r = n - r; // the rest stays the same }