Average Error: 60.8 → 0.0
Time: 21.9s
Precision: 64
\[-1 \lt x \land x \lt 1\]
\[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
\[\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}\]
\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}
\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}
double f(double x) {
        double r4424242 = 1.0;
        double r4424243 = x;
        double r4424244 = r4424242 - r4424243;
        double r4424245 = log(r4424244);
        double r4424246 = r4424242 + r4424243;
        double r4424247 = log(r4424246);
        double r4424248 = r4424245 / r4424247;
        return r4424248;
}

double f(double x) {
        double r4424249 = x;
        double r4424250 = -r4424249;
        double r4424251 = log1p(r4424250);
        double r4424252 = log1p(r4424249);
        double r4424253 = r4424251 / r4424252;
        return r4424253;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original60.8
Target0.4
Herbie0.0
\[-\left(\left(\left(1 + x\right) + \frac{x \cdot x}{2}\right) + \frac{5}{12} \cdot {x}^{3}\right)\]

Derivation

  1. Initial program 60.8

    \[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
  2. Simplified59.9

    \[\leadsto \color{blue}{\frac{\log \left(1 - x\right)}{\log_* (1 + x)}}\]
  3. Using strategy rm
  4. Applied sub-neg59.9

    \[\leadsto \frac{\log \color{blue}{\left(1 + \left(-x\right)\right)}}{\log_* (1 + x)}\]
  5. Applied log1p-def0.0

    \[\leadsto \frac{\color{blue}{\log_* (1 + \left(-x\right))}}{\log_* (1 + x)}\]
  6. Final simplification0.0

    \[\leadsto \frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}\]

Reproduce

herbie shell --seed 2019104 +o rules:numerics
(FPCore (x)
  :name "qlog (example 3.10)"
  :pre (and (< -1 x) (< x 1))

  :herbie-target
  (- (+ (+ (+ 1 x) (/ (* x x) 2)) (* 5/12 (pow x 3))))

  (/ (log (- 1 x)) (log (+ 1 x))))