<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <font face="Courier New">Stéphane,<br>
      <br>
      This would be great if it worked for any x. When x is close to
      1e16 there are few valid numbers per cycle. For instance</font><span
      style="color:rgb(0,0,0);"><br>
      <br>
    </span><span style="color:rgb(0,0,0);">x</span><span
      style="color:rgb(74,85,219);">(</span><span
      style="color:rgb(188,143,143);">1</span><span
      style="color:rgb(74,85,219);">)</span> <span
      style="color:rgb(92,92,92);">=</span> <span
      style="color:rgb(188,143,143);">1e16</span>
    <br>
    <span style="color:rgb(160,32,240);">for</span> <span
      style="color:rgb(0,0,0);">k</span><span
      style="color:rgb(92,92,92);">=</span><span
      style="color:rgb(188,143,143);">1</span><span
      style="color:rgb(255,170,0);">:</span><span
      style="color:rgb(188,143,143);">5</span> <span
      style="color:rgb(0,0,0);"><br>
          x</span><span style="color:rgb(74,85,219);">(</span><span
      style="color:rgb(0,0,0);">k</span><span
      style="color:rgb(92,92,92);">+</span><span
      style="color:rgb(188,143,143);">1</span><span
      style="color:rgb(74,85,219);">)</span> <span
      style="color:rgb(92,92,92);">=</span> <span
      style="color:rgb(50,185,185);">nearfloat</span><span
      style="color:rgb(74,85,219);">(</span><span
      style="color:rgb(188,143,143);">"</span><span
      style="color:rgb(188,143,143);">succ</span><span
      style="color:rgb(188,143,143);">"</span><span
      style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">x</span><span
      style="color:rgb(74,85,219);">(</span><span
      style="color:rgb(0,0,0);">k</span><span
      style="color:rgb(74,85,219);">)</span><span
      style="color:rgb(74,85,219);">)</span><span
      style="color:rgb(0,0,0);">;</span>
    <br>
    <span style="color:rgb(160,32,240);">end</span>
    <span style="color:rgb(74,85,219);"><br>
      x</span><span style="color:rgb(74,85,219);"></span><br>
    <font face="Courier New"><br>
      yields (with format(25))<br>
      <br>
         10000000000000000.  <br>
         10000000000000002.<br>
         10000000000000004.<br>
         10000000000000006.<br>
         10000000000000008.<br>
         10000000000000010.<br>
      <br>
      Those few numbers have each a definite exact value and sin(x) has
      also a definite exact value which seemingly is already well
      approximated, unlike what I had previously supposed. For instance<br>
      <br>
      [x sin(x)]<br>
      <br>
      yields<br>
    </font><br>
    <font face="Courier New"><font face="Courier New">  
        10000000000000000.   0.779688006606978<u>7</u>8957  <br>
           10000000000000002.  -0.893837828765730<u>5</u>909519<br>
           10000000000000004.  -0.035752436952928<u>5</u>263036<br>
           10000000000000006.   0.923594355839355<u>2</u>299535<br>
           10000000000000008.  -0.732949301917758<u>3</u>112977<br>
           10000000000000010.  -0.313565289154332<u>2</u>384749<br>
      </font><br>
      I have underlined the last correct digit compared with Alpha, so
      it is the expected result with 16 digits.</font><font
      face="Courier New"><br>
      <br>
      Regards,<br>
      <br>
      Federico Miyara<br>
    </font><br>
    <br>
    <div class="moz-cite-prefix">On 06/01/2021 05:49, Stéphane Mottelet
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:f9f8ddfa-58dd-5496-af47-2fc3a13b1431@utc.fr">x =
      (10^[1:16])*%pi<br>
      sx = sin(x-floor(x/2/%pi)*%pi*2)<br>
      plot("ln",x,sin(x),'-o',x,sx,'-o')<br>
      legend("$\Large\sin x$","$\Large\sin
      \left(x-2\pi\left\lfloor\frac{x}{2\pi}\right\rfloor\right)$",3)</blockquote>
    <br>
  <div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br /> <table style="border-top: 1px solid #D3D4DE;">
        <tr>
      <td style="width: 55px; padding-top: 18px;"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;" /></a></td>
                <td style="width: 470px; padding-top: 17px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Libre de virus. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank" style="color: #4453ea;">www.avast.com</a>           </td>
        </tr>
</table>
<a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></body>
</html>