s_tan 100%

This commit is contained in:
shibbo 2023-03-02 00:09:15 -05:00
parent 83d6d024ff
commit 6888144886
6 changed files with 29 additions and 5 deletions

View File

@ -121,7 +121,7 @@ floor,s_floor.o,MSL_C.PPCEABI.bare.H.a,true
frexp,s_frexp.o,MSL_C.PPCEABI.bare.H.a,false
ldexp,s_ldexp.o,MSL_C.PPCEABI.bare.H.a,true
sin,s_sin.o,MSL_C.PPCEABI.bare.H.a,false
tan,s_tan.o,MSL_C.PPCEABI.bare.H.a,false
tan,s_tan.o,MSL_C.PPCEABI.bare.H.a,true
acos,w_acos.o,MSL_C.PPCEABI.bare.H.a,true
asin,w_asin.o,MSL_C.PPCEABI.bare.H.a,true
atan2,w_atan2.o,MSL_C.PPCEABI.bare.H.a,true

1 Symbol Name Object File Library Archive Matching
121 frexp s_frexp.o MSL_C.PPCEABI.bare.H.a false
122 ldexp s_ldexp.o MSL_C.PPCEABI.bare.H.a true
123 sin s_sin.o MSL_C.PPCEABI.bare.H.a false
124 tan s_tan.o MSL_C.PPCEABI.bare.H.a false true
125 acos w_acos.o MSL_C.PPCEABI.bare.H.a true
126 asin w_asin.o MSL_C.PPCEABI.bare.H.a true
127 atan2 w_atan2.o MSL_C.PPCEABI.bare.H.a true

View File

@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"label": "MSL",
"message": "43.127%",
"message": "43.32%",
"color": "blue"
}

View File

@ -1,3 +1,3 @@
| Library | Percentage |
| ------------- | ------------- |
| [MSL_C.PPCEABI.bare.H](https://github.com/shibbo/Petari/blob/master/libs/MSL_C/docs/lib/MSL_C.PPCEABI.bare.H.md) | 43.12716985984313% |
| [MSL_C.PPCEABI.bare.H](https://github.com/shibbo/Petari/blob/master/libs/MSL_C/docs/lib/MSL_C.PPCEABI.bare.H.md) | 43.32004629034332% |

View File

@ -56,7 +56,7 @@
| s_frexp.o | 0.0% | 0 / 1 | 0.0% | :x:
| s_ldexp.o | 100.0% | 1 / 1 | 100.0% | :white_check_mark:
| s_sin.o | 0.0% | 0 / 1 | 0.0% | :x:
| s_tan.o | 0.0% | 0 / 1 | 0.0% | :x:
| s_tan.o | 100.0% | 1 / 1 | 100.0% | :white_check_mark:
| w_acos.o | 100.0% | 1 / 1 | 100.0% | :white_check_mark:
| w_asin.o | 100.0% | 1 / 1 | 100.0% | :white_check_mark:
| w_atan2.o | 100.0% | 1 / 1 | 100.0% | :white_check_mark:
@ -433,7 +433,7 @@
# s_tan.o
| Symbol | Decompiled? |
| ------------- | ------------- |
| tan | :x: |
| tan | :white_check_mark: |
# w_acos.o

View File

@ -31,6 +31,10 @@ double __ieee754_asin(double);
double scalbn(double, int);
double __kernel_tan(double, double, int);
int __ieee754_rem_pio2(double, double *);
int __float_huge[];
int __float_nan[];

20
libs/MSL_C/source/s_tan.c Normal file
View File

@ -0,0 +1,20 @@
#include <cmath>
double tan(double x) {
double y[2], z = 0.0;
int n, ix;
ix = *(int*)&x;
ix &= 0x7FFFFFFF;
if (ix <= 0x3FE921FB) {
return __kernel_tan(x, z, 1);
}
else if (ix >= 0x7FF00000) {
return x - x;
}
else {
n = __ieee754_rem_pio2(x, y);
return __kernel_tan(y[0], y[1], 1 - ((n & 1) << 1));
}
}