Average Error: 31.1 → 0.2
Time: 10.2s
Precision: 64
Internal Precision: 128
\[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
\[\log \left(x + \left(\left(x + \frac{\frac{-1}{2}}{x}\right) - \frac{\frac{\frac{1}{8}}{x}}{x \cdot x}\right)\right)\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 31.1

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

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

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

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

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

Reproduce

herbie shell --seed 2018360 
(FPCore (x)
  :name "Hyperbolic arc-cosine"
  (log (+ x (sqrt (- (* x x) 1)))))

Details

Time bar (total: 4.8s)Debug log

start145.0ms

Algorithm
intervals

setup76.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 29.8b

localize13.0ms

Local error

Found 2 expressions with local error:

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

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
2 → 24
Calls

2 calls. Slowest were:

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

series49.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

26.0ms
(+ x (sqrt (+ -1 (* x x))))
23.0ms
(sqrt (+ -1 (* x x)))

simplify980.0ms

Counts
12 → 30
Calls

12 calls. Slowest were:

299.0ms
(- (+ (* 1/2 (/ (pow x 2) (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 4) (pow (sqrt -1) 3))))
204.0ms
(sqrt (- (* -1 -1) (* (* x x) (* x x))))
78.0ms
(- x (+ (* 1/8 (/ 1 (pow x 3))) (* 1/2 (/ 1 x))))

prune251.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize26.0ms

Local error

Found 3 expressions with local error:

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

rewrite47.0ms

Algorithm
rewrite-expression-head
Counts
3 → 54
Calls

3 calls. Slowest were:

28.0ms
(- (+ (/ -1/2 x) x) (/ (/ 1/8 x) (* x x)))
11.0ms
(+ x (- (+ (/ -1/2 x) x) (/ (/ 1/8 x) (* x x))))
6.0ms
(/ (/ 1/8 x) (* x x))

series74.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

31.0ms
(+ x (- (+ (/ -1/2 x) x) (/ (/ 1/8 x) (* x x))))
26.0ms
(/ (/ 1/8 x) (* x x))
17.0ms
(- (+ (/ -1/2 x) x) (/ (/ 1/8 x) (* x x)))

simplify2.2s

Counts
36 → 63
Calls

36 calls. Slowest were:

549.0ms
(* (+ (* (/ -1/2 x) (/ -1/2 x)) (- (* x x) (* (/ -1/2 x) x))) (* x x))
340.0ms
(/ (* (* (/ 1/8 x) (/ 1/8 x)) (/ 1/8 x)) (* (* (* x x) (* x x)) (* x x)))
226.0ms
(- (* (+ (pow (/ -1/2 x) 3) (pow x 3)) (* x x)) (* (+ (* (/ -1/2 x) (/ -1/2 x)) (- (* x x) (* (/ -1/2 x) x))) (/ 1/8 x)))

prune849.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes36.0ms

Accuracy

0% (0.2b remaining)

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

bsearch2.0ms