Average Error: 58.5 → 0.2
Time: 20.3s
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. Simplified58.5

    \[\leadsto \color{blue}{\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 2019007 
(FPCore (x)
  :name "Hyperbolic arc-(co)tangent"
  (* (/ 1 2) (log (/ (+ 1 x) (- 1 x)))))

Details

Time bar (total: 19.8s)Debug log

sample241.0ms

Algorithm
intervals

simplify93.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

93.0ms
(* (/ 1 2) (log (/ (+ 1 x) (- 1 x))))

prune9.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 58.7b

localize25.0ms

Local error

Found 2 expressions with local error:

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

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
2 → 57
Calls

2 calls. Slowest were:

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

series84.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

72.0ms
(log (/ (+ x 1) (- 1 x)))
11.0ms
(/ (+ x 1) (- 1 x))

simplify1.4s

Counts
53 → 63
Calls

53 calls. Slowest were:

318.0ms
(/ (* (* (+ x 1) (+ x 1)) (+ x 1)) (* (* (- 1 x) (- 1 x)) (- 1 x)))
152.0ms
(- (+ (* 2 (/ 1 (pow x 2))) (+ (* 2 (/ 1 x)) 1)))
151.0ms
(- (+ (* 2 (/ 1 (pow x 2))) (+ (* 2 (/ 1 x)) 1)))

prune527.0ms

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.0b

localize43.0ms

Local error

Found 3 expressions with local error:

0.1b
(* 2/3 (pow x 3))
0.1b
(* 2/5 (pow x 5))
0.0b
(+ (* 2/3 (pow x 3)) (* 2/5 (pow x 5)))

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
3 → 35
Calls

3 calls. Slowest were:

6.0ms
(+ (* 2/3 (pow x 3)) (* 2/5 (pow x 5)))
3.0ms
(* 2/3 (pow x 3))
2.0ms
(* 2/5 (pow x 5))

series136.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

72.0ms
(+ (* 2/3 (pow x 3)) (* 2/5 (pow x 5)))
33.0ms
(* 2/5 (pow x 5))
32.0ms
(* 2/3 (pow x 3))

simplify111.0ms

Counts
17 → 44
Calls

17 calls. Slowest were:

22.0ms
(* (exp (* 2/3 (pow x 3))) (exp (* 2/5 (pow x 5))))
20.0ms
(+ (* 2/3 (pow x 3)) (* 2/5 (pow x 5)))
18.0ms
(+ (* 2/3 (pow x 3)) (* 2/5 (pow x 5)))

prune497.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.0b

localize17.0ms

Local error

Found 4 expressions with local error:

7.6b
(log (/ 1 (sqrt (- 1 x))))
7.5b
(log (/ (+ x 1) (sqrt (- 1 x))))
0.0b
(/ (+ x 1) (sqrt (- 1 x)))
0.0b
(/ 1 (sqrt (- 1 x)))

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
4 → 121
Calls

4 calls. Slowest were:

3.0ms
(/ (+ x 1) (sqrt (- 1 x)))
2.0ms
(/ 1 (sqrt (- 1 x)))
2.0ms
(log (/ (+ x 1) (sqrt (- 1 x))))

series122.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

43.0ms
(log (/ 1 (sqrt (- 1 x))))
42.0ms
(log (/ (+ x 1) (sqrt (- 1 x))))
24.0ms
(/ (+ x 1) (sqrt (- 1 x)))
13.0ms
(/ 1 (sqrt (- 1 x)))

simplify1.7s

Counts
111 → 133
Calls

111 calls. Slowest were:

279.0ms
(/ (* (* (+ x 1) (+ x 1)) (+ x 1)) (* (* (sqrt (- 1 x)) (sqrt (- 1 x))) (sqrt (- 1 x))))
138.0ms
(+ (* 1/2 x) (+ (* 1/6 (pow x 3)) (* 1/4 (pow x 2))))
109.0ms
(- (+ (* 3/2 x) (* 1/2 (pow x 3))) (* 1/4 (pow x 2)))

prune998.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0b

localize40.0ms

Local error

Found 4 expressions with local error:

7.6b
(log (sqrt (sqrt (- 1 x))))
7.6b
(log (/ 1 (sqrt (- 1 x))))
7.5b
(log (/ (+ x 1) (sqrt (sqrt (- 1 x)))))
0.0b
(/ (+ x 1) (sqrt (sqrt (- 1 x))))

rewrite21.0ms

Algorithm
rewrite-expression-head
Counts
4 → 141
Calls

4 calls. Slowest were:

8.0ms
(/ (+ x 1) (sqrt (sqrt (- 1 x))))
4.0ms
(log (/ (+ x 1) (sqrt (sqrt (- 1 x)))))
3.0ms
(log (sqrt (sqrt (- 1 x))))

series236.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

86.0ms
(log (sqrt (sqrt (- 1 x))))
61.0ms
(log (/ (+ x 1) (sqrt (sqrt (- 1 x)))))
48.0ms
(log (/ 1 (sqrt (- 1 x))))
41.0ms
(/ (+ x 1) (sqrt (sqrt (- 1 x))))

simplify3.9s

Counts
143 → 153
Calls

143 calls. Slowest were:

398.0ms
(- (* 1/4 (log -1)) (+ (* 1/4 (log (/ 1 x))) (+ (* 1/8 (/ 1 (pow x 2))) (* 1/4 (/ 1 x)))))
358.0ms
(+ (* 13/32 (/ (exp (* 1/4 (+ (log (/ 1 x)) (log -1)))) x)) (+ (* 5/4 (exp (* 1/4 (+ (log (/ 1 x)) (log -1))))) (* (exp (* 1/4 (+ (log (/ 1 x)) (log -1)))) x)))
293.0ms
(- (+ (* 5/4 (/ 1 x)) (* 1/4 (log -1))) (+ (* 3/4 (log (/ 1 x))) (* 3/8 (/ 1 (pow x 2)))))

prune1.6s

Pruning

4 alts after pruning (1 fresh and 3 done)

Merged error: 0b

regimes50.0ms

Accuracy

0% (0.2b remaining)

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

bsearch4.0ms

end0.0ms

sample7.9s

Algorithm
intervals