mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 00:02:28 +00:00
Import more Musl math
This commit is contained in:
parent
6d52664aa7
commit
3027d67037
48 changed files with 1749 additions and 180 deletions
|
@ -18,6 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/math.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/testlib/ezbench.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/x/x.h"
|
||||
|
||||
|
@ -38,3 +39,12 @@ TEST(atan, test) {
|
|||
gc(xasprintf("%.15g", atan(__DBL_MIN__))));
|
||||
EXPECT_STREQ("1.5707963267949", gc(xasprintf("%.15g", atan(__DBL_MAX__))));
|
||||
}
|
||||
|
||||
BENCH(atanl, bench) {
|
||||
double _atan(double) asm("atan");
|
||||
float _atanf(float) asm("atanf");
|
||||
long double _atanl(long double) asm("atanl");
|
||||
EZBENCH2("-atan", donothing, _atan(.7)); /* ~18ns */
|
||||
EZBENCH2("-atanf", donothing, _atanf(.7)); /* ~12ns */
|
||||
EZBENCH2("-atanl", donothing, _atanl(.7)); /* ~34ns */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue