mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-29 10:48: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
|
|
@ -29,6 +29,7 @@
|
|||
* acosh(NaN) is NaN without signal.
|
||||
*/
|
||||
|
||||
#include <cmath>
|
||||
#include <float.h>
|
||||
|
||||
#include "math_private.h"
|
||||
|
|
@ -55,9 +56,9 @@ __ieee754_acosh(double x)
|
|||
return 0.0; /* acosh(1) = 0 */
|
||||
} else if (hx > 0x40000000) { /* 2**28 > x > 2 */
|
||||
t=x*x;
|
||||
return __ieee754_log(2.0*x-one/(x+sqrt(t-one)));
|
||||
return __ieee754_log(2.0*x-one/(x+std::sqrt(t-one)));
|
||||
} else { /* 1<x<2 */
|
||||
t = x-one;
|
||||
return log1p(t+sqrt(2.0*t+t*t));
|
||||
return log1p(t+std::sqrt(2.0*t+t*t));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue