Average Error: 0.5 → 0.6
Time: 2.7s
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 r190186 = 1.0;
        double r190187 = x;
        double r190188 = exp(r190187);
        double r190189 = r190186 + r190188;
        double r190190 = log(r190189);
        double r190191 = y;
        double r190192 = r190187 * r190191;
        double r190193 = r190190 - r190192;
        return r190193;
}

double f(double x, double y) {
        double r190194 = 1.0;
        double r190195 = 3.0;
        double r190196 = pow(r190194, r190195);
        double r190197 = x;
        double r190198 = exp(r190197);
        double r190199 = pow(r190198, r190195);
        double r190200 = r190196 + r190199;
        double r190201 = log(r190200);
        double r190202 = r190194 * r190194;
        double r190203 = r190198 * r190198;
        double r190204 = r190194 * r190198;
        double r190205 = r190203 - r190204;
        double r190206 = r190202 + r190205;
        double r190207 = log(r190206);
        double r190208 = r190201 - r190207;
        double r190209 = y;
        double r190210 = r190197 * r190209;
        double r190211 = r190208 - r190210;
        return r190211;
}

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.0
Herbie0.6
\[\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.6

    \[\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.6

    \[\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.6

    \[\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 2020024 
(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)))