Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double FuncMeanSquare(double x, double* c)
- {
- return c[0] + c[1] * x + c[2] * pow(x, 2);
- }
- double scalarFF = 0; // (f,f)
- double scalarFG = 0; // (f,g[i])
- for (int i = 0; i < n; i++)
- {
- scalarFF += pow(F(xArr1[i]), 2);
- scalarFG += pow(FuncMeanSquare(xArr1[i], c), 2);
- }
- double error = sqrt(scalarFF - scalarFG);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement