Average Error: 0.0 → 0.4
Time: 1.9s
Precision: 64
\[-\log \left(\frac{1}{x} - 1\right)\]
\[-\left(\log 1 - \left(\log x + \left(1 \cdot x + 0.5 \cdot \frac{{x}^{2}}{{1}^{2}}\right)\right)\right)\]
-\log \left(\frac{1}{x} - 1\right)
-\left(\log 1 - \left(\log x + \left(1 \cdot x + 0.5 \cdot \frac{{x}^{2}}{{1}^{2}}\right)\right)\right)
double f(double x) {
        double r23448 = 1.0;
        double r23449 = x;
        double r23450 = r23448 / r23449;
        double r23451 = r23450 - r23448;
        double r23452 = log(r23451);
        double r23453 = -r23452;
        return r23453;
}

double f(double x) {
        double r23454 = 1.0;
        double r23455 = log(r23454);
        double r23456 = x;
        double r23457 = log(r23456);
        double r23458 = r23454 * r23456;
        double r23459 = 0.5;
        double r23460 = 2.0;
        double r23461 = pow(r23456, r23460);
        double r23462 = pow(r23454, r23460);
        double r23463 = r23461 / r23462;
        double r23464 = r23459 * r23463;
        double r23465 = r23458 + r23464;
        double r23466 = r23457 + r23465;
        double r23467 = r23455 - r23466;
        double r23468 = -r23467;
        return r23468;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[-\log \left(\frac{1}{x} - 1\right)\]
  2. Taylor expanded around 0 0.4

    \[\leadsto -\color{blue}{\left(\log 1 - \left(\log x + \left(1 \cdot x + 0.5 \cdot \frac{{x}^{2}}{{1}^{2}}\right)\right)\right)}\]
  3. Final simplification0.4

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

Reproduce

herbie shell --seed 2020062 
(FPCore (x)
  :name "neg log"
  :precision binary64
  (- (log (- (/ 1 x) 1))))