Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/libs/prx/libc/src/Math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ double APS5_VABI expm1_nid_postfix(double x) { return std::expm1(x); }
float APS5_VABI expm1f_nid_postfix(float x) { return std::expm1(x); }
float APS5_VABI erff_nid_postfix(float x) { return std::erf(x); }
double APS5_VABI lgamma_nid_postfix(double x) { return std::lgamma(x); }
float APS5_VABI lgammaf_nid_postfix(float x) { return std::lgamma(x); }
double APS5_VABI tgamma_nid_postfix(double x) { return std::tgamma(x); }
float APS5_VABI tgammaf_nid_postfix(float x) { return std::tgamma(x); }

float APS5_VABI sinf_nid_postfix(float x) { return std::sin(x); }
float APS5_VABI cosf_nid_postfix(float x) { return std::cos(x); }
Expand Down
10 changes: 10 additions & 0 deletions core/libs/tests/GuestMath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ double APS5_VABI expm1_nid_postfix(double);
float APS5_VABI expm1f_nid_postfix(float);
float APS5_VABI erff_nid_postfix(float);
double APS5_VABI lgamma_nid_postfix(double);
float APS5_VABI lgammaf_nid_postfix(float);
double APS5_VABI tgamma_nid_postfix(double);
float APS5_VABI tgammaf_nid_postfix(float);
float APS5_VABI logbf_nid_postfix(float);
double APS5_VABI exp2_nid_postfix(double);
float APS5_VABI __powisf2_nid_postfix(float, int);
Expand Down Expand Up @@ -711,6 +714,13 @@ int main() {
Require(lgamma_nid_postfix(1.) == 0. && lgamma_nid_postfix(2.) == 0. && std::isinf(lgamma_nid_postfix(0.)));
Require(std::abs(lgamma_nid_postfix(0.5) - 0.5723649429247001) < 1e-15 && std::abs(lgamma_nid_postfix(10.) - 12.801827480081469) < 1e-13);
Require(std::abs(lgamma_nid_postfix(-0.5) - 1.2655121234846454) < 1e-15);
Require(lgammaf_nid_postfix(1.f) == 0.f && lgammaf_nid_postfix(2.f) == 0.f && std::isinf(lgammaf_nid_postfix(0.f)));
Require(std::abs(lgammaf_nid_postfix(0.5f) - 0.57236494f) < 1e-6f && std::abs(lgammaf_nid_postfix(10.f) - 12.801827f) < 1e-4f);
Require(std::abs(lgammaf_nid_postfix(-0.5f) - 1.2655121f) < 1e-6f);
Require(tgamma_nid_postfix(1.) == 1. && tgamma_nid_postfix(2.) == 1. && tgamma_nid_postfix(3.) == 2. && tgamma_nid_postfix(4.) == 6.);
Require(std::abs(tgamma_nid_postfix(0.5) - 1.772453850905516) < 1e-15 && std::isnan(tgamma_nid_postfix(-1.)));
Require(tgammaf_nid_postfix(1.f) == 1.f && tgammaf_nid_postfix(2.f) == 1.f && tgammaf_nid_postfix(3.f) == 2.f && tgammaf_nid_postfix(4.f) == 6.f);
Require(std::abs(tgammaf_nid_postfix(0.5f) - 1.7724538f) < 1e-6f && std::isnan(tgammaf_nid_postfix(-1.f)));
Require(llroundl_nid_postfix(2.5L) == 3 && llroundl_nid_postfix(-2.5L) == -3 && llroundl_nid_postfix(0.49999999999999999L) == 0);
Require(llroundl_nid_postfix(9007199254740993.0L) == 9007199254740993LL && llroundl_nid_postfix(-1e30L) == INT64_MIN);
Require(logbf_nid_postfix(8.f) == 3.f && logbf_nid_postfix(-0.75f) == -1.f);
Expand Down
Loading