// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class Solver {
    public static interface Func {
        public double eval(double x);
    }
    private static final double EPS = 0.000000001;
    private static double d1(Func f, double x) {
        return (f.eval(x+EPS/2) - f.eval(x-EPS/2)) / EPS;
    }
    public static double solve(Func f) {
        double x = 100;
        double xold;
        do {
            xold = x;
            x = x - f.eval(x) / d1(f, x); 
        } while(Math.abs(x-xold) > EPS);
        return x;
    }
    public static void main(String[] args) {
        Func f = new Func() {
           public double eval(double x) {
                return Math.exp(-13.411689+0.1174066*x) / (1 + Math.exp(-13.411689+0.1174066*x)) - 0.5;
            } };
        System.out.println(Solver.solve(f));
    }
}
