Average Error: 58.5 → 0.0
Time: 12.4s
Precision: 64
Internal Precision: 128
\[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
\[(\left(\log_* (1 + \left(-x\right))\right) \cdot \frac{-1}{2} + \left(\frac{\log_* (1 + x)}{2}\right))_*\]

Error

Bits error versus x

Derivation

  1. Initial program 58.5

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

    \[\leadsto \color{blue}{(\left(\log \left(1 - x\right)\right) \cdot \frac{-1}{2} + \left(\frac{\log_* (1 + x)}{2}\right))_*}\]
  3. Using strategy rm
  4. Applied sub-neg50.4

    \[\leadsto (\left(\log \color{blue}{\left(1 + \left(-x\right)\right)}\right) \cdot \frac{-1}{2} + \left(\frac{\log_* (1 + x)}{2}\right))_*\]
  5. Applied log1p-def0.0

    \[\leadsto (\color{blue}{\left(\log_* (1 + \left(-x\right))\right)} \cdot \frac{-1}{2} + \left(\frac{\log_* (1 + x)}{2}\right))_*\]
  6. Final simplification0.0

    \[\leadsto (\left(\log_* (1 + \left(-x\right))\right) \cdot \frac{-1}{2} + \left(\frac{\log_* (1 + x)}{2}\right))_*\]

Reproduce

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

Details

Time bar (total: 12.1s)Debug log

sample235.0ms

Algorithm
intervals

simplify60.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune18.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 50.2b

localize17.0ms

Local error

Found 2 expressions with local error:

6.3b
(log (- 1 x))
0.0b
(fma (log (- 1 x)) -1/2 (/ (log1p x) 2))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
2 → 28
Calls

2 calls. Slowest were:

1.0ms
(log (- 1 x))
0.0ms
(fma (log (- 1 x)) -1/2 (/ (log1p x) 2))

series183.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

154.0ms
(fma (log (- 1 x)) -1/2 (/ (log1p x) 2))
29.0ms
(log (- 1 x))

simplify1.4s

Counts
14 → 34
Calls

14 calls. Slowest were:

568.0ms
(- (+ x (+ (* 1/3 (pow x 3)) (* 1/2 (pow x 2)))))
296.0ms
(- (log -1) (+ (log (/ 1 x)) (+ (* 1/2 (/ 1 (pow x 2))) (/ 1 x))))
235.0ms
(- (+ (log (/ -1 x)) (+ (* 1/2 (/ 1 (pow x 2))) (/ 1 x))))

prune187.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0b

localize8.0ms

Local error

Found 2 expressions with local error:

0.0b
(fma (log1p (- x)) -1/2 (/ (log1p x) 2))
0.0b
(log1p (- x))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
2 → 21
Calls

2 calls. Slowest were:

0.0ms
(log1p (- x))
0.0ms
(fma (log1p (- x)) -1/2 (/ (log1p x) 2))

series196.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

158.0ms
(fma (log1p (- x)) -1/2 (/ (log1p x) 2))
37.0ms
(log1p (- x))

simplify1.0s

Counts
7 → 27
Calls

7 calls. Slowest were:

303.0ms
(- (log -1) (+ (log (/ 1 x)) (+ (* 1/2 (/ 1 (pow x 2))) (/ 1 x))))
256.0ms
(- (+ x (+ (* 1/3 (pow x 3)) (* 1/2 (pow x 2)))))
224.0ms
(- (+ (log (/ -1 x)) (+ (* 1/2 (/ 1 (pow x 2))) (/ 1 x))))

prune237.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize34.0ms

Local error

Found 3 expressions with local error:

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

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
3 → 42
Calls

3 calls. Slowest were:

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

series107.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

68.0ms
(+ (* 1/3 (pow x 3)) (* 1/5 (pow x 5)))
23.0ms
(* 1/5 (pow x 5))
15.0ms
(* 1/3 (pow x 3))

simplify120.0ms

Counts
17 → 51
Calls

17 calls. Slowest were:

39.0ms
(* (exp (* 1/3 (pow x 3))) (exp (* 1/5 (pow x 5))))
17.0ms
(+ (* 1/3 (pow x 3)) (* 1/5 (pow x 5)))
12.0ms
(+ (* 1/3 (pow x 3)) (* 1/5 (pow x 5)))

prune546.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes31.0ms

Accuracy

0% (0.0b remaining)

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

bsearch1.0ms

end0.0ms

sample7.8s

Algorithm
intervals