/**
 * generated using metalibm 1.1
 * sha1 git: b'"44931432e12dbbda32ae5520e55557ff367a96bb"'(clean)
 * 
 * INFO: git status was clean when file was generated.
 * 
 * command used for generation:
 *   metalibm_functions/ml_cbrt.py --precision binary32 --target x86_sse2 \
 *     --output /root/s_cbrtf_sse2.c
 * 
**/
#include <stdint.h>
#include <math.h>
#include <xmmintrin.h>
#include <emmintrin.h>
#include <ml_support_lib.h>


static const __m128 my_cbrt_cst = {1.0f}/*sse*/;
static const __m128i my_cbrt_cst1 = {INT32_C(17)}/*sse*/;
static const __m128i my_cbrt_cst2 = {INT32_C(63)}/*sse*/;
static const __m128i my_cbrt_cst3 = {INT32_C(0)}/*sse*/;
static const __m128i my_cbrt_cst4 = {INT32_C(3)}/*sse*/;
static const __m128i my_cbrt_cst5 = {INT32_C(-127)}/*sse*/;
static const __m128i my_cbrt_cst6 = {INT32_C(23)}/*sse*/;
static const __m128i my_cbrt_cst7 = {INT32_C(255)}/*sse*/;
static const __m128i my_cbrt_cst8 = {INT32_C(3)}/*sse*/;
static const __m128i my_cbrt_cst9 = {INT32_C(0)}/*sse*/;
static const __m128i my_cbrt_cst10 = {INT32_C(127)}/*sse*/;
static const __m128i my_cbrt_cst11 = {INT32_C(3)}/*sse*/;
static const __m128i my_cbrt_cst12 = {INT32_C(23)}/*sse*/;
static const __m128 my_cbrt_cst13 = {1.0f}/*sse*/;
static const __m128 my_cbrt_cst14 = {0.3333333333333333f}/*sse*/;
static const __m128 my_cbrt_cst15 = {1.0f}/*sse*/;
static const __m128 my_cbrt_cst16 = {0.3333333333333333f}/*sse*/;
static const __m128 my_cbrt_cst17 = {1.0f}/*sse*/;
static const __m128 my_cbrt_cst18 = {0.3333333333333333f}/*sse*/;
static const __m128 my_cbrt_cst19 = {1.0f}/*sse*/;
static const __m128 my_cbrt_cst20 = {0.3333333333333333f}/*sse*/;
static const __m128 my_cbrt_cst21 = {1.0f}/*sse*/;
static const __m128 my_cbrt_cst22 = {0.3333333333333333f}/*sse*/;
static const __m128 my_cbrt_cst23 = {1.0f}/*sse*/;
static const __m128 my_cbrt_cst24 = {0.3333333333333333f}/*sse*/;
static const __m128 my_cbrt_cst25 = {1.0f}/*sse*/;
static const __m128 my_cbrt_cst26 = {0.3333333333333333f}/*sse*/;
static const __m128 my_cbrt_cst27 = {1.0f}/*sse*/;
static const __m128 my_cbrt_cst28 = {0.3333333333333333f}/*sse*/;
static const float my_cbrt_cbrt_approx_table[64][1]  = {
    { 0x1p0f},
    { 0x1.015392p0f},
    { 0x1.02a3aep0f},
    { 0x1.03f068p0f},
    { 0x1.0539d6p0f},
    { 0x1.06800ep0f},
    { 0x1.07c324p0f},
    { 0x1.090328p0f},
    { 0x1.0a403p0f},
    { 0x1.0b7a4cp0f},
    { 0x1.0cb18cp0f},
    { 0x1.0de602p0f},
    { 0x1.0f17bcp0f},
    { 0x1.1046ccp0f},
    { 0x1.11733ep0f},
    { 0x1.129d22p0f},
    { 0x1.13c484p0f},
    { 0x1.14e974p0f},
    { 0x1.160bfcp0f},
    { 0x1.172c2ap0f},
    { 0x1.184a0ap0f},
    { 0x1.1965a8p0f},
    { 0x1.1a7f0ep0f},
    { 0x1.1b9648p0f},
    { 0x1.1cab62p0f},
    { 0x1.1dbe62p0f},
    { 0x1.1ecf56p0f},
    { 0x1.1fde46p0f},
    { 0x1.20eb3cp0f},
    { 0x1.21f64p0f},
    { 0x1.22ff5cp0f},
    { 0x1.240698p0f},
    { 0x1.250bfep0f},
    { 0x1.260f94p0f},
    { 0x1.271164p0f},
    { 0x1.281172p0f},
    { 0x1.290fcap0f},
    { 0x1.2a0c72p0f},
    { 0x1.2b077p0f},
    { 0x1.2c00cap0f},
    { 0x1.2cf888p0f},
    { 0x1.2deeb2p0f},
    { 0x1.2ee34ep0f},
    { 0x1.2fd66p0f},
    { 0x1.30c7fp0f},
    { 0x1.31b802p0f},
    { 0x1.32a6ap0f},
    { 0x1.3393cap0f},
    { 0x1.347f8ap0f},
    { 0x1.3569e4p0f},
    { 0x1.3652dep0f},
    { 0x1.373a7ap0f},
    { 0x1.3820cp0f},
    { 0x1.3905b4p0f},
    { 0x1.39e95cp0f},
    { 0x1.3acbbcp0f},
    { 0x1.3bacd6p0f},
    { 0x1.3c8cb2p0f},
    { 0x1.3d6b54p0f},
    { 0x1.3e48bep0f},
    { 0x1.3f24f6p0f},
    { 0x1.4p0f},
    { 0x1.40d9ep0f},
    { 0x1.41b298p0f}
};
static const float my_cbrt_cbrt_mod_table[6][1]  = {
    { 0x1p-1f},
    { 0x1.428a3p-1f},
    { 0x1.965feap-1f},
    { 0x1p0f},
    { 0x1.428a3p0f},
    { 0x1.965feap0f}
};

float my_cbrt(float);
float my_cbrt(float x){
    float tmp;
    float tmp1;
    int32_t tmp2;
    float tmp3;
    int32_t tmp4;
    uint32_t _srl_cast;
    int32_t tmp5;
    int32_t tmp6;
    int32_t table_index;
    int32_t tmp7;
    float seed;
    __m128 tmp8;
    int32_t tmp9;
    int32_t tmp10;
    uint32_t _srl_cast1;
    int32_t tmp11;
    int32_t tmp12;
    int32_t tmp13;
    __m128i tmp14;
    __m128i exp_vx;
    int32_t tmp15;
    int32_t tmp16;
    int32_t exp_vx_mod;
    __m128i tmp17;
    __m128i tmp18;
    int32_t tmp19;
    int32_t tmp20;
    float cbrt_mod;
    __m128 tmp21;
    __m128 init_mult;
    int32_t tmp22;
    int32_t exp_vx_third;
    __m128i tmp23;
    __m128i tmp24;
    __m128i tmp25;
    int32_t tmp26;
    float exp_vx_third1;
    __m128 tmp27;
    __m128 init_approx;
    __m128 tmp28;
    __m128 tmp29;
    float tmp30;
    float tmp31;
    float carg;
    float tmp32;
    __m128 tmp33;
    float tmp34;
    float tmp35;
    float approx_0;
    __m128 tmp36;
    __m128 tmp37;
    __m128 tmp38;
    float tmp39;
    float tmp40;
    float carg1;
    float tmp41;
    __m128 tmp42;
    float tmp43;
    float approx_1;
    __m128 tmp44;
    __m128 tmp45;
    __m128 tmp46;
    float tmp47;
    float tmp48;
    float carg2;
    float tmp49;
    __m128 tmp50;
    float tmp51;
    float approx_2;
    __m128 tmp52;
    __m128 tmp53;
    __m128 tmp54;
    float tmp55;
    float tmp56;
    float carg3;
    float tmp57;
    __m128 tmp58;
    float tmp59;
    float approx_3;
    __m128 tmp60;
    __m128 tmp61;
    __m128 tmp62;
    float tmp63;
    float tmp64;
    float carg4;
    float tmp65;
    __m128 tmp66;
    float tmp67;
    float approx_4;
    __m128 tmp68;
    __m128 tmp69;
    __m128 tmp70;
    float tmp71;
    float tmp72;
    float carg5;
    float tmp73;
    __m128 tmp74;
    float tmp75;
    float approx_5;
    __m128 tmp76;
    __m128 tmp77;
    __m128 tmp78;
    float tmp79;
    float tmp80;
    float carg6;
    float tmp81;
    __m128 tmp82;
    float tmp83;
    float approx_6;
    __m128 tmp84;
    __m128 tmp85;
    __m128 tmp86;
    float tmp87;
    float tmp88;
    float carg7;
    float tmp89;
    __m128 tmp90;
    float tmp91;
    float result;
    
    tmp = _mm_cvtss_f32(my_cbrt_cst);
    tmp1 = tmp / x;
    tmp2 = _mm_cvtsi128_si32(my_cbrt_cst1);
    tmp3 = ml_mantissa_extraction_fp32(x);
    tmp4 = float_to_32b_encoding(tmp3);
    _srl_cast = tmp4;
    tmp5 = _srl_cast >> tmp2;
    tmp6 = _mm_cvtsi128_si32(my_cbrt_cst2);
    table_index = tmp5 & tmp6;
    tmp7 = _mm_cvtsi128_si32(my_cbrt_cst3);
    seed = my_cbrt_cbrt_approx_table[table_index][tmp7];
    tmp8 = _mm_set_ss(seed);
    tmp9 = _mm_cvtsi128_si32(my_cbrt_cst6);
    tmp10 = float_to_32b_encoding(x);
    _srl_cast1 = tmp10;
    tmp11 = _srl_cast1 >> tmp9;
    tmp12 = _mm_cvtsi128_si32(my_cbrt_cst7);
    tmp13 = tmp11 & tmp12;
    tmp14 = _mm_set1_epi32(tmp13);
    exp_vx = _mm_add_epi32(tmp14, my_cbrt_cst5);
    tmp15 = _mm_cvtsi128_si32(exp_vx);
    tmp16 = _mm_cvtsi128_si32(my_cbrt_cst8);
    exp_vx_mod = tmp15 % tmp16;
    tmp17 = _mm_set1_epi32(exp_vx_mod);
    tmp18 = _mm_add_epi32(tmp17, my_cbrt_cst4);
    tmp19 = _mm_cvtsi128_si32(tmp18);
    tmp20 = _mm_cvtsi128_si32(my_cbrt_cst9);
    cbrt_mod = my_cbrt_cbrt_mod_table[tmp19][tmp20];
    tmp21 = _mm_set_ss(cbrt_mod);
    init_mult = _mm_mul_ss(tmp8, tmp21);
    tmp22 = _mm_cvtsi128_si32(my_cbrt_cst11);
    exp_vx_third = tmp15 / tmp22;
    tmp23 = _mm_set1_epi32(exp_vx_third);
    tmp24 = _mm_add_epi32(tmp23, my_cbrt_cst10);
    tmp25 = tmp24 << my_cbrt_cst12;
    tmp26 = _mm_cvtsi128_si32(tmp25);
    exp_vx_third1 = float_from_32b_encoding(tmp26);
    tmp27 = _mm_set_ss(exp_vx_third1);
    init_approx = _mm_mul_ss(init_mult, tmp27);
    tmp28 = _mm_mul_ss(init_approx, init_approx);
    tmp29 = _mm_mul_ss(init_approx, tmp28);
    tmp30 = _mm_cvtss_f32(tmp29);
    tmp31 = _mm_cvtss_f32(my_cbrt_cst13);
    carg =  - tmp30;
    tmp32 = fmaf(carg, tmp1, tmp31);
    tmp33 = _mm_mul_ss(init_approx, my_cbrt_cst14);
    tmp34 = _mm_cvtss_f32(tmp33);
    tmp35 = _mm_cvtss_f32(init_approx);
    approx_0 = fmaf(tmp34, tmp32, tmp35);
    tmp36 = _mm_set_ss(approx_0);
    tmp37 = _mm_mul_ss(tmp36, tmp36);
    tmp38 = _mm_mul_ss(tmp36, tmp37);
    tmp39 = _mm_cvtss_f32(tmp38);
    tmp40 = _mm_cvtss_f32(my_cbrt_cst15);
    carg1 =  - tmp39;
    tmp41 = fmaf(carg1, tmp1, tmp40);
    tmp42 = _mm_mul_ss(tmp36, my_cbrt_cst16);
    tmp43 = _mm_cvtss_f32(tmp42);
    approx_1 = fmaf(tmp43, tmp41, approx_0);
    tmp44 = _mm_set_ss(approx_1);
    tmp45 = _mm_mul_ss(tmp44, tmp44);
    tmp46 = _mm_mul_ss(tmp44, tmp45);
    tmp47 = _mm_cvtss_f32(tmp46);
    tmp48 = _mm_cvtss_f32(my_cbrt_cst17);
    carg2 =  - tmp47;
    tmp49 = fmaf(carg2, tmp1, tmp48);
    tmp50 = _mm_mul_ss(tmp44, my_cbrt_cst18);
    tmp51 = _mm_cvtss_f32(tmp50);
    approx_2 = fmaf(tmp51, tmp49, approx_1);
    tmp52 = _mm_set_ss(approx_2);
    tmp53 = _mm_mul_ss(tmp52, tmp52);
    tmp54 = _mm_mul_ss(tmp52, tmp53);
    tmp55 = _mm_cvtss_f32(tmp54);
    tmp56 = _mm_cvtss_f32(my_cbrt_cst19);
    carg3 =  - tmp55;
    tmp57 = fmaf(carg3, tmp1, tmp56);
    tmp58 = _mm_mul_ss(tmp52, my_cbrt_cst20);
    tmp59 = _mm_cvtss_f32(tmp58);
    approx_3 = fmaf(tmp59, tmp57, approx_2);
    tmp60 = _mm_set_ss(approx_3);
    tmp61 = _mm_mul_ss(tmp60, tmp60);
    tmp62 = _mm_mul_ss(tmp60, tmp61);
    tmp63 = _mm_cvtss_f32(tmp62);
    tmp64 = _mm_cvtss_f32(my_cbrt_cst21);
    carg4 =  - tmp63;
    tmp65 = fmaf(carg4, tmp1, tmp64);
    tmp66 = _mm_mul_ss(tmp60, my_cbrt_cst22);
    tmp67 = _mm_cvtss_f32(tmp66);
    approx_4 = fmaf(tmp67, tmp65, approx_3);
    tmp68 = _mm_set_ss(approx_4);
    tmp69 = _mm_mul_ss(tmp68, tmp68);
    tmp70 = _mm_mul_ss(tmp68, tmp69);
    tmp71 = _mm_cvtss_f32(tmp70);
    tmp72 = _mm_cvtss_f32(my_cbrt_cst23);
    carg5 =  - tmp71;
    tmp73 = fmaf(carg5, tmp1, tmp72);
    tmp74 = _mm_mul_ss(tmp68, my_cbrt_cst24);
    tmp75 = _mm_cvtss_f32(tmp74);
    approx_5 = fmaf(tmp75, tmp73, approx_4);
    tmp76 = _mm_set_ss(approx_5);
    tmp77 = _mm_mul_ss(tmp76, tmp76);
    tmp78 = _mm_mul_ss(tmp76, tmp77);
    tmp79 = _mm_cvtss_f32(tmp78);
    tmp80 = _mm_cvtss_f32(my_cbrt_cst25);
    carg6 =  - tmp79;
    tmp81 = fmaf(carg6, tmp1, tmp80);
    tmp82 = _mm_mul_ss(tmp76, my_cbrt_cst26);
    tmp83 = _mm_cvtss_f32(tmp82);
    approx_6 = fmaf(tmp83, tmp81, approx_5);
    tmp84 = _mm_set_ss(approx_6);
    tmp85 = _mm_mul_ss(tmp84, tmp84);
    tmp86 = _mm_mul_ss(tmp84, tmp85);
    tmp87 = _mm_cvtss_f32(tmp86);
    tmp88 = _mm_cvtss_f32(my_cbrt_cst27);
    carg7 =  - tmp87;
    tmp89 = fmaf(carg7, tmp1, tmp88);
    tmp90 = _mm_mul_ss(tmp84, my_cbrt_cst28);
    tmp91 = _mm_cvtss_f32(tmp90);
    result = fmaf(tmp91, tmp89, approx_6);
    return result;
}
