Average Error: 31.1 → 0.2
Time: 19.0s
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.1

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

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

Details

Time bar (total: 13.8s)Debug log

start160.0ms

Algorithm
intervals

setup129.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 29.8b

localize20.0ms

Local error

Found 2 expressions with local error:

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

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
2 → 26
Calls

2 calls. Slowest were:

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

series77.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify857.0ms

Counts
10 → 32
Calls

10 calls. Slowest were:

296.0ms
(- (+ (* 1/2 (/ (pow x 2) (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 4) (pow (sqrt -1) 3))))
148.0ms
(- (* 2 x) (+ (* 1/8 (/ 1 (pow x 3))) (* 1/2 (/ 1 x))))
124.0ms
(- x (+ (* 1/8 (/ 1 (pow x 3))) (* 1/2 (/ 1 x))))

prune342.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize22.0ms

Local error

Found 2 expressions with local error:

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

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
2 → 69
Calls

2 calls. Slowest were:

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

series36.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

18.0ms
(- (fma 2 x (/ -1/2 x)) (/ (/ 1/8 x) (* x x)))
17.0ms
(/ (/ 1/8 x) (* x x))

simplify11.0s

Counts
75 → 75
Calls

75 calls. Slowest were:

569.0ms
(fma 1 (fma 2 x (/ -1/2 x)) (- (* (/ 1 (* x x)) (/ 1/8 x))))
525.0ms
(fma (sqrt (fma 2 x (/ -1/2 x))) (sqrt (fma 2 x (/ -1/2 x))) (- (* (/ 1 (* x x)) (/ 1/8 x))))
525.0ms
(fma (* (cbrt (fma 2 x (/ -1/2 x))) (cbrt (fma 2 x (/ -1/2 x)))) (cbrt (fma 2 x (/ -1/2 x))) (- (* (/ 1 (* x x)) (/ 1/8 x))))

prune1.1s

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