R/griewank.R

Defines functions griewank

Documented in griewank

griewank <- function(x) {
  term1 <- sum(x^2 / 4000)
  term2 <- prod(cos(x / sqrt(seq_along(x))))
  return(1 + term1 - term2)
}

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.