Average Error: 31.0 → 0.2
Time: 10.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.0

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

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

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

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

    \[\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 2018362 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-cosine"
  (log (+ x (sqrt (- (* x x) 1)))))

Details

Time bar (total: 5.6s)Debug log

start206.0ms

Algorithm
intervals

setup92.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 31.0b

localize15.0ms

Local error

Found 3 expressions with local error:

29.9b
(sqrt (fma x x -1))
0.0b
(+ x (sqrt (fma x x -1)))
0.0b
(log (+ x (sqrt (fma x x -1))))

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
3 → 42
Calls

3 calls. Slowest were:

1.0ms
(log (+ x (sqrt (fma x x -1))))
1.0ms
(+ x (sqrt (fma x x -1)))
1.0ms
(sqrt (fma x x -1))

series168.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

95.0ms
(log (+ x (sqrt (fma x x -1))))
40.0ms
(sqrt (fma x x -1))
33.0ms
(+ x (sqrt (fma x x -1)))

simplify3.5s

Counts
19 → 51
Calls

19 calls. Slowest were:

853.0ms
(+ (log -1/2) (+ (log (/ -1 x)) (+ (* 3/32 (/ 1 (pow x 4))) (* 1/4 (/ 1 (pow x 2))))))
534.0ms
(- (+ (* 1/2 (/ (pow x 2) (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 4) (pow (sqrt -1) 3))))
371.0ms
(log (- (* x x) (* (sqrt (fma x x -1)) (sqrt (fma x x -1)))))

prune586.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize45.0ms

Local error

Found 1 expressions with local error:

0.1b
(/ (/ 1/8 x) (* x x))

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
1 → 24
Calls

1 calls. Slowest were:

6.0ms
(/ (/ 1/8 x) (* x x))

series19.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

19.0ms
(/ (/ 1/8 x) (* x x))

simplify645.0ms

Counts
15 → 27
Calls

15 calls. Slowest were:

571.0ms
(/ (* (* (/ 1/8 x) (/ 1/8 x)) (/ 1/8 x)) (* (* (* x x) (* x x)) (* x x)))
39.0ms
(- (log (/ 1/8 x)) (log (* x x)))
12.0ms
(/ (* (cbrt (/ 1/8 x)) (cbrt (/ 1/8 x))) x)

prune373.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes18.0ms

Accuracy

0% (0.2b remaining)

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

bsearch1.0ms