Average Error: 30.9 → 0.3
Time: 12.8s
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 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.3

    \[\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.3

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

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

Details

Time bar (total: 12.6s)Debug log

sample165.0ms

Algorithm
intervals

simplify126.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
126.0ms
(log (+ x (sqrt (- (* x x) 1))))

prune11.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 28.3b

localize26.0ms

Local error

Found 3 expressions with local error:

27.2b
(sqrt (fma x x -1))
0.0b
(+ x (sqrt (fma x x -1)))
0.0b
(log (+ x (sqrt (fma x x -1))))

rewrite6.0ms

Algorithm
rewrite-expression-head
Rules
add-sqr-sqrt
add-cube-cbrt
*-un-lft-identity
add-exp-log
pow1
add-log-exp
log1p-expm1-u
sqrt-prod
add-cbrt-cube
log-prod
expm1-log1p-u
flip-+
flip3-+
log-div
log-pow
rem-log-exp
pow1/2
rem-sqrt-square
+-commutative
Counts
3 → 42
Calls
3 calls:
Slowest
2.0ms
(log (+ x (sqrt (fma x x -1))))
2.0ms
(+ x (sqrt (fma x x -1)))
2.0ms
(sqrt (fma x x -1))

series150.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
92.0ms
(log (+ x (sqrt (fma x x -1))))
30.0ms
(sqrt (fma x x -1))
28.0ms
(+ x (sqrt (fma x x -1)))

simplify2.9s

Counts
19 → 51
Calls
19 calls:
Slowest
415.0ms
(+ (log -1/2) (+ (log (/ -1 x)) (+ (* 3/32 (/ 1 (pow x 4))) (* 1/4 (/ 1 (pow x 2))))))
392.0ms
(- (log 2) (+ (log (/ 1 x)) (+ (* 3/32 (/ 1 (pow x 4))) (* 1/4 (/ 1 (pow x 2))))))
379.0ms
(- (+ (* 1/2 (/ (pow x 2) (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 4) (pow (sqrt -1) 3))))
374.0ms
(log (- (* x x) (* (sqrt (fma x x -1)) (sqrt (fma x x -1)))))
271.0ms
(- x (+ (* 1/8 (/ 1 (pow x 3))) (* 1/2 (/ 1 x))))

prune472.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0b

localize30.0ms

Local error

Found 3 expressions with local error:

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

rewrite16.0ms

Algorithm
rewrite-expression-head
Rules
add-cube-cbrt
add-exp-log
*-un-lft-identity
add-sqr-sqrt
add-cbrt-cube
associate-/l*
times-frac
pow1
add-log-exp
div-inv
log1p-expm1-u
log-prod
expm1-log1p-u
flip-+
flip3-+
log-div
associate-/l/
log-pow
rem-log-exp
div-exp
frac-2neg
associate-/r*
clear-num
associate-+r+
+-commutative
cbrt-undiv
Counts
3 → 53
Calls
3 calls:
Slowest
8.0ms
(+ x (+ (/ (/ -1/8 x) (* x x)) (+ x (/ -1/2 x))))
5.0ms
(log (+ x (+ (/ (/ -1/8 x) (* x x)) (+ x (/ -1/2 x)))))
3.0ms
(/ (/ -1/8 x) (* x x))

series172.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
117.0ms
(log (+ x (+ (/ (/ -1/8 x) (* x x)) (+ x (/ -1/2 x)))))
30.0ms
(+ x (+ (/ (/ -1/8 x) (* x x)) (+ x (/ -1/2 x))))
25.0ms
(/ (/ -1/8 x) (* x x))

simplify3.1s

Counts
28 → 62
Calls
28 calls:
Slowest
782.0ms
(log (+ (pow x 3) (pow (+ (/ (/ -1/8 x) (* x x)) (+ x (/ -1/2 x))) 3)))
600.0ms
(/ (* (* (/ -1/8 x) (/ -1/8 x)) (/ -1/8 x)) (* (* (* x x) (* x x)) (* x x)))
387.0ms
(- (log 2) (+ (log (/ 1 x)) (+ (* 3/32 (/ 1 (pow x 4))) (* 1/4 (/ 1 (pow x 2))))))
275.0ms
(- (+ (log -1/8) (* 4 (pow x 2))) (+ (* 24 (pow x 4)) (* 3 (log x))))
261.0ms
(- (* 2 x) (+ (* 1/8 (/ 1 (pow x 3))) (* 1/2 (/ 1 x))))

prune510.0ms

Pruning

1 alts after pruning (0 fresh and 1 done)

Merged error: 0b

end0.0ms

sample4.9s

Algorithm
intervals