Skip to content

acos 0.99+ values are out by several degrees #7

@jdtec01

Description

@jdtec01

Hi,

Acos input values between ~0.99 - 1.0 lead to some fairly imprecise output values, off by up to 5 degrees.

eg.

input=0.9941521, expected=0.1082002,  real=0.06253052, diff=0.04566966, :: degrees diff:2.616679
input=0.9961014, expected=0.0883307,  real=0,          diff=0.0883307,  :: degrees diff:5.060977
input=0.9980507, expected=0.06244908, real=0,          diff=0.06244908, :: degrees diff:3.578069

I found this whilst implementing a quaternion angle diff function which had some nasty snapping in these values leading to it being 2-5 degrees off floating point math acos.

I'm not sure what to suggest to improve it. I was considering generating a larger LUT table, however, I'd probably need to change some of the precision bit stuff.

I thought I'd raise it incase you also see this as an issue?

Thanks for putting this project up on github.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions