-1

__float128 is way too slow

I am not experienced in GMP or MPFR what so ever.

Is there anything I could do?

this is a very cut down version of my code.

The cut down code is missing many elements:

Code

I'm new to stack overflow

#include <SFML/Graphics.hpp>

typedef long double num;

void drawFract(const unsigned int threadNum)
{
    for(unsigned int iy = 0; iy < threadHeight; iy++)
    {
        num px = xStart;
        for(unsigned int ix = 0; ix < w; ix++)
        {
            pixels[counter + 0] = 0; pixels[counter + 1] = 0;
            pixels[counter + 2] = 0; pixels[counter + 3] = 255;

            num zr = px, zi = py;
            for(unsigned int i = 0; i < iter; i++)
            {
                const num   sqzr = zr * zr,
                            sqzi = zi * zi,
                            add = zr + zi;

                zi = py + add*add - sqzr - sqzi;
                zr = sqzr - sqzi + px;

                if(sqzr + sqzi > bail)
                {
                    i %= colors;
                    pixels[counter + 0] = r[i];
                    pixels[counter + 1] = g[i];
                    pixels[counter + 2] = b[i];
                    break;
                }
            }
            px += xIter;
            counter += 4;
        }
        py += yIter;
    }

    return;
}

int main()
{
    app.setFramerateLimit(64);

    sf::Thread  bot0(drawFract,0), bot1(drawFract,1),
                bot2(drawFract,2), bot3(drawFract,3),
                bot4(drawFract,4), bot5(drawFract,5),
                bot6(drawFract,6), bot7(drawFract,7);

    /* My position manager system */
}

Sorry for bad post, I really need help, not for a job, just for fun.

Spl1ce
  • 9
  • 1

1 Answers1

0

MPFR is quite standard for arbitrary precision floating point. However, if you're serious about performance, you should really consider rendering optimizations instead.

qwr
  • 9,525
  • 5
  • 58
  • 102