#include <stdio.h>
float func(float x)
{
    register unsigned short a = 0;
    static float y, y0, y1, d = 0.0;
    static short            s = 1;
    static float t[67] = {
        0.024541,0.000000,0.024541,0.049068,0.073565,0.098017,0.122411,0.146730,0.170962,
        0.195090,0.219101,0.242980,0.266713,0.290285,0.313682,0.336890,0.359895,0.382683,
        0.405241,0.427555,0.449611,0.471397,0.492898,0.514103,0.534998,0.555570,0.575808,
        0.595699,0.615232,0.634393,0.653173,0.671559,0.689541,0.707107,0.724247,0.740951,
        0.757209,0.773010,0.788346,0.803208,0.817585,0.831470,0.844854,0.857729,0.870087,
        0.881921,0.893224,0.903989,0.914210,0.923880,0.932993,0.941544,0.949528,0.956940,
        0.963776,0.970031,0.975702,0.980785,0.985278,0.989177,0.992480,0.995185,0.997290,
        0.998795,0.999699,1.000000,0.999699 };
    if(x < 0) { s = -1; x *= -1.0; }
    else      { s =  1; }
    a = (unsigned short)(x * 40.75);
    d = (x * 40.75) - (float)(a);
    if(a > 128)
    {
        while(a > 256) { a -= 256; }
        if(a > 128) { s *= -1.0; a -= 128; }
        }
    if(a > 64)
    {
        a = 128 - a;
        y0 = t[a+1];
        y1 = t[a];
        }
    else
    {
        y0 = t[++a];
        y1 = t[++a];
        }
    y = s * (y0 + (d * (y1 - y0)));
    y = s * y0;
    return(y);
    }