R/expanded_schaffer.R

Defines functions expanded_schaffer

Documented in expanded_schaffer

expanded_schaffer <- function(x) {
  D <- length(x)
  sum_terms <- 0
  for (i in 1:(D-1)) {
    sum_terms <- sum_terms + (sin(sqrt(x[i]^2 + x[i+1]^2))^2 - 0.5) /
      (1 + 0.001 * (x[i]^2 + x[i+1]^2))^2
  }
  return(0.5 + sum_terms)
}

Try the EEEA package in your browser

Any scripts or data that you put into this service are public.

EEEA documentation built on June 10, 2025, 9:13 a.m.