summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-04-05 15:53:14 +0200
committertomsmeding <tom.smeding@gmail.com>2017-04-05 15:53:14 +0200
commit3cbc229cde5e4bb455fae3158d7d658c0036e23d (patch)
tree1ee0ee432a919f00c6d1782e7199aa4783c8e331
parent6fba2e74c6b5c6f631a5c70da58fb5af25a7d389 (diff)
Fractional powers!
-rw-r--r--attract.c7
1 files changed, 6 insertions, 1 deletions
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");