import com.imsl.math.*; 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() { public double f(double x) { return Math.exp(x) - 5.*x; } }; System.out.println("Minimum is " + zf.computeMin(fcn)); } }
Minimum is 1.6094175999200253Link to Java source.