What's purpose of the InternalToEquivalenceClass [closed]

There is a kernel function InternalToEquivalenceClass.I don't know how to use it.There are some right example right to run

InternalToEquivalenceClass[{1, 2, 3}]

(* {1, 2, 3} *)

InternalToEquivalenceClass[9]
(* 9 *)

InternalToEquivalenceClass[{1, 2., 3}, 9]
(* {1, 2., 3} *)


But the InternalToEquivalenceClass[{1, 2., 3}, {5, 6}] will give a error information

And we can find a option of it.

InternalToEquivalenceClass // Options


{Heads -> True}

closed as off-topic by Daniel Lichtblau, MarcoB, LCarvalho, Jason B., ÖskåJul 10 '17 at 19:39

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "The question is out of scope for this site. The answer to this question requires either advice from Wolfram support or the services of a professional consultant." – Daniel Lichtblau, MarcoB, LCarvalho, Jason B., Öskå
If this question can be reworded to fit the rules in the help center, please edit the question.

• Umm...it is in Internal context. – Daniel Lichtblau Jul 9 '17 at 14:39
• You demonstrate that you are clueless about what the function does, so why do you want to use it? And if you don't want to use it, but are just curious about it, why should we spend our time trying to find out for you? As Daniel Lichtblau points out, it is the Internal context; not meant for users. – m_goldberg Jul 9 '17 at 15:20
• @m_goldberg,Daniel Lichtblau I have opened a discuss in Meta.SE here.If most people think I should not take such topic.I will delete it and stop to talk these undocumented question. – yode Jul 9 '17 at 15:54
• @m_goldberg This question is like one my earlier questions about an undocumented function, driven purely out of curiosity. My opinion is that this is a perfectly fine question, should not be closed, and that others can benefit from it in the future. – QuantumDot Jul 9 '17 at 17:40
• @QuantumDot. That's a perfectly valid opinion, but mine happens to be different. – m_goldberg Jul 9 '17 at 17:53

InternalToEquivalenceClass[expr, tol] is used to replace floating point numbers in an expression with their equivalence class representatives according to the specified tolerance.

For an example, using machine precision, consider

nums = {0.33000000000000004, 0.33000000000000007, 0.33000000000000010};


The first two numbers are equivalent under the default tolerance which allows a difference in the last binary digit

Gather[nums, Function[Abs[#1 - #2] < 2^-53]] // InputForm

(* {{0.33, 0.33000000000000007}, {0.3300000000000001}} *)


so InternalToEquivalenceClass[nums] which is the same as

InternalToEquivalenceClass[nums, N[Log[10, 2]]]

returns

(* {0.33000000000000007, 0.33000000000000007, 0.3300000000000002} *)


As the tolerance increases, the equivalence classes become larger: if another bit of tolerance is allowed, all three numbers are considered equivalent

InternalToEquivalenceClass[nums, N[Log[10, 2^2]]] // InputForm

(* {0.33000000000000007, 0.33000000000000007, 0.33000000000000007} *)

• As your answer,it is same the function InternalCompareNumeric` here.Though I think this result is little unexpected.. – yode Jul 10 '17 at 17:17