Average Error: 30.8 → 0.2
Time: 10.2s
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 30.8

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

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

Details

Time bar (total: 9.9s)Debug log

sample148.0ms

Algorithm
intervals

simplify85.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune8.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 31.2b

localize12.0ms

Local error

Found 2 expressions with local error:

30.1b
(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))

series67.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

40.0ms
(+ x (sqrt (fma x x -1)))
26.0ms
(sqrt (fma x x -1))

simplify951.0ms

Counts
10 → 32
Calls

10 calls. Slowest were:

359.0ms
(- (+ (* 1/2 (/ (pow x 2) (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 4) (pow (sqrt -1) 3))))
163.0ms
(- x (+ (* 1/8 (/ 1 (pow x 3))) (* 1/2 (/ 1 x))))
156.0ms
(- (* 2 x) (+ (* 1/8 (/ 1 (pow x 3))) (* 1/2 (/ 1 x))))

prune178.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0b

localize22.0ms

Local error

Found 1 expressions with local error:

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

rewrite3.0ms

Algorithm
rewrite-expression-head
Counts
1 → 24
Calls

1 calls. Slowest were:

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

series15.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify434.0ms

Counts
15 → 27
Calls

15 calls. Slowest were:

383.0ms
(/ (* (* (/ 1/8 x) (/ 1/8 x)) (/ 1/8 x)) (* (* (* x x) (* x x)) (* x x)))
24.0ms
(- (log (/ 1/8 x)) (log (* x x)))
5.0ms
(/ (* (cbrt (/ 1/8 x)) (cbrt (/ 1/8 x))) x)

prune171.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize16.0ms

Local error

Found 4 expressions with local error:

31.0b
(cbrt (fma x x -1))
31.0b
(cbrt (fma x x -1))
0.3b
(* (fabs (cbrt (fma x x -1))) (sqrt (cbrt (fma x x -1))))
0.1b
(sqrt (cbrt (fma x x -1)))

rewrite8.0ms

Algorithm
rewrite-expression-head
Counts
4 → 69
Calls

4 calls. Slowest were:

5.0ms
(* (fabs (cbrt (fma x x -1))) (sqrt (cbrt (fma x x -1))))
1.0ms
(sqrt (cbrt (fma x x -1)))
1.0ms
(cbrt (fma x x -1))

series364.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

98.0ms
(* (fabs (cbrt (fma x x -1))) (sqrt (cbrt (fma x x -1))))
93.0ms
(cbrt (fma x x -1))
87.0ms
(sqrt (cbrt (fma x x -1)))
86.0ms
(cbrt (fma x x -1))

simplify2.3s

Counts
40 → 81
Calls

40 calls. Slowest were:

250.0ms
(- (pow -1 1/6) (+ (* 1/6 (* (pow x 2) (pow -1 1/6))) (* 5/72 (* (pow x 4) (pow -1 1/6)))))
220.0ms
(- (* (fabs (pow (fma x x -1) 1/3)) (pow -1 1/6)) (+ (* 5/72 (* (* (pow x 4) (fabs (pow (fma x x -1) 1/3))) (pow -1 1/6))) (* 1/6 (* (* (pow x 2) (fabs (pow (fma x x -1) 1/3))) (pow -1 1/6)))))
217.0ms
(- (pow -1 1/3) (+ (* 1/3 (* (pow x 2) (pow -1 1/3))) (* 1/9 (* (pow x 4) (pow -1 1/3)))))

prune917.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes38.0ms

Accuracy

0% (0.1b remaining)

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

bsearch1.0ms

end0.0ms

sample4.2s

Algorithm
intervals