Average Error: 0.5 → 0.5
Time: 12.1s
Precision: 64
\[\log \left(1 + e^{x}\right) - x \cdot y\]
\[\left(\log \left({1}^{3} + {\left(e^{x}\right)}^{3}\right) - \log \left(1 \cdot 1 + \left(e^{x} \cdot e^{x} - 1 \cdot e^{x}\right)\right)\right) - x \cdot y\]
\log \left(1 + e^{x}\right) - x \cdot y
\left(\log \left({1}^{3} + {\left(e^{x}\right)}^{3}\right) - \log \left(1 \cdot 1 + \left(e^{x} \cdot e^{x} - 1 \cdot e^{x}\right)\right)\right) - x \cdot y
double f(double x, double y) {
        double r135618 = 1.0;
        double r135619 = x;
        double r135620 = exp(r135619);
        double r135621 = r135618 + r135620;
        double r135622 = log(r135621);
        double r135623 = y;
        double r135624 = r135619 * r135623;
        double r135625 = r135622 - r135624;
        return r135625;
}

double f(double x, double y) {
        double r135626 = 1.0;
        double r135627 = 3.0;
        double r135628 = pow(r135626, r135627);
        double r135629 = x;
        double r135630 = exp(r135629);
        double r135631 = pow(r135630, r135627);
        double r135632 = r135628 + r135631;
        double r135633 = log(r135632);
        double r135634 = r135626 * r135626;
        double r135635 = r135630 * r135630;
        double r135636 = r135626 * r135630;
        double r135637 = r135635 - r135636;
        double r135638 = r135634 + r135637;
        double r135639 = log(r135638);
        double r135640 = r135633 - r135639;
        double r135641 = y;
        double r135642 = r135629 * r135641;
        double r135643 = r135640 - r135642;
        return r135643;
}

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 flip3-+0.5

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

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

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

Reproduce

herbie shell --seed 2019303 
(FPCore (x y)
  :name "Logistic regression 2"
  :precision binary64

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

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