# include /******************************************************************************/ double f10 ( double x ) /******************************************************************************/ /* Purpose: F10 evaluates the objective function for problem 10. Licensing: This code is distributed under the GNU LGPL license. Modified: 03 February 2012 Author: John Burkardt Reference: Isabel Beichl, Dianne O'Leary, Francis Sullivan, Monte Carlo Minimization and Counting: One, Two, Too Many, Computing in Science and Engineering, Volume 9, Number 1, January/February 2007. Dianne O'Leary, Scientific Computing with Case Studies, SIAM, 2008, ISBN13: 978-0-898716-66-5, LC: QA401.O44. Parameters: Input, double X, the argument of the objective function. Output, double P10_F, the value of the objective function. */ { double f; f = cos ( x ) + 5.0 * cos ( 1.6 * x ) - 2.0 * cos ( 2.0 * x ) + 5.0 * cos ( 4.5 * x ) + 7.0 * cos ( 9.0 * x ); return f; }