stdlib-js/stdlib

[RFC]: Add C implementations to base special math functions (tracking issue)

kgryte opened this issue ยท 8 comments

Description

This RFC proposes adding C implementations to all base special math functions. The purpose of this issue is to serve as a tracking issue for adding C implementations.

Packages

  • abs
  • abs2
  • abs2f
  • absf
  • acos
  • acosd
  • acosh
  • acot
  • acotd
  • acoth
  • acovercos
  • acoversin
  • acsc
  • acscd
  • acsch
  • ahavercos
  • ahaversin
  • asec
  • asecd
  • asech
  • asin
  • asind
  • asinf
  • asinh
  • atan
  • atan2
  • atand
  • atanh
  • avercos
  • aversin
  • bernoulli
  • besselj0
  • besselj1
  • bessely0
  • bessely1
  • beta
  • betainc
  • betaincinv
  • betaln
  • binet
  • binomcoef
  • binomcoefln
  • boxcox
  • boxcox1p
  • boxcox1pinv
  • boxcoxinv
  • cabs
  • cabs2
  • cabs2f
  • cabsf
  • cbrt
  • cbrtf
  • cceil
  • cceilf
  • cceiln
  • ccis
  • ceil
  • ceil10
  • ceil2
  • ceilb
  • ceilf
  • ceiln
  • ceilsd
  • cexp
  • cflipsign
  • cflipsignf
  • cfloor
  • cfloorn
  • cidentity
  • cidentityf
  • cinv
  • clamp
  • clampf
  • copysign
  • copysignf
  • cos
  • cosd
  • cosh
  • cosm1
  • cospi
  • cot
  • cotd
  • coth
  • covercos
  • coversin
  • cphase
  • cpolar
  • cround
  • croundn
  • csc
  • cscd
  • csch
  • csignum
  • deg2rad
  • deg2radf
  • digamma
  • dirac-delta
  • dirichlet-eta
  • docs
  • ellipe
  • ellipj
  • ellipk
  • erf
  • erfc
  • erfcinv
  • erfcx
  • erfinv
  • examples
  • exp
  • exp10
  • exp2
  • expit
  • expm1
  • expm1rel
  • factorial
  • factorial2
  • factorialln
  • falling-factorial
  • fast
  • fibonacci
  • fibonacci-index
  • flipsign
  • flipsignf
  • floor
  • floor10
  • floor2
  • floorb
  • floorf
  • floorn
  • floorsd
  • fresnel
  • fresnelc
  • fresnels
  • frexp
  • gamma
  • gamma-delta-ratio
  • gamma-lanczos-sum
  • gamma-lanczos-sum-expg-scaled
  • gamma1pm1
  • gammainc
  • gammaincinv
  • gammaln
  • gammasgn
  • gcd
  • hacovercos
  • hacoversin
  • havercos
  • haversin
  • heaviside
  • hypot
  • hypotf
  • identity
  • identityf
  • inv
  • invf
  • kernel-betainc
  • kernel-betaincinv
  • kernel-cos
  • kernel-sin
  • kernel-tan
  • kronecker-delta
  • kronecker-deltaf
  • labs
  • lcm
  • ldexp
  • lib
  • ln
  • log
  • log10
  • log1mexp
  • log1p
  • log1pexp
  • log1pmx
  • log2
  • logaddexp
  • logit
  • lucas
  • max
  • maxabs
  • maxabsn
  • maxn
  • min
  • minabs
  • minabsn
  • minmax
  • minmaxabs
  • minmaxabsn
  • minmaxn
  • minn
  • modf
  • negafibonacci
  • negalucas
  • nonfibonacci
  • pdiff
  • pdifff
  • polygamma
  • pow
  • powm1
  • rad2deg
  • ramp
  • rampf
  • rcbrt
  • rempio2
  • riemann-zeta
  • rising-factorial
  • round
  • round10
  • round2
  • roundb
  • roundn
  • roundsd
  • rsqrt
  • rsqrtf
  • secd
  • sici
  • signum
  • signumf
  • sin
  • sinc
  • sincos
  • sincospi
  • sinh
  • sinpi
  • spence
  • sqrt
  • sqrt1pm1
  • sqrtf
  • sqrtpi
  • tan
  • tand
  • tanh
  • test
  • tribonacci
  • trigamma
  • trunc
  • trunc10
  • trunc2
  • truncb
  • truncf
  • truncn
  • truncsd
  • vercos
  • versin
  • wrap
  • xlog1py
  • xlogy

Related Issues

None.

Questions

No.

Other

No.

Checklist

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.

@kgryte I would like to work on this.

@Pratik772846 I suggest picking one of the associated RFCs for updating a single package. This is a tracking issue.

@Pranavchiku As you've been managing a number of the RFCs and PRs, would you mind updating the OP to match the current state of implementations?

I am not sure if this can be closed now, reopening this.

@Pranavchiku Yeah, I think GitHub unfortunately auto-closes it when we have a PR where the opening comment includes "Fixes #649" or something of the sort. Thanks for opening again!

But I see that I accidentally included "Closes #649" in the merge commit message. Will avoid and see whether that solves it going forward.

No worries, we can open it anytime so that is fine. Updated tracker to latest main.

Small script, not sure if it traps all cases. There can be false negatives but no false positives.

set -ex

# iterate over all folder in <.../math/base/special/*>
for d in <path>; do
  # if the folder is a directory
  if [ -d "$d" ]; then
	# get the name of the folder
	folder=$(basename $d)
	# check if it has `manifest.json` file
	if [ -f "$d/manifest.json" ]; then
		# if it has `manifest.json` file, then open it as j_, lookup js_[confs][dependencies] and see if it has "@stdlib/math/base/napi/unary"
		# if it has "@stdlib/math/base/napi/unary" then add it to the `names.md`
		jq -r '.jsdoc.confs.dependencies["@stdlib/math/base/napi/unary"]' $d/manifest.json
		if [ $? -eq 0 ]; then
			echo "- [x] $folder" >> names.md
		else
			echo "- [ ] $folder" >> names.md
		fi
	else
		echo "- [ ] $folder" >> names.md
	fi
  fi
done

@Planeshifter You should always check the PR OP to ensure it properly links to issues and does not auto-close tracking issues. I often correct contributor PR OPs as they commonly include errors, including linking to incorrect issues or closing tracking issues.

Updated as per latest develop