An error in the 3rd decimal place is not a rounding error. You have just used the sample code that they gave you. That is not a complete solution, which they actually told you in the instructions although perhaps their wording was a bit too subtle.
Compare your implementation to the mathematical formula for the cost shown in the instructions (equation 13) and ask yourself two questions:
-
What happened to the factor of 1/m?
-
Why is there only one term? What happened to the Y = 0 term?