File:Mandelbrot Set Image 112.png
Captions
Captions
Summary
[edit]| DescriptionMandelbrot Set Image 112.png |
Русский: Фрагмент множества Мандельброта, координаты центра:
-1.9999954356120112462319834543395114350278567924572684474582138880040267849941 1681518036306219179273434395557574279985918047221291197081186140687781560831995, -0.0000000000000000000000002619815217381104778369406006060701391387314425098538 3083459221663448338433592617272786772587281530484110756597337683912309313885172 ширина изображения 0.76e-119English: Fragment of the Mandelbrot set, coordinates:
-1.9999954356120112462319834543395114350278567924572684474582138880040267849941 1681518036306219179273434395557574279985918047221291197081186140687781560831995, -0.0000000000000000000000002619815217381104778369406006060701391387314425098538 3083459221663448338433592617272786772587281530484110756597337683912309313885172 width 0.76e-119Беларуская: Фрагмент мноства Мандэльброта, каардынаты цэнтра:
-1.9999954356120112462319834543395114350278567924572684474582138880040267849941 1681518036306219179273434395557574279985918047221291197081186140687781560831995, -0.0000000000000000000000002619815217381104778369406006060701391387314425098538 3083459221663448338433592617272786772587281530484110756597337683912309313885172 шырыня 0.76e-119 |
| Date | |
| Source | Own work |
| Author | Aokoroko |
| Other versions |
|
| Source code (C++) InfoField |
#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include <cstdint>
#include <string>
#include <atomic>
#include <omp.h>
#include <cstdio>
#include <iomanip>
#include <gmp.h>
#include <mpfr.h>
using namespace std;
const double PI = 3.14159265358979323846;
const mpfr_prec_t MPFR_BITS = 5000;
#pragma pack(push, 1)
struct BMPHeader {
uint16_t type{0x4D42};
uint32_t size{0};
uint16_t reserved1{0};
uint16_t reserved2{0};
uint32_t offBits{54};
uint32_t structSize{40};
int32_t width{0};
int32_t height{0};
uint16_t planes{1};
uint16_t bitCount{24};
uint32_t compression{0};
uint32_t sizeImage{0};
int32_t xpelsPerMeter{2834};
int32_t ypelsPerMeter{2834};
uint32_t clrUsed{0};
uint32_t clrImportant{0};
};
#pragma pack(pop)
struct ComplexDouble {
double re;
double im;
};
int main() {
string absc_str, ordi_str, size_str;
absc_str = "-1.9999954356120112462319834543395114350278567924572684474582138880040267"
"8499411681518036306219179273434395557574279985918047221291197081186140687781560831995";
ordi_str = "-0.0000000000000000000000002619815217381104778369406006060701391387314425"
"0985383083459221663448338433592617272786772587281530484110756597337683912309313885172";
size_str = "0.76e-119";
const int targetW = 8000;
const int targetH = 12600;
const int scale = 8;
const int rawW = targetW * scale;
const int rawH = targetH * scale;
const int frame = 200;
cout << "Step 1: Calculating Reference Orbit using Perturbation..." << endl;
mpfr_t rx, ry, zr, zi, zr2, zi2, tmp, sz, st;
mpfr_inits2(MPFR_BITS, rx, ry, zr, zi, zr2, zi2, tmp, sz, st, NULL);
mpfr_set_str(rx, absc_str.c_str(), 10, MPFR_RNDN);
mpfr_set_str(ry, ordi_str.c_str(), 10, MPFR_RNDN);
mpfr_set_str(sz, size_str.c_str(), 10, MPFR_RNDN);
mpfr_div_ui(st, sz, rawW, MPFR_RNDN);
double step_d = mpfr_get_d(st, MPFR_RNDN);
double ref_rec_d = mpfr_get_d(rx, MPFR_RNDN);
double ref_imc_d = mpfr_get_d(ry, MPFR_RNDN);
vector<ComplexDouble> ref_orbit_double(50005);
mpfr_set_ui(zr, 0, MPFR_RNDN);
mpfr_set_ui(zi, 0, MPFR_RNDN);
mpfr_set_ui(zr2, 0, MPFR_RNDN);
mpfr_set_ui(zi2, 0, MPFR_RNDN);
uint32_t ref_i = 0;
bool escaped = false;
while (ref_i < 50000) {
ref_orbit_double[ref_i].re = mpfr_get_d(zr, MPFR_RNDN);
ref_orbit_double[ref_i].im = mpfr_get_d(zi, MPFR_RNDN);
mpfr_mul(tmp, zr, zi, MPFR_RNDN);
mpfr_mul_ui(zi, tmp, 2, MPFR_RNDN);
mpfr_add(zi, zi, ry, MPFR_RNDN);
mpfr_sub(zr, zr2, zi2, MPFR_RNDN);
mpfr_add(zr, zr, rx, MPFR_RNDN);
mpfr_mul(zr2, zr, zr, MPFR_RNDN);
mpfr_mul(zi2, zi, zi, MPFR_RNDN);
if (escaped) {
ref_i++;
break;
}
mpfr_add(tmp, zr2, zi2, MPFR_RNDN);
if (mpfr_cmp_d(tmp, 40000.0) >= 0) {
escaped = true;
}
ref_i++;
}
ref_orbit_double[ref_i].re = mpfr_get_d(zr, MPFR_RNDN);
ref_orbit_double[ref_i].im = mpfr_get_d(zi, MPFR_RNDN);
uint32_t max_valid_ref_iter = ref_i;
mpfr_clears(rx, ry, zr, zi, zr2, zi2, tmp, sz, st, NULL);
uint8_t pal[256][3];
for (int a = 0; a < 255; ++a) {
pal[a][0] = (uint8_t)round(127.0 + 127.0 * cos(2.0 * PI * a / 255.0));
pal[a][1] = (uint8_t)round(127.0 + 127.0 * sin(2.0 * PI * a / 255.0));
pal[a][2] = (uint8_t)round(127.0 + 127.0 * sin(2.0 * PI * a / 255.0));
}
pal[255][0] = 255; pal[255][1] = 255; pal[255][2] = 255;
cout << "Step 2: Stream rendering Mandelbrot Set Image 112.bmp (" << targetW << "x" << targetH << ")..." << endl;
int rowSize = (targetW * 3 + 3) & ~3;
BMPHeader header;
header.width = targetW;
header.height = targetH;
header.sizeImage = rowSize * targetH;
header.size = header.sizeImage + 54;
ofstream f("Mandelbrot Set Image 112.bmp", ios::binary);
f.write(reinterpret_cast<char*>(&header), 54);
vector<uint8_t> rowBuffer(rowSize);
for (int y = 0; y < targetH; ++y) {
#pragma omp parallel for schedule(dynamic)
for (int x = 0; x < targetW; ++x) {
uint32_t rSum = 0, gSum = 0, bSum = 0;
const ComplexDouble* ref_ptr = ref_orbit_double.data();
for (int j = 0; j < scale; ++j) {
size_t b = (size_t)y * scale + j;
double delta_imc = (double)((long long)b - (rawH / 2)) * step_d;
for (int i = 0; i < scale; ++i) {
size_t a = (size_t)x * scale + i;
double delta_rec = (double)((long long)a - (rawW / 2)) * step_d;
uint32_t index = 0;
double delta_re = 0.0;
double delta_im = 0.0;
double z_re = 0.0;
double z_im = 0.0;
uint32_t iter = 0;
bool has_re_based = false;
while (iter < 50000) {
if ((z_re * z_re + z_im * z_im) >= 40000.0) {
break;
}
if (index >= max_valid_ref_iter) {
if (!has_re_based) {
break;
} else {
double ld_cx = ref_rec_d + delta_rec;
double ld_cy = ref_imc_d + delta_imc;
while (iter < 50000 && (z_re * z_re + z_im * z_im) < 40000.0) {
double old_re = z_re;
double old_im = z_im;
z_re = old_re * old_re - old_im * old_im + ld_cx;
z_im = 2.0 * old_re * old_im + ld_cy;
iter++;
}
break;
}
}
if ((z_re * z_re + z_im * z_im) < (delta_re * delta_re + delta_im * delta_im)) {
index = 0;
delta_re = z_re;
delta_im = z_im;
has_re_based = true;
}
for (int k = 0; k < 2; ++k) {
double Ur = ref_ptr[index].re;
double Ui = ref_ptr[index].im;
double next_delta_im = 2.0 * Ur * delta_im + 2.0 * Ui * delta_re + 2.0 * delta_re * delta_im + delta_imc;
delta_re = 2.0 * Ur * delta_re - 2.0 * Ui * delta_im + delta_re * delta_re - delta_im * delta_im + delta_rec;
delta_im = next_delta_im;
index++;
}
z_re = ref_ptr[index].re + delta_re;
z_im = ref_ptr[index].im + delta_im;
iter += 2;
}
int final_t = 50000 - iter;
uint8_t t = (final_t == 0) ? 255 : (uint8_t)(final_t % 254);
int colorIdx = (t == 255) ? 255 : (t - frame + 255) % 255;
bSum += pal[colorIdx][0];
gSum += pal[colorIdx][1];
rSum += pal[colorIdx][2];
}
}
int outIdx = x * 3;
rowBuffer[outIdx + 0] = (uint8_t)(bSum >> 6);
rowBuffer[outIdx + 1] = (uint8_t)(gSum >> 6);
rowBuffer[outIdx + 2] = (uint8_t)(rSum >> 6);
}
f.write(reinterpret_cast<const char*>(rowBuffer.data()), rowSize);
if ((y + 1) % 10 == 0 || y == targetH - 1) {
cout << "Progress: " << (y + 1) << "/" << targetH << "\r" << flush;
}
}
f.close();
cout << "\nDone! Mandelbrot Set Image 112.bmp successfully saved." << endl;
return 0;
}
|
Technical details
[edit]- High-Precision Reference: The 5000-bit reference trajectory is computed exactly once per zoom layer.
- Hardware-Native Performance: Blazing-fast math for billions of pixels utilizing hardware-native double registers.
- When using double-precision floating-point numbers (on the order of 10-15, perturbation theory only allows you to zoom down to the 10-308 level-no further.
- Innovative Algorithm: Revolutionary Reference Reset to Zero implementation.
- True 8x8 SSAA: Pristine, anti-aliased image quality with 64 independent samples per pixel. 80000 x 80000 pixels downscaled to 10000 x 10000.
- OpenMP Multi-threading: High-speed parallel computing to maximize CPU utilization.
- Software: C++ (compiled with g++), GNU C++ Compiler.
Related images
[edit]-
Previous step
-
Next step
Notes
[edit]- Rosetta Code: https://rosettacode.org/wiki/Mandelbrot_set#Perturbation_Theory
- github: https://github.com/Divetoxx/Mandelbrot
Licensing
[edit]| This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication. | |
| The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
http://creativecommons.org/publicdomain/zero/1.0/deed.enCC0Creative Commons Zero, Public Domain Dedicationfalsefalse |
This image has been assessed using the Quality image guidelines and is considered a Quality image.
العربية ∙ جازايرية ∙ беларуская ∙ беларуская (тарашкевіца) ∙ български ∙ বাংলা ∙ català ∙ čeština ∙ Cymraeg ∙ Deutsch ∙ Schweizer Hochdeutsch ∙ Zazaki ∙ Ελληνικά ∙ English ∙ Esperanto ∙ español ∙ eesti ∙ euskara ∙ فارسی ∙ suomi ∙ français ∙ galego ∙ עברית ∙ हिन्दी ∙ hrvatski ∙ magyar ∙ հայերեն ∙ Bahasa Indonesia ∙ italiano ∙ 日本語 ∙ Jawa ∙ ქართული ∙ Qaraqalpaqsha ∙ 한국어 ∙ kurdî ∙ кыргызча ∙ Latina ∙ Lëtzebuergesch ∙ lietuvių ∙ македонски ∙ മലയാളം ∙ मराठी ∙ Bahasa Melayu ∙ Nederlands ∙ ਪੰਜਾਬੀ ∙ Norfuk / Pitkern ∙ polski ∙ português ∙ português do Brasil ∙ rumantsch ∙ română ∙ русский ∙ sicilianu ∙ slovenčina ∙ slovenščina ∙ shqip ∙ српски / srpski ∙ svenska ∙ தமிழ் ∙ తెలుగు ∙ ไทย ∙ Tagalog ∙ toki pona ∙ Türkçe ∙ українська ∙ oʻzbekcha / ўзбекча ∙ vèneto ∙ Tiếng Việt ∙ 中文 ∙ 中文(简体) ∙ 中文(繁體) ∙ +/− |
File history
Click on a date/time to view the file as it appeared at that time.
| Date/Time | Thumbnail | Dimensions | User | Comment | |
|---|---|---|---|---|---|
| current | 17:28, 19 July 2026 | 8,000 × 12,600 (43.65 MB) | Aokoroko (talk | contribs) | The file is big! | |
| 19:06, 16 July 2026 | 10,000 × 10,000 (35.45 MB) | Aokoroko (talk | contribs) | Metadata! | ||
| 19:01, 16 July 2026 | 10,000 × 10,000 (35.45 MB) | Aokoroko (talk | contribs) | The file is big! | ||
| 12:23, 15 July 2026 | 2,160 × 2,160 (3.18 MB) | Aokoroko (talk | contribs) | Uploaded own work with UploadWizard |
You cannot overwrite this file.
File usage on Commons
The following 92 pages use this file:
- Fractal
- Mandelbrot set
- User:Aokoroko
- User talk:Aokoroko
- Commons:Candidatas a imagens especiais
- Commons:Candidatas a imaxes destacadas
- Commons:Candidatas a imágenes destacadas
- Commons:Candidate pentru imagini excelente
- Commons:Candidates a imáxenes destacaes
- Commons:Ehdokkaat suositelluiksi kuviksi
- Commons:Featured picture candidates
- Commons:Featured picture candidates/File:Mandelbrot Set Image 112.png
- Commons:Featured picture candidates/candidate list
- Commons:Javaslatok kiemelt képekre
- Commons:Kandidate fir exzellent Biller
- Commons:Kandidate für exzellänti Bilder
- Commons:Kandidaten für exzellente Bilder
- Commons:Kandidater til fremragende billeder
- Commons:Kandidater til utmerkede bilder
- Commons:Kandidater till utvalda bilder
- Commons:Kandidatët për fotografi të shkëlqyeshme
- Commons:Kandydatury do grafik na medal
- Commons:Návrhy na nejlepší obrázky
- Commons:Propositions d'images remarquables
- Commons:Quality images
- Commons:Quality images/Subject/Non photographic media
- Commons:Quality images/Subject/Non photographic media/Sample
- Commons:Quality images/ar
- Commons:Quality images/arz
- Commons:Quality images/bn
- Commons:Quality images/br
- Commons:Quality images/ca
- Commons:Quality images/cs
- Commons:Quality images/cy
- Commons:Quality images/da
- Commons:Quality images/de
- Commons:Quality images/el
- Commons:Quality images/en
- Commons:Quality images/en-ca
- Commons:Quality images/en-gb
- Commons:Quality images/es
- Commons:Quality images/eu
- Commons:Quality images/fa
- Commons:Quality images/fr
- Commons:Quality images/gl
- Commons:Quality images/gsw
- Commons:Quality images/hi
- Commons:Quality images/hr
- Commons:Quality images/id
- Commons:Quality images/it
- Commons:Quality images/ja
- Commons:Quality images/ko
- Commons:Quality images/krc
- Commons:Quality images/lt
- Commons:Quality images/mk
- Commons:Quality images/ml
- Commons:Quality images/ms
- Commons:Quality images/mwl
- Commons:Quality images/nan
- Commons:Quality images/nan-latn-tailo
- Commons:Quality images/ne
- Commons:Quality images/nl
- Commons:Quality images/oc
- Commons:Quality images/pl
- Commons:Quality images/ps
- Commons:Quality images/pt
- Commons:Quality images/ru
- Commons:Quality images/scn
- Commons:Quality images/sv
- Commons:Quality images/th
- Commons:Quality images/tr
- Commons:Quality images/uk
- Commons:Quality images/uz
- Commons:Quality images/vi
- Commons:Quality images/zh
- Commons:Quality images candidates/Archives July 18 2026
- Commons:Segnalazioni per la vetrina
- Commons:Signalazzioni pâ vitrina
- Commons:Đề cử hình ảnh chọn lọc
- Commons:Кандидате пентру имаджини ексчеленте
- Commons:Кандидати за изабране слике
- Commons:Кандидати у вибрані зображення
- Commons:Кандидаты в избранные изображения
- Commons:Ընտրյալ պատկերների թեկնածուներ
- Commons:گزیدن نگاره برگزیده
- Commons:निर्वाचित चित्र उम्मीदवार
- Commons:特色图片评选
- Commons:特色圖片候選
- Commons:特色靚相候選
- Commons:秀逸な画像の推薦
- File:Mandelbrot Set Image 111.png
- File:Mandelbrot Set Image 113.png
File usage on other wikis
The following other wikis use this file:
- Usage on en.wikipedia.org
- Usage on en.wikibooks.org
- Usage on meta.wikimedia.org
- Usage on ru.wikipedia.org
- Usage on www.wikidata.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
| Author |
|
|---|---|
| Copyright holder |
|
| PNG file comment |
|
| Image title |
|
| Short title |
|
| Width | 8,000 px |
| Height | 12,600 px |
| Software used |
|
| Y and C positioning | Centered |
| Horizontal resolution | 28.35 dpc |
| Vertical resolution | 28.35 dpc |