Average Error: 58.5 → 0.2
Time: 30.6s
Precision: 64
Internal Precision: 128
\[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
\[\left(x \cdot 2 + \left(\frac{2}{5} \cdot {x}^{5} + {x}^{3} \cdot \frac{2}{3}\right)\right) \cdot \frac{1}{2}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 58.5

    \[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
  2. Initial simplification58.5

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

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

    \[\leadsto \left(x \cdot 2 + \left(\frac{2}{5} \cdot {x}^{5} + {x}^{3} \cdot \frac{2}{3}\right)\right) \cdot \frac{1}{2}\]

Reproduce

herbie shell --seed 2018360 
(FPCore (x)
  :name "Hyperbolic arc-(co)tangent"
  (* (/ 1 2) (log (/ (+ 1 x) (- 1 x)))))

Details

Time bar (total: 16.3s)Debug log

start394.0ms

Algorithm
intervals

setup114.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 57.1b

localize29.0ms

Local error

Found 2 expressions with local error:

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

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
2 → 57
Calls

2 calls. Slowest were:

6.0ms
(/ (+ x 1) (- 1 x))
3.0ms
(log (/ (+ x 1) (- 1 x)))

series121.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

98.0ms
(log (/ (+ x 1) (- 1 x)))
23.0ms
(/ (+ x 1) (- 1 x))

simplify1.1s

Counts
53 → 63
Calls

53 calls. Slowest were:

328.0ms
(/ (* (* (+ x 1) (+ x 1)) (+ x 1)) (* (* (- 1 x) (- 1 x)) (- 1 x)))
98.0ms
(- (+ (* 2 (/ 1 (pow x 2))) (+ (* 2 (/ 1 x)) 1)))
87.0ms
(- (+ (* 2 (/ 1 (pow x 2))) (+ (* 2 (/ 1 x)) 1)))

prune765.0ms

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.0b

localize24.0ms

Local error

Found 2 expressions with local error:

0.2b
(* 2/3 (pow x 3))
0.1b
(* 2/5 (pow x 5))

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
2 → 24
Calls

2 calls. Slowest were:

7.0ms
(* 2/3 (pow x 3))
2.0ms
(* 2/5 (pow x 5))

series62.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

35.0ms
(* 2/5 (pow x 5))
27.0ms
(* 2/3 (pow x 3))

simplify56.0ms

Counts
13 → 30
Calls

13 calls. Slowest were:

10.0ms
(* 2/3 (pow x 3))
10.0ms
(* 2/3 (pow x 3))
10.0ms
(* 2/3 (pow x 3))

prune580.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.0b

localize40.0ms

Local error

Found 4 expressions with local error:

5.8b
(log (/ (+ 1 x) (- 1 (pow x 3))))
5.8b
(log (+ (* 1 1) (+ (* x x) (* 1 x))))
0.0b
(+ (log (/ (+ 1 x) (- 1 (pow x 3)))) (log (+ (* 1 1) (+ (* x x) (* 1 x)))))
0.0b
(/ (+ 1 x) (- 1 (pow x 3)))

rewrite39.0ms

Algorithm
rewrite-expression-head
Counts
4 → 109
Calls

4 calls. Slowest were:

19.0ms
(+ (log (/ (+ 1 x) (- 1 (pow x 3)))) (log (+ (* 1 1) (+ (* x x) (* 1 x)))))
7.0ms
(log (+ (* 1 1) (+ (* x x) (* 1 x))))
7.0ms
(/ (+ 1 x) (- 1 (pow x 3)))

series255.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

164.0ms
(+ (log (/ (+ 1 x) (- 1 (pow x 3)))) (log (+ (* 1 1) (+ (* x x) (* 1 x)))))
36.0ms
(log (/ (+ 1 x) (- 1 (pow x 3))))
35.0ms
(log (+ (* 1 1) (+ (* x x) (* 1 x))))
19.0ms
(/ (+ 1 x) (- 1 (pow x 3)))

simplify4.5s

Counts
93 → 121
Calls

93 calls. Slowest were:

400.0ms
(- (+ (/ 1 x) (+ (* 2 (log (/ -1 x))) (log -1))) (* 1/2 (/ 1 (pow x 2))))
350.0ms
(/ (* (* (+ 1 x) (+ 1 x)) (+ 1 x)) (* (* (- 1 (pow x 3)) (- 1 (pow x 3))) (- 1 (pow x 3))))
279.0ms
(log (- (* (* 1 1) (* 1 1)) (* (+ (* x x) (* 1 x)) (+ (* x x) (* 1 x)))))

prune1.6s

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.0b

localize28.0ms

Local error

Found 4 expressions with local error:

5.8b
(log (/ (+ 1 x) (- 1 (pow x 3))))
5.8b
(log (/ (+ 1 x) (- 1 (pow x 3))))
5.8b
(log (/ (+ 1 x) (- 1 (pow x 3))))
5.8b
(log (+ (* 1 1) (+ (* x x) (* 1 x))))

rewrite20.0ms

Algorithm
rewrite-expression-head
Counts
4 → 93
Calls

4 calls. Slowest were:

7.0ms
(log (+ (* 1 1) (+ (* x x) (* 1 x))))
3.0ms
(log (/ (+ 1 x) (- 1 (pow x 3))))
3.0ms
(log (/ (+ 1 x) (- 1 (pow x 3))))

series187.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

61.0ms
(log (/ (+ 1 x) (- 1 (pow x 3))))
51.0ms
(log (/ (+ 1 x) (- 1 (pow x 3))))
45.0ms
(log (/ (+ 1 x) (- 1 (pow x 3))))
30.0ms
(log (+ (* 1 1) (+ (* x x) (* 1 x))))

simplify4.6s

Counts
73 → 105
Calls

73 calls. Slowest were:

539.0ms
(- (+ (* 2 (log (/ 1 x))) (+ (log -1) (/ 1 x))) (* 1/2 (/ 1 (pow x 2))))
376.0ms
(- (+ (/ 1 x) (+ (* 2 (log (/ -1 x))) (log -1))) (* 1/2 (/ 1 (pow x 2))))
334.0ms
(- (+ (/ 1 x) (+ (* 2 (log (/ -1 x))) (log -1))) (* 1/2 (/ 1 (pow x 2))))

prune1.7s

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0.0b

regimes65.0ms

Accuracy

0% (0.2b remaining)

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

bsearch4.0ms