Average Error: 60.7 → 0.5
Time: 44.7s
Precision: 64
Internal Precision: 128
\[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
\[\sqrt[3]{\left(\left(\left(-1 - x\right) - x \cdot \left(\frac{1}{2} \cdot x\right)\right) \cdot \left(\left(-1 - x\right) - x \cdot \left(\frac{1}{2} \cdot x\right)\right)\right) \cdot \left(\left(-1 - x\right) - x \cdot \left(\frac{1}{2} \cdot x\right)\right)}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 60.7

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

    \[\leadsto \color{blue}{-\left(x + \left(\frac{1}{2} \cdot {x}^{2} + 1\right)\right)}\]
  3. Simplified0.5

    \[\leadsto \color{blue}{\left(-1 - x\right) - x \cdot \left(x \cdot \frac{1}{2}\right)}\]
  4. Using strategy rm
  5. Applied add-cbrt-cube0.5

    \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\left(-1 - x\right) - x \cdot \left(x \cdot \frac{1}{2}\right)\right) \cdot \left(\left(-1 - x\right) - x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right) \cdot \left(\left(-1 - x\right) - x \cdot \left(x \cdot \frac{1}{2}\right)\right)}}\]
  6. Final simplification0.5

    \[\leadsto \sqrt[3]{\left(\left(\left(-1 - x\right) - x \cdot \left(\frac{1}{2} \cdot x\right)\right) \cdot \left(\left(-1 - x\right) - x \cdot \left(\frac{1}{2} \cdot x\right)\right)\right) \cdot \left(\left(-1 - x\right) - x \cdot \left(\frac{1}{2} \cdot x\right)\right)}\]

Reproduce

herbie shell --seed 2019007 
(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))))

Details

Time bar (total: 43.8s)Debug log

sample287.0ms

Algorithm
intervals

simplify9.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune10.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 60.7b

localize14.0ms

Local error

Found 3 expressions with local error:

7.9b
(log (- 1 x))
7.9b
(log (+ 1 x))
0.0b
(/ (log (- 1 x)) (log (+ 1 x)))

rewrite8.0ms

Algorithm
rewrite-expression-head
Counts
3 → 66
Calls

3 calls. Slowest were:

5.0ms
(/ (log (- 1 x)) (log (+ 1 x)))
1.0ms
(log (- 1 x))
1.0ms
(log (+ 1 x))

series129.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

70.0ms
(/ (log (- 1 x)) (log (+ 1 x)))
36.0ms
(log (- 1 x))
22.0ms
(log (+ 1 x))

simplify2.1s

Counts
63 → 75
Calls

63 calls. Slowest were:

296.0ms
(- (+ (/ 1 x) (log -1)) (+ (log (/ -1 x)) (* 1/2 (/ 1 (pow x 2)))))
273.0ms
(- (log -1) (+ (log (/ 1 x)) (+ (* 1/2 (/ 1 (pow x 2))) (/ 1 x))))
197.0ms
(- (+ (/ (log (/ -1 x)) (* x (pow (- (log -1) (log (/ -1 x))) 2))) (/ 1 (* (pow x 2) (pow (- (log -1) (log (/ -1 x))) 2)))) (+ (/ (log (/ -1 x)) (- (log -1) (log (/ -1 x)))) (+ (/ (log (/ -1 x)) (* (pow x 2) (pow (- (log -1) (log (/ -1 x))) 3))) (+ (/ 1 (* x (- (log -1) (log (/ -1 x))))) (+ (* 1/2 (/ (log (/ -1 x)) (* (pow x 2) (pow (- (log -1) (log (/ -1 x))) 2)))) (* 1/2 (/ 1 (* (pow x 2) (- (log -1) (log (/ -1 x)))))))))))

prune697.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.1b

localize10.0ms

Local error

Found 1 expressions with local error:

0.0b
(- (- -1 x) (* x (* x 1/2)))

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
1 → 15
Calls

1 calls. Slowest were:

4.0ms
(- (- -1 x) (* x (* x 1/2)))

series10.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

10.0ms
(- (- -1 x) (* x (* x 1/2)))

simplify358.0ms

Counts
4 → 18
Calls

4 calls. Slowest were:

119.0ms
(/ (exp (- -1 x)) (exp (* x (* x 1/2))))
87.0ms
(- (+ x (+ (* 1/2 (pow x 2)) 1)))
78.0ms
(- (+ x (+ (* 1/2 (pow x 2)) 1)))

prune147.0ms

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0.1b

localize17.0ms

Local error

Found 4 expressions with local error:

0.0b
(cbrt (* (* (- (- -1 x) (* x (* x 1/2))) (- (- -1 x) (* x (* x 1/2)))) (- (- -1 x) (* x (* x 1/2)))))
0.0b
(* (- (- -1 x) (* x (* x 1/2))) (- (- -1 x) (* x (* x 1/2))))
0.0b
(* (* (- (- -1 x) (* x (* x 1/2))) (- (- -1 x) (* x (* x 1/2)))) (- (- -1 x) (* x (* x 1/2))))
0.0b
(- (- -1 x) (* x (* x 1/2)))

rewrite139.0ms

Algorithm
rewrite-expression-head
Counts
4 → 146
Calls

4 calls. Slowest were:

66.0ms
(* (* (- (- -1 x) (* x (* x 1/2))) (- (- -1 x) (* x (* x 1/2)))) (- (- -1 x) (* x (* x 1/2))))
44.0ms
(cbrt (* (* (- (- -1 x) (* x (* x 1/2))) (- (- -1 x) (* x (* x 1/2)))) (- (- -1 x) (* x (* x 1/2)))))
17.0ms
(* (- (- -1 x) (* x (* x 1/2))) (- (- -1 x) (* x (* x 1/2))))

series93.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

36.0ms
(cbrt (* (* (- (- -1 x) (* x (* x 1/2))) (- (- -1 x) (* x (* x 1/2)))) (- (- -1 x) (* x (* x 1/2)))))
23.0ms
(* (* (- (- -1 x) (* x (* x 1/2))) (- (- -1 x) (* x (* x 1/2)))) (- (- -1 x) (* x (* x 1/2))))
19.0ms
(* (- (- -1 x) (* x (* x 1/2))) (- (- -1 x) (* x (* x 1/2))))
15.0ms
(- (- -1 x) (* x (* x 1/2)))

simplify25.7s

Counts
142 → 158
Calls

142 calls. Slowest were:

1.3s
(* (- (* x (* x 1/2))) (* (- (- -1 x) (* x (* x 1/2))) (- (- -1 x) (* x (* x 1/2)))))
1.2s
(* (- (* x (* x 1/2))) (* (- (- -1 x) (* x (* x 1/2))) (- (- -1 x) (* x (* x 1/2)))))
974.0ms
(* (* (* (- (- -1 x) (* x (* x 1/2))) (- (- -1 x) (* x (* x 1/2)))) (- (- -1 x) (* x (* x 1/2)))) (* (* (- (- -1 x) (* x (* x 1/2))) (- (- -1 x) (* x (* x 1/2)))) (- (- -1 x) (* x (* x 1/2)))))

prune1.5s

Pruning

6 alts after pruning (3 fresh and 3 done)

Merged error: 0.1b

localize15.0ms

Local error

Found 4 expressions with local error:

7.9b
(log (+ 1 x))
7.9b
(log (+ 1 x))
7.9b
(log (+ 1 x))
2.4b
(log (- 1 (* x x)))

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
4 → 56
Calls

4 calls. Slowest were:

1.0ms
(log (- 1 (* x x)))
1.0ms
(log (+ 1 x))
1.0ms
(log (+ 1 x))

series191.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

108.0ms
(log (- 1 (* x x)))
32.0ms
(log (+ 1 x))
26.0ms
(log (+ 1 x))
24.0ms
(log (+ 1 x))

simplify2.3s

Counts
36 → 68
Calls

36 calls. Slowest were:

328.0ms
(- (+ (/ 1 x) (log -1)) (+ (log (/ -1 x)) (* 1/2 (/ 1 (pow x 2)))))
309.0ms
(- (log -1) (+ (* 2 (log (/ 1 x))) (+ (* 1/2 (/ 1 (pow x 4))) (/ 1 (pow x 2)))))
301.0ms
(- (+ (/ 1 x) (log -1)) (+ (log (/ -1 x)) (* 1/2 (/ 1 (pow x 2)))))

prune620.0ms

Pruning

7 alts after pruning (4 fresh and 3 done)

Merged error: 0.0b

regimes100.0ms

Accuracy

0% (0.5b remaining)

Error of 0.5b against oracle of 0.0b and baseline of 0.5b

bsearch2.0ms

end0.0ms

sample9.4s

Algorithm
intervals