Average Error: 31.4 → 0.4
Time: 29.1s
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 31.4

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

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

Details

Time bar (total: 23.5s)Debug log

start155.0ms

Algorithm
intervals

setup141.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 33.2b

localize18.0ms

Local error

Found 3 expressions with local error:

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

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
3 → 42
Calls

3 calls. Slowest were:

4.0ms
(sqrt (fma x x -1))
1.0ms
(log (+ x (sqrt (fma x x -1))))
1.0ms
(+ x (sqrt (fma x x -1)))

series151.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

101.0ms
(log (+ x (sqrt (fma x x -1))))
28.0ms
(+ x (sqrt (fma x x -1)))
22.0ms
(sqrt (fma x x -1))

simplify2.9s

Counts
19 → 51
Calls

19 calls. Slowest were:

469.0ms
(+ (log -1/2) (+ (log (/ -1 x)) (+ (* 3/32 (/ 1 (pow x 4))) (* 1/4 (/ 1 (pow x 2))))))
397.0ms
(- (log 2) (+ (log (/ 1 x)) (+ (* 3/32 (/ 1 (pow x 4))) (* 1/4 (/ 1 (pow x 2))))))
389.0ms
(log (- (* x x) (* (sqrt (fma x x -1)) (sqrt (fma x x -1)))))

prune567.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0b

localize53.0ms

Local error

Found 4 expressions with local error:

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

rewrite17.0ms

Algorithm
rewrite-expression-head
Counts
4 → 86
Calls

4 calls. Slowest were:

12.0ms
(- (/ 3/32 (pow x 4)) (+ (log x) (log 2)))
3.0ms
(+ (log x) (log 2))
0.0ms
(/ 3/32 (pow x 4))

series1.8s

Counts
4 → 12
Calls

4 calls. Slowest were:

1.4s
(- (/ 3/32 (pow x 4)) (+ (log x) (log 2)))
321.0ms
(+ (log x) (log 2))
22.0ms
(/ 3/32 (pow x 4))
14.0ms
(/ -1/4 (* x x))

simplify7.2s

Counts
64 → 98
Calls

64 calls. Slowest were:

540.0ms
(fma (- (+ (log x) (log 2))) 1 (* (+ (log x) (log 2)) 1))
507.0ms
(fma (- (+ (log x) (log 2))) 1 (* (+ (log x) (log 2)) 1))
486.0ms
(fma (- (+ (log x) (log 2))) 1 (* (+ (log x) (log 2)) 1))

prune1.5s

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0b

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

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
2 → 43
Calls

2 calls. Slowest were:

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

series133.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

118.0ms
(log (- (fma 2 x (/ -1/2 x)) (/ (/ 1/8 x) (* x x))))
15.0ms
(/ (/ 1/8 x) (* x x))

simplify2.3s

Counts
27 → 49
Calls

27 calls. Slowest were:

641.0ms
(/ (* (* (/ 1/8 x) (/ 1/8 x)) (/ 1/8 x)) (* (* (* x x) (* x x)) (* x x)))
389.0ms
(- (+ (log -1/8) (* 4 (pow x 2))) (+ (* 24 (pow x 4)) (* 3 (log x))))
370.0ms
(log (- (pow (fma 2 x (/ -1/2 x)) 3) (pow (/ (/ 1/8 x) (* x x)) 3)))

prune728.0ms

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

localize16.0ms

Local error

Found 4 expressions with local error:

32.9b
(cbrt (fma x x -1))
32.9b
(cbrt (fma x x -1))
0.3b
(* (fabs (cbrt (fma x x -1))) (sqrt (cbrt (fma x x -1))))
0.2b
(log (+ x (* (fabs (cbrt (fma x x -1))) (sqrt (cbrt (fma x x -1))))))

rewrite8.0ms

Algorithm
rewrite-expression-head
Counts
4 → 67
Calls

4 calls. Slowest were:

5.0ms
(* (fabs (cbrt (fma x x -1))) (sqrt (cbrt (fma x x -1))))
1.0ms
(log (+ x (* (fabs (cbrt (fma x x -1))) (sqrt (cbrt (fma x x -1))))))
1.0ms
(cbrt (fma x x -1))

series460.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

144.0ms
(* (fabs (cbrt (fma x x -1))) (sqrt (cbrt (fma x x -1))))
140.0ms
(cbrt (fma x x -1))
110.0ms
(cbrt (fma x x -1))
66.0ms
(log (+ x (* (fabs (cbrt (fma x x -1))) (sqrt (cbrt (fma x x -1))))))

simplify4.2s

Counts
38 → 79
Calls

38 calls. Slowest were:

639.0ms
(log (- (* x x) (* (* (fabs (cbrt (fma x x -1))) (sqrt (cbrt (fma x x -1)))) (* (fabs (cbrt (fma x x -1))) (sqrt (cbrt (fma x x -1)))))))
546.0ms
(- (* (pow (/ 1 (pow x 2)) 1/3) (fabs (pow (fma x x -1) 1/3))) (+ (log (/ 1 x)) (* 1/2 (* (pow (/ 1 (pow x 4)) 1/3) (pow (fabs (pow (fma x x -1) 1/3)) 2)))))
296.0ms
(- (+ (* (/ x (fabs (pow (fma x x -1) 1/3))) (pow -1 1/6)) (log (* (fabs (pow (fma x x -1) 1/3)) (pow -1 1/6)))) (+ (* 1/2 (* (/ (pow x 2) (pow (fabs (pow (fma x x -1) 1/3)) 2)) (pow -1 1/3))) (* 1/6 (pow x 2))))

prune1.0s

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0b

regimes50.0ms

Accuracy

0% (0.4b remaining)

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

bsearch4.0ms