From 3cbc229cde5e4bb455fae3158d7d658c0036e23d Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Wed, 5 Apr 2017 15:53:14 +0200 Subject: Fractional powers! --- attract.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/attract.c b/attract.c index bd7717d..16f1703 100644 --- a/attract.c +++ b/attract.c @@ -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"); -- cgit v1.2.3-70-g09d2