Average Error: 39.4 → 0.0
Time: 14.0s
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 39.4

    \[\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}\]
  2. Initial simplification0.0

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

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

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

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

Reproduce

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

Details

Time bar (total: 3.1s)Debug log

start290.0ms

Algorithm
intervals

setup755.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize11.0ms

Local error

Found 2 expressions with local error:

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

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
2 → 31
Calls

2 calls. Slowest were:

4.0ms
(+ (exp x) 1)
4.0ms
(sqrt (+ (exp x) 1))

series62.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

42.0ms
(sqrt (+ (exp x) 1))
19.0ms
(+ (exp x) 1)

simplify345.0ms

Counts
14 → 37
Calls

14 calls. Slowest were:

211.0ms
(- (+ (sqrt 2) (+ (* 1/4 (/ (pow x 2) (sqrt 2))) (* 1/2 (/ x (sqrt 2))))) (* 1/8 (/ (pow x 2) (pow (sqrt 2) 3))))
62.0ms
(+ x (+ (* 1/2 (pow x 2)) 2))
34.0ms
(sqrt (- (* (exp x) (exp x)) (* 1 1)))

prune412.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0b

localize17.0ms

Local error

Found 4 expressions with local error:

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

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
4 → 52
Calls

4 calls. Slowest were:

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

series148.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

65.0ms
(sqrt (fma (sqrt (exp x)) (sqrt (exp x)) 1))
52.0ms
(fma (sqrt (exp x)) (sqrt (exp x)) 1)
17.0ms
(sqrt (exp x))
13.0ms
(sqrt (exp x))

simplify332.0ms

Counts
24 → 64
Calls

24 calls. Slowest were:

164.0ms
(- (+ (sqrt 2) (+ (* 1/4 (/ (pow x 2) (sqrt 2))) (* 1/2 (/ x (sqrt 2))))) (* 1/8 (/ (pow x 2) (pow (sqrt 2) 3))))
46.0ms
(+ (* 1/2 x) (+ (* 1/8 (pow x 2)) 1))
45.0ms
(+ x (+ (* 1/2 (pow x 2)) 2))

prune749.0ms

Pruning

1 alts after pruning (0 fresh and 1 done)

Merged error: 0b