Changes

Willy

33 bytes added, 14 October
/* logsin and exponent tables */
The OPL3 uses two look-up tables, each containing 256 entries. [https://g.co/kgs/Da1vEi4 Source]
The exponent Exponential table exp[] is calculated by f(x)=round((power(2, x/256)-1)×1024) for x from 0 to 255. Given a value, the significand is calculated by exp[8 LSB] + 1024, and the exponent is the remaining MSBs, producing a floating-point value. Ten bits of exponent are required to represent all values in the table, the largest being 1,018.:
The logsin x = 0..255, y = round((power(2, x/256)-1)*1024) When such a table logsin[] is calculated used for calculation of the exponential, the table is read at the position given by fthe 8 LSB's of the input. The value + 1024 (xthe hidden bit)is then the significand of the floating point output and the yet unused MSB's of the input are the exponent of the floating point output. Log-sin table:  x = 0..255, y =round(-log(sin((x+0.5)*pi/512256/2))/log(2)*256) for x from 0 to 255. It requires 11 bits to represent all values (largest  This is 2,137) and represents the first (rising ) quarter of a sine wave. The rest can be constructed by flipping all the bits of x and/or by changing the sign of the samples.
<br>
8,313
edits