Numerically stable evaluation of $x^{n!}$

61 Views Asked by At

Given that $x$ is a real number with property $0 < x < 1$ and $n$ upto $4000$ Is there a good way to decompose the n! into steps for multiplying x?

1

There are 1 best solutions below

0
On

Minimal number of multiplications in worst case $n=4000$: $N_{\min}=\lceil\log_2 4000!\rceil=42\,100$. “Bruteforce” approach, using fast multiplication for power 2, then 3, then 4 etc gives $N_{bf}=\sum_{k=2}^{4000} \lceil\log_2k\rceil=43\,905$. So it's less than 5% inoptimal. I wouldn't be bothered with writing a sophisticated algorithm.