C++ always performs computations at the full precision allowed by the data type. If doubles aren't working, you can try to convert the problem into an integer expression, or analyze the order of operations to try and minimize effects caused by limited precision, such as adding a very small number to a relatively very large number. Again, wysota's suggestion of using fixed point point math is also viable, although it may not be necessary.
If you could post the inputs, intermediate results and outputs of your functions with two calls, and the expected results and discrepancies, we might be able to lend more assistance.
------------------------
Something else to consider: what, exactly, is "wrong" with the results? It's entirely possible that Excel is doing some rounding itself when displaying results; C++ may also not be displaying the full precision of the numbers used, depending on how you're outputting them.
Bookmarks