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

    \[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
  2. Initial simplification50.5

    \[\leadsto (\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.5

    \[\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))_*\]

Runtime

Time bar (total: 18.4s)Debug logProfile

start522.0ms

Algorithm
intervals

setup144.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 51.2b

localize27.0ms

Local error

Found 2 expressions with local error:

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

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

series160.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

136.0ms
(fma (log (- 1 x)) -1/2 (/ (log1p x) 2))
24.0ms
(log (- 1 x))

simplify1.3s

Counts
14 → 34
Calls

14 calls. Slowest were:

402.0ms
(- (log -1) (+ (log (/ 1 x)) (+ (* 1/2 (/ 1 (pow x 2))) (/ 1 x))))
362.0ms
(- (+ x (+ (* 1/3 (pow x 3)) (* 1/2 (pow x 2)))))
269.0ms
(- (+ (log (/ -1 x)) (+ (* 1/2 (/ 1 (pow x 2))) (/ 1 x))))

prune235.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize8.0ms

Local error

Found 1 expressions with local error:

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

rewrite0.0ms

Algorithm
rewrite-expression-head
Counts
1 → 10
Calls

1 calls. Slowest were:

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

series129.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify264.0ms

Counts
3 → 13
Calls

3 calls. Slowest were:

123.0ms
(- (+ (* 1/3 (/ 1 (pow x 3))) (/ 1 x)) (* 1/2 (log -1)))
85.0ms
(+ (/ 1 x) (+ (* 1/3 (/ 1 (pow x 3))) (* 1/2 (log -1))))
55.0ms
(+ x (+ (* 1/3 (pow x 3)) (* 1/5 (pow x 5))))

prune158.0ms

Pruning

1 alts after pruning (0 fresh and 1 done)

Merged error: 0.0b

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