Average Error: 0.0 → 0.4
Time: 2.4s
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 r4741 = 1.0;
        double r4742 = x;
        double r4743 = r4741 / r4742;
        double r4744 = r4743 - r4741;
        double r4745 = log(r4744);
        double r4746 = -r4745;
        return r4746;
}

double f(double x) {
        double r4747 = 1.0;
        double r4748 = log(r4747);
        double r4749 = x;
        double r4750 = log(r4749);
        double r4751 = r4747 * r4749;
        double r4752 = 0.5;
        double r4753 = 2.0;
        double r4754 = pow(r4749, r4753);
        double r4755 = pow(r4747, r4753);
        double r4756 = r4754 / r4755;
        double r4757 = r4752 * r4756;
        double r4758 = r4751 + r4757;
        double r4759 = r4750 + r4758;
        double r4760 = r4748 - r4759;
        double r4761 = -r4760;
        return r4761;
}

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 2020100 
(FPCore (x)
  :name "neg log"
  :precision binary64
  (- (log (- (/ 1 x) 1))))