Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static double logSumExp(double a, double b) {
        double x = (a < b) ? a : b;
        double y = (a < b) ? b : a;
        if (y - x > 50) {
            return y;
        } else {
            return x + Math.log(1.0 + Math.exp(y - x));
        }
    }
}