Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here's an ugly solution using <code>RegionPlot</code>. Open limits are represented using dotted lines and closed limits with full lines</p> <pre><code>numRegion[expr_, var_Symbol:x, range:{xmin_, xmax_}:{0, 0}, opts:OptionsPattern[]] := Module[{le=LogicalExpand[Reduce[expr,var,Reals]], y, opendots, closeddots, max, min, len}, opendots = Cases[Flatten[le/.And|Or-&gt;List], n_&lt;var|n_&gt;var|var&lt;n_|var&gt;n_:&gt;n]; closeddots = Cases[Flatten[le/.And|Or-&gt;List], n_&lt;=var|n_&gt;=var|var&lt;=n_|var&gt;=n_:&gt;n]; {max, min} = If[TrueQ[xmin &lt; xmax], {xmin, xmax}, {Max, Min}@Cases[le, _?NumericQ, Infinity] // Through]; len = max - min; RegionPlot[le &amp;&amp; -1 &lt; y &lt; 1, {var, min-len/10, max+len/10}, {y, -1, 1}, Epilog -&gt; {Thick, Red, Line[{{#,1},{#,-1}}]&amp;/@closeddots, Dotted, Line[{{#,1},{#,-1}}]&amp;/@opendots}, Axes -&gt; {True,False}, Frame-&gt;False, AspectRatio-&gt;.05, opts]] </code></pre> <p>An example reducing an absolute value:</p> <pre><code>numRegion[Abs[x] &lt; 2] </code></pre> <p><img src="https://i.stack.imgur.com/pOwo6.png" alt="example 1"></p> <p>Can use any variable:</p> <pre><code>numRegion[0 &lt; y &lt;= 1 || y &gt;= 2, y] </code></pre> <p><img src="https://i.stack.imgur.com/5GfC5.png" alt="example 2"></p> <p><code>Reduce</code>s extraneous inequalities, compare the following:</p> <pre><code>GraphicsColumn[{numRegion[0 &lt; x &lt;= 1 || x &gt;= 2 || x &lt; 0], numRegion[0 &lt; x &lt;= 1 || x &gt;= 2 || x &lt;= 0, x, {0, 2}]}] </code></pre> <p><img src="https://i.stack.imgur.com/6d7ox.png" alt="example 3"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload