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

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

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

    \[\leadsto \log \left(x + \color{blue}{\sqrt{x + 1} \cdot \sqrt{x - 1}}\right)\]
  5. Using strategy rm
  6. Applied add-sqr-sqrt0.1

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

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

Reproduce

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

Details

Time bar (total: 21.3s)Debug log

sample135.0ms

Algorithm
intervals
Results
45.0ms235×body160nan
43.0ms518×body80nan
26.0ms256×body80valid

simplify109.0ms

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

prune9.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 30.9b

localize26.0ms

Local error

Found 4 expressions with local error:

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

rewrite14.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
(log (+ x (sqrt (- (* x x) 1))))
3.0ms
(- (* x x) 1)
3.0ms
(+ x (sqrt (- (* x x) 1)))

series180.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
76.0ms
(log (+ x (sqrt (- (* x x) 1))))
39.0ms
(+ x (sqrt (- (* x x) 1)))
37.0ms
(sqrt (- (* x x) 1))
28.0ms
(- (* x x) 1)

simplify2.4s

Counts
26 → 63
Calls
26 calls:
Slowest
392.0ms
(- (+ (* 1/2 (/ (pow x 2) (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 4) (pow (sqrt -1) 3))))
254.0ms
(+ (log -1/2) (+ (log (/ -1 x)) (+ (* 3/32 (/ 1 (pow x 4))) (* 1/4 (/ 1 (pow x 2))))))
218.0ms
(log (- (* x x) (* (sqrt (- (* x x) 1)) (sqrt (- (* x x) 1)))))
180.0ms
(- (log 2) (+ (log (/ 1 x)) (+ (* 3/32 (/ 1 (pow x 4))) (* 1/4 (/ 1 (pow x 2))))))
174.0ms
(- (+ (log (sqrt -1)) (/ x (sqrt -1))) (* 1/6 (/ (pow x 3) (pow (sqrt -1) 3))))

prune403.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0b

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

rewrite8.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
5.0ms
(* (sqrt (+ x 1)) (sqrt (- x 1)))
1.0ms
(+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))
1.0ms
(log (+ x (* (sqrt (+ x 1)) (sqrt (- x 1)))))

series167.0ms

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

simplify3.0s

Counts
43 → 66
Calls
43 calls:
Slowest
528.0ms
(log (- (* x x) (* (* (sqrt (+ x 1)) (sqrt (- x 1))) (* (sqrt (+ x 1)) (sqrt (- x 1))))))
518.0ms
(* (* (* (sqrt (+ x 1)) (sqrt (+ x 1))) (sqrt (+ x 1))) (* (* (sqrt (- x 1)) (sqrt (- x 1))) (sqrt (- x 1))))
379.0ms
(- (+ (* 1/2 (/ (pow x 2) (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 4) (pow (sqrt -1) 3))))
354.0ms
(log (+ (pow x 3) (pow (* (sqrt (+ x 1)) (sqrt (- x 1))) 3)))
209.0ms
(- (+ (log (sqrt -1)) (/ x (sqrt -1))) (* 1/6 (/ (pow x 3) (pow (sqrt -1) 3))))

prune653.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize9.0ms

Local error

Found 4 expressions with local error:

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

rewrite17.0ms

Algorithm
rewrite-expression-head
Rules
38×sqrt-div
21×sqrt-prod
18×associate-*l*
18×associate-*r*
18×add-sqr-sqrt
17×add-cube-cbrt
17×*-un-lft-identity
13×flip-+
13×flip3-+
13×pow1
12×frac-times
10×add-exp-log
10×add-cbrt-cube
pow1/2
flip--
associate-*r/
associate-*l/
pow-prod-down
flip3--
add-log-exp
cbrt-unprod
*-commutative
prod-exp
sqrt-unprod
pow-prod-up
pow-plus
rem-square-sqrt
rem-sqrt-square
pow2
Counts
4 → 118
Calls
4 calls:
Slowest
5.0ms
(* (sqrt (+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))) (sqrt (+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))))
5.0ms
(* (sqrt (+ x 1)) (sqrt (- x 1)))
5.0ms
(* (sqrt (+ x 1)) (sqrt (- x 1)))
1.0ms
(sqrt (+ x (* (sqrt (+ x 1)) (sqrt (- x 1)))))

series155.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
51.0ms
(sqrt (+ x (* (sqrt (+ x 1)) (sqrt (- x 1)))))
38.0ms
(* (sqrt (+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))) (sqrt (+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))))
36.0ms
(* (sqrt (+ x 1)) (sqrt (- x 1)))
30.0ms
(* (sqrt (+ x 1)) (sqrt (- x 1)))

simplify8.3s

Counts
108 → 130
Calls
108 calls:
Slowest
587.0ms
(* (sqrt (+ (pow x 3) (pow (* (sqrt (+ x 1)) (sqrt (- x 1))) 3))) (sqrt (+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))))
587.0ms
(* (sqrt (- (* x x) (* (* (sqrt (+ x 1)) (sqrt (- x 1))) (* (sqrt (+ x 1)) (sqrt (- x 1)))))) (sqrt (+ x (* (sqrt (+ x 1)) (sqrt (- x 1))))))
554.0ms
(* (* (* (sqrt (+ x 1)) (sqrt (+ x 1))) (sqrt (+ x 1))) (* (* (sqrt (- x 1)) (sqrt (- x 1))) (sqrt (- x 1))))
544.0ms
(* (+ x (* (sqrt (+ x 1)) (sqrt (- x 1)))) (+ x (* (sqrt (+ x 1)) (sqrt (- x 1)))))
543.0ms
(sqrt (- (* x x) (* (* (sqrt (+ x 1)) (sqrt (- x 1))) (* (sqrt (+ x 1)) (sqrt (- x 1))))))

prune1.5s

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes17.0ms

Accuracy

0% (0.0b remaining)

Error of 0.1b against oracle of 0.1b and baseline of 0.1b

bsearch2.0ms

end0.0ms

sample4.3s

Algorithm
intervals
Results
1.7s16473×body80nan
1.3s7733×body160nan
849.0ms8000×body80valid