package com.imsl.test.example.math; import com.imsl.math.*; /** *
* MinUncon Example 1: Minimizes a single variable function. *
* * The minimum of \(e^x - 5\) is found using function evaluations only. * * @see Code * @see Output */ public class MinUnconEx1 { public static void main(String args[]) { MinUncon zf = new MinUncon(); zf.setGuess(0.0); zf.setAccuracy(0.001); MinUncon.Function fcn = new MinUncon.Function() { @Override public double f(double x) { return Math.exp(x) - 5. * x; } }; System.out.println("Minimum is " + zf.computeMin(fcn)); } }