Average Error: 0.4 → 0.4
Time: 59.4s
Precision: 64
Internal Precision: 128
\[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}\]
\[\frac{1}{\frac{\sqrt{k}}{{\left(\pi \cdot \left(n \cdot 2\right)\right)}^{\left(\frac{1}{2} - \frac{k}{2}\right)}}}\]

Error

Bits error versus k

Bits error versus n

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.4

    \[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}\]
  2. Simplified0.4

    \[\leadsto \color{blue}{\frac{{\left(\pi \cdot \left(n \cdot 2\right)\right)}^{\left(\frac{1}{2} - \frac{k}{2}\right)}}{\sqrt{k}}}\]
  3. Using strategy rm
  4. Applied *-un-lft-identity0.4

    \[\leadsto \frac{\color{blue}{1 \cdot {\left(\pi \cdot \left(n \cdot 2\right)\right)}^{\left(\frac{1}{2} - \frac{k}{2}\right)}}}{\sqrt{k}}\]
  5. Applied associate-/l*0.4

    \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt{k}}{{\left(\pi \cdot \left(n \cdot 2\right)\right)}^{\left(\frac{1}{2} - \frac{k}{2}\right)}}}}\]
  6. Final simplification0.4

    \[\leadsto \frac{1}{\frac{\sqrt{k}}{{\left(\pi \cdot \left(n \cdot 2\right)\right)}^{\left(\frac{1}{2} - \frac{k}{2}\right)}}}\]

Reproduce

herbie shell --seed 2019016 
(FPCore (k n)
  :name "Migdal et al, Equation (51)"
  (* (/ 1 (sqrt k)) (pow (* (* 2 PI) n) (/ (- 1 k) 2))))

Details

Time bar (total: 58.7s)Debug log

sample354.0ms

Algorithm
intervals
Results
1008×(pre true 80)
648×(body nan 80)
360×(body real 80)

simplify72.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
71.0ms
(* (/ 1 (sqrt k)) (pow (* (* 2 PI) n) (/ (- 1 k) 2)))

prune12.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.6b

localize42.0ms

Local error

Found 3 expressions with local error:

1.2b
(pow (* PI (* n 2)) (- 1/2 (/ k 2)))
0.2b
(* PI (* n 2))
0.2b
(/ (pow (* PI (* n 2)) (- 1/2 (/ k 2))) (sqrt k))

rewrite14.0ms

Algorithm
rewrite-expression-head
Rules
18×times-frac
15×add-cube-cbrt
15×*-un-lft-identity
15×add-sqr-sqrt
10×unpow-prod-up
add-exp-log
associate-/l*
add-cbrt-cube
unpow-prod-down
sub-neg
pow1
add-log-exp
div-exp
associate-/r*
pow-unpow
pow-sub
pow-exp
pow-to-exp
associate-/l/
div-inv
*-commutative
associate-*r*
frac-2neg
pow-pow
clear-num
cbrt-undiv
Counts
3 → 68
Calls
3 calls:
Slowest
8.0ms
(/ (pow (* PI (* n 2)) (- 1/2 (/ k 2))) (sqrt k))
3.0ms
(pow (* PI (* n 2)) (- 1/2 (/ k 2)))
2.0ms
(* PI (* n 2))

series489.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
245.0ms
(/ (pow (* PI (* n 2)) (- 1/2 (/ k 2))) (sqrt k))
158.0ms
(pow (* PI (* n 2)) (- 1/2 (/ k 2)))
87.0ms
(* PI (* n 2))

simplify3.3s

Counts
67 → 77
Calls
67 calls:
Slowest
586.0ms
(- (* (log (* PI (* n 2))) (- 1/2 (/ k 2))) (log (sqrt k)))
582.0ms
(- (* (log (* PI (* n 2))) (- 1/2 (/ k 2))) (log (sqrt k)))
302.0ms
(/ (* (* (pow (* PI (* n 2)) (- 1/2 (/ k 2))) (pow (* PI (* n 2)) (- 1/2 (/ k 2)))) (pow (* PI (* n 2)) (- 1/2 (/ k 2)))) (* (* (sqrt k) (sqrt k)) (sqrt k)))
280.0ms
(- (+ (* 1/4 (* (log (* 2 PI)) (* (exp (* 1/2 (+ (log n) (log (* 2 PI))))) (* (log n) (pow k 2))))) (+ (* 1/8 (* (exp (* 1/2 (+ (log n) (log (* 2 PI))))) (* (pow (log n) 2) (pow k 2)))) (+ (exp (* 1/2 (+ (log n) (log (* 2 PI))))) (* 1/8 (* (pow (log (* 2 PI)) 2) (* (exp (* 1/2 (+ (log n) (log (* 2 PI))))) (pow k 2))))))) (+ (* 1/2 (* (exp (* 1/2 (+ (log n) (log (* 2 PI))))) (* (log n) k))) (* 1/2 (* (log (* 2 PI)) (* (exp (* 1/2 (+ (log n) (log (* 2 PI))))) k)))))
228.0ms
(* (log (* PI (* n 2))) (- 1/2 (/ k 2)))

prune763.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0.0b

localize12.0ms

Local error

Found 4 expressions with local error:

1.2b
(pow (* PI (* n 2)) (- 1/2 (/ k 2)))
0.2b
(* PI (* n 2))
0.2b
(/ (sqrt k) (pow (* PI (* n 2)) (- 1/2 (/ k 2))))
0.1b
(/ 1 (/ (sqrt k) (pow (* PI (* n 2)) (- 1/2 (/ k 2)))))

rewrite23.0ms

Algorithm
rewrite-expression-head
Rules
36×times-frac
29×associate-/r*
26×add-cube-cbrt
26×*-un-lft-identity
26×add-sqr-sqrt
16×add-exp-log
16×unpow-prod-up
unpow-prod-down
sub-neg
div-exp
add-cbrt-cube
pow1
add-log-exp
rec-exp
pow-sub
associate-/l*
div-inv
associate-/r/
pow-exp
pow-unpow
pow-to-exp
frac-2neg
clear-num
inv-pow
pow-flip
*-commutative
associate-*r*
pow-pow
cbrt-undiv
Counts
4 → 108
Calls
4 calls:
Slowest
11.0ms
(/ (sqrt k) (pow (* PI (* n 2)) (- 1/2 (/ k 2))))
4.0ms
(/ 1 (/ (sqrt k) (pow (* PI (* n 2)) (- 1/2 (/ k 2)))))
3.0ms
(pow (* PI (* n 2)) (- 1/2 (/ k 2)))
2.0ms
(* PI (* n 2))

series538.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
168.0ms
(/ (sqrt k) (pow (* PI (* n 2)) (- 1/2 (/ k 2))))
145.0ms
(/ 1 (/ (sqrt k) (pow (* PI (* n 2)) (- 1/2 (/ k 2)))))
140.0ms
(pow (* PI (* n 2)) (- 1/2 (/ k 2)))
85.0ms
(* PI (* n 2))

simplify3.2s

Counts
95 → 120
Calls
95 calls:
Slowest
400.0ms
(- (log (sqrt k)) (* (log (* PI (* n 2))) (- 1/2 (/ k 2))))
346.0ms
(- (log (sqrt k)) (* (log (* PI (* n 2))) (- 1/2 (/ k 2))))
281.0ms
(- (log (sqrt k)) (log (pow (* PI (* n 2)) (- 1/2 (/ k 2)))))
278.0ms
(/ (* (* (sqrt k) (sqrt k)) (sqrt k)) (* (* (pow (* PI (* n 2)) (- 1/2 (/ k 2))) (pow (* PI (* n 2)) (- 1/2 (/ k 2)))) (pow (* PI (* n 2)) (- 1/2 (/ k 2)))))
271.0ms
(* (log (* PI (* n 2))) (- 1/2 (/ k 2)))

prune1.4s

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 0.0b

localize37.0ms

Local error

Found 4 expressions with local error:

0.9b
(pow (* n 2) (- 1/2 (/ k 2)))
0.5b
(pow PI (- 1/2 (/ k 2)))
0.2b
(/ (/ 1 (/ 1 (pow PI (- 1/2 (/ k 2))))) (/ (sqrt k) (pow (* n 2) (- 1/2 (/ k 2)))))
0.2b
(/ (sqrt k) (pow (* n 2) (- 1/2 (/ k 2))))

rewrite32.0ms

Algorithm
rewrite-expression-head
Rules
241×times-frac
101×add-cube-cbrt
101×*-un-lft-identity
101×add-sqr-sqrt
48×unpow-prod-up
46×add-exp-log
32×div-inv
32×associate-/r/
31×div-exp
29×associate-/r*
24×sub-neg
23×unpow-prod-down
20×rec-exp
11×add-cbrt-cube
11×pow-to-exp
pow-sub
associate-/l*
pow-exp
pow-unpow
pow1
add-log-exp
cbrt-undiv
frac-2neg
clear-num
associate-/l/
pow-pow
Counts
4 → 246
Calls
4 calls:
Slowest
12.0ms
(/ (/ 1 (/ 1 (pow PI (- 1/2 (/ k 2))))) (/ (sqrt k) (pow (* n 2) (- 1/2 (/ k 2)))))
9.0ms
(/ (sqrt k) (pow (* n 2) (- 1/2 (/ k 2))))
3.0ms
(pow (* n 2) (- 1/2 (/ k 2)))
1.0ms
(pow PI (- 1/2 (/ k 2)))

series513.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
247.0ms
(/ (/ 1 (/ 1 (pow PI (- 1/2 (/ k 2))))) (/ (sqrt k) (pow (* n 2) (- 1/2 (/ k 2)))))
123.0ms
(pow (* n 2) (- 1/2 (/ k 2)))
106.0ms
(/ (sqrt k) (pow (* n 2) (- 1/2 (/ k 2))))
37.0ms
(pow PI (- 1/2 (/ k 2)))

simplify28.2s

Counts
351 → 258
Calls
351 calls:
Slowest
534.0ms
(- (- (log (/ 1 (pow PI (- 1/2 (/ k 2)))))) (- (log (sqrt k)) (log (pow (* n 2) (- 1/2 (/ k 2))))))
505.0ms
(- (log (/ 1 (/ 1 (pow PI (- 1/2 (/ k 2)))))) (- (log (sqrt k)) (log (pow (* n 2) (- 1/2 (/ k 2))))))
491.0ms
(/ (* (cbrt (/ 1 (/ 1 (pow PI (- 1/2 (/ k 2)))))) (cbrt (/ 1 (/ 1 (pow PI (- 1/2 (/ k 2))))))) (/ (* (cbrt (sqrt k)) (cbrt (sqrt k))) 1))
454.0ms
(/ (/ 1 (/ 1 (pow PI (- 1/2 (/ k 2))))) (/ (sqrt k) (sqrt (pow (* n 2) (- 1/2 (/ k 2))))))
450.0ms
(/ (/ 1 (/ 1 (pow PI (- 1/2 (/ k 2))))) (/ (cbrt (sqrt k)) (pow (* n 2) (- (/ k 2)))))

prune3.4s

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 0b

localize12.0ms

Local error

Found 4 expressions with local error:

0.9b
(pow (* n 2) (- 1/2 (/ k 2)))
0.5b
(pow PI (- 1/2 (/ k 2)))
0.2b
(/ (* (pow PI (- 1/2 (/ k 2))) (pow (* n 2) (- 1/2 (/ k 2)))) (sqrt k))
0.1b
(* (pow PI (- 1/2 (/ k 2))) (pow (* n 2) (- 1/2 (/ k 2))))

rewrite33.0ms

Algorithm
rewrite-expression-head
Rules
27×add-exp-log
12×prod-exp
12×pow-to-exp
11×add-cbrt-cube
10×pow-sub
10×add-cube-cbrt
10×*-un-lft-identity
10×add-sqr-sqrt
unpow-prod-up
div-exp
associate-*r*
pow-unpow
pow-exp
associate-*l*
pow1
add-log-exp
sub-neg
associate-/l/
times-frac
associate-/r*
cbrt-unprod
associate-*r/
associate-*l/
unpow-prod-down
cbrt-undiv
frac-times
associate-/l*
div-inv
*-commutative
pow-prod-down
frac-2neg
pow-pow
clear-num
Counts
4 → 90
Calls
4 calls:
Slowest
16.0ms
(/ (* (pow PI (- 1/2 (/ k 2))) (pow (* n 2) (- 1/2 (/ k 2)))) (sqrt k))
11.0ms
(* (pow PI (- 1/2 (/ k 2))) (pow (* n 2) (- 1/2 (/ k 2))))
3.0ms
(pow (* n 2) (- 1/2 (/ k 2)))
1.0ms
(pow PI (- 1/2 (/ k 2)))

series586.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
266.0ms
(/ (* (pow PI (- 1/2 (/ k 2))) (pow (* n 2) (- 1/2 (/ k 2)))) (sqrt k))
179.0ms
(* (pow PI (- 1/2 (/ k 2))) (pow (* n 2) (- 1/2 (/ k 2))))
111.0ms
(pow (* n 2) (- 1/2 (/ k 2)))
29.0ms
(pow PI (- 1/2 (/ k 2)))

simplify6.3s

Counts
72 → 102
Calls
72 calls:
Slowest
663.0ms
(exp (* (- (log 2) (log (/ 1 n))) (- 1/2 (* 1/2 k))))
499.0ms
(- (log (* (pow PI (- 1/2 (/ k 2))) (pow (* n 2) (- 1/2 (/ k 2))))) (log (sqrt k)))
466.0ms
(/ (* (* (* (pow PI (- 1/2 (/ k 2))) (pow PI (- 1/2 (/ k 2)))) (pow PI (- 1/2 (/ k 2)))) (* (* (pow (* n 2) (- 1/2 (/ k 2))) (pow (* n 2) (- 1/2 (/ k 2)))) (pow (* n 2) (- 1/2 (/ k 2))))) (* (* (sqrt k) (sqrt k)) (sqrt k)))
439.0ms
(- (+ (* (log PI) (- 1/2 (/ k 2))) (log (pow (* n 2) (- 1/2 (/ k 2))))) (log (sqrt k)))
408.0ms
(/ (* (* (* (pow PI (- 1/2 (/ k 2))) (pow (* n 2) (- 1/2 (/ k 2)))) (* (pow PI (- 1/2 (/ k 2))) (pow (* n 2) (- 1/2 (/ k 2))))) (* (pow PI (- 1/2 (/ k 2))) (pow (* n 2) (- 1/2 (/ k 2))))) (* (* (sqrt k) (sqrt k)) (sqrt k)))

prune1.3s

Pruning

7 alts after pruning (5 fresh and 2 done)

Merged error: 0b

regimes135.0ms

Accuracy

0% (0.4b remaining)

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

bsearch3.0ms

end0.0ms

sample8.0s

Algorithm
intervals
Results
32813×(pre true 80)
20878×(body nan 80)
11931×(body real 80)
(body nan 160)