1 /*-------------------------------------------------------------------------
4 Copyright (C) 2005, Paul Stoffregen
6 This library is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this library; see the file COPYING. If not, write to the
18 Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
21 As a special exception, if you link this library with other files,
22 some of which are compiled with SDCC, to produce an executable,
23 this library does not by itself cause the resulting executable to
24 be covered by the GNU General Public License. This exception does
25 not however invalidate any other reasons why the executable file
26 might be covered by the GNU General Public License.
27 -------------------------------------------------------------------------*/
29 #define __SDCC_MATH_LIB
35 // This code is shared by both logf() and expf(), so it goes in this
36 // separate file to allow the linker to include it when either
37 // function is needed, but only 1 copy when both are used.
39 void _fs_cordic_rshift_r765_unsigned(void) __naked
96 __code
unsigned char _fs_natural_log_table
[] = {
97 0xFF, 0x42, 0x2E, 0x16, // 0.693147180560
98 0xF6, 0x91, 0xF9, 0x0C, // 0.405465108108
99 0xF2, 0xFD, 0x23, 0x07, // 0.223143551314
100 0xEE, 0xE0, 0xC4, 0x03, // 0.117783035656
101 0x0C, 0xA3, 0xF0, 0x01, // 0.060624621816
102 0xD8, 0x14, 0xFC, 0x00, // 0.030771658667
103 0xA3, 0x02, 0x7F, 0x00, // 0.015504186536
104 0x55, 0xC0, 0x3F, 0x00, // 0.007782140442
105 0x0B, 0xF0, 0x1F, 0x00, // 0.003898640416
106 0x01, 0xFC, 0x0F, 0x00, // 0.001951220131
107 0x00, 0xFF, 0x07, 0x00, // 0.000976085973
108 0xC0, 0xFF, 0x03, 0x00, // 0.000488162080
109 0xF0, 0xFF, 0x01, 0x00, // 0.000244110828
110 0xFC, 0xFF, 0x00, 0x00, // 0.000122062863
111 0xFF, 0x7F, 0x00, 0x00, // 0.000061033294
112 0x00, 0x40, 0x00, 0x00, // 0.000030517112
113 0x00, 0x20, 0x00, 0x00, // 0.000015258673
114 0x00, 0x10, 0x00, 0x00, // 0.000007629365
115 0x00, 0x08, 0x00, 0x00, // 0.000003814690
116 0x00, 0x04, 0x00, 0x00, // 0.000001907347
117 0x00, 0x02, 0x00, 0x00, // 0.000000953674
118 0x00, 0x01, 0x00, 0x00, // 0.000000476837
119 0x80, 0x00, 0x00, 0x00, // 0.000000238419
120 0x40, 0x00, 0x00, 0x00, // 0.000000119209
121 0x20, 0x00, 0x00, 0x00, // 0.000000059605
122 0x10, 0x00, 0x00, 0x00, // 0.000000029802
123 0x08, 0x00, 0x00, 0x00, // 0.000000014901
124 0x04, 0x00, 0x00, 0x00, // 0.000000007451
125 0x02, 0x00, 0x00, 0x00, // 0.000000003725
126 0x01, 0x00, 0x00, 0x00 // 0.000000001863