mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +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(tan, test) {
|
|||
gc(xasprintf("%.15g", tan(__DBL_MIN__))));
|
||||
EXPECT_STREQ("-0.0049620158744449", gc(xasprintf("%.15g", tan(__DBL_MAX__))));
|
||||
}
|
||||
|
||||
BENCH(tan, bench) {
|
||||
double _tan(double) asm("tan");
|
||||
float _tanf(float) asm("tanf");
|
||||
long double _tanl(long double) asm("tanl");
|
||||
EZBENCH2("tan", donothing, _tan(.7)); /* ~19ns */
|
||||
EZBENCH2("tanf", donothing, _tanf(.7)); /* ~32ns */
|
||||
EZBENCH2("tanl", donothing, _tanl(.7)); /* ~28ns */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue