4 replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/ edited Apr 13 '17 at 12:55 This functionality is undocumented, but evident when SpelunkingSpelunking: 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 = SystemDumpvalidDoublyInfiniteComplexRangeQ[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. 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 = SystemDumpvalidDoublyInfiniteComplexRangeQ[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. 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 = SystemDumpvalidDoublyInfiniteComplexRangeQ[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. 3 added 2 characters in body edited Jun 19 '15 at 15:22 LLlAMnYP 10k1919 silver badges5858 bronze badges 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 = SystemDumpvalidDoublyInfiniteComplexRangeQ[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"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. 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 = SystemDumpvalidDoublyInfiniteComplexRangeQ[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. 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 = SystemDumpvalidDoublyInfiniteComplexRangeQ[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. 2 added 785 characters in body edited Jun 19 '15 at 14:43 LLlAMnYP 10k1919 silver badges5858 bronze badges 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 = SystemDumpvalidDoublyInfiniteComplexRangeQ[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. 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. 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. 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 = SystemDumpvalidDoublyInfiniteComplexRangeQ[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`. 1 answered Jun 19 '15 at 14:37 LLlAMnYP 10k1919 silver badges5858 bronze badges