22 int min(
int a,
int b) {
return a < b ? a : b; }
31 int max(
int a,
int b) {
return a > b ? a : b; }
41 while (0 < n && n < z) {
54 int pxbits(
const mpfr_t radius,
double height) {
57 mpfr_log2(r, radius, MPFR_RNDN);
58 int bits = 2 + ceil(log2(height)) - floor(mpfr_get_d(r, MPFR_RNDN));
76 void pixel_coordinate(mpfr_t x, mpfr_t y,
int width,
int height,
const mpfr_t centerx,
const mpfr_t centery,
const mpfr_t radius,
double i,
double j) {
77 mpfr_set_prec(x, mpfr_get_prec(centerx) + 8);
78 mpfr_set_prec(y, mpfr_get_prec(centery) + 8);
79 mpfr_mul_d(x, radius, 2.0 * (i - width / 2.0) / height, MPFR_RNDN);
80 mpfr_add(x, x, centerx, MPFR_RNDN);
81 mpfr_mul_d(y, radius, 2.0 * (height / 2.0 - j) / height, MPFR_RNDN);
82 mpfr_add(y, y, centery, MPFR_RNDN);