mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-24 14:22: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"
|
||||
|
||||
|
@ -43,3 +44,12 @@ TEST(cos, test) {
|
|||
gc(xasprintf("%.15g", cos(-1.0000000000000002))));
|
||||
EXPECT_STREQ("1", gc(xasprintf("%.15g", cos(-2.1073424255447e-08))));
|
||||
}
|
||||
|
||||
BENCH(cos, bench) {
|
||||
double _cos(double) asm("cos");
|
||||
float _cosf(float) asm("cosf");
|
||||
long double _cosl(long double) asm("cosl");
|
||||
EZBENCH2("cos", donothing, _cos(.7)); /* ~6ns */
|
||||
EZBENCH2("cosf", donothing, _cosf(.7)); /* ~5ns */
|
||||
EZBENCH2("cosl", donothing, _cosl(.7)); /* ~28ns */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue