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

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

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

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

Details

Time bar (total: 10.3s)Debug log

sample270.0ms

Algorithm
intervals

simplify97.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune11.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 51.0b

localize16.0ms

Local error

Found 1 expressions with local error:

5.3b
(log (- 1 x))

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
1 → 18
Calls

1 calls. Slowest were:

1.0ms
(log (- 1 x))

series35.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

35.0ms
(log (- 1 x))

simplify914.0ms

Counts
11 → 21
Calls

11 calls. Slowest were:

320.0ms
(- (log -1) (+ (log (/ 1 x)) (+ (* 1/2 (/ 1 (pow x 2))) (/ 1 x))))
306.0ms
(- (+ x (+ (* 1/3 (pow x 3)) (* 1/2 (pow x 2)))))
231.0ms
(- (+ (log (/ -1 x)) (+ (* 1/2 (/ 1 (pow x 2))) (/ 1 x))))

prune187.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0b

localize12.0ms

Local error

Found 1 expressions with local error:

0.0b
(log1p (- x))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 11
Calls

1 calls. Slowest were:

0.0ms
(log1p (- x))

series24.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

24.0ms
(log1p (- x))

simplify893.0ms

Counts
4 → 14
Calls

4 calls. Slowest were:

340.0ms
(- (+ (log (/ -1 x)) (+ (* 1/2 (/ 1 (pow x 2))) (/ 1 x))))
293.0ms
(- (log -1) (+ (log (/ 1 x)) (+ (* 1/2 (/ 1 (pow x 2))) (/ 1 x))))
258.0ms
(- (+ x (+ (* 1/3 (pow x 3)) (* 1/2 (pow x 2)))))

prune163.0ms

Pruning

1 alts after pruning (0 fresh and 1 done)

Merged error: 0b

end0.0ms

sample7.6s

Algorithm
intervals