Average Error: 30.9 → 0.4
Time: 35.4s
Precision: 64
Internal Precision: 128
\[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
\[\frac{\frac{-1}{4}}{x \cdot x} - \left(\frac{\frac{3}{32}}{{x}^{4}} - \left(\log 2 + \log 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 30.9

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

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

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

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

    \[\leadsto \frac{\frac{-1}{4}}{x \cdot x} - \left(\frac{\frac{3}{32}}{{x}^{4}} - \left(\log 2 + \log x\right)\right)\]

Reproduce

herbie shell --seed 2019004 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-cosine"
  (log (+ x (sqrt (- (* x x) 1)))))

Details

Time bar (total: 34.9s)Debug log

sample142.0ms

Algorithm
intervals

simplify443.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune8.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 32.0b

localize12.0ms

Local error

Found 3 expressions with local error:

30.7b
(sqrt (fma x x -1))
0.2b
(log (+ x (sqrt (fma x x -1))))
0.0b
(+ x (sqrt (fma x x -1)))

rewrite3.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))

series188.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

105.0ms
(log (+ x (sqrt (fma x x -1))))
47.0ms
(+ x (sqrt (fma x x -1)))
36.0ms
(sqrt (fma x x -1))

simplify2.7s

Counts
19 → 51
Calls

19 calls. Slowest were:

388.0ms
(- (+ (* 1/2 (/ (pow x 2) (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 4) (pow (sqrt -1) 3))))
369.0ms
(+ (log -1/2) (+ (log (/ -1 x)) (+ (* 3/32 (/ 1 (pow x 4))) (* 1/4 (/ 1 (pow x 2))))))
342.0ms
(log (- (* x x) (* (sqrt (fma x x -1)) (sqrt (fma x x -1)))))

prune416.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0b

localize45.0ms

Local error

Found 4 expressions with local error:

0.6b
(/ -1/4 (* x x))
0.2b
(/ 3/32 (pow x 4))
0.2b
(+ (log x) (log 2))
0.0b
(- (/ -1/4 (* x x)) (- (/ 3/32 (pow x 4)) (+ (log x) (log 2))))

rewrite46.0ms

Algorithm
rewrite-expression-head
Counts
4 → 116
Calls

4 calls. Slowest were:

39.0ms
(- (/ -1/4 (* x x)) (- (/ 3/32 (pow x 4)) (+ (log x) (log 2))))
3.0ms
(+ (log x) (log 2))
0.0ms
(/ 3/32 (pow x 4))

series513.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

374.0ms
(+ (log x) (log 2))
91.0ms
(- (/ -1/4 (* x x)) (- (/ 3/32 (pow x 4)) (+ (log x) (log 2))))
25.0ms
(/ 3/32 (pow x 4))
23.0ms
(/ -1/4 (* x x))

simplify22.3s

Counts
104 → 128
Calls

104 calls. Slowest were:

731.0ms
(- (log 2) (+ (log (/ 1 x)) (+ (* 3/32 (/ 1 (pow x 4))) (* 1/4 (/ 1 (pow x 2))))))
554.0ms
(- (+ (log 2) (log x)) (+ (* 1/4 (/ 1 (pow x 2))) (* 3/32 (/ 1 (pow x 4)))))
512.0ms
(fma (- (sqrt (- (/ 3/32 (pow x 4)) (+ (log x) (log 2))))) (sqrt (- (/ 3/32 (pow x 4)) (+ (log x) (log 2)))) (* (sqrt (- (/ 3/32 (pow x 4)) (+ (log x) (log 2)))) (sqrt (- (/ 3/32 (pow x 4)) (+ (log x) (log 2))))))

prune1.4s

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize17.0ms

Local error

Found 2 expressions with local error:

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

rewrite8.0ms

Algorithm
rewrite-expression-head
Counts
2 → 43
Calls

2 calls. Slowest were:

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

series124.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

98.0ms
(log (- (fma 2 x (/ -1/2 x)) (/ (/ 1/8 x) (* x x))))
26.0ms
(/ (/ 1/8 x) (* x x))

simplify2.1s

Counts
27 → 49
Calls

27 calls. Slowest were:

545.0ms
(/ (* (* (/ 1/8 x) (/ 1/8 x)) (/ 1/8 x)) (* (* (* x x) (* x x)) (* x x)))
362.0ms
(log (- (pow (fma 2 x (/ -1/2 x)) 3) (pow (/ (/ 1/8 x) (* x x)) 3)))
345.0ms
(- (+ (log -1/8) (* 4 (pow x 2))) (+ (* 24 (pow x 4)) (* 3 (log x))))

prune498.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes39.0ms

Accuracy

0% (0.2b remaining)

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

bsearch4.0ms

end0.0ms

sample3.9s

Algorithm
intervals