Average Error: 61.2 → 0.6
Time: 9.8s
Precision: binary64
\[\]
\[\]
\[\]
double code(double x) {
	return ((double) (((double) log(((double) (1.0 - x)))) / ((double) log(((double) (1.0 + x))))));
}
double code(double x) {
	return ((double) (((double) (((double) (((double) log(1.0)) - ((double) (((double) (1.0 * ((double) (x * x)))) + ((double) (0.5 * ((double) (((double) pow(x, 4.0)) / ((double) (1.0 * 1.0)))))))))) / ((double) (((double) (1.0 * x)) + ((double) (((double) log(1.0)) - ((double) (0.5 * ((double) (x * ((double) (x / ((double) (1.0 * 1.0)))))))))))))) - 1.0));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original61.2
Target0.4
Herbie0.6
\[\]

Derivation

  1. Initial program 61.2

    \[\]
  2. Using strategy rm
  3. Applied flip--60.8

    \[\leadsto \]
  4. Applied log-div61.0

    \[\leadsto \]
  5. Applied div-sub61.0

    \[\leadsto \]
  6. Simplified61.0

    \[\leadsto \]
  7. Taylor expanded around 0 1.1

    \[\leadsto \]
  8. Simplified1.1

    \[\leadsto \]
  9. Taylor expanded around 0 0.6

    \[\leadsto \]
  10. Simplified0.6

    \[\leadsto \]
  11. Final simplification0.6

    \[\leadsto \]

Reproduce

herbie shell --seed 2020179 
(FPCore (x)
  :name "qlog (example 3.10)"
  :precision binary64
  :pre (and (< -1.0 x) (< x 1.0))

  :herbie-target
  (neg (+ (+ (+ 1.0 x) (/ (* x x) 2.0)) (* 0.4166666666666667 (pow x 3.0))))

  (/ (log (- 1.0 x)) (log (+ 1.0 x))))