Average Error: 58.5 → 0.3
Time: 20.4s
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.3

    \[\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.3

    \[\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 2019004 
(FPCore (x)
  :name "Hyperbolic arc-(co)tangent"
  (* (/ 1 2) (log (/ (+ 1 x) (- 1 x)))))

Details

Time bar (total: 19.8s)Debug log

sample269.0ms

Algorithm
intervals

simplify65.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune12.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 58.0b

localize13.0ms

Local error

Found 2 expressions with local error:

5.1b
(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))
1.0ms
(log (/ (+ x 1) (- 1 x)))

series101.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify1.3s

Counts
53 → 63
Calls

53 calls. Slowest were:

342.0ms
(/ (* (* (+ x 1) (+ x 1)) (+ x 1)) (* (* (- 1 x) (- 1 x)) (- 1 x)))
161.0ms
(- (+ (* 2 (/ 1 (pow x 2))) (+ (* 2 (/ 1 x)) 1)))
141.0ms
(- (+ (* 2 (/ 1 (pow x 2))) (+ (* 2 (/ 1 x)) 1)))

prune624.0ms

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 0.0b

localize43.0ms

Local error

Found 4 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)))
0.0b
(+ (* 2 x) (+ (* 2/3 (pow x 3)) (* 2/5 (pow x 5))))

rewrite23.0ms

Algorithm
rewrite-expression-head
Counts
4 → 48
Calls

4 calls. Slowest were:

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

series132.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

58.0ms
(+ (* 2/3 (pow x 3)) (* 2/5 (pow x 5)))
27.0ms
(* 2/3 (pow x 3))
25.0ms
(+ (* 2 x) (+ (* 2/3 (pow x 3)) (* 2/5 (pow x 5))))
22.0ms
(* 2/5 (pow x 5))

simplify562.0ms

Counts
23 → 60
Calls

23 calls. Slowest were:

167.0ms
(* (exp (* 2 x)) (* (exp (* 2/3 (pow x 3))) (exp (* 2/5 (pow x 5)))))
152.0ms
(* (exp (* 2 x)) (exp (+ (* 2/3 (pow x 3)) (* 2/5 (pow x 5)))))
52.0ms
(+ (* 2 x) (+ (* 2/3 (pow x 3)) (* 2/5 (pow x 5))))

prune731.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.0b

localize24.0ms

Local error

Found 4 expressions with local error:

5.1b
(log (/ (+ x 1) (- 1 x)))
5.1b
(log (/ (+ x 1) (- 1 x)))
5.1b
(log (/ (+ x 1) (- 1 x)))
0.1b
(cbrt (log (/ (+ x 1) (- 1 x))))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
4 → 90
Calls

4 calls. Slowest were:

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

series419.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

161.0ms
(cbrt (log (/ (+ x 1) (- 1 x))))
95.0ms
(log (/ (+ x 1) (- 1 x)))
91.0ms
(log (/ (+ x 1) (- 1 x)))
72.0ms
(log (/ (+ x 1) (- 1 x)))

simplify2.4s

Counts
70 → 102
Calls

70 calls. Slowest were:

461.0ms
(- (+ (* 2/3 (* (/ 1 x) (pow (/ 1 (pow (log -1) 2)) 1/3))) (pow (log -1) 1/3)) (* 4/9 (* (/ 1 (pow x 2)) (pow (/ 1 (pow (log -1) 5)) 1/3))))
391.0ms
(- (+ (* 2/3 (* (/ 1 x) (pow (/ 1 (pow (log -1) 2)) 1/3))) (pow (log -1) 1/3)) (* 4/9 (* (/ 1 (pow x 2)) (pow (/ 1 (pow (log -1) 5)) 1/3))))
195.0ms
(+ (* 22/405 (* (pow x 4) (exp (* 1/3 (+ (log 2) (log x)))))) (+ (exp (* 1/3 (+ (log 2) (log x)))) (* 1/9 (* (pow x 2) (exp (* 1/3 (+ (log 2) (log x))))))))

prune1.0s

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.0b

localize44.0ms

Local error

Found 4 expressions with local error:

5.3b
(log (sqrt (+ 1 x)))
5.1b
(log (/ (+ x 1) (- 1 x)))
5.1b
(log (/ (+ x 1) (- 1 x)))
5.1b
(log (/ (sqrt (+ x 1)) (- 1 x)))

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
4 → 105
Calls

4 calls. Slowest were:

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

series245.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

76.0ms
(log (/ (+ x 1) (- 1 x)))
71.0ms
(log (/ (sqrt (+ x 1)) (- 1 x)))
53.0ms
(log (/ (+ x 1) (- 1 x)))
44.0ms
(log (sqrt (+ 1 x)))

simplify1.8s

Counts
84 → 117
Calls

84 calls. Slowest were:

155.0ms
(- (+ (* 1/2 x) (* 1/6 (pow x 3))) (* 1/4 (pow x 2)))
123.0ms
(+ (* 3/2 x) (+ (* 1/2 (pow x 3)) (* 1/4 (pow x 2))))
95.0ms
(log (/ (* (cbrt (+ x 1)) (cbrt (+ x 1))) (* (cbrt (- 1 x)) (cbrt (- 1 x)))))

prune1.8s

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.0b

regimes30.0ms

Accuracy

0% (0.2b remaining)

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

bsearch2.0ms

end0.0ms

sample8.0s

Algorithm
intervals