Logo by Jimpan1973 - 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: Visit the official fractalforums.com Youtube Channel
 
*
Welcome, Guest. Please login or register. April 25, 2024, 08:34:36 AM


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: Infinitized (Sierpinski) fold using bitwise operators  (Read 711 times)
0 Members and 1 Guest are viewing this topic.
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« on: January 27, 2015, 11:24:09 AM »

This type of fold is totally new.
The idea is to add a fractal level to Tglad's Mandelbox without heavy job for the CPU.
To do so we could exploit the floating point structure that is "sierpinski like" if you think about it. (Yes really I am that insane cheesy )

In fact fp numbers are structured like...
(Sign)(Exponent)(Mantissa)

If you can fold the mantissa preserving the exponent you can get a fractal fold  evil

It is definitely not as easy as it seems too bad.

But I was able to do it! Now suppose to define some constants. If you use doubles, they must have the same size. But you set directly their bits not their value!
SEXP contains the bits of Sign and Exp. all on. If you use double they are dwords in 32 bit machines. So SEXP = 0xFFF00000 00000000
SEXP_parity is its "parity bit"= 0x00100000 00000000
Nbits is the number of bits turned on in SEXP... but - 1. Count them tongue stuck out

Okay so... the code is this

Code:
x = x / foldl; // user defined
const SE1 = 1.0f and SEXP;
const mantissa = not SEXP;
// x is a coordinate you want to fold
if (x>2 or x<-2) {
   m = SE1 xor (x and signbit); // you can really find signbit DON'T YOU :D
   n = x; // Save the sign without splitting
} else {
   m = x and SEXP;
   n = x and mantissa;
   n = n xor SE1; // Split x in two parts
}
n = abs(n);
n = 0.5 - abs(x-1.5);
// but we must restore sign and exponent so...
x = m * n;
m = m and SEXP_parity; // or SEXP for that matters?
shl( m, Nbits ); // make it a sign shifting bits
x = x xor m; // now it has alternate signs DONE!
x = x * foldl;

Very hackish. And proud smiley enjoy!
« Last Edit: January 27, 2015, 12:51:53 PM by DarkBeam » Logged

No sweat, guardian of wisdom!
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #1 on: January 27, 2015, 11:40:24 AM »

so, where is the pretty picture huh?
Logged

---

divide and conquer - iterate and rule - chaos is No random!
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #2 on: January 27, 2015, 11:43:14 AM »

 tease

Too bad I haven't got it because MB is not a function plotter wink

I cannot even post a picture of the fractal because I am using my tablet now wink

Btw it's the fold used in Amazing Surf 2 (latest version)
Logged

No sweat, guardian of wisdom!
KRAFTWERK
Global Moderator
Fractal Senior
******
Posts: 1439


Virtual Surreality


WWW
« Reply #3 on: January 27, 2015, 12:22:58 PM »

so, where is the pretty picture huh?

I like the code!  afro
Logged

DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #4 on: January 28, 2015, 07:10:25 PM »

Here is a picture (hopefully pretty? Chris?  grin) - btw, here fold is different from the one illustrated above!

The fold center is moved to the borders before applying infinitization. The result is awe (I think)

Logged

No sweat, guardian of wisdom!
quaz0r
Fractal Molossus
**
Posts: 652



« Reply #5 on: January 29, 2015, 03:18:45 AM »

mmm its pretty  smiley
Logged
knighty
Fractal Iambus
***
Posts: 819


« Reply #6 on: February 05, 2015, 07:53:41 PM »

Looks good!
Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #7 on: February 06, 2015, 12:56:01 AM »

Thanks again fold genius smiley
Logged

No sweat, guardian of wisdom!
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Generalized Box Fold. Amazing Box, Amazing Surf and variations « 1 2 » fractower 25 8788 Last post September 23, 2011, 11:31:57 PM
by knighty
Spherical Texture Fold 3D Fractal Generation Aexion 7 4684 Last post July 15, 2011, 10:07:35 PM
by Jesse
The power of fold (new) Theories & Research knighty 8 1702 Last post September 12, 2011, 10:37:50 PM
by knighty
Kalis Inversion Circle Fold (new) Theories & Research thomas314 8 760 Last post April 24, 2012, 06:16:01 PM
by Alef
3-fold symmetry Still Frame Kalles Fraktaler 0 1258 Last post May 08, 2014, 05:02:44 PM
by Kalles Fraktaler

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.139 seconds with 24 queries. (Pretty URLs adds 0.008s, 2q)