/*Example to show the syntax for using the optmum library in Gauss. In the example below, we use optmum to minimize the function f(x) = x^2, which we define in the procedure below. Note that optmum has two arguments. The second argument is a standard argument but the first requires you give it a function name (in this case f). & is a "pointer" that tells gauss that the input is the name of a function. The function should be the function that you want to minimize and needs to be defined in a procedure, as we do below. */ new; library optmum; {xmin,ymin,g,retcode}=optmum(&f,1); "Value of x that mimimizes f(x) " xmin; "The minimum value of y = f(x) " ymin; end; proc(1)=f(x); local y; y=x^2; retp(y); endp;