I'm just writing this here as an "idea for future improvement", but it seems to me that the `case 0:` is only ever useful for the first iteration. Splitting this up in a "head + recursive" function *might* give speed improvments. We'd have to bench of course. Something like:

```D
auto sum(R)(R r)
if (hasSlicing!R && hasLength!R && isFloatingPoint!(ElementType!R))
{
    switch (r.length)
    {
    case 0: return 0.0;
    case 1: return r.front;
    case 2: return r.front + r[1];
    default: return sumImpl(r[0 .. $ / 2]) + sumImpl(r[$ / 2 .. $]);
    }
}

auto sumImpl(R)(R r)
{
    switch (r.length)
    {
    //case 0: return 0.0;
    case 1: return r.front;
    case 2: return r.front + r[1];
    default: return sumImpl(r[0 .. $ / 2]) + sumImpl(r[$ / 2 .. $]);
    }
}
```
or maybe even taking it one step further?
```D
auto sum(R)(R r)
if (hasSlicing!R && hasLength!R && isFloatingPoint!(ElementType!R))
{
    switch (r.length)
    {
    case 0: return 0.0;
    case 1: return r.front;
    case 2: return r.front + r[1];
    case 3: return r.front + r[1] + r[2];
    default: return sumImpl(r[0 .. $ / 2]) + sumImpl(r[$ / 2 .. $]);
    }
}

auto sumImpl(R)(R r)
{
    switch (r.length)
    {
    //case 0: return 0.0;
    //case 1: return r.front;
    case 2: return r.front + r[1];
    case 3: return r.front + r[1] + r[2];
    default: return sumImpl(r[0 .. $ / 2]) + sumImpl(r[$ / 2 .. $]);
    }
}
```