Bug introduced in 10.1 and solved in 11.1

An expression like this one

a < x < b

is represented as

Less[a, x, b]

while an expression like

a < x <= b

is represented as

Inequality[a, Less, x, LessEqual, b]

On my machine a problem arise when an Inequality expression contains Quantity expressions. For example

Quantity[6368, "Kilometers"] < Quantity[5500, "Kilometers"] <= 
 Quantity[6371, "Kilometers"]

stays unevaluated:

Quantity[6368, "Kilometers"] < Quantity[5500, "Kilometers"] <= Quantity[6371, "Kilometers"]

An annoying workaround is to LogicalExpand all Inequality expressions that may contains Quantity expression.



  • 1
    $\begingroup$ Looks like a bug to me. Better send this to support@wolfram.com $\endgroup$ – Sjoerd C. de Vries May 1 '15 at 11:04
  • $\begingroup$ Simplify also works. $\endgroup$ – chuy May 1 '15 at 14:59
  • 3
    $\begingroup$ Thank you for pointing this out. I checked and this is a known (internally reported) issue. This example will be added to the report. $\endgroup$ – Daniel Lichtblau May 1 '15 at 15:46
  • $\begingroup$ @chuy Not if the inequality is undecidable. $\endgroup$ – unlikely Mar 8 '16 at 18:18
  • $\begingroup$ @DanielLichtblau Is there anything built-in that makes it easy to bring inequalities to a canonical form? There seem to be several different ways to represent the same inequality. LogicalExpand? $\endgroup$ – Szabolcs Sep 29 '16 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.