Q: How does Rescale[] handle infinities? Rescale appears to be a simple function.  It just does a simple linear $y = a x + b$ type rescaling of the values:
Rescale@Range[0, 10]
(* {0, 1/10, 1/5, 3/10, 2/5, 1/2, 3/5, 7/10, 4/5, 9/10, 1} *)

Or does it?  The documentation never says that it's linear.  What happens if the input has an infinite quantity?
Rescale[Prepend[Range[10], -Infinity]]
(* {0, 1/10, 1/9, 1/8, 1/7, 1/6, 1/5, 1/4, 1/3, 1/2, 1} *)

ListPlot[%]


That's a little strange.  The output numbers are no longer equispaced.
With both $-\infty$ and $\infty$ present, we get things like
Rescale[{-Infinity, 0, 1, 2, Infinity}]
(* {0, 1/2, 1/2 (-1 + Sqrt[5]), 1/Sqrt[2], 1} *)

I would have expected some error messages about indeterminate results instead.
What does Rescale do when infinities are present?  What's the justification for this behaviour?  Where is it documented?
We should note that Rescale[list] is really Rescale[list, {Min[list], Max[list]}], so it's in fact the infinities in the second argument that trigger this.  Such behaviour is acceptable if it's documented and if it's explicitly requested by putting infinities in the second argument.  But in my situation an infinite quantity slipped into the input only by accident, and I suddenly started getting unexpected strange results.

A: This functionality is undocumented, but evident when Spelunking:
Rescale[x, {DirectedInfinity[-1], DirectedInfinity[1]}]
(* (-2 + x + Sqrt[4 + x^2])/(2 x) *)

Rescale[x, {-Infinity, Infinity}] is equivalent to Rescale[x, {-Infinity, Infinity}, {0, 1}]. The relevant entry in the definition when spelunking:
Needs["Spelunk`"]
Spelunk[Rescale]

This returns a number of replacement rules for Rescale with infinities. The relevant rule for my example is:

Rescale[x_, {DirectedInfinity[d1_], 
    DirectedInfinity[d2_]}, {a : Except[_DirectedInfinity], 
    b : Except[_DirectedInfinity]}] /; ! 
   TrueQ[{d1, d2} == {-1, 1} || {d1, d2} == {1, -1}] := 
 Block[{valid, res}, 
         valid = System`Dump`validDoublyInfiniteComplexRangeQ[d1, d2];
    If[valid, 
   res = Rescale[x/(d2/Abs[d2]), {-\[Infinity], \[Infinity]}, {a, b}]];
    res /; valid]


As you can see, however, the rule applies if, and only if, the infinities are not "negative-to-positive" or "positive-to-negative". Failing that, the offset in their direction is accounted for as a complex multiplier added to x and the problem is reduced to rescaling a negative-to-positive infinity.
It seems, that Rescale reduces every problem with infinities to a problem such as Rescale[x, {-Infinity, Infinity}, {0, 1}] or similar. There is not an explicit rule, however, listed for this problem. It seems, that somewhere deeper down, there is a built-in rule that does not show up with Spelunk that says "once we have reduced our problem to Rescale[x, {-Infinity, Infinity}, {0, 1}], return (-2 + x + Sqrt[4 + x^2])/(2 x). This is made evident by
Trace[Rescale[x, {-\[Infinity], \[Infinity]}]]


... Rescale[x, {-\[Infinity], \[Infinity]}], (-2 + x + Sqrt[4 + x^2])/(2 x)


So in a few words, almost all of the functionality with infinities is "documented" (in a hidden way, accessible only through spelunking), except the final transformations from the basic cases such as the one I described to the functions of x, which does not even show up in the output of Spelunk.

A: The answers of the original questions by Szabolcs: 

What does Rescale do when infinities are present? What's the justification for this behaviour? Where is it documented?

were guessed correctly with the comment:

If I may be allowed to speculate, these were picked because they do the job advertised and are "conveniently" algebraic. They certainly work splendidly when used as variable substitutions for integrals with infinite limits. – J. M.

I programmed Rescale in the Mathematica kernel both in C and in top level. Originally, the request for Rescale was derived from image manipulation cases in FrontEnd. It is obviously useful otherwise. I wanted the Rescale functionality for top level implementation of integration algorithms in the NIntegrate framework. See the numerous uses of Rescale in the advanced NIntegrate documentation. For example, in NIntegrate Integration Strategies.
Generally speaking, within NIntegrate's framework I wanted to use Rescale for converting infinite regions and for handling singularities.
After some discussions the Rescale transformations of ranges with Infinity were left implemented but undocumented. The main reasons being that (1) there is a good adherence with Rescale for finite intervals, and (2) there are too many such mathematical transformations and the selection of the particular one implemented in Rescale is hard to explain.
(Sorry for my delayed reply. I found this question by accident today.)

Edit
Here is some code that shows Rescale formulas for different combinations of ranges:
 r1pairs = {{a, b}, {-∞, b}, {a, ∞}, {a, -∞}, {-∞, ∞}};
r2pairs = {{c, d}, {-∞, d}, {c, ∞}, {c, -∞}, {-∞, ∞}};
tbl = Table[Simplify @ Rescale[x, r1, r2], {r1, r1pairs}, {r2, r2pairs}];
Grid[Prepend[MapThread[Prepend, {tbl, r1pairs}], 
  Prepend[r2pairs, ""]], Alignment -> Left, Dividers -> All, 
 Background -> {{GrayLevel[0.95], White}, {GrayLevel[0.95], White}}]

The result should be something like this:

(The ranges that are the second Rescale argument are given in the first column; the ranges that are the third Rescale argument are given on the first row.)
