Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This was an error in the implementation #2336

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions code-experiments/src/f_katsuura.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ static double f_katsuura_raw(const double *x, const size_t number_of_variables)

size_t i, j;
double tmp, tmp2;
double result;

if (coco_vector_contains_nan(x, number_of_variables))
return NAN;

/* Computation core */
result = 1.0;
double result = 1.0;
double D = (double) number_of_variables;
for (i = 0; i < number_of_variables; ++i) {
tmp = 0;
for (j = 1; j < 33; ++j) {
Expand All @@ -39,12 +39,11 @@ static double f_katsuura_raw(const double *x, const size_t number_of_variables)
}
tmp = 1.0 + ((double) (long) i + 1) * tmp;
/*result *= tmp;*/ /* Wassim TODO: delete once consistency check passed*/
result *= pow(tmp, 10. / pow((double) number_of_variables, 1.2));
result *= pow(tmp, 10. / pow(D, 1.2));
}
/*result = 10. / ((double) number_of_variables) / ((double) number_of_variables)
* (-1. + pow(result, 10. / pow((double) number_of_variables, 1.2)));*/
result = 10. / ((double) number_of_variables) / ((double) number_of_variables)
* (-1. + result);
result = 10. / (D * D) * (-1. + result);

return result;
}
Expand Down