Skip to content

Commit

Permalink
Merge pull request #6 from hrkalona/release/1.0.8.5
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
hrkalona committed Dec 10, 2022
2 parents 9a21243 + 35ede9c commit 3e4a6b1
Show file tree
Hide file tree
Showing 140 changed files with 9,227 additions and 6,087 deletions.
12 changes: 11 additions & 1 deletion Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
Version 1.0.8.5
-Added a scaled iterations perturbation implementation for Mandelbrot (No Approximation/Series Approximation/Nanomb1)
-Fixed distance estimation with Polar Projection
-Fixed a bug with julia sets and perturbation theory
-Added the option to render a batch of parameters to Image Expander tool
-Added the option to create zoom sequences (Images) to Image Expander tool
-Added the option to split the loaded parameters into multiple images to Image Expander tool
-Added the option to render large polar projection images (Mercator maps) to Image Expander tool
-Bug fixes and stability changes

Version 1.0.8.4
-Added mpfr lib as an option for the reference calculations which adds a lot of speed-up in very deep zooms
-Added and an option to choose the high precision library: Double (53 bits), DoubleDouble(106 Bits), Built-in, Mpfr, Automatic
Expand All @@ -10,7 +20,7 @@ Version 1.0.8.4
-Changed the Julia seed to support high precision
-Added the multiwave algorithm with some presets under the "Generated Palette option"
-Changed the thread mechanism to support different type of splits (Grid, Vertical, Horizontal)
-Added a direct palette loader (Map files in rgp triplet format) and included a lot of presets
-Added a direct palette loader (Map files in rgb triplet format) and included a lot of presets
-Added pixel jitter as an option
-Added an option to cancel the current render
-Modified quick-draw in order to have a configurable delay before the full render, and also added an option to zoom only to current center
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.4
Fractal Zoomer 1.0.8.5

The most complete fractal generating software using java!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public boolean escaped(BigComplex z, BigComplex zold, BigComplex zold2, int iter

@Override
public boolean escaped(BigNumComplex z, BigNumComplex zold, BigNumComplex zold2, int iterations, BigNumComplex c, BigNumComplex start, BigNumComplex c0, BigNum norm_squared, BigNumComplex pixel) {
return z.norm_squared().compare(bnbound) >= 0;
return z.norm_squared().compareBothPositive(bnbound) >= 0;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public boolean escaped(BigComplex z, BigComplex zold, BigComplex zold2, int iter

@Override
public boolean escaped(BigNumComplex z, BigNumComplex zold, BigNumComplex zold2, int iterations, BigNumComplex c, BigNumComplex start, BigNumComplex c0, BigNum norm_squared, BigNumComplex pixel) {
return norm_squared.compare(bnbound) >= 0;
return norm_squared.compareBothPositive(bnbound) >= 0;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public boolean escaped(BigComplex z, BigComplex zold, BigComplex zold2, int iter

@Override
public boolean escaped(BigNumComplex z, BigNumComplex zold, BigNumComplex zold2, int iterations, BigNumComplex c, BigNumComplex start, BigNumComplex c0, BigNum norm_squared, BigNumComplex pixel) {
return z.getAbsRe().compare(bnbound) >= 0 && z.getAbsIm().compare(bnbound) >= 0;
return z.getAbsRe().compareBothPositive(bnbound) >= 0 && z.getAbsIm().compareBothPositive(bnbound) >= 0;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public boolean escaped(BigComplex z, BigComplex zold, BigComplex zold2, int iter

@Override
public boolean escaped(BigNumComplex z, BigNumComplex zold, BigNumComplex zold2, int iterations, BigNumComplex c, BigNumComplex start, BigNumComplex c0, BigNum norm_squared, BigNumComplex pixel) {
return z.getAbsIm().compare(bnbound) >= 0;
return z.getAbsIm().compareBothPositive(bnbound) >= 0;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public boolean escaped(BigComplex z, BigComplex zold, BigComplex zold2, int iter
@Override
public boolean escaped(BigNumComplex z, BigNumComplex zold, BigNumComplex zold2, int iterations, BigNumComplex c, BigNumComplex start, BigNumComplex c0, BigNum norm_squared, BigNumComplex pixel) {
BigNum temp = z.getRe().add(z.getIm());
return temp.squareFull().compare(bnbound) >= 0;
return temp.squareFull().compareBothPositive(bnbound) >= 0;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public boolean escaped(BigComplex z, BigComplex zold, BigComplex zold2, int iter

@Override
public boolean escaped(BigNumComplex z, BigNumComplex zold, BigNumComplex zold2, int iterations, BigNumComplex c, BigNumComplex start, BigNumComplex c0, BigNum norm_squared, BigNumComplex pixel) {
return z.getAbsRe().compare(bnbound) >= 0;
return z.getAbsRe().compareBothPositive(bnbound) >= 0;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public boolean escaped(BigComplex z, BigComplex zold, BigComplex zold2, int iter

@Override
public boolean escaped(BigNumComplex z, BigNumComplex zold, BigNumComplex zold2, int iterations, BigNumComplex c, BigNumComplex start, BigNumComplex c0, BigNum norm_squared, BigNumComplex pixel) {
return z.getAbsRe().add(z.getAbsIm()).compare(bnbound) >= 0;
return z.getAbsRe().add(z.getAbsIm()).compareBothPositive(bnbound) >= 0;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ public boolean escaped(BigNumComplex z, BigNumComplex zold, BigNumComplex zold2,
BigNum absRe = z.getAbsRe();
BigNum absIm = z.getAbsIm();

BigNum max = absRe.compare(absIm) == 1 ? absRe : absIm;
BigNum max = absRe.compareBothPositive(absIm) == 1 ? absRe : absIm;

return max.compare(bnbound) >= 0;
return max.compareBothPositive(bnbound) >= 0;

}

Expand Down
15 changes: 12 additions & 3 deletions src/fractalzoomer/core/BigComplex.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,11 @@ public final BigComplex i_sub(Apfloat number) {
*/
public final BigComplex times(BigComplex z) {

return new BigComplex(MyApfloat.fp.subtract(MyApfloat.fp.multiply(re, z.re), MyApfloat.fp.multiply(im, z.im)), MyApfloat.fp.add(MyApfloat.fp.multiply(re, z.im), MyApfloat.fp.multiply(im, z.re)));
//return new BigComplex(MyApfloat.fp.subtract(MyApfloat.fp.multiply(re, z.re), MyApfloat.fp.multiply(im, z.im)), MyApfloat.fp.add(MyApfloat.fp.multiply(re, z.im), MyApfloat.fp.multiply(im, z.re)));

Apfloat ac = MyApfloat.fp.multiply(re, z.re);
Apfloat bd = MyApfloat.fp.multiply(im, z.im);
return new BigComplex(MyApfloat.fp.subtract(ac, bd), MyApfloat.fp.subtract(MyApfloat.fp.subtract(MyApfloat.fp.multiply(MyApfloat.fp.add(re, im), MyApfloat.fp.add(z.re, z.im)), ac), bd));
}

/*
Expand Down Expand Up @@ -722,7 +725,9 @@ public final boolean isZero() {
return re.compareTo(Apfloat.ZERO) == 0 && im.compareTo(Apfloat.ZERO) == 0;
}


public final boolean isOne() {
return re.compareTo(Apfloat.ONE) == 0 && im.compareTo(Apfloat.ZERO) == 0;
}


/*
Expand Down Expand Up @@ -818,7 +823,11 @@ public final BigComplex plus(GenericComplex zn) {
public final BigComplex times(GenericComplex zn) {

BigComplex z = (BigComplex)zn;
return new BigComplex(MyApfloat.fp.subtract(MyApfloat.fp.multiply(re, z.re), MyApfloat.fp.multiply(im, z.im)), MyApfloat.fp.add(MyApfloat.fp.multiply(re, z.im), MyApfloat.fp.multiply(im, z.re)));
//return new BigComplex(MyApfloat.fp.subtract(MyApfloat.fp.multiply(re, z.re), MyApfloat.fp.multiply(im, z.im)), MyApfloat.fp.add(MyApfloat.fp.multiply(re, z.im), MyApfloat.fp.multiply(im, z.re)));

Apfloat ac = MyApfloat.fp.multiply(re, z.re);
Apfloat bd = MyApfloat.fp.multiply(im, z.im);
return new BigComplex(MyApfloat.fp.subtract(ac, bd), MyApfloat.fp.subtract(MyApfloat.fp.subtract(MyApfloat.fp.multiply(MyApfloat.fp.add(re, im), MyApfloat.fp.add(z.re, z.im)), ac), bd));

}

Expand Down
42 changes: 36 additions & 6 deletions src/fractalzoomer/core/BigNum.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public long getScale() {
long v = digit;
double d = v & ~(v >>> 1);
//int r = (int)(((Double.doubleToRawLongBits(d) >> 52) & 0x7ff) - 1023); //Fix for the 64 bit, not needed here
bitOffset = (int)(((Double.doubleToRawLongBits(d) >> 52)) - 1023);
bitOffset = (int)((Double.doubleToRawLongBits(d) >> 52) - 1023);
//r |= (r >> 31); //Fix for zero, not needed here

//bitOffset = 31 - Integer.numberOfLeadingZeros(digit);
Expand Down Expand Up @@ -408,7 +408,7 @@ public void print() {
}
}

sum = MyApfloat.fp.multiply(sum, new MyApfloat(sign));
//sum = MyApfloat.fp.multiply(sum, new MyApfloat(sign));

System.out.println();
//System.out.println(sum.toRadix(2).toString(true));
Expand Down Expand Up @@ -465,6 +465,31 @@ else if(signA > signB) {

}

public int compareBothPositive(BigNum other) {

int signA = sign;
int signB = other.sign;

if(signA == 0 && signB == 0) {
return 0;
}

int[] otherDigits = other.digits;

for (int i = 0; i < digits.length; i++) {
int digit = digits[i];
int otherDigit = otherDigits[i];
if (digit < otherDigit) {
return -1;
} else if (digit > otherDigit) {
return 1;
}
}

return 0;

}

public double doubleValue2() {

int[] digits = this.digits;
Expand Down Expand Up @@ -493,7 +518,7 @@ public double doubleValue2() {
long v = digit;
double d = v & ~(v >>> 1);
//int r = (int)(((Double.doubleToRawLongBits(d) >> 52) & 0x7ff) - 1023); //Fix for the 64 bit, not needed here
bitOffset = (int)(((Double.doubleToRawLongBits(d) >> 52)) - 1023);
bitOffset = (int)((Double.doubleToRawLongBits(d) >> 52) - 1023);
//r |= (r >> 31); //Fix for zero, not needed here
//bitOffset = 31 - Integer.numberOfLeadingZeros(digit);

Expand Down Expand Up @@ -2975,6 +3000,11 @@ public boolean isPositive() {
public boolean isZero() {
return sign == 0;
}

public boolean isOne() {
return sign == 1 && isOne;
}

public boolean isNegative() {
return sign == -1;
//return digits[0] < 0;
Expand Down Expand Up @@ -3020,7 +3050,7 @@ else if (b.isOne){

BigNum oldVal = null;

int iterations = 0;
//int iterations = 0;

while (true) {
BigNum mid = low.add(high.sub(low).divide2());
Expand All @@ -3044,7 +3074,7 @@ else if (b.isOne){
else {
high = mid;
}
iterations++;
//iterations++;
}


Expand Down Expand Up @@ -3140,7 +3170,7 @@ public MantExp getMantExp() {
long v = digit;
double d = v & ~(v >>> 1);
//int r = (int)(((Double.doubleToRawLongBits(d) >> 52) & 0x7ff) - 1023); //Fix for the 64 bit, not needed here
bitOffset = (int) (((Double.doubleToRawLongBits(d) >> 52)) - 1023);
bitOffset = (int) ((Double.doubleToRawLongBits(d) >> 52) - 1023);
//r |= (r >> 31); //Fix for zero, not needed here

//bitOffset = 31 - Integer.numberOfLeadingZeros(digit);
Expand Down
18 changes: 16 additions & 2 deletions src/fractalzoomer/core/BigNumComplex.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ public final BigNumComplex i_sub(BigNum number) {
*/
public final BigNumComplex times(BigNumComplex z) {

return new BigNumComplex(re.mult(z.re).sub(im.mult(z.im)), re.mult(z.im).add(im.mult(z.re)));
//return new BigNumComplex(re.mult(z.re).sub(im.mult(z.im)), re.mult(z.im).add(im.mult(z.re)));
BigNum ac = re.mult(z.re);
BigNum bd = im.mult(z.im);
return new BigNumComplex(ac.sub(bd), re.add(im).mult(z.re.add(z.im)).sub(ac).sub(bd));

}

Expand Down Expand Up @@ -472,7 +475,10 @@ public final BigNumComplex square_plus_c(GenericComplex cn) {
public final BigNumComplex times(GenericComplex zn) {

BigNumComplex z = (BigNumComplex)zn;
return new BigNumComplex(re.mult(z.re).sub(im.mult(z.im)), re.mult(z.im).add(im.mult(z.re)));
//return new BigNumComplex(re.mult(z.re).sub(im.mult(z.im)), re.mult(z.im).add(im.mult(z.re)));
BigNum ac = re.mult(z.re);
BigNum bd = im.mult(z.im);
return new BigNumComplex(ac.sub(bd), re.add(im).mult(z.re.add(z.im)).sub(ac).sub(bd));

}

Expand Down Expand Up @@ -627,4 +633,12 @@ public void set(GenericComplex za) {

@Override
public GenericComplex times_mutable(GenericComplex a) {return times(a);}

public boolean isZero() {
return re.isZero() && im.isZero();
}

public boolean isOne() {
return re.isOne() && im.isZero();
}
}
33 changes: 22 additions & 11 deletions src/fractalzoomer/core/Complex.java
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,10 @@ public final double norm() {

}

public double hypot() {
return Math.hypot(re, im);
}

/*
* n-norm
*/
Expand Down Expand Up @@ -2559,18 +2563,23 @@ private double mod(double a, double b) {
public static double DiffAbs(double c, double d)
{
double cd = c + d;
if (c >= 0.0)
if (cd >= 0.0) return d;
else return -d - 2.0 * c;
else
if (cd > 0.0) return d + 2.0 * c;
else return -d;
}

public double hypot() {
return Math.hypot(re, im);
if (c >= 0.0) {
if (cd >= 0.0) {
return d;
}
else {
return -d - 2.0 * c;
}
}
else {
if (cd > 0.0) {
return d + 2.0 * c;
}
else {
return -d;
}
}
}

/*
* A*X + B*Y
*/
Expand Down Expand Up @@ -2864,6 +2873,7 @@ public final Complex plus_mutable(GenericComplex za) {
/*
* z1 = z1 / z2
*/
@Override
public final Complex divide_mutable(GenericComplex za) {
Complex z = (Complex) za;

Expand All @@ -2882,6 +2892,7 @@ public final Complex divide_mutable(GenericComplex za) {
/*
* z1 = z1 - z2
*/
@Override
public final Complex sub_mutable(GenericComplex za) {
Complex z = (Complex) za;

Expand Down
16 changes: 14 additions & 2 deletions src/fractalzoomer/core/DDComplex.java
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ public final DDComplex times(DDComplex z) {

return new DDComplex(re.multiply(z.re).subtract(im.multiply(z.im)), re.multiply(z.im).add(im.multiply(z.re)));

//DoubleDouble ac = re.multiply(z.re);
//DoubleDouble bd = im.multiply(z.im);
//return new DDComplex(ac.subtract(bd), re.add(im).multiply(z.re.add(z.im)).subtract(ac).subtract(bd));

}

/*
Expand Down Expand Up @@ -665,7 +669,7 @@ public final DDComplex acot() {
*/
public final DDComplex cos() {

DoubleDouble temp = im.negate().exp();;
DoubleDouble temp = im.negate().exp();

DoubleDouble cos_re = re.cos();
DoubleDouble sin_re = re.sin();
Expand Down Expand Up @@ -777,7 +781,7 @@ public final DDComplex asinh() {
*/
public final DDComplex tan() {

DoubleDouble temp = im.multiply(2).exp();;
DoubleDouble temp = im.multiply(2).exp();

DoubleDouble temp3 = re.multiply(2);

Expand Down Expand Up @@ -1194,6 +1198,7 @@ public final DDComplex divide(DoubleDouble number) {

}

@Override
public final DDComplex divide(int number) {

DoubleDouble num = new DoubleDouble(number);
Expand Down Expand Up @@ -1402,6 +1407,9 @@ public final DDComplex times(GenericComplex zn) {

DDComplex z = (DDComplex)zn;
return new DDComplex(re.multiply(z.re).subtract(im.multiply(z.im)), re.multiply(z.im).add(im.multiply(z.re)));
//DoubleDouble ac = re.multiply(z.re);
//DoubleDouble bd = im.multiply(z.im);
//return new DDComplex(ac.subtract(bd), re.add(im).multiply(z.re.add(z.im)).subtract(ac).subtract(bd));

}

Expand Down Expand Up @@ -1483,6 +1491,10 @@ public boolean isZero() {
return re.isZero() && im.isZero();
}

public boolean isOne() {
return re.isOne() && im.isZero();
}

@Override
public DDComplex toDDComplex() { return this; }

Expand Down
Loading

0 comments on commit 3e4a6b1

Please sign in to comment.