Average Error: 4.2 → 0.1
Time: 1.1m
Precision: 64
Internal Precision: 128
\[\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}\]
\[\sqrt{e^{x} + 1}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 4.2

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

    \[\leadsto \color{blue}{\sqrt{e^{x} + 1}}\]
  3. Final simplification0.1

    \[\leadsto \sqrt{e^{x} + 1}\]

Reproduce

herbie shell --seed 1042149663 
(FPCore (x)
  :name "sqrtexp (problem 3.4.4)"
  (sqrt (/ (- (exp (* 2 x)) 1) (- (exp x) 1))))

Details

Time bar (total: 1.0m)Debug log

sample550.0ms

Algorithm
intervals
Results
873×(pre true 80)
397×(body nan 80)
232×(body real 80)
215×(body exit 10240)
29×(body real 160)

simplify107.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
106.0ms
(sqrt (/ (- (exp (* 2 x)) 1) (- (exp x) 1)))

prune21.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.3b

localize25.0ms

Local error

Found 2 expressions with local error:

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

rewrite28.0ms

Algorithm
rewrite-expression-head
Rules
add-sqr-sqrt
sqrt-prod
add-cube-cbrt
*-un-lft-identity
add-log-exp
flip-+
add-exp-log
sqrt-div
add-cbrt-cube
flip3-+
pow1
pow1/2
rem-sqrt-square
+-commutative
Counts
2 → 24
Calls
2 calls:
Slowest
19.0ms
(sqrt (+ (exp x) 1))
5.0ms
(+ (exp x) 1)

series68.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
54.0ms
(sqrt (+ (exp x) 1))
13.0ms
(+ (exp x) 1)

simplify401.0ms

Counts
12 → 30
Calls
12 calls:
Slowest
235.0ms
(- (+ (sqrt 2) (+ (* 1/4 (/ (pow x 2) (sqrt 2))) (* 1/2 (/ x (sqrt 2))))) (* 1/8 (/ (pow x 2) (pow (sqrt 2) 3))))
61.0ms
(sqrt (- (* (exp x) (exp x)) (* 1 1)))
48.0ms
(+ x (+ (* 1/2 (pow x 2)) 2))
20.0ms
(sqrt (+ (pow (exp x) 3) (pow 1 3)))
6.0ms
(sqrt (* (cbrt (+ (exp x) 1)) (cbrt (+ (exp x) 1))))

prune404.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.2b

localize75.0ms

Local error

Found 4 expressions with local error:

5.4b
(- (* 1 1) (* (exp x) 1))
0.3b
(sqrt (/ (+ (pow (exp x) 3) (pow 1 3)) (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1)))))
0.2b
(+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1)))
0.2b
(/ (+ (pow (exp x) 3) (pow 1 3)) (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1))))

rewrite117.0ms

Algorithm
rewrite-expression-head
Rules
46×*-un-lft-identity
37×times-frac
28×add-sqr-sqrt
25×add-cube-cbrt
24×sqrt-prod
14×distribute-lft-out
11×add-log-exp
sum-cubes
cube-mult
associate-/l*
add-exp-log
add-cbrt-cube
flip-+
associate-/r/
flip3-+
pow1
associate-/r*
associate-/l/
div-inv
diff-log
sub-neg
sum-log
associate-+r+
rem-sqrt-square
flip--
div-exp
sqrt-div
pow1/2
distribute-rgt-out--
flip3--
frac-2neg
associate-+r-
clear-num
+-commutative
cbrt-undiv
Counts
4 → 106
Calls
4 calls:
Slowest
55.0ms
(/ (+ (pow (exp x) 3) (pow 1 3)) (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1))))
35.0ms
(sqrt (/ (+ (pow (exp x) 3) (pow 1 3)) (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1)))))
17.0ms
(+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1)))
5.0ms
(- (* 1 1) (* (exp x) 1))

series304.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
140.0ms
(sqrt (/ (+ (pow (exp x) 3) (pow 1 3)) (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1)))))
99.0ms
(/ (+ (pow (exp x) 3) (pow 1 3)) (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1))))
38.0ms
(+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1)))
28.0ms
(- (* 1 1) (* (exp x) 1))

simplify13.3s

Counts
94 → 118
Calls
94 calls:
Slowest
861.0ms
(+ (* (* (exp x) (exp x)) (* (exp x) (exp x))) (- (* (- (* 1 1) (* (exp x) 1)) (- (* 1 1) (* (exp x) 1))) (* (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1)))))
746.0ms
(sqrt (/ (+ (pow (exp x) 3) (pow 1 3)) (- (* (* (exp x) (exp x)) (* (exp x) (exp x))) (* (- (* 1 1) (* (exp x) 1)) (- (* 1 1) (* (exp x) 1))))))
500.0ms
(/ (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1))) (* (cbrt (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1)))) (cbrt (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1))))))
488.0ms
(sqrt (/ (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1))) (* (cbrt (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1)))) (cbrt (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1)))))))
341.0ms
(sqrt (/ (+ (pow (exp x) 3) (pow 1 3)) (+ (pow (* (exp x) (exp x)) 3) (pow (- (* 1 1) (* (exp x) 1)) 3))))

prune2.3s

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0.2b

localize54.0ms

Local error

Found 4 expressions with local error:

5.4b
(- 1 (exp x))
5.4b
(- (* 1 1) (* (exp x) 1))
0.3b
(sqrt (/ (+ (exp (+ x x)) (- 1 (exp x))) (/ (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1))) (+ (exp x) 1))))
0.2b
(/ (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1))) (+ (exp x) 1))

rewrite103.0ms

Algorithm
rewrite-expression-head
Rules
108×times-frac
86×*-un-lft-identity
65×sqrt-prod
62×add-sqr-sqrt
56×add-cube-cbrt
15×distribute-lft-out
11×associate-/r/
add-log-exp
div-inv
flip-+
add-exp-log
add-cbrt-cube
flip3-+
pow1
associate-/l*
associate-/r*
rem-sqrt-square
associate-/l/
flip--
flip3--
sub-neg
div-exp
div-sub
diff-log
sqrt-div
pow1/2
distribute-rgt-out--
frac-2neg
associate-+r-
clear-num
cbrt-undiv
Counts
4 → 133
Calls
4 calls:
Slowest
50.0ms
(/ (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1))) (+ (exp x) 1))
40.0ms
(sqrt (/ (+ (exp (+ x x)) (- 1 (exp x))) (/ (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1))) (+ (exp x) 1))))
5.0ms
(- (* 1 1) (* (exp x) 1))
2.0ms
(- 1 (exp x))

series285.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
170.0ms
(sqrt (/ (+ (exp (+ x x)) (- 1 (exp x))) (/ (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1))) (+ (exp x) 1))))
68.0ms
(/ (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1))) (+ (exp x) 1))
25.0ms
(- (* 1 1) (* (exp x) 1))
22.0ms
(- 1 (exp x))

simplify26.4s

Counts
113 → 145
Calls
113 calls:
Slowest
4.1s
(sqrt (/ (* (cbrt (+ (exp (+ x x)) (- 1 (exp x)))) (cbrt (+ (exp (+ x x)) (- 1 (exp x))))) (/ (* (cbrt (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1)))) (cbrt (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1))))) (sqrt (+ (exp x) 1)))))
1.0s
(sqrt (/ (* (cbrt (+ (exp (+ x x)) (- 1 (exp x)))) (cbrt (+ (exp (+ x x)) (- 1 (exp x))))) (/ (* (cbrt (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1)))) (cbrt (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1))))) 1)))
910.0ms
(sqrt (/ (* (cbrt (+ (exp (+ x x)) (- 1 (exp x)))) (cbrt (+ (exp (+ x x)) (- 1 (exp x))))) (/ (* (cbrt (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1)))) (cbrt (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1))))) (* (cbrt (+ (exp x) 1)) (cbrt (+ (exp x) 1))))))
905.0ms
(sqrt (/ 1 (/ (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1))) (+ (pow (exp x) 3) (pow 1 3)))))
834.0ms
(sqrt (/ 1 (/ (+ (* (exp x) (exp x)) (- (* 1 1) (* (exp x) 1))) (+ (pow (exp x) 3) (pow 1 3)))))

prune2.9s

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0.2b

regimes58.0ms

Accuracy

0% (0.0b remaining)

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

bsearch2.0ms

end0.0ms

sample15.1s

Algorithm
intervals
Results
27564×(pre true 80)
12651×(body nan 80)
7446×(body real 80)
6763×(body exit 10240)
704×(body real 160)