Average Error: 31.2 → 0.1
Time: 17.4s
Precision: 64
Internal Precision: 128
\[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
\[\log \left(x + \left(\sqrt{x - 1} \cdot \sqrt{\sqrt{1 + x}}\right) \cdot \sqrt{\sqrt{1 + x}}\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.2

    \[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
  2. Using strategy rm
  3. Applied difference-of-sqr-131.2

    \[\leadsto \log \left(x + \sqrt{\color{blue}{\left(x + 1\right) \cdot \left(x - 1\right)}}\right)\]
  4. Applied sqrt-prod0.1

    \[\leadsto \log \left(x + \color{blue}{\sqrt{x + 1} \cdot \sqrt{x - 1}}\right)\]
  5. Using strategy rm
  6. Applied add-sqr-sqrt0.1

    \[\leadsto \log \left(x + \sqrt{\color{blue}{\sqrt{x + 1} \cdot \sqrt{x + 1}}} \cdot \sqrt{x - 1}\right)\]
  7. Applied sqrt-prod0.1

    \[\leadsto \log \left(x + \color{blue}{\left(\sqrt{\sqrt{x + 1}} \cdot \sqrt{\sqrt{x + 1}}\right)} \cdot \sqrt{x - 1}\right)\]
  8. Applied associate-*l*0.1

    \[\leadsto \log \left(x + \color{blue}{\sqrt{\sqrt{x + 1}} \cdot \left(\sqrt{\sqrt{x + 1}} \cdot \sqrt{x - 1}\right)}\right)\]
  9. Final simplification0.1

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

Reproduce

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

Details

Time bar (total: 17.0s)Debug log

sample139.0ms

Algorithm
intervals

simplify86.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune9.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 29.8b

localize23.0ms

Local error

Found 2 expressions with local error:

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

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
2 → 25
Calls

2 calls. Slowest were:

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

series67.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

39.0ms
(+ x (sqrt (- (* x x) 1)))
27.0ms
(sqrt (- (* x x) 1))

simplify1.3s

Counts
13 → 31
Calls

13 calls. Slowest were:

414.0ms
(- (+ (* 1/2 (/ (pow x 2) (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 4) (pow (sqrt -1) 3))))
159.0ms
(- (* 2 x) (+ (* 1/8 (/ 1 (pow x 3))) (* 1/2 (/ 1 x))))
128.0ms
(- x (+ (* 1/8 (/ 1 (pow x 3))) (* 1/2 (/ 1 x))))

prune197.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0b

localize17.0ms

Local error

Found 3 expressions with local error:

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

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
3 → 57
Calls

3 calls. Slowest were:

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

series96.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

54.0ms
(* (sqrt (+ x 1)) (sqrt (- x 1)))
31.0ms
(+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))
10.0ms
(sqrt (+ x 1))

simplify2.0s

Counts
43 → 66
Calls

43 calls. Slowest were:

655.0ms
(* (* (* (sqrt (+ x 1)) (sqrt (+ x 1))) (sqrt (+ x 1))) (* (* (sqrt (- x 1)) (sqrt (- x 1))) (sqrt (- x 1))))
345.0ms
(- (+ (* 1/2 (/ (pow x 2) (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 4) (pow (sqrt -1) 3))))
167.0ms
(- x (+ (* 1/8 (/ 1 (pow x 3))) (* 1/2 (/ 1 x))))

prune666.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0b

localize21.0ms

Local error

Found 4 expressions with local error:

0.3b
(* (sqrt (sqrt (+ x 1))) (sqrt (- x 1)))
0.2b
(* (sqrt (sqrt (+ x 1))) (* (sqrt (sqrt (+ x 1))) (sqrt (- x 1))))
0.1b
(sqrt (sqrt (+ x 1)))
0.1b
(sqrt (sqrt (+ x 1)))

rewrite25.0ms

Algorithm
rewrite-expression-head
Counts
4 → 124
Calls

4 calls. Slowest were:

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

series257.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

115.0ms
(* (sqrt (sqrt (+ x 1))) (sqrt (- x 1)))
56.0ms
(sqrt (sqrt (+ x 1)))
52.0ms
(* (sqrt (sqrt (+ x 1))) (* (sqrt (sqrt (+ x 1))) (sqrt (- x 1))))
34.0ms
(sqrt (sqrt (+ x 1)))

simplify5.9s

Counts
122 → 136
Calls

122 calls. Slowest were:

687.0ms
(* (* (* (sqrt (sqrt (+ x 1))) (sqrt (sqrt (+ x 1)))) (sqrt (sqrt (+ x 1)))) (* (* (* (sqrt (sqrt (+ x 1))) (sqrt (- x 1))) (* (sqrt (sqrt (+ x 1))) (sqrt (- x 1)))) (* (sqrt (sqrt (+ x 1))) (sqrt (- x 1)))))
438.0ms
(- (+ (* 1/2 (/ (pow x 2) (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 4) (pow (sqrt -1) 3))))
387.0ms
(* (* (* (sqrt (sqrt (+ x 1))) (sqrt (sqrt (+ x 1)))) (sqrt (sqrt (+ x 1)))) (* (* (sqrt (- x 1)) (sqrt (- x 1))) (sqrt (- x 1))))

prune1.5s

Pruning

1 alts after pruning (0 fresh and 1 done)

Merged error: 0b

end0.0ms

sample4.7s

Algorithm
intervals