Skip to content

Commit

Permalink
feat: updated c code using stdlib_base_maxf
Browse files Browse the repository at this point in the history
  • Loading branch information
aayush0325 committed Nov 12, 2024
1 parent 2c47328 commit ccedb23
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"@stdlib/math/base/special/absf",
"@stdlib/constants/float32/max",
"@stdlib/constants/float32/eps",
"@stdlib/constants/float32/smallest-normal"
"@stdlib/constants/float32/smallest-normal",
"@stdlib/math/base/special/maxf"
]
},
{
Expand All @@ -61,7 +62,8 @@
"@stdlib/math/base/special/absf",
"@stdlib/constants/float32/max",
"@stdlib/constants/float32/eps",
"@stdlib/constants/float32/smallest-normal"
"@stdlib/constants/float32/smallest-normal",
"@stdlib/math/base/special/maxf"
]
},
{
Expand All @@ -80,7 +82,8 @@
"@stdlib/math/base/special/absf",
"@stdlib/constants/float32/max",
"@stdlib/constants/float32/eps",
"@stdlib/constants/float32/smallest-normal"
"@stdlib/constants/float32/smallest-normal",
"@stdlib/math/base/special/maxf"
]
}
]
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/math/base/special/cinvf/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "stdlib/math/base/special/cinvf.h"
#include "stdlib/math/base/special/absf.h"
#include "stdlib/math/base/special/maxf"
#include "stdlib/constants/float32/max.h"
#include "stdlib/constants/float32/eps.h"
#include "stdlib/constants/float32/smallest_normal.h"
Expand Down Expand Up @@ -70,8 +71,7 @@ stdlib_complex64_t stdlib_base_cinvf( const stdlib_complex64_t z ) {

stdlib_complex64_reim( z, &re, &im );

// TODO: replace `fmaxf` with stdlib maxf implementation once available
ab = fmaxf( stdlib_base_absf( re ), stdlib_base_absf( im ) );
ab = stdlib_base_maxf( stdlib_base_absf( re ), stdlib_base_absf( im ) );
s = 1.0f;
if ( ab >= LARGE_THRESHOLD ) {
re *= 0.5f;
Expand Down

0 comments on commit ccedb23

Please sign in to comment.