Average Error: 0.6 → 0.6
Time: 14.6s
Precision: 64
\[\log \left(1 + e^{x}\right) - x \cdot y\]
\[\log \left(\log \left(e^{e^{x}} \cdot e\right)\right) - y \cdot x\]
\log \left(1 + e^{x}\right) - x \cdot y
\log \left(\log \left(e^{e^{x}} \cdot e\right)\right) - y \cdot x
double f(double x, double y) {
        double r2544080 = 1.0;
        double r2544081 = x;
        double r2544082 = exp(r2544081);
        double r2544083 = r2544080 + r2544082;
        double r2544084 = log(r2544083);
        double r2544085 = y;
        double r2544086 = r2544081 * r2544085;
        double r2544087 = r2544084 - r2544086;
        return r2544087;
}

double f(double x, double y) {
        double r2544088 = x;
        double r2544089 = exp(r2544088);
        double r2544090 = exp(r2544089);
        double r2544091 = exp(1.0);
        double r2544092 = r2544090 * r2544091;
        double r2544093 = log(r2544092);
        double r2544094 = log(r2544093);
        double r2544095 = y;
        double r2544096 = r2544095 * r2544088;
        double r2544097 = r2544094 - r2544096;
        return r2544097;
}

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.6
Target0.1
Herbie0.6
\[\begin{array}{l} \mathbf{if}\;x \le 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.6

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

    \[\leadsto \log \left(1 + \color{blue}{\log \left(e^{e^{x}}\right)}\right) - x \cdot y\]
  4. Applied add-log-exp0.6

    \[\leadsto \log \left(\color{blue}{\log \left(e^{1}\right)} + \log \left(e^{e^{x}}\right)\right) - x \cdot y\]
  5. Applied sum-log0.6

    \[\leadsto \log \color{blue}{\left(\log \left(e^{1} \cdot e^{e^{x}}\right)\right)} - x \cdot y\]
  6. Simplified0.6

    \[\leadsto \log \left(\log \color{blue}{\left(e^{e^{x}} \cdot e\right)}\right) - x \cdot y\]
  7. Final simplification0.6

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

Reproduce

herbie shell --seed 2019151 
(FPCore (x y)
  :name "Logistic regression 2"

  :herbie-target
  (if (<= x 0) (- (log (+ 1 (exp x))) (* x y)) (- (log (+ 1 (exp (- x)))) (* (- x) (- 1 y))))

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