Skip to content

Commit

Permalink
sa fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
camilo committed Jan 25, 2024
1 parent 38e8866 commit e4f16f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/ffmath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ float ffmath::tgamma( float x )
result = getInf(); /* a huge value */
}
else if ( classification::FFP_INFINITE == fClass ) {
if ( x > 0.0f ) {
if ( x > 0.0F ) {
result = getInf(); /* a huge value */
}
else {
Expand Down Expand Up @@ -760,13 +760,13 @@ static float lgamma_positive( float x )
3.417476345507377132798597e+11F,
4.463158187419713286462081e+11F };
constexpr float pnt68 = 0.6796875F;
float result, y;
float result;

if ( x > 171.624F ) {
result = ffmath::getInf(); /* a huge value */
}
else {
float corrector, num, den;
float y, corrector, num, den;

y = x;
if ( y <= 1.19209290E-07F ) { /* y < eps */
Expand Down Expand Up @@ -860,14 +860,12 @@ float ffmath::lgamma( float x )
result = getInf();
}
else {
float y;

if ( x < 0.0F ) {
if ( x <= -4503599627370496.0F ) { /* x < 2^52 */
result = getInf();
}
else {
float a, y1, isItAnInt;
float y, y1, isItAnInt;

y = -x;
y1 = ffmath::trunc( y );
Expand All @@ -876,6 +874,8 @@ float ffmath::lgamma( float x )
result = getInf();
}
else {
float a;

a = sin( FFP_PI*isItAnInt );
result = ffmath::log( FFP_PI/ffmath::absf( a*x ) ) - lgamma_positive( -x );
}
Expand Down
2 changes: 1 addition & 1 deletion src/include/fis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ namespace qlibs {
real_t fx{ 0.0_re };
real_t h{ 0.0_re };
size_t index{ 0U };
inline size_t getIndex( void )
inline size_t getIndex( void ) const
{
return index;
}
Expand Down

0 comments on commit e4f16f3

Please sign in to comment.