Skip to content

Commit

Permalink
Merge pull request #7 from hrkalona/release/1.0.8.6
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
hrkalona committed Jan 15, 2023
2 parents 3e4a6b1 + 66b2bd4 commit 4acdfd1
Show file tree
Hide file tree
Showing 157 changed files with 7,729 additions and 1,967 deletions.
11 changes: 11 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Version 1.0.8.6
-The contents of UserDefinedFunctions can now be saved as part of the settings, and then loaded into a new file (SavedUserDefinedFunctions) upon settings load
-Added a new high-precision module which renders all functions that support perturbation theory with full precision for every pixel calculation (It should be used only for debug as it has very bad performance)
-Optimized the reference calculation for some functions when using MPFR
-The detected period can now be used in BLA and Nanomb1 calculations (Disclaimer, it was found that the current implementation calculates the atom period. It will be changed on the next update)
-Added an option for greedy drawing algorithms that take into account the iteration data and the color
-Processing algorithms and statistical coloring methods will use smoothing by default
-Added an image preview option (Always Use Quick Draw) in Quick Draw options, that creates an image in low resolution before the full render.
-Fixed a bug on the scaled iterations algorithm, which caused some deep zoom images to render incorrectly.
-Bug fixes and stability changes

Version 1.0.8.5
-Added a scaled iterations perturbation implementation for Mandelbrot (No Approximation/Series Approximation/Nanomb1)
-Fixed distance estimation with Polar Projection
Expand Down
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Fractal Zoomer 1.0.8.5
Fractal Zoomer 1.0.8.6

The most complete fractal generating software using java!

Expand Down
4 changes: 2 additions & 2 deletions src/fractalzoomer/bailout_conditions/BailoutCondition.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public abstract class BailoutCondition {
protected BailoutCondition(double bound) {

this.bound = bound;
if(ThreadDraw.PERTURBATION_THEORY) {
if(ThreadDraw.PERTURBATION_THEORY || ThreadDraw.HIGH_PRECISION_CALCULATION) {
ddbound = new MyApfloat(bound);
ddcbound = new DoubleDouble(bound);

if(ThreadDraw.USE_BIGNUM_FOR_REF_IF_POSSIBLE) {
if(ThreadDraw.USE_BIGNUM_FOR_REF_IF_POSSIBLE || ThreadDraw.HIGH_PRECISION_CALCULATION) {
bnbound = new BigNum(ddbound);
}
}
Expand Down
14 changes: 12 additions & 2 deletions src/fractalzoomer/bailout_conditions/CircleBailoutCondition.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package fractalzoomer.bailout_conditions;

import fractalzoomer.core.*;
import fractalzoomer.core.mpfr.LibMpfr;
import fractalzoomer.core.mpfr.MpfrBigNum;
import org.apfloat.Apfloat;

Expand All @@ -26,10 +27,19 @@
* @author hrkalona2
*/
public class CircleBailoutCondition extends BailoutCondition {
private MpfrBigNum temp1;
private MpfrBigNum temp2;

public CircleBailoutCondition(double bound) {
public CircleBailoutCondition(double bound, boolean allocateMemory) {

super(bound);

if((ThreadDraw.PERTURBATION_THEORY && ThreadDraw.USE_BIGNUM_FOR_REF_IF_POSSIBLE) || ThreadDraw.HIGH_PRECISION_CALCULATION) {
if(allocateMemory && LibMpfr.LOAD_ERROR == null) {
temp1 = new MpfrBigNum();
temp2 = new MpfrBigNum();
}
}

}

Expand All @@ -54,7 +64,7 @@ public boolean escaped(BigNumComplex z, BigNumComplex zold, BigNumComplex zold2,

@Override
public boolean escaped(MpfrBigNumComplex z, MpfrBigNumComplex zold, MpfrBigNumComplex zold2, int iterations, MpfrBigNumComplex c, MpfrBigNumComplex start, MpfrBigNumComplex c0, MpfrBigNum norm_squared, MpfrBigNumComplex pixel) {
return z.norm_squared().compare(bound) >= 0;
return z.norm_squared(temp1, temp2).compare(bound) >= 0;
}

@Override
Expand Down
12 changes: 11 additions & 1 deletion src/fractalzoomer/bailout_conditions/CrossBailoutCondition.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package fractalzoomer.bailout_conditions;

import fractalzoomer.core.*;
import fractalzoomer.core.mpfr.LibMpfr;
import fractalzoomer.core.mpfr.MpfrBigNum;
import org.apfloat.Apfloat;

Expand All @@ -25,10 +26,19 @@
* @author hrkalona2
*/
public class CrossBailoutCondition extends BailoutCondition {
private MpfrBigNum temp1;
private MpfrBigNum temp2;

public CrossBailoutCondition(double bound) {

super(bound);

if((ThreadDraw.PERTURBATION_THEORY && ThreadDraw.USE_BIGNUM_FOR_REF_IF_POSSIBLE) || ThreadDraw.HIGH_PRECISION_CALCULATION) {
if(LibMpfr.LOAD_ERROR == null) {
temp1 = new MpfrBigNum();
temp2 = new MpfrBigNum();
}
}

}

Expand All @@ -53,7 +63,7 @@ public boolean escaped(BigNumComplex z, BigNumComplex zold, BigNumComplex zold2,

@Override
public boolean escaped(MpfrBigNumComplex z, MpfrBigNumComplex zold, MpfrBigNumComplex zold2, int iterations, MpfrBigNumComplex c, MpfrBigNumComplex start, MpfrBigNumComplex c0, MpfrBigNum norm_squared, MpfrBigNumComplex pixel) {
return z.getAbsRe().compare(bound) >= 0 && z.getAbsIm().compare(bound) >= 0;
return z.getAbsRe(temp1).compare(bound) >= 0 && z.getAbsIm(temp2).compare(bound) >= 0;
}

@Override
Expand Down
12 changes: 11 additions & 1 deletion src/fractalzoomer/bailout_conditions/CustomBailoutCondition.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
package fractalzoomer.bailout_conditions;

import fractalzoomer.core.*;
import fractalzoomer.core.mpfr.LibMpfr;
import fractalzoomer.core.mpfr.MpfrBigNum;
import org.apfloat.Apfloat;

public class CustomBailoutCondition extends BailoutCondition {
private MpfrBigNum temp1;
private MpfrBigNum temp2;

public CustomBailoutCondition(double bound) {

super(Math.pow(bound, 1 / Math.sqrt(bound)));

if((ThreadDraw.PERTURBATION_THEORY && ThreadDraw.USE_BIGNUM_FOR_REF_IF_POSSIBLE) || ThreadDraw.HIGH_PRECISION_CALCULATION) {
if(LibMpfr.LOAD_ERROR == null) {
temp1 = new MpfrBigNum();
temp2 = new MpfrBigNum();
}
}

}

@Override
Expand All @@ -33,7 +43,7 @@ public boolean escaped(BigNumComplex z, BigNumComplex zold, BigNumComplex zold2,

@Override
public boolean escaped(MpfrBigNumComplex z, MpfrBigNumComplex zold, MpfrBigNumComplex zold2, int iterations, MpfrBigNumComplex c, MpfrBigNumComplex start, MpfrBigNumComplex c0, MpfrBigNum norm_squared, MpfrBigNumComplex pixel) {
return z.norm().compare(bound) >= 0;
return z.norm(temp1, temp2).compare(bound) >= 0;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package fractalzoomer.bailout_conditions;

import fractalzoomer.core.*;
import fractalzoomer.core.mpfr.LibMpfr;
import fractalzoomer.core.mpfr.MpfrBigNum;
import org.apfloat.Apfloat;

Expand All @@ -25,10 +26,20 @@
* @author hrkalona2
*/
public class FieldLinesBailoutCondition extends BailoutCondition {

private MpfrBigNum temp1;
private MpfrBigNum temp2;


public FieldLinesBailoutCondition(double bound) {

super(bound);

if((ThreadDraw.PERTURBATION_THEORY && ThreadDraw.USE_BIGNUM_FOR_REF_IF_POSSIBLE) || ThreadDraw.HIGH_PRECISION_CALCULATION) {
if(LibMpfr.LOAD_ERROR == null) {
temp1 = new MpfrBigNum();
temp2 = new MpfrBigNum();
}
}

}

Expand Down Expand Up @@ -74,7 +85,7 @@ public boolean escaped(MpfrBigNumComplex z, MpfrBigNumComplex zold, MpfrBigNumCo
return false;
}

return iterations > 1 && z.getRe().divide(zoldRe).compare(bound) >= 0 && z.getIm().divide(zoldIm).compare(bound) >= 0;
return iterations > 1 && z.getRe().divide(zoldRe, temp1).compare(bound) >= 0 && z.getIm().divide(zoldIm, temp2).compare(bound) >= 0;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package fractalzoomer.bailout_conditions;

import fractalzoomer.core.*;
import fractalzoomer.core.mpfr.LibMpfr;
import fractalzoomer.core.mpfr.MpfrBigNum;
import org.apfloat.Apfloat;

Expand All @@ -25,10 +26,17 @@
* @author hrkalona2
*/
public class ImaginaryStripBailoutCondition extends BailoutCondition {
private MpfrBigNum temp1;

public ImaginaryStripBailoutCondition(double bound) {

super(bound);

if((ThreadDraw.PERTURBATION_THEORY && ThreadDraw.USE_BIGNUM_FOR_REF_IF_POSSIBLE) || ThreadDraw.HIGH_PRECISION_CALCULATION) {
if(LibMpfr.LOAD_ERROR == null) {
temp1 = new MpfrBigNum();
}
}

}

Expand All @@ -53,7 +61,7 @@ public boolean escaped(BigNumComplex z, BigNumComplex zold, BigNumComplex zold2,

@Override
public boolean escaped(MpfrBigNumComplex z, MpfrBigNumComplex zold, MpfrBigNumComplex zold2, int iterations, MpfrBigNumComplex c, MpfrBigNumComplex start, MpfrBigNumComplex c0, MpfrBigNum norm_squared, MpfrBigNumComplex pixel) {
return z.getAbsIm().compare(bound) >= 0;
return z.getAbsIm(temp1).compare(bound) >= 0;
}

@Override
Expand Down
34 changes: 27 additions & 7 deletions src/fractalzoomer/bailout_conditions/NNormBailoutCondition.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,44 @@
*/
public class NNormBailoutCondition extends BailoutCondition {
protected double n_norm;
protected double n_norm_reciprocal;
protected Apfloat ddn_norm;
protected Apfloat ddn_norm_reciprocal;
protected MpfrBigNum mpfrbn_norm;

private MpfrBigNum temp1;
private MpfrBigNum temp2;
private MpfrBigNum mpfrbn_norm_reciprocal;

protected DoubleDouble dddn_norm;
protected DoubleDouble dddn_norm_reciprocal;

public NNormBailoutCondition(double bound, double n_norm) {

super(bound);
this.n_norm = n_norm;
n_norm_reciprocal = 1 / n_norm;

if(ThreadDraw.PERTURBATION_THEORY) {
if(ThreadDraw.PERTURBATION_THEORY || ThreadDraw.HIGH_PRECISION_CALCULATION) {
ddn_norm = new MyApfloat(n_norm);
dddn_norm = new DoubleDouble(n_norm);

if(ThreadDraw.USE_BIGNUM_FOR_REF_IF_POSSIBLE) {
if(n_norm != 0) {
ddn_norm_reciprocal = MyApfloat.reciprocal(ddn_norm);
dddn_norm_reciprocal = dddn_norm.reciprocal();
}


if(ThreadDraw.USE_BIGNUM_FOR_REF_IF_POSSIBLE || ThreadDraw.HIGH_PRECISION_CALCULATION) {

if(LibMpfr.LOAD_ERROR == null) {
mpfrbn_norm = new MpfrBigNum(n_norm);
temp1 = new MpfrBigNum();
temp2 = new MpfrBigNum();

if(n_norm != 0) {
mpfrbn_norm_reciprocal = mpfrbn_norm.reciprocal();
}
}
}
}
Expand All @@ -56,7 +76,7 @@ public NNormBailoutCondition(double bound, double n_norm) {
@Override //N norm
public boolean escaped(Complex z, Complex zold, Complex zold2, int iterations, Complex c, Complex start, Complex c0, double norm_squared, Complex pixel) {

return z.nnorm(n_norm) >= bound;
return z.nnorm(n_norm, n_norm_reciprocal) >= bound;

}

Expand All @@ -67,7 +87,7 @@ public boolean escaped(BigComplex z, BigComplex zold, BigComplex zold2, int iter
return false;
}

return z.nnorm(ddn_norm).compareTo(ddbound) >= 0;
return z.nnorm(ddn_norm, ddn_norm_reciprocal).compareTo(ddbound) >= 0;

}

Expand All @@ -76,7 +96,7 @@ public boolean escaped(BigNumComplex z, BigNumComplex zold, BigNumComplex zold2,
if(n_norm == 0) {
return false;
}
return z.toComplex().nnorm(n_norm) >= bound;
return z.toComplex().nnorm(n_norm, n_norm_reciprocal) >= bound;
}

@Override
Expand All @@ -85,7 +105,7 @@ public boolean escaped(MpfrBigNumComplex z, MpfrBigNumComplex zold, MpfrBigNumCo
return false;
}

return z.nnorm(mpfrbn_norm).compare(bound) >= 0;
return z.nnorm(mpfrbn_norm, temp1, temp2, mpfrbn_norm_reciprocal).compare(bound) >= 0;
}

@Override
Expand All @@ -95,7 +115,7 @@ public boolean escaped(DDComplex z, DDComplex zold, DDComplex zold2, int iterati
return false;
}

return z.nnorm(dddn_norm).compareTo(ddcbound) >= 0;
return z.nnorm(dddn_norm, dddn_norm_reciprocal).compareTo(ddcbound) >= 0;

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package fractalzoomer.bailout_conditions;

import fractalzoomer.core.*;
import fractalzoomer.core.mpfr.LibMpfr;
import fractalzoomer.core.mpfr.MpfrBigNum;
import org.apfloat.Apfloat;

Expand All @@ -25,10 +26,17 @@
* @author hrkalona2
*/
public class RealPlusImaginarySquaredBailoutCondition extends BailoutCondition {
private MpfrBigNum temp1;

public RealPlusImaginarySquaredBailoutCondition(double bound) {

super(bound);

if((ThreadDraw.PERTURBATION_THEORY && ThreadDraw.USE_BIGNUM_FOR_REF_IF_POSSIBLE) || ThreadDraw.HIGH_PRECISION_CALCULATION) {
if(LibMpfr.LOAD_ERROR == null) {
temp1 = new MpfrBigNum();
}
}

}

Expand Down Expand Up @@ -56,11 +64,9 @@ public boolean escaped(BigNumComplex z, BigNumComplex zold, BigNumComplex zold2,

@Override
public boolean escaped(MpfrBigNumComplex z, MpfrBigNumComplex zold, MpfrBigNumComplex zold2, int iterations, MpfrBigNumComplex c, MpfrBigNumComplex start, MpfrBigNumComplex c0, MpfrBigNum norm_squared, MpfrBigNumComplex pixel) {
MpfrBigNum temp = new MpfrBigNum();
temp.set(z.getRe());
temp.add(z.getIm(), temp);
temp.square(temp);
return temp.compare(bound) >= 0;
z.getRe().add(z.getIm(), temp1);
temp1.square(temp1);
return temp1.compare(bound) >= 0;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package fractalzoomer.bailout_conditions;

import fractalzoomer.core.*;
import fractalzoomer.core.mpfr.LibMpfr;
import fractalzoomer.core.mpfr.MpfrBigNum;
import org.apfloat.Apfloat;

Expand All @@ -27,10 +28,17 @@
* @author hrkalona2
*/
public class RealStripBailoutCondition extends BailoutCondition {
private MpfrBigNum temp1;

public RealStripBailoutCondition(double bound) {

super(bound);

if((ThreadDraw.PERTURBATION_THEORY && ThreadDraw.USE_BIGNUM_FOR_REF_IF_POSSIBLE) || ThreadDraw.HIGH_PRECISION_CALCULATION) {
if(LibMpfr.LOAD_ERROR == null) {
temp1 = new MpfrBigNum();
}
}

}

Expand All @@ -55,7 +63,7 @@ public boolean escaped(BigNumComplex z, BigNumComplex zold, BigNumComplex zold2,

@Override
public boolean escaped(MpfrBigNumComplex z, MpfrBigNumComplex zold, MpfrBigNumComplex zold2, int iterations, MpfrBigNumComplex c, MpfrBigNumComplex start, MpfrBigNumComplex c0, MpfrBigNum norm_squared, MpfrBigNumComplex pixel) {
return z.getAbsRe().compare(bound) >= 0;
return z.getAbsRe(temp1).compare(bound) >= 0;
}

@Override
Expand Down
Loading

0 comments on commit 4acdfd1

Please sign in to comment.