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

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

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

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

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

Reproduce

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

Details

Time bar (total: 19.2s)Debug log

sample182.0ms

Algorithm
intervals
Results
1040×(pre true 80)
514×(body nan 80)
269×(body nan 160)
257×(body real 80)

simplify120.0ms

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

prune9.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 30.5b

localize28.0ms

Local error

Found 4 expressions with local error:

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

rewrite15.0ms

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

series195.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
102.0ms
(log (+ x (sqrt (- (* x x) 1))))
41.0ms
(sqrt (- (* x x) 1))
34.0ms
(+ x (sqrt (- (* x x) 1)))
17.0ms
(- (* x x) 1)

simplify2.8s

Counts
26 → 63
Calls
26 calls:
Slowest
332.0ms
(- (+ (* 1/2 (/ (pow x 2) (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 4) (pow (sqrt -1) 3))))
315.0ms
(+ (log -1/2) (+ (log (/ -1 x)) (+ (* 3/32 (/ 1 (pow x 4))) (* 1/4 (/ 1 (pow x 2))))))
311.0ms
(log (- (* x x) (* (sqrt (- (* x x) 1)) (sqrt (- (* x x) 1)))))
252.0ms
(- (+ (log (sqrt -1)) (/ x (sqrt -1))) (* 1/6 (/ (pow x 3) (pow (sqrt -1) 3))))
236.0ms
(- (log 2) (+ (log (/ 1 x)) (+ (* 3/32 (/ 1 (pow x 4))) (* 1/4 (/ 1 (pow x 2))))))

prune616.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0b

localize35.0ms

Local error

Found 3 expressions with local error:

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

rewrite21.0ms

Algorithm
rewrite-expression-head
Rules
12×sqrt-div
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
sqrt-prod
add-exp-log
associate-*l*
associate-*r*
pow1
flip-+
add-cbrt-cube
flip3-+
frac-times
add-log-exp
flip--
flip3--
log-prod
associate-*r/
associate-*l/
pow-prod-down
pow1/2
log-div
cbrt-unprod
*-commutative
log-pow
prod-exp
rem-log-exp
sqrt-unprod
+-commutative
Counts
3 → 57
Calls
3 calls:
Slowest
10.0ms
(* (sqrt (+ x 1)) (sqrt (- x 1)))
8.0ms
(+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))
2.0ms
(log (+ x (* (sqrt (+ x 1)) (sqrt (- x 1)))))

series165.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
68.0ms
(log (+ x (* (sqrt (+ x 1)) (sqrt (- x 1)))))
51.0ms
(* (sqrt (+ x 1)) (sqrt (- x 1)))
45.0ms
(+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))

simplify3.0s

Counts
43 → 66
Calls
43 calls:
Slowest
590.0ms
(* (* (* (sqrt (+ x 1)) (sqrt (+ x 1))) (sqrt (+ x 1))) (* (* (sqrt (- x 1)) (sqrt (- x 1))) (sqrt (- x 1))))
515.0ms
(log (- (* x x) (* (* (sqrt (+ x 1)) (sqrt (- x 1))) (* (sqrt (+ x 1)) (sqrt (- x 1))))))
360.0ms
(- (+ (* 1/2 (/ (pow x 2) (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 4) (pow (sqrt -1) 3))))
329.0ms
(log (+ (pow x 3) (pow (* (sqrt (+ x 1)) (sqrt (- x 1))) 3)))
180.0ms
(- (log 2) (+ (log (/ 1 x)) (+ (* 3/32 (/ 1 (pow x 4))) (* 1/4 (/ 1 (pow x 2))))))

prune632.0ms

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

localize20.0ms

Local error

Found 4 expressions with local error:

0.5b
(cbrt (* (* (log (+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))) (log (+ x (* (sqrt (+ x 1)) (sqrt (- x 1)))))) (log (+ x (* (sqrt (+ x 1)) (sqrt (- x 1)))))))
0.5b
(* (log (+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))) (log (+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))))
0.5b
(* (sqrt (+ x 1)) (sqrt (- x 1)))
0.5b
(* (sqrt (+ x 1)) (sqrt (- x 1)))

rewrite43.0ms

Algorithm
rewrite-expression-head
Rules
24×sqrt-div
16×add-cube-cbrt
16×associate-*l*
16×associate-*r*
16×*-un-lft-identity
16×add-sqr-sqrt
15×pow1
12×sqrt-prod
10×add-exp-log
10×add-cbrt-cube
frac-times
flip--
flip-+
flip3--
flip3-+
log-prod
pow-prod-down
add-log-exp
associate-*r/
associate-*l/
pow1/2
cbrt-unprod
*-commutative
prod-exp
distribute-lft-in
distribute-rgt-in
log-pow
sqrt-unprod
rem-cbrt-cube
pow-prod-up
pow3
pow1/3
pow-plus
pow2
cbrt-prod
Counts
4 → 104
Calls
4 calls:
Slowest
14.0ms
(cbrt (* (* (log (+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))) (log (+ x (* (sqrt (+ x 1)) (sqrt (- x 1)))))) (log (+ x (* (sqrt (+ x 1)) (sqrt (- x 1)))))))
10.0ms
(* (sqrt (+ x 1)) (sqrt (- x 1)))
9.0ms
(* (log (+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))) (log (+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))))
7.0ms
(* (sqrt (+ x 1)) (sqrt (- x 1)))

series292.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
111.0ms
(* (log (+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))) (log (+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))))
92.0ms
(cbrt (* (* (log (+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))) (log (+ x (* (sqrt (+ x 1)) (sqrt (- x 1)))))) (log (+ x (* (sqrt (+ x 1)) (sqrt (- x 1)))))))
51.0ms
(* (sqrt (+ x 1)) (sqrt (- x 1)))
38.0ms
(* (sqrt (+ x 1)) (sqrt (- x 1)))

simplify4.4s

Counts
88 → 116
Calls
88 calls:
Slowest
595.0ms
(* (* (* (sqrt (+ x 1)) (sqrt (+ x 1))) (sqrt (+ x 1))) (* (* (sqrt (- x 1)) (sqrt (- x 1))) (sqrt (- x 1))))
522.0ms
(* (* (* (sqrt (+ x 1)) (sqrt (+ x 1))) (sqrt (+ x 1))) (* (* (sqrt (- x 1)) (sqrt (- x 1))) (sqrt (- x 1))))
426.0ms
(- (+ (* 1/2 (/ (pow x 2) (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 4) (pow (sqrt -1) 3))))
387.0ms
(- (+ (* 1/2 (/ (pow x 2) (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 4) (pow (sqrt -1) 3))))
218.0ms
(- (+ (log (sqrt -1)) (/ x (sqrt -1))) (* 1/6 (/ (pow x 3) (pow (sqrt -1) 3))))

prune1.4s

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0b

regimes119.0ms

Accuracy

0% (0.0b remaining)

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

bsearch2.0ms

end0.0ms

sample5.1s

Algorithm
intervals
Results
32215×(pre true 80)
16356×(body nan 80)
8000×(body real 80)
7859×(body nan 160)