diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-04-05 15:53:14 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-04-05 15:53:14 +0200 |
commit | 3cbc229cde5e4bb455fae3158d7d658c0036e23d (patch) | |
tree | 1ee0ee432a919f00c6d1782e7199aa4783c8e331 | |
parent | 6fba2e74c6b5c6f631a5c70da58fb5af25a7d389 (diff) |
Fractional powers!
-rw-r--r-- | attract.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -16,6 +16,7 @@ const int MAXITER=200; const double EPS=1e-1; static double complex att_func(double complex x){ +#if 0 static const int N=9; double complex r=1,y=x; @@ -25,6 +26,10 @@ static double complex att_func(double complex x){ } r+=y; return clog(r); +#else + static const double N=8.5; + return clog((1-cpow(x,N+1))/(1-x)); +#endif } struct colour{ @@ -123,7 +128,7 @@ int main(void){ unsigned char img[cfg.width*cfg.height*3]; int nthreads=sysconf(_SC_NPROCESSORS_ONLN); - nthreads/=2; + if(nthreads==4)nthreads/=2; if(nthreads>=999||nthreads<1)nthreads=1; fprintf(stderr,"Using %d thread%s\n",nthreads,nthreads==1?"":"s"); |