Average Error: 1.3 → 0.7
Time: 21.3s
Precision: 64
\[\log \left(\frac{e^{x}}{1 + e^{x}}\right)\]
\[\frac{\left(x + \log \left(1 + e^{x}\right)\right) \cdot \left(x - \log \left(1 + e^{x}\right)\right)}{x + \log \left(1 + e^{x}\right)}\]
\log \left(\frac{e^{x}}{1 + e^{x}}\right)
\frac{\left(x + \log \left(1 + e^{x}\right)\right) \cdot \left(x - \log \left(1 + e^{x}\right)\right)}{x + \log \left(1 + e^{x}\right)}
double f(double x) {
        double r53171669 = x;
        double r53171670 = exp(r53171669);
        double r53171671 = 1.0;
        double r53171672 = r53171671 + r53171670;
        double r53171673 = r53171670 / r53171672;
        double r53171674 = log(r53171673);
        return r53171674;
}

double f(double x) {
        double r53171675 = x;
        double r53171676 = 1.0;
        double r53171677 = exp(r53171675);
        double r53171678 = r53171676 + r53171677;
        double r53171679 = log(r53171678);
        double r53171680 = r53171675 + r53171679;
        double r53171681 = r53171675 - r53171679;
        double r53171682 = r53171680 * r53171681;
        double r53171683 = r53171682 / r53171680;
        return r53171683;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 1.3

    \[\log \left(\frac{e^{x}}{1 + e^{x}}\right)\]
  2. Using strategy rm
  3. Applied log-div1.3

    \[\leadsto \color{blue}{\log \left(e^{x}\right) - \log \left(1 + e^{x}\right)}\]
  4. Simplified0.7

    \[\leadsto \color{blue}{x} - \log \left(1 + e^{x}\right)\]
  5. Using strategy rm
  6. Applied flip--0.7

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

    \[\leadsto \frac{\color{blue}{\left(x + \log \left(1 + e^{x}\right)\right) \cdot \left(x - \log \left(1 + e^{x}\right)\right)}}{x + \log \left(1 + e^{x}\right)}\]
  8. Final simplification0.7

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

Reproduce

herbie shell --seed 1 
(FPCore (x)
  :name "log(exp(x)/(1+exp(x)))"
  (log (/ (exp x) (+ 1 (exp x)))))