Average Error: 31.2 → 0.3
Time: 9.5s
Precision: 64
Internal Precision: 128
\[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
\[\log \left((2 \cdot x + \left(\frac{\frac{-1}{2}}{x}\right))_* - \frac{\frac{\frac{1}{8}}{x}}{x \cdot x}\right)\]

Error

Bits error versus x

Derivation

  1. Initial program 31.2

    \[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
  2. Simplified31.2

    \[\leadsto \color{blue}{\log \left(x + \sqrt{(x \cdot x + -1)_*}\right)}\]
  3. Taylor expanded around inf 0.3

    \[\leadsto \log \color{blue}{\left(2 \cdot x - \left(\frac{1}{8} \cdot \frac{1}{{x}^{3}} + \frac{1}{2} \cdot \frac{1}{x}\right)\right)}\]
  4. Simplified0.3

    \[\leadsto \log \color{blue}{\left((2 \cdot x + \left(\frac{\frac{-1}{2}}{x}\right))_* - \frac{\frac{\frac{1}{8}}{x}}{x \cdot x}\right)}\]
  5. Final simplification0.3

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

Reproduce

herbie shell --seed 2019008 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-cosine"
  (log (+ x (sqrt (- (* x x) 1)))))

Details

Time bar (total: 9.2s)Debug log

sample154.0ms

Algorithm
intervals

simplify102.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

102.0ms
(log (+ x (sqrt (- (* x x) 1))))

prune343.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 31.2b

localize23.0ms

Local error

Found 2 expressions with local error:

30.1b
(sqrt (fma x x -1))
0.0b
(+ x (sqrt (fma x x -1)))

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
2 → 26
Calls

2 calls. Slowest were:

2.0ms
(+ x (sqrt (fma x x -1)))
2.0ms
(sqrt (fma x x -1))

series89.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

52.0ms
(+ x (sqrt (fma x x -1)))
37.0ms
(sqrt (fma x x -1))

simplify1.1s

Counts
10 → 32
Calls

10 calls. Slowest were:

434.0ms
(- (+ (* 1/2 (/ (pow x 2) (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 4) (pow (sqrt -1) 3))))
213.0ms
(- (* 2 x) (+ (* 1/8 (/ 1 (pow x 3))) (* 1/2 (/ 1 x))))
177.0ms
(- x (+ (* 1/8 (/ 1 (pow x 3))) (* 1/2 (/ 1 x))))

prune248.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize28.0ms

Local error

Found 2 expressions with local error:

0.1b
(/ (/ 1/8 x) (* x x))
0.0b
(log (- (fma 2 x (/ -1/2 x)) (/ (/ 1/8 x) (* x x))))

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
2 → 43
Calls

2 calls. Slowest were:

8.0ms
(log (- (fma 2 x (/ -1/2 x)) (/ (/ 1/8 x) (* x x))))
4.0ms
(/ (/ 1/8 x) (* x x))

series95.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

80.0ms
(log (- (fma 2 x (/ -1/2 x)) (/ (/ 1/8 x) (* x x))))
15.0ms
(/ (/ 1/8 x) (* x x))

simplify2.1s

Counts
27 → 49
Calls

27 calls. Slowest were:

650.0ms
(/ (* (* (/ 1/8 x) (/ 1/8 x)) (/ 1/8 x)) (* (* (* x x) (* x x)) (* x x)))
347.0ms
(log (- (pow (fma 2 x (/ -1/2 x)) 3) (pow (/ (/ 1/8 x) (* x x)) 3)))
299.0ms
(- (log 2) (+ (log (/ 1 x)) (+ (* 3/32 (/ 1 (pow x 4))) (* 1/4 (/ 1 (pow x 2))))))

prune509.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes18.0ms

Accuracy

0% (0.2b remaining)

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

bsearch1.0ms

end0.0ms

sample4.3s

Algorithm
intervals