Average Error: 4.4 → 0.1
Time: 14.4s
Precision: 64
Internal Precision: 128
\[\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}\]
\[\sqrt{(\left(\sqrt{e^{x}}\right) \cdot \left(\sqrt{e^{x}}\right) + 1)_*}\]

Error

Bits error versus x

Derivation

  1. Initial program 4.4

    \[\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}\]
  2. Simplified0.1

    \[\leadsto \color{blue}{\sqrt{e^{x} + 1}}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt0.1

    \[\leadsto \sqrt{\color{blue}{\sqrt{e^{x}} \cdot \sqrt{e^{x}}} + 1}\]
  5. Applied fma-def0.1

    \[\leadsto \sqrt{\color{blue}{(\left(\sqrt{e^{x}}\right) \cdot \left(\sqrt{e^{x}}\right) + 1)_*}}\]
  6. Final simplification0.1

    \[\leadsto \sqrt{(\left(\sqrt{e^{x}}\right) \cdot \left(\sqrt{e^{x}}\right) + 1)_*}\]

Reproduce

herbie shell --seed 2019007 +o rules:numerics
(FPCore (x)
  :name "sqrtexp (problem 3.4.4)"
  (sqrt (/ (- (exp (* 2 x)) 1) (- (exp x) 1))))

Details

Time bar (total: 14.0s)Debug log

sample379.0ms

Algorithm
intervals

simplify92.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

92.0ms
(sqrt (/ (- (exp (* 2 x)) 1) (- (exp x) 1)))

prune15.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize19.0ms

Local error

Found 2 expressions with local error:

0.0b
(sqrt (+ (exp x) 1))
0.0b
(+ (exp x) 1)

rewrite26.0ms

Algorithm
rewrite-expression-head
Counts
2 → 31
Calls

2 calls. Slowest were:

15.0ms
(+ (exp x) 1)
8.0ms
(sqrt (+ (exp x) 1))

series39.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

32.0ms
(sqrt (+ (exp x) 1))
7.0ms
(+ (exp x) 1)

simplify336.0ms

Counts
14 → 37
Calls

14 calls. Slowest were:

214.0ms
(- (+ (sqrt 2) (+ (* 1/4 (/ (pow x 2) (sqrt 2))) (* 1/2 (/ x (sqrt 2))))) (* 1/8 (/ (pow x 2) (pow (sqrt 2) 3))))
43.0ms
(+ x (+ (* 1/2 (pow x 2)) 2))
39.0ms
(sqrt (- (* (exp x) (exp x)) (* 1 1)))

prune316.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0b

localize19.0ms

Local error

Found 4 expressions with local error:

0.2b
(sqrt (exp x))
0.2b
(sqrt (exp x))
0.0b
(fma (sqrt (exp x)) (sqrt (exp x)) 1)
0.0b
(sqrt (fma (sqrt (exp x)) (sqrt (exp x)) 1))

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
4 → 52
Calls

4 calls. Slowest were:

2.0ms
(sqrt (exp x))
1.0ms
(sqrt (fma (sqrt (exp x)) (sqrt (exp x)) 1))
1.0ms
(sqrt (exp x))

series112.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

52.0ms
(sqrt (fma (sqrt (exp x)) (sqrt (exp x)) 1))
37.0ms
(fma (sqrt (exp x)) (sqrt (exp x)) 1)
12.0ms
(sqrt (exp x))
11.0ms
(sqrt (exp x))

simplify312.0ms

Counts
24 → 64
Calls

24 calls. Slowest were:

143.0ms
(- (+ (sqrt 2) (+ (* 1/4 (/ (pow x 2) (sqrt 2))) (* 1/2 (/ x (sqrt 2))))) (* 1/8 (/ (pow x 2) (pow (sqrt 2) 3))))
56.0ms
(+ (* 1/2 x) (+ (* 1/8 (pow x 2)) 1))
35.0ms
(+ (* 1/2 x) (+ (* 1/8 (pow x 2)) 1))

prune612.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize16.0ms

Local error

Found 4 expressions with local error:

0.2b
(sqrt (exp x))
0.2b
(sqrt (exp x))
0.0b
(expm1 (log1p (sqrt (fma (sqrt (exp x)) (sqrt (exp x)) 1))))
0.0b
(log1p (sqrt (fma (sqrt (exp x)) (sqrt (exp x)) 1)))

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
4 → 50
Calls

4 calls. Slowest were:

2.0ms
(sqrt (exp x))
2.0ms
(sqrt (exp x))
1.0ms
(log1p (sqrt (fma (sqrt (exp x)) (sqrt (exp x)) 1)))

series383.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

210.0ms
(expm1 (log1p (sqrt (fma (sqrt (exp x)) (sqrt (exp x)) 1))))
144.0ms
(log1p (sqrt (fma (sqrt (exp x)) (sqrt (exp x)) 1)))
17.0ms
(sqrt (exp x))
12.0ms
(sqrt (exp x))

simplify609.0ms

Counts
22 → 62
Calls

22 calls. Slowest were:

268.0ms
(- (+ (sqrt 2) (+ (* 1/2 (/ x (sqrt 2))) (+ (* 1/8 (/ (pow x 2) (* (pow (+ (sqrt 2) 1) 2) (pow (sqrt 2) 2)))) (+ (* 1/4 (/ (pow x 2) (* (+ (sqrt 2) 1) (sqrt 2)))) (* 1/4 (/ (pow x 2) (+ (sqrt 2) 1))))))) (+ (* 1/8 (/ (pow x 2) (* (+ (sqrt 2) 1) (pow (sqrt 2) 3)))) (+ (* 1/8 (/ (pow x 2) (* (pow (sqrt 2) 2) (pow (+ (sqrt 2) 1) 2)))) (* 1/8 (/ (pow x 2) (* (pow (sqrt 2) 2) (+ (sqrt 2) 1)))))))
212.0ms
(- (+ (* 1/4 (/ (pow x 2) (* (sqrt 2) (+ (sqrt 2) 1)))) (+ (log (+ (sqrt 2) 1)) (* 1/2 (/ x (* (+ (sqrt 2) 1) (sqrt 2)))))) (+ (* 1/8 (/ (pow x 2) (* (pow (sqrt 2) 3) (+ (sqrt 2) 1)))) (* 1/8 (/ (pow x 2) (* (pow (+ (sqrt 2) 1) 2) (pow (sqrt 2) 2))))))
41.0ms
(+ (* 1/2 x) (+ (* 1/8 (pow x 2)) 1))

prune654.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes35.0ms

Accuracy

0% (0.0b remaining)

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

bsearch2.0ms

end0.0ms

sample10.0s

Algorithm
intervals