Average Error: 30.9 → 0.3
Time: 11.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. 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)\]
  3. Simplified0.3

    \[\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)\]
  4. 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 
(FPCore (x)
  :name "Hyperbolic arc-cosine"
  (log (+ x (sqrt (- (* x x) 1)))))

Details

Time bar (total: 11.6s)Debug log

sample187.0ms

Algorithm
intervals

simplify93.0ms

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

prune10.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 28.3b

localize16.0ms

Local error

Found 3 expressions with local error:

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

rewrite6.0ms

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

series159.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
100.0ms
(log (+ x (sqrt (- (* x x) 1))))
35.0ms
(+ x (sqrt (- (* x x) 1)))
24.0ms
(sqrt (- (* x x) 1))

simplify2.8s

Counts
22 → 48
Calls
22 calls:
Slowest
576.0ms
(log (- (* x x) (* (sqrt (- (* x x) 1)) (sqrt (- (* x x) 1)))))
373.0ms
(- (+ (* 1/2 (/ (pow x 2) (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 4) (pow (sqrt -1) 3))))
281.0ms
(+ (log -1/2) (+ (log (/ -1 x)) (+ (* 3/32 (/ 1 (pow x 4))) (* 1/4 (/ 1 (pow x 2))))))
185.0ms
(- (log 2) (+ (log (/ 1 x)) (+ (* 3/32 (/ 1 (pow x 4))) (* 1/4 (/ 1 (pow x 2))))))
176.0ms
(- (+ (log (sqrt -1)) (/ x (sqrt -1))) (* 1/6 (/ (pow x 3) (pow (sqrt -1) 3))))

prune360.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0b

localize25.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
(log (+ x (- (+ (/ -1/2 x) x) (/ (/ 1/8 x) (* x x)))))

rewrite34.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
log-prod
associate-+r+
flip-+
flip3-+
log-div
associate-/l/
log-pow
associate--l+
rem-log-exp
div-exp
frac-2neg
sub-neg
associate-/r*
associate-+r-
clear-num
+-commutative
cbrt-undiv
Counts
3 → 50
Calls
3 calls:
Slowest
15.0ms
(+ x (- (+ (/ -1/2 x) x) (/ (/ 1/8 x) (* x x))))
14.0ms
(log (+ x (- (+ (/ -1/2 x) x) (/ (/ 1/8 x) (* x x)))))
3.0ms
(/ (/ 1/8 x) (* x x))

series125.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
80.0ms
(log (+ x (- (+ (/ -1/2 x) x) (/ (/ 1/8 x) (* x x)))))
24.0ms
(/ (/ 1/8 x) (* x x))
21.0ms
(+ x (- (+ (/ -1/2 x) x) (/ (/ 1/8 x) (* x x))))

simplify3.1s

Counts
31 → 59
Calls
31 calls:
Slowest
581.0ms
(/ (* (* (/ 1/8 x) (/ 1/8 x)) (/ 1/8 x)) (* (* (* x x) (* x x)) (* x x)))
579.0ms
(log (+ (pow x 3) (pow (- (+ (/ -1/2 x) x) (/ (/ 1/8 x) (* x x))) 3)))
481.0ms
(- (log -2) (+ (log (/ -1 x)) (+ (* 3/32 (/ 1 (pow x 4))) (* 1/4 (/ 1 (pow x 2))))))
237.0ms
(- (log 2) (+ (log (/ 1 x)) (+ (* 3/32 (/ 1 (pow x 4))) (* 1/4 (/ 1 (pow x 2))))))
212.0ms
(log (- (* x x) (* (- (+ (/ -1/2 x) x) (/ (/ 1/8 x) (* x x))) (- (+ (/ -1/2 x) x) (/ (/ 1/8 x) (* x x))))))

prune517.0ms

Pruning

1 alts after pruning (0 fresh and 1 done)

Merged error: 0b

end0.0ms

sample4.2s

Algorithm
intervals