title: How to draw graph of Gauss function?
body: <p><a href="https://en.wikipedia.org/wiki/Gauss%E2%80%93Kuzmin%E2%80%93Wirsing_operator#The_Gaus_map" rel="nofollow noreferrer">Gauss function</a> has an infinite number of jump discontinuities at x = 1/n, for positive integers. </p>
  
  <p>I want to draw diagram of Gauss function. </p>
  
  <p>Using Maxima cas I can draw it with simple command : </p>
  
  <pre><code>  f(x):= 1/x - floor(1/x);  plot2d(f(x),[x,0,1]);
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/rPybe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rPybe.png" alt="enter image description here"></a></p>
  
  <p>but the result is not good ( near x=0 it should be like <a href="http://wayback.cecm.sfu.ca/publications/organic/figure1.ps" rel="nofollow noreferrer">here</a>)</p>
  
  <p>Also Maxima claims:</p>
  
  <p><code>plot2d: expression evaluates to non-numeric value somewhere in plotting 
     range.</code></p>
  
  <p>I can define picewise function ( jump discontinuities at x = 1/n, for positive integers )</p>
  
  <p>so I tried : </p>
  
  <pre><code>define( g(x), for i:2 thru 20 step 1 do if (x=i) then x else (1/x) - floor(1/x));
  </code></pre>
  
  <p>but it don't works.</p>
  
  <p>I can also use chebyshew polynomials to aproximate function ( like in :  A Graduate Introduction to Numerical Methods From the Viewpoint of Backward Error Analysis by Corless, Robert, Fillion, Nicolas) </p>
  
  <p>How to do it properly ? </p>