mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-28 10:18:39 +09:00
Issue #1291 - Part 2: Stop using the lib's sqrt() function
Use <cmath>'s functions over fdlibm's for performance reasons. No significant precision loss when doing this.
This commit is contained in:
parent
ddb27ac3e9
commit
b6c0bdd7da
10 changed files with 17 additions and 459 deletions
|
|
@ -38,6 +38,7 @@
|
|||
* Function needed: sqrt
|
||||
*/
|
||||
|
||||
#include <cmath>
|
||||
#include <float.h>
|
||||
|
||||
#include "math_private.h"
|
||||
|
|
@ -87,13 +88,13 @@ __ieee754_acos(double x)
|
|||
z = (one+x)*0.5;
|
||||
p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
|
||||
q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
|
||||
s = sqrt(z);
|
||||
s = std::sqrt(z);
|
||||
r = p/q;
|
||||
w = r*s-pio2_lo;
|
||||
return pi - 2.0*(s+w);
|
||||
} else { /* x > 0.5 */
|
||||
z = (one-x)*0.5;
|
||||
s = sqrt(z);
|
||||
s = std::sqrt(z);
|
||||
df = s;
|
||||
SET_LOW_WORD(df,0);
|
||||
c = (z-df*df)/(s+df);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue