Average Error: 0.5 → 0.5
Time: 17.6s
Precision: 64
\[\log \left(1 + e^{x}\right) - x \cdot y\]
\[\sqrt[3]{\log \left(1 + e^{x}\right) \cdot \left(\log \left(1 + e^{x}\right) \cdot \log \left(1 + e^{x}\right)\right)} - y \cdot x\]
\log \left(1 + e^{x}\right) - x \cdot y
\sqrt[3]{\log \left(1 + e^{x}\right) \cdot \left(\log \left(1 + e^{x}\right) \cdot \log \left(1 + e^{x}\right)\right)} - y \cdot x
double f(double x, double y) {
        double r8385974 = 1.0;
        double r8385975 = x;
        double r8385976 = exp(r8385975);
        double r8385977 = r8385974 + r8385976;
        double r8385978 = log(r8385977);
        double r8385979 = y;
        double r8385980 = r8385975 * r8385979;
        double r8385981 = r8385978 - r8385980;
        return r8385981;
}

double f(double x, double y) {
        double r8385982 = 1.0;
        double r8385983 = x;
        double r8385984 = exp(r8385983);
        double r8385985 = r8385982 + r8385984;
        double r8385986 = log(r8385985);
        double r8385987 = r8385986 * r8385986;
        double r8385988 = r8385986 * r8385987;
        double r8385989 = cbrt(r8385988);
        double r8385990 = y;
        double r8385991 = r8385990 * r8385983;
        double r8385992 = r8385989 - r8385991;
        return r8385992;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.5
Target0.1
Herbie0.5
\[\begin{array}{l} \mathbf{if}\;x \le 0.0:\\ \;\;\;\;\log \left(1 + e^{x}\right) - x \cdot y\\ \mathbf{else}:\\ \;\;\;\;\log \left(1 + e^{-x}\right) - \left(-x\right) \cdot \left(1 - y\right)\\ \end{array}\]

Derivation

  1. Initial program 0.5

    \[\log \left(1 + e^{x}\right) - x \cdot y\]
  2. Using strategy rm
  3. Applied add-cbrt-cube0.5

    \[\leadsto \color{blue}{\sqrt[3]{\left(\log \left(1 + e^{x}\right) \cdot \log \left(1 + e^{x}\right)\right) \cdot \log \left(1 + e^{x}\right)}} - x \cdot y\]
  4. Final simplification0.5

    \[\leadsto \sqrt[3]{\log \left(1 + e^{x}\right) \cdot \left(\log \left(1 + e^{x}\right) \cdot \log \left(1 + e^{x}\right)\right)} - y \cdot x\]

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(FPCore (x y)
  :name "Logistic regression 2"

  :herbie-target
  (if (<= x 0.0) (- (log (+ 1.0 (exp x))) (* x y)) (- (log (+ 1.0 (exp (- x)))) (* (- x) (- 1.0 y))))

  (- (log (+ 1.0 (exp x))) (* x y)))