Description: don't use unpackaged jafama to compute exp, use Math instead
Author: Pierre Gruet <pgt@debian.org>
Forwarded: not-needed
Last-Update: 2022-03-27

--- a/xgboost-predictor/build.gradle
+++ b/xgboost-predictor/build.gradle
@@ -1,8 +1,6 @@
 description = "Pure Java implementation of XGBoost predictor for online prediction tasks"
 
 dependencies {
-    compile group: 'net.jafama', name: 'jafama', version: '2.1.0'
-
     testCompile project(':xgboost-predictor-test')
     testCompile(group: 'junit', name: 'junit', version: '4.12') {
         exclude group: 'org.hamcrest', module: 'hamcrest-core'
--- a/xgboost-predictor/src/main/java/biz/k11i/xgboost/learner/ObjFunction.java
+++ b/xgboost-predictor/src/main/java/biz/k11i/xgboost/learner/ObjFunction.java
@@ -1,7 +1,6 @@
 package biz.k11i.xgboost.learner;
 
 import biz.k11i.xgboost.config.PredictorConfiguration;
-import net.jafama.FastMath;
 
 import java.io.Serializable;
 import java.util.HashMap;
@@ -55,16 +54,9 @@
      *                  or {@code false} if you don't want to use it but JDK's {@link Math#exp(double)}.
      */
     public static void useFastMathExp(boolean useJafama) {
-        if (useJafama) {
-            register("binary:logistic", new RegLossObjLogistic_Jafama());
-            register("reg:logistic", new RegLossObjLogistic_Jafama());
-            register("multi:softprob", new SoftmaxMultiClassObjProb_Jafama());
-
-        } else {
-            register("binary:logistic", new RegLossObjLogistic());
-            register("reg:logistic", new RegLossObjLogistic());
-            register("multi:softprob", new SoftmaxMultiClassObjProb());
-        }
+        register("binary:logistic", new RegLossObjLogistic());
+        register("reg:logistic", new RegLossObjLogistic());
+        register("multi:softprob", new SoftmaxMultiClassObjProb());
     }
 
     /**
@@ -112,18 +104,6 @@
     }
 
     /**
-     * Logistic regression.
-     * <p>
-     * Jafama's {@link FastMath#exp(double)} version.
-     * </p>
-     */
-    static class RegLossObjLogistic_Jafama extends RegLossObjLogistic {
-        double sigmoid(double x) {
-            return (1 / (1 + FastMath.exp(-x)));
-        }
-    }
-
-    /**
      * Multiclass classification.
      */
     static class SoftmaxMultiClassObjClassify extends ObjFunction {
@@ -180,17 +160,4 @@
             return Math.exp(x);
         }
     }
-
-    /**
-     * Multiclass classification (predicted probability).
-     * <p>
-     * Jafama's {@link FastMath#exp(double)} version.
-     * </p>
-     */
-    static class SoftmaxMultiClassObjProb_Jafama extends SoftmaxMultiClassObjProb {
-        @Override
-        double exp(double x) {
-            return FastMath.exp(x);
-        }
-    }
 }
