Logo by Trifox - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Support us via Flattr FLATTR Link
 
*
Welcome, Guest. Please login or register. October 24, 2020, 10:29:11 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: New plugin started  (Read 1221 times)
0 Members and 1 Guest are viewing this topic.
simon.snake
Fractal Bachius
*
Posts: 640


Experienced Fractal eXtreme plugin crasher!


simon.fez SimonSideBurns
« on: May 12, 2013, 12:24:13 AM »

I'm in the process of writing a plugin for a formula I wrote about here which I have now got working up to 45 zooms (so I've still got the high precision bit to write). Will upload as soon as I get that bit done, unless I have a problem beforehand.

I've just had a play with it but I'm certain the julias are different to what I was getting in FractInt.

Here's an initial screenshot showing the new plugin:

« Last Edit: May 12, 2013, 12:31:13 AM by simon.snake » Logged

To anyone viewing my posts and finding missing/broken links to a website called www.needanother.co.uk, I still own the domain but recently cancelled my server (saving £30/month) so even though the domain address exists, it points nowhere.  I hope to one day sort something out but for now - sorry!
simon.snake
Fractal Bachius
*
Posts: 640


Experienced Fractal eXtreme plugin crasher!


simon.fez SimonSideBurns
« Reply #1 on: May 12, 2013, 06:01:07 PM »

I've had no issues creating the initial plugin but the fixed high precision maths section just comes up blank (either completely black - e.g. reached infinity or blue - e.g. bailed out).

Also the julias are different to how they appeared on FractInt.

Here's the code for each section, I don't know what's wrong. Anyone see anything I've overlooked?

Firstly, the low precision stuff:

Code:
FXEXPORT int CalcJuliaFloat(int EquationID, struct FloatParams *pParams)
{
double zr = pParams->cr;
double zi = pParams->ci;
double JuliaR = pParams->JuliaR;
double JuliaI = pParams->JuliaI;
int MaxIters = pParams->MaxIters;
double OverFlowPoint = pParams->OverFlowPoint;
double zrsqr = 0;
double zisqr = 0;
double zrabs, ziabs, tempzi, tempzr;

int count = 0;
switch (EquationID)
{
case FT_Simon100A:
for (/**/; count < MaxIters && zrsqr + zisqr < OverFlowPoint; count++)
{
zrabs = abs(zr);
ziabs = abs(zi);
tempzi = zi*zrabs+zr*ziabs;
tempzr = zr*zrabs-zi*ziabs;
zi=tempzi;
zr=tempzr;
zrsqr = zr * zr;
zisqr = zi * zi;
zi = zr * zi * 2.0 + JuliaI;
zr = zrsqr - zisqr + JuliaR;

zisqr = zi * zi;
zrsqr = zr * zr;
}
break;
}

pParams->cr = zr;
pParams->ci = zi;

if (count > MaxIters)
{
// It is not legal to return a count value that is greater than MaxIters.
__debugbreak();
count = MaxIters;
}
if (count < 0)
{
// It is not legal to return a count value that is negative.
__debugbreak();
count = 0;
}

return count;
}

Secondly, the high precision stuff:

Code:
// Initialize our numbers from the fixed-point data passed in.
HighPrecMath zr(pParams->cr + offset, precision);
HighPrecMath zi(pParams->ci + offset, precision);
HighPrecMath JuliaR(pParams->JuliaR + offset, precision);
HighPrecMath JuliaI(pParams->JuliaI + offset, precision);
int MaxIters = pParams->MaxIters;
HighPrecMath zrsqr = zr - zr;
HighPrecMath zisqr = zrsqr;
HighPrecMath zrabs = zr;
HighPrecMath ziabs = zi;
HighPrecMath tempzi = zi;
HighPrecMath tempzr = zr;
HighPrecMath zrziabs = zr;
HighPrecMath ziziabs = zi;

int count = 0;
switch (EquationID)
{
case FT_Simon100A:
for (/**/; count < MaxIters && !(zrsqr + zisqr).Overflow(); count++)
{
// Using *= and += instead of * and + avoids the creation of expensive
// temporaries and can be a very important optimization.
// Combining the fixed-point shifting of 'zi *= zr' with the shifting
// by one of zi (multiplication by two) can save some time.
zrabs = zr;
if(zrabs.IsNegative()) zrabs.negate();
ziabs = zi;
if(ziabs.IsNegative()) ziabs.negate();
tempzi = zi; tempzi *= zrabs;
zrziabs = zr; zrziabs *= ziabs;
tempzi += zrziabs;
tempzr = zr; tempzr *= zrabs;
ziziabs = zi; ziziabs *= ziabs;
tempzr -= ziziabs;
zi = tempzi;
zr = tempzr;

zrsqr = zr; zisqr *= zr;
zisqr = zi; zisqr *= zi;

zi *= zr;
zi <<= 1; zi += JuliaI; //zi = |zi * zr| * 2 - JuliaI;
zrsqr -= zisqr; zrsqr += JuliaR; zr = zrsqr; //zr = zrsqr - zisqr - JuliaR;
zisqr = zi; zisqr *= zi; // zisqr = zi * zi;
zrsqr *= zrsqr; // zrsqr = zr * zr;
}
break;
}

Hope it makes sense...
Logged

To anyone viewing my posts and finding missing/broken links to a website called www.needanother.co.uk, I still own the domain but recently cancelled my server (saving £30/month) so even though the domain address exists, it points nowhere.  I hope to one day sort something out but for now - sorry!
simon.snake
Fractal Bachius
*
Posts: 640


Experienced Fractal eXtreme plugin crasher!


simon.fez SimonSideBurns
« Reply #2 on: May 12, 2013, 07:58:18 PM »

I found it. I was trying to square zr but assigned it to zisqr!
Logged

To anyone viewing my posts and finding missing/broken links to a website called www.needanother.co.uk, I still own the domain but recently cancelled my server (saving £30/month) so even though the domain address exists, it points nowhere.  I hope to one day sort something out but for now - sorry!
simon.snake
Fractal Bachius
*
Posts: 640


Experienced Fractal eXtreme plugin crasher!


simon.fez SimonSideBurns
« Reply #3 on: May 12, 2013, 08:20:57 PM »

Here's a link to the 64-bit version of the plugin: Simon100A.dll

It's incredibly slow in high precision but looks good.

Let me know if there's any problems. I've only got the express edition of C++ but I've 'adapted it' to allow me to compile 64-bit stuff by installing the windows driver development kit, and even though I've had to add a few paths to the library and include directories, it does compile.

I'll compile a 32-bit version as soon as I get a chance, but my phone line (and therefore internet) has been down all day, and using mobile data is incredibly slow.  Should be back up and working tomorrow evening...
Logged

To anyone viewing my posts and finding missing/broken links to a website called www.needanother.co.uk, I still own the domain but recently cancelled my server (saving £30/month) so even though the domain address exists, it points nowhere.  I hope to one day sort something out but for now - sorry!
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #4 on: May 12, 2013, 08:35:27 PM »

well done, i wonder if there is a tutorial about how to create 64bit c# smiley
Logged

---

divide and conquer - iterate and rule - chaos is No random!
panzerboy
Fractal Lover
**
Posts: 242


« Reply #5 on: May 13, 2013, 04:07:28 AM »

Congratulations, you've joined an exclusive club of FX plugun writers.  cheesy

I'm currently trying to track down why there are extra artifacts in many plugins once you go into high-precision.
Ie turn off the guessing in advanced setting and see all the extra fine lines there are between the iterations bands.
My suspicion is that it has to do with the dodgy .overflow() method in high precision.
It just checks against the most significant word (the last) against a constant integer of 4.
If the value was 4.000 000 000 000 000 001 or less it wouldnt be detected as overflowing.
So far my attempts to fix this have just made the artifacts worse  sad

Your plugiun request for the formula with a fixed number of iterations using the distance travelled looks like it would extremely slow.
The only way I know how to calculate the distance is to do pythagous for the triangle formed by each successive iterations coordinates.
You add up the hypotenuses for all the iterations, you get the total distance travelled.
That means coding a square root finding algorithm (iterative) for every iteration.
Logged
simon.snake
Fractal Bachius
*
Posts: 640


Experienced Fractal eXtreme plugin crasher!


simon.fez SimonSideBurns
« Reply #6 on: May 18, 2013, 04:55:15 PM »

Unbelievably, I've only just been re-connected to the telephone network (and internet is back) so I'm now back, with more news.

As I've had no internet for a week, I've been converting some more formulae to plugins.  Once I wade through outstanding emails, check facebook, etc. I'll be able to write a new post (in this sub forum) with more ideas, and provide links to the new plugins...

Back soon...
Logged

To anyone viewing my posts and finding missing/broken links to a website called www.needanother.co.uk, I still own the domain but recently cancelled my server (saving £30/month) so even though the domain address exists, it points nowhere.  I hope to one day sort something out but for now - sorry!
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Get started with fractal images (a tutorial) Introduction to Fractals and Related Links heneganj 0 2041 Last post November 15, 2006, 11:19:58 PM
by heneganj
Just getting started... Images Showcase (Rate My Fractal) _db_ 2 957 Last post February 04, 2008, 04:52:37 AM
by _db_
A New Forum Has Started Chaoscope Nahee_Enterprises 1 1536 Last post April 03, 2009, 07:25:14 PM
by The_Fractalist
Just can't seem to get started Apophysis Programs Sarcophyton 7 2535 Last post March 18, 2014, 09:20:39 PM
by Sarcophyton
It started with Fractint Meet & Greet djbarney 1 467 Last post July 14, 2016, 11:39:17 PM
by Kalter Rauch

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.109 seconds with 30 queries. (Pretty URLs adds 0.007s, 2q)