/**
 * standalone.cc
 *
 *  A toy objective-function program to be used along with the EvalF
 *  option in objective.h/objective.cc
 *
 *  Anne Shepherd, College of William and Mary, January 2001
 */


#include <iostream>       // for cin and cout
#include <cmath>           // for cos

using namespace std;

int main() {
  
  double x;
  double f;

  // our EvalF function sends the "x" down a pipe
  // so this program gets it on its standard input.
  
  cin >> x;
  f= cos(x);
  
  // now the objective program sends the function value
  // to its parent via its standard output.
  
  cout << f;

  // note that EvalF expects a return value of 0 in the case of a
  // successful function evaluation.
  
  return 0;
}
