Skip to content
Snippets Groups Projects
Commit 275aca8f authored by Ganesh Ajjanagadde's avatar Ganesh Ajjanagadde
Browse files

configure+libm.h: add hypot emulation

It is known that the naive sqrt(x*x + y*y) approach for computing the
hypotenuse suffers from overflow and accuracy issues, see e.g
http://www.johndcook.com/blog/2010/06/02/whats-so-hard-about-finding-a-hypotenuse/

.
This adds hypot support to FFmpeg, a C99 function.

On platforms without hypot, this patch does a reaonable workaround, that
although not as accurate as GNU libm, is readable and does not suffer
from the overflow issue. Improvements can be made separately.

Reviewed-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: default avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
parent 14ea4151
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment