Skip to content

Serious bug in the vlogq_neon_f32 code #13

@HaoYuan-Gao

Description

@HaoYuan-Gao

I have identified a bug in the vlogq_neon_f32 code. When calculating values close to 1, a significant error occurs, potentially leading to the inversion of the sign bit.

` float a = 0.1;
for(int i = 0; i < 9; ++i){
a += 0.1;
}
printf("%.9f\n", a);
float32x4_t in = {0.9f, 1.000000119, 1.1f, 1.2f};
float32x4_t out = vlogq_f32(in);
// out = vmulq_n_f32(out, 65535.f);
for(int i = 0; i < 4; ++i){
printf("%.9f\t", out[i]);
}
printf("\n");

for (int i = 0; i < 4; i++) {
    printf("%.9f\t", std::log(in[i]));
}
printf("\n");`

How to obtain correct results

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions