/* Auto-generated file.  DO NOT EDIT, OR YOUR CHANGES WILL BE LOST!
   This file has been auto-generated by:
   $ JOBS=2 CC=avr-gcc-15 builddir=../../../../build/avr-libc TIMES=1000 ./gen-bench.sh A 1 B 2 C 1 D 2
*/

/**
\page benchmarks

\section bench_libm Math Functions from libm

The following tables contain benchmark values for some
floating-point functions over the indicated range(s) of input values.

Notice that the values for relative error and the Worst Case Execution Time
Cycles<sub>max</sub> are only <em>lower bounds</em>.
The best achievable accuracy for IEEE single with its 23 fractional bits in
the mantissa is
{{{log<sub>10</sub>(2<sup>-24</sup> &asymp; 6*10<sup>-8</sup>) &asymp; -7.22}}}.

The poor performance of \c sinf, \c cosf and \c tanf occurs for values
that are close to the poles (if any) or close to the non-zero zeros.

<table>
<caption>libm benchmarks for ATmega128 (avr51, with MUL)</caption>
  <tr>
  <th>Function
  <th>Size
  <th>x<sub>0</sub>
  <th>x<sub>1</sub>
  <th>Cycles<sub>avr</sub>
  <th>Cycles<sub>max</sub>
  <th>log<sub>10</sub>(Err<sub>max</sub>)
  <tr><td> \c #acosf <td align='right'> 1102 <td> -1 <td> 1 <td align="right"> 1957 <td align="right"> 2464 <td align="center"> -6.66
  <tr><td> \c #asinf <td align='right'> 1092 <td> -1 <td> 1 <td align="right"> 1896 <td align="right"> 2454 <td align="center"> -6.47
  <tr><td> \c #atanf <td align='right'> 1058 <td> -10 <td> 10 <td align="right"> 2879 <td align="right"> 3073 <td align="center"> -6.92
  <tr><td> \c #cbrtf <td align='right'> 514 <td> -1e+06 <td> 1e+06 <td align="right"> 2573 <td align="right"> 2665 <td align="center"> -6.92
  <tr><td> \c #ceilf <td align='right'> 258 <td> -1e+05 <td> 1e+05 <td align="right"> 108 <td align="right"> 177 <td align="center"> -7.22
  <tr><td> \c #cosf <td align='right'> 904 <td> -1.57 <td> 1.58 <td align="right"> 1775 <td align="right"> 2126 <td align="center"> <b>-2.86</b>
  <tr><td> \c #coshf <td align='right'> 1366 <td> -20 <td> 20 <td align="right"> 3053 <td align="right"> 3439 <td align="center"> -5.78
  <tr><td> \c #expf <td align='right'> 1320 <td> -20 <td> 20 <td align="right"> 2588 <td align="right"> 3247 <td align="center"> -5.78
  <tr><td> \c #floorf <td align='right'> 258 <td> -1e+05 <td> 1e+05 <td align="right"> 108 <td align="right"> 180 <td align="center"> -7.22
  <tr><td> \c #frexpf <td align='right'> 154 <td> -1e+05 <td> 1e+05 <td align="right"> 40 <td align="right"> 40 <td align="center"> -7.22
  <tr><td> \c #logf <td align='right'> 1076 <td> 0 <td> 100 <td align="right"> 2392 <td align="right"> 2866 <td align="center"> -6.69
  <tr><td> \c #log10f <td align='right'> 1076 <td> 0 <td> 100 <td align="right"> 2397 <td align="right"> 2866 <td align="center"> -6.62
  <tr><td> \c #log2f <td align='right'> 1052 <td> 0 <td> 100 <td align="right"> 2252 <td align="right"> 2723 <td align="center"> -6.83
  <tr><td> \c #modff <td align='right'> 484 <td> -1e+05 <td> 1e+05 <td align="right"> 365 <td align="right"> 456 <td align="center"> -7.22
  <tr><td> \c #roundf <td align='right'> 236 <td> -1e+05 <td> 1e+05 <td align="right"> 111 <td align="right"> 156 <td align="center"> -7.22
  <tr><td> \c #sinf <td align='right'> 910 <td> 0 <td> 3.15 <td align="right"> 1744 <td align="right"> 2146 <td align="center"> <b>-3.67</b>
  <tr><td> \c #sincosf <td align='right'> 976 <td> -1.57 <td> 3.15 <td align="right"> 3482 <td align="right"> 3883 <td align="center"> <b>-3.43</b>
  <tr><td> \c #sinhf <td align='right'> 1466 <td> -20 <td> 20 <td align="right"> 3043 <td align="right"> 3461 <td align="center"> -5.78
  <tr><td> \c #sqrtf <td align='right'> 256 <td> 0 <td> 1e+06 <td align="right"> 474 <td align="right"> 510 <td align="center"> -7.22
  <tr><td> \c #tanf <td align='right'> 1178 <td> 0 <td> 3.15 <td align="right"> 2178 <td align="right"> 2946 <td align="center"> <b>-2.86</b>
  <tr><td> \c #tanhf <td align='right'> 1494 <td> -20 <td> 20 <td align="right"> 3148 <td align="right"> 3620 <td align="center"> -6.37
  <tr><td> \c #truncf <td align='right'> 234 <td> -1000 <td> 1000 <td align="right"> 140 <td align="right"> 178 <td align="center"> -7.22
</table>

&nbsp;
<table>
<caption>libm benchmarks for ATmega128 (avr51, with MUL)</caption>
  <tr>
  <th>Function
  <th>Size
  <th>x<sub>0</sub>
  <th>x<sub>1</sub>
  <th>y<sub>0</sub>
  <th>y<sub>1</sub>
  <th>Cycles<sub>avr</sub>
  <th>Cycles<sub>max</sub>
  <th>log<sub>10</sub>(Err<sub>max</sub>)
  <tr><td> \c + <td align='right'> 380 <td> -1e+10 <td> 1e+10 <td> -1e+10 <td> 1e+10 <td align="right"> 102 <td align="right"> 256 <td align="center"> -7.22
  <tr><td> \c * <td align='right'> 380 <td> -1e+10 <td> 1e+10 <td> -1e+10 <td> 1e+10 <td align="right"> 129 <td align="right"> 139 <td align="center"> -7.22
  <tr><td> \c / <td align='right'> 390 <td> -1e+10 <td> 1e+10 <td> -1e+10 <td> 1e+10 <td align="right"> 469 <td align="right"> 501 <td align="center"> -7.22
  <tr><td> \c #atan2f <td align='right'> 1206 <td> -10 <td> 10 <td> -10 <td> 10 <td align="right"> 2882 <td align="right"> 3455 <td align="center"> -6.82
  <tr><td> \c #fdimf <td align='right'> 446 <td> -1e+10 <td> 1e+10 <td> -1e+10 <td> 1e+10 <td align="right"> 75 <td align="right"> 218 <td align="center"> -7.22
  <tr><td> \c #fmaxf <td align='right'> 62 <td> -1e+10 <td> 1e+10 <td> -1e+10 <td> 1e+10 <td align="right"> 30 <td align="right"> 34 <td align="center"> -&infin;
  <tr><td> \c #fminf <td align='right'> 62 <td> -1e+10 <td> 1e+10 <td> -1e+10 <td> 1e+10 <td align="right"> 30 <td align="right"> 34 <td align="center"> -&infin;
  <tr><td> \c #fmodf <td align='right'> 312 <td> -1e+10 <td> 1e+10 <td> -1e+10 <td> 1e+10 <td align="right"> 88 <td align="right"> 324 <td align="center"> -7.22
  <tr><td> \c #hypotf <td align='right'> 1092 <td> -1e+10 <td> 1e+10 <td> -1e+10 <td> 1e+10 <td align="right"> 850 <td align="right"> 927 <td align="center"> -6.92
  <tr><td> \c #ldexpf <td align='right'> 238 <td> -1e+10 <td> 1e+10 <td> -10 <td> 10 <td align="right"> 40 <td align="right"> 40 <td align="center"> -7.22
  <tr><td> \c #powf <td align='right'> 1858 <td> 0 <td> 1e+04 <td> -10 <td> 10 <td align="right"> 5182 <td align="right"> 5833 <td align="center"> <b>-4.65</b>
  <tr><td> \c #__builtin_powif <td align='right'> 732 <td> 0 <td> 1e+04 <td> -10 <td> 10 <td align="right"> 648 <td align="right"> 1223 <td align="center"> -6.39
</table>

For devices without MUL instruction, the following applies:
- The execution times for multiplication and for the transcendental functions
  are roughly twice the time for devices that have MUL.
- The execution times for the remaining functions are roughly the same.
- The maximal relative errors are the same, i.e. independent of MUL.

<table>
<caption>libm benchmarks for AT90S8515 (avr2, no MUL)</caption>
  <tr>
  <th>Function
  <th>Size
  <th>x<sub>0</sub>
  <th>x<sub>1</sub>
  <th>Cycles<sub>avr</sub>
  <th>Cycles<sub>max</sub>
  <th>log<sub>10</sub>(Err<sub>max</sub>)
  <tr><td> \c #acosf <td align='right'> 1104 <td> -1 <td> 1 <td align="right"> 3513 <td align="right"> 3888 <td align="center"> -6.66
  <tr><td> \c #asinf <td align='right'> 1096 <td> -1 <td> 1 <td align="right"> 3452 <td align="right"> 3879 <td align="center"> -6.47
  <tr><td> \c #atanf <td align='right'> 1054 <td> -10 <td> 10 <td align="right"> 5280 <td align="right"> 5541 <td align="center"> -6.92
  <tr><td> \c #cbrtf <td align='right'> 538 <td> -1e+06 <td> 1e+06 <td align="right"> 2702 <td align="right"> 2795 <td align="center"> -6.92
  <tr><td> \c #ceilf <td align='right'> 250 <td> -1e+05 <td> 1e+05 <td align="right"> 105 <td align="right"> 174 <td align="center"> -7.22
  <tr><td> \c #cosf <td align='right'> 906 <td> -1.57 <td> 1.58 <td align="right"> 3441 <td align="right"> 3798 <td align="center"> <b>-2.86</b>
  <tr><td> \c #coshf <td align='right'> 1348 <td> -20 <td> 20 <td align="right"> 4966 <td align="right"> 5346 <td align="center"> -5.78
  <tr><td> \c #expf <td align='right'> 1312 <td> -20 <td> 20 <td align="right"> 4512 <td align="right"> 5140 <td align="center"> -5.78
  <tr><td> \c #floorf <td align='right'> 250 <td> -1e+05 <td> 1e+05 <td align="right"> 105 <td align="right"> 177 <td align="center"> -7.22
  <tr><td> \c #frexpf <td align='right'> 150 <td> -1e+05 <td> 1e+05 <td align="right"> 39 <td align="right"> 39 <td align="center"> -7.22
  <tr><td> \c #logf <td align='right'> 1076 <td> 0 <td> 100 <td align="right"> 4562 <td align="right"> 5023 <td align="center"> -6.69
  <tr><td> \c #log10f <td align='right'> 1076 <td> 0 <td> 100 <td align="right"> 4568 <td align="right"> 5035 <td align="center"> -6.62
  <tr><td> \c #log2f <td align='right'> 1060 <td> 0 <td> 100 <td align="right"> 4205 <td align="right"> 4632 <td align="center"> -6.83
  <tr><td> \c #modff <td align='right'> 490 <td> -1e+05 <td> 1e+05 <td align="right"> 365 <td align="right"> 456 <td align="center"> -7.22
  <tr><td> \c #roundf <td align='right'> 230 <td> -1e+05 <td> 1e+05 <td align="right"> 109 <td align="right"> 154 <td align="center"> -7.22
  <tr><td> \c #sinf <td align='right'> 912 <td> 0 <td> 3.15 <td align="right"> 3408 <td align="right"> 3818 <td align="center"> <b>-3.67</b>
  <tr><td> \c #sincosf <td align='right'> 978 <td> -1.57 <td> 3.15 <td align="right"> 6813 <td align="right"> 7225 <td align="center"> <b>-3.43</b>
  <tr><td> \c #sinhf <td align='right'> 1434 <td> -20 <td> 20 <td align="right"> 4941 <td align="right"> 5358 <td align="center"> -5.78
  <tr><td> \c #sqrtf <td align='right'> 252 <td> 0 <td> 1e+06 <td align="right"> 474 <td align="right"> 510 <td align="center"> -7.22
  <tr><td> \c #tanf <td align='right'> 1164 <td> 0 <td> 3.15 <td align="right"> 4080 <td align="right"> 4785 <td align="center"> <b>-2.86</b>
  <tr><td> \c #tanhf <td align='right'> 1462 <td> -20 <td> 20 <td align="right"> 5055 <td align="right"> 5544 <td align="center"> -6.37
  <tr><td> \c #truncf <td align='right'> 226 <td> -1000 <td> 1000 <td align="right"> 137 <td align="right"> 175 <td align="center"> -7.22
</table>

&nbsp;
<table>
<caption>libm benchmarks for AT90S8515 (avr2, no MUL)</caption>
  <tr>
  <th>Function
  <th>Size
  <th>x<sub>0</sub>
  <th>x<sub>1</sub>
  <th>y<sub>0</sub>
  <th>y<sub>1</sub>
  <th>Cycles<sub>avr</sub>
  <th>Cycles<sub>max</sub>
  <th>log<sub>10</sub>(Err<sub>max</sub>)
  <tr><td> \c + <td align='right'> 376 <td> -1e+10 <td> 1e+10 <td> -1e+10 <td> 1e+10 <td align="right"> 102 <td align="right"> 253 <td align="center"> -7.22
  <tr><td> \c * <td align='right'> 378 <td> -1e+10 <td> 1e+10 <td> -1e+10 <td> 1e+10 <td align="right"> 346 <td align="right"> 386 <td align="center"> -7.22
  <tr><td> \c / <td align='right'> 374 <td> -1e+10 <td> 1e+10 <td> -1e+10 <td> 1e+10 <td align="right"> 467 <td align="right"> 499 <td align="center"> -7.22
  <tr><td> \c #atan2f <td align='right'> 1192 <td> -10 <td> 10 <td> -10 <td> 10 <td align="right"> 5287 <td align="right"> 5844 <td align="center"> -6.82
  <tr><td> \c #fdimf <td align='right'> 436 <td> -1e+10 <td> 1e+10 <td> -1e+10 <td> 1e+10 <td align="right"> 74 <td align="right"> 219 <td align="center"> -7.22
  <tr><td> \c #fmaxf <td align='right'> 66 <td> -1e+10 <td> 1e+10 <td> -1e+10 <td> 1e+10 <td align="right"> 31 <td align="right"> 36 <td align="center"> -&infin;
  <tr><td> \c #fminf <td align='right'> 66 <td> -1e+10 <td> 1e+10 <td> -1e+10 <td> 1e+10 <td align="right"> 30 <td align="right"> 36 <td align="center"> -&infin;
  <tr><td> \c #fmodf <td align='right'> 302 <td> -1e+10 <td> 1e+10 <td> -1e+10 <td> 1e+10 <td align="right"> 86 <td align="right"> 322 <td align="center"> -7.22
  <tr><td> \c #hypotf <td align='right'> 1068 <td> -1e+10 <td> 1e+10 <td> -1e+10 <td> 1e+10 <td align="right"> 1297 <td align="right"> 1387 <td align="center"> -6.92
  <tr><td> \c #ldexpf <td align='right'> 232 <td> -1e+10 <td> 1e+10 <td> -10 <td> 10 <td align="right"> 39 <td align="right"> 39 <td align="center"> -7.22
  <tr><td> \c #powf <td align='right'> 1820 <td> 0 <td> 1e+04 <td> -10 <td> 10 <td align="right"> 9490 <td align="right"> 10180 <td align="center"> <b>-4.65</b>
  <tr><td> \c #__builtin_powif <td align='right'> 734 <td> 0 <td> 1e+04 <td> -10 <td> 10 <td align="right"> 1143 <td align="right"> 2140 <td align="center"> -6.39
</table>
*/
