Average Error: 58.6 → 0.2
Time: 15.7s
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.6

    \[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
  2. Simplified58.6

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

Details

Time bar (total: 15.4s)Debug log

sample250.0ms

Algorithm
intervals

simplify119.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune7.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 59.3b

localize13.0ms

Local error

Found 2 expressions with local error:

5.2b
(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:

84.0ms
(log (/ (+ x 1) (- 1 x)))
16.0ms
(/ (+ x 1) (- 1 x))

simplify1.8s

Counts
53 → 63
Calls

53 calls. Slowest were:

366.0ms
(/ (* (cbrt (+ x 1)) (cbrt (+ x 1))) (* (cbrt (- 1 x)) (cbrt (- 1 x))))
361.0ms
(/ (* (* (+ x 1) (+ x 1)) (+ x 1)) (* (* (- 1 x) (- 1 x)) (- 1 x)))
155.0ms
(- (+ (* 2 (/ 1 (pow x 2))) (+ (* 2 (/ 1 x)) 1)))

prune408.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.0b

localize20.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)))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
3 → 35
Calls

3 calls. Slowest were:

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

series93.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

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

simplify97.0ms

Counts
17 → 44
Calls

17 calls. Slowest were:

21.0ms
(+ (* 2/3 (pow x 3)) (* 2/5 (pow x 5)))
20.0ms
(+ (* 2/3 (pow x 3)) (* 2/5 (pow x 5)))
17.0ms
(* (exp (* 2/3 (pow x 3))) (exp (* 2/5 (pow x 5))))

prune365.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0.0b

localize16.0ms

Local error

Found 4 expressions with local error:

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

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
4 → 110
Calls

4 calls. Slowest were:

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

series241.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

114.0ms
(log (sqrt (/ (+ x 1) (- 1 x))))
80.0ms
(log (sqrt (/ (+ x 1) (- 1 x))))
24.0ms
(sqrt (/ (+ x 1) (- 1 x)))
23.0ms
(sqrt (/ (+ x 1) (- 1 x)))

simplify3.1s

Counts
88 → 122
Calls

88 calls. Slowest were:

419.0ms
(- (log (sqrt -1)) (+ (/ 1 (* (pow x 2) (pow (sqrt -1) 2))) (+ (/ 1 (* (pow x 2) (pow (sqrt -1) 4))) (/ 1 (* x (pow (sqrt -1) 2))))))
366.0ms
(- (log (sqrt -1)) (+ (/ 1 (* (pow x 2) (pow (sqrt -1) 2))) (+ (/ 1 (* (pow x 2) (pow (sqrt -1) 4))) (/ 1 (* x (pow (sqrt -1) 2))))))
364.0ms
(- (log (sqrt -1)) (+ (/ 1 (* (pow x 2) (pow (sqrt -1) 2))) (+ (/ 1 (* (pow x 2) (pow (sqrt -1) 4))) (/ 1 (* x (pow (sqrt -1) 2))))))

prune970.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0.0b

regimes29.0ms

Accuracy

0% (0.2b remaining)

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

bsearch2.0ms

end0.0ms

sample7.8s

Algorithm
intervals