anchor.diff:    float screenZoom = 4.0 / wallDimension.x;
     vec2 pixelScreenSpace = ss - wallDimension / 2.0 + screenOffset;
     vec2 mandelbrotSpace = pixelScreenSpace * screenZoom;
  -  float64 zoom = float64(zoom_dp.x, zoom_dp.y);
  -  complex64 center = complex64(float64(zoom_center.x, zoom_center.y),
  -                               float64(zoom_center.z, zoom_center.w));
  -  complex64 zoomedSpace =
  -      complexAdd(complexScale(makeComplex64(mandelbrotSpace), zoom), center);
  -
  -  vec3 chosenColor = color(zoomedSpace);
  +
  +  vec3 chosenColor;
  +
  +// Set to 1 to enable floats in initial zoom levels.
  +#define USE_FLOATS_FOR_LOW_ZOOM_LEVELS 1
  +
  +#if USE_FLOATS_FOR_LOW_ZOOM_LEVELS
  +  // Floats look good until roughly this zoom level.
  +  // Afterwards they start looking blocky.
  +  if (zoom_dp.x > 1.0e-5) {
  +#else
  +  if (false) {
  +#endif
  +    // `zoom_dp` is a fake double represented by vec2.
  +    // The zoom value we want fits in the float, which is the high part or `.x`.
  +    float zoom = zoom_dp.x;
  +
  +    // `zoom_center` is a vector of two fake doubles.
  +    // Here we take the high parts from both.
  +    vec2 zoomedSpace = mandelbrotSpace * zoom + zoom_center.xz;
  +
  +    chosenColor = colorFloat(zoomedSpace);
  +  } else {
  +    float64 zoom = float64(zoom_dp.x, zoom_dp.y);
  +    complex64 center = complex64(float64(zoom_center.x, zoom_center.y),
  +                                float64(zoom_center.z, zoom_center.w));
  +    complex64 zoomedSpace =
  +        complexAdd(complexScale(makeComplex64(mandelbrotSpace), zoom), center);
  +
  +    chosenColor = colorF64(zoomedSpace);
  +  }
  +
     gl_FragColor = vec4(chosenColor, 1.0);
  -}+}
  
positive.code: 
  // The screen-space interpolated position of this pixel.
  varying vec2 ss;
  
  struct float64 {
    float high;
    float low;
  };
  
  // We need some routines that act like normal operations, but won't get
  // optimized out by certain aggressive compilers (*cough* nvidia *cough*).
  float times_frc(float a, float b) {
    return mix(.0, a * b, b != 0.0 ? 1.0 : 0.0);
  }
  float add_frc(float a, float b) { return mix(a, a + b, b != 0.0 ? 1.0 : 0.0); }
  float sub_frc(float a, float b) { return mix(a, a - b, b != 0.0 ? 1.0 : 0.0); }
  
  float64 add(float64 a, float64 b) {
    float64 ret;
    float t1, t2, e;
  
    t1 = add_frc(a.high, b.high);
    e = sub_frc(t1, a.high);
    t2 = add_frc(
        add_frc(add_frc(sub_frc(b.high, e), sub_frc(a.high, sub_frc(t1, e))),
                a.low),
        b.low);
    ret.high = add_frc(t1, t2);
    ret.low = sub_frc(t2, sub_frc(ret.high, t1));
    return ret;
  }
  
  float64 sub(float64 a, float64 b) {
    float64 ret;
    float t1, t2, e;
  
    t1 = sub_frc(a.high, b.high);
    e = sub_frc(t1, a.high);
    t2 = sub_frc(add_frc(add_frc(sub_frc(sub_frc(0.0, b.high), e),
                                 sub_frc(a.high, sub_frc(t1, e))),
                         a.low),
                 b.low);
    ret.high = add_frc(t1, t2);
    ret.low = sub_frc(t2, sub_frc(ret.high, t1));
    return ret;
  }
  
  float cmp(float64 a, float64 b) {
    if (a.high < b.high) {
      return -1.;
    }
    if (b.high < a.high) {
      return 1.;
    }
    if (a.low < b.low) {
      return -1.;
    }
    if (b.low < a.low) {
      return 1.;
    }
    return 0.;
  }
  
  float64 mul(float64 a, float64 b) {
    float64 ret;
    float c11, c21, c2, e, t1, t2;
    float a1, a2, b1, b2, cona, conb, split = 8193.;
  
    cona = times_frc(a.high, split);
    conb = times_frc(b.high, split);
    a1 = sub_frc(cona, sub_frc(cona, a.high));
    b1 = sub_frc(conb, sub_frc(conb, b.high));
    a2 = sub_frc(a.high, a1);
    b2 = sub_frc(b.high, b1);
  
    c11 = times_frc(a.high, b.high);
    c21 = add_frc(
        times_frc(a2, b2),
        add_frc(times_frc(a2, b1),
                add_frc(times_frc(a1, b2), sub_frc(times_frc(a1, b1), c11))));
  
    c2 = add_frc(times_frc(a.high, b.low), times_frc(a.low, b.high));
  
    t1 = add_frc(c11, c2);
    e = sub_frc(t1, c11);
    t2 = add_frc(add_frc(times_frc(a.low, b.low),
                         add_frc(sub_frc(c2, e), sub_frc(c11, sub_frc(t1, e)))),
                 c21);
  
    ret.high = add_frc(t1, t2);
    ret.low = sub_frc(t2, sub_frc(ret.high, t1));
  
    return ret;
  }
  
  float64 makeFloat64(float a) { return float64(a, 0.0); }
  
  struct complex64 {
    float64 real;
  
negative.code:   return complex64(makeFloat64(p.x), makeFloat64(p.y));
  }
  
  bool eqEps(float64 a, float64 b) {
    const float eps = 0.00001;
    return abs(a.high - b.high) < eps && abs(a.low - b.low) < eps;
  }
  
  // Determine the color of the point at z.
  // 64-bit version.
  vec3 colorF64(const complex64 z) {
    float64 x = z.real;
    float64 y = z.imag;
  
    float64 x2 = square(x);
    float64 y2 = square(y);
  
    int period = 0;
    float64 xold = x;
    float64 yold = y;
  
    int iters = 0;
    for (; iters <= 250; iters++) {
      if (x2.high + y2.high > 4.0) {
        float smoothIndex = float(iters) + 1.0 - log2(log(x2.high + y2.high));
        float colorLocation = mod((smoothIndex * 4.0 + colorBias), 384.0);
  
        return texture2D(palette, vec2(colorLocation / 384.0, 0.0)).rgb;
      }
  
      y = add(mul(unpreciseTimes2(x), y), z.imag);
      x = add(sub(x2, y2), z.real);
  
      // If we have already encountered this point, the function will not diverge,
      // so we're inside the set and can bail early.
      if (eqEps(x, xold) && eqEps(y, yold)) {
        break;
      }
  
      period++;
      // Save x and y every 20 iterations for periodity checking.
      if (period > 20) {
        period = 0;
        xold = x;
        yold = y;
      }
  
      x2 = square(x);
      y2 = square(y);
    }
    return vec3(0.0);
  }
  
  // Multiplication if two complex numbers x+y*i represented by vec2.
  vec2 v2ComplexMult(vec2 a, vec2 b) {
    return vec2(a.x*b.x - a.y*b.y, a.x*b.y+a.y*b.x);
  }
  
  // Determine the color of the point at z.
  // float version.
  vec3 colorFloat(vec2 z) {
    vec2 c = z;
    int iters = 0;
  
    for (; iters <= 250; iters++) {
      float modulus2 = z.x*z.x+z.y*z.y;
      if (modulus2 > 1.0e3) {
        // look up color
        float smoothIndex = float(iters) + 1.0 - log2(log(modulus2));
        float colorLocation = mod((smoothIndex * 4.0 + colorBias), 384.0);
  
        return texture2D(palette, vec2(colorLocation / 384.0, 0.0)).rgb;
      }
  
      z = v2ComplexMult(z, z) + c;
    }
    return vec3(0.0);
  }
  