diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index dab5d2a6..00000000 --- a/.editorconfig +++ /dev/null @@ -1,180 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = true # Note: this disables using two spaces to force a hard line break, which is permitted in Markdown. As we don't typically follow that practice (TMK), we should be safe to automatically trim. - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f302863..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69c..00000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# Configure directories which should *not* be included in GitHub language statistics: -/deps/** linguist-vendored -/dist/** linguist-generated -/workshops/** linguist-vendored - -benchmark/** linguist-vendored -docs/* linguist-documentation -etc/** linguist-vendored -examples/** linguist-documentation -scripts/** linguist-vendored -test/** linguist-vendored -tools/** linguist-vendored - -# Configure files which should *not* be included in GitHub language statistics: -Makefile linguist-vendored -*.mk linguist-vendored -*.jl linguist-vendored -*.py linguist-vendored -*.R linguist-vendored - -# Configure files which should be included in GitHub language statistics: -docs/types/*.d.ts -linguist-documentation diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index bd3b072d..00000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2026-03-16T01:40:45.153Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 20cf9ce2..00000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/complex) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/contributing/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fed..00000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db6..00000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ac831b91..00000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/complex) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 29849010..00000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 4c2caa75..00000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '48 12 * * 1' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index 83d50c46..00000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,821 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - node -e "var pkg = require( './package.json' ); pkg.dependencies[ '@stdlib/error-tools-fmtprodmsg' ] = '^$PKG_VERSION'; require( 'fs' ).writeFileSync( 'package.json', JSON.stringify( pkg, null, 2 ) );" - fi - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send notification to Zulip if job fails: - - name: 'Send notification to Zulip in case of failure' - # Pin action to full length commit SHA - uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2 - if: failure() - with: - api-key: ${{ secrets.ZULIP_API_KEY }} - email: 'github-actions-bot@stdlib.zulipchat.com' - organization-url: 'https://stdlib.zulipchat.com' - to: 'workflows-standalone' - type: 'stream' - topic: ${{ github.event.repository.name }} - content: | - :cross_mark: **${{ github.workflow }}** workflow failed - - **Repository:** [${{ github.repository }}](${{ github.server_url }}/${{ github.repository }}) - **Run:** [View workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -143,7 +140,7 @@ console.log( objectKeys( ns ) ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4ca..00000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/base/README.md b/base/README.md deleted file mode 100644 index cacaa4b4..00000000 --- a/base/README.md +++ /dev/null @@ -1,114 +0,0 @@ - - -# Base Complex - -> Base (i.e., lower-level) complex number functions. - -
- -## Usage - -```javascript -var complex = require( '@stdlib/complex/base' ); -``` - -#### complex - -Namespace containing "base" (i.e., lower-level) complex number functions. - -```javascript -var ns = complex; -// returns {...} -``` - -The namespace contains the following functions: - - - -
- -- [`assert`][@stdlib/complex/base/assert]: base (i.e., lower-level) complex number assertion functions. -- [`cast( fcn, nargs, ctor )`][@stdlib/complex/base/cast-return]: wrap a function and cast a function's return value to a complex number. -- [`parse( str )`][@stdlib/complex/base/parse]: parses a string representing a complex number into a complex like object `{re: number, im: number}`. -- [`wrap( fcn, nargs, ctor )`][@stdlib/complex/base/wrap-function]: wrap a function accepting complex number arguments to support providing both real and complex numbers. - -
- - - -
- - - - - -
- -
- - - -
- -## Examples - - - - - -```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/complex/base' ); - -console.log( objectKeys( ns ) ); -``` - -
- - - - - - - - - - - - - - diff --git a/base/assert/README.md b/base/assert/README.md deleted file mode 100644 index e7e37d44..00000000 --- a/base/assert/README.md +++ /dev/null @@ -1,108 +0,0 @@ - - -# Assert - -> Base (i.e., lower-level) complex number assertion functions. - -
- -## Usage - -```javascript -var assert = require( '@stdlib/complex/base/assert' ); -``` - -#### assert - -Namespace containing base (i.e., lower-level) complex number assertion functions. - -```javascript -var ns = assert; -// returns {...} -``` - -The namespace contains the following functions: - - - -
- -- [`isAlmostEqual( z1, z2, maxULP )`][@stdlib/complex/base/assert/is-almost-equal]: test whether two complex numbers are approximately equal within a specified number of ULPs (units in the last place). -- [`isAlmostSameValue( z1, z2, maxULP )`][@stdlib/complex/base/assert/is-almost-same-value]: test whether two complex numbers are approximately the same value within a specified number of ULPs (units in the last place). - -
- - - -
- - - - - -
- -
- - - -
- -## Examples - - - - - -```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/complex/base/assert' ); - -console.log( objectKeys( ns ) ); -``` - -
- - - - - - - - - - - - - - diff --git a/base/assert/docs/types/index.d.ts b/base/assert/docs/types/index.d.ts deleted file mode 100644 index 3fe5c1a1..00000000 --- a/base/assert/docs/types/index.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/* eslint-disable max-lines */ - -import isAlmostEqual = require( './../../../../base/assert/is-almost-equal' ); -import isAlmostSameValue = require( './../../../../base/assert/is-almost-same-value' ); - -/** -* Interface describing the `assert` namespace. -*/ -interface Namespace { - /** - * Tests whether two complex numbers are approximately equal within a specified number of ULPs (units in the last place). - * - * ## Notes - * - * - The function returns `false` if either input value has a `NaN` real or imaginary component. - * - The function does not distinguish between `-0` and `+0`, treating them as equal. - * - * @param z1 - first complex number - * @param z2 - second complex number - * @param maxULP - maximum allowed ULP difference - * @returns boolean indicating whether two complex numbers are approximately equal within a specified number of ULPs - * - * @example - * var EPS = require( '@stdlib/constants/float64/eps' ); - * var Complex128 = require( './../../../../float64/ctor' ); - * - * var z1 = new Complex128( 1.0, 3.0 ); - * var z2 = new Complex128( 1.0+EPS, 3.0 ); - * - * var bool = ns.isAlmostEqual( z1, z2, 0 ); - * // returns false - * - * bool = ns.isAlmostEqual( z1, z2, 1 ); - * // returns true - */ - isAlmostEqual: typeof isAlmostEqual; - - /** - * Tests whether two complex numbers are approximately the same value within a specified number of ULPs (units in the last place). - * - * ## Notes - * - * - The function differs from the `===` operator in that the function treats `-0` and `+0` as distinct and `NaNs` as the same. - * - * @param z1 - first complex number - * @param z2 - second complex number - * @param maxULP - maximum allowed ULP difference - * @returns boolean indicating whether two complex numbers are approximately the same value within a specified number of ULPs - * - * @example - * var EPS = require( '@stdlib/constants/float64/eps' ); - * var Complex128 = require( './../../../../float64/ctor' ); - * - * var z1 = new Complex128( 1.0, 3.0 ); - * var z2 = new Complex128( 1.0+EPS, 3.0 ); - * - * var bool = ns.isAlmostSameValue( z1, z2, 0 ); - * // returns false - * - * bool = ns.isAlmostSameValue( z1, z2, 1 ); - * // returns true - */ - isAlmostSameValue: typeof isAlmostSameValue; -} - -/** -* Base (i.e., lower-level) complex number assertion functions. -*/ -declare var ns: Namespace; - - -// EXPORTS // - -export = ns; diff --git a/base/assert/docs/types/test.ts b/base/assert/docs/types/test.ts deleted file mode 100644 index 1a38cb7d..00000000 --- a/base/assert/docs/types/test.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable @typescript-eslint/no-unused-expressions */ - -import ns = require( './index' ); - - -// TESTS // - -// The exported value is the expected interface... -{ - ns; // $ExpectType Namespace -} diff --git a/base/assert/examples/index.js b/base/assert/examples/index.js deleted file mode 100644 index f5349d26..00000000 --- a/base/assert/examples/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - -console.log( objectKeys( ns ) ); diff --git a/base/assert/is-almost-equal/README.md b/base/assert/is-almost-equal/README.md deleted file mode 100644 index d9f474c6..00000000 --- a/base/assert/is-almost-equal/README.md +++ /dev/null @@ -1,159 +0,0 @@ - - -# isAlmostEqual - -> Test whether two complex numbers are approximately equal within a specified number of ULPs (units in the last place). - - - -
- -
- - - - - -
- -## Usage - -```javascript -var isAlmostEqual = require( '@stdlib/complex/base/assert/is-almost-equal' ); -``` - -#### isAlmostEqual( z1, z2, maxULP ) - -Tests whether two complex numbers are approximately equal within a specified number of ULPs (units in the last place). - -```javascript -var EPS = require( '@stdlib/constants/float64/eps' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( 1.0, 3.0 ); -var z2 = new Complex128( 1.0+EPS, 3.0 ); - -var out = isAlmostEqual( z1, z2, 0 ); -// returns false - -out = isAlmostEqual( z1, z2, 1 ); -// returns true -``` - -The function returns `false` if either input value has a `NaN` real or imaginary component. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z1 = new Complex64( NaN, 3.0 ); -var z2 = new Complex64( 1.0, 3.0 ); - -var out = isAlmostEqual( z1, z2, 1 ); -// returns false - -out = isAlmostEqual( z2, z1, 1 ); -// returns false - -z1 = new Complex64( NaN, NaN ); -z2 = new Complex64( NaN, NaN ); - -out = isAlmostEqual( z1, z2, 1 ); -// returns false -``` - -The function does not distinguish between `-0` and `+0`, treating them as equal. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z1 = new Complex128( 0.0, 0.0 ); -var z2 = new Complex64( -0.0, -0.0 ); - -var out = isAlmostEqual( z1, z2, 0 ); -// returns true -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var EPS = require( '@stdlib/constants/float64/eps' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isAlmostEqual = require( '@stdlib/complex/base/assert/is-almost-equal' ); - -var z1 = new Complex128( 1.0, 3.0+EPS ); -var z2 = new Complex128( 1.0+EPS, 3.0 ); -console.log( isAlmostEqual( z1, z2, 1 ) ); -// => true - -z1 = new Complex128( 1.0, 3.0+EPS ); -z2 = new Complex128( 1.0+EPS+EPS, 3.0 ); -console.log( isAlmostEqual( z1, z2, 1 ) ); -// => false - -z1 = new Complex128( 0.0, 0.0 ); -z2 = new Complex128( -0.0, 0.0 ); -console.log( isAlmostEqual( z1, z2, 0 ) ); -// => true - -z1 = new Complex128( NaN, 0.0 ); -z2 = new Complex128( 1.0, 0.0 ); -console.log( isAlmostEqual( z1, z2, 1 ) ); -// => false -``` - -
- - - - - - - - - - - - - - diff --git a/base/assert/is-almost-equal/benchmark/benchmark.js b/base/assert/is-almost-equal/benchmark/benchmark.js deleted file mode 100644 index 2d3a8a80..00000000 --- a/base/assert/is-almost-equal/benchmark/benchmark.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex128 = require( './../../../../float64/ctor' ); -var Complex64 = require( './../../../../float32/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var isAlmostEqual = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var z1; - var z2; - var v; - var i; - - z1 = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ), - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ) - ]; - z2 = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ), - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ), - z1[ 0 ], - z1[ 1 ] - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = isAlmostEqual( z1[ i%z1.length ], z2[ i%z2.length ], 1 ); - if ( typeof v !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( v ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/base/assert/is-almost-equal/docs/repl.txt b/base/assert/is-almost-equal/docs/repl.txt deleted file mode 100644 index 91750a00..00000000 --- a/base/assert/is-almost-equal/docs/repl.txt +++ /dev/null @@ -1,45 +0,0 @@ - -{{alias}}( z1, z2, maxULP ) - Tests whether two complex numbers are approximately equal within a specified - number of ULPs (units in the last - place). - - The function returns `false` if either input value has a `NaN` real or - imaginary component. - - The function does not distinguish between `-0` and `+0`, treating them as - equal. - - Parameters - ---------- - z1: ComplexLike - First complex number. - - z2: ComplexLike - Second complex number. - - maxULP: number - Maximum allowed ULP difference. - - Returns - ------- - out: boolean - Boolean indicating whether two complex numbers are approximately equal - within a specified number of ULPs. - - Examples - -------- - > var re1 = 1.0; - > var im1 = 3.0; - > var re2 = 1.0 + {{alias:@stdlib/constants/float64/eps}}; - > var im2 = 3.0; - > var z1 = new {{alias:@stdlib/complex/float64/ctor}}( re1, im1 ); - > var z2 = new {{alias:@stdlib/complex/float64/ctor}}( re2, im2 ); - > var v = {{alias}}( z1, z2, 0 ) - false - > v = {{alias}}( z1, z2, 1 ) - true - - See Also - -------- - diff --git a/base/assert/is-almost-equal/docs/types/index.d.ts b/base/assert/is-almost-equal/docs/types/index.d.ts deleted file mode 100644 index 96d74075..00000000 --- a/base/assert/is-almost-equal/docs/types/index.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { ComplexLike } from '@stdlib/types/complex'; - -/** -* Tests whether two complex numbers are approximately equal within a specified number of ULPs (units in the last place). -* -* ## Notes -* -* - The function returns `false` if either input value has a `NaN` real or imaginary component. -* - The function does not distinguish between `-0` and `+0`, treating them as equal. -* -* @param z1 - first complex number -* @param z2 - second complex number -* @param maxULP - maximum allowed ULP difference -* @returns boolean indicating whether two complex numbers are approximately equal within a specified number of ULPs -* -* @example -* var EPS = require( '@stdlib/constants/float64/eps' ); -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 1.0, 3.0 ); -* var z2 = new Complex128( 1.0+EPS, 3.0 ); -* -* var bool = isAlmostEqual( z1, z2, 0 ); -* // returns false -* -* bool = isAlmostEqual( z1, z2, 1 ); -* // returns true -*/ -declare function isAlmostEqual( z1: ComplexLike, z2: ComplexLike, maxULP: number ): boolean; - - -// EXPORTS // - -export = isAlmostEqual; diff --git a/base/assert/is-almost-equal/docs/types/test.ts b/base/assert/is-almost-equal/docs/types/test.ts deleted file mode 100644 index 11fb39bb..00000000 --- a/base/assert/is-almost-equal/docs/types/test.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../../float64/ctor' ); -import isAlmostEqual = require( './index' ); - - -// TESTS // - -// The function returns a boolean... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isAlmostEqual( z1, z2, 1 ); // $ExpectType boolean -} - -// The compiler throws an error if the function is provided a first argument that is not a complex number... -{ - const z2 = new Complex128( 5.0, 3.0 ); - - isAlmostEqual( 'abc', z2, 1 ); // $ExpectError - isAlmostEqual( 123, z2, 1 ); // $ExpectError - isAlmostEqual( true, z2, 1 ); // $ExpectError - isAlmostEqual( false, z2, 1 ); // $ExpectError - isAlmostEqual( [], z2, 1 ); // $ExpectError - isAlmostEqual( {}, z2, 1 ); // $ExpectError - isAlmostEqual( ( x: number ): number => x, z2, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a complex number... -{ - const z1 = new Complex128( 5.0, 3.0 ); - - isAlmostEqual( z1, 'abc', 1 ); // $ExpectError - isAlmostEqual( z1, 123, 1 ); // $ExpectError - isAlmostEqual( z1, true, 1 ); // $ExpectError - isAlmostEqual( z1, false, 1 ); // $ExpectError - isAlmostEqual( z1, [], 1 ); // $ExpectError - isAlmostEqual( z1, {}, 1 ); // $ExpectError - isAlmostEqual( z1, ( x: number ): number => x, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a third argument that is not a number... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isAlmostEqual( z1, z2, 'abc' ); // $ExpectError - isAlmostEqual( z1, z2, true ); // $ExpectError - isAlmostEqual( z1, z2, false ); // $ExpectError - isAlmostEqual( z1, z2, null ); // $ExpectError - isAlmostEqual( z1, z2, void 0 ); // $ExpectError - isAlmostEqual( z1, z2, [] ); // $ExpectError - isAlmostEqual( z1, z2, {} ); // $ExpectError - isAlmostEqual( z1, z2, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isAlmostEqual(); // $ExpectError - isAlmostEqual( z1 ); // $ExpectError - isAlmostEqual( z1, z2 ); // $ExpectError - isAlmostEqual( z1, z2, 1, 1 ); // $ExpectError -} diff --git a/base/assert/is-almost-equal/examples/index.js b/base/assert/is-almost-equal/examples/index.js deleted file mode 100644 index f343bd1c..00000000 --- a/base/assert/is-almost-equal/examples/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var EPS = require( '@stdlib/constants/float64/eps' ); -var Complex128 = require( './../../../../float64/ctor' ); -var isAlmostEqual = require( './../lib' ); - -var z1 = new Complex128( 1.0, 3.0+EPS ); -var z2 = new Complex128( 1.0+EPS, 3.0 ); -console.log( isAlmostEqual( z1, z2, 1 ) ); -// => true - -z1 = new Complex128( 1.0, 3.0+EPS ); -z2 = new Complex128( 1.0+EPS+EPS, 3.0 ); -console.log( isAlmostEqual( z1, z2, 1 ) ); -// => false - -z1 = new Complex128( 0.0, 0.0 ); -z2 = new Complex128( -0.0, 0.0 ); -console.log( isAlmostEqual( z1, z2, 0 ) ); -// => true - -z1 = new Complex128( NaN, 0.0 ); -z2 = new Complex128( 1.0, 0.0 ); -console.log( isAlmostEqual( z1, z2, 1 ) ); -// => false diff --git a/base/assert/is-almost-equal/lib/index.js b/base/assert/is-almost-equal/lib/index.js deleted file mode 100644 index 7da38ed8..00000000 --- a/base/assert/is-almost-equal/lib/index.js +++ /dev/null @@ -1,48 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Test whether two complex numbers are approximately equal within a specified number of ULPs (units in the last place). -* -* @module @stdlib/complex/base/assert/is-almost-equal -* -* @example -* var EPS = require( '@stdlib/constants/float64/eps' ); -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var isAlmostEqual = require( '@stdlib/complex/base/assert/is-almost-equal' ); -* -* var z1 = new Complex128( 1.0, 3.0 ); -* var z2 = new Complex128( 1.0+EPS, 3.0 ); -* -* var bool = isAlmostEqual( z1, z2, 0 ); -* // returns false -* -* bool = isAlmostEqual( z1, z2, 1 ); -* // returns true -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/base/assert/is-almost-equal/lib/main.js b/base/assert/is-almost-equal/lib/main.js deleted file mode 100644 index 71ed3304..00000000 --- a/base/assert/is-almost-equal/lib/main.js +++ /dev/null @@ -1,89 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var isAlmostEqualF64 = require( '@stdlib/number/float64/base/assert/is-almost-equal' ); -var isAlmostEqualF32 = require( '@stdlib/number/float32/base/assert/is-almost-equal' ); -var reim = require( './../../../../float64/reim' ); -var reimf = require( './../../../../float32/reim' ); - - -// MAIN // - -/** -* Tests whether two complex numbers are approximately equal within a specified number of ULPs (units in the last place). -* -* ## Notes -* -* - The function returns `false` if either input value has a `NaN` real or imaginary component. -* - The function does not distinguish between `-0` and `+0`, treating them as equal. -* -* @param {ComplexLike} z1 - first complex number -* @param {ComplexLike} z2 - second complex number -* @param {number} maxULP - maximum allowed ULP difference -* @returns {boolean} boolean indicating whether two complex numbers are approximately equal within a specified number of ULPs -* -* @example -* var EPS = require( '@stdlib/constants/float64/eps' ); -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 1.0, 3.0 ); -* var z2 = new Complex128( 1.0+EPS, 3.0 ); -* -* var bool = isAlmostEqual( z1, z2, 0 ); -* // returns false -* -* bool = isAlmostEqual( z1, z2, 1 ); -* // returns true -*/ -function isAlmostEqual( z1, z2, maxULP ) { - var parts1; - var parts2; - var nb1; - var nb2; - var f; - - // Complex-like values will not, in general, have these properties, but complex instances will, thus allowing us to distinguish between complex number data types without expensive constructor checks, including when given cross-realm complex number instances: - nb1 = z1.BYTES_PER_ELEMENT; - nb2 = z2.BYTES_PER_ELEMENT; - - // Case: isAlmostEqual( complex64, complex64 ) - if ( nb1 === 4 && nb2 === 4 ) { - f = isAlmostEqualF32; - parts1 = reimf( z1 ); - parts2 = reimf( z2 ); - } - // Case: isAlmostEqual( complexLike, complexLike ) - else { - f = isAlmostEqualF64; - parts1 = reim( z1 ); - parts2 = reim( z2 ); - } - return ( - f( parts1[ 0 ], parts2[ 0 ], maxULP ) && - f( parts1[ 1 ], parts2[ 1 ], maxULP ) - ); -} - - -// EXPORTS // - -module.exports = isAlmostEqual; diff --git a/base/assert/is-almost-equal/package.json b/base/assert/is-almost-equal/package.json deleted file mode 100644 index 01babe5d..00000000 --- a/base/assert/is-almost-equal/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "@stdlib/complex/base/assert/is-almost-equal", - "version": "0.0.0", - "description": "Test whether two complex numbers are approximately equal within a specified number of ULPs (units in the last place).", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "number", - "base", - "assert", - "test", - "validate", - "equality", - "compare", - "comparison", - "equal", - "eq", - "same", - "issame", - "isequal", - "isalmostequal" - ] -} diff --git a/base/assert/is-almost-equal/test/test.js b/base/assert/is-almost-equal/test/test.js deleted file mode 100644 index 5abc0015..00000000 --- a/base/assert/is-almost-equal/test/test.js +++ /dev/null @@ -1,217 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex128 = require( './../../../../float64/ctor' ); -var Complex64 = require( './../../../../float32/ctor' ); -var FLOAT64_EPS = require( '@stdlib/constants/float64/eps' ); -var FLOAT32_EPS = require( '@stdlib/constants/float32/eps' ); -var isAlmostEqual = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof isAlmostEqual, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns `false` if provided `NaN` as either real or imaginary component (float64)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( NaN, 3.14 ); - z2 = new Complex128( 5.0, 3.14 ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), false, 'returns expected value' ); - - z2 = new Complex128( 5.0, NaN ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), false, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `false` if provided `NaN` as either real or imaginary component (float32)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( NaN, 3.14 ); - z2 = new Complex64( 5.0, 3.14 ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), false, 'returns expected value' ); - - z2 = new Complex64( 5.0, NaN ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), false, 'returns expected value' ); - - z1 = new Complex64( NaN, NaN ); - z2 = new Complex64( NaN, NaN ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if provided two complex numbers which are the same value irrespective of the specified number of ULPs (float64)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z1, 0 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), true, 'returns expected value' ); - - z1 = new Complex128( -5.0, -3.0 ); - z2 = new Complex128( -5.0, -3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 0 ), true, 'returns expected value' ); - - z1 = new Complex128( 0.0, 0.0 ); - z2 = new Complex128( 0.0, 0.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 0 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if provided two complex numbers which are the same value irrespective of the specified number of ULPs (float32)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z1, 0 ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), true, 'returns expected value' ); - - z1 = new Complex64( -5.0, -3.0 ); - z2 = new Complex64( -5.0, -3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 0 ), true, 'returns expected value' ); - - z1 = new Complex64( 0.0, 0.0 ); - z2 = new Complex64( 0.0, 0.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 0 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if provided two complex numbers which are approximately equal within a specified number of ULPs (float64)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 1.0, 3.0 ); - z2 = new Complex128( 1.0+FLOAT64_EPS, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), true, 'returns expected value' ); - - z2 = new Complex128( 1.0+FLOAT64_EPS+FLOAT64_EPS, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 2 ), true, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 2 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if provided two complex numbers which are approximately equal within a specified number of ULPs (float32)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 1.0, 3.0 ); - z2 = new Complex64( 1.0+FLOAT32_EPS, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), true, 'returns expected value' ); - - z2 = new Complex64( 1.0+FLOAT32_EPS+FLOAT32_EPS, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 2 ), true, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 2 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `false` if provided two complex numbers which are not approximately equal within a specified number of ULPs (float64)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 1.0, 3.0 ); - z2 = new Complex128( 1.0+FLOAT64_EPS, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 0 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 0 ), false, 'returns expected value' ); - - z2 = new Complex128( 1.0+FLOAT64_EPS+FLOAT64_EPS, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `false` if provided two complex numbers which are not approximately equal within a specified number of ULPs (float32)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 1.0, 3.0 ); - z2 = new Complex64( 1.0+FLOAT32_EPS, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 0 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 0 ), false, 'returns expected value' ); - - z2 = new Complex64( 1.0+FLOAT32_EPS+FLOAT32_EPS, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if signed zeros are provided as real or imaginary components irrespective of the specified number of ULPs (float64)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 0.0, 0.0 ); - z2 = new Complex128( -0.0, -0.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 0 ), true, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 0 ), true, 'returns expected value' ); - - t.strictEqual( isAlmostEqual( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if signed zeros are provided as real or imaginary components irrespective of the specified number of ULPs (float32)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 0.0, 0.0 ); - z2 = new Complex64( -0.0, -0.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 0 ), true, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 0 ), true, 'returns expected value' ); - - t.strictEqual( isAlmostEqual( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/base/assert/is-almost-same-value/README.md b/base/assert/is-almost-same-value/README.md deleted file mode 100644 index e9d4a4ca..00000000 --- a/base/assert/is-almost-same-value/README.md +++ /dev/null @@ -1,159 +0,0 @@ - - -# isAlmostSameValue - -> Test whether two complex numbers are approximately the same value within a specified number of ULPs (units in the last place). - - - -
- -
- - - - - -
- -## Usage - -```javascript -var isAlmostSameValue = require( '@stdlib/complex/base/assert/is-almost-same-value' ); -``` - -#### isAlmostSameValue( z1, z2, maxULP ) - -Tests whether two complex numbers are approximately the same value within a specified number of ULPs (units in the last place). - -```javascript -var EPS = require( '@stdlib/constants/float64/eps' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( 1.0, 3.0 ); -var z2 = new Complex128( 1.0+EPS, 3.0 ); - -var out = isAlmostSameValue( z1, z2, 0 ); -// returns false - -out = isAlmostSameValue( z1, z2, 1 ); -// returns true -``` - -In contrast to the strict equality operator `===`, the function distinguishes between `+0` and `-0` and treats `NaNs` as the same value. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z1 = new Complex64( NaN, 3.0 ); -var z2 = new Complex64( 1.0, 3.0 ); - -var out = isAlmostSameValue( z1, z2, 1 ); -// returns false - -out = isAlmostSameValue( z2, z1, 1 ); -// returns false - -z1 = new Complex64( NaN, NaN ); -z2 = new Complex64( NaN, NaN ); - -out = isAlmostSameValue( z1, z2, 1 ); -// returns true - -z1 = new Complex128( 0.0, 0.0 ); -z2 = new Complex64( -0.0, -0.0 ); - -out = isAlmostSameValue( z1, z2, 0 ); -// returns false -``` - -
- - - - - -
- -## Notes - -- The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm] as specified in ECMAScript 5. - -
- - - - - -
- -## Examples - - - -```javascript -var EPS = require( '@stdlib/constants/float64/eps' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isAlmostSameValue = require( '@stdlib/complex/base/assert/is-almost-same-value' ); - -var z1 = new Complex128( 1.0, 3.0+EPS ); -var z2 = new Complex128( 1.0+EPS, 3.0 ); -console.log( isAlmostSameValue( z1, z2, 1 ) ); -// => true - -z1 = new Complex128( 1.0, 3.0+EPS ); -z2 = new Complex128( 1.0+EPS+EPS, 3.0 ); -console.log( isAlmostSameValue( z1, z2, 1 ) ); -// => false - -z1 = new Complex128( 0.0, 0.0 ); -z2 = new Complex128( -0.0, 0.0 ); -console.log( isAlmostSameValue( z1, z2, 0 ) ); -// => false - -z1 = new Complex128( NaN, 0.0 ); -z2 = new Complex128( 1.0, 0.0 ); -console.log( isAlmostSameValue( z1, z2, 1 ) ); -// => false -``` - -
- - - - - - - - - - - - - - diff --git a/base/assert/is-almost-same-value/benchmark/benchmark.js b/base/assert/is-almost-same-value/benchmark/benchmark.js deleted file mode 100644 index 22d5c5b4..00000000 --- a/base/assert/is-almost-same-value/benchmark/benchmark.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex128 = require( './../../../../float64/ctor' ); -var Complex64 = require( './../../../../float32/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var isAlmostSameValue = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var z1; - var z2; - var v; - var i; - - z1 = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ), - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ) - ]; - z2 = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ), - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ), - z1[ 0 ], - z1[ 1 ] - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = isAlmostSameValue( z1[ i%z1.length ], z2[ i%z2.length ], 1 ); - if ( typeof v !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( v ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/base/assert/is-almost-same-value/docs/repl.txt b/base/assert/is-almost-same-value/docs/repl.txt deleted file mode 100644 index 52b77635..00000000 --- a/base/assert/is-almost-same-value/docs/repl.txt +++ /dev/null @@ -1,41 +0,0 @@ - -{{alias}}( z1, z2, maxULP ) - Tests whether two complex numbers are approximately the same value within a - specified number of ULPs (units in the last place). - - The function differs from the `===` operator in that the function treats - `-0` and `+0` as distinct and `NaNs` as the same. - - Parameters - ---------- - z1: ComplexLike - First complex number. - - z2: ComplexLike - Second complex number. - - maxULP: number - Maximum allowed ULP difference. - - Returns - ------- - out: boolean - Boolean indicating whether two complex numbers are approximately the - same value within a specified number of ULPs. - - Examples - -------- - > var re1 = 1.0; - > var im1 = 3.0; - > var re2 = 1.0 + {{alias:@stdlib/constants/float64/eps}}; - > var im2 = 3.0; - > var z1 = new {{alias:@stdlib/complex/float64/ctor}}( re1, im1 ); - > var z2 = new {{alias:@stdlib/complex/float64/ctor}}( re2, im2 ); - > var v = {{alias}}( z1, z2, 0 ) - false - > v = {{alias}}( z1, z2, 1 ) - true - - See Also - -------- - diff --git a/base/assert/is-almost-same-value/docs/types/index.d.ts b/base/assert/is-almost-same-value/docs/types/index.d.ts deleted file mode 100644 index 8844b21f..00000000 --- a/base/assert/is-almost-same-value/docs/types/index.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { ComplexLike } from '@stdlib/types/complex'; - -/** -* Tests whether two complex numbers are approximately the same value within a specified number of ULPs (units in the last place). -* -* ## Notes -* -* - The function differs from the `===` operator in that the function treats `-0` and `+0` as distinct and `NaNs` as the same. -* -* @param z1 - first complex number -* @param z2 - second complex number -* @param maxULP - maximum allowed ULP difference -* @returns boolean indicating whether two complex numbers are approximately the same value within a specified number of ULPs -* -* @example -* var EPS = require( '@stdlib/constants/float64/eps' ); -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 1.0, 3.0 ); -* var z2 = new Complex128( 1.0+EPS, 3.0 ); -* -* var bool = isAlmostSameValue( z1, z2, 0 ); -* // returns false -* -* bool = isAlmostSameValue( z1, z2, 1 ); -* // returns true -*/ -declare function isAlmostSameValue( z1: ComplexLike, z2: ComplexLike, maxULP: number ): boolean; - - -// EXPORTS // - -export = isAlmostSameValue; diff --git a/base/assert/is-almost-same-value/docs/types/test.ts b/base/assert/is-almost-same-value/docs/types/test.ts deleted file mode 100644 index 46d79ec5..00000000 --- a/base/assert/is-almost-same-value/docs/types/test.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../../float64/ctor' ); -import isAlmostSameValue = require( './index' ); - - -// TESTS // - -// The function returns a boolean... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isAlmostSameValue( z1, z2, 1 ); // $ExpectType boolean -} - -// The compiler throws an error if the function is provided a first argument that is not a complex number... -{ - const z2 = new Complex128( 5.0, 3.0 ); - - isAlmostSameValue( 'abc', z2, 1 ); // $ExpectError - isAlmostSameValue( 123, z2, 1 ); // $ExpectError - isAlmostSameValue( true, z2, 1 ); // $ExpectError - isAlmostSameValue( false, z2, 1 ); // $ExpectError - isAlmostSameValue( [], z2, 1 ); // $ExpectError - isAlmostSameValue( {}, z2, 1 ); // $ExpectError - isAlmostSameValue( ( x: number ): number => x, z2, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a complex number... -{ - const z1 = new Complex128( 5.0, 3.0 ); - - isAlmostSameValue( z1, 'abc', 1 ); // $ExpectError - isAlmostSameValue( z1, 123, 1 ); // $ExpectError - isAlmostSameValue( z1, true, 1 ); // $ExpectError - isAlmostSameValue( z1, false, 1 ); // $ExpectError - isAlmostSameValue( z1, [], 1 ); // $ExpectError - isAlmostSameValue( z1, {}, 1 ); // $ExpectError - isAlmostSameValue( z1, ( x: number ): number => x, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a third argument that is not a number... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isAlmostSameValue( z1, z2, 'abc' ); // $ExpectError - isAlmostSameValue( z1, z2, true ); // $ExpectError - isAlmostSameValue( z1, z2, false ); // $ExpectError - isAlmostSameValue( z1, z2, null ); // $ExpectError - isAlmostSameValue( z1, z2, void 0 ); // $ExpectError - isAlmostSameValue( z1, z2, [] ); // $ExpectError - isAlmostSameValue( z1, z2, {} ); // $ExpectError - isAlmostSameValue( z1, z2, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isAlmostSameValue(); // $ExpectError - isAlmostSameValue( z1 ); // $ExpectError - isAlmostSameValue( z1, z2 ); // $ExpectError - isAlmostSameValue( z1, z2, 1, 1 ); // $ExpectError -} diff --git a/base/assert/is-almost-same-value/examples/index.js b/base/assert/is-almost-same-value/examples/index.js deleted file mode 100644 index 8a25691e..00000000 --- a/base/assert/is-almost-same-value/examples/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var EPS = require( '@stdlib/constants/float64/eps' ); -var Complex128 = require( './../../../../float64/ctor' ); -var isAlmostSameValue = require( './../lib' ); - -var z1 = new Complex128( 1.0, 3.0+EPS ); -var z2 = new Complex128( 1.0+EPS, 3.0 ); -console.log( isAlmostSameValue( z1, z2, 1 ) ); -// => true - -z1 = new Complex128( 1.0, 3.0+EPS ); -z2 = new Complex128( 1.0+EPS+EPS, 3.0 ); -console.log( isAlmostSameValue( z1, z2, 1 ) ); -// => false - -z1 = new Complex128( 0.0, 0.0 ); -z2 = new Complex128( -0.0, 0.0 ); -console.log( isAlmostSameValue( z1, z2, 0 ) ); -// => false - -z1 = new Complex128( NaN, 0.0 ); -z2 = new Complex128( 1.0, 0.0 ); -console.log( isAlmostSameValue( z1, z2, 1 ) ); -// => false diff --git a/base/assert/is-almost-same-value/lib/index.js b/base/assert/is-almost-same-value/lib/index.js deleted file mode 100644 index ca853a21..00000000 --- a/base/assert/is-almost-same-value/lib/index.js +++ /dev/null @@ -1,48 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Test whether two complex numbers are approximately the same value within a specified number of ULPs (units in the last place). -* -* @module @stdlib/complex/base/assert/is-almost-same-value -* -* @example -* var EPS = require( '@stdlib/constants/float64/eps' ); -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var isAlmostSameValue = require( '@stdlib/complex/base/assert/is-almost-same-value' ); -* -* var z1 = new Complex128( 1.0, 3.0 ); -* var z2 = new Complex128( 1.0+EPS, 3.0 ); -* -* var bool = isAlmostSameValue( z1, z2, 0 ); -* // returns false -* -* bool = isAlmostSameValue( z1, z2, 1 ); -* // returns true -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/base/assert/is-almost-same-value/lib/main.js b/base/assert/is-almost-same-value/lib/main.js deleted file mode 100644 index 55f31d8d..00000000 --- a/base/assert/is-almost-same-value/lib/main.js +++ /dev/null @@ -1,91 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var isAlmostSameValueF64 = require( '@stdlib/number/float64/base/assert/is-almost-same-value' ); -var isAlmostSameValueF32 = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); -var reim = require( './../../../../float64/reim' ); -var reimf = require( './../../../../float32/reim' ); - - -// MAIN // - -/** -* Tests whether two complex numbers are approximately the same value within a specified number of ULPs (units in the last place). -* -* ## Notes -* -* - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5. -* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same. -* -* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12 -* -* @param {ComplexLike} z1 - first complex number -* @param {ComplexLike} z2 - second complex number -* @param {number} maxULP - maximum allowed ULP difference -* @returns {boolean} boolean indicating whether two complex numbers are approximately the same value within a specified number of ULPs -* -* @example -* var EPS = require( '@stdlib/constants/float64/eps' ); -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 1.0, 3.0 ); -* var z2 = new Complex128( 1.0+EPS, 3.0 ); -* -* var bool = isAlmostSameValue( z1, z2, 0 ); -* // returns false -* -* bool = isAlmostSameValue( z1, z2, 1 ); -* // returns true -*/ -function isAlmostSameValue( z1, z2, maxULP ) { - var parts1; - var parts2; - var nb1; - var nb2; - var f; - - // Complex-like values will not, in general, have these properties, but complex instances will, thus allowing us to distinguish between complex number data types without expensive constructor checks, including when given cross-realm complex number instances: - nb1 = z1.BYTES_PER_ELEMENT; - nb2 = z2.BYTES_PER_ELEMENT; - - // Case: isAlmostSameValue( complex64, complex64 ) - if ( nb1 === 4 && nb2 === 4 ) { - f = isAlmostSameValueF32; - parts1 = reimf( z1 ); - parts2 = reimf( z2 ); - } - // Case: isAlmostSameValue( complexLike, complexLike ) - else { - f = isAlmostSameValueF64; - parts1 = reim( z1 ); - parts2 = reim( z2 ); - } - return ( - f( parts1[ 0 ], parts2[ 0 ], maxULP ) && - f( parts1[ 1 ], parts2[ 1 ], maxULP ) - ); -} - - -// EXPORTS // - -module.exports = isAlmostSameValue; diff --git a/base/assert/is-almost-same-value/package.json b/base/assert/is-almost-same-value/package.json deleted file mode 100644 index 26c8da88..00000000 --- a/base/assert/is-almost-same-value/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "@stdlib/complex/base/assert/is-almost-same-value", - "version": "0.0.0", - "description": "Test whether two complex numbers are approximately the same value within a specified number of ULPs (units in the last place).", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "number", - "base", - "assert", - "test", - "validate", - "equality", - "compare", - "comparison", - "equal", - "eq", - "same", - "issame", - "isequal", - "isalmostequal" - ] -} diff --git a/base/assert/is-almost-same-value/test/test.js b/base/assert/is-almost-same-value/test/test.js deleted file mode 100644 index 8cdffd3d..00000000 --- a/base/assert/is-almost-same-value/test/test.js +++ /dev/null @@ -1,217 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex128 = require( './../../../../float64/ctor' ); -var Complex64 = require( './../../../../float32/ctor' ); -var FLOAT64_EPS = require( '@stdlib/constants/float64/eps' ); -var FLOAT32_EPS = require( '@stdlib/constants/float32/eps' ); -var isAlmostSameValue = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof isAlmostSameValue, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function treats `NaNs` as the same value (float64)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( NaN, 3.14 ); - z2 = new Complex128( 5.0, 3.14 ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), false, 'returns expected value' ); - - z2 = new Complex128( 5.0, NaN ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), false, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function treats `NaNs` as the same value (float32)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( NaN, 3.14 ); - z2 = new Complex64( 5.0, 3.14 ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), false, 'returns expected value' ); - - z2 = new Complex64( 5.0, NaN ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), false, 'returns expected value' ); - - z1 = new Complex64( NaN, NaN ); - z2 = new Complex64( NaN, NaN ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if provided two complex numbers which are the same value irrespective of the specified number of ULPs (float64)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z1, 0 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), true, 'returns expected value' ); - - z1 = new Complex128( -5.0, -3.0 ); - z2 = new Complex128( -5.0, -3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 0 ), true, 'returns expected value' ); - - z1 = new Complex128( 0.0, 0.0 ); - z2 = new Complex128( 0.0, 0.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 0 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if provided two complex numbers which are the same value irrespective of the specified number of ULPs (float32)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z1, 0 ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), true, 'returns expected value' ); - - z1 = new Complex64( -5.0, -3.0 ); - z2 = new Complex64( -5.0, -3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 0 ), true, 'returns expected value' ); - - z1 = new Complex64( 0.0, 0.0 ); - z2 = new Complex64( 0.0, 0.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 0 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if provided two complex numbers which are approximately the same value within a specified number of ULPs (float64)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 1.0, 3.0 ); - z2 = new Complex128( 1.0+FLOAT64_EPS, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), true, 'returns expected value' ); - - z2 = new Complex128( 1.0+FLOAT64_EPS+FLOAT64_EPS, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 2 ), true, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 2 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if provided two complex numbers which are approximately the same value within a specified number of ULPs (float32)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 1.0, 3.0 ); - z2 = new Complex64( 1.0+FLOAT32_EPS, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), true, 'returns expected value' ); - - z2 = new Complex64( 1.0+FLOAT32_EPS+FLOAT32_EPS, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 2 ), true, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 2 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `false` if provided two complex numbers which are not approximately equal within a specified number of ULPs (float64)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 1.0, 3.0 ); - z2 = new Complex128( 1.0+FLOAT64_EPS, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 0 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 0 ), false, 'returns expected value' ); - - z2 = new Complex128( 1.0+FLOAT64_EPS+FLOAT64_EPS, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `false` if provided two complex numbers which are not approximately equal within a specified number of ULPs (float32)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 1.0, 3.0 ); - z2 = new Complex64( 1.0+FLOAT32_EPS, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 0 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 0 ), false, 'returns expected value' ); - - z2 = new Complex64( 1.0+FLOAT32_EPS+FLOAT32_EPS, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function distinguishes between signed zeros when the specified number of ULPs is zero (float64)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 0.0, 0.0 ); - z2 = new Complex128( -0.0, -0.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 0 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 0 ), false, 'returns expected value' ); - - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function distinguishes between signed zeros when the specified number of ULPs is zero (float32)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 0.0, 0.0 ); - z2 = new Complex64( -0.0, -0.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 0 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 0 ), false, 'returns expected value' ); - - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/base/assert/lib/index.js b/base/assert/lib/index.js deleted file mode 100644 index ca43e645..00000000 --- a/base/assert/lib/index.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/* -* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name. -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); - - -// MAIN // - -/** -* Top-level namespace. -* -* @namespace ns -*/ -var ns = {}; - -/** -* @name isAlmostEqual -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/base/assert/is-almost-equal} -*/ -setReadOnly( ns, 'isAlmostEqual', require( './../../../base/assert/is-almost-equal' ) ); - -/** -* @name isAlmostSameValue -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/base/assert/is-almost-same-value} -*/ -setReadOnly( ns, 'isAlmostSameValue', require( './../../../base/assert/is-almost-same-value' ) ); - - -// EXPORTS // - -module.exports = ns; diff --git a/base/assert/package.json b/base/assert/package.json deleted file mode 100644 index da931a2b..00000000 --- a/base/assert/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "@stdlib/complex/base/assert", - "version": "0.0.0", - "description": "Base (i.e., lower-level) complex number assertion functions.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "lib/index.js", - "directories": { - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "types", - "complex", - "cmplx", - "number", - "namespace", - "ns", - "base", - "assert" - ] -} diff --git a/base/assert/test/test.js b/base/assert/test/test.js deleted file mode 100644 index 85de573d..00000000 --- a/base/assert/test/test.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - - -// TESTS // - -tape( 'main export is an object', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ns, 'object', 'main export is an object' ); - t.end(); -}); - -tape( 'the exported object contains key-value pairs', function test( t ) { - var keys = objectKeys( ns ); - t.strictEqual( keys.length > 0, true, 'has keys' ); - t.end(); -}); diff --git a/base/cast-return/README.md b/base/cast-return/README.md deleted file mode 100644 index 916474a9..00000000 --- a/base/cast-return/README.md +++ /dev/null @@ -1,128 +0,0 @@ - - -# castReturn - -> Wrap a function and cast a function's return value to a complex number. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var castReturn = require( '@stdlib/complex/base/cast-return' ); -``` - -#### castReturn( fcn, nargs, ctor ) - -Returns a function which wraps a function and casts a function's return value to a complex number. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var addf = require( '@stdlib/number/float32/base/add' ); - -var f = castReturn( addf, 2, Complex64 ); -// returns -``` - -The function accepts the following arguments: - -- **fcn**: the function to wrap. -- **nargs**: the number of arguments to be provided to the wrapped function. -- **ctor**: complex number constructor for converting real numbers to complex numbers. - -
- - - - - -
- -## Notes - -- The returned function **assumes** that the wrapped function returns either a real or complex number. -- The returned function **assumes** that, if a return value is non-numeric (i.e., not of type `number`), then the return value is a complex number. The returned function does **not** verify that non-numeric return values are, in fact, complex number objects. The returned function returns non-numeric return values from the wrapped function without modification. - -
- - - - - -
- -## Examples - - - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var addf = require( '@stdlib/number/float32/base/add' ); -var castReturn = require( '@stdlib/complex/base/cast-return' ); - -var f = castReturn( addf, 2, Complex64 ); - -// ... - -var z = f( 3.0, 4.0 ); -// returns [ 7.0, 0.0 ] - -console.log( z.toString() ); -// => '7 + 0i' -``` - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/base/cast-return/benchmark/benchmark.js b/base/cast-return/benchmark/benchmark.js deleted file mode 100644 index de206927..00000000 --- a/base/cast-return/benchmark/benchmark.js +++ /dev/null @@ -1,363 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex64 = require( './../../../float32/ctor' ); -var realf = require( './../../../float32/real' ); -var imagf = require( './../../../float32/imag' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var pkg = require( './../package.json' ).name; -var cast = require( './../lib' ); - - -// FUNCTIONS // - -function naryReal() { - var re; - var i; - - re = 0.0; - for ( i = 0; i < arguments.length; i++ ) { - re += arguments[ i ]; - } - return re; -} - -function naryComplex() { - var re; - var i; - - re = 0.0; - for ( i = 0; i < arguments.length; i++ ) { - re += arguments[ i ]; - } - return new Complex64( re, 0.0 ); -} - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var f; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - f = cast( naryReal, i, Complex64 ); - if ( typeof f !== 'function' ) { - b.fail( 'should return a function' ); - } - } - b.toc(); - if ( !isFunction( f ) ) { - b.fail( 'should return a function' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_nullary', function benchmark( b ) { - var f; - var v; - var i; - - f = cast( naryReal, 0, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f(); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_unary,real', function benchmark( b ) { - var f; - var v; - var i; - - f = cast( naryReal, 1, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( i ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_unary,complex', function benchmark( b ) { - var f; - var v; - var i; - - f = cast( naryComplex, 1, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( i ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_binary,real', function benchmark( b ) { - var f; - var v; - var i; - - f = cast( naryReal, 2, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( i, i+1 ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_binary,complex', function benchmark( b ) { - var f; - var v; - var i; - - f = cast( naryComplex, 2, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( i, i+1 ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_ternary,real', function benchmark( b ) { - var f; - var v; - var i; - - f = cast( naryReal, 3, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( i, i+1, i+2 ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_ternary,complex', function benchmark( b ) { - var f; - var v; - var i; - - f = cast( naryComplex, 3, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( i, i+1, i+2 ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_quaternary,real', function benchmark( b ) { - var f; - var v; - var i; - - f = cast( naryReal, 4, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( i, i+1, i+2, i+3 ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_quaternary,complex', function benchmark( b ) { - var f; - var v; - var i; - - f = cast( naryComplex, 4, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( i, i+1, i+2, i+3 ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_quinary,real', function benchmark( b ) { - var f; - var v; - var i; - - f = cast( naryReal, 5, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( i, i+1, i+2, i+3, i+4 ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_quinary,complex', function benchmark( b ) { - var f; - var v; - var i; - - f = cast( naryComplex, 5, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( i, i+1, i+2, i+3, i+4 ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_nary,real', function benchmark( b ) { - var f; - var v; - var i; - - f = cast( naryReal, 6, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( i, i+1, i+2, i+3, i+4, i+5 ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_nary,complex', function benchmark( b ) { - var f; - var v; - var i; - - f = cast( naryComplex, 6, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( i, i+1, i+2, i+3, i+4, i+5 ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/base/cast-return/docs/repl.txt b/base/cast-return/docs/repl.txt deleted file mode 100644 index 6b6fee20..00000000 --- a/base/cast-return/docs/repl.txt +++ /dev/null @@ -1,41 +0,0 @@ - -{{alias}}( fcn, nargs, ctor ) - Wraps a function and casts a function's return value to a complex number. - - The returned function *assumes* that the wrapped function returns either a - real or complex number. - - The returned function *assumes* that, if a return value is non-numeric - (i.e., not of type `number`), then the return value is a complex number. - - The returned function does *not* verify that non-numeric return values are, - in fact, complex number objects. - - The returned function returns non-numeric return values from the wrapped - function without modification. - - Parameters - ---------- - fcn: Function - Function to wrap. - - nargs: integer - Number of arguments. - - ctor: Function - Complex number constructor. - - Returns - ------- - f: Function - Wrapped function. - - Examples - -------- - > var f = {{alias}}( {{alias:@stdlib/number/float32/base/add}}, 2, {{alias:@stdlib/complex/float32/ctor}} ); - > var z = f( 3.0, 4.0 ) - [ 7.0, 0.0 ] - - See Also - -------- - diff --git a/base/cast-return/docs/types/index.d.ts b/base/cast-return/docs/types/index.d.ts deleted file mode 100644 index 7acc04d5..00000000 --- a/base/cast-return/docs/types/index.d.ts +++ /dev/null @@ -1,378 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { ComplexLike } from '@stdlib/types/complex'; - -/** -* Real or complex number. -*/ -type RealOrComplex = number | ComplexLike; - -/** -* Nullary function returning either a real or complex number. -* -* @returns result -*/ -type Nullary = () => RealOrComplex; - -/** -* Nullary function returning a complex number. -* -* @returns result -*/ -type WrappedNullary = () => ComplexLike; - -/** -* Unary function returning either a real or complex number. -* -* @param x - input value -* @returns result -*/ -type Unary = ( x: any ) => RealOrComplex; - -/** -* Unary function returning a complex number. -* -* @param x - input value -* @returns result -*/ -type WrappedUnary = ( x: any ) => ComplexLike; - -/** -* Binary function returning either a real or complex number. -* -* @param x - input value -* @param y - input value -* @returns result -*/ -type Binary = ( x: any, y: any ) => RealOrComplex; - -/** -* Binary function returning a complex number. -* -* @param x - input value -* @param y - input value -* @returns result -*/ -type WrappedBinary = ( x: any, y: any ) => ComplexLike; - -/** -* Ternary function returning either a real or complex number. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @returns result -*/ -type Ternary = ( x: any, y: any, z: any ) => RealOrComplex; - -/** -* Ternary function returning a complex number. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @returns result -*/ -type WrappedTernary = ( x: any, y: any, z: any ) => ComplexLike; - -/** -* Quaternary function returning either a real or complex number. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @param w - input value -* @returns result -*/ -type Quaternary = ( x: any, y: any, z: any, w: any ) => RealOrComplex; - -/** -* Quaternary function returning a complex number. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @param w - input value -* @returns result -*/ -type WrappedQuaternary = ( x: any, y: any, z: any, w: any ) => ComplexLike; - -/** -* Quinary function returning either a real or complex number. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @param w - input value -* @param v - input value -* @returns result -*/ -type Quinary = ( x: any, y: any, z: any, w: any, v: any ) => RealOrComplex; - -/** -* Quinary function returning a complex number. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @param w - input value -* @param v - input value -* @returns result -*/ -type WrappedQuinary = ( x: any, y: any, z: any, w: any, v: any ) => ComplexLike; - -/** -* An n-ary function returning either a real or complex number. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @param w - input value -* @param v - input value -* @param args - subsequent input values -* @returns result -*/ -type Nary = ( x: any, y: any, z: any, w: any, v: any, ...args: Array ) => RealOrComplex; - -/** -* An n-ary function returning a complex number. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @param w - input value -* @param v - input value -* @param args - subsequent input values -* @returns result -*/ -type WrappedNary = ( x: any, y: any, z: any, w: any, v: any, ...args: Array ) => ComplexLike; - -/** -* Complex number constructor. -* -* @param re - real component -* @param im - imaginary component -* @returns complex number -*/ -type Constructor = new( re: number, im: number ) => ComplexLike; - -/** -* Wraps a nullary function and casts a function's return value to a complex number. -* -* @param fcn - nullary function to wrap -* @param nargs - number of arguments -* @param ctor - complex number constructor -* @throws second argument must be a nonnegative integer -* @returns wrapped function -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var randu = require( '@stdlib/random/base/randu' ); -* -* var f = wrap( randu, 0, Complex64 ); -* -* // ... -* -* var z = f(); -* // e.g., returns [ , ] -*/ -declare function wrap( fcn: Nullary, nargs: 0, ctor: Constructor ): WrappedNullary; - -/** -* Wraps a unary function and casts a function's return value to a complex number. -* -* ## Notes -* -* - The returned function **assumes** that the wrapped function returns either a real or complex number. -* - The returned function **assumes** that, if a return value is non-numeric (i.e., not of type `number`), then the return value is a complex number. The returned function does **not** verify that non-numeric return values are, in fact, complex number objects. The returned function returns non-numeric return values from the wrapped function without modification. -* -* @param fcn - function to wrap -* @param nargs - number of arguments -* @param ctor - complex number constructor -* @throws second argument must be a nonnegative integer -* @returns wrapped function -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var identityf = require( '@stdlib/number/float32/base/identity' ); -* -* var f = wrap( identityf, 1, Complex64 ); -* -* // ... -* -* var z = f( 3.0 ); -* // returns [ 3.0, 0.0 ] -*/ -declare function wrap( fcn: Unary, nargs: 1, ctor: Constructor ): WrappedUnary; - -/** -* Wraps a binary function and casts a function's return value to a complex number. -* -* ## Notes -* -* - The returned function **assumes** that the wrapped function returns either a real or complex number. -* - The returned function **assumes** that, if a return value is non-numeric (i.e., not of type `number`), then the return value is a complex number. The returned function does **not** verify that non-numeric return values are, in fact, complex number objects. The returned function returns non-numeric return values from the wrapped function without modification. -* -* @param fcn - function to wrap -* @param nargs - number of arguments -* @param ctor - complex number constructor -* @throws second argument must be a nonnegative integer -* @returns wrapped function -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var addf = require( '@stdlib/number/float32/base/add' ); -* -* var f = wrap( addf, 2, Complex64 ); -* -* // ... -* -* var z = f( 3.0, 4.0 ); -* // returns [ 7.0, 0.0 ] -*/ -declare function wrap( fcn: Binary, nargs: 2, ctor: Constructor ): WrappedBinary; - -/** -* Wraps a ternary function and casts a function's return value to a complex number. -* -* ## Notes -* -* - The returned function **assumes** that the wrapped function returns either a real or complex number. -* - The returned function **assumes** that, if a return value is non-numeric (i.e., not of type `number`), then the return value is a complex number. The returned function does **not** verify that non-numeric return values are, in fact, complex number objects. The returned function returns non-numeric return values from the wrapped function without modification. -* -* @param fcn - function to wrap -* @param nargs - number of arguments -* @param ctor - complex number constructor -* @throws second argument must be a nonnegative integer -* @returns wrapped function -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* function add( x, y, z ) { -* return x + y + z; -* } -* -* var f = wrap( add, 3, Complex64 ); -* -* // ... -* -* var z = f( 3.0, 4.0, 5.0 ); -* // returns [ 12.0, 0.0 ] -*/ -declare function wrap( fcn: Ternary, nargs: 3, ctor: Constructor ): WrappedTernary; - -/** -* Wraps a quaternary function and casts a function's return value to a complex number. -* -* ## Notes -* -* - The returned function **assumes** that the wrapped function returns either a real or complex number. -* - The returned function **assumes** that, if a return value is non-numeric (i.e., not of type `number`), then the return value is a complex number. The returned function does **not** verify that non-numeric return values are, in fact, complex number objects. The returned function returns non-numeric return values from the wrapped function without modification. -* -* @param fcn - function to wrap -* @param nargs - number of arguments -* @param ctor - complex number constructor -* @throws second argument must be a nonnegative integer -* @returns wrapped function -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* function add( x, y, z, w ) { -* return x + y + z + w; -* } -* -* var f = wrap( add, 4, Complex64 ); -* -* // ... -* -* var z = f( 3.0, 4.0, 5.0, 6.0 ); -* // returns [ 18.0, 0.0 ] -*/ -declare function wrap( fcn: Quaternary, nargs: 4, ctor: Constructor ): WrappedQuaternary; - -/** -* Wraps a quinary function and casts a function's return value to a complex number. -* -* ## Notes -* -* - The returned function **assumes** that the wrapped function returns either a real or complex number. -* - The returned function **assumes** that, if a return value is non-numeric (i.e., not of type `number`), then the return value is a complex number. The returned function does **not** verify that non-numeric return values are, in fact, complex number objects. The returned function returns non-numeric return values from the wrapped function without modification. -* -* @param fcn - function to wrap -* @param nargs - number of arguments -* @param ctor - complex number constructor -* @throws second argument must be a nonnegative integer -* @returns wrapped function -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* function add( x, y, z, w, v ) { -* return x + y + z + w + v; -* } -* -* var f = wrap( add, 5, Complex64 ); -* -* // ... -* -* var z = f( 3.0, 4.0, 5.0, 6.0, 7.0 ); -* // returns [ 25.0, 0.0 ] -*/ -declare function wrap( fcn: Quinary, nargs: 5, ctor: Constructor ): WrappedQuinary; - -/** -* Wraps an n-ary function and casts a function's return value to a complex number. -* -* ## Notes -* -* - The returned function **assumes** that the wrapped function returns either a real or complex number. -* - The returned function **assumes** that, if a return value is non-numeric (i.e., not of type `number`), then the return value is a complex number. The returned function does **not** verify that non-numeric return values are, in fact, complex number objects. The returned function returns non-numeric return values from the wrapped function without modification. -* -* @param fcn - function to wrap -* @param nargs - number of arguments -* @param ctor - complex number constructor -* @throws second argument must be a nonnegative integer -* @returns wrapped function -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* function add( x, y, z, w, v, t ) { -* return x + y + z + w + v + t; -* } -* -* var f = wrap( add, 6, Complex64 ); -* -* // ... -* -* var z = f( 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ); -* // returns [ 33.0, 0.0 ] -*/ -declare function wrap( fcn: Nary, nargs: number, ctor: Constructor ): WrappedNary; - - -// EXPORTS // - -export = wrap; diff --git a/base/cast-return/docs/types/test.ts b/base/cast-return/docs/types/test.ts deleted file mode 100644 index 5f9eff81..00000000 --- a/base/cast-return/docs/types/test.ts +++ /dev/null @@ -1,192 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/// - -import Complex64 = require( './../../../../float32/ctor' ); -import castReturn = require( './index' ); - -/** -* Nullary function. -* -* @returns result -*/ -function nullary(): number { - return 1.0; -} - -/** -* Unary function. -* -* @param x - input value -* @returns result -*/ -function unary( x: number ): number { - return x; -} - -/** -* Binary function. -* -* @param x - input value -* @param y - input value -* @returns result -*/ -function binary( x: number, y: number ): number { - return x + y; -} - -/** -* Ternary function. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @returns result -*/ -function ternary( x: number, y: number, z: number ): number { - return x + y + z; -} - -/** -* Quaternary function. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @param w - input value -* @returns result -*/ -function quaternary( x: number, y: number, z: number, w: number ): number { - return x + y + z + w; -} - -/** -* Quinary function. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @param w - input value -* @param v - input value -* @returns result -*/ -function quinary( x: number, y: number, z: number, w: number, v: number ): number { - return x + y + z + w + v; -} - -/** -* N-ary function. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @param w - input value -* @param v - input value -* @param t - input value -* @returns result -*/ -function nary( x: number, y: number, z: number, w: number, v: number, t: number ): number { - return x + y + z + w + v + t; -} - - -// TESTS // - -// The function returns a wrapped function... -{ - castReturn( nullary, 0, Complex64 ); // $ExpectType WrappedNullary - castReturn( unary, 1, Complex64 ); // $ExpectType WrappedUnary - castReturn( binary, 2, Complex64 ); // $ExpectType WrappedBinary - castReturn( ternary, 3, Complex64 ); // $ExpectType WrappedTernary - castReturn( quaternary, 4, Complex64 ); // $ExpectType WrappedQuaternary - castReturn( quinary, 5, Complex64 ); // $ExpectType WrappedQuinary - castReturn( nary, 6, Complex64 ); // $ExpectType WrappedNary -} - -// The compiler throws an error if the function is provided a first argument that is not a valid function... -{ - castReturn( 'abc', 1, Complex64 ); // $ExpectError - castReturn( 123, 1, Complex64 ); // $ExpectError - castReturn( true, 1, Complex64 ); // $ExpectError - castReturn( false, 1, Complex64 ); // $ExpectError - castReturn( null, 1, Complex64 ); // $ExpectError - castReturn( undefined, 1, Complex64 ); // $ExpectError - castReturn( [], 1, Complex64 ); // $ExpectError - castReturn( {}, 1, Complex64 ); // $ExpectError - - castReturn( ( x: string ): string => x, 1, Complex64 ); // $ExpectError - castReturn( ( x: boolean ): boolean => x, 1, Complex64 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a number... -{ - castReturn( binary, 'abc', Complex64 ); // $ExpectError - castReturn( binary, true, Complex64 ); // $ExpectError - castReturn( binary, false, Complex64 ); // $ExpectError - castReturn( binary, null, Complex64 ); // $ExpectError - castReturn( binary, undefined, Complex64 ); // $ExpectError - castReturn( binary, [], Complex64 ); // $ExpectError - castReturn( binary, {}, Complex64 ); // $ExpectError - castReturn( binary, ( x: number ): number => x, Complex64 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a third argument that is not a complex number constructor... -{ - castReturn( binary, 2, 'abc' ); // $ExpectError - castReturn( binary, 2, 1 ); // $ExpectError - castReturn( binary, 2, true ); // $ExpectError - castReturn( binary, 2, false ); // $ExpectError - castReturn( binary, 2, null ); // $ExpectError - castReturn( binary, 2, undefined ); // $ExpectError - castReturn( binary, 2, [] ); // $ExpectError - castReturn( binary, 2, {} ); // $ExpectError - castReturn( binary, 2, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - castReturn(); // $ExpectError - castReturn( binary ); // $ExpectError - castReturn( binary, 2 ); // $ExpectError - castReturn( binary, 2, Complex64, true ); // $ExpectError -} - -// The function returns a function which returns a complex number... -{ - const f0 = castReturn( nullary, 0, Complex64 ); - f0(); // $ExpectType ComplexLike - - const f1 = castReturn( unary, 1, Complex64 ); - f1( 1.0 ); // $ExpectType ComplexLike - - const f2 = castReturn( binary, 2, Complex64 ); - f2( 1.0, 1.0 ); // $ExpectType ComplexLike - - const f3 = castReturn( ternary, 3, Complex64 ); - f3( 1.0, 1.0, 1.0 ); // $ExpectType ComplexLike - - const f4 = castReturn( quaternary, 4, Complex64 ); - f4( 1.0, 1.0, 1.0, 1.0 ); // $ExpectType ComplexLike - - const f5 = castReturn( quinary, 5, Complex64 ); - f5( 1.0, 1.0, 1.0, 1.0, 1.0 ); // $ExpectType ComplexLike - - const f6 = castReturn( nary, 6, Complex64 ); - f6( 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ); // $ExpectType ComplexLike -} diff --git a/base/cast-return/examples/index.js b/base/cast-return/examples/index.js deleted file mode 100644 index e0e624ea..00000000 --- a/base/cast-return/examples/index.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64 = require( './../../../float32/ctor' ); -var addf = require( '@stdlib/number/float32/base/add' ); -var castReturn = require( './../lib' ); - -var f = castReturn( addf, 2, Complex64 ); - -// ... - -var z = f( 3.0, 4.0 ); -// returns [ 7.0, 0.0 ] - -console.log( z.toString() ); -// => '7 + 0i' diff --git a/base/cast-return/lib/index.js b/base/cast-return/lib/index.js deleted file mode 100644 index 26d80e32..00000000 --- a/base/cast-return/lib/index.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Wrap a function and casts a function's return value to a complex number. -* -* @module @stdlib/complex/base/cast-return -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var addf = require( '@stdlib/number/float32/base/add' ); -* var castReturn = require( '@stdlib/complex/base/cast-return' ); -* -* var f = castReturn( addf, 2, Complex64 ); -* -* // ... -* -* var z = f( 3.0, 4.0 ); -* // returns [ 7.0, 0.0 ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/base/cast-return/lib/main.js b/base/cast-return/lib/main.js deleted file mode 100644 index 711cb62f..00000000 --- a/base/cast-return/lib/main.js +++ /dev/null @@ -1,204 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable valid-typeof */ - -'use strict'; - -// MODULES // - -var isFunction = require( '@stdlib/assert/is-function' ); -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var T = 'number'; - - -// FUNCTIONS // - -/** -* Wraps a function and casts a function's return value to a complex number. -* -* ## Notes -* -* - The returned function **assumes** that the wrapped function returns either a real or complex number. -* - The returned function **assumes** that, if a return value is non-numeric (i.e., not of type `number`), then the return value is a complex number. The returned function does **not** verify that non-numeric return values are, in fact, complex number objects. The returned function returns non-numeric return values from the wrapped function without modification. -* -* @param {Function} fcn - function to wrap -* @param {NonNegativeInteger} nargs - number of arguments -* @param {Function} ctor - complex number constructor -* @throws {TypeError} first argument must be a function -* @throws {TypeError} second argument must be a nonnegative integer -* @throws {TypeError} third argument must be a constructor function -* @returns {Function} wrapped function -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var addf = require( '@stdlib/number/float32/base/add' ); -* -* var f = wrap( addf, 2, Complex64 ); -* -* // ... -* -* var z = f( 3.0, 4.0 ); -* // returns [ 7.0, 0.0 ] -*/ -function wrap( fcn, nargs, ctor ) { - var fcns; - if ( !isFunction( fcn ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) ); - } - if ( !isNonNegativeInteger( nargs ) ) { - throw new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', nargs ) ); - } - if ( !isFunction( ctor ) ) { - throw new TypeError( format( 'invalid argument. Third argument must be a constructor function. Value: `%s`.', ctor ) ); - } - fcns = [ fcn0, fcn1, fcn2, fcn3, fcn4, fcn5 ]; - return ( nargs <= 5 ) ? fcns[ nargs ] : fcnN; - - /** - * Invokes a nullary function and returns a complex number. - * - * @private - * @returns {Complex} result - */ - function fcn0() { - var r = fcn(); - if ( typeof r === T ) { - return new ctor( r, 0.0 ); - } - return r; - } - - /** - * Invokes a unary function and returns a complex number. - * - * @private - * @param {*} x - input value - * @returns {Complex} result - */ - function fcn1( x ) { - var r = fcn( x ); - if ( typeof r === T ) { - return new ctor( r, 0.0 ); - } - return r; - } - - /** - * Invokes a binary function and returns a complex number. - * - * @private - * @param {*} x - input value - * @param {*} y - input value - * @returns {Complex} result - */ - function fcn2( x, y ) { - var r = fcn( x, y ); - if ( typeof r === T ) { - return new ctor( r, 0.0 ); - } - return r; - } - - /** - * Invokes a ternary function and returns a complex number. - * - * @private - * @param {*} x - input value - * @param {*} y - input value - * @param {*} z - input value - * @returns {Complex} result - */ - function fcn3( x, y, z ) { - var r = fcn( x, y, z ); - if ( typeof r === T ) { - return new ctor( r, 0.0 ); - } - return r; - } - - /** - * Invokes a quaternary function and returns a complex number. - * - * @private - * @param {*} x - input value - * @param {*} y - input value - * @param {*} z - input value - * @param {*} w - input value - * @returns {Complex} result - */ - function fcn4( x, y, z, w ) { - var r = fcn( x, y, z, w ); - if ( typeof r === T ) { - return new ctor( r, 0.0 ); - } - return r; - } - - /** - * Invokes a quinary function and returns a complex number. - * - * @private - * @param {*} x - input value - * @param {*} y - input value - * @param {*} z - input value - * @param {*} w - input value - * @param {*} v - input value - * @returns {Complex} result - */ - function fcn5( x, y, z, w, v ) { - var r = fcn( x, y, z, w, v ); - if ( typeof r === T ) { - return new ctor( r, 0.0 ); - } - return r; - } - - /** - * Invokes a function and returns a complex number. - * - * @private - * @param {...*} args - input values - * @returns {Complex} result - */ - function fcnN() { - var args; - var r; - var i; - - args = []; - for ( i = 0; i < arguments.length; i++ ) { - args.push( arguments[ i ] ); - } - r = fcn.apply( null, args ); - if ( typeof r === T ) { - return new ctor( r, 0.0 ); - } - return r; - } -} - - -// EXPORTS // - -module.exports = wrap; diff --git a/base/cast-return/package.json b/base/cast-return/package.json deleted file mode 100644 index b7fd5f66..00000000 --- a/base/cast-return/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "@stdlib/complex/base/cast-return", - "version": "0.0.0", - "description": "Wrap a function and casts a function's return value to a complex number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "types", - "data", - "structure", - "complex", - "cmplx", - "number", - "base", - "wrap", - "cast", - "convert" - ] -} diff --git a/base/cast-return/test/test.js b/base/cast-return/test/test.js deleted file mode 100644 index cb019222..00000000 --- a/base/cast-return/test/test.js +++ /dev/null @@ -1,277 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex64 = require( './../../../float32/ctor' ); -var realf = require( './../../../float32/real' ); -var imagf = require( './../../../float32/imag' ); -var castReturn = require( './../lib' ); - - -// FUNCTIONS // - -function naryReal() { - var re; - var i; - - re = 0.0; - for ( i = 0; i < arguments.length; i++ ) { - re += arguments[ i ]; - } - return re; -} - -function naryComplex() { - var re; - var i; - - re = 0.0; - for ( i = 0; i < arguments.length; i++ ) { - re += arguments[ i ]; - } - return new Complex64( re, 0.0 ); -} - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof castReturn, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function throws an error if not provided a first argument which is a function', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - null, - void 0, - [], - {} - ]; - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - castReturn( value, 2, Complex64 ); - }; - } -}); - -tape( 'the function throws an error if not provided a second argument which is a nonnegative integer', function test( t ) { - var values; - var i; - - values = [ - '5', - -5, - 3.14, - NaN, - true, - false, - null, - void 0, - [], - {}, - function noop() {} - ]; - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - castReturn( naryReal, value, Complex64 ); - }; - } -}); - -tape( 'the function throws an error if not provided a third argument which is a constructor function', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - null, - void 0, - [], - {} - ]; - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - castReturn( naryReal, 2, value ); - }; - } -}); - -tape( 'the function returns a function which casts return values to complex numbers (nullary)', function test( t ) { - var f; - var v; - - f = castReturn( naryReal, 0, Complex64 ); - v = f(); - - t.strictEqual( realf( v ), 0.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - f = castReturn( naryComplex, 0, Complex64 ); - v = f(); - - t.strictEqual( realf( v ), 0.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a function which casts return values to complex numbers (unary)', function test( t ) { - var f; - var v; - - f = castReturn( naryReal, 1, Complex64 ); - - v = f( 1.0 ); - t.strictEqual( realf( v ), 1.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - f = castReturn( naryComplex, 1, Complex64 ); - - v = f( 1.0 ); - t.strictEqual( realf( v ), 1.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a function which casts return values to complex numbers (binary)', function test( t ) { - var f; - var v; - - f = castReturn( naryReal, 2, Complex64 ); - - v = f( 1.0, 1.0 ); - t.strictEqual( realf( v ), 2.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - f = castReturn( naryComplex, 2, Complex64 ); - - v = f( 1.0, 1.0 ); - t.strictEqual( realf( v ), 2.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a function which casts return values to complex numbers (ternary)', function test( t ) { - var f; - var v; - - f = castReturn( naryReal, 3, Complex64 ); - - v = f( 1.0, 1.0, 1.0 ); - t.strictEqual( realf( v ), 3.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - f = castReturn( naryComplex, 3, Complex64 ); - - v = f( 1.0, 1.0, 1.0 ); - t.strictEqual( realf( v ), 3.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a function which casts return values to complex numbers (quaternary)', function test( t ) { - var f; - var v; - - f = castReturn( naryReal, 4, Complex64 ); - - v = f( 1.0, 1.0, 1.0, 1.0 ); - t.strictEqual( realf( v ), 4.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - f = castReturn( naryComplex, 4, Complex64 ); - - v = f( 1.0, 1.0, 1.0, 1.0 ); - t.strictEqual( realf( v ), 4.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a function which casts return values to complex numbers (quinary)', function test( t ) { - var f; - var v; - - f = castReturn( naryReal, 5, Complex64 ); - - v = f( 1.0, 1.0, 1.0, 1.0, 1.0 ); - t.strictEqual( realf( v ), 5.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - f = castReturn( naryComplex, 5, Complex64 ); - - v = f( 1.0, 1.0, 1.0, 1.0, 1.0 ); - t.strictEqual( realf( v ), 5.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a function which casts return values to complex numbers (nary)', function test( t ) { - var f; - var v; - - f = castReturn( naryReal, 6, Complex64 ); - - v = f( 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ); - t.strictEqual( realf( v ), 6.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - f = castReturn( naryComplex, 6, Complex64 ); - - v = f( 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ); - t.strictEqual( realf( v ), 6.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - t.end(); -}); diff --git a/base/docs/types/index.d.ts b/base/docs/types/index.d.ts deleted file mode 100644 index 4caf6e32..00000000 --- a/base/docs/types/index.d.ts +++ /dev/null @@ -1,130 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/* eslint-disable max-lines */ - -import assert = require( './../../../base/assert' ); -import cast = require( './../../../base/cast-return' ); -import parse = require( './../../../base/parse' ); -import wrap = require( './../../../base/wrap-function' ); - -/** -* Interface describing the `base` namespace. -*/ -interface Namespace { - /** - * Base (i.e., lower-level) complex number assertion functions. - */ - assert: typeof assert; - - /** - * Wraps an n-ary function and casts a function's return value to a complex number. - * - * ## Notes - * - * - The returned function **assumes** that the wrapped function returns either a real or complex number. - * - The returned function **assumes** that, if a return value is non-numeric (i.e., not of type `number`), then the return value is a complex number. The returned function does **not** verify that non-numeric return values are, in fact, complex number objects. The returned function returns non-numeric return values from the wrapped function without modification. - * - * @param fcn - function to wrap - * @param nargs - number of arguments - * @param ctor - complex number constructor - * @throws second argument must be a nonnegative integer - * @returns wrapped function - * - * @example - * var Complex64 = require( './../../../float32/ctor' ); - * - * function add( x, y, z, w, v, t ) { - * return x + y + z + w + v + t; - * } - * - * var f = ns.cast( add, 6, Complex64 ); - * - * // ... - * - * var z = f( 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ); - * // returns [ 33.0, 0.0 ] - */ - cast: typeof cast; - - /** - * Parses a string representing a complex number into a complex like object. - * - * @param str - input string - * @returns complex like object - * - * @example - * var str = '4 + 6i'; - * - * var z = ns.parse( str ); - * // returns { 're' : 4, 'im' : 6 } - */ - parse: typeof parse; - - /** - * Wraps an n-ary function accepting complex number arguments to support providing both real and complex numbers. - * - * ## Notes - * - * - The returned function **assumes** that the wrapped function accepts **only** complex number input arguments (i.e., every argument must be a complex number). - * - The returned function **assumes** that, if an input argument is non-numeric (i.e., not of type `number`), then the input argument is a complex number. The returned function does **not** verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification. - * - * @param fcn - function to wrap - * @param nargs - number of arguments - * @param ctor - complex number constructor - * @throws second argument must be a nonnegative integer - * @returns wrapped function - * - * @example - * var Complex64 = require( './../../../float32/ctor' ); - * var realf = require( './../../../float32/real' ); - * var imagf = require( './../../../float32/imag' ); - * - * function add( x, y, z, w, v, t ) { - * var re = realf( x ) + realf( y ) + realf( z ) + realf( w ) + realf( v ) + realf( t ); - * var im = imagf( x ) + imagf( y ) + imagf( z ) + imagf( w ) + imagf( v ) + imagf( t ); - * return new Complex64( re, im ); - * } - * - * var f = ns.wrap( add, 6, Complex64 ); - * - * // ... - * - * var z = f( 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ); - * // returns - * - * var re = realf( z ); - * // returns 33.0 - * - * var im = imagf( z ); - * // returns 0.0 - */ - wrap: typeof wrap; -} - -/** -* Base (i.e., lower-level) complex number functions. -*/ -declare var ns: Namespace; - - -// EXPORTS // - -export = ns; diff --git a/base/docs/types/test.ts b/base/docs/types/test.ts deleted file mode 100644 index e344b791..00000000 --- a/base/docs/types/test.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable @typescript-eslint/no-unused-expressions */ - -import ns = require( './index' ); - - -// TESTS // - -// The exported value is the expected interface... -{ - ns; // $ExpectType Namespace -} diff --git a/base/examples/index.js b/base/examples/index.js deleted file mode 100644 index d903e87c..00000000 --- a/base/examples/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - -console.log( objectKeys( ns ) ); diff --git a/base/lib/index.js b/base/lib/index.js deleted file mode 100644 index 5c179798..00000000 --- a/base/lib/index.js +++ /dev/null @@ -1,78 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/* -* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name. -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); - - -// MAIN // - -/** -* Top-level namespace. -* -* @namespace ns -*/ -var ns = {}; - -/** -* @name assert -* @memberof ns -* @readonly -* @type {Namespace} -* @see {@link module:@stdlib/complex/base/assert} -*/ -setReadOnly( ns, 'assert', require( './../../base/assert' ) ); - -/** -* @name cast -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/base/cast-return} -*/ -setReadOnly( ns, 'cast', require( './../../base/cast-return' ) ); - -/** -* @name parse -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/base/parse} -*/ -setReadOnly( ns, 'parse', require( './../../base/parse' ) ); - -/** -* @name wrap -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/base/wrap-function} -*/ -setReadOnly( ns, 'wrap', require( './../../base/wrap-function' ) ); - - -// EXPORTS // - -module.exports = ns; diff --git a/base/package.json b/base/package.json deleted file mode 100644 index 9da16744..00000000 --- a/base/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "@stdlib/complex/base", - "version": "0.0.0", - "description": "Base (i.e., lower-level) complex number functions.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "lib/index.js", - "directories": { - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "types", - "complex", - "cmplx", - "number", - "namespace", - "ns", - "base" - ] -} diff --git a/base/parse/README.md b/base/parse/README.md deleted file mode 100644 index e1a87541..00000000 --- a/base/parse/README.md +++ /dev/null @@ -1,137 +0,0 @@ - - -# parse - -> Parses a string representing a complex number into a complex like object `{re: number, im: number}`. - - - -
- -
- - - - - -
- -## Usage - -```js -var parse = require( '@stdlib/complex/base/parse' ); -``` - -#### parse( str ) - -Parses a string representing a complex number into a complex like object. - -```js -var parse = require( '@stdlib/complex/base/parse' ); - -var str = '5 + 3i'; - -var z = parse( str ); -// returns <{re: 5, im: 3}> -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```js -var parse = require( '@stdlib/complex/base/parse' ); - -var str; -var z; - -z = parse( '5 + 4i' ); -// returns {'re' : 5, 'im' : 4} - -z = parse( 'Infinity + 2.34i' ); -// returns {'re' : Infinity, 'im' : 2.34} - -z = parse( 'NaN + 4i' ); -// returns {'re' : NaN, 'im' : 4} - -z = parse( '45i55 + 5' ); -// returns null - -z = parse( '5 + 6 + 10e4i' ); -// returns {'re' : 11, 'im' : 100000} - -z = parse( {} ); -// returns null -``` - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/base/parse/benchmark/benchmark.js b/base/parse/benchmark/benchmark.js deleted file mode 100644 index 0473802e..00000000 --- a/base/parse/benchmark/benchmark.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var parse = require( './../lib' ); -var pkg = require( './../package.json' ).name; - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var str; - var z; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - str = '4 + 3i'; - z = parse( str ); - if ( typeof z !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( typeof z !== 'object' ) { - b.fail( 'should return an object' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/base/parse/docs/repl.txt b/base/parse/docs/repl.txt deleted file mode 100644 index a4b0f329..00000000 --- a/base/parse/docs/repl.txt +++ /dev/null @@ -1,21 +0,0 @@ - -{{alias}}( str ) - Parses a string representing a complex number into a complex like object. - - Parameters - ---------- - str: string - - Returns - ------- - out: ComplexLike | null - Complex like object or null. - - Examples - -------- - > var str = '5 + 3i'; - > var z = {{alias}}( str ) - - See Also - -------- - diff --git a/base/parse/docs/types/index.d.ts b/base/parse/docs/types/index.d.ts deleted file mode 100644 index 4ea7625c..00000000 --- a/base/parse/docs/types/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { ComplexLike } from '@stdlib/types/complex'; - -/** -* Parses a string representing a complex number into a complex like object. -* -* @param str - input string -* @returns complex like object -* -* @example -* var str = '4 + 6i'; -* -* var z = parse( str ); -* // returns { 're' : 4, 'im' : 6 } -*/ -declare function parse( str: string ): ComplexLike | null; - - -// EXPORTS // - -export = parse; diff --git a/base/parse/docs/types/test.ts b/base/parse/docs/types/test.ts deleted file mode 100644 index 2297860a..00000000 --- a/base/parse/docs/types/test.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import parse = require( './index' ); - - -// TESTS // - -// The function returns a complex like object... -{ - const str = '54 + 3i'; - parse( str ); // $ExpectType ComplexLike | null -} - -// The compiler throws an error if the function is provided insufficient arguments... -{ - parse(); // $ExpectError - parse( 'beep', 'boop' ); // $ExpectError -} diff --git a/base/parse/examples/index.js b/base/parse/examples/index.js deleted file mode 100644 index a5e4dd12..00000000 --- a/base/parse/examples/index.js +++ /dev/null @@ -1,51 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var parse = require( './../lib' ); - -var str = '5 + 4i'; -var z = parse( str ); -console.log( JSON.stringify( z ) ); -// => '{"re":5,"im":4}' - -str = 'Infinity + 2.34i'; -z = parse( str ); -console.log( JSON.stringify( z ) ); -// => '{"re":null,"im":2.34}' - -str = 'NaN + i4'; -z = parse( str ); -console.log( z ); -// => null - -str = '45i55 + 5'; -z = parse( str ); -console.log( z ); -// => null - -str = '5 + 6 + 10e4i'; -z = parse( str ); -console.log( JSON.stringify( z ) ); -// => '{"re":11,"im":100000}' - -str = {}; -z = parse( str ); -console.log( z ); -// => null diff --git a/base/parse/lib/index.js b/base/parse/lib/index.js deleted file mode 100644 index 3c06872d..00000000 --- a/base/parse/lib/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Parse a string representing a complex number into a complex like object. -* -* @module @stdlib/complex/base/parse -* -* @example -* var parse = require( '@stdlib/complex/base/parse' ); -* -* var str = '4 + 6i'; -* -* var z = parse( str ); -* // returns { 're': 4, 'im': 6 } -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/base/parse/lib/main.js b/base/parse/lib/main.js deleted file mode 100644 index 4cfa330c..00000000 --- a/base/parse/lib/main.js +++ /dev/null @@ -1,124 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var replace = require( '@stdlib/string/replace' ); -var Number = require( '@stdlib/number/ctor' ); - - -// MAIN // - -/** -* Parses a string representing a complex number into a complex-like object. -* -* ## Notes -* -* - The function returns an object containing the following properties: -* -* - **re**: real component -* - **im**: imaginary component -* -* @param {string} str - input string -* @returns {ComplexLike} an object containing real and imaginary parts -* -* @example -* var str = '4 + 6i'; -* -* var z = parse( str ); -* // returns { 're': 4, 'im': 6 } -*/ -function parse( str ) { - var imaginaryParts = []; - var currentToken = ''; - var isImaginary; - var realParts = []; - var parts = []; - var valid = true; - var value; - var part; - var re = 0; - var im = 0; - - var i; - if ( typeof str !== 'string' ) { - return null; - } - - str = replace( str, ' ', '' ); - for ( i = 0; i < str.length; i++ ) { - if ( (str[i] === '+' || str[i] === '-') && i !== 0 && str[i - 1] !== 'e' ) { - parts.push( currentToken ); - currentToken = ''; - } else if ( i === str.length - 1 ) { - currentToken += str[ i ]; - parts.push( currentToken ); - } - currentToken += str[ i ]; - } - - for ( i = 0; i < parts.length; i++ ) { // Check for invalid parts... - part = parts[ i ]; - isImaginary = false; - - // Check for Iota on either sides: - if ( part[0] === 'i' ) { - part = part.slice( 1 ); - isImaginary = true; - } else if ( part[part.length - 1] === 'i' ) { - part = part.slice( 0, part.length - 1 ); - isImaginary = true; - } - - value = Number( part ); - if ( isNaN( value ) && part !== 'NaN' && part !== '+NaN' && part !== '-NaN' ) { - valid = false; - break; - } - - if ( isImaginary ) { - imaginaryParts.push( value ); - } - else { - realParts.push( value ); - } - } - - if ( !valid ) { - return null; - } - - for ( i = 0; i < realParts.length; i++ ) { - re += realParts[i]; - } - for ( i = 0; i < imaginaryParts.length; i++ ) { - im += imaginaryParts[i]; - } - - return { - 're': re, - 'im': im - }; -} - - -// EXPORTS // - -module.exports = parse; diff --git a/base/parse/package.json b/base/parse/package.json deleted file mode 100644 index e797ffa5..00000000 --- a/base/parse/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "@stdlib/complex/base/parse", - "version": "0.0.0", - "description": "Parse a string representing a complex number into a complex like object.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "utils", - "util", - "utilities", - "utility", - "complex", - "cmplx", - "json", - "parse", - "parser", - "unmarshal", - "deserialize", - "from", - "convert", - "string", - "object", - "obj" - ] -} diff --git a/base/parse/test/test.js b/base/parse/test/test.js deleted file mode 100644 index 7dcee4c1..00000000 --- a/base/parse/test/test.js +++ /dev/null @@ -1,171 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var parse = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof parse, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns complex like object if provided valid complex string', function test( t ) { - var tests; - var i; - - tests = [ - { - 'value': '1 + 2i', - 'expected': { - 're': 1, - 'im': 2 - } - }, - { - 'value': '1', - 'expected': { - 're': 1, - 'im': 0 - } - }, - { - 'value': '2i', - 'expected': { - 're': 0, - 'im': 2 - } - }, - { - 'value': '-2i', - 'expected': { - 're': 0, - 'im': -2 - } - }, - { - 'value': '2i', - 'expected': { - 're': 0, - 'im': 2 - } - }, - { - 'value': '1.523 - 4.234i', - 'expected': { - 're': 1.523, - 'im': -4.234 - } - }, - { - 'value': '-1.5 + 4.2i', - 'expected': { - 're': -1.5, - 'im': 4.2 - } - }, - { - 'value': '1.0e10 -2.0e-10i', - 'expected': { - 're': 1.0e10, - 'im': -2.0e-10 - } - }, - { - 'value': '1.0E10 + 4.1e+10i', - 'expected': { - 're': 1.0e10, - 'im': 4.1e+10 - } - }, - { - 'value': '1+2i', - 'expected': { - 're': 1, - 'im': 2 - } - }, - { - 'value': '1-0i', - 'expected': { - 're': 1, - 'im': 0 - } - }, - { - 'value': '0+1i', - 'expected': { - 're': 0, - 'im': 1 - } - }, - { - 'value': '-0.0 + 2.0i', - 'expected': { - 're': 0.0, - 'im': 2.0 - } - }, - { - 'value': '-Infinity + 5i', - 'expected': { - 're': -Infinity, - 'im': 5 - } - }, - { - 'value': 'Infinity-Infinityi', - 'expected': { - 're': Infinity, - 'im': -Infinity - } - } - ]; - - for ( i = 0; i < tests.length; i++ ) { - t.deepEqual( parse( tests[ i ].value ), tests[ i ].expected, 'returns expected complex like object' ); - } - t.end(); -}); - -tape( 'the function returns null if provided input is not a complex number string', function test( t ) { - var values; - var i; - - values = [ - 'boop', - '4 + 5i5', - null, - Infinity, - '55555555555555boop5', - {}, - NaN - ]; - - for ( i = 0; i < values.length; i++ ) { - t.strictEqual( parse( values[ i ] ), null, 'returns expected value' ); - } - t.end(); -}); diff --git a/base/test/test.js b/base/test/test.js deleted file mode 100644 index da72de67..00000000 --- a/base/test/test.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - - -// TESTS // - -tape( 'main export is an object', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ns, 'object', 'main export is an object' ); - t.end(); -}); - -tape( 'the exported object contains key-value pairs', function test( t ) { - var keys = objectKeys( ns ); - t.strictEqual( keys.length > 0, true, 'has keys' ); - t.end(); -}); diff --git a/base/wrap-function/README.md b/base/wrap-function/README.md deleted file mode 100644 index c7e0ecea..00000000 --- a/base/wrap-function/README.md +++ /dev/null @@ -1,128 +0,0 @@ - - -# wrap - -> Wrap a function accepting complex number arguments to support providing both real and complex numbers. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var wrap = require( '@stdlib/complex/base/wrap-function' ); -``` - -#### wrap( fcn, nargs, ctor ) - -Returns a function which wraps a function accepting complex number arguments to support providing both real and complex numbers. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var caddf = require( '@stdlib/complex/float32/base/add' ); - -var f = wrap( caddf, 2, Complex64 ); -// returns -``` - -The function accepts the following arguments: - -- **fcn**: the function to wrap. -- **nargs**: the number of arguments to be provided to the wrapped function. -- **ctor**: complex number constructor for converting real numbers to complex numbers. - -
- - - - - -
- -## Notes - -- The returned function **assumes** that the wrapped function accepts **only** complex number input arguments (i.e., every argument must be a complex number). -- The returned function **assumes** that, if an input argument is non-numeric (i.e., not of type `number`), then the input argument is a complex number. The returned function does **not** verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification. - -
- - - - - -
- -## Examples - - - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var caddf = require( '@stdlib/complex/float32/base/add' ); -var wrap = require( '@stdlib/complex/base/wrap-function' ); - -var f = wrap( caddf, 2, Complex64 ); - -// ... - -var z = f( 3.0, 4.0 ); -// returns [ 7.0, 0.0 ] - -console.log( z.toString() ); -// => '7 + 0i' -``` - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/base/wrap-function/benchmark/benchmark.js b/base/wrap-function/benchmark/benchmark.js deleted file mode 100644 index 7df27a6d..00000000 --- a/base/wrap-function/benchmark/benchmark.js +++ /dev/null @@ -1,369 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex64 = require( './../../../float32/ctor' ); -var realf = require( './../../../float32/real' ); -var imagf = require( './../../../float32/imag' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var pkg = require( './../package.json' ).name; -var wrap = require( './../lib' ); - - -// FUNCTIONS // - -function nary() { - var re; - var im; - var z; - var i; - - re = 0.0; - im = 0.0; - for ( i = 0; i < arguments.length; i++ ) { - z = arguments[ i ]; - re += realf( z ); - im += imagf( z ); - } - return new Complex64( re, im ); -} - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var f; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - f = wrap( nary, i, Complex64 ); - if ( typeof f !== 'function' ) { - b.fail( 'should return a function' ); - } - } - b.toc(); - if ( !isFunction( f ) ) { - b.fail( 'should return a function' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_nullary', function benchmark( b ) { - var f; - var v; - var i; - - f = wrap( nary, 0, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f(); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_unary,reals', function benchmark( b ) { - var f; - var v; - var i; - - f = wrap( nary, 1, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( 3.0 ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_unary,complex', function benchmark( b ) { - var f; - var v; - var z; - var i; - - f = wrap( nary, 1, Complex64 ); - z = new Complex64( 1.0, 1.0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( z ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_binary,reals', function benchmark( b ) { - var f; - var v; - var i; - - f = wrap( nary, 2, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( 3.0, 4.0 ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_binary,complex', function benchmark( b ) { - var f; - var v; - var z; - var i; - - f = wrap( nary, 2, Complex64 ); - z = new Complex64( 1.0, 1.0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( z, z ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_ternary,reals', function benchmark( b ) { - var f; - var v; - var i; - - f = wrap( nary, 3, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( 3.0, 4.0, 5.0 ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_ternary,complex', function benchmark( b ) { - var f; - var v; - var z; - var i; - - f = wrap( nary, 3, Complex64 ); - z = new Complex64( 1.0, 1.0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( z, z, z ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_quaternary,reals', function benchmark( b ) { - var f; - var v; - var i; - - f = wrap( nary, 4, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( 3.0, 4.0, 5.0, 6.0 ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_quaternary,complex', function benchmark( b ) { - var f; - var v; - var z; - var i; - - f = wrap( nary, 4, Complex64 ); - z = new Complex64( 1.0, 1.0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( z, z, z, z ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_quinary,reals', function benchmark( b ) { - var f; - var v; - var i; - - f = wrap( nary, 5, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( 3.0, 4.0, 5.0, 6.0, 7.0 ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_quinary,complex', function benchmark( b ) { - var f; - var v; - var z; - var i; - - f = wrap( nary, 5, Complex64 ); - z = new Complex64( 1.0, 1.0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( z, z, z, z, z ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_nary,reals', function benchmark( b ) { - var f; - var v; - var i; - - f = wrap( nary, 6, Complex64 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::wrapped_nary,complex', function benchmark( b ) { - var f; - var v; - var z; - var i; - - f = wrap( nary, 6, Complex64 ); - z = new Complex64( 1.0, 1.0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = f( z, z, z, z, z, z ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( v ) ) || isnanf( imagf( v ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/base/wrap-function/docs/repl.txt b/base/wrap-function/docs/repl.txt deleted file mode 100644 index e253d77a..00000000 --- a/base/wrap-function/docs/repl.txt +++ /dev/null @@ -1,43 +0,0 @@ - -{{alias}}( fcn, nargs, ctor ) - Wraps a function accepting complex number arguments to support providing - both real and complex numbers. - - The returned function *assumes* that the wrapped function accepts *only* - complex number input arguments (i.e., every argument must be a complex - number). - - The returned function *assumes* that, if an input argument is non-numeric - (i.e., not of type `number`), then the input argument is a complex number. - - The returned function does *not* verify that non-numeric input arguments - are, in fact, complex number objects. - - The returned function passes non-numeric input arguments to the wrapped - function without modification. - - Parameters - ---------- - fcn: Function - Function to wrap. - - nargs: integer - Number of arguments. - - ctor: Function - Complex number constructor. - - Returns - ------- - f: Function - Wrapped function. - - Examples - -------- - > var f = {{alias}}( {{alias:@stdlib/complex/float32/base/add}}, 2, {{alias:@stdlib/complex/float32/ctor}} ); - > var z = f( 3.0, 4.0 ) - [ 7.0, 0.0 ] - - See Also - -------- - diff --git a/base/wrap-function/docs/types/index.d.ts b/base/wrap-function/docs/types/index.d.ts deleted file mode 100644 index 242e2270..00000000 --- a/base/wrap-function/docs/types/index.d.ts +++ /dev/null @@ -1,417 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { ComplexLike } from '@stdlib/types/complex'; - -/** -* Real or complex number. -*/ -type RealOrComplex = number | ComplexLike; - -/** -* Nullary function. -* -* @returns result -*/ -type Nullary = () => any; - -/** -* Unary function accepting complex numbers. -* -* @param x - input value -* @returns result -*/ -type Unary = ( x: ComplexLike ) => any; - -/** -* Unary function accepting both real and complex numbers. -* -* @param x - input value -* @returns result -*/ -type WrappedUnary = ( x: RealOrComplex ) => any; - -/** -* Binary function accepting complex numbers. -* -* @param x - input value -* @param y - input value -* @returns result -*/ -type Binary = ( x: ComplexLike, y: ComplexLike ) => any; - -/** -* Binary function accepting both real and complex numbers. -* -* @param x - input value -* @param y - input value -* @returns result -*/ -type WrappedBinary = ( x: RealOrComplex, y: RealOrComplex ) => any; - -/** -* Ternary function accepting complex numbers. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @returns result -*/ -type Ternary = ( x: ComplexLike, y: ComplexLike, z: ComplexLike ) => any; - -/** -* Ternary function accepting both real and complex numbers. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @returns result -*/ -type WrappedTernary = ( x: RealOrComplex, y: RealOrComplex, z: RealOrComplex ) => any; - -/** -* Quaternary function accepting complex numbers. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @param w - input value -* @returns result -*/ -type Quaternary = ( x: ComplexLike, y: ComplexLike, z: ComplexLike, w: ComplexLike ) => any; - -/** -* Quaternary function accepting both real and complex numbers. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @param w - input value -* @returns result -*/ -type WrappedQuaternary = ( x: RealOrComplex, y: RealOrComplex, z: RealOrComplex, w: RealOrComplex ) => any; - -/** -* Quinary function accepting complex numbers. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @param w - input value -* @param v - input value -* @returns result -*/ -type Quinary = ( x: ComplexLike, y: ComplexLike, z: ComplexLike, w: ComplexLike, v: ComplexLike ) => any; - -/** -* Quinary function accepting both real and complex numbers. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @param w - input value -* @param v - input value -* @returns result -*/ -type WrappedQuinary = ( x: RealOrComplex, y: RealOrComplex, z: RealOrComplex, w: RealOrComplex, v: RealOrComplex ) => any; - -/** -* An n-ary function accepting complex numbers. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @param w - input value -* @param v - input value -* @param args - subsequent input values -* @returns result -*/ -type Nary = ( x: ComplexLike, y: ComplexLike, z: ComplexLike, w: ComplexLike, v: ComplexLike, ...args: Array ) => any; - -/** -* An n-ary function accepting both real and complex numbers. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @param w - input value -* @param v - input value -* @param args - subsequent input values -* @returns result -*/ -type WrappedNary = ( x: RealOrComplex, y: RealOrComplex, z: RealOrComplex, w: RealOrComplex, v: RealOrComplex, ...args: Array ) => any; - -/** -* Complex number constructor. -* -* @param re - real component -* @param im - imaginary component -* @returns complex number -*/ -type Constructor = new( re: number, im: number ) => ComplexLike; - -/** -* Wraps a nullary function accepting complex number arguments to support providing both real and complex numbers. -* -* @param fcn - nullary function to wrap -* @param nargs - number of arguments -* @param ctor - complex number constructor -* @throws second argument must be a nonnegative integer -* @returns wrapped function -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var realf = require( '@stdlib/complex/float32/real' ); -* var imagf = require( '@stdlib/complex/float32/imag' ); -* var randu = require( '@stdlib/random/base/randu' ); -* -* function randComplex() { -* return new Complex64( randu(), randu() ); -* } -* -* var f = wrap( randComplex, 0, Complex64 ); -* -* // ... -* -* var z = f(); -* // e.g., returns [ , ] -*/ -declare function wrap( fcn: Nullary, nargs: 0, ctor: Constructor ): Nullary; - -/** -* Wraps a unary function accepting complex number arguments to support providing both real and complex numbers. -* -* ## Notes -* -* - The returned function **assumes** that the wrapped function accepts **only** complex number input arguments (i.e., every argument must be a complex number). -* - The returned function **assumes** that, if an input argument is non-numeric (i.e., not of type `number`), then the input argument is a complex number. The returned function does **not** verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification. -* -* @param fcn - function to wrap -* @param nargs - number of arguments -* @param ctor - complex number constructor -* @throws second argument must be a nonnegative integer -* @returns wrapped function -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var cidentityf = require( '@stdlib/complex/float32/base/identity' ); -* -* var f = wrap( cidentityf, 1, Complex64 ); -* -* // ... -* -* var z = f( 3.0 ); -* // returns [ 3.0, 0.0 ] -*/ -declare function wrap( fcn: Unary, nargs: 1, ctor: Constructor ): WrappedUnary; - -/** -* Wraps a binary function accepting complex number arguments to support providing both real and complex numbers. -* -* ## Notes -* -* - The returned function **assumes** that the wrapped function accepts **only** complex number input arguments (i.e., every argument must be a complex number). -* - The returned function **assumes** that, if an input argument is non-numeric (i.e., not of type `number`), then the input argument is a complex number. The returned function does **not** verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification. -* -* @param fcn - function to wrap -* @param nargs - number of arguments -* @param ctor - complex number constructor -* @throws second argument must be a nonnegative integer -* @returns wrapped function -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var caddf = require( '@stdlib/complex/float32/base/add' ); -* -* var f = wrap( caddf, 2, Complex64 ); -* -* // ... -* -* var z = f( 3.0, 4.0 ); -* // returns [ 7.0, 0.0 ] -*/ -declare function wrap( fcn: Binary, nargs: 2, ctor: Constructor ): WrappedBinary; - -/** -* Wraps a ternary function accepting complex number arguments to support providing both real and complex numbers. -* -* ## Notes -* -* - The returned function **assumes** that the wrapped function accepts **only** complex number input arguments (i.e., every argument must be a complex number). -* - The returned function **assumes** that, if an input argument is non-numeric (i.e., not of type `number`), then the input argument is a complex number. The returned function does **not** verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification. -* -* @param fcn - function to wrap -* @param nargs - number of arguments -* @param ctor - complex number constructor -* @throws second argument must be a nonnegative integer -* @returns wrapped function -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var realf = require( '@stdlib/complex/float32/real' ); -* var imagf = require( '@stdlib/complex/float32/imag' ); -* -* function add( x, y, z ) { -* var re = realf( x ) + realf( y ) + realf( z ); -* var im = imagf( x ) + imagf( y ) + imagf( z ); -* return new Complex64( re, im ); -* } -* -* var f = wrap( add, 3, Complex64 ); -* -* // ... -* -* var z = f( 3.0, 4.0, 5.0 ); -* // returns -* -* var re = realf( z ); -* // returns 12.0 -* -* var im = imagf( z ); -* // returns 0.0 -*/ -declare function wrap( fcn: Ternary, nargs: 3, ctor: Constructor ): WrappedTernary; - -/** -* Wraps a quaternary function accepting complex number arguments to support providing both real and complex numbers. -* -* ## Notes -* -* - The returned function **assumes** that the wrapped function accepts **only** complex number input arguments (i.e., every argument must be a complex number). -* - The returned function **assumes** that, if an input argument is non-numeric (i.e., not of type `number`), then the input argument is a complex number. The returned function does **not** verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification. -* -* @param fcn - function to wrap -* @param nargs - number of arguments -* @param ctor - complex number constructor -* @throws second argument must be a nonnegative integer -* @returns wrapped function -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var realf = require( '@stdlib/complex/float32/real' ); -* var imagf = require( '@stdlib/complex/float32/imag' ); -* -* function add( x, y, z, w ) { -* var re = realf( x ) + realf( y ) + realf( z ) + realf( w ); -* var im = imagf( x ) + imagf( y ) + imagf( z ) + imagf( w ); -* return new Complex64( re, im ); -* } -* -* var f = wrap( add, 4, Complex64 ); -* -* // ... -* -* var z = f( 3.0, 4.0, 5.0, 6.0 ); -* // returns -* -* var re = realf( z ); -* // returns 18.0 -* -* var im = imagf( z ); -* // returns 0.0 -*/ -declare function wrap( fcn: Quaternary, nargs: 4, ctor: Constructor ): WrappedQuaternary; - -/** -* Wraps a quinary function accepting complex number arguments to support providing both real and complex numbers. -* -* ## Notes -* -* - The returned function **assumes** that the wrapped function accepts **only** complex number input arguments (i.e., every argument must be a complex number). -* - The returned function **assumes** that, if an input argument is non-numeric (i.e., not of type `number`), then the input argument is a complex number. The returned function does **not** verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification. -* -* @param fcn - function to wrap -* @param nargs - number of arguments -* @param ctor - complex number constructor -* @throws second argument must be a nonnegative integer -* @returns wrapped function -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var realf = require( '@stdlib/complex/float32/real' ); -* var imagf = require( '@stdlib/complex/float32/imag' ); -* -* function add( x, y, z, w, v ) { -* var re = realf( x ) + realf( y ) + realf( z ) + realf( w ) + realf( v ); -* var im = imagf( x ) + imagf( y ) + imagf( z ) + imagf( w ) + imagf( v ); -* return new Complex64( re, im ); -* } -* -* var f = wrap( add, 5, Complex64 ); -* -* // ... -* -* var z = f( 3.0, 4.0, 5.0, 6.0, 7.0 ); -* // returns -* -* var re = realf( z ); -* // returns 25.0 -* -* var im = imagf( z ); -* // returns 0.0 -*/ -declare function wrap( fcn: Quinary, nargs: 5, ctor: Constructor ): WrappedQuinary; - -/** -* Wraps an n-ary function accepting complex number arguments to support providing both real and complex numbers. -* -* ## Notes -* -* - The returned function **assumes** that the wrapped function accepts **only** complex number input arguments (i.e., every argument must be a complex number). -* - The returned function **assumes** that, if an input argument is non-numeric (i.e., not of type `number`), then the input argument is a complex number. The returned function does **not** verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification. -* -* @param fcn - function to wrap -* @param nargs - number of arguments -* @param ctor - complex number constructor -* @throws second argument must be a nonnegative integer -* @returns wrapped function -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var realf = require( '@stdlib/complex/float32/real' ); -* var imagf = require( '@stdlib/complex/float32/imag' ); -* -* function add( x, y, z, w, v, t ) { -* var re = realf( x ) + realf( y ) + realf( z ) + realf( w ) + realf( v ) + realf( t ); -* var im = imagf( x ) + imagf( y ) + imagf( z ) + imagf( w ) + imagf( v ) + imagf( t ); -* return new Complex64( re, im ); -* } -* -* var f = wrap( add, 6, Complex64 ); -* -* // ... -* -* var z = f( 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ); -* // returns -* -* var re = realf( z ); -* // returns 33.0 -* -* var im = imagf( z ); -* // returns 0.0 -*/ -declare function wrap( fcn: Nary, nargs: number, ctor: Constructor ): WrappedNary; - - -// EXPORTS // - -export = wrap; diff --git a/base/wrap-function/docs/types/test.ts b/base/wrap-function/docs/types/test.ts deleted file mode 100644 index c319e77c..00000000 --- a/base/wrap-function/docs/types/test.ts +++ /dev/null @@ -1,629 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/// - -import { ComplexLike } from '@stdlib/types/complex'; -import Complex64 = require( './../../../../float32/ctor' ); -import wrap = require( './index' ); - -/** -* Nullary function. -* -* @returns result -*/ -function nullary(): ComplexLike { - return new Complex64( 1.0, 1.0 ); -} - -/** -* Unary function. -* -* @param x - input value -* @returns result -*/ -function unary( x: ComplexLike ): ComplexLike { - const re: number = x.re; - const im: number = x.im; - return new Complex64( re, im ); -} - -/** -* Binary function. -* -* @param x - input value -* @param y - input value -* @returns result -*/ -function binary( x: ComplexLike, y: ComplexLike ): ComplexLike { - const re: number = x.re + y.re; - const im: number = x.im + y.im; - return new Complex64( re, im ); -} - -/** -* Ternary function. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @returns result -*/ -function ternary( x: ComplexLike, y: ComplexLike, z: ComplexLike ): ComplexLike { - const re: number = x.re + y.re + z.re; - const im: number = x.im + y.im + z.im; - return new Complex64( re, im ); -} - -/** -* Quaternary function. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @param w - input value -* @returns result -*/ -function quaternary( x: ComplexLike, y: ComplexLike, z: ComplexLike, w: ComplexLike ): ComplexLike { - const re: number = x.re + y.re + z.re + w.re; - const im: number = x.im + y.im + z.im + w.im; - return new Complex64( re, im ); -} - -/** -* Quinary function. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @param w - input value -* @param v - input value -* @returns result -*/ -function quinary( x: ComplexLike, y: ComplexLike, z: ComplexLike, w: ComplexLike, v: ComplexLike ): ComplexLike { - const re: number = x.re + y.re + z.re + w.re + v.re; - const im: number = x.im + y.im + z.im + w.im + v.im; - return new Complex64( re, im ); -} - -/** -* N-ary function. -* -* @param x - input value -* @param y - input value -* @param z - input value -* @param w - input value -* @param v - input value -* @param t - input value -* @returns result -*/ -function nary( x: ComplexLike, y: ComplexLike, z: ComplexLike, w: ComplexLike, v: ComplexLike, t: ComplexLike ): ComplexLike { - const re: number = x.re + y.re + z.re + w.re + v.re + t.re; - const im: number = x.im + y.im + z.im + w.im + v.im + t.im; - return new Complex64( re, im ); -} - - -// TESTS // - -// The function returns a wrapped function... -{ - wrap( nullary, 0, Complex64 ); // $ExpectType Nullary - wrap( unary, 1, Complex64 ); // $ExpectType WrappedUnary - wrap( binary, 2, Complex64 ); // $ExpectType WrappedBinary - wrap( ternary, 3, Complex64 ); // $ExpectType WrappedTernary - wrap( quaternary, 4, Complex64 ); // $ExpectType WrappedQuaternary - wrap( quinary, 5, Complex64 ); // $ExpectType WrappedQuinary - wrap( nary, 6, Complex64 ); // $ExpectType WrappedNary -} - -// The compiler throws an error if the function is provided a first argument that is not a complex number function... -{ - wrap( 'abc', 1, Complex64 ); // $ExpectError - wrap( 123, 1, Complex64 ); // $ExpectError - wrap( true, 1, Complex64 ); // $ExpectError - wrap( false, 1, Complex64 ); // $ExpectError - wrap( null, 1, Complex64 ); // $ExpectError - wrap( undefined, 1, Complex64 ); // $ExpectError - wrap( [], 1, Complex64 ); // $ExpectError - wrap( {}, 1, Complex64 ); // $ExpectError - wrap( ( x: number ): number => x, 1, Complex64 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a number... -{ - wrap( binary, 'abc', Complex64 ); // $ExpectError - wrap( binary, true, Complex64 ); // $ExpectError - wrap( binary, false, Complex64 ); // $ExpectError - wrap( binary, null, Complex64 ); // $ExpectError - wrap( binary, undefined, Complex64 ); // $ExpectError - wrap( binary, [], Complex64 ); // $ExpectError - wrap( binary, {}, Complex64 ); // $ExpectError - wrap( binary, ( x: number ): number => x, Complex64 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a third argument that is not a complex number constructor... -{ - wrap( binary, 2, 'abc' ); // $ExpectError - wrap( binary, 2, 1 ); // $ExpectError - wrap( binary, 2, true ); // $ExpectError - wrap( binary, 2, false ); // $ExpectError - wrap( binary, 2, null ); // $ExpectError - wrap( binary, 2, undefined ); // $ExpectError - wrap( binary, 2, [] ); // $ExpectError - wrap( binary, 2, {} ); // $ExpectError - wrap( binary, 2, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - wrap(); // $ExpectError - wrap( binary ); // $ExpectError - wrap( binary, 2 ); // $ExpectError - wrap( binary, 2, Complex64, true ); // $ExpectError -} - -// The function returns a function which returns a computed result... -{ - const z = new Complex64( 1.0, 1.0 ); - - const f0 = wrap( nullary, 0, Complex64 ); - f0(); - - const f1 = wrap( unary, 1, Complex64 ); - f1( 1.0 ); - f1( z ); - - const f2 = wrap( binary, 2, Complex64 ); - f2( 1.0, 1.0 ); - f2( 1.0, z ); - f2( z, 1.0 ); - f2( z, z ); - - const f3 = wrap( ternary, 3, Complex64 ); - f3( 1.0, 1.0, 1.0 ); - f3( 1.0, 1.0, z ); - f3( 1.0, z, 1.0 ); - f3( z, 1.0, 1.0 ); - f3( z, z, 1.0 ); - f3( z, 1.0, z ); - f3( 1.0, z, z ); - f3( z, z, z ); - - const f4 = wrap( quaternary, 4, Complex64 ); - f4( 1.0, 1.0, 1.0, 1.0 ); - f4( 1.0, 1.0, 1.0, z ); - f4( 1.0, 1.0, z, 1.0 ); - f4( 1.0, z, 1.0, 1.0 ); - f4( z, 1.0, 1.0, 1.0 ); - f4( z, z, 1.0, 1.0 ); - f4( z, 1.0, z, 1.0 ); - f4( 1.0, z, z, 1.0 ); - f4( z, z, z, z ); - - const f5 = wrap( quinary, 5, Complex64 ); - f5( 1.0, 1.0, 1.0, 1.0, 1.0 ); - f5( 1.0, 1.0, 1.0, 1.0, z ); - f5( 1.0, 1.0, 1.0, z, 1.0 ); - f5( 1.0, 1.0, z, 1.0, 1.0 ); - f5( 1.0, z, 1.0, 1.0, 1.0 ); - f5( z, 1.0, 1.0, 1.0, 1.0 ); - f5( z, z, 1.0, 1.0, z ); - f5( z, 1.0, z, 1.0, 1.0 ); - f5( 1.0, z, z, 1.0, z ); - f5( z, z, z, z, z ); - - const f6 = wrap( nary, 6, Complex64 ); - f6( 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ); - f6( 1.0, 1.0, 1.0, 1.0, 1.0, z ); - f6( 1.0, 1.0, 1.0, 1.0, z, 1.0 ); - f6( 1.0, 1.0, 1.0, z, 1.0, 1.0 ); - f6( 1.0, 1.0, z, 1.0, 1.0, 1.0 ); - f6( 1.0, z, 1.0, 1.0, 1.0, 1.0 ); - f6( z, 1.0, 1.0, 1.0, 1.0, 1.0 ); - f6( z, z, 1.0, 1.0, z, z ); - f6( z, 1.0, z, 1.0, 1.0, 1.0 ); - f6( 1.0, z, z, 1.0, z, 1.0 ); - f6( z, z, z, z, z, z ); -} - -// The compiler throws an error if the returned function is not provided real or complex number arguments... -{ - const z = new Complex64( 1.0, 1.0 ); - - const f1 = wrap( unary, 1, Complex64 ); - - f1( 'beep' ); // $ExpectError - f1( true ); // $ExpectError - f1( false ); // $ExpectError - f1( null ); // $ExpectError - f1( undefined ); // $ExpectError - f1( [] ); // $ExpectError - f1( {} ); // $ExpectError - f1( ( x: number ): number => x ); // $ExpectError - - const f2 = wrap( binary, 2, Complex64 ); - - f2( 'beep', 1.0 ); // $ExpectError - f2( true, 1.0 ); // $ExpectError - f2( false, 1.0 ); // $ExpectError - f2( null, 1.0 ); // $ExpectError - f2( undefined, 1.0 ); // $ExpectError - f2( [], 1.0 ); // $ExpectError - f2( {}, 1.0 ); // $ExpectError - f2( ( x: number ): number => x, 1.0 ); // $ExpectError - - f2( 'beep', z ); // $ExpectError - f2( true, z ); // $ExpectError - f2( false, z ); // $ExpectError - f2( null, z ); // $ExpectError - f2( undefined, z ); // $ExpectError - f2( [], z ); // $ExpectError - f2( {}, z ); // $ExpectError - f2( ( x: number ): number => x, z ); // $ExpectError - - f2( 1.0, 'beep' ); // $ExpectError - f2( 1.0, true ); // $ExpectError - f2( 1.0, false ); // $ExpectError - f2( 1.0, null ); // $ExpectError - f2( 1.0, undefined ); // $ExpectError - f2( 1.0, [] ); // $ExpectError - f2( 1.0, {} ); // $ExpectError - f2( 1.0, ( x: number ): number => x ); // $ExpectError - - f2( z, 'beep' ); // $ExpectError - f2( z, true ); // $ExpectError - f2( z, false ); // $ExpectError - f2( z, null ); // $ExpectError - f2( z, undefined ); // $ExpectError - f2( z, [] ); // $ExpectError - f2( z, {} ); // $ExpectError - f2( z, ( x: number ): number => x ); // $ExpectError - - const f3 = wrap( ternary, 3, Complex64 ); - - f3( 'beep', 1.0, 1.0 ); // $ExpectError - f3( true, 1.0, 1.0 ); // $ExpectError - f3( false, 1.0, 1.0 ); // $ExpectError - f3( null, 1.0, 1.0 ); // $ExpectError - f3( undefined, 1.0, 1.0 ); // $ExpectError - f3( [], 1.0, 1.0 ); // $ExpectError - f3( {}, 1.0, 1.0 ); // $ExpectError - f3( ( x: number ): number => x, 1.0, 1.0 ); // $ExpectError - - f3( 'beep', z, z ); // $ExpectError - f3( true, z, z ); // $ExpectError - f3( false, z, z ); // $ExpectError - f3( null, z, z ); // $ExpectError - f3( undefined, z, z ); // $ExpectError - f3( [], z, z ); // $ExpectError - f3( {}, z, z ); // $ExpectError - f3( ( x: number ): number => x, z, z ); // $ExpectError - - f3( 1.0, 'beep', 1.0 ); // $ExpectError - f3( 1.0, true, 1.0 ); // $ExpectError - f3( 1.0, false, 1.0 ); // $ExpectError - f3( 1.0, null, 1.0 ); // $ExpectError - f3( 1.0, undefined, 1.0 ); // $ExpectError - f3( 1.0, [], 1.0 ); // $ExpectError - f3( 1.0, {}, 1.0 ); // $ExpectError - f3( 1.0, ( x: number ): number => x, 1.0 ); // $ExpectError - - f3( z, 'beep', z ); // $ExpectError - f3( z, true, z ); // $ExpectError - f3( z, false, z ); // $ExpectError - f3( z, null, z ); // $ExpectError - f3( z, undefined, z ); // $ExpectError - f3( z, [], z ); // $ExpectError - f3( z, {}, z ); // $ExpectError - f3( z, ( x: number ): number => x, z ); // $ExpectError - - f3( 1.0, 1.0, 'beep' ); // $ExpectError - f3( 1.0, 1.0, true ); // $ExpectError - f3( 1.0, 1.0, false ); // $ExpectError - f3( 1.0, 1.0, null ); // $ExpectError - f3( 1.0, 1.0, undefined ); // $ExpectError - f3( 1.0, 1.0, [] ); // $ExpectError - f3( 1.0, 1.0, {} ); // $ExpectError - f3( 1.0, 1.0, ( x: number ): number => x ); // $ExpectError - - f3( z, z, 'beep' ); // $ExpectError - f3( z, z, true ); // $ExpectError - f3( z, z, false ); // $ExpectError - f3( z, z, null ); // $ExpectError - f3( z, z, undefined ); // $ExpectError - f3( z, z, [] ); // $ExpectError - f3( z, z, {} ); // $ExpectError - f3( z, z, ( x: number ): number => x ); // $ExpectError - - const f4 = wrap( ternary, 4, Complex64 ); - - f4( 'beep', 1.0, 1.0, 1.0 ); // $ExpectError - f4( true, 1.0, 1.0, 1.0 ); // $ExpectError - f4( false, 1.0, 1.0, 1.0 ); // $ExpectError - f4( null, 1.0, 1.0, 1.0 ); // $ExpectError - f4( undefined, 1.0, 1.0, 1.0 ); // $ExpectError - f4( [], 1.0, 1.0, 1.0 ); // $ExpectError - f4( {}, 1.0, 1.0, 1.0 ); // $ExpectError - f4( ( x: number ): number => x, 1.0, 1.0, 1.0 ); // $ExpectError - - f4( 'beep', z, z, z ); // $ExpectError - f4( true, z, z, z ); // $ExpectError - f4( false, z, z, z ); // $ExpectError - f4( null, z, z, z ); // $ExpectError - f4( undefined, z, z, z ); // $ExpectError - f4( [], z, z, z ); // $ExpectError - f4( {}, z, z, z ); // $ExpectError - f4( ( x: number ): number => x, z, z, z ); // $ExpectError - - f4( 1.0, 'beep', 1.0, 1.0 ); // $ExpectError - f4( 1.0, true, 1.0, 1.0 ); // $ExpectError - f4( 1.0, false, 1.0, 1.0 ); // $ExpectError - f4( 1.0, null, 1.0, 1.0 ); // $ExpectError - f4( 1.0, undefined, 1.0, 1.0 ); // $ExpectError - f4( 1.0, [], 1.0, 1.0 ); // $ExpectError - f4( 1.0, {}, 1.0, 1.0 ); // $ExpectError - f4( 1.0, ( x: number ): number => x, 1.0, 1.0 ); // $ExpectError - - f4( z, 'beep', z, z ); // $ExpectError - f4( z, true, z, z ); // $ExpectError - f4( z, false, z, z ); // $ExpectError - f4( z, null, z, z ); // $ExpectError - f4( z, undefined, z, z ); // $ExpectError - f4( z, [], z, z ); // $ExpectError - f4( z, {}, z, z ); // $ExpectError - f4( z, ( x: number ): number => x, z, z ); // $ExpectError - - f4( 1.0, 1.0, 'beep', 1.0 ); // $ExpectError - f4( 1.0, 1.0, true, 1.0 ); // $ExpectError - f4( 1.0, 1.0, false, 1.0 ); // $ExpectError - f4( 1.0, 1.0, null, 1.0 ); // $ExpectError - f4( 1.0, 1.0, undefined, 1.0 ); // $ExpectError - f4( 1.0, 1.0, [], 1.0 ); // $ExpectError - f4( 1.0, 1.0, {}, 1.0 ); // $ExpectError - f4( 1.0, 1.0, ( x: number ): number => x, 1.0 ); // $ExpectError - - f4( z, z, 'beep', z ); // $ExpectError - f4( z, z, true, z ); // $ExpectError - f4( z, z, false, z ); // $ExpectError - f4( z, z, null, z ); // $ExpectError - f4( z, z, undefined, z ); // $ExpectError - f4( z, z, [], z ); // $ExpectError - f4( z, z, {}, z ); // $ExpectError - f4( z, z, ( x: number ): number => x, z ); // $ExpectError - - f4( 1.0, 1.0, 1.0, 'beep' ); // $ExpectError - f4( 1.0, 1.0, 1.0, true ); // $ExpectError - f4( 1.0, 1.0, 1.0, false ); // $ExpectError - f4( 1.0, 1.0, 1.0, null ); // $ExpectError - f4( 1.0, 1.0, 1.0, undefined ); // $ExpectError - f4( 1.0, 1.0, 1.0, [] ); // $ExpectError - f4( 1.0, 1.0, 1.0, {} ); // $ExpectError - f4( 1.0, 1.0, 1.0, ( x: number ): number => x ); // $ExpectError - - f4( z, z, z, 'beep' ); // $ExpectError - f4( z, z, z, true ); // $ExpectError - f4( z, z, z, false ); // $ExpectError - f4( z, z, z, null ); // $ExpectError - f4( z, z, z, undefined ); // $ExpectError - f4( z, z, z, [] ); // $ExpectError - f4( z, z, z, {} ); // $ExpectError - f4( z, z, z, ( x: number ): number => x ); // $ExpectError - - const f5 = wrap( ternary, 5, Complex64 ); - - f5( 'beep', 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f5( true, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f5( false, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f5( null, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f5( undefined, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f5( [], 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f5( {}, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f5( ( x: number ): number => x, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - - f5( 'beep', z, z, z, z ); // $ExpectError - f5( true, z, z, z, z ); // $ExpectError - f5( false, z, z, z, z ); // $ExpectError - f5( null, z, z, z, z ); // $ExpectError - f5( undefined, z, z, z, z ); // $ExpectError - f5( [], z, z, z, z ); // $ExpectError - f5( {}, z, z, z, z ); // $ExpectError - f5( ( x: number ): number => x, z, z, z, z ); // $ExpectError - - f5( 1.0, 'beep', 1.0, 1.0, 1.0 ); // $ExpectError - f5( 1.0, true, 1.0, 1.0, 1.0 ); // $ExpectError - f5( 1.0, false, 1.0, 1.0, 1.0 ); // $ExpectError - f5( 1.0, null, 1.0, 1.0, 1.0 ); // $ExpectError - f5( 1.0, undefined, 1.0, 1.0, 1.0 ); // $ExpectError - f5( 1.0, [], 1.0, 1.0, 1.0 ); // $ExpectError - f5( 1.0, {}, 1.0, 1.0, 1.0 ); // $ExpectError - f5( 1.0, ( x: number ): number => x, 1.0, 1.0, 1.0 ); // $ExpectError - - f5( z, 'beep', z, z, z ); // $ExpectError - f5( z, true, z, z, z ); // $ExpectError - f5( z, false, z, z, z ); // $ExpectError - f5( z, null, z, z, z ); // $ExpectError - f5( z, undefined, z, z, z ); // $ExpectError - f5( z, [], z, z, z ); // $ExpectError - f5( z, {}, z, z, z ); // $ExpectError - f5( z, ( x: number ): number => x, z, z, z ); // $ExpectError - - f5( 1.0, 1.0, 'beep', 1.0, 1.0 ); // $ExpectError - f5( 1.0, 1.0, true, 1.0, 1.0 ); // $ExpectError - f5( 1.0, 1.0, false, 1.0, 1.0 ); // $ExpectError - f5( 1.0, 1.0, null, 1.0, 1.0 ); // $ExpectError - f5( 1.0, 1.0, undefined, 1.0, 1.0 ); // $ExpectError - f5( 1.0, 1.0, [], 1.0, 1.0 ); // $ExpectError - f5( 1.0, 1.0, {}, 1.0, 1.0 ); // $ExpectError - f5( 1.0, 1.0, ( x: number ): number => x, 1.0, 1.0 ); // $ExpectError - - f5( z, z, 'beep', z, z ); // $ExpectError - f5( z, z, true, z, z ); // $ExpectError - f5( z, z, false, z, z ); // $ExpectError - f5( z, z, null, z, z ); // $ExpectError - f5( z, z, undefined, z, z ); // $ExpectError - f5( z, z, [], z, z ); // $ExpectError - f5( z, z, {}, z, z ); // $ExpectError - f5( z, z, ( x: number ): number => x, z, z ); // $ExpectError - - f5( 1.0, 1.0, 1.0, 'beep', 1.0 ); // $ExpectError - f5( 1.0, 1.0, 1.0, true, 1.0 ); // $ExpectError - f5( 1.0, 1.0, 1.0, false, 1.0 ); // $ExpectError - f5( 1.0, 1.0, 1.0, null, 1.0 ); // $ExpectError - f5( 1.0, 1.0, 1.0, undefined, 1.0 ); // $ExpectError - f5( 1.0, 1.0, 1.0, [], 1.0 ); // $ExpectError - f5( 1.0, 1.0, 1.0, {}, 1.0 ); // $ExpectError - f5( 1.0, 1.0, 1.0, ( x: number ): number => x, 1.0 ); // $ExpectError - - f5( z, z, z, 'beep', z ); // $ExpectError - f5( z, z, z, true, z ); // $ExpectError - f5( z, z, z, false, z ); // $ExpectError - f5( z, z, z, null, z ); // $ExpectError - f5( z, z, z, undefined, z ); // $ExpectError - f5( z, z, z, [], z ); // $ExpectError - f5( z, z, z, {}, z ); // $ExpectError - f5( z, z, z, ( x: number ): number => x, z ); // $ExpectError - - f5( 1.0, 1.0, 1.0, 1.0, 'beep' ); // $ExpectError - f5( 1.0, 1.0, 1.0, 1.0, true ); // $ExpectError - f5( 1.0, 1.0, 1.0, 1.0, false ); // $ExpectError - f5( 1.0, 1.0, 1.0, 1.0, null ); // $ExpectError - f5( 1.0, 1.0, 1.0, 1.0, undefined ); // $ExpectError - f5( 1.0, 1.0, 1.0, 1.0, [] ); // $ExpectError - f5( 1.0, 1.0, 1.0, 1.0, {} ); // $ExpectError - f5( 1.0, 1.0, 1.0, 1.0, ( x: number ): number => x ); // $ExpectError - - f5( z, z, z, z, 'beep' ); // $ExpectError - f5( z, z, z, z, true ); // $ExpectError - f5( z, z, z, z, false ); // $ExpectError - f5( z, z, z, z, null ); // $ExpectError - f5( z, z, z, z, undefined ); // $ExpectError - f5( z, z, z, z, [] ); // $ExpectError - f5( z, z, z, z, {} ); // $ExpectError - f5( z, z, z, z, ( x: number ): number => x ); // $ExpectError - - const f6 = wrap( ternary, 6, Complex64 ); - - f6( 'beep', 1.0, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f6( true, 1.0, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f6( false, 1.0, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f6( null, 1.0, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f6( undefined, 1.0, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f6( [], 1.0, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f6( {}, 1.0, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f6( ( x: number ): number => x, 1.0, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - - f6( 'beep', z, z, z, z, z ); // $ExpectError - f6( true, z, z, z, z, z ); // $ExpectError - f6( false, z, z, z, z, z ); // $ExpectError - f6( null, z, z, z, z, z ); // $ExpectError - f6( undefined, z, z, z, z, z ); // $ExpectError - f6( [], z, z, z, z, z ); // $ExpectError - f6( {}, z, z, z, z, z ); // $ExpectError - f6( ( x: number ): number => x, z, z, z, z, z ); // $ExpectError - - f6( 1.0, 'beep', 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f6( 1.0, true, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f6( 1.0, false, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f6( 1.0, null, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f6( 1.0, undefined, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f6( 1.0, [], 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f6( 1.0, {}, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - f6( 1.0, ( x: number ): number => x, 1.0, 1.0, 1.0, 1.0 ); // $ExpectError - - f6( z, 'beep', z, z, z, z ); // $ExpectError - f6( z, true, z, z, z, z ); // $ExpectError - f6( z, false, z, z, z, z ); // $ExpectError - f6( z, null, z, z, z, z ); // $ExpectError - f6( z, undefined, z, z, z, z ); // $ExpectError - f6( z, [], z, z, z, z ); // $ExpectError - f6( z, {}, z, z, z, z ); // $ExpectError - f6( z, ( x: number ): number => x, z, z, z, z ); // $ExpectError - - f6( 1.0, 1.0, 'beep', 1.0, 1.0, 1.0 ); // $ExpectError - f6( 1.0, 1.0, true, 1.0, 1.0, 1.0 ); // $ExpectError - f6( 1.0, 1.0, false, 1.0, 1.0, 1.0 ); // $ExpectError - f6( 1.0, 1.0, null, 1.0, 1.0, 1.0 ); // $ExpectError - f6( 1.0, 1.0, undefined, 1.0, 1.0, 1.0 ); // $ExpectError - f6( 1.0, 1.0, [], 1.0, 1.0, 1.0 ); // $ExpectError - f6( 1.0, 1.0, {}, 1.0, 1.0, 1.0 ); // $ExpectError - f6( 1.0, 1.0, ( x: number ): number => x, 1.0, 1.0, 1.0 ); // $ExpectError - - f6( z, z, 'beep', z, z, z ); // $ExpectError - f6( z, z, true, z, z, z ); // $ExpectError - f6( z, z, false, z, z, z ); // $ExpectError - f6( z, z, null, z, z, z ); // $ExpectError - f6( z, z, undefined, z, z, z ); // $ExpectError - f6( z, z, [], z, z, z ); // $ExpectError - f6( z, z, {}, z, z, z ); // $ExpectError - f6( z, z, ( x: number ): number => x, z, z, z ); // $ExpectError - - f6( 1.0, 1.0, 1.0, 'beep', 1.0, 1.0 ); // $ExpectError - f6( 1.0, 1.0, 1.0, true, 1.0, 1.0 ); // $ExpectError - f6( 1.0, 1.0, 1.0, false, 1.0, 1.0 ); // $ExpectError - f6( 1.0, 1.0, 1.0, null, 1.0, 1.0 ); // $ExpectError - f6( 1.0, 1.0, 1.0, undefined, 1.0, 1.0 ); // $ExpectError - f6( 1.0, 1.0, 1.0, [], 1.0, 1.0 ); // $ExpectError - f6( 1.0, 1.0, 1.0, {}, 1.0, 1.0 ); // $ExpectError - f6( 1.0, 1.0, 1.0, ( x: number ): number => x, 1.0, 1.0 ); // $ExpectError - - f6( z, z, z, 'beep', z, z ); // $ExpectError - f6( z, z, z, true, z, z ); // $ExpectError - f6( z, z, z, false, z, z ); // $ExpectError - f6( z, z, z, null, z, z ); // $ExpectError - f6( z, z, z, undefined, z, z ); // $ExpectError - f6( z, z, z, [], z, z ); // $ExpectError - f6( z, z, z, {}, z, z ); // $ExpectError - f6( z, z, z, ( x: number ): number => x, z, z ); // $ExpectError - - f6( 1.0, 1.0, 1.0, 1.0, 'beep', 1.0 ); // $ExpectError - f6( 1.0, 1.0, 1.0, 1.0, true, 1.0 ); // $ExpectError - f6( 1.0, 1.0, 1.0, 1.0, false, 1.0 ); // $ExpectError - f6( 1.0, 1.0, 1.0, 1.0, null, 1.0 ); // $ExpectError - f6( 1.0, 1.0, 1.0, 1.0, undefined, 1.0 ); // $ExpectError - f6( 1.0, 1.0, 1.0, 1.0, [], 1.0 ); // $ExpectError - f6( 1.0, 1.0, 1.0, 1.0, {}, 1.0 ); // $ExpectError - f6( 1.0, 1.0, 1.0, 1.0, ( x: number ): number => x, 1.0 ); // $ExpectError - - f6( z, z, z, z, 'beep', z ); // $ExpectError - f6( z, z, z, z, true, z ); // $ExpectError - f6( z, z, z, z, false, z ); // $ExpectError - f6( z, z, z, z, null, z ); // $ExpectError - f6( z, z, z, z, undefined, z ); // $ExpectError - f6( z, z, z, z, [], z ); // $ExpectError - f6( z, z, z, z, {}, z ); // $ExpectError - f6( z, z, z, z, ( x: number ): number => x, z ); // $ExpectError - - f6( 1.0, 1.0, 1.0, 1.0, 1.0, 'beep' ); // $ExpectError - f6( 1.0, 1.0, 1.0, 1.0, 1.0, true ); // $ExpectError - f6( 1.0, 1.0, 1.0, 1.0, 1.0, false ); // $ExpectError - f6( 1.0, 1.0, 1.0, 1.0, 1.0, null ); // $ExpectError - f6( 1.0, 1.0, 1.0, 1.0, 1.0, undefined ); // $ExpectError - f6( 1.0, 1.0, 1.0, 1.0, 1.0, [] ); // $ExpectError - f6( 1.0, 1.0, 1.0, 1.0, 1.0, {} ); // $ExpectError - f6( 1.0, 1.0, 1.0, 1.0, 1.0, ( x: number ): number => x ); // $ExpectError - - f6( z, z, z, z, z, 'beep' ); // $ExpectError - f6( z, z, z, z, z, true ); // $ExpectError - f6( z, z, z, z, z, false ); // $ExpectError - f6( z, z, z, z, z, null ); // $ExpectError - f6( z, z, z, z, z, undefined ); // $ExpectError - f6( z, z, z, z, z, [] ); // $ExpectError - f6( z, z, z, z, z, {} ); // $ExpectError - f6( z, z, z, z, z, ( x: number ): number => x ); // $ExpectError -} diff --git a/base/wrap-function/examples/index.js b/base/wrap-function/examples/index.js deleted file mode 100644 index efa0b801..00000000 --- a/base/wrap-function/examples/index.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64 = require( './../../../float32/ctor' ); -var caddf = require( './../../../float32/base/add' ); -var wrap = require( './../lib' ); - -var f = wrap( caddf, 2, Complex64 ); - -// ... - -var z = f( 3.0, 4.0 ); -// returns [ 7.0, 0.0 ] - -console.log( z.toString() ); -// => '7 + 0i' diff --git a/base/wrap-function/lib/index.js b/base/wrap-function/lib/index.js deleted file mode 100644 index 30ec7116..00000000 --- a/base/wrap-function/lib/index.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Wrap a function accepting complex number arguments to support providing both real and complex numbers. -* -* @module @stdlib/complex/base/wrap-function -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var caddf = require( '@stdlib/complex/float32/base/add' ); -* var wrap = require( '@stdlib/complex/base/wrap-function' ); -* -* var f = wrap( caddf, 2, Complex64 ); -* -* // ... -* -* var z = f( 3.0, 4.0 ); -* // returns [ 7.0, 0.0 ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/base/wrap-function/lib/main.js b/base/wrap-function/lib/main.js deleted file mode 100644 index b380d1dd..00000000 --- a/base/wrap-function/lib/main.js +++ /dev/null @@ -1,225 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable valid-typeof */ - -'use strict'; - -// MODULES // - -var isFunction = require( '@stdlib/assert/is-function' ); -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var T = 'number'; - - -// FUNCTIONS // - -/** -* Wraps a function accepting complex number arguments to support providing both real and complex numbers. -* -* ## Notes -* -* - The returned function **assumes** that the wrapped function accepts **only** complex number input arguments (i.e., every argument must be a complex number). -* - The returned function **assumes** that, if an input argument is non-numeric (i.e., not of type `number`), then the input argument is a complex number. The returned function does **not** verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification. -* -* @param {Function} fcn - function to wrap -* @param {NonNegativeInteger} nargs - number of arguments -* @param {Function} ctor - complex number constructor -* @throws {TypeError} first argument must be a function -* @throws {TypeError} second argument must be a nonnegative integer -* @throws {TypeError} third argument must be a constructor function -* @returns {Function} wrapped function -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var caddf = require( '@stdlib/complex/float32/base/add' ); -* -* var f = wrap( caddf, 2, Complex64 ); -* -* // ... -* -* var z = f( 3.0, 4.0 ); -* // returns [ 7.0, 0.0 ] -*/ -function wrap( fcn, nargs, ctor ) { - var fcns; - if ( !isFunction( fcn ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) ); - } - if ( !isNonNegativeInteger( nargs ) ) { - throw new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', nargs ) ); - } - if ( !isFunction( ctor ) ) { - throw new TypeError( format( 'invalid argument. Third argument must be a constructor function. Value: `%s`.', ctor ) ); - } - fcns = [ fcn0, fcn1, fcn2, fcn3, fcn4, fcn5 ]; - return ( nargs <= 5 ) ? fcns[ nargs ] : fcnN; - - /** - * Invokes a nullary function. - * - * @private - * @returns {*} result - */ - function fcn0() { - return fcn(); - } - - /** - * Invokes a unary function accepting complex numbers. - * - * @private - * @param {(number|Complex)} x - input value - * @returns {*} result - */ - function fcn1( x ) { - if ( typeof x === T ) { - x = new ctor( x, 0.0 ); - } - return fcn( x ); - } - - /** - * Invokes a binary function accepting complex numbers. - * - * @private - * @param {(number|Complex)} x - input value - * @param {(number|Complex)} y - input value - * @returns {*} result - */ - function fcn2( x, y ) { - if ( typeof x === T ) { - x = new ctor( x, 0.0 ); - } - if ( typeof y === T ) { - y = new ctor( y, 0.0 ); - } - return fcn( x, y ); - } - - /** - * Invokes a ternary function accepting complex numbers. - * - * @private - * @param {(number|Complex)} x - input value - * @param {(number|Complex)} y - input value - * @param {(number|Complex)} z - input value - * @returns {*} result - */ - function fcn3( x, y, z ) { - if ( typeof x === T ) { - x = new ctor( x, 0.0 ); - } - if ( typeof y === T ) { - y = new ctor( y, 0.0 ); - } - if ( typeof z === T ) { - z = new ctor( z, 0.0 ); - } - return fcn( x, y, z ); - } - - /** - * Invokes a quaternary function accepting complex numbers. - * - * @private - * @param {(number|Complex)} x - input value - * @param {(number|Complex)} y - input value - * @param {(number|Complex)} z - input value - * @param {(number|Complex)} w - input value - * @returns {*} result - */ - function fcn4( x, y, z, w ) { - if ( typeof x === T ) { - x = new ctor( x, 0.0 ); - } - if ( typeof y === T ) { - y = new ctor( y, 0.0 ); - } - if ( typeof z === T ) { - z = new ctor( z, 0.0 ); - } - if ( typeof w === T ) { - w = new ctor( w, 0.0 ); - } - return fcn( x, y, z, w ); - } - - /** - * Invokes a quinary function accepting complex numbers. - * - * @private - * @param {(number|Complex)} x - input value - * @param {(number|Complex)} y - input value - * @param {(number|Complex)} z - input value - * @param {(number|Complex)} w - input value - * @param {(number|Complex)} v - input value - * @returns {*} result - */ - function fcn5( x, y, z, w, v ) { - if ( typeof x === T ) { - x = new ctor( x, 0.0 ); - } - if ( typeof y === T ) { - y = new ctor( y, 0.0 ); - } - if ( typeof z === T ) { - z = new ctor( z, 0.0 ); - } - if ( typeof w === T ) { - w = new ctor( w, 0.0 ); - } - if ( typeof v === T ) { - v = new ctor( v, 0.0 ); - } - return fcn( x, y, z, w, v ); - } - - /** - * Invokes a function accepting an arbitrary number of complex number input arguments. - * - * @private - * @param {...(number|Complex)} args - input values - * @returns {*} result - */ - function fcnN() { - var args; - var v; - var i; - - args = []; - for ( i = 0; i < arguments.length; i++ ) { - v = arguments[ i ]; - if ( typeof v === T ) { - v = new ctor( v, 0.0 ); - } - args.push( v ); - } - return fcn.apply( null, args ); - } -} - - -// EXPORTS // - -module.exports = wrap; diff --git a/base/wrap-function/package.json b/base/wrap-function/package.json deleted file mode 100644 index f154b805..00000000 --- a/base/wrap-function/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "@stdlib/complex/base/wrap-function", - "version": "0.0.0", - "description": "Wrap a function accepting complex number arguments to support providing both real and complex numbers.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "types", - "data", - "structure", - "complex", - "cmplx", - "number", - "base", - "wrap" - ] -} diff --git a/base/wrap-function/test/test.js b/base/wrap-function/test/test.js deleted file mode 100644 index f65c89d9..00000000 --- a/base/wrap-function/test/test.js +++ /dev/null @@ -1,455 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex64 = require( './../../../float32/ctor' ); -var realf = require( './../../../float32/real' ); -var imagf = require( './../../../float32/imag' ); -var wrap = require( './../lib' ); - - -// FUNCTIONS // - -function nary() { - var re; - var im; - var z; - var i; - - re = 0.0; - im = 0.0; - for ( i = 0; i < arguments.length; i++ ) { - z = arguments[ i ]; - re += realf( z ); - im += imagf( z ); - } - return new Complex64( re, im ); -} - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof wrap, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function throws an error if not provided a first argument which is a function', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - null, - void 0, - [], - {} - ]; - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - wrap( value, 2, Complex64 ); - }; - } -}); - -tape( 'the function throws an error if not provided a second argument which is a nonnegative integer', function test( t ) { - var values; - var i; - - values = [ - '5', - -5, - 3.14, - NaN, - true, - false, - null, - void 0, - [], - {}, - function noop() {} - ]; - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - wrap( nary, value, Complex64 ); - }; - } -}); - -tape( 'the function throws an error if not provided a third argument which is a constructor function', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - null, - void 0, - [], - {} - ]; - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - wrap( nary, 2, value ); - }; - } -}); - -tape( 'the function returns a function which accepts real and complex number arguments (nullary)', function test( t ) { - var f; - var v; - - f = wrap( nary, 0, Complex64 ); - v = f(); - - t.strictEqual( realf( v ), 0.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a function which accepts real and complex number arguments (unary)', function test( t ) { - var f; - var v; - var z; - - f = wrap( nary, 1, Complex64 ); - - v = f( 1.0 ); - t.strictEqual( realf( v ), 1.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z ); - t.strictEqual( realf( v ), 1.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a function which accepts real and complex number arguments (binary)', function test( t ) { - var f; - var v; - var z; - - f = wrap( nary, 2, Complex64 ); - - v = f( 1.0, 1.0 ); - t.strictEqual( realf( v ), 2.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, z ); - t.strictEqual( realf( v ), 2.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, 1.0 ); - t.strictEqual( realf( v ), 2.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, z ); - t.strictEqual( realf( v ), 2.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 2.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a function which accepts real and complex number arguments (ternary)', function test( t ) { - var f; - var v; - var z; - - f = wrap( nary, 3, Complex64 ); - - v = f( 1.0, 1.0, 1.0 ); - t.strictEqual( realf( v ), 3.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, 1.0, z ); - t.strictEqual( realf( v ), 3.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, z, 1.0 ); - t.strictEqual( realf( v ), 3.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, 1.0, 1.0 ); - t.strictEqual( realf( v ), 3.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, z, 1.0 ); - t.strictEqual( realf( v ), 3.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 2.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, 1.0, z ); - t.strictEqual( realf( v ), 3.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 2.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, z, z ); - t.strictEqual( realf( v ), 3.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 2.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, z, z ); - t.strictEqual( realf( v ), 3.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 3.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a function which accepts real and complex number arguments (quaternary)', function test( t ) { - var f; - var v; - var z; - - f = wrap( nary, 4, Complex64 ); - - v = f( 1.0, 1.0, 1.0, 1.0 ); - t.strictEqual( realf( v ), 4.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, 1.0, 1.0, z ); - t.strictEqual( realf( v ), 4.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, 1.0, z, 1.0 ); - t.strictEqual( realf( v ), 4.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, z, 1.0, 1.0 ); - t.strictEqual( realf( v ), 4.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, 1.0, 1.0, 1.0 ); - t.strictEqual( realf( v ), 4.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, z, z, 1.0 ); - t.strictEqual( realf( v ), 4.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 3.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, z, 1.0, z ); - t.strictEqual( realf( v ), 4.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 3.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, 1.0, z, z ); - t.strictEqual( realf( v ), 4.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 3.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, z, z, z ); - t.strictEqual( realf( v ), 4.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 3.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, z, z, z ); - t.strictEqual( realf( v ), 4.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 4.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a function which accepts real and complex number arguments (quinary)', function test( t ) { - var f; - var v; - var z; - - f = wrap( nary, 5, Complex64 ); - - v = f( 1.0, 1.0, 1.0, 1.0, 1.0 ); - t.strictEqual( realf( v ), 5.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, 1.0, 1.0, 1.0, z ); - t.strictEqual( realf( v ), 5.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, 1.0, 1.0, z, 1.0 ); - t.strictEqual( realf( v ), 5.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, 1.0, z, 1.0, 1.0 ); - t.strictEqual( realf( v ), 5.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, z, 1.0, 1.0, 1.0 ); - t.strictEqual( realf( v ), 5.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, 1.0, 1.0, 1.0, 1.0 ); - t.strictEqual( realf( v ), 5.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, z, z, z, 1.0 ); - t.strictEqual( realf( v ), 5.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 4.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, z, z, 1.0, z ); - t.strictEqual( realf( v ), 5.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 4.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, z, 1.0, z, z ); - t.strictEqual( realf( v ), 5.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 4.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, 1.0, z, z, z ); - t.strictEqual( realf( v ), 5.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 4.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, z, z, z, z ); - t.strictEqual( realf( v ), 5.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 4.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, z, z, z, z ); - t.strictEqual( realf( v ), 5.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 5.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a function which accepts real and complex number arguments (nary)', function test( t ) { - var f; - var v; - var z; - - f = wrap( nary, 6, Complex64 ); - - v = f( 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ); - t.strictEqual( realf( v ), 6.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, 1.0, 1.0, 1.0, 1.0, z ); - t.strictEqual( realf( v ), 6.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, 1.0, 1.0, 1.0, z, 1.0 ); - t.strictEqual( realf( v ), 6.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, 1.0, 1.0, z, 1.0, 1.0 ); - t.strictEqual( realf( v ), 6.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, 1.0, z, 1.0, 1.0, 1.0 ); - t.strictEqual( realf( v ), 6.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, z, 1.0, 1.0, 1.0, 1.0 ); - t.strictEqual( realf( v ), 6.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, 1.0, 1.0, 1.0, 1.0, 1.0 ); - t.strictEqual( realf( v ), 6.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 1.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, z, z, z, z, 1.0 ); - t.strictEqual( realf( v ), 6.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 5.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, z, z, z, 1.0, z ); - t.strictEqual( realf( v ), 6.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 5.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, z, z, 1.0, z, z ); - t.strictEqual( realf( v ), 6.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 5.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, z, 1.0, z, z, z ); - t.strictEqual( realf( v ), 6.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 5.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, 1.0, z, z, z, z ); - t.strictEqual( realf( v ), 6.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 5.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( 1.0, z, z, z, z, z ); - t.strictEqual( realf( v ), 6.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 5.0, 'returns expected value' ); - - z = new Complex64( 1.0, 1.0 ); - v = f( z, z, z, z, z, z ); - t.strictEqual( realf( v ), 6.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 6.0, 'returns expected value' ); - - t.end(); -}); diff --git a/branches.md b/branches.md deleted file mode 100644 index 7a1771c2..00000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/complex" -%% click B href "https://github.com/stdlib-js/complex/tree/main" -%% click C href "https://github.com/stdlib-js/complex/tree/production" -%% click D href "https://github.com/stdlib-js/complex/tree/esm" -%% click E href "https://github.com/stdlib-js/complex/tree/deno" -%% click F href "https://github.com/stdlib-js/complex/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/complex -[production-url]: https://github.com/stdlib-js/complex/tree/production -[deno-url]: https://github.com/stdlib-js/complex/tree/deno -[deno-readme]: https://github.com/stdlib-js/complex/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/complex/tree/umd -[umd-readme]: https://github.com/stdlib-js/complex/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/complex/tree/esm -[esm-readme]: https://github.com/stdlib-js/complex/blob/esm/README.md \ No newline at end of file diff --git a/cmplx/README.md b/cmplx/README.md deleted file mode 100644 index a6a8bc5b..00000000 --- a/cmplx/README.md +++ /dev/null @@ -1,137 +0,0 @@ - - -# Complex Numbers - -> Create a complex number. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var complex = require( '@stdlib/complex/cmplx' ); -``` - -#### complex( real, imag\[, dtype] ) - -Creates a complex number, where `real` and `imag` are the **real** and **imaginary** components, respectively. - -```javascript -var z = complex( 5.0, 3.0 ); -// returns -``` - -By default, the function returns a [128-bit complex number][@stdlib/complex/float64/ctor]. To specify an alternative underlying data type, set the `dtype` parameter to one of the following: - -- [`'float64'`][@stdlib/complex/float64/ctor]: store **real** and **imaginary** components as double-precision floating-point numbers. -- [`'float32'`][@stdlib/complex/float32/ctor]: store **real** and **imaginary** components as single-precision floating-point numbers. - -```javascript -var z = complex( 5.0, 3.0, 'float32' ); -// returns -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var complex = require( '@stdlib/complex/cmplx' ); - -var rand = discreteUniform( -50, 50 ); - -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = complex( rand(), rand(), 'float64' ); - console.log( z.toString() ); -} -``` - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/cmplx/benchmark/benchmark.js b/cmplx/benchmark/benchmark.js deleted file mode 100644 index 7af3225d..00000000 --- a/cmplx/benchmark/benchmark.js +++ /dev/null @@ -1,83 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var pkg = require( './../package.json' ).name; -var complex = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var z; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = complex( i, -i ); - if ( isnan( z ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( z.re ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':dtype=float64', function benchmark( b ) { - var z; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = complex( i, -i, 'float64' ); - if ( isnan( z ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( z.re ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':dtype=float32', function benchmark( b ) { - var z; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = complex( i, -i, 'float32' ); - if ( isnan( z ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( z.re ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/cmplx/benchmark/julia/REQUIRE b/cmplx/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/cmplx/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/cmplx/benchmark/julia/benchmark.jl b/cmplx/benchmark/julia/benchmark.jl deleted file mode 100644 index d76ba6b8..00000000 --- a/cmplx/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "complex"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark complex( rand(), rand() ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/cmplx/benchmark/python/benchmark.py b/cmplx/benchmark/python/benchmark.py deleted file mode 100644 index d4eeb994..00000000 --- a/cmplx/benchmark/python/benchmark.py +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env python -# -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Benchmark complex.""" - -from __future__ import print_function -import timeit - -NAME = "complex" -REPEATS = 3 -ITERATIONS = 1000000 - - -def print_version(): - """Print the TAP version.""" - print("TAP version 13") - - -def print_summary(total, passing): - """Print the benchmark summary. - - # Arguments - - * `total`: total number of tests - * `passing`: number of passing tests - - """ - print("#") - print("1.." + str(total)) # TAP plan - print("# total " + str(total)) - print("# pass " + str(passing)) - print("#") - print("# ok") - - -def print_results(elapsed): - """Print benchmark results. - - # Arguments - - * `elapsed`: elapsed time (in seconds) - - # Examples - - ``` python - python> print_results(0.131009101868) - ``` - """ - rate = ITERATIONS / elapsed - - print(" ---") - print(" iterations: " + str(ITERATIONS)) - print(" elapsed: " + str(elapsed)) - print(" rate: " + str(rate)) - print(" ...") - - -def benchmark(): - """Run the benchmark and print benchmark results.""" - setup = "from random import random;" - stmt = "z = complex(random(), random())" - - t = timeit.Timer(stmt, setup=setup) - - print_version() - - for i in range(REPEATS): - print("# python::" + NAME) - elapsed = t.timeit(number=ITERATIONS) - print_results(elapsed) - print("ok " + str(i+1) + " benchmark finished") - - print_summary(REPEATS, REPEATS) - - -def main(): - """Run the benchmark.""" - benchmark() - - -if __name__ == "__main__": - main() diff --git a/cmplx/docs/repl.txt b/cmplx/docs/repl.txt deleted file mode 100644 index 8ae30636..00000000 --- a/cmplx/docs/repl.txt +++ /dev/null @@ -1,35 +0,0 @@ - -{{alias}}( real, imag[, dtype] ) - Creates a complex number. - - The function supports the following data types: - - - float64 - - float32 - - Parameters - ---------- - real: number - Real component. - - imag: number - Imaginary component. - - dtype: string (optional) - Data type. Default: 'float64'. - - Returns - ------- - z: Complex - Complex number. - - Examples - -------- - > var z = {{alias}}( 5.0, 3.0, 'float64' ) - - > z = {{alias}}( 5.0, 3.0, 'float32' ) - - - See Also - -------- - diff --git a/cmplx/docs/types/index.d.ts b/cmplx/docs/types/index.d.ts deleted file mode 100644 index 7ec9c172..00000000 --- a/cmplx/docs/types/index.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -import Complex128 = require( './../../../float64/ctor' ); -import Complex64 = require( './../../../float32/ctor' ); - -type Complex = Complex128 | Complex64; -type DataType = 'float64' | 'float32'; - -/** -* Creates a complex number. -* -* @param real - real component -* @param imag - imaginary component -* @param dtype - data type (default: 'float64') -* @returns complex number -* -* @example -* var z = complex( 5.0, 3.0, 'float64' ); -* // returns -*/ -declare function complex( real: number, imag: number, dtype?: DataType ): Complex; - - -// EXPORTS // - -export = complex; diff --git a/cmplx/docs/types/test.ts b/cmplx/docs/types/test.ts deleted file mode 100644 index dc865923..00000000 --- a/cmplx/docs/types/test.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import complex = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - complex( 5.0, 3.0 ); // $ExpectType Complex - complex( 5.0, 3.0, 'float64' ); // $ExpectType Complex - complex( 5.0, 3.0, 'float32' ); // $ExpectType Complex -} - -// The compiler throws an error if the function is provided a first argument that is not a number... -{ - complex( true, 3.0 ); // $ExpectError - complex( false, 3.0 ); // $ExpectError - complex( '5', 3.0 ); // $ExpectError - complex( [], 3.0 ); // $ExpectError - complex( {}, 3.0 ); // $ExpectError - complex( ( x: number ): number => x, 3.0 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a number... -{ - complex( 5.0, true ); // $ExpectError - complex( 5.0, false ); // $ExpectError - complex( 5.0, '5' ); // $ExpectError - complex( 5.0, [] ); // $ExpectError - complex( 5.0, {} ); // $ExpectError - complex( 5.0, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided a third argument that is not a recognized data type... -{ - complex( 5.0, 3.0, 'abc' ); // $ExpectError - complex( 5.0, 3.0, 123 ); // $ExpectError - complex( 5.0, 3.0, true ); // $ExpectError - complex( 5.0, 3.0, false ); // $ExpectError - complex( 5.0, 3.0, [] ); // $ExpectError - complex( 5.0, 3.0, {} ); // $ExpectError - complex( 5.0, 3.0, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided insufficient arguments... -{ - complex(); // $ExpectError - complex( 3 ); // $ExpectError -} diff --git a/cmplx/examples/index.js b/cmplx/examples/index.js deleted file mode 100644 index c6071427..00000000 --- a/cmplx/examples/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; -var complex = require( './../lib' ); - -var rand = discreteUniform( -50, 50 ); - -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = complex( rand(), rand(), 'float64' ); - console.log( z.toString() ); -} diff --git a/cmplx/lib/index.js b/cmplx/lib/index.js deleted file mode 100644 index 04945a1c..00000000 --- a/cmplx/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a complex number. -* -* @module @stdlib/complex/cmplx -* -* @example -* var complex = require( '@stdlib/complex/cmplx' ); -* -* var z = complex( 5.0, 3.0, 'float64' ); -* // returns -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/cmplx/lib/main.js b/cmplx/lib/main.js deleted file mode 100644 index ccbffbf4..00000000 --- a/cmplx/lib/main.js +++ /dev/null @@ -1,66 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var ctors = require( './../../ctors' ); -var format = require( '@stdlib/string/format' ); - - -// VARIABLES // - -var TABLE = { - 'float64': 'complex128', - 'float32': 'complex64' -}; -var DEFAULT_CTOR = ctors( TABLE[ 'float64' ] ); - - -// MAIN // - -/** -* Creates a complex number. -* -* @param {number} real - real component -* @param {number} imag - imaginary component -* @param {string} [dtype="float64"] - data type -* @throws {TypeError} must provide a recognized data type -* @returns {Complex} complex number -* -* @example -* var z = complex( 5.0, 3.0, 'float64' ); -* // returns -*/ -function complex( real, imag, dtype ) { - var ctor; - if ( arguments.length > 2 ) { - ctor = ctors( TABLE[ dtype ] ); - if ( ctor ) { - return new ctor( real, imag ); - } - throw new TypeError( format( 'invalid argument. Must provide a recognized data type. Value: `%s`.', dtype ) ); - } - return new DEFAULT_CTOR( real, imag ); -} - - -// EXPORTS // - -module.exports = complex; diff --git a/cmplx/package.json b/cmplx/package.json deleted file mode 100644 index ae7e9417..00000000 --- a/cmplx/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "@stdlib/complex/cmplx", - "version": "0.0.0", - "description": "Create a complex number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "types", - "data", - "structure", - "complex", - "cmplx", - "number", - "complex128", - "complex64" - ] -} diff --git a/cmplx/test/test.js b/cmplx/test/test.js deleted file mode 100644 index b8334542..00000000 --- a/cmplx/test/test.js +++ /dev/null @@ -1,102 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex128 = require( './../../float64/ctor' ); -var Complex64 = require( './../../float32/ctor' ); -var instanceOf = require( '@stdlib/assert/instance-of' ); -var complex = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof complex, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function throws an error if provided an unrecognized data type', function test( t ) { - var values; - var i; - - values = [ - '5', - 'beep', - 'complex', - 'int32', - 'uint32', - 'int16', - 'uint16', - 'int8', - 'uint8', - 'uint8', - 'Float64', - 'Float32', - 'FLOAT64', - 'FLOAT32', - 5, - NaN, - true, - false, - null, - void 0, - [], - {}, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - complex( 5.0, 3.0, value ); - }; - } -}); - -tape( 'the function returns a complex number (default)', function test( t ) { - var z = complex( 3.14, -3.14 ); - t.strictEqual( instanceOf( z, Complex128 ), true, 'returns expected value' ); - t.strictEqual( z.re, 3.14, 'returns expected value' ); - t.strictEqual( z.im, -3.14, 'returns expected value' ); - t.end(); -}); - -tape( 'the function returns a complex number (float64)', function test( t ) { - var z = complex( 3.14, -3.14, 'float64' ); - t.strictEqual( instanceOf( z, Complex128 ), true, 'returns expected value' ); - t.strictEqual( z.re, 3.14, 'returns expected value' ); - t.strictEqual( z.im, -3.14, 'returns expected value' ); - t.end(); -}); - -tape( 'the function returns a complex number (float32)', function test( t ) { - var z = complex( 3.14, -3.14, 'float32' ); - t.strictEqual( instanceOf( z, Complex64 ), true, 'returns expected value' ); - t.strictEqual( z.re, 3.140000104904175, 'returns expected value' ); - t.strictEqual( z.im, -3.140000104904175, 'returns expected value' ); - t.end(); -}); diff --git a/ctors/README.md b/ctors/README.md deleted file mode 100644 index 23a93255..00000000 --- a/ctors/README.md +++ /dev/null @@ -1,136 +0,0 @@ - - -# Constructors - -> Complex number constructors. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var ctors = require( '@stdlib/complex/ctors' ); -``` - -#### ctors( dtype ) - -Returns a complex number constructor for a specified data type. - -```javascript -var ctor = ctors( 'complex128' ); -// returns -``` - -The function returns constructors for the following data types: - -- `complex64`: single-precision complex floating-point numbers. -- `complex128`: double-precision complex floating-point numbers. - -If provided an unknown or unsupported data type, the function returns `null`. - -```javascript -var ctor = ctors( 'complex' ); -// returns null -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var dtypes = require( '@stdlib/complex/dtypes' ); -var ctors = require( '@stdlib/complex/ctors' ); - -var DTYPES = dtypes(); -var ctor; -var i; - -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); - console.log( ctor ); -} -``` - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/ctors/benchmark/benchmark.js b/ctors/benchmark/benchmark.js deleted file mode 100644 index f3232947..00000000 --- a/ctors/benchmark/benchmark.js +++ /dev/null @@ -1,54 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var dtypes = require( './../../dtypes' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var pkg = require( './../package.json' ).name; -var ctors = require( './../lib' ); - - -// VARIABLES // - -var DTYPES = dtypes(); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var ctor; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - ctor = ctors( DTYPES[ i%DTYPES.length ] ); - if ( typeof ctor !== 'function' ) { - b.fail( 'should return a function' ); - } - } - b.toc(); - if ( !isFunction( ctor ) ) { - b.fail( 'should return a function' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/ctors/docs/repl.txt b/ctors/docs/repl.txt deleted file mode 100644 index d45547d0..00000000 --- a/ctors/docs/repl.txt +++ /dev/null @@ -1,29 +0,0 @@ - -{{alias}}( dtype ) - Returns a complex number constructor. - - The function returns constructors for the following data types: - - - complex64: single-precision complex floating-point numbers. - - complex128: double-precision complex floating-point numbers. - - Parameters - ---------- - dtype: string - Data type. - - Returns - ------- - out: Function|null - Constructor. - - Examples - -------- - > var ctor = {{alias}}( 'complex128' ) - - > ctor = {{alias}}( 'complex' ) - null - - See Also - -------- - diff --git a/ctors/docs/types/index.d.ts b/ctors/docs/types/index.d.ts deleted file mode 100644 index 22b6d739..00000000 --- a/ctors/docs/types/index.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -import Complex128 = require( './../../../float64/ctor' ); -import Complex64 = require( './../../../float32/ctor' ); - -/** -* Returns a `Complex128` constructor. -* -* @param dtype - data type -* @returns constructor -* -* @example -* var ctor = ctors( 'complex128' ); -* // returns -*/ -declare function ctors( dtype: 'complex128' ): typeof Complex128; - -/** -* Returns a `Complex64` constructor. -* -* @param dtype - data type -* @returns constructor -* -* @example -* var ctor = ctors( 'complex64' ); -* // returns -*/ -declare function ctors( dtype: 'complex64' ): typeof Complex64; - -/** -* Returns a complex number constructor. -* -* @param dtype - data type -* @returns constructor or null -* -* @example -* var ctor = ctors( 'complex128' ); -* // returns -* -* @example -* var ctor = ctors( 'float' ); -* // returns null -*/ -declare function ctors( dtype: string ): Function | null; - - -// EXPORTS // - -export = ctors; diff --git a/ctors/docs/types/test.ts b/ctors/docs/types/test.ts deleted file mode 100644 index 1df74b00..00000000 --- a/ctors/docs/types/test.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import ctors = require( './index' ); - - -// TESTS // - -// The function returns a function or null.. -{ - ctors( 'complex128' ); // $ExpectType typeof Complex128 - ctors( 'complex64' ); // $ExpectType typeof Complex64 - ctors( 'float64' ); // $ExpectType Function | null -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - ctors(); // $ExpectError - ctors( 'int32', 3 ); // $ExpectError -} diff --git a/ctors/examples/index.js b/ctors/examples/index.js deleted file mode 100644 index 00984ebc..00000000 --- a/ctors/examples/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var dtypes = require( './../../dtypes' ); -var ctors = require( './../lib' ); - -var DTYPES = dtypes(); -var ctor; -var i; - -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); - console.log( ctor ); -} diff --git a/ctors/lib/ctors.js b/ctors/lib/ctors.js deleted file mode 100644 index cd9830ed..00000000 --- a/ctors/lib/ctors.js +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex64 = require( './../../float32/ctor' ); -var Complex128 = require( './../../float64/ctor' ); - - -// MAIN // - -// Mapping from data types to constructors... -var ctors = { - 'complex64': Complex64, - 'complex128': Complex128 -}; - - -// EXPORTS // - -module.exports = ctors; diff --git a/ctors/lib/index.js b/ctors/lib/index.js deleted file mode 100644 index a90e0be9..00000000 --- a/ctors/lib/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Complex number constructors. -* -* @module @stdlib/complex/ctors -* -* @example -* var ctors = require( '@stdlib/complex/ctors' ); -* -* var ctor = ctors( 'complex128' ); -* // returns -* -* ctor = ctors( 'int' ); -* // returns null -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/ctors/lib/main.js b/ctors/lib/main.js deleted file mode 100644 index 3fbbb04b..00000000 --- a/ctors/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var table = require( './ctors.js' ); - - -// MAIN // - -/** -* Returns a complex number constructor. -* -* @param {string} dtype - data type -* @returns {(Function|null)} constructor or null -* -* @example -* var ctor = ctors( 'complex128' ); -* // returns -* -* @example -* var ctor = ctors( 'complex' ); -* // returns null -*/ -function ctors( dtype ) { - return table[ dtype ] || null; -} - - -// EXPORTS // - -module.exports = ctors; diff --git a/ctors/package.json b/ctors/package.json deleted file mode 100644 index 15574f8c..00000000 --- a/ctors/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "@stdlib/complex/ctors", - "version": "0.0.0", - "description": "Complex number constructors.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "types", - "complex", - "cmplx", - "list", - "dtypes", - "dtype", - "data", - "structure", - "constructors", - "constructor", - "ctors", - "ctor", - "utilities", - "utility", - "utils", - "util" - ], - "__stdlib__": {} -} diff --git a/ctors/test/test.js b/ctors/test/test.js deleted file mode 100644 index 63616a5f..00000000 --- a/ctors/test/test.js +++ /dev/null @@ -1,98 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var dtypes = require( './../../dtypes' ); -var Complex64 = require( './../../float32/ctor' ); -var Complex128 = require( './../../float64/ctor' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var ctors = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctors, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns complex number constructors', function test( t ) { - var expected; - var dtypes; - var ctor; - var i; - - dtypes = [ - 'complex64', - 'complex128' - ]; - expected = [ - Complex64, - Complex128 - ]; - for ( i = 0; i < dtypes.length; i++ ) { - ctor = ctors( dtypes[ i ] ); - t.strictEqual( ctor, expected[ i ], 'returns expected value for ' + dtypes[ i ] ); - } - t.end(); -}); - -tape( 'the function returns a constructor for each supported complex number data type', function test( t ) { - var DTYPES; - var ctor; - var i; - - DTYPES = dtypes(); - for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); - - // Note: this is a weak test for a "constructor" - t.strictEqual( isFunction( ctor ), true, 'returns a function for ' + DTYPES[ i ] ); - } - t.end(); -}); - -tape( 'if provided an unknown/unsupported data type, the function returns `null`', function test( t ) { - var dtypes; - var i; - - dtypes = [ - 'binary', - 'buffer', - 'buf', - 'float', - 'complex', - 'double', - 'single', - 'int', - 'integer', - 'uint', - 'uinteger', - 'byte', - 'bits' - ]; - for ( i = 0; i < dtypes.length; i++ ) { - t.strictEqual( ctors( dtypes[i] ), null, 'returns expected value for ' + dtypes[ i ] ); - } - t.end(); -}); diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index c2dd14ec..00000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable @typescript-eslint/no-unused-expressions */ - -import ns = require( './index' ); - - -// TESTS // - -// The exported value is the expected interface... -{ - ns; // $ExpectType Namespace -} diff --git a/dtype/README.md b/dtype/README.md deleted file mode 100644 index 39ef2485..00000000 --- a/dtype/README.md +++ /dev/null @@ -1,142 +0,0 @@ - - -# dtype - -> Return the data type of a complex number. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var dtype = require( '@stdlib/complex/dtype' ); -``` - -#### dtype( value ) - -Returns the [data type][@stdlib/complex/dtypes] of a complex number. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var dt = dtype( new Complex128( 1.0, 2.0 ) ); -// returns 'complex128' -``` - -If provided an argument having an unknown or unsupported [data type][@stdlib/complex/dtypes], the function returns `null`. - -```javascript -var dt = dtype( 'beep' ); -// returns null -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - - - -```javascript -var dtypes = require( '@stdlib/complex/dtypes' ); -var ctors = require( '@stdlib/complex/ctors' ); -var dtype = require( '@stdlib/complex/dtype' ); - -// Get a list of supported complex number data types: -var DTYPES = dtypes(); - -// For each supported data type, create a complex number and confirm its data type... -var ctor; -var dt; -var i; -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); - dt = dtype( new ctor( 1.0, 2.0 ) ); - console.log( '%s == %s => %s', DTYPES[ i ], dt, DTYPES[ i ] === dt ); -} -``` - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/dtype/benchmark/benchmark.js b/dtype/benchmark/benchmark.js deleted file mode 100644 index aacb3f0b..00000000 --- a/dtype/benchmark/benchmark.js +++ /dev/null @@ -1,62 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var dtypes = require( './../../dtypes' ); -var ctors = require( './../../ctors' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var dtype = require( './../lib' ); - - -// VARIABLES // - -var DTYPES = dtypes(); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var ctor; - var dt; - var i; - - values = []; - for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); - values.push( new ctor( 1.0, 2.0 ) ); - } - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - dt = dtype( values[ i%values.length ] ); - if ( typeof dt !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( !isString( dt ) ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/dtype/docs/repl.txt b/dtype/docs/repl.txt deleted file mode 100644 index 41c73f2d..00000000 --- a/dtype/docs/repl.txt +++ /dev/null @@ -1,28 +0,0 @@ - -{{alias}}( value ) - Returns the data type of a complex number object. - - If provided an argument having an unknown or unsupported type, the function - returns `null`. - - Parameters - ---------- - value: any - Input value. - - Returns - ------- - out: string|null - Data type. - - Examples - -------- - > var v = new {{alias:@stdlib/complex/float64/ctor}}( 1.0, 2.0 ); - > var dt = {{alias}}( v ) - 'complex128' - > dt = {{alias}}( 'beep' ) - null - - See Also - -------- - diff --git a/dtype/docs/types/index.d.ts b/dtype/docs/types/index.d.ts deleted file mode 100644 index f9f9fa46..00000000 --- a/dtype/docs/types/index.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex64, Complex128, ComplexFloatingPointDataType } from '@stdlib/types/complex'; - -/** -* Complex number data type. -*/ -type DataType = ComplexFloatingPointDataType; - -/** -* Returns the data type of a complex number. -* -* @param value - input value -* @returns data type -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var dt = dtype( new Complex128( 1.0, 2.0 ) ); -* // returns 'complex128' -*/ -declare function dtype( value: Complex128 ): 'complex128'; - -/** -* Returns the data type of a complex number. -* -* @param value - input value -* @returns data type -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var dt = dtype( new Complex64( 1.0, 2.0 ) ); -* // returns 'complex64' -*/ -declare function dtype( value: Complex64 ): 'complex64'; - -/** -* Returns the data type of a complex number. -* -* ## Notes -* -* - If provided an argument having an unknown or unsupported type, the function returns `null`. -* -* @param value - input value -* @returns data type -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var dt = dtype( new Complex64( 1.0, 2.0 ) ); -* // returns 'complex64' -* -* var dt = dtype( 'beep' ); -* // returns null -*/ -declare function dtype( value: any ): DataType | null; - - -// EXPORTS // - -export = dtype; diff --git a/dtype/docs/types/test.ts b/dtype/docs/types/test.ts deleted file mode 100644 index d13ef320..00000000 --- a/dtype/docs/types/test.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../float64/ctor' ); -import Complex64 = require( './../../../float32/ctor' ); -import dtype = require( './index' ); - - -// TESTS // - -// The function returns a data type or null.. -{ - dtype( new Complex128( 1.0, 2.0 ) ); // $ExpectType "complex128" - dtype( new Complex64( 1.0, 2.0 ) ); // $ExpectType "complex64" -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - dtype(); // $ExpectError - dtype( new Complex128( 1.0, 2.0 ), 3 ); // $ExpectError -} diff --git a/dtype/examples/index.js b/dtype/examples/index.js deleted file mode 100644 index 628f92c4..00000000 --- a/dtype/examples/index.js +++ /dev/null @@ -1,36 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var dtypes = require( './../../dtypes' ); -var ctors = require( './../../ctors' ); -var dtype = require( './../lib' ); - -// Get a list of supported complex number data types: -var DTYPES = dtypes(); - -// For each supported data type, create a complex number and confirm its data type... -var ctor; -var dt; -var i; -for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); - dt = dtype( new ctor( 1.0, 2.0 ) ); - console.log( '%s == %s => %s', DTYPES[ i ], dt, DTYPES[ i ] === dt ); -} diff --git a/dtype/lib/ctor2dtype.js b/dtype/lib/ctor2dtype.js deleted file mode 100644 index 3c119cb4..00000000 --- a/dtype/lib/ctor2dtype.js +++ /dev/null @@ -1,32 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -// Mapping from complex number constructors to data types... -var ctor2dtypes = { - 'Complex64': 'complex64', - 'Complex128': 'complex128' -}; - - -// EXPORTS // - -module.exports = ctor2dtypes; diff --git a/dtype/lib/ctors.js b/dtype/lib/ctors.js deleted file mode 100644 index f9d05c5d..00000000 --- a/dtype/lib/ctors.js +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var ctors = require( './../../ctors' ); -var DTYPES = require( './dtypes.js' ); - - -// MAIN // - -var CTORS = []; -var i; -for ( i = 0; i < DTYPES.length; i++ ) { - CTORS.push( ctors( DTYPES[ i ] ) ); -} - - -// EXPORTS // - -module.exports = CTORS; diff --git a/dtype/lib/dtypes.js b/dtype/lib/dtypes.js deleted file mode 100644 index d88dae7b..00000000 --- a/dtype/lib/dtypes.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var dtypes = require( './../../dtypes' ); - - -// MAIN // - -var DTYPES = dtypes(); - - -// EXPORTS // - -module.exports = DTYPES; diff --git a/dtype/lib/index.js b/dtype/lib/index.js deleted file mode 100644 index e1052789..00000000 --- a/dtype/lib/index.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Return the data type of a complex number. -* -* @module @stdlib/complex/dtype -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var dtype = require( '@stdlib/complex/dtype' ); -* -* var v = new Complex128( 1.0, 2.0 ); -* -* var dt = dtype( v ); -* // returns 'complex128' -* -* dt = dtype( {} ); -* // returns null -* -* dt = dtype( 'beep' ); -* // returns null -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/dtype/lib/main.js b/dtype/lib/main.js deleted file mode 100644 index deccc702..00000000 --- a/dtype/lib/main.js +++ /dev/null @@ -1,65 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var constructorName = require( '@stdlib/utils/constructor-name' ); -var ctor2dtype = require( './ctor2dtype.js' ); -var CTORS = require( './ctors.js' ); -var DTYPES = require( './dtypes.js' ); - - -// VARIABLES // - -var NTYPES = DTYPES.length; - - -// MAIN // - -/** -* Returns the data type of a complex number. -* -* @param {*} value - input value -* @returns {(string|null)} data type -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var dt = dtype( new Complex128( 1.0, 2.0 ) ); -* // returns 'complex128' -* -* var dt = dtype( 'beep' ); -* // returns null -*/ -function dtype( value ) { - var i; - for ( i = 0; i < NTYPES; i++ ) { - if ( value instanceof CTORS[ i ] ) { - return DTYPES[ i ]; - } - } - // If the above failed, fall back to a more robust (and significantly slower) means for resolving underlying data types: - return ctor2dtype[ constructorName( value ) ] || null; -} - - -// EXPORTS // - -module.exports = dtype; diff --git a/dtype/package.json b/dtype/package.json deleted file mode 100644 index abf8749c..00000000 --- a/dtype/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@stdlib/complex/dtype", - "version": "0.0.0", - "description": "Return the data type of a complex number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "types", - "complex", - "cmplx", - "dtypes", - "dtype", - "data", - "type", - "utilities", - "utility", - "utils", - "util" - ], - "__stdlib__": {} -} diff --git a/dtype/test/test.js b/dtype/test/test.js deleted file mode 100644 index 488451ea..00000000 --- a/dtype/test/test.js +++ /dev/null @@ -1,88 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var dtypes = require( './../../dtypes' ); -var ctors = require( './../../ctors' ); -var dtype = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof dtype, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns the data type for an input complex number', function test( t ) { - var DTYPES; - var ctor; - var dt; - var v; - var i; - - DTYPES = dtypes(); - - for ( i = 0; i < DTYPES.length; i++ ) { - ctor = ctors( DTYPES[ i ] ); - v = new ctor( 1.0, 2.0 ); - dt = dtype( v ); - t.strictEqual( dt, DTYPES[ i ], 'returns expected value' ); - } - t.end(); -}); - -tape( 'the function does not support complex-like objects', function test( t ) { - var dt; - var v; - - v = { - 're': 1.0, - 'im': 2.0 - }; - dt = dtype( v ); - t.strictEqual( dt, null, 'returns expected value' ); - t.end(); -}); - -tape( 'if provided an argument having an unknown/unsupported data type, the function returns `null`', function test( t ) { - var values; - var i; - - values = [ - 'beep', - 5, - NaN, - null, - void 0, - true, - false, - {}, - [], - function noop() {} - ]; - for ( i = 0; i < values.length; i++ ) { - t.strictEqual( dtype( values[i] ), null, 'returns expected value for ' + values[ i ] ); - } - t.end(); -}); diff --git a/dtypes/README.md b/dtypes/README.md deleted file mode 100644 index 6d34ae5c..00000000 --- a/dtypes/README.md +++ /dev/null @@ -1,142 +0,0 @@ - - -# Data Types - -> List of complex number data types. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var dtypes = require( '@stdlib/complex/dtypes' ); -``` - -#### dtypes() - -Returns a list of complex number data types. - -```javascript -var out = dtypes(); -// e.g., returns [ 'complex64', 'complex128' ] -``` - -The output `array` contains the following data types: - -- `complex64`: single-precision complex floating-point numbers. -- `complex128`: double-precision complex floating-point numbers. - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var indexOf = require( '@stdlib/utils/index-of' ); -var dtypes = require( '@stdlib/complex/dtypes' ); - -var DTYPES = dtypes(); -var bool; - -function isdtype( str ) { - if ( indexOf( DTYPES, str ) === -1 ) { - return false; - } - return true; -} - -bool = isdtype( 'complex128' ); -// returns true - -bool = isdtype( 'complex64' ); -// returns true - -bool = isdtype( 'float64' ); -// returns false - -bool = isdtype( 'beep' ); -// returns false -``` - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/dtypes/benchmark/benchmark.js b/dtypes/benchmark/benchmark.js deleted file mode 100644 index 5542f8cc..00000000 --- a/dtypes/benchmark/benchmark.js +++ /dev/null @@ -1,48 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives; -var pkg = require( './../package.json' ).name; -var dtypes = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = dtypes(); - if ( out.length <= 1 ) { - b.fail( 'should return an array of strings' ); - } - } - b.toc(); - if ( !isStringArray( out ) ) { - b.fail( 'should return an array of strings' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/dtypes/docs/repl.txt b/dtypes/docs/repl.txt deleted file mode 100644 index 7d54b9a1..00000000 --- a/dtypes/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}() - Returns a list of complex number data types. - - The output array contains the following data types: - - - complex64: single-precision complex floating-point numbers. - - complex128: double-precision complex floating-point numbers. - - Returns - ------- - out: Array - List of complex number data types. - - Examples - -------- - > var out = {{alias}}() - - - See Also - -------- - diff --git a/dtypes/docs/types/index.d.ts b/dtypes/docs/types/index.d.ts deleted file mode 100644 index 5950ab38..00000000 --- a/dtypes/docs/types/index.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { ComplexFloatingPointDataType } from '@stdlib/types/complex'; - -/** -* Returns a list of complex number data types. -* -* @returns list of complex number data types -* -* @example -* var list = dtypes(); -* // e.g., returns [ 'complex64', 'complex128' ] -*/ -declare function dtypes(): Array; - - -// EXPORTS // - -export = dtypes; diff --git a/dtypes/docs/types/test.ts b/dtypes/docs/types/test.ts deleted file mode 100644 index d50cb650..00000000 --- a/dtypes/docs/types/test.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import dtypes = require( './index' ); - - -// TESTS // - -// The function returns an array of data types... -{ - dtypes(); // $ExpectType ComplexFloatingPointDataType[] -} - -// The compiler throws an error if the function is provided arguments... -{ - dtypes( 1 ); // $ExpectError - dtypes( 1, 2 ); // $ExpectError -} diff --git a/dtypes/examples/index.js b/dtypes/examples/index.js deleted file mode 100644 index ef41a6f6..00000000 --- a/dtypes/examples/index.js +++ /dev/null @@ -1,48 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var indexOf = require( '@stdlib/utils/index-of' ); -var dtypes = require( './../lib' ); - -var DTYPES = dtypes(); -var bool; - -function isdtype( str ) { - if ( indexOf( DTYPES, str ) === -1 ) { - return false; - } - return true; -} - -bool = isdtype( 'complex128' ); -console.log( bool ); -// => true - -bool = isdtype( 'complex64' ); -console.log( bool ); -// => true - -bool = isdtype( 'float64' ); -console.log( bool ); -// => false - -bool = isdtype( 'beep' ); -console.log( bool ); -// => false diff --git a/dtypes/lib/dtypes.json b/dtypes/lib/dtypes.json deleted file mode 100644 index 96402949..00000000 --- a/dtypes/lib/dtypes.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "complex64", - "complex128" -] diff --git a/dtypes/lib/index.js b/dtypes/lib/index.js deleted file mode 100644 index ab69fc80..00000000 --- a/dtypes/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Return a list of complex number data types. -* -* @module @stdlib/complex/dtypes -* -* @example -* var dtypes = require( '@stdlib/complex/dtypes' ); -* -* var list = dtypes(); -* // e.g., returns [ 'complex64', 'complex128' ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/dtypes/lib/main.js b/dtypes/lib/main.js deleted file mode 100644 index 417456ac..00000000 --- a/dtypes/lib/main.js +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var DTYPES = require( './dtypes.json' ); - - -// MAIN // - -/** -* Returns a list of complex number data types. -* -* @returns {StringArray} list of complex number data types -* -* @example -* var list = dtypes(); -* // e.g., returns [ 'complex64', 'complex128' ] -*/ -function dtypes() { - return DTYPES.slice(); -} - - -// EXPORTS // - -module.exports = dtypes; diff --git a/dtypes/package.json b/dtypes/package.json deleted file mode 100644 index 2c80db39..00000000 --- a/dtypes/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "@stdlib/complex/dtypes", - "version": "0.0.0", - "description": "List of complex number data types.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "types", - "typed", - "complex", - "cmplx", - "dtypes", - "dtype", - "data", - "type", - "utilities", - "utility", - "utils", - "util" - ], - "__stdlib__": {} -} diff --git a/dtypes/test/test.js b/dtypes/test/test.js deleted file mode 100644 index 86e9ec89..00000000 --- a/dtypes/test/test.js +++ /dev/null @@ -1,47 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var dtypes = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof dtypes, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a list of complex number data types', function test( t ) { - var expected; - var actual; - - expected = [ - 'complex64', - 'complex128' - ]; - actual = dtypes(); - - t.deepEqual( actual, expected, 'returns expected value' ); - t.end(); -}); diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index c7e940d8..00000000 --- a/examples/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - -console.log( objectKeys( ns ) ); diff --git a/float32/README.md b/float32/README.md deleted file mode 100644 index 61eed940..00000000 --- a/float32/README.md +++ /dev/null @@ -1,137 +0,0 @@ - - -# Complex64 - -> Single-precision complex floating-point number functions. - -
- -## Usage - -```javascript -var complex = require( '@stdlib/complex/float32' ); -``` - -#### complex - -Namespace containing single-precision complex floating-point number functions. - -```javascript -var ns = complex; -// returns {...} -``` - -The namespace contains the following sub-namespaces: - - - -
- -- [`base`][@stdlib/complex/float32/base]: base (i.e., lower-level) single-precision complex floating-point number functions. - -
- - - -The namespace contains the following functions: - - - -
- -- [`conj( z )`][@stdlib/complex/float32/conj]: return the complex conjugate of a single-precision complex floating-point number. -- [`Complex64( real, imag )`][@stdlib/complex/float32/ctor]: 64-bit complex number. -- [`imag( z )`][@stdlib/complex/float32/imag]: return the imaginary component of a single-precision complex floating-point number. -- [`parseComplex64( str )`][@stdlib/complex/float32/parse]: parse a string representation of a 64-bit complex number. -- [`real( z )`][@stdlib/complex/float32/real]: return the real component of a single-precision complex floating-point number. -- [`reim( z )`][@stdlib/complex/float32/reim]: return the real and imaginary components of a single-precision complex floating-point number. -- [`reviveComplex64( key, value )`][@stdlib/complex/float32/reviver]: revive a JSON-serialized 64-bit complex number. - -
- - - -
- - - - - -
- -
- - - -
- -## Examples - - - - - -```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/complex/float32' ); - -console.log( objectKeys( ns ) ); -``` - -
- - - - - - - - - - - - - - diff --git a/float32/base/README.md b/float32/base/README.md deleted file mode 100644 index a3f4c045..00000000 --- a/float32/base/README.md +++ /dev/null @@ -1,134 +0,0 @@ - - -# Complex64 - -> Base (i.e., lower-level) single-precision complex floating-point number functions. - -
- -## Usage - -```javascript -var complex = require( '@stdlib/complex/float32/base' ); -``` - -#### complex - -Namespace containing base (i.e., lower-level) single-precision complex floating-point number functions. - -```javascript -var ns = complex; -// returns {...} -``` - -The namespace contains the following sub-namespaces: - - - -
- -- [`assert`][@stdlib/complex/float32/base/assert]: base (i.e., lower-level) single-precision complex floating-point number assertion functions. - -
- - - -The namespace contains the following functions: - - - -
- -- [`add( z1, z2 )`][@stdlib/complex/float32/base/add]: add two single-precision complex floating-point numbers. -- [`identity( z )`][@stdlib/complex/float32/base/identity]: evaluate the identity function of a single-precision complex floating-point number. -- [`mul( z1, z2 )`][@stdlib/complex/float32/base/mul]: multiply two single-precision complex floating-point numbers. -- [`neg( z )`][@stdlib/complex/float32/base/neg]: negate a single-precision complex floating-point number. -- [`scale( alpha, c )`][@stdlib/complex/float32/base/scale]: scale a single-precision complex floating-point number by a real-valued single-precision floating-point scalar constant. -- [`sub( z1, z2 )`][@stdlib/complex/float32/base/sub]: subtract two single-precision complex floating-point numbers. - -
- - - -
- - - - - -
- -
- - - -
- -## Examples - - - - - -```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/complex/float32/base' ); - -console.log( objectKeys( ns ) ); -``` - -
- - - - - - - - - - - - - - diff --git a/float32/base/add/README.md b/float32/base/add/README.md deleted file mode 100644 index 912bae18..00000000 --- a/float32/base/add/README.md +++ /dev/null @@ -1,279 +0,0 @@ - - -# add - -> Add two single-precision complex floating-point numbers. - -
- -
- - - -
- -## Usage - -```javascript -var add = require( '@stdlib/complex/float32/base/add' ); -``` - -#### add( z1, z2 ) - -Adds two single-precision complex floating-point numbers. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z = new Complex64( -1.5, 2.5 ); - -var v = add( z, z ); -// returns [ -3.0, 5.0 ] -``` - -#### add.assign( re1, im1, re2, im2, out, strideOut, offsetOut ) - -Adds two single-precision complex floating-point numbers and assigns results to a provided output array. - -```javascript -var Float32Array = require( '@stdlib/array/float32' ); - -var out = new Float32Array( 2 ); -var v = add.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ); -// returns [ 3.0, 4.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **re1**: real component of the first complex number. -- **im1**: imaginary component of the first complex number. -- **re2**: real component of the second complex number. -- **im2**: imaginary component of the second complex number. -- **out**: output array. -- **strideOut**: stride length for `out`. -- **offsetOut**: starting index for `out`. - -#### add.strided( z1, sz1, oz1, z2, sz2, oz2, out, so, oo ) - -Adds two single-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. - -```javascript -var Float32Array = require( '@stdlib/array/float32' ); - -var z1 = new Float32Array( [ 5.0, 3.0 ] ); -var z2 = new Float32Array( [ -2.0, 1.0 ] ); -var out = new Float32Array( 2 ); - -var v = add.strided( z1, 1, 0, z2, 1, 0, out, 1, 0 ); -// returns [ 3.0, 4.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **z1**: first complex number strided array view. -- **sz1**: stride length for `z1`. -- **oz1**: starting index for `z1`. -- **z2**: second complex number strided array view. -- **sz2**: stride length for `z2`. -- **oz2**: starting index for `z2`. -- **out**: output array. -- **so**: stride length for `out`. -- **oo**: starting index for `out`. - -
- - - -
- -## Examples - - - -```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var add = require( '@stdlib/complex/float32/base/add' ); - -// Generate arrays of random values: -var z1 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise addition: -logEachMap( '(%s) + (%s) = %s', z1, z2, add ); -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float32/base/add.h" -``` - -#### stdlib_base_complex64_add( z1, z2 ) - -Adds two single-precision complex floating-point numbers. - -```c -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/real.h" -#include "stdlib/complex/float32/imag.h" - -stdlib_complex64_t z = stdlib_complex64( 3.0f, -2.0f ); - -stdlib_complex64_t out = stdlib_base_complex64_add( z, z ); - -float re = stdlib_complex64_real( out ); -// returns 6.0f - -float im = stdlib_complex64_imag( out ); -// returns -4.0f -``` - -The function accepts the following arguments: - -- **z1**: `[in] stdlib_complex64_t` input value. -- **z2**: `[in] stdlib_complex64_t` input value. - -```c -stdlib_complex64_t stdlib_base_complex64_add( const stdlib_complex64_t z1, const stdlib_complex64_t z2 ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float32/base/add.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 3.14f, 1.5f ), - stdlib_complex64( -3.14f, 1.5f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - stdlib_complex64_t v; - stdlib_complex64_t y; - float re; - float im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex64_reim( v, &re, &im ); - printf( "z = %f + %fi\n", re, im ); - - y = stdlib_base_complex64_add( v, v ); - stdlib_complex64_reim( y, &re, &im ); - printf( "add(z, z) = %f + %fi\n", re, im ); - } -} -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/float32/base/add/benchmark/benchmark.assign.js b/float32/base/add/benchmark/benchmark.assign.js deleted file mode 100644 index a10dba18..00000000 --- a/float32/base/add/benchmark/benchmark.assign.js +++ /dev/null @@ -1,70 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Float32Array = require( '@stdlib/array/float32' ); -var pkg = require( './../package.json' ).name; -var add = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float32' -}; - - -// MAIN // - -bench( pkg+':assign', function benchmark( b ) { - var out; - var re; - var im; - var N; - var i; - var j; - var k; - - N = 100; - re = uniform( N, -500.0, 500.0, options ); - im = uniform( N, -500.0, 500.0, options ); - - out = new Float32Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = i % N; - k = ( i+1 ) % N; - out = add.assign( re[ j ], im[ j ], re[ k ], im[ k ], out, 1, 0 ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( out[ 0 ] ) || isnanf( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/add/benchmark/benchmark.js b/float32/base/add/benchmark/benchmark.js deleted file mode 100644 index 6eddcecd..00000000 --- a/float32/base/add/benchmark/benchmark.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var pkg = require( './../package.json' ).name; -var add = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = add( z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( out ) ) || isnanf( imagf( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/add/benchmark/benchmark.native.js b/float32/base/add/benchmark/benchmark.native.js deleted file mode 100644 index 5cb97aa4..00000000 --- a/float32/base/add/benchmark/benchmark.native.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); -var pkg = require( './../package.json' ).name; - - -// VARIABLES // - -var add = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( add instanceof Error ) -}; - - -// MAIN // - -bench( pkg+'::native', opts, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = add( z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( out ) ) || isnanf( imagf( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/add/benchmark/benchmark.strided.js b/float32/base/add/benchmark/benchmark.strided.js deleted file mode 100644 index 6c058f37..00000000 --- a/float32/base/add/benchmark/benchmark.strided.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Float32Array = require( '@stdlib/array/float32' ); -var pkg = require( './../package.json' ).name; -var add = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float32' -}; - - -// MAIN // - -bench( pkg+':strided', function benchmark( b ) { - var out; - var z1; - var z2; - var N; - var i; - var j; - - N = 50; - z1 = uniform( N*2, -500.0, 500.0, options ); - z2 = uniform( N*2, -500.0, 500.0, options ); - - out = new Float32Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = ( i % N ) * 2; - out = add.strided( z1, 1, j, z2, 1, j, out, 1, 0 ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( out[ 0 ] ) || isnanf( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/add/benchmark/c/Makefile b/float32/base/add/benchmark/c/Makefile deleted file mode 100644 index d7adc1ad..00000000 --- a/float32/base/add/benchmark/c/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/add/benchmark/c/benchmark.c b/float32/base/add/benchmark/c/benchmark.c deleted file mode 100644 index ad12f144..00000000 --- a/float32/base/add/benchmark/c/benchmark.c +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include -#include -#include -#include - -#define NAME "add" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - float re; - float im; - double t; - int i; - - float complex z1; - float complex z2; - float complex z3; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z1 = re + im*I; - - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z2 = re + im*I; - - z3 = (crealf(z1)+crealf(z2)) + (cimagf(z1)+cimagf(z2))*I; - if ( z3 != z3 ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( z3 != z3 ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/base/add/benchmark/c/native/Makefile b/float32/base/add/benchmark/c/native/Makefile deleted file mode 100644 index 7f6bbc4c..00000000 --- a/float32/base/add/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/add/benchmark/c/native/benchmark.c b/float32/base/add/benchmark/c/native/benchmark.c deleted file mode 100644 index cdc3411a..00000000 --- a/float32/base/add/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,148 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/add.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include -#include -#include -#include -#include -#include - -#define NAME "add" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - float re; - float im; - double t; - int i; - - stdlib_complex64_t z1; - stdlib_complex64_t z2; - stdlib_complex64_t z3; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z1 = stdlib_complex64( re, im ); - - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z2 = stdlib_complex64( re, im ); - - z3 = stdlib_base_complex64_add( z1, z2 ); - stdlib_complex64_reim( z3, &re, &im ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/base/add/benchmark/julia/REQUIRE b/float32/base/add/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float32/base/add/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float32/base/add/benchmark/julia/benchmark.jl b/float32/base/add/benchmark/julia/benchmark.jl deleted file mode 100644 index 22903be8..00000000 --- a/float32/base/add/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "add"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark ComplexF32( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) + ComplexF32( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float32/base/add/binding.gyp b/float32/base/add/binding.gyp deleted file mode 100644 index ad8560b8..00000000 --- a/float32/base/add/binding.gyp +++ /dev/null @@ -1,170 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A `.gyp` file for building a Node.js native add-on. -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # List of files to include in this file: - 'includes': [ - './include.gypi', - ], - - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Target name should match the add-on export name: - 'addon_target_name%': 'addon', - - # Set variables based on the host OS: - 'conditions': [ - [ - 'OS=="win"', - { - # Define the object file suffix: - 'obj': 'obj', - }, - { - # Define the object file suffix: - 'obj': 'o', - } - ], # end condition (OS=="win") - ], # end conditions - }, # end variables - - # Define compile targets: - 'targets': [ - - # Target to generate an add-on: - { - # The target name should match the add-on export name: - 'target_name': '<(addon_target_name)', - - # Define dependencies: - 'dependencies': [], - - # Define directories which contain relevant include headers: - 'include_dirs': [ - # Local include directory: - '<@(include_dirs)', - ], - - # List of source files: - 'sources': [ - '<@(src_files)', - ], - - # Settings which should be applied when a target's object files are used as linker input: - 'link_settings': { - # Define libraries: - 'libraries': [ - '<@(libraries)', - ], - - # Define library directories: - 'library_dirs': [ - '<@(library_dirs)', - ], - }, - - # C/C++ compiler flags: - 'cflags': [ - # Enable commonly used warning options: - '-Wall', - - # Aggressive optimization: - '-O3', - ], - - # C specific compiler flags: - 'cflags_c': [ - # Specify the C standard to which a program is expected to conform: - '-std=c99', - ], - - # C++ specific compiler flags: - 'cflags_cpp': [ - # Specify the C++ standard to which a program is expected to conform: - '-std=c++11', - ], - - # Linker flags: - 'ldflags': [], - - # Apply conditions based on the host OS: - 'conditions': [ - [ - 'OS=="mac"', - { - # Linker flags: - 'ldflags': [ - '-undefined dynamic_lookup', - '-Wl,-no-pie', - '-Wl,-search_paths_first', - ], - }, - ], # end condition (OS=="mac") - [ - 'OS!="win"', - { - # C/C++ flags: - 'cflags': [ - # Generate platform-independent code: - '-fPIC', - ], - }, - ], # end condition (OS!="win") - ], # end conditions - }, # end target <(addon_target_name) - - # Target to copy a generated add-on to a standard location: - { - 'target_name': 'copy_addon', - - # Declare that the output of this target is not linked: - 'type': 'none', - - # Define dependencies: - 'dependencies': [ - # Require that the add-on be generated before building this target: - '<(addon_target_name)', - ], - - # Define a list of actions: - 'actions': [ - { - 'action_name': 'copy_addon', - 'message': 'Copying addon...', - - # Explicitly list the inputs in the command-line invocation below: - 'inputs': [], - - # Declare the expected outputs: - 'outputs': [ - '<(addon_output_dir)/<(addon_target_name).node', - ], - - # Define the command-line invocation: - 'action': [ - 'cp', - '<(PRODUCT_DIR)/<(addon_target_name).node', - '<(addon_output_dir)/<(addon_target_name).node', - ], - }, - ], # end actions - }, # end target copy_addon - ], # end targets -} diff --git a/float32/base/add/docs/repl.txt b/float32/base/add/docs/repl.txt deleted file mode 100644 index 06e0737f..00000000 --- a/float32/base/add/docs/repl.txt +++ /dev/null @@ -1,118 +0,0 @@ - -{{alias}}( z1, z2 ) - Adds two single-precision complex floating-point numbers. - - Parameters - ---------- - z1: Complex64 - Complex number. - - z2: Complex64 - Complex number. - - Returns - ------- - out: Complex64 - Result. - - Examples - -------- - > var z = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ) - - > var out = {{alias}}( z, z ) - - > var re = {{alias:@stdlib/complex/float32/real}}( out ) - 10.0 - > var im = {{alias:@stdlib/complex/float32/imag}}( out ) - 6.0 - - -{{alias}}.assign( re1, im1, re2, im2, out, strideOut, offsetOut ) - Adds two single-precision complex floating-point numbers and assigns results - to a provided output array. - - Parameters - ---------- - re1: number - Real component of the first complex number. - - im1: number - Imaginary component of the first complex number. - - re2: number - Real component of the second complex number. - - im2: number - Imaginary component of the second complex number. - - out: ArrayLikeObject - Output array. - - strideOut: integer - Stride length. - - offsetOut: integer - Starting index. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var out = new {{alias:@stdlib/array/float32}}( 2 ); - > {{alias}}.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ) - [ 3.0, 4.0 ] - - -{{alias}}.strided( z1, sz1, oz1, z2, sz2, oz2, out, so, oo ) - Adds two single-precision complex floating-point numbers stored in real- - valued strided array views and assigns results to a provided strided output - array. - - Parameters - ---------- - z1: ArrayLikeObject - First complex number view. - - sz1: integer - Stride length for `z1`. - - oz1: integer - Starting index for `z1`. - - z2: ArrayLikeObject - Second complex number view. - - sz2: integer - Stride length for `z2`. - - oz2: integer - Starting index for `z2`. - - out: ArrayLikeObject - Output array. - - so: integer - Stride length for `out`. - - oo: integer - Starting index for `out`. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var z1 = new {{alias:@stdlib/array/float32}}( [ 5.0, 3.0 ] ); - > var z2 = new {{alias:@stdlib/array/float32}}( [ -2.0, 1.0 ] ); - > var out = new {{alias:@stdlib/array/float32}}( 2 ); - > {{alias}}.strided( z1, 1, 0, z2, 1, 0, out, 1, 0 ) - [ 3.0, 4.0 ] - - See Also - -------- - diff --git a/float32/base/add/docs/types/index.d.ts b/float32/base/add/docs/types/index.d.ts deleted file mode 100644 index 2a1eebb7..00000000 --- a/float32/base/add/docs/types/index.d.ts +++ /dev/null @@ -1,136 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex64 } from '@stdlib/types/complex'; -import { Collection, NumericArray } from '@stdlib/types/array'; - -/** -* Interface for adding two single-precision complex floating-point numbers. -*/ -interface Add { - /** - * Adds two single-precision complex floating-point numbers. - * - * @param z1 - complex number - * @param z2 - complex number - * @returns result - * - * @example - * var Complex64 = require( './../../../../../float32/ctor' ); - * - * var z = new Complex64( 5.0, 3.0 ); - * - * var out = add( z, z ); - * // returns [ 10.0, 6.0 ] - */ - ( z1: Complex64, z2: Complex64 ): Complex64; - - /** - * Adds two single-precision complex floating-point numbers and assigns results to a provided output array. - * - * @param re1 - real component of the first complex number - * @param im1 - imaginary component of the first complex number - * @param re2 - real component of the second complex number - * @param im2 - imaginary component of the second complex number - * @param out - output array - * @param strideOut - stride length - * @param offsetOut - starting index - * @returns output array - * - * @example - * var Float32Array = require( '@stdlib/array/float32' ); - * - * var out = new Float32Array( 2 ); - * var v = add.assign( 5.0, 3.0, 5.0, 3.0, out, 1, 0 ); - * // returns [ 10.0, 6.0 ] - * - * var bool = ( out === v ); - * // returns true - */ - assign>( re1: number, im1: number, re2: number, im2: number, out: T, strideOut: number, offsetOut: number ): T; - - /** - * Adds two single-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. - * - * @param z1 - first complex number view - * @param strideZ1 - stride length for `z1` - * @param offsetZ1 - starting index for `z1` - * @param z2 - second complex number view - * @param strideZ2 - stride length for `z2` - * @param offsetZ2 - starting index for `z2` - * @param out - output array - * @param strideOut - stride length for `out` - * @param offsetOut - starting index for `out` - * @returns output array - * - * @example - * var Float32Array = require( '@stdlib/array/float32' ); - * - * var z1 = new Float32Array( [ 5.0, 3.0 ] ); - * var z2 = new Float32Array( [ 5.0, 3.0 ] ); - * - * var out = add.strided( z1, 1, 0, z2, 1, 0, new Float32Array( 2 ), 1, 0 ); - * // returns [ 10.0, 6.0 ] - */ - strided, U extends NumericArray | Collection, V extends NumericArray | Collection>( z1: T, strideZ1: number, offsetZ1: number, z2: U, strideZ2: number, offsetZ2: number, out: V, strideOut: number, offsetOut: number ): V; -} - -/** -* Adds two single-precision complex floating-point numbers. -* -* @param z1 - complex number -* @param z2 - complex number -* @returns result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var out = add( z, z ); -* // returns [ 10.0, 6.0 ] -* -* @example -* var Float32Array = require( '@stdlib/array/float32' ); -* -* var out = new Float32Array( 2 ); -* var v = add.assign( 5.0, 3.0, 5.0, 3.0, out, 1, 0 ); -* // returns [ 10.0, 6.0 ] -* -* var bool = ( out === v ); -* // returns true -* -* @example -* var Float32Array = require( '@stdlib/array/float32' ); -* -* var z1 = new Float32Array( [ 5.0, 3.0 ] ); -* var z2 = new Float32Array( [ 5.0, 3.0 ] ); -* -* var out = add.strided( z1, 1, 0, z2, 1, 0, new Float32Array( 2 ), 1, 0 ); -* // returns [ 10.0, 6.0 ] -*/ -declare var add: Add; - - -// EXPORTS // - -export = add; diff --git a/float32/base/add/docs/types/test.ts b/float32/base/add/docs/types/test.ts deleted file mode 100644 index cec5adc3..00000000 --- a/float32/base/add/docs/types/test.ts +++ /dev/null @@ -1,356 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64 = require( './../../../../../float32/ctor' ); -import add = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - const z = new Complex64( 1.0, 1.0 ); - - add( z, z ); // $ExpectType Complex64 -} - -// The compiler throws an error if the function is provided a first argument which is not a complex number... -{ - const z = new Complex64( 1.0, 1.0 ); - - add( true, z ); // $ExpectError - add( false, z ); // $ExpectError - add( null, z ); // $ExpectError - add( undefined, z ); // $ExpectError - add( '5', z ); // $ExpectError - add( [], z ); // $ExpectError - add( {}, z ); // $ExpectError - add( ( x: number ): number => x, z ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument which is not a complex number... -{ - const z = new Complex64( 1.0, 1.0 ); - - add( z, true ); // $ExpectError - add( z, false ); // $ExpectError - add( z, null ); // $ExpectError - add( z, undefined ); // $ExpectError - add( z, '5' ); // $ExpectError - add( z, [] ); // $ExpectError - add( z, {} ); // $ExpectError - add( z, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z = new Complex64( 1.0, 1.0 ); - - add(); // $ExpectError - add( z ); // $ExpectError - add( z, z, z ); // $ExpectError -} - -// Attached to the main export is an `assign` method which returns a collection... -{ - add.assign( 1.0, 1.0, 1.0, 1.0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - add.assign( 1.0, 1.0, 1.0, 1.0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `assign` method is provided a first argument which is not a number... -{ - const out = new Float32Array( 2 ); - - add.assign( true, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( false, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( null, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( undefined, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( '5', 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( [], 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( {}, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( ( x: number ): number => x, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a second argument which is not a number... -{ - const out = new Float32Array( 2 ); - - add.assign( 1.0, true, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, false, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, null, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, undefined, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, '5', 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, [], 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, {}, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, ( x: number ): number => x, 3.0, 4.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a third argument which is not a number... -{ - const out = new Float32Array( 2 ); - - add.assign( 1.0, 2.0, true, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, false, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, null, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, undefined, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, '5', 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, [], 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, {}, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, ( x: number ): number => x, 4.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fourth argument which is not a number... -{ - const out = new Float32Array( 2 ); - - add.assign( 1.0, 2.0, 3.0, true, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, false, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, null, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, undefined, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, '5', out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, [], out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, {}, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fifth argument which is not a collection... -{ - add.assign( 1.0, 2.0, 3.0, 4.0, 1, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, true, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, false, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, null, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, undefined, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, '5', 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, [ '5' ], 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, {}, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a sixth argument which is not a number... -{ - const out = new Float32Array( 2 ); - - add.assign( 1.0, 2.0, 3.0, 4.0, out, true, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, false, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, null, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, undefined, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, '5', 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, [], 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, {}, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a seventh argument which is not a number... -{ - const out = new Float32Array( 2 ); - - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1, true ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1, false ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1, null ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1, undefined ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1, '5' ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1, [] ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1, {} ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided an unsupported number of arguments... -{ - const out = new Float32Array( 2 ); - - add.assign(); // $ExpectError - add.assign( 1.0 ); // $ExpectError - add.assign( 1.0, 2.0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1, 0, {} ); // $ExpectError -} - -// Attached to the main export is a `strided` method which returns a collection... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - - add.strided( z1, 1, 0, z2, 1, 0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - add.strided( z1, 1, 0, z2, 1, 0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - add.strided( z1, 1, 0, z2, 1, 0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `strided` method is provided a first argument which is not a collection... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const out = new Float32Array( z2.length ); - - add.strided( true, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( false, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( null, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( undefined, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( '5', 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( [ '5' ], 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( {}, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( ( x: number ): number => x, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a second argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const out = new Float32Array( z2.length ); - - add.strided( z1, true, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, false, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, null, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, undefined, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, '5', 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, [], 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, {}, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, ( x: number ): number => x, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a third argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const out = new Float32Array( 2 ); - - add.strided( z1, 1, true, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, false, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, null, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, undefined, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, '5', z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, [], z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, {}, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, ( x: number ): number => x, z2, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fourth argument which is not a collection... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const out = new Float32Array( z2.length ); - - add.strided( z1, 1, 0, true, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, false, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, null, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, undefined, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, '5', 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, [ '5' ], 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, {}, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, ( x: number ): number => x, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fifth argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const out = new Float32Array( z2.length ); - - add.strided( z1, 1, 0, z2, true, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, false, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, null, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, undefined, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, '5', 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, [], 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, {}, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, ( x: number ): number => x, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a sixth argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const out = new Float32Array( z2.length ); - - add.strided( z1, 1, 0, z2, 1, true, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, false, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, null, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, undefined, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, '5', out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, [], out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, {}, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a seventh argument which is not a collection... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - - add.strided( z1, 1, 0, z2, 1, 0, 1, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, true, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, false, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, null, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, undefined, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, '5', 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, [ '5' ], 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, {}, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an eighth argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const out = new Float32Array( z2.length ); - - add.strided( z1, 1, 0, z2, 1, 0, out, true, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, false, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, null, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, undefined, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, '5', 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, [], 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, {}, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a ninth argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const out = new Float32Array( z2.length ); - - add.strided( z1, 1, 0, z2, 1, 0, out, 1, true ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, 1, false ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, 1, null ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, 1, undefined ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, 1, '5' ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, 1, [] ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, 1, {} ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an unsupported number of arguments... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const out = new Float32Array( z2.length ); - - add.strided(); // $ExpectError - add.strided( z1 ); // $ExpectError - add.strided( z1, 1 ); // $ExpectError - add.strided( z1, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, 1 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, 1, 0, {} ); // $ExpectError -} diff --git a/float32/base/add/examples/c/Makefile b/float32/base/add/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float32/base/add/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/add/examples/c/example.c b/float32/base/add/examples/c/example.c deleted file mode 100644 index 27479fa3..00000000 --- a/float32/base/add/examples/c/example.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/add.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 3.14f, 1.5f ), - stdlib_complex64( -3.14f, 1.5f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - stdlib_complex64_t v; - stdlib_complex64_t y; - float re; - float im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex64_reim( v, &re, &im ); - printf( "z = %f + %fi\n", re, im ); - - y = stdlib_base_complex64_add( v, v ); - stdlib_complex64_reim( y, &re, &im ); - printf( "add(z, z) = %f + %fi\n", re, im ); - } -} diff --git a/float32/base/add/examples/index.js b/float32/base/add/examples/index.js deleted file mode 100644 index 8d1adce1..00000000 --- a/float32/base/add/examples/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64Array = require( '@stdlib/array/complex64' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var add = require( './../lib' ); - -// Generate arrays of random values: -var z1 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise addition: -logEachMap( '(%s) + (%s) = %s', z1, z2, add ); diff --git a/float32/base/add/include.gypi b/float32/base/add/include.gypi deleted file mode 100644 index 5c60648e..00000000 --- a/float32/base/add/include.gypi +++ /dev/null @@ -1,53 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A GYP include file for building a Node.js native add-on. -# -# Main documentation: -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Source directory: - 'src_dir': './src', - - # Include directories: - 'include_dirs': [ - '[ 3.0, 4.0 ] -*/ -function assign( re1, im1, re2, im2, out, strideOut, offsetOut ) { - out[ offsetOut ] = float64ToFloat32( re1 + re2 ); - out[ offsetOut+strideOut ] = float64ToFloat32( im1 + im2 ); - return out; -} - - -// EXPORTS // - -module.exports = assign; diff --git a/float32/base/add/lib/index.js b/float32/base/add/lib/index.js deleted file mode 100644 index 437e4ef0..00000000 --- a/float32/base/add/lib/index.js +++ /dev/null @@ -1,54 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Add two single-precision complex floating-point numbers. -* -* @module @stdlib/complex/float32/base/add -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var add = require( '@stdlib/complex/float32/base/add' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var out = add( z, z ); -* // returns [ 10.0, 6.0 ] -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var main = require( './main.js' ); -var assign = require( './assign.js' ); -var strided = require( './strided.js' ); - - -// MAIN // - -setReadOnly( main, 'assign', assign ); -setReadOnly( main, 'strided', strided ); - - -// EXPORTS // - -module.exports = main; - -// exports: { "assign": "main.assign", "strided": "main.strided" } diff --git a/float32/base/add/lib/main.js b/float32/base/add/lib/main.js deleted file mode 100644 index 3e452d1c..00000000 --- a/float32/base/add/lib/main.js +++ /dev/null @@ -1,55 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var f32 = require( '@stdlib/number/float64/base/to-float32' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); - - -// MAIN // - -/** -* Adds two single-precision complex floating-point numbers. -* -* @param {Complex64} z1 - complex number -* @param {Complex64} z2 - complex number -* @returns {Complex64} result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var out = add( z, z ); -* // returns [ 10.0, 6.0 ] -*/ -function add( z1, z2 ) { - var re = f32( realf( z1 ) + realf( z2 ) ); - var im = f32( imagf( z1 ) + imagf( z2 ) ); - return new Complex64( re, im ); -} - - -// EXPORTS // - -module.exports = add; diff --git a/float32/base/add/lib/native.js b/float32/base/add/lib/native.js deleted file mode 100644 index 9511c3ef..00000000 --- a/float32/base/add/lib/native.js +++ /dev/null @@ -1,53 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex64 = require( './../../../../float32/ctor' ); -var addon = require( './../src/addon.node' ); - - -// MAIN // - -/** -* Adds two single-precision complex floating-point numbers. -* -* @private -* @param {Complex64} z1 - complex number -* @param {Complex64} z2 - complex number -* @returns {Complex64} result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var out = add( z, z ); -* // returns [ 10.0, 6.0 ] -*/ -function add( z1, z2 ) { - var v = addon( z1, z2 ); - return new Complex64( v.re, v.im ); -} - - -// EXPORTS // - -module.exports = add; diff --git a/float32/base/add/lib/strided.js b/float32/base/add/lib/strided.js deleted file mode 100644 index 2434c820..00000000 --- a/float32/base/add/lib/strided.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); - - -// MAIN // - -/** -* Adds two single-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. -* -* @param {Float32Array} z1 - first complex number view -* @param {integer} strideZ1 - stride length for `z1` -* @param {NonNegativeInteger} offsetZ1 - starting index for `z1` -* @param {Float32Array} z2 - second complex number view -* @param {integer} strideZ2 - stride length for `z2` -* @param {NonNegativeInteger} offsetZ2 - starting index for `z2` -* @param {Collection} out - output array -* @param {integer} strideOut - stride length for `out` -* @param {NonNegativeInteger} offsetOut - starting index for `out` -* @returns {Collection} output array -* -* @example -* var Float32Array = require( '@stdlib/array/float32' ); -* -* var z1 = new Float32Array( [ 5.0, 3.0 ] ); -* var z2 = new Float32Array( [ -2.0, 1.0 ] ); -* -* var out = strided( z1, 1, 0, z2, 1, 0, new Float32Array( 2 ), 1, 0 ); -* // returns [ 3.0, 4.0 ] -*/ -function strided( z1, strideZ1, offsetZ1, z2, strideZ2, offsetZ2, out, strideOut, offsetOut ) { // eslint-disable-line max-len - out[ offsetOut ] = float64ToFloat32( z1[ offsetZ1 ] + z2[ offsetZ2 ] ); - out[ offsetOut+strideOut ] = float64ToFloat32( z1[ offsetZ1+strideZ1 ] + z2[ offsetZ2+strideZ2 ] ); // eslint-disable-line max-len - return out; -} - - -// EXPORTS // - -module.exports = strided; diff --git a/float32/base/add/manifest.json b/float32/base/add/manifest.json deleted file mode 100644 index c5511326..00000000 --- a/float32/base/add/manifest.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/napi/binary", - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - } - ] -} diff --git a/float32/base/add/package.json b/float32/base/add/package.json deleted file mode 100644 index e7d2221a..00000000 --- a/float32/base/add/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "@stdlib/complex/float32/base/add", - "version": "0.0.0", - "description": "Add two single-precision complex floating-point numbers.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "add", - "cadd", - "caddf", - "addition", - "sum", - "arithmetic", - "complex", - "cmplx", - "number" - ] -} diff --git a/float32/base/add/src/Makefile b/float32/base/add/src/Makefile deleted file mode 100644 index a28d8988..00000000 --- a/float32/base/add/src/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - - -# RULES # - -#/ -# Removes generated files for building an add-on. -# -# @example -# make clean-addon -#/ -clean-addon: - $(QUIET) -rm -f *.o *.node - -.PHONY: clean-addon - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: clean-addon - -.PHONY: clean diff --git a/float32/base/add/src/addon.c b/float32/base/add/src/addon.c deleted file mode 100644 index edd54b75..00000000 --- a/float32/base/add/src/addon.c +++ /dev/null @@ -1,22 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/add.h" -#include "stdlib/math/base/napi/binary.h" - -STDLIB_MATH_BASE_NAPI_MODULE_CC_C( stdlib_base_complex64_add ) diff --git a/float32/base/add/src/main.c b/float32/base/add/src/main.c deleted file mode 100644 index 2af720be..00000000 --- a/float32/base/add/src/main.c +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/add.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" - -/** -* Adds two single-precision complex floating-point numbers. -* -* @param z1 input value -* @param z2 input value -* @return result -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* #include "stdlib/complex/float32/real.h" -* #include "stdlib/complex/float32/imag.h" -* -* stdlib_complex64_t z = stdlib_complex64( 3.0f, -2.0f ); -* -* stdlib_complex64_t out = stdlib_base_complex64_add( z, z ); -* -* float re = stdlib_complex64_real( out ); -* // returns 6.0f -* -* float im = stdlib_complex64_imag( out ); -* // returns -4.0f -*/ -stdlib_complex64_t stdlib_base_complex64_add( const stdlib_complex64_t z1, const stdlib_complex64_t z2 ) { - float re1; - float re2; - float im1; - float im2; - float re; - float im; - - stdlib_complex64_reim( z1, &re1, &im1 ); - stdlib_complex64_reim( z2, &re2, &im2 ); - - re = re1 + re2; - im = im1 + im2; - - return stdlib_complex64( re, im ); -} diff --git a/float32/base/add/test/test.assign.js b/float32/base/add/test/test.assign.js deleted file mode 100644 index 81a98377..00000000 --- a/float32/base/add/test/test.assign.js +++ /dev/null @@ -1,132 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); -var Float32Array = require( '@stdlib/array/float32' ); -var add = require( './../lib/assign.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof add, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function adds two complex numbers', function test( t ) { - var expected; - var out; - var v; - - out = new Float32Array( 2 ); - v = add( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ); - - expected = new Float32Array( [ 3.0, 4.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 4 ); - v = add( 5.0, 3.0, -2.0, 1.0, out, 2, 0 ); - - expected = new Float32Array( [ 3.0, 0.0, 4.0, 0.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 4 ); - v = add( 5.0, 3.0, -2.0, 1.0, out, 2, 1 ); - - expected = new Float32Array( [ 0.0, 3.0, 0.0, 4.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 4 ); - v = add( 5.0, 3.0, -2.0, 1.0, out, -2, 3 ); - - expected = new Float32Array( [ 0.0, 4.0, 0.0, 3.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the output component is `NaN`', function test( t ) { - var expected; - var out; - var v; - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, 4.0 ] ); - - v = add( NaN, 3.0, -2.0, 1.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, 4.0 ] ); - - v = add( 5.0, 3.0, NaN, 1.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, 4.0 ] ); - - v = add( NaN, 3.0, NaN, 1.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ 3.0, NaN ] ); - - v = add( 5.0, NaN, -2.0, 1.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ 3.0, NaN ] ); - - v = add( 5.0, 3.0, -2.0, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ 3.0, NaN ] ); - - v = add( 5.0, NaN, -2.0, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = add( NaN, NaN, NaN, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/add/test/test.js b/float32/base/add/test/test.js deleted file mode 100644 index 2fd75094..00000000 --- a/float32/base/add/test/test.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isMethod = require( '@stdlib/assert/is-method' ); -var add = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof add, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'attached to the main export is an `assign` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( add, 'assign' ), true, 'returns expected value' ); - t.end(); -}); - -tape( 'attached to the main export is a `strided` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( add, 'strided' ), true, 'returns expected value' ); - t.end(); -}); diff --git a/float32/base/add/test/test.main.js b/float32/base/add/test/test.main.js deleted file mode 100644 index 2fd7cbbf..00000000 --- a/float32/base/add/test/test.main.js +++ /dev/null @@ -1,110 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var add = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof add, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function adds two complex numbers', function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - - v = add( z1, z2 ); - - t.strictEqual( real( v ), 3.0, 'returns expected value' ); - t.strictEqual( imag( v ), 4.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the resulting component is `NaN`', function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - - v = add( z1, z2 ); - t.strictEqual( isnanf( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 4.0, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( NaN, 1.0 ); - - v = add( z1, z2 ); - t.strictEqual( isnanf( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 4.0, 'returns expected value' ); - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( NaN, 1.0 ); - - v = add( z1, z2 ); - t.strictEqual( isnanf( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 4.0, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( -2.0, 1.0 ); - - v = add( z1, z2 ); - t.strictEqual( real( v ), 3.0, 'returns expected value' ); - t.strictEqual( isnanf( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, NaN ); - - v = add( z1, z2 ); - t.strictEqual( real( v ), 3.0, 'returns expected value' ); - t.strictEqual( isnanf( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( -2.0, NaN ); - - v = add( z1, z2 ); - t.strictEqual( real( v ), 3.0, 'returns expected value' ); - t.strictEqual( isnanf( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, NaN ); - z2 = new Complex64( NaN, NaN ); - - v = add( z1, z2 ); - t.strictEqual( isnanf( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/add/test/test.native.js b/float32/base/add/test/test.native.js deleted file mode 100644 index 0fa7dae9..00000000 --- a/float32/base/add/test/test.native.js +++ /dev/null @@ -1,119 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var tape = require( 'tape' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var add = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( add instanceof Error ) -}; - - -// TESTS // - -tape( 'main export is a function', opts, function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof add, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function adds two complex numbers', opts, function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - - v = add( z1, z2 ); - - t.strictEqual( realf( v ), 3.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 4.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the resulting component is `NaN`', opts, function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - - v = add( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( imagf( v ), 4.0, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( NaN, 1.0 ); - - v = add( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( imagf( v ), 4.0, 'returns expected value' ); - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( NaN, 1.0 ); - - v = add( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( imagf( v ), 4.0, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( -2.0, 1.0 ); - - v = add( z1, z2 ); - t.strictEqual( realf( v ), 3.0, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, NaN ); - - v = add( z1, z2 ); - t.strictEqual( realf( v ), 3.0, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( -2.0, NaN ); - - v = add( z1, z2 ); - t.strictEqual( realf( v ), 3.0, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, NaN ); - z2 = new Complex64( NaN, NaN ); - - v = add( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/add/test/test.strided.js b/float32/base/add/test/test.strided.js deleted file mode 100644 index 96bdbac9..00000000 --- a/float32/base/add/test/test.strided.js +++ /dev/null @@ -1,158 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); -var Float32Array = require( '@stdlib/array/float32' ); -var add = require( './../lib/strided.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof add, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function adds two complex numbers', function test( t ) { - var expected; - var out; - var z1; - var z2; - var v; - - z1 = new Float32Array( [ 5.0, 3.0 ] ); - z2 = new Float32Array( [ -2.0, 1.0 ] ); - out = new Float32Array( 2 ); - v = add( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - - expected = new Float32Array( [ 3.0, 4.0 ] ); - - t.deepEqual( v, out, 'returns expected value' ); - t.deepEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, 0.0, 3.0, 0.0 ] ); - z2 = new Float32Array( [ -2.0, 1.0 ] ); - out = new Float32Array( 4 ); - v = add( z1, 2, 0, z2, 1, 0, out, 2, 0 ); - - expected = new Float32Array( [ 3.0, 0.0, 4.0, 0.0 ] ); - - t.deepEqual( v, out, 'returns expected value' ); - t.deepEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, 3.0 ] ); - z2 = new Float32Array( [ 0.0, -2.0, 0.0, 1.0 ] ); - out = new Float32Array( 4 ); - v = add( z1, 1, 0, z2, 2, 1, out, 2, 1 ); - - expected = new Float32Array( [ 0.0, 3.0, 0.0, 4.0 ] ); - - t.deepEqual( v, out, 'returns expected value' ); - t.deepEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 3.0, 5.0 ] ); - z2 = new Float32Array( [ 1.0, -2.0 ] ); - out = new Float32Array( 4 ); - v = add( z1, -1, 1, z2, -1, 1, out, -2, 3 ); - - expected = new Float32Array( [ 0.0, 4.0, 0.0, 3.0 ] ); - - t.deepEqual( v, out, 'returns expected value' ); - t.deepEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the output component is `NaN`', function test( t ) { - var expected; - var out; - var z1; - var z2; - var v; - - z1 = new Float32Array( [ NaN, 3.0 ] ); - z2 = new Float32Array( [ -2.0, 1.0 ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, 4.0 ] ); - - v = add( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.deepEqual( v, out, 'returns expected value' ); - t.deepEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, 3.0 ] ); - z2 = new Float32Array( [ NaN, 1.0 ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, 4.0 ] ); - - v = add( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.deepEqual( v, out, 'returns expected value' ); - t.deepEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ NaN, 3.0 ] ); - z2 = new Float32Array( [ NaN, 1.0 ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, 4.0 ] ); - - v = add( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.deepEqual( v, out, 'returns expected value' ); - t.deepEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, NaN ] ); - z2 = new Float32Array( [ -2.0, 1.0 ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ 3.0, NaN ] ); - - v = add( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.deepEqual( v, out, 'returns expected value' ); - t.deepEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, 3.0 ] ); - z2 = new Float32Array( [ -2.0, NaN ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ 3.0, NaN ] ); - - v = add( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.deepEqual( v, out, 'returns expected value' ); - t.deepEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, NaN ] ); - z2 = new Float32Array( [ -2.0, NaN ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ 3.0, NaN ] ); - - v = add( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.deepEqual( v, out, 'returns expected value' ); - t.deepEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ NaN, NaN ] ); - z2 = new Float32Array( [ NaN, NaN ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = add( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.deepEqual( v, out, 'returns expected value' ); - t.deepEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/assert/README.md b/float32/base/assert/README.md deleted file mode 100644 index c27f495c..00000000 --- a/float32/base/assert/README.md +++ /dev/null @@ -1,120 +0,0 @@ - - -# Assert - -> Base (i.e., lower-level) single-precision complex floating-point number assertion functions. - -
- -## Usage - -```javascript -var assert = require( '@stdlib/complex/float32/base/assert' ); -``` - -#### assert - -Namespace containing base (i.e., lower-level) single-precision complex floating-point number assertion functions. - -```javascript -var ns = assert; -// returns {...} -``` - -The namespace contains the following functions: - - - -
- -- [`isAlmostEqual( z1, z2, maxULP )`][@stdlib/complex/float32/base/assert/is-almost-equal]: test whether two single-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place). -- [`isAlmostSameValue( z1, z2, maxULP )`][@stdlib/complex/float32/base/assert/is-almost-same-value]: test whether two single-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place). -- [`isEqual( z1, z2 )`][@stdlib/complex/float32/base/assert/is-equal]: test whether two single-precision complex floating-point numbers are equal. -- [`isNotEqual( z1, z2 )`][@stdlib/complex/float32/base/assert/is-not-equal]: test whether two single-precision complex floating-point numbers are not equal. -- [`isSameValueZero( z1, z2 )`][@stdlib/complex/float32/base/assert/is-same-value-zero]: test whether two single-precision complex floating-point numbers are the same value. -- [`isSameValue( z1, z2 )`][@stdlib/complex/float32/base/assert/is-same-value]: test whether two single-precision complex floating-point numbers are the same value. - -
- - - -
- - - - - -
- -
- - - -
- -## Examples - - - - - -```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/complex/float32/base/assert' ); - -console.log( objectKeys( ns ) ); -``` - -
- - - - - - - - - - - - - - diff --git a/float32/base/assert/docs/types/index.d.ts b/float32/base/assert/docs/types/index.d.ts deleted file mode 100644 index 2d4f3232..00000000 --- a/float32/base/assert/docs/types/index.d.ts +++ /dev/null @@ -1,181 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/* eslint-disable max-lines */ - -import isAlmostEqual = require( './../../../../../float32/base/assert/is-almost-equal' ); -import isAlmostSameValue = require( './../../../../../float32/base/assert/is-almost-same-value' ); -import isEqual = require( './../../../../../float32/base/assert/is-equal' ); -import isNotEqual = require( './../../../../../float32/base/assert/is-not-equal' ); -import isSameValue = require( './../../../../../float32/base/assert/is-same-value' ); -import isSameValueZero = require( './../../../../../float32/base/assert/is-same-value-zero' ); - -/** -* Interface describing the `assert` namespace. -*/ -interface Namespace { - /** - * Tests whether two single-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place). - * - * ## Notes - * - * - The function returns `false` if either input value has a `NaN` real or imaginary component. - * - The function does not distinguish between `-0` and `+0`, treating them as equal. - * - * @param z1 - first complex number - * @param z2 - second complex number - * @param maxULP - maximum allowed ULP difference - * @returns boolean indicating whether two single-precision complex floating-point numbers are approximately equal within a specified number of ULPs - * - * @example - * var EPS = require( '@stdlib/constants/float32/eps' ); - * var Complex64 = require( './../../../../../float32/ctor' ); - * - * var z1 = new Complex64( 1.0, 3.0 ); - * var z2 = new Complex64( 1.0+EPS, 3.0 ); - * - * var bool = ns.isAlmostEqual( z1, z2, 0 ); - * // returns false - * - * bool = ns.isAlmostEqual( z1, z2, 1 ); - * // returns true - */ - isAlmostEqual: typeof isAlmostEqual; - - /** - * Tests whether two single-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place). - * - * ## Notes - * - * - The function differs from the `===` operator in that the function treats `-0` and `+0` as distinct and `NaNs` as the same. - * - * @param z1 - first complex number - * @param z2 - second complex number - * @param maxULP - maximum allowed ULP difference - * @returns boolean indicating whether two single-precision complex floating-point numbers are approximately the same value within a specified number of ULPs - * - * @example - * var EPS = require( '@stdlib/constants/float32/eps' ); - * var Complex64 = require( './../../../../../float32/ctor' ); - * - * var z1 = new Complex64( 1.0, 3.0 ); - * var z2 = new Complex64( 1.0+EPS, 3.0 ); - * - * var bool = ns.isAlmostSameValue( z1, z2, 0 ); - * // returns false - * - * bool = ns.isAlmostSameValue( z1, z2, 1 ); - * // returns true - */ - isAlmostSameValue: typeof isAlmostSameValue; - - /** - * Tests whether two single-precision complex floating-point numbers are equal. - * - * @param z1 - first complex number - * @param z2 - second complex number - * @returns boolean indicating if both complex numbers are equal - * - * @example - * var Complex64 = require( './../../../../../float32/ctor' ); - * - * var z1 = new Complex64( 5.0, 3.0 ); - * var z2 = new Complex64( 5.0, 3.0 ); - * - * var v = ns.isEqual( z1, z2 ); - * // returns true - */ - isEqual: typeof isEqual; - - /** - * Tests whether two single-precision complex floating-point numbers are not equal. - * - * @param z1 - first complex number - * @param z2 - second complex number - * @returns boolean indicating if both complex numbers are not equal - * - * @example - * var Complex64 = require( './../../../../../float32/ctor' ); - * - * var z1 = new Complex64( 5.0, 3.0 ); - * var z2 = new Complex64( 5.0, -3.0 ); - * - * var v = ns.isNotEqual( z1, z2 ); - * // returns true - */ - isNotEqual: typeof isNotEqual; - - /** - * Tests whether two single-precision complex floating-point numbers are the same value. - * - * ## Notes - * - * - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5. - * - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same. - * - * [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12 - * - * @param z1 - first complex number - * @param z2 - second complex number - * @returns boolean indicating if both complex numbers are the same value - * - * @example - * var Complex64 = require( './../../../../../float32/ctor' ); - * - * var z1 = new Complex64( 5.0, 3.0 ); - * var z2 = new Complex64( 5.0, 3.0 ); - * - * var v = ns.isSameValue( z1, z2 ); - * // returns true - */ - isSameValue: typeof isSameValue; - - /** - * Tests whether two single-precision complex floating-point numbers are the same value. - * - * ## Notes - * - * - In contrast to the strict equality operator `===`, `NaNs` are treated as the same value. - * - * @param z1 - first complex number - * @param z2 - second complex number - * @returns boolean indicating if both complex numbers are the same value - * - * @example - * var Complex64 = require( './../../../../../float32/ctor' ); - * - * var z1 = new Complex64( 5.0, 3.0 ); - * var z2 = new Complex64( 5.0, 3.0 ); - * - * var v = ns.isSameValueZero( z1, z2 ); - * // returns true - */ - isSameValueZero: typeof isSameValueZero; -} - -/** -* Base (i.e., lower-level) single-precision complex number assertion functions. -*/ -declare var ns: Namespace; - - -// EXPORTS // - -export = ns; diff --git a/float32/base/assert/docs/types/test.ts b/float32/base/assert/docs/types/test.ts deleted file mode 100644 index 2f81653a..00000000 --- a/float32/base/assert/docs/types/test.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable @typescript-eslint/no-unused-expressions */ - -import ns = require( './index' ); - - -// TESTS // - -// The exported value is the expected interface... -{ - ns; // $ExpectType Namespace -} diff --git a/float32/base/assert/examples/index.js b/float32/base/assert/examples/index.js deleted file mode 100644 index 6115ca08..00000000 --- a/float32/base/assert/examples/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - -console.log( objectKeys( ns ) ); diff --git a/float32/base/assert/is-almost-equal/README.md b/float32/base/assert/is-almost-equal/README.md deleted file mode 100644 index e7c70a43..00000000 --- a/float32/base/assert/is-almost-equal/README.md +++ /dev/null @@ -1,158 +0,0 @@ - - -# isAlmostEqual - -> Test whether two single-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place). - - - -
- -
- - - - - -
- -## Usage - -```javascript -var isAlmostEqual = require( '@stdlib/complex/float32/base/assert/is-almost-equal' ); -``` - -#### isAlmostEqual( z1, z2, maxULP ) - -Tests whether two single-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place). - -```javascript -var EPS = require( '@stdlib/constants/float32/eps' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z1 = new Complex64( 1.0, 3.0 ); -var z2 = new Complex64( 1.0+EPS, 3.0 ); - -var out = isAlmostEqual( z1, z2, 0 ); -// returns false - -out = isAlmostEqual( z1, z2, 1 ); -// returns true -``` - -The function returns `false` if either input value has a `NaN` real or imaginary component. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z1 = new Complex64( NaN, 3.0 ); -var z2 = new Complex64( 1.0, 3.0 ); - -var out = isAlmostEqual( z1, z2, 1 ); -// returns false - -out = isAlmostEqual( z2, z1, 1 ); -// returns false - -z1 = new Complex64( NaN, NaN ); -z2 = new Complex64( NaN, NaN ); - -out = isAlmostEqual( z1, z2, 1 ); -// returns false -``` - -The function does not distinguish between `-0` and `+0`, treating them as equal. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z1 = new Complex64( 0.0, 0.0 ); -var z2 = new Complex64( -0.0, -0.0 ); - -var out = isAlmostEqual( z1, z2, 0 ); -// returns true -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var EPS = require( '@stdlib/constants/float32/eps' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var isAlmostEqual = require( '@stdlib/complex/float32/base/assert/is-almost-equal' ); - -var z1 = new Complex64( 1.0, 3.0+EPS ); -var z2 = new Complex64( 1.0+EPS, 3.0 ); -console.log( isAlmostEqual( z1, z2, 1 ) ); -// => true - -z1 = new Complex64( 1.0, 3.0+EPS ); -z2 = new Complex64( 1.0+EPS+EPS, 3.0 ); -console.log( isAlmostEqual( z1, z2, 1 ) ); -// => false - -z1 = new Complex64( 0.0, 0.0 ); -z2 = new Complex64( -0.0, 0.0 ); -console.log( isAlmostEqual( z1, z2, 0 ) ); -// => true - -z1 = new Complex64( NaN, 0.0 ); -z2 = new Complex64( 1.0, 0.0 ); -console.log( isAlmostEqual( z1, z2, 1 ) ); -// => false -``` - -
- - - - - - - - - - - - - - diff --git a/float32/base/assert/is-almost-equal/benchmark/benchmark.js b/float32/base/assert/is-almost-equal/benchmark/benchmark.js deleted file mode 100644 index 92057143..00000000 --- a/float32/base/assert/is-almost-equal/benchmark/benchmark.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex64 = require( './../../../../../float32/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var isAlmostEqual = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var z1; - var z2; - var v; - var i; - - z1 = [ - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ) - ]; - z2 = [ - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ), - z1[ 0 ], - z1[ 1 ] - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = isAlmostEqual( z1[ i%z1.length ], z2[ i%z2.length ], 1 ); - if ( typeof v !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( v ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/assert/is-almost-equal/docs/repl.txt b/float32/base/assert/is-almost-equal/docs/repl.txt deleted file mode 100644 index 96d628f0..00000000 --- a/float32/base/assert/is-almost-equal/docs/repl.txt +++ /dev/null @@ -1,45 +0,0 @@ - -{{alias}}( z1, z2, maxULP ) - Tests whether two single-precision complex floating-point numbers are - approximately equal within a specified number of ULPs (units in the last - place). - - The function returns `false` if either input value has a `NaN` real or - imaginary component. - - The function does not distinguish between `-0` and `+0`, treating them as - equal. - - Parameters - ---------- - z1: Complex64 - First complex number. - - z2: Complex64 - Second complex number. - - maxULP: number - Maximum allowed ULP difference. - - Returns - ------- - out: boolean - Boolean indicating whether two single-precision complex floating-point - numbers are approximately equal within a specified number of ULPs. - - Examples - -------- - > var re1 = 1.0; - > var im1 = 3.0; - > var re2 = 1.0 + {{alias:@stdlib/constants/float32/eps}}; - > var im2 = 3.0; - > var z1 = new {{alias:@stdlib/complex/float32/ctor}}( re1, im1 ); - > var z2 = new {{alias:@stdlib/complex/float32/ctor}}( re2, im2 ); - > var v = {{alias}}( z1, z2, 0 ) - false - > v = {{alias}}( z1, z2, 1 ) - true - - See Also - -------- - diff --git a/float32/base/assert/is-almost-equal/docs/types/index.d.ts b/float32/base/assert/is-almost-equal/docs/types/index.d.ts deleted file mode 100644 index 6e3ea050..00000000 --- a/float32/base/assert/is-almost-equal/docs/types/index.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex64 } from '@stdlib/types/complex'; - -/** -* Tests whether two single-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place). -* -* ## Notes -* -* - The function returns `false` if either input value has a `NaN` real or imaginary component. -* - The function does not distinguish between `-0` and `+0`, treating them as equal. -* -* @param z1 - first complex number -* @param z2 - second complex number -* @param maxULP - maximum allowed ULP difference -* @returns boolean indicating whether two single-precision complex floating-point numbers are approximately equal within a specified number of ULPs -* -* @example -* var EPS = require( '@stdlib/constants/float32/eps' ); -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 1.0, 3.0 ); -* var z2 = new Complex64( 1.0+EPS, 3.0 ); -* -* var bool = isAlmostEqual( z1, z2, 0 ); -* // returns false -* -* bool = isAlmostEqual( z1, z2, 1 ); -* // returns true -*/ -declare function isAlmostEqual( z1: Complex64, z2: Complex64, maxULP: number ): boolean; - - -// EXPORTS // - -export = isAlmostEqual; diff --git a/float32/base/assert/is-almost-equal/docs/types/test.ts b/float32/base/assert/is-almost-equal/docs/types/test.ts deleted file mode 100644 index 6613b145..00000000 --- a/float32/base/assert/is-almost-equal/docs/types/test.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64 = require( './../../../../../../float32/ctor' ); -import isAlmostEqual = require( './index' ); - - -// TESTS // - -// The function returns a boolean... -{ - const z1 = new Complex64( 5.0, 3.0 ); - const z2 = new Complex64( 5.0, 3.0 ); - - isAlmostEqual( z1, z2, 1 ); // $ExpectType boolean -} - -// The compiler throws an error if the function is provided a first argument that is not a complex number... -{ - const z2 = new Complex64( 5.0, 3.0 ); - - isAlmostEqual( 'abc', z2, 1 ); // $ExpectError - isAlmostEqual( 123, z2, 1 ); // $ExpectError - isAlmostEqual( true, z2, 1 ); // $ExpectError - isAlmostEqual( false, z2, 1 ); // $ExpectError - isAlmostEqual( [], z2, 1 ); // $ExpectError - isAlmostEqual( {}, z2, 1 ); // $ExpectError - isAlmostEqual( ( x: number ): number => x, z2, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a complex number... -{ - const z1 = new Complex64( 5.0, 3.0 ); - - isAlmostEqual( z1, 'abc', 1 ); // $ExpectError - isAlmostEqual( z1, 123, 1 ); // $ExpectError - isAlmostEqual( z1, true, 1 ); // $ExpectError - isAlmostEqual( z1, false, 1 ); // $ExpectError - isAlmostEqual( z1, [], 1 ); // $ExpectError - isAlmostEqual( z1, {}, 1 ); // $ExpectError - isAlmostEqual( z1, ( x: number ): number => x, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a third argument that is not a number... -{ - const z1 = new Complex64( 5.0, 3.0 ); - const z2 = new Complex64( 5.0, 3.0 ); - - isAlmostEqual( z1, z2, 'abc' ); // $ExpectError - isAlmostEqual( z1, z2, true ); // $ExpectError - isAlmostEqual( z1, z2, false ); // $ExpectError - isAlmostEqual( z1, z2, null ); // $ExpectError - isAlmostEqual( z1, z2, void 0 ); // $ExpectError - isAlmostEqual( z1, z2, [] ); // $ExpectError - isAlmostEqual( z1, z2, {} ); // $ExpectError - isAlmostEqual( z1, z2, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z1 = new Complex64( 5.0, 3.0 ); - const z2 = new Complex64( 5.0, 3.0 ); - - isAlmostEqual(); // $ExpectError - isAlmostEqual( z1 ); // $ExpectError - isAlmostEqual( z1, z2 ); // $ExpectError - isAlmostEqual( z1, z2, 1, 1 ); // $ExpectError -} diff --git a/float32/base/assert/is-almost-equal/examples/index.js b/float32/base/assert/is-almost-equal/examples/index.js deleted file mode 100644 index ef72b1b1..00000000 --- a/float32/base/assert/is-almost-equal/examples/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var EPS = require( '@stdlib/constants/float32/eps' ); -var Complex64 = require( './../../../../../float32/ctor' ); -var isAlmostEqual = require( './../lib' ); - -var z1 = new Complex64( 1.0, 3.0+EPS ); -var z2 = new Complex64( 1.0+EPS, 3.0 ); -console.log( isAlmostEqual( z1, z2, 1 ) ); -// => true - -z1 = new Complex64( 1.0, 3.0+EPS ); -z2 = new Complex64( 1.0+EPS+EPS, 3.0 ); -console.log( isAlmostEqual( z1, z2, 1 ) ); -// => false - -z1 = new Complex64( 0.0, 0.0 ); -z2 = new Complex64( -0.0, 0.0 ); -console.log( isAlmostEqual( z1, z2, 0 ) ); -// => true - -z1 = new Complex64( NaN, 0.0 ); -z2 = new Complex64( 1.0, 0.0 ); -console.log( isAlmostEqual( z1, z2, 1 ) ); -// => false diff --git a/float32/base/assert/is-almost-equal/lib/index.js b/float32/base/assert/is-almost-equal/lib/index.js deleted file mode 100644 index ff4c2991..00000000 --- a/float32/base/assert/is-almost-equal/lib/index.js +++ /dev/null @@ -1,48 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Test whether two single-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place). -* -* @module @stdlib/complex/float32/base/assert/is-almost-equal -* -* @example -* var EPS = require( '@stdlib/constants/float32/eps' ); -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var isAlmostEqual = require( '@stdlib/complex/float32/base/assert/is-almost-equal' ); -* -* var z1 = new Complex64( 1.0, 3.0 ); -* var z2 = new Complex64( 1.0+EPS, 3.0 ); -* -* var bool = isAlmostEqual( z1, z2, 0 ); -* // returns false -* -* bool = isAlmostEqual( z1, z2, 1 ); -* // returns true -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float32/base/assert/is-almost-equal/lib/main.js b/float32/base/assert/is-almost-equal/lib/main.js deleted file mode 100644 index d654b895..00000000 --- a/float32/base/assert/is-almost-equal/lib/main.js +++ /dev/null @@ -1,67 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var isAlmostEqualF32 = require( '@stdlib/number/float32/base/assert/is-almost-equal' ); -var reimf = require( './../../../../../float32/reim' ); - - -// MAIN // - -/** -* Tests whether two single-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place). -* -* ## Notes -* -* - The function returns `false` if either input value has a `NaN` real or imaginary component. -* - The function does not distinguish between `-0` and `+0`, treating them as equal. -* -* @param {Complex64} z1 - first complex number -* @param {Complex64} z2 - second complex number -* @param {number} maxULP - maximum allowed ULP difference -* @returns {boolean} boolean indicating whether two single-precision complex floating-point numbers are approximately equal within a specified number of ULPs -* -* @example -* var EPS = require( '@stdlib/constants/float32/eps' ); -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 1.0, 3.0 ); -* var z2 = new Complex64( 1.0+EPS, 3.0 ); -* -* var bool = isAlmostEqual( z1, z2, 0 ); -* // returns false -* -* bool = isAlmostEqual( z1, z2, 1 ); -* // returns true -*/ -function isAlmostEqual( z1, z2, maxULP ) { - var parts1 = reimf( z1 ); - var parts2 = reimf( z2 ); - return ( - isAlmostEqualF32( parts1[ 0 ], parts2[ 0 ], maxULP ) && - isAlmostEqualF32( parts1[ 1 ], parts2[ 1 ], maxULP ) - ); -} - - -// EXPORTS // - -module.exports = isAlmostEqual; diff --git a/float32/base/assert/is-almost-equal/package.json b/float32/base/assert/is-almost-equal/package.json deleted file mode 100644 index be9eb7aa..00000000 --- a/float32/base/assert/is-almost-equal/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "@stdlib/complex/float32/base/assert/is-almost-equal", - "version": "0.0.0", - "description": "Test whether two single-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place).", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "number", - "base", - "assert", - "test", - "validate", - "equality", - "compare", - "comparison", - "equal", - "eq", - "same", - "issame", - "isequal", - "isalmostequal" - ] -} diff --git a/float32/base/assert/is-almost-equal/test/test.js b/float32/base/assert/is-almost-equal/test/test.js deleted file mode 100644 index 717e79ce..00000000 --- a/float32/base/assert/is-almost-equal/test/test.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex64 = require( './../../../../../float32/ctor' ); -var EPS = require( '@stdlib/constants/float32/eps' ); -var isAlmostEqual = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof isAlmostEqual, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns `false` if provided `NaN` as either real or imaginary component', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( NaN, 3.14 ); - z2 = new Complex64( 5.0, 3.14 ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), false, 'returns expected value' ); - - z2 = new Complex64( 5.0, NaN ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), false, 'returns expected value' ); - - z1 = new Complex64( NaN, NaN ); - z2 = new Complex64( NaN, NaN ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if provided two complex single-precision floating-point numbers which are the same value irrespective of the specified number of ULPs', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z1, 0 ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), true, 'returns expected value' ); - - z1 = new Complex64( -5.0, -3.0 ); - z2 = new Complex64( -5.0, -3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 0 ), true, 'returns expected value' ); - - z1 = new Complex64( 0.0, 0.0 ); - z2 = new Complex64( 0.0, 0.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 0 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if provided two complex single-precision floating-point numbers which are approximately equal within a specified number of ULPs', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 1.0, 3.0 ); - z2 = new Complex64( 1.0+EPS, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), true, 'returns expected value' ); - - z2 = new Complex64( 1.0+EPS+EPS, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 2 ), true, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 2 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `false` if provided two complex single-precision floating-point numbers which are not approximately equal within a specified number of ULPs', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 1.0, 3.0 ); - z2 = new Complex64( 1.0+EPS, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 0 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 0 ), false, 'returns expected value' ); - - z2 = new Complex64( 1.0+EPS+EPS, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if signed zeros are provided as real or imaginary components irrespective of the specified number of ULPs', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 0.0, 0.0 ); - z2 = new Complex64( -0.0, -0.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 0 ), true, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 0 ), true, 'returns expected value' ); - - t.strictEqual( isAlmostEqual( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/assert/is-almost-same-value/README.md b/float32/base/assert/is-almost-same-value/README.md deleted file mode 100644 index b50effb7..00000000 --- a/float32/base/assert/is-almost-same-value/README.md +++ /dev/null @@ -1,158 +0,0 @@ - - -# isAlmostSameValue - -> Test whether two single-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place). - - - -
- -
- - - - - -
- -## Usage - -```javascript -var isAlmostSameValue = require( '@stdlib/complex/float32/base/assert/is-almost-same-value' ); -``` - -#### isAlmostSameValue( z1, z2, maxULP ) - -Tests whether two single-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place). - -```javascript -var EPS = require( '@stdlib/constants/float32/eps' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z1 = new Complex64( 1.0, 3.0 ); -var z2 = new Complex64( 1.0+EPS, 3.0 ); - -var out = isAlmostSameValue( z1, z2, 0 ); -// returns false - -out = isAlmostSameValue( z1, z2, 1 ); -// returns true -``` - -In contrast to the strict equality operator `===`, the function distinguishes between `+0` and `-0` and treats `NaNs` as the same value. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z1 = new Complex64( NaN, 3.0 ); -var z2 = new Complex64( 1.0, 3.0 ); - -var out = isAlmostSameValue( z1, z2, 1 ); -// returns false - -out = isAlmostSameValue( z2, z1, 1 ); -// returns false - -z1 = new Complex64( NaN, NaN ); -z2 = new Complex64( NaN, NaN ); - -out = isAlmostSameValue( z1, z2, 1 ); -// returns true - -z1 = new Complex64( 0.0, 0.0 ); -z2 = new Complex64( -0.0, -0.0 ); - -out = isAlmostSameValue( z1, z2, 0 ); -// returns false -``` - -
- - - - - -
- -## Notes - -- The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm] as specified in ECMAScript 5. - -
- - - - - -
- -## Examples - - - -```javascript -var EPS = require( '@stdlib/constants/float32/eps' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var isAlmostSameValue = require( '@stdlib/complex/float32/base/assert/is-almost-same-value' ); - -var z1 = new Complex64( 1.0, 3.0+EPS ); -var z2 = new Complex64( 1.0+EPS, 3.0 ); -console.log( isAlmostSameValue( z1, z2, 1 ) ); -// => true - -z1 = new Complex64( 1.0, 3.0+EPS ); -z2 = new Complex64( 1.0+EPS+EPS, 3.0 ); -console.log( isAlmostSameValue( z1, z2, 1 ) ); -// => false - -z1 = new Complex64( 0.0, 0.0 ); -z2 = new Complex64( -0.0, 0.0 ); -console.log( isAlmostSameValue( z1, z2, 0 ) ); -// => false - -z1 = new Complex64( NaN, 0.0 ); -z2 = new Complex64( 1.0, 0.0 ); -console.log( isAlmostSameValue( z1, z2, 1 ) ); -// => false -``` - -
- - - - - - - - - - - - - - diff --git a/float32/base/assert/is-almost-same-value/benchmark/benchmark.js b/float32/base/assert/is-almost-same-value/benchmark/benchmark.js deleted file mode 100644 index ac86b6ef..00000000 --- a/float32/base/assert/is-almost-same-value/benchmark/benchmark.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex64 = require( './../../../../../float32/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var isAlmostSameValue = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var z1; - var z2; - var v; - var i; - - z1 = [ - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ) - ]; - z2 = [ - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ), - z1[ 0 ], - z1[ 1 ] - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = isAlmostSameValue( z1[ i%z1.length ], z2[ i%z2.length ], 1 ); - if ( typeof v !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( v ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/assert/is-almost-same-value/docs/repl.txt b/float32/base/assert/is-almost-same-value/docs/repl.txt deleted file mode 100644 index 307ba3f9..00000000 --- a/float32/base/assert/is-almost-same-value/docs/repl.txt +++ /dev/null @@ -1,43 +0,0 @@ - -{{alias}}( z1, z2, maxULP ) - Tests whether two single-precision complex floating-point numbers are - approximately the same value within a specified number of ULPs (units in the - last place). - - The function differs from the `===` operator in that the function treats - `-0` and `+0` as distinct and `NaNs` as the same. - - Parameters - ---------- - z1: Complex64 - First complex number. - - z2: Complex64 - Second complex number. - - maxULP: number - Maximum allowed ULP difference. - - Returns - ------- - out: boolean - Boolean indicating whether two single-precision complex floating-point - numbers are approximately the same value within a specified number of - ULPs. - - Examples - -------- - > var re1 = 1.0; - > var im1 = 3.0; - > var re2 = 1.0 + {{alias:@stdlib/constants/float32/eps}}; - > var im2 = 3.0; - > var z1 = new {{alias:@stdlib/complex/float32/ctor}}( re1, im1 ); - > var z2 = new {{alias:@stdlib/complex/float32/ctor}}( re2, im2 ); - > var v = {{alias}}( z1, z2, 0 ) - false - > v = {{alias}}( z1, z2, 1 ) - true - - See Also - -------- - diff --git a/float32/base/assert/is-almost-same-value/docs/types/index.d.ts b/float32/base/assert/is-almost-same-value/docs/types/index.d.ts deleted file mode 100644 index 334054ee..00000000 --- a/float32/base/assert/is-almost-same-value/docs/types/index.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex64 } from '@stdlib/types/complex'; - -/** -* Tests whether two single-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place). -* -* ## Notes -* -* - The function differs from the `===` operator in that the function treats `-0` and `+0` as distinct and `NaNs` as the same. -* -* @param z1 - first complex number -* @param z2 - second complex number -* @param maxULP - maximum allowed ULP difference -* @returns boolean indicating whether two single-precision complex floating-point numbers are approximately the same value within a specified number of ULPs -* -* @example -* var EPS = require( '@stdlib/constants/float32/eps' ); -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 1.0, 3.0 ); -* var z2 = new Complex64( 1.0+EPS, 3.0 ); -* -* var bool = isAlmostSameValue( z1, z2, 0 ); -* // returns false -* -* bool = isAlmostSameValue( z1, z2, 1 ); -* // returns true -*/ -declare function isAlmostSameValue( z1: Complex64, z2: Complex64, maxULP: number ): boolean; - - -// EXPORTS // - -export = isAlmostSameValue; diff --git a/float32/base/assert/is-almost-same-value/docs/types/test.ts b/float32/base/assert/is-almost-same-value/docs/types/test.ts deleted file mode 100644 index 2b7b7a83..00000000 --- a/float32/base/assert/is-almost-same-value/docs/types/test.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64 = require( './../../../../../../float32/ctor' ); -import isAlmostSameValue = require( './index' ); - - -// TESTS // - -// The function returns a boolean... -{ - const z1 = new Complex64( 5.0, 3.0 ); - const z2 = new Complex64( 5.0, 3.0 ); - - isAlmostSameValue( z1, z2, 1 ); // $ExpectType boolean -} - -// The compiler throws an error if the function is provided a first argument that is not a complex number... -{ - const z2 = new Complex64( 5.0, 3.0 ); - - isAlmostSameValue( 'abc', z2, 1 ); // $ExpectError - isAlmostSameValue( 123, z2, 1 ); // $ExpectError - isAlmostSameValue( true, z2, 1 ); // $ExpectError - isAlmostSameValue( false, z2, 1 ); // $ExpectError - isAlmostSameValue( [], z2, 1 ); // $ExpectError - isAlmostSameValue( {}, z2, 1 ); // $ExpectError - isAlmostSameValue( ( x: number ): number => x, z2, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a complex number... -{ - const z1 = new Complex64( 5.0, 3.0 ); - - isAlmostSameValue( z1, 'abc', 1 ); // $ExpectError - isAlmostSameValue( z1, 123, 1 ); // $ExpectError - isAlmostSameValue( z1, true, 1 ); // $ExpectError - isAlmostSameValue( z1, false, 1 ); // $ExpectError - isAlmostSameValue( z1, [], 1 ); // $ExpectError - isAlmostSameValue( z1, {}, 1 ); // $ExpectError - isAlmostSameValue( z1, ( x: number ): number => x, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a third argument that is not a number... -{ - const z1 = new Complex64( 5.0, 3.0 ); - const z2 = new Complex64( 5.0, 3.0 ); - - isAlmostSameValue( z1, z2, 'abc' ); // $ExpectError - isAlmostSameValue( z1, z2, true ); // $ExpectError - isAlmostSameValue( z1, z2, false ); // $ExpectError - isAlmostSameValue( z1, z2, null ); // $ExpectError - isAlmostSameValue( z1, z2, void 0 ); // $ExpectError - isAlmostSameValue( z1, z2, [] ); // $ExpectError - isAlmostSameValue( z1, z2, {} ); // $ExpectError - isAlmostSameValue( z1, z2, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z1 = new Complex64( 5.0, 3.0 ); - const z2 = new Complex64( 5.0, 3.0 ); - - isAlmostSameValue(); // $ExpectError - isAlmostSameValue( z1 ); // $ExpectError - isAlmostSameValue( z1, z2 ); // $ExpectError - isAlmostSameValue( z1, z2, 1, 1 ); // $ExpectError -} diff --git a/float32/base/assert/is-almost-same-value/examples/index.js b/float32/base/assert/is-almost-same-value/examples/index.js deleted file mode 100644 index e5947d5d..00000000 --- a/float32/base/assert/is-almost-same-value/examples/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var EPS = require( '@stdlib/constants/float32/eps' ); -var Complex64 = require( './../../../../../float32/ctor' ); -var isAlmostSameValue = require( './../lib' ); - -var z1 = new Complex64( 1.0, 3.0+EPS ); -var z2 = new Complex64( 1.0+EPS, 3.0 ); -console.log( isAlmostSameValue( z1, z2, 1 ) ); -// => true - -z1 = new Complex64( 1.0, 3.0+EPS ); -z2 = new Complex64( 1.0+EPS+EPS, 3.0 ); -console.log( isAlmostSameValue( z1, z2, 1 ) ); -// => false - -z1 = new Complex64( 0.0, 0.0 ); -z2 = new Complex64( -0.0, 0.0 ); -console.log( isAlmostSameValue( z1, z2, 0 ) ); -// => false - -z1 = new Complex64( NaN, 0.0 ); -z2 = new Complex64( 1.0, 0.0 ); -console.log( isAlmostSameValue( z1, z2, 1 ) ); -// => false diff --git a/float32/base/assert/is-almost-same-value/lib/index.js b/float32/base/assert/is-almost-same-value/lib/index.js deleted file mode 100644 index ef0ddd80..00000000 --- a/float32/base/assert/is-almost-same-value/lib/index.js +++ /dev/null @@ -1,48 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Test whether two single-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place). -* -* @module @stdlib/complex/float32/base/assert/is-almost-same-value -* -* @example -* var EPS = require( '@stdlib/constants/float32/eps' ); -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var isAlmostSameValue = require( '@stdlib/complex/float32/base/assert/is-almost-same-value' ); -* -* var z1 = new Complex64( 1.0, 3.0 ); -* var z2 = new Complex64( 1.0+EPS, 3.0 ); -* -* var bool = isAlmostSameValue( z1, z2, 0 ); -* // returns false -* -* bool = isAlmostSameValue( z1, z2, 1 ); -* // returns true -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float32/base/assert/is-almost-same-value/lib/main.js b/float32/base/assert/is-almost-same-value/lib/main.js deleted file mode 100644 index d3297c6a..00000000 --- a/float32/base/assert/is-almost-same-value/lib/main.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var isAlmostSameValueF32 = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); -var reim = require( './../../../../../float32/reim' ); - - -// MAIN // - -/** -* Tests whether two single-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place). -* -* ## Notes -* -* - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5. -* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same. -* -* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12 -* -* @param {Complex64} z1 - first complex number -* @param {Complex64} z2 - second complex number -* @param {number} maxULP - maximum allowed ULP difference -* @returns {boolean} boolean indicating whether two single-precision complex floating-point numbers are approximately the same value within a specified number of ULPs -* -* @example -* var EPS = require( '@stdlib/constants/float32/eps' ); -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 1.0, 3.0 ); -* var z2 = new Complex64( 1.0+EPS, 3.0 ); -* -* var bool = isAlmostSameValue( z1, z2, 0 ); -* // returns false -* -* bool = isAlmostSameValue( z1, z2, 1 ); -* // returns true -*/ -function isAlmostSameValue( z1, z2, maxULP ) { - var parts1 = reim( z1 ); - var parts2 = reim( z2 ); - return ( - isAlmostSameValueF32( parts1[ 0 ], parts2[ 0 ], maxULP ) && - isAlmostSameValueF32( parts1[ 1 ], parts2[ 1 ], maxULP ) - ); -} - - -// EXPORTS // - -module.exports = isAlmostSameValue; diff --git a/float32/base/assert/is-almost-same-value/package.json b/float32/base/assert/is-almost-same-value/package.json deleted file mode 100644 index a7c11214..00000000 --- a/float32/base/assert/is-almost-same-value/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "name": "@stdlib/complex/float32/base/assert/is-almost-same-value", - "version": "0.0.0", - "description": "Test whether two single-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place).", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "number", - "base", - "assert", - "test", - "validate", - "equality", - "compare", - "comparison", - "equal", - "eq", - "same", - "issame", - "isequal", - "isalmostequal", - "isalmostsame" - ] -} diff --git a/float32/base/assert/is-almost-same-value/test/test.js b/float32/base/assert/is-almost-same-value/test/test.js deleted file mode 100644 index 7d2f32b1..00000000 --- a/float32/base/assert/is-almost-same-value/test/test.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex64 = require( './../../../../../float32/ctor' ); -var EPS = require( '@stdlib/constants/float32/eps' ); -var isAlmostSameValue = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof isAlmostSameValue, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function treats `NaNs` as the same value', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( NaN, 3.14 ); - z2 = new Complex64( 5.0, 3.14 ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), false, 'returns expected value' ); - - z2 = new Complex64( 5.0, NaN ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), false, 'returns expected value' ); - - z1 = new Complex64( NaN, NaN ); - z2 = new Complex64( NaN, NaN ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if provided two complex single-precision floating-point numbers which are the same value irrespective of the specified number of ULPs', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z1, 0 ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), true, 'returns expected value' ); - - z1 = new Complex64( -5.0, -3.0 ); - z2 = new Complex64( -5.0, -3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 0 ), true, 'returns expected value' ); - - z1 = new Complex64( 0.0, 0.0 ); - z2 = new Complex64( 0.0, 0.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 0 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if provided two complex single-precision floating-point numbers which are approximately the same value within a specified number of ULPs', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 1.0, 3.0 ); - z2 = new Complex64( 1.0+EPS, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), true, 'returns expected value' ); - - z2 = new Complex64( 1.0+EPS+EPS, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 2 ), true, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 2 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `false` if provided two complex single-precision floating-point numbers which are not approximately the same value within a specified number of ULPs', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 1.0, 3.0 ); - z2 = new Complex64( 1.0+EPS, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 0 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 0 ), false, 'returns expected value' ); - - z2 = new Complex64( 1.0+EPS+EPS, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function distinguishes between signed zeros when the specified number of ULPs is zero', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 0.0, 0.0 ); - z2 = new Complex64( -0.0, -0.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 0 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 0 ), false, 'returns expected value' ); - - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/assert/is-equal/README.md b/float32/base/assert/is-equal/README.md deleted file mode 100644 index 7531aaa3..00000000 --- a/float32/base/assert/is-equal/README.md +++ /dev/null @@ -1,221 +0,0 @@ - - -# isEqual - -> Test whether two single-precision complex floating-point numbers are equal. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var isEqual = require( '@stdlib/complex/float32/base/assert/is-equal' ); -``` - -#### isEqual( z1, z2 ) - -Tests whether two single-precision complex floating-point numbers are equal. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, 3.0 ); - -var out = isEqual( z1, z2 ); -// returns true -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var isEqual = require( '@stdlib/complex/float32/base/assert/is-equal' ); - -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, 3.0 ); -var out = isEqual( z1, z2 ); -// returns true - -z1 = new Complex64( -5.0, -3.0 ); -z2 = new Complex64( 5.0, 3.0 ); -out = isEqual( z1, z2 ); -// returns false - -z1 = new Complex64( NaN, 3.0 ); -z2 = new Complex64( NaN, 3.0 ); -out = isEqual( z1, z2 ); -// returns false -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float32/base/assert/is_equal.h" -``` - -#### stdlib_base_complex64_is_equal( z1, z2 ) - -Tests whether single-precision complex floating-point numbers are equal. - -```c -#include "stdlib/complex/float32/ctor.h" -#include - -stdlib_complex64_t z1 = stdlib_complex64( 5.0, 2.0 ); -stdlib_complex64_t z2 = stdlib_complex64( 5.0, 2.0 ); - -bool v = stdlib_base_complex64_is_equal( z1, z2 ); -``` - -The function accepts the following arguments: - -- **z1**: `[in] stdlib_complex64_t` first single-precision complex floating-point number. -- **z2**: `[in] stdlib_complex64_t` second single-precision complex floating-point number. - -```c -bool stdlib_base_complex64_is_equal( const stdlib_complex64_t z1, const stdlib_complex64_t z2 ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float32/base/assert/is_equal.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include - -int main( void ) { - const stdlib_complex64_t z[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - bool v; - int i; - for ( i = 0; i < 4; i++ ) { - v = stdlib_base_complex64_is_equal( z[ i ], z[ i ] ); - printf( "Equal? %s\n", ( v ) ? "True" : "False" ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float32/base/assert/is-equal/benchmark/benchmark.js b/float32/base/assert/is-equal/benchmark/benchmark.js deleted file mode 100644 index 2030ca4d..00000000 --- a/float32/base/assert/is-equal/benchmark/benchmark.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex64 = require( './../../../../../float32/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var isEqual = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var z1; - var z2; - var v; - var i; - - z1 = [ - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ) - ]; - z2 = [ - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ), - z1[ 0 ], - z1[ 1 ] - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = isEqual( z1[ i%z1.length ], z2[ i%z2.length ] ); - if ( typeof v !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( v ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/assert/is-equal/docs/repl.txt b/float32/base/assert/is-equal/docs/repl.txt deleted file mode 100644 index 58fb14d3..00000000 --- a/float32/base/assert/is-equal/docs/repl.txt +++ /dev/null @@ -1,27 +0,0 @@ - -{{alias}}( z1, z2 ) - Tests whether two single-precision complex floating-point numbers are equal. - - Parameters - ---------- - z1: Complex64 - First complex number. - - z2: Complex64 - Second complex number. - - Returns - ------- - out: boolean - Result. - - Examples - -------- - > var z1 = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ); - > var z2 = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ); - > var v = {{alias}}( z1, z2 ) - true - - See Also - -------- - diff --git a/float32/base/assert/is-equal/docs/types/index.d.ts b/float32/base/assert/is-equal/docs/types/index.d.ts deleted file mode 100644 index f5424bbc..00000000 --- a/float32/base/assert/is-equal/docs/types/index.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex64 } from '@stdlib/types/complex'; - -/** -* Tests whether two single-precision complex floating-point numbers are equal. -* -* @param z1 - first complex number -* @param z2 - second complex number -* @returns boolean indicating if both complex numbers are equal -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( 5.0, 3.0 ); -* -* var v = isEqual( z1, z2 ); -* // returns true -*/ -declare function isEqual( z1: Complex64, z2: Complex64 ): boolean; - - -// EXPORTS // - -export = isEqual; diff --git a/float32/base/assert/is-equal/docs/types/test.ts b/float32/base/assert/is-equal/docs/types/test.ts deleted file mode 100644 index 154a0002..00000000 --- a/float32/base/assert/is-equal/docs/types/test.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64 = require( './../../../../../../float32/ctor' ); -import isEqual = require( './index' ); - - -// TESTS // - -// The function returns a boolean... -{ - const z1 = new Complex64( 5.0, 3.0 ); - const z2 = new Complex64( 5.0, 3.0 ); - - isEqual( z1, z2 ); // $ExpectType boolean -} - -// The compiler throws an error if the function is provided a first argument that is not a complex number... -{ - const z2 = new Complex64( 5.0, 3.0 ); - - isEqual( 'abc', z2 ); // $ExpectError - isEqual( 123, z2 ); // $ExpectError - isEqual( true, z2 ); // $ExpectError - isEqual( false, z2 ); // $ExpectError - isEqual( [], z2 ); // $ExpectError - isEqual( {}, z2 ); // $ExpectError - isEqual( ( x: number ): number => x, z2 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a complex number... -{ - const z1 = new Complex64( 5.0, 3.0 ); - - isEqual( z1, 'abc' ); // $ExpectError - isEqual( z1, 123 ); // $ExpectError - isEqual( z1, true ); // $ExpectError - isEqual( z1, false ); // $ExpectError - isEqual( z1, [] ); // $ExpectError - isEqual( z1, {} ); // $ExpectError - isEqual( z1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z1 = new Complex64( 5.0, 3.0 ); - const z2 = new Complex64( 5.0, 3.0 ); - - isEqual(); // $ExpectError - isEqual( z1 ); // $ExpectError - isEqual( z1, z2, {} ); // $ExpectError -} diff --git a/float32/base/assert/is-equal/examples/c/Makefile b/float32/base/assert/is-equal/examples/c/Makefile deleted file mode 100644 index 6aed70da..00000000 --- a/float32/base/assert/is-equal/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2024 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/assert/is-equal/examples/c/example.c b/float32/base/assert/is-equal/examples/c/example.c deleted file mode 100644 index df732c4f..00000000 --- a/float32/base/assert/is-equal/examples/c/example.c +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/assert/is_equal.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include - -int main( void ) { - const stdlib_complex64_t z[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - bool v; - int i; - for ( i = 0; i < 4; i++ ) { - v = stdlib_base_complex64_is_equal( z[ i ], z[ i ] ); - printf( "Equal? %s\n", ( v ) ? "True" : "False" ); - } -} diff --git a/float32/base/assert/is-equal/examples/index.js b/float32/base/assert/is-equal/examples/index.js deleted file mode 100644 index 88edb055..00000000 --- a/float32/base/assert/is-equal/examples/index.js +++ /dev/null @@ -1,37 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64 = require( './../../../../../float32/ctor' ); -var isEqual = require( './../lib' ); - -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, 3.0 ); -console.log( isEqual( z1, z2 ) ); -// => true - -z1 = new Complex64( -5.0, -3.0 ); -z2 = new Complex64( 5.0, 3.0 ); -console.log( isEqual( z1, z2 ) ); -// => false - -z1 = new Complex64( NaN, 3.0 ); -z2 = new Complex64( NaN, 3.0 ); -console.log( isEqual( z1, z2 ) ); -// => false diff --git a/float32/base/assert/is-equal/include/stdlib/complex/float32/base/assert/is_equal.h b/float32/base/assert/is-equal/include/stdlib/complex/float32/base/assert/is_equal.h deleted file mode 100644 index b5b0dde1..00000000 --- a/float32/base/assert/is-equal/include/stdlib/complex/float32/base/assert/is_equal.h +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef STDLIB_COMPLEX_FLOAT32_BASE_ASSERT_IS_EQUAL_H -#define STDLIB_COMPLEX_FLOAT32_BASE_ASSERT_IS_EQUAL_H - -#include "stdlib/complex/float32/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether two single-precision complex floating-point numbers are equal. -*/ -bool stdlib_base_complex64_is_equal( const stdlib_complex64_t z1, const stdlib_complex64_t z2 ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_FLOAT32_BASE_ASSERT_IS_EQUAL_H diff --git a/float32/base/assert/is-equal/lib/index.js b/float32/base/assert/is-equal/lib/index.js deleted file mode 100644 index 0fdeceb8..00000000 --- a/float32/base/assert/is-equal/lib/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Test whether two single-precision complex floating-point numbers are equal. -* -* @module @stdlib/complex/float32/base/assert/is-equal -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var isEqual = require( '@stdlib/complex/float32/base/assert/is-equal' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( 5.0, 3.0 ); -* -* var v = isEqual( z1, z2 ); -* // returns true -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float32/base/assert/is-equal/lib/main.js b/float32/base/assert/is-equal/lib/main.js deleted file mode 100644 index 9c39986e..00000000 --- a/float32/base/assert/is-equal/lib/main.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var reimf = require( './../../../../../float32/reim' ); - - -// MAIN // - -/** -* Tests whether two single-precision complex floating-point numbers are equal. -* -* @param {Complex64} z1 - first complex number -* @param {Complex64} z2 - second complex number -* @returns {boolean} result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( 5.0, 3.0 ); -* -* var v = isEqual( z1, z2 ); -* // returns true -*/ -function isEqual( z1, z2 ) { - var parts1 = reimf( z1 ); - var parts2 = reimf( z2 ); - return ( - parts1[ 0 ] === parts2[ 0 ] && - parts1[ 1 ] === parts2[ 1 ] - ); -} - - -// EXPORTS // - -module.exports = isEqual; diff --git a/float32/base/assert/is-equal/manifest.json b/float32/base/assert/is-equal/manifest.json deleted file mode 100644 index c8446ead..00000000 --- a/float32/base/assert/is-equal/manifest.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - } - ] -} diff --git a/float32/base/assert/is-equal/package.json b/float32/base/assert/is-equal/package.json deleted file mode 100644 index f0fce101..00000000 --- a/float32/base/assert/is-equal/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "@stdlib/complex/float32/base/assert/is-equal", - "version": "0.0.0", - "description": "Test whether two single-precision complex floating-point numbers are equal.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "number", - "base", - "assert", - "test", - "validate", - "equality", - "compare", - "comparison", - "equal", - "eq" - ] -} diff --git a/float32/base/assert/is-equal/src/main.c b/float32/base/assert/is-equal/src/main.c deleted file mode 100644 index ee325e8f..00000000 --- a/float32/base/assert/is-equal/src/main.c +++ /dev/null @@ -1,48 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/assert/is_equal.h" -#include "stdlib/complex/float32/reim.h" -#include "stdlib/complex/float32/ctor.h" -#include - -/** -* Tests whether two single-precision complex floating-point numbers are equal. -* -* @param z1 first single-precision complex floating-point number -* @param z2 second single-precision complex floating-point number -* @return boolean indicating if both complex numbers are equal -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* #include -* -* stdlib_complex64_t z1 = stdlib_complex64( 5.0, 2.0 ); -* stdlib_complex64_t z2 = stdlib_complex64( 5.0, 2.0 ); -* -* bool v = stdlib_base_complex64_is_equal( z1, z2 ); -*/ -bool stdlib_base_complex64_is_equal( const stdlib_complex64_t z1, const stdlib_complex64_t z2 ) { - float re1; - float re2; - float im1; - float im2; - stdlib_complex64_reim( z1, &re1, &im1 ); - stdlib_complex64_reim( z2, &re2, &im2 ); - return ( re1 == re2 && im1 == im2 ); -} diff --git a/float32/base/assert/is-equal/test/test.js b/float32/base/assert/is-equal/test/test.js deleted file mode 100644 index 5d0800a1..00000000 --- a/float32/base/assert/is-equal/test/test.js +++ /dev/null @@ -1,134 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex64 = require( './../../../../../float32/ctor' ); -var PINF = require( '@stdlib/constants/float32/pinf' ); -var NINF = require( '@stdlib/constants/float32/ninf' ); -var isEqual = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof isEqual, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function tests whether two complex numbers are equal (finite)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isEqual( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( -5.0, 3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -5.0, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 5.0, -3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( 5.0, -3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether two complex numbers are equal (infinite)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( PINF, NINF ); - t.strictEqual( isEqual( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex64( PINF, NINF ); - z2 = new Complex64( PINF, NINF ); - t.strictEqual( isEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( NINF, 3.0 ); - z2 = new Complex64( PINF, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( PINF, 3.0 ); - z2 = new Complex64( NINF, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( PINF, -3.0 ); - z2 = new Complex64( PINF, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( PINF, 3.0 ); - z2 = new Complex64( PINF, -3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 5.0, PINF ); - z2 = new Complex64( 5.0, NINF ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether two complex numbers are equal (NaNs)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( NaN, NaN ); - t.strictEqual( isEqual( z1, z1 ), false, 'returns expected value' ); - - z1 = new Complex64( NaN, NaN ); - z2 = new Complex64( NaN, NaN ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( NaN, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( NaN, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( 5.0, NaN ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( 5.0, NaN ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/assert/is-not-equal/README.md b/float32/base/assert/is-not-equal/README.md deleted file mode 100644 index ffd83015..00000000 --- a/float32/base/assert/is-not-equal/README.md +++ /dev/null @@ -1,221 +0,0 @@ - - -# isNotEqual - -> Test whether two single-precision complex floating-point numbers are not equal. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var isNotEqual = require( '@stdlib/complex/float32/base/assert/is-not-equal' ); -``` - -#### isNotEqual( z1, z2 ) - -Tests whether two single-precision complex floating-point numbers are not equal. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, -3.0 ); - -var out = isNotEqual( z1, z2 ); -// returns true -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var isNotEqual = require( '@stdlib/complex/float32/base/assert/is-not-equal' ); - -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, 3.0 ); -var out = isNotEqual( z1, z2 ); -// returns false - -z1 = new Complex64( -5.0, -3.0 ); -z2 = new Complex64( 5.0, 3.0 ); -out = isNotEqual( z1, z2 ); -// returns true - -z1 = new Complex64( NaN, 3.0 ); -z2 = new Complex64( NaN, 3.0 ); -out = isNotEqual( z1, z2 ); -// returns true -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float32/base/assert/is_not_equal.h" -``` - -#### stdlib_base_complex64_is_not_equal( z1, z2 ) - -Tests whether single-precision complex floating-point numbers are not equal. - -```c -#include "stdlib/complex/float32/ctor.h" -#include - -stdlib_complex64_t z1 = stdlib_complex64( 5.0, 2.0 ); -stdlib_complex64_t z2 = stdlib_complex64( 5.0, -2.0 ); - -bool v = stdlib_base_complex64_is_not_equal( z1, z2 ); -``` - -The function accepts the following arguments: - -- **z1**: `[in] stdlib_complex64_t` first single-precision complex floating-point number. -- **z2**: `[in] stdlib_complex64_t` second single-precision complex floating-point number. - -```c -bool stdlib_base_complex64_is_not_equal( const stdlib_complex64_t z1, const stdlib_complex64_t z2 ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float32/base/assert/is_not_equal.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include - -int main( void ) { - const stdlib_complex64_t z[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - bool v; - int i; - for ( i = 0; i < 4; i++ ) { - v = stdlib_base_complex64_is_not_equal( z[ i ], z[ i ] ); - printf( "Equal? %s\n", ( v ) ? "True" : "False" ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float32/base/assert/is-not-equal/benchmark/benchmark.js b/float32/base/assert/is-not-equal/benchmark/benchmark.js deleted file mode 100644 index 94446924..00000000 --- a/float32/base/assert/is-not-equal/benchmark/benchmark.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex64 = require( './../../../../../float32/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var isNotEqual = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var z1; - var z2; - var v; - var i; - - z1 = [ - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ) - ]; - z2 = [ - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ), - z1[ 0 ], - z1[ 1 ] - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = isNotEqual( z1[ i%z1.length ], z2[ i%z2.length ] ); - if ( typeof v !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( v ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/assert/is-not-equal/docs/repl.txt b/float32/base/assert/is-not-equal/docs/repl.txt deleted file mode 100644 index bdae47c0..00000000 --- a/float32/base/assert/is-not-equal/docs/repl.txt +++ /dev/null @@ -1,28 +0,0 @@ - -{{alias}}( z1, z2 ) - Tests whether two single-precision complex floating-point numbers are not - equal. - - Parameters - ---------- - z1: Complex64 - First complex number. - - z2: Complex64 - Second complex number. - - Returns - ------- - out: boolean - Result. - - Examples - -------- - > var z1 = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ); - > var z2 = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, -3.0 ); - > var v = {{alias}}( z1, z2 ) - true - - See Also - -------- - diff --git a/float32/base/assert/is-not-equal/docs/types/index.d.ts b/float32/base/assert/is-not-equal/docs/types/index.d.ts deleted file mode 100644 index 74e12f8c..00000000 --- a/float32/base/assert/is-not-equal/docs/types/index.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex64 } from '@stdlib/types/complex'; - -/** -* Tests whether two single-precision complex floating-point numbers are not equal. -* -* @param z1 - first complex number -* @param z2 - second complex number -* @returns boolean indicating if both complex numbers are not equal -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( 5.0, -3.0 ); -* -* var v = isNotEqual( z1, z2 ); -* // returns true -*/ -declare function isNotEqual( z1: Complex64, z2: Complex64 ): boolean; - - -// EXPORTS // - -export = isNotEqual; diff --git a/float32/base/assert/is-not-equal/docs/types/test.ts b/float32/base/assert/is-not-equal/docs/types/test.ts deleted file mode 100644 index e5f0dffe..00000000 --- a/float32/base/assert/is-not-equal/docs/types/test.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64 = require( './../../../../../../float32/ctor' ); -import isNotEqual = require( './index' ); - - -// TESTS // - -// The function returns a boolean... -{ - const z1 = new Complex64( 5.0, 3.0 ); - const z2 = new Complex64( 5.0, 3.0 ); - - isNotEqual( z1, z2 ); // $ExpectType boolean -} - -// The compiler throws an error if the function is provided a first argument that is not a complex number... -{ - const z2 = new Complex64( 5.0, 3.0 ); - - isNotEqual( 'abc', z2 ); // $ExpectError - isNotEqual( 123, z2 ); // $ExpectError - isNotEqual( true, z2 ); // $ExpectError - isNotEqual( false, z2 ); // $ExpectError - isNotEqual( [], z2 ); // $ExpectError - isNotEqual( {}, z2 ); // $ExpectError - isNotEqual( ( x: number ): number => x, z2 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a complex number... -{ - const z1 = new Complex64( 5.0, 3.0 ); - - isNotEqual( z1, 'abc' ); // $ExpectError - isNotEqual( z1, 123 ); // $ExpectError - isNotEqual( z1, true ); // $ExpectError - isNotEqual( z1, false ); // $ExpectError - isNotEqual( z1, [] ); // $ExpectError - isNotEqual( z1, {} ); // $ExpectError - isNotEqual( z1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z1 = new Complex64( 5.0, 3.0 ); - const z2 = new Complex64( 5.0, 3.0 ); - - isNotEqual(); // $ExpectError - isNotEqual( z1 ); // $ExpectError - isNotEqual( z1, z2, {} ); // $ExpectError -} diff --git a/float32/base/assert/is-not-equal/examples/c/Makefile b/float32/base/assert/is-not-equal/examples/c/Makefile deleted file mode 100644 index 6aed70da..00000000 --- a/float32/base/assert/is-not-equal/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2024 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/assert/is-not-equal/examples/c/example.c b/float32/base/assert/is-not-equal/examples/c/example.c deleted file mode 100644 index bfe97a4e..00000000 --- a/float32/base/assert/is-not-equal/examples/c/example.c +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/assert/is_not_equal.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include - -int main( void ) { - const stdlib_complex64_t z[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - bool v; - int i; - for ( i = 0; i < 4; i++ ) { - v = stdlib_base_complex64_is_not_equal( z[ i ], z[ i ] ); - printf( "Equal? %s\n", ( v ) ? "True" : "False" ); - } -} diff --git a/float32/base/assert/is-not-equal/examples/index.js b/float32/base/assert/is-not-equal/examples/index.js deleted file mode 100644 index b0f1826b..00000000 --- a/float32/base/assert/is-not-equal/examples/index.js +++ /dev/null @@ -1,37 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64 = require( './../../../../../float32/ctor' ); -var isNotEqual = require( './../lib' ); - -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, 3.0 ); -console.log( isNotEqual( z1, z2 ) ); -// => false - -z1 = new Complex64( -5.0, -3.0 ); -z2 = new Complex64( 5.0, 3.0 ); -console.log( isNotEqual( z1, z2 ) ); -// => true - -z1 = new Complex64( NaN, 3.0 ); -z2 = new Complex64( NaN, 3.0 ); -console.log( isNotEqual( z1, z2 ) ); -// => true diff --git a/float32/base/assert/is-not-equal/include/stdlib/complex/float32/base/assert/is_not_equal.h b/float32/base/assert/is-not-equal/include/stdlib/complex/float32/base/assert/is_not_equal.h deleted file mode 100644 index 427fc7c4..00000000 --- a/float32/base/assert/is-not-equal/include/stdlib/complex/float32/base/assert/is_not_equal.h +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef STDLIB_COMPLEX_FLOAT32_BASE_ASSERT_IS_NOT_EQUAL_H -#define STDLIB_COMPLEX_FLOAT32_BASE_ASSERT_IS_NOT_EQUAL_H - -#include "stdlib/complex/float32/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether two single-precision complex floating-point numbers are not equal. -*/ -bool stdlib_base_complex64_is_not_equal( const stdlib_complex64_t z1, const stdlib_complex64_t z2 ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_FLOAT32_BASE_ASSERT_IS_NOT_EQUAL_H diff --git a/float32/base/assert/is-not-equal/lib/index.js b/float32/base/assert/is-not-equal/lib/index.js deleted file mode 100644 index f98c672d..00000000 --- a/float32/base/assert/is-not-equal/lib/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Test whether two single-precision complex floating-point numbers are not equal. -* -* @module @stdlib/complex/float32/base/assert/is-not-equal -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var isNotEqual = require( '@stdlib/complex/float32/base/assert/is-not-equal' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( 5.0, -3.0 ); -* -* var v = isNotEqual( z1, z2 ); -* // returns true -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float32/base/assert/is-not-equal/lib/main.js b/float32/base/assert/is-not-equal/lib/main.js deleted file mode 100644 index 1f50dbe0..00000000 --- a/float32/base/assert/is-not-equal/lib/main.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var reimf = require( './../../../../../float32/reim' ); - - -// MAIN // - -/** -* Tests whether two single-precision complex floating-point numbers are not equal. -* -* @param {Complex64} z1 - first complex number -* @param {Complex64} z2 - second complex number -* @returns {boolean} result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( 5.0, -3.0 ); -* -* var v = isNotEqual( z1, z2 ); -* // returns true -*/ -function isNotEqual( z1, z2 ) { - var parts1 = reimf( z1 ); - var parts2 = reimf( z2 ); - return ( - parts1[ 0 ] !== parts2[ 0 ] || - parts1[ 1 ] !== parts2[ 1 ] - ); -} - - -// EXPORTS // - -module.exports = isNotEqual; diff --git a/float32/base/assert/is-not-equal/manifest.json b/float32/base/assert/is-not-equal/manifest.json deleted file mode 100644 index c8446ead..00000000 --- a/float32/base/assert/is-not-equal/manifest.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - } - ] -} diff --git a/float32/base/assert/is-not-equal/package.json b/float32/base/assert/is-not-equal/package.json deleted file mode 100644 index 70360ff9..00000000 --- a/float32/base/assert/is-not-equal/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "@stdlib/complex/float32/base/assert/is-not-equal", - "version": "0.0.0", - "description": "Test whether two single-precision complex floating-point numbers are not equal.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "number", - "base", - "assert", - "test", - "validate", - "equality", - "compare", - "comparison", - "equal", - "eq", - "unequal" - ] -} diff --git a/float32/base/assert/is-not-equal/src/main.c b/float32/base/assert/is-not-equal/src/main.c deleted file mode 100644 index 3229b1a1..00000000 --- a/float32/base/assert/is-not-equal/src/main.c +++ /dev/null @@ -1,48 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/assert/is_not_equal.h" -#include "stdlib/complex/float32/reim.h" -#include "stdlib/complex/float32/ctor.h" -#include - -/** -* Tests whether two single-precision complex floating-point numbers are not equal. -* -* @param z1 first single-precision complex floating-point number -* @param z2 second single-precision complex floating-point number -* @return boolean indicating if both complex numbers are not equal -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* #include -* -* stdlib_complex64_t z1 = stdlib_complex64( 5.0, 2.0 ); -* stdlib_complex64_t z2 = stdlib_complex64( 5.0, -2.0 ); -* -* bool v = stdlib_base_complex64_is_not_equal( z1, z2 ); -*/ -bool stdlib_base_complex64_is_not_equal( const stdlib_complex64_t z1, const stdlib_complex64_t z2 ) { - float re1; - float re2; - float im1; - float im2; - stdlib_complex64_reim( z1, &re1, &im1 ); - stdlib_complex64_reim( z2, &re2, &im2 ); - return ( re1 != re2 || im1 != im2 ); -} diff --git a/float32/base/assert/is-not-equal/test/test.js b/float32/base/assert/is-not-equal/test/test.js deleted file mode 100644 index 89ae1c2b..00000000 --- a/float32/base/assert/is-not-equal/test/test.js +++ /dev/null @@ -1,134 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex64 = require( './../../../../../float32/ctor' ); -var PINF = require( '@stdlib/constants/float32/pinf' ); -var NINF = require( '@stdlib/constants/float32/ninf' ); -var isNotEqual = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof isNotEqual, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function tests whether two complex numbers are not equal (finite)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isNotEqual( z1, z1 ), false, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( -5.0, 3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -5.0, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, -3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( 5.0, -3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether two complex numbers are not equal (infinite)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( PINF, NINF ); - t.strictEqual( isNotEqual( z1, z1 ), false, 'returns expected value' ); - - z1 = new Complex64( PINF, NINF ); - z2 = new Complex64( PINF, NINF ); - t.strictEqual( isNotEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( NINF, 3.0 ); - z2 = new Complex64( PINF, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( PINF, 3.0 ); - z2 = new Complex64( NINF, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( PINF, -3.0 ); - z2 = new Complex64( PINF, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( PINF, 3.0 ); - z2 = new Complex64( PINF, -3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, PINF ); - z2 = new Complex64( 5.0, NINF ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether two complex numbers are not equal (NaNs)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( NaN, NaN ); - t.strictEqual( isNotEqual( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, NaN ); - z2 = new Complex64( NaN, NaN ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( NaN, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( NaN, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( 5.0, NaN ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( 5.0, NaN ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/assert/is-same-value-zero/README.md b/float32/base/assert/is-same-value-zero/README.md deleted file mode 100644 index d7fc9005..00000000 --- a/float32/base/assert/is-same-value-zero/README.md +++ /dev/null @@ -1,247 +0,0 @@ - - -# isSameValueZero - -> Test whether two single-precision complex floating-point numbers are the same value. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var isSameValueZero = require( '@stdlib/complex/float32/base/assert/is-same-value-zero' ); -``` - -#### isSameValueZero( z1, z2 ) - -Tests whether two single-precision complex floating-point numbers are the same value. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, 3.0 ); - -var out = isSameValueZero( z1, z2 ); -// returns true -``` - -In contrast to the strict equality operator `===`, the function treats `NaNs` as the same value. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z1 = new Complex64( NaN, NaN ); -var z2 = new Complex64( NaN, NaN ); - -var out = isSameValueZero( z1, z2 ); -// returns true -``` - -In contrast to the [SameValue Algorithm][@stdlib/complex/float32/base/assert/is-same-value] (as specified in ECMAScript 5), the function does not distinguish between `+0` and `-0`. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z1 = new Complex64( -0.0, 0.0 ); -var z2 = new Complex64( 0.0, -0.0 ); - -var out = isSameValueZero( z1, z2 ); -// returns true -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var isSameValueZero = require( '@stdlib/complex/float32/base/assert/is-same-value-zero' ); - -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, 3.0 ); -var out = isSameValueZero( z1, z2 ); -// returns true - -z1 = new Complex64( -5.0, -3.0 ); -z2 = new Complex64( 5.0, 3.0 ); -out = isSameValueZero( z1, z2 ); -// returns false - -z1 = new Complex64( NaN, 3.0 ); -z2 = new Complex64( NaN, 3.0 ); -out = isSameValueZero( z1, z2 ); -// returns true -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float32/base/assert/is_same_value_zero.h" -``` - -#### stdlib_base_complex64_is_same_value_zero( z1, z2 ) - -Tests whether two single-precision complex floating-point numbers are the same value. - -```c -#include "stdlib/complex/float32/ctor.h" -#include - -stdlib_complex64_t z1 = stdlib_complex64( 5.0f, 2.0f ); -stdlib_complex64_t z2 = stdlib_complex64( 5.0f, 2.0f ); - -bool v = stdlib_base_complex64_is_same_value_zero( z1, z2 ); -``` - -The function accepts the following arguments: - -- **z1**: `[in] stdlib_complex64_t` first single-precision complex floating-point number. -- **z2**: `[in] stdlib_complex64_t` second single-precision complex floating-point number. - -```c -bool stdlib_base_complex64_is_same_value_zero( const stdlib_complex64_t z1, const stdlib_complex64_t z2 ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float32/base/assert/is_same_value_zero.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include - -int main( void ) { - const stdlib_complex64_t z[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - bool v; - int i; - for ( i = 0; i < 4; i++ ) { - v = stdlib_base_complex64_is_same_value_zero( z[ i ], z[ i ] ); - printf( "Same value? %s\n", ( v ) ? "True" : "False" ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float32/base/assert/is-same-value-zero/benchmark/benchmark.js b/float32/base/assert/is-same-value-zero/benchmark/benchmark.js deleted file mode 100644 index 39a95379..00000000 --- a/float32/base/assert/is-same-value-zero/benchmark/benchmark.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex64 = require( './../../../../../float32/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var isSameValueZero = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var z1; - var z2; - var v; - var i; - - z1 = [ - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ) - ]; - z2 = [ - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ), - z1[ 0 ], - z1[ 1 ] - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = isSameValueZero( z1[ i%z1.length ], z2[ i%z2.length ] ); - if ( typeof v !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( v ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/assert/is-same-value-zero/docs/repl.txt b/float32/base/assert/is-same-value-zero/docs/repl.txt deleted file mode 100644 index 1b38d3ed..00000000 --- a/float32/base/assert/is-same-value-zero/docs/repl.txt +++ /dev/null @@ -1,31 +0,0 @@ - -{{alias}}( z1, z2 ) - Tests whether two single-precision complex floating-point numbers are the - same value. - - The function differs from the `===` operator in that the function treats - `NaNs` as the same value. - - Parameters - ---------- - z1: Complex64 - First complex number. - - z2: Complex64 - Second complex number. - - Returns - ------- - out: boolean - Result. - - Examples - -------- - > var z1 = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ); - > var z2 = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ); - > var v = {{alias}}( z1, z2 ) - true - - See Also - -------- - diff --git a/float32/base/assert/is-same-value-zero/docs/types/index.d.ts b/float32/base/assert/is-same-value-zero/docs/types/index.d.ts deleted file mode 100644 index 3373b6f7..00000000 --- a/float32/base/assert/is-same-value-zero/docs/types/index.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex64 } from '@stdlib/types/complex'; - -/** -* Tests whether two single-precision complex floating-point numbers are the same value. -* -* ## Notes -* -* - In contrast to the strict equality operator `===`, `NaNs` are treated as the same value. -* -* @param z1 - first complex number -* @param z2 - second complex number -* @returns boolean indicating if both complex numbers are the same value -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( 5.0, 3.0 ); -* -* var v = isSameValueZero( z1, z2 ); -* // returns true -*/ -declare function isSameValueZero( z1: Complex64, z2: Complex64 ): boolean; - - -// EXPORTS // - -export = isSameValueZero; diff --git a/float32/base/assert/is-same-value-zero/docs/types/test.ts b/float32/base/assert/is-same-value-zero/docs/types/test.ts deleted file mode 100644 index bf0b111e..00000000 --- a/float32/base/assert/is-same-value-zero/docs/types/test.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64 = require( './../../../../../../float32/ctor' ); -import isSameValueZero = require( './index' ); - - -// TESTS // - -// The function returns a boolean... -{ - const z1 = new Complex64( 5.0, 3.0 ); - const z2 = new Complex64( 5.0, 3.0 ); - - isSameValueZero( z1, z2 ); // $ExpectType boolean -} - -// The compiler throws an error if the function is provided a first argument that is not a complex number... -{ - const z2 = new Complex64( 5.0, 3.0 ); - - isSameValueZero( 'abc', z2 ); // $ExpectError - isSameValueZero( 123, z2 ); // $ExpectError - isSameValueZero( true, z2 ); // $ExpectError - isSameValueZero( false, z2 ); // $ExpectError - isSameValueZero( [], z2 ); // $ExpectError - isSameValueZero( {}, z2 ); // $ExpectError - isSameValueZero( ( x: number ): number => x, z2 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a complex number... -{ - const z1 = new Complex64( 5.0, 3.0 ); - - isSameValueZero( z1, 'abc' ); // $ExpectError - isSameValueZero( z1, 123 ); // $ExpectError - isSameValueZero( z1, true ); // $ExpectError - isSameValueZero( z1, false ); // $ExpectError - isSameValueZero( z1, [] ); // $ExpectError - isSameValueZero( z1, {} ); // $ExpectError - isSameValueZero( z1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z1 = new Complex64( 5.0, 3.0 ); - const z2 = new Complex64( 5.0, 3.0 ); - - isSameValueZero(); // $ExpectError - isSameValueZero( z1 ); // $ExpectError - isSameValueZero( z1, z2, {} ); // $ExpectError -} diff --git a/float32/base/assert/is-same-value-zero/examples/c/Makefile b/float32/base/assert/is-same-value-zero/examples/c/Makefile deleted file mode 100644 index 6aed70da..00000000 --- a/float32/base/assert/is-same-value-zero/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2024 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/assert/is-same-value-zero/examples/c/example.c b/float32/base/assert/is-same-value-zero/examples/c/example.c deleted file mode 100644 index e5a9ea23..00000000 --- a/float32/base/assert/is-same-value-zero/examples/c/example.c +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/assert/is_same_value_zero.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include - -int main( void ) { - const stdlib_complex64_t z[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - bool v; - int i; - for ( i = 0; i < 4; i++ ) { - v = stdlib_base_complex64_is_same_value_zero( z[ i ], z[ i ] ); - printf( "Same value? %s\n", ( v ) ? "True" : "False" ); - } -} diff --git a/float32/base/assert/is-same-value-zero/examples/index.js b/float32/base/assert/is-same-value-zero/examples/index.js deleted file mode 100644 index 64824063..00000000 --- a/float32/base/assert/is-same-value-zero/examples/index.js +++ /dev/null @@ -1,37 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64 = require( './../../../../../float32/ctor' ); -var isSameValueZero = require( './../lib' ); - -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, 3.0 ); -console.log( isSameValueZero( z1, z2 ) ); -// => true - -z1 = new Complex64( -5.0, -3.0 ); -z2 = new Complex64( 5.0, 3.0 ); -console.log( isSameValueZero( z1, z2 ) ); -// => false - -z1 = new Complex64( NaN, 3.0 ); -z2 = new Complex64( NaN, 3.0 ); -console.log( isSameValueZero( z1, z2 ) ); -// => true diff --git a/float32/base/assert/is-same-value-zero/include/stdlib/complex/float32/base/assert/is_same_value_zero.h b/float32/base/assert/is-same-value-zero/include/stdlib/complex/float32/base/assert/is_same_value_zero.h deleted file mode 100644 index 68851190..00000000 --- a/float32/base/assert/is-same-value-zero/include/stdlib/complex/float32/base/assert/is_same_value_zero.h +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef STDLIB_COMPLEX_FLOAT32_BASE_ASSERT_IS_SAME_VALUE_ZERO_H -#define STDLIB_COMPLEX_FLOAT32_BASE_ASSERT_IS_SAME_VALUE_ZERO_H - -#include "stdlib/complex/float32/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether two single-precision complex floating-point numbers are the same value. -*/ -bool stdlib_base_complex64_is_same_value_zero( const stdlib_complex64_t z1, const stdlib_complex64_t z2 ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_FLOAT32_BASE_ASSERT_IS_SAME_VALUE_ZERO_H diff --git a/float32/base/assert/is-same-value-zero/lib/index.js b/float32/base/assert/is-same-value-zero/lib/index.js deleted file mode 100644 index 07576458..00000000 --- a/float32/base/assert/is-same-value-zero/lib/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Test whether two single-precision complex floating-point numbers are the same value. -* -* @module @stdlib/complex/float32/base/assert/is-same-value-zero -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var isSameValueZero = require( '@stdlib/complex/float32/base/assert/is-same-value-zero' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( 5.0, 3.0 ); -* -* var v = isSameValueZero( z1, z2 ); -* // returns true -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float32/base/assert/is-same-value-zero/lib/main.js b/float32/base/assert/is-same-value-zero/lib/main.js deleted file mode 100644 index e64788d6..00000000 --- a/float32/base/assert/is-same-value-zero/lib/main.js +++ /dev/null @@ -1,62 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var isSame = require( '@stdlib/number/float32/base/assert/is-same-value-zero' ); -var reimf = require( './../../../../../float32/reim' ); - - -// MAIN // - -/** -* Tests whether two single-precision complex floating-point numbers are the same value. -* -* ## Notes -* -* - The function implements the SameValueZero Algorithm used by `TypedArray` and `ArrayBuffer` constructors, `Map` and `Set` operations, `String.prototype.includes`, and `Array.prototype.includes` since ES2016. -* - In contrast to the strict equality operator `===`, `NaNs` are considered the same value. -* -* @param {Complex64} z1 - first complex number -* @param {Complex64} z2 - second complex number -* @returns {boolean} result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( 5.0, 3.0 ); -* -* var v = isSameValueZero( z1, z2 ); -* // returns true -*/ -function isSameValueZero( z1, z2 ) { - var parts1 = reimf( z1 ); - var parts2 = reimf( z2 ); - return ( - isSame( parts1[ 0 ], parts2[ 0 ] ) && - isSame( parts1[ 1 ], parts2[ 1 ] ) - ); -} - - -// EXPORTS // - -module.exports = isSameValueZero; diff --git a/float32/base/assert/is-same-value-zero/manifest.json b/float32/base/assert/is-same-value-zero/manifest.json deleted file mode 100644 index 67bd4dbc..00000000 --- a/float32/base/assert/is-same-value-zero/manifest.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim", - "@stdlib/number/float32/base/assert/is-same-value-zero" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim", - "@stdlib/number/float32/base/assert/is-same-value-zero" - ] - } - ] -} diff --git a/float32/base/assert/is-same-value-zero/package.json b/float32/base/assert/is-same-value-zero/package.json deleted file mode 100644 index fb6e2f60..00000000 --- a/float32/base/assert/is-same-value-zero/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "name": "@stdlib/complex/float32/base/assert/is-same-value-zero", - "version": "0.0.0", - "description": "Test whether two single-precision complex floating-point numbers are the same value.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "number", - "base", - "assert", - "test", - "validate", - "equality", - "compare", - "comparison", - "equal", - "eq", - "same", - "issame", - "issamevalue" - ] -} diff --git a/float32/base/assert/is-same-value-zero/src/main.c b/float32/base/assert/is-same-value-zero/src/main.c deleted file mode 100644 index 2cc174da..00000000 --- a/float32/base/assert/is-same-value-zero/src/main.c +++ /dev/null @@ -1,52 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/assert/is_same_value_zero.h" -#include "stdlib/number/float32/base/assert/is_same_value_zero.h" -#include "stdlib/complex/float32/reim.h" -#include "stdlib/complex/float32/ctor.h" -#include - -/** -* Tests whether two single-precision complex floating-point numbers are the same value. -* -* @param z1 first single-precision complex floating-point number -* @param z2 second single-precision complex floating-point number -* @return boolean indicating if both complex numbers are the same value -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* #include -* -* stdlib_complex64_t z1 = stdlib_complex64( 5.0f, 2.0f ); -* stdlib_complex64_t z2 = stdlib_complex64( 5.0f, 2.0f ); -* -* bool v = stdlib_base_complex64_is_same_value_zero( z1, z2 ); -*/ -bool stdlib_base_complex64_is_same_value_zero( const stdlib_complex64_t z1, const stdlib_complex64_t z2 ) { - float re1; - float re2; - float im1; - float im2; - stdlib_complex64_reim( z1, &re1, &im1 ); - stdlib_complex64_reim( z2, &re2, &im2 ); - return ( - stdlib_base_float32_is_same_value_zero( re1, re2 ) && - stdlib_base_float32_is_same_value_zero( im1, im2 ) - ); -} diff --git a/float32/base/assert/is-same-value-zero/test/test.js b/float32/base/assert/is-same-value-zero/test/test.js deleted file mode 100644 index 768edeaa..00000000 --- a/float32/base/assert/is-same-value-zero/test/test.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex64 = require( './../../../../../float32/ctor' ); -var PINF = require( '@stdlib/constants/float32/pinf' ); -var NINF = require( '@stdlib/constants/float32/ninf' ); -var isSameValueZero = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof isSameValueZero, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function tests whether two complex numbers are the same value (finite)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isSameValueZero( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( 0.0, 0.0 ); - z2 = new Complex64( 0.0, 0.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( -0.0, 0.0 ); - z2 = new Complex64( 0.0, 0.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( 0.0, -0.0 ); - z2 = new Complex64( -0.0, 0.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( 0.0, -0.0 ); - z2 = new Complex64( 0.0, -0.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( -5.0, 3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -5.0, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 5.0, -3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( 5.0, -3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether two complex numbers are the same value (infinite)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( PINF, NINF ); - t.strictEqual( isSameValueZero( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex64( PINF, NINF ); - z2 = new Complex64( PINF, NINF ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( NINF, 3.0 ); - z2 = new Complex64( PINF, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( PINF, 3.0 ); - z2 = new Complex64( NINF, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( PINF, -3.0 ); - z2 = new Complex64( PINF, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( PINF, 3.0 ); - z2 = new Complex64( PINF, -3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 5.0, PINF ); - z2 = new Complex64( 5.0, NINF ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether two complex numbers are the same value (NaNs)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( NaN, NaN ); - t.strictEqual( isSameValueZero( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, NaN ); - z2 = new Complex64( NaN, NaN ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( NaN, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( NaN, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( 5.0, NaN ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( 5.0, NaN ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/assert/is-same-value/README.md b/float32/base/assert/is-same-value/README.md deleted file mode 100644 index 800a3597..00000000 --- a/float32/base/assert/is-same-value/README.md +++ /dev/null @@ -1,245 +0,0 @@ - - -# isSameValue - -> Test whether two single-precision complex floating-point numbers are the same value. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var isSameValue = require( '@stdlib/complex/float32/base/assert/is-same-value' ); -``` - -#### isSameValue( z1, z2 ) - -Tests whether two single-precision complex floating-point numbers are the same value. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, 3.0 ); - -var out = isSameValue( z1, z2 ); -// returns true -``` - -In contrast to the strict equality operator `===`, the function distinguishes between `+0` and `-0` and treats `NaNs` as the same value. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z1 = new Complex64( NaN, NaN ); -var z2 = new Complex64( NaN, NaN ); - -var out = isSameValue( z1, z2 ); -// returns true - -z1 = new Complex64( -0.0, 0.0 ); -z2 = new Complex64( 0.0, -0.0 ); - -out = isSameValue( z1, z2 ); -// returns false -``` - -
- - - - - -
- -## Notes - -- The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm] as specified in ECMAScript 5. - -
- - - - - -
- -## Examples - - - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var isSameValue = require( '@stdlib/complex/float32/base/assert/is-same-value' ); - -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, 3.0 ); -var out = isSameValue( z1, z2 ); -// returns true - -z1 = new Complex64( -5.0, -3.0 ); -z2 = new Complex64( 5.0, 3.0 ); -out = isSameValue( z1, z2 ); -// returns false - -z1 = new Complex64( NaN, 3.0 ); -z2 = new Complex64( NaN, 3.0 ); -out = isSameValue( z1, z2 ); -// returns true -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float32/base/assert/is_same_value.h" -``` - -#### stdlib_base_complex64_is_same_value( z1, z2 ) - -Tests whether two single-precision complex floating-point numbers are the same value. - -```c -#include "stdlib/complex/float32/ctor.h" -#include - -stdlib_complex64_t z1 = stdlib_complex64( 5.0f, 2.0f ); -stdlib_complex64_t z2 = stdlib_complex64( 5.0f, 2.0f ); - -bool v = stdlib_base_complex64_is_same_value( z1, z2 ); -``` - -The function accepts the following arguments: - -- **z1**: `[in] stdlib_complex64_t` first single-precision complex floating-point number. -- **z2**: `[in] stdlib_complex64_t` second single-precision complex floating-point number. - -```c -bool stdlib_base_complex64_is_same_value( const stdlib_complex64_t z1, const stdlib_complex64_t z2 ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float32/base/assert/is_same_value.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include - -int main( void ) { - const stdlib_complex64_t z[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - bool v; - int i; - for ( i = 0; i < 4; i++ ) { - v = stdlib_base_complex64_is_same_value( z[ i ], z[ i ] ); - printf( "Same value? %s\n", ( v ) ? "True" : "False" ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float32/base/assert/is-same-value/benchmark/benchmark.js b/float32/base/assert/is-same-value/benchmark/benchmark.js deleted file mode 100644 index fd482f9b..00000000 --- a/float32/base/assert/is-same-value/benchmark/benchmark.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex64 = require( './../../../../../float32/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var isSameValue = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var z1; - var z2; - var v; - var i; - - z1 = [ - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ) - ]; - z2 = [ - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ), - z1[ 0 ], - z1[ 1 ] - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = isSameValue( z1[ i%z1.length ], z2[ i%z2.length ] ); - if ( typeof v !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( v ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/assert/is-same-value/docs/repl.txt b/float32/base/assert/is-same-value/docs/repl.txt deleted file mode 100644 index e9eaccdc..00000000 --- a/float32/base/assert/is-same-value/docs/repl.txt +++ /dev/null @@ -1,31 +0,0 @@ - -{{alias}}( z1, z2 ) - Tests whether two single-precision complex floating-point numbers are the - same value. - - The function differs from the `===` operator in that the function treats - `-0` and `+0` as distinct and `NaNs` as the same. - - Parameters - ---------- - z1: Complex64 - First complex number. - - z2: Complex64 - Second complex number. - - Returns - ------- - out: boolean - Result. - - Examples - -------- - > var z1 = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ); - > var z2 = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ); - > var v = {{alias}}( z1, z2 ) - true - - See Also - -------- - diff --git a/float32/base/assert/is-same-value/docs/types/index.d.ts b/float32/base/assert/is-same-value/docs/types/index.d.ts deleted file mode 100644 index b8ca4b34..00000000 --- a/float32/base/assert/is-same-value/docs/types/index.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex64 } from '@stdlib/types/complex'; - -/** -* Tests whether two single-precision complex floating-point numbers are the same value. -* -* ## Notes -* -* - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5. -* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same. -* -* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12 -* -* @param z1 - first complex number -* @param z2 - second complex number -* @returns boolean indicating if both complex numbers are the same value -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( 5.0, 3.0 ); -* -* var v = isSameValue( z1, z2 ); -* // returns true -*/ -declare function isSameValue( z1: Complex64, z2: Complex64 ): boolean; - - -// EXPORTS // - -export = isSameValue; diff --git a/float32/base/assert/is-same-value/docs/types/test.ts b/float32/base/assert/is-same-value/docs/types/test.ts deleted file mode 100644 index 586ae966..00000000 --- a/float32/base/assert/is-same-value/docs/types/test.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64 = require( './../../../../../../float32/ctor' ); -import isSameValue = require( './index' ); - - -// TESTS // - -// The function returns a boolean... -{ - const z1 = new Complex64( 5.0, 3.0 ); - const z2 = new Complex64( 5.0, 3.0 ); - - isSameValue( z1, z2 ); // $ExpectType boolean -} - -// The compiler throws an error if the function is provided a first argument that is not a complex number... -{ - const z2 = new Complex64( 5.0, 3.0 ); - - isSameValue( 'abc', z2 ); // $ExpectError - isSameValue( 123, z2 ); // $ExpectError - isSameValue( true, z2 ); // $ExpectError - isSameValue( false, z2 ); // $ExpectError - isSameValue( [], z2 ); // $ExpectError - isSameValue( {}, z2 ); // $ExpectError - isSameValue( ( x: number ): number => x, z2 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a complex number... -{ - const z1 = new Complex64( 5.0, 3.0 ); - - isSameValue( z1, 'abc' ); // $ExpectError - isSameValue( z1, 123 ); // $ExpectError - isSameValue( z1, true ); // $ExpectError - isSameValue( z1, false ); // $ExpectError - isSameValue( z1, [] ); // $ExpectError - isSameValue( z1, {} ); // $ExpectError - isSameValue( z1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z1 = new Complex64( 5.0, 3.0 ); - const z2 = new Complex64( 5.0, 3.0 ); - - isSameValue(); // $ExpectError - isSameValue( z1 ); // $ExpectError - isSameValue( z1, z2, {} ); // $ExpectError -} diff --git a/float32/base/assert/is-same-value/examples/c/Makefile b/float32/base/assert/is-same-value/examples/c/Makefile deleted file mode 100644 index 6aed70da..00000000 --- a/float32/base/assert/is-same-value/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2024 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/assert/is-same-value/examples/c/example.c b/float32/base/assert/is-same-value/examples/c/example.c deleted file mode 100644 index bbfa7394..00000000 --- a/float32/base/assert/is-same-value/examples/c/example.c +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/assert/is_same_value.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include - -int main( void ) { - const stdlib_complex64_t z[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - bool v; - int i; - for ( i = 0; i < 4; i++ ) { - v = stdlib_base_complex64_is_same_value( z[ i ], z[ i ] ); - printf( "Same value? %s\n", ( v ) ? "True" : "False" ); - } -} diff --git a/float32/base/assert/is-same-value/examples/index.js b/float32/base/assert/is-same-value/examples/index.js deleted file mode 100644 index 84b108a4..00000000 --- a/float32/base/assert/is-same-value/examples/index.js +++ /dev/null @@ -1,37 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64 = require( './../../../../../float32/ctor' ); -var isSameValue = require( './../lib' ); - -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( 5.0, 3.0 ); -console.log( isSameValue( z1, z2 ) ); -// => true - -z1 = new Complex64( -5.0, -3.0 ); -z2 = new Complex64( 5.0, 3.0 ); -console.log( isSameValue( z1, z2 ) ); -// => false - -z1 = new Complex64( NaN, 3.0 ); -z2 = new Complex64( NaN, 3.0 ); -console.log( isSameValue( z1, z2 ) ); -// => true diff --git a/float32/base/assert/is-same-value/include/stdlib/complex/float32/base/assert/is_same_value.h b/float32/base/assert/is-same-value/include/stdlib/complex/float32/base/assert/is_same_value.h deleted file mode 100644 index 23f3daff..00000000 --- a/float32/base/assert/is-same-value/include/stdlib/complex/float32/base/assert/is_same_value.h +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef STDLIB_COMPLEX_FLOAT32_BASE_ASSERT_IS_SAME_VALUE_H -#define STDLIB_COMPLEX_FLOAT32_BASE_ASSERT_IS_SAME_VALUE_H - -#include "stdlib/complex/float32/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether two single-precision complex floating-point numbers are the same value. -*/ -bool stdlib_base_complex64_is_same_value( const stdlib_complex64_t z1, const stdlib_complex64_t z2 ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_FLOAT32_BASE_ASSERT_IS_SAME_VALUE_H diff --git a/float32/base/assert/is-same-value/lib/index.js b/float32/base/assert/is-same-value/lib/index.js deleted file mode 100644 index 09d55128..00000000 --- a/float32/base/assert/is-same-value/lib/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Test whether two single-precision complex floating-point numbers are the same value. -* -* @module @stdlib/complex/float32/base/assert/is-same-value -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var isSameValue = require( '@stdlib/complex/float32/base/assert/is-same-value' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( 5.0, 3.0 ); -* -* var v = isSameValue( z1, z2 ); -* // returns true -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float32/base/assert/is-same-value/lib/main.js b/float32/base/assert/is-same-value/lib/main.js deleted file mode 100644 index 2ad7c42c..00000000 --- a/float32/base/assert/is-same-value/lib/main.js +++ /dev/null @@ -1,64 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var isSame = require( '@stdlib/number/float32/base/assert/is-same-value' ); -var reimf = require( './../../../../../float32/reim' ); - - -// MAIN // - -/** -* Tests whether two single-precision complex floating-point numbers are the same value. -* -* ## Notes -* -* - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5. -* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same. -* -* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12 -* -* @param {Complex64} z1 - first complex number -* @param {Complex64} z2 - second complex number -* @returns {boolean} result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( 5.0, 3.0 ); -* -* var v = isSameValue( z1, z2 ); -* // returns true -*/ -function isSameValue( z1, z2 ) { - var parts1 = reimf( z1 ); - var parts2 = reimf( z2 ); - return ( - isSame( parts1[ 0 ], parts2[ 0 ] ) && - isSame( parts1[ 1 ], parts2[ 1 ] ) - ); -} - - -// EXPORTS // - -module.exports = isSameValue; diff --git a/float32/base/assert/is-same-value/manifest.json b/float32/base/assert/is-same-value/manifest.json deleted file mode 100644 index aefe64fa..00000000 --- a/float32/base/assert/is-same-value/manifest.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim", - "@stdlib/number/float32/base/assert/is-same-value" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim", - "@stdlib/number/float32/base/assert/is-same-value" - ] - } - ] -} diff --git a/float32/base/assert/is-same-value/package.json b/float32/base/assert/is-same-value/package.json deleted file mode 100644 index 8f1cf7c2..00000000 --- a/float32/base/assert/is-same-value/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "name": "@stdlib/complex/float32/base/assert/is-same-value", - "version": "0.0.0", - "description": "Test whether two single-precision complex floating-point numbers are the same value.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "number", - "base", - "assert", - "test", - "validate", - "equality", - "compare", - "comparison", - "equal", - "eq", - "same", - "issame", - "issamevalue" - ] -} diff --git a/float32/base/assert/is-same-value/src/main.c b/float32/base/assert/is-same-value/src/main.c deleted file mode 100644 index 34a1e309..00000000 --- a/float32/base/assert/is-same-value/src/main.c +++ /dev/null @@ -1,52 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/assert/is_same_value.h" -#include "stdlib/number/float32/base/assert/is_same_value.h" -#include "stdlib/complex/float32/reim.h" -#include "stdlib/complex/float32/ctor.h" -#include - -/** -* Tests whether two single-precision complex floating-point numbers are the same value. -* -* @param z1 first single-precision complex floating-point number -* @param z2 second single-precision complex floating-point number -* @return boolean indicating if both complex numbers are the same value -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* #include -* -* stdlib_complex64_t z1 = stdlib_complex64( 5.0f, 2.0f ); -* stdlib_complex64_t z2 = stdlib_complex64( 5.0f, 2.0f ); -* -* bool v = stdlib_base_complex64_is_same_value( z1, z2 ); -*/ -bool stdlib_base_complex64_is_same_value( const stdlib_complex64_t z1, const stdlib_complex64_t z2 ) { - float re1; - float re2; - float im1; - float im2; - stdlib_complex64_reim( z1, &re1, &im1 ); - stdlib_complex64_reim( z2, &re2, &im2 ); - return ( - stdlib_base_float32_is_same_value( re1, re2 ) && - stdlib_base_float32_is_same_value( im1, im2 ) - ); -} diff --git a/float32/base/assert/is-same-value/test/test.js b/float32/base/assert/is-same-value/test/test.js deleted file mode 100644 index 8702ac45..00000000 --- a/float32/base/assert/is-same-value/test/test.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex64 = require( './../../../../../float32/ctor' ); -var PINF = require( '@stdlib/constants/float32/pinf' ); -var NINF = require( '@stdlib/constants/float32/ninf' ); -var isSameValue = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof isSameValue, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function tests whether two complex numbers are the same value (finite)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isSameValue( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( 0.0, 0.0 ); - z2 = new Complex64( 0.0, 0.0 ); - t.strictEqual( isSameValue( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( -0.0, 0.0 ); - z2 = new Complex64( 0.0, 0.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 0.0, -0.0 ); - z2 = new Complex64( -0.0, 0.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 0.0, -0.0 ); - z2 = new Complex64( 0.0, -0.0 ); - t.strictEqual( isSameValue( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( -5.0, 3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -5.0, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 5.0, -3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( 5.0, -3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether two complex numbers are the same value (infinite)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( PINF, NINF ); - t.strictEqual( isSameValue( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex64( PINF, NINF ); - z2 = new Complex64( PINF, NINF ); - t.strictEqual( isSameValue( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( NINF, 3.0 ); - z2 = new Complex64( PINF, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( PINF, 3.0 ); - z2 = new Complex64( NINF, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( PINF, -3.0 ); - z2 = new Complex64( PINF, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( PINF, 3.0 ); - z2 = new Complex64( PINF, -3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 5.0, PINF ); - z2 = new Complex64( 5.0, NINF ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether two complex numbers are the same value (NaNs)', function test( t ) { - var z1; - var z2; - - z1 = new Complex64( NaN, NaN ); - t.strictEqual( isSameValue( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, NaN ); - z2 = new Complex64( NaN, NaN ); - t.strictEqual( isSameValue( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( NaN, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( NaN, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( 5.0, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( 5.0, NaN ); - t.strictEqual( isSameValue( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( 5.0, NaN ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/assert/lib/index.js b/float32/base/assert/lib/index.js deleted file mode 100644 index a0242e32..00000000 --- a/float32/base/assert/lib/index.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/* -* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name. -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); - - -// MAIN // - -/** -* Top-level namespace. -* -* @namespace ns -*/ -var ns = {}; - -/** -* @name isAlmostEqual -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float32/base/assert/is-almost-equal} -*/ -setReadOnly( ns, 'isAlmostEqual', require( './../../../../float32/base/assert/is-almost-equal' ) ); - -/** -* @name isAlmostSameValue -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float32/base/assert/is-almost-same-value} -*/ -setReadOnly( ns, 'isAlmostSameValue', require( './../../../../float32/base/assert/is-almost-same-value' ) ); - -/** -* @name isEqual -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float32/base/assert/is-equal} -*/ -setReadOnly( ns, 'isEqual', require( './../../../../float32/base/assert/is-equal' ) ); - -/** -* @name isNotEqual -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float32/base/assert/is-not-equal} -*/ -setReadOnly( ns, 'isNotEqual', require( './../../../../float32/base/assert/is-not-equal' ) ); - -/** -* @name isSameValue -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float32/base/assert/is-same-value} -*/ -setReadOnly( ns, 'isSameValue', require( './../../../../float32/base/assert/is-same-value' ) ); - -/** -* @name isSameValueZero -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float32/base/assert/is-same-value-zero} -*/ -setReadOnly( ns, 'isSameValueZero', require( './../../../../float32/base/assert/is-same-value-zero' ) ); - - -// EXPORTS // - -module.exports = ns; diff --git a/float32/base/assert/package.json b/float32/base/assert/package.json deleted file mode 100644 index 3b2e58ad..00000000 --- a/float32/base/assert/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "@stdlib/complex/float32/base/assert", - "version": "0.0.0", - "description": "Base (i.e., lower-level) single-precision complex number assertion functions.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "lib/index.js", - "directories": { - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "types", - "complex", - "cmplx", - "number", - "namespace", - "ns", - "float32", - "base", - "assert" - ] -} diff --git a/float32/base/assert/test/test.js b/float32/base/assert/test/test.js deleted file mode 100644 index 2fbefe9d..00000000 --- a/float32/base/assert/test/test.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - - -// TESTS // - -tape( 'main export is an object', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ns, 'object', 'main export is an object' ); - t.end(); -}); - -tape( 'the exported object contains key-value pairs', function test( t ) { - var keys = objectKeys( ns ); - t.strictEqual( keys.length > 0, true, 'has keys' ); - t.end(); -}); diff --git a/float32/base/docs/types/index.d.ts b/float32/base/docs/types/index.d.ts deleted file mode 100644 index 0068e628..00000000 --- a/float32/base/docs/types/index.d.ts +++ /dev/null @@ -1,221 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/* eslint-disable max-lines */ - -import add = require( './../../../../float32/base/add' ); -import assert = require( './../../../../float32/base/assert' ); -import identity = require( './../../../../float32/base/identity' ); -import mul = require( './../../../../float32/base/mul' ); -import neg = require( './../../../../float32/base/neg' ); -import scale = require( './../../../../float32/base/scale' ); -import sub = require( './../../../../float32/base/sub' ); - -/** -* Interface describing the `base` namespace. -*/ -interface Namespace { - /** - * Adds two single-precision complex floating-point numbers. - * - * @param z1 - complex number - * @param z2 - complex number - * @returns result - * - * @example - * var Complex64 = require( './../../../../float32/ctor' ); - * - * var z = new Complex64( 5.0, 3.0 ); - * - * var out = ns.add( z, z ); - * // returns [ 10.0, 6.0 ] - * - * @example - * var Float32Array = require( '@stdlib/array/float32' ); - * - * var out = new Float32Array( 2 ); - * var v = ns.add.assign( 5.0, 3.0, 5.0, 3.0, out, 1, 0 ); - * // returns [ 10.0, 6.0 ] - * - * var bool = ( out === v ); - * // returns true - * - * @example - * var Float32Array = require( '@stdlib/array/float32' ); - * - * var z1 = new Float32Array( [ 5.0, 3.0 ] ); - * var z2 = new Float32Array( [ 5.0, 3.0 ] ); - * - * var out = ns.add.strided( z1, 1, 0, z2, 1, 0, new Float32Array( 2 ), 1, 0 ); - * // returns [ 10.0, 6.0 ] - */ - add: typeof add; - - /** - * Base (i.e., lower-level) single-precision complex number assertion functions. - */ - assert: typeof assert; - - /** - * Evaluates the identity function for single-precision complex floating-point number. - * - * @param z - input value - * @returns input value - * - * @example - * var Complex64 = require( './../../../../float32/ctor' ); - * - * var v = ns.identity( new Complex64( -1.0, 2.0 ) ); - * // returns [ -1.0, 2.0 ] - */ - identity: typeof identity; - - /** - * Multiplies two single-precision complex floating-point numbers. - * - * @param z1 - complex number - * @param z2 - complex number - * @returns result - * - * @example - * var Complex64 = require( './../../../../float32/ctor' ); - * - * var z1 = new Complex64( 5.0, 3.0 ); - * var z2 = new Complex64( -2.0, 1.0 ); - * - * var out = ns.mul( z1, z2 ); - * // returns [ -13.0, -1.0 ] - * - * @example - * var Float32Array = require( '@stdlib/array/float32' ); - * - * var out = new Float32Array( 2 ); - * var v = ns.mul.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ); - * // returns [ -13.0, -1.0 ] - * - * var bool = ( out === v ); - * // returns true - * - * @example - * var Float32Array = require( '@stdlib/array/float32' ); - * - * var z1 = new Float32Array( [ 5.0, 3.0 ] ); - * var z2 = new Float32Array( [ -2.0, 1.0 ] ); - * - * var out = ns.mul.strided( z1, 1, 0, z2, 1, 0, new Float32Array( 2 ), 1, 0 ); - * // returns [ -13.0, -1.0 ] - */ - mul: typeof mul; - - /** - * Negates a single-precision complex floating-point number. - * - * @param z - complex number - * @returns result - * - * @example - * var Complex64 = require( './../../../../float32/ctor' ); - * - * var z = new Complex64( -4.2, 5.5 ); - * - * var out = ns.neg( z ); - * // returns [ ~4.2, -5.5 ] - * - * @example - * var Complex64 = require( './../../../../float32/ctor' ); - * - * var z = new Complex64( 0.0, 0.0 ); - * - * var out = ns.neg( z ); - * // returns [ -0.0, -0.0 ] - * - * @example - * var Complex64 = require( './../../../../float32/ctor' ); - * - * var z = new Complex64( NaN, NaN ); - * - * var out = ns.neg( z ); - * // returns [ NaN, NaN ] - */ - neg: typeof neg; - - /** - * Scales a single-precision complex floating-point number by a real-valued single-precision floating-point scalar constant. - * - * @param alpha - scalar constant - * @param z - complex number - * @returns result - * - * @example - * var Complex64 = require( './../../../../float32/ctor' ); - * - * var z = new Complex64( 5.0, 3.0 ); - * - * var out = ns.scale( 5.0, z ); - * // returns [ 25.0, 15.0 ] - * - * @example - * var Float32Array = require( '@stdlib/array/float32' ); - * - * var out = new Float32Array( 2 ); - * var v = ns.scale.assign( 5.0, 5.0, 3.0, out, 1, 0 ); - * // returns [ 25.0, 15.0 ] - * - * var bool = ( out === v ); - * // returns true - * - * @example - * var Float32Array = require( '@stdlib/array/float32' ); - * - * var z = new Float32Array( [ 5.0, 3.0 ] ); - * - * var out = ns.scale.strided( 5.0, z, 1, 0, new Float32Array( 2 ), 1, 0 ); - * // returns [ 25.0, 15.0 ] - */ - scale: typeof scale; - - /** - * Subtracts two single-precision complex floating-point numbers. - * - * @param z1 - complex number - * @param z2 - complex number - * @returns result - * - * @example - * var Complex64 = require( './../../../../float32/ctor' ); - * - * var z1 = new Complex64( 5.0, 3.0 ); - * var z2 = new Complex64( -2.0, 1.0 ); - * - * var out = ns.sub( z1, z2 ); - * // returns [ 7.0, 2.0 ] - */ - sub: typeof sub; -} - -/** -* Base (i.e., lower-level) single-precision complex number functions. -*/ -declare var ns: Namespace; - - -// EXPORTS // - -export = ns; diff --git a/float32/base/docs/types/test.ts b/float32/base/docs/types/test.ts deleted file mode 100644 index 2f81653a..00000000 --- a/float32/base/docs/types/test.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable @typescript-eslint/no-unused-expressions */ - -import ns = require( './index' ); - - -// TESTS // - -// The exported value is the expected interface... -{ - ns; // $ExpectType Namespace -} diff --git a/float32/base/examples/index.js b/float32/base/examples/index.js deleted file mode 100644 index 6115ca08..00000000 --- a/float32/base/examples/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - -console.log( objectKeys( ns ) ); diff --git a/float32/base/identity/README.md b/float32/base/identity/README.md deleted file mode 100644 index 2612cf6b..00000000 --- a/float32/base/identity/README.md +++ /dev/null @@ -1,237 +0,0 @@ - - -# Identity Function - -> Evaluate the [identity function][identity-function] of a single-precision [complex][@stdlib/complex/float32/ctor] floating-point number. - -
- -The [identity-function][identity-function] is defined as - - - -```math -f(z) = z -``` - - - - - -for all `z`. - -
- - - -
- -## Usage - -```javascript -var cidentityf = require( '@stdlib/complex/float32/base/identity' ); -``` - -#### cidentityf( z ) - -Evaluates the [identity function][identity-function] for a single-precision [complex][@stdlib/complex/float32/ctor] floating-point number. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var v = cidentityf( new Complex64( -1.0, 2.0 ) ); -// returns [ -1.0, 2.0 ] -``` - -
- - - -
- -## Examples - - - -```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var cidentityf = require( '@stdlib/complex/float32/base/identity' ); - -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = new Complex64( discreteUniform( -50, 50 ), discreteUniform( -50, 50 ) ); - console.log( 'identity(%s) = %s', z, cidentityf( z ) ); -} -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float32/base/identity.h" -``` - -#### stdlib_base_complex64_identity( z ) - -Evaluates the identity function for a single-precision complex floating-point number. - -```c -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/real.h" -#include "stdlib/complex/float32/imag.h" - -stdlib_complex64_t z = stdlib_complex64( 2.0f, 2.0f ); -stdlib_complex64_t out = stdlib_base_complex64_identity( z ); - -float re = stdlib_complex64_real( out ); -// returns 2.0f - -float im = stdlib_complex64_imag( out ); -// returns 2.0f -``` - -The function accepts the following arguments: - -- **z**: `[in] stdlib_complex64_t` input value. - -```c -stdlib_complex64_t stdlib_base_complex64_identity( const stdlib_complex64_t z ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float32/base/identity.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 3.14f, 1.0f ), - stdlib_complex64( -3.14f, -1.0f ), - stdlib_complex64( 0.0f, 0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - stdlib_complex64_t v; - stdlib_complex64_t y; - float re1; - float im1; - float re2; - float im2; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - y = stdlib_base_complex64_identity( v ); - stdlib_complex64_reim( v, &re1, &im1 ); - stdlib_complex64_reim( y, &re2, &im2 ); - printf( "cidentity(%f + %fi) = %f + %fi\n", re1, im1, re2, im2 ); - } -} -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/float32/base/identity/benchmark/benchmark.js b/float32/base/identity/benchmark/benchmark.js deleted file mode 100644 index efab3947..00000000 --- a/float32/base/identity/benchmark/benchmark.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var real = require( './../../../../float32/real' ); -var imag = require( './../../../../float32/imag' ); -var pkg = require( './../package.json' ).name; -var cidentityf = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var y; - var i; - - values = [ - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - y = cidentityf( values[ i%values.length ] ); - if ( isnanf( real( y ) ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnanf( imag( y ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/identity/benchmark/benchmark.native.js b/float32/base/identity/benchmark/benchmark.native.js deleted file mode 100644 index bf6acee1..00000000 --- a/float32/base/identity/benchmark/benchmark.native.js +++ /dev/null @@ -1,67 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var real = require( './../../../../float32/real' ); -var imag = require( './../../../../float32/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); -var pkg = require( './../package.json' ).name; - - -// VARIABLES // - -var cidentityf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( cidentityf instanceof Error ) -}; - - -// MAIN // - -bench( pkg+'::native', opts, function benchmark( b ) { - var values; - var y; - var i; - - values = [ - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - y = cidentityf( values[ i%values.length ] ); - if ( isnanf( real( y ) ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnanf( imag( y ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/identity/benchmark/c/native/Makefile b/float32/base/identity/benchmark/c/native/Makefile deleted file mode 100644 index 7f6bbc4c..00000000 --- a/float32/base/identity/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/identity/benchmark/c/native/benchmark.c b/float32/base/identity/benchmark/c/native/benchmark.c deleted file mode 100644 index f016e8c5..00000000 --- a/float32/base/identity/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,141 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/identity.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include -#include -#include -#include -#include - -#define NAME "cidentityf" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double t; - float re; - float im; - float v; - int i; - - stdlib_complex64_t x; - stdlib_complex64_t y; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - v = ( 1000.0f*rand_float() ) - 500.0f; - x = stdlib_complex64( v, v ); - y = stdlib_base_complex64_identity( x ); - stdlib_complex64_reim( y, &re, &im ); - if ( re != re ) { - printf( "unexpected result\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "unexpected result\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/base/identity/binding.gyp b/float32/base/identity/binding.gyp deleted file mode 100644 index 68a1ca11..00000000 --- a/float32/base/identity/binding.gyp +++ /dev/null @@ -1,170 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A `.gyp` file for building a Node.js native add-on. -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # List of files to include in this file: - 'includes': [ - './include.gypi', - ], - - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Target name should match the add-on export name: - 'addon_target_name%': 'addon', - - # Set variables based on the host OS: - 'conditions': [ - [ - 'OS=="win"', - { - # Define the object file suffix: - 'obj': 'obj', - }, - { - # Define the object file suffix: - 'obj': 'o', - } - ], # end condition (OS=="win") - ], # end conditions - }, # end variables - - # Define compile targets: - 'targets': [ - - # Target to generate an add-on: - { - # The target name should match the add-on export name: - 'target_name': '<(addon_target_name)', - - # Define dependencies: - 'dependencies': [], - - # Define directories which contain relevant include headers: - 'include_dirs': [ - # Local include directory: - '<@(include_dirs)', - ], - - # List of source files: - 'sources': [ - '<@(src_files)', - ], - - # Settings which should be applied when a target's object files are used as linker input: - 'link_settings': { - # Define libraries: - 'libraries': [ - '<@(libraries)', - ], - - # Define library directories: - 'library_dirs': [ - '<@(library_dirs)', - ], - }, - - # C/C++ compiler flags: - 'cflags': [ - # Enable commonly used warning options: - '-Wall', - - # Aggressive optimization: - '-O3', - ], - - # C specific compiler flags: - 'cflags_c': [ - # Specify the C standard to which a program is expected to conform: - '-std=c99', - ], - - # C++ specific compiler flags: - 'cflags_cpp': [ - # Specify the C++ standard to which a program is expected to conform: - '-std=c++11', - ], - - # Linker flags: - 'ldflags': [], - - # Apply conditions based on the host OS: - 'conditions': [ - [ - 'OS=="mac"', - { - # Linker flags: - 'ldflags': [ - '-undefined dynamic_lookup', - '-Wl,-no-pie', - '-Wl,-search_paths_first', - ], - }, - ], # end condition (OS=="mac") - [ - 'OS!="win"', - { - # C/C++ flags: - 'cflags': [ - # Generate platform-independent code: - '-fPIC', - ], - }, - ], # end condition (OS!="win") - ], # end conditions - }, # end target <(addon_target_name) - - # Target to copy a generated add-on to a standard location: - { - 'target_name': 'copy_addon', - - # Declare that the output of this target is not linked: - 'type': 'none', - - # Define dependencies: - 'dependencies': [ - # Require that the add-on be generated before building this target: - '<(addon_target_name)', - ], - - # Define a list of actions: - 'actions': [ - { - 'action_name': 'copy_addon', - 'message': 'Copying addon...', - - # Explicitly list the inputs in the command-line invocation below: - 'inputs': [], - - # Declare the expected outputs: - 'outputs': [ - '<(addon_output_dir)/<(addon_target_name).node', - ], - - # Define the command-line invocation: - 'action': [ - 'cp', - '<(PRODUCT_DIR)/<(addon_target_name).node', - '<(addon_output_dir)/<(addon_target_name).node', - ], - }, - ], # end actions - }, # end target copy_addon - ], # end targets -} diff --git a/float32/base/identity/docs/img/equation_identity_function.svg b/float32/base/identity/docs/img/equation_identity_function.svg deleted file mode 100644 index 86516c97..00000000 --- a/float32/base/identity/docs/img/equation_identity_function.svg +++ /dev/null @@ -1,18 +0,0 @@ - -f left-parenthesis x right-parenthesis equals x - - - \ No newline at end of file diff --git a/float32/base/identity/docs/repl.txt b/float32/base/identity/docs/repl.txt deleted file mode 100644 index bcb5136e..00000000 --- a/float32/base/identity/docs/repl.txt +++ /dev/null @@ -1,27 +0,0 @@ - -{{alias}}( z ) - Evaluates the identity function for a single-precision complex floating- - point number. - - Parameters - ---------- - z: Complex64 - Input value. - - Returns - ------- - v: Complex64 - Input value. - - Examples - -------- - > var v = {{alias}}( new {{alias:@stdlib/complex/float32/ctor}}( -1.0, 2.0 ) ) - - > var re = {{alias:@stdlib/complex/float32/real}}( v ) - -1.0 - > var img = {{alias:@stdlib/complex/float32/imag}}( v ) - 2.0 - - See Also - -------- - diff --git a/float32/base/identity/docs/types/index.d.ts b/float32/base/identity/docs/types/index.d.ts deleted file mode 100644 index 70263abd..00000000 --- a/float32/base/identity/docs/types/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex64 } from '@stdlib/types/complex'; - -/** -* Evaluates the identity function for single-precision complex floating-point number. -* -* @param z - input value -* @returns input value -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var v = cidentityf( new Complex64( -1.0, 2.0 ) ); -* // returns [ -1.0, 2.0 ] -*/ -declare function cidentityf( z: Complex64 ): Complex64; - - -// EXPORTS // - -export = cidentityf; diff --git a/float32/base/identity/docs/types/test.ts b/float32/base/identity/docs/types/test.ts deleted file mode 100644 index d74928cd..00000000 --- a/float32/base/identity/docs/types/test.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64 = require( './../../../../../float32/ctor' ); -import cidentityf = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - cidentityf( new Complex64( 1.0, 2.0 ) ); // $ExpectType Complex64 -} - -// The compiler throws an error if the function is provided a value other than a complex number... -{ - cidentityf( true ); // $ExpectError - cidentityf( false ); // $ExpectError - cidentityf( null ); // $ExpectError - cidentityf( undefined ); // $ExpectError - cidentityf( '5' ); // $ExpectError - cidentityf( [] ); // $ExpectError - cidentityf( {} ); // $ExpectError - cidentityf( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided insufficient arguments... -{ - cidentityf(); // $ExpectError -} diff --git a/float32/base/identity/examples/c/Makefile b/float32/base/identity/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float32/base/identity/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/identity/examples/c/example.c b/float32/base/identity/examples/c/example.c deleted file mode 100644 index e012a5b2..00000000 --- a/float32/base/identity/examples/c/example.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/identity.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 3.14f, 1.0f ), - stdlib_complex64( -3.14f, -1.0f ), - stdlib_complex64( 0.0f, 0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - stdlib_complex64_t v; - stdlib_complex64_t y; - float re1; - float im1; - float re2; - float im2; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - y = stdlib_base_complex64_identity( v ); - stdlib_complex64_reim( v, &re1, &im1 ); - stdlib_complex64_reim( y, &re2, &im2 ); - printf( "cidentity(%f + %fi) = %f + %fi\n", re1, im1, re2, im2 ); - } -} diff --git a/float32/base/identity/examples/index.js b/float32/base/identity/examples/index.js deleted file mode 100644 index cf0646bc..00000000 --- a/float32/base/identity/examples/index.js +++ /dev/null @@ -1,30 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var Complex64 = require( './../../../../float32/ctor' ); -var cidentityf = require( './../lib' ); - -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = new Complex64( discreteUniform( -50, 50 ), discreteUniform( -50, 50 ) ); - console.log( 'identity(%s) = %s', z, cidentityf( z ) ); -} diff --git a/float32/base/identity/include.gypi b/float32/base/identity/include.gypi deleted file mode 100644 index ecfaf82a..00000000 --- a/float32/base/identity/include.gypi +++ /dev/null @@ -1,53 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A GYP include file for building a Node.js native add-on. -# -# Main documentation: -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Source directory: - 'src_dir': './src', - - # Include directories: - 'include_dirs': [ - '[ -1.0, 2.0 ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float32/base/identity/lib/main.js b/float32/base/identity/lib/main.js deleted file mode 100644 index 308a751c..00000000 --- a/float32/base/identity/lib/main.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Evaluates the identity function for a single-precision complex floating-point number. -* -* @param {Complex64} z - input value -* @returns {Complex64} input value -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var v = cidentityf( new Complex64( -1.0, 2.0 ) ); -* // returns [ -1.0, 2.0 ] -*/ -function cidentityf( z ) { - return z; -} - - -// EXPORTS // - -module.exports = cidentityf; diff --git a/float32/base/identity/lib/native.js b/float32/base/identity/lib/native.js deleted file mode 100644 index bda391a5..00000000 --- a/float32/base/identity/lib/native.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex64 = require( './../../../../float32/ctor' ); -var addon = require( './../src/addon.node' ); - - -// MAIN // - -/** -* Evaluates the identity function for a single-precision complex floating-point number. -* -* @private -* @param {Complex64} z - input value -* @returns {Complex64} input value -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var v = cidentityf( new Complex64( -1.0, 2.0 ) ); -* // returns [ -1.0, 2.0 ] -*/ -function cidentityf( z ) { - var v = addon( z ); - return new Complex64( v.re, v.im ); -} - - -// EXPORTS // - -module.exports = cidentityf; diff --git a/float32/base/identity/manifest.json b/float32/base/identity/manifest.json deleted file mode 100644 index b36aa0cc..00000000 --- a/float32/base/identity/manifest.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/napi/unary", - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - } - ] -} diff --git a/float32/base/identity/package.json b/float32/base/identity/package.json deleted file mode 100644 index 7a8bf105..00000000 --- a/float32/base/identity/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "@stdlib/complex/float32/base/identity", - "version": "0.0.0", - "description": "Evaluate the identity function for a single-precision complex floating-point number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "identity", - "single", - "single-precision", - "float", - "float32", - "complex", - "cmplx" - ], - "__stdlib__": {} -} diff --git a/float32/base/identity/src/Makefile b/float32/base/identity/src/Makefile deleted file mode 100644 index 7733b618..00000000 --- a/float32/base/identity/src/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - - -# RULES # - -#/ -# Removes generated files for building an add-on. -# -# @example -# make clean-addon -#/ -clean-addon: - $(QUIET) -rm -f *.o *.node - -.PHONY: clean-addon - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: clean-addon - -.PHONY: clean diff --git a/float32/base/identity/src/addon.c b/float32/base/identity/src/addon.c deleted file mode 100644 index 3d04489c..00000000 --- a/float32/base/identity/src/addon.c +++ /dev/null @@ -1,22 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/identity.h" -#include "stdlib/math/base/napi/unary.h" - -STDLIB_MATH_BASE_NAPI_MODULE_C_C( stdlib_base_complex64_identity ) diff --git a/float32/base/identity/src/main.c b/float32/base/identity/src/main.c deleted file mode 100644 index 5efeb784..00000000 --- a/float32/base/identity/src/main.c +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/identity.h" -#include "stdlib/complex/float32/ctor.h" - -/** -* Evaluates the identity function for a single-precision complex floating-point number. -* -* @param z number -* @return input value -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* #include "stdlib/complex/float32/real.h" -* #include "stdlib/complex/float32/imag.h" -* -* stdlib_complex64_t z = stdlib_complex64( 3.0f, 3.0f ); -* stdlib_complex64_t out = stdlib_base_complex64_identity( z ); -* -* float re = stdlib_complex64_real( out ); -* // returns 3.0f -* -* float im = stdlib_complex64_imag( out ); -* // returns 3.0f -*/ -stdlib_complex64_t stdlib_base_complex64_identity( const stdlib_complex64_t z ) { - return z; -} diff --git a/float32/base/identity/test/test.js b/float32/base/identity/test/test.js deleted file mode 100644 index 5d0e2992..00000000 --- a/float32/base/identity/test/test.js +++ /dev/null @@ -1,117 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' ); -var isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var PINF = require( '@stdlib/constants/float32/pinf' ); -var NINF = require( '@stdlib/constants/float32/ninf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var real = require( './../../../../float32/real' ); -var imag = require( './../../../../float32/imag' ); -var cidentityf = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof cidentityf, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function evaluates the identity function when provided a finite number', function test( t ) { - var v; - - v = cidentityf( new Complex64( -2.0, 1.0 ) ); - t.strictEqual( real( v ), -2.0, 'returns expected value' ); - t.strictEqual( imag( v ), 1.0, 'returns expected value' ); - - v = cidentityf( new Complex64( 3.0, -2.0 ) ); - t.strictEqual( real( v ), 3.0, 'returns expected value' ); - t.strictEqual( imag( v ), -2.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function evaluates the identity function when provided +-zero', function test( t ) { - var v; - - v = cidentityf( new Complex64( -0.0, -0.0 ) ); - t.strictEqual( isNegativeZerof( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isNegativeZerof( imag( v ) ), true, 'returns expected value' ); - - v = cidentityf( new Complex64( 0.0, 0.0 ) ); - t.strictEqual( isPositiveZerof( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isPositiveZerof( imag( v ) ), true, 'returns expected value' ); - - v = cidentityf( new Complex64( -0.0, 0.0 ) ); - t.strictEqual( isNegativeZerof( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isPositiveZerof( imag( v ) ), true, 'returns expected value' ); - - v = cidentityf( new Complex64( 0.0, -0.0 ) ); - t.strictEqual( isPositiveZerof( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isNegativeZerof( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function evaluates the identity function when provided +-infinity', function test( t ) { - var v; - - v = cidentityf( new Complex64( PINF, PINF ) ); - t.strictEqual( real( v ), PINF, 'returns expected value' ); - t.strictEqual( imag( v ), PINF, 'returns expected value' ); - - v = cidentityf( new Complex64( NINF, NINF ) ); - t.strictEqual( real( v ), NINF, 'returns expected value' ); - t.strictEqual( imag( v ), NINF, 'returns expected value' ); - - v = cidentityf( new Complex64( NINF, PINF ) ); - t.strictEqual( real( v ), NINF, 'returns expected value' ); - t.strictEqual( imag( v ), PINF, 'returns expected value' ); - - v = cidentityf( new Complex64( PINF, NINF ) ); - t.strictEqual( real( v ), PINF, 'returns expected value' ); - t.strictEqual( imag( v ), NINF, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function evaluates the identity function when provided `NaN`', function test( t ) { - var v; - - v = cidentityf( new Complex64( NaN, NaN ) ); - t.strictEqual( isnanf( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imag( v ) ), true, 'returns expected value' ); - - v = cidentityf( new Complex64( 1.0, NaN ) ); - t.strictEqual( real( v ), 1.0, 'returns expected value' ); - t.strictEqual( isnanf( imag( v ) ), true, 'returns expected value' ); - - v = cidentityf( new Complex64( NaN, 1.0 ) ); - t.strictEqual( isnanf( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 1.0, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/identity/test/test.native.js b/float32/base/identity/test/test.native.js deleted file mode 100644 index ffffa096..00000000 --- a/float32/base/identity/test/test.native.js +++ /dev/null @@ -1,126 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var tape = require( 'tape' ); -var isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' ); -var isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var PINF = require( '@stdlib/constants/float32/pinf' ); -var NINF = require( '@stdlib/constants/float32/ninf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var real = require( './../../../../float32/real' ); -var imag = require( './../../../../float32/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var cidentityf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( cidentityf instanceof Error ) -}; - - -// TESTS // - -tape( 'main export is a function', opts, function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof cidentityf, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function evaluates the identity function when provided a finite number', opts, function test( t ) { - var v; - - v = cidentityf( new Complex64( -2.0, 1.0 ) ); - t.strictEqual( real( v ), -2.0, 'returns expected value' ); - t.strictEqual( imag( v ), 1.0, 'returns expected value' ); - - v = cidentityf( new Complex64( 3.0, -2.0 ) ); - t.strictEqual( real( v ), 3.0, 'returns expected value' ); - t.strictEqual( imag( v ), -2.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function evaluates the identity function when provided +-zero', opts, function test( t ) { - var v; - - v = cidentityf( new Complex64( -0.0, -0.0 ) ); - t.strictEqual( isNegativeZerof( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isNegativeZerof( imag( v ) ), true, 'returns expected value' ); - - v = cidentityf( new Complex64( 0.0, 0.0 ) ); - t.strictEqual( isPositiveZerof( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isPositiveZerof( imag( v ) ), true, 'returns expected value' ); - - v = cidentityf( new Complex64( -0.0, 0.0 ) ); - t.strictEqual( isNegativeZerof( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isPositiveZerof( imag( v ) ), true, 'returns expected value' ); - - v = cidentityf( new Complex64( 0.0, -0.0 ) ); - t.strictEqual( isPositiveZerof( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isNegativeZerof( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function evaluates the identity function when provided +-infinity', opts, function test( t ) { - var v; - - v = cidentityf( new Complex64( PINF, PINF ) ); - t.strictEqual( real( v ), PINF, 'returns expected value' ); - t.strictEqual( imag( v ), PINF, 'returns expected value' ); - - v = cidentityf( new Complex64( NINF, NINF ) ); - t.strictEqual( real( v ), NINF, 'returns expected value' ); - t.strictEqual( imag( v ), NINF, 'returns expected value' ); - - v = cidentityf( new Complex64( NINF, PINF ) ); - t.strictEqual( real( v ), NINF, 'returns expected value' ); - t.strictEqual( imag( v ), PINF, 'returns expected value' ); - - v = cidentityf( new Complex64( PINF, NINF ) ); - t.strictEqual( real( v ), PINF, 'returns expected value' ); - t.strictEqual( imag( v ), NINF, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function evaluates the identity function when provided `NaN`', opts, function test( t ) { - var v; - - v = cidentityf( new Complex64( NaN, NaN ) ); - t.strictEqual( isnanf( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imag( v ) ), true, 'returns expected value' ); - - v = cidentityf( new Complex64( 1.0, NaN ) ); - t.strictEqual( real( v ), 1.0, 'returns expected value' ); - t.strictEqual( isnanf( imag( v ) ), true, 'returns expected value' ); - - v = cidentityf( new Complex64( NaN, 1.0 ) ); - t.strictEqual( isnanf( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 1.0, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/lib/index.js b/float32/base/lib/index.js deleted file mode 100644 index 8464816d..00000000 --- a/float32/base/lib/index.js +++ /dev/null @@ -1,105 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/* -* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name. -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); - - -// MAIN // - -/** -* Top-level namespace. -* -* @namespace ns -*/ -var ns = {}; - -/** -* @name add -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float32/base/add} -*/ -setReadOnly( ns, 'add', require( './../../../float32/base/add' ) ); - -/** -* @name assert -* @memberof ns -* @readonly -* @type {Namespace} -* @see {@link module:@stdlib/complex/float32/base/assert} -*/ -setReadOnly( ns, 'assert', require( './../../../float32/base/assert' ) ); - -/** -* @name identity -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float32/base/identity} -*/ -setReadOnly( ns, 'identity', require( './../../../float32/base/identity' ) ); - -/** -* @name mul -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float32/base/mul} -*/ -setReadOnly( ns, 'mul', require( './../../../float32/base/mul' ) ); - -/** -* @name neg -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float32/base/neg} -*/ -setReadOnly( ns, 'neg', require( './../../../float32/base/neg' ) ); - -/** -* @name scale -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float32/base/scale} -*/ -setReadOnly( ns, 'scale', require( './../../../float32/base/scale' ) ); - -/** -* @name sub -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float32/base/sub} -*/ -setReadOnly( ns, 'sub', require( './../../../float32/base/sub' ) ); - - -// EXPORTS // - -module.exports = ns; diff --git a/float32/base/mul-add/README.md b/float32/base/mul-add/README.md deleted file mode 100644 index 3b9a5542..00000000 --- a/float32/base/mul-add/README.md +++ /dev/null @@ -1,286 +0,0 @@ - - -# muladd - -> Perform a multiply-add operation involving three single-precision complex floating-point numbers. - -
- -
- - - -
- -## Usage - -```javascript -var muladd = require( '@stdlib/complex/float32/base/mul-add' ); -``` - -#### muladd( alpha, x, y ) - -Performs a multiply-add operation involving three single-precision complex floating-point numbers. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( -2.0, 1.0 ); -var z3 = new Complex64( 7.0, -8.0 ); - -// Compute `alpha*x + y`: -var v = muladd( z1, z2, z3 ); -// returns [ -6.0, -9.0 ] -``` - -The function supports the following parameters: - -- **alpha**: first [complex number][@stdlib/complex/float32/ctor] -- **x**: second [complex number][@stdlib/complex/float32/ctor]. -- **y**: third [complex number][@stdlib/complex/float32/ctor]. - -#### muladd.assign( ar, ai, xr, xi, yr, yi, out, strideOut, offsetOut ) - -Performs a multiply-add operation involving three single-precision complex floating-point numbers and assigns the results to an output strided array. - -```javascript -var Float32Array = require( '@stdlib/array/float32' ); - -var out = new Float32Array( 2 ); -var v = muladd.assign( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, out, 1, 0 ); -// returns [ -6.0, -9.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **ar**: real component of the first complex number. -- **ai**: imaginary component of the first complex number. -- **xr**: real component of the second complex number. -- **xi**: imaginary component of the second complex number. -- **yr**: real component of the third complex number. -- **yi**: imaginary component of the third complex number. -- **out**: output array. -- **strideOut**: stride length for `out`. -- **offsetOut**: starting index for `out`. - -#### muladd.strided( alpha, sa, oa, x, sx, ox, y, sy, oy, out, so, oo ) - -Performs a multiply-add operation involving three single-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. - -```javascript -var Float32Array = require( '@stdlib/array/float32' ); - -var z1 = new Float32Array( [ 5.0, 3.0 ] ); -var z2 = new Float32Array( [ -2.0, 1.0 ] ); -var z3 = new Float32Array( [ 7.0, -8.0 ] ); -var out = new Float32Array( 2 ); - -var v = muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); -// returns [ -6.0, -9.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **alpha**: first complex number strided array view. -- **sa**: stride length for `alpha`. -- **oa**: starting index for `alpha`. -- **x**: second complex number strided array view. -- **sx**: stride length for `x`. -- **ox**: starting index for `x`. -- **y**: third complex number strided array view. -- **sy**: stride length for `y`. -- **oy**: starting index for `y`. -- **out**: output array. -- **so**: stride length for `out`. -- **oo**: starting index for `out`. - -
- - - -
- -## Examples - - - -```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var muladd = require( '@stdlib/complex/float32/base/mul-add' ); - -// Generate arrays of random values: -var z1 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); -var z3 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise computation: -logEachMap( '( (%s) * (%s) ) + (%s) = %s', z1, z2, z3, muladd ); -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float32/base/mul_add.h" -``` - -#### stdlib_base_complex64_muladd( alpha, x, y ) - -Performs a multiply-add operation involving three single-precision complex floating-point numbers. - -```c -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/real.h" -#include "stdlib/complex/float32/imag.h" - -stdlib_complex64_t z1 = sstdlib_complex64( 5.0f, 3.0f ); -stdlib_complex64_t z2 = sstdlib_complex64( -2.0f, 1.0f ); -stdlib_complex64_t z3 = sstdlib_complex64( 7.0f, -8.0f ); - -stdlib_complex64_t out = stdlib_base_complex64_muladd( z1, z2, z3 ); - -float re = stdlib_complex64_real( out ); -// returns -6.0f - -float im = stdlib_complex64_imag( out ); -// returns -9.0f -``` - -The function accepts the following arguments: - -- **alpha**: `[in] stdlib_complex64_t` input value. -- **z1**: `[in] stdlib_complex64_t` input value. -- **z2**: `[in] stdlib_complex64_t` input value. - -```c -stdlib_complex64_t stdlib_base_complex64_muladd( const stdlib_complex64_t alpha, const stdlib_complex64_t x, const stdlib_complex64_t y ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float32/base/mul_add.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 3.14f, 1.5f ), - stdlib_complex64( -3.14f, 1.5f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - stdlib_complex64_t v; - stdlib_complex64_t y; - float re; - float im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex64_reim( v, &re, &im ); - printf( "z = %f + %fi\n", re, im ); - - y = stdlib_base_complex64_muladd( v, v, v ); - stdlib_complex64_reim( y, &re, &im ); - printf( "z*z + z = %f + %fi\n", re, im ); - } -} -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/float32/base/mul-add/benchmark/benchmark.assign.js b/float32/base/mul-add/benchmark/benchmark.assign.js deleted file mode 100644 index c6d175ec..00000000 --- a/float32/base/mul-add/benchmark/benchmark.assign.js +++ /dev/null @@ -1,70 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Float32Array = require( '@stdlib/array/float32' ); -var pkg = require( './../package.json' ).name; -var muladd = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float32' -}; - - -// MAIN // - -bench( pkg+':assign', function benchmark( b ) { - var out; - var re; - var im; - var N; - var i; - var j; - var k; - - N = 100; - re = uniform( N, -500.0, 500.0, options ); - im = uniform( N, -500.0, 500.0, options ); - - out = new Float32Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = i % N; - k = ( i+1 ) % N; - out = muladd.assign( re[ j ], im[ j ], re[ k ], im[ k ], re[ k ], im[ k ], out, 1, 0 ); // eslint-disable-line max-len - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( out[ 0 ] ) || isnanf( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/mul-add/benchmark/benchmark.js b/float32/base/mul-add/benchmark/benchmark.js deleted file mode 100644 index 2e0327bc..00000000 --- a/float32/base/mul-add/benchmark/benchmark.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var pkg = require( './../package.json' ).name; -var muladd = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = muladd( z, z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( out ) ) || isnanf( imagf( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/mul-add/benchmark/benchmark.native.js b/float32/base/mul-add/benchmark/benchmark.native.js deleted file mode 100644 index afc5d8fa..00000000 --- a/float32/base/mul-add/benchmark/benchmark.native.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); -var pkg = require( './../package.json' ).name; - - -// VARIABLES // - -var muladd = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( muladd instanceof Error ) -}; - - -// MAIN // - -bench( pkg+'::native', opts, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = muladd( z, z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( out ) ) || isnanf( imagf( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/mul-add/benchmark/benchmark.strided.js b/float32/base/mul-add/benchmark/benchmark.strided.js deleted file mode 100644 index 540e645d..00000000 --- a/float32/base/mul-add/benchmark/benchmark.strided.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Float32Array = require( '@stdlib/array/float32' ); -var pkg = require( './../package.json' ).name; -var muladd = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float32' -}; - - -// MAIN // - -bench( pkg+':strided', function benchmark( b ) { - var out; - var z1; - var z2; - var N; - var i; - var j; - - N = 50; - z1 = uniform( N*2, -500.0, 500.0, options ); - z2 = uniform( N*2, -500.0, 500.0, options ); - - out = new Float32Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = ( i % N ) * 2; - out = muladd.strided( z1, 1, j, z2, 1, j, z2, 1, j, out, 1, 0 ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( out[ 0 ] ) || isnanf( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/mul-add/benchmark/c/Makefile b/float32/base/mul-add/benchmark/c/Makefile deleted file mode 100644 index 85a01e54..00000000 --- a/float32/base/mul-add/benchmark/c/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/mul-add/benchmark/c/benchmark.c b/float32/base/mul-add/benchmark/c/benchmark.c deleted file mode 100644 index 34ddd875..00000000 --- a/float32/base/mul-add/benchmark/c/benchmark.c +++ /dev/null @@ -1,151 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include -#include -#include -#include - -#define NAME "cmuladd" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - float complex z1[ 100 ]; - float complex z2[ 100 ]; - float complex z3[ 100 ]; - float complex z4; - double elapsed; - float re; - float im; - double t; - int i; - - for ( i = 0; i < 100; i++ ) { - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z1[ i ] = re + im*I; - - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z2[ i ] = re + im*I; - - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z3[ i ] = re + im*I; - } - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( crealf(z1[i%100])*crealf(z2[i%100]) ) - ( cimagf(z1[i%100])*cimagf(z2[i%100]) ) + crealf(z3[i%100]); - im = ( crealf(z1[i%100])*cimagf(z2[i%100]) ) + ( cimagf(z1[i%100])*crealf(z2[i%100]) ) + cimagf(z3[i%100]); - z4 = re + im*I; - if ( z4 != z4 ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( z4 != z4 ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/base/mul-add/benchmark/c/native/Makefile b/float32/base/mul-add/benchmark/c/native/Makefile deleted file mode 100644 index a4bd7b38..00000000 --- a/float32/base/mul-add/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/mul-add/benchmark/c/native/benchmark.c b/float32/base/mul-add/benchmark/c/native/benchmark.c deleted file mode 100644 index 67347679..00000000 --- a/float32/base/mul-add/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,153 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/mul_add.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include -#include -#include -#include -#include - -#define NAME "muladd" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - stdlib_complex64_t z1[ 100 ]; - stdlib_complex64_t z2[ 100 ]; - stdlib_complex64_t z3[ 100 ]; - stdlib_complex64_t z4; - double elapsed; - float re; - float im; - double t; - int i; - - for ( i = 0; i < 100; i++ ) { - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z1[ i ] = stdlib_complex64( re, im ); - - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z2[ i ] = stdlib_complex64( re, im ); - - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z3[ i ] = stdlib_complex64( re, im ); - } - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - z4 = stdlib_base_complex64_muladd( z1[ i%100 ], z2[ i%100 ], z3[ i%100 ] ); - stdlib_complex64_reim( z4, &re, &im ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/base/mul-add/benchmark/julia/REQUIRE b/float32/base/mul-add/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float32/base/mul-add/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float32/base/mul-add/benchmark/julia/benchmark.jl b/float32/base/mul-add/benchmark/julia/benchmark.jl deleted file mode 100644 index 51cb4fb7..00000000 --- a/float32/base/mul-add/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "muladd"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark ( ComplexF32( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) * ComplexF32( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) ) + ComplexF32( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float32/base/mul-add/binding.gyp b/float32/base/mul-add/binding.gyp deleted file mode 100644 index 68a1ca11..00000000 --- a/float32/base/mul-add/binding.gyp +++ /dev/null @@ -1,170 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A `.gyp` file for building a Node.js native add-on. -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # List of files to include in this file: - 'includes': [ - './include.gypi', - ], - - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Target name should match the add-on export name: - 'addon_target_name%': 'addon', - - # Set variables based on the host OS: - 'conditions': [ - [ - 'OS=="win"', - { - # Define the object file suffix: - 'obj': 'obj', - }, - { - # Define the object file suffix: - 'obj': 'o', - } - ], # end condition (OS=="win") - ], # end conditions - }, # end variables - - # Define compile targets: - 'targets': [ - - # Target to generate an add-on: - { - # The target name should match the add-on export name: - 'target_name': '<(addon_target_name)', - - # Define dependencies: - 'dependencies': [], - - # Define directories which contain relevant include headers: - 'include_dirs': [ - # Local include directory: - '<@(include_dirs)', - ], - - # List of source files: - 'sources': [ - '<@(src_files)', - ], - - # Settings which should be applied when a target's object files are used as linker input: - 'link_settings': { - # Define libraries: - 'libraries': [ - '<@(libraries)', - ], - - # Define library directories: - 'library_dirs': [ - '<@(library_dirs)', - ], - }, - - # C/C++ compiler flags: - 'cflags': [ - # Enable commonly used warning options: - '-Wall', - - # Aggressive optimization: - '-O3', - ], - - # C specific compiler flags: - 'cflags_c': [ - # Specify the C standard to which a program is expected to conform: - '-std=c99', - ], - - # C++ specific compiler flags: - 'cflags_cpp': [ - # Specify the C++ standard to which a program is expected to conform: - '-std=c++11', - ], - - # Linker flags: - 'ldflags': [], - - # Apply conditions based on the host OS: - 'conditions': [ - [ - 'OS=="mac"', - { - # Linker flags: - 'ldflags': [ - '-undefined dynamic_lookup', - '-Wl,-no-pie', - '-Wl,-search_paths_first', - ], - }, - ], # end condition (OS=="mac") - [ - 'OS!="win"', - { - # C/C++ flags: - 'cflags': [ - # Generate platform-independent code: - '-fPIC', - ], - }, - ], # end condition (OS!="win") - ], # end conditions - }, # end target <(addon_target_name) - - # Target to copy a generated add-on to a standard location: - { - 'target_name': 'copy_addon', - - # Declare that the output of this target is not linked: - 'type': 'none', - - # Define dependencies: - 'dependencies': [ - # Require that the add-on be generated before building this target: - '<(addon_target_name)', - ], - - # Define a list of actions: - 'actions': [ - { - 'action_name': 'copy_addon', - 'message': 'Copying addon...', - - # Explicitly list the inputs in the command-line invocation below: - 'inputs': [], - - # Declare the expected outputs: - 'outputs': [ - '<(addon_output_dir)/<(addon_target_name).node', - ], - - # Define the command-line invocation: - 'action': [ - 'cp', - '<(PRODUCT_DIR)/<(addon_target_name).node', - '<(addon_output_dir)/<(addon_target_name).node', - ], - }, - ], # end actions - }, # end target copy_addon - ], # end targets -} diff --git a/float32/base/mul-add/docs/repl.txt b/float32/base/mul-add/docs/repl.txt deleted file mode 100644 index 1baa43b9..00000000 --- a/float32/base/mul-add/docs/repl.txt +++ /dev/null @@ -1,141 +0,0 @@ - -{{alias}}( alpha, x, y ) - Performs a multiply-add operation involving three single-precision complex - floating-point numbers. - - Parameters - ---------- - alpha: Complex64 - Complex number. - - x: Complex64 - Complex number. - - y: Complex64 - Complex number. - - Returns - ------- - out: Complex64 - Result. - - Examples - -------- - > var z1 = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ) - - > var z2 = new {{alias:@stdlib/complex/float32/ctor}}( -2.0, 1.0 ) - - > var z3 = new {{alias:@stdlib/complex/float32/ctor}}( 7.0, -8.0 ) - - > var out = {{alias}}( z1, z2, z3 ) - - > var re = {{alias:@stdlib/complex/float32/real}}( out ) - -6.0 - > var im = {{alias:@stdlib/complex/float32/imag}}( out ) - -9.0 - - -{{alias}}.assign( ar, ai, xr, xi, yr, yi, out, strideOut, offsetOut ) - Performs a multiply-add operation involving three single-precision complex - floating-point numbers and assigns the results to an output strided array. - - Parameters - ---------- - ar: number - Real component of the first complex number. - - ai: number - Imaginary component of the first complex number. - - xr: number - Real component of the second complex number. - - xi: number - Imaginary component of the second complex number. - - yr: number - Real component of the third complex number. - - yi: number - Imaginary component of the third complex number. - - out: ArrayLikeObject - Output array. - - strideOut: integer - Stride length. - - offsetOut: integer - Starting index. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var out = new {{alias:@stdlib/array/float32}}( 2 ); - > {{alias}}.assign( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, out, 1, 0 ) - [ -6.0, -9.0 ] - - -{{alias}}.strided( a, sa, oa, x, sx, ox, y, sy, oy, out, so, oo ) - Performs a multiply-add operation involving three single-precision complex - floating-point numbers stored in real-valued strided array views and assigns - results to a provided strided output array. - - Parameters - ---------- - a: ArrayLikeObject - First complex number view. - - sa: integer - Stride length for `a`. - - oa: integer - Starting index for `a`. - - x: ArrayLikeObject - Second complex number view. - - sx: integer - Stride length for `x`. - - ox: integer - Starting index for `x`. - - y: ArrayLikeObject - Third complex number view. - - sy: integer - Stride length for `y`. - - oy: integer - Starting index for `y`. - - out: ArrayLikeObject - Output array. - - so: integer - Stride length for `out`. - - oo: integer - Starting index for `out`. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var z1 = new {{alias:@stdlib/array/float32}}( [ 5.0, 3.0 ] ); - > var z2 = new {{alias:@stdlib/array/float32}}( [ -2.0, 1.0 ] ); - > var z3 = new {{alias:@stdlib/array/float32}}( [ 7.0, -8.0 ] ); - > var out = new {{alias:@stdlib/array/float32}}( 2 ); - > {{alias}}.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ) - [ -6.0, -9.0 ] - - See Also - -------- diff --git a/float32/base/mul-add/docs/types/index.d.ts b/float32/base/mul-add/docs/types/index.d.ts deleted file mode 100644 index 3f58f06d..00000000 --- a/float32/base/mul-add/docs/types/index.d.ts +++ /dev/null @@ -1,151 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex64 } from '@stdlib/types/complex'; -import { Collection, NumericArray } from '@stdlib/types/array'; - -/** -* Input array. -*/ -type InputArray = NumericArray | Collection; - -/** -* Output array. -*/ -type OutputArray = NumericArray | Collection; - -/** -* Interface for performing a multiply-add operation involving three single-precision complex floating-point numbers. -*/ -interface MulAdd { - /** - * Performs a multiply-add operation involving three single-precision complex floating-point numbers. - * - * @param alpha - complex number - * @param x - complex number - * @param y - complex number - * @returns result - * - * @example - * var Complex64 = require( './../../../../../float32/ctor' ); - * - * var z1 = new Complex64( 5.0, 3.0 ); - * var z2 = new Complex64( -2.0, 1.0 ); - * var z3 = new Complex64( 7.0, -8.0 ); - * - * var out = muladd( z1, z2, z3 ); - * // returns [ -6.0, -9.0 ] - */ - ( alpha: Complex64, x: Complex64, y: Complex64 ): Complex64; - - /** - * Performs a multiply-add operation involving three single-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. - * - * @param ar - real component of the first complex number - * @param ai - imaginary component of the first complex number - * @param xr - real component of the second complex number - * @param xi - imaginary component of the second complex number - * @param yr - real component of the third complex number - * @param yi - imaginary component of the third complex number - * @param out - output array - * @param strideOut - stride length - * @param offsetOut - starting index - * @returns output array - * - * @example - * var Float32Array = require( '@stdlib/array/float32' ); - * - * var out = muladd.assign( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, new Float32Array( 2 ), 1, 0 ); - * // returns [ -6.0, -9.0 ] - */ - assign( ar: number, ai: number, xr: number, xi: number, yr: number, yi: number, out: T, strideOut: number, offsetOut: number ): T; - - /** - * Performs a multiply‐add operation involving three double‐precision complex floating‐point numbers stored in real‐valued strided array views and assigns the results to a provided strided output array. - * - * @param alpha - first complex number view - * @param strideA - stride length for `alpha` - * @param offsetA - starting index for `alpha` - * @param x - second complex number view - * @param strideX - stride length for `x` - * @param offsetX - starting index for `x` - * @param y - third complex number view - * @param strideY - stride length for `y` - * @param offsetY - starting index for `y` - * @param out - output array - * @param strideOut - stride length for `out` - * @param offsetOut - starting index for `out` - * @returns output array - * - * @example - * var Float32Array = require( '@stdlib/array/float32' ); - * - * var alpha = new Float32Array( [ 5.0, 3.0 ] ); - * var x = new Float32Array( [ -2.0, 1.0 ] ); - * var y = new Float32Array( [ 7.0, -8.0 ] ); - * - * var out = muladd.strided( alpha, 1, 0, x, 1, 0, y, 1, 0, new Float32Array( 2 ), 1, 0 ); - * // returns [ -6.0, -9.0 ] - */ - strided( alpha: T, strideA: number, offsetA: number, x: U, strideX: number, offsetX: number, y: V, strideY: number, offsetY: number, out: W, strideOut: number, offsetOut: number ): W; -} - -/** -* Performs a multiply-add operation involving three single-precision complex floating-point numbers. -* -* @param alpha - complex number -* @param x - complex number -* @param y - complex number -* @returns result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( -2.0, 1.0 ); -* var z3 = new Complex64( 7.0, -8.0 ); -* -* var out = muladd( z1, z2, z3 ); -* // returns [ -6.0, -9.0 ] -* -* @example -* var Float32Array = require( '@stdlib/array/float32' ); -* -* var out = muladd.assign( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, new Float32Array( 2 ), 1, 0 ); -* // returns [ -6.0, -9.0 ] -* -* @example -* var Float32Array = require( '@stdlib/array/float32' ); -* -* var alpha = new Float32Array( [ 5.0, 3.0 ] ); -* var x = new Float32Array( [ -2.0, 1.0 ] ); -* var y = new Float32Array( [ 7.0, -8.0 ] ); -* -* var out = muladd.strided( alpha, 1, 0, x, 1, 0, y, 1, 0, new Float32Array( 2 ), 1, 0 ); -* // returns [ -6.0, -9.0 ] -*/ -declare var muladd: MulAdd; - - -// EXPORTS // - -export = muladd; diff --git a/float32/base/mul-add/docs/types/test.ts b/float32/base/mul-add/docs/types/test.ts deleted file mode 100644 index 34eadf85..00000000 --- a/float32/base/mul-add/docs/types/test.ts +++ /dev/null @@ -1,465 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64 = require( './../../../../../float32/ctor' ); -import muladd = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - const z = new Complex64( 1.0, 1.0 ); - - muladd( z, z, z ); // $ExpectType Complex64 -} - -// The compiler throws an error if the function is provided a first argument which is not a complex number... -{ - const z = new Complex64( 1.0, 1.0 ); - - muladd( true, z, z ); // $ExpectError - muladd( false, z, z ); // $ExpectError - muladd( null, z, z ); // $ExpectError - muladd( undefined, z, z ); // $ExpectError - muladd( '5', z, z ); // $ExpectError - muladd( [], z, z ); // $ExpectError - muladd( {}, z, z ); // $ExpectError - muladd( ( x: number ): number => x, z, z ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument which is not a complex number... -{ - const z = new Complex64( 1.0, 1.0 ); - - muladd( z, true, z ); // $ExpectError - muladd( z, false, z ); // $ExpectError - muladd( z, null, z ); // $ExpectError - muladd( z, undefined, z ); // $ExpectError - muladd( z, '5', z ); // $ExpectError - muladd( z, [], z ); // $ExpectError - muladd( z, {}, z ); // $ExpectError - muladd( z, ( x: number ): number => x, z ); // $ExpectError -} - -// The compiler throws an error if the function is provided a third argument which is not a complex number... -{ - const z = new Complex64( 1.0, 1.0 ); - - muladd( z, z, true ); // $ExpectError - muladd( z, z, false ); // $ExpectError - muladd( z, z, null ); // $ExpectError - muladd( z, z, undefined ); // $ExpectError - muladd( z, z, '5' ); // $ExpectError - muladd( z, z, [] ); // $ExpectError - muladd( z, z, {} ); // $ExpectError - muladd( z, z, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z = new Complex64( 1.0, 1.0 ); - - muladd(); // $ExpectError - muladd( z ); // $ExpectError - muladd( z, z ); // $ExpectError - muladd( z, z, z, z ); // $ExpectError -} - -// Attached to the main export is an `assign` method which returns a collection... -{ - muladd.assign( 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - muladd.assign( 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `assign` method is provided a first argument which is not a number... -{ - const out = new Float32Array( 2 ); - - muladd.assign( true, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( false, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( null, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( undefined, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( '5', 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( [], 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( {}, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( ( x: number ): number => x, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a second argument which is not a number... -{ - const out = new Float32Array( 2 ); - - muladd.assign( 1.0, true, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, false, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, null, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, undefined, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, '5', 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, [], 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, {}, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, ( x: number ): number => x, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a third argument which is not a number... -{ - const out = new Float32Array( 2 ); - - muladd.assign( 1.0, 2.0, true, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, false, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, null, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, undefined, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, '5', 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, [], 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, {}, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, ( x: number ): number => x, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fourth argument which is not a number... -{ - const out = new Float32Array( 2 ); - - muladd.assign( 1.0, 2.0, 3.0, true, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, false, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, null, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, undefined, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, '5', 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, [], 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, {}, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, ( x: number ): number => x, 5.0, 6.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fifth argument which is not a number... -{ - const out = new Float32Array( 2 ); - - muladd.assign( 1.0, 2.0, 3.0, 4.0, true, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, false, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, null, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, undefined, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, '5', 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, [], 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, {}, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, ( x: number ): number => x, 6.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a sixth argument which is not a number... -{ - const out = new Float32Array( 2 ); - - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, true, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, false, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, null, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, undefined, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, '5', out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, [], out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, {}, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a seventh argument which is not a collection... -{ - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 1, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, true, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, false, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, null, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, undefined, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, '5', 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, [ '5' ], 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, {}, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided an eighth argument which is not a number... -{ - const out = new Float32Array( 2 ); - - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, true, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, false, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, null, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, undefined, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, '5', 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, [], 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, {}, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a ninth argument which is not a number... -{ - const out = new Float32Array( 2 ); - - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, true ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, false ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, null ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, undefined ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, '5' ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, [] ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, {} ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided an unsupported number of arguments... -{ - const out = new Float32Array( 2 ); - - muladd.assign(); // $ExpectError - muladd.assign( 1.0 ); // $ExpectError - muladd.assign( 1.0, 2.0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0, {} ); // $ExpectError -} - -// Attached to the main export is a `strided` method which returns a collection... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const z3 = new Float32Array( z2.length ); - - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `strided` method is provided a first argument which is not a collection... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const z3 = new Float32Array( z2.length ); - const out = new Float32Array( z2.length ); - - muladd.strided( true, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( false, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( null, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( undefined, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( '5', 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( [ '5' ], 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( {}, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( ( x: number ): number => x, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a second argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const z3 = new Float32Array( z2.length ); - const out = new Float32Array( z2.length ); - - muladd.strided( z1, true, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, false, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, null, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, undefined, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, '5', 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, [], 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, {}, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, ( x: number ): number => x, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a third argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const z3 = new Float32Array( z2.length ); - const out = new Float32Array( z2.length ); - - muladd.strided( z1, 1, true, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, false, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, null, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, undefined, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, '5', z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, [], z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, {}, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, ( x: number ): number => x, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fourth argument which is not a collection... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const z3 = new Float32Array( z2.length ); - const out = new Float32Array( z2.length ); - - muladd.strided( z1, 1, 0, true, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, false, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, null, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, undefined, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, '5', 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, [ '5' ], 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, {}, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, ( x: number ): number => x, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fifth argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const z3 = new Float32Array( z2.length ); - const out = new Float32Array( z2.length ); - - muladd.strided( z1, 1, 0, z2, true, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, false, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, null, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, undefined, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, '5', 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, [], 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, {}, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, ( x: number ): number => x, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a sixth argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const z3 = new Float32Array( z2.length ); - const out = new Float32Array( z2.length ); - - muladd.strided( z1, 1, 0, z2, 1, true, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, false, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, null, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, undefined, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, '5', z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, [], z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, {}, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, ( x: number ): number => x, z3, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a seventh argument which is not a collection... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const z3 = new Float32Array( z2.length ); - const out = new Float32Array( z3.length ); - - muladd.strided( z1, 1, 0, z2, 1, 0, true, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, false, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, null, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, undefined, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, '5', 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, [ '5' ], 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, {}, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, ( x: number ): number => x, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an eighth argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const z3 = new Float32Array( z2.length ); - const out = new Float32Array( z2.length ); - - muladd.strided( z1, 1, 0, z2, 1, 0, z3, true, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, false, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, null, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, undefined, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, '5', 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, [], 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, {}, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, ( x: number ): number => x, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a ninth argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const z3 = new Float32Array( z2.length ); - const out = new Float32Array( z2.length ); - - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, true, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, false, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, null, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, undefined, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, '5', out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, [], out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, {}, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a tenth argument which is not a collection... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const z3 = new Float32Array( z2.length ); - - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, 1, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, true, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, false, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, null, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, undefined, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, '5', 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, [ '5' ], 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, {}, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an eleventh argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const z3 = new Float32Array( z2.length ); - const out = new Float32Array( z2.length ); - - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, true, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, false, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, null, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, undefined, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, '5', 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, [], 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, {}, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a twelfth argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const z3 = new Float32Array( z2.length ); - const out = new Float32Array( z2.length ); - - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, true ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, false ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, null ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, undefined ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, '5' ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, [] ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, {} ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an unsupported number of arguments... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const z3 = new Float32Array( z2.length ); - const out = new Float32Array( z2.length ); - - muladd.strided(); // $ExpectError - muladd.strided( z1 ); // $ExpectError - muladd.strided( z1, 1 ); // $ExpectError - muladd.strided( z1, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0, {} ); // $ExpectError -} diff --git a/float32/base/mul-add/examples/c/Makefile b/float32/base/mul-add/examples/c/Makefile deleted file mode 100644 index 25ced822..00000000 --- a/float32/base/mul-add/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/mul-add/examples/c/example.c b/float32/base/mul-add/examples/c/example.c deleted file mode 100644 index 811a7ee5..00000000 --- a/float32/base/mul-add/examples/c/example.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/mul_add.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 3.14f, 1.5f ), - stdlib_complex64( -3.14f, 1.5f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - stdlib_complex64_t v; - stdlib_complex64_t y; - float re; - float im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex64_reim( v, &re, &im ); - printf( "z = %f + %fi\n", re, im ); - - y = stdlib_base_complex64_muladd( v, v, v ); - stdlib_complex64_reim( y, &re, &im ); - printf( "z*z + z = %f + %fi\n", re, im ); - } -} diff --git a/float32/base/mul-add/examples/index.js b/float32/base/mul-add/examples/index.js deleted file mode 100644 index 30473789..00000000 --- a/float32/base/mul-add/examples/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64Array = require( '@stdlib/array/complex64' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var muladd = require( './../lib' ); - -// Generate arrays of random values: -var z1 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); -var z3 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise computation: -logEachMap( '( (%s) * (%s) ) + (%s) = %s', z1, z2, z3, muladd ); diff --git a/float32/base/mul-add/include.gypi b/float32/base/mul-add/include.gypi deleted file mode 100644 index ecfaf82a..00000000 --- a/float32/base/mul-add/include.gypi +++ /dev/null @@ -1,53 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A GYP include file for building a Node.js native add-on. -# -# Main documentation: -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Source directory: - 'src_dir': './src', - - # Include directories: - 'include_dirs': [ - '[ -6.0, -9.0 ] -*/ -function assign( ar, ai, xr, xi, yr, yi, out, strideOut, offsetOut ) { - out[ offsetOut ] = f32( f32( f32(ar*xr) - f32(ai*xi) ) + yr ); - out[ offsetOut+strideOut ] = f32( f32( f32(ar*xi) + f32(ai*xr) ) + yi ); - return out; -} - - -// EXPORTS // - -module.exports = assign; diff --git a/float32/base/mul-add/lib/index.js b/float32/base/mul-add/lib/index.js deleted file mode 100644 index a14c91b0..00000000 --- a/float32/base/mul-add/lib/index.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Perform a multiply-add operation involving three single-precision complex floating-point numbers. -* -* @module @stdlib/complex/float32/base/mul-add -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var muladd = require( '@stdlib/complex/float32/base/mul-add' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( -2.0, 1.0 ); -* var z3 = new Complex64( 7.0, -8.0 ); -* -* var out = muladd( z1, z2, z3 ); -* // returns [ -6.0, -9.0 ] -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var main = require( './main.js' ); -var assign = require( './assign.js' ); -var strided = require( './strided.js' ); - - -// MAIN // - -setReadOnly( main, 'assign', assign ); -setReadOnly( main, 'strided', strided ); - - -// EXPORTS // - -module.exports = main; - -// exports: { "assign": "main.assign", "strided": "main.strided" } diff --git a/float32/base/mul-add/lib/main.js b/float32/base/mul-add/lib/main.js deleted file mode 100644 index 62212057..00000000 --- a/float32/base/mul-add/lib/main.js +++ /dev/null @@ -1,64 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var f32 = require( '@stdlib/number/float64/base/to-float32' ); - - -// MAIN // - -/** -* Performs a multiply-add operation involving three single-precision complex floating-point numbers. -* -* @param {Complex64} alpha - complex number -* @param {Complex64} x - complex number -* @param {Complex64} y - complex number -* @returns {Complex64} result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( -2.0, 1.0 ); -* var z3 = new Complex64( 7.0, -8.0 ); -* -* var out = muladd( z1, z2, z3 ); -* // returns [ -6.0, -9.0 ] -*/ -function muladd( alpha, x, y ) { - var re0 = realf( alpha ); - var im0 = imagf( alpha ); - var re1 = realf( x ); - var im1 = imagf( x ); - var re2 = realf( y ); - var im2 = imagf( y ); - var re = f32( f32( f32(re0*re1) - f32(im0*im1) ) + re2 ); - var im = f32( f32( f32(re0*im1) + f32(im0*re1) ) + im2 ); - return new Complex64( re, im ); -} - - -// EXPORTS // - -module.exports = muladd; diff --git a/float32/base/mul-add/lib/native.js b/float32/base/mul-add/lib/native.js deleted file mode 100644 index a0d2ff49..00000000 --- a/float32/base/mul-add/lib/native.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex64 = require( './../../../../float32/ctor' ); -var addon = require( './../src/addon.node' ); - - -// MAIN // - -/** -* Performs a multiply-add operation involving three single-precision complex floating-point numbers. -* -* @private -* @param {Complex64} alpha - complex number -* @param {Complex64} x - complex number -* @param {Complex64} y - complex number -* @returns {Complex64} result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( -2.0, 1.0 ); -* var z3 = new Complex64( 7.0, -8.0 ); -* -* var out = muladd( z1, z2, z3 ); -* // returns [ -6.0, -9.0 ] -*/ -function muladd( alpha, x, y ) { - var v = addon( alpha, x, y ); - return new Complex64( v.re, v.im ); -} - - -// EXPORTS // - -module.exports = muladd; diff --git a/float32/base/mul-add/lib/strided.js b/float32/base/mul-add/lib/strided.js deleted file mode 100644 index 2f3b15d1..00000000 --- a/float32/base/mul-add/lib/strided.js +++ /dev/null @@ -1,70 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var f32 = require( '@stdlib/number/float64/base/to-float32' ); - - -// MAIN // - -/** -* Performs a multiply-add operation involving three single-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. -* -* @param {Float32Array} alpha - first complex number view -* @param {integer} strideA - stride length for `alpha` -* @param {NonNegativeInteger} offsetA - starting index for `alpha` -* @param {Float32Array} x - second complex number view -* @param {integer} strideX - stride length for `x` -* @param {NonNegativeInteger} offsetX - starting index for `x` -* @param {Float32Array} y - third complex number view -* @param {integer} strideY - stride length for `y` -* @param {NonNegativeInteger} offsetY - starting index for `y` -* @param {Collection} out - output array -* @param {integer} strideOut - stride length for `out` -* @param {NonNegativeInteger} offsetOut - starting index for `out` -* @returns {Collection} output array -* -* @example -* var Float32Array = require( '@stdlib/array/float32' ); -* -* var alpha = new Float32Array( [ 5.0, 3.0 ] ); -* var x = new Float32Array( [ -2.0, 1.0 ] ); -* var y = new Float32Array( [ 7.0, -8.0 ] ); -* -* var out = strided( alpha, 1, 0, x, 1, 0, y, 1, 0, new Float32Array( 2 ), 1, 0 ); -* // returns [ -6.0, -9.0 ] -*/ -function strided( alpha, strideA, offsetA, x, strideX, offsetX, y, strideY, offsetY, out, strideOut, offsetOut ) { // eslint-disable-line max-len, max-params - var re0 = alpha[ offsetA ]; - var im0 = alpha[ offsetA+strideA ]; - var re1 = x[ offsetX ]; - var im1 = x[ offsetX+strideX ]; - var re2 = y[ offsetY ]; - var im2 = y[ offsetY+strideY ]; - out[ offsetOut ] = f32( f32( f32(re0*re1) - f32(im0*im1) ) + re2 ); - out[ offsetOut+strideOut ] = f32( f32( f32(re0*im1) + f32(im0*re1) ) + im2 ); // eslint-disable-line max-len - return out; -} - - -// EXPORTS // - -module.exports = strided; diff --git a/float32/base/mul-add/manifest.json b/float32/base/mul-add/manifest.json deleted file mode 100644 index 0f3ab02d..00000000 --- a/float32/base/mul-add/manifest.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/napi/ternary", - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - } - ] - } diff --git a/float32/base/mul-add/package.json b/float32/base/mul-add/package.json deleted file mode 100644 index 7ceb1d21..00000000 --- a/float32/base/mul-add/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "@stdlib/complex/float32/base/mul-add", - "version": "0.0.0", - "description": "Perform a multiply-add operation involving three single-precision complex floating-point numbers.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "mul", - "mult", - "multiply", - "multiplication", - "addition", - "add", - "arithmetic", - "complex", - "cmplx", - "number" - ] -} diff --git a/float32/base/mul-add/src/Makefile b/float32/base/mul-add/src/Makefile deleted file mode 100644 index 7733b618..00000000 --- a/float32/base/mul-add/src/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - - -# RULES # - -#/ -# Removes generated files for building an add-on. -# -# @example -# make clean-addon -#/ -clean-addon: - $(QUIET) -rm -f *.o *.node - -.PHONY: clean-addon - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: clean-addon - -.PHONY: clean diff --git a/float32/base/mul-add/src/addon.c b/float32/base/mul-add/src/addon.c deleted file mode 100644 index c7981ca6..00000000 --- a/float32/base/mul-add/src/addon.c +++ /dev/null @@ -1,22 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/mul_add.h" -#include "stdlib/math/base/napi/ternary.h" - -STDLIB_MATH_BASE_NAPI_MODULE_CCC_C( stdlib_base_complex64_muladd ) diff --git a/float32/base/mul-add/src/main.c b/float32/base/mul-add/src/main.c deleted file mode 100644 index cc235345..00000000 --- a/float32/base/mul-add/src/main.c +++ /dev/null @@ -1,66 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/mul_add.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" - -/** -* Performs a multiply-add operation involving three single-precision complex floating-point numbers. -* -* @param alpha input value -* @param x input value -* @param y input value -* @return result -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* #include "stdlib/complex/float32/real.h" -* #include "stdlib/complex/float32/imag.h" -* -* stdlib_complex64_t z1 = stdlib_complex64( 5.0f, 3.0f ); -* stdlib_complex64_t z2 = stdlib_complex64( -2.0f, 1.0f ); -* stdlib_complex64_t z3 = stdlib_complex64( 7.0f, -8.0f ); -* -* stdlib_complex64_t out = stdlib_base_complex64_muladd( z1, z2, z3 ); -* -* float re = stdlib_complex64_real( out ); -* // returns -6.0f -* -* float im = stdlib_complex64_imag( out ); -* // returns -9.0f -*/ -stdlib_complex64_t stdlib_base_complex64_muladd( const stdlib_complex64_t alpha, const stdlib_complex64_t x, const stdlib_complex64_t y ) { - float re1; - float re2; - float re3; - float im1; - float im2; - float im3; - float re; - float im; - - stdlib_complex64_reim( alpha, &re1, &im1 ); - stdlib_complex64_reim( x, &re2, &im2 ); - stdlib_complex64_reim( y, &re3, &im3 ); - - re = (re1*re2) - (im1*im2) + re3; - im = (re1*im2) + (im1*re2) + im3; - - return stdlib_complex64( re, im ); -} diff --git a/float32/base/mul-add/test/test.assign.js b/float32/base/mul-add/test/test.assign.js deleted file mode 100644 index cda4c59c..00000000 --- a/float32/base/mul-add/test/test.assign.js +++ /dev/null @@ -1,153 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); -var Float32Array = require( '@stdlib/array/float32' ); -var muladd = require( './../lib/assign.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof muladd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function performs a multiply-add operation', function test( t ) { - var expected; - var out; - var v; - - out = new Float32Array( 2 ); - v = muladd( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, out, 1, 0 ); - - expected = new Float32Array( [ -6.0, -9.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 4 ); - v = muladd( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, out, 2, 0 ); - - expected = new Float32Array( [ -6.0, 0.0, -9.0, 0.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 4 ); - v = muladd( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, out, 2, 1 ); - - expected = new Float32Array( [ 0.0, -6.0, 0.0, -9.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 4 ); - v = muladd( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, out, -2, 3 ); - - expected = new Float32Array( [ 0.0, -9.0, 0.0, -6.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the function propagates `NaN` values', function test( t ) { - var expected; - var out; - var v; - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = muladd( NaN, 3.0, -2.0, 1.0, 7.0, -8.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = muladd( 5.0, 3.0, NaN, 1.0, 7.0, -8.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = muladd( NaN, 3.0, NaN, 1.0, 7.0, -8.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = muladd( 5.0, NaN, -2.0, 1.0, 7.0, -8.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = muladd( 5.0, 3.0, -2.0, NaN, 7.0, -8.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = muladd( 5.0, NaN, -2.0, NaN, 7.0, -8.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = muladd( NaN, NaN, NaN, NaN, 7.0, -8.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, -9.0 ] ); - - v = muladd( 5.0, 3.0, -2.0, 1.0, NaN, -8.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ -6.0, NaN ] ); - - v = muladd( 5.0, 3.0, -2.0, 1.0, 7.0, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = muladd( NaN, NaN, NaN, NaN, NaN, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/mul-add/test/test.js b/float32/base/mul-add/test/test.js deleted file mode 100644 index 3925eb02..00000000 --- a/float32/base/mul-add/test/test.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isMethod = require( '@stdlib/assert/is-method' ); -var muladd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof muladd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'attached to the main export is an `assign` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( muladd, 'assign' ), true, 'returns expected value' ); - t.end(); -}); - -tape( 'attached to the main export is a `strided` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( muladd, 'strided' ), true, 'returns expected value' ); - t.end(); -}); diff --git a/float32/base/mul-add/test/test.main.js b/float32/base/mul-add/test/test.main.js deleted file mode 100644 index 2ed82bb5..00000000 --- a/float32/base/mul-add/test/test.main.js +++ /dev/null @@ -1,138 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var muladd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof muladd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function performs a multiply-add operation', function test( t ) { - var z1; - var z2; - var z3; - var v; - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - z3 = new Complex64( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - - t.strictEqual( realf( v ), -6.0, 'returns expected value' ); - t.strictEqual( imagf( v ), -9.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the function propagates `NaN` values', function test( t ) { - var z1; - var z2; - var z3; - var v; - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - z3 = new Complex64( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( NaN, 1.0 ); - z3 = new Complex64( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( NaN, 1.0 ); - z3 = new Complex64( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( -2.0, 1.0 ); - z3 = new Complex64( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, NaN ); - z3 = new Complex64( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( -2.0, NaN ); - z3 = new Complex64( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - z3 = new Complex64( NaN, -8.0 ); - - v = muladd( z1, z2, z3 ); - - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( imagf( v ), -9.0, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - z3 = new Complex64( 7.0, NaN ); - - v = muladd( z1, z2, z3 ); - - t.strictEqual( realf( v ), -6.0, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, NaN ); - z2 = new Complex64( NaN, NaN ); - z3 = new Complex64( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/mul-add/test/test.native.js b/float32/base/mul-add/test/test.native.js deleted file mode 100644 index 8e220700..00000000 --- a/float32/base/mul-add/test/test.native.js +++ /dev/null @@ -1,147 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var tape = require( 'tape' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var muladd = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( muladd instanceof Error ) -}; - - -// TESTS // - -tape( 'main export is a function', opts, function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof muladd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function performs a multiply-add operation', opts, function test( t ) { - var z1; - var z2; - var z3; - var v; - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - z3 = new Complex64( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - - t.strictEqual( realf( v ), -6.0, 'returns expected value' ); - t.strictEqual( imagf( v ), -9.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the function propagates `NaN` values', opts, function test( t ) { - var z1; - var z2; - var z3; - var v; - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - z3 = new Complex64( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( NaN, 1.0 ); - z3 = new Complex64( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( NaN, 1.0 ); - z3 = new Complex64( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( -2.0, 1.0 ); - z3 = new Complex64( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, NaN ); - z3 = new Complex64( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( -2.0, NaN ); - z3 = new Complex64( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - z3 = new Complex64( NaN, -8.0 ); - - v = muladd( z1, z2, z3 ); - - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( imagf( v ), -9.0, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - z3 = new Complex64( 7.0, NaN ); - - v = muladd( z1, z2, z3 ); - - t.strictEqual( realf( v ), -6.0, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, NaN ); - z2 = new Complex64( NaN, NaN ); - z3 = new Complex64( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/mul-add/test/test.strided.js b/float32/base/mul-add/test/test.strided.js deleted file mode 100644 index 54657c46..00000000 --- a/float32/base/mul-add/test/test.strided.js +++ /dev/null @@ -1,211 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); -var Float32Array = require( '@stdlib/array/float32' ); -var muladd = require( './../lib/strided.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof muladd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function performs a multiply-add operation', function test( t ) { - var expected; - var out; - var z1; - var z2; - var z3; - var v; - - z1 = new Float32Array( [ 5.0, 3.0 ] ); - z2 = new Float32Array( [ -2.0, 1.0 ] ); - z3 = new Float32Array( [ 7.0, -8.0 ] ); - out = new Float32Array( 2 ); - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - - expected = new Float32Array( [ -6.0, -9.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, 0.0, 3.0, 0.0 ] ); - z2 = new Float32Array( [ -2.0, 1.0 ] ); - z3 = new Float32Array( [ 7.0, -8.0 ] ); - out = new Float32Array( 4 ); - v = muladd( z1, 2, 0, z2, 1, 0, z3, 1, 0, out, 2, 0 ); - - expected = new Float32Array( [ -6.0, 0.0, -9.0, 0.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, 3.0 ] ); - z2 = new Float32Array( [ 0.0, -2.0, 0.0, 1.0 ] ); - z3 = new Float32Array( [ 7.0, -8.0 ] ); - out = new Float32Array( 4 ); - v = muladd( z1, 1, 0, z2, 2, 1, z3, 1, 0, out, 2, 1 ); - - expected = new Float32Array( [ 0.0, -6.0, 0.0, -9.0 ] ); - - z1 = new Float32Array( [ 5.0, 3.0 ] ); - z2 = new Float32Array( [ -2.0, 1.0 ] ); - z3 = new Float32Array( [ 0.0, 7.0, 0.0, -8.0 ] ); - out = new Float32Array( 2 ); - v = muladd( z1, 1, 0, z2, 1, 0, z3, 2, 1, out, 1, 0 ); - - expected = new Float32Array( [ -6.0, -9.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 3.0, 5.0 ] ); - z2 = new Float32Array( [ 1.0, -2.0 ] ); - z3 = new Float32Array( [ -8.0, 7.0 ] ); - out = new Float32Array( 4 ); - v = muladd( z1, -1, 1, z2, -1, 1, z3, -1, 1, out, -2, 3 ); - - expected = new Float32Array( [ 0.0, -9.0, 0.0, -6.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the function propagates `NaN` values', function test( t ) { - var expected; - var out; - var z1; - var z2; - var z3; - var v; - - z1 = new Float32Array( [ NaN, 3.0 ] ); - z2 = new Float32Array( [ -2.0, 1.0 ] ); - z3 = new Float32Array( [ 7.0, -8.0 ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, 3.0 ] ); - z2 = new Float32Array( [ NaN, 1.0 ] ); - z3 = new Float32Array( [ 7.0, -8.0 ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ NaN, 3.0 ] ); - z2 = new Float32Array( [ NaN, 1.0 ] ); - z3 = new Float32Array( [ 7.0, -8.0 ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, NaN ] ); - z2 = new Float32Array( [ -2.0, 1.0 ] ); - z3 = new Float32Array( [ 7.0, -8.0 ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, 3.0 ] ); - z2 = new Float32Array( [ -2.0, NaN ] ); - z3 = new Float32Array( [ 7.0, -8.0 ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, NaN ] ); - z2 = new Float32Array( [ -2.0, NaN ] ); - z3 = new Float32Array( [ 7.0, -8.0 ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ NaN, NaN ] ); - z2 = new Float32Array( [ NaN, NaN ] ); - z3 = new Float32Array( [ 7.0, -8.0 ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, 3.0 ] ); - z2 = new Float32Array( [ -2.0, 1.0 ] ); - z3 = new Float32Array( [ NaN, -8.0 ] ); - out = new Float32Array( 2 ); - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - - expected = new Float32Array( [ NaN, -9.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, 3.0 ] ); - z2 = new Float32Array( [ -2.0, 1.0 ] ); - z3 = new Float32Array( [ 7.0, NaN ] ); - out = new Float32Array( 2 ); - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - - expected = new Float32Array( [ -6.0, NaN ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ NaN, NaN ] ); - z2 = new Float32Array( [ NaN, NaN ] ); - z3 = new Float32Array( [ NaN, NaN ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/mul/README.md b/float32/base/mul/README.md deleted file mode 100644 index e1848acc..00000000 --- a/float32/base/mul/README.md +++ /dev/null @@ -1,281 +0,0 @@ - - -# mul - -> Multiply two single-precision complex floating-point numbers. - -
- -
- - - -
- -## Usage - -```javascript -var mul = require( '@stdlib/complex/float32/base/mul' ); -``` - -#### mul( z1, z2 ) - -Multiplies two single-precision complex floating-point numbers. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( -2.0, 1.0 ); - -var v = mul( z1, z2 ); -// returns [ -13.0, -1.0 ] -``` - -#### mul.assign( re1, im1, re2, im2, out, strideOut, offsetOut ) - -Multiplies two single-precision complex floating-point numbers and assigns results to a provided output array. - -```javascript -var Float32Array = require( '@stdlib/array/float32' ); - -var out = new Float32Array( 2 ); -var v = mul.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ); -// returns [ -13.0, -1.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **re1**: real component of the first complex number. -- **im1**: imaginary component of the first complex number. -- **re2**: real component of the second complex number. -- **im2**: imaginary component of the second complex number. -- **out**: output array. -- **strideOut**: stride length for `out`. -- **offsetOut**: starting index for `out`. - -#### mul.strided( z1, sz1, oz1, z2, sz2, oz2, out, so, oo ) - -Multiplies two single-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. - -```javascript -var Float32Array = require( '@stdlib/array/float32' ); - -var z1 = new Float32Array( [ 5.0, 3.0 ] ); -var z2 = new Float32Array( [ -2.0, 1.0 ] ); -var out = new Float32Array( 2 ); - -var v = mul.strided( z1, 1, 0, z2, 1, 0, out, 1, 0 ); -// returns [ -13.0, -1.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **z1**: first complex number strided array view. -- **sz1**: stride length for `z1`. -- **oz1**: starting index for `z1`. -- **z2**: second complex number strided array view. -- **sz2**: stride length for `z2`. -- **oz2**: starting index for `z2`. -- **out**: output array. -- **so**: stride length for `out`. -- **oo**: starting index for `out`. - -
- - - -
- -## Examples - - - -```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var mul = require( '@stdlib/complex/float32/base/mul' ); - -// Generate arrays of random values: -var z1 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise multiplication: -logEachMap( '(%s) * (%s) = %s', z1, z2, mul ); -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float32/base/mul.h" -``` - -#### stdlib_base_complex64_mul( z1, z2 ) - -Multiplies two single-precision complex floating-point numbers. - -```c -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/real.h" -#include "stdlib/complex/float32/imag.h" - -stdlib_complex64_t z1 = stdlib_complex64( 5.0f, 3.0f ); -stdlib_complex64_t z2 = stdlib_complex64( -2.0f, 1.0f ); - -stdlib_complex64_t out = stdlib_base_complex64_mul( z1, z2 ); - -float re = stdlib_complex64_real( out ); -// returns -13.0f - -float im = stdlib_complex64_imag( out ); -// returns -1.0f -``` - -The function accepts the following arguments: - -- **z1**: `[in] stdlib_complex64_t` input value. -- **z2**: `[in] stdlib_complex64_t` input value. - -```c -stdlib_complex64_t stdlib_base_complex64_mul( const stdlib_complex64_t z1, const stdlib_complex64_t z2 ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float32/base/mul.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 3.14f, 1.5f ), - stdlib_complex64( -3.14f, 1.5f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - stdlib_complex64_t v; - stdlib_complex64_t y; - float re; - float im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex64_reim( v, &re, &im ); - printf( "z = %f + %fi\n", re, im ); - - y = stdlib_base_complex64_mul( v, v ); - stdlib_complex64_reim( y, &re, &im ); - printf( "mul(z, z) = %f + %fi\n", re, im ); - } -} -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/float32/base/mul/benchmark/benchmark.assign.js b/float32/base/mul/benchmark/benchmark.assign.js deleted file mode 100644 index 3fdf5ef3..00000000 --- a/float32/base/mul/benchmark/benchmark.assign.js +++ /dev/null @@ -1,70 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Float32Array = require( '@stdlib/array/float32' ); -var pkg = require( './../package.json' ).name; -var mul = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float32' -}; - - -// MAIN // - -bench( pkg+':assign', function benchmark( b ) { - var out; - var re; - var im; - var N; - var i; - var j; - var k; - - N = 100; - re = uniform( N, -500.0, 500.0, options ); - im = uniform( N, -500.0, 500.0, options ); - - out = new Float32Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = i % N; - k = ( i+1 ) % N; - out = mul.assign( re[ j ], im[ j ], re[ k ], im[ k ], out, 1, 0 ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( out[ 0 ] ) || isnanf( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/mul/benchmark/benchmark.js b/float32/base/mul/benchmark/benchmark.js deleted file mode 100644 index 6f384d8b..00000000 --- a/float32/base/mul/benchmark/benchmark.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var real = require( './../../../../float32/real' ); -var imag = require( './../../../../float32/imag' ); -var pkg = require( './../package.json' ).name; -var mul = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = mul( z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( real( out ) ) || isnanf( imag( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/mul/benchmark/benchmark.native.js b/float32/base/mul/benchmark/benchmark.native.js deleted file mode 100644 index 2809bc86..00000000 --- a/float32/base/mul/benchmark/benchmark.native.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); -var pkg = require( './../package.json' ).name; - - -// VARIABLES // - -var mul = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( mul instanceof Error ) -}; - - -// MAIN // - -bench( pkg+'::native', opts, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = mul( z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( out ) ) || isnanf( imagf( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/mul/benchmark/benchmark.strided.js b/float32/base/mul/benchmark/benchmark.strided.js deleted file mode 100644 index 8e854649..00000000 --- a/float32/base/mul/benchmark/benchmark.strided.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Float32Array = require( '@stdlib/array/float32' ); -var pkg = require( './../package.json' ).name; -var mul = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float32' -}; - - -// MAIN // - -bench( pkg+':strided', function benchmark( b ) { - var out; - var z1; - var z2; - var N; - var i; - var j; - - N = 50; - z1 = uniform( N*2, -500.0, 500.0, options ); - z2 = uniform( N*2, -500.0, 500.0, options ); - - out = new Float32Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = ( i % N ) * 2; - out = mul.strided( z1, 1, j, z2, 1, j, out, 1, 0 ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( out[ 0 ] ) || isnanf( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/mul/benchmark/c/Makefile b/float32/base/mul/benchmark/c/Makefile deleted file mode 100644 index d7adc1ad..00000000 --- a/float32/base/mul/benchmark/c/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/mul/benchmark/c/benchmark.c b/float32/base/mul/benchmark/c/benchmark.c deleted file mode 100644 index f7d1f2f5..00000000 --- a/float32/base/mul/benchmark/c/benchmark.c +++ /dev/null @@ -1,145 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include -#include -#include -#include - -#define NAME "cmulf" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - float re; - float im; - double t; - int i; - - float complex z1; - float complex z2; - float complex z3; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z1 = re + im*I; - - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z2 = re + im*I; - - re = ( crealf(z1)*crealf(z2) ) - ( cimagf(z1)*cimagf(z2) ); - im = ( crealf(z1)*cimagf(z2) ) + ( cimagf(z1)*crealf(z2) ); - z3 = re + im*I; - if ( z3 != z3 ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( z3 != z3 ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/base/mul/benchmark/c/native/Makefile b/float32/base/mul/benchmark/c/native/Makefile deleted file mode 100644 index 7f6bbc4c..00000000 --- a/float32/base/mul/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/mul/benchmark/c/native/benchmark.c b/float32/base/mul/benchmark/c/native/benchmark.c deleted file mode 100644 index cfd52a8a..00000000 --- a/float32/base/mul/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,147 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/mul.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include -#include -#include -#include -#include - -#define NAME "mul" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - float re; - float im; - double t; - int i; - - stdlib_complex64_t z1; - stdlib_complex64_t z2; - stdlib_complex64_t z3; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z1 = stdlib_complex64( re, im ); - - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z2 = stdlib_complex64( re, im ); - - z3 = stdlib_base_complex64_mul( z1, z2 ); - stdlib_complex64_reim( z3, &re, &im ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/base/mul/benchmark/julia/REQUIRE b/float32/base/mul/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float32/base/mul/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float32/base/mul/benchmark/julia/benchmark.jl b/float32/base/mul/benchmark/julia/benchmark.jl deleted file mode 100644 index 60f30d91..00000000 --- a/float32/base/mul/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "mul"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark ComplexF32( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) * ComplexF32( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float32/base/mul/binding.gyp b/float32/base/mul/binding.gyp deleted file mode 100644 index 1058b57b..00000000 --- a/float32/base/mul/binding.gyp +++ /dev/null @@ -1,170 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2022 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A `.gyp` file for building a Node.js native add-on. -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # List of files to include in this file: - 'includes': [ - './include.gypi', - ], - - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Target name should match the add-on export name: - 'addon_target_name%': 'addon', - - # Set variables based on the host OS: - 'conditions': [ - [ - 'OS=="win"', - { - # Define the object file suffix: - 'obj': 'obj', - }, - { - # Define the object file suffix: - 'obj': 'o', - } - ], # end condition (OS=="win") - ], # end conditions - }, # end variables - - # Define compile targets: - 'targets': [ - - # Target to generate an add-on: - { - # The target name should match the add-on export name: - 'target_name': '<(addon_target_name)', - - # Define dependencies: - 'dependencies': [], - - # Define directories which contain relevant include headers: - 'include_dirs': [ - # Local include directory: - '<@(include_dirs)', - ], - - # List of source files: - 'sources': [ - '<@(src_files)', - ], - - # Settings which should be applied when a target's object files are used as linker input: - 'link_settings': { - # Define libraries: - 'libraries': [ - '<@(libraries)', - ], - - # Define library directories: - 'library_dirs': [ - '<@(library_dirs)', - ], - }, - - # C/C++ compiler flags: - 'cflags': [ - # Enable commonly used warning options: - '-Wall', - - # Aggressive optimization: - '-O3', - ], - - # C specific compiler flags: - 'cflags_c': [ - # Specify the C standard to which a program is expected to conform: - '-std=c99', - ], - - # C++ specific compiler flags: - 'cflags_cpp': [ - # Specify the C++ standard to which a program is expected to conform: - '-std=c++11', - ], - - # Linker flags: - 'ldflags': [], - - # Apply conditions based on the host OS: - 'conditions': [ - [ - 'OS=="mac"', - { - # Linker flags: - 'ldflags': [ - '-undefined dynamic_lookup', - '-Wl,-no-pie', - '-Wl,-search_paths_first', - ], - }, - ], # end condition (OS=="mac") - [ - 'OS!="win"', - { - # C/C++ flags: - 'cflags': [ - # Generate platform-independent code: - '-fPIC', - ], - }, - ], # end condition (OS!="win") - ], # end conditions - }, # end target <(addon_target_name) - - # Target to copy a generated add-on to a standard location: - { - 'target_name': 'copy_addon', - - # Declare that the output of this target is not linked: - 'type': 'none', - - # Define dependencies: - 'dependencies': [ - # Require that the add-on be generated before building this target: - '<(addon_target_name)', - ], - - # Define a list of actions: - 'actions': [ - { - 'action_name': 'copy_addon', - 'message': 'Copying addon...', - - # Explicitly list the inputs in the command-line invocation below: - 'inputs': [], - - # Declare the expected outputs: - 'outputs': [ - '<(addon_output_dir)/<(addon_target_name).node', - ], - - # Define the command-line invocation: - 'action': [ - 'cp', - '<(PRODUCT_DIR)/<(addon_target_name).node', - '<(addon_output_dir)/<(addon_target_name).node', - ], - }, - ], # end actions - }, # end target copy_addon - ], # end targets -} diff --git a/float32/base/mul/docs/repl.txt b/float32/base/mul/docs/repl.txt deleted file mode 100644 index 3c5a9e2b..00000000 --- a/float32/base/mul/docs/repl.txt +++ /dev/null @@ -1,120 +0,0 @@ - -{{alias}}( z1, z2 ) - Multiplies two single-precision complex floating-point numbers. - - Parameters - ---------- - z1: Complex64 - Complex number. - - z2: Complex64 - Complex number. - - Returns - ------- - out: Complex64 - Result. - - Examples - -------- - > var z1 = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ) - - > var z2 = new {{alias:@stdlib/complex/float32/ctor}}( -2.0, 1.0 ) - - > var out = {{alias}}( z1, z2 ) - - > var re = {{alias:@stdlib/complex/float32/real}}( out ) - -13.0 - > var im = {{alias:@stdlib/complex/float32/imag}}( out ) - -1.0 - - -{{alias}}.assign( re1, im1, re2, im2, out, strideOut, offsetOut ) - Multiplies two single-precision complex floating-point numbers and assigns - results to a provided output array. - - Parameters - ---------- - re1: number - Real component of the first complex number. - - im1: number - Imaginary component of the first complex number. - - re2: number - Real component of the second complex number. - - im2: number - Imaginary component of the second complex number. - - out: ArrayLikeObject - Output array. - - strideOut: integer - Stride length. - - offsetOut: integer - Starting index. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var out = new {{alias:@stdlib/array/float32}}( 2 ); - > {{alias}}.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ) - [ -13.0, -1.0 ] - - -{{alias}}.strided( z1, sz1, oz1, z2, sz2, oz2, out, so, oo ) - Multiplies two single-precision complex floating-point numbers stored in - real-valued strided array views and assigns results to a provided strided - output array. - - Parameters - ---------- - z1: ArrayLikeObject - First complex number view. - - sz1: integer - Stride length for `z1`. - - oz1: integer - Starting index for `z1`. - - z2: ArrayLikeObject - Second complex number view. - - sz2: integer - Stride length for `z2`. - - oz2: integer - Starting index for `z2`. - - out: ArrayLikeObject - Output array. - - so: integer - Stride length for `out`. - - oo: integer - Starting index for `out`. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var z1 = new {{alias:@stdlib/array/float32}}( [ 5.0, 3.0 ] ); - > var z2 = new {{alias:@stdlib/array/float32}}( [ -2.0, 1.0 ] ); - > var out = new {{alias:@stdlib/array/float32}}( 2 ); - > {{alias}}.strided( z1, 1, 0, z2, 1, 0, out, 1, 0 ) - [ -13.0, -1.0 ] - - See Also - -------- - diff --git a/float32/base/mul/docs/types/index.d.ts b/float32/base/mul/docs/types/index.d.ts deleted file mode 100644 index 79391a54..00000000 --- a/float32/base/mul/docs/types/index.d.ts +++ /dev/null @@ -1,138 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex64 } from '@stdlib/types/complex'; -import { Collection, NumericArray } from '@stdlib/types/array'; - -/** -* Interface for multiplying two single-precision complex floating-point numbers. -*/ -interface Mul { - /** - * Multiplies two single-precision complex floating-point numbers. - * - * @param z1 - complex number - * @param z2 - complex number - * @returns result - * - * @example - * var Complex64 = require( './../../../../../float32/ctor' ); - * - * var z1 = new Complex64( 5.0, 3.0 ); - * var z2 = new Complex64( -2.0, 1.0 ); - * - * var out = mul( z1, z2 ); - * // returns [ -13.0, -1.0 ] - */ - ( z1: Complex64, z2: Complex64 ): Complex64; - - /** - * Multiplies two single-precision complex floating-point numbers and assigns results to a provided output array. - * - * @param re1 - real component of the first complex number - * @param im1 - imaginary component of the first complex number - * @param re2 - real component of the second complex number - * @param im2 - imaginary component of the second complex number - * @param out - output array - * @param strideOut - stride length - * @param offsetOut - starting index - * @returns output array - * - * @example - * var Float32Array = require( '@stdlib/array/float32' ); - * - * var out = new Float32Array( 2 ); - * var v = mul.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ); - * // returns [ -13.0, -1.0 ] - * - * var bool = ( out === v ); - * // returns true - */ - assign>( re1: number, im1: number, re2: number, im2: number, out: T, strideOut: number, offsetOut: number ): T; - - /** - * Multiplies two single-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. - * - * @param z1 - first complex number view - * @param strideZ1 - stride length for `z1` - * @param offsetZ1 - starting index for `z1` - * @param z2 - second complex number view - * @param strideZ2 - stride length for `z2` - * @param offsetZ2 - starting index for `z2` - * @param out - output array - * @param strideOut - stride length for `out` - * @param offsetOut - starting index for `out` - * @returns output array - * - * @example - * var Float32Array = require( '@stdlib/array/float32' ); - * - * var z1 = new Float32Array( [ 5.0, 3.0 ] ); - * var z2 = new Float32Array( [ -2.0, 1.0 ] ); - * - * var out = mul.strided( z1, 1, 0, z2, 1, 0, new Float32Array( 2 ), 1, 0 ); - * // returns [ -13.0, -1.0 ] - */ - strided, U extends NumericArray | Collection, V extends NumericArray | Collection>( z1: T, strideZ1: number, offsetZ1: number, z2: U, strideZ2: number, offsetZ2: number, out: V, strideOut: number, offsetOut: number ): V; -} - -/** -* Multiplies two single-precision complex floating-point numbers. -* -* @param z1 - complex number -* @param z2 - complex number -* @returns result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( -2.0, 1.0 ); -* -* var out = mul( z1, z2 ); -* // returns [ -13.0, -1.0 ] -* -* @example -* var Float32Array = require( '@stdlib/array/float32' ); -* -* var out = new Float32Array( 2 ); -* var v = mul.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ); -* // returns [ -13.0, -1.0 ] -* -* var bool = ( out === v ); -* // returns true -* -* @example -* var Float32Array = require( '@stdlib/array/float32' ); -* -* var z1 = new Float32Array( [ 5.0, 3.0 ] ); -* var z2 = new Float32Array( [ -2.0, 1.0 ] ); -* -* var out = mul.strided( z1, 1, 0, z2, 1, 0, new Float32Array( 2 ), 1, 0 ); -* // returns [ -13.0, -1.0 ] -*/ -declare var mul: Mul; - - -// EXPORTS // - -export = mul; diff --git a/float32/base/mul/docs/types/test.ts b/float32/base/mul/docs/types/test.ts deleted file mode 100644 index d4ea3126..00000000 --- a/float32/base/mul/docs/types/test.ts +++ /dev/null @@ -1,356 +0,0 @@ - -/* -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64 = require( './../../../../../float32/ctor' ); -import mul = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - const z = new Complex64( 1.0, 1.0 ); - - mul( z, z ); // $ExpectType Complex64 -} - -// The compiler throws an error if the function is provided a first argument which is not a complex number... -{ - const z = new Complex64( 1.0, 1.0 ); - - mul( true, z ); // $ExpectError - mul( false, z ); // $ExpectError - mul( null, z ); // $ExpectError - mul( undefined, z ); // $ExpectError - mul( '5', z ); // $ExpectError - mul( [], z ); // $ExpectError - mul( {}, z ); // $ExpectError - mul( ( x: number ): number => x, z ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument which is not a complex number... -{ - const z = new Complex64( 1.0, 1.0 ); - - mul( z, true ); // $ExpectError - mul( z, false ); // $ExpectError - mul( z, null ); // $ExpectError - mul( z, undefined ); // $ExpectError - mul( z, '5' ); // $ExpectError - mul( z, [] ); // $ExpectError - mul( z, {} ); // $ExpectError - mul( z, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z = new Complex64( 1.0, 1.0 ); - - mul(); // $ExpectError - mul( z ); // $ExpectError - mul( z, z, z ); // $ExpectError -} - -// Attached to the main export is an `assign` method which returns a collection... -{ - mul.assign( 1.0, 1.0, 1.0, 1.0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - mul.assign( 1.0, 1.0, 1.0, 1.0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `assign` method is provided a first argument which is not a number... -{ - const out = new Float32Array( 2 ); - - mul.assign( true, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( false, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( null, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( undefined, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( '5', 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( [], 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( {}, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( ( x: number ): number => x, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a second argument which is not a number... -{ - const out = new Float32Array( 2 ); - - mul.assign( 1.0, true, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, false, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, null, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, undefined, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, '5', 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, [], 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, {}, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, ( x: number ): number => x, 3.0, 4.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a third argument which is not a number... -{ - const out = new Float32Array( 2 ); - - mul.assign( 1.0, 2.0, true, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, false, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, null, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, undefined, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, '5', 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, [], 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, {}, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, ( x: number ): number => x, 4.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fourth argument which is not a number... -{ - const out = new Float32Array( 2 ); - - mul.assign( 1.0, 2.0, 3.0, true, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, false, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, null, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, undefined, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, '5', out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, [], out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, {}, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fifth argument which is not a collection... -{ - mul.assign( 1.0, 2.0, 3.0, 4.0, 1, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, true, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, false, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, null, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, undefined, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, '5', 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, [ '5' ], 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, {}, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a sixth argument which is not a number... -{ - const out = new Float32Array( 2 ); - - mul.assign( 1.0, 2.0, 3.0, 4.0, out, true, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, false, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, null, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, undefined, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, '5', 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, [], 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, {}, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a seventh argument which is not a number... -{ - const out = new Float32Array( 2 ); - - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1, true ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1, false ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1, null ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1, undefined ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1, '5' ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1, [] ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1, {} ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided an unsupported number of arguments... -{ - const out = new Float32Array( 2 ); - - mul.assign(); // $ExpectError - mul.assign( 1.0 ); // $ExpectError - mul.assign( 1.0, 2.0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1, 0, {} ); // $ExpectError -} - -// Attached to the main export is a `strided` method which returns a collection... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - - mul.strided( z1, 1, 0, z2, 1, 0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - mul.strided( z1, 1, 0, z2, 1, 0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `strided` method is provided a first argument which is not a collection... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const out = new Float32Array( z2.length ); - - mul.strided( true, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( false, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( null, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( undefined, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( '5', 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( [ '5' ], 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( {}, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( ( x: number ): number => x, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a second argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const out = new Float32Array( z2.length ); - - mul.strided( z1, true, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, false, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, null, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, undefined, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, '5', 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, [], 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, {}, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, ( x: number ): number => x, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a third argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const out = new Float32Array( 2 ); - - mul.strided( z1, 1, true, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, false, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, null, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, undefined, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, '5', z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, [], z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, {}, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, ( x: number ): number => x, z2, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fourth argument which is not a collection... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const out = new Float32Array( z2.length ); - - mul.strided( z1, 1, 0, true, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, false, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, null, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, undefined, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, '5', 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, [ '5' ], 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, {}, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, ( x: number ): number => x, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fifth argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const out = new Float32Array( z2.length ); - - mul.strided( z1, 1, 0, z2, true, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, false, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, null, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, undefined, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, '5', 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, [], 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, {}, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, ( x: number ): number => x, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a sixth argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const out = new Float32Array( z2.length ); - - mul.strided( z1, 1, 0, z2, 1, true, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, false, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, null, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, undefined, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, '5', out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, [], out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, {}, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a seventh argument which is not a collection... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - - mul.strided( z1, 1, 0, z2, 1, 0, 1, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, true, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, false, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, null, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, undefined, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, '5', 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, [ '5' ], 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, {}, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an eighth argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const out = new Float32Array( z2.length ); - - mul.strided( z1, 1, 0, z2, 1, 0, out, true, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, false, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, null, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, undefined, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, '5', 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, [], 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, {}, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a ninth argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const out = new Float32Array( z2.length ); - - mul.strided( z1, 1, 0, z2, 1, 0, out, 1, true ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, 1, false ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, 1, null ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, 1, undefined ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, 1, '5' ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, 1, [] ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, 1, {} ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an unsupported number of arguments... -{ - const z1 = new Float32Array( 2 ); - const z2 = new Float32Array( z1.length ); - const out = new Float32Array( z2.length ); - - mul.strided(); // $ExpectError - mul.strided( z1 ); // $ExpectError - mul.strided( z1, 1 ); // $ExpectError - mul.strided( z1, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, 1 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, 1, 0, {} ); // $ExpectError -} diff --git a/float32/base/mul/examples/c/Makefile b/float32/base/mul/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float32/base/mul/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/mul/examples/c/example.c b/float32/base/mul/examples/c/example.c deleted file mode 100644 index 39643c3b..00000000 --- a/float32/base/mul/examples/c/example.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/mul.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 3.14f, 1.5f ), - stdlib_complex64( -3.14f, 1.5f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - stdlib_complex64_t v; - stdlib_complex64_t y; - float re; - float im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex64_reim( v, &re, &im ); - printf( "z = %f + %fi\n", re, im ); - - y = stdlib_base_complex64_mul( v, v ); - stdlib_complex64_reim( y, &re, &im ); - printf( "mul(z, z) = %f + %fi\n", re, im ); - } -} diff --git a/float32/base/mul/examples/index.js b/float32/base/mul/examples/index.js deleted file mode 100644 index 927f068b..00000000 --- a/float32/base/mul/examples/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64Array = require( '@stdlib/array/complex64' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var mul = require( './../lib' ); - -// Generate arrays of random values: -var z1 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise multiplication: -logEachMap( '(%s) * (%s) = %s', z1, z2, mul ); diff --git a/float32/base/mul/include.gypi b/float32/base/mul/include.gypi deleted file mode 100644 index 3b437d52..00000000 --- a/float32/base/mul/include.gypi +++ /dev/null @@ -1,53 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2022 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A GYP include file for building a Node.js native add-on. -# -# Main documentation: -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Source directory: - 'src_dir': './src', - - # Include directories: - 'include_dirs': [ - '[ -13.0, -1.0 ] -*/ -function assign( re1, im1, re2, im2, out, strideOut, offsetOut ) { - out[ offsetOut ] = f32(re1*re2) - f32(im1*im2); - out[ offsetOut+strideOut ] = f32(re1*im2) + f32(im1*re2); - return out; -} - - -// EXPORTS // - -module.exports = assign; diff --git a/float32/base/mul/lib/index.js b/float32/base/mul/lib/index.js deleted file mode 100644 index 5df899e3..00000000 --- a/float32/base/mul/lib/index.js +++ /dev/null @@ -1,55 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Multiply two single-precision complex floating-point numbers. -* -* @module @stdlib/complex/float32/base/mul -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var mul = require( '@stdlib/complex/float32/base/mul' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( -2.0, 1.0 ); -* -* var out = mul( z1, z2 ); -* // returns [ -13.0, -1.0 ] -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var main = require( './main.js' ); -var assign = require( './assign.js' ); -var strided = require( './strided.js' ); - - -// MAIN // - -setReadOnly( main, 'assign', assign ); -setReadOnly( main, 'strided', strided ); - - -// EXPORTS // - -module.exports = main; - -// exports: { "assign": "main.assign", "strided": "main.strided" } diff --git a/float32/base/mul/lib/main.js b/float32/base/mul/lib/main.js deleted file mode 100644 index 31fcd13a..00000000 --- a/float32/base/mul/lib/main.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var f32 = require( '@stdlib/number/float64/base/to-float32' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); - - -// MAIN // - -/** -* Multiplies two single-precision complex floating-point numbers. -* -* @param {Complex64} z1 - complex number -* @param {Complex64} z2 - complex number -* @returns {Complex64} result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( -2.0, 1.0 ); -* -* var out = mul( z1, z2 ); -* // returns [ -13.0, -1.0 ] -*/ -function mul( z1, z2 ) { - var re1 = realf( z1 ); - var re2 = realf( z2 ); - var im1 = imagf( z1 ); - var im2 = imagf( z2 ); - var re = f32(re1*re2) - f32(im1*im2); - var im = f32(re1*im2) + f32(im1*re2); - return new Complex64( f32( re ), f32( im ) ); -} - - -// EXPORTS // - -module.exports = mul; diff --git a/float32/base/mul/lib/native.js b/float32/base/mul/lib/native.js deleted file mode 100644 index 8441ace5..00000000 --- a/float32/base/mul/lib/native.js +++ /dev/null @@ -1,54 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex64 = require( './../../../../float32/ctor' ); -var addon = require( './../src/addon.node' ); - - -// MAIN // - -/** -* Multiplies two single-precision complex floating-point numbers. -* -* @private -* @param {Complex64} z1 - complex number -* @param {Complex64} z2 - complex number -* @returns {Complex64} result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( -2.0, 1.0 ); -* -* var out = mul( z1, z2 ); -* // returns [ -13.0, -1.0 ] -*/ -function mul( z1, z2 ) { - var v = addon( z1, z2 ); - return new Complex64( v.re, v.im ); -} - - -// EXPORTS // - -module.exports = mul; diff --git a/float32/base/mul/lib/strided.js b/float32/base/mul/lib/strided.js deleted file mode 100644 index 990ee894..00000000 --- a/float32/base/mul/lib/strided.js +++ /dev/null @@ -1,64 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var f32 = require( '@stdlib/number/float64/base/to-float32' ); - - -// MAIN // - -/** -* Multiplies two single-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. -* -* @param {Float32Array} z1 - first complex number view -* @param {integer} strideZ1 - stride length for `z1` -* @param {NonNegativeInteger} offsetZ1 - starting index for `z1` -* @param {Float32Array} z2 - second complex number view -* @param {integer} strideZ2 - stride length for `z2` -* @param {NonNegativeInteger} offsetZ2 - starting index for `z2` -* @param {Collection} out - output array -* @param {integer} strideOut - stride length for `out` -* @param {NonNegativeInteger} offsetOut - starting index for `out` -* @returns {Collection} output array -* -* @example -* var Float32Array = require( '@stdlib/array/float32' ); -* -* var z1 = new Float32Array( [ 5.0, 3.0 ] ); -* var z2 = new Float32Array( [ -2.0, 1.0 ] ); -* -* var out = strided( z1, 1, 0, z2, 1, 0, new Float32Array( 2 ), 1, 0 ); -* // returns [ -13.0, -1.0 ] -*/ -function strided( z1, strideZ1, offsetZ1, z2, strideZ2, offsetZ2, out, strideOut, offsetOut ) { // eslint-disable-line max-len - var re1 = z1[ offsetZ1 ]; - var im1 = z1[ offsetZ1+strideZ1 ]; - var re2 = z2[ offsetZ2 ]; - var im2 = z2[ offsetZ2+strideZ2 ]; - out[ offsetOut ] = f32(re1*re2) - f32(im1*im2); - out[ offsetOut+strideOut ] = f32(re1*im2) + f32(im1*re2); - return out; -} - - -// EXPORTS // - -module.exports = strided; diff --git a/float32/base/mul/manifest.json b/float32/base/mul/manifest.json deleted file mode 100644 index fab47254..00000000 --- a/float32/base/mul/manifest.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "options": { - "task": "build", - "wasm": false - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "wasm": false, - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/napi/binary", - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - }, - { - "task": "benchmark", - "wasm": false, - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - }, - { - "task": "examples", - "wasm": false, - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - }, - { - "task": "build", - "wasm": true, - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - } - ] -} diff --git a/float32/base/mul/package.json b/float32/base/mul/package.json deleted file mode 100644 index 13095825..00000000 --- a/float32/base/mul/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "@stdlib/complex/float32/base/mul", - "version": "0.0.0", - "description": "Multiply two single-precision complex floating-point numbers.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "mul", - "cmulf", - "mult", - "multiply", - "multiplication", - "arithmetic", - "complex", - "cmplx", - "number" - ] -} diff --git a/float32/base/mul/src/Makefile b/float32/base/mul/src/Makefile deleted file mode 100644 index f79b8723..00000000 --- a/float32/base/mul/src/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - - -# RULES # - -#/ -# Removes generated files for building an add-on. -# -# @example -# make clean-addon -#/ -clean-addon: - $(QUIET) -rm -f *.o *.node - -.PHONY: clean-addon - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: clean-addon - -.PHONY: clean diff --git a/float32/base/mul/src/addon.c b/float32/base/mul/src/addon.c deleted file mode 100644 index 0a8784d2..00000000 --- a/float32/base/mul/src/addon.c +++ /dev/null @@ -1,22 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/mul.h" -#include "stdlib/math/base/napi/binary.h" - -STDLIB_MATH_BASE_NAPI_MODULE_CC_C( stdlib_base_complex64_mul ) diff --git a/float32/base/mul/src/main.c b/float32/base/mul/src/main.c deleted file mode 100644 index 283a2bb8..00000000 --- a/float32/base/mul/src/main.c +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/mul.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" - -/** -* Multiplies two single-precision complex floating-point numbers. -* -* @param z1 input value -* @param z2 input value -* @return result -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* #include "stdlib/complex/float32/real.h" -* #include "stdlib/complex/float32/imag.h" -* -* stdlib_complex64_t z1 = stdlib_complex64( 5.0f, 3.0f ); -* stdlib_complex64_t z2 = stdlib_complex64( -2.0f, 1.0f ); -* -* stdlib_complex64_t out = stdlib_base_complex64_mul( z1, z2 ); -* -* float re = stdlib_complex64_real( out ); -* // returns -13.0f -* -* float im = stdlib_complex64_imag( out ); -* // returns -1.0f -*/ -stdlib_complex64_t stdlib_base_complex64_mul( const stdlib_complex64_t z1, const stdlib_complex64_t z2 ) { - float re1; - float re2; - float im1; - float im2; - float re; - float im; - - stdlib_complex64_reim( z1, &re1, &im1 ); - stdlib_complex64_reim( z2, &re2, &im2 ); - - re = (re1*re2) - (im1*im2); - im = (re1*im2) + (im1*re2); - - return stdlib_complex64( re, im ); -} diff --git a/float32/base/mul/test/test.assign.js b/float32/base/mul/test/test.assign.js deleted file mode 100644 index 0e662d5a..00000000 --- a/float32/base/mul/test/test.assign.js +++ /dev/null @@ -1,132 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); -var Float32Array = require( '@stdlib/array/float32' ); -var mul = require( './../lib/assign.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof mul, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function multiplies two complex numbers', function test( t ) { - var expected; - var out; - var v; - - out = new Float32Array( 2 ); - v = mul( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ); - - expected = new Float32Array( [ -13.0, -1.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 4 ); - v = mul( 5.0, 3.0, -2.0, 1.0, out, 2, 0 ); - - expected = new Float32Array( [ -13.0, 0.0, -1.0, 0.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 4 ); - v = mul( 5.0, 3.0, -2.0, 1.0, out, 2, 1 ); - - expected = new Float32Array( [ 0.0, -13.0, 0.0, -1.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 4 ); - v = mul( 5.0, 3.0, -2.0, 1.0, out, -2, 3 ); - - expected = new Float32Array( [ 0.0, -1.0, 0.0, -13.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', function test( t ) { - var expected; - var out; - var v; - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = mul( NaN, 3.0, -2.0, 1.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = mul( 5.0, 3.0, NaN, 1.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = mul( NaN, 3.0, NaN, 1.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = mul( 5.0, NaN, -2.0, 1.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = mul( 5.0, 3.0, -2.0, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = mul( 5.0, NaN, -2.0, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = mul( NaN, NaN, NaN, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/mul/test/test.js b/float32/base/mul/test/test.js deleted file mode 100644 index ec16fef0..00000000 --- a/float32/base/mul/test/test.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isMethod = require( '@stdlib/assert/is-method' ); -var mul = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof mul, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'attached to the main export is an `assign` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( mul, 'assign' ), true, 'returns expected value' ); - t.end(); -}); - -tape( 'attached to the main export is a `strided` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( mul, 'strided' ), true, 'returns expected value' ); - t.end(); -}); diff --git a/float32/base/mul/test/test.main.js b/float32/base/mul/test/test.main.js deleted file mode 100644 index f0509342..00000000 --- a/float32/base/mul/test/test.main.js +++ /dev/null @@ -1,111 +0,0 @@ - -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var mul = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof mul, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function multiplies two complex numbers', function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - - v = mul( z1, z2 ); - - t.strictEqual( realf( v ), -13.0, 'returns expected value' ); - t.strictEqual( imagf( v ), -1.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - - v = mul( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( NaN, 1.0 ); - - v = mul( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( NaN, 1.0 ); - - v = mul( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( -2.0, 1.0 ); - - v = mul( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, NaN ); - - v = mul( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( -2.0, NaN ); - - v = mul( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, NaN ); - z2 = new Complex64( NaN, NaN ); - - v = mul( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/mul/test/test.native.js b/float32/base/mul/test/test.native.js deleted file mode 100644 index 721a9e8f..00000000 --- a/float32/base/mul/test/test.native.js +++ /dev/null @@ -1,119 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var tape = require( 'tape' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var mul = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( mul instanceof Error ) -}; - - -// TESTS // - -tape( 'main export is a function', opts, function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof mul, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function multiplies two complex numbers', opts, function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - - v = mul( z1, z2 ); - - t.strictEqual( realf( v ), -13.0, 'returns expected value' ); - t.strictEqual( imagf( v ), -1.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', opts, function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - - v = mul( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( NaN, 1.0 ); - - v = mul( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( NaN, 1.0 ); - - v = mul( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( -2.0, 1.0 ); - - v = mul( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, NaN ); - - v = mul( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( -2.0, NaN ); - - v = mul( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, NaN ); - z2 = new Complex64( NaN, NaN ); - - v = mul( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/mul/test/test.strided.js b/float32/base/mul/test/test.strided.js deleted file mode 100644 index 3503f5d5..00000000 --- a/float32/base/mul/test/test.strided.js +++ /dev/null @@ -1,158 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); -var Float32Array = require( '@stdlib/array/float32' ); -var mul = require( './../lib/strided.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof mul, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function multiplies two complex numbers', function test( t ) { - var expected; - var out; - var z1; - var z2; - var v; - - z1 = new Float32Array( [ 5.0, 3.0 ] ); - z2 = new Float32Array( [ -2.0, 1.0 ] ); - out = new Float32Array( 2 ); - v = mul( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - - expected = new Float32Array( [ -13.0, -1.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, 0.0, 3.0, 0.0 ] ); - z2 = new Float32Array( [ -2.0, 1.0 ] ); - out = new Float32Array( 4 ); - v = mul( z1, 2, 0, z2, 1, 0, out, 2, 0 ); - - expected = new Float32Array( [ -13.0, 0.0, -1.0, 0.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, 3.0 ] ); - z2 = new Float32Array( [ 0.0, -2.0, 0.0, 1.0 ] ); - out = new Float32Array( 4 ); - v = mul( z1, 1, 0, z2, 2, 1, out, 2, 1 ); - - expected = new Float32Array( [ 0.0, -13.0, 0.0, -1.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 3.0, 5.0 ] ); - z2 = new Float32Array( [ 1.0, -2.0 ] ); - out = new Float32Array( 4 ); - v = mul( z1, -1, 1, z2, -1, 1, out, -2, 3 ); - - expected = new Float32Array( [ 0.0, -1.0, 0.0, -13.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', function test( t ) { - var expected; - var out; - var z1; - var z2; - var v; - - z1 = new Float32Array( [ NaN, 3.0 ] ); - z2 = new Float32Array( [ -2.0, 1.0 ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = mul( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, 3.0 ] ); - z2 = new Float32Array( [ NaN, 1.0 ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = mul( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ NaN, 3.0 ] ); - z2 = new Float32Array( [ NaN, 1.0 ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = mul( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, NaN ] ); - z2 = new Float32Array( [ -2.0, 1.0 ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = mul( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, 3.0 ] ); - z2 = new Float32Array( [ -2.0, NaN ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = mul( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ 5.0, NaN ] ); - z2 = new Float32Array( [ -2.0, NaN ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = mul( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float32Array( [ NaN, NaN ] ); - z2 = new Float32Array( [ NaN, NaN ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = mul( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/neg/README.md b/float32/base/neg/README.md deleted file mode 100644 index fd5fa1d6..00000000 --- a/float32/base/neg/README.md +++ /dev/null @@ -1,259 +0,0 @@ - - -# cnegf - -> Negate a single-precision complex floating-point number. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var cnegf = require( '@stdlib/complex/float32/base/neg' ); -``` - -#### cnegf( z ) - -Negates a single-precision complex floating-point number. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z = new Complex64( -4.0, 5.0 ); - -var out = cnegf( z ); -// returns [ 4.0, -5.0 ] - -z = new Complex64( 0.0, 0.0 ); - -out = cnegf( z ); -// returns [ -0.0, -0.0 ] - -z = new Complex64( NaN, NaN ); - -out = cnegf( z ); -// returns [ NaN, NaN ] -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var cnegf = require( '@stdlib/complex/float32/base/neg' ); - -function randomComplex() { - var re = discreteUniform( -50, 50 ); - var im = discreteUniform( -50, 50 ); - return new Complex64( re, im ); -} - -var z; -var o; -var i; - -for ( i = 0; i < 100; i++ ) { - z = randomComplex(); - o = cnegf( z ); - console.log( 'negate(%s) = %s', z.toString(), o.toString() ); -} -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float32/base/neg.h" -``` - -#### stdlib_base_complex64_neg( z ) - -Negates a single-precision complex floating-point number. - -```c -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/real.h" -#include "stdlib/complex/float32/imag.h" - -stdlib_complex64_t z = stdlib_complex64( 3.0f, -2.0f ); -stdlib_complex64_t out = stdlib_base_complex64_neg( z ); - -float re = stdlib_complex64_real( out ); -// returns -3.0f - -float im = stdlib_complex64_imag( out ); -// returns 2.0f -``` - -The function accepts the following arguments: - -- **z**: `[in] stdlib_complex64_t` input value. - -```c -stdlib_complex64_t stdlib_base_complex64_neg( const stdlib_complex64_t z ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float32/base/neg.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 3.14f, 1.5f ), - stdlib_complex64( -3.14f, 1.5f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - stdlib_complex64_t v; - stdlib_complex64_t y; - float re; - float im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex64_reim( v, &re, &im ); - printf( "z = %f + %fi\n", re, im ); - - y = stdlib_base_complex64_neg( v ); - stdlib_complex64_reim( y, &re, &im ); - printf( "cnegf(z) = %f + %fi\n", re, im ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float32/base/neg/benchmark/benchmark.js b/float32/base/neg/benchmark/benchmark.js deleted file mode 100644 index 06d3affb..00000000 --- a/float32/base/neg/benchmark/benchmark.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex64 = require( './../../../../float32/ctor' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var pkg = require( './../package.json' ).name; -var cnegf = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var z; - var y; - var i; - - values = [ - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - y = cnegf( z ); - if ( typeof y !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( y ) ) || isnanf( imagf( y ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/neg/benchmark/benchmark.native.js b/float32/base/neg/benchmark/benchmark.native.js deleted file mode 100644 index 84b3a166..00000000 --- a/float32/base/neg/benchmark/benchmark.native.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); -var pkg = require( './../package.json' ).name; - - -// VARIABLES // - -var cnegf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( cnegf instanceof Error ) -}; - - -// MAIN // - -bench( pkg+'::native', opts, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = cnegf( z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( out ) ) || isnanf( imagf( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/neg/benchmark/c/Makefile b/float32/base/neg/benchmark/c/Makefile deleted file mode 100644 index 91269afd..00000000 --- a/float32/base/neg/benchmark/c/Makefile +++ /dev/null @@ -1,127 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler -# @param {string} [CFLAGS] - C compiler flags -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/neg/benchmark/c/benchmark.c b/float32/base/neg/benchmark/c/benchmark.c deleted file mode 100644 index a16e6478..00000000 --- a/float32/base/neg/benchmark/c/benchmark.c +++ /dev/null @@ -1,141 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/** -* Benchmark complex number negation. -*/ - -#include -#include -#include -#include -#include - -#define NAME "negate" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double t; - float re; - float im; - int i; - - float complex z; - float complex y; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z = re + im*I; - y = -crealf(z) - ( cimagf(z) )*I; - if ( y != y ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( y != y ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/base/neg/benchmark/c/native/Makefile b/float32/base/neg/benchmark/c/native/Makefile deleted file mode 100644 index 3cbfe3fe..00000000 --- a/float32/base/neg/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/neg/benchmark/c/native/benchmark.c b/float32/base/neg/benchmark/c/native/benchmark.c deleted file mode 100644 index b226f94a..00000000 --- a/float32/base/neg/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,142 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/neg.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include -#include -#include -#include -#include - -#define NAME "cnegf" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double t; - float re; - float im; - int i; - - stdlib_complex64_t z1; - stdlib_complex64_t z2; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z1 = stdlib_complex64( re, im ); - - z2 = stdlib_base_complex64_neg( z1 ); - stdlib_complex64_reim( z2, &re, &im ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/base/neg/benchmark/julia/REQUIRE b/float32/base/neg/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float32/base/neg/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float32/base/neg/benchmark/julia/benchmark.jl b/float32/base/neg/benchmark/julia/benchmark.jl deleted file mode 100644 index 92934d43..00000000 --- a/float32/base/neg/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "negate"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark -( ComplexF32( (rand()*1000.0) - 500.0, (rand()*1000.0) - 500.0 ) ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float32/base/neg/binding.gyp b/float32/base/neg/binding.gyp deleted file mode 100644 index f2b466ae..00000000 --- a/float32/base/neg/binding.gyp +++ /dev/null @@ -1,170 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A `.gyp` file for building a Node.js native add-on. -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # List of files to include in this file: - 'includes': [ - './include.gypi', - ], - - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Target name should match the add-on export name: - 'addon_target_name%': 'addon', - - # Set variables based on the host OS: - 'conditions': [ - [ - 'OS=="win"', - { - # Define the object file suffix: - 'obj': 'obj', - }, - { - # Define the object file suffix: - 'obj': 'o', - } - ], # end condition (OS=="win") - ], # end conditions - }, # end variables - - # Define compile targets: - 'targets': [ - - # Target to generate an add-on: - { - # The target name should match the add-on export name: - 'target_name': '<(addon_target_name)', - - # Define dependencies: - 'dependencies': [], - - # Define directories which contain relevant include headers: - 'include_dirs': [ - # Local include directory: - '<@(include_dirs)', - ], - - # List of source files: - 'sources': [ - '<@(src_files)', - ], - - # Settings which should be applied when a target's object files are used as linker input: - 'link_settings': { - # Define libraries: - 'libraries': [ - '<@(libraries)', - ], - - # Define library directories: - 'library_dirs': [ - '<@(library_dirs)', - ], - }, - - # C/C++ compiler flags: - 'cflags': [ - # Enable commonly used warning options: - '-Wall', - - # Aggressive optimization: - '-O3', - ], - - # C specific compiler flags: - 'cflags_c': [ - # Specify the C standard to which a program is expected to conform: - '-std=c99', - ], - - # C++ specific compiler flags: - 'cflags_cpp': [ - # Specify the C++ standard to which a program is expected to conform: - '-std=c++11', - ], - - # Linker flags: - 'ldflags': [], - - # Apply conditions based on the host OS: - 'conditions': [ - [ - 'OS=="mac"', - { - # Linker flags: - 'ldflags': [ - '-undefined dynamic_lookup', - '-Wl,-no-pie', - '-Wl,-search_paths_first', - ], - }, - ], # end condition (OS=="mac") - [ - 'OS!="win"', - { - # C/C++ flags: - 'cflags': [ - # Generate platform-independent code: - '-fPIC', - ], - }, - ], # end condition (OS!="win") - ], # end conditions - }, # end target <(addon_target_name) - - # Target to copy a generated add-on to a standard location: - { - 'target_name': 'copy_addon', - - # Declare that the output of this target is not linked: - 'type': 'none', - - # Define dependencies: - 'dependencies': [ - # Require that the add-on be generated before building this target: - '<(addon_target_name)', - ], - - # Define a list of actions: - 'actions': [ - { - 'action_name': 'copy_addon', - 'message': 'Copying addon...', - - # Explicitly list the inputs in the command-line invocation below: - 'inputs': [], - - # Declare the expected outputs: - 'outputs': [ - '<(addon_output_dir)/<(addon_target_name).node', - ], - - # Define the command-line invocation: - 'action': [ - 'cp', - '<(PRODUCT_DIR)/<(addon_target_name).node', - '<(addon_output_dir)/<(addon_target_name).node', - ], - }, - ], # end actions - }, # end target copy_addon - ], # end targets -} diff --git a/float32/base/neg/docs/repl.txt b/float32/base/neg/docs/repl.txt deleted file mode 100644 index 4dd2c3ef..00000000 --- a/float32/base/neg/docs/repl.txt +++ /dev/null @@ -1,28 +0,0 @@ - -{{alias}}( z ) - Negates a single-precision complex floating-point number. - - Parameters - ---------- - z: Complex64 - Complex number. - - Returns - ------- - out: Complex64 - Result. - - Examples - -------- - > var z = new {{alias:@stdlib/complex/float32/ctor}}( -4.0, 5.0 ) - - > var v = {{alias}}( z ) - - > var re = {{alias:@stdlib/complex/float32/real}}( v ) - 4.0 - > var im = {{alias:@stdlib/complex/float32/imag}}( v ) - -5.0 - - See Also - -------- - diff --git a/float32/base/neg/docs/types/index.d.ts b/float32/base/neg/docs/types/index.d.ts deleted file mode 100644 index ab5ab630..00000000 --- a/float32/base/neg/docs/types/index.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex64 } from '@stdlib/types/complex'; - -/** -* Negates a single-precision complex floating-point number. -* -* @param z - complex number -* @returns result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( -4.2, 5.5 ); -* -* var out = cnegf( z ); -* // returns [ ~4.2, -5.5 ] -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 0.0, 0.0 ); -* -* var out = cnegf( z ); -* // returns [ -0.0, -0.0 ] -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( NaN, NaN ); -* -* var out = cnegf( z ); -* // returns [ NaN, NaN ] -*/ -declare function cnegf( z: Complex64 ): Complex64; - - -// EXPORTS // - -export = cnegf; diff --git a/float32/base/neg/docs/types/test.ts b/float32/base/neg/docs/types/test.ts deleted file mode 100644 index 6a1094b6..00000000 --- a/float32/base/neg/docs/types/test.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64 = require( './../../../../../float32/ctor' ); -import cnegf = require( './index' ); - - -// TESTS // - -// The function returns a single-precision complex floating-point number... -{ - const z = new Complex64( 1.0, 1.0 ); - - cnegf( z ); // $ExpectType Complex64 -} - -// The compiler throws an error if the function is provided an argument which is not a complex number... -{ - cnegf( true ); // $ExpectError - cnegf( false ); // $ExpectError - cnegf( null ); // $ExpectError - cnegf( undefined ); // $ExpectError - cnegf( '5' ); // $ExpectError - cnegf( [] ); // $ExpectError - cnegf( {} ); // $ExpectError - cnegf( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z = new Complex64( 1.0, 1.0 ); - - cnegf(); // $ExpectError - cnegf( z, z ); // $ExpectError - cnegf( z, z, z ); // $ExpectError -} diff --git a/float32/base/neg/examples/c/Makefile b/float32/base/neg/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float32/base/neg/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/neg/examples/c/example.c b/float32/base/neg/examples/c/example.c deleted file mode 100644 index 69c60962..00000000 --- a/float32/base/neg/examples/c/example.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/neg.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 3.14f, 1.5f ), - stdlib_complex64( -3.14f, 1.5f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - stdlib_complex64_t v; - stdlib_complex64_t y; - float re; - float im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex64_reim( v, &re, &im ); - printf( "z = %f + %fi\n", re, im ); - - y = stdlib_base_complex64_neg( v ); - stdlib_complex64_reim( y, &re, &im ); - printf( "cnegf(z) = %f + %fi\n", re, im ); - } -} diff --git a/float32/base/neg/examples/index.js b/float32/base/neg/examples/index.js deleted file mode 100644 index afeef33c..00000000 --- a/float32/base/neg/examples/index.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64 = require( './../../../../float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var cnegf = require( './../lib' ); - -function randomComplex() { - var re = discreteUniform( -50, 50 ); - var im = discreteUniform( -50, 50 ); - return new Complex64( re, im ); -} - -var z; -var o; -var i; - -for ( i = 0; i < 100; i++ ) { - z = randomComplex(); - o = cnegf( z ); - console.log( 'negate(%s) = %s', z.toString(), o.toString() ); -} diff --git a/float32/base/neg/include.gypi b/float32/base/neg/include.gypi deleted file mode 100644 index 78db9faf..00000000 --- a/float32/base/neg/include.gypi +++ /dev/null @@ -1,53 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A GYP include file for building a Node.js native add-on. -# -# Main documentation: -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Source directory: - 'src_dir': './src', - - # Include directories: - 'include_dirs': [ - '[ 4.0, -5.0 ] -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var cnegf = require( '@stdlib/complex/float32/base/neg' ); -* -* var z = new Complex64( 0.0, 0.0 ); -* -* var out = cnegf( z ); -* // returns [ -0.0, -0.0 ] -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var cnegf = require( '@stdlib/complex/float32/base/neg' ); -* -* var z = new Complex64( NaN, NaN ); -* -* var out = cnegf( z ); -* // returns [ NaN, NaN ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float32/base/neg/lib/main.js b/float32/base/neg/lib/main.js deleted file mode 100644 index 70464f81..00000000 --- a/float32/base/neg/lib/main.js +++ /dev/null @@ -1,67 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var Complex64 = require( './../../../../float32/ctor' ); - - -// MAIN // - -/** -* Negates a single-precision complex floating-point number. -* -* @param {Complex64} z - complex number -* @returns {Complex64} result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( -4.2, 5.5 ); -* -* var out = cnegf( z ); -* // returns [ ~4.2, -5.5 ] -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 0.0, 0.0 ); -* -* var out = cnegf( z ); -* // returns [ -0.0, -0.0 ] -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( NaN, NaN ); -* -* var out = cnegf( z ); -* // returns [ NaN, NaN ] -*/ -function cnegf( z ) { - return new Complex64( -realf( z ), -imagf( z ) ); -} - - -// EXPORTS // - -module.exports = cnegf; diff --git a/float32/base/neg/lib/native.js b/float32/base/neg/lib/native.js deleted file mode 100644 index 38f7f19e..00000000 --- a/float32/base/neg/lib/native.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex64 = require( './../../../../float32/ctor' ); -var addon = require( './../src/addon.node' ); - - -// MAIN // - -/** -* Negates a single-precision complex floating-point number. -* -* @private -* @param {Complex64} z - complex number -* @returns {Complex64} result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( -4.2, 5.5 ); -* -* var out = cnegf( z ); -* // returns [ ~4.2, -5.5 ] -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 0.0, 0.0 ); -* -* var out = cnegf( z ); -* // returns [ -0.0, -0.0 ] -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( NaN, NaN ); -* -* var out = cnegf( z ); -* // returns [ NaN, NaN ] -*/ -function cnegf( z ) { - var v = addon( z ); - return new Complex64( v.re, v.im ); -} - - -// EXPORTS // - -module.exports = cnegf; diff --git a/float32/base/neg/manifest.json b/float32/base/neg/manifest.json deleted file mode 100644 index b36aa0cc..00000000 --- a/float32/base/neg/manifest.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/napi/unary", - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - } - ] -} diff --git a/float32/base/neg/package.json b/float32/base/neg/package.json deleted file mode 100644 index 6f8e77df..00000000 --- a/float32/base/neg/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@stdlib/complex/float32/base/neg", - "version": "0.0.0", - "description": "Negate a single-precision complex floating-point number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "neg", - "negate", - "negation", - "negative", - "complex", - "cmplx", - "number" - ] -} diff --git a/float32/base/neg/src/Makefile b/float32/base/neg/src/Makefile deleted file mode 100644 index a28d8988..00000000 --- a/float32/base/neg/src/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - - -# RULES # - -#/ -# Removes generated files for building an add-on. -# -# @example -# make clean-addon -#/ -clean-addon: - $(QUIET) -rm -f *.o *.node - -.PHONY: clean-addon - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: clean-addon - -.PHONY: clean diff --git a/float32/base/neg/src/addon.c b/float32/base/neg/src/addon.c deleted file mode 100644 index 4123bbe7..00000000 --- a/float32/base/neg/src/addon.c +++ /dev/null @@ -1,22 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/neg.h" -#include "stdlib/math/base/napi/unary.h" - -STDLIB_MATH_BASE_NAPI_MODULE_C_C( stdlib_base_complex64_neg ) diff --git a/float32/base/neg/src/main.c b/float32/base/neg/src/main.c deleted file mode 100644 index 6d49cd1f..00000000 --- a/float32/base/neg/src/main.c +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/neg.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" - -/** -* Negates a single-precision complex floating-point number. -* -* @param z input value -* @return result -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* #include "stdlib/complex/float32/real.h" -* #include "stdlib/complex/float32/imag.h" -* -* stdlib_complex64_t z = stdlib_complex64( 3.0f, -2.0f ); -* stdlib_complex64_t out = stdlib_base_complex64_neg( z ); -* -* float re = stdlib_complex64_real( out ); -* // returns -3.0f -* -* float im = stdlib_complex64_imag( out ); -* // returns 2.0f -*/ -stdlib_complex64_t stdlib_base_complex64_neg( const stdlib_complex64_t z ) { - float re; - float im; - - stdlib_complex64_reim( z, &re, &im ); - - return stdlib_complex64( -re, -im ); -} diff --git a/float32/base/neg/test/test.js b/float32/base/neg/test/test.js deleted file mode 100644 index 5229623c..00000000 --- a/float32/base/neg/test/test.js +++ /dev/null @@ -1,132 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var PINF = require( '@stdlib/constants/float32/pinf' ); -var NINF = require( '@stdlib/constants/float32/ninf' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' ); -var isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var cnegf = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof cnegf, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function negates real and imaginary components', function test( t ) { - var actual; - var z; - - z = new Complex64( 4.0, 7.0 ); - - actual = cnegf( z ); - - t.strictEqual( realf( actual ), -4.0, 'returns expected value' ); - t.strictEqual( imagf( actual ), -7.0, 'returns expected value' ); - - z = new Complex64( -4.0, -7.0 ); - - actual = cnegf( z ); - - t.strictEqual( realf( actual ), 4.0, 'returns expected value' ); - t.strictEqual( imagf( actual ), 7.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `NaN` if provided `NaN`', function test( t ) { - var actual; - var z; - - z = new Complex64( NaN, NaN ); - - actual = cnegf( z ); - - t.strictEqual( isnanf( realf( actual ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( actual ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `+0` if provided `-0`', function test( t ) { - var actual; - var z; - - z = new Complex64( -0.0, -0.0 ); - - actual = cnegf( z ); - - t.strictEqual( isPositiveZerof( realf( actual ) ), true, 'returns expected value' ); - t.strictEqual( isPositiveZerof( imagf( actual ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `-0` if provided `+0`', function test( t ) { - var actual; - var z; - - z = new Complex64( +0.0, +0.0 ); - - actual = cnegf( z ); - - t.strictEqual( isNegativeZerof( realf( actual ) ), true, 'returns expected value' ); - t.strictEqual( isNegativeZerof( imagf( actual ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `-infinity` if provided `+infinity`', function test( t ) { - var actual; - var z; - - z = new Complex64( PINF, PINF ); - - actual = cnegf( z ); - - t.strictEqual( realf( actual ), NINF, 'returns expected value' ); - t.strictEqual( imagf( actual ), NINF, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `+infinity` if provided `-infinity`', function test( t ) { - var actual; - var z; - - z = new Complex64( NINF, NINF ); - - actual = cnegf( z ); - - t.strictEqual( realf( actual ), PINF, 'returns expected value' ); - t.strictEqual( imagf( actual ), PINF, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/neg/test/test.native.js b/float32/base/neg/test/test.native.js deleted file mode 100644 index b703da75..00000000 --- a/float32/base/neg/test/test.native.js +++ /dev/null @@ -1,141 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var tape = require( 'tape' ); -var PINF = require( '@stdlib/constants/float32/pinf' ); -var NINF = require( '@stdlib/constants/float32/ninf' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' ); -var isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var cnegf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( cnegf instanceof Error ) -}; - - -// TESTS // - -tape( 'main export is a function', opts, function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof cnegf, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function negates real and imaginary components', opts, function test( t ) { - var actual; - var z; - - z = new Complex64( 4.0, 7.0 ); - - actual = cnegf( z ); - - t.strictEqual( realf( actual ), -4.0, 'returns expected value' ); - t.strictEqual( imagf( actual ), -7.0, 'returns expected value' ); - - z = new Complex64( -4.0, -7.0 ); - - actual = cnegf( z ); - - t.strictEqual( realf( actual ), 4.0, 'returns expected value' ); - t.strictEqual( imagf( actual ), 7.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `NaN` if provided `NaN`', opts, function test( t ) { - var actual; - var z; - - z = new Complex64( NaN, NaN ); - - actual = cnegf( z ); - - t.strictEqual( isnanf( realf( actual ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( actual ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `+0` if provided `-0`', opts, function test( t ) { - var actual; - var z; - - z = new Complex64( -0.0, -0.0 ); - - actual = cnegf( z ); - - t.strictEqual( isPositiveZerof( realf( actual ) ), true, 'returns expected value' ); - t.strictEqual( isPositiveZerof( imagf( actual ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `-0` if provided `+0`', opts, function test( t ) { - var actual; - var z; - - z = new Complex64( +0.0, +0.0 ); - - actual = cnegf( z ); - - t.strictEqual( isNegativeZerof( realf( actual ) ), true, 'returns expected value' ); - t.strictEqual( isNegativeZerof( imagf( actual ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `-infinity` if provided `+infinity`', opts, function test( t ) { - var actual; - var z; - - z = new Complex64( PINF, PINF ); - - actual = cnegf( z ); - - t.strictEqual( realf( actual ), NINF, 'returns expected value' ); - t.strictEqual( imagf( actual ), NINF, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `+infinity` if provided `-infinity`', opts, function test( t ) { - var actual; - var z; - - z = new Complex64( NINF, NINF ); - - actual = cnegf( z ); - - t.strictEqual( realf( actual ), PINF, 'returns expected value' ); - t.strictEqual( imagf( actual ), PINF, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/package.json b/float32/base/package.json deleted file mode 100644 index 0d003d33..00000000 --- a/float32/base/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@stdlib/complex/float32/base", - "version": "0.0.0", - "description": "Base (i.e., lower-level) single-precision complex number functions.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "lib/index.js", - "directories": { - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "types", - "complex", - "cmplx", - "number", - "namespace", - "ns", - "float32", - "base" - ], - "__stdlib__": { - "scaffold": { - "alias_prefix": "stdlib_base_complex64_" - } - } -} diff --git a/float32/base/scale/README.md b/float32/base/scale/README.md deleted file mode 100644 index abfadef1..00000000 --- a/float32/base/scale/README.md +++ /dev/null @@ -1,263 +0,0 @@ - - -# scale - -> Scale a single-precision complex floating-point number by a real-valued single-precision floating-point scalar constant. - -
- -
- - - -
- -## Usage - -```javascript -var scale = require( '@stdlib/complex/float32/base/scale' ); -``` - -#### scale( alpha, c ) - -Scales a single-precision complex floating-point number by a real-valued single-precision floating-point scalar constant. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var c = new Complex64( 5.0, 3.0 ); - -var v = scale( 5.0, c ); -// returns [ 25.0, 15.0 ] -``` - -The function supports the following parameters: - -- **alpha**: real-valued scalar constant. -- **c**: [complex number][@stdlib/complex/float32/ctor]. - -#### scale.assign( alpha, re1, im1, out, strideOut, offsetOut ) - -Scales a single-precision complex floating-point number by a real-valued single-precision floating-point scalar constant and assigns results to a provided output array. - -```javascript -var Float32Array = require( '@stdlib/array/float32' ); - -var out = new Float32Array( 2 ); -var v = scale.assign( 5.0, 5.0, 3.0, out, 1, 0 ); -// returns [ 25.0, 15.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **alpha**: real-valued scalar constant. -- **re**: real component of the complex number. -- **im**: imaginary component of the complex number. -- **out**: output array. -- **strideOut**: stride length for `out`. -- **offsetOut**: starting index for `out`. - -#### scale.strided( alpha, c, sc, oc, out, so, oo ) - -Scales a single-precision complex floating-point number stored in a real-valued strided array view by a real-valued single-precision floating-point scalar constant and assigns results to a provided strided output array. - -```javascript -var Float32Array = require( '@stdlib/array/float32' ); - -var c = new Float32Array( [ 5.0, 3.0 ] ); -var out = new Float32Array( 2 ); - -var v = scale.strided( 5.0, c, 1, 0, out, 1, 0 ); -// returns [ 25.0, 15.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **alpha**: real-valued scalar constant. -- **c**: complex number strided array view. -- **sc**: stride length for `c`. -- **oc**: starting index for `c`. -- **out**: output array. -- **so**: stride length for `out`. -- **oo**: starting index for `out`. - -
- - - -
- -## Examples - - - -```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var scale = require( '@stdlib/complex/float32/base/scale' ); - -// Generate an array of random values: -var values = new Complex64Array( discreteUniform( 200, -50, 50 ) ); - -// Scale each by a scalar constant: -logEachMap( '%0.1f * (%s) = %s', 5.0, values, scale ); -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float32/base/scale.h" -``` - -#### stdlib_base_complex64_scale( alpha, c ) - -Scales a single-precision complex floating-point number by a real-valued single-precision floating-point scalar constant. - -```c -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/real.h" -#include "stdlib/complex/float32/imag.h" - -stdlib_complex64_t c = stdlib_complex64( 5.0f, 3.0f ); - -stdlib_complex64_t out = stdlib_base_complex64_scale( 5.0f, c ); - -float re = stdlib_complex64_real( out ); -// returns 25.0f - -float im = stdlib_complex64_imag( out ); -// returns 15.0f -``` - -The function accepts the following arguments: - -- **alpha**: `[in] float` scalar constant. -- **c**: `[in] stdlib_complex64_t` complex number. - -```c -stdlib_complex64_t stdlib_base_complex64_scale( const float alpha, const stdlib_complex64_t c ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float32/base/scale.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 3.14f, 1.5f ), - stdlib_complex64( -3.14f, 1.5f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - stdlib_complex64_t v; - stdlib_complex64_t y; - float re; - float im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex64_reim( v, &re, &im ); - printf( "c = %f + %fi\n", re, im ); - - y = stdlib_base_complex64_scale( 5.0f, v ); - stdlib_complex64_reim( y, &re, &im ); - printf( "scale(5.0, c) = %f + %fi\n", re, im ); - } -} -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/float32/base/scale/benchmark/benchmark.assign.js b/float32/base/scale/benchmark/benchmark.assign.js deleted file mode 100644 index 53977e19..00000000 --- a/float32/base/scale/benchmark/benchmark.assign.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Float32Array = require( '@stdlib/array/float32' ); -var pkg = require( './../package.json' ).name; -var scale = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float32' -}; - - -// MAIN // - -bench( pkg+':assign', function benchmark( b ) { - var out; - var re; - var im; - var N; - var i; - var j; - - N = 100; - re = uniform( N, -500.0, 500.0, options ); - im = uniform( N, -500.0, 500.0, options ); - - out = new Float32Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = i % N; - out = scale.assign( 5.0, re[ j ], im[ j ], out, 1, 0 ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( out[ 0 ] ) || isnanf( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/scale/benchmark/benchmark.js b/float32/base/scale/benchmark/benchmark.js deleted file mode 100644 index 8a1b608f..00000000 --- a/float32/base/scale/benchmark/benchmark.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var pkg = require( './../package.json' ).name; -var scale = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = scale( 5.0, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( out ) ) || isnanf( imagf( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/scale/benchmark/benchmark.native.js b/float32/base/scale/benchmark/benchmark.native.js deleted file mode 100644 index d326afd9..00000000 --- a/float32/base/scale/benchmark/benchmark.native.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); -var pkg = require( './../package.json' ).name; - - -// VARIABLES // - -var scale = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( scale instanceof Error ) -}; - - -// MAIN // - -bench( pkg+'::native', opts, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = scale( 5.0, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( out ) ) || isnanf( imagf( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/scale/benchmark/benchmark.strided.js b/float32/base/scale/benchmark/benchmark.strided.js deleted file mode 100644 index 2aefff0e..00000000 --- a/float32/base/scale/benchmark/benchmark.strided.js +++ /dev/null @@ -1,66 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Float32Array = require( '@stdlib/array/float32' ); -var pkg = require( './../package.json' ).name; -var scale = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float32' -}; - - -// MAIN // - -bench( pkg+':strided', function benchmark( b ) { - var out; - var z1; - var N; - var i; - var j; - - N = 50; - z1 = uniform( N*2, -500.0, 500.0, options ); - - out = new Float32Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = ( i % N ) * 2; - out = scale.strided( 5.0, z1, 1, j, out, 1, 0 ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( out[ 0 ] ) || isnanf( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/scale/benchmark/c/Makefile b/float32/base/scale/benchmark/c/Makefile deleted file mode 100644 index 85a01e54..00000000 --- a/float32/base/scale/benchmark/c/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/scale/benchmark/c/benchmark.c b/float32/base/scale/benchmark/c/benchmark.c deleted file mode 100644 index b39656dd..00000000 --- a/float32/base/scale/benchmark/c/benchmark.c +++ /dev/null @@ -1,140 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include -#include -#include -#include - -#define NAME "cscale" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - float re; - float im; - double t; - int i; - - float complex z1; - float complex z2; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z1 = re + im*I; - - re = creal( z1 ) * 5.0f; - im = cimag( z1 ) * 5.0f; - z2 = re + im*I; - if ( z2 != z2 ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( z2 != z2 ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/base/scale/benchmark/c/native/Makefile b/float32/base/scale/benchmark/c/native/Makefile deleted file mode 100644 index a4bd7b38..00000000 --- a/float32/base/scale/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/scale/benchmark/c/native/benchmark.c b/float32/base/scale/benchmark/c/native/benchmark.c deleted file mode 100644 index 56abbb9a..00000000 --- a/float32/base/scale/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,142 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/scale.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include -#include -#include -#include -#include - -#define NAME "scale" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - float re; - float im; - double t; - int i; - - stdlib_complex64_t z1; - stdlib_complex64_t z2; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z1 = stdlib_complex64( re, im ); - - z2 = stdlib_base_complex64_scale( 5.0f, z1 ); - stdlib_complex64_reim( z2, &re, &im ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/base/scale/benchmark/julia/REQUIRE b/float32/base/scale/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float32/base/scale/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float32/base/scale/benchmark/julia/benchmark.jl b/float32/base/scale/benchmark/julia/benchmark.jl deleted file mode 100644 index 64548604..00000000 --- a/float32/base/scale/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "scale"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark ComplexF32( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) * 5.0 samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float32/base/scale/binding.gyp b/float32/base/scale/binding.gyp deleted file mode 100644 index 68a1ca11..00000000 --- a/float32/base/scale/binding.gyp +++ /dev/null @@ -1,170 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A `.gyp` file for building a Node.js native add-on. -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # List of files to include in this file: - 'includes': [ - './include.gypi', - ], - - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Target name should match the add-on export name: - 'addon_target_name%': 'addon', - - # Set variables based on the host OS: - 'conditions': [ - [ - 'OS=="win"', - { - # Define the object file suffix: - 'obj': 'obj', - }, - { - # Define the object file suffix: - 'obj': 'o', - } - ], # end condition (OS=="win") - ], # end conditions - }, # end variables - - # Define compile targets: - 'targets': [ - - # Target to generate an add-on: - { - # The target name should match the add-on export name: - 'target_name': '<(addon_target_name)', - - # Define dependencies: - 'dependencies': [], - - # Define directories which contain relevant include headers: - 'include_dirs': [ - # Local include directory: - '<@(include_dirs)', - ], - - # List of source files: - 'sources': [ - '<@(src_files)', - ], - - # Settings which should be applied when a target's object files are used as linker input: - 'link_settings': { - # Define libraries: - 'libraries': [ - '<@(libraries)', - ], - - # Define library directories: - 'library_dirs': [ - '<@(library_dirs)', - ], - }, - - # C/C++ compiler flags: - 'cflags': [ - # Enable commonly used warning options: - '-Wall', - - # Aggressive optimization: - '-O3', - ], - - # C specific compiler flags: - 'cflags_c': [ - # Specify the C standard to which a program is expected to conform: - '-std=c99', - ], - - # C++ specific compiler flags: - 'cflags_cpp': [ - # Specify the C++ standard to which a program is expected to conform: - '-std=c++11', - ], - - # Linker flags: - 'ldflags': [], - - # Apply conditions based on the host OS: - 'conditions': [ - [ - 'OS=="mac"', - { - # Linker flags: - 'ldflags': [ - '-undefined dynamic_lookup', - '-Wl,-no-pie', - '-Wl,-search_paths_first', - ], - }, - ], # end condition (OS=="mac") - [ - 'OS!="win"', - { - # C/C++ flags: - 'cflags': [ - # Generate platform-independent code: - '-fPIC', - ], - }, - ], # end condition (OS!="win") - ], # end conditions - }, # end target <(addon_target_name) - - # Target to copy a generated add-on to a standard location: - { - 'target_name': 'copy_addon', - - # Declare that the output of this target is not linked: - 'type': 'none', - - # Define dependencies: - 'dependencies': [ - # Require that the add-on be generated before building this target: - '<(addon_target_name)', - ], - - # Define a list of actions: - 'actions': [ - { - 'action_name': 'copy_addon', - 'message': 'Copying addon...', - - # Explicitly list the inputs in the command-line invocation below: - 'inputs': [], - - # Declare the expected outputs: - 'outputs': [ - '<(addon_output_dir)/<(addon_target_name).node', - ], - - # Define the command-line invocation: - 'action': [ - 'cp', - '<(PRODUCT_DIR)/<(addon_target_name).node', - '<(addon_output_dir)/<(addon_target_name).node', - ], - }, - ], # end actions - }, # end target copy_addon - ], # end targets -} diff --git a/float32/base/scale/docs/repl.txt b/float32/base/scale/docs/repl.txt deleted file mode 100644 index e8f48e32..00000000 --- a/float32/base/scale/docs/repl.txt +++ /dev/null @@ -1,110 +0,0 @@ - -{{alias}}( alpha, c ) - Scales a single-precision complex floating-point number by a real-valued - single-precision floating-point scalar constant. - - Parameters - ---------- - alpha: number - Scalar constant. - - c: Complex64 - Complex number. - - Returns - ------- - out: Complex64 - Result. - - Examples - -------- - > var c = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ) - - > var out = {{alias}}( 5.0, c ) - - > var re = {{alias:@stdlib/complex/float32/real}}( out ) - 25.0 - > var im = {{alias:@stdlib/complex/float32/imag}}( out ) - 15.0 - - -{{alias}}.assign( alpha, re, im, out, strideOut, offsetOut ) - Scales a single-precision complex floating-point number by a real-valued - single-precision floating-point scalar constant and assigns results to a - provided output array. - - Parameters - ---------- - alpha: number - Scalar constant. - - re: number - Real component of the complex number. - - im: number - Imaginary component of the complex number. - - out: ArrayLikeObject - Output array. - - strideOut: integer - Stride length. - - offsetOut: integer - Starting index. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var out = new {{alias:@stdlib/array/float32}}( 2 ); - > {{alias}}.assign( 5.0, 5.0, 3.0, out, 1, 0 ) - [ 25.0, 15.0 ] - - -{{alias}}.strided( alpha, c, sc, oc, out, so, oo ) - Scales a single-precision complex floating-point number stored in a real- - valued strided array view by a real-valued single-precision floating-point - scalar constant and assigns results to a provided strided output array. - - Parameters - ---------- - alpha: number - Scalar constant. - - c: ArrayLikeObject - Complex number view. - - sc: integer - Stride length for `c`. - - oc: integer - Starting index for `c`. - - out: ArrayLikeObject - Output array. - - so: integer - Stride length for `out`. - - oo: integer - Starting index for `out`. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var c = new {{alias:@stdlib/array/float32}}( [ 5.0, 3.0 ] ); - > var out = new {{alias:@stdlib/array/float32}}( 2 ); - > {{alias}}.strided( 5.0, c, 1, 0, out, 1, 0 ) - [ 25.0, 15.0 ] - - See Also - -------- - diff --git a/float32/base/scale/docs/types/index.d.ts b/float32/base/scale/docs/types/index.d.ts deleted file mode 100644 index ff6b8b6c..00000000 --- a/float32/base/scale/docs/types/index.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex64 } from '@stdlib/types/complex'; -import { Collection, NumericArray } from '@stdlib/types/array'; - -/** -* Interface for scaling a single-precision complex floating-point number. -*/ -interface Scale { - /** - * Scales a single-precision complex floating-point number by a real-valued single-precision floating-point scalar constant. - * - * @param alpha - scalar constant - * @param z - complex number - * @returns result - * - * @example - * var Complex64 = require( './../../../../../float32/ctor' ); - * - * var z = new Complex64( 5.0, 3.0 ); - * - * var out = scale( 5.0, z ); - * // returns [ 25.0, 15.0 ] - */ - ( alpha: number, z: Complex64 ): Complex64; - - /** - * Scales a single-precision complex floating-point number by a real-valued single-precision floating-point scalar constant and assigns results to a provided output array. - * - * @param alpha - scalar constant - * @param re - real component of the complex number - * @param im - imaginary component of the complex number - * @param out - output array - * @param strideOut - stride length - * @param offsetOut - starting index - * @returns output array - * - * @example - * var Float32Array = require( '@stdlib/array/float32' ); - * - * var out = new Float32Array( 2 ); - * var v = scale.assign( 5.0, 5.0, 3.0, out, 1, 0 ); - * // returns [ 25.0, 15.0 ] - * - * var bool = ( out === v ); - * // returns true - */ - assign>( alpha: number, re: number, im: number, out: T, strideOut: number, offsetOut: number ): T; - - /** - * Scales a single-precision complex floating-point number stored in a real-valued strided array view by a real-valued single-precision floating-point scalar constant and assigns results to a provided strided output array. - * - * @param alpha - scalar constant - * @param z - complex number view - * @param strideZ - stride length for `z` - * @param offsetZ - starting index for `z` - * @param out - output array - * @param strideOut - stride length for `out` - * @param offsetOut - starting index for `out` - * @returns output array - * - * @example - * var Float32Array = require( '@stdlib/array/float32' ); - * - * var z = new Float32Array( [ 5.0, 3.0 ] ); - * - * var out = scale.strided( 5.0, z, 1, 0, new Float32Array( 2 ), 1, 0 ); - * // returns [ 25.0, 15.0 ] - */ - strided, U extends NumericArray | Collection>( alpha: number, z: T, strideZ: number, offsetZ: number, out: U, strideOut: number, offsetOut: number ): U; -} - -/** -* Scales a single-precision complex floating-point number by a real-valued single-precision floating-point scalar constant. -* -* @param alpha - scalar constant -* @param z - complex number -* @returns result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var out = scale( 5.0, z ); -* // returns [ 25.0, 15.0 ] -* -* @example -* var Float32Array = require( '@stdlib/array/float32' ); -* -* var out = new Float32Array( 2 ); -* var v = scale.assign( 5.0, 5.0, 3.0, out, 1, 0 ); -* // returns [ 25.0, 15.0 ] -* -* var bool = ( out === v ); -* // returns true -* -* @example -* var Float32Array = require( '@stdlib/array/float32' ); -* -* var z = new Float32Array( [ 5.0, 3.0 ] ); -* -* var out = scale.strided( 5.0, z, 1, 0, new Float32Array( 2 ), 1, 0 ); -* // returns [ 25.0, 15.0 ] -*/ -declare var scale: Scale; - - -// EXPORTS // - -export = scale; diff --git a/float32/base/scale/docs/types/test.ts b/float32/base/scale/docs/types/test.ts deleted file mode 100644 index 09122bf6..00000000 --- a/float32/base/scale/docs/types/test.ts +++ /dev/null @@ -1,296 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64 = require( './../../../../../float32/ctor' ); -import scale = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - const z = new Complex64( 1.0, 1.0 ); - - scale( 5.0, z ); // $ExpectType Complex64 -} - -// The compiler throws an error if the function is provided a first argument which is not a number... -{ - const z = new Complex64( 1.0, 1.0 ); - - scale( true, z ); // $ExpectError - scale( false, z ); // $ExpectError - scale( null, z ); // $ExpectError - scale( undefined, z ); // $ExpectError - scale( '5', z ); // $ExpectError - scale( [], z ); // $ExpectError - scale( {}, z ); // $ExpectError - scale( ( x: number ): number => x, z ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument which is not a complex number... -{ - scale( 5.0, true ); // $ExpectError - scale( 5.0, false ); // $ExpectError - scale( 5.0, null ); // $ExpectError - scale( 5.0, undefined ); // $ExpectError - scale( 5.0, '5' ); // $ExpectError - scale( 5.0, [] ); // $ExpectError - scale( 5.0, {} ); // $ExpectError - scale( 5.0, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z = new Complex64( 1.0, 1.0 ); - - scale(); // $ExpectError - scale( 5.0 ); // $ExpectError - scale( 5.0, z, z ); // $ExpectError -} - -// Attached to the main export is an `assign` method which returns a collection... -{ - scale.assign( 5.0, 1.0, 1.0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - scale.assign( 5.0, 1.0, 1.0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - scale.assign( 5.0, 1.0, 1.0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `assign` method is provided a first argument which is not a number... -{ - const out = new Float32Array( 2 ); - - scale.assign( true, 1.0, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( false, 1.0, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( null, 1.0, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( undefined, 1.0, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( '5', 1.0, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( [], 1.0, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( {}, 1.0, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( ( x: number ): number => x, 1.0, 2.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a second argument which is not a number... -{ - const out = new Float32Array( 2 ); - - scale.assign( 5.0, true, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, false, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, null, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, undefined, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, '5', 2.0, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, [], 2.0, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, {}, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, ( x: number ): number => x, 2.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a third argument which is not a number... -{ - const out = new Float32Array( 2 ); - - scale.assign( 5.0, 1.0, true, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, 1.0, false, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, 1.0, null, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, 1.0, undefined, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, 1.0, '5', out, 1, 0 ); // $ExpectError - scale.assign( 5.0, 1.0, [], out, 1, 0 ); // $ExpectError - scale.assign( 5.0, 1.0, {}, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, 1.0, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fourth argument which is not a collection... -{ - scale.assign( 1.0, 2.0, 3.0, 1, 1, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, true, 1, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, false, 1, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, null, 1, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, undefined, 1, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, '5', 1, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, [ '5' ], 1, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, {}, 1, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fifth argument which is not a number... -{ - const out = new Float32Array( 2 ); - - scale.assign( 1.0, 2.0, 3.0, out, true, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, false, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, null, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, undefined, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, '5', 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, [], 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, {}, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a sixth argument which is not a number... -{ - const out = new Float32Array( 2 ); - - scale.assign( 1.0, 2.0, 3.0, out, 1, true ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, 1, false ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, 1, null ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, 1, undefined ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, 1, '5' ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, 1, [] ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, 1, {} ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided an unsupported number of arguments... -{ - const out = new Float32Array( 2 ); - - scale.assign(); // $ExpectError - scale.assign( 1.0 ); // $ExpectError - scale.assign( 1.0, 2.0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, 1 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, 1, 0, {} ); // $ExpectError -} - -// Attached to the main export is a `strided` method which returns a collection... -{ - const z1 = new Float32Array( 2 ); - - scale.strided( 5.0, z1, 1, 0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - scale.strided( 5.0, z1, 1, 0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - scale.strided( 5.0, z1, 1, 0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `strided` method is provided a first argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const out = new Float32Array( z1.length ); - - scale.strided( true, z1, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( false, z1, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( null, z1, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( undefined, z1, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( '5', z1, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( [ '5' ], z1, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( {}, z1, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( ( x: number ): number => x, z1, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a second argument which is not a collection... -{ - const z1 = new Float32Array( 2 ); - const out = new Float32Array( z1.length ); - - scale.strided( 5.0, true, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, false, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, null, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, undefined, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, '5', 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, [ '5' ], 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, {}, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, ( x: number ): number => x, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a third argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const out = new Float32Array( z1.length ); - - scale.strided( 5.0, z1, true, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, false, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, null, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, undefined, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, '5', 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, [], 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, {}, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, ( x: number ): number => x, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fourth argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const out = new Float32Array( 2 ); - - scale.strided( 5.0, z1, 1, true, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, false, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, null, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, undefined, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, '5', out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, [], out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, {}, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fifth argument which is not a collection... -{ - const z1 = new Float32Array( 2 ); - - scale.strided( 5.0, z1, 1, 0, true, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, false, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, null, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, undefined, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, '5', 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, [ '5' ], 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, {}, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a sixth argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const out = new Float32Array( z1.length ); - - scale.strided( 5.0, z1, 1, 0, out, true, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, false, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, null, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, undefined, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, '5', 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, [], 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, {}, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a seventh argument which is not a number... -{ - const z1 = new Float32Array( 2 ); - const out = new Float32Array( z1.length ); - - scale.strided( 5.0, z1, 1, 0, out, 1, true ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, 1, false ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, 1, null ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, 1, undefined ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, 1, '5' ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, 1, [] ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, 1, {} ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an unsupported number of arguments... -{ - const z1 = new Float32Array( 2 ); - const out = new Float32Array( z1.length ); - - scale.strided(); // $ExpectError - scale.strided( 5.0 ); // $ExpectError - scale.strided( 5.0, z1 ); // $ExpectError - scale.strided( 5.0, z1, 1 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, 1 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, 1, 0, {} ); // $ExpectError -} diff --git a/float32/base/scale/examples/c/Makefile b/float32/base/scale/examples/c/Makefile deleted file mode 100644 index 25ced822..00000000 --- a/float32/base/scale/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/scale/examples/c/example.c b/float32/base/scale/examples/c/example.c deleted file mode 100644 index 2cea242c..00000000 --- a/float32/base/scale/examples/c/example.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/scale.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 3.14f, 1.5f ), - stdlib_complex64( -3.14f, 1.5f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - stdlib_complex64_t v; - stdlib_complex64_t y; - float re; - float im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex64_reim( v, &re, &im ); - printf( "z = %f + %fi\n", re, im ); - - y = stdlib_base_complex64_scale( 5.0f, v ); - stdlib_complex64_reim( y, &re, &im ); - printf( "scale(5.0, z) = %f + %fi\n", re, im ); - } -} diff --git a/float32/base/scale/examples/index.js b/float32/base/scale/examples/index.js deleted file mode 100644 index 93df811b..00000000 --- a/float32/base/scale/examples/index.js +++ /dev/null @@ -1,30 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64Array = require( '@stdlib/array/complex64' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var scale = require( './../lib' ); - -// Generate an array of random values: -var values = new Complex64Array( discreteUniform( 200, -50, 50 ) ); - -// Scale each by a scalar constant: -logEachMap( '%0.1f * (%s) = %s', 5.0, values, scale ); diff --git a/float32/base/scale/include.gypi b/float32/base/scale/include.gypi deleted file mode 100644 index ecfaf82a..00000000 --- a/float32/base/scale/include.gypi +++ /dev/null @@ -1,53 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A GYP include file for building a Node.js native add-on. -# -# Main documentation: -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Source directory: - 'src_dir': './src', - - # Include directories: - 'include_dirs': [ - '[ 25.0, 15.0 ] -*/ -function assign( alpha, re, im, out, strideOut, offsetOut ) { - out[ offsetOut ] = f32( re * alpha ); - out[ offsetOut+strideOut ] = f32( im * alpha ); - return out; -} - - -// EXPORTS // - -module.exports = assign; diff --git a/float32/base/scale/lib/index.js b/float32/base/scale/lib/index.js deleted file mode 100644 index 27e1d720..00000000 --- a/float32/base/scale/lib/index.js +++ /dev/null @@ -1,54 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Scale a single-precision complex floating-point number by a real-valued single-precision floating-point scalar constant. -* -* @module @stdlib/complex/float32/base/scale -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var scale = require( '@stdlib/complex/float32/base/scale' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var out = scale( 5.0, z ); -* // returns [ 25.0, 15.0 ] -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var main = require( './main.js' ); -var assign = require( './assign.js' ); -var strided = require( './strided.js' ); - - -// MAIN // - -setReadOnly( main, 'assign', assign ); -setReadOnly( main, 'strided', strided ); - - -// EXPORTS // - -module.exports = main; - -// exports: { "assign": "main.assign", "strided": "main.strided" } diff --git a/float32/base/scale/lib/main.js b/float32/base/scale/lib/main.js deleted file mode 100644 index ed2488ff..00000000 --- a/float32/base/scale/lib/main.js +++ /dev/null @@ -1,53 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var f32 = require( '@stdlib/number/float64/base/to-float32' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); - - -// MAIN // - -/** -* Scales a single-precision complex floating-point number by a real-valued single-precision floating-point scalar constant. -* -* @param {number} alpha - scalar constant -* @param {Complex64} z - complex number -* @returns {Complex64} result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var out = scale( 5.0, z ); -* // returns [ 25.0, 15.0 ] -*/ -function scale( alpha, z ) { - return new Complex64( f32( realf(z)*alpha ), f32( imagf(z)*alpha ) ); -} - - -// EXPORTS // - -module.exports = scale; diff --git a/float32/base/scale/lib/native.js b/float32/base/scale/lib/native.js deleted file mode 100644 index 04e49e59..00000000 --- a/float32/base/scale/lib/native.js +++ /dev/null @@ -1,53 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex64 = require( './../../../../float32/ctor' ); -var addon = require( './../src/addon.node' ); - - -// MAIN // - -/** -* Scales a single-precision complex floating-point number by a real-valued single-precision floating-point scalar constant. -* -* @private -* @param {number} alpha - scalar constant -* @param {Complex64} z - complex number -* @returns {Complex64} result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var out = scale( 5.0, z ); -* // returns [ 25.0, 15.0 ] -*/ -function scale( alpha, z ) { - var v = addon( alpha, z ); - return new Complex64( v.re, v.im ); -} - - -// EXPORTS // - -module.exports = scale; diff --git a/float32/base/scale/lib/strided.js b/float32/base/scale/lib/strided.js deleted file mode 100644 index 165648d9..00000000 --- a/float32/base/scale/lib/strided.js +++ /dev/null @@ -1,57 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var f32 = require( '@stdlib/number/float64/base/to-float32' ); - - -// MAIN // - -/** -* Scales a single-precision complex floating-point number stored in a real-valued strided array view by a real-valued single-precision floating-point scalar constant and assigns results to a provided strided output array. -* -* @param {number} alpha - scalar constant -* @param {Float32Array} z - complex number view -* @param {integer} strideZ - stride length for `z` -* @param {NonNegativeInteger} offsetZ - starting index for `z` -* @param {Collection} out - output array -* @param {integer} strideOut - stride length for `out` -* @param {NonNegativeInteger} offsetOut - starting index for `out` -* @returns {Collection} output array -* -* @example -* var Float32Array = require( '@stdlib/array/float32' ); -* -* var z = new Float32Array( [ 5.0, 3.0 ] ); -* -* var out = strided( 5.0, z, 1, 0, new Float32Array( 2 ), 1, 0 ); -* // returns [ 25.0, 15.0 ] -*/ -function strided( alpha, z, strideZ, offsetZ, out, strideOut, offsetOut ) { - out[ offsetOut ] = f32( alpha * z[ offsetZ ] ); - out[ offsetOut+strideOut ] = f32( alpha * z[ offsetZ+strideZ ] ); - return out; -} - - -// EXPORTS // - -module.exports = strided; diff --git a/float32/base/scale/manifest.json b/float32/base/scale/manifest.json deleted file mode 100644 index c5511326..00000000 --- a/float32/base/scale/manifest.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/napi/binary", - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - } - ] -} diff --git a/float32/base/scale/package.json b/float32/base/scale/package.json deleted file mode 100644 index dddf99ac..00000000 --- a/float32/base/scale/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "@stdlib/complex/float32/base/scale", - "version": "0.0.0", - "description": "Scale a single-precision complex floating-point number by a real-valued single-precision floating-point scalar constant.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "mul", - "cmul", - "mult", - "multiply", - "multiplication", - "arithmetic", - "complex", - "cmplx", - "number" - ] -} diff --git a/float32/base/scale/src/Makefile b/float32/base/scale/src/Makefile deleted file mode 100644 index 7733b618..00000000 --- a/float32/base/scale/src/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - - -# RULES # - -#/ -# Removes generated files for building an add-on. -# -# @example -# make clean-addon -#/ -clean-addon: - $(QUIET) -rm -f *.o *.node - -.PHONY: clean-addon - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: clean-addon - -.PHONY: clean diff --git a/float32/base/scale/src/addon.c b/float32/base/scale/src/addon.c deleted file mode 100644 index 20a4d768..00000000 --- a/float32/base/scale/src/addon.c +++ /dev/null @@ -1,22 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/scale.h" -#include "stdlib/math/base/napi/binary.h" - -STDLIB_MATH_BASE_NAPI_MODULE_FC_C( stdlib_base_complex64_scale ) diff --git a/float32/base/scale/src/main.c b/float32/base/scale/src/main.c deleted file mode 100644 index 12dc5301..00000000 --- a/float32/base/scale/src/main.c +++ /dev/null @@ -1,51 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/scale.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" - -/** -* Scales a single-precision complex floating-point number by a real-valued single-precision floating-point scalar constant. -* -* @param alpha scalar constant -* @param z input value -* @return result -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* #include "stdlib/complex/float32/real.h" -* #include "stdlib/complex/float32/imag.h" -* -* stdlib_complex64_t z = stdlib_complex64( 5.0f, 3.0f ); -* -* stdlib_complex64_t out = stdlib_base_complex64_scale( 5.0f, z ); -* -* float re = stdlib_complex64_real( out ); -* // returns 25.0f -* -* float im = stdlib_complex64_imag( out ); -* // returns 15.0f -*/ -stdlib_complex64_t stdlib_base_complex64_scale( const float alpha, const stdlib_complex64_t z ) { - float re; - float im; - - stdlib_complex64_reim( z, &re, &im ); - return stdlib_complex64( re * alpha, im * alpha ); -} diff --git a/float32/base/scale/test/test.assign.js b/float32/base/scale/test/test.assign.js deleted file mode 100644 index 6018471a..00000000 --- a/float32/base/scale/test/test.assign.js +++ /dev/null @@ -1,111 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); -var Float32Array = require( '@stdlib/array/float32' ); -var scale = require( './../lib/assign.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof scale, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function scales a complex number', function test( t ) { - var expected; - var out; - var v; - - out = new Float32Array( 2 ); - v = scale( 5.0, 5.0, 3.0, out, 1, 0 ); - - expected = new Float32Array( [ 25.0, 15.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 4 ); - v = scale( 5.0, 5.0, 3.0, out, 2, 0 ); - - expected = new Float32Array( [ 25.0, 0.0, 15.0, 0.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 4 ); - v = scale( 5.0, 5.0, 3.0, out, 2, 1 ); - - expected = new Float32Array( [ 0.0, 25.0, 0.0, 15.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 4 ); - v = scale( 5.0, 5.0, 3.0, out, -2, 3 ); - - expected = new Float32Array( [ 0.0, 15.0, 0.0, 25.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the respective component is `NaN`', function test( t ) { - var expected; - var out; - var v; - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, 15.0 ] ); - - v = scale( 5.0, NaN, 3.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ 25.0, NaN ] ); - - v = scale( 5.0, 5.0, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = scale( 5.0, NaN, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = scale( NaN, 5.0, 3.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/scale/test/test.js b/float32/base/scale/test/test.js deleted file mode 100644 index 4869937e..00000000 --- a/float32/base/scale/test/test.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isMethod = require( '@stdlib/assert/is-method' ); -var scale = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof scale, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'attached to the main export is an `assign` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( scale, 'assign' ), true, 'returns expected value' ); - t.end(); -}); - -tape( 'attached to the main export is a `strided` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( scale, 'strided' ), true, 'returns expected value' ); - t.end(); -}); diff --git a/float32/base/scale/test/test.main.js b/float32/base/scale/test/test.main.js deleted file mode 100644 index 09f847d6..00000000 --- a/float32/base/scale/test/test.main.js +++ /dev/null @@ -1,82 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var scale = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof scale, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function scales a complex number', function test( t ) { - var c1; - var v; - - c1 = new Complex64( 5.0, 3.0 ); - - v = scale( 5.0, c1 ); - - t.strictEqual( realf( v ), 25.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 15.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the respective component is `NaN`', function test( t ) { - var c1; - var v; - - c1 = new Complex64( NaN, 3.0 ); - - v = scale( 5.0, c1 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( imagf( v ), 15.0, 'returns expected value' ); - - c1 = new Complex64( 5.0, NaN ); - - v = scale( 5.0, c1 ); - t.strictEqual( realf( v ), 25.0, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - c1 = new Complex64( NaN, NaN ); - - v = scale( 5.0, c1 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - c1 = new Complex64( 5.0, 3.0 ); - - v = scale( NaN, c1 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/scale/test/test.native.js b/float32/base/scale/test/test.native.js deleted file mode 100644 index e9948903..00000000 --- a/float32/base/scale/test/test.native.js +++ /dev/null @@ -1,91 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var tape = require( 'tape' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var scale = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( scale instanceof Error ) -}; - - -// TESTS // - -tape( 'main export is a function', opts, function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof scale, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function scales a complex number', opts, function test( t ) { - var c1; - var v; - - c1 = new Complex64( 5.0, 3.0 ); - - v = scale( 5.0, c1 ); - - t.strictEqual( realf( v ), 25.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 15.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the respective component is `NaN`', opts, function test( t ) { - var c1; - var v; - - c1 = new Complex64( NaN, 3.0 ); - - v = scale( 5.0, c1 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( imagf( v ), 15.0, 'returns expected value' ); - - c1 = new Complex64( 5.0, NaN ); - - v = scale( 5.0, c1 ); - t.strictEqual( realf( v ), 25.0, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - c1 = new Complex64( NaN, NaN ); - - v = scale( 5.0, c1 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - c1 = new Complex64( 5.0, 3.0 ); - - v = scale( NaN, c1 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/scale/test/test.strided.js b/float32/base/scale/test/test.strided.js deleted file mode 100644 index 7828f4b8..00000000 --- a/float32/base/scale/test/test.strided.js +++ /dev/null @@ -1,104 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); -var Float32Array = require( '@stdlib/array/float32' ); -var scale = require( './../lib/strided.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof scale, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function scales a complex number', function test( t ) { - var expected; - var out; - var c1; - var v; - - c1 = new Float32Array( [ 5.0, 3.0 ] ); - out = new Float32Array( 2 ); - v = scale( 5.0, c1, 1, 0, out, 1, 0 ); - - expected = new Float32Array( [ 25.0, 15.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - c1 = new Float32Array( [ 5.0, 0.0, 3.0, 0.0 ] ); - out = new Float32Array( 4 ); - v = scale( 5.0, c1, 2, 0, out, 2, 0 ); - - expected = new Float32Array( [ 25.0, 0.0, 15.0, 0.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - c1 = new Float32Array( [ 3.0, 5.0 ] ); - out = new Float32Array( 4 ); - v = scale( 5.0, c1, -1, 1, out, -2, 3 ); - - expected = new Float32Array( [ 0.0, 15.0, 0.0, 25.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the respective component is `NaN`', function test( t ) { - var expected; - var out; - var c1; - var v; - - c1 = new Float32Array( [ NaN, 3.0 ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, 15.0 ] ); - - v = scale( 5.0, c1, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - c1 = new Float32Array( [ 5.0, NaN ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ 25.0, NaN ] ); - - v = scale( 5.0, c1, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - c1 = new Float32Array( [ 5.0, 3.0 ] ); - out = new Float32Array( 2 ); - expected = new Float32Array( [ NaN, NaN ] ); - - v = scale( NaN, c1, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/sub/README.md b/float32/base/sub/README.md deleted file mode 100644 index 4a0eecd5..00000000 --- a/float32/base/sub/README.md +++ /dev/null @@ -1,225 +0,0 @@ - - -# csubf - -> Subtract two single-precision complex floating-point numbers. - -
- -
- - - -
- -## Usage - -```javascript -var csubf = require( '@stdlib/complex/float32/base/sub' ); -``` - -#### csubf( z1, z2 ) - -Subtracts two single-precision complex floating-point numbers. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z1 = new Complex64( 5.0, 3.0 ); -var z2 = new Complex64( -2.0, 1.0 ); - -var v = csubf( z1, z2 ); -// returns [ 7.0, 2.0 ] -``` - -
- - - -
- -## Examples - - - -```javascript -var Complex64Array = require( '@stdlib/array/complex64' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var csubf = require( '@stdlib/complex/float32/base/sub' ); - -// Generate arrays of random values: -var z1 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise subtraction: -logEachMap( '(%s) - (%s) = %s', z1, z2, csubf ); -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float32/base/sub.h" -``` - -#### stdlib_base_complex64_sub( z1, z2 ) - -Subtracts two single-precision complex floating-point numbers. - -```c -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/real.h" -#include "stdlib/complex/float32/imag.h" - -stdlib_complex64_t z1 = stdlib_complex64( 5.0f, 3.0f ); -stdlib_complex64_t z2 = stdlib_complex64( -2.0f, 1.0f ); -stdlib_complex64_t out = stdlib_base_complex64_sub( z1, z2 ); - -float re = stdlib_complex64_real( out ); -// returns 7.0f - -float im = stdlib_complex64_imag( out ); -// returns 2.0f -``` - -The function accepts the following arguments: - -- **z1**: `[in] stdlib_complex64_t` input value. -- **z2**: `[in] stdlib_complex64_t` input value. - -```c -stdlib_complex64_t stdlib_base_complex64_sub( const stdlib_complex64_t z1, const stdlib_complex64_t z2 ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float32/base/sub.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 3.14f, 1.5f ), - stdlib_complex64( -3.14f, 1.5f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - stdlib_complex64_t v; - stdlib_complex64_t y; - float re; - float im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex64_reim( v, &re, &im ); - printf( "z = %f + %fi\n", re, im ); - - y = stdlib_base_complex64_sub( v, v ); - stdlib_complex64_reim( y, &re, &im ); - printf( "csubf(z, z) = %f + %fi\n", re, im ); - } -} -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/float32/base/sub/benchmark/benchmark.js b/float32/base/sub/benchmark/benchmark.js deleted file mode 100644 index dc2ffc62..00000000 --- a/float32/base/sub/benchmark/benchmark.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var pkg = require( './../package.json' ).name; -var csubf = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = csubf( z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( out ) ) || isnanf( imagf( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/sub/benchmark/benchmark.native.js b/float32/base/sub/benchmark/benchmark.native.js deleted file mode 100644 index 8d891778..00000000 --- a/float32/base/sub/benchmark/benchmark.native.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); -var pkg = require( './../package.json' ).name; - - -// VARIABLES // - -var csubf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( csubf instanceof Error ) -}; - - -// MAIN // - -bench( pkg+'::native', opts, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = csubf( z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnanf( realf( out ) ) || isnanf( imagf( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/base/sub/benchmark/c/Makefile b/float32/base/sub/benchmark/c/Makefile deleted file mode 100644 index d7adc1ad..00000000 --- a/float32/base/sub/benchmark/c/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/sub/benchmark/c/benchmark.c b/float32/base/sub/benchmark/c/benchmark.c deleted file mode 100644 index 978bd6cd..00000000 --- a/float32/base/sub/benchmark/c/benchmark.c +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include -#include -#include -#include - -#define NAME "csubf" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - float re; - float im; - double t; - int i; - - float complex z1; - float complex z2; - float complex z3; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z1 = re + im*I; - - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z2 = re + im*I; - - z3 = (crealf(z1)-crealf(z2)) + (cimagf(z1)-cimagf(z2))*I; - if ( z3 != z3 ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( z3 != z3 ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/base/sub/benchmark/c/native/Makefile b/float32/base/sub/benchmark/c/native/Makefile deleted file mode 100644 index 7f6bbc4c..00000000 --- a/float32/base/sub/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/sub/benchmark/c/native/benchmark.c b/float32/base/sub/benchmark/c/native/benchmark.c deleted file mode 100644 index 3be1148f..00000000 --- a/float32/base/sub/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,148 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/sub.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include -#include -#include -#include -#include -#include - -#define NAME "csubf" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - float re; - float im; - double t; - int i; - - stdlib_complex64_t z1; - stdlib_complex64_t z2; - stdlib_complex64_t z3; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z1 = stdlib_complex64( re, im ); - - re = ( 1000.0f*rand_float() ) - 500.0f; - im = ( 1000.0f*rand_float() ) - 500.0f; - z2 = stdlib_complex64( re, im ); - - z3 = stdlib_base_complex64_sub( z1, z2 ); - stdlib_complex64_reim( z3, &re, &im ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/base/sub/benchmark/julia/REQUIRE b/float32/base/sub/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float32/base/sub/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float32/base/sub/benchmark/julia/benchmark.jl b/float32/base/sub/benchmark/julia/benchmark.jl deleted file mode 100644 index eaeefe34..00000000 --- a/float32/base/sub/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "csubf"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark ComplexF32( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) - ComplexF32( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float32/base/sub/binding.gyp b/float32/base/sub/binding.gyp deleted file mode 100644 index ad8560b8..00000000 --- a/float32/base/sub/binding.gyp +++ /dev/null @@ -1,170 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A `.gyp` file for building a Node.js native add-on. -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # List of files to include in this file: - 'includes': [ - './include.gypi', - ], - - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Target name should match the add-on export name: - 'addon_target_name%': 'addon', - - # Set variables based on the host OS: - 'conditions': [ - [ - 'OS=="win"', - { - # Define the object file suffix: - 'obj': 'obj', - }, - { - # Define the object file suffix: - 'obj': 'o', - } - ], # end condition (OS=="win") - ], # end conditions - }, # end variables - - # Define compile targets: - 'targets': [ - - # Target to generate an add-on: - { - # The target name should match the add-on export name: - 'target_name': '<(addon_target_name)', - - # Define dependencies: - 'dependencies': [], - - # Define directories which contain relevant include headers: - 'include_dirs': [ - # Local include directory: - '<@(include_dirs)', - ], - - # List of source files: - 'sources': [ - '<@(src_files)', - ], - - # Settings which should be applied when a target's object files are used as linker input: - 'link_settings': { - # Define libraries: - 'libraries': [ - '<@(libraries)', - ], - - # Define library directories: - 'library_dirs': [ - '<@(library_dirs)', - ], - }, - - # C/C++ compiler flags: - 'cflags': [ - # Enable commonly used warning options: - '-Wall', - - # Aggressive optimization: - '-O3', - ], - - # C specific compiler flags: - 'cflags_c': [ - # Specify the C standard to which a program is expected to conform: - '-std=c99', - ], - - # C++ specific compiler flags: - 'cflags_cpp': [ - # Specify the C++ standard to which a program is expected to conform: - '-std=c++11', - ], - - # Linker flags: - 'ldflags': [], - - # Apply conditions based on the host OS: - 'conditions': [ - [ - 'OS=="mac"', - { - # Linker flags: - 'ldflags': [ - '-undefined dynamic_lookup', - '-Wl,-no-pie', - '-Wl,-search_paths_first', - ], - }, - ], # end condition (OS=="mac") - [ - 'OS!="win"', - { - # C/C++ flags: - 'cflags': [ - # Generate platform-independent code: - '-fPIC', - ], - }, - ], # end condition (OS!="win") - ], # end conditions - }, # end target <(addon_target_name) - - # Target to copy a generated add-on to a standard location: - { - 'target_name': 'copy_addon', - - # Declare that the output of this target is not linked: - 'type': 'none', - - # Define dependencies: - 'dependencies': [ - # Require that the add-on be generated before building this target: - '<(addon_target_name)', - ], - - # Define a list of actions: - 'actions': [ - { - 'action_name': 'copy_addon', - 'message': 'Copying addon...', - - # Explicitly list the inputs in the command-line invocation below: - 'inputs': [], - - # Declare the expected outputs: - 'outputs': [ - '<(addon_output_dir)/<(addon_target_name).node', - ], - - # Define the command-line invocation: - 'action': [ - 'cp', - '<(PRODUCT_DIR)/<(addon_target_name).node', - '<(addon_output_dir)/<(addon_target_name).node', - ], - }, - ], # end actions - }, # end target copy_addon - ], # end targets -} diff --git a/float32/base/sub/docs/repl.txt b/float32/base/sub/docs/repl.txt deleted file mode 100644 index c928b38d..00000000 --- a/float32/base/sub/docs/repl.txt +++ /dev/null @@ -1,33 +0,0 @@ - -{{alias}}( z1, z2 ) - Subtracts two single-precision complex floating-point numbers. - - Parameters - ---------- - z1: Complex64 - Complex number. - - z2: Complex64 - Complex number. - - Returns - ------- - out: Complex64 - Result. - - Examples - -------- - > var z1 = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ) - - > var z2 = new {{alias:@stdlib/complex/float32/ctor}}( -2.0, 1.0 ) - - > var out = {{alias}}( z1, z2 ) - - > var re = {{alias:@stdlib/complex/float32/real}}( out ) - 7.0 - > var im = {{alias:@stdlib/complex/float32/imag}}( out ) - 2.0 - - See Also - -------- - diff --git a/float32/base/sub/docs/types/index.d.ts b/float32/base/sub/docs/types/index.d.ts deleted file mode 100644 index aa2ed9bc..00000000 --- a/float32/base/sub/docs/types/index.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex64 } from '@stdlib/types/complex'; - -/** -* Subtracts two single-precision complex floating-point numbers. -* -* @param z1 - complex number -* @param z2 - complex number -* @returns result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( -2.0, 1.0 ); -* -* var out = csubf( z1, z2 ); -* // returns [ 7.0, 2.0 ] -*/ -declare function csubf( z1: Complex64, z2: Complex64 ): Complex64; - - -// EXPORTS // - -export = csubf; diff --git a/float32/base/sub/docs/types/test.ts b/float32/base/sub/docs/types/test.ts deleted file mode 100644 index 90f42562..00000000 --- a/float32/base/sub/docs/types/test.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64 = require( './../../../../../float32/ctor' ); -import csubf = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - const z = new Complex64( 1.0, 1.0 ); - - csubf( z, z ); // $ExpectType Complex64 -} - -// The compiler throws an error if the function is provided a first argument which is not a complex number... -{ - const z = new Complex64( 1.0, 1.0 ); - - csubf( true, z ); // $ExpectError - csubf( false, z ); // $ExpectError - csubf( null, z ); // $ExpectError - csubf( undefined, z ); // $ExpectError - csubf( '5', z ); // $ExpectError - csubf( [], z ); // $ExpectError - csubf( {}, z ); // $ExpectError - csubf( ( x: number ): number => x, z ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument which is not a complex number... -{ - const z = new Complex64( 1.0, 1.0 ); - - csubf( z, true ); // $ExpectError - csubf( z, false ); // $ExpectError - csubf( z, null ); // $ExpectError - csubf( z, undefined ); // $ExpectError - csubf( z, '5' ); // $ExpectError - csubf( z, [] ); // $ExpectError - csubf( z, {} ); // $ExpectError - csubf( z, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z = new Complex64( 1.0, 1.0 ); - - csubf(); // $ExpectError - csubf( z ); // $ExpectError - csubf( z, z, z ); // $ExpectError -} diff --git a/float32/base/sub/examples/c/Makefile b/float32/base/sub/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float32/base/sub/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/base/sub/examples/c/example.c b/float32/base/sub/examples/c/example.c deleted file mode 100644 index ffa2a143..00000000 --- a/float32/base/sub/examples/c/example.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/sub.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 3.14f, 1.5f ), - stdlib_complex64( -3.14f, 1.5f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - stdlib_complex64_t v; - stdlib_complex64_t y; - float re; - float im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex64_reim( v, &re, &im ); - printf( "z = %f + %fi\n", re, im ); - - y = stdlib_base_complex64_sub( v, v ); - stdlib_complex64_reim( y, &re, &im ); - printf( "csubf(z, z) = %f + %fi\n", re, im ); - } -} diff --git a/float32/base/sub/examples/index.js b/float32/base/sub/examples/index.js deleted file mode 100644 index 6d5b9d90..00000000 --- a/float32/base/sub/examples/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64Array = require( '@stdlib/array/complex64' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var csubf = require( './../lib' ); - -// Generate arrays of random values: -var z1 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise subtraction: -logEachMap( '(%s) - (%s) = %s', z1, z2, csubf ); diff --git a/float32/base/sub/include.gypi b/float32/base/sub/include.gypi deleted file mode 100644 index 5c60648e..00000000 --- a/float32/base/sub/include.gypi +++ /dev/null @@ -1,53 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A GYP include file for building a Node.js native add-on. -# -# Main documentation: -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Source directory: - 'src_dir': './src', - - # Include directories: - 'include_dirs': [ - '[ 7.0, 2.0 ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float32/base/sub/lib/main.js b/float32/base/sub/lib/main.js deleted file mode 100644 index 4554b401..00000000 --- a/float32/base/sub/lib/main.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var f32 = require( '@stdlib/number/float64/base/to-float32' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); - - -// MAIN // - -/** -* Subtracts two single-precision complex floating-point numbers. -* -* @param {Complex64} z1 - complex number -* @param {Complex64} z2 - complex number -* @returns {Complex64} result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( -2.0, 1.0 ); -* -* var out = csubf( z1, z2 ); -* // returns [ 7.0, 2.0 ] -*/ -function csubf( z1, z2 ) { - var re = f32( realf( z1 ) - realf( z2 ) ); - var im = f32( imagf( z1 ) - imagf( z2 ) ); - return new Complex64( re, im ); -} - - -// EXPORTS // - -module.exports = csubf; diff --git a/float32/base/sub/lib/native.js b/float32/base/sub/lib/native.js deleted file mode 100644 index 0a3eecf8..00000000 --- a/float32/base/sub/lib/native.js +++ /dev/null @@ -1,54 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex64 = require( './../../../../float32/ctor' ); -var addon = require( './../src/addon.node' ); - - -// MAIN // - -/** -* Subtracts two single-precision complex floating-point numbers. -* -* @private -* @param {Complex64} z1 - complex number -* @param {Complex64} z2 - complex number -* @returns {Complex64} result -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z1 = new Complex64( 5.0, 3.0 ); -* var z2 = new Complex64( -2.0, 1.0 ); -* -* var out = csubf( z1, z2 ); -* // returns [ 7.0, 2.0 ] -*/ -function csubf( z1, z2 ) { - var v = addon( z1, z2 ); - return new Complex64( v.re, v.im ); -} - - -// EXPORTS // - -module.exports = csubf; diff --git a/float32/base/sub/manifest.json b/float32/base/sub/manifest.json deleted file mode 100644 index c5511326..00000000 --- a/float32/base/sub/manifest.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/napi/binary", - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/reim" - ] - } - ] -} diff --git a/float32/base/sub/package.json b/float32/base/sub/package.json deleted file mode 100644 index 32490d92..00000000 --- a/float32/base/sub/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "@stdlib/complex/float32/base/sub", - "version": "0.0.0", - "description": "Subtract two single-precision complex floating-point numbers.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "csubtract", - "subtract", - "sub", - "csub", - "csubf", - "subtraction", - "difference", - "sum", - "arithmetic", - "complex", - "cmplx", - "number" - ] -} diff --git a/float32/base/sub/src/Makefile b/float32/base/sub/src/Makefile deleted file mode 100644 index 904c7dc4..00000000 --- a/float32/base/sub/src/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - - -# RULES # - -#/ -# Removes generated files for building an add-on. -# -# @example -# make clean-addon -#/ -clean-addon: - $(QUIET) -rm -f *.o *.node - -.PHONY: clean-addon - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: clean-addon - -.PHONY: clean diff --git a/float32/base/sub/src/addon.c b/float32/base/sub/src/addon.c deleted file mode 100644 index cd96aeb1..00000000 --- a/float32/base/sub/src/addon.c +++ /dev/null @@ -1,22 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/sub.h" -#include "stdlib/math/base/napi/binary.h" - -STDLIB_MATH_BASE_NAPI_MODULE_CC_C( stdlib_base_complex64_sub ) diff --git a/float32/base/sub/src/main.c b/float32/base/sub/src/main.c deleted file mode 100644 index 2a700d29..00000000 --- a/float32/base/sub/src/main.c +++ /dev/null @@ -1,62 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/base/sub.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/reim.h" - -/** -* Subtracts two single-precision complex floating-point numbers. -* -* @param z1 input value -* @param z2 input value -* @return result -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* #include "stdlib/complex/float32/real.h" -* #include "stdlib/complex/float32/imag.h" -* -* stdlib_complex64_t z1 = stdlib_complex64( 5.0f, 3.0f ); -* -* stdlib_complex64_t z2 = stdlib_complex64( -2.0f, 1.0f ); -* -* stdlib_complex64_t out = stdlib_base_complex64_sub( z1, z2 ); -* -* float re = stdlib_complex64_real( out ); -* // returns 7.0f -* -* float im = stdlib_complex64_imag( out ); -* // returns 2.0f -*/ -stdlib_complex64_t stdlib_base_complex64_sub( const stdlib_complex64_t z1, const stdlib_complex64_t z2 ) { - float re1; - float re2; - float im1; - float im2; - float re; - float im; - - stdlib_complex64_reim( z1, &re1, &im1 ); - stdlib_complex64_reim( z2, &re2, &im2 ); - - re = re1 - re2; - im = im1 - im2; - - return stdlib_complex64( re, im ); -} diff --git a/float32/base/sub/test/test.js b/float32/base/sub/test/test.js deleted file mode 100644 index 3f91dc6d..00000000 --- a/float32/base/sub/test/test.js +++ /dev/null @@ -1,110 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var csubf = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof csubf, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function subtracts two complex numbers', function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - - v = csubf( z1, z2 ); - - t.strictEqual( realf( v ), 7.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 2.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the resulting component is `NaN`', function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - - v = csubf( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( imagf( v ), 2.0, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( NaN, 1.0 ); - - v = csubf( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( imagf( v ), 2.0, 'returns expected value' ); - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( NaN, 1.0 ); - - v = csubf( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( imagf( v ), 2.0, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( -2.0, 1.0 ); - - v = csubf( z1, z2 ); - t.strictEqual( realf( v ), 7.0, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, NaN ); - - v = csubf( z1, z2 ); - t.strictEqual( realf( v ), 7.0, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( -2.0, NaN ); - - v = csubf( z1, z2 ); - t.strictEqual( realf( v ), 7.0, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, NaN ); - z2 = new Complex64( NaN, NaN ); - - v = csubf( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/sub/test/test.native.js b/float32/base/sub/test/test.native.js deleted file mode 100644 index bde5905e..00000000 --- a/float32/base/sub/test/test.native.js +++ /dev/null @@ -1,119 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var tape = require( 'tape' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var Complex64 = require( './../../../../float32/ctor' ); -var realf = require( './../../../../float32/real' ); -var imagf = require( './../../../../float32/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var csubf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( csubf instanceof Error ) -}; - - -// TESTS // - -tape( 'main export is a function', opts, function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof csubf, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function subtracts two complex numbers', opts, function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - - v = csubf( z1, z2 ); - - t.strictEqual( realf( v ), 7.0, 'returns expected value' ); - t.strictEqual( imagf( v ), 2.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the resulting component is `NaN`', opts, function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( -2.0, 1.0 ); - - v = csubf( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( imagf( v ), 2.0, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( NaN, 1.0 ); - - v = csubf( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( imagf( v ), 2.0, 'returns expected value' ); - - z1 = new Complex64( NaN, 3.0 ); - z2 = new Complex64( NaN, 1.0 ); - - v = csubf( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( imagf( v ), 2.0, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( -2.0, 1.0 ); - - v = csubf( z1, z2 ); - t.strictEqual( realf( v ), 7.0, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, 3.0 ); - z2 = new Complex64( -2.0, NaN ); - - v = csubf( z1, z2 ); - t.strictEqual( realf( v ), 7.0, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( 5.0, NaN ); - z2 = new Complex64( -2.0, NaN ); - - v = csubf( z1, z2 ); - t.strictEqual( realf( v ), 7.0, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - z1 = new Complex64( NaN, NaN ); - z2 = new Complex64( NaN, NaN ); - - v = csubf( z1, z2 ); - t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); - t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/base/test/test.js b/float32/base/test/test.js deleted file mode 100644 index 2fbefe9d..00000000 --- a/float32/base/test/test.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - - -// TESTS // - -tape( 'main export is an object', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ns, 'object', 'main export is an object' ); - t.end(); -}); - -tape( 'the exported object contains key-value pairs', function test( t ) { - var keys = objectKeys( ns ); - t.strictEqual( keys.length > 0, true, 'has keys' ); - t.end(); -}); diff --git a/float32/conj/README.md b/float32/conj/README.md deleted file mode 100644 index 35a5aa5b..00000000 --- a/float32/conj/README.md +++ /dev/null @@ -1,258 +0,0 @@ - - -# conj - -> Return the [complex conjugate][complex-conjugate] of a single-precision complex floating-point number. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var conj = require( '@stdlib/complex/float32/conj' ); -``` - -#### conj( z ) - -Returns the [complex conjugate][complex-conjugate] of a single-precision complex floating-point number. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z = new Complex64( 5.0, 3.0 ); - -var v = conj( z ); -// returns [ 5.0, -3.0 ] -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - - - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var conj = require( '@stdlib/complex/float32/conj' ); - -function random() { - return new Complex64( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); -} - -// Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex64', random ); -// returns - -// Compute the complex conjugate of each complex number... -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = x.get( i ); - console.log( 'conj(%s) = %s', z.toString(), conj( z ).toString() ); -} -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float32/conj.h" -``` - -#### stdlib_complex64_conj( z ) - -Returns the [complex conjugate][complex-conjugate] of a single-precision complex floating-point number. - -```c -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/real.h" -#include "stdlib/complex/float32/imag.h" - -stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); - -// ... - -stdlib_complex64_t v = stdlib_complex64_conj( z ); - -float re = stdlib_complex64_real( v ); -// returns 5.0f - -float im = stdlib_complex64_imag( v ); -// returns -2.0f -``` - -The function accepts the following arguments: - -- **z**: `[in] stdlib_complex64_t` single-precision complex floating-point number. - -```c -stdlib_complex64_t stdlib_complex64_conj( const stdlib_complex64_t z ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float32/conj.h" -#include "stdlib/complex/float32/real.h" -#include "stdlib/complex/float32/imag.h" -#include "stdlib/complex/float32/ctor.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - stdlib_complex64_t z; - stdlib_complex64_t v; - int i; - for ( i = 0; i < 4; i++ ) { - z = x[ i ]; - v = stdlib_complex64_conj( z ); - printf( "conj(%f + %fi) = %f + %fi\n", stdlib_complex64_real( z ), stdlib_complex64_imag( z ), stdlib_complex64_real( v ), stdlib_complex64_imag( v ) ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float32/conj/benchmark/benchmark.js b/float32/conj/benchmark/benchmark.js deleted file mode 100644 index c246e97f..00000000 --- a/float32/conj/benchmark/benchmark.js +++ /dev/null @@ -1,57 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var isComplex64 = require( '@stdlib/assert/is-complex64' ); -var Complex64 = require( './../../../float32/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var pkg = require( './../package.json' ).name; -var conj = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var v; - var i; - - values = [ - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = conj( values[ i%values.length ] ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isComplex64( v ) ) { - b.fail( 'should return an object' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/conj/benchmark/c/Makefile b/float32/conj/benchmark/c/Makefile deleted file mode 100644 index d7adc1ad..00000000 --- a/float32/conj/benchmark/c/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/conj/benchmark/c/benchmark.c b/float32/conj/benchmark/c/benchmark.c deleted file mode 100644 index a57fe66b..00000000 --- a/float32/conj/benchmark/c/benchmark.c +++ /dev/null @@ -1,137 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include -#include -#include -#include - -#define NAME "conjf" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - float re; - float im; - double t; - int i; - - float complex z; - float complex v; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = rand_float(); - im = rand_float(); - z = re + im*I; - v = conjf( z ); - if ( v != v ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( v != v ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/conj/benchmark/c/native/Makefile b/float32/conj/benchmark/c/native/Makefile deleted file mode 100644 index 7f6bbc4c..00000000 --- a/float32/conj/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/conj/benchmark/c/native/benchmark.c b/float32/conj/benchmark/c/native/benchmark.c deleted file mode 100644 index a9d4b771..00000000 --- a/float32/conj/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/conj.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/real.h" -#include "stdlib/complex/float32/imag.h" -#include -#include -#include -#include -#include -#include - -#define NAME "complex64_conj" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - stdlib_complex64_t z; - stdlib_complex64_t v; - double elapsed; - float re; - float im; - double t; - int i; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = rand_float(); - im = rand_float(); - z = stdlib_complex64( re, im ); - v = stdlib_complex64_conj( z ); - re = stdlib_complex64_real( v ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - im = stdlib_complex64_imag( v ); - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/conj/benchmark/julia/REQUIRE b/float32/conj/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float32/conj/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float32/conj/benchmark/julia/benchmark.jl b/float32/conj/benchmark/julia/benchmark.jl deleted file mode 100644 index 05010caa..00000000 --- a/float32/conj/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "conj"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark conj( ComplexF32( rand(), rand() ) ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float32/conj/docs/repl.txt b/float32/conj/docs/repl.txt deleted file mode 100644 index 715b4cd2..00000000 --- a/float32/conj/docs/repl.txt +++ /dev/null @@ -1,27 +0,0 @@ - -{{alias}}( z ) - Returns the complex conjugate of a single-precision complex floating-point - number. - - Parameters - ---------- - z: Complex64 - Complex number. - - Returns - ------- - out: Complex64 - Complex conjugate. - - Examples - -------- - > var z = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ); - > z.toString() - '5 + 3i' - > var v = {{alias}}( z ); - > v.toString() - '5 - 3i' - - See Also - -------- - diff --git a/float32/conj/docs/types/index.d.ts b/float32/conj/docs/types/index.d.ts deleted file mode 100644 index bdcfc144..00000000 --- a/float32/conj/docs/types/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -import Complex64 = require( './../../../../float32/ctor' ); - -/** -* Returns the complex conjugate of a single-precision complex floating-point number. -* -* @param z - complex number -* @returns complex conjugate -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var v = conj( z ); -* // returns [ 5.0, -3.0 ] -*/ -declare function conj( z: Complex64 ): Complex64; - - -// EXPORTS // - -export = conj; diff --git a/float32/conj/docs/types/test.ts b/float32/conj/docs/types/test.ts deleted file mode 100644 index ff3f3318..00000000 --- a/float32/conj/docs/types/test.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64 = require( './../../../../float32/ctor' ); -import conj = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - conj( new Complex64( 5.0, 3.0 ) ); // $ExpectType Complex64 -} - -// The compiler throws an error if the function is provided an argument that is not a complex number... -{ - conj( 'abc' ); // $ExpectError - conj( 123 ); // $ExpectError - conj( true ); // $ExpectError - conj( false ); // $ExpectError - conj( [] ); // $ExpectError - conj( {} ); // $ExpectError - conj( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - conj(); // $ExpectError - conj( new Complex64( 5.0, 3.0 ), 123 ); // $ExpectError -} diff --git a/float32/conj/examples/c/Makefile b/float32/conj/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float32/conj/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/conj/examples/c/example.c b/float32/conj/examples/c/example.c deleted file mode 100644 index b828b3ca..00000000 --- a/float32/conj/examples/c/example.c +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/conj.h" -#include "stdlib/complex/float32/real.h" -#include "stdlib/complex/float32/imag.h" -#include "stdlib/complex/float32/ctor.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - stdlib_complex64_t z; - stdlib_complex64_t v; - int i; - for ( i = 0; i < 4; i++ ) { - z = x[ i ]; - v = stdlib_complex64_conj( z ); - printf( "conj(%f + %fi) = %f + %fi\n", stdlib_complex64_real( z ), stdlib_complex64_imag( z ), stdlib_complex64_real( v ), stdlib_complex64_imag( v ) ); - } -} diff --git a/float32/conj/examples/index.js b/float32/conj/examples/index.js deleted file mode 100644 index 9dc1b411..00000000 --- a/float32/conj/examples/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64 = require( './../../../float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var conj = require( './../lib' ); - -function random() { - return new Complex64( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); // eslint-disable-line max-len -} - -// Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex64', random ); -// returns - -// Compute the complex conjugate of each complex number... -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); - console.log( 'conj(%s) = %s', z.toString(), conj( z ).toString() ); -} diff --git a/float32/conj/include/stdlib/complex/float32/conj.h b/float32/conj/include/stdlib/complex/float32/conj.h deleted file mode 100644 index 23f96dff..00000000 --- a/float32/conj/include/stdlib/complex/float32/conj.h +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef STDLIB_COMPLEX_FLOAT32_CONJ_H -#define STDLIB_COMPLEX_FLOAT32_CONJ_H - -#include "stdlib/complex/float32/ctor.h" - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Returns the complex conjugate of a single-precision complex floating-point number. -*/ -stdlib_complex64_t stdlib_complex64_conj( const stdlib_complex64_t z ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_FLOAT32_CONJ_H diff --git a/float32/conj/lib/index.js b/float32/conj/lib/index.js deleted file mode 100644 index a168beca..00000000 --- a/float32/conj/lib/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Return the complex conjugate of a single-precision complex floating-point number. -* -* @module @stdlib/complex/float32/conj -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var conj = require( '@stdlib/complex/float32/conj' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var v = conj( z ); -* // returns [ 5.0, -3.0 ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float32/conj/lib/main.js b/float32/conj/lib/main.js deleted file mode 100644 index 645eb30a..00000000 --- a/float32/conj/lib/main.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Returns the complex conjugate of a single-precision complex floating-point number. -* -* @param {Complex64} z - complex number -* @returns {Complex64} complex conjugate -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var v = conj( z ); -* // returns [ 5.0, -3.0 ] -*/ -function conj( z ) { - return new z.constructor( z.re, -z.im ); -} - - -// EXPORTS // - -module.exports = conj; diff --git a/float32/conj/manifest.json b/float32/conj/manifest.json deleted file mode 100644 index 95cb2ef8..00000000 --- a/float32/conj/manifest.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/real", - "@stdlib/complex/float32/imag" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor", - "@stdlib/complex/float32/real", - "@stdlib/complex/float32/imag" - ] - } - ] -} diff --git a/float32/conj/package.json b/float32/conj/package.json deleted file mode 100644 index 4c5c35ad..00000000 --- a/float32/conj/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@stdlib/complex/float32/conj", - "version": "0.0.0", - "description": "Return the complex conjugate of a single-precision complex floating-point number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "number", - "conjugate", - "conj" - ] -} diff --git a/float32/conj/src/main.c b/float32/conj/src/main.c deleted file mode 100644 index cd0c93b9..00000000 --- a/float32/conj/src/main.c +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/conj.h" -#include "stdlib/complex/float32/ctor.h" - -/** -* Returns the complex conjugate of a single-precision complex floating-point number. -* -* @param z single-precision complex floating-point number -* @return complex conjugate -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* #include "stdlib/complex/float32/real.h" -* #include "stdlib/complex/float32/imag.h" -* -* stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); -* -* // ... -* -* stdlib_complex64_t v = stdlib_complex64_conj( z ); -* -* float re = stdlib_complex64_real( v ); -* // returns 5.0f -* -* float im = stdlib_complex64_imag( v ); -* // returns -2.0f -*/ -stdlib_complex64_t stdlib_complex64_conj( const stdlib_complex64_t z ) { - stdlib_complex64_parts_t v; - v.value = z; // cppcheck-suppress unreadVariable - return stdlib_complex64( v.parts[ 0 ], -v.parts[ 1 ] ); -} diff --git a/float32/conj/test/test.js b/float32/conj/test/test.js deleted file mode 100644 index fd06d914..00000000 --- a/float32/conj/test/test.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex64 = require( './../../../float32/ctor' ); -var conj = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof conj, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns the complex conjugate of a complex number', function test( t ) { - var v; - var z; - - z = new Complex64( 3.14, -3.14 ); - v = conj( z ); - t.strictEqual( v.re, 3.140000104904175, 'returns expected value' ); - t.strictEqual( v.im, 3.140000104904175, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/ctor/README.md b/float32/ctor/README.md deleted file mode 100644 index 5ae4fe83..00000000 --- a/float32/ctor/README.md +++ /dev/null @@ -1,547 +0,0 @@ - - -# Complex64 - -> 64-bit complex number. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -``` - -#### Complex64( real, imag ) - -64-bit complex number constructor, where `real` and `imag` are the **real** and **imaginary** components, respectively. - -```javascript -var z = new Complex64( 5.0, 3.0 ); -// returns -``` - -* * * - -## Properties - -#### Complex64.name - -Static property returning the constructor name. - -```javascript -var str = Complex64.name; -// returns 'Complex64' -``` - -#### Complex64.BYTES_PER_ELEMENT - -Size (in bytes) of each component. - -```javascript -var nbytes = Complex64.BYTES_PER_ELEMENT; -// returns 4 -``` - -#### Complex64.prototype.BYTES_PER_ELEMENT - -Size (in bytes) of each component. - -```javascript -var z = new Complex64( 5.0, 3.0 ); - -var nbytes = z.BYTES_PER_ELEMENT; -// returns 4 -``` - -#### Complex64.prototype.byteLength - -Length (in bytes) of a complex number. - -```javascript -var z = new Complex64( 5.0, 3.0 ); - -var nbytes = z.byteLength; -// returns 8 -``` - -### Instance - -A `Complex64` instance has the following properties... - -#### re - -A **read-only** property returning the **real** component. - -```javascript -var z = new Complex64( 5.0, 3.0 ); - -var re = z.re; -// returns 5.0 -``` - -#### im - -A **read-only** property returning the **imaginary** component. - -```javascript -var z = new Complex64( 5.0, -3.0 ); - -var im = z.im; -// returns -3.0 -``` - -* * * - -## Methods - -### Accessor Methods - -These methods do **not** mutate a `Complex64` instance and, instead, return a complex number representation. - -#### Complex64.prototype.toString() - -Returns a `string` representation of a `Complex64` instance. - -```javascript -var z = new Complex64( 5.0, 3.0 ); -var str = z.toString(); -// returns '5 + 3i' - -z = new Complex64( -5.0, -3.0 ); -str = z.toString(); -// returns '-5 - 3i' -``` - -#### Complex64.prototype.toJSON() - -Returns a [JSON][json] representation of a `Complex64` instance. [`JSON.stringify()`][mdn-json-stringify] implicitly calls this method when stringifying a `Complex64` instance. - -```javascript -var z = new Complex64( 5.0, -3.0 ); - -var o = z.toJSON(); -/* - { - "type": "Complex64", - "re": 5.0, - "im": -3.0 - } -*/ -``` - -To [revive][mdn-json-parse] a `Complex64` number from a [JSON][json] `string`, see [@stdlib/complex/float32/reviver][@stdlib/complex/float32/reviver]. - -
- - - -* * * - - - -
- -## Notes - -- Both the **real** and **imaginary** components are stored as single-precision floating-point numbers. - -
- - - -* * * - - - -
- -## Examples - - - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z = new Complex64( 3.0, -2.0 ); - -console.log( 'type: %s', typeof z ); -// => 'type: object' - -console.log( 'str: %s', z ); -// => 'str: 3 - 2i' - -console.log( 'real: %d', z.re ); -// => 'real: 3' - -console.log( 'imaginary: %d', z.im ); -// => 'imaginary: -2' - -console.log( 'JSON: %s', JSON.stringify( z ) ); -// => 'JSON: {"type":"Complex64","re":3,"im":-2}' -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float32/ctor.h" -``` - -#### stdlib_complex64_t - -An opaque type definition for a single-precision complex floating-point number. - -```c -stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); -``` - -#### stdlib_complex64_parts_t - -An opaque type definition for a union for accessing the real and imaginary parts of a single-precision complex floating-point number. - -```c -float realf( const stdlib_complex64_t z ) { - stdlib_complex64_parts_t v; - - // Assign a single-precision complex floating-point number: - v.value = z; - - // Extract the real component: - float re = v.parts[ 0 ]; - - return re; -} - -// ... - -// Create a complex number: -stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); - -// ... - -// Access the real component: -float re = realf( z ); -// returns 5.0f -``` - -The union has the following members: - -- **value**: `stdlib_complex64_t` single-precision complex floating-point number. - -- **parts**: `float[]` array having the following elements: - - - **0**: `float` real component. - - **1**: `float` imaginary component. - -#### stdlib_complex64( real, imag ) - -Returns a single-precision complex floating-point number. - -```c -stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); -``` - -The function accepts the following arguments: - -- **real**: `[in] float` real component. -- **imag**: `[in] float` imaginary component. - -```c -stdlib_complex64_t stdlib_complex64( const float real, const float imag ); -``` - -#### stdlib_complex64_from_float32( real ) - -Converts a single-precision floating-point number to a single-precision complex floating-point number. - -```c -stdlib_complex64_t z = stdlib_complex64_from_float32( 5.0f ); -``` - -The function accepts the following arguments: - -- **real**: `[in] float` real component. - -```c -stdlib_complex64_t stdlib_complex64_from_float32( const float real ); -``` - -#### stdlib_complex64_from_float64( real ) - -Converts a double-precision floating-point number to a single-precision complex floating-point number. - -```c -stdlib_complex64_t z = stdlib_complex64_from_float64( 5.0 ); -``` - -The function accepts the following arguments: - -- **real**: `[in] double` real component. - -```c -stdlib_complex64_t stdlib_complex64_from_float64( const double real ); -``` - -#### stdlib_complex64_from_complex64( z ) - -Converts (copies) a single-precision complex floating-point number to a single-precision complex floating-point number. - -```c -stdlib_complex64_t z1 = stdlib_complex64( 5.0f, 3.0f ); -stdlib_complex64_t z2 = stdlib_complex64_from_complex64( z1 ); -``` - -The function accepts the following arguments: - -- **z**: `[in] stdlib_complex64_t` single-precision complex floating-point number. - -```c -stdlib_complex64_t stdlib_complex64_from_complex64( const stdlib_complex64_t z ); -``` - -#### stdlib_complex64_from_int8( real ) - -Converts a signed 8-bit integer to a single-precision complex floating-point number. - -```c -stdlib_complex64_t z = stdlib_complex64_from_int8( 5 ); -``` - -The function accepts the following arguments: - -- **real**: `[in] int8_t` real component. - -```c -stdlib_complex64_t stdlib_complex64_from_int8( const int8_t real ); -``` - -#### stdlib_complex64_from_uint8( real ) - -Converts an unsigned 8-bit integer to a single-precision complex floating-point number. - -```c -stdlib_complex64_t z = stdlib_complex64_from_uint8( 5 ); -``` - -The function accepts the following arguments: - -- **real**: `[in] uint8_t` real component. - -```c -stdlib_complex64_t stdlib_complex64_from_uint8( const uint8_t real ); -``` - -#### stdlib_complex64_from_int16( real ) - -Converts a signed 16-bit integer to a single-precision complex floating-point number. - -```c -stdlib_complex64_t z = stdlib_complex64_from_int16( 5 ); -``` - -The function accepts the following arguments: - -- **real**: `[in] int16_t` real component. - -```c -stdlib_complex64_t stdlib_complex64_from_int16( const int16_t real ); -``` - -#### stdlib_complex64_from_uint16( real ) - -Converts an unsigned 16-bit integer to a single-precision complex floating-point number. - -```c -stdlib_complex64_t z = stdlib_complex64_from_uint16( 5 ); -``` - -The function accepts the following arguments: - -- **real**: `[in] uint16_t` real component. - -```c -stdlib_complex64_t stdlib_complex64_from_uint16( const uint16_t real ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float32/ctor.h" -#include -#include - -/** -* Return the real component of a single-precision complex floating-point number. -* -* @param z complex number -* @return real component -*/ -static float real( const stdlib_complex64_t z ) { - stdlib_complex64_parts_t v; - - // Assign a single-precision complex floating-point number: - v.value = z; - - // Extract the real component: - float re = v.parts[ 0 ]; - - return re; -} - -/** -* Return the imaginary component of a single-precision complex floating-point number. -* -* @param z complex number -* @return imaginary component -*/ -static float imag( const stdlib_complex64_t z ) { - stdlib_complex64_parts_t v; - - // Assign a single-precision complex floating-point number: - v.value = z; - - // Extract the imaginary component: - float im = v.parts[ 1 ]; - - return im; -} - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - stdlib_complex64_t v; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - printf( "%f + %fi\n", real( v ), imag( v ) ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float32/ctor/benchmark/benchmark.js b/float32/ctor/benchmark/benchmark.js deleted file mode 100644 index 4b894a23..00000000 --- a/float32/ctor/benchmark/benchmark.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var pkg = require( './../package.json' ).name; -var Complex64 = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var z; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = new Complex64( i, i ); - if ( isnan( z ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !( z instanceof Complex64 ) ) { - b.fail( 'should return a complex number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:real', function benchmark( b ) { - var re; - var z; - var i; - - z = new Complex64( randu(), randu() ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - re = z.re; - if ( isnan( re ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( re ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:imag', function benchmark( b ) { - var im; - var z; - var i; - - z = new Complex64( randu(), randu() ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - im = z.im; - if ( isnan( im ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( im ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':toString', function benchmark( b ) { - var o; - var z; - var i; - - z = new Complex64( randu(), randu() ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - o = z.toString(); - if ( typeof o !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof o !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':toJSON', function benchmark( b ) { - var o; - var z; - var i; - - z = new Complex64( randu(), randu() ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - o = z.toJSON(); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/ctor/benchmark/julia/REQUIRE b/float32/ctor/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float32/ctor/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float32/ctor/benchmark/julia/benchmark.jl b/float32/ctor/benchmark/julia/benchmark.jl deleted file mode 100644 index 7fae6c3b..00000000 --- a/float32/ctor/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "complex64"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark ComplexF32( rand(), rand() ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float32/ctor/benchmark/python/benchmark.py b/float32/ctor/benchmark/python/benchmark.py deleted file mode 100644 index 5779ccb9..00000000 --- a/float32/ctor/benchmark/python/benchmark.py +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env python -# -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Benchmark complex.""" - -from __future__ import print_function -import timeit - -NAME = "complex64" -REPEATS = 3 -ITERATIONS = 1000000 - - -def print_version(): - """Print the TAP version.""" - print("TAP version 13") - - -def print_summary(total, passing): - """Print the benchmark summary. - - # Arguments - - * `total`: total number of tests - * `passing`: number of passing tests - - """ - print("#") - print("1.." + str(total)) # TAP plan - print("# total " + str(total)) - print("# pass " + str(passing)) - print("#") - print("# ok") - - -def print_results(elapsed): - """Print benchmark results. - - # Arguments - - * `elapsed`: elapsed time (in seconds) - - # Examples - - ``` python - python> print_results(0.131009101868) - ``` - """ - rate = ITERATIONS / elapsed - - print(" ---") - print(" iterations: " + str(ITERATIONS)) - print(" elapsed: " + str(elapsed)) - print(" rate: " + str(rate)) - print(" ...") - - -def benchmark(): - """Run the benchmark and print benchmark results.""" - setup = "from random import random;" - stmt = "z = complex(float(random()), float(random()))" - - t = timeit.Timer(stmt, setup=setup) - - print_version() - - for i in range(REPEATS): - print("# python::" + NAME) - elapsed = t.timeit(number=ITERATIONS) - print_results(elapsed) - print("ok " + str(i+1) + " benchmark finished") - - print_summary(REPEATS, REPEATS) - - -def main(): - """Run the benchmark.""" - benchmark() - - -if __name__ == "__main__": - main() diff --git a/float32/ctor/docs/repl.txt b/float32/ctor/docs/repl.txt deleted file mode 100644 index cff80d0c..00000000 --- a/float32/ctor/docs/repl.txt +++ /dev/null @@ -1,93 +0,0 @@ - -{{alias}}( real, imag ) - 64-bit complex number constructor. - - Both the real and imaginary components are stored as single-precision - floating-point numbers. - - Parameters - ---------- - real: number - Real component. - - imag: number - Imaginary component. - - Returns - ------- - z: Complex64 - 64-bit complex number. - - z.re: number - Read-only property returning the real component. - - z.im: number - Read-only property returning the imaginary component. - - Examples - -------- - > var z = new {{alias}}( 5.0, 3.0 ) - - > z.re - 5.0 - > z.im - 3.0 - - -{{alias}}.name - Constructor name. - - Examples - -------- - > var str = {{alias}}.name - 'Complex64' - - -{{alias}}.BYTES_PER_ELEMENT - Size (in bytes) of each component. - - Returns - ------- - v: integer - Size (in bytes) of each component. - - Examples - -------- - > var s = {{alias}}.BYTES_PER_ELEMENT - 4 - - -{{alias}}.prototype.BYTES_PER_ELEMENT - Size (in bytes) of each component. - - Returns - ------- - s: integer - Size (in bytes) of each component. - - Examples - -------- - > var z = new {{alias}}( 5.0, 3.0 ) - - > var s = z.BYTES_PER_ELEMENT - 4 - - -{{alias}}.prototype.byteLength - Length (in bytes) of a complex number. - - Returns - ------- - len: integer - Length (in bytes) of a complex number. - - Examples - -------- - > var z = new {{alias}}( 5.0, 3.0 ) - - > var s = z.byteLength - 8 - - See Also - -------- - diff --git a/float32/ctor/docs/types/index.d.ts b/float32/ctor/docs/types/index.d.ts deleted file mode 100644 index 82e030b7..00000000 --- a/float32/ctor/docs/types/index.d.ts +++ /dev/null @@ -1,120 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/** -* 64-bit complex number. -*/ -declare class Complex64 { - /** - * 64-bit complex number constructor. - * - * @param real - real component - * @param imag - imaginary component - * @returns 64-bit complex number - * - * @example - * var z = new Complex64( 5.0, 3.0 ); - * // returns - */ - constructor( real: number, imag: number ); - - /** - * Constructor name. - * - * @example - * var str = Complex64.name; - * // returns 'Complex64' - */ - static readonly name: 'Complex64'; - - /** - * Read-only property returning the real component. - * - * @returns real component - */ - readonly re: number; - - /** - * Read-only property returning the imaginary component. - * - * @returns imaginary component - */ - readonly im: number; - - /** - * Size (in bytes) of each component. - * - * @returns size of each component - * - * @example - * var nbytes = Complex64.BYTES_PER_ELEMENT; - * // returns 4 - */ - readonly BYTES_PER_ELEMENT: 4; - - /** - * Length (in bytes) of a complex number. - * - * @returns byte length - * - * @example - * var z = new Complex64( 5.0, 3.0 ); - * - * var nbytes = z.byteLength; - * // returns 8 - */ - readonly byteLength: 8; - - /** - * Serializes a complex number as a string. - * - * @returns serialized complex number - * - * @example - * var z = new Complex64( 5.0, 3.0 ); - * - * var str = z.toString(); - * // returns '5 + 3i' - */ - toString(): string; - - /** - * Serializes a complex number as a JSON object. - * - * ## Notes - * - * - `JSON.stringify()` implicitly calls this method when stringifying a `Complex64` instance. - * - * - * @returns serialized complex number - * - * @example - * var z = new Complex64( 5.0, 3.0 ); - * - * var obj = z.toJSON(); - * // returns { 'type': 'Complex64', 're': 5.0, 'im': 3.0 } - */ - toJSON(): any; -} - - -// EXPORTS // - -export = Complex64; diff --git a/float32/ctor/docs/types/test.ts b/float32/ctor/docs/types/test.ts deleted file mode 100644 index 8f73174e..00000000 --- a/float32/ctor/docs/types/test.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable @typescript-eslint/no-unused-expressions */ - -import Complex64 = require( './index' ); - - -// TESTS // - -// The function returns a 64-bit complex number with the expected properties... -{ - const x = new Complex64( 5.0, 3.0 ); // $ExpectType Complex64 - - x.im; // $ExpectType number - x.re; // $ExpectType number - x.BYTES_PER_ELEMENT; // $ExpectType 4 - x.byteLength; // $ExpectType 8 -} - -// 64-bit complex number comes with a `toString` method to serialize a complex number as a string... -{ - const x = new Complex64( 5.0, 3.0 ); // $ExpectType Complex64 - - x.toString(); // $ExpectType string -} - -// 64-bit complex number comes with a `toJSON` method to serialize a complex number as a JSON object.... -{ - const x = new Complex64( 5.0, 3.0 ); // $ExpectType Complex64 - - x.toJSON(); // $ExpectType any -} - -// The compiler throws an error if the constructor is invoked without the `new` keyword... -{ - Complex64( 5.0, 3.0 ); // $ExpectError -} - -// The compiler throws an error if the constructor is provided an unsupported number of arguments... -{ - new Complex64( 5.0 ); // $ExpectError - new Complex64( 5.0, 3.0, 1.0 ); // $ExpectError -} diff --git a/float32/ctor/examples/c/Makefile b/float32/ctor/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float32/ctor/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/ctor/examples/c/example.c b/float32/ctor/examples/c/example.c deleted file mode 100644 index 31b58f39..00000000 --- a/float32/ctor/examples/c/example.c +++ /dev/null @@ -1,73 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/ctor.h" -#include -#include - -/** -* Return the real component of a single-precision complex floating-point number. -* -* @param z complex number -* @return real component -*/ -static float real( const stdlib_complex64_t z ) { - stdlib_complex64_parts_t v; - - // Assign a single-precision complex floating-point number: - v.value = z; // cppcheck-suppress unreadVariable - - // Extract the real component: - float re = v.parts[ 0 ]; - - return re; -} - -/** -* Return the imaginary component of a single-precision complex floating-point number. -* -* @param z complex number -* @return imaginary component -*/ -static float imag( const stdlib_complex64_t z ) { - stdlib_complex64_parts_t v; - - // Assign a single-precision complex floating-point number: - v.value = z; // cppcheck-suppress unreadVariable - - // Extract the imaginary component: - float im = v.parts[ 1 ]; - - return im; -} - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - stdlib_complex64_t v; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - printf( "%f + %fi\n", real( v ), imag( v ) ); - } -} diff --git a/float32/ctor/examples/index.js b/float32/ctor/examples/index.js deleted file mode 100644 index 7f515037..00000000 --- a/float32/ctor/examples/index.js +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64 = require( './../lib' ); - -var z = new Complex64( 3.0, -2.0 ); - -console.log( 'type: %s', typeof z ); -// => 'type: object' - -console.log( 'str: %s', z ); -// => 'str: 3 - 2i' - -console.log( 'real: %d', z.re ); -// => 'real: 3' - -console.log( 'imaginary: %d', z.im ); -// => 'imaginary: -2' - -console.log( 'JSON: %s', JSON.stringify( z ) ); -// => 'JSON: {"type":"Complex64","re":3,"im":-2}' diff --git a/float32/ctor/include/stdlib/complex/float32/ctor.h b/float32/ctor/include/stdlib/complex/float32/ctor.h deleted file mode 100644 index a19097c5..00000000 --- a/float32/ctor/include/stdlib/complex/float32/ctor.h +++ /dev/null @@ -1,148 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef STDLIB_COMPLEX_FLOAT32_CTOR_H -#define STDLIB_COMPLEX_FLOAT32_CTOR_H - -#include -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -// Check for C11 support where we can precisely define a complex number and thus avoid issues concerning infinities and NaNs as real and/or imaginary components... (TODO: revisit the following check; similar to NumPy, we may want to check for a compile time variable (e.g., STDLIB_USE_C99_COMPLEX), rather than checking for C11 support, especially if we are not using C11 functionality) -#if defined(_Imaginary_I) && defined(CMPLXF) - -/** -* An opaque type definition for a single-precision complex floating-point number. -*/ -typedef float complex stdlib_complex64_t; - -// If we aren't going to use the native complex number type, we need to define a complex number as an "opaque" struct (here, "opaque" meaning type consumers should **not** be accessing the components directly, but only through dedicated functions) for storing the real and imaginary components... -#else - -/** -* An opaque type definition for a single-precision complex floating-point number. -* -* @example -* stdlib_complex64_t z; -* -* // Set the real component: -* z.re = 5.0f; -* -* // Set the imaginary component: -* z.im = 2.0f; -*/ -typedef struct { - /** - * Real component. - */ - float re; - - /** - * Imaginary component. - */ - float im; -} stdlib_complex64_t; - -#endif - -/** -* An opaque type definition for a union for accessing the real and imaginary parts of a single-precision complex floating-point number. -* -* @example -* float realf( const stdlib_complex64_t z ) { -* stdlib_complex64_parts_t v; -* -* // Assign a single-precision complex floating-point number: -* v.value = z; -* -* // Extract the real component: -* float re = v.parts[ 0 ]; -* -* return re; -* } -* -* // ... -* -* // Create a complex number: -* stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); -* -* // ... -* -* // Access the real component: -* float re = realf( z ); -* // returns 5.0f -*/ -typedef union { - // An opaque type for the output value (e.g., could be a `struct` or a C99 complex number): - stdlib_complex64_t value; - - // Leverage the fact that C99 specifies that complex numbers have the same representation and alignment as a two-element array (see ), where the first element is the real component and the second element is the imaginary component, thus allowing us to create a complex number irrespective of its native data type (e.g., `struct` vs `float complex`): - float parts[ 2 ]; -} stdlib_complex64_parts_t; - -/** -* Returns a single-precision complex floating-point number. -*/ -stdlib_complex64_t stdlib_complex64( const float real, const float imag ); - -/** -* Converts a single-precision floating-point number to a single-precision complex floating-point number. -*/ -stdlib_complex64_t stdlib_complex64_from_float32( const float real ); - -/** -* Converts a double-precision floating-point number to a single-precision complex floating-point number. -*/ -stdlib_complex64_t stdlib_complex64_from_float64( const double real ); - -/** -* Converts (copies) a single-precision complex floating-point number to a single-precision complex floating-point number. -*/ -stdlib_complex64_t stdlib_complex64_from_complex64( const stdlib_complex64_t z ); - -/** -* Converts a signed 8-bit integer to a single-precision complex floating-point number. -*/ -stdlib_complex64_t stdlib_complex64_from_int8( const int8_t real ); - -/** -* Converts an unsigned 8-bit integer to a single-precision complex floating-point number. -*/ -stdlib_complex64_t stdlib_complex64_from_uint8( const uint8_t real ); - -/** -* Converts a signed 16-bit integer to a single-precision complex floating-point number. -*/ -stdlib_complex64_t stdlib_complex64_from_int16( const int16_t real ); - -/** -* Converts an unsigned 16-bit integer to a single-precision complex floating-point number. -*/ -stdlib_complex64_t stdlib_complex64_from_uint16( const uint16_t real ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_FLOAT32_CTOR_H diff --git a/float32/ctor/lib/index.js b/float32/ctor/lib/index.js deleted file mode 100644 index 45597b5e..00000000 --- a/float32/ctor/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* 64-bit complex number constructor. -* -* @module @stdlib/complex/float32/ctor -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* // returns -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float32/ctor/lib/main.js b/float32/ctor/lib/main.js deleted file mode 100644 index 4e446501..00000000 --- a/float32/ctor/lib/main.js +++ /dev/null @@ -1,164 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var setEnumerableReadOnly = require( '@stdlib/utils/define-read-only-property' ); -var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var format = require( '@stdlib/string/format' ); -var toStr = require( './tostring.js' ); -var toJSON = require( './tojson.js' ); - - -// MAIN // - -/** -* 64-bit complex number constructor. -* -* @constructor -* @param {number} real - real component -* @param {number} imag - imaginary component -* @throws {TypeError} must invoke using the `new` keyword -* @throws {TypeError} real component must be a number -* @throws {TypeError} imaginary component must be a number -* @returns {Complex64} 64-bit complex number -* -* @example -* var z = new Complex64( 5.0, 3.0 ); -* // returns -*/ -function Complex64( real, imag ) { - if ( !( this instanceof Complex64 ) ) { - throw new TypeError( 'invalid invocation. Constructor must be called with the `new` keyword.' ); - } - if ( !isNumber( real ) ) { - throw new TypeError( format( 'invalid argument. Real component must be a number. Value: `%s`.', real ) ); - } - if ( !isNumber( imag ) ) { - throw new TypeError( format( 'invalid argument. Imaginary component must be a number. Value: `%s`.', imag ) ); - } - setEnumerableReadOnly( this, 're', float64ToFloat32( real ) ); - setEnumerableReadOnly( this, 'im', float64ToFloat32( imag ) ); - return this; -} - -/** -* Constructor name. -* -* @name name -* @memberof Complex64 -* @readonly -* @type {string} -* @default 'Complex64' -* -* @example -* var name = Complex64.name; -* // returns 'Complex64' -*/ -setReadOnly( Complex64, 'name', 'Complex64' ); - -/** -* Size (in bytes) of each component. -* -* @name BYTES_PER_ELEMENT -* @memberof Complex64 -* @type {integer} -* @returns {integer} size of each component -* -* @example -* var nbytes = Complex64.BYTES_PER_ELEMENT; -* // returns 4 -*/ -setReadOnly( Complex64, 'BYTES_PER_ELEMENT', 4 ); - -/** -* Size (in bytes) of each component. -* -* @name BYTES_PER_ELEMENT -* @memberof Complex64.prototype -* @type {integer} -* @returns {integer} size of each component -* -* @example -* var z = new Complex64( 5.0, 3.0 ); -* -* var nbytes = z.BYTES_PER_ELEMENT; -* // returns 4 -*/ -setReadOnly( Complex64.prototype, 'BYTES_PER_ELEMENT', 4 ); - -/** -* Length (in bytes) of a complex number. -* -* @name byteLength -* @memberof Complex64.prototype -* @type {integer} -* @returns {integer} byte length -* -* @example -* var z = new Complex64( 5.0, 3.0 ); -* -* var nbytes = z.byteLength; -* // returns 8 -*/ -setReadOnly( Complex64.prototype, 'byteLength', 8 ); - -/** -* Serializes a complex number as a string. -* -* @name toString -* @memberof Complex64.prototype -* @type {Function} -* @returns {string} serialized complex number -* -* @example -* var z = new Complex64( 5.0, 3.0 ); -* -* var str = z.toString(); -* // returns '5 + 3i' -*/ -setReadOnly( Complex64.prototype, 'toString', toStr ); - -/** -* Serializes a complex number as a JSON object. -* -* ## Notes -* -* - `JSON.stringify()` implicitly calls this method when stringifying a `Complex64` instance. -* -* @name toJSON -* @memberof Complex64.prototype -* @type {Function} -* @returns {Object} serialized complex number -* -* @example -* var z = new Complex64( 5.0, 3.0 ); -* -* var obj = z.toJSON(); -* // returns { 'type': 'Complex64', 're': 5.0, 'im': 3.0 } -*/ -setReadOnly( Complex64.prototype, 'toJSON', toJSON ); - - -// EXPORTS // - -module.exports = Complex64; diff --git a/float32/ctor/lib/tojson.js b/float32/ctor/lib/tojson.js deleted file mode 100644 index 79948378..00000000 --- a/float32/ctor/lib/tojson.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Serializes a complex number as a JSON object. -* -* @private -* @returns {Object} JSON representation -*/ -function toJSON() { - /* eslint-disable no-invalid-this */ - var out = {}; - out.type = 'Complex64'; - out.re = this.re; - out.im = this.im; - return out; -} - - -// EXPORTS // - -module.exports = toJSON; diff --git a/float32/ctor/lib/tostring.js b/float32/ctor/lib/tostring.js deleted file mode 100644 index d57bdc16..00000000 --- a/float32/ctor/lib/tostring.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Serializes a complex number as a string. -* -* @private -* @returns {string} serialized complex number -*/ -function toString() { // eslint-disable-line stdlib/no-redeclare - /* eslint-disable no-invalid-this */ - var str = '' + this.re; - if ( this.im < 0 ) { - str += ' - ' + (-this.im); - } else { - str += ' + ' + this.im; - } - str += 'i'; - return str; -} - - -// EXPORTS // - -module.exports = toString; diff --git a/float32/ctor/manifest.json b/float32/ctor/manifest.json deleted file mode 100644 index 04e61e36..00000000 --- a/float32/ctor/manifest.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "options": {}, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [] - } - ] -} diff --git a/float32/ctor/package.json b/float32/ctor/package.json deleted file mode 100644 index d789199f..00000000 --- a/float32/ctor/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "@stdlib/complex/float32/ctor", - "version": "0.0.0", - "description": "64-bit complex number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "types", - "data", - "structure", - "constructor", - "ctor", - "complex", - "complex64", - "64-bit", - "float32", - "float", - "single", - "single-precision", - "ieee754" - ] -} diff --git a/float32/ctor/src/main.c b/float32/ctor/src/main.c deleted file mode 100644 index f1bfb9fb..00000000 --- a/float32/ctor/src/main.c +++ /dev/null @@ -1,151 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/ctor.h" -#include - -/** -* Returns a single-precision complex floating-point number. -* -* @param real real component -* @param imag imaginary component -* @return single-precision complex floating-point number -* -* @example -* stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); -*/ -stdlib_complex64_t stdlib_complex64( const float real, const float imag ) { - stdlib_complex64_parts_t z; - z.parts[ 0 ] = real; - z.parts[ 1 ] = imag; // cppcheck-suppress unreadVariable - return z.value; -} - -/** -* Converts a single-precision floating-point number to a single-precision complex floating-point number. -* -* @param real real component -* @return single-precision complex floating-point number -* -* @example -* stdlib_complex64_t z = stdlib_complex64_from_float32( 5.0f ); -*/ -stdlib_complex64_t stdlib_complex64_from_float32( const float real ) { - stdlib_complex64_parts_t z; - z.parts[ 0 ] = real; - z.parts[ 1 ] = 0.0f; // cppcheck-suppress unreadVariable - return z.value; -} - -/** -* Converts a double-precision floating-point number to a single-precision complex floating-point number. -* -* @param real real component -* @return single-precision complex floating-point number -* -* @example -* stdlib_complex64_t z = stdlib_complex64_from_float64( 5.0 ); -*/ -stdlib_complex64_t stdlib_complex64_from_float64( const double real ) { - stdlib_complex64_parts_t z; - z.parts[ 0 ] = (float)real; - z.parts[ 1 ] = 0.0f; // cppcheck-suppress unreadVariable - return z.value; -} - -/** -* Converts (copies) a single-precision complex floating-point number to a single-precision complex floating-point number. -* -* @param z single-precision complex floating-point number -* @return single-precision complex floating-point number -* -* @example -* stdlib_complex64_t z1 = stdlib_complex64( 5.0f, 3.0f ); -* stdlib_complex64_t z2 = stdlib_complex64_from_complex64( z1 ); -*/ -stdlib_complex64_t stdlib_complex64_from_complex64( const stdlib_complex64_t z ) { - stdlib_complex64_parts_t v1 = { z }; - stdlib_complex64_parts_t v2; - v2.parts[ 0 ] = v1.parts[ 0 ]; - v2.parts[ 1 ] = v1.parts[ 1 ]; // cppcheck-suppress unreadVariable - return v2.value; -} - -/** -* Converts a signed 8-bit integer to a single-precision complex floating-point number. -* -* @param real real component -* @return single-precision complex floating-point number -* -* @example -* stdlib_complex64_t z = stdlib_complex64_from_int8( 5 ); -*/ -stdlib_complex64_t stdlib_complex64_from_int8( const int8_t real ) { - stdlib_complex64_parts_t z; - z.parts[ 0 ] = (float)real; - z.parts[ 1 ] = 0.0f; // cppcheck-suppress unreadVariable - return z.value; -} - -/** -* Converts an unsigned 8-bit integer to a single-precision complex floating-point number. -* -* @param real real component -* @return single-precision complex floating-point number -* -* @example -* stdlib_complex64_t z = stdlib_complex64_from_uint8( 5 ); -*/ -stdlib_complex64_t stdlib_complex64_from_uint8( const uint8_t real ) { - stdlib_complex64_parts_t z; - z.parts[ 0 ] = (float)real; - z.parts[ 1 ] = 0.0f; // cppcheck-suppress unreadVariable - return z.value; -} - -/** -* Converts a signed 16-bit integer to a single-precision complex floating-point number. -* -* @param real real component -* @return single-precision complex floating-point number -* -* @example -* stdlib_complex64_t z = stdlib_complex64_from_int16( 5 ); -*/ -stdlib_complex64_t stdlib_complex64_from_int16( const int16_t real ) { - stdlib_complex64_parts_t z; - z.parts[ 0 ] = (float)real; - z.parts[ 1 ] = 0.0f; // cppcheck-suppress unreadVariable - return z.value; -} - -/** -* Converts an unsigned 16-bit integer to a single-precision complex floating-point number. -* -* @param real real component -* @return single-precision complex floating-point number -* -* @example -* stdlib_complex64_t z = stdlib_complex64_from_uint16( 5 ); -*/ -stdlib_complex64_t stdlib_complex64_from_uint16( const uint16_t real ) { - stdlib_complex64_parts_t z; - z.parts[ 0 ] = (float)real; - z.parts[ 1 ] = 0.0f; // cppcheck-suppress unreadVariable - return z.value; -} diff --git a/float32/ctor/test/test.js b/float32/ctor/test/test.js deleted file mode 100644 index 810e16bb..00000000 --- a/float32/ctor/test/test.js +++ /dev/null @@ -1,224 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); -var Complex64 = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof Complex64, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function is a constructor', function test( t ) { - var z = new Complex64( 5.0, 3.0 ); - t.strictEqual( z instanceof Complex64, true, 'is an instance' ); - t.end(); -}); - -tape( 'the constructor throws an error if provided a real component which is not a number', function test( t ) { - var values; - var i; - - values = [ - '5', - null, - void 0, - true, - false, - [], - {}, - function noop() {} - ]; - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var z = new Complex64( value, 3.0 ); // eslint-disable-line no-unused-vars - }; - } -}); - -tape( 'the constructor throws an error if provided an imaginary component which is not a number', function test( t ) { - var values; - var i; - - values = [ - '5', - null, - void 0, - true, - false, - [], - {}, - function noop() {} - ]; - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var z = new Complex64( 5.0, value ); // eslint-disable-line no-unused-vars - }; - } -}); - -tape( 'the constructor requires the `new` keyword', function test( t ) { - var ctor = Complex64; - t.throws( foo, TypeError, 'throws an error' ); - t.end(); - - function foo() { - ctor( 5.0, 3.0 ); - } -}); - -tape( 'the constructor has a read-only `name` property', function test( t ) { - t.strictEqual( hasOwnProp( Complex64, 'name' ), true, 'has property' ); - t.strictEqual( Complex64.name, 'Complex64', 'returns expected value' ); - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - Complex64.name = 'Foo'; - } -}); - -tape( 'the constructor has a read-only `BYTES_PER_ELEMENT` property', function test( t ) { - t.strictEqual( hasOwnProp( Complex64, 'BYTES_PER_ELEMENT' ), true, 'has property' ); - t.strictEqual( Complex64.BYTES_PER_ELEMENT, 4, 'returns expected value' ); - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - Complex64.BYTES_PER_ELEMENT = 16; - } -}); - -tape( 'the constructor prototype has a read-only `BYTES_PER_ELEMENT` property', function test( t ) { - t.strictEqual( hasOwnProp( Complex64.prototype, 'BYTES_PER_ELEMENT' ), true, 'has property' ); - t.strictEqual( Complex64.prototype.BYTES_PER_ELEMENT, 4, 'returns expected value' ); - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - Complex64.prototype.BYTES_PER_ELEMENT = 16; - } -}); - -tape( 'the constructor prototype has a read-only `byteLength` property', function test( t ) { - t.strictEqual( hasOwnProp( Complex64.prototype, 'byteLength' ), true, 'has property' ); - t.strictEqual( Complex64.prototype.byteLength, 8, 'returns expected value' ); - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - Complex64.prototype.byteLength = 64; - } -}); - -tape( 'the constructor returns an instance having a property for getting the real component', function test( t ) { - var z = new Complex64( 5.0, 3.0 ); - t.strictEqual( z.re, 5.0, 'returns expected value' ); - t.end(); -}); - -tape( 'the constructor returns an instance which throws an error when attempting to mutate the real component', function test( t ) { - var z = new Complex64( 5.0, 3.0 ); - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - z.re = -5.0; - } -}); - -tape( 'the constructor returns an instance having a property for getting the imaginary component', function test( t ) { - var z = new Complex64( 5.0, 3.0 ); - t.strictEqual( z.im, 3.0, 'returns expected value' ); - t.end(); -}); - -tape( 'the constructor returns an instance which throws an error when attempting to mutate the imaginary component', function test( t ) { - var z = new Complex64( 5.0, 3.0 ); - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - z.im = -3.0; - } -}); - -tape( 'the constructor returns an instance which stores real and imaginary components as single-precision floating-point numbers', function test( t ) { - var z = new Complex64( 3.14, -3.14 ); - - t.strictEqual( z.re, 3.140000104904175, 'stores as single-precision' ); - t.strictEqual( z.im, -3.140000104904175, 'stores as single-precision' ); - - t.end(); -}); - -tape( 'the constructor returns an instance which supports serializing an instance as a string', function test( t ) { - var z; - - z = new Complex64( 5.0, -3.0 ); - t.strictEqual( z.toString(), '5 - 3i', 'returns expected value' ); - - z = new Complex64( 5.0, 3.0 ); - t.strictEqual( z.toString(), '5 + 3i', 'returns expected value' ); - - t.end(); -}); - -tape( 'the constructor returns an instance which supports serializing an instance as a JSON object', function test( t ) { - var expected; - var z; - - z = new Complex64( 5.0, -3.0 ); - expected = { - 'type': 'Complex64', - 're': 5.0, - 'im': -3.0 - }; - t.deepEqual( z.toJSON(), expected, 'returns expected value' ); - t.strictEqual( JSON.stringify( z ), JSON.stringify( expected ), 'serializes as JSON when called by JSON.stringify()' ); - - z = new Complex64( 5.0, 3.0 ); - expected = { - 'type': 'Complex64', - 're': 5.0, - 'im': 3.0 - }; - t.deepEqual( z.toJSON(), expected, 'returns expected value' ); - t.strictEqual( JSON.stringify( z ), JSON.stringify( expected ), 'serializes as JSON when called by JSON.stringify()' ); - - t.end(); -}); diff --git a/float32/docs/types/index.d.ts b/float32/docs/types/index.d.ts deleted file mode 100644 index 3a474c5d..00000000 --- a/float32/docs/types/index.d.ts +++ /dev/null @@ -1,151 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/* eslint-disable max-lines */ - -import base = require( './../../../float32/base' ); -import conj = require( './../../../float32/conj' ); -import Complex64 = require( './../../../float32/ctor' ); -import imag = require( './../../../float32/imag' ); -import parseComplex64 = require( './../../../float32/parse' ); -import real = require( './../../../float32/real' ); -import reim = require( './../../../float32/reim' ); -import reviveComplex64 = require( './../../../float32/reviver' ); - -/** -* Interface describing the `float32` namespace. -*/ -interface Namespace { - /** - * Base (i.e., lower-level) single-precision complex number functions. - */ - base: typeof base; - - /** - * Returns the complex conjugate of a single-precision complex floating-point number. - * - * @param z - complex number - * @returns complex conjugate - * - * @example - * var Complex64 = require( './../../../float32/ctor' ); - * - * var z = new Complex64( 5.0, 3.0 ); - * - * var v = ns.conj( z ); - * // returns [ 5.0, -3.0 ] - */ - conj: typeof conj; - - /** - * 64-bit complex number. - */ - Complex64: typeof Complex64; - - /** - * Returns the imaginary component of a single-precision complex floating-point number. - * - * @param z - complex number - * @returns imaginary component - * - * @example - * var Complex64 = require( './../../../float32/ctor' ); - * - * var z = new Complex64( 5.0, 3.0 ); - * - * var im = ns.imag( z ); - * // returns 3.0 - */ - imag: typeof imag; - - /** - * Parse a string representation of a 64-bit complex number. - * - * @param str - string representation of a complex number - * @throws must provide a string recognized as a complex number - * @returns Complex64 instance - * - * @example - * var str = '5 + 3i'; - * - * var z = ns.parseComplex64( str ); - * // returns - */ - parseComplex64: typeof parseComplex64; - - /** - * Returns the real component of a single-precision complex floating-point number. - * - * @param z - complex number - * @returns real component - * - * @example - * var Complex64 = require( './../../../float32/ctor' ); - * - * var z = new Complex64( 5.0, 3.0 ); - * - * var re = ns.real( z ); - * // returns 5.0 - */ - real: typeof real; - - /** - * Returns the real and imaginary components of a single-precision complex floating-point number. - * - * @param z - complex number - * @returns real and imaginary components - * - * @example - * var Complex64 = require( './../../../float32/ctor' ); - * - * var z = new Complex64( 5.0, 3.0 ); - * - * var out = ns.reim( z ); - * // returns [ 5.0, 3.0 ] - */ - reim: typeof reim; - - /** - * Revives a JSON-serialized 64-bit complex number. - * - * @param key - key - * @param value - value - * @returns value or 64-bit complex number - * - * @example - * var parseJSON = require( '@stdlib/utils/parse-json' ); - * - * var str = '{"type":"Complex64","re":5,"im":3}'; - * - * var z = parseJSON( str, ns.reviveComplex64 ); - * // returns - */ - reviveComplex64: typeof reviveComplex64; -} - -/** -* Single-precision complex number functions. -*/ -declare var ns: Namespace; - - -// EXPORTS // - -export = ns; diff --git a/float32/docs/types/test.ts b/float32/docs/types/test.ts deleted file mode 100644 index 2f81653a..00000000 --- a/float32/docs/types/test.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable @typescript-eslint/no-unused-expressions */ - -import ns = require( './index' ); - - -// TESTS // - -// The exported value is the expected interface... -{ - ns; // $ExpectType Namespace -} diff --git a/float32/examples/index.js b/float32/examples/index.js deleted file mode 100644 index 6115ca08..00000000 --- a/float32/examples/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - -console.log( objectKeys( ns ) ); diff --git a/float32/imag/README.md b/float32/imag/README.md deleted file mode 100644 index 4db11112..00000000 --- a/float32/imag/README.md +++ /dev/null @@ -1,239 +0,0 @@ - - -# imag - -> Return the imaginary component of a single-precision complex floating-point number. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var imag = require( '@stdlib/complex/float32/imag' ); -``` - -#### imag( z ) - -Returns the **imaginary** component of a single-precision complex floating-point number. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z = new Complex64( 5.0, 3.0 ); -var im = imag( z ); -// returns 3.0 -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - - - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var imag = require( '@stdlib/complex/float32/imag' ); - -function random() { - return new Complex64( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); -} - -// Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex64', random ); -// returns - -// Retrieve the imaginary component of each complex number... -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); - console.log( 'imag(%s) = %d', z.toString(), imag( z ) ); -} -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float32/imag.h" -``` - -#### stdlib_complex64_imag( z ) - -Returns the imaginary component of a single-precision complex floating-point number. - -```c -#include "stdlib/complex/float32/ctor.h" - -stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); - -// ... - -float im = stdlib_complex64_imag( z ); -// returns 2.0f -``` - -The function accepts the following arguments: - -- **z**: `[in] stdlib_complex64_t` single-precision complex floating-point number. - -```c -float stdlib_complex64_imag( const stdlib_complex64_t z ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float32/imag.h" -#include "stdlib/complex/float32/ctor.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - int i; - for ( i = 0; i < 4; i++ ) { - printf( "imag(v) = %f\n", stdlib_complex64_imag( x[ i ] ) ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float32/imag/benchmark/benchmark.js b/float32/imag/benchmark/benchmark.js deleted file mode 100644 index a6153c52..00000000 --- a/float32/imag/benchmark/benchmark.js +++ /dev/null @@ -1,57 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex64 = require( './../../../float32/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var pkg = require( './../package.json' ).name; -var imag = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var im; - var i; - - values = [ - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - im = imag( values[ i%values.length ] ); - if ( isnanf( im ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnanf( im ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/imag/benchmark/c/Makefile b/float32/imag/benchmark/c/Makefile deleted file mode 100644 index d7adc1ad..00000000 --- a/float32/imag/benchmark/c/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/imag/benchmark/c/benchmark.c b/float32/imag/benchmark/c/benchmark.c deleted file mode 100644 index 828b3fd6..00000000 --- a/float32/imag/benchmark/c/benchmark.c +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include -#include -#include -#include - -#define NAME "cimagf" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - float complex z; - double elapsed; - float re; - float im; - float v; - double t; - int i; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = rand_float(); - im = rand_float(); - z = re + im*I; - v = cimagf( z ); - if ( v != v ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( v != v ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/imag/benchmark/c/native/Makefile b/float32/imag/benchmark/c/native/Makefile deleted file mode 100644 index 7f6bbc4c..00000000 --- a/float32/imag/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/imag/benchmark/c/native/benchmark.c b/float32/imag/benchmark/c/native/benchmark.c deleted file mode 100644 index efeecd23..00000000 --- a/float32/imag/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,139 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/imag.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include -#include -#include -#include -#include - -#define NAME "imag" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - stdlib_complex64_t z; - double elapsed; - float re; - float im; - float v; - double t; - int i; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = rand_float(); - im = rand_float(); - z = stdlib_complex64( re, im ); - v = stdlib_complex64_imag( z ); - if ( v != v ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( v != v ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/imag/benchmark/julia/REQUIRE b/float32/imag/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float32/imag/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float32/imag/benchmark/julia/benchmark.jl b/float32/imag/benchmark/julia/benchmark.jl deleted file mode 100644 index 1e9b0d85..00000000 --- a/float32/imag/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "imag"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark imag( ComplexF32( rand(), rand() ) ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float32/imag/docs/repl.txt b/float32/imag/docs/repl.txt deleted file mode 100644 index dd09c69c..00000000 --- a/float32/imag/docs/repl.txt +++ /dev/null @@ -1,24 +0,0 @@ - -{{alias}}( z ) - Returns the imaginary component of a single-precision complex floating-point - number. - - Parameters - ---------- - z: Complex64 - Complex number. - - Returns - ------- - im: number - Imaginary component. - - Examples - -------- - > var z = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ); - > var im = {{alias}}( z ) - 3.0 - - See Also - -------- - diff --git a/float32/imag/docs/types/index.d.ts b/float32/imag/docs/types/index.d.ts deleted file mode 100644 index e550852e..00000000 --- a/float32/imag/docs/types/index.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex64 } from '@stdlib/types/complex'; - -/** -* Returns the imaginary component of a single-precision complex floating-point number. -* -* @param z - complex number -* @returns imaginary component -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var im = imag( z ); -* // returns 3.0 -*/ -declare function imag( z: Complex64 ): number; - - -// EXPORTS // - -export = imag; diff --git a/float32/imag/docs/types/test.ts b/float32/imag/docs/types/test.ts deleted file mode 100644 index 43341f3b..00000000 --- a/float32/imag/docs/types/test.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64 = require( './../../../../float32/ctor' ); -import imag = require( './index' ); - - -// TESTS // - -// The function returns a number... -{ - imag( new Complex64( 5.0, 3.0 ) ); // $ExpectType number -} - -// The compiler throws an error if the function is provided an argument that is not a complex number... -{ - imag( 'abc' ); // $ExpectError - imag( 123 ); // $ExpectError - imag( true ); // $ExpectError - imag( false ); // $ExpectError - imag( [] ); // $ExpectError - imag( {} ); // $ExpectError - imag( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - imag(); // $ExpectError - imag( new Complex64( 5.0, 3.0 ), 123 ); // $ExpectError -} diff --git a/float32/imag/examples/c/Makefile b/float32/imag/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float32/imag/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/imag/examples/c/example.c b/float32/imag/examples/c/example.c deleted file mode 100644 index e90371ca..00000000 --- a/float32/imag/examples/c/example.c +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/imag.h" -#include "stdlib/complex/float32/ctor.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - int i; - for ( i = 0; i < 4; i++ ) { - printf( "imag(v) = %f\n", stdlib_complex64_imag( x[ i ] ) ); - } -} diff --git a/float32/imag/examples/index.js b/float32/imag/examples/index.js deleted file mode 100644 index 0b0c039d..00000000 --- a/float32/imag/examples/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64 = require( './../../../float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var imag = require( './../lib' ); - -function random() { - return new Complex64( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); // eslint-disable-line max-len -} - -// Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex64', random ); -// returns - -// Retrieve the imaginary component of each complex number... -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); - console.log( 'imag(%s) = %d', z.toString(), imag( z ) ); -} diff --git a/float32/imag/include/stdlib/complex/float32/imag.h b/float32/imag/include/stdlib/complex/float32/imag.h deleted file mode 100644 index 66a06eae..00000000 --- a/float32/imag/include/stdlib/complex/float32/imag.h +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef STDLIB_COMPLEX_FLOAT32_IMAG_H -#define STDLIB_COMPLEX_FLOAT32_IMAG_H - -#include "stdlib/complex/float32/ctor.h" - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Returns the imaginary component of a single-precision complex floating-point number. -*/ -float stdlib_complex64_imag( const stdlib_complex64_t z ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_FLOAT32_IMAG_H diff --git a/float32/imag/lib/index.js b/float32/imag/lib/index.js deleted file mode 100644 index f062d6d9..00000000 --- a/float32/imag/lib/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Return the imaginary component of a single-precision complex floating-point number. -* -* @module @stdlib/complex/float32/imag -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var imag = require( '@stdlib/complex/float32/imag' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var im = imag( z ); -* // returns 3.0 -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float32/imag/lib/main.js b/float32/imag/lib/main.js deleted file mode 100644 index 7d74174e..00000000 --- a/float32/imag/lib/main.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Returns the imaginary component of a single-precision complex floating-point number. -* -* @param {Complex} z - complex number -* @returns {number} imaginary component -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var im = imag( z ); -* // returns 3.0 -*/ -function imag( z ) { - return z.im; -} - - -// EXPORTS // - -module.exports = imag; diff --git a/float32/imag/manifest.json b/float32/imag/manifest.json deleted file mode 100644 index fde543aa..00000000 --- a/float32/imag/manifest.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "options": {}, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor" - ] - } - ] -} diff --git a/float32/imag/package.json b/float32/imag/package.json deleted file mode 100644 index c1a218ae..00000000 --- a/float32/imag/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@stdlib/complex/float32/imag", - "version": "0.0.0", - "description": "Return the imaginary component of a single-precision complex floating-point number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "real", - "re", - "imaginary", - "imag", - "im", - "number" - ] -} diff --git a/float32/imag/src/main.c b/float32/imag/src/main.c deleted file mode 100644 index 1ef6c848..00000000 --- a/float32/imag/src/main.c +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/imag.h" -#include "stdlib/complex/float32/ctor.h" - -/** -* Returns the imaginary component of a single-precision complex floating-point number. -* -* @param z single-precision complex floating-point number -* @return imaginary component -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* -* stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); -* -* // ... -* -* float im = stdlib_complex64_imag( z ); -* // returns 2.0f -*/ -float stdlib_complex64_imag( const stdlib_complex64_t z ) { - stdlib_complex64_parts_t v; - v.value = z; // cppcheck-suppress unreadVariable - return v.parts[ 1 ]; -} diff --git a/float32/imag/test/test.js b/float32/imag/test/test.js deleted file mode 100644 index 74bd96c2..00000000 --- a/float32/imag/test/test.js +++ /dev/null @@ -1,45 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex64 = require( './../../../float32/ctor' ); -var imag = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof imag, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns the imaginary component of a complex number', function test( t ) { - var im; - var z; - - z = new Complex64( 3.14, -3.14 ); - im = imag( z ); - t.strictEqual( im, -3.140000104904175, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/lib/index.js b/float32/lib/index.js deleted file mode 100644 index 3783ec64..00000000 --- a/float32/lib/index.js +++ /dev/null @@ -1,114 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/* -* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name. -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); - - -// MAIN // - -/** -* Top-level namespace. -* -* @namespace ns -*/ -var ns = {}; - -/** -* @name base -* @memberof ns -* @readonly -* @type {Namespace} -* @see {@link module:@stdlib/complex/float32/base} -*/ -setReadOnly( ns, 'base', require( './../../float32/base' ) ); - -/** -* @name conj -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float32/conj} -*/ -setReadOnly( ns, 'conj', require( './../../float32/conj' ) ); - -/** -* @name Complex64 -* @memberof ns -* @readonly -* @constructor -* @see {@link module:@stdlib/complex/float32/ctor} -*/ -setReadOnly( ns, 'Complex64', require( './../../float32/ctor' ) ); - -/** -* @name imag -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float32/imag} -*/ -setReadOnly( ns, 'imag', require( './../../float32/imag' ) ); - -/** -* @name parseComplex64 -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float32/parse} -*/ -setReadOnly( ns, 'parseComplex64', require( './../../float32/parse' ) ); - -/** -* @name real -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float32/real} -*/ -setReadOnly( ns, 'real', require( './../../float32/real' ) ); - -/** -* @name reim -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float32/reim} -*/ -setReadOnly( ns, 'reim', require( './../../float32/reim' ) ); - -/** -* @name reviveComplex64 -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float32/reviver} -*/ -setReadOnly( ns, 'reviveComplex64', require( './../../float32/reviver' ) ); - - -// EXPORTS // - -module.exports = ns; diff --git a/float32/package.json b/float32/package.json deleted file mode 100644 index aee8a40d..00000000 --- a/float32/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "@stdlib/complex/float32", - "version": "0.0.0", - "description": "Single-precision complex number functions.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "lib/index.js", - "directories": { - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "types", - "complex", - "cmplx", - "number", - "namespace", - "ns", - "float32" - ] -} diff --git a/float32/parse/README.md b/float32/parse/README.md deleted file mode 100644 index 9641b348..00000000 --- a/float32/parse/README.md +++ /dev/null @@ -1,133 +0,0 @@ - - -# parseComplex64 - -> Parse a string representation of a 64-bit [complex number][@stdlib/complex/float32/ctor]. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var parseComplex64 = require( '@stdlib/complex/float32/parse' ); -``` - -#### parseComplex64( str ) - -Parses a string representation of a 64-bit [complex number][@stdlib/complex/float32/ctor]. - -```javascript -var parseComplex64 = require( '@stdlib/complex/float32/parse' ); -var real = require( '@stdlib/complex/float32/real' ); -var imag = require( '@stdlib/complex/float32/imag' ); - -var str = '5 + 3i'; - -var z = parseComplex64( str ); -// returns - -var re = real( z ); -// returns 5.0 - -var im = imag( z ); -// returns 3.0 -``` - -For details on the string format, see [Complex64][@stdlib/complex/float32/ctor]. - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var parseComplex64 = require( '@stdlib/complex/float32/parse' ); -var isComplex64 = require( '@stdlib/assert/is-complex64' ); -var real = require( '@stdlib/complex/float32/real' ); -var imag = require( '@stdlib/complex/float32/imag' ); - -var str = '1e3 - 2.75i'; - -var z = parseComplex64( str ); -var bool = isComplex64( z ); -// returns true - -bool = ( real( z ) === 1e3 ); -// returns true - -bool = ( imag( z ) === -2.75 ); -// returns true -``` - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float32/parse/benchmark/benchmark.js b/float32/parse/benchmark/benchmark.js deleted file mode 100644 index a75453f5..00000000 --- a/float32/parse/benchmark/benchmark.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var isComplex64 = require( '@stdlib/assert/is-complex64' ); -var pkg = require( './../package.json' ).name; -var parse = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var str; - var z; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - str = i + ' + ' + (i+1) + 'i'; - z = parse( str ); - if ( !(isComplex64(z)) ) { - b.fail( 'should return a Complex64' ); - } - } - b.toc(); - if ( !(isComplex64(z)) ) { - b.fail( 'should return a Complex64' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/parse/docs/repl.txt b/float32/parse/docs/repl.txt deleted file mode 100644 index a63f2014..00000000 --- a/float32/parse/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( str ) - Parse a string representation of a 64-bit complex number. - - Parameters - ---------- - str: string - String representation of a complex number. - - Returns - ------- - out: Complex64 - 64-bit complex number. - - Examples - -------- - > var str = '5 + 3i'; - > var z = {{alias}}( str ) - - - See Also - -------- diff --git a/float32/parse/docs/types/index.d.ts b/float32/parse/docs/types/index.d.ts deleted file mode 100644 index 1cda6622..00000000 --- a/float32/parse/docs/types/index.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -// MODULES // - -/// - -import { Complex64 } from '@stdlib/types/complex'; - - -/** -* Parse a string representation of a 64-bit complex number. -* -* @param str - string representation of a complex number -* @throws must provide a string recognized as a complex number -* @returns Complex64 instance -* -* @example -* var str = '5 + 3i'; -* -* var z = parseComplex64( str ); -* // returns -*/ -declare function parseComplex64( str: string ): Complex64; - - -// EXPORTS // - -export = parseComplex64; diff --git a/float32/parse/docs/types/test.ts b/float32/parse/docs/types/test.ts deleted file mode 100644 index 5638828d..00000000 --- a/float32/parse/docs/types/test.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import parseComplex64 = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - parseComplex64( '5 + 3.5i' ); // $ExpectType Complex64 - parseComplex64( '3' ); // $ExpectType Complex64 - parseComplex64( '-8i' ); // $ExpectType Complex64 - parseComplex64( '1e3 + 1e-3i' ); // $ExpectType Complex64 - parseComplex64( 'NaN + NaNi' ); // $ExpectType Complex64 - parseComplex64( 'Infinity - Infinityi' ); // $ExpectType Complex64 -} - -// The compiler throws an error if the function is provided a first argument that is not a string... -{ - parseComplex64( true ); // $ExpectError - parseComplex64( false ); // $ExpectError - parseComplex64( null ); // $ExpectError - parseComplex64( undefined ); // $ExpectError - parseComplex64( 5 ); // $ExpectError - parseComplex64( [] ); // $ExpectError - parseComplex64( {} ); // $ExpectError - parseComplex64( ( x: number ): number => x ); // $ExpectError -} diff --git a/float32/parse/examples/index.js b/float32/parse/examples/index.js deleted file mode 100644 index 8df5b014..00000000 --- a/float32/parse/examples/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var isComplex64 = require( '@stdlib/assert/is-complex64' ); -var real = require( './../../../float32/real' ); -var imag = require( './../../../float32/imag' ); -var parseComplex64 = require( './../lib' ); - -var str = '-0.5 + 1.25i'; - -var z = parseComplex64( str ); -console.log( z ); -// => - -var bool = ( isComplex64( z ) ); -console.log( bool ); -// => true - -bool = ( real( z ) === -0.5 ); -console.log( bool ); -// => true - -bool = ( imag( z ) === 1.25 ); -console.log( bool ); -// => true diff --git a/float32/parse/lib/index.js b/float32/parse/lib/index.js deleted file mode 100644 index 7c193147..00000000 --- a/float32/parse/lib/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Parse a string representation of a complex number and returns a Complex64 instance. -* -* @module @stdlib/complex/float32/parse -* -* @example -* var parseComplex64 = require( '@stdlib/complex/float32/parse' ); -* -* var str = '1 + 2i'; -* -* var z = parseComplex64( str ); -* // returns -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float32/parse/lib/main.js b/float32/parse/lib/main.js deleted file mode 100644 index 0a93af77..00000000 --- a/float32/parse/lib/main.js +++ /dev/null @@ -1,90 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var Complex64 = require( './../../../float32/ctor' ); -var replace = require( '@stdlib/string/base/replace' ); -var format = require( '@stdlib/string/format' ); - - -// FUNCTIONS // - -/** -* Matches a complex number string. -* -* @private -* @returns {RegExp} regular expression -* -* @example -* var re = regexp(); -* // returns /^([-+]?(\d*\.?\d*(?:[eE][-+]?\d+)?|Infinity|NaN)i?)?([-+])?((\d*\.?\d*(?:[eE][-+]?\d+)?|Infinity|NaN)i)?$/ -*/ -function regexp() { - return /^([-+]?(\d*\.?\d*(?:[eE][-+]?\d+)?|Infinity|NaN)i?)?([-+])?((\d*\.?\d*(?:[eE][-+]?\d+)?|Infinity|NaN)i)?$/; -} - - -// MAIN // - -/** -* Parse a string representation of a complex number and returns a Complex64 instance. -* -* @param {string} str - string representation of a complex number -* @throws {TypeError} must provide a string -* @throws {Error} must provide a valid string representation of a complex number -* @returns {Complex64} 64-bit complex number -* -* @example -* var str = '1 + 2i'; -* var z = parseComplex64( str ); -* // returns -*/ -function parseComplex64( str ) { - var match; - var re; - var im = 0; - - if ( !isString( str ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) ); - } - - match = replace( str, /\s/g, '' ).match( regexp() ); - if ( !match ) { - throw new Error( format( 'invalid argument. Unable to parse input string as a complex number. Value: `%s`.', str ) ); - } - - // Real part: - re = ( match[1] && !match[1].endsWith( 'i' ) ) ? parseFloat( match[1] ) : 0; - - // Imaginary part: - if ( match[4] ) { - im = ( ( match[3] === '-' ) ? -1 : 1 ) * parseFloat( replace( match[4], /i$/, '' ) ); - } else if ( match[1] && match[1].endsWith( 'i' ) ) { - im = parseFloat( replace( match[1], /i$/, '' ) ); - } - return new Complex64( re, im ); -} - - -// EXPORTS // - -module.exports = parseComplex64; diff --git a/float32/parse/package.json b/float32/parse/package.json deleted file mode 100644 index 0580fe8a..00000000 --- a/float32/parse/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@stdlib/complex/float32/parse", - "version": "0.0.0", - "description": "Parse a string representation of a 64-bit complex number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "utils", - "util", - "utilities", - "utility", - "complex", - "complex64", - "cmplx", - "parse", - "string", - "convert", - "object", - "obj" - ] -} diff --git a/float32/parse/test/test.js b/float32/parse/test/test.js deleted file mode 100644 index c05fc903..00000000 --- a/float32/parse/test/test.js +++ /dev/null @@ -1,192 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var PINF = require( '@stdlib/constants/float32/pinf' ); -var NINF = require( '@stdlib/constants/float32/ninf' ); -var Complex64 = require( './../../../float32/ctor' ); -var isComplex64 = require( '@stdlib/assert/is-complex64' ); -var isSameComplex64 = require( '@stdlib/assert/is-same-complex64' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var real = require( './../../../float32/real' ); -var imag = require( './../../../float32/imag' ); -var parseComplex64 = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof parseComplex64, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function throws an error for inputs not recognized as complex numbers', function test( t ) { - t.throws( function invalidInput() { - parseComplex64( 'beep boop' ); - }, Error, 'throws an Error for invalid input' ); - t.throws( function invalidType() { - parseComplex64( true ); - }, TypeError, 'throws TypeError for non string input type' ); - - t.end(); -}); - -tape( 'the function will parse a string representation of a complex number', function test( t ) { - var z; - var w; - - z = new Complex64( 5.0, 12.0 ); - w = parseComplex64( '5 + 12i' ); - - t.ok( isComplex64( w ), 'is an instance' ); - t.ok( isSameComplex64( w, z ), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will parse a string representation of a complex number (negative values)', function test( t ) { - var z; - var w; - - z = new Complex64( -2.5, -4.0 ); - w = parseComplex64( '-2.5 - 4i' ); - - t.ok( isComplex64( w ), 'is an instance' ); - t.ok( isSameComplex64( w, z ), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will parse a string representation of a complex number (only real part)', function test( t ) { - var z; - var w; - - z = new Complex64( 3.0, 0.0 ); - w = parseComplex64( '3' ); - - t.ok( isComplex64( w ), 'is an instance' ); - t.ok( isSameComplex64( w, z ), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will parse a string representation of a complex number (only imaginary part)', function test( t ) { - var z; - var w; - - z = new Complex64( 0.0, 8.5 ); - w = parseComplex64( '8.5i' ); - - t.ok( isComplex64( w ), 'is an instance' ); - t.ok( isSameComplex64( w, z ), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will parse a string representation of a complex number (only real part, negative)', function test( t ) { - var z; - var w; - - z = new Complex64( -3.753, 0.0 ); - w = parseComplex64( '-3.753' ); - - t.ok( isComplex64( w ), 'is an instance' ); - t.ok( isSameComplex64( w, z ), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will parse a string representation of a complex number (only imaginary part, negative)', function test( t ) { - var z; - var w; - - z = new Complex64( 0.0, -0.3 ); - w = parseComplex64( '-0.3i' ); - - t.ok( isComplex64( w ), 'is an instance' ); - t.ok( isSameComplex64( w, z ), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function correctly parses a string representation of a complex number with no space (a+ib format)', function test( t ) { - var z; - var w; - - z = new Complex64( 5.0, 3.0 ); - w = parseComplex64( '5+3i' ); - - t.ok( isComplex64( w ), 'is an instance' ); - t.ok( isSameComplex64( w, z ), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function correctly parses a string representation of a complex number with unconventional spacing (a+ ib format)', function test( t ) { - var z; - var w; - - z = new Complex64( 5.0, 3.0 ); - w = parseComplex64( '5+ 3i' ); - - t.ok( isComplex64( w ), 'is an instance' ); - t.ok( isSameComplex64( w, z ), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will parse a string representation of a complex number with NaNs', function test( t ) { - var w = parseComplex64( 'NaN + NaNi' ); - - t.ok( isComplex64(w), 'is an instance' ); - t.ok( isnan(real( w )), 'has expected property value' ); - t.ok( isnan(imag( w )), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will parse a string representation of a complex number with Infinity', function test( t ) { - var z; - var w; - - z = new Complex64( PINF, NINF ); - w = parseComplex64( 'Infinity - Infinityi' ); - - t.ok( isComplex64( w ), 'is an instance' ); - t.ok( isSameComplex64( w, z ), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will parse a string representation of a complex number in scientific notation', function test( t ) { - var z; - var w; - - z = new Complex64( 1e3, 4.1e-3 ); - w = parseComplex64( '1E3 + 4.1e-3i' ); - - t.ok( isComplex64( w ), 'is an instance' ); - t.ok( isSameComplex64( w, z ), 'has expected property value' ); - - t.end(); -}); diff --git a/float32/real/README.md b/float32/real/README.md deleted file mode 100644 index f800ce0c..00000000 --- a/float32/real/README.md +++ /dev/null @@ -1,239 +0,0 @@ - - -# real - -> Return the real component of a single-precision complex floating-point number. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var real = require( '@stdlib/complex/float32/real' ); -``` - -#### real( z ) - -Returns the **real** component of a single-precision complex floating-point number. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z = new Complex64( 5.0, 3.0 ); -var re = real( z ); -// returns 5.0 -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - - - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var real = require( '@stdlib/complex/float32/real' ); - -function random() { - return new Complex64( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); -} - -// Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex64', random ); -// returns - -// Retrieve the real component of each complex number... -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); - console.log( 'real(%s) = %d', z.toString(), real( z ) ); -} -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float32/real.h" -``` - -#### stdlib_complex64_real( z ) - -Returns the real component of a single-precision complex floating-point number. - -```c -#include "stdlib/complex/float32/ctor.h" - -stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); - -// ... - -float re = stdlib_complex64_real( z ); -// returns 5.0f -``` - -The function accepts the following arguments: - -- **z**: `[in] stdlib_complex64_t` single-precision complex floating-point number. - -```c -float stdlib_complex64_real( const stdlib_complex64_t z ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float32/real.h" -#include "stdlib/complex/float32/ctor.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - int i; - for ( i = 0; i < 4; i++ ) { - printf( "real(v) = %f\n", stdlib_complex64_real( x[ i ] ) ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float32/real/benchmark/benchmark.js b/float32/real/benchmark/benchmark.js deleted file mode 100644 index 4537590e..00000000 --- a/float32/real/benchmark/benchmark.js +++ /dev/null @@ -1,57 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex64 = require( './../../../float32/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var pkg = require( './../package.json' ).name; -var real = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var re; - var i; - - values = [ - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - re = real( values[ i%values.length ] ); - if ( isnanf( re ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnanf( re ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/real/benchmark/c/Makefile b/float32/real/benchmark/c/Makefile deleted file mode 100644 index d7adc1ad..00000000 --- a/float32/real/benchmark/c/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/real/benchmark/c/benchmark.c b/float32/real/benchmark/c/benchmark.c deleted file mode 100644 index f73f9a61..00000000 --- a/float32/real/benchmark/c/benchmark.c +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include -#include -#include -#include - -#define NAME "crealf" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - float complex z; - double elapsed; - float re; - float im; - float v; - double t; - int i; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = rand_float(); - im = rand_float(); - z = re + im*I; - v = crealf( z ); - if ( v != v ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( v != v ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/real/benchmark/c/native/Makefile b/float32/real/benchmark/c/native/Makefile deleted file mode 100644 index 7f6bbc4c..00000000 --- a/float32/real/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/real/benchmark/c/native/benchmark.c b/float32/real/benchmark/c/native/benchmark.c deleted file mode 100644 index 2ad72320..00000000 --- a/float32/real/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,139 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/real.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include -#include -#include -#include -#include - -#define NAME "complex64_real" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - stdlib_complex64_t z; - double elapsed; - float re; - float im; - float v; - double t; - int i; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = rand_float(); - im = rand_float(); - z = stdlib_complex64( re, im ); - v = stdlib_complex64_real( z ); - if ( v != v ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( v != v ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/real/benchmark/julia/REQUIRE b/float32/real/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float32/real/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float32/real/benchmark/julia/benchmark.jl b/float32/real/benchmark/julia/benchmark.jl deleted file mode 100644 index 81b19ffd..00000000 --- a/float32/real/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "real"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark real( ComplexF32( rand(), rand() ) ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float32/real/docs/repl.txt b/float32/real/docs/repl.txt deleted file mode 100644 index 5bd7c7e7..00000000 --- a/float32/real/docs/repl.txt +++ /dev/null @@ -1,24 +0,0 @@ - -{{alias}}( z ) - Returns the real component of a single-precision complex floating-point - number. - - Parameters - ---------- - z: Complex64 - Complex number. - - Returns - ------- - re: number - Real component. - - Examples - -------- - > var z = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ); - > var re = {{alias}}( z ) - 5.0 - - See Also - -------- - diff --git a/float32/real/docs/types/index.d.ts b/float32/real/docs/types/index.d.ts deleted file mode 100644 index 7c278494..00000000 --- a/float32/real/docs/types/index.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex64 } from '@stdlib/types/complex'; - -/** -* Returns the real component of a single-precision complex floating-point number. -* -* @param z - complex number -* @returns real component -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var re = real( z ); -* // returns 5.0 -*/ -declare function real( z: Complex64 ): number; - - -// EXPORTS // - -export = real; diff --git a/float32/real/docs/types/test.ts b/float32/real/docs/types/test.ts deleted file mode 100644 index 909b9e50..00000000 --- a/float32/real/docs/types/test.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64 = require( './../../../../float32/ctor' ); -import real = require( './index' ); - - -// TESTS // - -// The function returns a number... -{ - real( new Complex64( 5.0, 3.0 ) ); // $ExpectType number -} - -// The compiler throws an error if the function is provided an argument that is not a complex number... -{ - real( 'abc' ); // $ExpectError - real( 123 ); // $ExpectError - real( true ); // $ExpectError - real( false ); // $ExpectError - real( [] ); // $ExpectError - real( {} ); // $ExpectError - real( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - real(); // $ExpectError - real( new Complex64( 5.0, 3.0 ), 123 ); // $ExpectError -} diff --git a/float32/real/examples/c/Makefile b/float32/real/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float32/real/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/real/examples/c/example.c b/float32/real/examples/c/example.c deleted file mode 100644 index 96627985..00000000 --- a/float32/real/examples/c/example.c +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/real.h" -#include "stdlib/complex/float32/ctor.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - int i; - for ( i = 0; i < 4; i++ ) { - printf( "real(v) = %f\n", stdlib_complex64_real( x[ i ] ) ); - } -} diff --git a/float32/real/examples/index.js b/float32/real/examples/index.js deleted file mode 100644 index e02729c8..00000000 --- a/float32/real/examples/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64 = require( './../../../float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var real = require( './../lib' ); - -function random() { - return new Complex64( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); // eslint-disable-line max-len -} - -// Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex64', random ); -// returns - -// Retrieve the real component of each complex number... -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); - console.log( 'real(%s) = %d', z.toString(), real( z ) ); -} diff --git a/float32/real/include/stdlib/complex/float32/real.h b/float32/real/include/stdlib/complex/float32/real.h deleted file mode 100644 index 8d0f66f7..00000000 --- a/float32/real/include/stdlib/complex/float32/real.h +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef STDLIB_COMPLEX_FLOAT32_REAL_H -#define STDLIB_COMPLEX_FLOAT32_REAL_H - -#include "stdlib/complex/float32/ctor.h" - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Returns the real component of a single-precision complex floating-point number. -*/ -float stdlib_complex64_real( const stdlib_complex64_t z ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_FLOAT32_REAL_H diff --git a/float32/real/lib/index.js b/float32/real/lib/index.js deleted file mode 100644 index ae76c66f..00000000 --- a/float32/real/lib/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Return the real component of a single-precision complex floating-point number. -* -* @module @stdlib/complex/float32/real -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var real = require( '@stdlib/complex/float32/real' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var re = real( z ); -* // returns 5.0 -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float32/real/lib/main.js b/float32/real/lib/main.js deleted file mode 100644 index 0a4076eb..00000000 --- a/float32/real/lib/main.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Returns the real component of a single-precision complex floating-point number. -* -* @param {Complex} z - complex number -* @returns {number} real component -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var re = real( z ); -* // returns 5.0 -*/ -function real( z ) { - return z.re; -} - - -// EXPORTS // - -module.exports = real; diff --git a/float32/real/manifest.json b/float32/real/manifest.json deleted file mode 100644 index 66b8c5b0..00000000 --- a/float32/real/manifest.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "options": {}, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor" - ] - } - ] -} diff --git a/float32/real/package.json b/float32/real/package.json deleted file mode 100644 index eb881319..00000000 --- a/float32/real/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@stdlib/complex/float32/real", - "version": "0.0.0", - "description": "Return the real component of a single-precision complex floating-point number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "real", - "re", - "imaginary", - "imag", - "im", - "number" - ] -} diff --git a/float32/real/src/main.c b/float32/real/src/main.c deleted file mode 100644 index 976f3b50..00000000 --- a/float32/real/src/main.c +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/real.h" -#include "stdlib/complex/float32/ctor.h" - -/** -* Returns the real component of a single-precision complex floating-point number. -* -* @param z single-precision complex floating-point number -* @return real component -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* -* stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); -* -* // ... -* -* float re = stdlib_complex64_real( z ); -* // returns 5.0f -*/ -float stdlib_complex64_real( const stdlib_complex64_t z ) { - stdlib_complex64_parts_t v; - v.value = z; // cppcheck-suppress unreadVariable - return v.parts[ 0 ]; -} diff --git a/float32/real/test/test.js b/float32/real/test/test.js deleted file mode 100644 index f6af81da..00000000 --- a/float32/real/test/test.js +++ /dev/null @@ -1,45 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex64 = require( './../../../float32/ctor' ); -var real = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof real, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns the real component of a complex number', function test( t ) { - var re; - var z; - - z = new Complex64( 3.0, -3.0 ); - re = real( z ); - t.strictEqual( re, 3.0, 'returns expected value' ); - - t.end(); -}); diff --git a/float32/reim/README.md b/float32/reim/README.md deleted file mode 100644 index 3a330fc4..00000000 --- a/float32/reim/README.md +++ /dev/null @@ -1,248 +0,0 @@ - - -# reim - -> Return the real and imaginary components of a single-precision complex floating-point number. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var reim = require( '@stdlib/complex/float32/reim' ); -``` - -#### reim( z ) - -Returns the **real** and **imaginary** components of a single-precision complex floating-point number. - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); - -var z = new Complex64( 5.0, 3.0 ); -var out = reim( z ); -// returns [ 5.0, 3.0 ] -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - - - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var reim = require( '@stdlib/complex/float32/reim' ); - -function random() { - return new Complex64( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); -} - -// Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex64', random ); -// returns - -// Return the real and imaginary components of each complex number... -var out; -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); - out = reim( z ); - console.log( '%s => %d, %d', z.toString(), out[ 0 ], out[ 1 ] ); -} -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float32/reim.h" -``` - -#### stdlib_complex64_reim( z, \*re, \*im ) - -Returns the real and imaginary components of a single-precision complex floating-point number. - -```c -#include "stdlib/complex/float32/ctor.h" - -stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); - -// ... - -float re; -float im; - -stdlib_complex64_reim( z, &re, &im ); -``` - -The function accepts the following arguments: - -- **z**: `[in] stdlib_complex64_t` single-precision complex floating-point number. -- **re**: `[out] float*` destination for real component. -- **im**: `[out] float*` destination for imaginary component. - -```c -void stdlib_complex64_reim( const stdlib_complex64_t z, float *re, float *im ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float32/reim.h" -#include "stdlib/complex/float32/ctor.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - float re; - float im; - int i; - for ( i = 0; i < 4; i++ ) { - stdlib_complex64_reim( x[ i ], &re, &im ); - printf( "reim(v) = %f, %f\n", re, im ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float32/reim/benchmark/benchmark.js b/float32/reim/benchmark/benchmark.js deleted file mode 100644 index 53be7ebb..00000000 --- a/float32/reim/benchmark/benchmark.js +++ /dev/null @@ -1,57 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex64 = require( './../../../float32/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isArrayLike = require( '@stdlib/assert/is-array-like' ); -var pkg = require( './../package.json' ).name; -var reim = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var arr; - var i; - - values = [ - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ), - new Complex64( randu(), randu() ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = reim( values[ i%values.length ] ); - if ( arr.length === 0 ) { - b.fail( 'should not be empty' ); - } - } - b.toc(); - if ( !isArrayLike( arr ) ) { - b.fail( 'should return an array' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/reim/benchmark/c/Makefile b/float32/reim/benchmark/c/Makefile deleted file mode 100644 index 7f6bbc4c..00000000 --- a/float32/reim/benchmark/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/reim/benchmark/c/benchmark.c b/float32/reim/benchmark/c/benchmark.c deleted file mode 100644 index 475dabbb..00000000 --- a/float32/reim/benchmark/c/benchmark.c +++ /dev/null @@ -1,138 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/reim.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include -#include -#include -#include -#include - -#define NAME "complex64_reim" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static float rand_float( void ) { - int r = rand(); - return (float)r / ( (float)RAND_MAX + 1.0f ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - stdlib_complex64_t z; - double elapsed; - float re; - float im; - double t; - int i; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = rand_float(); - im = rand_float(); - z = stdlib_complex64( re, im ); - stdlib_complex64_reim( z, &re, &im ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float32/reim/benchmark/julia/REQUIRE b/float32/reim/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float32/reim/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float32/reim/benchmark/julia/benchmark.jl b/float32/reim/benchmark/julia/benchmark.jl deleted file mode 100644 index 668eb170..00000000 --- a/float32/reim/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "reim"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark reim( ComplexF32( rand(), rand() ) ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float32/reim/docs/repl.txt b/float32/reim/docs/repl.txt deleted file mode 100644 index 81df6992..00000000 --- a/float32/reim/docs/repl.txt +++ /dev/null @@ -1,24 +0,0 @@ - -{{alias}}( z ) - Returns the real and imaginary components of a single-precision complex - floating-point number. - - Parameters - ---------- - z: Complex64 - Complex number. - - Returns - ------- - out: Float32Array - Array containing the real and imaginary components, respectively. - - Examples - -------- - > var z = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ); - > var out = {{alias}}( z ) - [ 5.0, 3.0 ] - - See Also - -------- - diff --git a/float32/reim/docs/types/index.d.ts b/float32/reim/docs/types/index.d.ts deleted file mode 100644 index 47b006aa..00000000 --- a/float32/reim/docs/types/index.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex64 } from '@stdlib/types/complex'; - -/** -* Returns the real and imaginary components of a single-precision complex floating-point number. -* -* @param z - complex number -* @returns real and imaginary components -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var out = reim( z ); -* // returns [ 5.0, 3.0 ] -*/ -declare function reim( z: Complex64 ): Float32Array; - - -// EXPORTS // - -export = reim; diff --git a/float32/reim/docs/types/test.ts b/float32/reim/docs/types/test.ts deleted file mode 100644 index 29eb534a..00000000 --- a/float32/reim/docs/types/test.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex64 = require( './../../../../float32/ctor' ); -import reim = require( './index' ); - - -// TESTS // - -// The function returns a floating-point typed array... -{ - reim( new Complex64( 5.0, 3.0 ) ); // $ExpectType Float32Array -} - -// The compiler throws an error if the function is provided an argument that is not a complex number... -{ - reim( 'abc' ); // $ExpectError - reim( 123 ); // $ExpectError - reim( true ); // $ExpectError - reim( false ); // $ExpectError - reim( [] ); // $ExpectError - reim( {} ); // $ExpectError - reim( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - reim(); // $ExpectError - reim( new Complex64( 5.0, 3.0 ), 123 ); // $ExpectError -} diff --git a/float32/reim/examples/c/Makefile b/float32/reim/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float32/reim/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float32/reim/examples/c/example.c b/float32/reim/examples/c/example.c deleted file mode 100644 index fd59c6f1..00000000 --- a/float32/reim/examples/c/example.c +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/reim.h" -#include "stdlib/complex/float32/ctor.h" -#include - -int main( void ) { - const stdlib_complex64_t x[] = { - stdlib_complex64( 5.0f, 2.0f ), - stdlib_complex64( -2.0f, 1.0f ), - stdlib_complex64( 0.0f, -0.0f ), - stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) - }; - - float re; - float im; - int i; - for ( i = 0; i < 4; i++ ) { - stdlib_complex64_reim( x[ i ], &re, &im ); - printf( "reim(v) = %f, %f\n", re, im ); - } -} diff --git a/float32/reim/examples/index.js b/float32/reim/examples/index.js deleted file mode 100644 index 31beede6..00000000 --- a/float32/reim/examples/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64 = require( './../../../float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var reim = require( './../lib' ); - -function random() { - return new Complex64( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); // eslint-disable-line max-len -} - -// Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex64', random ); -// returns - -// Return the real and imaginary components of each complex number... -var out; -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); - out = reim( z ); - console.log( '%s => %d, %d', z.toString(), out[ 0 ], out[ 1 ] ); -} diff --git a/float32/reim/include/stdlib/complex/float32/reim.h b/float32/reim/include/stdlib/complex/float32/reim.h deleted file mode 100644 index 4c180c32..00000000 --- a/float32/reim/include/stdlib/complex/float32/reim.h +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef STDLIB_COMPLEX_FLOAT32_REIM_H -#define STDLIB_COMPLEX_FLOAT32_REIM_H - -#include "stdlib/complex/float32/ctor.h" - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Returns the real and imaginary components of a single-precision complex floating-point number. -*/ -void stdlib_complex64_reim( const stdlib_complex64_t z, float *re, float *im ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_FLOAT32_REIM_H diff --git a/float32/reim/lib/index.js b/float32/reim/lib/index.js deleted file mode 100644 index 782b15b4..00000000 --- a/float32/reim/lib/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Return the real and imaginary components of a single-precision complex floating-point number. -* -* @module @stdlib/complex/float32/reim -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* var reim = require( '@stdlib/complex/float32/reim' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var out = reim( z ); -* // returns [ 5.0, 3.0 ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float32/reim/lib/main.js b/float32/reim/lib/main.js deleted file mode 100644 index 80451c25..00000000 --- a/float32/reim/lib/main.js +++ /dev/null @@ -1,52 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Float32Array = require( '@stdlib/array/float32' ); - - -// MAIN // - -/** -* Returns the real and imaginary components of a single-precision complex floating-point number. -* -* @param {Complex64} z - complex number -* @returns {Float32Array} real and imaginary components -* -* @example -* var Complex64 = require( '@stdlib/complex/float32/ctor' ); -* -* var z = new Complex64( 5.0, 3.0 ); -* -* var out = reim( z ); -* // returns [ 5.0, 3.0 ] -*/ -function reim( z ) { - var out = new Float32Array( 2 ); - out[ 0 ] = z.re; - out[ 1 ] = z.im; - return out; -} - - -// EXPORTS // - -module.exports = reim; diff --git a/float32/reim/manifest.json b/float32/reim/manifest.json deleted file mode 100644 index fde543aa..00000000 --- a/float32/reim/manifest.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "options": {}, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor" - ] - } - ] -} diff --git a/float32/reim/package.json b/float32/reim/package.json deleted file mode 100644 index baa5d1f1..00000000 --- a/float32/reim/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@stdlib/complex/float32/reim", - "version": "0.0.0", - "description": "Return the real and imaginary components of a single-precision complex floating-point number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "mathematics", - "math", - "complex", - "cmplx", - "real", - "re", - "imaginary", - "imag", - "im", - "number" - ] -} diff --git a/float32/reim/src/main.c b/float32/reim/src/main.c deleted file mode 100644 index d2474b66..00000000 --- a/float32/reim/src/main.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float32/reim.h" -#include "stdlib/complex/float32/ctor.h" - -/** -* Returns the real and imaginary components of a single-precision complex floating-point number. -* -* @param z single-precision complex floating-point number -* @param re destination for real component -* @param im destination for imaginary component -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* -* stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f ); -* -* // ... -* -* float re; -* float im; -* -* stdlib_complex64_reim( z, &re, &im ); -*/ -void stdlib_complex64_reim( const stdlib_complex64_t z, float *re, float *im ) { - stdlib_complex64_parts_t v; - v.value = z; // cppcheck-suppress unreadVariable - *re = v.parts[ 0 ]; - *im = v.parts[ 1 ]; -} diff --git a/float32/reim/test/test.js b/float32/reim/test/test.js deleted file mode 100644 index aa880685..00000000 --- a/float32/reim/test/test.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex64 = require( './../../../float32/ctor' ); -var Float32Array = require( '@stdlib/array/float32' ); -var reim = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof reim, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns the real and imaginary components of a complex number', function test( t ) { - var expected; - var out; - var z; - - z = new Complex64( 3.14, -3.14 ); - out = reim( z ); - expected = new Float32Array( [ 3.14, -3.14 ] ); - t.strictEqual( out[ 0 ], expected[ 0 ], 'returns expected value' ); - t.strictEqual( out[ 1 ], expected[ 1 ], 'returns expected value' ); - - t.end(); -}); diff --git a/float32/reviver/README.md b/float32/reviver/README.md deleted file mode 100644 index 0461ca94..00000000 --- a/float32/reviver/README.md +++ /dev/null @@ -1,145 +0,0 @@ - - -# reviveComplex64 - -> Revive a JSON-serialized 64-bit [complex number][@stdlib/complex/float32/ctor]. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var reviveComplex64 = require( '@stdlib/complex/float32/reviver' ); -``` - -#### reviveComplex64( key, value ) - -Revives a JSON-serialized 64-bit [complex number][@stdlib/complex/float32/ctor]. - -```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); - -var str = '{"type":"Complex64","re":5,"im":3}'; - -var z = parseJSON( str, reviveComplex64 ); -// returns -``` - -For details on the JSON serialization format, see [`Complex64`][@stdlib/complex/float32/ctor]. - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var parseJSON = require( '@stdlib/utils/parse-json' ); -var reviveComplex64 = require( '@stdlib/complex/float32/reviver' ); - -var z = new Complex64( 5.0, 3.0 ); -var str = JSON.stringify( z ); -// returns '{"type":"Complex64","re":5,"im":3}' - -var w = parseJSON( str, reviveComplex64 ); -if ( w instanceof Error ) { - throw w; -} -var bool = ( w instanceof z.constructor ); -// returns true - -bool = ( w.re === z.re ); -// returns true - -bool = ( w.im === z.im ); -// returns true -``` - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float32/reviver/benchmark/benchmark.js b/float32/reviver/benchmark/benchmark.js deleted file mode 100644 index 92aced7b..00000000 --- a/float32/reviver/benchmark/benchmark.js +++ /dev/null @@ -1,92 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var parseJSON = require( '@stdlib/utils/parse-json' ); -var pkg = require( './../package.json' ).name; -var reviver = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var str; - var o; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - str = '{"type":"Complex64","re":'+i+',"im":'+(i+1)+'}'; - o = parseJSON( str, reviver ); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::no_reviver', function benchmark( b ) { - var str; - var o; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - str = '{"type":"Complex64","re":'+i+',"im":'+(i+1)+'}'; - o = parseJSON( str ); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::no_reviver,built-in', function benchmark( b ) { - var str; - var o; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - str = '{"type":"Complex64","re":'+i+',"im":'+(i+1)+'}'; - o = JSON.parse( str ); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float32/reviver/docs/repl.txt b/float32/reviver/docs/repl.txt deleted file mode 100644 index 4d1cedb9..00000000 --- a/float32/reviver/docs/repl.txt +++ /dev/null @@ -1,26 +0,0 @@ - -{{alias}}( key, value ) - Revives a JSON-serialized 64-bit complex number. - - Parameters - ---------- - key: string - Key. - - value: any - Value. - - Returns - ------- - out: any - Value or complex number. - - Examples - -------- - > var str = '{"type":"Complex64","re":5,"im":3}'; - > var z = {{alias:@stdlib/utils/parse-json}}( str, {{alias}} ) - - - See Also - -------- - diff --git a/float32/reviver/docs/types/index.d.ts b/float32/reviver/docs/types/index.d.ts deleted file mode 100644 index 3ed00074..00000000 --- a/float32/reviver/docs/types/index.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/** -* Revives a JSON-serialized 64-bit complex number. -* -* @param key - key -* @param value - value -* @returns value or 64-bit complex number -* -* @example -* var parseJSON = require( '@stdlib/utils/parse-json' ); -* -* var str = '{"type":"Complex64","re":5,"im":3}'; -* -* var z = parseJSON( str, reviveComplex64 ); -* // returns -*/ -declare function reviveComplex64( key: string, value: any ): any; - - -// EXPORTS // - -export = reviveComplex64; diff --git a/float32/reviver/docs/types/test.ts b/float32/reviver/docs/types/test.ts deleted file mode 100644 index af2049ce..00000000 --- a/float32/reviver/docs/types/test.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import reviveComplex64 = require( './index' ); - - -// TESTS // - -// The function revives a serialized object... -{ - const o = { - 'type': 'Complex64', - 're': 5, - 'im': 3 - }; - reviveComplex64( 'foo', o ); // $ExpectType any -} - -// The compiler throws an error if the function is provided a first argument that is not a string... -{ - reviveComplex64( true, 1 ); // $ExpectError - reviveComplex64( false, 1 ); // $ExpectError - reviveComplex64( null, 1 ); // $ExpectError - reviveComplex64( undefined, 1 ); // $ExpectError - reviveComplex64( 5, 1 ); // $ExpectError - reviveComplex64( [], 1 ); // $ExpectError - reviveComplex64( {}, 1 ); // $ExpectError - reviveComplex64( ( x: number ): number => x, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided insufficient arguments... -{ - reviveComplex64(); // $ExpectError - reviveComplex64( 'beep' ); // $ExpectError -} diff --git a/float32/reviver/examples/index.js b/float32/reviver/examples/index.js deleted file mode 100644 index 19227a1c..00000000 --- a/float32/reviver/examples/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex64 = require( './../../../float32/ctor' ); -var parseJSON = require( '@stdlib/utils/parse-json' ); -var reviveComplex64 = require( './../lib' ); - -var z = new Complex64( 5.0, 3.0 ); -var str = JSON.stringify( z ); -console.log( str ); -// => '{"type":"Complex64","re":5,"im":3}' - -var w = parseJSON( str, reviveComplex64 ); -if ( w instanceof Error ) { - throw w; -} -var bool = ( w instanceof z.constructor ); -console.log( bool ); -// => true - -bool = ( w.re === z.re ); -console.log( bool ); -// => true - -bool = ( w.im === z.im ); -console.log( bool ); -// => true diff --git a/float32/reviver/lib/index.js b/float32/reviver/lib/index.js deleted file mode 100644 index e0b00b85..00000000 --- a/float32/reviver/lib/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Revive a JSON-serialized 64-bit complex number. -* -* @module @stdlib/complex/float32/reviver -* -* @example -* var parseJSON = require( '@stdlib/utils/parse-json' ); -* var reviveComplex64 = require( '@stdlib/complex/float32/reviver' ); -* -* var str = '{"type":"Complex64","re":5,"im":3}'; -* -* var z = parseJSON( str, reviveComplex64 ); -* // returns -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float32/reviver/lib/main.js b/float32/reviver/lib/main.js deleted file mode 100644 index b5e12c1c..00000000 --- a/float32/reviver/lib/main.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var Complex64 = require( './../../../float32/ctor' ); - - -// MAIN // - -/** -* Revives a JSON-serialized 64-bit complex number. -* -* @param {string} key - key -* @param {*} value - value -* @returns {(*|Complex64)} value or 64-bit complex number -* -* @example -* var parseJSON = require( '@stdlib/utils/parse-json' ); -* -* var str = '{"type":"Complex64","re":5,"im":3}'; -* -* var z = parseJSON( str, reviveComplex64 ); -* // returns -*/ -function reviveComplex64( key, value ) { - if ( - value && - value.type && - value.type === 'Complex64' && - isNumber( value.re ) && - isNumber( value.im ) - ) { - return new Complex64( value.re, value.im ); - } - return value; -} - - -// EXPORTS // - -module.exports = reviveComplex64; diff --git a/float32/reviver/package.json b/float32/reviver/package.json deleted file mode 100644 index 46bc9801..00000000 --- a/float32/reviver/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "@stdlib/complex/float32/reviver", - "version": "0.0.0", - "description": "Revive a JSON-serialized 64-bit complex number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "utils", - "util", - "utilities", - "utility", - "complex", - "complex64", - "cmplx", - "json", - "reviver", - "revive", - "unmarshal", - "deserialize", - "from", - "convert", - "parse", - "object", - "obj" - ] -} diff --git a/float32/reviver/test/test.js b/float32/reviver/test/test.js deleted file mode 100644 index 9dbb80b0..00000000 --- a/float32/reviver/test/test.js +++ /dev/null @@ -1,207 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var copy = require( '@stdlib/utils/copy' ); -var parseJSON = require( '@stdlib/utils/parse-json' ); -var Complex64 = require( './../../../float32/ctor' ); -var reviveComplex64 = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof reviveComplex64, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'values which are not recognized as serialized 64-bit complex numbers are unaffected', function test( t ) { - var expected; - var actual; - - expected = { - 'beep': 'boop' - }; - actual = parseJSON( '{"beep":"boop"}', reviveComplex64 ); - - t.deepEqual( actual, expected, 'deep equal' ); - - // Null edge case: - actual = parseJSON( 'null', reviveComplex64 ); - t.strictEqual( actual, null, 'equals null' ); - - t.end(); -}); - -tape( 'an object must have a recognized "type" field in order to be revived', function test( t ) { - var expected; - var actual; - var json; - - json = { - 'type': 'Boop', - 're': 5.0, - 'im': 3.0 - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviveComplex64 ); - - t.deepEqual( actual, expected, 'deep equal' ); - t.end(); -}); - -tape( 'an object must have a numeric "re" field in order to be revived', function test( t ) { - var expected; - var actual; - var json; - - json = { - 'type': 'Complex64', - 'im': 3.0 - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviveComplex64 ); - - t.deepEqual( actual, expected, 'deep equal' ); - - json = { - 'type': 'Complex64', - 'im': 3.0, - 're': '5.0' - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviveComplex64 ); - - t.deepEqual( actual, expected, 'deep equal' ); - - json = { - 'type': 'Complex64', - 'im': 3.0, - 're': null - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviveComplex64 ); - - t.deepEqual( actual, expected, 'deep equal' ); - - t.end(); -}); - -tape( 'an object must have a numeric "im" field in order to be revived', function test( t ) { - var expected; - var actual; - var json; - - json = { - 'type': 'Complex64', - 're': 3.0 - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviveComplex64 ); - - t.deepEqual( actual, expected, 'deep equal' ); - - json = { - 'type': 'Complex64', - 're': 3.0, - 'im': '5.0' - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviveComplex64 ); - - t.deepEqual( actual, expected, 'deep equal' ); - - json = { - 'type': 'Complex64', - 're': 3.0, - 'im': null - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviveComplex64 ); - - t.deepEqual( actual, expected, 'deep equal' ); - - t.end(); -}); - -tape( 'the function will revive a JSON-serialized 64-bit complex number', function test( t ) { - var json; - var z; - var w; - - z = new Complex64( 5.0, 3.0 ); - json = JSON.stringify( z ); - - w = parseJSON( json, reviveComplex64 ); - - t.strictEqual( w instanceof Complex64, true, 'is an instance' ); - t.strictEqual( w.re, z.re, true, 'has expected property value' ); - t.strictEqual( w.im, z.im, true, 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will revive deeply nested serialized 64-bit complex numbers (array)', function test( t ) { - var actual; - var arr; - var i; - - arr = [ - new Complex64( 5.0, 3.0 ), - new Complex64( -2.0, -4.0 ) - ]; - - actual = parseJSON( JSON.stringify( arr ), reviveComplex64 ); - - for ( i = 0; i < arr.length; i++ ) { - t.strictEqual( actual[i] instanceof Complex64, true, 'is an instance' ); - t.strictEqual( actual[i].re, arr[i].re, 'has expected property value' ); - t.strictEqual( actual[i].im, arr[i].im, 'has expected property value' ); - } - t.end(); -}); - -tape( 'the function will revive deeply nested serialized 64-bit complex numbers (object)', function test( t ) { - var actual; - var json; - - json = { - 'beep': { - 'boop': new Complex64( 5.0, 3.0 ) - } - }; - actual = parseJSON( JSON.stringify( json ), reviveComplex64 ); - - t.strictEqual( actual.beep.boop instanceof Complex64, true, 'is an instance' ); - t.strictEqual( actual.beep.boop.re, json.beep.boop.re, 'has expected property value' ); - t.strictEqual( actual.beep.boop.im, json.beep.boop.im, 'has expected property value' ); - - t.end(); -}); diff --git a/float32/test/test.js b/float32/test/test.js deleted file mode 100644 index 2fbefe9d..00000000 --- a/float32/test/test.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - - -// TESTS // - -tape( 'main export is an object', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ns, 'object', 'main export is an object' ); - t.end(); -}); - -tape( 'the exported object contains key-value pairs', function test( t ) { - var keys = objectKeys( ns ); - t.strictEqual( keys.length > 0, true, 'has keys' ); - t.end(); -}); diff --git a/float64/README.md b/float64/README.md deleted file mode 100644 index 5dacf892..00000000 --- a/float64/README.md +++ /dev/null @@ -1,137 +0,0 @@ - - -# Complex128 - -> Double-precision complex floating-point number functions. - -
- -## Usage - -```javascript -var complex = require( '@stdlib/complex/float64' ); -``` - -#### complex - -Namespace containing double-precision complex floating-point number functions. - -```javascript -var ns = complex; -// returns {...} -``` - -The namespace contains the following sub-namespaces: - - - -
- -- [`base`][@stdlib/complex/float64/base]: base (i.e., lower-level) double-precision complex floating-point number functions. - -
- - - -The namespace contains the following functions: - - - -
- -- [`conj( z )`][@stdlib/complex/float64/conj]: return the complex conjugate of a double-precision complex floating-point number. -- [`Complex128( real, imag )`][@stdlib/complex/float64/ctor]: 128-bit complex number. -- [`imag( z )`][@stdlib/complex/float64/imag]: return the imaginary component of a double-precision complex floating-point number. -- [`parseComplex128( str )`][@stdlib/complex/float64/parse]: parse a string representation of a 128-bit complex number. -- [`real( z )`][@stdlib/complex/float64/real]: return the real component of a double-precision complex floating-point number. -- [`reim( z )`][@stdlib/complex/float64/reim]: return the real and imaginary components of a double-precision complex floating-point number. -- [`reviveComplex128( key, value )`][@stdlib/complex/float64/reviver]: revive a JSON-serialized 128-bit complex number. - -
- - - -
- - - - - -
- -
- - - -
- -## Examples - - - - - -```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/complex/float64' ); - -console.log( objectKeys( ns ) ); -``` - -
- - - - - - - - - - - - - - diff --git a/float64/base/README.md b/float64/base/README.md deleted file mode 100644 index f9392237..00000000 --- a/float64/base/README.md +++ /dev/null @@ -1,143 +0,0 @@ - - -# Complex128 - -> Base (i.e., lower-level) double-precision complex floating-point number functions. - -
- -## Usage - -```javascript -var complex = require( '@stdlib/complex/float64/base' ); -``` - -#### complex - -Namespace containing base (i.e., lower-level) double-precision complex floating-point number functions. - -```javascript -var ns = complex; -// returns {...} -``` - -The namespace contains the following sub-namespaces: - - - -
- -- [`assert`][@stdlib/complex/float64/base/assert]: base (i.e., lower-level) double-precision complex floating-point number assertion functions. - -
- - - -The namespace contains the following functions: - - - -
- -- [`add( z1, z2 )`][@stdlib/complex/float64/base/add]: add two double-precision complex floating-point numbers. -- [`add3( z1, z2, z3 )`][@stdlib/complex/float64/base/add3]: compute the sum of three double-precision complex floating-point numbers. -- [`div( z1, z2 )`][@stdlib/complex/float64/base/div]: divide two double-precision complex floating-point numbers. -- [`identity( z )`][@stdlib/complex/float64/base/identity]: evaluate the identity function of a double-precision complex floating-point number. -- [`muladd( alpha, x, y )`][@stdlib/complex/float64/base/mul-add]: perform a multiply-add operation involving three double-precision complex floating-point numbers. -- [`mul( z1, z2 )`][@stdlib/complex/float64/base/mul]: multiply two double-precision complex floating-point numbers. -- [`neg( z )`][@stdlib/complex/float64/base/neg]: negate a double-precision complex floating-point number. -- [`scale( alpha, z )`][@stdlib/complex/float64/base/scale]: scale a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant. -- [`sub( z1, z2 )`][@stdlib/complex/float64/base/sub]: subtract two double-precision complex floating-point numbers. - -
- - - -
- - - - - -
- -
- - - -
- -## Examples - - - - - -```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/complex/float64/base' ); - -console.log( objectKeys( ns ) ); -``` - -
- - - - - - - - - - - - - - diff --git a/float64/base/add/README.md b/float64/base/add/README.md deleted file mode 100644 index 4cec1161..00000000 --- a/float64/base/add/README.md +++ /dev/null @@ -1,279 +0,0 @@ - - -# add - -> Add two double-precision complex floating-point numbers. - -
- -
- - - -
- -## Usage - -```javascript -var add = require( '@stdlib/complex/float64/base/add' ); -``` - -#### add( z1, z2 ) - -Adds two double-precision complex floating-point numbers. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z = new Complex128( -1.5, 2.5 ); - -var v = add( z, z ); -// returns [ -3.0, 5.0 ] -``` - -#### add.assign( re1, im1, re2, im2, out, strideOut, offsetOut ) - -Adds two double-precision complex floating-point numbers and assigns results to a provided output array. - -```javascript -var Float64Array = require( '@stdlib/array/float64' ); - -var out = new Float64Array( 2 ); -var v = add.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ); -// returns [ 3.0, 4.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **re1**: real component of the first complex number. -- **im1**: imaginary component of the first complex number. -- **re2**: real component of the second complex number. -- **im2**: imaginary component of the second complex number. -- **out**: output array. -- **strideOut**: stride length for `out`. -- **offsetOut**: starting index for `out`. - -#### add.strided( z1, sz1, oz1, z2, sz2, oz2, out, so, oo ) - -Adds two double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. - -```javascript -var Float64Array = require( '@stdlib/array/float64' ); - -var z1 = new Float64Array( [ 5.0, 3.0 ] ); -var z2 = new Float64Array( [ -2.0, 1.0 ] ); -var out = new Float64Array( 2 ); - -var v = add.strided( z1, 1, 0, z2, 1, 0, out, 1, 0 ); -// returns [ 3.0, 4.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **z1**: first complex number strided array view. -- **sz1**: stride length for `z1`. -- **oz1**: starting index for `z1`. -- **z2**: second complex number strided array view. -- **sz2**: stride length for `z2`. -- **oz2**: starting index for `z2`. -- **out**: output array. -- **so**: stride length for `out`. -- **oo**: starting index for `out`. - -
- - - -
- -## Examples - - - -```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var add = require( '@stdlib/complex/float64/base/add' ); - -// Generate arrays of random values: -var z1 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise addition: -logEachMap( '(%s) + (%s) = %s', z1, z2, add ); -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float64/base/add.h" -``` - -#### stdlib_base_complex128_add( z1, z2 ) - -Adds two double-precision complex floating-point numbers. - -```c -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/imag.h" - -stdlib_complex128_t z = stdlib_complex128( 3.0, -2.0 ); - -stdlib_complex128_t out = stdlib_base_complex128_add( z, z ); - -double re = stdlib_complex128_real( out ); -// returns 6.0 - -double im = stdlib_complex128_imag( out ); -// returns -4.0 -``` - -The function accepts the following arguments: - -- **z1**: `[in] stdlib_complex128_t` input value. -- **z2**: `[in] stdlib_complex128_t` input value. - -```c -stdlib_complex128_t stdlib_base_complex128_add( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float64/base/add.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 3.14, 1.5 ), - stdlib_complex128( -3.14, 1.5 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - stdlib_complex128_t y; - double re; - double im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex128_reim( v, &re, &im ); - printf( "z = %lf + %lfi\n", re, im ); - - y = stdlib_base_complex128_add( v, v ); - stdlib_complex128_reim( y, &re, &im ); - printf( "add(z, z) = %lf + %lfi\n", re, im ); - } -} -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/float64/base/add/benchmark/benchmark.assign.js b/float64/base/add/benchmark/benchmark.assign.js deleted file mode 100644 index 5ae19e4c..00000000 --- a/float64/base/add/benchmark/benchmark.assign.js +++ /dev/null @@ -1,71 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Float64Array = require( '@stdlib/array/float64' ); -var format = require( '@stdlib/string/format' ); -var pkg = require( './../package.json' ).name; -var add = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float64' -}; - - -// MAIN // - -bench( format( '%s:assign', pkg ), function benchmark( b ) { - var out; - var re; - var im; - var N; - var i; - var j; - var k; - - N = 100; - re = uniform( N, -500.0, 500.0, options ); - im = uniform( N, -500.0, 500.0, options ); - - out = new Float64Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = i % N; - k = ( i+1 ) % N; - out = add.assign( re[ j ], im[ j ], re[ k ], im[ k ], out, 1, 0 ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( out[ 0 ] ) || isnan( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/add/benchmark/benchmark.js b/float64/base/add/benchmark/benchmark.js deleted file mode 100644 index f31a7654..00000000 --- a/float64/base/add/benchmark/benchmark.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var pkg = require( './../package.json' ).name; -var cadd = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = cadd( z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( real( out ) ) || isnan( imag( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/add/benchmark/benchmark.native.js b/float64/base/add/benchmark/benchmark.native.js deleted file mode 100644 index 37ebad3d..00000000 --- a/float64/base/add/benchmark/benchmark.native.js +++ /dev/null @@ -1,70 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); -var format = require( '@stdlib/string/format' ); -var pkg = require( './../package.json' ).name; - - -// VARIABLES // - -var cadd = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( cadd instanceof Error ) -}; - - -// MAIN // - -bench( format( '%s::native', pkg ), opts, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = cadd( z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( real( out ) ) || isnan( imag( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/add/benchmark/benchmark.strided.js b/float64/base/add/benchmark/benchmark.strided.js deleted file mode 100644 index dcdc24db..00000000 --- a/float64/base/add/benchmark/benchmark.strided.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Float64Array = require( '@stdlib/array/float64' ); -var format = require( '@stdlib/string/format' ); -var pkg = require( './../package.json' ).name; -var add = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float64' -}; - - -// MAIN // - -bench( format( '%s:strided', pkg ), function benchmark( b ) { - var out; - var z1; - var z2; - var N; - var i; - var j; - - N = 50; - z1 = uniform( N*2, -500.0, 500.0, options ); - z2 = uniform( N*2, -500.0, 500.0, options ); - - out = new Float64Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = ( i % N ) * 2; - out = add.strided( z1, 1, j, z2, 1, j, out, 1, 0 ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( out[ 0 ] ) || isnan( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/add/benchmark/c/Makefile b/float64/base/add/benchmark/c/Makefile deleted file mode 100644 index d7adc1ad..00000000 --- a/float64/base/add/benchmark/c/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/add/benchmark/c/benchmark.c b/float64/base/add/benchmark/c/benchmark.c deleted file mode 100644 index a0221582..00000000 --- a/float64/base/add/benchmark/c/benchmark.c +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include -#include -#include -#include - -#define NAME "add" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double re; - double im; - double t; - int i; - - double complex z1; - double complex z2; - double complex z3; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z1 = re + im*I; - - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z2 = re + im*I; - - z3 = (creal(z1)+creal(z2)) + (cimag(z1)+cimag(z2))*I; - if ( z3 != z3 ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( z3 != z3 ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/base/add/benchmark/c/native/Makefile b/float64/base/add/benchmark/c/native/Makefile deleted file mode 100644 index 7f6bbc4c..00000000 --- a/float64/base/add/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/add/benchmark/c/native/benchmark.c b/float64/base/add/benchmark/c/native/benchmark.c deleted file mode 100644 index 056d60c4..00000000 --- a/float64/base/add/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,147 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/add.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include -#include -#include -#include -#include - -#define NAME "add" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double re; - double im; - double t; - int i; - - stdlib_complex128_t z1; - stdlib_complex128_t z2; - stdlib_complex128_t z3; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z1 = stdlib_complex128( re, im ); - - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z2 = stdlib_complex128( re, im ); - - z3 = stdlib_base_complex128_add( z1, z2 ); - stdlib_complex128_reim( z3, &re, &im ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/base/add/benchmark/julia/REQUIRE b/float64/base/add/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float64/base/add/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float64/base/add/benchmark/julia/benchmark.jl b/float64/base/add/benchmark/julia/benchmark.jl deleted file mode 100644 index 46d2ac45..00000000 --- a/float64/base/add/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "add"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark ComplexF64( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) + ComplexF64( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float64/base/add/binding.gyp b/float64/base/add/binding.gyp deleted file mode 100644 index ad8560b8..00000000 --- a/float64/base/add/binding.gyp +++ /dev/null @@ -1,170 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A `.gyp` file for building a Node.js native add-on. -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # List of files to include in this file: - 'includes': [ - './include.gypi', - ], - - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Target name should match the add-on export name: - 'addon_target_name%': 'addon', - - # Set variables based on the host OS: - 'conditions': [ - [ - 'OS=="win"', - { - # Define the object file suffix: - 'obj': 'obj', - }, - { - # Define the object file suffix: - 'obj': 'o', - } - ], # end condition (OS=="win") - ], # end conditions - }, # end variables - - # Define compile targets: - 'targets': [ - - # Target to generate an add-on: - { - # The target name should match the add-on export name: - 'target_name': '<(addon_target_name)', - - # Define dependencies: - 'dependencies': [], - - # Define directories which contain relevant include headers: - 'include_dirs': [ - # Local include directory: - '<@(include_dirs)', - ], - - # List of source files: - 'sources': [ - '<@(src_files)', - ], - - # Settings which should be applied when a target's object files are used as linker input: - 'link_settings': { - # Define libraries: - 'libraries': [ - '<@(libraries)', - ], - - # Define library directories: - 'library_dirs': [ - '<@(library_dirs)', - ], - }, - - # C/C++ compiler flags: - 'cflags': [ - # Enable commonly used warning options: - '-Wall', - - # Aggressive optimization: - '-O3', - ], - - # C specific compiler flags: - 'cflags_c': [ - # Specify the C standard to which a program is expected to conform: - '-std=c99', - ], - - # C++ specific compiler flags: - 'cflags_cpp': [ - # Specify the C++ standard to which a program is expected to conform: - '-std=c++11', - ], - - # Linker flags: - 'ldflags': [], - - # Apply conditions based on the host OS: - 'conditions': [ - [ - 'OS=="mac"', - { - # Linker flags: - 'ldflags': [ - '-undefined dynamic_lookup', - '-Wl,-no-pie', - '-Wl,-search_paths_first', - ], - }, - ], # end condition (OS=="mac") - [ - 'OS!="win"', - { - # C/C++ flags: - 'cflags': [ - # Generate platform-independent code: - '-fPIC', - ], - }, - ], # end condition (OS!="win") - ], # end conditions - }, # end target <(addon_target_name) - - # Target to copy a generated add-on to a standard location: - { - 'target_name': 'copy_addon', - - # Declare that the output of this target is not linked: - 'type': 'none', - - # Define dependencies: - 'dependencies': [ - # Require that the add-on be generated before building this target: - '<(addon_target_name)', - ], - - # Define a list of actions: - 'actions': [ - { - 'action_name': 'copy_addon', - 'message': 'Copying addon...', - - # Explicitly list the inputs in the command-line invocation below: - 'inputs': [], - - # Declare the expected outputs: - 'outputs': [ - '<(addon_output_dir)/<(addon_target_name).node', - ], - - # Define the command-line invocation: - 'action': [ - 'cp', - '<(PRODUCT_DIR)/<(addon_target_name).node', - '<(addon_output_dir)/<(addon_target_name).node', - ], - }, - ], # end actions - }, # end target copy_addon - ], # end targets -} diff --git a/float64/base/add/docs/repl.txt b/float64/base/add/docs/repl.txt deleted file mode 100644 index 48b89d18..00000000 --- a/float64/base/add/docs/repl.txt +++ /dev/null @@ -1,118 +0,0 @@ - -{{alias}}( z1, z2 ) - Adds two double-precision complex floating-point numbers. - - Parameters - ---------- - z1: Complex128 - Complex number. - - z2: Complex128 - Complex number. - - Returns - ------- - out: Complex128 - Result. - - Examples - -------- - > var z = new {{alias:@stdlib/complex/float64/ctor}}( 5.0, 3.0 ) - - > var out = {{alias}}( z, z ) - - > var re = {{alias:@stdlib/complex/float64/real}}( out ) - 10.0 - > var im = {{alias:@stdlib/complex/float64/imag}}( out ) - 6.0 - - -{{alias}}.assign( re1, im1, re2, im2, out, strideOut, offsetOut ) - Adds two double-precision complex floating-point numbers and assigns results - to a provided output array. - - Parameters - ---------- - re1: number - Real component of the first complex number. - - im1: number - Imaginary component of the first complex number. - - re2: number - Real component of the second complex number. - - im2: number - Imaginary component of the second complex number. - - out: ArrayLikeObject - Output array. - - strideOut: integer - Stride length. - - offsetOut: integer - Starting index. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var out = new {{alias:@stdlib/array/float64}}( 2 ); - > {{alias}}.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ) - [ 3.0, 4.0 ] - - -{{alias}}.strided( z1, sz1, oz1, z2, sz2, oz2, out, so, oo ) - Adds two double-precision complex floating-point numbers stored in real- - valued strided array views and assigns results to a provided strided output - array. - - Parameters - ---------- - z1: ArrayLikeObject - First complex number view. - - sz1: integer - Stride length for `z1`. - - oz1: integer - Starting index for `z1`. - - z2: ArrayLikeObject - Second complex number view. - - sz2: integer - Stride length for `z2`. - - oz2: integer - Starting index for `z2`. - - out: ArrayLikeObject - Output array. - - so: integer - Stride length for `out`. - - oo: integer - Starting index for `out`. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var z1 = new {{alias:@stdlib/array/float64}}( [ 5.0, 3.0 ] ); - > var z2 = new {{alias:@stdlib/array/float64}}( [ -2.0, 1.0 ] ); - > var out = new {{alias:@stdlib/array/float64}}( 2 ); - > {{alias}}.strided( z1, 1, 0, z2, 1, 0, out, 1, 0 ) - [ 3.0, 4.0 ] - - See Also - -------- - diff --git a/float64/base/add/docs/types/index.d.ts b/float64/base/add/docs/types/index.d.ts deleted file mode 100644 index 056a9c58..00000000 --- a/float64/base/add/docs/types/index.d.ts +++ /dev/null @@ -1,136 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex128 } from '@stdlib/types/complex'; -import { Collection, NumericArray } from '@stdlib/types/array'; - -/** -* Interface for adding two double-precision complex floating-point numbers. -*/ -interface Add { - /** - * Adds two double-precision complex floating-point numbers. - * - * @param z1 - complex number - * @param z2 - complex number - * @returns result - * - * @example - * var Complex128 = require( './../../../../../float64/ctor' ); - * - * var z = new Complex128( 5.0, 3.0 ); - * - * var out = add( z, z ); - * // returns [ 10.0, 6.0 ] - */ - ( z1: Complex128, z2: Complex128 ): Complex128; - - /** - * Adds two double-precision complex floating-point numbers and assigns results to a provided output array. - * - * @param re1 - real component of the first complex number - * @param im1 - imaginary component of the first complex number - * @param re2 - real component of the second complex number - * @param im2 - imaginary component of the second complex number - * @param out - output array - * @param strideOut - stride length - * @param offsetOut - starting index - * @returns output array - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var out = new Float64Array( 2 ); - * var v = add.assign( 5.0, 3.0, 5.0, 3.0, out, 1, 0 ); - * // returns [ 10.0, 6.0 ] - * - * var bool = ( out === v ); - * // returns true - */ - assign>( re1: number, im1: number, re2: number, im2: number, out: T, strideOut: number, offsetOut: number ): T; - - /** - * Adds two double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. - * - * @param z1 - first complex number view - * @param strideZ1 - stride length for `z1` - * @param offsetZ1 - starting index for `z1` - * @param z2 - second complex number view - * @param strideZ2 - stride length for `z2` - * @param offsetZ2 - starting index for `z2` - * @param out - output array - * @param strideOut - stride length for `out` - * @param offsetOut - starting index for `out` - * @returns output array - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var z1 = new Float64Array( [ 5.0, 3.0 ] ); - * var z2 = new Float64Array( [ 5.0, 3.0 ] ); - * - * var out = add.strided( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - * // returns [ 10.0, 6.0 ] - */ - strided, U extends NumericArray | Collection, V extends NumericArray | Collection>( z1: T, strideZ1: number, offsetZ1: number, z2: U, strideZ2: number, offsetZ2: number, out: V, strideOut: number, offsetOut: number ): V; -} - -/** -* Adds two double-precision complex floating-point numbers. -* -* @param z1 - complex number -* @param z2 - complex number -* @returns result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var out = add( z, z ); -* // returns [ 10.0, 6.0 ] -* -* @example -* var Float64Array = require( '@stdlib/array/float64' ); -* -* var out = new Float64Array( 2 ); -* var v = add.assign( 5.0, 3.0, 5.0, 3.0, out, 1, 0 ); -* // returns [ 10.0, 6.0 ] -* -* var bool = ( out === v ); -* // returns true -* -* @example -* var Float64Array = require( '@stdlib/array/float64' ); -* -* var z1 = new Float64Array( [ 5.0, 3.0 ] ); -* var z2 = new Float64Array( [ 5.0, 3.0 ] ); -* -* var out = add.strided( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); -* // returns [ 10.0, 6.0 ] -*/ -declare var add: Add; - - -// EXPORTS // - -export = add; diff --git a/float64/base/add/docs/types/test.ts b/float64/base/add/docs/types/test.ts deleted file mode 100644 index c85d9ff8..00000000 --- a/float64/base/add/docs/types/test.ts +++ /dev/null @@ -1,357 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../../float64/ctor' ); -import add = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - add( z, z ); // $ExpectType Complex128 -} - -// The compiler throws an error if the function is provided a first argument which is not a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - add( true, z ); // $ExpectError - add( false, z ); // $ExpectError - add( null, z ); // $ExpectError - add( undefined, z ); // $ExpectError - add( '5', z ); // $ExpectError - add( [], z ); // $ExpectError - add( {}, z ); // $ExpectError - add( ( x: number ): number => x, z ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument which is not a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - add( z, true ); // $ExpectError - add( z, false ); // $ExpectError - add( z, null ); // $ExpectError - add( z, undefined ); // $ExpectError - add( z, '5' ); // $ExpectError - add( z, [] ); // $ExpectError - add( z, {} ); // $ExpectError - add( z, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z = new Complex128( 1.0, 1.0 ); - - add(); // $ExpectError - add( z ); // $ExpectError - add( z, z, z ); // $ExpectError -} - -// Attached to the main export is an `assign` method which returns a collection... -{ - add.assign( 1.0, 1.0, 1.0, 1.0, new Float64Array( 2 ), 1, 0 ); // $ExpectType Float64Array - add.assign( 1.0, 1.0, 1.0, 1.0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - add.assign( 1.0, 1.0, 1.0, 1.0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `assign` method is provided a first argument which is not a number... -{ - const out = new Float64Array( 2 ); - - add.assign( true, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( false, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( null, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( undefined, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( '5', 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( [], 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( {}, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( ( x: number ): number => x, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a second argument which is not a number... -{ - const out = new Float64Array( 2 ); - - add.assign( 1.0, true, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, false, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, null, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, undefined, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, '5', 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, [], 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, {}, 3.0, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, ( x: number ): number => x, 3.0, 4.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a third argument which is not a number... -{ - const out = new Float64Array( 2 ); - - add.assign( 1.0, 2.0, true, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, false, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, null, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, undefined, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, '5', 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, [], 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, {}, 4.0, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, ( x: number ): number => x, 4.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fourth argument which is not a number... -{ - const out = new Float64Array( 2 ); - - add.assign( 1.0, 2.0, 3.0, true, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, false, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, null, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, undefined, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, '5', out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, [], out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, {}, out, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fifth argument which is not a collection... -{ - add.assign( 1.0, 2.0, 3.0, 4.0, 1, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, true, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, false, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, null, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, undefined, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, '5', 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, [ '5' ], 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, {}, 1, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a sixth argument which is not a number... -{ - const out = new Float64Array( 2 ); - - add.assign( 1.0, 2.0, 3.0, 4.0, out, true, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, false, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, null, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, undefined, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, '5', 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, [], 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, {}, 0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a seventh argument which is not a number... -{ - const out = new Float64Array( 2 ); - - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1, true ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1, false ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1, null ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1, undefined ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1, '5' ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1, [] ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1, {} ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided an unsupported number of arguments... -{ - const out = new Float64Array( 2 ); - - add.assign(); // $ExpectError - add.assign( 1.0 ); // $ExpectError - add.assign( 1.0, 2.0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1 ); // $ExpectError - add.assign( 1.0, 2.0, 3.0, 4.0, out, 1, 0, {} ); // $ExpectError -} - -// Attached to the main export is a `strided` method which returns a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - - add.strided( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); // $ExpectType Float64Array - add.strided( z1, 1, 0, z2, 1, 0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - add.strided( z1, 1, 0, z2, 1, 0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `strided` method is provided a first argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - add.strided( true, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( false, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( null, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( undefined, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( '5', 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( [ '5' ], 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( {}, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( ( x: number ): number => x, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a second argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - add.strided( z1, true, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, false, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, null, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, undefined, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, '5', 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, [], 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, {}, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, ( x: number ): number => x, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a third argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( 2 ); - - add.strided( z1, 1, true, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, false, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, null, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, undefined, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, '5', z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, [], z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, {}, z2, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, ( x: number ): number => x, z2, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fourth argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - add.strided( z1, 1, 0, true, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, false, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, null, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, undefined, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, '5', 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, [ '5' ], 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, {}, 1, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, ( x: number ): number => x, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fifth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - add.strided( z1, 1, 0, z2, true, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, false, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, null, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, undefined, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, '5', 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, [], 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, {}, 0, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, ( x: number ): number => x, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a sixth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - add.strided( z1, 1, 0, z2, 1, true, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, false, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, null, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, undefined, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, '5', out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, [], out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, {}, out, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a seventh argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - - add.strided( z1, 1, 0, z2, 1, 0, 1, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, true, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, false, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, null, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, undefined, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, '5', 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, [ '5' ], 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, {}, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an eighth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - add.strided( z1, 1, 0, z2, 1, 0, out, true, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, false, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, null, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, undefined, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, '5', 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, [], 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, {}, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a ninth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - add.strided( z1, 1, 0, z2, 1, 0, out, 1, true ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, 1, false ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, 1, null ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, 1, undefined ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, 1, '5' ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, 1, [] ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, 1, {} ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an unsupported number of arguments... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - add.strided(); // $ExpectError - add.strided( z1 ); // $ExpectError - add.strided( z1, 1 ); // $ExpectError - add.strided( z1, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, 1 ); // $ExpectError - add.strided( z1, 1, 0, z2, 1, 0, out, 1, 0, {} ); // $ExpectError -} diff --git a/float64/base/add/examples/c/Makefile b/float64/base/add/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float64/base/add/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/add/examples/c/example.c b/float64/base/add/examples/c/example.c deleted file mode 100644 index c92c2219..00000000 --- a/float64/base/add/examples/c/example.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/add.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 3.14, 1.5 ), - stdlib_complex128( -3.14, 1.5 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - stdlib_complex128_t y; - double re; - double im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex128_reim( v, &re, &im ); - printf( "z = %lf + %lfi\n", re, im ); - - y = stdlib_base_complex128_add( v, v ); - stdlib_complex128_reim( y, &re, &im ); - printf( "cadd(z, z) = %lf + %lfi\n", re, im ); - } -} diff --git a/float64/base/add/examples/index.js b/float64/base/add/examples/index.js deleted file mode 100644 index fa090dfa..00000000 --- a/float64/base/add/examples/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128Array = require( '@stdlib/array/complex128' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var add = require( './../lib' ); - -// Generate arrays of random values: -var z1 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise addition: -logEachMap( '(%s) + (%s) = %s', z1, z2, add ); diff --git a/float64/base/add/include.gypi b/float64/base/add/include.gypi deleted file mode 100644 index 5c60648e..00000000 --- a/float64/base/add/include.gypi +++ /dev/null @@ -1,53 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A GYP include file for building a Node.js native add-on. -# -# Main documentation: -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Source directory: - 'src_dir': './src', - - # Include directories: - 'include_dirs': [ - '[ 3.0, 4.0 ] -*/ -function assign( re1, im1, re2, im2, out, strideOut, offsetOut ) { - out[ offsetOut ] = re1 + re2; - out[ offsetOut+strideOut ] = im1 + im2; - return out; -} - - -// EXPORTS // - -module.exports = assign; diff --git a/float64/base/add/lib/index.js b/float64/base/add/lib/index.js deleted file mode 100644 index 63988677..00000000 --- a/float64/base/add/lib/index.js +++ /dev/null @@ -1,54 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Add two double-precision complex floating-point numbers. -* -* @module @stdlib/complex/float64/base/add -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var cadd = require( '@stdlib/complex/float64/base/add' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var out = cadd( z, z ); -* // returns [ 10.0, 6.0 ] -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var main = require( './main.js' ); -var assign = require( './assign.js' ); -var strided = require( './strided.js' ); - - -// MAIN // - -setReadOnly( main, 'assign', assign ); -setReadOnly( main, 'strided', strided ); - - -// EXPORTS // - -module.exports = main; - -// exports: { "assign": "main.assign", "strided": "main.strided" } diff --git a/float64/base/add/lib/main.js b/float64/base/add/lib/main.js deleted file mode 100644 index c2a717fc..00000000 --- a/float64/base/add/lib/main.js +++ /dev/null @@ -1,54 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); - - -// MAIN // - -/** -* Adds two double-precision complex floating-point numbers. -* -* @param {Complex128} z1 - complex number -* @param {Complex128} z2 - complex number -* @returns {Complex128} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var out = cadd( z, z ); -* // returns [ 10.0, 6.0 ] -*/ -function cadd( z1, z2 ) { - var re = real( z1 ) + real( z2 ); - var im = imag( z1 ) + imag( z2 ); - return new Complex128( re, im ); -} - - -// EXPORTS // - -module.exports = cadd; diff --git a/float64/base/add/lib/native.js b/float64/base/add/lib/native.js deleted file mode 100644 index cb983adf..00000000 --- a/float64/base/add/lib/native.js +++ /dev/null @@ -1,53 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex128 = require( './../../../../float64/ctor' ); -var addon = require( './../src/addon.node' ); - - -// MAIN // - -/** -* Adds two double-precision complex floating-point numbers. -* -* @private -* @param {Complex128} z1 - complex number -* @param {Complex128} z2 - complex number -* @returns {Complex128} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var out = cadd( z, z ); -* // returns [ 10.0, 6.0 ] -*/ -function cadd( z1, z2 ) { - var v = addon( z1, z2 ); - return new Complex128( v.re, v.im ); -} - - -// EXPORTS // - -module.exports = cadd; diff --git a/float64/base/add/lib/strided.js b/float64/base/add/lib/strided.js deleted file mode 100644 index e75587aa..00000000 --- a/float64/base/add/lib/strided.js +++ /dev/null @@ -1,55 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Adds two double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. -* -* @param {Float64Array} z1 - first complex number view -* @param {integer} strideZ1 - stride length for `z1` -* @param {NonNegativeInteger} offsetZ1 - starting index for `z1` -* @param {Float64Array} z2 - second complex number view -* @param {integer} strideZ2 - stride length for `z2` -* @param {NonNegativeInteger} offsetZ2 - starting index for `z2` -* @param {Collection} out - output array -* @param {integer} strideOut - stride length for `out` -* @param {NonNegativeInteger} offsetOut - starting index for `out` -* @returns {Collection} output array -* -* @example -* var Float64Array = require( '@stdlib/array/float64' ); -* -* var z1 = new Float64Array( [ 5.0, 3.0 ] ); -* var z2 = new Float64Array( [ -2.0, 1.0 ] ); -* -* var out = strided( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); -* // returns [ 3.0, 4.0 ] -*/ -function strided( z1, strideZ1, offsetZ1, z2, strideZ2, offsetZ2, out, strideOut, offsetOut ) { // eslint-disable-line max-len - out[ offsetOut ] = z1[ offsetZ1 ] + z2[ offsetZ2 ]; - out[ offsetOut+strideOut ] = z1[ offsetZ1+strideZ1 ] + z2[ offsetZ2+strideZ2 ]; // eslint-disable-line max-len - return out; -} - - -// EXPORTS // - -module.exports = strided; diff --git a/float64/base/add/manifest.json b/float64/base/add/manifest.json deleted file mode 100644 index 48efffba..00000000 --- a/float64/base/add/manifest.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/napi/binary", - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - } - ] -} diff --git a/float64/base/add/package.json b/float64/base/add/package.json deleted file mode 100644 index 6fedc943..00000000 --- a/float64/base/add/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "@stdlib/complex/float64/base/add", - "version": "0.0.0", - "description": "Add two double-precision complex floating-point numbers.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "cadd", - "add", - "addition", - "sum", - "arithmetic", - "complex", - "cmplx", - "number" - ] -} diff --git a/float64/base/add/src/Makefile b/float64/base/add/src/Makefile deleted file mode 100644 index a28d8988..00000000 --- a/float64/base/add/src/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - - -# RULES # - -#/ -# Removes generated files for building an add-on. -# -# @example -# make clean-addon -#/ -clean-addon: - $(QUIET) -rm -f *.o *.node - -.PHONY: clean-addon - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: clean-addon - -.PHONY: clean diff --git a/float64/base/add/src/addon.c b/float64/base/add/src/addon.c deleted file mode 100644 index ee2809ec..00000000 --- a/float64/base/add/src/addon.c +++ /dev/null @@ -1,22 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/add.h" -#include "stdlib/math/base/napi/binary.h" - -STDLIB_MATH_BASE_NAPI_MODULE_ZZ_Z( stdlib_base_complex128_add ) diff --git a/float64/base/add/src/main.c b/float64/base/add/src/main.c deleted file mode 100644 index e30df7a2..00000000 --- a/float64/base/add/src/main.c +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/add.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" - -/** -* Adds two double-precision complex floating-point numbers. -* -* @param z1 input value -* @param z2 input value -* @return result -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* #include "stdlib/complex/float64/real.h" -* #include "stdlib/complex/float64/imag.h" -* -* stdlib_complex128_t z = stdlib_complex128( 3.0, -2.0 ); -* -* stdlib_complex128_t out = stdlib_base_complex128_add( z, z ); -* -* double re = stdlib_complex128_real( out ); -* // returns 6.0 -* -* double im = stdlib_complex128_imag( out ); -* // returns -4.0 -*/ -stdlib_complex128_t stdlib_base_complex128_add( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ) { - double re1; - double re2; - double im1; - double im2; - double re; - double im; - - stdlib_complex128_reim( z1, &re1, &im1 ); - stdlib_complex128_reim( z2, &re2, &im2 ); - - re = re1 + re2; - im = im1 + im2; - - return stdlib_complex128( re, im ); -} diff --git a/float64/base/add/test/test.assign.js b/float64/base/add/test/test.assign.js deleted file mode 100644 index bb124362..00000000 --- a/float64/base/add/test/test.assign.js +++ /dev/null @@ -1,132 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' ); -var Float64Array = require( '@stdlib/array/float64' ); -var add = require( './../lib/assign.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof add, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function adds two complex numbers', function test( t ) { - var expected; - var out; - var v; - - out = new Float64Array( 2 ); - v = add( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ); - - expected = new Float64Array( [ 3.0, 4.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 4 ); - v = add( 5.0, 3.0, -2.0, 1.0, out, 2, 0 ); - - expected = new Float64Array( [ 3.0, 0.0, 4.0, 0.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 4 ); - v = add( 5.0, 3.0, -2.0, 1.0, out, 2, 1 ); - - expected = new Float64Array( [ 0.0, 3.0, 0.0, 4.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 4 ); - v = add( 5.0, 3.0, -2.0, 1.0, out, -2, 3 ); - - expected = new Float64Array( [ 0.0, 4.0, 0.0, 3.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the output component is `NaN`', function test( t ) { - var expected; - var out; - var v; - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, 4.0 ] ); - - v = add( NaN, 3.0, -2.0, 1.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, 4.0 ] ); - - v = add( 5.0, 3.0, NaN, 1.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, 4.0 ] ); - - v = add( NaN, 3.0, NaN, 1.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ 3.0, NaN ] ); - - v = add( 5.0, NaN, -2.0, 1.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ 3.0, NaN ] ); - - v = add( 5.0, 3.0, -2.0, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ 3.0, NaN ] ); - - v = add( 5.0, NaN, -2.0, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = add( NaN, NaN, NaN, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/add/test/test.js b/float64/base/add/test/test.js deleted file mode 100644 index 04b4d699..00000000 --- a/float64/base/add/test/test.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isMethod = require( '@stdlib/assert/is-method' ); -var add = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof add, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'attached to the main export is an `assign` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( add, 'assign' ), true, 'returns expected value' ); - t.end(); -}); - -tape( 'attached to the main export is a `strided` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( add, 'strided' ), true, 'returns expected value' ); - t.end(); -}); diff --git a/float64/base/add/test/test.main.js b/float64/base/add/test/test.main.js deleted file mode 100644 index 9d505464..00000000 --- a/float64/base/add/test/test.main.js +++ /dev/null @@ -1,110 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var add = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof add, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function adds two complex numbers', function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - - v = add( z1, z2 ); - - t.strictEqual( real( v ), 3.0, 'returns expected value' ); - t.strictEqual( imag( v ), 4.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the resulting component is `NaN`', function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - - v = add( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 4.0, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - - v = add( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 4.0, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - - v = add( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 4.0, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, 1.0 ); - - v = add( z1, z2 ); - t.strictEqual( real( v ), 3.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, NaN ); - - v = add( z1, z2 ); - t.strictEqual( real( v ), 3.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, NaN ); - - v = add( z1, z2 ); - t.strictEqual( real( v ), 3.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - - v = add( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/add/test/test.native.js b/float64/base/add/test/test.native.js deleted file mode 100644 index 8f2ecac4..00000000 --- a/float64/base/add/test/test.native.js +++ /dev/null @@ -1,119 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var tape = require( 'tape' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var add = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( add instanceof Error ) -}; - - -// TESTS // - -tape( 'main export is a function', opts, function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof add, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function adds two complex numbers', opts, function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - - v = add( z1, z2 ); - - t.strictEqual( real( v ), 3.0, 'returns expected value' ); - t.strictEqual( imag( v ), 4.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the resulting component is `NaN`', opts, function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - - v = add( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 4.0, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - - v = add( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 4.0, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - - v = add( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 4.0, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, 1.0 ); - - v = add( z1, z2 ); - t.strictEqual( real( v ), 3.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, NaN ); - - v = add( z1, z2 ); - t.strictEqual( real( v ), 3.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, NaN ); - - v = add( z1, z2 ); - t.strictEqual( real( v ), 3.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - - v = add( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/add/test/test.strided.js b/float64/base/add/test/test.strided.js deleted file mode 100644 index 0968dc06..00000000 --- a/float64/base/add/test/test.strided.js +++ /dev/null @@ -1,158 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' ); -var Float64Array = require( '@stdlib/array/float64' ); -var add = require( './../lib/strided.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof add, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function adds two complex numbers', function test( t ) { - var expected; - var out; - var z1; - var z2; - var v; - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - out = new Float64Array( 2 ); - v = add( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - - expected = new Float64Array( [ 3.0, 4.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 0.0, 3.0, 0.0 ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - out = new Float64Array( 4 ); - v = add( z1, 2, 0, z2, 1, 0, out, 2, 0 ); - - expected = new Float64Array( [ 3.0, 0.0, 4.0, 0.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ 0.0, -2.0, 0.0, 1.0 ] ); - out = new Float64Array( 4 ); - v = add( z1, 1, 0, z2, 2, 1, out, 2, 1 ); - - expected = new Float64Array( [ 0.0, 3.0, 0.0, 4.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 3.0, 5.0 ] ); - z2 = new Float64Array( [ 1.0, -2.0 ] ); - out = new Float64Array( 4 ); - v = add( z1, -1, 1, z2, -1, 1, out, -2, 3 ); - - expected = new Float64Array( [ 0.0, 4.0, 0.0, 3.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the output component is `NaN`', function test( t ) { - var expected; - var out; - var z1; - var z2; - var v; - - z1 = new Float64Array( [ NaN, 3.0 ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, 4.0 ] ); - - v = add( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ NaN, 1.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, 4.0 ] ); - - v = add( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ NaN, 3.0 ] ); - z2 = new Float64Array( [ NaN, 1.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, 4.0 ] ); - - v = add( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, NaN ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ 3.0, NaN ] ); - - v = add( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ -2.0, NaN ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ 3.0, NaN ] ); - - v = add( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, NaN ] ); - z2 = new Float64Array( [ -2.0, NaN ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ 3.0, NaN ] ); - - v = add( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ NaN, NaN ] ); - z2 = new Float64Array( [ NaN, NaN ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = add( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/add3/README.md b/float64/base/add3/README.md deleted file mode 100644 index ba563d4f..00000000 --- a/float64/base/add3/README.md +++ /dev/null @@ -1,275 +0,0 @@ - - -# add3 - -> Compute the sum of three double-precision complex floating-point numbers. - -
- -
- - - -
- -## Usage - -```javascript -var add3 = require( '@stdlib/complex/float64/base/add3' ); -``` - -#### add3( z1, z2, z3 ) - -Computes the sum of three double-precision complex floating-point numbers. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z = new Complex128( -1.5, 2.5 ); - -var v = add3( z, z, z ); -// returns [ -4.5, 7.5 ] -``` - -The function supports the following parameters: - -- **z1**: first complex number. -- **z2**: second complex number. -- **z3**: third complex number. - -#### add3.assign( re1, im1, re2, im2, re3, im3, out, strideOut, offsetOut ) - -Computes the sum of three double-precision complex floating-point numbers and assigns results to a provided output array. - -```javascript -var Float64Array = require( '@stdlib/array/float64' ); - -var out = new Float64Array( 2 ); -var v = add3.assign( 5.0, 3.0, -2.0, 1.0, 5.0, 3.0, out, 1, 0 ); -// returns [ 8.0, 7.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **re1**: real component of the first complex number. -- **im1**: imaginary component of the first complex number. -- **re2**: real component of the second complex number. -- **im2**: imaginary component of the second complex number. -- **re3**: real component of the third complex number. -- **im3**: imaginary component of the third complex number. -- **out**: output array. -- **strideOut**: stride length for `out`. -- **offsetOut**: starting index for `out`. - -#### add3.strided( z1, sz1, oz1, z2, sz2, oz2, z3, sz3, oz3, out, so, oo ) - -Computes the sum of three double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. - -```javascript -var Float64Array = require( '@stdlib/array/float64' ); - -var z1 = new Float64Array( [ 5.0, 3.0 ] ); -var z2 = new Float64Array( [ -2.0, 1.0 ] ); -var z3 = new Float64Array( [ 5.0, 3.0 ] ); -var out = new Float64Array( 2 ); - -var v = add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); -// returns [ 8.0, 7.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **z1**: first complex number strided array view. -- **sz1**: stride length for `z1`. -- **oz1**: starting index for `z1`. -- **z2**: second complex number strided array view. -- **sz2**: stride length for `z2`. -- **oz2**: starting index for `z2`. -- **z3**: third complex number strided array view. -- **sz3**: stride length for `z3`. -- **oz3**: starting index for `z3`. -- **out**: output array. -- **so**: stride length for `out`. -- **oo**: starting index for `out`. - -
- - - -
- -## Examples - - - -```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var add3 = require( '@stdlib/complex/float64/base/add3' ); - -// Generate arrays of random values: -var z1 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); -var z3 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise addition: -logEachMap( '(%s) + (%s) + (%s) = %s', z1, z2, z3, add3 ); -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float64/base/add3.h" -``` - -#### stdlib_base_complex128_add3( z1, z2, z3 ) - -Computes the sum of three double-precision complex floating-point numbers. - -```c -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/imag.h" - -stdlib_complex128_t z = stdlib_complex128( 3.0, -2.0 ); - -stdlib_complex128_t out = stdlib_base_complex128_add3( z, z, z ); - -double re = stdlib_complex128_real( out ); -// returns 9.0 - -double im = stdlib_complex128_imag( out ); -// returns -6.0 -``` - -The function accepts the following arguments: - -- **z1**: `[in] stdlib_complex128_t` first input value. -- **z2**: `[in] stdlib_complex128_t` second input value. -- **z3**: `[in] stdlib_complex128_t` third input value. - -```c -stdlib_complex128_t stdlib_base_complex128_add3( const stdlib_complex128_t z1, const stdlib_complex128_t z2, const stdlib_complex128_t z3 ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float64/base/add3.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 3.14, 1.5 ), - stdlib_complex128( -3.14, 1.5 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - stdlib_complex128_t y; - double re; - double im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex128_reim( v, &re, &im ); - printf( "z = %lf + %lfi\n", re, im ); - - y = stdlib_base_complex128_add3( v, v, v ); - stdlib_complex128_reim( y, &re, &im ); - printf( "add3(z, z, z) = %lf + %lfi\n", re, im ); - } -} -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/float64/base/add3/benchmark/benchmark.assign.js b/float64/base/add3/benchmark/benchmark.assign.js deleted file mode 100644 index 5c3f41f2..00000000 --- a/float64/base/add3/benchmark/benchmark.assign.js +++ /dev/null @@ -1,71 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Float64Array = require( '@stdlib/array/float64' ); -var format = require( '@stdlib/string/format' ); -var pkg = require( './../package.json' ).name; -var add3 = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float64' -}; - - -// MAIN // - -bench( format( '%s:assign', pkg ), function benchmark( b ) { - var out; - var re; - var im; - var N; - var i; - var j; - var k; - - N = 100; - re = uniform( N, -500.0, 500.0, options ); - im = uniform( N, -500.0, 500.0, options ); - - out = new Float64Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = i % N; - k = ( i+1 ) % N; - out = add3.assign( re[ j ], im[ j ], re[ k ], im[ k ], re[ j ], im[ k ], out, 1, 0 ); // eslint-disable-line max-len - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( out[ 0 ] ) || isnan( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/add3/benchmark/benchmark.js b/float64/base/add3/benchmark/benchmark.js deleted file mode 100644 index 519cafd1..00000000 --- a/float64/base/add3/benchmark/benchmark.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var pkg = require( './../package.json' ).name; -var add3 = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = add3( z, z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( real( out ) ) || isnan( imag( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/add3/benchmark/benchmark.native.js b/float64/base/add3/benchmark/benchmark.native.js deleted file mode 100644 index 32a40aff..00000000 --- a/float64/base/add3/benchmark/benchmark.native.js +++ /dev/null @@ -1,70 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); -var format = require( '@stdlib/string/format' ); -var pkg = require( './../package.json' ).name; - - -// VARIABLES // - -var add3 = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( add3 instanceof Error ) -}; - - -// MAIN // - -bench( format( '%s::native', pkg ), opts, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = add3( z, z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( real( out ) ) || isnan( imag( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/add3/benchmark/benchmark.strided.js b/float64/base/add3/benchmark/benchmark.strided.js deleted file mode 100644 index 5c7817d0..00000000 --- a/float64/base/add3/benchmark/benchmark.strided.js +++ /dev/null @@ -1,71 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Float64Array = require( '@stdlib/array/float64' ); -var format = require( '@stdlib/string/format' ); -var pkg = require( './../package.json' ).name; -var add3 = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float64' -}; - - -// MAIN // - -bench( format( '%s:strided', pkg ), function benchmark( b ) { - var out; - var z1; - var z2; - var z3; - var N; - var i; - var j; - - N = 50; - z1 = uniform( N*2, -500.0, 500.0, options ); - z2 = uniform( N*2, -500.0, 500.0, options ); - z3 = uniform( N*2, -500.0, 500.0, options ); - - out = new Float64Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = ( i % N ) * 2; - out = add3.strided( z1, 1, j, z2, 1, j, z3, 1, j, out, 1, 0 ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( out[ 0 ] ) || isnan( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/add3/benchmark/c/Makefile b/float64/base/add3/benchmark/c/Makefile deleted file mode 100644 index 85a01e54..00000000 --- a/float64/base/add3/benchmark/c/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/add3/benchmark/c/benchmark.c b/float64/base/add3/benchmark/c/benchmark.c deleted file mode 100644 index 09a8210a..00000000 --- a/float64/base/add3/benchmark/c/benchmark.c +++ /dev/null @@ -1,149 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include -#include -#include -#include - -#define NAME "add3" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double complex z1[ 100 ]; - double complex z2[ 100 ]; - double complex z3[ 100 ]; - double complex z4; - double elapsed; - double re; - double im; - double t; - int i; - - for ( i = 0; i < 100; i++ ) { - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z1[ i ] = re + im*I; - - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z2[ i ] = re + im*I; - - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z3[ i ] = re + im*I; - } - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - z4 = (creal(z1[i%100])+creal(z2[i%100])+creal(z3[i%100])) + (cimag(z1[i%100])+cimag(z2[i%100])+cimag(z3[i%100]))*I; - if ( z4 != z4 ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( z4 != z4 ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/base/add3/benchmark/c/native/Makefile b/float64/base/add3/benchmark/c/native/Makefile deleted file mode 100644 index a4bd7b38..00000000 --- a/float64/base/add3/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/add3/benchmark/c/native/benchmark.c b/float64/base/add3/benchmark/c/native/benchmark.c deleted file mode 100644 index fc04ee4e..00000000 --- a/float64/base/add3/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,153 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/add3.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include -#include -#include -#include -#include - -#define NAME "add3" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - stdlib_complex128_t z1[ 100 ]; - stdlib_complex128_t z2[ 100 ]; - stdlib_complex128_t z3[ 100 ]; - stdlib_complex128_t z4; - double elapsed; - double re; - double im; - double t; - int i; - - for ( i = 0; i < 100; i++ ) { - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z1[ i ] = stdlib_complex128( re, im ); - - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z2[ i ] = stdlib_complex128( re, im ); - - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z3[ i ] = stdlib_complex128( re, im ); - } - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - z4 = stdlib_base_complex128_add3( z1[ i%100 ], z2[ i%100 ], z3[ i%100 ] ); - stdlib_complex128_reim( z4, &re, &im ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/base/add3/benchmark/julia/REQUIRE b/float64/base/add3/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float64/base/add3/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float64/base/add3/benchmark/julia/benchmark.jl b/float64/base/add3/benchmark/julia/benchmark.jl deleted file mode 100644 index 95e523c4..00000000 --- a/float64/base/add3/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "add3"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark ComplexF64( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) + ComplexF64( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) + ComplexF64( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float64/base/add3/binding.gyp b/float64/base/add3/binding.gyp deleted file mode 100644 index 68a1ca11..00000000 --- a/float64/base/add3/binding.gyp +++ /dev/null @@ -1,170 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A `.gyp` file for building a Node.js native add-on. -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # List of files to include in this file: - 'includes': [ - './include.gypi', - ], - - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Target name should match the add-on export name: - 'addon_target_name%': 'addon', - - # Set variables based on the host OS: - 'conditions': [ - [ - 'OS=="win"', - { - # Define the object file suffix: - 'obj': 'obj', - }, - { - # Define the object file suffix: - 'obj': 'o', - } - ], # end condition (OS=="win") - ], # end conditions - }, # end variables - - # Define compile targets: - 'targets': [ - - # Target to generate an add-on: - { - # The target name should match the add-on export name: - 'target_name': '<(addon_target_name)', - - # Define dependencies: - 'dependencies': [], - - # Define directories which contain relevant include headers: - 'include_dirs': [ - # Local include directory: - '<@(include_dirs)', - ], - - # List of source files: - 'sources': [ - '<@(src_files)', - ], - - # Settings which should be applied when a target's object files are used as linker input: - 'link_settings': { - # Define libraries: - 'libraries': [ - '<@(libraries)', - ], - - # Define library directories: - 'library_dirs': [ - '<@(library_dirs)', - ], - }, - - # C/C++ compiler flags: - 'cflags': [ - # Enable commonly used warning options: - '-Wall', - - # Aggressive optimization: - '-O3', - ], - - # C specific compiler flags: - 'cflags_c': [ - # Specify the C standard to which a program is expected to conform: - '-std=c99', - ], - - # C++ specific compiler flags: - 'cflags_cpp': [ - # Specify the C++ standard to which a program is expected to conform: - '-std=c++11', - ], - - # Linker flags: - 'ldflags': [], - - # Apply conditions based on the host OS: - 'conditions': [ - [ - 'OS=="mac"', - { - # Linker flags: - 'ldflags': [ - '-undefined dynamic_lookup', - '-Wl,-no-pie', - '-Wl,-search_paths_first', - ], - }, - ], # end condition (OS=="mac") - [ - 'OS!="win"', - { - # C/C++ flags: - 'cflags': [ - # Generate platform-independent code: - '-fPIC', - ], - }, - ], # end condition (OS!="win") - ], # end conditions - }, # end target <(addon_target_name) - - # Target to copy a generated add-on to a standard location: - { - 'target_name': 'copy_addon', - - # Declare that the output of this target is not linked: - 'type': 'none', - - # Define dependencies: - 'dependencies': [ - # Require that the add-on be generated before building this target: - '<(addon_target_name)', - ], - - # Define a list of actions: - 'actions': [ - { - 'action_name': 'copy_addon', - 'message': 'Copying addon...', - - # Explicitly list the inputs in the command-line invocation below: - 'inputs': [], - - # Declare the expected outputs: - 'outputs': [ - '<(addon_output_dir)/<(addon_target_name).node', - ], - - # Define the command-line invocation: - 'action': [ - 'cp', - '<(PRODUCT_DIR)/<(addon_target_name).node', - '<(addon_output_dir)/<(addon_target_name).node', - ], - }, - ], # end actions - }, # end target copy_addon - ], # end targets -} diff --git a/float64/base/add3/docs/repl.txt b/float64/base/add3/docs/repl.txt deleted file mode 100644 index 53ecc2ab..00000000 --- a/float64/base/add3/docs/repl.txt +++ /dev/null @@ -1,133 +0,0 @@ - -{{alias}}( z1, z2, z3 ) - Computes the sum of three double-precision complex floating-point numbers. - - Parameters - ---------- - z1: Complex128 - Complex number. - - z2: Complex128 - Complex number. - - z3: Complex128 - Complex number. - - Returns - ------- - out: Complex128 - Result. - - Examples - -------- - > var z = new {{alias:@stdlib/complex/float64/ctor}}( 5.0, 3.0 ) - [ 5.0, 3.0 ] - > var out = {{alias}}( z, z, z ) - [ 15.0, 9.0 ] - - -{{alias}}.assign( re1, im1, re2, im2, re3, im3, out, strideOut, offsetOut ) - Computes the sum of three double-precision complex floating-point numbers - and assigns results to a provided output array. - - Parameters - ---------- - re1: number - Real component of the first complex number. - - im1: number - Imaginary component of the first complex number. - - re2: number - Real component of the second complex number. - - im2: number - Imaginary component of the second complex number. - - re3: number - Real component of the third complex number. - - im3: number - Imaginary component of the third complex number. - - out: ArrayLikeObject - Output array. - - strideOut: integer - Stride length. - - offsetOut: integer - Starting index. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var out = new {{alias:@stdlib/array/float64}}( 2 ); - > {{alias}}.assign( 5.0, 3.0, -2.0, 1.0, 5.0, 3.0, out, 1, 0 ) - [ 8.0, 7.0 ] - - -{{alias}}.strided( z1, sz1, oz1, z2, sz2, oz2, z3, sz3, oz3, out, so, oo ) - Computes the sum of three double-precision complex floating-point numbers - stored in real-valued strided array views and assigns results to a provided - strided output array. - - Parameters - ---------- - z1: ArrayLikeObject - First complex number view. - - sz1: integer - Stride length for `z1`. - - oz1: integer - Starting index for `z1`. - - z2: ArrayLikeObject - Second complex number view. - - sz2: integer - Stride length for `z2`. - - oz2: integer - Starting index for `z2`. - - z3: ArrayLikeObject - Third complex number view. - - sz3: integer - Stride length for `z3`. - - oz3: integer - Starting index for `z3`. - - out: ArrayLikeObject - Output array. - - so: integer - Stride length for `out`. - - oo: integer - Starting index for `out`. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var z1 = new {{alias:@stdlib/array/float64}}( [ 5.0, 3.0 ] ); - > var z2 = new {{alias:@stdlib/array/float64}}( [ -2.0, 1.0 ] ); - > var z3 = new {{alias:@stdlib/array/float64}}( [ 5.0, 3.0 ] ); - > var out = new {{alias:@stdlib/array/float64}}( 2 ); - > {{alias}}.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ) - [ 8.0, 7.0 ] - - See Also - -------- - diff --git a/float64/base/add3/docs/types/index.d.ts b/float64/base/add3/docs/types/index.d.ts deleted file mode 100644 index 7cb94cfa..00000000 --- a/float64/base/add3/docs/types/index.d.ts +++ /dev/null @@ -1,145 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex128 } from '@stdlib/types/complex'; -import { Collection, NumericArray } from '@stdlib/types/array'; - -/** -* Interface for summing three double-precision complex floating-point numbers. -*/ -interface Add { - /** - * Computes the sum of three double-precision complex floating-point numbers. - * - * @param z1 - first complex number - * @param z2 - second complex number - * @param z3 - third complex number - * @returns result - * - * @example - * var Complex128 = require( './../../../../../float64/ctor' ); - * - * var z = new Complex128( 5.0, 3.0 ); - * - * var out = add( z, z, z ); - * // returns [ 15.0, 9.0 ] - */ - ( z1: Complex128, z2: Complex128, z3: Complex128 ): Complex128; - - /** - * Computes the sum of three double-precision complex floating-point numbers and assigns results to a provided output array. - * - * @param re1 - real component of the first complex number - * @param im1 - imaginary component of the first complex number - * @param re2 - real component of the second complex number - * @param im2 - imaginary component of the second complex number - * @param re3 - real component of the third complex number - * @param im3 - imaginary component of the third complex number - * @param out - output array - * @param strideOut - stride length - * @param offsetOut - starting index - * @returns output array - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var out = new Float64Array( 2 ); - * var v = add.assign( 5.0, 3.0, 5.0, 3.0, 5.0, 3.0, out, 1, 0 ); - * // returns [ 15.0, 9.0 ] - * - * var bool = ( out === v ); - * // returns true - */ - assign>( re1: number, im1: number, re2: number, im2: number, re3: number, im3: number, out: T, strideOut: number, offsetOut: number ): T; - - /** - * Computes the sum of three double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. - * - * @param z1 - first complex number view - * @param strideZ1 - stride length for `z1` - * @param offsetZ1 - starting index for `z1` - * @param z2 - second complex number view - * @param strideZ2 - stride length for `z2` - * @param offsetZ2 - starting index for `z2` - * @param z3 - third complex number view - * @param strideZ3 - stride length for `z3` - * @param offsetZ3 - starting index for `z3` - * @param out - output array - * @param strideOut - stride length for `out` - * @param offsetOut - starting index for `out` - * @returns output array - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var z1 = new Float64Array( [ 5.0, 3.0 ] ); - * var z2 = new Float64Array( [ 5.0, 3.0 ] ); - * var z3 = new Float64Array( [ 5.0, 3.0 ] ); - * - * var out = add.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, new Float64Array( 2 ), 1, 0 ); - * // returns [ 15.0, 9.0 ] - */ - strided, U extends NumericArray | Collection, V extends NumericArray | Collection, W extends NumericArray | Collection>( z1: T, strideZ1: number, offsetZ1: number, z2: U, strideZ2: number, offsetZ2: number, z3: V, strideZ3: number, offsetZ3: number, out: W, strideOut: number, offsetOut: number ): W; -} - -/** -* Computes the sum of three double-precision complex floating-point numbers. -* -* @param z1 - first complex number -* @param z2 - second complex number -* @param z3 - third complex number -* @returns result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var out = add( z, z, z ); -* // returns [ 15.0, 9.0 ] -* -* @example -* var Float64Array = require( '@stdlib/array/float64' ); -* -* var out = new Float64Array( 2 ); -* var v = add.assign( 5.0, 3.0, 5.0, 3.0, 5.0, 3.0, out, 1, 0 ); -* // returns [ 15.0, 9.0 ] -* -* var bool = ( out === v ); -* // returns true -* -* @example -* var Float64Array = require( '@stdlib/array/float64' ); -* -* var z1 = new Float64Array( [ 5.0, 3.0 ] ); -* var z2 = new Float64Array( [ 5.0, 3.0 ] ); -* var z3 = new Float64Array( [ 5.0, 3.0 ] ); -* -* var out = add.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, new Float64Array( 2 ), 1, 0 ); -* // returns [ 15.0, 9.0 ] -*/ -declare var add: Add; - - -// EXPORTS // - -export = add; diff --git a/float64/base/add3/docs/types/test.ts b/float64/base/add3/docs/types/test.ts deleted file mode 100644 index c0895fa6..00000000 --- a/float64/base/add3/docs/types/test.ts +++ /dev/null @@ -1,467 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../../float64/ctor' ); -import add3 = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - add3( z, z, z ); // $ExpectType Complex128 -} - -// The compiler throws an error if the function is provided a first argument which is not a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - add3( true, z, z ); // $ExpectError - add3( false, z, z ); // $ExpectError - add3( null, z, z ); // $ExpectError - add3( undefined, z, z ); // $ExpectError - add3( '5', z, z ); // $ExpectError - add3( [], z, z ); // $ExpectError - add3( {}, z, z ); // $ExpectError - add3( ( x: number ): number => x, z, z ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument which is not a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - add3( z, true, z ); // $ExpectError - add3( z, false, z ); // $ExpectError - add3( z, null, z ); // $ExpectError - add3( z, undefined, z ); // $ExpectError - add3( z, '5', z ); // $ExpectError - add3( z, [], z ); // $ExpectError - add3( z, {}, z ); // $ExpectError - add3( z, ( x: number ): number => x, z ); // $ExpectError -} - -// The compiler throws an error if the function is provided a third argument which is not a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - add3( z, z, true ); // $ExpectError - add3( z, z, false ); // $ExpectError - add3( z, z, null ); // $ExpectError - add3( z, z, undefined ); // $ExpectError - add3( z, z, '5' ); // $ExpectError - add3( z, z, [] ); // $ExpectError - add3( z, z, {} ); // $ExpectError - add3( z, z, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z = new Complex128( 1.0, 1.0 ); - - add3(); // $ExpectError - add3( z ); // $ExpectError - add3( z, z ); // $ExpectError - add3( z, z, z, z ); // $ExpectError -} - -// Attached to the main export is an `assign` method which returns a collection... -{ - add3.assign( 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, new Float64Array( 2 ), 1, 0 ); // $ExpectType Float64Array - add3.assign( 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - add3.assign( 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `assign` method is provided a first argument which is not a number... -{ - const out = new Float64Array( 2 ); - - add3.assign( true, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( false, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( null, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( undefined, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( '5', 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( [], 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( {}, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( ( x: number ): number => x, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a second argument which is not a number... -{ - const out = new Float64Array( 2 ); - - add3.assign( 1.0, true, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, false, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, null, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, undefined, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, '5', 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, [], 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, {}, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, ( x: number ): number => x, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a third argument which is not a number... -{ - const out = new Float64Array( 2 ); - - add3.assign( 1.0, 2.0, true, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, false, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, null, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, undefined, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, '5', 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, [], 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, {}, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, ( x: number ): number => x, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fourth argument which is not a number... -{ - const out = new Float64Array( 2 ); - - add3.assign( 1.0, 2.0, 3.0, true, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, false, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, null, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, undefined, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, '5', 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, [], 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, {}, 5.0, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, ( x: number ): number => x, 5.0, 6.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fifth argument which is not a number... -{ - const out = new Float64Array( 2 ); - - add3.assign( 1.0, 2.0, 3.0, 4.0, true, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, false, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, null, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, undefined, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, '5', 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, [], 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, {}, 6.0, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, ( x: number ): number => x, 6.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a sixth argument which is not a number... -{ - const out = new Float64Array( 2 ); - - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, true, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, false, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, null, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, undefined, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, '5', out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, [], out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, {}, out, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a seventh argument which is not a collection... -{ - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 1, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, true, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, false, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, null, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, undefined, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, '5', 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, [ '5' ], 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, {}, 1, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided an eighth argument which is not a number... -{ - const out = new Float64Array( 2 ); - - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, true, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, false, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, null, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, undefined, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, '5', 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, [], 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, {}, 0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a ninth argument which is not a number... -{ - const out = new Float64Array( 2 ); - - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, true ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, false ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, null ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, undefined ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, '5' ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, [] ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, {} ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided an unsupported number of arguments... -{ - const out = new Float64Array( 2 ); - - add3.assign(); // $ExpectError - add3.assign( 1.0 ); // $ExpectError - add3.assign( 1.0, 2.0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1 ); // $ExpectError - add3.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0, {} ); // $ExpectError -} - -// Attached to the main export is a `strided` method which returns a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z1.length ); - - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, new Float64Array( 2 ), 1, 0 ); // $ExpectType Float64Array - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `strided` method is provided a first argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z1.length ); - const out = new Float64Array( z1.length ); - - add3.strided( true, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( false, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( null, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( undefined, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( '5', 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( [ '5' ], 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( {}, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( ( x: number ): number => x, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a second argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z1.length ); - const out = new Float64Array( z1.length ); - - add3.strided( z1, true, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, false, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, null, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, undefined, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, '5', 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, [], 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, {}, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, ( x: number ): number => x, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a third argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z1.length ); - const out = new Float64Array( 2 ); - - add3.strided( z1, 1, true, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, false, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, null, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, undefined, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, '5', z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, [], z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, {}, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, ( x: number ): number => x, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fourth argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z2.length ); - const out = new Float64Array( z1.length ); - - add3.strided( z1, 1, 0, true, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, false, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, null, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, undefined, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, '5', 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, [ '5' ], 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, {}, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, ( x: number ): number => x, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fifth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z1.length ); - const out = new Float64Array( z1.length ); - - add3.strided( z1, 1, 0, z2, true, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, false, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, null, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, undefined, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, '5', 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, [], 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, {}, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, ( x: number ): number => x, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a sixth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z1.length ); - const out = new Float64Array( z1.length ); - - add3.strided( z1, 1, 0, z2, 1, true, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, false, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, null, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, undefined, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, '5', z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, [], z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, {}, z3, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, ( x: number ): number => x, z3, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a seventh argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z2.length ); - const out = new Float64Array( z3.length ); - - add3.strided( z1, 1, 0, z3, 1, 0, true, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z3, 1, 0, false, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z3, 1, 0, null, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z3, 1, 0, undefined, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z3, 1, 0, '5', 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z3, 1, 0, [ '5' ], 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z3, 1, 0, {}, 1, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z3, 1, 0, ( x: number ): number => x, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an eighth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z1.length ); - const out = new Float64Array( z1.length ); - - add3.strided( z1, 1, 0, z2, 1, 0, z3, true, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, false, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, null, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, undefined, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, '5', 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, [], 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, {}, 0, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, ( x: number ): number => x, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a ninth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z1.length ); - const out = new Float64Array( z1.length ); - - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, true, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, false, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, null, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, undefined, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, '5', out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, [], out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, {}, out, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a tenth argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z1.length ); - - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, 1, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, true, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, false, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, null, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, undefined, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, '5', 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, [ '5' ], 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, {}, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an eleventh argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z1.length ); - const out = new Float64Array( z1.length ); - - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, true, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, false, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, null, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, undefined, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, '5', 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, [], 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, {}, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a twelfth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z1.length ); - const out = new Float64Array( z1.length ); - - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, true ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, false ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, null ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, undefined ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, '5' ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, [] ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, {} ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an unsupported number of arguments... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z1.length ); - const out = new Float64Array( z1.length ); - - add3.strided(); // $ExpectError - add3.strided( z1 ); // $ExpectError - add3.strided( z1, 1 ); // $ExpectError - add3.strided( z1, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1 ); // $ExpectError - add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0, {} ); // $ExpectError -} diff --git a/float64/base/add3/examples/c/Makefile b/float64/base/add3/examples/c/Makefile deleted file mode 100644 index 25ced822..00000000 --- a/float64/base/add3/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/add3/examples/c/example.c b/float64/base/add3/examples/c/example.c deleted file mode 100644 index d3425092..00000000 --- a/float64/base/add3/examples/c/example.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/add3.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 3.14, 1.5 ), - stdlib_complex128( -3.14, 1.5 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - stdlib_complex128_t y; - double re; - double im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex128_reim( v, &re, &im ); - printf( "z = %lf + %lfi\n", re, im ); - - y = stdlib_base_complex128_add3( v, v, v ); - stdlib_complex128_reim( y, &re, &im ); - printf( "add3(z, z, z) = %lf + %lfi\n", re, im ); - } -} diff --git a/float64/base/add3/examples/index.js b/float64/base/add3/examples/index.js deleted file mode 100644 index a804fc72..00000000 --- a/float64/base/add3/examples/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128Array = require( '@stdlib/array/complex128' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var add3 = require( './../lib' ); - -// Generate arrays of random values: -var z1 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); -var z3 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise addition: -logEachMap( '(%s) + (%s) + (%s) = %s', z1, z2, z3, add3 ); diff --git a/float64/base/add3/include.gypi b/float64/base/add3/include.gypi deleted file mode 100644 index ecfaf82a..00000000 --- a/float64/base/add3/include.gypi +++ /dev/null @@ -1,53 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A GYP include file for building a Node.js native add-on. -# -# Main documentation: -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Source directory: - 'src_dir': './src', - - # Include directories: - 'include_dirs': [ - '[ 8.0, 7.0 ] -*/ -function assign( re1, im1, re2, im2, re3, im3, out, strideOut, offsetOut ) { - out[ offsetOut ] = re1 + re2 + re3; - out[ offsetOut+strideOut ] = im1 + im2 + im3; - return out; -} - - -// EXPORTS // - -module.exports = assign; diff --git a/float64/base/add3/lib/index.js b/float64/base/add3/lib/index.js deleted file mode 100644 index 5d6d97a1..00000000 --- a/float64/base/add3/lib/index.js +++ /dev/null @@ -1,54 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Compute the sum of three double-precision complex floating-point numbers. -* -* @module @stdlib/complex/float64/base/add3 -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var add3 = require( '@stdlib/complex/float64/base/add3' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var out = add3( z, z, z ); -* // returns [ 15.0, 9.0 ] -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var main = require( './main.js' ); -var assign = require( './assign.js' ); -var strided = require( './strided.js' ); - - -// MAIN // - -setReadOnly( main, 'assign', assign ); -setReadOnly( main, 'strided', strided ); - - -// EXPORTS // - -module.exports = main; - -// exports: { "assign": "main.assign", "strided": "main.strided" } diff --git a/float64/base/add3/lib/main.js b/float64/base/add3/lib/main.js deleted file mode 100644 index 6c53c207..00000000 --- a/float64/base/add3/lib/main.js +++ /dev/null @@ -1,55 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); - - -// MAIN // - -/** -* Computes the sum of three double-precision complex floating-point numbers. -* -* @param {Complex128} z1 - first complex number -* @param {Complex128} z2 - second complex number -* @param {Complex128} z3 - third complex number -* @returns {Complex128} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var out = add3( z, z, z ); -* // returns [ 15.0, 9.0 ] -*/ -function add3( z1, z2, z3 ) { - var re = real( z1 ) + real( z2 ) + real( z3 ); - var im = imag( z1 ) + imag( z2 ) + imag( z3 ); - return new Complex128( re, im ); -} - - -// EXPORTS // - -module.exports = add3; diff --git a/float64/base/add3/lib/native.js b/float64/base/add3/lib/native.js deleted file mode 100644 index ddf409c4..00000000 --- a/float64/base/add3/lib/native.js +++ /dev/null @@ -1,54 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex128 = require( './../../../../float64/ctor' ); -var addon = require( './../src/addon.node' ); - - -// MAIN // - -/** -* Computes the sum of three double-precision complex floating-point numbers. -* -* @private -* @param {Complex128} z1 - first complex number -* @param {Complex128} z2 - second complex number -* @param {Complex128} z3 - third complex number -* @returns {Complex128} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var out = add3( z, z, z ); -* // returns [ 15.0, 9.0 ] -*/ -function add3( z1, z2, z3 ) { - var v = addon( z1, z2, z3 ); - return new Complex128( v.re, v.im ); -} - - -// EXPORTS // - -module.exports = add3; diff --git a/float64/base/add3/lib/strided.js b/float64/base/add3/lib/strided.js deleted file mode 100644 index acc22cab..00000000 --- a/float64/base/add3/lib/strided.js +++ /dev/null @@ -1,59 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Computes the sum of three double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. -* -* @param {Float64Array} z1 - first complex number view -* @param {integer} strideZ1 - stride length for `z1` -* @param {NonNegativeInteger} offsetZ1 - starting index for `z1` -* @param {Float64Array} z2 - second complex number view -* @param {integer} strideZ2 - stride length for `z2` -* @param {NonNegativeInteger} offsetZ2 - starting index for `z2` -* @param {Float64Array} z3 - third complex number view -* @param {integer} strideZ3 - stride length for `z3` -* @param {NonNegativeInteger} offsetZ3 - starting index for `z3` -* @param {Collection} out - output array -* @param {integer} strideOut - stride length for `out` -* @param {NonNegativeInteger} offsetOut - starting index for `out` -* @returns {Collection} output array -* -* @example -* var Float64Array = require( '@stdlib/array/float64' ); -* -* var z1 = new Float64Array( [ 5.0, 3.0 ] ); -* var z2 = new Float64Array( [ -2.0, 1.0 ] ); -* var z3 = new Float64Array( [ 5.0, 3.0 ] ); -* -* var out = strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, new Float64Array( 2 ), 1, 0 ); -* // returns [ 8.0, 7.0 ] -*/ -function strided( z1, strideZ1, offsetZ1, z2, strideZ2, offsetZ2, z3, strideZ3, offsetZ3, out, strideOut, offsetOut ) { // eslint-disable-line max-len, max-params - out[ offsetOut ] = z1[ offsetZ1 ] + z2[ offsetZ2 ] + z3[ offsetZ3 ]; - out[ offsetOut+strideOut ] = z1[ offsetZ1+strideZ1 ] + z2[ offsetZ2+strideZ2 ] + z3[ offsetZ3+strideZ3 ]; // eslint-disable-line max-len - return out; -} - - -// EXPORTS // - -module.exports = strided; diff --git a/float64/base/add3/manifest.json b/float64/base/add3/manifest.json deleted file mode 100644 index 2f74ff72..00000000 --- a/float64/base/add3/manifest.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/napi/ternary", - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - } - ] -} diff --git a/float64/base/add3/package.json b/float64/base/add3/package.json deleted file mode 100644 index dff1d981..00000000 --- a/float64/base/add3/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "@stdlib/complex/float64/base/add3", - "version": "0.0.0", - "description": "Compute the sum of three double-precision complex floating-point numbers.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "cadd", - "add", - "addition", - "sum", - "arithmetic", - "complex", - "cmplx", - "number" - ] -} diff --git a/float64/base/add3/src/Makefile b/float64/base/add3/src/Makefile deleted file mode 100644 index 7733b618..00000000 --- a/float64/base/add3/src/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - - -# RULES # - -#/ -# Removes generated files for building an add-on. -# -# @example -# make clean-addon -#/ -clean-addon: - $(QUIET) -rm -f *.o *.node - -.PHONY: clean-addon - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: clean-addon - -.PHONY: clean diff --git a/float64/base/add3/src/addon.c b/float64/base/add3/src/addon.c deleted file mode 100644 index e7946787..00000000 --- a/float64/base/add3/src/addon.c +++ /dev/null @@ -1,22 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/add3.h" -#include "stdlib/math/base/napi/ternary.h" - -STDLIB_MATH_BASE_NAPI_MODULE_ZZZ_Z( stdlib_base_complex128_add3 ) diff --git a/float64/base/add3/src/main.c b/float64/base/add3/src/main.c deleted file mode 100644 index 52c80317..00000000 --- a/float64/base/add3/src/main.c +++ /dev/null @@ -1,64 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/add3.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" - -/** -* Computes the sum of three double-precision complex floating-point numbers. -* -* @param z1 first input value -* @param z2 second input value -* @param z3 third input value -* @return result -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* #include "stdlib/complex/float64/real.h" -* #include "stdlib/complex/float64/imag.h" -* -* stdlib_complex128_t z = stdlib_complex128( 3.0, -2.0 ); -* -* stdlib_complex128_t out = stdlib_base_complex128_add3( z, z, z ); -* -* double re = stdlib_complex128_real( out ); -* // returns 9.0 -* -* double im = stdlib_complex128_imag( out ); -* // returns -6.0 -*/ -stdlib_complex128_t stdlib_base_complex128_add3( const stdlib_complex128_t z1, const stdlib_complex128_t z2, const stdlib_complex128_t z3 ) { - double re1; - double im1; - double re2; - double im2; - double re3; - double im3; - double re; - double im; - - stdlib_complex128_reim( z1, &re1, &im1 ); - stdlib_complex128_reim( z2, &re2, &im2 ); - stdlib_complex128_reim( z3, &re3, &im3 ); - - re = re1 + re2 + re3; - im = im1 + im2 + im3; - - return stdlib_complex128( re, im ); -} diff --git a/float64/base/add3/test/test.assign.js b/float64/base/add3/test/test.assign.js deleted file mode 100644 index 1208cc9d..00000000 --- a/float64/base/add3/test/test.assign.js +++ /dev/null @@ -1,132 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' ); -var Float64Array = require( '@stdlib/array/float64' ); -var assign = require( './../lib/assign.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof assign, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function sums three complex numbers', function test( t ) { - var expected; - var out; - var v; - - out = new Float64Array( 2 ); - v = assign( 5.0, 3.0, -2.0, 1.0, -5.0, -3.0, out, 1, 0 ); - - expected = new Float64Array( [ -2.0, 1.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 4 ); - v = assign( 5.0, 3.0, -2.0, 1.0, -5.0, -3.0, out, 2, 0 ); - - expected = new Float64Array( [ -2.0, 0.0, 1.0, 0.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 4 ); - v = assign( 5.0, 3.0, -2.0, 1.0, -5.0, -3.0, out, 2, 1 ); - - expected = new Float64Array( [ 0.0, -2.0, 0.0, 1.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 4 ); - v = assign( 5.0, 3.0, -2.0, 1.0, -5.0, -3.0, out, -2, 3 ); - - expected = new Float64Array( [ 0.0, 1.0, 0.0, -2.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the output component is `NaN`', function test( t ) { - var expected; - var out; - var v; - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, 1.0 ] ); - - v = assign( NaN, 3.0, -2.0, 1.0, -5.0, -3.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, 1.0 ] ); - - v = assign( 5.0, 3.0, NaN, 1.0, -5.0, -3.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, 1.0 ] ); - - v = assign( NaN, 3.0, NaN, 1.0, NaN, -3.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ -2.0, NaN ] ); - - v = assign( 5.0, NaN, -2.0, 1.0, -5.0, -3.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ -2.0, NaN ] ); - - v = assign( 5.0, 3.0, -2.0, NaN, -5.0, -3.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ -2.0, NaN ] ); - - v = assign( 5.0, NaN, -2.0, NaN, -5.0, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = assign( NaN, NaN, NaN, NaN, NaN, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/add3/test/test.js b/float64/base/add3/test/test.js deleted file mode 100644 index 16cebf2d..00000000 --- a/float64/base/add3/test/test.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isMethod = require( '@stdlib/assert/is-method' ); -var add3 = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof add3, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'attached to the main export is an `assign` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( add3, 'assign' ), true, 'returns expected value' ); - t.end(); -}); - -tape( 'attached to the main export is a `strided` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( add3, 'strided' ), true, 'returns expected value' ); - t.end(); -}); diff --git a/float64/base/add3/test/test.main.js b/float64/base/add3/test/test.main.js deleted file mode 100644 index 267dbb07..00000000 --- a/float64/base/add3/test/test.main.js +++ /dev/null @@ -1,120 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var add3 = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof add3, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function sums three complex numbers', function test( t ) { - var z1; - var z2; - var z3; - var v; - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - z3 = new Complex128( -5.0, -3.0 ); - - v = add3( z1, z2, z3 ); - - t.strictEqual( real( v ), -2.0, 'returns expected value' ); - t.strictEqual( imag( v ), 1.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the resulting component is `NaN`', function test( t ) { - var z1; - var z2; - var z3; - var v; - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - z3 = new Complex128( -5.0, -3.0 ); - - v = add3( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 1.0, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - z3 = new Complex128( -5.0, -3.0 ); - - v = add3( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 1.0, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - z3 = new Complex128( NaN, -3.0 ); - - v = add3( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 1.0, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, 1.0 ); - z3 = new Complex128( -5.0, -3.0 ); - - v = add3( z1, z2, z3 ); - t.strictEqual( real( v ), -2.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, NaN ); - z3 = new Complex128( -5.0, -3.0 ); - - v = add3( z1, z2, z3 ); - t.strictEqual( real( v ), -2.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, NaN ); - z3 = new Complex128( -5.0, NaN ); - - v = add3( z1, z2, z3 ); - t.strictEqual( real( v ), -2.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - z3 = new Complex128( NaN, NaN ); - - v = add3( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/add3/test/test.native.js b/float64/base/add3/test/test.native.js deleted file mode 100644 index d041c71f..00000000 --- a/float64/base/add3/test/test.native.js +++ /dev/null @@ -1,129 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var tape = require( 'tape' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var add3 = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( add3 instanceof Error ) -}; - - -// TESTS // - -tape( 'main export is a function', opts, function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof add3, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function sums three complex numbers', opts, function test( t ) { - var z1; - var z2; - var z3; - var v; - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - z3 = new Complex128( -5.0, -3.0 ); - - v = add3( z1, z2, z3 ); - - t.strictEqual( real( v ), -2.0, 'returns expected value' ); - t.strictEqual( imag( v ), 1.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the resulting component is `NaN`', opts, function test( t ) { - var z1; - var z2; - var z3; - var v; - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - z3 = new Complex128( -5.0, -3.0 ); - - v = add3( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 1.0, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - z3 = new Complex128( -5.0, -3.0 ); - - v = add3( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 1.0, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - z3 = new Complex128( NaN, -3.0 ); - - v = add3( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 1.0, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, 1.0 ); - z3 = new Complex128( -5.0, -3.0 ); - - v = add3( z1, z2, z3 ); - t.strictEqual( real( v ), -2.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, NaN ); - z3 = new Complex128( -5.0, -3.0 ); - - v = add3( z1, z2, z3 ); - t.strictEqual( real( v ), -2.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, NaN ); - z3 = new Complex128( -5.0, NaN ); - - v = add3( z1, z2, z3 ); - t.strictEqual( real( v ), -2.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - z3 = new Complex128( NaN, NaN ); - - v = add3( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/add3/test/test.strided.js b/float64/base/add3/test/test.strided.js deleted file mode 100644 index cfe191f3..00000000 --- a/float64/base/add3/test/test.strided.js +++ /dev/null @@ -1,171 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' ); -var Float64Array = require( '@stdlib/array/float64' ); -var strided = require( './../lib/strided.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof strided, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function sums three complex numbers', function test( t ) { - var expected; - var out; - var z1; - var z2; - var z3; - var v; - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - z3 = new Float64Array( [ -5.0, -3.0 ] ); - out = new Float64Array( 2 ); - v = strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - - expected = new Float64Array( [ -2.0, 1.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 0.0, 3.0, 0.0 ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - z3 = new Float64Array( [ -5.0, -3.0 ] ); - out = new Float64Array( 4 ); - v = strided( z1, 2, 0, z2, 1, 0, z3, 1, 0, out, 2, 0 ); - - expected = new Float64Array( [ -2.0, 0.0, 1.0, 0.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ 0.0, -2.0, 0.0, 1.0 ] ); - z3 = new Float64Array( [ -5.0, -3.0 ] ); - out = new Float64Array( 4 ); - v = strided( z1, 1, 0, z2, 2, 1, z3, 1, 0, out, 2, 1 ); - - expected = new Float64Array( [ 0.0, -2.0, 0.0, 1.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 3.0, 5.0 ] ); - z2 = new Float64Array( [ 1.0, -2.0 ] ); - z3 = new Float64Array( [ -3.0, -5.0 ] ); - out = new Float64Array( 4 ); - v = strided( z1, -1, 1, z2, -1, 1, z3, -1, 1, out, -2, 3 ); - - expected = new Float64Array( [ 0.0, 1.0, 0.0, -2.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the output component is `NaN`', function test( t ) { - var expected; - var out; - var z1; - var z2; - var z3; - var v; - - z1 = new Float64Array( [ NaN, 3.0 ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - z3 = new Float64Array( [ -5.0, -3.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, 1.0 ] ); - - v = strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ NaN, 1.0 ] ); - z3 = new Float64Array( [ -5.0, -3.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, 1.0 ] ); - - v = strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ NaN, 3.0 ] ); - z2 = new Float64Array( [ NaN, 1.0 ] ); - z3 = new Float64Array( [ NaN, -3.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, 1.0 ] ); - - v = strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, NaN ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - z3 = new Float64Array( [ -5.0, -3.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ -2.0, NaN ] ); - - v = strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ -2.0, NaN ] ); - z3 = new Float64Array( [ -5.0, -3.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ -2.0, NaN ] ); - - v = strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, NaN ] ); - z2 = new Float64Array( [ -2.0, NaN ] ); - z3 = new Float64Array( [ -5.0, NaN ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ -2.0, NaN ] ); - - v = strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ NaN, NaN ] ); - z2 = new Float64Array( [ NaN, NaN ] ); - z3 = new Float64Array( [ NaN, NaN ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/assert/README.md b/float64/base/assert/README.md deleted file mode 100644 index 7ca0c095..00000000 --- a/float64/base/assert/README.md +++ /dev/null @@ -1,120 +0,0 @@ - - -# Assert - -> Base (i.e., lower-level) double-precision complex floating-point number assertion functions. - -
- -## Usage - -```javascript -var assert = require( '@stdlib/complex/float64/base/assert' ); -``` - -#### assert - -Namespace containing base (i.e., lower-level) double-precision complex floating-point number assertion functions. - -```javascript -var ns = assert; -// returns {...} -``` - -The namespace contains the following functions: - - - -
- -- [`isAlmostEqual( z1, z2, maxULP )`][@stdlib/complex/float64/base/assert/is-almost-equal]: test whether two double-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place). -- [`isAlmostSameValue( z1, z2, maxULP )`][@stdlib/complex/float64/base/assert/is-almost-same-value]: test whether two double-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place). -- [`isEqual( z1, z2 )`][@stdlib/complex/float64/base/assert/is-equal]: test whether two double-precision complex floating-point numbers are equal. -- [`isNotEqual( z1, z2 )`][@stdlib/complex/float64/base/assert/is-not-equal]: test whether two double-precision complex floating-point numbers are not equal. -- [`isSameValueZero( z1, z2 )`][@stdlib/complex/float64/base/assert/is-same-value-zero]: test whether two double-precision complex floating-point numbers are the same value. -- [`isSameValue( z1, z2 )`][@stdlib/complex/float64/base/assert/is-same-value]: test whether two double-precision complex floating-point numbers are the same value. - -
- - - -
- - - - - -
- -
- - - -
- -## Examples - - - - - -```javascript -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( '@stdlib/complex/float64/base/assert' ); - -console.log( objectKeys( ns ) ); -``` - -
- - - - - - - - - - - - - - diff --git a/float64/base/assert/docs/types/index.d.ts b/float64/base/assert/docs/types/index.d.ts deleted file mode 100644 index 640e2e5e..00000000 --- a/float64/base/assert/docs/types/index.d.ts +++ /dev/null @@ -1,181 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/* eslint-disable max-lines */ - -import isAlmostEqual = require( './../../../../../float64/base/assert/is-almost-equal' ); -import isAlmostSameValue = require( './../../../../../float64/base/assert/is-almost-same-value' ); -import isEqual = require( './../../../../../float64/base/assert/is-equal' ); -import isNotEqual = require( './../../../../../float64/base/assert/is-not-equal' ); -import isSameValue = require( './../../../../../float64/base/assert/is-same-value' ); -import isSameValueZero = require( './../../../../../float64/base/assert/is-same-value-zero' ); - -/** -* Interface describing the `assert` namespace. -*/ -interface Namespace { - /** - * Tests whether two double-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place). - * - * ## Notes - * - * - The function returns `false` if either input value has a `NaN` real or imaginary component. - * - The function does not distinguish between `-0` and `+0`, treating them as equal. - * - * @param z1 - first complex number - * @param z2 - second complex number - * @param maxULP - maximum allowed ULP difference - * @returns boolean indicating whether two double-precision complex floating-point numbers are approximately equal within a specified number of ULPs - * - * @example - * var EPS = require( '@stdlib/constants/float64/eps' ); - * var Complex128 = require( './../../../../../float64/ctor' ); - * - * var z1 = new Complex128( 1.0, 3.0 ); - * var z2 = new Complex128( 1.0+EPS, 3.0 ); - * - * var bool = ns.isAlmostEqual( z1, z2, 0 ); - * // returns false - * - * bool = ns.isAlmostEqual( z1, z2, 1 ); - * // returns true - */ - isAlmostEqual: typeof isAlmostEqual; - - /** - * Tests whether two double-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place). - * - * ## Notes - * - * - The function differs from the `===` operator in that the function treats `-0` and `+0` as distinct and `NaNs` as the same. - * - * @param z1 - first complex number - * @param z2 - second complex number - * @param maxULP - maximum allowed ULP difference - * @returns boolean indicating whether two double-precision complex floating-point numbers are approximately the same value within a specified number of ULPs - * - * @example - * var EPS = require( '@stdlib/constants/float64/eps' ); - * var Complex128 = require( './../../../../../float64/ctor' ); - * - * var z1 = new Complex128( 1.0, 3.0 ); - * var z2 = new Complex128( 1.0+EPS, 3.0 ); - * - * var bool = ns.isAlmostSameValue( z1, z2, 0 ); - * // returns false - * - * bool = ns.isAlmostSameValue( z1, z2, 1 ); - * // returns true - */ - isAlmostSameValue: typeof isAlmostSameValue; - - /** - * Tests whether two double-precision complex floating-point numbers are equal. - * - * @param z1 - first complex number - * @param z2 - second complex number - * @returns boolean indicating if both complex numbers are equal - * - * @example - * var Complex128 = require( './../../../../../float64/ctor' ); - * - * var z1 = new Complex128( 5.0, 3.0 ); - * var z2 = new Complex128( 5.0, 3.0 ); - * - * var v = ns.isEqual( z1, z2 ); - * // returns true - */ - isEqual: typeof isEqual; - - /** - * Tests whether two double-precision complex floating-point numbers are not equal. - * - * @param z1 - first complex number - * @param z2 - second complex number - * @returns boolean indicating if both complex numbers are not equal - * - * @example - * var Complex128 = require( './../../../../../float64/ctor' ); - * - * var z1 = new Complex128( 5.0, 3.0 ); - * var z2 = new Complex128( 5.0, -3.0 ); - * - * var v = ns.isNotEqual( z1, z2 ); - * // returns true - */ - isNotEqual: typeof isNotEqual; - - /** - * Tests whether two double-precision complex floating-point numbers are the same value. - * - * ## Notes - * - * - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5. - * - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same. - * - * [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12 - * - * @param z1 - first complex number - * @param z2 - second complex number - * @returns boolean indicating if both complex numbers are the same value - * - * @example - * var Complex128 = require( './../../../../../float64/ctor' ); - * - * var z1 = new Complex128( 5.0, 3.0 ); - * var z2 = new Complex128( 5.0, 3.0 ); - * - * var v = ns.isSameValue( z1, z2 ); - * // returns true - */ - isSameValue: typeof isSameValue; - - /** - * Tests whether two double-precision complex floating-point numbers are the same value. - * - * ## Notes - * - * - In contrast to the strict equality operator `===`, `NaNs` are treated as the same value. - * - * @param z1 - first complex number - * @param z2 - second complex number - * @returns boolean indicating if both complex numbers are the same value - * - * @example - * var Complex128 = require( './../../../../../float64/ctor' ); - * - * var z1 = new Complex128( 5.0, 3.0 ); - * var z2 = new Complex128( 5.0, 3.0 ); - * - * var v = ns.isSameValueZero( z1, z2 ); - * // returns true - */ - isSameValueZero: typeof isSameValueZero; -} - -/** -* Base (i.e., lower-level) double-precision complex number assertion functions. -*/ -declare var ns: Namespace; - - -// EXPORTS // - -export = ns; diff --git a/float64/base/assert/docs/types/test.ts b/float64/base/assert/docs/types/test.ts deleted file mode 100644 index 2f81653a..00000000 --- a/float64/base/assert/docs/types/test.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable @typescript-eslint/no-unused-expressions */ - -import ns = require( './index' ); - - -// TESTS // - -// The exported value is the expected interface... -{ - ns; // $ExpectType Namespace -} diff --git a/float64/base/assert/examples/index.js b/float64/base/assert/examples/index.js deleted file mode 100644 index 6115ca08..00000000 --- a/float64/base/assert/examples/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - -console.log( objectKeys( ns ) ); diff --git a/float64/base/assert/is-almost-equal/README.md b/float64/base/assert/is-almost-equal/README.md deleted file mode 100644 index 89727041..00000000 --- a/float64/base/assert/is-almost-equal/README.md +++ /dev/null @@ -1,158 +0,0 @@ - - -# isAlmostEqual - -> Test whether two double-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place). - - - -
- -
- - - - - -
- -## Usage - -```javascript -var isAlmostEqual = require( '@stdlib/complex/float64/base/assert/is-almost-equal' ); -``` - -#### isAlmostEqual( z1, z2, maxULP ) - -Tests whether two double-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place). - -```javascript -var EPS = require( '@stdlib/constants/float64/eps' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( 1.0, 3.0 ); -var z2 = new Complex128( 1.0+EPS, 3.0 ); - -var out = isAlmostEqual( z1, z2, 0 ); -// returns false - -out = isAlmostEqual( z1, z2, 1 ); -// returns true -``` - -The function returns `false` if either input value has a `NaN` real or imaginary component. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( NaN, 3.0 ); -var z2 = new Complex128( 1.0, 3.0 ); - -var out = isAlmostEqual( z1, z2, 1 ); -// returns false - -out = isAlmostEqual( z2, z1, 1 ); -// returns false - -z1 = new Complex128( NaN, NaN ); -z2 = new Complex128( NaN, NaN ); - -out = isAlmostEqual( z1, z2, 1 ); -// returns false -``` - -The function does not distinguish between `-0` and `+0`, treating them as equal. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( 0.0, 0.0 ); -var z2 = new Complex128( -0.0, -0.0 ); - -var out = isAlmostEqual( z1, z2, 0 ); -// returns true -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var EPS = require( '@stdlib/constants/float64/eps' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isAlmostEqual = require( '@stdlib/complex/float64/base/assert/is-almost-equal' ); - -var z1 = new Complex128( 1.0, 3.0+EPS ); -var z2 = new Complex128( 1.0+EPS, 3.0 ); -console.log( isAlmostEqual( z1, z2, 1 ) ); -// => true - -z1 = new Complex128( 1.0, 3.0+EPS ); -z2 = new Complex128( 1.0+EPS+EPS, 3.0 ); -console.log( isAlmostEqual( z1, z2, 1 ) ); -// => false - -z1 = new Complex128( 0.0, 0.0 ); -z2 = new Complex128( -0.0, 0.0 ); -console.log( isAlmostEqual( z1, z2, 0 ) ); -// => true - -z1 = new Complex128( NaN, 0.0 ); -z2 = new Complex128( 1.0, 0.0 ); -console.log( isAlmostEqual( z1, z2, 1 ) ); -// => false -``` - -
- - - - - - - - - - - - - - diff --git a/float64/base/assert/is-almost-equal/benchmark/benchmark.js b/float64/base/assert/is-almost-equal/benchmark/benchmark.js deleted file mode 100644 index 0a3edcc7..00000000 --- a/float64/base/assert/is-almost-equal/benchmark/benchmark.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex128 = require( './../../../../../float64/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var isAlmostEqual = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var z1; - var z2; - var v; - var i; - - z1 = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ) - ]; - z2 = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ), - z1[ 0 ], - z1[ 1 ] - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = isAlmostEqual( z1[ i%z1.length ], z2[ i%z2.length ], 1 ); - if ( typeof v !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( v ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/assert/is-almost-equal/docs/repl.txt b/float64/base/assert/is-almost-equal/docs/repl.txt deleted file mode 100644 index 46265ca0..00000000 --- a/float64/base/assert/is-almost-equal/docs/repl.txt +++ /dev/null @@ -1,45 +0,0 @@ - -{{alias}}( z1, z2, maxULP ) - Tests whether two double-precision complex floating-point numbers are - approximately equal within a specified number of ULPs (units in the last - place). - - The function returns `false` if either input value has a `NaN` real or - imaginary component. - - The function does not distinguish between `-0` and `+0`, treating them as - equal. - - Parameters - ---------- - z1: Complex128 - First complex number. - - z2: Complex128 - Second complex number. - - maxULP: number - Maximum allowed ULP difference. - - Returns - ------- - out: boolean - Boolean indicating whether two double-precision complex floating-point - numbers are approximately equal within a specified number of ULPs. - - Examples - -------- - > var re1 = 1.0; - > var im1 = 3.0; - > var re2 = 1.0 + {{alias:@stdlib/constants/float64/eps}}; - > var im2 = 3.0; - > var z1 = new {{alias:@stdlib/complex/float64/ctor}}( re1, im1 ); - > var z2 = new {{alias:@stdlib/complex/float64/ctor}}( re2, im2 ); - > var v = {{alias}}( z1, z2, 0 ) - false - > v = {{alias}}( z1, z2, 1 ) - true - - See Also - -------- - diff --git a/float64/base/assert/is-almost-equal/docs/types/index.d.ts b/float64/base/assert/is-almost-equal/docs/types/index.d.ts deleted file mode 100644 index 49f2fc28..00000000 --- a/float64/base/assert/is-almost-equal/docs/types/index.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex128 } from '@stdlib/types/complex'; - -/** -* Tests whether two double-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place). -* -* ## Notes -* -* - The function returns `false` if either input value has a `NaN` real or imaginary component. -* - The function does not distinguish between `-0` and `+0`, treating them as equal. -* -* @param z1 - first complex number -* @param z2 - second complex number -* @param maxULP - maximum allowed ULP difference -* @returns boolean indicating whether two double-precision complex floating-point numbers are approximately equal within a specified number of ULPs -* -* @example -* var EPS = require( '@stdlib/constants/float64/eps' ); -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 1.0, 3.0 ); -* var z2 = new Complex128( 1.0+EPS, 3.0 ); -* -* var bool = isAlmostEqual( z1, z2, 0 ); -* // returns false -* -* bool = isAlmostEqual( z1, z2, 1 ); -* // returns true -*/ -declare function isAlmostEqual( z1: Complex128, z2: Complex128, maxULP: number ): boolean; - - -// EXPORTS // - -export = isAlmostEqual; diff --git a/float64/base/assert/is-almost-equal/docs/types/test.ts b/float64/base/assert/is-almost-equal/docs/types/test.ts deleted file mode 100644 index 8c8661cc..00000000 --- a/float64/base/assert/is-almost-equal/docs/types/test.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../../../float64/ctor' ); -import isAlmostEqual = require( './index' ); - - -// TESTS // - -// The function returns a boolean... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isAlmostEqual( z1, z2, 1 ); // $ExpectType boolean -} - -// The compiler throws an error if the function is provided a first argument that is not a complex number... -{ - const z2 = new Complex128( 5.0, 3.0 ); - - isAlmostEqual( 'abc', z2, 1 ); // $ExpectError - isAlmostEqual( 123, z2, 1 ); // $ExpectError - isAlmostEqual( true, z2, 1 ); // $ExpectError - isAlmostEqual( false, z2, 1 ); // $ExpectError - isAlmostEqual( [], z2, 1 ); // $ExpectError - isAlmostEqual( {}, z2, 1 ); // $ExpectError - isAlmostEqual( ( x: number ): number => x, z2, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a complex number... -{ - const z1 = new Complex128( 5.0, 3.0 ); - - isAlmostEqual( z1, 'abc', 1 ); // $ExpectError - isAlmostEqual( z1, 123, 1 ); // $ExpectError - isAlmostEqual( z1, true, 1 ); // $ExpectError - isAlmostEqual( z1, false, 1 ); // $ExpectError - isAlmostEqual( z1, [], 1 ); // $ExpectError - isAlmostEqual( z1, {}, 1 ); // $ExpectError - isAlmostEqual( z1, ( x: number ): number => x, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a third argument that is not a number... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isAlmostEqual( z1, z2, 'abc' ); // $ExpectError - isAlmostEqual( z1, z2, true ); // $ExpectError - isAlmostEqual( z1, z2, false ); // $ExpectError - isAlmostEqual( z1, z2, null ); // $ExpectError - isAlmostEqual( z1, z2, void 0 ); // $ExpectError - isAlmostEqual( z1, z2, [] ); // $ExpectError - isAlmostEqual( z1, z2, {} ); // $ExpectError - isAlmostEqual( z1, z2, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isAlmostEqual(); // $ExpectError - isAlmostEqual( z1 ); // $ExpectError - isAlmostEqual( z1, z2 ); // $ExpectError - isAlmostEqual( z1, z2, 1, 1 ); // $ExpectError -} diff --git a/float64/base/assert/is-almost-equal/examples/index.js b/float64/base/assert/is-almost-equal/examples/index.js deleted file mode 100644 index 7d2e182a..00000000 --- a/float64/base/assert/is-almost-equal/examples/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var EPS = require( '@stdlib/constants/float64/eps' ); -var Complex128 = require( './../../../../../float64/ctor' ); -var isAlmostEqual = require( './../lib' ); - -var z1 = new Complex128( 1.0, 3.0+EPS ); -var z2 = new Complex128( 1.0+EPS, 3.0 ); -console.log( isAlmostEqual( z1, z2, 1 ) ); -// => true - -z1 = new Complex128( 1.0, 3.0+EPS ); -z2 = new Complex128( 1.0+EPS+EPS, 3.0 ); -console.log( isAlmostEqual( z1, z2, 1 ) ); -// => false - -z1 = new Complex128( 0.0, 0.0 ); -z2 = new Complex128( -0.0, 0.0 ); -console.log( isAlmostEqual( z1, z2, 0 ) ); -// => true - -z1 = new Complex128( NaN, 0.0 ); -z2 = new Complex128( 1.0, 0.0 ); -console.log( isAlmostEqual( z1, z2, 1 ) ); -// => false diff --git a/float64/base/assert/is-almost-equal/lib/index.js b/float64/base/assert/is-almost-equal/lib/index.js deleted file mode 100644 index 63c785db..00000000 --- a/float64/base/assert/is-almost-equal/lib/index.js +++ /dev/null @@ -1,48 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Test whether two double-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place). -* -* @module @stdlib/complex/float64/base/assert/is-almost-equal -* -* @example -* var EPS = require( '@stdlib/constants/float64/eps' ); -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var isAlmostEqual = require( '@stdlib/complex/float64/base/assert/is-almost-equal' ); -* -* var z1 = new Complex128( 1.0, 3.0 ); -* var z2 = new Complex128( 1.0+EPS, 3.0 ); -* -* var bool = isAlmostEqual( z1, z2, 0 ); -* // returns false -* -* bool = isAlmostEqual( z1, z2, 1 ); -* // returns true -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float64/base/assert/is-almost-equal/lib/main.js b/float64/base/assert/is-almost-equal/lib/main.js deleted file mode 100644 index e6c7e766..00000000 --- a/float64/base/assert/is-almost-equal/lib/main.js +++ /dev/null @@ -1,67 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var isAlmostEqualF64 = require( '@stdlib/number/float64/base/assert/is-almost-equal' ); -var reim = require( './../../../../../float64/reim' ); - - -// MAIN // - -/** -* Tests whether two double-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place). -* -* ## Notes -* -* - The function returns `false` if either input value has a `NaN` real or imaginary component. -* - The function does not distinguish between `-0` and `+0`, treating them as equal. -* -* @param {Complex128} z1 - first complex number -* @param {Complex128} z2 - second complex number -* @param {number} maxULP - maximum allowed ULP difference -* @returns {boolean} boolean indicating whether two double-precision complex floating-point numbers are approximately equal within a specified number of ULPs -* -* @example -* var EPS = require( '@stdlib/constants/float64/eps' ); -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 1.0, 3.0 ); -* var z2 = new Complex128( 1.0+EPS, 3.0 ); -* -* var bool = isAlmostEqual( z1, z2, 0 ); -* // returns false -* -* bool = isAlmostEqual( z1, z2, 1 ); -* // returns true -*/ -function isAlmostEqual( z1, z2, maxULP ) { - var parts1 = reim( z1 ); - var parts2 = reim( z2 ); - return ( - isAlmostEqualF64( parts1[ 0 ], parts2[ 0 ], maxULP ) && - isAlmostEqualF64( parts1[ 1 ], parts2[ 1 ], maxULP ) - ); -} - - -// EXPORTS // - -module.exports = isAlmostEqual; diff --git a/float64/base/assert/is-almost-equal/package.json b/float64/base/assert/is-almost-equal/package.json deleted file mode 100644 index 45a1868a..00000000 --- a/float64/base/assert/is-almost-equal/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "@stdlib/complex/float64/base/assert/is-almost-equal", - "version": "0.0.0", - "description": "Test whether two double-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place).", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "number", - "base", - "assert", - "test", - "validate", - "equality", - "compare", - "comparison", - "equal", - "eq", - "same", - "issame", - "isequal", - "isalmostequal" - ] -} diff --git a/float64/base/assert/is-almost-equal/test/test.js b/float64/base/assert/is-almost-equal/test/test.js deleted file mode 100644 index 84b1cc95..00000000 --- a/float64/base/assert/is-almost-equal/test/test.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex128 = require( './../../../../../float64/ctor' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var isAlmostEqual = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof isAlmostEqual, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns `false` if provided `NaN` as either real or imaginary component', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( NaN, 3.14 ); - z2 = new Complex128( 5.0, 3.14 ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), false, 'returns expected value' ); - - z2 = new Complex128( 5.0, NaN ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), false, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if provided two complex double-precision floating-point numbers which are the same value irrespective of the specified number of ULPs', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z1, 0 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), true, 'returns expected value' ); - - z1 = new Complex128( -5.0, -3.0 ); - z2 = new Complex128( -5.0, -3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 0 ), true, 'returns expected value' ); - - z1 = new Complex128( 0.0, 0.0 ); - z2 = new Complex128( 0.0, 0.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 0 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if provided two complex double-precision floating-point numbers which are approximately equal within a specified number of ULPs', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 1.0, 3.0 ); - z2 = new Complex128( 1.0+EPS, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), true, 'returns expected value' ); - - z2 = new Complex128( 1.0+EPS+EPS, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 2 ), true, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 2 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `false` if provided two complex double-precision floating-point numbers which are not approximately equal within a specified number of ULPs', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 1.0, 3.0 ); - z2 = new Complex128( 1.0+EPS, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 0 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 0 ), false, 'returns expected value' ); - - z2 = new Complex128( 1.0+EPS+EPS, 3.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if signed zeros are provided as real or imaginary components irrespective of the specified number of ULPs', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 0.0, 0.0 ); - z2 = new Complex128( -0.0, -0.0 ); - t.strictEqual( isAlmostEqual( z1, z2, 0 ), true, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 0 ), true, 'returns expected value' ); - - t.strictEqual( isAlmostEqual( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostEqual( z2, z1, 1 ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/assert/is-almost-same-value/README.md b/float64/base/assert/is-almost-same-value/README.md deleted file mode 100644 index 3e38b7f3..00000000 --- a/float64/base/assert/is-almost-same-value/README.md +++ /dev/null @@ -1,158 +0,0 @@ - - -# isAlmostSameValue - -> Test whether two double-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place). - - - -
- -
- - - - - -
- -## Usage - -```javascript -var isAlmostSameValue = require( '@stdlib/complex/float64/base/assert/is-almost-same-value' ); -``` - -#### isAlmostSameValue( z1, z2, maxULP ) - -Tests whether two double-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place). - -```javascript -var EPS = require( '@stdlib/constants/float64/eps' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( 1.0, 3.0 ); -var z2 = new Complex128( 1.0+EPS, 3.0 ); - -var out = isAlmostSameValue( z1, z2, 0 ); -// returns false - -out = isAlmostSameValue( z1, z2, 1 ); -// returns true -``` - -In contrast to the strict equality operator `===`, the function distinguishes between `+0` and `-0` and treats `NaNs` as the same value. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( NaN, 3.0 ); -var z2 = new Complex128( 1.0, 3.0 ); - -var out = isAlmostSameValue( z1, z2, 1 ); -// returns false - -out = isAlmostSameValue( z2, z1, 1 ); -// returns false - -z1 = new Complex128( NaN, NaN ); -z2 = new Complex128( NaN, NaN ); - -out = isAlmostSameValue( z1, z2, 1 ); -// returns true - -z1 = new Complex128( 0.0, 0.0 ); -z2 = new Complex128( -0.0, -0.0 ); - -out = isAlmostSameValue( z1, z2, 0 ); -// returns false -``` - -
- - - - - -
- -## Notes - -- The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm] as specified in ECMAScript 5. - -
- - - - - -
- -## Examples - - - -```javascript -var EPS = require( '@stdlib/constants/float64/eps' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isAlmostSameValue = require( '@stdlib/complex/float64/base/assert/is-almost-same-value' ); - -var z1 = new Complex128( 1.0, 3.0+EPS ); -var z2 = new Complex128( 1.0+EPS, 3.0 ); -console.log( isAlmostSameValue( z1, z2, 1 ) ); -// => true - -z1 = new Complex128( 1.0, 3.0+EPS ); -z2 = new Complex128( 1.0+EPS+EPS, 3.0 ); -console.log( isAlmostSameValue( z1, z2, 1 ) ); -// => false - -z1 = new Complex128( 0.0, 0.0 ); -z2 = new Complex128( -0.0, 0.0 ); -console.log( isAlmostSameValue( z1, z2, 0 ) ); -// => false - -z1 = new Complex128( NaN, 0.0 ); -z2 = new Complex128( 1.0, 0.0 ); -console.log( isAlmostSameValue( z1, z2, 1 ) ); -// => false -``` - -
- - - - - - - - - - - - - - diff --git a/float64/base/assert/is-almost-same-value/benchmark/benchmark.js b/float64/base/assert/is-almost-same-value/benchmark/benchmark.js deleted file mode 100644 index 5b46d5e7..00000000 --- a/float64/base/assert/is-almost-same-value/benchmark/benchmark.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex128 = require( './../../../../../float64/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var isAlmostSameValue = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var z1; - var z2; - var v; - var i; - - z1 = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ) - ]; - z2 = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ), - z1[ 0 ], - z1[ 1 ] - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = isAlmostSameValue( z1[ i%z1.length ], z2[ i%z2.length ], 1 ); - if ( typeof v !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( v ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/assert/is-almost-same-value/docs/repl.txt b/float64/base/assert/is-almost-same-value/docs/repl.txt deleted file mode 100644 index ee613045..00000000 --- a/float64/base/assert/is-almost-same-value/docs/repl.txt +++ /dev/null @@ -1,43 +0,0 @@ - -{{alias}}( z1, z2, maxULP ) - Tests whether two double-precision complex floating-point numbers are - approximately the same value within a specified number of ULPs (units in the - last place). - - The function differs from the `===` operator in that the function treats - `-0` and `+0` as distinct and `NaNs` as the same. - - Parameters - ---------- - z1: Complex128 - First complex number. - - z2: Complex128 - Second complex number. - - maxULP: number - Maximum allowed ULP difference. - - Returns - ------- - out: boolean - Boolean indicating whether two double-precision complex floating-point - numbers are approximately the same value within a specified number of - ULPs. - - Examples - -------- - > var re1 = 1.0; - > var im1 = 3.0; - > var re2 = 1.0 + {{alias:@stdlib/constants/float64/eps}}; - > var im2 = 3.0; - > var z1 = new {{alias:@stdlib/complex/float64/ctor}}( re1, im1 ); - > var z2 = new {{alias:@stdlib/complex/float64/ctor}}( re2, im2 ); - > var v = {{alias}}( z1, z2, 0 ) - false - > v = {{alias}}( z1, z2, 1 ) - true - - See Also - -------- - diff --git a/float64/base/assert/is-almost-same-value/docs/types/index.d.ts b/float64/base/assert/is-almost-same-value/docs/types/index.d.ts deleted file mode 100644 index 0a6eb448..00000000 --- a/float64/base/assert/is-almost-same-value/docs/types/index.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex128 } from '@stdlib/types/complex'; - -/** -* Tests whether two double-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place). -* -* ## Notes -* -* - The function differs from the `===` operator in that the function treats `-0` and `+0` as distinct and `NaNs` as the same. -* -* @param z1 - first complex number -* @param z2 - second complex number -* @param maxULP - maximum allowed ULP difference -* @returns boolean indicating whether two double-precision complex floating-point numbers are approximately the same value within a specified number of ULPs -* -* @example -* var EPS = require( '@stdlib/constants/float64/eps' ); -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 1.0, 3.0 ); -* var z2 = new Complex128( 1.0+EPS, 3.0 ); -* -* var bool = isAlmostSameValue( z1, z2, 0 ); -* // returns false -* -* bool = isAlmostSameValue( z1, z2, 1 ); -* // returns true -*/ -declare function isAlmostSameValue( z1: Complex128, z2: Complex128, maxULP: number ): boolean; - - -// EXPORTS // - -export = isAlmostSameValue; diff --git a/float64/base/assert/is-almost-same-value/docs/types/test.ts b/float64/base/assert/is-almost-same-value/docs/types/test.ts deleted file mode 100644 index c37ae3ba..00000000 --- a/float64/base/assert/is-almost-same-value/docs/types/test.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../../../float64/ctor' ); -import isAlmostSameValue = require( './index' ); - - -// TESTS // - -// The function returns a boolean... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isAlmostSameValue( z1, z2, 1 ); // $ExpectType boolean -} - -// The compiler throws an error if the function is provided a first argument that is not a complex number... -{ - const z2 = new Complex128( 5.0, 3.0 ); - - isAlmostSameValue( 'abc', z2, 1 ); // $ExpectError - isAlmostSameValue( 123, z2, 1 ); // $ExpectError - isAlmostSameValue( true, z2, 1 ); // $ExpectError - isAlmostSameValue( false, z2, 1 ); // $ExpectError - isAlmostSameValue( [], z2, 1 ); // $ExpectError - isAlmostSameValue( {}, z2, 1 ); // $ExpectError - isAlmostSameValue( ( x: number ): number => x, z2, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a complex number... -{ - const z1 = new Complex128( 5.0, 3.0 ); - - isAlmostSameValue( z1, 'abc', 1 ); // $ExpectError - isAlmostSameValue( z1, 123, 1 ); // $ExpectError - isAlmostSameValue( z1, true, 1 ); // $ExpectError - isAlmostSameValue( z1, false, 1 ); // $ExpectError - isAlmostSameValue( z1, [], 1 ); // $ExpectError - isAlmostSameValue( z1, {}, 1 ); // $ExpectError - isAlmostSameValue( z1, ( x: number ): number => x, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a third argument that is not a number... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isAlmostSameValue( z1, z2, 'abc' ); // $ExpectError - isAlmostSameValue( z1, z2, true ); // $ExpectError - isAlmostSameValue( z1, z2, false ); // $ExpectError - isAlmostSameValue( z1, z2, null ); // $ExpectError - isAlmostSameValue( z1, z2, void 0 ); // $ExpectError - isAlmostSameValue( z1, z2, [] ); // $ExpectError - isAlmostSameValue( z1, z2, {} ); // $ExpectError - isAlmostSameValue( z1, z2, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isAlmostSameValue(); // $ExpectError - isAlmostSameValue( z1 ); // $ExpectError - isAlmostSameValue( z1, z2 ); // $ExpectError - isAlmostSameValue( z1, z2, 1, 1 ); // $ExpectError -} diff --git a/float64/base/assert/is-almost-same-value/examples/index.js b/float64/base/assert/is-almost-same-value/examples/index.js deleted file mode 100644 index ea324dfe..00000000 --- a/float64/base/assert/is-almost-same-value/examples/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var EPS = require( '@stdlib/constants/float64/eps' ); -var Complex128 = require( './../../../../../float64/ctor' ); -var isAlmostSameValue = require( './../lib' ); - -var z1 = new Complex128( 1.0, 3.0+EPS ); -var z2 = new Complex128( 1.0+EPS, 3.0 ); -console.log( isAlmostSameValue( z1, z2, 1 ) ); -// => true - -z1 = new Complex128( 1.0, 3.0+EPS ); -z2 = new Complex128( 1.0+EPS+EPS, 3.0 ); -console.log( isAlmostSameValue( z1, z2, 1 ) ); -// => false - -z1 = new Complex128( 0.0, 0.0 ); -z2 = new Complex128( -0.0, 0.0 ); -console.log( isAlmostSameValue( z1, z2, 0 ) ); -// => false - -z1 = new Complex128( NaN, 0.0 ); -z2 = new Complex128( 1.0, 0.0 ); -console.log( isAlmostSameValue( z1, z2, 1 ) ); -// => false diff --git a/float64/base/assert/is-almost-same-value/lib/index.js b/float64/base/assert/is-almost-same-value/lib/index.js deleted file mode 100644 index 2153824c..00000000 --- a/float64/base/assert/is-almost-same-value/lib/index.js +++ /dev/null @@ -1,48 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Test whether two double-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place). -* -* @module @stdlib/complex/float64/base/assert/is-almost-same-value -* -* @example -* var EPS = require( '@stdlib/constants/float64/eps' ); -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var isAlmostSameValue = require( '@stdlib/complex/float64/base/assert/is-almost-same-value' ); -* -* var z1 = new Complex128( 1.0, 3.0 ); -* var z2 = new Complex128( 1.0+EPS, 3.0 ); -* -* var bool = isAlmostSameValue( z1, z2, 0 ); -* // returns false -* -* bool = isAlmostSameValue( z1, z2, 1 ); -* // returns true -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float64/base/assert/is-almost-same-value/lib/main.js b/float64/base/assert/is-almost-same-value/lib/main.js deleted file mode 100644 index f509bf20..00000000 --- a/float64/base/assert/is-almost-same-value/lib/main.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var isAlmostSameValueF64 = require( '@stdlib/number/float64/base/assert/is-almost-same-value' ); -var reim = require( './../../../../../float64/reim' ); - - -// MAIN // - -/** -* Tests whether two double-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place). -* -* ## Notes -* -* - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5. -* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same. -* -* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12 -* -* @param {Complex128} z1 - first complex number -* @param {Complex128} z2 - second complex number -* @param {number} maxULP - maximum allowed ULP difference -* @returns {boolean} boolean indicating whether two double-precision complex floating-point numbers are approximately the same value within a specified number of ULPs -* -* @example -* var EPS = require( '@stdlib/constants/float64/eps' ); -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 1.0, 3.0 ); -* var z2 = new Complex128( 1.0+EPS, 3.0 ); -* -* var bool = isAlmostSameValue( z1, z2, 0 ); -* // returns false -* -* bool = isAlmostSameValue( z1, z2, 1 ); -* // returns true -*/ -function isAlmostSameValue( z1, z2, maxULP ) { - var parts1 = reim( z1 ); - var parts2 = reim( z2 ); - return ( - isAlmostSameValueF64( parts1[ 0 ], parts2[ 0 ], maxULP ) && - isAlmostSameValueF64( parts1[ 1 ], parts2[ 1 ], maxULP ) - ); -} - - -// EXPORTS // - -module.exports = isAlmostSameValue; diff --git a/float64/base/assert/is-almost-same-value/package.json b/float64/base/assert/is-almost-same-value/package.json deleted file mode 100644 index 5489c14e..00000000 --- a/float64/base/assert/is-almost-same-value/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "name": "@stdlib/complex/float64/base/assert/is-almost-same-value", - "version": "0.0.0", - "description": "Test whether two double-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place).", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "number", - "base", - "assert", - "test", - "validate", - "equality", - "compare", - "comparison", - "equal", - "eq", - "same", - "issame", - "isequal", - "isalmostequal", - "isalmostsame" - ] -} diff --git a/float64/base/assert/is-almost-same-value/test/test.js b/float64/base/assert/is-almost-same-value/test/test.js deleted file mode 100644 index b726d10f..00000000 --- a/float64/base/assert/is-almost-same-value/test/test.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex128 = require( './../../../../../float64/ctor' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var isAlmostSameValue = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof isAlmostSameValue, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function treats `NaNs` as the same value', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( NaN, 3.14 ); - z2 = new Complex128( 5.0, 3.14 ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), false, 'returns expected value' ); - - z2 = new Complex128( 5.0, NaN ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), false, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if provided two complex double-precision floating-point numbers which are the same value irrespective of the specified number of ULPs', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z1, 0 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), true, 'returns expected value' ); - - z1 = new Complex128( -5.0, -3.0 ); - z2 = new Complex128( -5.0, -3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 0 ), true, 'returns expected value' ); - - z1 = new Complex128( 0.0, 0.0 ); - z2 = new Complex128( 0.0, 0.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 0 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `true` if provided two complex double-precision floating-point numbers which are approximately the same value within a specified number of ULPs', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 1.0, 3.0 ); - z2 = new Complex128( 1.0+EPS, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), true, 'returns expected value' ); - - z2 = new Complex128( 1.0+EPS+EPS, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 2 ), true, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 2 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `false` if provided two complex double-precision floating-point numbers which are not approximately the same value within a specified number of ULPs', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 1.0, 3.0 ); - z2 = new Complex128( 1.0+EPS, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 0 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 0 ), false, 'returns expected value' ); - - z2 = new Complex128( 1.0+EPS+EPS, 3.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function distinguishes between signed zeros when the specified number of ULPs is zero', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 0.0, 0.0 ); - z2 = new Complex128( -0.0, -0.0 ); - t.strictEqual( isAlmostSameValue( z1, z2, 0 ), false, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 0 ), false, 'returns expected value' ); - - t.strictEqual( isAlmostSameValue( z1, z2, 1 ), true, 'returns expected value' ); - t.strictEqual( isAlmostSameValue( z2, z1, 1 ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/assert/is-equal/README.md b/float64/base/assert/is-equal/README.md deleted file mode 100644 index 39eb9cc7..00000000 --- a/float64/base/assert/is-equal/README.md +++ /dev/null @@ -1,221 +0,0 @@ - - -# isEqual - -> Test whether two double-precision complex floating-point numbers are equal. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var isEqual = require( '@stdlib/complex/float64/base/assert/is-equal' ); -``` - -#### isEqual( z1, z2 ) - -Tests whether two double-precision complex floating-point numbers are equal. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); - -var out = isEqual( z1, z2 ); -// returns true -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isEqual = require( '@stdlib/complex/float64/base/assert/is-equal' ); - -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); -var out = isEqual( z1, z2 ); -// returns true - -z1 = new Complex128( -5.0, -3.0 ); -z2 = new Complex128( 5.0, 3.0 ); -out = isEqual( z1, z2 ); -// returns false - -z1 = new Complex128( NaN, 3.0 ); -z2 = new Complex128( NaN, 3.0 ); -out = isEqual( z1, z2 ); -// returns false -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float64/base/assert/is_equal.h" -``` - -#### stdlib_base_complex128_is_equal( z1, z2 ) - -Tests whether double-precision complex floating-point numbers are equal. - -```c -#include "stdlib/complex/float64/ctor.h" -#include - -stdlib_complex128_t z1 = stdlib_complex128( 5.0, 2.0 ); -stdlib_complex128_t z2 = stdlib_complex128( 5.0, 2.0 ); - -bool v = stdlib_base_complex128_is_equal( z1, z2 ); -``` - -The function accepts the following arguments: - -- **z1**: `[in] stdlib_complex128_t` first double-precision complex floating-point number. -- **z2**: `[in] stdlib_complex128_t` second double-precision complex floating-point number. - -```c -bool stdlib_base_complex128_is_equal( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float64/base/assert/is_equal.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -int main( void ) { - const stdlib_complex128_t z[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - bool v; - int i; - for ( i = 0; i < 4; i++ ) { - v = stdlib_base_complex128_is_equal( z[ i ], z[ i ] ); - printf( "Equal? %s\n", ( v ) ? "True" : "False" ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float64/base/assert/is-equal/benchmark/benchmark.js b/float64/base/assert/is-equal/benchmark/benchmark.js deleted file mode 100644 index 265941eb..00000000 --- a/float64/base/assert/is-equal/benchmark/benchmark.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex128 = require( './../../../../../float64/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var isEqual = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var z1; - var z2; - var v; - var i; - - z1 = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ) - ]; - z2 = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ), - z1[ 0 ], - z1[ 1 ] - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = isEqual( z1[ i%z1.length ], z2[ i%z2.length ] ); - if ( typeof v !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( v ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/assert/is-equal/docs/repl.txt b/float64/base/assert/is-equal/docs/repl.txt deleted file mode 100644 index aa4bd9ca..00000000 --- a/float64/base/assert/is-equal/docs/repl.txt +++ /dev/null @@ -1,27 +0,0 @@ - -{{alias}}( z1, z2 ) - Tests whether two double-precision complex floating-point numbers are equal. - - Parameters - ---------- - z1: Complex128 - First complex number. - - z2: Complex128 - Second complex number. - - Returns - ------- - out: boolean - Result. - - Examples - -------- - > var z1 = new {{alias:@stdlib/complex/float64/ctor}}( 5.0, 3.0 ); - > var z2 = new {{alias:@stdlib/complex/float64/ctor}}( 5.0, 3.0 ); - > var v = {{alias}}( z1, z2 ) - true - - See Also - -------- - diff --git a/float64/base/assert/is-equal/docs/types/index.d.ts b/float64/base/assert/is-equal/docs/types/index.d.ts deleted file mode 100644 index 491e7c83..00000000 --- a/float64/base/assert/is-equal/docs/types/index.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex128 } from '@stdlib/types/complex'; - -/** -* Tests whether two double-precision complex floating-point numbers are equal. -* -* @param z1 - first complex number -* @param z2 - second complex number -* @returns boolean indicating if both complex numbers are equal -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( 5.0, 3.0 ); -* -* var v = isEqual( z1, z2 ); -* // returns true -*/ -declare function isEqual( z1: Complex128, z2: Complex128 ): boolean; - - -// EXPORTS // - -export = isEqual; diff --git a/float64/base/assert/is-equal/docs/types/test.ts b/float64/base/assert/is-equal/docs/types/test.ts deleted file mode 100644 index a6fcb2fa..00000000 --- a/float64/base/assert/is-equal/docs/types/test.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../../../float64/ctor' ); -import isEqual = require( './index' ); - - -// TESTS // - -// The function returns a boolean... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isEqual( z1, z2 ); // $ExpectType boolean -} - -// The compiler throws an error if the function is provided a first argument that is not a complex number... -{ - const z2 = new Complex128( 5.0, 3.0 ); - - isEqual( 'abc', z2 ); // $ExpectError - isEqual( 123, z2 ); // $ExpectError - isEqual( true, z2 ); // $ExpectError - isEqual( false, z2 ); // $ExpectError - isEqual( [], z2 ); // $ExpectError - isEqual( {}, z2 ); // $ExpectError - isEqual( ( x: number ): number => x, z2 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a complex number... -{ - const z1 = new Complex128( 5.0, 3.0 ); - - isEqual( z1, 'abc' ); // $ExpectError - isEqual( z1, 123 ); // $ExpectError - isEqual( z1, true ); // $ExpectError - isEqual( z1, false ); // $ExpectError - isEqual( z1, [] ); // $ExpectError - isEqual( z1, {} ); // $ExpectError - isEqual( z1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isEqual(); // $ExpectError - isEqual( z1 ); // $ExpectError - isEqual( z1, z2, {} ); // $ExpectError -} diff --git a/float64/base/assert/is-equal/examples/c/Makefile b/float64/base/assert/is-equal/examples/c/Makefile deleted file mode 100644 index 6aed70da..00000000 --- a/float64/base/assert/is-equal/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2024 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/assert/is-equal/examples/c/example.c b/float64/base/assert/is-equal/examples/c/example.c deleted file mode 100644 index 176c311d..00000000 --- a/float64/base/assert/is-equal/examples/c/example.c +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/assert/is_equal.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -int main( void ) { - const stdlib_complex128_t z[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - bool v; - int i; - for ( i = 0; i < 4; i++ ) { - v = stdlib_base_complex128_is_equal( z[ i ], z[ i ] ); - printf( "Equal? %s\n", ( v ) ? "True" : "False" ); - } -} diff --git a/float64/base/assert/is-equal/examples/index.js b/float64/base/assert/is-equal/examples/index.js deleted file mode 100644 index f0f8238e..00000000 --- a/float64/base/assert/is-equal/examples/index.js +++ /dev/null @@ -1,37 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128 = require( './../../../../../float64/ctor' ); -var isEqual = require( './../lib' ); - -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); -console.log( isEqual( z1, z2 ) ); -// => true - -z1 = new Complex128( -5.0, -3.0 ); -z2 = new Complex128( 5.0, 3.0 ); -console.log( isEqual( z1, z2 ) ); -// => false - -z1 = new Complex128( NaN, 3.0 ); -z2 = new Complex128( NaN, 3.0 ); -console.log( isEqual( z1, z2 ) ); -// => false diff --git a/float64/base/assert/is-equal/include/stdlib/complex/float64/base/assert/is_equal.h b/float64/base/assert/is-equal/include/stdlib/complex/float64/base/assert/is_equal.h deleted file mode 100644 index 19c9bbf4..00000000 --- a/float64/base/assert/is-equal/include/stdlib/complex/float64/base/assert/is_equal.h +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef STDLIB_COMPLEX_FLOAT64_BASE_ASSERT_IS_EQUAL_H -#define STDLIB_COMPLEX_FLOAT64_BASE_ASSERT_IS_EQUAL_H - -#include "stdlib/complex/float64/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether two double-precision complex floating-point numbers are equal. -*/ -bool stdlib_base_complex128_is_equal( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_FLOAT64_BASE_ASSERT_IS_EQUAL_H diff --git a/float64/base/assert/is-equal/lib/index.js b/float64/base/assert/is-equal/lib/index.js deleted file mode 100644 index cb92fa7c..00000000 --- a/float64/base/assert/is-equal/lib/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Test whether two double-precision complex floating-point numbers are equal. -* -* @module @stdlib/complex/float64/base/assert/is-equal -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var isEqual = require( '@stdlib/complex/float64/base/assert/is-equal' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( 5.0, 3.0 ); -* -* var v = isEqual( z1, z2 ); -* // returns true -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float64/base/assert/is-equal/lib/main.js b/float64/base/assert/is-equal/lib/main.js deleted file mode 100644 index 8e7b2fd8..00000000 --- a/float64/base/assert/is-equal/lib/main.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var reim = require( './../../../../../float64/reim' ); - - -// MAIN // - -/** -* Tests whether two double-precision complex floating-point numbers are equal. -* -* @param {Complex128} z1 - first complex number -* @param {Complex128} z2 - second complex number -* @returns {boolean} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( 5.0, 3.0 ); -* -* var v = isEqual( z1, z2 ); -* // returns true -*/ -function isEqual( z1, z2 ) { - var parts1 = reim( z1 ); - var parts2 = reim( z2 ); - return ( - parts1[ 0 ] === parts2[ 0 ] && - parts1[ 1 ] === parts2[ 1 ] - ); -} - - -// EXPORTS // - -module.exports = isEqual; diff --git a/float64/base/assert/is-equal/manifest.json b/float64/base/assert/is-equal/manifest.json deleted file mode 100644 index 88543a6f..00000000 --- a/float64/base/assert/is-equal/manifest.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - } - ] -} diff --git a/float64/base/assert/is-equal/package.json b/float64/base/assert/is-equal/package.json deleted file mode 100644 index 7b00c9f6..00000000 --- a/float64/base/assert/is-equal/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "@stdlib/complex/float64/base/assert/is-equal", - "version": "0.0.0", - "description": "Test whether two double-precision complex floating-point numbers are equal.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "number", - "base", - "assert", - "test", - "validate", - "equality", - "compare", - "comparison", - "equal", - "eq" - ] -} diff --git a/float64/base/assert/is-equal/src/main.c b/float64/base/assert/is-equal/src/main.c deleted file mode 100644 index 7f1de477..00000000 --- a/float64/base/assert/is-equal/src/main.c +++ /dev/null @@ -1,48 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/assert/is_equal.h" -#include "stdlib/complex/float64/reim.h" -#include "stdlib/complex/float64/ctor.h" -#include - -/** -* Tests whether two double-precision complex floating-point numbers are equal. -* -* @param z1 first double-precision complex floating-point number -* @param z2 second double-precision complex floating-point number -* @return boolean indicating if both complex numbers are equal -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* #include -* -* stdlib_complex128_t z1 = stdlib_complex128( 5.0, 2.0 ); -* stdlib_complex128_t z2 = stdlib_complex128( 5.0, 2.0 ); -* -* bool v = stdlib_base_complex128_is_equal( z1, z2 ); -*/ -bool stdlib_base_complex128_is_equal( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ) { - double re1; - double re2; - double im1; - double im2; - stdlib_complex128_reim( z1, &re1, &im1 ); - stdlib_complex128_reim( z2, &re2, &im2 ); - return ( re1 == re2 && im1 == im2 ); -} diff --git a/float64/base/assert/is-equal/test/test.js b/float64/base/assert/is-equal/test/test.js deleted file mode 100644 index 2a687480..00000000 --- a/float64/base/assert/is-equal/test/test.js +++ /dev/null @@ -1,134 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex128 = require( './../../../../../float64/ctor' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var isEqual = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof isEqual, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function tests whether two complex numbers are equal (finite)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isEqual( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( -5.0, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -5.0, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, -3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, -3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether two complex numbers are equal (infinite)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( PINF, NINF ); - t.strictEqual( isEqual( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex128( PINF, NINF ); - z2 = new Complex128( PINF, NINF ); - t.strictEqual( isEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( NINF, 3.0 ); - z2 = new Complex128( PINF, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( PINF, 3.0 ); - z2 = new Complex128( NINF, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( PINF, -3.0 ); - z2 = new Complex128( PINF, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( PINF, 3.0 ); - z2 = new Complex128( PINF, -3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, PINF ); - z2 = new Complex128( 5.0, NINF ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether two complex numbers are equal (NaNs)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( NaN, NaN ); - t.strictEqual( isEqual( z1, z1 ), false, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( NaN, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( 5.0, NaN ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, NaN ); - t.strictEqual( isEqual( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/assert/is-not-equal/README.md b/float64/base/assert/is-not-equal/README.md deleted file mode 100644 index 1d86c370..00000000 --- a/float64/base/assert/is-not-equal/README.md +++ /dev/null @@ -1,221 +0,0 @@ - - -# isNotEqual - -> Test whether two double-precision complex floating-point numbers are not equal. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var isNotEqual = require( '@stdlib/complex/float64/base/assert/is-not-equal' ); -``` - -#### isNotEqual( z1, z2 ) - -Tests whether two double-precision complex floating-point numbers are not equal. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, -3.0 ); - -var out = isNotEqual( z1, z2 ); -// returns true -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isNotEqual = require( '@stdlib/complex/float64/base/assert/is-not-equal' ); - -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); -var out = isNotEqual( z1, z2 ); -// returns false - -z1 = new Complex128( -5.0, -3.0 ); -z2 = new Complex128( 5.0, 3.0 ); -out = isNotEqual( z1, z2 ); -// returns true - -z1 = new Complex128( NaN, 3.0 ); -z2 = new Complex128( NaN, 3.0 ); -out = isNotEqual( z1, z2 ); -// returns true -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float64/base/assert/is_not_equal.h" -``` - -#### stdlib_base_complex128_is_not_equal( z1, z2 ) - -Tests whether double-precision complex floating-point numbers are not equal. - -```c -#include "stdlib/complex/float64/ctor.h" -#include - -stdlib_complex128_t z1 = stdlib_complex128( 5.0, 2.0 ); -stdlib_complex128_t z2 = stdlib_complex128( 5.0, -2.0 ); - -bool v = stdlib_base_complex128_is_not_equal( z1, z2 ); -``` - -The function accepts the following arguments: - -- **z1**: `[in] stdlib_complex128_t` first double-precision complex floating-point number. -- **z2**: `[in] stdlib_complex128_t` second double-precision complex floating-point number. - -```c -bool stdlib_base_complex128_is_not_equal( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float64/base/assert/is_not_equal.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -int main( void ) { - const stdlib_complex128_t z[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - bool v; - int i; - for ( i = 0; i < 4; i++ ) { - v = stdlib_base_complex128_is_not_equal( z[ i ], z[ i ] ); - printf( "Equal? %s\n", ( v ) ? "True" : "False" ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float64/base/assert/is-not-equal/benchmark/benchmark.js b/float64/base/assert/is-not-equal/benchmark/benchmark.js deleted file mode 100644 index b4bf31d9..00000000 --- a/float64/base/assert/is-not-equal/benchmark/benchmark.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex128 = require( './../../../../../float64/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var isNotEqual = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var z1; - var z2; - var v; - var i; - - z1 = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ) - ]; - z2 = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ), - z1[ 0 ], - z1[ 1 ] - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = isNotEqual( z1[ i%z1.length ], z2[ i%z2.length ] ); - if ( typeof v !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( v ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/assert/is-not-equal/docs/repl.txt b/float64/base/assert/is-not-equal/docs/repl.txt deleted file mode 100644 index cf619db3..00000000 --- a/float64/base/assert/is-not-equal/docs/repl.txt +++ /dev/null @@ -1,28 +0,0 @@ - -{{alias}}( z1, z2 ) - Tests whether two double-precision complex floating-point numbers are not - equal. - - Parameters - ---------- - z1: Complex128 - First complex number. - - z2: Complex128 - Second complex number. - - Returns - ------- - out: boolean - Result. - - Examples - -------- - > var z1 = new {{alias:@stdlib/complex/float64/ctor}}( 5.0, 3.0 ); - > var z2 = new {{alias:@stdlib/complex/float64/ctor}}( 5.0, -3.0 ); - > var v = {{alias}}( z1, z2 ) - true - - See Also - -------- - diff --git a/float64/base/assert/is-not-equal/docs/types/index.d.ts b/float64/base/assert/is-not-equal/docs/types/index.d.ts deleted file mode 100644 index 55ba4d27..00000000 --- a/float64/base/assert/is-not-equal/docs/types/index.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex128 } from '@stdlib/types/complex'; - -/** -* Tests whether two double-precision complex floating-point numbers are not equal. -* -* @param z1 - first complex number -* @param z2 - second complex number -* @returns boolean indicating if both complex numbers are not equal -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( 5.0, -3.0 ); -* -* var v = isNotEqual( z1, z2 ); -* // returns true -*/ -declare function isNotEqual( z1: Complex128, z2: Complex128 ): boolean; - - -// EXPORTS // - -export = isNotEqual; diff --git a/float64/base/assert/is-not-equal/docs/types/test.ts b/float64/base/assert/is-not-equal/docs/types/test.ts deleted file mode 100644 index 8c3d9c4e..00000000 --- a/float64/base/assert/is-not-equal/docs/types/test.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../../../float64/ctor' ); -import isNotEqual = require( './index' ); - - -// TESTS // - -// The function returns a boolean... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isNotEqual( z1, z2 ); // $ExpectType boolean -} - -// The compiler throws an error if the function is provided a first argument that is not a complex number... -{ - const z2 = new Complex128( 5.0, 3.0 ); - - isNotEqual( 'abc', z2 ); // $ExpectError - isNotEqual( 123, z2 ); // $ExpectError - isNotEqual( true, z2 ); // $ExpectError - isNotEqual( false, z2 ); // $ExpectError - isNotEqual( [], z2 ); // $ExpectError - isNotEqual( {}, z2 ); // $ExpectError - isNotEqual( ( x: number ): number => x, z2 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a complex number... -{ - const z1 = new Complex128( 5.0, 3.0 ); - - isNotEqual( z1, 'abc' ); // $ExpectError - isNotEqual( z1, 123 ); // $ExpectError - isNotEqual( z1, true ); // $ExpectError - isNotEqual( z1, false ); // $ExpectError - isNotEqual( z1, [] ); // $ExpectError - isNotEqual( z1, {} ); // $ExpectError - isNotEqual( z1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isNotEqual(); // $ExpectError - isNotEqual( z1 ); // $ExpectError - isNotEqual( z1, z2, {} ); // $ExpectError -} diff --git a/float64/base/assert/is-not-equal/examples/c/Makefile b/float64/base/assert/is-not-equal/examples/c/Makefile deleted file mode 100644 index 6aed70da..00000000 --- a/float64/base/assert/is-not-equal/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2024 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/assert/is-not-equal/examples/c/example.c b/float64/base/assert/is-not-equal/examples/c/example.c deleted file mode 100644 index f57609d4..00000000 --- a/float64/base/assert/is-not-equal/examples/c/example.c +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/assert/is_not_equal.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -int main( void ) { - const stdlib_complex128_t z[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - bool v; - int i; - for ( i = 0; i < 4; i++ ) { - v = stdlib_base_complex128_is_not_equal( z[ i ], z[ i ] ); - printf( "Equal? %s\n", ( v ) ? "True" : "False" ); - } -} diff --git a/float64/base/assert/is-not-equal/examples/index.js b/float64/base/assert/is-not-equal/examples/index.js deleted file mode 100644 index 1168ac9c..00000000 --- a/float64/base/assert/is-not-equal/examples/index.js +++ /dev/null @@ -1,37 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128 = require( './../../../../../float64/ctor' ); -var isNotEqual = require( './../lib' ); - -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); -console.log( isNotEqual( z1, z2 ) ); -// => false - -z1 = new Complex128( -5.0, -3.0 ); -z2 = new Complex128( 5.0, 3.0 ); -console.log( isNotEqual( z1, z2 ) ); -// => true - -z1 = new Complex128( NaN, 3.0 ); -z2 = new Complex128( NaN, 3.0 ); -console.log( isNotEqual( z1, z2 ) ); -// => true diff --git a/float64/base/assert/is-not-equal/include/stdlib/complex/float64/base/assert/is_not_equal.h b/float64/base/assert/is-not-equal/include/stdlib/complex/float64/base/assert/is_not_equal.h deleted file mode 100644 index ff4a3f15..00000000 --- a/float64/base/assert/is-not-equal/include/stdlib/complex/float64/base/assert/is_not_equal.h +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef STDLIB_COMPLEX_BFLOAT64_ASE_ASSERT_IS_NOT_EQUAL_H -#define STDLIB_COMPLEX_BFLOAT64_ASE_ASSERT_IS_NOT_EQUAL_H - -#include "stdlib/complex/float64/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether two double-precision complex floating-point numbers are not equal. -*/ -bool stdlib_base_complex128_is_not_equal( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_FLOAT64_BASE_ASSERT_IS_NOT_EQUAL_H diff --git a/float64/base/assert/is-not-equal/lib/index.js b/float64/base/assert/is-not-equal/lib/index.js deleted file mode 100644 index 095a9a07..00000000 --- a/float64/base/assert/is-not-equal/lib/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Test whether two double-precision complex floating-point numbers are not equal. -* -* @module @stdlib/complex/float64/base/assert/is-not-equal -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var isNotEqual = require( '@stdlib/complex/float64/base/assert/is-not-equal' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( 5.0, -3.0 ); -* -* var v = isNotEqual( z1, z2 ); -* // returns true -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float64/base/assert/is-not-equal/lib/main.js b/float64/base/assert/is-not-equal/lib/main.js deleted file mode 100644 index 771db577..00000000 --- a/float64/base/assert/is-not-equal/lib/main.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var reim = require( './../../../../../float64/reim' ); - - -// MAIN // - -/** -* Tests whether two double-precision complex floating-point numbers are not equal. -* -* @param {Complex128} z1 - first complex number -* @param {Complex128} z2 - second complex number -* @returns {boolean} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( 5.0, -3.0 ); -* -* var v = isNotEqual( z1, z2 ); -* // returns true -*/ -function isNotEqual( z1, z2 ) { - var parts1 = reim( z1 ); - var parts2 = reim( z2 ); - return ( - parts1[ 0 ] !== parts2[ 0 ] || - parts1[ 1 ] !== parts2[ 1 ] - ); -} - - -// EXPORTS // - -module.exports = isNotEqual; diff --git a/float64/base/assert/is-not-equal/manifest.json b/float64/base/assert/is-not-equal/manifest.json deleted file mode 100644 index 88543a6f..00000000 --- a/float64/base/assert/is-not-equal/manifest.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - } - ] -} diff --git a/float64/base/assert/is-not-equal/package.json b/float64/base/assert/is-not-equal/package.json deleted file mode 100644 index 12e6092f..00000000 --- a/float64/base/assert/is-not-equal/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "@stdlib/complex/float64/base/assert/is-not-equal", - "version": "0.0.0", - "description": "Test whether two double-precision complex floating-point numbers are not equal.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "number", - "base", - "assert", - "test", - "validate", - "equality", - "compare", - "comparison", - "equal", - "eq", - "unequal" - ] -} diff --git a/float64/base/assert/is-not-equal/src/main.c b/float64/base/assert/is-not-equal/src/main.c deleted file mode 100644 index 49c372ea..00000000 --- a/float64/base/assert/is-not-equal/src/main.c +++ /dev/null @@ -1,48 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/assert/is_not_equal.h" -#include "stdlib/complex/float64/reim.h" -#include "stdlib/complex/float64/ctor.h" -#include - -/** -* Tests whether two double-precision complex floating-point numbers are not equal. -* -* @param z1 first double-precision complex floating-point number -* @param z2 second double-precision complex floating-point number -* @return boolean indicating if both complex numbers are not equal -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* #include -* -* stdlib_complex128_t z1 = stdlib_complex128( 5.0, 2.0 ); -* stdlib_complex128_t z2 = stdlib_complex128( 5.0, -2.0 ); -* -* bool v = stdlib_base_complex128_is_not_equal( z1, z2 ); -*/ -bool stdlib_base_complex128_is_not_equal( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ) { - double re1; - double re2; - double im1; - double im2; - stdlib_complex128_reim( z1, &re1, &im1 ); - stdlib_complex128_reim( z2, &re2, &im2 ); - return ( re1 != re2 || im1 != im2 ); -} diff --git a/float64/base/assert/is-not-equal/test/test.js b/float64/base/assert/is-not-equal/test/test.js deleted file mode 100644 index da0d052f..00000000 --- a/float64/base/assert/is-not-equal/test/test.js +++ /dev/null @@ -1,134 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex128 = require( './../../../../../float64/ctor' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var isNotEqual = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof isNotEqual, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function tests whether two complex numbers are not equal (finite)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isNotEqual( z1, z1 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( -5.0, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -5.0, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, -3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, -3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether two complex numbers are not equal (infinite)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( PINF, NINF ); - t.strictEqual( isNotEqual( z1, z1 ), false, 'returns expected value' ); - - z1 = new Complex128( PINF, NINF ); - z2 = new Complex128( PINF, NINF ); - t.strictEqual( isNotEqual( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( NINF, 3.0 ); - z2 = new Complex128( PINF, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( PINF, 3.0 ); - z2 = new Complex128( NINF, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( PINF, -3.0 ); - z2 = new Complex128( PINF, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( PINF, 3.0 ); - z2 = new Complex128( PINF, -3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, PINF ); - z2 = new Complex128( 5.0, NINF ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether two complex numbers are not equal (NaNs)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( NaN, NaN ); - t.strictEqual( isNotEqual( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( NaN, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( 5.0, NaN ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, NaN ); - t.strictEqual( isNotEqual( z1, z2 ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/assert/is-same-value-zero/README.md b/float64/base/assert/is-same-value-zero/README.md deleted file mode 100644 index 8cda7d89..00000000 --- a/float64/base/assert/is-same-value-zero/README.md +++ /dev/null @@ -1,247 +0,0 @@ - - -# isSameValueZero - -> Test whether two double-precision complex floating-point numbers are the same value. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var isSameValueZero = require( '@stdlib/complex/float64/base/assert/is-same-value-zero' ); -``` - -#### isSameValueZero( z1, z2 ) - -Tests whether two double-precision complex floating-point numbers are the same value. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); - -var out = isSameValueZero( z1, z2 ); -// returns true -``` - -In contrast to the strict equality operator `===`, the function treats `NaNs` as the same value. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( NaN, NaN ); -var z2 = new Complex128( NaN, NaN ); - -var out = isSameValueZero( z1, z2 ); -// returns true -``` - -In contrast to the [SameValue Algorithm][@stdlib/complex/float64/base/assert/is-same-value] (as specified in ECMAScript 5), the function does not distinguish between `+0` and `-0`. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( -0.0, 0.0 ); -var z2 = new Complex128( 0.0, -0.0 ); - -var out = isSameValueZero( z1, z2 ); -// returns true -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isSameValueZero = require( '@stdlib/complex/float64/base/assert/is-same-value-zero' ); - -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); -var out = isSameValueZero( z1, z2 ); -// returns true - -z1 = new Complex128( -5.0, -3.0 ); -z2 = new Complex128( 5.0, 3.0 ); -out = isSameValueZero( z1, z2 ); -// returns false - -z1 = new Complex128( NaN, 3.0 ); -z2 = new Complex128( NaN, 3.0 ); -out = isSameValueZero( z1, z2 ); -// returns true -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float64/base/assert/is_same_value_zero.h" -``` - -#### stdlib_base_complex128_is_same_value_zero( z1, z2 ) - -Tests whether two double-precision complex floating-point numbers are the same value. - -```c -#include "stdlib/complex/float64/ctor.h" -#include - -stdlib_complex128_t z1 = stdlib_complex128( 5.0, 2.0 ); -stdlib_complex128_t z2 = stdlib_complex128( 5.0, 2.0 ); - -bool v = stdlib_base_complex128_is_same_value_zero( z1, z2 ); -``` - -The function accepts the following arguments: - -- **z1**: `[in] stdlib_complex128_t` first double-precision complex floating-point number. -- **z2**: `[in] stdlib_complex128_t` second double-precision complex floating-point number. - -```c -bool stdlib_base_complex128_is_same_value_zero( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float64/base/assert/is_same_value_zero.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -int main( void ) { - const stdlib_complex128_t z[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - bool v; - int i; - for ( i = 0; i < 4; i++ ) { - v = stdlib_base_complex128_is_same_value_zero( z[ i ], z[ i ] ); - printf( "Same value? %s\n", ( v ) ? "True" : "False" ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float64/base/assert/is-same-value-zero/benchmark/benchmark.js b/float64/base/assert/is-same-value-zero/benchmark/benchmark.js deleted file mode 100644 index 17626035..00000000 --- a/float64/base/assert/is-same-value-zero/benchmark/benchmark.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex128 = require( './../../../../../float64/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var isSameValueZero = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var z1; - var z2; - var v; - var i; - - z1 = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ) - ]; - z2 = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ), - z1[ 0 ], - z1[ 1 ] - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = isSameValueZero( z1[ i%z1.length ], z2[ i%z2.length ] ); - if ( typeof v !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( v ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/assert/is-same-value-zero/docs/repl.txt b/float64/base/assert/is-same-value-zero/docs/repl.txt deleted file mode 100644 index e761c938..00000000 --- a/float64/base/assert/is-same-value-zero/docs/repl.txt +++ /dev/null @@ -1,31 +0,0 @@ - -{{alias}}( z1, z2 ) - Tests whether two double-precision complex floating-point numbers are the - same value. - - The function differs from the `===` operator in that the function treats - `NaNs` as the same value. - - Parameters - ---------- - z1: Complex128 - First complex number. - - z2: Complex128 - Second complex number. - - Returns - ------- - out: boolean - Result. - - Examples - -------- - > var z1 = new {{alias:@stdlib/complex/float64/ctor}}( 5.0, 3.0 ); - > var z2 = new {{alias:@stdlib/complex/float64/ctor}}( 5.0, 3.0 ); - > var v = {{alias}}( z1, z2 ) - true - - See Also - -------- - diff --git a/float64/base/assert/is-same-value-zero/docs/types/index.d.ts b/float64/base/assert/is-same-value-zero/docs/types/index.d.ts deleted file mode 100644 index ae116aa5..00000000 --- a/float64/base/assert/is-same-value-zero/docs/types/index.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex128 } from '@stdlib/types/complex'; - -/** -* Tests whether two double-precision complex floating-point numbers are the same value. -* -* ## Notes -* -* - In contrast to the strict equality operator `===`, `NaNs` are treated as the same value. -* -* @param z1 - first complex number -* @param z2 - second complex number -* @returns boolean indicating if both complex numbers are the same value -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( 5.0, 3.0 ); -* -* var v = isSameValueZero( z1, z2 ); -* // returns true -*/ -declare function isSameValueZero( z1: Complex128, z2: Complex128 ): boolean; - - -// EXPORTS // - -export = isSameValueZero; diff --git a/float64/base/assert/is-same-value-zero/docs/types/test.ts b/float64/base/assert/is-same-value-zero/docs/types/test.ts deleted file mode 100644 index aba9d044..00000000 --- a/float64/base/assert/is-same-value-zero/docs/types/test.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../../../float64/ctor' ); -import isSameValueZero = require( './index' ); - - -// TESTS // - -// The function returns a boolean... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isSameValueZero( z1, z2 ); // $ExpectType boolean -} - -// The compiler throws an error if the function is provided a first argument that is not a complex number... -{ - const z2 = new Complex128( 5.0, 3.0 ); - - isSameValueZero( 'abc', z2 ); // $ExpectError - isSameValueZero( 123, z2 ); // $ExpectError - isSameValueZero( true, z2 ); // $ExpectError - isSameValueZero( false, z2 ); // $ExpectError - isSameValueZero( [], z2 ); // $ExpectError - isSameValueZero( {}, z2 ); // $ExpectError - isSameValueZero( ( x: number ): number => x, z2 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a complex number... -{ - const z1 = new Complex128( 5.0, 3.0 ); - - isSameValueZero( z1, 'abc' ); // $ExpectError - isSameValueZero( z1, 123 ); // $ExpectError - isSameValueZero( z1, true ); // $ExpectError - isSameValueZero( z1, false ); // $ExpectError - isSameValueZero( z1, [] ); // $ExpectError - isSameValueZero( z1, {} ); // $ExpectError - isSameValueZero( z1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isSameValueZero(); // $ExpectError - isSameValueZero( z1 ); // $ExpectError - isSameValueZero( z1, z2, {} ); // $ExpectError -} diff --git a/float64/base/assert/is-same-value-zero/examples/c/Makefile b/float64/base/assert/is-same-value-zero/examples/c/Makefile deleted file mode 100644 index 6aed70da..00000000 --- a/float64/base/assert/is-same-value-zero/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2024 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/assert/is-same-value-zero/examples/c/example.c b/float64/base/assert/is-same-value-zero/examples/c/example.c deleted file mode 100644 index 150cbd02..00000000 --- a/float64/base/assert/is-same-value-zero/examples/c/example.c +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/assert/is_same_value_zero.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -int main( void ) { - const stdlib_complex128_t z[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - bool v; - int i; - for ( i = 0; i < 4; i++ ) { - v = stdlib_base_complex128_is_same_value_zero( z[ i ], z[ i ] ); - printf( "Same value? %s\n", ( v ) ? "True" : "False" ); - } -} diff --git a/float64/base/assert/is-same-value-zero/examples/index.js b/float64/base/assert/is-same-value-zero/examples/index.js deleted file mode 100644 index c5bc02a9..00000000 --- a/float64/base/assert/is-same-value-zero/examples/index.js +++ /dev/null @@ -1,37 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128 = require( './../../../../../float64/ctor' ); -var isSameValueZero = require( './../lib' ); - -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); -console.log( isSameValueZero( z1, z2 ) ); -// => true - -z1 = new Complex128( -5.0, -3.0 ); -z2 = new Complex128( 5.0, 3.0 ); -console.log( isSameValueZero( z1, z2 ) ); -// => false - -z1 = new Complex128( NaN, 3.0 ); -z2 = new Complex128( NaN, 3.0 ); -console.log( isSameValueZero( z1, z2 ) ); -// => true diff --git a/float64/base/assert/is-same-value-zero/include/stdlib/complex/float64/base/assert/is_same_value_zero.h b/float64/base/assert/is-same-value-zero/include/stdlib/complex/float64/base/assert/is_same_value_zero.h deleted file mode 100644 index 699c589c..00000000 --- a/float64/base/assert/is-same-value-zero/include/stdlib/complex/float64/base/assert/is_same_value_zero.h +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef STDLIB_COMPLEX_FLOAT64_BASE_ASSERT_IS_SAME_VALUE_ZERO_H -#define STDLIB_COMPLEX_FLOAT64_BASE_ASSERT_IS_SAME_VALUE_ZERO_H - -#include "stdlib/complex/float64/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether two double-precision complex floating-point numbers are the same value. -*/ -bool stdlib_base_complex128_is_same_value_zero( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_FLOAT64_BASE_ASSERT_IS_SAME_VALUE_ZERO_H diff --git a/float64/base/assert/is-same-value-zero/lib/index.js b/float64/base/assert/is-same-value-zero/lib/index.js deleted file mode 100644 index fb521393..00000000 --- a/float64/base/assert/is-same-value-zero/lib/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Test whether two double-precision complex floating-point numbers are the same value. -* -* @module @stdlib/complex/float64/base/assert/is-same-value-zero -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var isSameValueZero = require( '@stdlib/complex/float64/base/assert/is-same-value-zero' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( 5.0, 3.0 ); -* -* var v = isSameValueZero( z1, z2 ); -* // returns true -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float64/base/assert/is-same-value-zero/lib/main.js b/float64/base/assert/is-same-value-zero/lib/main.js deleted file mode 100644 index 3b835ef3..00000000 --- a/float64/base/assert/is-same-value-zero/lib/main.js +++ /dev/null @@ -1,62 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var isSame = require( '@stdlib/number/float64/base/assert/is-same-value-zero' ); -var reim = require( './../../../../../float64/reim' ); - - -// MAIN // - -/** -* Tests whether two double-precision complex floating-point numbers are the same value. -* -* ## Notes -* -* - The function implements the SameValueZero Algorithm used by `TypedArray` and `ArrayBuffer` constructors, `Map` and `Set` operations, `String.prototype.includes`, and `Array.prototype.includes` since ES2016. -* - In contrast to the strict equality operator `===`, `NaNs` are considered the same value. -* -* @param {Complex128} z1 - first complex number -* @param {Complex128} z2 - second complex number -* @returns {boolean} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( 5.0, 3.0 ); -* -* var v = isSameValueZero( z1, z2 ); -* // returns true -*/ -function isSameValueZero( z1, z2 ) { - var parts1 = reim( z1 ); - var parts2 = reim( z2 ); - return ( - isSame( parts1[ 0 ], parts2[ 0 ] ) && - isSame( parts1[ 1 ], parts2[ 1 ] ) - ); -} - - -// EXPORTS // - -module.exports = isSameValueZero; diff --git a/float64/base/assert/is-same-value-zero/manifest.json b/float64/base/assert/is-same-value-zero/manifest.json deleted file mode 100644 index 04f8cd5f..00000000 --- a/float64/base/assert/is-same-value-zero/manifest.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim", - "@stdlib/number/float64/base/assert/is-same-value-zero" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim", - "@stdlib/number/float64/base/assert/is-same-value-zero" - ] - } - ] -} diff --git a/float64/base/assert/is-same-value-zero/package.json b/float64/base/assert/is-same-value-zero/package.json deleted file mode 100644 index b331857c..00000000 --- a/float64/base/assert/is-same-value-zero/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "name": "@stdlib/complex/float64/base/assert/is-same-value-zero", - "version": "0.0.0", - "description": "Test whether two double-precision complex floating-point numbers are the same value.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "number", - "base", - "assert", - "test", - "validate", - "equality", - "compare", - "comparison", - "equal", - "eq", - "same", - "issame", - "issamevalue" - ] -} diff --git a/float64/base/assert/is-same-value-zero/src/main.c b/float64/base/assert/is-same-value-zero/src/main.c deleted file mode 100644 index 8cb427a3..00000000 --- a/float64/base/assert/is-same-value-zero/src/main.c +++ /dev/null @@ -1,52 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/assert/is_same_value_zero.h" -#include "stdlib/number/float64/base/assert/is_same_value_zero.h" -#include "stdlib/complex/float64/reim.h" -#include "stdlib/complex/float64/ctor.h" -#include - -/** -* Tests whether two double-precision complex floating-point numbers are the same value. -* -* @param z1 first double-precision complex floating-point number -* @param z2 second double-precision complex floating-point number -* @return boolean indicating if both complex numbers are the same value -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* #include -* -* stdlib_complex128_t z1 = stdlib_complex128( 5.0, 2.0 ); -* stdlib_complex128_t z2 = stdlib_complex128( 5.0, 2.0 ); -* -* bool v = stdlib_base_complex128_is_same_value_zero( z1, z2 ); -*/ -bool stdlib_base_complex128_is_same_value_zero( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ) { - double re1; - double re2; - double im1; - double im2; - stdlib_complex128_reim( z1, &re1, &im1 ); - stdlib_complex128_reim( z2, &re2, &im2 ); - return ( - stdlib_base_float64_is_same_value_zero( re1, re2 ) && - stdlib_base_float64_is_same_value_zero( im1, im2 ) - ); -} diff --git a/float64/base/assert/is-same-value-zero/test/test.js b/float64/base/assert/is-same-value-zero/test/test.js deleted file mode 100644 index 78ece5c1..00000000 --- a/float64/base/assert/is-same-value-zero/test/test.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex128 = require( './../../../../../float64/ctor' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var isSameValueZero = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof isSameValueZero, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function tests whether two complex numbers are the same value (finite)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isSameValueZero( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 0.0, 0.0 ); - z2 = new Complex128( 0.0, 0.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( -0.0, 0.0 ); - z2 = new Complex128( 0.0, 0.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 0.0, -0.0 ); - z2 = new Complex128( -0.0, 0.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 0.0, -0.0 ); - z2 = new Complex128( 0.0, -0.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( -5.0, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -5.0, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, -3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, -3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether two complex numbers are the same value (infinite)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( PINF, NINF ); - t.strictEqual( isSameValueZero( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex128( PINF, NINF ); - z2 = new Complex128( PINF, NINF ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( NINF, 3.0 ); - z2 = new Complex128( PINF, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( PINF, 3.0 ); - z2 = new Complex128( NINF, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( PINF, -3.0 ); - z2 = new Complex128( PINF, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( PINF, 3.0 ); - z2 = new Complex128( PINF, -3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, PINF ); - z2 = new Complex128( 5.0, NINF ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether two complex numbers are the same value (NaNs)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( NaN, NaN ); - t.strictEqual( isSameValueZero( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( NaN, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( 5.0, NaN ); - t.strictEqual( isSameValueZero( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, NaN ); - t.strictEqual( isSameValueZero( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/assert/is-same-value/README.md b/float64/base/assert/is-same-value/README.md deleted file mode 100644 index b8785873..00000000 --- a/float64/base/assert/is-same-value/README.md +++ /dev/null @@ -1,245 +0,0 @@ - - -# isSameValue - -> Test whether two double-precision complex floating-point numbers are the same value. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var isSameValue = require( '@stdlib/complex/float64/base/assert/is-same-value' ); -``` - -#### isSameValue( z1, z2 ) - -Tests whether two double-precision complex floating-point numbers are the same value. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); - -var out = isSameValue( z1, z2 ); -// returns true -``` - -In contrast to the strict equality operator `===`, the function distinguishes between `+0` and `-0` and treats `NaNs` as the same value. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( NaN, NaN ); -var z2 = new Complex128( NaN, NaN ); - -var out = isSameValue( z1, z2 ); -// returns true - -z1 = new Complex128( -0.0, 0.0 ); -z2 = new Complex128( 0.0, -0.0 ); - -out = isSameValue( z1, z2 ); -// returns false -``` - -
- - - - - -
- -## Notes - -- The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm] as specified in ECMAScript 5. - -
- - - - - -
- -## Examples - - - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var isSameValue = require( '@stdlib/complex/float64/base/assert/is-same-value' ); - -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); -var out = isSameValue( z1, z2 ); -// returns true - -z1 = new Complex128( -5.0, -3.0 ); -z2 = new Complex128( 5.0, 3.0 ); -out = isSameValue( z1, z2 ); -// returns false - -z1 = new Complex128( NaN, 3.0 ); -z2 = new Complex128( NaN, 3.0 ); -out = isSameValue( z1, z2 ); -// returns true -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float64/base/assert/is_same_value.h" -``` - -#### stdlib_base_complex128_is_same_value( z1, z2 ) - -Tests whether two double-precision complex floating-point numbers are the same value. - -```c -#include "stdlib/complex/float64/ctor.h" -#include - -stdlib_complex128_t z1 = stdlib_complex128( 5.0, 2.0 ); -stdlib_complex128_t z2 = stdlib_complex128( 5.0, 2.0 ); - -bool v = stdlib_base_complex128_is_same_value( z1, z2 ); -``` - -The function accepts the following arguments: - -- **z1**: `[in] stdlib_complex128_t` first double-precision complex floating-point number. -- **z2**: `[in] stdlib_complex128_t` second double-precision complex floating-point number. - -```c -bool stdlib_base_complex128_is_same_value( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float64/base/assert/is_same_value.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -int main( void ) { - const stdlib_complex128_t z[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - bool v; - int i; - for ( i = 0; i < 4; i++ ) { - v = stdlib_base_complex128_is_same_value( z[ i ], z[ i ] ); - printf( "Same value? %s\n", ( v ) ? "True" : "False" ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float64/base/assert/is-same-value/benchmark/benchmark.js b/float64/base/assert/is-same-value/benchmark/benchmark.js deleted file mode 100644 index 36fb9bd2..00000000 --- a/float64/base/assert/is-same-value/benchmark/benchmark.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex128 = require( './../../../../../float64/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var isSameValue = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var z1; - var z2; - var v; - var i; - - z1 = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ) - ]; - z2 = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ), - z1[ 0 ], - z1[ 1 ] - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = isSameValue( z1[ i%z1.length ], z2[ i%z2.length ] ); - if ( typeof v !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( v ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/assert/is-same-value/docs/repl.txt b/float64/base/assert/is-same-value/docs/repl.txt deleted file mode 100644 index 0a6d5d65..00000000 --- a/float64/base/assert/is-same-value/docs/repl.txt +++ /dev/null @@ -1,31 +0,0 @@ - -{{alias}}( z1, z2 ) - Tests whether two double-precision complex floating-point numbers are the - same value. - - The function differs from the `===` operator in that the function treats - `-0` and `+0` as distinct and `NaNs` as the same. - - Parameters - ---------- - z1: Complex128 - First complex number. - - z2: Complex128 - Second complex number. - - Returns - ------- - out: boolean - Result. - - Examples - -------- - > var z1 = new {{alias:@stdlib/complex/float64/ctor}}( 5.0, 3.0 ); - > var z2 = new {{alias:@stdlib/complex/float64/ctor}}( 5.0, 3.0 ); - > var v = {{alias}}( z1, z2 ) - true - - See Also - -------- - diff --git a/float64/base/assert/is-same-value/docs/types/index.d.ts b/float64/base/assert/is-same-value/docs/types/index.d.ts deleted file mode 100644 index 8a4f2e5f..00000000 --- a/float64/base/assert/is-same-value/docs/types/index.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex128 } from '@stdlib/types/complex'; - -/** -* Tests whether two double-precision complex floating-point numbers are the same value. -* -* ## Notes -* -* - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5. -* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same. -* -* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12 -* -* @param z1 - first complex number -* @param z2 - second complex number -* @returns boolean indicating if both complex numbers are the same value -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( 5.0, 3.0 ); -* -* var v = isSameValue( z1, z2 ); -* // returns true -*/ -declare function isSameValue( z1: Complex128, z2: Complex128 ): boolean; - - -// EXPORTS // - -export = isSameValue; diff --git a/float64/base/assert/is-same-value/docs/types/test.ts b/float64/base/assert/is-same-value/docs/types/test.ts deleted file mode 100644 index 5b017224..00000000 --- a/float64/base/assert/is-same-value/docs/types/test.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../../../float64/ctor' ); -import isSameValue = require( './index' ); - - -// TESTS // - -// The function returns a boolean... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isSameValue( z1, z2 ); // $ExpectType boolean -} - -// The compiler throws an error if the function is provided a first argument that is not a complex number... -{ - const z2 = new Complex128( 5.0, 3.0 ); - - isSameValue( 'abc', z2 ); // $ExpectError - isSameValue( 123, z2 ); // $ExpectError - isSameValue( true, z2 ); // $ExpectError - isSameValue( false, z2 ); // $ExpectError - isSameValue( [], z2 ); // $ExpectError - isSameValue( {}, z2 ); // $ExpectError - isSameValue( ( x: number ): number => x, z2 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a complex number... -{ - const z1 = new Complex128( 5.0, 3.0 ); - - isSameValue( z1, 'abc' ); // $ExpectError - isSameValue( z1, 123 ); // $ExpectError - isSameValue( z1, true ); // $ExpectError - isSameValue( z1, false ); // $ExpectError - isSameValue( z1, [] ); // $ExpectError - isSameValue( z1, {} ); // $ExpectError - isSameValue( z1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z1 = new Complex128( 5.0, 3.0 ); - const z2 = new Complex128( 5.0, 3.0 ); - - isSameValue(); // $ExpectError - isSameValue( z1 ); // $ExpectError - isSameValue( z1, z2, {} ); // $ExpectError -} diff --git a/float64/base/assert/is-same-value/examples/c/Makefile b/float64/base/assert/is-same-value/examples/c/Makefile deleted file mode 100644 index 6aed70da..00000000 --- a/float64/base/assert/is-same-value/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2024 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/assert/is-same-value/examples/c/example.c b/float64/base/assert/is-same-value/examples/c/example.c deleted file mode 100644 index d1fa91ea..00000000 --- a/float64/base/assert/is-same-value/examples/c/example.c +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/assert/is_same_value.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -int main( void ) { - const stdlib_complex128_t z[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - bool v; - int i; - for ( i = 0; i < 4; i++ ) { - v = stdlib_base_complex128_is_same_value( z[ i ], z[ i ] ); - printf( "Same value? %s\n", ( v ) ? "True" : "False" ); - } -} diff --git a/float64/base/assert/is-same-value/examples/index.js b/float64/base/assert/is-same-value/examples/index.js deleted file mode 100644 index 3634aea1..00000000 --- a/float64/base/assert/is-same-value/examples/index.js +++ /dev/null @@ -1,37 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128 = require( './../../../../../float64/ctor' ); -var isSameValue = require( './../lib' ); - -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( 5.0, 3.0 ); -console.log( isSameValue( z1, z2 ) ); -// => true - -z1 = new Complex128( -5.0, -3.0 ); -z2 = new Complex128( 5.0, 3.0 ); -console.log( isSameValue( z1, z2 ) ); -// => false - -z1 = new Complex128( NaN, 3.0 ); -z2 = new Complex128( NaN, 3.0 ); -console.log( isSameValue( z1, z2 ) ); -// => true diff --git a/float64/base/assert/is-same-value/include/stdlib/complex/float64/base/assert/is_same_value.h b/float64/base/assert/is-same-value/include/stdlib/complex/float64/base/assert/is_same_value.h deleted file mode 100644 index f017b8fc..00000000 --- a/float64/base/assert/is-same-value/include/stdlib/complex/float64/base/assert/is_same_value.h +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef STDLIB_COMPLEX_FLOAT64_BASE_ASSERT_IS_SAME_VALUE_H -#define STDLIB_COMPLEX_FLOAT64_BASE_ASSERT_IS_SAME_VALUE_H - -#include "stdlib/complex/float64/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether two double-precision complex floating-point numbers are the same value. -*/ -bool stdlib_base_complex128_is_same_value( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_FLOAT64_BASE_ASSERT_IS_SAME_VALUE_H diff --git a/float64/base/assert/is-same-value/lib/index.js b/float64/base/assert/is-same-value/lib/index.js deleted file mode 100644 index 0280e706..00000000 --- a/float64/base/assert/is-same-value/lib/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Test whether two double-precision complex floating-point numbers are the same value. -* -* @module @stdlib/complex/float64/base/assert/is-same-value -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var isSameValue = require( '@stdlib/complex/float64/base/assert/is-same-value' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( 5.0, 3.0 ); -* -* var v = isSameValue( z1, z2 ); -* // returns true -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float64/base/assert/is-same-value/lib/main.js b/float64/base/assert/is-same-value/lib/main.js deleted file mode 100644 index bb5c8844..00000000 --- a/float64/base/assert/is-same-value/lib/main.js +++ /dev/null @@ -1,64 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var isSame = require( '@stdlib/number/float64/base/assert/is-same-value' ); -var reim = require( './../../../../../float64/reim' ); - - -// MAIN // - -/** -* Tests whether two double-precision complex floating-point numbers are the same value. -* -* ## Notes -* -* - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5. -* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same. -* -* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12 -* -* @param {Complex128} z1 - first complex number -* @param {Complex128} z2 - second complex number -* @returns {boolean} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( 5.0, 3.0 ); -* -* var v = isSameValue( z1, z2 ); -* // returns true -*/ -function isSameValue( z1, z2 ) { - var parts1 = reim( z1 ); - var parts2 = reim( z2 ); - return ( - isSame( parts1[ 0 ], parts2[ 0 ] ) && - isSame( parts1[ 1 ], parts2[ 1 ] ) - ); -} - - -// EXPORTS // - -module.exports = isSameValue; diff --git a/float64/base/assert/is-same-value/manifest.json b/float64/base/assert/is-same-value/manifest.json deleted file mode 100644 index 84cc73fb..00000000 --- a/float64/base/assert/is-same-value/manifest.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim", - "@stdlib/number/float64/base/assert/is-same-value" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim", - "@stdlib/number/float64/base/assert/is-same-value" - ] - } - ] -} diff --git a/float64/base/assert/is-same-value/package.json b/float64/base/assert/is-same-value/package.json deleted file mode 100644 index 9d869c03..00000000 --- a/float64/base/assert/is-same-value/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "name": "@stdlib/complex/float64/base/assert/is-same-value", - "version": "0.0.0", - "description": "Test whether two double-precision complex floating-point numbers are the same value.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "number", - "base", - "assert", - "test", - "validate", - "equality", - "compare", - "comparison", - "equal", - "eq", - "same", - "issame", - "issamevalue" - ] -} diff --git a/float64/base/assert/is-same-value/src/main.c b/float64/base/assert/is-same-value/src/main.c deleted file mode 100644 index 4bb8c6b2..00000000 --- a/float64/base/assert/is-same-value/src/main.c +++ /dev/null @@ -1,52 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/assert/is_same_value.h" -#include "stdlib/number/float64/base/assert/is_same_value.h" -#include "stdlib/complex/float64/reim.h" -#include "stdlib/complex/float64/ctor.h" -#include - -/** -* Tests whether two double-precision complex floating-point numbers are the same value. -* -* @param z1 first double-precision complex floating-point number -* @param z2 second double-precision complex floating-point number -* @return boolean indicating if both complex numbers are the same value -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* #include -* -* stdlib_complex128_t z1 = stdlib_complex128( 5.0, 2.0 ); -* stdlib_complex128_t z2 = stdlib_complex128( 5.0, 2.0 ); -* -* bool v = stdlib_base_complex128_is_same_value( z1, z2 ); -*/ -bool stdlib_base_complex128_is_same_value( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ) { - double re1; - double re2; - double im1; - double im2; - stdlib_complex128_reim( z1, &re1, &im1 ); - stdlib_complex128_reim( z2, &re2, &im2 ); - return ( - stdlib_base_float64_is_same_value( re1, re2 ) && - stdlib_base_float64_is_same_value( im1, im2 ) - ); -} diff --git a/float64/base/assert/is-same-value/test/test.js b/float64/base/assert/is-same-value/test/test.js deleted file mode 100644 index 73d754dc..00000000 --- a/float64/base/assert/is-same-value/test/test.js +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex128 = require( './../../../../../float64/ctor' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var isSameValue = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof isSameValue, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function tests whether two complex numbers are the same value (finite)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isSameValue( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 0.0, 0.0 ); - z2 = new Complex128( 0.0, 0.0 ); - t.strictEqual( isSameValue( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( -0.0, 0.0 ); - z2 = new Complex128( 0.0, 0.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 0.0, -0.0 ); - z2 = new Complex128( -0.0, 0.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 0.0, -0.0 ); - z2 = new Complex128( 0.0, -0.0 ); - t.strictEqual( isSameValue( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( -5.0, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -5.0, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, -3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, -3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether two complex numbers are the same value (infinite)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( PINF, NINF ); - t.strictEqual( isSameValue( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex128( PINF, NINF ); - z2 = new Complex128( PINF, NINF ); - t.strictEqual( isSameValue( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( NINF, 3.0 ); - z2 = new Complex128( PINF, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( PINF, 3.0 ); - z2 = new Complex128( NINF, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( PINF, -3.0 ); - z2 = new Complex128( PINF, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( PINF, 3.0 ); - z2 = new Complex128( PINF, -3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, PINF ); - z2 = new Complex128( 5.0, NINF ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether two complex numbers are the same value (NaNs)', function test( t ) { - var z1; - var z2; - - z1 = new Complex128( NaN, NaN ); - t.strictEqual( isSameValue( z1, z1 ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - t.strictEqual( isSameValue( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( NaN, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( 5.0, 3.0 ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( 5.0, NaN ); - t.strictEqual( isSameValue( z1, z2 ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( 5.0, NaN ); - t.strictEqual( isSameValue( z1, z2 ), false, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/assert/lib/index.js b/float64/base/assert/lib/index.js deleted file mode 100644 index 8ab6e951..00000000 --- a/float64/base/assert/lib/index.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/* -* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name. -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); - - -// MAIN // - -/** -* Top-level namespace. -* -* @namespace ns -*/ -var ns = {}; - -/** -* @name isAlmostEqual -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/base/assert/is-almost-equal} -*/ -setReadOnly( ns, 'isAlmostEqual', require( './../../../../float64/base/assert/is-almost-equal' ) ); - -/** -* @name isAlmostSameValue -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/base/assert/is-almost-same-value} -*/ -setReadOnly( ns, 'isAlmostSameValue', require( './../../../../float64/base/assert/is-almost-same-value' ) ); - -/** -* @name isEqual -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/base/assert/is-equal} -*/ -setReadOnly( ns, 'isEqual', require( './../../../../float64/base/assert/is-equal' ) ); - -/** -* @name isNotEqual -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/base/assert/is-not-equal} -*/ -setReadOnly( ns, 'isNotEqual', require( './../../../../float64/base/assert/is-not-equal' ) ); - -/** -* @name isSameValue -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/base/assert/is-same-value} -*/ -setReadOnly( ns, 'isSameValue', require( './../../../../float64/base/assert/is-same-value' ) ); - -/** -* @name isSameValueZero -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/base/assert/is-same-value-zero} -*/ -setReadOnly( ns, 'isSameValueZero', require( './../../../../float64/base/assert/is-same-value-zero' ) ); - - -// EXPORTS // - -module.exports = ns; diff --git a/float64/base/assert/package.json b/float64/base/assert/package.json deleted file mode 100644 index 0b50fc1b..00000000 --- a/float64/base/assert/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "@stdlib/complex/float64/base/assert", - "version": "0.0.0", - "description": "Base (i.e., lower-level) double-precision complex number assertion functions.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "lib/index.js", - "directories": { - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "types", - "complex", - "cmplx", - "number", - "namespace", - "ns", - "float64", - "base", - "assert" - ] -} diff --git a/float64/base/assert/test/test.js b/float64/base/assert/test/test.js deleted file mode 100644 index 2fbefe9d..00000000 --- a/float64/base/assert/test/test.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - - -// TESTS // - -tape( 'main export is an object', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ns, 'object', 'main export is an object' ); - t.end(); -}); - -tape( 'the exported object contains key-value pairs', function test( t ) { - var keys = objectKeys( ns ); - t.strictEqual( keys.length > 0, true, 'has keys' ); - t.end(); -}); diff --git a/float64/base/div/README.md b/float64/base/div/README.md deleted file mode 100644 index f88688d6..00000000 --- a/float64/base/div/README.md +++ /dev/null @@ -1,304 +0,0 @@ - - -# cdiv - -> Divide two double-precision complex floating-point numbers. - -
- -
- - - -
- -## Usage - -```javascript -var cdiv = require( '@stdlib/complex/float64/base/div' ); -``` - -#### cdiv( z1, z2 ) - -Divides two double-precision complex floating-point numbers. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( -13.0, -1.0 ); -var z2 = new Complex128( -2.0, 1.0 ); - -var v = cdiv( z1, z2 ); -// returns [ 5.0, 3.0 ] -``` - -#### cdiv.assign( re1, im1, re2, im2, out, strideOut, offsetOut ) - -Divides two double-precision complex floating-point numbers and assigns results to a provided output array. - -```javascript -var Float64Array = require( '@stdlib/array/float64' ); - -var out = new Float64Array( 2 ); -var v = cdiv.assign( -13.0, -1.0, -2.0, 1.0, out, 1, 0 ); -// returns [ 5.0, 3.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **re1**: real component of the first complex number. -- **im1**: imaginary component of the first complex number. -- **re2**: real component of the second complex number. -- **im2**: imaginary component of the second complex number. -- **out**: output array. -- **strideOut**: stride length for `out`. -- **offsetOut**: starting index for `out`. - -#### cdiv.strided( z1, sz1, oz1, z2, sz2, oz2, out, so, oo ) - -Divides two double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. - -```javascript -var Float64Array = require( '@stdlib/array/float64' ); - -var z1 = new Float64Array( [ -13.0, -1.0 ] ); -var z2 = new Float64Array( [ -2.0, 1.0 ] ); -var out = new Float64Array( 2 ); - -var v = cdiv.strided( z1, 1, 0, z2, 1, 0, out, 1, 0 ); -// returns [ 5.0, 3.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **z1**: first complex number strided array view. -- **sz1**: stride length for `z1`. -- **oz1**: starting index for `z1`. -- **z2**: second complex number strided array view. -- **sz2**: stride length for `z2`. -- **oz2**: starting index for `z2`. -- **out**: output array. -- **so**: stride length for `out`. -- **oo**: starting index for `out`. - -
- - - -
- -## Examples - - - -```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var cdiv = require( '@stdlib/complex/float64/base/div' ); - -// Generate arrays of random values: -var z1 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise division: -logEachMap( '(%s) / (%s) = %s', z1, z2, cdiv ); -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float64/base/div.h" -``` - -#### stdlib_base_complex128_div( z1, z2 ) - -Divides two double-precision complex floating-point numbers. - -```c -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/imag.h" - -stdlib_complex128_t z1 = stdlib_complex128( -13.0, -1.0 ); -stdlib_complex128_t z2 = stdlib_complex128( -2.0, 1.0 ); - -stdlib_complex128_t out = stdlib_base_complex128_div( z1, z2 ); - -double re = stdlib_complex128_real( out ); -// returns 5.0 - -double im = stdlib_complex128_imag( out ); -// returns 3.0 -``` - -The function accepts the following arguments: - -- **z1**: `[in] stdlib_complex128_t` input value. -- **z2**: `[in] stdlib_complex128_t` input value. - -```c -stdlib_complex128_t stdlib_base_complex128_div( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float64/base/div.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 3.14, 1.5 ), - stdlib_complex128( -3.14, 1.5 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - stdlib_complex128_t y; - double re; - double im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex128_reim( v, &re, &im ); - printf( "z = %lf + %lfi\n", re, im ); - - y = stdlib_base_complex128_div( v, v ); - stdlib_complex128_reim( y, &re, &im ); - printf( "cdiv(z, z) = %lf + %lfi\n", re, im ); - } -} -``` - -
- - - -
- - - -* * * - -
- -## References - -- Smith, Robert L. 1962. "Algorithm 116: Complex Division." _Commun. ACM_ 5 (8). New York, NY, USA: ACM: 435. doi:[10.1145/368637.368661][@smith:1962a]. -- Stewart, G. W. 1985. "A Note on Complex Division." _ACM Trans. Math. Softw._ 11 (3). New York, NY, USA: ACM: 238–41. doi:[10.1145/214408.214414][@stewart:1985a]. -- Priest, Douglas M. 2004. "Efficient Scaling for Complex Division." _ACM Trans. Math. Softw._ 30 (4). New York, NY, USA: ACM: 389–401. doi:[10.1145/1039813.1039814][@priest:2004a]. -- Baudin, Michael, and Robert L. Smith. 2012. "A Robust Complex Division in Scilab." _arXiv_ abs/1210.4539 \[cs.MS] (October): 1–25. [<https://arxiv.org/abs/1210.4539>][@baudin:2012a]. - -
- - - - - - - - - - - - - - diff --git a/float64/base/div/benchmark/benchmark.assign.js b/float64/base/div/benchmark/benchmark.assign.js deleted file mode 100644 index b4ee0278..00000000 --- a/float64/base/div/benchmark/benchmark.assign.js +++ /dev/null @@ -1,70 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Float64Array = require( '@stdlib/array/float64' ); -var pkg = require( './../package.json' ).name; -var cdiv = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float64' -}; - - -// MAIN // - -bench( pkg+':assign', function benchmark( b ) { - var out; - var re; - var im; - var N; - var i; - var j; - var k; - - N = 100; - re = uniform( N, -500.0, 500.0, options ); - im = uniform( N, -500.0, 500.0, options ); - - out = new Float64Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = i % N; - k = ( i+1 ) % N; - out = cdiv.assign( re[ j ], im[ j ], re[ k ], im[ k ], out, 1, 0 ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( out[ 0 ] ) || isnan( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/div/benchmark/benchmark.js b/float64/base/div/benchmark/benchmark.js deleted file mode 100644 index 42c6e203..00000000 --- a/float64/base/div/benchmark/benchmark.js +++ /dev/null @@ -1,111 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex128 = require( './../../../../float64/ctor' ); -var isComplex128 = require( '@stdlib/assert/is-complex128' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var pkg = require( './../package.json' ).name; -var cdiv = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var y; - var i; - var z; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i % values.length ]; - y = cdiv( z, z ); - if ( typeof y !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isComplex128( y ) ) { - b.fail( 'should return a Complex128' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::smiths_algorithm', function benchmark( b ) { - var values; - var y; - var i; - var z; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i % values.length ]; - y = cdiv( z, z ); - if ( typeof y !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isComplex128( y ) ) { - b.fail( 'should return a Complex128' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function cdiv( z1, z2 ) { - var re1; - var re2; - var im1; - var im2; - var a; - var b; - - re1 = real( z1 ); - re2 = real( z2 ); - im1 = imag( z1 ); - im2 = imag( z2 ); - - if ( abs( re2 ) >= abs( im2 ) ) { - a = im2 / re2; - b = re2 + ( im2 * a ); - return new Complex128( ( re1 + (im1 * a) )/b, (im1 - (re1*a) )/b ); - } - a = re2 / im2; - b = ( re2 * a ) + im2; - return new Complex128( ( (re1*a) + im1 )/b, ( (im1*a) - re1 )/b ); - } -}); diff --git a/float64/base/div/benchmark/benchmark.native.js b/float64/base/div/benchmark/benchmark.native.js deleted file mode 100644 index b322291a..00000000 --- a/float64/base/div/benchmark/benchmark.native.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); -var pkg = require( './../package.json' ).name; - - -// VARIABLES // - -var cdiv = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( cdiv instanceof Error ) -}; - - -// MAIN // - -bench( pkg+'::native', opts, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = cdiv( z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( real( out ) ) || isnan( imag( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/div/benchmark/benchmark.strided.js b/float64/base/div/benchmark/benchmark.strided.js deleted file mode 100644 index 0d098653..00000000 --- a/float64/base/div/benchmark/benchmark.strided.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Float64Array = require( '@stdlib/array/float64' ); -var pkg = require( './../package.json' ).name; -var cdiv = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float64' -}; - - -// MAIN // - -bench( pkg+':strided', function benchmark( b ) { - var out; - var z1; - var z2; - var N; - var i; - var j; - - N = 50; - z1 = uniform( N*2, -500.0, 500.0, options ); - z2 = uniform( N*2, -500.0, 500.0, options ); - - out = new Float64Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = ( i % N ) * 2; - out = cdiv.strided( z1, 1, j, z2, 1, j, out, 1, 0 ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( out[ 0 ] ) || isnan( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/div/benchmark/c/Makefile b/float64/base/div/benchmark/c/Makefile deleted file mode 100644 index e64c0050..00000000 --- a/float64/base/div/benchmark/c/Makefile +++ /dev/null @@ -1,127 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler -# @param {string} [CFLAGS] - C compiler flags -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/div/benchmark/c/benchmark.c b/float64/base/div/benchmark/c/benchmark.c deleted file mode 100644 index e86a7686..00000000 --- a/float64/base/div/benchmark/c/benchmark.c +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include -#include -#include -#include - -#define NAME "cdiv" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double re; - double im; - double t; - int i; - - double complex z1; - double complex z2; - double complex z3; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z1 = re + im*I; - - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z2 = re + im*I; - - z3 = z1 / z2; - if ( z3 != z3 ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( z3 != z3 ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/base/div/benchmark/c/native/Makefile b/float64/base/div/benchmark/c/native/Makefile deleted file mode 100644 index 3cbfe3fe..00000000 --- a/float64/base/div/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/div/benchmark/c/native/benchmark.c b/float64/base/div/benchmark/c/native/benchmark.c deleted file mode 100644 index 2c36de56..00000000 --- a/float64/base/div/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,147 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/div.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include -#include -#include -#include -#include - -#define NAME "cdiv" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double re; - double im; - double t; - int i; - - stdlib_complex128_t z1; - stdlib_complex128_t z2; - stdlib_complex128_t z3; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z1 = stdlib_complex128( re, im ); - - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z2 = stdlib_complex128( re, im ); - - z3 = stdlib_base_complex128_div( z1, z2 ); - stdlib_complex128_reim( z3, &re, &im ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/base/div/benchmark/julia/REQUIRE b/float64/base/div/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float64/base/div/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float64/base/div/benchmark/julia/benchmark.jl b/float64/base/div/benchmark/julia/benchmark.jl deleted file mode 100644 index 32223ab3..00000000 --- a/float64/base/div/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "divide"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark ComplexF64( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) / ComplexF64( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float64/base/div/binding.gyp b/float64/base/div/binding.gyp deleted file mode 100644 index f2b466ae..00000000 --- a/float64/base/div/binding.gyp +++ /dev/null @@ -1,170 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A `.gyp` file for building a Node.js native add-on. -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # List of files to include in this file: - 'includes': [ - './include.gypi', - ], - - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Target name should match the add-on export name: - 'addon_target_name%': 'addon', - - # Set variables based on the host OS: - 'conditions': [ - [ - 'OS=="win"', - { - # Define the object file suffix: - 'obj': 'obj', - }, - { - # Define the object file suffix: - 'obj': 'o', - } - ], # end condition (OS=="win") - ], # end conditions - }, # end variables - - # Define compile targets: - 'targets': [ - - # Target to generate an add-on: - { - # The target name should match the add-on export name: - 'target_name': '<(addon_target_name)', - - # Define dependencies: - 'dependencies': [], - - # Define directories which contain relevant include headers: - 'include_dirs': [ - # Local include directory: - '<@(include_dirs)', - ], - - # List of source files: - 'sources': [ - '<@(src_files)', - ], - - # Settings which should be applied when a target's object files are used as linker input: - 'link_settings': { - # Define libraries: - 'libraries': [ - '<@(libraries)', - ], - - # Define library directories: - 'library_dirs': [ - '<@(library_dirs)', - ], - }, - - # C/C++ compiler flags: - 'cflags': [ - # Enable commonly used warning options: - '-Wall', - - # Aggressive optimization: - '-O3', - ], - - # C specific compiler flags: - 'cflags_c': [ - # Specify the C standard to which a program is expected to conform: - '-std=c99', - ], - - # C++ specific compiler flags: - 'cflags_cpp': [ - # Specify the C++ standard to which a program is expected to conform: - '-std=c++11', - ], - - # Linker flags: - 'ldflags': [], - - # Apply conditions based on the host OS: - 'conditions': [ - [ - 'OS=="mac"', - { - # Linker flags: - 'ldflags': [ - '-undefined dynamic_lookup', - '-Wl,-no-pie', - '-Wl,-search_paths_first', - ], - }, - ], # end condition (OS=="mac") - [ - 'OS!="win"', - { - # C/C++ flags: - 'cflags': [ - # Generate platform-independent code: - '-fPIC', - ], - }, - ], # end condition (OS!="win") - ], # end conditions - }, # end target <(addon_target_name) - - # Target to copy a generated add-on to a standard location: - { - 'target_name': 'copy_addon', - - # Declare that the output of this target is not linked: - 'type': 'none', - - # Define dependencies: - 'dependencies': [ - # Require that the add-on be generated before building this target: - '<(addon_target_name)', - ], - - # Define a list of actions: - 'actions': [ - { - 'action_name': 'copy_addon', - 'message': 'Copying addon...', - - # Explicitly list the inputs in the command-line invocation below: - 'inputs': [], - - # Declare the expected outputs: - 'outputs': [ - '<(addon_output_dir)/<(addon_target_name).node', - ], - - # Define the command-line invocation: - 'action': [ - 'cp', - '<(PRODUCT_DIR)/<(addon_target_name).node', - '<(addon_output_dir)/<(addon_target_name).node', - ], - }, - ], # end actions - }, # end target copy_addon - ], # end targets -} diff --git a/float64/base/div/docs/repl.txt b/float64/base/div/docs/repl.txt deleted file mode 100644 index b68fa023..00000000 --- a/float64/base/div/docs/repl.txt +++ /dev/null @@ -1,119 +0,0 @@ - -{{alias}}( z1, z2 ) - Divides two double-precision complex floating-point numbers. - - Parameters - ---------- - z1: Complex128 - Complex number. - - z2: Complex128 - Complex number. - - Returns - ------- - out: Complex128 - Result. - - Examples - -------- - > var z1 = new {{alias:@stdlib/complex/float64/ctor}}( -13.0, -1.0 ) - - > var z2 = new {{alias:@stdlib/complex/float64/ctor}}( -2.0, 1.0 ) - - > var y = {{alias}}( z1, z2 ) - - > var re = {{alias:@stdlib/complex/float64/real}}( y ) - 5.0 - > var im = {{alias:@stdlib/complex/float64/imag}}( y ) - 3.0 - - -{{alias}}.assign( re1, im1, re2, im2, out, strideOut, offsetOut ) - Divides two double-precision complex floating-point numbers and assigns - results to a provided output array. - - Parameters - ---------- - re1: number - Real component of the first complex number. - - im1: number - Imaginary component of the first complex number. - - re2: number - Real component of the second complex number. - - im2: number - Imaginary component of the second complex number. - - out: ArrayLikeObject - Output array. - - strideOut: integer - Stride length. - - offsetOut: integer - Starting index. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var out = new {{alias:@stdlib/array/float64}}( 2 ); - > {{alias}}.assign( -13.0, -1.0, -2.0, 1.0, out, 1, 0 ) - [ 5.0, 3.0 ] - - -{{alias}}.strided( z1, sz1, oz1, z2, sz2, oz2, out, so, oo ) - Divides two double-precision complex floating-point numbers stored in real- - valued strided array views and assigns results to a provided strided output - array. - - Parameters - ---------- - z1: ArrayLikeObject - First complex number view. - - sz1: integer - Stride length for `z1`. - - oz1: integer - Starting index for `z1`. - - z2: ArrayLikeObject - Second complex number view. - - sz2: integer - Stride length for `z2`. - - oz2: integer - Starting index for `z2`. - - out: ArrayLikeObject - Output array. - - so: integer - Stride length for `out`. - - oo: integer - Starting index for `out`. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var z1 = new {{alias:@stdlib/array/float64}}( [ -13.0, -1.0 ] ); - > var z2 = new {{alias:@stdlib/array/float64}}( [ -2.0, 1.0 ] ); - > var out = new {{alias:@stdlib/array/float64}}( 2 ); - > {{alias}}.strided( z1, 1, 0, z2, 1, 0, out, 1, 0 ) - [ 5.0, 3.0 ] - - See Also - -------- diff --git a/float64/base/div/docs/types/index.d.ts b/float64/base/div/docs/types/index.d.ts deleted file mode 100644 index 6a0e6f85..00000000 --- a/float64/base/div/docs/types/index.d.ts +++ /dev/null @@ -1,119 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex128 } from '@stdlib/types/complex'; -import { Collection, NumericArray } from '@stdlib/types/array'; - -/** -* Interface for dividing two double-precision complex floating-point numbers. -*/ -interface Cdiv { - /** - * Divides two double-precision complex floating-point numbers. - * - * @param z1 - complex number - * @param z2 - complex number - * @returns result - * - * @example - * var Complex128 = require( './../../../../../float64/ctor' ); - * - * var z1 = new Complex128( -13.0, -1.0 ); - * var z2 = new Complex128( -2.0, 1.0 ); - * - * var out = cdiv( z1, z2 ); - * // returns [ 5.0, 3.0 ] - */ - ( z1: Complex128, z2: Complex128 ): Complex128; - - /** - * Divides two double-precision complex floating-point numbers and assigns results to a provided output array. - * - * @param re1 - real component of the first complex number - * @param im1 - imaginary component of the first complex number - * @param re2 - real component of the second complex number - * @param im2 - imaginary component of the second complex number - * @param out - output array - * @param strideOut - stride length - * @param offsetOut - starting index - * @returns output array - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var out = new Float64Array( 2 ); - * var v = cdiv.assign( -13.0, -1.0, -2.0, 1.0, out, 1, 0 ); - * // returns [ 5.0, 3.0 ] - * - * var bool = ( out === v ); - * // returns true - */ - assign>( re1: number, im1: number, re2: number, im2: number, out: T, strideOut: number, offsetOut: number ): T; - - /** - * Divides two double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. - * - * @param z1 - first complex number view - * @param strideZ1 - stride length for `z1` - * @param offsetZ1 - starting index for `z1` - * @param z2 - second complex number view - * @param strideZ2 - stride length for `z2` - * @param offsetZ2 - starting index for `z2` - * @param out - output array - * @param strideOut - stride length for `out` - * @param offsetOut - starting index for `out` - * @returns output array - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var z1 = new Float64Array( [ -13.0, -1.0 ] ); - * var z2 = new Float64Array( [ -2.0, 1.0 ] ); - * - * var out = cdiv.strided( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - * // returns [ 5.0, 3.0 ] - */ - strided, U extends NumericArray | Collection, V extends NumericArray | Collection>( z1: T, strideZ1: number, offsetZ1: number, z2: U, strideZ2: number, offsetZ2: number, out: V, strideOut: number, offsetOut: number ): V; -} - -/** -* Divides two double-precision complex floating-point numbers. -* -* @param z1 - complex number -* @param z2 - complex number -* @returns result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( -13.0, -1.0 ); -* var z2 = new Complex128( -2.0, 1.0 ); -* -* var out = cdiv( z1, z2 ); -* // returns [ 5.0, 3.0 ] -*/ -declare var cdiv: Cdiv; - - -// EXPORTS // - -export = cdiv; diff --git a/float64/base/div/docs/types/test.ts b/float64/base/div/docs/types/test.ts deleted file mode 100644 index 5eac8e3b..00000000 --- a/float64/base/div/docs/types/test.ts +++ /dev/null @@ -1,357 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../../float64/ctor' ); -import cdiv = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - cdiv( z, z ); // $ExpectType Complex128 -} - -// The compiler throws an error if the function is provided a first argument which is not a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - cdiv( true, z ); // $ExpectError - cdiv( false, z ); // $ExpectError - cdiv( null, z ); // $ExpectError - cdiv( undefined, z ); // $ExpectError - cdiv( '5', z ); // $ExpectError - cdiv( [], z ); // $ExpectError - cdiv( {}, z ); // $ExpectError - cdiv( ( x: number ): number => x, z ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument which is not a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - cdiv( z, true ); // $ExpectError - cdiv( z, false ); // $ExpectError - cdiv( z, null ); // $ExpectError - cdiv( z, undefined ); // $ExpectError - cdiv( z, '5' ); // $ExpectError - cdiv( z, [] ); // $ExpectError - cdiv( z, {} ); // $ExpectError - cdiv( z, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z = new Complex128( 1.0, 1.0 ); - - cdiv(); // $ExpectError - cdiv( z ); // $ExpectError - cdiv( z, z, z ); // $ExpectError -} - -// Attached to the main export is an `assign` method which returns a collection... -{ - cdiv.assign( 1.0, 1.0, 1.0, 1.0, new Float64Array( 2 ), 1, 0 ); // $ExpectType Float64Array - cdiv.assign( 1.0, 1.0, 1.0, 1.0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - cdiv.assign( 1.0, 1.0, 1.0, 1.0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `assign` method is provided a first argument which is not a number... -{ - const out = new Float64Array( 2 ); - - cdiv.assign( true, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( false, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( null, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( undefined, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( '5', 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( [], 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( {}, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( ( x: number ): number => x, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a second argument which is not a number... -{ - const out = new Float64Array( 2 ); - - cdiv.assign( 1.0, true, 3.0, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, false, 3.0, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, null, 3.0, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, undefined, 3.0, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, '5', 3.0, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, [], 3.0, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, {}, 3.0, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, ( x: number ): number => x, 3.0, 4.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a third argument which is not a number... -{ - const out = new Float64Array( 2 ); - - cdiv.assign( 1.0, 2.0, true, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, false, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, null, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, undefined, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, '5', 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, [], 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, {}, 4.0, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, ( x: number ): number => x, 4.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fourth argument which is not a number... -{ - const out = new Float64Array( 2 ); - - cdiv.assign( 1.0, 2.0, 3.0, true, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, false, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, null, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, undefined, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, '5', out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, [], out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, {}, out, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fifth argument which is not a collection... -{ - cdiv.assign( 1.0, 2.0, 3.0, 4.0, 1, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, true, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, false, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, null, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, undefined, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, '5', 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, [ '5' ], 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, {}, 1, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a sixth argument which is not a number... -{ - const out = new Float64Array( 2 ); - - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out, true, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out, false, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out, null, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out, undefined, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out, '5', 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out, [], 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out, {}, 0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a seventh argument which is not a number... -{ - const out = new Float64Array( 2 ); - - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out, 1, true ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out, 1, false ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out, 1, null ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out, 1, undefined ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out, 1, '5' ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out, 1, [] ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out, 1, {} ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided an unsupported number of arguments... -{ - const out = new Float64Array( 2 ); - - cdiv.assign(); // $ExpectError - cdiv.assign( 1.0 ); // $ExpectError - cdiv.assign( 1.0, 2.0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out, 1 ); // $ExpectError - cdiv.assign( 1.0, 2.0, 3.0, 4.0, out, 1, 0, {} ); // $ExpectError -} - -// Attached to the main export is a `strided` method which returns a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - - cdiv.strided( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); // $ExpectType Float64Array - cdiv.strided( z1, 1, 0, z2, 1, 0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - cdiv.strided( z1, 1, 0, z2, 1, 0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `strided` method is provided a first argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - cdiv.strided( true, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( false, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( null, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( undefined, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( '5', 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( [ '5' ], 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( {}, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( ( x: number ): number => x, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a second argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - cdiv.strided( z1, true, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, false, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, null, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, undefined, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, '5', 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, [], 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, {}, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, ( x: number ): number => x, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a third argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( 2 ); - - cdiv.strided( z1, 1, true, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, false, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, null, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, undefined, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, '5', z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, [], z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, {}, z2, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, ( x: number ): number => x, z2, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fourth argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - cdiv.strided( z1, 1, 0, true, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, false, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, null, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, undefined, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, '5', 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, [ '5' ], 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, {}, 1, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, ( x: number ): number => x, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fifth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - cdiv.strided( z1, 1, 0, z2, true, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, false, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, null, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, undefined, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, '5', 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, [], 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, {}, 0, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, ( x: number ): number => x, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a sixth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - cdiv.strided( z1, 1, 0, z2, 1, true, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, false, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, null, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, undefined, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, '5', out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, [], out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, {}, out, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a seventh argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - - cdiv.strided( z1, 1, 0, z2, 1, 0, 1, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, true, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, false, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, null, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, undefined, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, '5', 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, [ '5' ], 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, {}, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an eighth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - cdiv.strided( z1, 1, 0, z2, 1, 0, out, true, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, out, false, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, out, null, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, out, undefined, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, out, '5', 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, out, [], 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, out, {}, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a ninth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - cdiv.strided( z1, 1, 0, z2, 1, 0, out, 1, true ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, out, 1, false ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, out, 1, null ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, out, 1, undefined ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, out, 1, '5' ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, out, 1, [] ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, out, 1, {} ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an unsupported number of arguments... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - cdiv.strided(); // $ExpectError - cdiv.strided( z1 ); // $ExpectError - cdiv.strided( z1, 1 ); // $ExpectError - cdiv.strided( z1, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, out ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, out, 1 ); // $ExpectError - cdiv.strided( z1, 1, 0, z2, 1, 0, out, 1, 0, {} ); // $ExpectError -} diff --git a/float64/base/div/examples/c/Makefile b/float64/base/div/examples/c/Makefile deleted file mode 100644 index f0ae66fe..00000000 --- a/float64/base/div/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/div/examples/c/example.c b/float64/base/div/examples/c/example.c deleted file mode 100644 index 5689a9c1..00000000 --- a/float64/base/div/examples/c/example.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/div.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 3.14, 1.5 ), - stdlib_complex128( -3.14, 1.5 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - stdlib_complex128_t y; - double re; - double im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex128_reim( v, &re, &im ); - printf( "z = %lf + %lfi\n", re, im ); - - y = stdlib_base_complex128_div( v, v ); - stdlib_complex128_reim( y, &re, &im ); - printf( "cdiv(z, z) = %lf + %lfi\n", re, im ); - } -} diff --git a/float64/base/div/examples/index.js b/float64/base/div/examples/index.js deleted file mode 100644 index 52635ad5..00000000 --- a/float64/base/div/examples/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128Array = require( '@stdlib/array/complex128' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var cdiv = require( './../lib' ); - -// Generate arrays of random values: -var z1 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise division: -logEachMap( '(%s) / (%s) = %s', z1, z2, cdiv ); diff --git a/float64/base/div/include.gypi b/float64/base/div/include.gypi deleted file mode 100644 index 78db9faf..00000000 --- a/float64/base/div/include.gypi +++ /dev/null @@ -1,53 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A GYP include file for building a Node.js native add-on. -# -# Main documentation: -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Source directory: - 'src_dir': './src', - - # Include directories: - 'include_dirs': [ - '[ 5.0, 3.0 ] -*/ -function assign( re1, im1, re2, im2, out, strideOut, offsetOut ) { - var res; - var ab; - var cd; - var s; - - ab = max( abs(re1), abs(im1) ); - cd = max( abs(re2), abs(im2) ); - s = 1.0; - - if ( ab >= LARGE_THRESHOLD ) { - re1 *= 0.5; - im1 *= 0.5; - s *= 2.0; - } else if ( ab <= SMALL_THRESHOLD ) { - re1 *= RECIP_EPS_SQR; - im1 *= RECIP_EPS_SQR; - s /= RECIP_EPS_SQR; - } - if ( cd >= LARGE_THRESHOLD ) { - re2 *= 0.5; - im2 *= 0.5; - s *= 0.5; - } else if ( cd <= SMALL_THRESHOLD ) { - re2 *= RECIP_EPS_SQR; - im2 *= RECIP_EPS_SQR; - s *= RECIP_EPS_SQR; - } - - if ( abs( im2 ) <= abs( re2 ) ) { - res = robustInternal( re1, im1, re2, im2 ); - } else { - res = robustInternal( im1, re1, im2, re2 ); - res[ 1 ] *= -1.0; - } - - res[ 0 ] *= s; - res[ 1 ] *= s; - - out[ offsetOut ] = res[ 0 ]; - out[ offsetOut+strideOut ] = res[ 1 ]; - - return out; -} - - -// EXPORTS // - -module.exports = assign; diff --git a/float64/base/div/lib/index.js b/float64/base/div/lib/index.js deleted file mode 100644 index 9b4d9ad9..00000000 --- a/float64/base/div/lib/index.js +++ /dev/null @@ -1,55 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Divide two double-precision complex floating-point numbers. -* -* @module @stdlib/complex/float64/base/div -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var cdiv = require( '@stdlib/complex/float64/base/div' ); -* -* var z1 = new Complex128( -13.0, -1.0 ); -* var z2 = new Complex128( -2.0, 1.0 ); -* -* var out = cdiv( z1, z2 ); -* // returns [ 5.0, 3.0 ] -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var main = require( './main.js' ); -var assign = require( './assign.js' ); -var strided = require( './strided.js' ); - - -// MAIN // - -setReadOnly( main, 'assign', assign ); -setReadOnly( main, 'strided', strided ); - - -// EXPORTS // - -module.exports = main; - -// exports: { "assign": "main.assign", "strided": "main.strided" } diff --git a/float64/base/div/lib/internal_compreal.js b/float64/base/div/lib/internal_compreal.js deleted file mode 100644 index ef46ec4e..00000000 --- a/float64/base/div/lib/internal_compreal.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Computes the real part of the quotient. -* -* ## Notes -* -* - See figure 10 of [Baudin (2012)][@baudin:2012]. -* -* [@baudin:2012]: https://arxiv.org/abs/1210.4539 -* -* @private -* @param {number} re1 - real component -* @param {number} im1 - imaginary component -* @param {number} re2 - real component -* @param {number} im2 - imaginary component -* @param {number} r - partial result -* @param {number} t - partial result -* @returns {number} real part of the quotient -*/ -function internalCompreal( re1, im1, re2, im2, r, t ) { - var br; - if ( r === 0.0 ) { - return ( re1 + (im2 * (im1/re2)) ) * t; - } - br = im1 * r; - if ( br === 0.0 ) { - return ( re1*t ) + ( (im1*t) * r ); - } - return ( re1+br ) * t; -} - - -// EXPORTS // - -module.exports = internalCompreal; diff --git a/float64/base/div/lib/main.js b/float64/base/div/lib/main.js deleted file mode 100644 index 072254bd..00000000 --- a/float64/base/div/lib/main.js +++ /dev/null @@ -1,76 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var Float64Array = require( '@stdlib/array/float64' ); -var Complex128 = require( './../../../../float64/ctor' ); -var assign = require( './assign.js' ); - - -// VARIABLES // - -var out = new Float64Array( 2 ); - - -// MAIN // - -/** -* Divides two double-precision complex floating-point numbers. -* -* ## References -* -* - Baudin, Michael, and Robert L. Smith. 2012. "A Robust Complex Division in Scilab." _arXiv_ abs/1210.4539 \[cs.MS\] (October): 1–25. . -* -* @param {Complex128} z1 - complex number -* @param {Complex128} z2 - complex number -* @returns {Complex128} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( -13.0, -1.0 ); -* var z2 = new Complex128( -2.0, 1.0 ); -* -* var out = cdiv( z1, z2 ); -* // returns [ 5.0, 3.0 ] -*/ -function cdiv( z1, z2 ) { - var re1; - var re2; - var im1; - var im2; - - re1 = real( z1 ); - re2 = real( z2 ); - im1 = imag( z1 ); - im2 = imag( z2 ); - - out = assign( re1, im1, re2, im2, out, 1, 0 ); - - return new Complex128( out[ 0 ], out[ 1 ] ); -} - - -// EXPORTS // - -module.exports = cdiv; diff --git a/float64/base/div/lib/native.js b/float64/base/div/lib/native.js deleted file mode 100644 index fc6ea6a2..00000000 --- a/float64/base/div/lib/native.js +++ /dev/null @@ -1,54 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex128 = require( './../../../../float64/ctor' ); -var addon = require( './../src/addon.node' ); - - -// MAIN // - -/** -* Divides two double-precision complex floating-point numbers. -* -* @private -* @param {Complex128} z1 - complex number -* @param {Complex128} z2 - complex number -* @returns {Complex128} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( -13.0, -1.0 ); -* var z2 = new Complex128( -2.0, 1.0 ); -* -* var out = cdiv( z1, z2 ); -* // returns [ 5.0, 3.0 ] -*/ -function cdiv( z1, z2 ) { - var v = addon( z1, z2 ); - return new Complex128( v.re, v.im ); -} - - -// EXPORTS // - -module.exports = cdiv; diff --git a/float64/base/div/lib/robust_internal.js b/float64/base/div/lib/robust_internal.js deleted file mode 100644 index 81a6ce90..00000000 --- a/float64/base/div/lib/robust_internal.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var internalCompreal = require( './internal_compreal.js' ); - - -// MAIN // - -/** -* Computes the complex division. -* -* ## Notes -* -* - See figure 10 of [reference][@baudin:2012]. -* -* [@baudin:2012]: https://arxiv.org/abs/1210.4539 -* -* @private -* @param {number} re1 - real component -* @param {number} im1 - imaginary component -* @param {number} re2 - real component -* @param {number} im2 - imaginary component -* @returns {Array} result -*/ -function robustInternal( re1, im1, re2, im2 ) { - var out; - var r; - var t; - - out = [ 0.0, 0.0 ]; - r = im2 / re2; - t = 1.0 / ( re2 + (im2*r) ); - - out[ 0 ] = internalCompreal( re1, im1, re2, im2, r, t ); - out[ 1 ] = internalCompreal( im1, -re1, re2, im2, r, t ); - return out; -} - - -// EXPORTS // - -module.exports = robustInternal; diff --git a/float64/base/div/lib/strided.js b/float64/base/div/lib/strided.js deleted file mode 100644 index d5f0f36e..00000000 --- a/float64/base/div/lib/strided.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var assign = require( './assign.js' ); - - -// MAIN // - -/** -* Divides two double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. -* -* @param {Float64Array} z1 - first complex number view -* @param {integer} strideZ1 - stride length for `z1` -* @param {NonNegativeInteger} offsetZ1 - starting index for `z1` -* @param {Float64Array} z2 - second complex number view -* @param {integer} strideZ2 - stride length for `z2` -* @param {NonNegativeInteger} offsetZ2 - starting index for `z2` -* @param {Collection} out - output array -* @param {integer} strideOut - stride length for `out` -* @param {NonNegativeInteger} offsetOut - starting index for `out` -* @returns {Collection} output array -* -* @example -* var Float64Array = require( '@stdlib/array/float64' ); -* -* var z1 = new Float64Array( [ -13.0, -1.0 ] ); -* var z2 = new Float64Array( [ -2.0, 1.0 ] ); -* -* var out = strided( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); -* // returns [ 5.0, 3.0 ] -*/ -function strided( z1, strideZ1, offsetZ1, z2, strideZ2, offsetZ2, out, strideOut, offsetOut ) { // eslint-disable-line max-len - return assign( z1[ offsetZ1 ], z1[ offsetZ1+strideZ1 ], z2[ offsetZ2 ], z2[ offsetZ2+strideZ2 ], out, strideOut, offsetOut ); // eslint-disable-line max-len -} - - -// EXPORTS // - -module.exports = strided; diff --git a/float64/base/div/manifest.json b/float64/base/div/manifest.json deleted file mode 100644 index 28959ad2..00000000 --- a/float64/base/div/manifest.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/napi/binary", - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim", - "@stdlib/math/base/special/abs", - "@stdlib/constants/float64/max", - "@stdlib/constants/float64/eps", - "@stdlib/constants/float64/smallest-normal" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim", - "@stdlib/math/base/special/abs", - "@stdlib/constants/float64/max", - "@stdlib/constants/float64/eps", - "@stdlib/constants/float64/smallest-normal" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim", - "@stdlib/math/base/special/abs", - "@stdlib/constants/float64/max", - "@stdlib/constants/float64/eps", - "@stdlib/constants/float64/smallest-normal" - ] - } - ] -} diff --git a/float64/base/div/package.json b/float64/base/div/package.json deleted file mode 100644 index 5a1a4105..00000000 --- a/float64/base/div/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "@stdlib/complex/float64/base/div", - "version": "0.0.0", - "description": "Divide two complex numbers.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "cdiv", - "div", - "divide", - "division", - "arithmetic", - "complex", - "cmplx", - "number" - ] -} diff --git a/float64/base/div/src/Makefile b/float64/base/div/src/Makefile deleted file mode 100644 index 904c7dc4..00000000 --- a/float64/base/div/src/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - - -# RULES # - -#/ -# Removes generated files for building an add-on. -# -# @example -# make clean-addon -#/ -clean-addon: - $(QUIET) -rm -f *.o *.node - -.PHONY: clean-addon - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: clean-addon - -.PHONY: clean diff --git a/float64/base/div/src/addon.c b/float64/base/div/src/addon.c deleted file mode 100644 index e25a87b4..00000000 --- a/float64/base/div/src/addon.c +++ /dev/null @@ -1,22 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/div.h" -#include "stdlib/math/base/napi/binary.h" - -STDLIB_MATH_BASE_NAPI_MODULE_ZZ_Z( stdlib_base_complex128_div ) diff --git a/float64/base/div/src/main.c b/float64/base/div/src/main.c deleted file mode 100644 index 97fc2f76..00000000 --- a/float64/base/div/src/main.c +++ /dev/null @@ -1,173 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/div.h" -#include "stdlib/math/base/special/abs.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include "stdlib/constants/float64/max.h" -#include "stdlib/constants/float64/eps.h" -#include "stdlib/constants/float64/smallest_normal.h" - -static const double LARGE_THRESHOLD = STDLIB_CONSTANT_FLOAT64_MAX * 0.5; -static const double SMALL_THRESHOLD = STDLIB_CONSTANT_FLOAT64_SMALLEST_NORMAL * ( 2.0 / STDLIB_CONSTANT_FLOAT64_EPS ); -static const double RECIP_EPS_SQR = 2.0 / ( STDLIB_CONSTANT_FLOAT64_EPS * STDLIB_CONSTANT_FLOAT64_EPS ); - -/** -* Computes the real part of the quotient. -* -* ## Notes -* -* - See figure 10 of [Baudin (2012)][@baudin:2012]. -* -* [@baudin:2012]: https://arxiv.org/abs/1210.4539 -* -* @param re1 real component -* @param im1 imaginary component -* @param re2 real component -* @param im2 imaginary component -* @param r partial result -* @param t partial result -* @return real part of the quotient -*/ -static double internalCompreal( const double re1, const double im1, const double re2, const double im2, const double r, const double t ) { - double br; - if ( r == 0.0 ) { - return ( re1 + (im2 * ( im1 / re2 )) ) * t; - } - br = im1 * r; - if ( br == 0.0 ) { - return ( re1 * t ) + ( ( im1 * t ) * r ); - } - return ( re1 + br ) * t; -} - -/** -* Computes the complex division. -* -* ## Notes -* -* - See figure 10 of [reference][@baudin:2012]. -* -* [@baudin:2012]: https://arxiv.org/abs/1210.4539 -* -* @param re1 real component -* @param im1 imaginary component -* @param re2 real component -* @param im2 imaginary component -* @param re real result -* @param im imaginary result -*/ -static void robustInternal( const double re1, const double im1, const double re2, const double im2, double* re, double* im ) { - double r; - double t; - - r = im2 / re2; - t = 1.0 / ( re2 + ( im2 * r ) ); - - *re = internalCompreal( re1, im1, re2, im2, r, t ); - *im = internalCompreal( im1, -re1, re2, im2, r, t ); -} - -/** -* Divides two double-precision complex floating-point numbers. -* -* @param z1 input value -* @param z2 input value -* @return result -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* #include "stdlib/complex/float64/real.h" -* #include "stdlib/complex/float64/imag.h" -* -* stdlib_complex128_t z1 = stdlib_complex128( -13.0, -1.0 ); -* stdlib_complex128_t z2 = stdlib_complex128( -2.0, 1.0 ); -* -* stdlib_complex128_t out = stdlib_base_complex128_div( z1, z2 ); -* -* double re = stdlib_complex128_real( out ); -* // returns 5.0 -* -* double im = stdlib_complex128_imag( out ); -* // returns 3.0 -*/ -stdlib_complex128_t stdlib_base_complex128_div( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ) { - double re1; - double re2; - double im1; - double im2; - double t1; - double t2; - double ab; - double cd; - double re; - double im; - double s; - - stdlib_complex128_reim( z1, &re1, &im1 ); - stdlib_complex128_reim( z2, &re2, &im2 ); - - t1 = stdlib_base_abs( re1 ); - t2 = stdlib_base_abs( im1 ); - if ( t1 > t2 ) { - ab = t1; - } else { - ab = t2; - } - t1 = stdlib_base_abs( re2 ); - t2 = stdlib_base_abs( im2 ); - if ( t1 > t2 ) { - cd = t1; - } else { - cd = t2; - } - - s = 1.0; - - if ( ab >= LARGE_THRESHOLD ) { - re1 *= 0.5; - im1 *= 0.5; - s *= 2.0; - } else if ( ab <= SMALL_THRESHOLD ) { - re1 *= RECIP_EPS_SQR; - im1 *= RECIP_EPS_SQR; - s /= RECIP_EPS_SQR; - } - if ( cd >= LARGE_THRESHOLD ) { - re2 *= 0.5; - im2 *= 0.5; - s *= 0.5; - } else if ( cd <= SMALL_THRESHOLD ) { - re2 *= RECIP_EPS_SQR; - im2 *= RECIP_EPS_SQR; - s *= RECIP_EPS_SQR; - } - re = 0.0; - im = 0.0; - if ( stdlib_base_abs( im2 ) <= stdlib_base_abs( re2 ) ) { - robustInternal( re1, im1, re2, im2, &re, &im ); - } else { - robustInternal( im1, re1, im2, re2, &re, &im ); - im *= -1.0; - } - re *= s; - im *= s; - - return stdlib_complex128( re, im ); -} diff --git a/float64/base/div/test/fixtures/julia/REQUIRE b/float64/base/div/test/fixtures/julia/REQUIRE deleted file mode 100644 index 308c3be8..00000000 --- a/float64/base/div/test/fixtures/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -JSON 0.21 diff --git a/float64/base/div/test/fixtures/julia/component_scales1.json b/float64/base/div/test/fixtures/julia/component_scales1.json deleted file mode 100644 index 34479125..00000000 --- a/float64/base/div/test/fixtures/julia/component_scales1.json +++ /dev/null @@ -1 +0,0 @@ -{"re1":[4.8838467406385655e199,6.758745249489743e199,1.271729121251427e199,4.745185171464931e199,4.264494533241181e199,5.889230676436307e199,1.1775110728424353e199,4.767870668683234e199,9.54522113696469e199,6.369137701215216e199,5.498898977400675e199,5.747889992626044e199,7.585986806221693e199,4.471582692953363e199,1.5578193081722436e199,8.587982232511523e199,7.821274421751218e199,3.2593609576129957e199,9.738514211627286e199,8.200891880566522e199,7.547380164960127e198,4.513191787494536e199,4.0184673679214633e198,4.148833793939411e199,1.027894940663211e199,6.596446258442346e199,4.271104940552971e199,8.044546809149422e198,6.0008489638827575e199,1.8699675406875326e199,6.7619594845534565e199,3.2627691023645875e199,5.842598998103831e199,7.579432791598053e199,6.7761322731281345e199,1.367146061215806e199,9.765806385447195e199,7.946884315344149e198,3.515131875886055e199,4.240907004646325e199,5.679926615162179e198,5.794961691447075e198,2.194885256733792e199,7.561009195097536e199,6.908203750237569e199,2.45942851169054e199,2.3045005923854534e199,8.906453985245221e198,6.832126966843021e199,1.9548269184985467e199,3.353683743492012e199,7.104645353537747e199,5.096069023346767e199,2.2459673095850373e199,1.6921022902212145e199,7.866612811022054e199,7.909053033081963e199,4.406306624315681e198,9.788441006818333e199,9.504241985406811e199,4.8607552877599566e199,1.7677736914975762e198,2.1391908961962813e199,2.04311102759542e199,9.948069795074042e199,5.796123479781983e199,3.130404025859974e199,4.238763915385672e199,2.4569883641779988e199,8.73186353276591e199,7.855955035667041e199,8.85998076594156e199,1.9134118793114817e199,6.293121633766187e199,6.8449482375649785e199,4.36872247690403e199,4.971797244965349e199,6.752161825987485e199,7.472185241597435e199,6.49841000475757e198,8.995872229928066e199,8.277054281309625e199,8.974073619730372e198,7.948407303542265e199,2.169906959837782e199,6.329298279000661e198,4.256602364607523e199,9.259021025224254e199,2.716124543400601e199,3.8109026357575256e199,7.825976725390264e199,4.502048226728136e199,5.4967269256919515e199,1.710532441962107e199,2.1154854669964994e199,6.457134262750559e199,7.915495595395205e199,7.176668966560978e199,7.493739310063292e199,2.9707525886292416e199,2.7783115025097216e199,6.535710093901822e199,3.0614845674300215e199,5.3469978832075035e199,5.643093968407028e199,3.5302776705716466e199,1.8335167994387568e199,9.01476578178535e199,3.843344756464118e199,1.3330722232877667e199,7.89390068341324e199,6.439128346875178e198,2.550941080412581e199,4.7643061702788935e199,5.9890136148468476e199,4.039503545728795e199,6.218331893169331e199,8.691551657151264e199,3.124612438151608e198,1.4676772614960075e199,7.186266207300451e197,2.403166517666155e199,7.998412827985377e199,8.042952604544032e199,2.8203805274896055e199,1.9411598744504377e198,5.350893400893386e198,3.7976728044349573e199,1.259920132742891e199,7.1169944533964e199,9.834040977578905e199,7.370745270578349e199,2.545302543776694e199,4.028229803538114e199,8.449767747790775e199,2.888007133199829e199,6.266160408288216e199,8.967576032742403e199,5.816163408671584e199,7.294645503564878e198,8.668481033118801e199,6.298021865270361e199,7.0222355183316495e199,5.305954864008373e199,7.586663233523425e199,4.195862010956738e199,2.68545634341366e199,4.479538110944935e199,3.3376021530603374e197,7.329095453295416e199,7.711892560801714e198,8.303511985607507e199,4.3132693707663395e199,1.265802222571931e199,8.20464845554131e199,9.560856559339359e198,6.722121909178553e199,2.9675331034808728e199,4.577519298527672e199,3.3676066619793063e199,4.5436339196784746e199,5.273334239729663e199,5.060621330164594e199,9.541121905697607e199,6.218666041961787e199,5.510223542242867e199,9.664965684027473e199,3.146321388097444e199,4.75485742299237e199,1.4256244216123792e199,4.2305692528946524e199,9.554253485142649e199,5.8935459099446054e199,8.59627172851328e199,4.178393169222586e199,4.2109534082890505e199,9.05228608609577e199,3.79299188392928e199,8.400879587403651e199,3.995488221871448e199,7.68953292826408e199,9.388636311110928e199,7.429906315779392e199,6.372534986419087e198,8.179774972966686e199,5.692133018630474e197,8.882911655102863e199,5.926246878001779e199,1.5179608242217767e199,9.535568682954528e199,2.2948997015373885e199,1.5648700656734958e198,5.561909192378824e199,8.243170764579399e198,9.533803165726858e199,7.287594579622334e199,3.4176401803002584e199,2.9673143539197144e198,5.049016810199445e199,3.4122316563469533e198,2.9221696286927246e199,9.439383683848964e199,1.055871614097309e199,6.539851412894406e199,9.936337284221849e199,9.315629863318375e199,7.429350882689777e199,6.6818105139884715e199,3.6357686055450986e199,4.426876031471645e199,2.054848369071218e199,4.988406306266609e199,8.134004773937315e199,3.0449407485144397e199,1.5775642833885196e199,2.364681415669466e199,5.986291400178428e199,8.832331437554308e198,6.850299084652106e199,1.4967227455498665e199,6.649504094500325e199,5.673372385168096e198,1.3284547676305669e199,8.996369354579499e199,4.8963023614728996e199,8.396228325075705e198,6.736631971860194e199,8.19427972191809e199,1.0779668588238755e199,9.779852746344442e199,6.431234507438941e199,1.6439484422127726e198,2.345529033080671e199,4.358977010201648e199,9.666473172838296e199,7.234471078809368e198,5.47976386701706e199,3.540818983745674e199,1.2803192737285783e199,1.935148939250827e199,2.6421977631909142e199,1.0719941187997316e199,6.541196038656243e199,2.5839112278352527e199,6.917733186587172e199,6.291718470016834e199,8.882875005301205e198,4.340657083215533e199,7.235670187794127e199,7.292545540831352e199,5.9910324627801825e199,5.091095823511138e198,5.9744534135986534e199,4.4677658425512743e198,5.629541503018849e199,2.993996329736983e199,8.462285472117385e199,7.468223283136899e198,6.9002542567144584e199,4.966058609720556e199,4.492670385034085e199,2.358658452920034e199,2.224872524250313e199,8.176178156474011e199,6.229838471261813e199,3.7576436627384833e199,8.241831833373262e199,3.4929825024950033e199,9.530428868332143e199,3.382730277062491e199,4.3526819198413315e199,6.324006663408351e199,7.794907987620412e199,8.689398736300562e199,7.262796466615589e199,2.142377197321631e199,4.7472542758070355e199,3.924416225671557e199,8.770756987350974e199,4.924499560583562e199,8.626249949394027e199,6.43510468080543e199,9.701191229124524e199,8.907562198695747e199,9.2180772013626e199,6.615646919423537e199,2.901600587322155e199,3.4981403288011723e199,7.153121850716069e199,7.051636547153569e199,2.091985894034789e199,7.554811238344538e198,1.4378192854605908e199,3.6369068847810913e199,4.0858051959365585e199,7.810027148208195e199,1.1519182949927865e199,1.5408398836810466e199,6.452034176231116e199,9.76603179028208e199,2.7167678908071133e199,9.88355040719337e199,6.426311021710563e199,2.701796488769278e199,4.4121023030293005e199,8.53260284480646e199,1.215929735930098e199,8.958787663132717e198,7.121444501874308e198,3.700702358412847e199,2.554285942184653e197,8.630890600100223e199,4.4056268727765065e199,2.2303575089708593e198,7.816819914642788e199,4.723258714967816e199,1.6602568598136912e199,3.997813781556182e199,7.920653477064226e199,5.265386978260028e199,9.692362095863822e199,8.0470427359181e199,1.3066210601055083e199,7.936687997783009e199,1.176662844729822e199,2.3735031817054494e199,3.2396551208935185e199,9.692102382899859e197,8.568896113148652e199,7.180584125743611e199,5.1619281840216875e199,3.7157387069066705e199,4.1664568714106996e199,1.816742905557167e198,9.593942957348047e199,9.926715589050824e199,9.386790499388035e199,3.8243895946531746e199,7.120035922480993e199,8.038206382535979e199,5.924364706458185e199,5.398904065803793e199,1.7076134961070543e199,3.37843808963594e199,8.718675032787131e199,8.215739319530602e199,6.305777157971495e199,8.65112746636064e199,9.298319736952575e198,3.2495037883802713e199,2.350106583267669e199,2.1235660695849935e199,7.880048029737611e199,3.0827636936581413e199,3.337293390910711e197,9.879137932487333e199,8.402082638132676e199,6.880194689468675e199,2.7902675433076016e199,9.380317179648178e199,1.683796485332434e198,8.07040116129002e199,3.434563550456957e199,5.020422774115247e199,6.371782088646716e199,5.526278904408454e199,6.318482848349692e199,6.1063452549914174e199,5.145311299700655e199,2.903886826553129e199,4.541846186976962e199,2.9859428994881064e199,1.2616382650175871e199,1.586318946313676e199,5.57109296963979e198,8.538093729037208e199,1.3404058155635646e199,7.014657363630216e199,7.47263382375927e199,5.9443341700890525e199,6.029425931033949e198,8.410555215356079e199,9.795451083646155e199,3.493315221552914e199,1.304073714297146e199,6.993797168616586e199,5.227855171387064e198,8.152450059171445e198,8.525018857091673e199,7.302058121499174e199,9.895409392957299e197,3.1989959402318723e199,5.181563875673669e199,3.448873601245019e199,2.4715378935856457e199,4.791930814530561e199,3.5020865522796805e199,9.968841405594803e199,3.288823304107924e199,4.175715076051259e199,6.806043384963574e199,6.82734088845768e199,2.438359132602785e198,1.1690110977540745e199,3.548379430980607e199,1.8488990742362488e199,9.361297598514813e199,4.553740989126645e199,1.4507724702723767e199,4.274638928562622e199,3.4172223419231504e199,4.1789857547523435e199,7.565113171228627e199,3.995070364710962e198,7.1463122791676104e199,8.983377818275988e199,8.306026285296824e199,7.86263618336656e199,2.290661001873644e199,5.301460600806087e199,2.9902814736720196e199,4.442224427064831e199,1.30178789698557e199,7.504007405568563e199,1.991880385961772e199,6.422161117609425e199,6.838655361470604e199,2.6711452079068385e199,3.425462559362592e199,2.829404188181217e198,4.605665363550468e199,7.789155822442642e199,8.213815128681322e199,9.830081609402356e199,2.538597710952687e199,4.368637312371361e199,5.265296074720212e199,2.1709219682272873e199,4.995539249208459e199,8.715197820934955e199,2.115736660416674e199,4.683113930168607e199,1.237204848481045e199,5.704525625560719e198,5.720738957088653e199,3.0112257836895537e199,4.496721008440665e199,3.8951318101519635e198,2.474027886565281e199,3.564578417260631e199,8.62793941221158e199,5.513154230341518e199,9.471782658029742e199,3.7700135796686485e199,2.9929103226118056e199,6.8278254747913e199,6.38078649743653e198,1.0080803806498362e199,3.367892229933632e199,7.483846277444171e199,4.066360925299091e199,1.4071539488868967e199,9.783088744213107e199,5.7061759799587e199,3.971579724502437e199,6.001219412185347e199,6.326753744558955e199,7.806832507603765e199,2.2603604144167753e199,1.3798300857348332e199,6.447951733340673e198,8.492783955981256e199,7.188487806539244e199,5.025504251208579e199,6.078725991611182e199,5.556107889276912e199,5.089288348150671e199,5.134445503435383e199,3.805822970307412e199,7.6916941726565e199,5.034561507783819e199,7.630531579344413e198,8.025065880768285e199,6.0712538917255e199,2.9227871750164204e199,6.671930960713337e199,5.161667595606578e198,2.8634119279786185e199,6.665104229964804e199,5.654823783738083e199,5.698472761188309e199,3.871038689025542e199,5.432430515305908e198,3.9644754672660065e199,6.2645909587640824e199,2.8633312328086723e199,4.1892708453424296e198,7.73072327586401e199,9.989299690927234e198,8.622252608119039e199],"im1":[4.066779632797175e-201,-3.755648775719368e-201,-3.251488831394631e-201,8.136808504132145e-202,-2.262331339705368e-201,4.8551772755772645e-201,-1.8292161922071027e-201,-3.8508839878058685e-201,-4.479136917518668e-201,2.8786454335451667e-202,2.0461679797314773e-201,3.669230994585731e-201,4.6008426363731706e-201,3.4813254062472685e-201,-2.561348139823171e-201,3.827226157353462e-201,-2.817574775839916e-201,-4.397299442948933e-201,4.47941886269525e-201,2.8484356136752807e-201,3.288884186143144e-201,4.953015441800092e-201,-1.9211758055397533e-201,2.4915096175745105e-201,-4.6990966954995226e-201,-6.069464547752145e-203,-4.529028801136167e-201,4.3174948305872586e-201,-3.814697793761822e-201,-1.096369797946367e-201,-2.2193020639807436e-201,7.519017174554602e-202,3.270635862932802e-201,-2.563074869966323e-201,2.1837285184728767e-201,2.508675072028082e-201,-1.0778758933820775e-201,-2.3300252724707636e-201,2.8585741685444316e-201,4.98896938394828e-201,5.014341692910005e-202,-2.0189581671724554e-201,4.721282668060564e-202,1.3477635717538463e-202,-2.979084050309799e-201,-3.0649814914922712e-201,-9.024276405836696e-202,-5.78471875941807e-202,1.4580667985995686e-201,-2.0786981052079423e-201,1.2161186381518503e-202,4.225669073723042e-201,1.1475470864640846e-201,-2.483018531663008e-201,-2.390125280633385e-201,2.566163574858962e-202,2.4192172907923464e-201,-2.1654132864907483e-201,4.0327974386077794e-201,-3.204891393735786e-201,2.615448358503545e-201,2.0884156336467566e-201,-4.3533270720231994e-201,1.4148214155919115e-201,-3.815214093351627e-201,-1.0767878922063955e-201,-2.2929834725182393e-202,-6.646117095466586e-202,-2.642213380497289e-201,4.68111123064137e-201,-4.0631354681132225e-201,-3.455964632027441e-201,4.4658826169654765e-201,7.859873936421831e-202,6.274462148593606e-202,3.257670721169154e-201,2.7517486150312585e-201,3.2243713088416493e-201,3.84653483266296e-201,3.379036390136801e-201,3.96450432795853e-201,-1.1198817548536356e-201,2.9105490354640628e-201,5.232647259962896e-202,-4.667022264914694e-201,-4.632869060396524e-201,-3.850126927123291e-201,-7.011623203488248e-202,2.9055317483718318e-201,-3.975212926558706e-201,-1.6209722188227024e-201,2.463945746569153e-201,-2.750321594349595e-201,-3.6127218852055373e-202,6.89507845608411e-202,9.904211531674432e-202,-1.1804273786502069e-202,-6.731671209472557e-202,1.3548385518385933e-201,-1.0913134227695122e-201,-4.284603344962447e-201,-4.940813890892309e-201,-4.697295591379072e-201,2.691085991380409e-201,-3.656024311021503e-201,-2.878265576868625e-201,-2.533100351439106e-201,2.7940020520645152e-201,-2.2951045484622112e-201,4.5282046735965575e-201,4.272237736728526e-201,2.6302496420466563e-201,2.7558296690053675e-201,-2.325503261849826e-201,-3.774506253889839e-201,-3.5108929132178755e-201,-4.206353960642936e-201,3.2153778932377544e-201,-3.2444339444251725e-201,4.2136159318832694e-201,1.1452398260517984e-201,9.584408127643386e-202,2.2139626200364365e-201,-3.548225606127998e-201,-1.522010225043895e-201,-4.692131472506123e-201,-4.073800324553561e-201,3.9188278233163535e-201,4.152119125112383e-201,3.7187440902726074e-201,4.1311556453576585e-201,-3.639932321170007e-201,-1.9218424563580495e-201,-2.6432087720111873e-201,1.8723180360493483e-201,-1.1187389434201354e-201,4.020987413005758e-201,4.1536167084451154e-201,-1.1669969169695202e-201,3.598246226246773e-201,3.703303905619425e-201,2.2943231878292673e-201,1.4165102568043206e-201,2.574737830476977e-201,-2.506739423898241e-201,1.4483198974103038e-201,-1.0555471513460579e-201,-5.798682393579903e-202,-4.944872880693227e-202,8.360999362634672e-202,1.9309721869462606e-201,4.459638851524066e-201,-1.8219582014109335e-201,4.290318590075134e-202,-4.559356225042212e-201,-3.8642962306392445e-201,-4.467537883078806e-202,-2.524009129245127e-201,2.834717888308565e-201,1.3095622153630328e-201,-1.704511944600172e-201,-4.518162131476929e-201,6.650337217139976e-202,-3.2653245901225424e-201,1.6239592831492395e-201,-1.9074439578857495e-201,1.521743165002677e-201,-6.955472155046579e-202,-8.84995420904383e-202,-1.6878500808401396e-201,4.717031524521923e-202,-4.570076040243327e-201,1.2815759325354075e-202,8.997130604555512e-202,-2.5274527235064315e-201,-3.1263892596222896e-201,3.742938092147298e-201,-4.5078366096860146e-201,2.802806905728761e-202,-3.1159251671111263e-201,1.5172287634026435e-201,-3.799212670737174e-201,4.51373529131785e-201,4.354670399503602e-202,2.9979778312109746e-202,3.6655107978463254e-201,-2.0601911310826925e-201,-2.2741140924838675e-201,-3.216353968114506e-201,3.2843431422000286e-202,3.142316617639095e-201,1.1887493680808867e-201,-3.770787143911213e-202,2.719620604722933e-201,1.0907980792595895e-201,-6.305736333182412e-203,4.811767256455717e-201,1.6081594116010218e-201,1.1868510744496316e-201,-3.724598229349714e-201,9.10713629765227e-202,-2.0717344235340917e-201,1.474651526520885e-201,1.1359568961251412e-201,-2.5484756972911836e-201,9.257799101722955e-202,-4.8276754870996084e-201,-3.172251113254264e-201,-2.7881654536002507e-201,-3.4146835461376535e-201,3.754805536269991e-201,-3.238286410602873e-201,1.9441774398695298e-202,4.6994799874700224e-201,-1.4375501883560182e-202,-9.86332969325032e-202,1.929008922001272e-201,1.681522570989431e-201,2.7583390942913002e-201,1.3104126669977901e-201,-8.648407027362989e-202,-3.604939784687774e-201,2.9643043325462054e-201,4.9246660886966845e-201,-3.7442036333659845e-201,-2.85290550074217e-201,-2.1075128230114315e-201,-1.4523694169414981e-201,-9.288200876261151e-202,4.9774725243046906e-201,-2.5320949692750706e-203,-7.572405149605602e-202,-1.7774630077262855e-201,4.7294621931674475e-202,2.660039989447829e-201,3.9873975010755315e-201,-7.739647795044228e-204,3.2862228216380056e-201,3.656937035767598e-201,1.0654113838656223e-201,-4.675049631188716e-201,9.3180854802239e-202,-3.5728105986741294e-201,-3.660574621385981e-201,1.0428595090387194e-201,1.6001629654482813e-203,1.6979291911710542e-201,-2.981874251358534e-201,4.719559920992837e-201,-1.408223164179402e-201,2.93302246798872e-201,4.590513643308496e-201,-4.300423020979004e-201,-1.5103468860376631e-201,-3.337240022936452e-201,-1.637334831937088e-201,3.590454842331952e-201,-1.2037182809406279e-201,3.594119889669549e-201,-3.892680182221545e-201,3.516992558736472e-201,2.7794440243800692e-201,-2.3695075217465975e-201,-1.834328080490638e-201,-3.1179206083953193e-201,-1.8559020233577306e-201,-2.64739699938894e-201,9.442905681276047e-202,-3.702080033884054e-201,-2.4223176008891923e-201,2.408631912898655e-201,1.9969989515081806e-201,-4.1101743910923984e-201,-3.4215167073835004e-201,-1.4167097828348606e-201,4.230300740836558e-201,4.284189483314048e-201,-4.460815203059833e-202,4.686689519240219e-201,2.5841561984120435e-201,-1.0581539926730863e-201,3.5753036080186574e-201,4.7250330262548204e-201,1.3808945486901349e-201,-4.1447226264660874e-201,1.794061818265192e-201,-4.278848454278577e-201,1.1930535411885634e-201,-1.74162654086512e-201,-1.0927197855156948e-201,-1.526648628141323e-201,4.337497009260282e-201,-2.4626452645777407e-201,2.5666590936266733e-201,1.900554038261181e-201,-2.1731633170564333e-201,-2.492718187426224e-201,-4.338925082403414e-201,-4.262769935754508e-201,-4.830183130231607e-201,-1.7379321811351843e-201,-6.994464161526873e-202,-4.567930584946138e-201,-3.286340380035382e-202,-1.2022159200934073e-202,-4.9465186949635585e-201,4.626814048807914e-201,3.580827021680219e-201,3.3575917307201004e-201,-4.949233296662558e-201,2.1845935830436146e-201,-3.198801873909892e-201,2.4320056356236594e-201,-4.143894137633654e-202,-2.1360685944062885e-201,4.510836335350253e-201,-1.7438774551724822e-201,3.4067080263083364e-202,-4.310396131570781e-201,-9.978533449281198e-202,3.322995258529497e-201,-2.413814906993009e-201,3.530016942826014e-201,-2.598114160073456e-201,1.2109523987373303e-201,3.6876768149070285e-201,-4.1433225865003386e-201,-3.581128886948343e-201,-2.4061295909225754e-201,4.560414142154416e-201,-1.0817629830061384e-201,-2.2816922981503318e-201,-1.9341447613178764e-201,-4.1657096216338464e-201,-2.6496083250482997e-202,3.1923509571344296e-201,4.2294224389180984e-201,-4.659170806999626e-202,5.744494538790959e-202,1.2106940002279256e-201,4.2652896572819835e-201,2.4519076173851057e-201,3.789111651230323e-202,1.7037506364009473e-201,1.7059688553419867e-201,-1.9033669096170878e-201,-4.607433417486971e-201,3.404336598753323e-201,-4.3467846655491746e-201,-3.290507785291426e-201,3.476840269026896e-201,-3.572203482678757e-201,9.642256781285621e-202,3.010885839159631e-201,-3.8443033693882645e-201,-4.374838123773936e-201,3.2498112858797184e-201,-3.8523782868228454e-201,-3.019458535668522e-201,-2.985202278997683e-201,4.2615303893281356e-201,4.3326413385838856e-201,2.983392896518687e-201,-1.4346574116244868e-201,-2.0015097835561958e-201,2.9925415271571755e-201,3.884664905968295e-201,-4.7005500729664515e-201,4.8276697449557296e-201,5.4577070175133815e-202,-3.1872027794594436e-201,4.570487391080893e-201,-3.395276828275137e-201,2.364734009384992e-201,4.502245399624944e-201,2.402125408486367e-201,-2.7532043387254832e-201,1.4893131696722994e-201,4.660517517317924e-201,-2.021026358339153e-201,3.6318067103697762e-202,-3.354163361550335e-201,-5.379499518051637e-202,1.2296389613697379e-201,-1.4764439655633747e-201,4.8335733544227425e-201,-2.0480670762338937e-201,-4.037073164131098e-201,-1.8481502487696034e-201,4.814389442443158e-202,-1.022443150400432e-201,-5.584525239223271e-202,-4.6262405893943714e-201,-2.3941313134475205e-201,-7.159788958451406e-202,1.8813922669192247e-203,3.3722462196777675e-201,4.325172311639876e-201,2.343210106982727e-201,-4.1510164680885056e-201,-2.393855208909795e-201,-3.372447678941277e-201,1.1927824698542623e-201,2.9842671734190163e-201,-4.105799761305739e-202,-1.9974709919123024e-201,-1.945278101095034e-201,3.4565302454208103e-202,3.156010318136259e-201,1.1929658775214069e-201,-4.051187805541818e-201,3.579454569514623e-201,1.1477644253357802e-201,3.78880906838083e-201,-2.8969966243060275e-201,3.1544671630848756e-201,5.925190466264698e-202,5.538814147104029e-202,-4.242857510276574e-201,4.68439227931331e-201,2.2818614883262185e-201,4.770895681182005e-201,-1.9798567798866547e-202,-2.4458764422752178e-201,2.0800211845229127e-201,3.832980772871772e-201,2.0505331343869108e-201,-3.9480636458625564e-201,-1.4339423325474085e-201,1.0781235599935487e-201,2.8690523615047168e-201,1.2967847642806456e-202,2.6007682199891786e-201,-2.805523796937478e-202,1.5392052841921744e-201,-6.483275772593858e-203,3.391615875748182e-201,-1.174892427126343e-201,2.507347533558396e-201,-2.7059718292501666e-201,-1.4895572205990768e-201,2.584651473648398e-201,-3.011258571209149e-202,3.966507268874377e-201,-1.032477260918351e-201,-3.6831430290131186e-201,7.7471331897277025e-202,-6.593622194262186e-202,4.266443026354092e-202,-4.350165956141042e-202,-3.2883314127507476e-201,-4.247984933275508e-201,-4.154292952003571e-201,-4.7870350087085944e-201,7.019830875027465e-202,-2.473808660043152e-201,-6.3450425055864705e-202,-2.2187567959646714e-201,1.1026003647424466e-201,-4.316150806972102e-201,2.1867525230988876e-202,-3.1955527434774044e-201,3.9593789692727323e-202,-3.674853013994709e-201,3.468420903121901e-201,-3.598677279105107e-201,-4.818423754039258e-201,2.086466480387516e-202,-2.4660130238122203e-201,2.332199344639039e-201,-8.541860561480433e-202,3.846838523401078e-201,3.171099033440562e-202,1.3669664930838333e-201,3.247247473493295e-201,-1.7602795096517664e-201,-1.4496737688185365e-201,3.455511936894442e-201,7.363944324103771e-204,-2.4154936345309806e-201,1.0722065051647525e-202,-3.817384775842569e-201,2.9724950167737424e-201,-2.12048175514043e-201,-8.955147341713534e-202,1.549849941460948e-202,-2.6599640077563123e-201,-1.3640733557075735e-203,2.9252118606839493e-201,2.357248241310052e-201,-2.021346432228913e-201,-4.883365998438863e-201,3.906667578257921e-201,-2.0090743660403908e-201,2.4727826402043924e-201,2.1058911113359363e-201,6.617539236609546e-202,-4.800759557626786e-202,-7.277652122009972e-202,4.8522761021994315e-201],"qim":[0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0],"qre":[3.196957140600279,0.9427935773128138,0.24410674377784397,0.4956382052697177,0.659454649482942,0.7377921999716176,0.19682388516223476,1.1147320747931717,1.1609819385862603,1.569578426930236,18.35027005478411,1.2846282928008381,2.641584849467909,0.6787567644669196,1.5950647225991663,5.759902857587663,1.460231843026149,0.5377871218143478,1.0046012830555464,2.3062788491338053,0.20525356789700058,0.4604609564751185,1.3646204642396178,6.502407854153899,1.6142137588351992,0.7779728719133043,2.082733960073931,0.2251686692713712,1.4471127277090814,0.5599702158129681,1.6936747742193445,0.3388749148063925,0.6301621681447046,4.3551631465914795,20.999356915688892,0.6720402656756339,101.71877920945614,0.08710012180913156,1.197418087823895,0.6535613137226504,0.18872302691454065,0.3462653157810965,2.357236570703276,1.4178166959667506,1.2859430104542968,0.504670691373813,1.7274216597295886,0.09747469723875912,1.1707120052663056,1.506420653307384,0.7287006251379411,1.1305768118317954,2.780274100681834,4.6925942320459635,0.5418099384286089,5.591051539456696,2.768127315733977,0.059793254496546766,1.304284111404566,4.36563327128055,0.5672117040607265,0.032330470228770565,0.27202003909208533,0.6943784672311792,1.076663374449244,1.7642131803366383,6.213979172834397,0.9485765340237968,0.9573500772393626,1.1189090882876842,1.9821364118915759,2.802384030280475,0.6636609536285984,5.0323444037162,1.331315743267812,1.3704283901279197,0.6209661060784024,2.4299000622040823,10.559232654335142,0.11911575813068782,1.2268987772480267,1.2770080575232015,0.34843398301197914,0.9412313548887888,0.3647323517290731,1.0245174760714402,2.5310123642875584,26.404056632845283,3.301572895545022,2.2662138196565995,3.093979558774442,0.6011719038126403,3.2534609493588817,0.4286462170615469,10.688915222462425,3.503174764956486,1.541632008556827,1.358286581743649,1.0954286095517232,5.197951773274458,0.8269657199308418,110.27254809266286,0.4897360922044221,0.6403916206693652,1.681161439178952,0.3567616165283667,0.2235221189056537,2.7198725581898526,0.506687713612101,0.38039273017509645,1.0246300954038137,0.9939738917762985,30.17938351691953,0.5668689304951048,0.88913554152904,1.2430051769829569,0.9449126181056963,2.9030489990767125,0.05447443750371423,0.9749394736856304,0.00903686116560511,1.067258450828926,2.183446639227644,7.19294207687615,0.4240997032496723,0.10622912722422871,0.08666138843779814,2.645477608155818,0.6557876376373032,1.1458037584467917,2.099674428883339,0.8993600988580935,0.5066148492647194,1.2726085518025136,4.03211497960911,5.409436360232457,6.572280650649033,2.806746798720011,0.6150049813079941,0.22768372352149643,1.8099250470621724,0.7020075227162861,4.023436204410153,2.4818217149742527,11.436402830962445,0.4382038276602266,1.7451434620564232,1.5064733536046166,0.006036990628727041,2.657404223515151,0.10105922369076903,7.783063745561281,4.700373052970891,0.283499901377133,1.1977985676282503,0.12423238131680789,30.72734856187575,0.4360022139340843,2.202251093316013,0.938097676668016,1.9224007413158213,1.4385582622002662,0.7387160620711669,1.307481637773667,0.908832242866011,0.6458077074664832,1.1674192144664386,0.4472299269168907,0.8408572504197226,0.26928628544687067,0.5453314161490018,1.1361170702838101,0.6901070846846055,10.213882989242329,0.6640101673837102,1.810565559093048,0.9096458870214246,0.5631315343693845,1.535621123319478,1.941279449690906,1.4772193044769366,1.5480636191063095,0.8594459717012857,0.08639233776288613,1.7305521334360874,0.008684404581948904,0.9467282536246369,0.6857092408116486,0.16584692141625662,1.0897890008623268,1.7280573150496676,0.019180865752257296,0.7183721721007631,0.23139426238779842,2.4044327959934457,2.2725762950675525,0.7339007999723481,0.035810121320724815,0.7545674923833596,0.035188280785986674,2.862191099762298,2.0780756628184607,0.4820594774885343,0.9532803959807398,1.3903722343555944,19.406332474887208,8.497037755943586,0.7369600221762103,1.4073847210479473,1.063923664456907,0.2269457899510809,0.6235046527656396,3.1666581580912907,1.5670065615880793,0.29197852850169786,0.8252800132669533,0.7746276657318852,0.3852129429559878,0.7843786610576399,0.6680748803199604,8.489231741176203,0.22244552329098177,1.0079243779027325,3.735520054232034,0.5960839088755344,0.08710897164354886,1.2811875585036574,5.99499348782533,0.3078175207694417,2.4896464827816236,0.758248091064855,0.018135271335356005,0.3245531755465872,2.600762408848462,1.3555450588643427,0.2714642329464428,2.787198342673882,0.4256702047831642,0.12975888731810745,0.23695614181199334,0.7495464320100897,0.30433945800608414,2.266171488016556,0.590546775973794,0.98532756296037,28.452354747574763,0.1705936674173249,1.863137750132163,4.92726329011944,1.5883231360796048,0.7206949702169563,0.07020078484272674,4.90715348601753,0.2394826123986761,0.8715390403942862,0.8504382341392672,2.2375864228503897,0.08951340946698759,3.0839850684409025,1.2827669834681483,0.7045481599198261,0.3160374772904212,0.26559766619221464,2.0936160398151435,0.813074690054905,3.8253100124114128,1.5365497200494767,0.37667717760592295,1.247033314552116,2.988083439469539,0.5624232815919626,3.31709668836762,1.4185292073078797,1.0389946522020226,159.7354711863626,0.4238815523267935,0.6601471927834207,1.151657334953576,1.2278165999701518,1.7086843546126729,8.030202359140205,0.7241551967507102,3.796387003961332,1.5196023772622183,5.500319671874966,0.7429559786614094,6.0421659013937585,2.4048039033237423,0.933068454888497,0.8161731517583946,0.23560161753609463,0.08329333539545399,0.3009193598264994,4.590245838378801,1.5596474368051534,3.6186074508938715,11.172564368192033,0.24625242129369113,109.54703004493321,1.1411707681955336,1.1718921333405674,2.2688472147771956,2.247897012225649,3.767497818798311,1.4625481236593416,1.8502538945279712,0.12784851397247798,0.6155243238987302,0.30361745426597214,0.3759443536535242,0.01072795493502261,1.4926899592314293,0.5416314865888651,0.0703763936151577,0.7870004124819205,7.286842792083895,0.2047788967273751,1.3724024307246374,0.8098264111302178,2.3430978700704124,1.1587066625430684,1.6481376163561146,1.434019042331084,1.3429675413193347,0.14484734713667063,0.9502425065650657,1.6085180966344688,0.14551474824342872,0.9928092387545546,2.2841825681422665,6.052928193415676,0.38524922729690364,0.44826859676083314,0.03475895792638903,10.119931871685093,4.375726555934265,1.0497874487374204,3.999251964819975,4.52211237856008,2.798087774523446,2.3795389059691945,2.3580501434498182,0.24151284389190017,0.6096645068363508,1.9385225918254583,1.0704530577906117,1.0042042955502442,4.253259321736411,0.2064732790630512,0.4334811655340106,0.2506481268883393,0.35334346074743367,0.8636001567060432,0.6338462686059675,0.010122675359452576,4.436252429928392,1.0909651858982485,14.017746428107579,0.33079885022815886,4.513669929456184,0.02753438459018398,0.8491784478293952,0.7800958404493752,2.5366265983585303,6.035303849971427,3.630584658649938,1.4230783527823587,1.0891716421697872,3.5931473326712973,0.9662773328636919,0.48466843807311427,5.540208699528841,0.19091736921738223,1.0100584155064039,0.9395616269119741,0.9515443443242442,0.570457642851492,0.7413483904968274,0.7731959169206968,1.137965614995452,0.09371881329041616,6.098338120156442,1.1722861204133608,0.7929404246851813,0.15545033721805623,1.1492348870960873,0.28450493712772185,1.2150405071938473,0.875098960489311,1.4694042519386243,0.028537071504851567,18.156541406861617,2.846193848140807,0.7539323355040184,0.4288023760122086,1.7605644978293393,0.43373898453318105,1.0798411803632304,11.57643684696874,0.785113317217945,1.772046996199302,0.8576534515315055,0.05730425304818112,0.12358551013522351,0.5091190735383979,0.5913479011969123,1.9261779256813718,0.600763338452453,0.25404157694570034,0.5958964181139342,0.46779452887129236,1.1723137932443373,2.786218044298352,0.06882127274393253,1.164304289724051,4.733965405636037,1.301013307021809,0.7938774934264257,2.0507795008697163,1.9757658857613427,0.5033757270570618,0.9453871314527902,0.32359479541743075,0.8005716289642674,0.43404994408414643,1.6566440882069482,2.0206540615642696,0.4513437312127191,0.837599739341003,0.03149728398631143,0.47702168986673466,2.0456983106720337,3.013386339515503,15.867613524256647,0.25825538594124814,0.5025597587579711,0.6316550931413009,0.37530187463696824,0.6199188530472483,1.5106109943092076,0.23132860815654785,0.4888270517163939,0.32862841686384725,0.24781372782252575,0.840260843653652,0.36117488359681155,0.5605095407040703,0.08961923460744857,0.3917633819493667,0.41808931600364563,1.4416580744024592,0.9295416704269254,0.9977370209661443,0.3796252781419226,0.3546538191148535,1.0666972220625823,0.0942088316628148,0.43923731576447517,2.9933874766921886,1.3060267100788585,0.563507050300838,1.1898267894178582,1.5051160967759247,0.7280321097887446,0.6274575271606688,1.8496735576350603,1.0755927365175826,0.8672158845773164,2.869049676539668,2.154341120934558,0.3927903352601222,0.8807285340460759,1.2957288079175444,1.1612515441640194,1.0350233513931024,1.4150106074409852,8.287883837564989,0.6815603442194021,1.4478013330575208,0.7734994729484697,0.598006484495209,0.09168909538751928,1.0541351342548018,3.4299329837957755,0.32933826180511755,0.7310582470828043,0.17703704411088603,0.3273203183230295,260.1288908685762,1.52857426244323,2.615675548356125,0.3877798940269149,0.10779093255998275,0.6979199446972106,0.6572082208516923,0.8420256855698224,0.05577201543821692,1.714579189974061,0.1936419360252377,0.9089803966973428],"re2":[1.5276547435107457e199,7.168849483206892e199,5.209725473249518e199,9.573889020283824e199,6.466698713224388e199,7.982234939137148e199,5.98256188201882e199,4.277144953927937e199,8.221679269694759e199,4.057865215229739e199,2.996631090977897e198,4.47436042381885e199,2.8717558732780168e199,6.587901479648963e199,9.766495905155302e198,1.490994283210586e199,5.356186730966365e199,6.0606898629643565e199,9.693909788774204e199,3.5558977977214776e199,3.6771005942988134e199,9.801464649779511e199,2.9447509202938706e198,6.380457650451798e198,6.367774621156308e198,8.479018352168764e199,2.0507203620002235e199,3.572675912319848e199,4.146773674904151e199,3.3394053610024643e199,3.992478123593833e199,9.628240273343004e199,9.271580068516888e199,1.7403326893804227e199,3.226828469240217e198,2.034321648631201e199,9.600790002933235e197,9.1238498296922e199,2.935592765492806e199,6.4889198849459825e199,3.0096627359279357e199,1.6735611184085673e199,9.311264232078975e198,5.33285382842949e199,5.3720916821944115e199,4.873333351289909e199,1.3340695246036227e199,9.137195844198759e199,5.835873328461252e199,1.297663381212064e199,4.602279218378835e199,6.284089041262558e199,1.8329376308965395e199,4.786195435878971e198,3.123055097750247e199,1.4070005893357374e199,2.8571854293431784e199,7.369236984031632e199,7.504838034312396e199,2.177059179004053e199,8.569560982189388e199,5.467825487810109e199,7.864093040116481e199,2.94235942502982e199,9.239721561219517e199,3.285387244797704e199,5.037680267010125e198,4.468552365938387e199,2.5664471363109185e199,7.803907952994345e199,3.963377590228521e199,3.1615869453319765e199,2.8831165504762776e199,1.2505347664835797e199,5.1414912444162586e199,3.1878517027046125e199,8.006551720453508e199,2.7787817001258982e199,7.076447206161041e198,5.455541824808638e199,7.3322040878597146e199,6.48159910389543e199,2.575544882894457e199,8.444690311534945e199,5.949313104666983e199,6.177833396527943e198,1.6817785739287338e199,3.5066660983094965e198,8.226759273028938e198,1.6816165371081327e199,2.529420953411281e199,7.488786814846279e199,1.6895014297851407e199,3.990545988456726e199,1.9791395319057935e198,1.8432235603383505e199,5.134490949500436e199,5.283619129438945e199,6.8409198415311775e199,5.715236920633859e198,3.359645310016077e199,5.926869567219772e197,6.251294556726522e199,8.349575026635402e199,3.3566639329789825e199,9.895340493533582e199,8.202842780909143e199,3.314407417597873e199,7.585233770650344e199,3.504462934068555e199,7.704146812418388e199,6.478166479169811e198,8.452595060407519e197,8.404599218584332e199,6.735771246471134e199,3.2497881911751536e199,6.580853905449445e199,2.9939390137457312e199,5.7359241900176804e199,1.505403464635242e199,7.952170643776022e199,2.2517193616969223e199,3.6632050833239846e199,1.1181728586972073e199,6.650277059564967e199,1.8273329784146986e199,6.174483812631309e199,1.4355339061374038e199,1.9212319056244786e199,6.211355479444342e199,4.683602773030342e199,8.195544009498414e199,5.024137266151682e199,3.1653329673390593e199,2.0956167645323274e199,5.338831887238848e198,9.534225242906225e198,3.1950071295465544e199,9.457099674707925e199,3.203850231690437e199,4.7894143722632465e199,8.971444979537184e199,1.7453328850186477e199,2.1379274876976483e199,6.633784543671028e198,9.575137746651805e199,1.5388169521886763e199,2.973526282576796e199,5.528585943430732e199,2.757990443621958e199,7.631062538536139e199,1.0668693276915585e199,9.176440512610207e198,4.4649123912324236e199,6.849773139892175e199,7.695945660864373e199,2.18766741153803e198,6.806234025062796e199,2.078563753434277e199,3.5898251810414305e199,2.3635206864144797e199,3.6657077980728633e199,6.850563552085132e199,7.29732764885623e199,6.8424795563493266e199,8.53229758415177e199,8.27891606053853e199,7.035131592797297e199,5.654773649889959e199,5.294084766502713e199,7.757794852110128e199,8.40956775938234e199,8.540045509948778e199,8.41626219682291e198,6.292664441699771e199,2.325766878277752e199,9.951439582425732e199,6.7355345109146e199,5.470672068670087e199,2.058172625537048e199,5.205410533804823e199,6.064761289675516e199,8.644995218340236e199,7.376273349506127e199,4.726685093690523e199,6.554430951388355e199,9.38274697210505e199,8.642506947969814e199,9.152782645942944e199,8.749921934805028e199,1.3280229084713136e199,8.158495481307117e199,7.742378405491294e199,3.562392031468999e199,3.96509446286593e199,3.206754640290618e199,4.656814899818924e199,8.286244906415342e199,6.691272631228435e199,9.697068399277508e199,1.020955459240792e199,4.542367659051683e199,2.1903347271549553e199,6.860364946628503e199,7.1465302878600085e199,4.800304166371094e198,8.743459892823268e198,9.0667204636927e199,2.5833509140541774e199,4.160896292998049e199,9.054357736771187e199,8.000591950901819e199,2.5686399882329268e199,1.9431576249614115e199,5.4030147061972945e199,2.865307989598147e199,7.72795972181351e199,2.292843892985039e199,8.733408269183796e199,2.2403517773831617e199,7.832869094911787e198,2.55045473661735e199,1.3180103554939182e199,2.40833116245417e199,8.214115980264238e199,9.638764144103538e199,5.258115353327452e199,1.366853815364284e199,3.5019671918912087e199,3.9282094120518036e199,8.481702207000822e199,9.064923329863711e199,7.226948339453198e199,1.676038147649046e199,7.1310600187180325e199,2.6649813127450416e199,1.966047332591365e199,8.318221345911119e199,9.866910083698859e199,8.166696691011369e199,3.5250621580643415e199,3.522363238151989e199,2.8864523595173107e199,4.375455650527361e199,7.020744619995375e199,2.2113173148008534e198,5.207036779138433e199,2.3297563923588717e199,1.4684967621486145e199,4.591348810060939e199,8.312854550624457e199,7.2521921726614555e199,1.2174987863375974e199,1.865590907749749e199,6.459310761881685e199,3.520533543235179e199,3.7818809524852004e199,8.343133534524979e199,2.237447362286633e199,3.871364537535952e199,6.376668964042611e199,7.463223897185318e199,8.376852689059998e199,3.9052901778474765e199,7.662074035094029e199,9.823108847509398e198,5.363856259143945e199,9.273146105361705e199,7.642481365267365e199,1.1320735667485282e199,7.73915672111027e199,1.9064884920555224e199,5.495063441389257e199,8.363275708767547e199,4.546764981299689e197,5.054188335306357e199,7.191205730635442e199,3.407624912865035e199,7.1433771033590764e199,2.8820416990941865e199,1.0742257247820641e199,8.886361251952335e199,2.555374680980057e199,5.861771692371262e199,1.6759166287184745e199,8.904493818520726e199,4.80225242847575e198,1.4546468108964316e199,7.666234790426901e199,8.639878109150312e199,8.879335871767913e199,9.070126922491889e199,4.778088343300983e199,7.923120052466703e198,2.6196979519333495e199,2.158296320944941e199,1.0310240845622376e198,6.257156277230572e199,5.889739022212348e197,8.557905672368855e199,2.3182747059345476e199,4.356199193502745e199,2.8588102509855894e199,7.171328607778859e198,3.0167228220771845e199,4.611584858727327e199,9.510706836935562e199,1.4554725646563838e199,2.345531985007636e199,9.843750338177625e199,2.3809625950663725e199,5.782105350627654e199,8.133993281156263e199,3.169184145989663e199,9.932421623505008e199,6.481900117426653e198,8.107558378068682e199,2.913004008194091e199,9.780680610317372e199,2.2471903737003516e199,8.364810878528597e199,4.882506567448776e199,9.111601879299436e198,5.909813717452907e199,8.123468382334835e199,2.4977867915898467e199,2.0140619665217985e199,6.660563619768722e198,8.630959280655003e199,3.1436121726397746e199,8.527985165323437e198,9.645025722642209e199,9.294554429012677e199,5.226689791462058e199,9.480244609344923e198,2.268586819162278e199,8.941610523804157e199,9.562762307288952e198,1.5744933620486755e199,2.8727499028885894e199,2.489711217411329e199,2.289562874988408e199,7.070487302411844e199,5.5414708446243816e199,4.497587528539955e199,7.675011304547705e199,6.2793768020244375e199,2.033999531171022e199,4.5034010110882805e199,7.49629752512354e199,9.376118674585639e199,6.009920390469309e199,9.124648679770752e199,4.8635826167094645e199,3.296849175148484e199,2.2269106838554718e199,7.701513070020473e199,4.908203130050137e198,8.434937247765812e199,2.0782018460039096e199,6.115250115060527e199,9.503775304141266e199,4.402745627355829e199,1.979172960404972e199,1.0557516650428266e199,1.5221457214176204e199,4.440010513824478e199,5.606412266506219e199,1.4319789374947267e199,3.005231239303806e199,9.371037662435542e199,5.389585594026524e198,6.60829483555821e199,1.5705219836402806e199,5.929459877954058e198,8.972880538847282e199,2.3497026157164034e199,9.462025484305998e199,9.664605904179529e199,5.2236500749741985e199,6.433527825784504e199,1.3791552796256434e199,8.355853501184653e199,4.405520405823494e199,8.389005373901962e199,6.0856116074657905e199,1.837527047567593e199,6.709611746195721e198,9.741776921235188e199,4.9694004300486905e199,3.46756302281227e199,1.7618971964687756e198,1.820523882819287e199,4.574513439510961e199,5.7638157618680675e199,2.721814974934856e199,8.07417981127258e199,9.231766288299493e199,2.8409633703215806e198,5.318614503760982e199,3.840780407946979e199,7.960489025335521e199,4.255110228123252e199,9.45912750188091e199,6.969645443293311e199,3.126584317783155e199,4.860037836433683e199,7.579924901637532e199,5.7107678503447076e199,7.173459679607135e199,7.304964318775423e199,3.5647330764463222e199,2.7151906458683983e199,5.804993435061369e199,6.137839001573498e199,1.897643317710096e199,6.384274657659278e199,9.904092569032186e199,1.116970888826515e199,2.6832433128903932e199,5.940456229692313e199,4.6988416483291875e199,4.0228950385505736e199,9.373311686396891e199,4.589058040693167e199,3.8766088403215115e199,3.3843771140996423e199,5.918206065983717e199,4.08961750878485e199,8.98301005702861e199,9.655043913909136e199,3.8075779707144696e199,2.7257756567655886e199,6.195059889992416e198,9.8297958112293e199,8.692771827111734e199,8.335713796805195e199,5.7844687568566855e199,8.05837606753301e199,5.7693197347079795e199,9.146022523011438e199,9.580308441861031e199,3.7647530919203086e199,2.301940927843219e199,6.808289354783608e199,8.337306718844436e199,8.022559264187046e199,4.346312292459844e199,6.315107538266646e199,8.525877798870968e199,5.984733526906305e199,5.9310458107912525e199,9.493265719315374e199,9.930881310435898e199,8.438962620172888e199,6.400903024373599e199,6.773023701508329e199,2.2950699871556047e199,1.1251106835174196e199,5.730239833297355e199,7.21616690177735e199,1.1826544513889869e199,6.499889786023312e199,7.837808117576681e199,6.32963914302595e199,3.244474889860206e199,5.882109026733403e199,9.002178865080221e199,7.878428989570418e198,6.404882088200869e198,1.641575964202523e199,9.642907692527367e199,5.547833591885914e199,4.327662061217253e199,5.873032703493545e199,3.926548578547413e199,6.140636678669863e198,7.533368904137042e199,2.6286914395016704e199,9.944019927171842e199,8.41890788531099e199,8.322180022710838e199,7.6129384364381645e199,1.7700794506505711e199,8.874727032918965e199,9.126401333049501e199,2.915586182275841e199,8.748042109481096e199,2.5622314413865644e197,3.6994105701476176e199,2.178585476616024e199,9.982566782477027e199,5.039784317927584e199,5.6804157803313335e199,9.532125070872736e199,3.4005271832901107e199,7.511420938307701e199,4.508816694538888e199,5.15864481422315e199,9.485630976693036e199],"im2":[-2.4936259841734845e-203,-3.931621083402336e-201,3.3978446115098346e-201,-2.068400386926299e-201,-3.2836285976197335e-201,-2.4443859307572247e-201,-3.337306540455519e-201,-2.742356591398776e-201,1.0148718730333207e-201,1.2783845238594471e-201,-3.955085106846206e-201,-4.883303283780472e-201,3.142442528190435e-201,9.28529742301731e-202,-3.5130250116574226e-201,4.0250627408012866e-201,3.629501051282968e-201,4.3711938048054444e-201,-4.2404472156990554e-201,6.350495644120814e-202,4.274819750513671e-202,3.663046200523891e-201,-4.6337148252670765e-201,-8.890805012522293e-202,1.7468350372883348e-201,-1.6933157074142756e-201,3.449706235061663e-201,1.2422310289201486e-201,-2.8839086152824645e-201,-3.325407788749697e-201,2.1763197554255525e-201,-4.045490369647028e-201,-4.510595966724439e-201,7.274348217854028e-202,5.8368013814137e-202,4.841873728991414e-201,-3.966252021145554e-201,3.0205268327036303e-201,3.0179448522314533e-201,-2.6063465787013172e-201,3.2413261130170508e-201,-3.585495954499249e-201,1.0531355067751467e-201,-2.564671676535627e-201,-2.9124629655991106e-201,1.658754387413274e-201,1.1098481693449502e-201,1.746275923523243e-201,4.021824325834147e-201,1.6874537476588105e-201,3.0325857553067404e-201,-2.3547098770255382e-201,-3.634836330527266e-201,-2.1567465520769367e-201,1.8339635044597428e-201,3.8808783569447064e-201,4.711938352967231e-201,6.506155479840128e-202,2.2482800003833208e-201,-4.757803827751521e-201,-4.694880668095302e-201,4.049965108110789e-201,-5.583341484458802e-203,-1.1682657137518337e-201,-2.148890573983261e-201,2.4384774107371276e-201,-1.3402018602980803e-201,-4.7852934663490465e-201,4.861126801981655e-201,-1.0720460011649239e-201,-1.0817734354303606e-201,1.4888918983835127e-201,-2.5081843436493855e-201,3.830511154814615e-201,4.45358276523722e-202,3.2447007579364888e-201,-4.9830363858722124e-201,1.2809032031440225e-201,1.8051327374780986e-202,-1.686605818480451e-201,-3.4603025674308694e-201,1.8849949853768935e-201,4.999451060477604e-201,-8.458148725981309e-203,1.095552852247312e-201,-1.0624001968121464e-201,4.405457522460994e-201,6.813986963009278e-202,-3.378325272127737e-201,-1.0863277485676614e-201,-1.0699936021892151e-201,-4.1499313348050085e-201,2.1814965723010292e-201,4.09684977009821e-201,-6.126124682418822e-202,2.1944490653523293e-201,-4.116039933703042e-201,7.524538560944235e-202,4.858362098101054e-205,4.255825718105691e-201,8.217880338033602e-202,-4.510809093076551e-201,4.307941982830255e-201,3.308084228676967e-201,-2.8761900945982165e-201,4.308529745190514e-201,4.763578599881358e-201,-4.8162316104949145e-201,-5.269153521756339e-202,4.577419998638533e-202,1.645696829462408e-201,-1.833851891687066e-201,3.466665577836703e-201,2.6635080452539232e-201,8.310454291516586e-202,2.7406780768166577e-201,-3.81090691813429e-201,4.458705709029517e-201,1.6358897656699835e-201,3.0514080896648105e-201,-1.6618626017180183e-201,3.2352011900757875e-201,-1.5120363887743196e-201,-4.673121543744676e-201,4.50505895704304e-202,-9.651160318938392e-202,-4.254699867591749e-201,-2.3086681199182334e-201,-3.255535791653433e-201,-3.422900473175619e-201,-3.41363368584641e-201,-2.7598537351189346e-201,-1.0639427639020468e-201,-3.423268759541096e-201,-2.1481468824359394e-201,3.444267016876756e-201,1.051822223738913e-201,3.1977275488162747e-201,-2.3638289443103755e-201,-3.930981220577848e-201,-8.138175024834841e-202,-3.110270773436094e-202,4.1893138805330504e-201,1.2554995960015783e-201,-1.0819489859247153e-201,1.1847429635226754e-204,-4.360879396400895e-201,-5.416634373623342e-202,7.556350120487846e-202,6.838337825993179e-203,4.0850101996494156e-201,8.644229964402598e-202,-8.14867721538933e-202,3.644578526276217e-201,-1.7117760284143592e-201,-1.6324487589070049e-201,-1.3567959848910802e-201,3.302015581271077e-202,3.733574735318348e-201,-3.523111947181541e-201,-1.4166374325607214e-201,-1.0313895066169329e-201,-8.385114315016683e-202,-1.1375132186845507e-201,1.2610580641870084e-201,4.760778993032515e-201,-1.8953971090255915e-201,-4.708191845873448e-201,2.6412892157400834e-201,-3.0589361496669652e-201,-6.707136371319969e-202,-2.8548290387874076e-201,2.9998317488121733e-201,-5.120007263501822e-202,4.0430309941953885e-201,-1.8184250979248044e-202,-4.2538242044730875e-201,4.697356302229547e-201,-4.131528632610384e-201,-3.8471174848758225e-201,-3.0461588015649888e-201,2.7356668128145534e-201,2.5008890748254796e-201,-6.0826211049512006e-204,-1.937910961843776e-201,4.138719616697286e-201,-1.369064807353039e-201,5.887629987027479e-202,4.956873818236453e-201,1.3066735828334738e-201,5.161795231287321e-202,4.753716318223387e-201,-3.6049589442403316e-201,1.833198798658242e-201,3.330018735337096e-201,4.107320758926526e-201,3.2162552574753103e-202,-2.235209208208258e-202,-1.5106417521895212e-201,3.679218911575321e-201,2.196644498797613e-201,-1.0038341990198053e-201,-4.28886887080161e-201,2.234502877834324e-201,4.559784796911924e-201,1.4421145429628138e-201,-1.2726656492211072e-201,1.743891234492943e-202,-2.7285953803730255e-201,-2.3028218612088348e-201,-4.530542684697679e-201,1.69705328000326e-201,4.7443354337223144e-201,-2.2228780095768997e-201,1.4307088960655346e-201,-1.6721346034093273e-202,6.956510818905547e-202,-4.09311183873553e-201,1.5622826147467874e-201,1.3960644685869253e-201,-2.7582460719394474e-201,-1.662923700120419e-201,1.1455970868984841e-201,-2.2450162939370786e-201,2.0876077828461817e-201,4.681453305721577e-201,-9.494456133027806e-202,-2.2836830207560743e-201,-9.071855738762302e-202,-7.337711406807947e-202,4.069675191695262e-201,1.1292888392350486e-201,-1.9052736481798048e-202,3.311008450003504e-201,2.5803612905458344e-201,4.1346795348755385e-201,3.579487787685374e-201,-6.964857312488873e-202,-4.8494109141001904e-201,-3.7739661123624645e-201,-2.453397396839717e-201,3.0188668156786464e-201,-2.461857579475844e-202,2.6650619722578645e-201,4.922923432076596e-202,6.23756367769789e-202,-7.417747674296334e-202,8.355055194646431e-203,-4.4919437465813335e-201,-4.530897625331882e-201,1.650444623930469e-201,-1.4086057337770563e-201,-3.1998565829989546e-201,-1.9339329737408396e-201,1.815086395550104e-202,-2.31673412873879e-201,2.5993307811104402e-201,1.8125829346845616e-201,2.6432891611192237e-201,4.860883419777515e-201,2.488110457164805e-201,-7.050779222845541e-202,2.512296364533371e-201,3.8986311940223265e-201,-4.4805208089590364e-201,-1.3989067703932033e-201,3.8851260201861726e-202,-3.661650297044787e-201,2.362598773853815e-201,3.1453145257060224e-201,3.803563578416544e-201,4.622788006296853e-202,-2.9004197958272182e-201,-2.554106707135312e-201,-9.059276524214367e-202,-4.921402748072858e-201,2.186909388817473e-202,3.90024253082856e-201,-3.60588553019682e-202,-4.285263479337997e-202,-3.0327618516541322e-201,2.2757260117438293e-201,-8.940547728306479e-202,-1.5348554478580305e-202,-4.3625973429400755e-201,3.9727394254159055e-201,1.1701591261001862e-201,-2.880578453852106e-201,1.778456425680343e-201,3.768780523486077e-201,1.238413461721599e-201,3.4186267314363765e-204,2.0731465844372527e-201,3.0567614642858498e-201,-3.2635668709368047e-201,2.06388217414991e-201,-2.495186302323683e-201,-8.444147164502521e-202,-2.1700680446514586e-201,5.71232911769608e-202,3.857296338530442e-201,-1.016994956362636e-202,3.297559797864099e-201,1.8216981905340703e-201,3.1343608952850505e-201,-7.950855495225398e-202,1.6645170611944215e-201,-9.139205761668902e-202,2.2502774115976753e-201,-2.1056047728894466e-201,-2.17551001125731e-201,-1.8291627980662106e-201,4.3462508685672206e-201,4.3764970906827244e-201,-4.9749620187493544e-201,-2.7348640281172897e-201,2.1648446173217467e-201,-2.5879854830598602e-201,2.2522231038454147e-201,-2.4439385819757795e-201,-1.079563068988382e-201,2.779776642696617e-201,-4.231983060403688e-201,-3.773106256281861e-201,-3.897869039207111e-201,2.3935934228762086e-201,4.921364421143755e-201,-2.2835728870296413e-201,2.8961036447264533e-201,7.8087517741143295e-202,3.919330174406937e-201,2.5190539313569196e-201,-6.7365155139850775e-202,-4.2220066420269796e-201,-2.518478062128223e-202,4.428742131143785e-201,-9.215091425782608e-202,-3.568329713045043e-201,-1.0187680996767048e-201,-1.6740683259998833e-201,-1.5363862816410774e-201,-4.6026129194742856e-201,3.2881952485345325e-201,-4.4142536659845e-201,4.7920902130208965e-201,-2.234996507273568e-201,-4.643771461707987e-201,-1.5289086943710981e-201,3.480069977921003e-201,3.969737943333162e-201,4.2466367494453646e-201,-1.9932683758354895e-201,-4.946022892544495e-201,2.6385631355774547e-201,-3.577743732864697e-201,4.967362124398703e-201,-4.346230880558854e-201,-2.089816545742077e-201,-2.3515496075264765e-201,-1.0620217093018772e-201,4.433351175479861e-201,-4.194807773843734e-201,-2.3228167468552073e-201,-4.818921087184096e-201,4.516163551056173e-201,-1.1338333845664359e-201,1.9390647954880386e-201,-2.98914470818197e-201,6.110573481017333e-202,-3.936231091255691e-201,-4.9219941971239065e-201,1.6014719348907087e-201,-3.13064021442255e-201,-3.336520903224891e-201,8.81606583839245e-202,-4.173334153030823e-201,-3.7201632103476844e-202,3.9712876876233695e-201,3.1640007808198608e-201,-3.5711401343070545e-201,-4.211470682824423e-201,-2.6700239834206353e-201,1.1458045551355569e-202,-2.1833230087489707e-201,-3.8878631706717004e-201,2.059726974769839e-201,-4.361151777743646e-201,2.701074133015608e-201,6.36442453102679e-202,-4.3307739881137064e-201,-8.639706710021153e-202,-5.137543793543795e-202,-4.669504765303617e-201,-2.9473039028693503e-201,-2.2458233148897967e-201,-2.28339894219732e-201,3.787415181142041e-201,-2.8870323165510333e-202,3.408863590468637e-201,-2.4473388212372036e-201,3.34893265257025e-201,-4.8470238456917626e-201,-2.9091206027142525e-201,-6.217296416690806e-202,-2.7772602308027892e-201,4.487343047075408e-201,8.095589869480289e-202,3.0315064056772937e-201,-2.8880455789474403e-201,-2.8449784962321557e-201,2.9658434315216006e-201,-2.995174305726791e-201,9.028799661418405e-202,4.591893722932708e-201,3.87986796164989e-201,-3.1775121772582446e-202,3.4690281057780185e-201,2.9521733375642205e-202,-4.441868445952033e-202,-2.3399670701864428e-201,-2.206447289817286e-201,-1.7600215552629595e-201,-9.310022595155306e-202,2.8431207733171974e-201,1.2872652979246113e-201,1.996478883903676e-201,-3.7472606904128436e-201,-1.3269182854054205e-201,-2.073487232935577e-201,-4.9285241846271905e-202,4.486916158662454e-201,1.8027458342703688e-202,-1.777972605210737e-201,1.8853669085695275e-201,1.0902900814719705e-201,2.1446227219110814e-201,2.467504117143887e-201,1.4316597634574232e-201,-2.183456224961775e-201,-3.203168435826835e-201,3.8619747237405e-201,-1.3871270583263749e-201,1.923451132146166e-201,-2.5933339996400018e-201,2.381595593502735e-201,-1.3655977045493164e-201,4.244363630072413e-201,-1.070903670520539e-201,3.611482254787528e-201,3.459215130549887e-201,4.0647731469392215e-201,8.264705712515797e-202,1.109777254254601e-201,-1.098404825306566e-201,2.6233103227571124e-201,-2.1564067337746016e-201,-2.9059445596138312e-201,2.1759145742960345e-202,-2.4416250973496766e-201,2.939298435345774e-201,-2.1015571002783084e-201,1.9659559881548032e-201,-1.644070879848578e-201,2.327506622575289e-201,3.521762227465489e-202,-3.628250858868028e-201,-8.432576572589653e-202,2.384126425019313e-201,-1.270311457026594e-201,4.649958441968382e-201,3.3221595188502517e-202,4.2505966075631286e-201,1.6269146306053361e-201,-3.2972852324493436e-201,-4.132466900703007e-201,3.695271464839503e-201,-1.729485298987895e-201,-1.040775194058123e-201,2.101690533471242e-202,-2.505695226289213e-201,4.2133041724834335e-201,-2.8036118263077012e-201,1.815778736966725e-201,-3.832297235049795e-201,-3.0163098367420736e-201,-2.9330722173335574e-202,-1.0520288044901192e-201,-2.519044268301458e-201,2.518325343654001e-201,-2.0254357812785663e-201,-3.671764766433444e-201,-3.0434089753631e-201,7.103716220992859e-202,-4.805573351544824e-201,-1.1197558827493515e-201,2.937915502064261e-201,4.269773290581628e-201,-1.715152634171898e-201,3.822752598787714e-201,4.652151473202023e-201]} diff --git a/float64/base/div/test/fixtures/julia/component_scales2.json b/float64/base/div/test/fixtures/julia/component_scales2.json deleted file mode 100644 index dc3840a2..00000000 --- a/float64/base/div/test/fixtures/julia/component_scales2.json +++ /dev/null @@ -1 +0,0 @@ -{"re1":[-1.6697238793644286e-201,-1.5832014739997755e-201,4.09379180897986e-201,1.7725222704965455e-201,-1.242087892296859e-201,-3.777507038244326e-201,-4.98081123090357e-201,-3.9618431951289766e-201,-3.1438606910386022e-201,-4.298898639109093e-202,-3.2174254536564727e-201,1.8082270765743116e-201,-7.078897484362364e-202,-4.590205688022245e-201,1.6640262185495174e-201,2.3486070947904266e-201,-9.975800753148508e-202,-3.544216350488045e-201,-4.377913576945983e-201,4.8829788828693384e-201,3.8111192750937806e-201,2.635792083609272e-201,-4.210686897815601e-201,-1.4438808266851507e-202,-2.434881302159516e-201,-2.9980797653771996e-201,-4.904786098827346e-201,-3.69941513722751e-201,-2.7577443977537598e-201,-4.54960262254888e-201,-2.9517280815446554e-201,-2.006454694971078e-201,4.717190560511894e-202,-3.959689556278991e-202,3.5876314338457466e-201,-4.92359005844804e-201,-2.2177059053447112e-201,7.228779285215979e-202,-3.198644921865891e-202,-3.199989552783219e-201,-1.3219337672731881e-201,2.705398951982499e-201,3.231300131697217e-201,4.309710021890855e-201,2.7139641356078945e-201,-4.7733894132947886e-201,-2.17171901072325e-201,-1.3238773613700863e-201,-5.886483399019394e-202,-1.142078975086822e-201,-2.4704953947149233e-201,-1.9114370769864586e-201,1.4314524643052266e-202,3.71633112285975e-201,-2.5631672046035e-201,2.886257199263284e-201,-4.2174806582780475e-201,2.9869436895596944e-201,1.903691906821825e-201,1.345385615085507e-201,-4.872219230441833e-201,-1.5193419064133794e-201,-4.216782900133855e-201,-3.0284153773525447e-201,1.5156123522247419e-201,1.2758336566449358e-201,4.2016037512189005e-201,-2.4459467375680298e-201,2.1298431413336688e-201,-4.36358126699186e-201,6.297332854471872e-202,1.5217028458884283e-201,-2.0016716664205415e-201,-3.098708126856976e-201,-2.2483965934994963e-201,-2.2128578412893008e-201,3.459042544836746e-201,-3.35598850451963e-201,3.0296792261096427e-201,3.0217917656783142e-201,-1.4911269357964715e-201,-1.9663128602554035e-201,3.166567760581609e-201,-2.853917794415408e-201,-3.737657602834591e-201,3.009133719257095e-201,1.7089063226302773e-201,-4.95740056194444e-201,2.997239224142674e-201,1.6610581984733712e-201,-4.650668309397348e-201,-3.396862106806638e-201,3.478587467841032e-201,3.554426494667044e-201,-3.74048060112428e-201,-9.679951165258651e-203,-4.1952889967019935e-201,-2.3817141304721823e-201,-2.804476133749517e-201,-7.055346554095628e-202,-2.559926358391591e-201,-7.964070370834675e-202,4.737187272191237e-201,1.4676067528769159e-202,-2.838867391562494e-201,-4.634481137646349e-202,2.150136811573984e-201,3.498244488148529e-201,2.185319735897244e-201,-1.2916192061294853e-201,-4.712136236435415e-202,-3.111106252160508e-201,4.265128972114166e-201,8.327369169177791e-202,2.8338844319741895e-201,2.0880139132545777e-201,-4.108919546998448e-201,3.329973365790397e-201,-2.7846816954197023e-202,-7.856122595091738e-203,-2.2337915739647374e-201,4.67489778412844e-201,2.005116656005214e-201,-3.98475384914555e-201,-2.802457945132506e-201,1.1580113234348519e-201,-2.9277926535064893e-202,-3.804610255807814e-201,-2.3968402765815842e-201,1.0810551271427036e-201,4.390716720612851e-201,2.747775417137917e-201,4.58251900984655e-201,-4.650666256270277e-202,3.2175703024701347e-201,2.5311831756533466e-201,-1.4302524131675522e-201,-2.4547573354897533e-201,-4.7402282243133174e-201,-4.730098727550428e-201,-4.841746149910991e-201,-3.7083750045580154e-201,3.531940412965433e-201,-4.755712553656441e-202,-7.839186032832611e-202,-1.037947348578878e-201,-8.319330772751019e-202,-2.2855515983130757e-201,-1.975497002754294e-201,-1.5238748967705298e-201,-2.2426019495093995e-201,3.2460984881307212e-201,3.9842345841362223e-202,-4.6784045244645515e-202,1.2776033315947599e-201,2.651266528811547e-201,-2.9176755483256944e-201,-6.634683675142859e-202,-2.6484632769401627e-201,-4.920305240557597e-201,1.1462251857001456e-201,2.2722245501895894e-201,-3.394857506913772e-201,-2.230565529760956e-201,-4.014278969627491e-201,1.3679123937474726e-201,5.272832360174552e-202,3.080018443055162e-201,3.339019379643913e-201,-1.4610537883320254e-201,-4.452619044103296e-201,2.195799711109237e-201,2.6344917253308656e-201,4.87755687452262e-201,4.6859805484086475e-201,-4.9919828892797945e-201,3.508335016345859e-201,3.1202697337924177e-201,-2.5565325766194337e-201,-1.4057477020382544e-201,1.9581351091456606e-201,4.572892781764813e-201,5.175467969187261e-202,2.2836557298109785e-201,2.0761827552216244e-201,-2.318749604806951e-201,-3.295297531923932e-201,-3.78047946245674e-201,-5.7624978218656165e-202,2.4811561675626993e-201,-1.0130295461977357e-201,1.846980291602369e-201,4.183964932145233e-201,2.9644093258265574e-201,-2.440326978485857e-201,3.139458294008915e-201,-2.0093882053173782e-201,2.344488913322135e-201,-1.3783095984144731e-201,1.4399202195444558e-201,-3.440344084617738e-201,4.53017898384803e-201,-4.909592627894781e-201,-3.94654940214317e-201,2.613776586306639e-201,-8.472050150455143e-202,1.649070263410981e-201,1.5484405446707862e-201,9.654872896404108e-202,4.105345800238826e-201,1.158837077662639e-201,-1.618490796859883e-201,-2.3274557671524596e-201,-3.9413612299724e-201,-3.9296827715505716e-202,-3.5274257292250636e-201,-9.487063452762638e-203,4.388452081455557e-201,-8.996693436408547e-203,8.088466363522729e-202,4.7157489470365136e-201,-2.116725486645988e-202,-6.572852303505873e-202,-4.4191714869155675e-201,-6.198398047167971e-202,2.5763594735896504e-201,4.64271586435132e-201,-2.7647717605894838e-201,3.2970759770681845e-201,4.756386433750053e-201,5.957662859848856e-204,-1.3741204238912683e-201,-2.934108361911376e-201,2.4721844175478146e-201,-2.86250778896735e-201,3.2556070573127647e-201,6.603472783902166e-202,2.8046005303386296e-201,4.0664649418317255e-201,-2.5878102229773158e-201,-8.519966096933162e-203,3.078491070351454e-201,3.336665924099856e-201,-1.8765978951568744e-202,9.384645346516321e-202,4.710146714027527e-201,1.052168768882077e-201,1.2512180961851756e-201,-3.309710303753998e-201,8.221755229016628e-202,8.389559089248707e-202,6.170596974421917e-202,-2.036978140263512e-201,3.865800988100866e-202,4.888122497359419e-201,-2.405586217219415e-201,4.814927842815536e-201,-2.3196112837295477e-201,2.218157004796975e-201,4.30619537571915e-202,-2.5323710002906785e-201,7.005327186544361e-202,1.511239529537976e-202,4.960969454801152e-201,4.2897718481196315e-201,-4.777580374700272e-201,-4.690333359637836e-201,-3.96036682791996e-201,3.1130631089923276e-201,4.1231505424520434e-201,1.2222147722239809e-201,1.1292644920735296e-201,-1.5309023462327584e-201,3.036393765609927e-202,1.5551016938540789e-201,-1.9606117278960123e-201,3.9084406044198274e-201,1.460376628178449e-201,-4.67405058822979e-201,3.4419865411655914e-201,3.775592203711124e-201,3.284390652293071e-201,-4.3528740946819624e-201,3.5061649591181575e-201,-4.188154166013397e-201,-2.8137319664235782e-201,8.454829677644795e-202,-4.1975944803256845e-201,1.43065872467807e-203,6.219952051690523e-202,-1.824669459751791e-201,-1.4647116207670792e-202,-4.7137981262888415e-201,-7.109474408286961e-202,3.075435074019617e-201,4.405882620080637e-202,2.9308284355156994e-201,-7.087795668306999e-202,1.93550593513067e-201,2.8929829014682423e-201,-3.0552838376702672e-201,4.565291566633884e-201,1.9567185200403123e-201,2.030373565581102e-201,3.383332142831376e-201,-1.051379400503959e-201,-4.342602978755527e-201,1.6123629058534605e-201,2.4579801457082852e-201,-4.813825272707236e-201,4.3922158791494274e-201,-4.562047582668547e-201,-4.6596461827309644e-201,4.3494388846488114e-201,-2.14650090484807e-202,-3.427862977314036e-202,3.0895540327342396e-202,2.269172780533734e-201,2.936879130447106e-201,-1.9791775713333894e-201,-1.0979481125702016e-201,-1.0943824084661588e-201,-4.054765614703438e-201,2.301074555140823e-201,1.758937828487612e-201,4.637404350517186e-201,4.5508453470024406e-201,4.651089637951262e-201,6.707735757040544e-203,3.2484786438669933e-201,2.7478760241099977e-201,-2.828013994327e-201,-4.794684706741921e-201,1.9127464582085102e-201,-4.138301706224491e-201,-3.3896291782194865e-202,-2.176603349334756e-201,9.02958086179406e-203,2.689366502479169e-201,-1.9681137657940782e-201,-2.275363528772355e-201,1.4162285551070518e-201,4.067186566769984e-201,-3.6918085872198e-202,-4.387946901118364e-201,4.767799866663625e-201,-4.381510842505458e-201,-1.8828140052146037e-201,3.0556857649730713e-201,2.129734006712638e-201,1.0182239047594241e-201,-4.472577244836965e-201,4.050782214399114e-201,-3.0407437301491145e-201,-1.1329083247846514e-201,-3.602128452503305e-201,4.6302533037170485e-201,-3.1455934237460458e-201,-3.283385496381077e-201,-4.759096282866054e-201,4.221497466514043e-201,-2.111993936069144e-201,2.6052771600642176e-201,-2.4599788512377905e-201,4.904167669078769e-201,-2.148522931720551e-201,-4.9305812637226596e-201,2.0326632390876753e-201,-2.868436366077086e-202,2.6762522204718503e-201,-1.7149356000910252e-201,-1.025289711609137e-202,6.857600576773963e-203,4.646295158986378e-201,-1.1618811334305393e-201,-3.661951594273257e-201,2.9362470718930926e-201,4.645233831187311e-201,-4.1742359777917415e-201,-3.1886804350315434e-201,-4.172803136041955e-202,-2.8713278546406904e-201,4.874168044593757e-201,4.20933595081913e-201,2.7613701586078918e-201,-4.702039514800944e-201,-3.56856929586563e-201,-4.43001765342725e-201,2.3994286321289636e-201,-1.4336522398128407e-201,-1.723711871133324e-201,1.4055854618640508e-201,-1.386932507843387e-201,3.994946719037651e-201,2.5735301269988428e-201,-4.63910493351794e-201,-4.10915706985045e-201,3.0558266610255652e-201,4.517516073127301e-202,-3.6909715685082854e-201,3.697702023750299e-201,-4.653274957616186e-201,4.553466046156651e-201,-2.1924285012801635e-201,-3.203341656060781e-201,2.198094166232196e-201,4.896198389276288e-201,-3.544442042468962e-201,3.3179848601933315e-202,3.2419122909379928e-201,-3.7481739684457025e-201,-2.1852346404496715e-201,-3.2961230520115995e-201,2.7064567296476282e-201,1.5590679647541955e-201,-1.1147799547800286e-201,-2.0338369933552525e-201,3.3548023259710876e-201,2.7003902997505705e-201,-4.500305406109917e-201,3.1566596990411737e-201,-1.9716675071079235e-201,-1.063415362822126e-202,4.7599689416810676e-201,-4.0492348575323574e-202,-4.630124628871379e-201,-3.056047178835256e-201,-7.788201581075827e-202,4.3245236069915674e-201,-3.393039361454008e-202,-1.99783993347258e-202,2.724881232958141e-201,2.650091355239101e-202,4.9547530588599454e-201,5.273092271161129e-202,-8.078998394344086e-202,-1.740119548875436e-201,-2.962219984708877e-201,2.869516005265145e-201,2.234103325464549e-201,2.0391227687867652e-201,-3.2398593465177893e-201,1.2365212957688864e-201,4.106829578066818e-201,1.7706872981854383e-201,1.670759854324327e-201,4.492713566594829e-201,2.863453237323987e-201,3.389188379972808e-201,-2.165641337013782e-202,1.8276527624224585e-201,2.0175907095421166e-202,2.4413462583169793e-201,2.4798650127175106e-201,-2.517947606693963e-201,4.0543928788946685e-201,2.2792306606809037e-201,2.872645107583323e-201,1.6343618996486204e-201,-5.028660780587933e-202,-3.70494044034883e-201,-3.345827549400772e-201,4.700106875631418e-201,4.48335987917652e-201,-2.2762276072138966e-201,4.59241251492325e-201,-3.1075523160837827e-201,3.408862055173529e-201,-4.980980764170146e-201,1.3266972785530504e-201,-2.1802703087203466e-201,4.8517686854784154e-201,-4.025784523613258e-201,5.253167075970932e-202,2.9820983901108923e-201,-1.1269291967115077e-201,-3.1556895385787343e-201,-2.5234294082344423e-201,-1.4985551671627749e-201,3.364613003349753e-201,-4.3171557304630234e-201,3.2520169272411276e-201,2.544536757618719e-201,-3.6171966310439915e-201,4.8581136595569035e-201,7.347830370352174e-202,1.6564569651649525e-202,2.347008217834509e-201,-5.406892245684736e-202,2.6515623709896213e-201,-2.7366960292499665e-202,-4.224881933882874e-201,7.555696118209252e-202,3.723429985701064e-201,1.518499357923865e-202,-1.0626159875051932e-201,1.7303876965198657e-201,-2.8300179738900966e-201,2.7628273961712576e-201,2.2266748194958997e-201],"im1":[8.459803576926952e199,4.096740176735712e199,8.063204208991473e199,5.8114640889151815e199,3.935329383637742e199,6.1569887723677265e199,3.588536992246424e199,6.857452057728977e199,2.665280351930709e199,9.613987682261959e197,6.342311602685882e199,2.824459847566475e199,1.2732982300290473e199,3.884519411610168e199,8.494897873154279e199,9.459294277873664e198,2.1548755817769527e199,1.9918753535540168e199,7.409719684213737e199,2.8796361580221597e199,9.40077698143205e199,6.353270630135119e199,6.617901414731241e199,6.417062469211981e199,8.719289909170444e199,6.955706408973694e198,2.261688792479408e199,2.659195520401005e199,5.053926171296139e199,3.2519512891707612e199,6.204220349699597e199,8.454161154057e199,9.038308924668082e199,9.331587287860164e199,6.933709371223429e199,6.774709942759199e199,1.2843484780963198e199,6.1460881022547905e199,2.3538388523848673e199,8.63951635640961e199,5.487570310049516e199,5.750528406525358e199,9.349988031328908e199,7.497245763557434e199,8.531255917452509e199,4.784190571493053e198,7.105176095064832e199,1.6065872732192842e199,3.3184084924532153e199,4.840784336171356e199,7.3231880778634685e199,6.1240902379972715e199,2.6466597198743825e199,4.3753159580896595e199,1.750528141179739e199,6.169329952654228e199,4.12489259516466e199,7.499132250515464e199,9.76342678389263e199,8.630001308418152e199,1.3657347947001785e199,9.256306664898592e199,4.5442574067530936e198,7.014058790210354e199,8.276671193299746e199,8.096077239220958e199,9.199754009687597e199,7.854932961023587e199,4.331342566828958e199,8.0335825662723e199,5.118963445416761e199,8.56378965990831e199,6.6657973870111e199,1.2620223218427594e199,5.597057712708202e199,9.593756628685165e199,7.260245093156897e199,5.074100642702537e199,2.4089248167899924e198,8.829258167944211e199,1.294444597357891e198,7.4056431913456284e199,7.354018224360304e199,5.8938975253815585e199,1.2774412101213138e199,3.456579957136885e197,5.887000529343166e199,4.25796200429756e199,7.377157224528084e199,8.180108600290608e199,2.3767509007685063e199,6.719174468143599e199,3.688954403140426e199,5.948844801766229e198,8.138678567645924e199,7.064956004945125e199,2.8408259843049077e199,8.000531196053461e199,7.0925730004157324e199,9.24245580103064e199,7.236700621801469e199,1.5782074587771366e199,7.151385669002696e199,3.566731036928503e199,9.337951875109967e199,7.747956049361726e198,3.559769191378982e199,7.147541158913894e199,4.016870405963952e199,5.112414737892737e199,4.620413334522026e199,8.025032846299595e198,9.456712964969264e199,2.471822034951765e198,1.969856993606337e199,6.309094581897012e199,9.927890618481759e199,5.260098426211312e198,7.996238603714759e199,1.1039185090589031e199,5.482749866375715e199,3.260487667331954e199,5.149037599385107e199,4.280449371746128e199,1.0198115370501914e199,5.440257564386629e199,2.229019900971103e199,8.941948267871048e199,1.9257606452907084e199,3.4072635631604085e199,3.8046277573008613e199,1.7486824852854576e198,8.232293045485033e199,7.371671009968675e199,1.6595428468594786e199,5.072265960088411e199,2.3345398179973107e199,1.4437385913850554e199,9.86384321788311e199,7.984721770328601e199,9.095221999116104e199,5.255003057894055e199,7.79052265358777e199,9.769758328205127e199,1.4985093081208144e199,7.552858910637539e199,2.593082039087523e199,2.512260468962568e198,7.381074565493512e199,4.3676811989672445e199,3.832785573156038e199,7.421718041680888e199,3.6888519271173745e199,2.5212467820497564e199,9.146485192457245e199,5.9480609175706435e199,3.371326202371492e199,5.371693838005948e199,2.4799733077190765e199,6.267552230891648e198,9.616616168186486e199,5.744160081621063e199,5.9644359587200165e199,4.8745138347038676e199,4.4953811137027784e198,8.007985666783636e199,7.489108314165427e198,4.510723776386896e199,5.8834793886390735e199,6.3682296805401845e199,7.422646582256104e199,6.647398748838332e199,2.8751660584665473e199,8.900807881035338e199,6.873168415529333e199,4.1127919755279204e199,1.233328453624517e199,5.862468130355115e199,5.727680551085454e199,2.420176580315536e198,5.3435950245345754e199,9.973636506755942e199,1.9656347831505717e198,7.175346286001648e199,1.2364929388479896e199,1.935735374765909e199,3.4138043650368797e199,6.375159010644597e199,7.30709213249036e199,2.862041405485873e199,2.4917835536346886e199,3.9957469355206805e199,1.4506560748830643e199,6.893389462949022e199,2.6402068893879215e199,5.3227302580898435e199,3.884472572573481e199,7.561754748855743e199,4.036333778909651e199,6.723967356646566e199,1.5937213658824943e199,6.4474526221610905e199,3.783338718939668e199,9.19037921859575e199,7.902104731796011e198,8.5438755576497e199,8.341708971767413e199,6.442233492436128e199,4.935098613295413e199,7.815542282052046e199,3.1762885854756284e198,7.1606787043989275e199,9.09259940424213e199,9.871082261174783e199,7.217079053612125e199,5.504931757933332e199,5.628273721317457e199,4.255711836606749e199,7.725159692077045e199,2.663884828083497e199,6.688675549779488e198,7.5313940968194504e199,1.7750067598393392e199,7.705597916656388e199,6.366437458119721e199,2.2335740062794486e199,9.767654055028457e199,5.277701002066995e199,6.162317661068136e199,3.2595297782389862e199,9.31500852071541e199,3.186949576512572e199,1.9564865611129377e199,5.0051335009441144e197,6.572724352501535e198,5.351773525435107e199,2.148460530628977e199,7.861064936573316e199,9.201853729126215e199,1.6426233632504894e199,8.896759826938088e199,2.452698368111845e199,7.716738637032541e199,5.393284515385119e199,6.33507104607568e198,8.716066828212788e199,8.040289954054328e199,7.679358756848186e199,9.378377397862724e198,3.0641813312090216e199,1.6739839944606415e199,4.105093623195468e199,6.937882536150727e199,3.3780614578037437e199,3.6609826936746604e199,6.652391602609287e199,6.635038793687289e199,7.71522448620694e199,1.2486261057214297e199,3.3549421698758076e198,8.357653013607316e199,8.102428626380202e199,3.0526965487185377e199,3.2971083899682074e199,9.876102079766946e199,9.578433353813003e199,8.02999228442593e199,2.992626090425029e199,8.25417708847113e199,8.923275984578176e199,8.180478502404576e199,5.808671761058589e199,7.983984710987619e199,4.217666463658746e199,1.6536172480793321e199,8.531019991588248e199,2.589051359654161e199,9.929122721799942e199,3.5271149147093893e199,2.340511759971203e199,3.197927643260735e199,8.677947013835805e199,3.2053624763994903e199,9.848446438257186e199,5.921773518374356e199,3.187531653718012e198,8.69714854677328e199,7.989618967652177e199,6.644989699667385e199,8.057984337481898e199,4.121709053794459e199,4.61272300653345e199,4.858413887717324e199,1.0476959641765593e199,5.324300288735114e199,3.3111981760490183e199,3.195237516583841e199,4.774367498132325e199,9.99011419230383e199,9.798696386874683e199,1.5268339909196071e199,8.7554681478712e199,2.1586306255946672e199,5.201292076699917e199,8.283264984534863e199,3.327697689414334e199,8.671188975005654e199,4.3035187575256405e199,9.31731550718076e199,8.67205620974492e199,1.6603381380733428e199,5.793093528714743e198,3.6216661327095957e199,4.5907872251765847e198,7.627153294563213e199,3.320082724228752e199,2.4421154027040125e199,8.427401653216115e199,9.300497978886447e199,2.645766405333788e199,7.879408503582152e199,8.286980625714173e199,3.1348252755394866e199,7.615458450118272e199,2.8464644765600564e199,7.586832781033477e199,2.897147148315526e198,9.880087954074373e199,8.321978338696641e199,4.377588594046616e199,4.745959182029482e199,2.4759049249584087e199,7.523951106133859e199,5.39816795472442e198,6.116273141685882e199,4.3099816449441105e199,7.2909170802577055e199,4.85707054089666e199,7.2792926224457665e199,2.4905971176256356e199,4.108841566350806e199,8.506172017264258e199,4.079202864591781e199,5.6712099086648644e199,1.8173114986061443e199,6.233754138121975e199,8.694106843918735e199,4.833048070070429e199,1.4215702273166919e199,5.747355761819547e199,4.268026550944669e199,2.2345641799651725e199,4.0416334325390075e199,4.173209668954429e199,1.7002505553348944e199,7.0895931064842965e199,9.133360630659708e199,2.378444856710349e199,4.64853011547126e199,5.136525326036279e199,3.868428838207598e199,5.165432105426638e199,8.668539175641157e199,1.04048450826269e199,3.1567096073395827e199,6.927373918925821e199,7.619925408652385e199,7.925442045746708e199,6.52056295506131e199,3.0217639294215005e199,6.665968575699133e198,1.506737815692465e199,9.864733387012813e198,9.246145846758514e199,9.062856398511474e199,5.453401256652513e199,8.813330437439601e199,7.152553065533564e199,3.7048888059188445e199,7.986079392130888e199,1.8237760043732788e198,5.713587097807485e199,7.907859486258439e199,4.773854974066989e199,6.260141764755577e199,1.2483961945936706e198,8.936689887241654e199,2.7786324590772924e199,7.264753915318029e199,6.21189685020096e197,1.1177670057887212e199,5.085259565465636e199,2.24397887641964e199,8.193516421998556e199,9.087738783895785e199,1.533966043826702e199,7.603696819991472e199,9.529702811059807e199,5.552697204997589e199,8.459268392811054e199,9.036374110000762e199,1.2138022150382954e199,2.0980777924779147e198,4.7805897532686365e199,7.695972466548074e198,2.4222559459762538e199,7.8264455974392e199,7.73078229311397e199,2.0250150516099152e199,8.314779489517588e199,4.934393990613239e199,1.6245744668654572e199,5.718506836105141e199,7.54454470511415e199,4.712637782586531e199,6.765738594547561e199,6.485806305834831e199,9.839593843837161e199,9.95955612302793e199,3.9150149098193194e199,6.468800830595686e199,8.908619449440458e199,7.522965190726384e199,3.967139930324345e199,9.108232329826934e199,9.159490309831645e199,3.2704637889134647e199,2.0979514321408764e198,1.5419597214420043e199,4.41207036831337e198,6.884303227823569e199,8.806645974952703e199,3.99773360360118e199,9.3909687700161e199,4.600958067510083e199,4.737590827749584e199,1.4250754497749318e199,1.0317038622089037e199,1.2493848983845412e199,7.079316984731957e199,1.6689576122922866e199,6.640279200621365e199,7.482888110675201e198,6.78074701727864e199,3.4493488364489756e199,1.5583824819843616e199,1.7005353300819336e199,8.14849718653708e199,7.225557386914809e199,5.763872456420359e199,5.720136754702482e199,9.378225670276047e199,5.4469297371206145e199,2.4850057013308324e199,3.2188492338791362e199,8.901058808706445e199,9.593650990666803e199,3.5427419797956284e199,7.820763351406005e199,7.489839169405931e198,1.120132405933293e199,1.890602634538212e199,3.451406426806729e199,7.666700537969636e199,7.451926917657457e199,7.470109927812002e199,1.8693425215993585e199,6.700733312040071e199,6.640509247801251e198,8.632669146771972e199,6.4435078026329464e199,6.318088055390531e199,3.2801862859006134e199,1.2849093801958755e199,2.4888530690985555e199,8.701586787120441e198,3.3172940563397223e199,6.4566730809569385e199,2.8393139952382996e199,5.459685274544976e199,7.974763703699197e199,6.953323194193572e198,9.369072036597202e199,6.324522278531925e199,1.3034889390057336e199,9.753882106369622e199,1.0933956712353198e199,3.918254743621804e199,8.481403248542763e199,3.0493625941487435e199,3.979444396849857e199,9.319927042557481e199,4.069056592257314e198,4.778995594215579e199,5.251477954676114e199,5.754156701376463e199,7.742290052382076e199,5.993484264300541e198,2.0318577548072492e199,9.010548586954678e199],"qim":[-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0],"qre":[0.8865106679724405,57.49744770529232,1.5474193581240627,8.11526412704103,0.6499340718694749,1.7028937045126018,0.4618050815688521,0.9694923242968845,0.6184752886893851,0.0983931703688892,0.7544600183009599,0.5062447883949175,0.17513060921982618,10.941001033932098,5.049430578633746,2.1754351285350166,0.8114826291120523,0.27785486195750514,0.8371459290653228,10.937707843603707,7.652652156667487,1.8141300426041822,2.2582749160791424,1.7757248259253786,1.1679391562857777,0.07672047374240501,0.24623317245415652,0.636123435919785,0.6842409819726307,0.5448045001207896,0.943887709488942,1.3016458395547603,1.9780641001633468,1.3595994333511292,0.910141586760147,0.6806494352825455,0.34376988366057093,2.3198205873451347,0.5618503329181165,8.865692192387337,0.7225402293848961,0.6229553988354999,1.7181127799552278,17.92547506925519,2.560673007850251,0.09435528375658886,0.844216915022704,0.16229742538324043,0.6337062316876784,0.49940437124185866,1.1165978533408145,0.6605594131215249,1.2997307853693725,0.9616597094956584,0.1990924430256976,0.8597861935335732,0.4129874842003844,1.0305913276354868,1.0487657719907015,0.9103244457447411,0.2549405276424742,2.0342300608422597,0.06869562305482124,1.9233074432785386,1.2019227772055396,1.0294314908757136,1.1904242186528826,0.9167832132443611,0.6097794536704104,1.8365609217951049,0.679328066616656,1.6133196180132996,3.330865792199491,0.7156236580166357,1.985563209181691,22.09276244526849,1.0385456103676214,2.5779774300813822,0.10507250042903434,0.977870903898924,0.036825596766146655,6.828161223980843,1.8565597268820395,1.120597062841152,0.17336703063900288,0.004724409416120933,0.6330043195314501,0.6475259373429892,1.3724504185319513,1.4381859794276506,1.733882414371372,0.949027214013506,1.1075167500696856,0.06942633526838399,1.00715132724147,1.3351650648394555,0.9979480496414687,0.9041911352403126,0.9952572427019023,3.095161143295836,1.7149068711701212,2.6483200842152366,13.958686766941844,2.1755365799290707,1.5801368452867997,1.0814711227952478,15.497979989174796,2.053677109669377,0.753469057025494,0.808382747659274,0.8307849779633261,0.6200018646278013,3.4105714159053506,0.03546465673835943,0.4831639750859538,182.87470190790813,1.129097247110026,0.0866250525667802,1.107201457952968,0.19249969006950962,1.357909265007061,0.4578590700360155,2.0272030342954475,6.570373689318275,0.15633892941901714,0.6591760802524965,0.3100768832063079,6.615339385507732,0.3949457101012678,4.992070147129316,0.5642243219047921,0.040114100768393446,1.1707459866922847,5.29770401179575,2.6825161061634337,2.617040979815403,0.2347196585635654,0.1509613171392639,1.1091343290334978,0.8315478013146524,20.818606191704006,1.48806674205233,5.302606017794287,3.8150591262537197,0.22311455098497113,1.2198674352162906,0.6719787342881434,0.05473694012447871,4.182675501144107,0.9968597335663011,0.9173282056580673,0.8723770453454063,0.4728627838574194,0.2711693920477907,1.1519458298342828,1.836659156452409,1.329965814749025,0.5713944817726659,1.9604536723192554,0.25414610375471763,1.000970043509983,0.811091291203989,0.9479209747628432,1.7688974853553086,0.09735885319778072,1.7148697631488468,0.2650025854552764,0.7415094034632705,0.6516156024054606,1.637576925610197,1.6526622392989208,1.2901856113759724,0.7180989087005655,0.9600227334715746,0.9900839269190989,4.0771037342063625,0.1860132699062789,0.8156685294154039,0.5862224841505698,0.23038258305955972,1.1322105532619704,3.8142307638786095,0.02456507301099902,0.8348908713213457,0.15653136710684978,0.910491651368963,0.5946536486168569,1.270080386799922,0.9838079622844828,0.6027884622461753,0.2594654891488337,0.48683032819778777,1.2834428635247899,1.755075448543555,0.48904859899859787,0.6200697329953273,0.6731968951837384,1.340736621203352,2.1558901833700346,0.9332148052724067,0.3665073414885607,0.834099374581007,0.5885259549516296,1.9136676602778757,0.09909199166795167,1.7683519363831637,1.555120074613934,1.2460028162084404,0.720579227465465,1.9428746749573016,0.18435490554645975,0.7273759850516114,1.1961893905648378,2.200039338178475,3.235382482429632,1.5391590494049756,0.7946026765632322,0.6001257771957641,1.077234123171807,0.2867845453832008,0.13593469836122046,8.488079264752043,1.600313057783743,2.567676889536371,1.4037183806868818,0.4182247437287424,1.1969248487605482,0.7176979253700155,1.831100873667759,0.4006135923535457,2.9981226779867245,3.0792146114596566,0.235623062175865,0.012851994544610421,0.14351713481408526,25721.41126292867,0.39252915617637885,1.025229766502151,2.905193809246585,0.45773401403169595,0.9063475991562757,0.28602736710306714,15.865708827830872,2.3772875471370973,0.1565931799721411,2.315311605831491,1.0113144547968669,2.3531762391156783,0.174991108525372,0.6979218002880778,0.6489265812400282,0.5111093101381081,0.8458809039265829,0.36671125573525426,2.0215757896840416,0.830631441875523,2.130958029201704,0.8155700391173301,0.18352564033190294,0.0886809865319723,1.1728657506158415,1.484232100889609,0.6443928018925065,0.8798607037335284,1.0568019643225777,1.486053748874042,21.999156879797287,2.9423665486995922,2.0094484004135422,1.5066734759577822,17.78420321220787,6.36985251868033,1.2030237981136098,1.6219462465469863,0.2439055289808097,0.8943632679849522,0.2790377450337714,3.8449534347216128,0.39580487995712754,0.2410836137484896,0.3280941831352828,1.6064155315832087,0.32944131994713677,1.119394179851286,0.7797505856202668,0.21715809026311847,7.5877575431977515,1.4451397392770668,1.047732069424579,0.8382377982092538,0.5402511729626309,4.461798834291313,1.3025478290679542,2.9702771451417562,0.9496319696229337,0.36883508841502055,0.37066521462879193,1.3383304445871766,1.4792162653269099,2.171465638698639,4.730487635072472,0.9507052676336211,7.520257950766643,0.6240157066047761,1.05126045589295,0.6157758577484892,1.6599498820861,0.4617678969619845,1.4593782091101852,3.4573219515517373,0.16607677737047494,0.1235400884096853,0.7434560371874561,0.05547609588008804,3.0957011497220788,0.40444043307261834,0.445375285430569,1.9323818240461579,1.323298045085998,0.4921712032516913,5.367367633492102,1.278623902817347,0.32771874804117895,0.7640325543554226,0.3821375011134328,3.756792264688988,0.04272949479913089,1.0899368296047103,2.908114493837796,1.4422438817220753,0.5351292993717023,1.4687458393521626,0.7669436081410157,0.32781080341523744,0.6893334554955323,0.8811203024613791,0.8215940976198163,0.6923169909112153,2.247840081463819,0.6069892336131412,3.2478202363685997,0.8654141828373492,0.4390814079014263,0.8572413943250972,0.22435973646062246,22.324649275480258,1.1098209706257323,0.5570929386285692,0.5248710036371959,1.3177870317154048,0.554880267205221,0.8158865040872265,0.9823038431118635,0.5668051235794656,11.872992667916064,29.44691968480099,49.36430925217182,2.413960099501929,0.6601463827460455,0.5780089050982602,0.7745446791003421,1.057026935551559,6.477637169352213,0.32163765035857483,2.634768695419826,0.7548519041977532,0.8514044362657023,0.9343449990976509,4.476384098230053,1.048259307448373,2.329440891533277,0.29875281569213313,0.2169691682380707,0.971290897998146,10.947010345575674,2.18675895258153,2.866196680409985,5.294899591735885,1.5019461173218636,0.9389591459659246,0.02405804955198601,1.1802150050653326,1.7772729636396531,0.5455498353703405,0.8556356788472447,0.02907413752010958,3.586724815488004,2.37027461869689,38.23871079640259,0.0063323593880133065,0.20101916897597813,1.4192564156889151,0.28823663604169936,3.190249135604482,1.6070746331110786,0.16912189642376868,0.7886793761268907,2.8101290331127045,0.7220654376305202,1.628159123304916,1.3980657867501851,0.454361213567419,0.039522609579587205,0.8759571604297032,0.11120115121238998,1.8882331845881717,4.271505957811082,0.7786958952922528,0.24656342712035728,1.7751530199235364,3.1082707800147604,0.8247012890188198,1.555654859027668,1.1450726596472742,0.5995690837391888,1.7285753759915845,3.325595913724708,1.017503968076115,2.1951418808309415,0.48157314268676094,0.9805832008206882,13.928169334287514,0.8544772162182375,1.6188751852066683,1.3588803292186753,1.036832856294965,0.504793404516071,0.03548316922465224,0.30585909545757695,0.0736465836963817,2.7419796904208456,1.2926931136244826,1.0871870361902451,1.1484752600311519,1.2114302728208612,7.261356221929679,1.412805937317456,0.5505391743132731,8.509316079725574,1.2866888399792231,0.908788941753899,0.8492854017459627,0.14939161939527454,0.9495813375065294,0.3830567804015577,0.24289972082632946,0.2527461275686792,0.9693418917280441,1.0036089835286448,1.3238954079401146,0.9326035105656673,2.8962734625521365,0.562977025775618,0.2844659883893774,0.7815727246249993,1.1043080090211868,1.09928071997701,1.3604810421675788,1.104204590214239,0.27260821514199374,0.16156848744995853,0.4590536961906583,0.4721063936348732,2.590002373495073,0.9678189563366996,0.95031603859872,1.2504326369328838,1.0515038146951254,0.7745631977747663,1.1182172446736032,1.8369005569530583,1.78294664114752,0.35131181259614225,0.15289441427274025,0.48423400895847934,0.09840576239394912,0.4828638862461844,0.8764520969817875,0.5015904167409038,8.953741438713191,4.562664907335399,0.14106640665729608,3.0046664045946954,0.6572306573610143,0.7557549221252462,0.9911821814101811,0.14051844943229647,0.6218002227042756,0.9326349476653486,0.9318869762662095,1.0691048765643796,0.95276400134461,0.4146653214888676,3.8514609995755076,1.0699619268263059,1.030858582898466,3.174711248193092,0.40777118325943984,0.3076169450976323,1.5247906482826856],"re2":[-4.511579013364899e-201,1.170057629037956e-201,-4.51632238620012e-201,-2.1698673878294073e-201,2.4795277488389336e-201,4.7893150032935176e-201,3.999884181963801e-201,-4.253086593537565e-201,-1.8115042103775442e-202,-1.4585382535034275e-202,-4.536400916753715e-202,1.0397744679295298e-201,1.625172066623243e-201,-4.518640278331317e-201,3.341082215157453e-201,2.0113842988614586e-201,4.8579619721270535e-201,-2.976832084574491e-201,-3.435837204754664e-201,-1.7739191702659952e-201,6.078029608985471e-202,-3.2028960372154957e-201,1.0381331983851564e-201,1.364410107928261e-201,3.831003862844384e-201,2.643655218090975e-201,-1.479353156637168e-201,-2.6720451895613227e-201,8.209244487434128e-202,1.75815042441692e-201,2.837779623224364e-201,2.0201891115448745e-201,-4.495695252459222e-201,-3.533550456682125e-201,-6.192911513401265e-202,3.1836795686236975e-201,-3.0059655744324986e-201,4.562426684046515e-201,4.286077885231148e-201,4.17002581352082e-201,1.8297234153939917e-201,1.24854813709911e-201,-4.7585645317951094e-201,-3.34693207156154e-201,7.726071611120296e-202,2.3115614335225226e-201,1.138066687091209e-201,4.192214260262307e-201,-5.735054796848105e-202,-4.721064456397075e-201,-2.990589304848109e-201,-5.8092170301087405e-202,-3.773329386568709e-201,-3.136797840989086e-201,-2.013134484096739e-201,1.9648907930506e-201,-1.8856443699415516e-201,-3.6494083070900604e-201,-4.101761791079317e-201,-5.955434458446015e-202,-3.1252000268799395e-201,-3.926980052794435e-201,1.3930298987945957e-201,-2.6696962682191205e-201,3.0749486599639776e-201,-3.892659005614181e-201,1.678180131921383e-201,-1.1565284797485067e-201,5.86888735932467e-202,1.0544941120643912e-201,-4.644289364857437e-201,-1.625720959032095e-201,3.0740430894140185e-201,-4.479019172153521e-202,2.0360352795095542e-201,-8.120916140249215e-202,-5.541493616284867e-202,-1.764435545365871e-201,1.0789954978021e-201,-1.4791243699430237e-201,-3.037986658279477e-202,-4.750333830305541e-201,-2.0790338067873926e-201,3.866819108334404e-201,3.9180414731923635e-201,1.0593495058605075e-202,-1.3509041057866844e-201,-3.5755734494533375e-201,1.93625572532869e-201,-2.6589582464955453e-201,4.746265912938453e-201,4.221222365560232e-201,3.443115832481337e-201,-2.392255281234755e-201,-2.5189518318845172e-201,-1.0873899030022785e-201,-2.2024616310469812e-201,-6.159661250431703e-202,-7.0665693185364285e-202,2.6763193823157784e-201,2.793689597508541e-201,1.2356353266638145e-201,-3.394867962406779e-201,-2.8116487276164813e-201,7.494385731934948e-202,-4.509137484764711e-202,1.2372551887430275e-201,1.944779282450342e-201,-2.8668912835720716e-201,1.0537469939534597e-201,-1.1457945809120874e-201,3.399766769271974e-201,4.209253229525298e-202,3.483228129949032e-201,4.220372830414563e-201,3.686036211797003e-201,3.719157044721429e-201,1.263199728003387e-201,3.837625555915486e-201,2.996160211877416e-202,-2.7891946417253454e-201,-8.817784658814242e-202,2.1823824233130675e-201,-1.5828414708582825e-201,-3.2968763104621094e-201,4.3467798265456046e-201,2.612855388009759e-201,-4.036972376800178e-201,7.9347298124725595e-202,2.5188784016204457e-201,3.986061820947447e-201,3.410932101914684e-201,1.1305908279958841e-201,-3.1314206354566074e-201,-3.2225981301052107e-201,-2.2228248224211665e-201,-4.685845407269706e-201,-3.293349932753141e-202,2.336692612505065e-201,-2.6143142986885247e-201,-5.997185843941475e-202,9.324862141044308e-202,-4.379847051322017e-201,-7.046584659208712e-202,4.276669231534412e-201,4.6709130266863385e-201,-4.8164304104036526e-201,5.927164012815255e-202,-5.603497787096256e-202,-1.6737420154850722e-201,4.899572883048163e-201,-2.5135969941631552e-202,1.2210297089636788e-201,-3.629781601244204e-201,5.23439261083807e-202,3.2653220914567323e-201,-1.7121634721788648e-201,3.637714839810292e-201,4.752621850178132e-201,2.168246041509287e-201,4.406492108484128e-201,-5.707934617344056e-202,-3.2569591213960824e-201,-3.4044790984789844e-201,2.8103641565972816e-201,2.4471003863965807e-201,1.8862230089427705e-201,-3.4760499052685525e-201,4.691902708199093e-201,-3.8323395119077996e-201,1.3139526280715615e-201,-4.7751037150588425e-201,-4.8040431601323705e-201,-1.8330503345314962e-201,3.925355819657368e-201,1.5418854930444862e-201,-1.0613930165659023e-201,4.845685913645832e-201,3.693199921032521e-201,-4.582735634671295e-201,1.8144589151026072e-201,-4.1134553018727025e-202,-3.4863501345735016e-201,4.615077238288694e-201,1.1958816292684148e-201,3.0934364095176572e-201,-6.755914501254892e-202,1.4806016891011618e-201,3.3496907056559476e-202,2.194132199259829e-201,-3.600586911031055e-201,-1.1819497640000051e-201,4.8925700015157384e-201,4.4370384140865594e-201,2.5830273638696885e-201,-4.569292215402861e-201,-4.2038484271999554e-201,4.948075767168336e-201,3.334120338703818e-201,1.9718296020923425e-201,-1.6113258221995474e-201,-3.40580632038756e-201,-4.7292269428704605e-201,1.6014104365547086e-201,2.07103149631886e-201,4.79590157839358e-201,2.1159799587059408e-201,1.0238906596488416e-201,-4.8523004386005085e-201,-4.7587492817330845e-201,3.6701027951355417e-202,4.937637973641153e-201,-1.4053737341430927e-202,-3.8231845219907772e-202,-3.9753503086709404e-201,-8.296554210656245e-202,4.840732675320808e-201,4.827691723624159e-201,-1.7803375531698207e-201,-2.7128922480193073e-201,-4.461741743695412e-201,2.6299834323092444e-201,4.784399397832054e-201,1.872855758104217e-201,3.105988905470405e-201,1.4061551769155513e-201,4.174279911686042e-201,-8.919763110790623e-202,4.086507801704784e-201,1.0895966698283508e-201,-1.5489124921245846e-201,-1.8479763349561672e-201,-2.516728198690381e-201,3.98269582621705e-201,-2.63229668728411e-201,3.921845837888119e-201,-9.398095773661218e-202,-4.7880086398651785e-202,-1.2032290395333731e-202,-3.754572810467795e-201,-1.5346686480726465e-201,4.203926379343335e-201,-4.790847731922271e-201,-9.661527571909014e-202,-2.2724613768793687e-201,3.310403781086529e-201,-4.99267933590245e-201,-1.5341114584578386e-201,-4.527860568519688e-201,-2.1135988252693315e-201,-4.0717724490231336e-201,-7.644684671936132e-202,-1.631374216931832e-201,6.726959620361973e-203,-2.1048645025498303e-201,-3.436770875732382e-201,-4.403494534777066e-201,2.2544062449498505e-201,-1.127287440728522e-202,3.7021599025726504e-201,3.2541372434360776e-201,4.761136442942991e-201,-3.1153187455822563e-201,2.663781935345348e-201,4.891288903098776e-201,-3.038402645677972e-201,-3.5332855849604763e-202,-1.3561551814196829e-201,-4.650948414312968e-201,-2.3249722946654105e-201,1.4498764521380392e-201,3.779263383869624e-201,2.153003814710054e-202,-2.169488039329607e-202,-2.3522935963196743e-201,-2.269703786265247e-201,2.228250465972892e-202,4.2065497588339886e-201,-1.1586117843232882e-201,4.479966483224043e-201,-4.226720213041493e-201,-3.850301223991619e-201,1.8322949968579818e-201,-3.2373107916544385e-201,1.9405401777491297e-201,-3.4464425618576866e-202,-2.8874327273487343e-201,4.934295192397014e-201,3.59997820880045e-201,-8.246734145193638e-202,-3.567551588872071e-201,-4.0537099444735965e-201,-1.929947014903065e-201,3.321232528683199e-201,2.620519025738367e-202,2.866334410785181e-201,1.808133348094047e-201,-4.038120424344536e-201,5.555480483692808e-202,1.9074831526090884e-201,-4.22850556894699e-201,-2.5702582661665708e-201,4.984556535484064e-201,-1.5949774233744874e-201,-4.856921039962471e-201,-3.829485798444154e-201,1.41093967624466e-201,-2.3163434440755284e-202,-2.687447598799143e-201,-3.526006145226182e-201,-4.714031659709057e-201,-1.2217587082569756e-201,-1.1947021289070332e-202,3.659419223261668e-201,-3.023508589670122e-201,-8.560705805810332e-202,7.736056946454614e-202,1.728491657831846e-201,-1.2281947584621014e-201,-1.1790146467828208e-201,-5.722171569430778e-202,1.3739564855916164e-201,-2.9743194668401562e-201,3.780314396453714e-201,3.1823240061936594e-202,1.86203651174414e-201,7.909173453942284e-202,3.577393881442915e-201,-3.47335371231152e-201,-4.0817043652845876e-201,3.0601505208358244e-202,3.5834575225574065e-201,-4.0606390418751615e-201,4.050662557462507e-201,-3.132165701177115e-201,2.2386211217042435e-202,3.939910317774232e-201,3.3739068440884574e-201,2.1797880336951346e-201,-1.5729906961718574e-201,4.8324086700902065e-201,-4.8255253346040995e-201,-1.8473511954784695e-201,2.6443333659100633e-201,2.6280068555113915e-201,-1.0168862011117677e-201,-9.482918691194797e-202,-1.4148209771467702e-201,4.428898397295056e-201,2.843036818584152e-201,4.0738457522543784e-201,-4.619212012853221e-201,-3.8589226427832234e-201,4.0211322860212226e-201,-3.026500433957775e-201,-4.562924422400383e-203,-2.482678687416663e-201,-1.4402664652670572e-201,-1.5826543964116103e-201,-2.9585503999426955e-201,-8.726803760297109e-202,4.193936752052166e-201,-3.515427647115647e-201,-3.827867314333969e-201,8.648416846601e-202,-3.290253971351929e-201,-4.550461031790312e-201,-2.080344833423654e-201,1.7644899145005676e-201,-1.53301591038636e-202,-3.432580848582128e-201,-4.382798241250606e-201,2.1155475321575836e-202,-1.5212357170161997e-201,-4.798874655132208e-201,-4.609376594773934e-201,2.388671543986961e-201,-3.5290625837165225e-201,-4.563336865555204e-201,-1.0492926845002436e-201,-1.281320913354924e-201,3.69515360188438e-202,-3.9592124984940434e-201,2.925020260139895e-201,-4.2746131994128035e-201,2.9371009207176462e-201,1.3123439721164586e-201,1.1275181163527429e-201,7.755692433280669e-202,2.4604730529934423e-201,1.1460138971021439e-201,9.247822313994177e-202,-3.0922401816791554e-201,-3.1938987377683945e-201,-1.153488642638747e-201,-1.6339446080338503e-201,2.6331059362240568e-201,1.3681049899864586e-201,2.6286710235274926e-201,3.01481834358223e-201,1.1140521577740436e-201,2.4115501831790407e-201,-1.3916427627916162e-201,-2.1628694185746954e-201,-1.863857769442826e-201,7.778060891758509e-202,2.4262585953673506e-201,-3.894018137455141e-201,-1.2441043861999146e-201,3.7407679236008155e-201,2.7529791861064884e-201,3.436957428326722e-201,-4.330977527296229e-201,4.770530690313911e-201,3.6605644930859045e-201,3.140824956433762e-201,2.7290791940142156e-201,-3.1695944756071004e-201,-3.699031100588971e-201,4.905767846881335e-204,-2.9790074059747383e-201,3.457413902537051e-201,-1.0504722955953297e-202,3.651578744592004e-201,-3.860624591532102e-201,-4.5342586053013856e-201,3.92523026251751e-201,3.1873111225580217e-201,3.6791255820352734e-201,3.297570887217802e-201,1.1951356419008562e-201,-9.983356763247166e-202,2.0653850541169326e-202,2.1729587281819042e-201,-1.4623101366524003e-201,-2.4624556824559494e-201,4.094754415961693e-201,-4.1963225416835246e-201,-4.183550312545391e-201,2.1270319220148396e-201,3.77479825341748e-201,-2.0146281932210307e-201,-1.902049814215009e-201,-3.1803014761832004e-201,2.546871466690267e-201,-2.235778112382948e-201,4.235916849077754e-201,-2.4986611334656592e-201,-3.0729622809295208e-201,1.4250337736216147e-201,2.1322894640546526e-201,4.205977726921633e-201,-3.9632107038025364e-202,-2.8123855558805188e-201,-4.946259759249134e-201,2.492584827229373e-201,-1.765623871529417e-201,-3.262832653501846e-202,1.3144172799377193e-201,2.924212902358076e-201,4.176466397862992e-201,6.226336300141435e-202,-4.69008755364531e-201,-4.19596778366185e-201,4.810402323658578e-201,-3.870519770309908e-201,-1.743678070323077e-201,-2.0926431366288533e-201,9.097916554189843e-202,3.6453568814851655e-201,-1.2845181777337944e-201,-2.8968630966597875e-201,1.376456241165365e-201,-2.086973208686149e-201,3.591037228876769e-201,4.507585406077055e-201,1.5698197194352305e-201,-1.0795528421433828e-201,-3.0131919254298814e-202,-6.248571781210313e-202,1.0946912281196672e-201,-1.1575433544305701e-201,4.9133633195168126e-201,4.789087087714755e-201,2.1109738246070012e-201,4.2573998032892465e-201,4.659456648495963e-201,2.808711158170485e-202,4.6325175030276455e-201,3.312234550435863e-201,-2.180126827504283e-201,1.020638414426296e-201,2.689977746867773e-201,4.614233297896162e-201,-1.3577492412789952e-201,3.206730202530628e-201,1.233369813665941e-201,-1.2543387479531063e-201,4.469677569521994e-201,3.708407780903606e-201],"im2":[9.542810800320732e199,7.125081790993359e197,5.210742754805976e199,7.161152117711966e198,6.0549670404540155e199,3.6156036962565227e199,7.770674545319824e199,7.0732401751631015e199,4.309437095827582e199,9.77099085863158e198,8.40642505744537e199,5.5792373814288755e199,7.270563585094295e199,3.550424133553076e198,1.6823476906682799e199,4.348230914264839e198,2.6554796177644367e199,7.1687619195184436e199,8.851168508322942e199,2.6327601716900405e198,1.228433853907953e199,3.502103201496517e199,2.930511855581056e199,3.6137707687157405e199,7.465534366446877e199,9.06629752095643e199,9.185150684359913e199,4.180313709957903e199,7.386178706697654e199,5.9690242801771364e199,6.573049195712916e199,6.494978047906503e199,4.569269986711607e199,6.863482772171909e199,7.618275521180745e199,9.953302818721855e199,3.736070374810525e199,2.6493807908173362e199,4.189441056588131e199,9.744886432926314e198,7.594830137999547e199,9.231043534215948e199,5.442010641217952e199,4.1824530365816123e198,3.3316459740459837e199,5.070400279686479e199,8.416292031857415e199,9.899031173326226e199,5.236509168634293e199,9.693115669239892e199,6.558483034830126e199,9.271066487505503e199,2.036313788722196e199,4.549754881988651e199,8.79253935797951e199,7.175423377408917e199,9.987936082739092e199,7.27653343223926e199,9.309444534369486e199,9.48013793187538e199,5.357072127094167e199,4.550275233405055e199,6.615061054365334e199,3.6468734183516382e199,6.8861921500006315e199,7.864610040570851e199,7.728130749976086e199,8.56792843449449e199,7.1031297311799486e199,4.374253241988867e199,7.5353333639097025e199,5.308179212779964e199,2.0012206443807013e199,1.763527948950818e199,2.818876622424382e199,4.3424884744278857e198,6.990781166160758e199,1.9682486679266065e199,2.2926310946763595e199,9.029063174638472e199,3.5150675373382113e199,1.0845735694313485e199,3.961099725410319e199,5.259604652575318e199,7.368420658835027e199,7.316427626577241e199,9.300095351167151e199,6.575739686612974e199,5.375172119091266e199,5.687796096820534e199,1.3707682141930078e199,7.080065111860929e199,3.330833960667696e199,8.56857095908859e199,8.080889482554026e199,5.29144762021963e199,2.84666720409497e199,8.848274313071108e199,7.126371651575197e199,2.9860984204489425e199,4.219879658458479e199,5.959277612187874e198,5.123251053916633e198,1.6394718755061288e199,5.909584288831073e199,7.164274557175232e198,2.296924627509811e198,3.4803626749604187e199,5.3311683718261025e199,6.324250180618122e199,5.561503225358015e199,1.2943562437698753e199,2.772764974475381e199,6.969818016814984e199,4.076994757847796e199,3.44995481391086e197,8.792768420871303e199,6.0722600106432775e199,7.222026801245799e199,5.734650838452205e199,4.037640811256417e199,7.121159939182774e199,2.539971336011072e199,6.51477309229006e198,6.523081236643936e199,8.253117379961277e199,7.188603929200479e199,1.3516990961129272e199,4.876013578668636e199,6.825351933645707e198,6.743111931893746e199,4.3592713080664975e199,7.03166454470946e199,1.3914841209616613e199,6.186515872342613e198,1.9381683356162772e199,9.946077087382455e199,9.563632715612748e199,8.893280966678298e199,9.602240253302327e199,4.3687948728961754e198,3.531429679455369e199,1.4691875329686244e199,2.5608406068921807e199,6.716322631157091e199,6.191540730242026e199,3.858875150021658e199,4.589698407052661e199,1.7646777913980016e199,4.381440088207505e199,4.17820530265555e199,8.507465987647985e199,7.801104364833373e199,9.2976820245458e199,7.940030646903807e199,3.2385219090185436e199,2.5348968860584495e199,9.401025052501507e199,1.2649997001894052e199,2.4661217064891972e199,9.60729667240094e199,7.08201424909198e199,6.292123623714768e199,2.755679102412626e199,4.617331620135857e199,4.66973401646511e199,2.826051036935766e199,6.083164630575487e199,9.029064630926599e199,3.888812538175721e199,4.491327027236297e199,5.152280951071013e199,4.0038579973186405e199,9.271455321530552e199,6.94200585289468e199,1.0087533316903708e199,6.63032510662233e199,7.187316806934787e199,9.770489372110664e199,1.0505032751064603e199,4.719612451181752e199,2.6148487399367427e199,8.001746146939836e199,8.594352306961433e199,7.899330094037623e199,2.126033085372555e199,5.740828081989014e199,5.01949252732527e199,7.427356163618246e199,4.748002964126131e199,9.603525932519527e199,8.207678741611394e199,1.1302848892696692e199,3.927688390074332e199,5.398659549979594e199,8.584083329430877e199,5.7701878905922105e199,5.640000153101537e199,1.8722353346403541e199,7.20516575461298e199,4.3484022977810856e199,7.729837497360357e199,6.428499350127416e199,4.802494920806287e199,7.974513983203861e199,4.831547036459617e199,5.364028866927387e199,5.170320169933246e199,6.848793894120319e199,4.022669286285183e199,1.7229205678365655e199,9.844535496852893e199,7.6013041713642226e199,4.486775345275215e199,2.230672599856698e199,3.576584083406771e199,7.083129578244725e199,7.091366507355531e199,7.17129129676202e199,9.288801893156482e199,4.9205064125758474e199,8.872907358552407e198,1.1091622049860217e199,3.0009998329843357e199,4.535409342580832e199,5.3406070295260405e199,8.16062434090424e199,7.353652303433969e199,3.3653621980556425e199,8.136343450280182e199,3.1069470869586133e199,1.0349878065179242e199,8.303459530004112e199,3.894441040704498e199,4.579748864841793e199,2.0806686968799504e195,5.473378211078896e199,7.667612854622302e199,3.167380330991607e199,3.5885979911834676e199,9.81605714542647e199,8.575047880743662e199,4.863784354529566e198,2.268671504160321e199,4.045559996420488e199,3.7645329493705937e199,7.950336234113558e199,3.2634014525550714e199,5.359345098669942e199,4.390436478620147e199,2.579620010728856e199,8.031733215906829e199,8.201961415543306e199,9.21177467277558e199,1.8109549552168146e199,8.008836732195604e199,3.113641236835104e199,9.45991651993117e199,6.803551282879662e199,3.7831583759685005e199,7.125839431511175e199,5.459003764656365e199,4.737322545740927e199,3.747307245314547e199,9.345272258362656e199,6.445549739415833e199,3.650136379453794e198,1.0170813326258244e199,4.10768302722898e199,5.922501541952021e199,4.599856628262733e198,9.119005101019195e198,6.636597483363863e199,2.60037376247078e199,6.7797448257494705e199,9.5386520186692e199,9.27849871830355e199,2.5823778858114685e199,8.911246660454101e199,9.708298807951922e199,9.746980616057238e199,5.402056219714971e199,9.729691700220947e199,8.798014690022396e199,7.5944457466021315e199,1.4678392363166649e199,1.1462080195973146e199,5.528613427826014e199,6.342260482030348e199,9.613005229180014e199,7.629245913880796e199,1.033825857652345e199,3.729931277221344e199,3.52726669257174e198,5.606698657006262e199,8.977448946839875e199,8.620278867505163e199,3.567405581664873e199,6.7536535572748e199,4.512480516499008e199,3.227646087898961e198,9.20944528861635e199,2.8704209878526954e198,8.335194165223447e199,7.879365135540065e199,5.404073004066223e199,5.223765529660664e199,9.319657745458065e199,6.384441982905673e199,2.5083160698565176e199,9.997413030056285e199,4.6892418511986235e199,4.871392458403594e199,8.275252885674585e199,2.463788630000009e199,8.209077166210587e199,5.483275526487924e199,4.361147237231938e199,7.02827153219442e199,5.375703389092373e199,1.46802101917056e199,6.481171365132831e199,9.565596397144741e199,9.967452835230386e199,7.448796488871994e199,2.019497551766165e199,6.780204544740963e199,9.064826222688159e199,2.861640542808976e199,3.0352623779687427e199,8.868808319039406e199,1.6857272773963982e199,9.810305511732554e199,1.6467327795437446e199,8.872735093481218e199,4.891479214477667e199,8.874110830858838e199,7.01567432933268e199,3.238349864152884e199,4.103198178327153e199,1.2651074466316269e199,9.829018504614635e199,9.290311070305125e199,6.615651024563257e199,8.09998945120486e199,2.7923189570412064e198,7.833792182730948e199,8.675478964009574e199,2.708418292238748e199,4.361369192059838e199,7.691797317719628e199,2.7388174320460077e199,4.114443266082948e199,7.362688683193154e199,1.4320320098650585e198,2.4075839450683144e198,1.8501951650944814e198,9.852875601386668e198,7.04166566229527e199,8.886585104018563e199,4.994455378224146e199,4.886755419086179e199,1.3382254900991997e199,3.2349586781980133e199,1.1980974317886338e199,9.177129818978391e199,8.949830520115347e199,8.482350794835687e199,1.4566585020350507e199,2.8826492719410677e199,2.8616173949412736e198,5.043426326214675e199,4.546606076393618e199,9.51944043315452e199,8.278841539758208e198,2.493828252178696e199,3.074921723857041e199,1.3508382815600594e199,2.466725512447192e199,8.505246928411844e199,7.580730933454764e199,4.841140871184908e199,4.449434413307025e199,8.750538749271751e199,7.316363634098982e199,4.293837413853456e199,2.4916017667850388e199,1.1722829233200438e199,1.8998427938636153e198,9.809766738697154e199,5.560499585600688e199,3.583044972882664e199,7.785196591369468e199,2.5682998642819366e199,5.654833071631001e199,9.07018000781545e199,9.641049392380857e199,3.391197592269993e199,7.690019374447466e199,5.195602979910233e199,6.463482759996498e199,2.6714476913821982e199,5.30855076321058e199,5.457561133381803e199,6.92076690091909e199,1.2828161085965418e199,1.8322450383400223e199,9.927858025002849e199,8.21295792024105e199,4.683979012623791e199,1.587504545080145e199,1.9698944193457956e199,3.675948301077132e199,6.58870390586232e199,7.860041337015498e199,3.914054711479646e199,1.950268906414023e199,9.670324787471595e199,4.5370899302681395e199,8.12963714707371e199,6.5968913450502684e199,6.396116557478781e198,8.804172946847752e199,2.4505533018086833e199,6.702747941802909e199,8.834104990231804e199,6.478816402224493e199,5.912525509934739e199,5.04140548488569e199,5.990869021844577e199,2.510705404519955e199,6.81263470976528e199,3.6771350931576264e199,8.176901233171862e199,3.7979553348923488e199,6.524388396539216e198,1.0086844995008815e199,1.8739881017473857e199,1.4682553646835904e198,5.5019650165352105e199,1.8364633806737517e199,7.818666359942448e199,5.008907555166307e199,7.140775360101277e199,9.004797755656563e199,6.415744228452972e199,6.728234954341067e199,8.406215862610425e199,7.199574242061952e199,4.353721919308209e199,6.133514070982806e199,3.238031833503784e199,9.675225609102494e199,8.735686524075256e199,4.118425749086304e199,8.06030449475412e199,8.727207542462349e199,2.6040362709877782e199,7.0827122262629e199,2.7474737566161354e199,6.9328643450983824e199,4.1184781872510836e199,7.310653855444382e199,2.9601133251564648e199,7.699711675274283e199,7.860658585565898e199,1.494956598529421e199,6.37252401598076e199,8.573231037672191e198,7.720028632979779e199,3.507815258829827e199,3.543621502505624e199,9.336965534009581e199,8.403900079068903e199,5.1397733803367835e199,8.842558174881324e199,6.8700396754219585e199,7.366829405955665e199,5.660622492923235e199,6.097657958871805e198,1.747830240804703e199,4.929113428887316e199,3.1181737920290063e199,9.622987314570583e199,1.7247508429587377e199,9.84065521889479e199,7.781153831775887e199,6.301468865001198e199,9.094022553812866e199,3.2722451024765052e199,3.722220788701287e199,9.781989064872856e199,9.812869274062396e198,1.240826687519957e199,4.908097964058324e199,5.581906962638363e199,2.4387383440899234e199,1.469815551062924e199,6.6051554935062905e199,5.9093676873627995e199]} diff --git a/float64/base/div/test/fixtures/julia/data.json b/float64/base/div/test/fixtures/julia/data.json deleted file mode 100644 index 8dd21539..00000000 --- a/float64/base/div/test/fixtures/julia/data.json +++ /dev/null @@ -1 +0,0 @@ -{"re1":[45.26731079212148,13.725009656713269,46.738090454345,49.398915597351845,-45.47538884678577,48.7709935307514,10.359739210506824,46.946040024052266,-23.911276559401408,44.64089091922048,-5.087046964971506,-36.73911112681971,-49.21842024854325,-43.024593873339036,-49.765192199155805,20.26339266899558,-16.199207734750097,-34.1755923637027,-17.1829333436432,-28.006576750577526,38.86708577196633,-28.98375298995769,36.08210612013956,-8.776242471496829,14.913959543572446,-34.10454624651392,-23.284509352227477,-48.596897034729366,-18.204041508066748,-39.21645997042017,-11.894976660321653,-8.195151062790806,40.69552955543898,28.119362380807672,-11.874343528583331,-42.040049823975835,-11.68322218935731,2.61304412172737,-5.081134685866573,-36.99628001180525,-24.93024546488004,-18.747244952397235,29.035135739994303,34.116192391419446,1.5406855134384116,-9.865853655075938,-3.8616473327687473,24.417762068793422,-31.354967607005246,41.38597465582883,-27.977570187725377,-20.24127641982495,15.378588815525816,-1.79169472212444,-41.138566674316365,-48.62090399832645,-33.04425082380086,-35.67744884817283,40.55678464153762,45.25893166019881,34.150931568298105,31.6582482726121,-48.63034010905428,-23.46109449326068,21.223502802991916,-16.930253940650708,23.56425434519589,36.489485992910545,-33.289422264874936,22.623913042728148,48.39564539421809,-20.05126144179412,-6.947257928897656,18.272493514271304,20.265007006906913,-48.64034151442681,34.09835011543814,39.88185899452736,-6.32584790081696,-42.03768925200209,-44.37205989550198,43.38959001322618,-25.722169297155993,19.293035541729594,19.611875954514318,-37.469581011033895,-24.37712938240022,-28.963429810903207,-23.235591520319588,9.581331650318447,-17.12904631653805,22.235309207775828,-23.85204461658238,36.91155930460198,-23.448642605889514,-25.869740760940463,45.27956558921625,-4.881816742804425,25.003096305397122,25.013145974917663,17.70183962871073,-40.40900472493523,33.68727858124126,-49.1419031775639,-28.97222916341875,-24.161870293597133,23.721419727939093,40.778592048095135,15.374933091196723,-17.528595196768514,5.3733160032282825,-47.123384912207044,-41.68875245250251,-21.309987089410086,-2.0625979348503165,-47.90763439705863,-48.33419103987227,43.024696902478226,3.7265582553881984,-18.551961601305457,-38.612097253850585,18.767181124840533,21.71149565769555,12.304406953698177,16.247461459460283,-43.196393603414606,-6.340476415102337,-33.78299791573535,-16.41543667350132,39.82108988438637,34.59376826078618,-24.480858379403358,-2.0792012859791598,-0.8852673935314428,-31.27398894634942,-39.023364168999734,-44.58375286335262,-41.16637482971347,22.529157989263012,-5.732366109810997,-25.47803372722459,18.007973729839904,-20.376669557853756,36.87322614949959,-0.7295638427055522,-46.80416042677514,31.551464860405233,24.69513992227475,-29.64521982102646,15.708077932883285,-48.20277437480923,-27.462664696681884,6.018266282214938,-13.161671334773942,32.36768280310915,22.255634500983064,46.897308154180095,-30.357686867151745,45.61120406042501,-17.802332350366832,45.58709224789598,-47.16435498792564,-23.82513985076955,36.0551557615761,31.841952654714504,-9.332385571086832,10.376024987908252,-44.41023762892753,-45.931877400264824,42.40366673674649,40.57884723741225,37.15848943681753,15.12010192163801,46.150300688355756,-45.93568990974154,-21.751183484590907,-12.68102850235676,-20.103948063271517,-14.547397382539359,24.341542911760044,-41.137618320100515,-11.870598624586528,24.13602144337682,-49.5997979064414,-6.321231478789912,-36.397464106401266,11.6222694561216,-6.987881789379969,-21.639191306856496,-45.488677689121985,0.034272202962895904,40.27865173487952,-17.6077807343653,-27.10003642051345,-29.296186825099923,-2.6301440072629916,45.10768486979023,-0.15077636816305073,-38.054877708110055,9.93469698936319,-48.05700931122369,6.533158943995396,-7.111781665203928,-14.919686017188305,13.231023577124837,-9.35520216292607,29.436949925636185,11.87074357515987,4.392224193308891,-19.895889975581195,27.1469372874232,16.343970456050457,45.52991240249354,6.749564819376253,-21.07644774267842,25.08113893107658,-22.11818431087589,11.74426470103338,33.06421008628931,33.28031800703074,45.883311303170444,46.27123976328819,42.964538999001206,-21.331082083603526,-7.3936971595370835,-29.994197150624025,18.417464664630515,-22.74874717433778,1.2274145343454066,1.540288410981283,-14.906589817611113,-0.2361510515253471,-32.88046203734628,-11.221059196532302,-23.271117952664298,-21.08168342620871,34.47891193410794,-12.222007223165008,-15.577112360288034,28.276777383987778,-39.03915554504695,-49.461382999893374,-37.82235969996568,-16.636475429424827,14.794664184111568,-38.56763522331539,3.8414257387101145,46.390229126466465,-43.02311895716956,-31.310727756515856,-48.068349302862856,-45.5223329170467,-30.77199048883118,-5.863593786354116,-48.7247455723953,13.2914727146119,-0.3105150878629743,-32.4287458971439,6.763040509529162,16.214706653585253,-6.04103823720218,45.44504988527403,12.809451559986073,-25.91105050840938,49.72909487396426,-33.90430192614262,7.162895291896554,46.735930697180024,-44.51699166249836,-16.512093653409835,-1.4815182726352205,28.001799493618122,5.6948992776428184,45.720632602316584,-35.53471859051881,-21.694249940225664,15.592564499895673,13.62131658074145,2.210203379410345,0.6358895501983284,-17.600786825098993,5.178352202416249,4.014002172692713,-7.68954952852836,29.807612350810288,-17.625259237697,40.52905006114483,-9.787244041681966,-3.184997644805712,19.575554825095807,37.431234865842896,41.12438564741271,-2.7963484696994385,-9.497081077160871,-8.833352573015375,42.401045255730565,-38.090353359686404,-13.902118469410183,25.61378328466884,1.7750835348121825,-31.335476389870387,-4.537430313873038,7.843567381166295,-14.292190367037414,31.178878284398436,13.188801314985035,-7.378271266610007,-9.684067529551257,1.7394688425202318,39.468906419140964,-20.204972618780193,-32.41271299942989,-13.580296059752492,4.28759834878295,-21.57789336447187,-33.76471829003916,23.347292085489556,8.761381044742592,48.520822686278876,2.6307035635279234,-7.765933227277131,-34.11050443381581,3.550503408488595,3.4046807854514327,-7.535860875890101,10.969819604368325,26.132224117258602,-25.607799171820535,-30.967091963055193,-18.186277379813,36.723077255369006,3.0757834841748775,-43.61413702101488,-3.000940603140336,44.37736319292705,0.7234366589567998,-6.056168592901123,6.906839338722868,15.582029432591185,-18.694353633547543,3.6016953838793526,32.903861472412785,33.313596313042126,42.88932302338466,-46.20669288132895,25.176766262757084,9.987356512191766,-47.97953055016671,45.86988433349305,9.072145502741499,-18.578214940499226,30.120064114463545,-42.03297538829791,-48.83786485139795,8.74496820455851,-15.615477103265782,-28.14767025075522,29.73074425073331,-14.855625922617577,-24.800766782176698,-34.20053577708888,3.462291559419107,-40.482291908903356,24.105762278865996,-27.41406498207266,-29.82573554077389,24.048205053721546,16.034921673927556,-19.161831498202066,3.279487038961868,20.857175851765206,-28.966433334402332,38.965508257130026,-23.97179669729146,-49.73068042394825,46.71413304234903,-28.88227487632734,-48.119772855235624,-7.283975878960739,29.44232958845265,-7.767738862380412,44.55521327498414,4.75771361916312,-34.94359245655602,-31.342865186861545,19.14815994704786,40.84857442381953,-3.302337319419692,-22.849498237065692,8.511659095819091,-19.668951645605237,25.763346300440986,32.50113935211556,-39.668507406677456,12.01088157619008,-32.846108544683396,42.74786233084764,-17.470200687362123,-29.959010279226085,39.415661619616984,20.06564009929798,17.460369241315732,30.67774367261947,5.985092743111956,-11.288691964123878,-1.8014135751512796,7.48931009787259,-16.226260753862945,25.790753617867196,-44.955556041450315,8.633672473591801,-6.334979877298252,-34.95725280153816,-2.065301037337683,-5.098520208350074,-35.70307598485002,16.005665743216127,13.690914781916042,-27.281202371515732,-3.104846266774345,23.656892744971543,7.775193879639019,25.090405991006875,-47.414295502116424,-9.897019257147612,-15.805609225878925,37.0131752821071,-16.34364503274415,-3.8261748190528877,25.487596096657313,-41.925033211688636,47.988893005573914,24.30534044385243,47.36281102058861,-13.201766245687082,-29.503534977251945,-43.59511615619142,-6.850107788362735,29.610596790651314,44.114304337520764,-39.473113182747966,-46.565982773359224,10.904576282999969,27.47013742407229,-15.121436196983339,24.577788482691545,-44.998490110272115,-5.7394047749319554,31.287453805334337,8.272261400767377,20.087588541116148,38.648713151887264,10.483907716110622,-27.844327169695514,7.652535067992886,-19.023591829183996,-29.647373759839002,32.03847424780932,-48.51988508152498,-42.469826805380904,42.58257239311894,-3.0711976055537917,5.6356359270384075,42.592406888374285,31.1551239796361,-27.035058197048755,17.5307810992163,-33.466293218928826,-7.2937936049467496,-48.8853841649575,-18.351871882235884,3.1369569759420983,-33.821926196701114,-42.91222497161132,22.212186615854662,-19.8424864873028,-14.328595780727369,40.481763408862406,-38.184711644408075,14.762212654635803,19.370629802377636,-10.016784175444336,-23.869319213300066,-6.54657667436399,12.75870081649122,-4.941036611175896,-22.784174907283205,47.59622396290824,-22.448153912182413,25.034208312510714,1.7529156907397123,3.5533304561785286,16.874714878345458,-29.0328780951007,-4.513725304989947,27.849412154703856,4.920492045371894,10.497916350877126,-4.172209396948702,-1.416755577168935],"im1":[22.551397179147145,14.97338365194932,20.061861016090404,40.825749687148246,-49.40881606642692,26.49940627517431,0.846503732555945,-22.542838639667217,19.98422781888044,-37.62790620261448,16.56214738576726,-29.30879815864813,-23.360643063863474,34.57611591427214,22.976919725942565,23.691735718361002,-1.1620316507730735,25.738675786313138,-15.02284486208292,25.383564796044908,13.993317431977829,-27.28071189745157,-11.596249218709943,-30.829468706708653,-40.894047215738006,-32.307936629294296,13.292149571284199,-40.3554288851643,-6.280590447511457,-13.437598905405515,17.311657379925478,4.952213499377244,26.755685670578927,43.2062466538255,12.260704350384088,4.598466465371587,-1.0139336238948005,4.69636529877787,8.866956523750957,24.29216352548289,-1.8546375819171317,8.81869971643038,27.844182123554674,12.381409576693102,17.551923703229647,-5.33900740384243,-27.493667932891384,16.04551208796508,-32.81930719866307,-22.164082346527337,-19.153959470036654,-2.216875448207631,33.80329203553019,-41.78872541716654,19.480823862579882,8.387732202824829,-13.166647430390697,-13.98400943507444,-37.83280428157916,-15.552905989250455,11.139264471271716,44.61010309815572,12.721135141826146,-14.728854632355784,7.2712389254307865,-4.100494183991302,-19.65062394532533,-45.9560578719581,-12.013247083966291,43.55938895918804,36.47380445603626,-47.99100048365963,49.28843110140704,4.127905310889055,-35.52579548685559,-14.657428926679636,-19.586570611293375,-44.30357475015416,19.98901341832149,15.157405980133618,-32.28755231443452,-5.626322478857993,-22.66460541798071,15.599815225411234,-21.3491396767046,-12.915051730709834,2.326416218587511,43.53248589277379,-12.036719246223406,24.416108043210812,37.406835276248344,42.421882050584955,46.22791765603145,24.8365424011201,-48.3850947653179,-7.630421566738207,-10.90350252370299,-36.18891642555915,20.51661920201164,-19.828747445310213,28.898096569226055,-27.179271212821565,43.51509557257407,49.03606776295692,-2.5194648360469927,35.75700664427529,39.30641727689881,-4.850544150598978,30.535095691307774,-10.597930214731633,-22.829773754062376,-4.572738337874412,32.547493026977165,47.94883424540676,-30.001572607885052,-34.08782254596893,36.19085050780622,0.5971050722078672,-27.975741588217772,-28.958460276722263,32.99940546938235,47.98263957691607,39.12199123039784,-33.722279329949835,6.429311502378212,-38.706901632286474,-19.999763038372752,-2.166826576322613,19.173158441561128,-6.174600378074466,49.16922032044728,-15.455707673008192,-40.30731666836655,-0.40471090184857417,3.4246617062626754,20.003828661208203,30.77597294250006,-11.98295109834725,44.55228241012921,16.100162545834422,-25.302477383808597,25.881718752299037,2.881028916209573,36.95615160520097,-7.027684033462364,21.530660611311774,1.9471208591924167,20.172063075790206,-6.08809028094587,-47.76207532826414,-45.96489303952055,3.58969172153045,21.88731392570395,23.78367993895239,-7.91997952624763,10.208165300361884,40.05410134560317,-37.578658495062626,24.773536442651007,36.53140859994093,-20.346589657156876,-7.495125510156285,0.6358957694549403,32.924216249584376,-18.16057814726507,-46.429986776095866,16.40203539027651,-38.35719118068938,41.97321697090763,20.367763289005694,-38.927571210552294,-44.93332102523625,-17.776828895788455,-9.850276297406289,-6.561805611464656,-5.419799276352201,22.981433464458917,-35.39700880542108,25.16222120500602,37.62305097597638,33.99482752703253,-18.903163788291756,-41.60531733069179,-17.563857747653714,-7.168776016526735,-47.6432908827376,11.944612575275492,30.324077300520486,-20.49634919723876,-19.488219621070456,-16.0476021431315,-46.69500921461083,-26.18479208681248,24.786455468079737,25.703290004575038,43.102705768921595,20.183002957242635,40.366539609038895,1.5998799756156714,-13.422264111090065,28.654161606094334,32.82518487586337,-25.668256591624072,-48.17552475744381,-41.831199260153916,-36.68127508459026,40.09847718702207,-30.367537923891064,-32.85335781794001,-0.9837587110177353,40.10127115031344,-14.883328924142816,36.428669434517175,27.8571141274913,2.8423543989001274,26.672718721494903,-39.68335650997842,-37.44556328695335,44.718478321291826,20.032389852457683,-44.08928564445854,4.349852275556586,-21.918092103703813,-16.21504614943713,-21.13560446129551,-47.99300596179747,-14.508003329795201,-26.939217176424567,-35.666144141994,37.73263890764346,-45.208962770469206,8.030003549144205,28.154551805839745,8.575991747853116,32.80287504835563,-31.075295040043336,-45.492564484161115,1.735751499971471,-9.343160852776975,4.036103019880663,43.53716343458335,-13.735141029988242,43.14504678217223,26.551815387967352,22.112293251402377,25.653006405250977,49.37455742773528,6.065237156635192,-2.212111383907512,-38.215507997989505,-6.5112349469241195,19.657394065219478,-27.014916430104073,-10.721541403938076,-5.89030322971864,18.79564603627331,-24.277841909001594,48.796147872811844,-15.964069935094201,24.961247057813424,-19.01629293954513,-37.61470762646848,-38.00141072340409,31.284947608132825,35.86319162050276,14.465664801952855,-16.272022498261208,-13.592635191374505,37.35303283261962,46.53787930115614,30.49263710652893,13.01126314092901,-21.385257789865676,34.60061723068618,-48.33171500473278,-36.17268039111477,39.09547607174672,-35.42039008109006,-21.30054986808182,-23.159064691042154,-39.85997769860275,-42.40399162444387,-44.17584688570457,42.59096484144716,10.967762415952308,28.50656969406991,1.0095334868406098,16.971998318440157,20.905334483955045,25.589820647073978,-26.30270668198369,14.0596138322625,-11.452846429189314,-33.413881620625396,41.91434330074425,37.17897914479006,21.843294698225122,16.467195161542747,-38.408975158936684,11.918509674290569,6.703333864724257,-32.472720685106296,-44.8168033293582,49.94462866265317,-29.05591253945474,44.85391544686125,-47.12165837759647,8.190838386826456,-0.17522635076392135,-3.1976485161146257,36.63411404401225,-9.459846345421056,-29.57061590872034,44.64390809955003,48.64701248108783,26.983143276775493,-34.100659310642286,-28.025653457978294,32.82242925675254,-0.23011935583669185,4.38000074773921,23.718649513572487,-27.994166816567446,18.706630879992176,-36.471372288182536,40.77845928043209,-32.596394742471226,-40.762713824414156,-19.29898575581842,24.313005263940937,37.33132115478941,-38.79830814281735,21.040309025297972,7.026081129240843,38.61207428000603,-38.54553328808814,-28.696831963776724,48.498149968952646,0.6953996595175056,0.6073992138234345,32.771037562337014,45.520667015757866,-42.82386198177974,-28.575986675526888,-11.545258646782372,10.516585327905702,-30.33233706154479,34.540480462052656,-31.39285885394063,47.963655157962606,-2.4154601406941154,-1.2589428867768149,45.45751265703055,17.557291173620996,-41.35549597767051,25.403578221208278,-32.14022550974718,-43.54120732686458,-5.2006084973960895,30.54141439680501,6.4205559412827355,-36.53905888413618,-47.67098679795109,38.0869233815576,35.201477220950764,-17.183273575787283,-23.27541640729911,5.163086160081107,44.12932939334226,31.412390482084405,22.22287380751952,-15.326296609498243,-12.297372309189655,-12.065551954572861,42.74927921121335,31.706681974578956,38.041042965183564,-30.194736509566344,37.53473641035872,-37.112567226537564,32.239986829098996,-5.47097196862638,20.65381867992363,32.51740230551485,-32.692428370248265,2.9290126532886234,36.074968866195405,-32.142970026255725,-21.176142200630498,38.73513967442361,43.31587200068705,-23.73716429405205,27.663685123808648,19.370354299319203,-10.592969072934075,10.34756433511754,32.714098017254585,-21.23793872812707,46.64109702202174,2.0228585330155795,28.692645774639942,-23.17290465417985,38.28435589359243,20.854111802983425,37.276300185157865,-23.419943608524697,-0.9582784615837525,49.18410354243335,42.43794168828529,45.15355254141676,6.667836502021665,-17.636103987748463,47.92225066208337,16.56643904977625,-45.76917480260745,34.635901349654006,-30.093422177196505,-34.8563332920309,19.31561133497661,29.913521373737908,-39.82156350200319,15.45845518238363,-32.005422352881254,-36.73189550763979,39.89030436438617,-18.373672876131643,-34.00881790411741,24.19566698289448,11.178243917402654,-48.12030687025618,44.1200524298974,-33.60601837363045,-26.193054277410287,18.531006535846032,38.62619084442481,1.0973818023173436,-4.780212589180685,-11.799905778735784,2.3893722808982503,-22.958006647304174,19.039744521285442,11.623210295297667,-40.793593015162834,-46.920797781400424,-46.88687409407899,-20.090110285695715,-14.98822542769772,-34.2873872998851,16.397843624921975,11.755147710719719,-9.287185062924841,16.61719422990039,-37.63255107527509,-9.327935633929918,16.335651240567117,-25.542003805983583,17.72915150737967,-49.039567062365386,-31.110909876025307,-37.428506211830204,-44.977987682632644,49.51943716846607,-8.582511414101916,-23.866102582826944,30.81264851556098,-41.37271764288293,-43.98838430588754,-42.50903068344783,48.69188189108202,15.2258690146041,16.227238366905823,-45.924001333461376,21.343455742365308,16.63451127806458,-26.34094177230468,39.02015720336645,-41.32229196722308,25.28965610899685,-22.121097346398557,-8.93478924223686,-12.358919573534799,49.53853462763318,33.5691778093082,11.699721418337283,38.97325096452994,31.131445032628818,-7.38017600302355,-14.51301160398016,47.090507456602126,-41.025149824554845,47.887125218939104,-28.419783296562574,-18.87888697867275,3.529461562524361,-5.115427691140475,42.60182070456311,2.8338053799806673,-38.722866342937536,-1.6709930233843835,46.34466618381873],"qim":[-0.7763870879667669,-0.04145376615680302,0.8996319552159503,0.20313771871712244,-0.8321923821411273,0.485453720799407,0.09497725947166774,-0.8643370292826233,-0.6634589059834867,-2.1733330250512655,-1.2053805023487525,-0.8059144767963097,-0.9508289899574638,0.5960620313809571,-0.9311638775279814,-0.21212498703667726,0.32497733506573906,-0.7393587848561143,-0.21504796650798988,-0.6683609546683859,-0.07999859745645369,-0.4272323941601072,-1.950957727544962,-0.3225699239156251,-0.31791765243369324,1.8788095943334384,-0.4919317569895936,-1.2836591048485018,0.4165190716822137,-0.4777314980469167,-0.41987408194147574,0.09786606041531232,-0.8286418041296909,-0.25305434521500547,-0.5324880298004621,0.16215670190443393,-0.25875784901609555,-0.09053256725561669,0.10292873596515506,0.866845601348264,-0.9404993441443649,0.1522305112312476,0.6676885011216721,-2.6481420923816144,-0.3690365891953118,-0.1669783630625644,2.103624050892953,0.5029684651233262,-0.009381808047100083,-1.5319195594869028,0.7399722690247788,-4.512303789950117,0.7816633539948615,0.3453401116437292,-0.5272018177901183,-0.3378894769133037,-0.082013523600057,-1.2010787047729754,0.7825073275259641,0.07261658756879277,1.6569795568113426,-0.8103586586557769,0.14738224221052063,0.3495641205414679,0.13223885952212705,0.6718993224725163,0.2250030853200742,0.27659451200312024,-1.7292589139517633,0.6624271523876925,-0.14545016774745906,0.799565632606334,-0.7191116755072501,-0.11038869832715045,1.5332995536239433,0.20103063841210433,0.13599368651804958,-0.7329535072472064,-0.13788798683062056,-0.02902884317271338,2.0976404124092807,0.8469191784738607,-0.25946558042359563,-1.4173520281268663,0.8593719645051271,-0.241408941215544,0.17828722066977057,-1.3424196174026124,-0.5402288256311247,0.42051170880808925,0.7270473269066466,-1.7233183955744549,-0.6531855929278644,0.976638877458657,1.0934158382231989,-0.1832302000069153,0.6217607425236065,0.7400220191331799,0.2816829501197409,-1.1792336602158873,-0.7339750432509872,0.6068364780474176,0.05634996423761949,2.2217001931959306,0.3549588689390353,-0.04962201366632265,0.21781373796698705,1.7334907977239409,-0.7572322790598867,0.3460094075698027,0.998709976987876,-0.7278656993048505,0.20273383678428145,-3.638894320843207,0.7513650858125911,-0.4656382711700445,-0.28921672071578386,1.887175209708039,0.45602040117122417,0.6276160643226494,0.06913457579241462,0.8792110197822136,-0.2664074764357126,-0.8053691757299556,-0.09196376006753082,-0.053725482437478024,-0.2038407992950286,0.7451432042019097,0.7044134078965505,1.116804487232813,-0.7481072135383818,-0.2392799176488298,1.0643243514216338,-0.00930284455522463,-0.20509009556289387,-0.9383862860255546,-1.281495904347932,0.4061461956325428,0.5281014430698733,0.26433764587929265,1.3624616260758224,-0.0650791308125683,0.3438854519376375,-0.5247622367402831,0.07164085390332293,2.8197777475205057,-0.8412763011992419,-1.4953706460363803,0.5050229824664204,7.862682417098296,2.678103852222678,0.7760331749802891,-0.23054770440902353,-0.05714942054503094,0.8601853278652944,-0.03859049803561581,-1.535256101565965,-2.0991421860512265,-0.6763702879009822,0.1456084279900568,1.0676697940682787,-1.211876771357107,-0.38128035250001807,-0.7939063629677175,0.04620182221516316,0.22212087838244307,0.2564363040827623,0.1213438549180511,0.8140141307846802,1.3661780510579407,0.5658390419728272,-0.9373025776054889,0.454875783219606,0.433266661445417,-0.9573891737604604,-0.26685548659386904,0.6528304578168632,0.6209512407027685,0.4634223636546828,-2.0837846181922766,0.7589619059852564,0.0018869900812496336,-0.1702269835934521,0.6643082958950597,-0.008489708504629429,-0.4948314935862145,0.25652778077899985,-0.041376241782725316,0.09312787937129242,0.809033618387589,0.14758585023386345,1.0328060326801451,0.6717256203589407,1.809471617656929,-0.8957317307277972,-0.6814399167845016,-0.870330088830008,0.8150054399198434,-0.1386429274506805,0.4531123442572229,0.680305190868341,-0.357378620009716,-0.11836383721579813,0.25961901546673716,1.1384905440433726,-1.0800296678349826,-0.745799901141815,-0.5640263037198033,-1.1525798543745036,-0.23590958259024028,-0.7022068643428404,-0.36462639195392926,0.18540768281303707,-0.1393355700608879,-1.241336987606883,0.07533832188546108,0.17691839334315496,-0.7917670769650905,0.6013284039862281,-0.10994463410979696,-0.8867516149858445,-1.3103343247300352,-0.2076131097605125,0.2176960911755655,0.29263244639422537,-0.7161026883640841,-0.650486101180446,-0.36819524867673054,-2.515148895467901,0.5414352997713011,0.1010365746395018,0.1544613021805342,1.6196068620919284,-0.30450092362719694,-0.7783530072236559,-0.7853390603830391,-1.0361825055715086,0.42460036781781735,0.03335019375318206,0.3568790634496956,-1.3650919718000571,0.35301245106823054,1.9660341641814165,-0.2938746582452211,0.5487187150988855,0.9993910004144698,0.09196534569087102,-1.9730630603035821,0.6177836350606876,0.1954610899936951,-0.5524131401181235,1.708923823047501,0.025572664832303346,0.49163187980026046,0.011180704540167003,-1.189854795910997,0.22983137822401103,0.7514486510664308,0.22499171350605957,-0.5614838216015435,-0.26315087761794725,1.2233959066053488,4.064250243198402,-2.0404462481035415,-2.3689360740118883,2.3100953142274827,-0.32157646515555677,-0.9486893718116033,0.6615997718420824,0.2544089598750688,0.5226287474559336,1.4940355173446547,-0.8400839915470902,0.21608547896949445,1.303196262142792,0.5240286083268563,-2.6518117388269027,-0.0225586218918405,-0.965942850000174,0.26995245747014635,-0.6880831104275494,1.6416632026489357,-0.45035203043427136,0.004149524122274127,-0.3880176678619706,-0.5380172203447603,-0.4257609679348755,1.4594943116710808,0.05032284928425469,-1.3471778468970796,-3.295391089555623,-0.29648772114790234,-0.054087816616264564,0.5946382113068323,0.3929968560707383,1.1511874123723005,1.3382252625998248,0.5140270063065613,-0.2921842317800932,0.14005823308063395,0.5752958615403819,0.37911744803371566,-0.7087745908244864,-1.3774826410112937,0.9425043259556594,-0.9743461849934901,0.8010568448059119,-0.00602597249191525,-0.037297372270433005,1.1737834728897634,-1.3801537446229355,0.5105118833702491,-0.2853346675356562,0.4252013110741364,-1.2049839563190041,-0.761433662243693,-0.2797076538710481,-0.429477463815697,-2.0921486744958036,0.1848623330302578,0.19842889172820502,-1.4987164761437528,-0.509124861368321,-0.16949671065206526,-1.519503104027623,0.6656588009491164,0.04291473064713211,1.0884701087383906,-0.32384300495866203,0.49232918134578413,0.5971024266361803,-0.3354437532175987,0.3237393946689281,-0.014866575837322591,-1.7729939842922544,-0.3863361878287421,-0.9407278723635282,-0.3966688438788427,0.19503252427882747,-0.12308662457994601,1.8090043367356792,1.8635383040983444,1.7735718805916294,1.2643118492091163,1.8042728100100165,0.29739214223666366,-0.09756384678501447,1.0905533234844427,-0.08816194432990403,-1.3861529448059144,0.37976292405172596,-0.8515760092425056,1.0327690945331747,-1.0962345828011848,-0.5916629904972255,0.14973201831437408,-1.147663131604202,0.9817482540702728,0.2996893373895736,-0.8789435653141998,-0.6843818112717343,2.4129165682311595,-0.05617219076585254,-0.8714212125866396,-0.798518176283586,0.5317046354662167,1.8676331102749595,-0.42461097677681847,1.0657249584453525,-0.21968325635545458,0.12526522576465357,-0.555845655481601,0.4868993810155893,-0.013621668021454205,0.10519440798703521,1.5224928415002201,1.47305216055594,0.9996109441999167,0.5980037730582084,-1.0012936456284036,-0.7376326937029017,1.41544374390152,0.12378239313928974,-0.37858306643711914,0.8297782211887136,1.1827844269289802,-0.916510689814267,1.856571446494959,-0.7621823455691955,-0.45566461898161426,-0.9433910489172544,0.3080416762780878,0.015618528449778893,1.532090094552664,-0.020349034514705863,0.35155590332832887,0.9303502771657347,-0.11352791181696197,1.8688927470021957,0.7685623482758326,-0.030676747353734535,0.039275662072787036,0.2757081808856529,0.18403924233094812,-0.6034328310607471,0.4812664100725906,0.11030980647175527,-0.2855084894207442,-1.6134799292536517,-0.4552013681297949,0.23521449026079086,0.20981055134388915,-1.4036701860445335,0.4140275418444295,-3.371463985308813,-0.35576256025282316,0.5787413721764277,2.8888178527870725,-0.5181520637588457,-0.6859848105805275,0.7734042079610863,0.037350982752209674,0.13922496276658128,0.35386500516153185,0.5176099688894469,-0.21004451576394081,0.4440105620567464,0.943533218393226,-0.34567018209189326,1.979592944068848,-4.336800617555326,-0.10141824002685816,-0.6266603507123745,1.1026250557170927,0.41749538974293593,0.9590406345837296,0.6809301473589946,0.29469255433652425,-0.12399144438456157,0.7243227074536942,0.9507553725251248,1.1866405963712714,0.5937103522397013,-0.8547011949932131,-0.2166860055284577,-0.7116100824093042,-3.779033092510839,0.3394347387148249,0.8291730131267415,-0.2666030877918565,-1.0440125140141931,0.7779053132522245,-1.8131142266497933,-0.5514208214226243,0.2039626792280003,0.4978346804546941,0.804121030504401,-1.1797074373806802,0.22454680173912506,1.6408928745001388,-1.0030215363238235,-1.7064805764697188,0.012758258952626203,-0.5650747080220991,-0.02656364317657043,-1.2806226597370758,-0.6164443799220205,1.9849855279725184,1.4638392621598577,0.11076527442721174,0.3481958513155442,0.9661216024070365,0.16526000419782433,0.9401804492308228,-0.6785352246515566,-0.8787412422541387,0.27861646787763544,0.8333072598656843,-1.1234363154844842,-1.0412580870074473,0.11139962215181526,1.0240182581157602,0.7029492991930368,-0.2990860561781152,-0.8168118491175965,1.1014074300703387,-0.2910986498005897,3.3329565616987815,0.2977541782348252,-0.12507839671810886,1.0802412531759304,2.03153351657167,1.988896606132948,0.5205125610800391,-0.16000140446336722,-0.10970415673163085,-0.030745497291381575,-1.2547715224825298,-0.23068161873152151,1.1775322061346765],"qre":[-0.6978409996957189,0.3877012904632834,0.08371196724192358,-2.062554468428757,1.3508530144297686,1.8696080807077646,-0.18787012720312737,0.335892615937894,-0.2450592075556759,0.5732762001752794,-1.342718819320771,1.0210828347871619,-1.2201185238825292,-2.0297058663736767,2.481392417128937,-0.6453314589609866,0.187539954149046,0.7955225049465552,-0.7089788493999966,0.16656307665943867,1.0506961022217158,-1.0353508803625129,-1.8771326852923318,0.6323144074889675,0.5874039483285493,1.5388306764290263,0.44623911388848336,-0.39538050121863627,0.9777538259904645,0.8023070414295579,-0.06536687763721576,-0.1813219383240048,-0.28953087370386066,-0.9449820003287249,0.3636444024221922,-1.0133341557039008,-0.23648385245406703,0.08118392563844969,0.19518275339040175,0.28113616169094247,0.3009334440979091,0.36769449530874815,0.40348319630609214,0.15429723199732825,-0.4225265519982498,-0.0374516691107795,-2.9323509036875404,0.11851909695190516,0.677942299426261,-0.18403351544154598,-0.004223024410715716,0.16589575055602307,-0.06326719905723305,-1.2326974632551286,-0.9676844180523945,-0.8662244650288689,0.7357218921080672,0.49171460976819936,-1.7992313323713884,1.2695939926579467,2.6643863611092558,1.3763676652769625,-1.1436648040046618,-0.7427108624533797,-0.42854472875431415,-0.15292076049536174,-0.5935756411128111,-0.9323349694394094,2.4764278509595483,0.7741466508235604,1.0331881167766341,-0.3311340774806931,0.5210640070167882,-0.5063973277671745,-3.502793370511205,-1.582230845044171,-0.7319812803371047,4.012110665891235,-0.6036030299522633,0.9871591218219467,0.24980626148909532,-0.20193215403605058,-0.62204254477529,-0.5947344571891767,-0.05779879547371315,1.2619876696489802,-0.45548893613504415,-0.09800440995113863,-0.2728375855039204,-0.40708589229740866,-0.5087262674017686,0.7286744978173749,-0.817027538920522,-0.0017678646088843397,-0.5756295000110427,-0.5212297830078201,-0.4560081193000235,1.166169690529394,0.591842726755047,-0.1761828305028912,0.07998022237770602,1.1733030405433058,-0.9629505113183645,-1.0949438230808621,0.5786380829712549,-0.7718049607469653,0.8618392691986447,-0.29282510166678183,-0.8644489076653721,0.150924413975126,-0.6568871975866423,1.5214584012763988,1.1398372131359107,0.09256179858479731,0.42566461471998895,-2.561685937777517,1.5226628509454294,-0.693218556462288,1.6980452493810878,-0.06715625474925287,1.1030920551895385,0.853330238687781,-0.8394962262596971,-0.6352133170206953,0.2653482525777158,0.8713387244633557,-0.36083170249776975,0.3609732067921353,-1.2584167738837402,0.8081021584453958,1.038696401834961,0.9312219142783561,0.7798432055043713,0.01866477326128696,2.127732102024325,0.00032490433622146104,-1.8517216808341561,-0.6021428073896468,0.8381692912248166,0.413877686782139,-0.13593303014421976,-2.057383346598235,0.37368127080116975,-1.1284934892657965,0.09915960455332527,0.6256265172982959,-0.8186061901971657,-1.016035560676441,-0.42963102515524787,8.095236517909926,-1.0393690847942259,0.38231716230635154,0.3998393053586196,0.43550529178104413,-1.6623546131172162,-1.3116966096312024,0.1671895786448569,1.5829817245061295,-0.7496005454340563,-0.8933471671515091,0.8445480542628825,-2.4371303912952347,-0.41674249543213593,-0.6429500366810069,0.637928646813426,0.8555960623681349,-0.28633324041667246,1.216817323083242,1.1006502348568343,-0.3389448988300653,2.129426845831852,-0.01045910042802227,-0.1541014012657491,0.6922868161389408,-0.1643680827318806,-0.3984097866061208,-0.6835242062205281,0.5546534413416253,0.4043057325262087,-11.461636948825145,1.6676001338866182,-0.4250477369472599,0.862100956438801,0.7551890298509613,-0.17478149445115168,-0.9669537141059359,0.8885229602773925,0.8840019593807372,-0.49828696949064555,0.44341397999193916,-0.22862157555016796,0.09908305108131785,0.3301810631784047,-0.35420135630919924,1.259073766213455,0.42152802248066484,-0.10847564314459168,0.39436462080244905,0.7627559936049935,-0.021596762330666923,0.997591296699701,1.6417354375768747,1.7322838046313367,-3.9110085405400707,1.3876001738395156,3.7153831327424056,2.0464212574088023,-0.12445415719061384,0.45094132697672257,0.2882578008856919,-0.7431800797965549,-0.04757241180261499,-1.047074391817818,-0.7379032382606951,0.5829362650950785,-1.2574787618258583,0.8766802084023028,0.3005838797478151,1.042286101783136,0.5878461022686461,0.9625032237897625,0.10424274029368269,-2.1635356521230937,-0.6379280062817171,0.390208980923228,-1.2275731388122053,0.42049671086896867,0.9939105404453271,-1.1075415008460123,-0.4170483613708588,-3.084989235641818,-0.3552348415121543,-0.09820317105660846,-0.2341562121643022,0.17021112085704554,-0.04534851673398445,0.8234015057998527,-0.006628792741883426,-0.31223073296455667,-0.35412537875940375,-0.7714388198879097,-1.3501918211786623,-2.836682341511522,-0.6696138463694956,-0.18836515642694762,-0.27819597523789347,1.061750341720398,1.8624191650337834,-0.473199282983844,-2.1755311211517485,0.9593305071946137,3.5338679033424216,-0.6743512309759268,-0.2911555819037684,-1.2426283286442785,0.07668110679584515,-0.5943428228844286,1.0916971890262097,-0.2629682410239541,-0.41351993130974257,0.35418882730976187,-0.040200725824860326,2.809613543196812,-0.6140532427065384,-0.32067674922783135,-0.003325967433929373,-0.6132978944047216,0.8672914727101884,0.9307837505915073,0.9838775621207081,0.3521544296773123,1.1920151776653745,0.3699815435570937,1.319905160614443,0.1816322391074367,-1.356736095369264,-1.449959368211755,-0.8728847881093749,-0.9768689484092815,0.26952263973927765,-0.548329401312805,-0.6980713118100136,0.7012284684457039,2.8156372171313997,0.7546710416151983,-0.32862084913518064,0.7322912279898913,1.7249271749604556,-0.4129499389300498,0.11582569974478028,-1.031313607030641,0.7074410557792637,-0.24559808060446706,-0.3603029264637002,4.316885842833367,-0.7611803268475263,-0.23521505102737927,0.7570018693798383,0.7422012788045832,0.1675461495105687,-0.5258686930105888,0.4441641182578213,-0.6900402910510322,1.284672551351333,0.9222354484064796,0.5357380811183833,2.7621639522074424,0.22354649949356484,-0.023991776444025167,-0.3025034436516639,-0.28045589158756823,1.12345658303506,-0.47311584507218185,2.4877994062280737,-0.8672110783616647,-1.2127768660380704,-1.0512804707737788,0.39981779378643273,-0.8512140644909963,-0.06614824473706625,-0.06038106387704591,0.15451860837404346,-0.46966212337350344,-0.3941047734099712,0.04539110839067216,0.44783405771404133,0.7975341362071982,-0.4513172906096001,0.5683550254468788,-0.5241075737678195,1.0490799887792839,0.5924608744987365,1.0526076940108404,-0.5596201555435735,5.3865539986700535,0.4731166244282968,-1.2833100568924465,-0.6894005625281482,-0.18144582980163732,0.35481467777169334,-0.7033226548696577,-2.134080403061506,0.5108729116750078,0.35451643099445107,-0.1951888553521881,0.5592277668009811,0.7976287197213053,-2.1281899108347315,0.9735835832361196,0.4288214561006808,0.22081184594167183,-0.07653881169242739,0.034994254156119654,0.3009291215955575,0.6002025826365295,-0.605913156746452,-0.6128657371751148,-0.26213406071686773,0.06832243908640107,-0.08359696085867416,-0.6410882891638188,-1.8809838094702926,-1.928990334762752,0.20211632701893162,-0.06526462338004067,0.3660146923263748,0.3013478635887219,0.03309059990357919,-1.274516637454326,-0.7465765464906873,0.5186612632148444,0.4261132269371516,0.974003741624695,0.5673154948979472,-1.3401366760996507,1.152325437307343,-0.20055154156793406,0.6682524496457156,0.33302745924326166,-0.14685014129170137,-0.2539596692560984,-1.3233634834333279,-0.4722403650234048,0.8951599966628112,-0.018369222064511366,0.2742221539191362,-1.1743211813857013,0.427552940056608,0.599709111647953,0.6596338730238502,-0.9148363325671355,0.5870678373951816,0.7356116271343532,1.4838704712918525,0.2710540682600997,0.49980959550377874,0.03518414077146984,-0.44870397985046073,-1.1521085739971182,0.6765688645619068,0.6040786606181346,0.5632055558850958,-4.904673348715249,0.34337897222251024,-0.4017653144396886,0.3157194044627779,-0.06830550378328182,-1.036850716030502,-0.9679957517206842,1.3175299618576863,0.4373855751070987,-0.4303774557859847,-0.8416280348477396,0.06839202450563697,1.241834294131504,-0.9127285208677541,0.42365855817801895,-0.5414555390119627,-1.282982066652703,-0.05248086412931919,0.2566465837385002,-0.3814486458966915,-0.6575648204013619,-1.1948042893055892,0.47502396874828334,0.4365136208309475,1.8729819741055043,-2.8320785445514924,0.08262930388302277,-1.4707468353229713,0.10297946985343547,1.0768188208763503,0.5975214996880035,0.339679091493087,-0.959579913464397,0.7083921460679672,0.3975678493520967,-0.016744216312636565,-2.912532053871118,-0.28295440517973686,0.30685552929344406,1.2147429644974392,0.737519167952479,-0.23076392976924848,-1.200701279826318,-1.8127917784175311,-1.4396390904284633,-0.7329242700294362,0.12347520587299843,-0.06113631147731701,1.0217470252071557,0.509105917814532,-0.22952707508415596,-0.190092181084046,-0.5393295812739796,-0.10797296038923823,0.17075764080077266,-0.15452636153187027,-1.013884348459575,0.03592896081366529,0.04760997877768168,-1.622436725567034,0.21802001661831136,1.121490610416175,0.8239873935210171,0.22559182016389956,1.4262556006806972,-0.655970036468041,1.3165156138020686,-1.3744370725959376,-0.344557521093637,1.7514072297067935,-1.5365880582380707,0.058686602258675356,-0.1676096979072854,0.2605855338940468,0.6645734168362615,0.010642938178574644,1.952207825530147,0.8518471106274315,0.3540087373957613,0.5714735486998783,0.5177433982831061,-0.034461276834915434,-0.4992558778497891,0.8035025341560144,0.40045590406356707,1.2135621117655062,-1.2443281615883999,0.7207298505602012,0.02665723692625595,-1.3853027348176086,-2.3838996891229036,-1.0762728034281708,0.0485483626583421,0.9547718998708529,0.1263367320051586,1.390913938392379,-0.03077146157327217,-0.31110472475359835],"re2":[-45.05399845191682,30.918101708822874,26.901395094408386,-21.789541015702973,-8.069176587087114,27.886384073257332,-42.10426534972228,40.99702528798902,-14.791215591963336,21.252783676223743,-4.033746143527651,-8.210639359341343,34.38042748965351,24.119973315814164,-20.62564408219241,-39.229007638959345,-24.26194179802692,-39.18378656172389,28.07991070964394,-45.590182994206444,35.7703587484999,33.21184270556357,-6.153881411529774,8.723063128917708,48.779925888475105,-19.19006713545518,-38.37742873120528,39.364018509048094,-18.074568718057126,-28.72277686567083,-35.948850717825266,46.416092791976354,-44.068238070209496,-39.189908805706196,-26.08758768697913,41.159060727969674,24.61955439154866,-14.407058926301886,-1.6242391685519877,12.832138635268784,-5.905096371145049,-35.04871803826805,49.79641757737767,-3.911580748151934,-22.649839655237436,43.060173656362494,-3.5713249511586582,41.06131100737534,-45.571542021793306,11.063041829800504,-25.668087236794257,0.32593393774410373,41.38182182804002,-7.458313684003556,24.324704789161117,45.43880671209544,-42.392313606422015,-0.44362309265907385,-26.64608974920596,34.83371662985745,11.11772160129646,2.909841186227794,43.23688013366096,18.21885788561829,-40.43836579843533,-0.34987415705042224,-45.683666155588,-49.412072977408215,-6.759248747113148,44.66677404824448,41.05760788954116,-42.36876665293868,-49.533858638389695,-36.142782977888565,-8.58077543124314,29.094930716628497,-49.83485212911045,11.57147809436151,2.770462844494091,-42.99885241285884,-17.660979272898324,-17.84422817362831,48.1684534079821,-14.215153566172404,-26.258825058421586,-26.754241258402224,48.14198493162533,-30.68966365685728,35.0602307349845,18.58663718765449,45.606457798686264,-16.254634286555913,-9.785939672494337,25.36213362620373,-25.808569349332178,48.753540102671195,-46.13262141203806,-17.02342649408839,47.89566164601594,13.347922689130684,-36.31277992860132,-36.62429247448136,-32.22864216216019,26.528923407020145,-38.32043899524392,28.210400259863107,36.70611341090681,-6.5839862020508875,-27.571559490685026,-44.29786665187727,-18.426462595348603,-24.03408220046339,-30.529732907364014,-13.317104837902292,-31.405199723754663,20.44487494971358,-34.995204213589695,-7.100149058315566,-2.0799077503547565,-42.4909877727641,-32.99899528396212,38.77036306801949,-36.931955306734736,18.384827286719812,47.16764313700659,-46.65834187537946,37.05729698271544,-20.14375844972235,16.426151372010125,13.30523352727009,-0.5196200224095193,-20.66017899053747,-25.57323337281514,-29.335165147575392,-14.71668492174372,-21.331660430209187,8.50256878036032,37.76312313950541,43.2143432696476,7.809376910240459,-16.540797800267313,-9.141633833013444,-25.683470055925028,-39.38630860912941,-38.47718288738701,3.7674014111687484,-19.933994029290126,-16.905767175071794,21.977249099934312,-1.9502818671534001,-8.845565945655288,-10.307043068254188,-12.391721656140462,-36.755130849923866,-17.303255841532042,-17.181149234585128,-22.496176088531396,4.45981803804699,-49.97781020234528,25.90466987199268,9.05311357299049,16.741990873684713,30.36051899849815,-47.25661465157779,47.60311372527654,-23.417246128630964,8.359440849554304,-39.25022288964396,-8.74477223318538,6.790141483255553,13.262166993172627,47.49068030648253,-45.15873182570262,41.502601902059794,14.659181004804836,43.97708275015795,26.49536214353037,-47.79218472754947,15.279698928470893,-2.633474998199233,-12.749902622914213,27.72969979944297,36.11785176895195,-48.56095643662838,38.068925950692574,49.811146101540984,15.656609780495259,-9.489617472766597,34.533203923610884,-42.22156296165265,-32.089849680725656,-41.09216826490481,-41.77310951276078,16.01615437345842,-25.091833002414432,-47.47412573126729,-29.19624326816447,40.06001246465438,-48.664716369209,-30.597900722319515,-19.51139240588867,-0.3561089164377478,-3.078604873418591,2.9839597649712886,-9.08402655808569,0.3245511754687982,6.394306992441365,46.91260835860943,26.013223332535958,-39.66292152710263,-46.23487388451849,34.38460128401135,-36.187825257370754,-15.715140296778351,-8.408717267499014,-18.607970020801233,-33.019548241743706,46.25792453555256,42.372040824079164,48.5424565387536,48.61160327732313,-0.5071757802371906,-18.71401799206309,22.180877274851753,-38.12598895674367,35.246136192035934,28.6386329049531,-11.296987002785855,11.697427574460598,42.36392807598223,4.347361710910036,8.82514576968687,18.546347115440113,0.10900247898948123,-46.46026550884761,40.98270084903122,43.11818806138416,4.5362421103896295,46.16678197995378,-33.91704051259443,-11.923852763216601,31.799415862031253,16.12774814600968,6.240560485869992,27.769938666101098,33.79258210416694,7.589012396910086,10.110727074466332,31.36181069313146,12.711387415785104,-34.69392014195219,-8.26009936345362,44.04947333161586,-10.916150109639489,39.165215933333045,-15.01432740163763,-13.286656352589624,0.7204353717062659,-44.83667351217876,-42.61160860058428,14.71244857137114,-31.93230173364444,-4.852423041426434,-10.554933697878411,-17.657045758184566,6.283051810674486,1.7510548476159542,32.33789368016129,-12.823621816363328,-4.2665427405740886,38.81270988240962,14.458594990593994,23.82122754278953,37.91478976822644,-40.10831684663088,4.953273923608428,-13.824795866817205,-14.546524582985384,9.75777775956417,-41.785281987193216,47.8967585626834,-23.01056271605475,32.69713765947877,-2.7087171614560646,25.32927170606854,-24.015340450801006,40.764204390120526,1.5450505920733733,13.678839798411104,-17.615610783438683,4.031998314478315,42.361515423166296,20.653961666570808,-34.02339502620274,-1.152763558749129,5.5260825710502814,20.68640031946228,-2.4595803993603482,47.51877820620774,41.24083535853656,33.472656424345004,-42.01126937710842,26.931196167610537,-24.566664437588226,0.7872773442043766,-29.63321930156556,-7.027617320137239,-44.275663923298225,-17.896719082924783,-10.680653165254796,-22.634011486472083,-27.08448950909508,48.68913089134516,4.654568706092213,-18.105958255029332,9.949822777453711,-12.680407668077862,45.13247086334516,-21.555962695888354,-5.6176047772665925,31.102677324791856,-17.981388381619844,26.230168790921965,-24.51817203314398,23.832753398953983,49.80478734028796,30.478763092248897,-23.63185369972898,-26.52585883548624,41.582930946540614,41.73774103957949,32.00840220537599,-32.23723344625861,5.025381364417839,5.30442147873346,40.830900154088795,13.732172863171641,-37.9363761526471,-37.932050313908725,-47.55824132201892,15.064346467371877,1.8200928925589892,-17.2996762325454,-12.135713475493425,-3.586387773231415,42.89144964842828,16.919667907655892,24.44309115431642,49.62741702382762,-29.731818965204717,-26.011248170687452,-1.68700555774506,42.58722874251272,-26.26630430728788,41.837145453980824,34.05297752347575,31.98190627832568,-48.947018121079026,-27.23851018418405,-31.77671572875399,19.93631608149046,-10.114905956328549,21.687509316420545,-35.38698688837101,-41.00362999601798,-48.12625634203636,-10.12138584491683,-9.160939085945884,25.886810926478248,-15.436903832165292,47.77492204394861,-7.795387445314397,26.95749699659173,-41.72008128572878,39.37002057945428,28.00537760419742,27.975532730951898,-43.11790146737764,42.73100280208902,32.06253137768249,-35.83415275064473,-17.765818281867205,1.2998394318499251,-46.14541288224563,-38.54391545311698,5.911936936115971,-36.51718540702578,-16.830132941642297,2.5910052509199204,-18.72533406397122,-13.243252616172143,17.775005639863068,44.9606623836133,-6.4156293019936115,46.980897521018676,-34.223386037616386,36.84817903251411,47.847368506720784,25.24488711902059,26.918352015505704,30.725608040840015,27.996359667936474,-5.797694118645488,38.82690054380822,-34.17078561944476,-35.73834226301482,-36.66819839774633,2.405146372782305,-26.392460905180325,-41.06042838734633,21.670406164162827,-4.247888663032839,-14.1288876968801,38.1479502607167,11.463204233702072,21.117347503442204,-20.674162518685122,-12.514595911871837,13.05434792925658,-43.00868743006288,-37.237804297335956,-16.25921384436817,-46.382642203793914,28.112633481262563,32.308218230909034,-12.955074154434733,14.634739134423455,7.756311623588672,-33.09285515257967,-21.826199055580098,-10.397102145952864,47.0870712676133,41.2640551238206,27.435320900739413,26.293955990176258,-13.961691538395847,-33.112666085279415,-38.59604669923725,-10.183086123237175,-48.14126923998116,6.001021736395508,-14.832639969996698,-18.046370062263495,43.07936262665794,19.021473258977863,-7.978184989447442,7.424799461414736,-11.391554981804028,24.844222900863613,-48.649352146546086,14.161844026544912,37.72061776951915,19.707926576523093,30.67786023249201,-2.392270530172837,-41.085793021505204,13.605049437106395,37.3707264091278,39.13981118700784,-23.365354221962253,46.75231724208702,-14.342663842881663,23.465180492792996,38.840297686272265,36.56666870799917,27.72744578443111,21.58875773871047,-14.283820156110373,15.911785027012087,36.22506064900914,49.897986223354124,-9.716532556043092,23.23617001349288,14.78624649728313,28.966612611771936,-46.970252933240296,-40.50853848370212,30.963941467078527,-9.79512109319235,12.088529907431308,39.79170245394995,32.725557705030496,14.745876915529507,-36.11670775572541,-41.687128183034815,16.311416837953928,-28.460230952930267,0.7463229234912916,25.62859252622833,43.308594835764254,44.34306878966791,-10.363246768207915,-8.069125832203092,23.147350312745488,21.437679940382353,23.728519673193077,31.616234037207576,18.007515131029848,9.487516490913038,37.08660779750356],"im2":[17.809136301270286,41.9267508518611,-49.44924587384322,-21.939797485903036,-41.547024548813525,6.932927548250291,-25.791495112480067,38.382529997508456,-41.503701107659055,14.934285485033811,-8.713625119854285,-35.18409090637922,-7.646194937474618,-9.95174520477773,1.5197374586239292,-23.817656443143033,35.845959165197854,-4.062991319449253,12.672193496112648,-30.54178354228333,16.041646986918508,12.644541162027068,12.57354469284818,-44.306551558990506,-43.21735964427912,2.434670479403131,-12.520028386836387,-25.733570183760623,1.2762027647665235,-33.851596362805125,-33.92645890531007,-2.259259755005118,33.71349833565621,-35.22720002114504,-4.484116374240408,2.04843689919678,-22.65088824716911,41.782375524475654,46.28553113094554,46.840934707238304,-24.6179910920037,38.494413601461986,-13.394147115394759,13.110980174922574,-21.757932341913953,-49.426633056360714,6.813967198452666,-38.87164688097111,-49.04082646334138,28.344794520273325,37.95543201060451,-4.497779497971933,-23.023595365569204,31.810782211971627,-33.38366500687469,-27.407476690869316,-22.62185021452009,-29.522888676129043,9.438499373245499,-14.242672640087676,-2.733302139170405,34.12468868867052,-5.551265352670413,28.406092778448127,-29.44561314809413,25.277234839776526,15.788481639873524,34.632348585105504,-9.570938326487166,18.0468455236515,41.08219957397728,42.62439818769637,26.23104808153633,-0.2728105707989883,6.3860165251821925,12.96043588546457,17.499553195232792,-8.928522236786371,-33.74904689287077,14.09012866250238,19.050089068033273,-46.97764272230683,16.343817286716828,7.647213738435546,-21.055082365878885,-15.35178611635304,13.736194177377236,-23.816064496324895,-25.30380122424275,-40.77814975299234,-8.351803939145164,19.775595021358114,-48.75708706383279,-37.840390113499225,35.03224952246097,-2.4992803170264324,-38.99042509878685,-20.22965111374927,11.87009253310054,23.205596735266766,28.07472002219913,-4.222536195196959,-47.07529397723299,9.044524739027104,19.153103076180784,-48.14281509092873,36.33081321270373,-22.411792246095253,-11.171303214462888,31.337198916472346,6.739485463803533,-14.503401714665898,33.98459224603991,-5.51742648822492,-15.046592554323027,9.59052238129211,17.12109301687228,-20.190357326440523,-15.916690813364895,34.10603777935853,31.983529247568427,16.283624435861626,-34.88168415927511,29.778510030025757,40.57695957740415,-47.29922176322058,34.49246259557725,35.579256016551014,-6.041207756247871,-26.028819085788214,46.963182646255575,-21.905920906384978,-16.78427349588241,-36.30429224788713,0.19100872187179618,-41.578222104329264,-22.50445109666599,45.37179479913914,25.92641557692521,33.91303925255019,20.35027920241386,-12.290752333564868,31.34543135813341,-14.433139718978808,-43.073445228583296,17.434404783901087,18.107456409933064,5.027702872069348,40.00434131029425,-4.005766639587179,21.431798512442285,30.310695466923875,47.59519809373572,49.788477701722,-4.189254938739495,-7.276938984586323,32.99673214382307,-17.825137127271184,12.046375216204133,-36.670481025572876,-35.53655166194538,-5.249659345938959,-29.302903565481063,7.14380675414057,-31.91568343292024,-48.18690654395182,-49.796423404664935,-27.60843159574995,44.60234830695289,-32.72278494022913,-21.804845358899538,40.1740058453005,-17.941333368307788,-40.20294683645126,-45.463422426847345,-15.852337849732464,-8.3163902822198,-10.313453368497171,44.721767605583025,-2.8037405499594783,26.188243233743464,44.59614252486031,-41.12869160551118,19.45948350533817,39.16651447350023,23.78104217876934,8.922962678743943,33.859011595980334,47.587745011233324,33.08520907717319,49.47737048397059,-42.941450513242906,5.679537757001732,11.841629683212574,2.5635821258484484,25.507062182759228,48.18930672642979,19.56922888109368,-6.748080393366337,-20.46706852546333,42.029098769804946,19.916679882962327,-15.02793711291055,12.516008836702383,-22.693223534848308,-9.778466685220891,21.924787258448788,31.3978489890456,-6.36677209596823,-35.87282613346005,-10.27318350441935,49.310004061016826,-41.198763524946436,-34.78428439500188,-13.03006489454932,-22.326112224585582,-38.60197910456608,-2.7282287781206875,18.458431524698554,43.15648666801545,-1.0211580667451088,35.35289298475391,11.926481336154168,32.98763531903019,-25.572714954112406,18.53506920349345,9.800384224574657,-31.289248729849618,5.638950859631933,-35.47625211066949,14.796876688926787,-18.767472281846075,19.17696983512198,-36.766836223598446,-19.737913186571543,-24.47755332782846,-0.9888885765658131,28.713911570654616,34.855095375908206,-45.578164235347515,-35.3365776414406,18.486803411527234,-4.031943502602175,-42.39123507064944,-36.49511575581964,29.184448205901404,45.84564691576024,13.968036706497344,45.61909870166144,18.708116487924087,-26.765136856362346,9.557028041772938,41.73104096944634,18.39158971413451,5.092591076066334,12.13827771859063,35.71028462074017,44.201613936192075,22.345625885454652,-2.5041555140724796,-42.75882811186149,-36.09734832353738,-6.506214792937691,-15.875126238807148,18.60197551242213,14.667535357416867,25.61385684410142,19.700390684548466,49.24574378461756,48.40371183930445,28.987280281178045,-7.206612354336514,-3.7121469870175474,20.007332732374437,21.67728377948599,28.574707906929675,-1.6791643673698005,40.95447659985868,12.156281790589532,-44.07431280729316,12.589197425611374,6.630264649109229,-41.998615111345536,15.130573097074134,27.55633409157224,-47.42822319433997,25.079285266717605,8.531957743898623,-48.95745073307959,16.045316748866256,12.620501925523278,37.62756315454013,42.08387424172925,36.58663277881122,9.814337765141815,-40.48636224861356,24.827360222168053,23.423305315642722,-33.04324332764246,36.66089111058412,23.871637573814894,-37.2509051723892,37.28572971595263,12.535859690771623,-32.31053945451973,29.82969072861941,-15.021605573943077,35.446918077066485,35.12565844322876,-30.872791186084157,-19.23902651706121,3.8872062079968615,33.13759007764027,17.149605903283828,-30.93782348892772,-28.495986558341002,35.81105845322034,-21.615532050255226,14.42157741163723,-12.220493114275556,29.672697507410447,-20.905919046858756,31.170782225457955,-36.92135277447177,-5.671364504506812,17.027432654171676,-42.51151281407286,33.324997227262216,-49.07003253518029,-7.327722599890684,11.82904528775152,-47.36395394259476,29.903611427208972,-12.688591131084706,8.914192944841261,-48.12994894114643,12.295231474679767,-48.52037163541401,-44.604955606632416,-14.78626593017718,-7.847848259338939,-19.740987327853198,-23.766464016635503,-37.32594366003003,25.99757395079,-4.003726030065302,-35.95857128134803,-3.704550109622218,-27.750682881529777,15.742698152964536,33.796409295960245,35.218163015692255,42.14231808939955,-37.34015475414718,-27.66066968851192,-33.51100226315252,-7.447355803158594,-17.214253817723687,43.360316329380495,-31.238869850938965,-31.297729798479946,6.450153720051254,24.081381358038882,35.87019645783853,-37.68248781890105,22.96541692215331,-14.509414566255394,38.477720872838304,-12.978338931280767,-37.5328709586484,31.308174647832118,-46.136396645278666,-26.101502308556633,-22.269529327676494,-28.808832630627478,-9.486300134852144,15.798312703446854,19.313643661165045,35.97732011460563,34.106595003908396,-22.867978313608607,-14.867830811446957,-43.395107581150505,16.809878067211557,38.62584737779757,-14.818402633267368,-2.2196466520777207,-2.0971105144773716,-32.017728875818705,45.78701715909105,-33.69160682277378,-49.76018948137951,36.65176669961063,19.678049377048595,-35.55361935574979,44.775046197280716,-44.554606829241685,35.22573368056602,0.4677418654522896,-27.58857860806726,49.058524033068636,-43.097018419182554,-8.13159710275562,39.922183807920504,-41.45834814654428,-19.701924676572613,-45.18791658623316,-48.098335159653885,0.1505835801197648,20.08515185961261,3.5909802512101976,38.90736352518627,-33.375732600308595,11.289868701934836,-5.734577154210307,-46.17875085480551,-42.79018715093852,-2.3936495339314305,-20.327445981835833,-7.816469498259238,-42.94500555067681,-42.1177345130758,38.85214039195195,39.069137194612054,48.770693807428216,-48.32567449654774,-21.626901493321526,-5.959343658140625,-3.158314748719917,3.340695424925876,-9.420388149574691,-26.773798821780105,-0.5598242437749548,-34.502758616765206,-28.813218214001736,20.450835593782543,44.68973041123027,25.437929234367104,-0.3868650038333783,-42.09797624917581,43.45445850518114,24.05794796856098,-40.78439937006016,43.77120408267528,35.61684138498687,14.2142453812355,-9.078898683110395,41.50592231017143,-34.03367912503691,19.872310927256578,5.3809379295139195,-24.996517044614063,8.277145608704103,-39.91997572800835,-31.193514562282044,47.123568229976684,39.758368071337486,32.053062843760685,39.353235267278606,25.370537319094865,40.235123673741995,-15.436016401195076,-40.738856922246,-1.710609692535293,38.57339651697649,-25.995278864493308,-21.51095211385603,21.580032017356118,19.29303835914328,-8.158533012715651,3.3290041715692027,-20.861310100160747,-11.391111687061041,46.56550726460355,39.89073937762153,-8.651827960246337,-45.19582832397438,-48.18416690685638,-16.968117668549624,4.287729850039781,-47.43301059518803,28.0449831267308,44.81674521103611,-26.050042714327926,-9.860095649037284,16.385672443660937,-39.11769222897487,-14.008737850462524,-31.711479469587278,-49.40572419847206,-0.5284486204335863,5.317610339818643,1.1872269665782937,7.915302703779773,-34.71525505615678,47.34632214449893,30.124748024825564,-11.594929578812241,-16.820866218815752,-8.59514778533412]} diff --git a/float64/base/div/test/fixtures/julia/imaginary_component_scales.json b/float64/base/div/test/fixtures/julia/imaginary_component_scales.json deleted file mode 100644 index 00e63507..00000000 --- a/float64/base/div/test/fixtures/julia/imaginary_component_scales.json +++ /dev/null @@ -1 +0,0 @@ -{"re1":[9.379647782681577,-6.7141853957797615,-6.246441070539239,0.6129227695886907,2.0081746720571747,-5.760395805970859,-4.278564819588673,-7.6740475049546175,-7.358765590940499,2.3538071265125566,4.485275045817481,-2.5565863969146214,-7.487048657346742,4.176044251974023,-4.094053516903966,4.909102595065772,-9.557802717787386,-7.839206473297063,0.15313174689939046,0.9030249943207309,9.386369132272378,-7.394986481220784,1.1731609963102905,6.4648259817692875,-4.9607984269297,6.163254020566239,4.082438700585191,2.7775410516422845,-6.199498744955612,-2.678959882702088,-4.958416291055874,-3.8375154616374445,-7.889572288519289,7.754952573199912,6.492558840165618,-5.521828665243915,6.408402684204383,7.220974503040885,9.960252678777891,-9.648804623457316,0.43699971361764156,-2.1683194699302444,-4.087099067517563,-9.753373450251788,3.3094739710824044,-5.741631706196639,4.642090669657062,-0.5164118647747369,6.663155788204733,-2.8527145625552226,-2.8194131963552653,-2.122117897803257,-6.6555361702112625,-1.8221616898156974,-7.861512249434632,3.9983239262475614,-7.4844127753811485,2.216838294613485,-1.7332838078942547,9.366533399179904,-0.9592877579309658,3.753521751474004,2.2517463154676225,-4.226626760361915,4.6657708423673725,-2.6153506929828207,5.647804638715732,2.2725318427910057,-9.78445706418001,6.085805226180405,1.809575099411573,-6.599696682031448,-2.114317688772454,7.189925482051237,-6.7779653836938225,5.782580990942172,7.872414944558233,7.337682887426261,-1.157930809872937,-3.6225617156983976,9.703538966119986,1.036620915906525,-0.8401368759401286,6.617326632365142,-3.945429788491821,-1.410371969627782,-9.460349148540057,1.5292053712771807,-7.71069325958444,-0.6701227458046048,0.48398323308710545,2.8152324988525113,0.08819489860504603,3.736069248978147,-3.9382957198589486,-3.881456151014211,9.319715956852342,3.808022302986398,-8.790602551958065,8.818007765212599,6.115001970070658,1.9379117333058833,-1.2630538861883966,0.1147006119722942,-2.9170117575871686,-0.21974353357819432,-7.309106832192207,8.075123310840041,1.9295652819733817,8.355432921279135,-5.303267648622684,6.468155062496745,5.0151334667859935,1.1953345079655282,1.0874483165496258,-6.8321112462740015,-6.823121600454909,5.011062253194666,4.05502045678414,-1.3892439613800391,-1.0183278545211554,6.926151392792743,8.31051689997678,1.0531006484784342,-1.2274509193211784,-6.257012836907427,-5.0674716729768265,-8.339916156199184,-6.256054346990474,0.6290189740529168,2.823301526208706,6.617360215951493,0.24607259181566832,-5.983551650499299,2.057852754247584,-9.064895754884992,2.263458696296073,-2.9142972787603183,1.9895137292449974,8.17899647764603,2.9505228635967597,-9.264585842461244,0.7716449385270856,5.29359147522009,-0.027760696510236826,9.196381150878839,-9.15490634882782,-3.1463450115168694,-6.708261532149207,-3.7710490529479124,-1.9728102635460232,4.327003077244822,9.715657677177663,-5.060571800621023,-1.0666310801917316,-9.735342963759352,4.088831592196273,8.94159338784953,-3.4132691577489194,-2.57987430741389,-6.028276315716639,7.243766491577631,-7.991202804583406,-4.309730719986462,-1.6471778343320072,-6.677608434854944,2.98320973810155,0.110832616452468,-0.7408751518287708,-5.246268049976499,4.28037298001936,-0.37148093782941594,-6.035619076702239,-1.23821800733457,-0.3577501079336791,3.7164154847704403,2.93364879171941,-1.1905536049208454,3.693341197446806,-3.326314612090462,-6.289368496933103,2.6215022863143496,-7.62389465591782,-0.5083253128490526,5.469963433290273,6.305485318395384,-1.804277158026741,7.646641135394269,-3.883910293572357,-8.79505929030203,2.2308317574193772,-4.5300830844477025,1.8159591183314703,-9.550680802867088,-8.825640323394722,-4.866214541649827,1.65013248387298,5.755888274383739,-3.937937274446586,-7.515118234680315,-5.174684599204427,-3.36907309477364,-0.8915816708496962,0.3018934851613011,8.257300456163566,-7.34671724538833,-6.799242389120179,9.030219746192746,-2.2727804591247196,5.265445359924332,-5.8149594709001695,0.6200400396547767,-7.324284446557769,9.567515440508402,-4.962191649069776,-4.697106185510361,5.178674746753742,8.545318510000218,-2.3045954363647176,5.954171236214602,3.0680131858921715,4.365417495009499,6.27485526322323,-6.927162074070261,-6.9697658203556,-6.997545997176216,4.640062656857884,3.54613005805515,9.811425303887074,-9.48169090798162,-7.255678045296254,-0.19177007955583747,-0.29638502276858425,-0.6668519606779792,7.76290847759547,-0.7906828567039597,-0.5213970433825832,9.175373900615245,7.477289888092461,8.061799565144344,-8.409699951187378,-5.3285837603421875,-9.625057572380161,1.1813859841251588,8.286796197992572,8.177656228634788,-3.985223418995865,2.2850404421429857,-4.834622006731859,6.202061968311668,0.4666592848912501,-0.6019191421165182,7.143218848221071,4.134232440047805,7.623700154062849,-4.049186762925405,-8.333283309840889,4.487245249389645,9.168950901605086,-9.826783304784303,-3.8072206586282658,-8.78197065891191,-8.856009518219256,-5.610692962537325,3.516060053277732,9.210559253885616,-5.770539065564025,-6.267234428681858,-0.06135617820876682,5.13400015507197,9.690856628780917,-0.6687593375849499,0.2732084943404658,4.71495416400122,5.882630705888863,1.8020656896134817,5.736149473799127,-6.701969811333783,-7.408965269229233,6.107355709408534,8.679143966586352,9.755994343882744,-4.452695895587753,-9.418765391009629,2.3844873911016062,-5.904398585685708,-3.149089841238668,6.0341484328126676,-7.284846565674896,-9.354249558235638,5.827692709358846,-7.542737661149133,-7.151388697391468,6.607072774687094,0.38550562337888294,7.698327715985165,-1.5054771484885947,-5.431863579443082,-9.108322800756703,8.11357160869579,-8.300662519331933,8.183851749155448,9.226099544751559,3.7123565218920707,1.2044593235267165,9.812347279533672,5.545937279254922,4.274105397728697,0.3186356750472559,6.7607354510587605,-8.168851990840235,5.610687347043752,-8.798733340914342,-5.7048260673749995,2.2136242186799233,-5.9918805932385055,1.7192887612221028,0.34153746766565973,-4.606431960154376,-5.084966955024861,8.047830132826896,-2.2513320552822886,5.6736584062866555,-1.6038078209366624,8.83195038779391,-0.24416702029363968,-0.35314330323878806,4.524928049034978,0.634796620790528,8.520318674528411,0.26510879742150983,4.23605324473311,-9.30771249514726,-3.334635368789403,-2.093308916878822,-3.534978784097314,2.312147028553241,-1.0583420727691806,6.843467800853876,4.824960889898058,-1.7426984746836425,5.921052070214468,-4.3406369783311405,2.7029549808539777,-5.880799024429972,-1.451931836691866,-0.17917534050853767,-7.676841409402034,8.647287019269672,-9.129374910472741,8.87468931365423,-7.640874509434439,5.97063374350814,-8.123374689076908,7.254897029738206,6.1123694655320016,-6.791763992133369,7.170040553541675,5.087430490139983,-2.397655377110519,3.657082478215761,-8.572782024305488,-8.53119983875448,0.03557173853677931,2.42015744508117,7.714926643771889,3.8777413482608303,8.300084513611235,6.492383289844014,7.280055497925009,1.0034593550088715,0.6259311267571004,-7.038754890634693,-1.9692419248986042,8.401505757920802,3.3720435927180183,-6.592534087430948,-4.846732982460889,2.350570241989363,1.9284436224209767,-4.996633162370127,-9.525891694362727,-4.817526992625007,2.802663089986515,8.392209709612935,3.463593282157788,8.151219244865086,-9.412878301023182,-9.437591596027561,5.4705280121653495,4.484953152444646,1.5220208269050435,-6.689195964200312,1.3935020283454786,-6.101907556084734,-0.9449468798790406,5.434211166881353,-3.8420887806743886,0.3561950893302246,5.911661114036029,4.745386618991629,0.7767699379325137,3.3306157325526815,3.097166497187029,-8.077080922321379,0.3825592730327827,-0.0002892503503364452,-7.940834123805336,-8.303409977472551,3.1056077547967504,-6.884390007258454,-1.0777625272342597,0.29782408371540825,6.525451765399911,-1.9817899134347954,9.106270324085148,-4.087618188447147,-0.8629936609186295,-3.3049661936673242,0.5923663933534495,-2.8336700902689094,0.6178103785649913,-6.745385517110806,8.408578504341047,-7.302517975788627,2.091590792396069,9.518690931791202,1.9458116894630901,2.9486304818922555,-9.7937804780387,-0.02346185641018117,3.3368467101629307,3.041956310771944,9.399973024704703,0.254377928974419,5.595152154699576,-7.8092468181424435,-2.164379025879775,-9.20740983961949,4.869681638704371,-7.715665819302169,-2.447896860582861,-6.985367398361193,-6.348967370941403,-1.9377284268936652,-2.2635860059506836,-4.078827116487409,-8.276682222803418,8.604933558171417,8.159499712571897,1.9390380984341622,4.411347745943765,0.5257946844924248,-8.771212714699082,-9.319092151702089,5.297902197624696,-3.494064388242089,7.074281685810785,-5.011707357691282,-9.214018915761134,-8.271821702315494,7.853610129842188,8.52577316534369,-4.754788387394719,-4.318940735529775,8.891509416719913,-3.596271503413324,3.702654347679271,-7.80225358304484,-4.968962876531946,6.689172116077195,6.35154628122644,-0.28140005521674105,8.81693443887896,4.280663834243821,-6.864165709606247,-3.8236213758591298,6.0551808641350355,2.707383455255277,9.275585162535261,8.678722676167567,-8.967312541227564,4.736173523463005,-5.748884509798458,-6.48004456906815,3.3889681250052135,-2.0138502877464486,-4.364269803332506,8.52887451178131,2.3092333442379758,-3.570874751804432,5.525842172614158,-6.0136358069700036,-1.6433300053630475,6.456409608579428,9.590183168838902,5.247677306015763,1.9826222613284763,2.259915837214166,-4.879922380668229],"im1":[2.6991847060728765e198,6.260852416000773e199,8.387560467232451e199,4.8610067711553215e199,9.704291142906428e199,8.856494579039247e199,2.895167409950232e199,9.853950015352544e199,5.873211985392379e198,2.2541479887703565e199,6.233202395996123e199,4.607240728579161e199,5.391312269236815e199,3.11735059812813e199,2.707172293174027e199,2.98456893807873e199,1.9150846191591917e199,9.5564008251447e199,5.601728853452807e199,3.685160277969005e199,5.468324612395275e199,2.797188132695779e199,6.811760124507585e199,6.3187526146672526e199,8.242190247529688e199,9.203487213311409e199,9.844026834766716e199,6.157098981785972e199,7.267632783510558e199,7.07676681089588e199,8.148698860681757e199,2.500292527483515e199,6.092060235057805e199,2.5673113497373267e199,3.089586905731967e199,6.223005570347517e199,4.05945704765176e199,7.6340194893492464e199,2.3936137757786868e199,5.025367987785013e199,4.443255350965694e199,5.350706047877763e199,9.509441353269404e199,9.205805883330514e199,7.3560008986554565e199,1.1435947811456926e199,3.4875695333491275e199,3.914558128513468e199,7.3153342349435874e199,7.888853533830778e199,5.512221798692873e199,4.639003059465165e199,5.92931791792318e199,2.654396034435664e199,6.096408321651718e199,4.800374708754925e199,8.990280008111506e198,3.586943932882992e199,6.9757425798301304e199,5.178572105742864e199,2.7035313156195227e198,7.474319876037178e199,7.969116526642645e199,9.237908675805912e199,7.935197355601566e199,5.765778810605227e198,8.104151883377505e199,9.465115140705565e199,1.0887090846468106e199,9.235502824628561e198,1.2978941712224146e199,8.50444756091955e199,5.875204909982142e199,7.910682825122117e198,5.460663855345957e199,9.838531275318724e199,9.369850529844338e199,2.56637834539417e199,9.888146099671949e199,4.66477575748983e199,2.8469769519661104e199,5.8779020012075654e199,8.650373923843051e199,9.445427484489183e199,7.604616928486155e199,3.6285523496364833e199,9.568045038068046e199,9.658737039986223e199,8.291868293503413e199,2.7994293076756616e199,7.2604583612462155e199,2.799299140080488e199,3.0255204941007307e199,1.5889834525361723e199,4.519389014218915e199,3.0287323688684476e199,6.568216719143701e199,7.4032586407562374e199,8.666827755577173e199,6.563789827051939e199,4.049174007104108e199,5.7836042010598145e199,5.39257054506604e199,8.43844543446837e199,3.9272319704344495e199,7.831302425507213e199,9.307170736084779e199,1.6060872385426895e199,3.202477402766723e198,1.8470233080958287e199,5.723163996569786e199,7.892522586420053e199,6.074534119242933e199,5.765367600980139e199,4.117948081879118e199,5.952268542019551e199,8.371140842835667e199,8.392646245470397e199,2.949228298032168e199,2.5293437639491855e199,5.017183514884891e199,7.162378936767718e199,8.781917163688252e199,4.614107605569324e199,7.294370979240734e199,8.068049396807054e199,5.9509833558162305e199,9.327804767672876e198,6.8449728341525906e199,7.841824475247289e199,6.0685459099627255e199,3.4404334748403196e199,1.3033527143813804e199,6.02209928667324e199,8.828592820842337e199,6.907490371398947e199,6.190066567817894e199,6.459945142893811e199,8.93890600357599e199,2.7938905825419967e199,1.7928923823477792e199,1.9727494877007945e199,5.573670868231176e199,1.139165004268492e199,6.7242502263885115e199,2.0478067331915816e198,5.64472876140658e198,3.7970305777225874e199,5.718003461904512e199,8.257640119001107e199,6.5188195829004515e199,5.633561995567199e199,7.357276340579898e199,9.700643190556008e199,2.0482339457893748e199,5.122425642529317e199,9.586045628299488e199,3.0968541160109674e199,7.42592585366952e199,4.60106809660349e199,7.797729142367056e199,8.515382015127958e198,1.5098468037977696e199,8.471277119984493e199,7.4744000119707395e199,8.32957284441668e199,6.253482639021026e199,6.036745581075365e197,4.56843197693388e199,6.946873577047997e199,5.4988020549427185e199,8.182069487455803e199,6.4919788670012775e199,2.4025631784992263e199,1.6408489390347679e199,1.656664050340706e197,5.9827068785282775e199,7.442133970659072e199,1.455052215513768e199,2.1232879708518924e199,5.930055100915765e199,4.87602942544376e199,2.456922958403984e198,1.3068464439505677e199,1.4379395808367311e199,5.503237748187166e199,9.592902680995589e199,5.942096112449116e199,6.100997114207406e199,5.4143500038772595e199,9.82666393300573e198,4.999780506845126e199,3.1703260579239443e199,4.223648954452939e199,1.6227612716160377e199,7.855851186968046e199,2.645345277079628e199,3.5155437851194635e199,3.221495474754019e199,6.950664224734288e199,7.7403694725915e199,5.1289734587984334e199,1.732037948232077e199,7.688947376160893e199,1.2548553883051471e199,1.0942357099209765e198,3.081862427331551e199,2.10259273298543e199,1.7948516582692576e199,1.1245836666545682e199,7.916613938915052e199,2.6046246203751575e199,9.044804105796112e199,1.4171334281772506e199,5.758267879681311e199,8.746479595398115e198,2.003938560480052e199,1.3490159223965693e199,7.308749666342955e199,6.994888911389768e199,2.391134828327862e199,3.2190141604671816e198,8.627546049061168e199,6.911152427143996e199,9.983274298801682e199,5.443050170603304e199,5.917034417717878e199,8.592785544340386e198,3.417979989350087e199,9.816158851621074e199,7.173392900369598e199,5.038818174641479e198,3.934001567733136e199,4.986958886067683e199,6.484253232396932e199,4.638792530626682e199,9.185809277866929e199,7.394703483381848e199,9.678591120141544e198,5.084033055989394e199,4.315307596401059e199,8.706543114430753e198,9.34360164338539e199,6.3331235118625836e199,5.886149087511993e199,6.544076874867848e199,1.509625860372018e199,8.423889741348015e199,9.372148691664327e199,8.439893433070206e199,5.261888437686488e199,3.640125170468866e198,3.985378246211431e199,7.159755171293438e199,3.6640922941977304e199,5.191253555859337e199,3.245597403743394e199,6.869329362721598e199,4.770471128136379e199,3.4679920455567725e199,6.88297597181049e199,3.7812926859371597e199,9.97072937988343e199,2.1177030377532536e199,6.510115144855427e199,4.930201822985363e199,7.87383443819223e199,8.325256947514836e198,6.680213312851014e199,9.313982271460037e199,5.951494232174829e199,6.706753728645733e199,1.97614504084773e199,8.433598202751415e199,2.521336465791213e199,3.7317101914766992e199,5.245504335072648e199,5.079074387315129e198,6.240330678572743e199,4.085284100349908e199,1.4051243506784195e199,3.3472335849266844e199,8.575537952911586e199,5.427384787241868e199,9.869561302378066e199,7.989391174315514e199,4.696011211151392e199,3.926161062329371e199,7.5153495625367035e199,8.90131478842695e198,9.192978459374967e199,6.610100222889557e199,7.914906976322825e199,6.586679650779314e198,8.236718809732668e198,3.910418443065907e199,7.192071955428247e199,3.776040418318619e199,8.836270635027583e199,1.1703782841527777e199,4.3120942934808525e199,6.634784367403098e199,6.482697550985668e199,3.723389425829493e199,5.084952963713456e199,5.235912110147367e199,5.348909506876004e199,7.00744205441971e199,3.244465577459943e198,3.4584765672611904e199,7.2546401962081975e199,4.003496595391044e199,3.7174631959686174e198,9.495560311883713e199,6.215013202779063e198,2.8002697242057303e199,8.965029550925154e199,3.466241720362939e198,2.605720887405669e199,4.2178020279438174e198,9.101897580484599e199,7.692671100015805e199,5.851645104836433e199,5.978754326848832e199,3.961783478837978e199,5.733718675457785e199,2.3809247238909537e197,7.810860899157784e199,7.215380679109847e199,8.244304204685877e199,9.612122339490691e199,9.985007432553644e199,3.276426041890138e199,5.114475822193518e199,8.065247115557124e199,8.850805510454144e199,1.6942125207895031e199,8.23637267140434e199,5.602211210105594e199,4.105729194859839e199,4.465257927042846e199,4.6877932729094515e199,9.698479508747371e199,5.010311421126263e199,2.7264861253075477e199,5.4739950050598734e199,6.908477226531805e199,5.383019927564052e199,6.661005215619516e199,6.242103833220469e199,6.886451245694483e199,4.71322801096167e199,5.965122220029687e199,9.931457926373845e199,1.6293876260962824e199,2.5773803474963694e199,8.566355683946997e199,5.916954593653306e199,9.69196729736884e199,4.096234501555435e199,7.232080349152354e199,9.085551371208044e198,7.096818861866882e199,6.731431934308208e199,2.4429178481322e199,5.99391856977383e199,1.5604931900078877e199,9.313518635891335e199,2.871225931926524e198,3.770425477795942e199,8.781288128013443e199,4.278257964886789e197,7.3421212302770285e199,8.334652743148534e199,9.329770852139912e199,4.341914859300425e199,9.131345881163409e199,2.8067211443117025e199,5.3724403701005015e199,9.871653183262896e199,4.150348671375256e199,1.2116448036739802e199,4.159900420204532e197,3.1216526799947517e199,2.5725182795554333e199,3.7197266576993215e199,6.127979807750545e199,9.514743925751076e199,3.013015159520369e199,2.5712163691086907e199,7.738725149479886e199,6.104328714495697e199,1.9702042817751917e199,1.5169092148100693e197,1.6475760325848542e199,8.990332923314866e199,4.4993529862564264e199,5.064402741643011e199,8.098130854588847e199,7.366529189203221e199,7.286789846037696e199,1.9600754529857e199,2.2664733059603224e199,3.847342581735671e199,2.689613606303648e199,2.087876417177563e199,1.0444155861835792e199,1.329158562215559e199,2.028267564247783e199,7.5746535535764855e199,2.8068188883773458e199,8.215365724841909e199,1.3572739438750002e199,6.639671851201231e199,9.005622830979061e199,8.18890778157893e199,8.391577874153331e199,8.910710420250954e199,3.3582797745637883e198,9.392873427830624e199,1.0690810661134885e199,4.458049417569531e199,4.513847368865918e199,8.820151944603405e198,4.470538573786703e199,8.360699452820588e199,9.631922215502543e199,5.0285354839783325e199,7.546992739062231e198,7.26248439841186e199,8.205784348784896e199,3.7093595196649064e199,4.782537189011721e199,8.474137685395844e199,8.553635473907715e199,6.5177093767881755e199,4.9245306334081035e199,6.479418515098159e199,2.2002494815969874e199,8.316525055305092e199,8.86065555198694e198,1.8567743201834164e199,9.483885637962788e199,3.618409654492105e199,9.130819514445698e198,5.554633552166213e199,9.888160931140035e199,3.5841071347927455e199,9.661622159626584e199,4.571585891596641e198,9.572148203134538e199,9.732215698955465e199,4.203228294900174e199,8.84288004077454e199,9.363977685288468e199,4.6740479859493145e198,9.055255983599676e199,2.877245468135011e199,3.693130327576608e199,8.801847118668194e199,8.336139715341345e199,6.715552120238736e199,3.5335284763002684e199,8.423891226971347e198,6.69025813619722e199,2.726516362093829e199,7.457627259963305e199,2.1333251501480375e199,6.438571935319447e199,7.139521687884183e199,8.021984670768669e199,1.6831268602202976e199,4.731466937463656e199,5.926939792320705e199,8.638382340845785e199,8.114758236874606e199,3.5394980547094857e199,3.682165506365442e199,6.513693497542959e199,7.120799036836045e198,5.159254524294203e199,9.620367003171868e199,1.0316431713641782e199,7.227716253275069e199,8.763619004229278e199,1.2006941114355562e199,3.5961972023108677e199,7.108103181131761e199,5.099772894299314e198,7.806434077110195e199,1.3878373812235723e199,5.0123380048702115e199,3.2846214182821133e199,4.2426213548393105e199,7.1264367205748065e199,6.270317148106765e199,4.883240642928166e198,1.6288212986397165e199,2.2435671309777284e199,6.878231111147204e198],"qim":[-3.178769425698291e197,-1.0032382951461384e199,-2.0410816363850614e199,-7.567652169102542e198,-1.54171190518055e199,1.7424172041448518e199,-1.1143356865471327e199,1.5384843864567725e199,9.060467289151567e197,5.627040996006578e198,-9.647558090050935e198,2.3407646710159427e199,2.6246761091942773e200,3.4209188006979606e198,-4.1274030057383107e198,1.9071146493421453e199,-3.0831739648430376e198,-2.61002139571159e199,2.4340666192442787e199,1.5387345061346058e199,2.5635575492010844e199,4.168464092601049e198,1.0730505423173838e199,-8.751024180094513e198,1.5093594416335344e200,-9.336419893280016e198,-2.6166375329038326e199,-2.034702475510954e199,-2.598043182948803e199,-5.908697130743543e199,-2.375531363112241e199,2.5299009881957864e198,-1.6146500448701865e199,3.2475625801893165e198,-6.300653523946231e198,-1.196478096533105e199,1.6954456595216915e199,3.4536843380249156e199,8.598796001622949e198,-6.82147736436918e198,5.255766339850194e198,1.9085330921343022e199,-2.75385140926037e199,9.399906726580119e202,-1.8255901344394715e199,-3.587184890484662e198,4.1697561416794463e198,9.416451229805946e199,-2.6120841850977993e199,9.398698628925661e198,8.135687297343299e198,-1.661907600284548e199,6.613822507715758e198,1.6898701599048675e200,-2.3351609119932923e199,-1.3584923448663287e199,3.9095562051447164e198,6.742793478504794e198,7.756491629459649e198,-6.456206557008424e198,-3.9330998868196066e197,1.819550831230612e199,-1.2316827842025652e199,5.71386451441792e199,8.181270361944406e198,-3.1345084999697826e198,-6.810783990698612e200,1.1495044677089781e199,-1.231910228037928e198,-3.207434677422959e198,-6.678601271620619e198,-2.6837668628467537e199,-1.7949243437111925e199,-2.702477508215654e199,-1.1448715214996469e200,-2.1337946900914127e199,-1.434833810373153e199,-3.9485660633987376e198,2.5272113507124824e199,6.120484879393641e198,-3.7641174342783384e198,-8.59143242296604e200,-1.0137289465284223e199,4.3347325443884455e200,7.73148335252078e199,-4.299785143717281e198,-1.5081509819527427e199,1.0314610217378592e199,1.249664939515837e201,2.970863389317025e198,1.1039684351071458e199,-3.5007503887762106e198,6.163270168907956e198,2.3043332528539684e198,8.507691152772055e198,-2.4934060538058913e199,-7.97502755910215e198,-1.5437644182581582e200,-1.3218172886339428e199,-1.8976808803168111e199,-7.686755582562234e198,-5.910462284781128e198,-1.7490114449781186e199,9.434130107097514e198,-6.124901065770991e198,9.621806890300678e198,2.350066333299397e199,6.660396890288885e198,4.129456911992691e197,-2.3330248633040046e198,-9.273257475897269e198,4.158042381022235e199,4.182784850796265e199,6.032391737865728e198,-1.7063631463041192e199,5.7263196642917665e199,-7.950301091607452e199,2.6588316048026073e199,1.1165573044442315e200,-8.086269073986273e198,6.120524141341829e198,1.6600073231698253e199,3.235071681085155e199,4.7702803742004273e198,-9.756716454000234e198,2.730695188007378e199,6.425582156630212e198,-5.003798522823614e198,9.59910001614507e198,-1.6856532215156884e199,6.142004039363651e198,3.685478920161712e198,4.516314993137843e198,-2.9627850634244518e199,-1.132988810560243e199,-1.1776466302786525e199,1.4643538254520276e199,1.6649867505468551e199,5.844582548754799e199,4.0459721790875906e198,1.9529170868745155e198,-2.1305156703710942e200,-3.709642813120939e199,-1.1768725815030924e198,-7.782933478644242e198,-4.323440620381973e197,-1.0024775746910643e198,7.282357448255969e198,-1.3886138761977878e200,-1.875652752113994e199,-8.033246036962161e199,-5.798880011079041e198,9.924771775066675e198,-1.5150467262399495e199,-3.99979269970387e198,6.654693798241425e198,-1.3491279929883448e199,-6.856658480504781e198,-6.686979998809982e199,6.93570917007055e198,8.932811462958303e198,-4.054430772450662e198,3.0471627423417134e198,1.3868749039399582e199,-7.812437724949363e198,-2.0702171854092485e200,-8.769885933571113e198,-7.1136345963768384e196,-9.464742763524883e198,2.244729100881528e199,-1.5072738567566433e200,4.1729737078633474e199,-2.029391677766782e199,-9.521488687458969e198,2.3759641914681028e198,6.9281320787808956e196,-2.53413442528921e199,-9.103757145364988e199,3.4994592053846553e198,5.174617214954858e198,-1.1614299286697815e199,-7.625018383716311e198,-2.9180539152492306e198,-1.3384445505041226e198,-6.357002166069481e198,9.511593235881878e198,1.0572388882247992e199,1.7666378756580256e199,1.0665154471104155e199,-4.096879197167464e199,-1.0623053560182056e198,-7.091867121573192e198,-1.4654640042723576e199,-5.782862143252951e198,-1.7839666483383354e198,9.097854401906663e198,-5.110606211708422e198,-1.0917851385839635e199,-5.752451816281969e198,9.973595252510932e198,1.1229171834430883e199,1.9811660846451923e199,2.429790212820729e198,-9.217619242286394e198,-2.267577641334335e198,-2.8046609788275117e197,2.020340033761585e199,-3.040764190728812e198,2.84695301943292e198,1.1561819624258842e198,1.3150248734294033e199,4.200721879627213e198,-1.7468043919743785e199,2.7200953866729114e198,-2.68093568231104e200,-1.4450393526285816e198,2.1003896626940258e198,-3.494730827360476e199,-8.084987926455434e198,1.6273522608787528e199,2.404674844949647e198,5.1719023610303785e197,5.0408039794844116e199,8.680306963307085e198,-3.907378954674946e199,7.326149907721546e198,1.9887929803364844e200,-3.0457401122341534e198,-2.053693427928497e199,-3.652137264479699e199,-2.319532042305695e199,5.377537257957366e197,-5.688513499292138e199,-5.330141101880702e198,7.966107657949493e198,8.609352040056296e199,-8.694357794412985e199,-8.326608762603347e198,1.857556004543123e198,1.2428865741465212e199,1.8036239483902264e199,-1.4427929806432572e198,1.0492532321611728e199,-6.806845028724118e198,-1.0529362632694907e199,8.339752572275432e198,-2.2603349476586787e198,-1.7489308438833521e199,2.1646249048200246e200,-1.011626576434894e199,1.0810642642113788e199,4.282913323291645e197,-5.553944483842125e198,8.312690462057967e198,1.3517130514813055e199,1.0455162073837618e199,3.258698249873566e198,1.624940727030119e200,-3.3786548007912576e199,-1.251153836101763e199,-1.162549290442033e199,-4.4464923135301134e198,-3.0639870575500603e199,4.044466724508021e199,-2.570783934532985e199,1.0821050722247717e199,1.7759496123543587e199,-2.623553110401879e199,-3.35349135072083e200,-1.5037416150952557e200,-7.635658134558592e198,-6.949030560448694e198,-2.5986006117473894e198,1.4337673080351408e199,-2.684394642583716e198,-5.239317478704873e198,7.508973232900695e198,-7.56155085032014e197,-7.254435936694235e198,4.4431429725684023e198,-9.05970157848427e199,1.5218824402905932e200,-1.7240292965638756e199,6.930256738307807e198,1.7321023243640225e199,6.43187571913029e199,-1.150623793126709e199,4.441123611362197e199,1.7525207179924924e199,1.630972942879207e198,-8.935358964049126e199,4.19311005065055e199,4.9386469861840605e199,-7.476102845679519e197,1.633086551031984e198,-5.445659995222667e198,7.357879639762452e198,9.108671562963695e198,-5.374994620638966e199,-1.6962430903291037e198,6.641787472606716e198,7.879100062634218e198,-6.821662535688193e199,1.264534882427711e199,-1.2942792893957654e199,1.423225372269058e199,5.569214068404384e198,1.3197581077101755e199,-3.7616337530307265e197,-5.542808967267866e198,1.509455760327606e199,-2.66655111139767e199,6.165334864567856e197,-2.9102473438203476e199,-6.858153128662019e197,-2.1700803165808716e199,-2.276995007182836e200,-1.1789537296126704e198,2.6530168722662964e198,-7.552073213389171e199,-1.977776266467061e199,1.34048406803528e199,-1.9986059796932375e199,-8.039518487345286e198,1.1226233938782798e199,-2.681842764670145e199,5.2644116365110064e196,-9.865647070930601e198,1.3893393543218084e199,1.3742244120110987e199,2.9736999617678215e199,-1.891247684011512e199,5.801347092321569e198,-1.12473293163411e199,-1.1405365843115948e199,1.0192891225249745e199,2.5792407525614157e198,1.365360584955082e199,-7.713499734219908e198,-1.6500713225500388e199,6.969149637066983e198,-7.50740546485193e198,-1.0714590456816775e199,5.121096838726519e198,9.847325644631852e198,-5.630844769117438e199,1.8393620923852773e199,1.4713988153444599e199,2.4261086730127703e199,-1.0566815172600962e199,-1.3048330524107469e199,9.9020479738615e198,-6.599771796451955e198,1.4757789521905823e199,-2.1182026142466287e198,3.289467978157779e198,-1.284242336596572e199,6.630331888602965e198,-1.0969598344783335e199,-6.496182329986225e198,1.6487686063207509e199,1.209115978909771e198,9.984411548519428e198,3.6938828394506463e199,-2.4721054599141975e198,-6.61317708304402e198,1.9888505679318542e198,2.892661436129074e199,3.882858941476264e197,5.427927934800136e198,1.1137621221563138e199,8.908951008204699e196,1.4482018290763394e199,2.1743373163358984e199,1.599245490199668e199,4.90811874451091e198,3.720475965202008e199,-1.2192819126469834e199,5.94726581093026e198,1.105134867003536e199,4.6999425816970995e198,-3.411944245090945e198,-4.195593926074032e196,1.0844185202196543e199,4.687141610971669e198,-7.356096847664947e198,-1.4318191948364112e199,-1.7790313043994868e199,1.5472154371923574e199,2.2396285911518595e199,1.6906200057979586e199,1.2973340884262438e199,-6.258277181242396e198,-4.508400915934377e197,-1.9674106083084156e199,1.0661927947089818e199,6.971380334115435e198,-1.2269939937568244e199,-1.2729168983631618e200,8.879910424015886e198,3.7091883645699505e199,-8.313437505738981e198,2.479599087245441e198,5.62995622506621e198,-5.241079524160342e198,-5.641983138941047e198,2.2093372496255e199,-2.842509238958504e198,2.280152182766686e198,8.185557667823054e199,1.7922241345452337e200,9.950552937990472e198,-2.949009401638986e198,6.912040781980883e198,4.693026258837124e199,-1.2139894827642946e199,-2.764989307993779e199,1.6155306885138373e199,-3.4743068151518455e197,1.4317072869455181e199,-1.6532133759703486e198,-6.786981620784979e198,-6.26120264997599e198,9.755271284586761e197,6.070030904550747e198,-4.132373733039778e199,-1.5798029386701227e199,6.67171215500401e198,-9.801707110613365e197,1.345368848744077e199,-1.4866135024723187e199,1.2688188338987556e199,2.13272610076397e199,-1.7056316284696586e199,-1.0718306636865743e199,-1.4400964386860435e199,-4.00659850376045e199,-7.723609497765007e198,-2.565574335404979e198,1.0002182939485962e199,-1.2038747266981398e198,-5.373730801296859e198,3.4392176272131796e199,3.0349614884313317e199,8.809116969209608e198,-8.320814652823806e198,-1.1991485235414852e199,7.083231935278514e198,-2.106814626291122e199,6.812422037108123e197,5.544551376548678e199,-1.8132364216269138e200,6.185212828021586e198,-9.449580167434347e198,3.4252536327964584e199,-8.459898205319758e197,2.2885783507811134e199,-5.3773174835784e198,-4.564581792534273e198,3.30358030803843e199,-6.525945176744874e200,-1.3804097646521456e199,6.432208072413798e198,7.297959609006153e198,1.0071983706571678e200,3.1027644611196184e198,-1.2510617081481304e200,2.393574259699026e198,-1.3555546346524377e199,-1.4609304202392132e199,1.0846132939942876e199,-9.976438456961025e198,-4.847568154598701e198,1.1350912146629671e199,2.371141514695453e199,1.0908937137145934e199,3.5995527537641444e198,-6.689401985373082e198,-7.539307657642665e198,1.8350750520522079e198,-1.1869151533456482e199,-1.2062980997136396e199,4.992593567368866e198,1.7254179647406704e199,1.1029681751371282e200,1.5577109630098763e198,-5.066342468388449e198,1.9978383164446122e199,1.125926035714276e198,4.614458902920467e199,2.901642636487698e198,6.655919879160975e198,-7.957242514094871e198,5.891799778015381e198,2.4201498774710502e199,7.476231654034561e198,-4.946254730200557e197,2.932907857374401e198,2.0400397691615577e200,7.522803284509305e199],"qre":[3.3816138961171206e96,3.35471138282191e97,1.858077525479545e98,4.603182839725189e96,4.339263823720405e97,2.2163999599829674e98,3.594869723255024e98,1.8987599975788796e98,6.414235417442505e96,4.3088093100964715e97,1.379715264085834e98,5.3882183669957056e97,8.291697608536904e100,1.0755792405259346e97,2.287636095666027e97,6.711209524724407e97,2.246134982866882e97,1.8631144289084306e98,8.182343348059506e98,5.46984493929974e98,4.0148329783908225e98,1.0492252394635618e97,7.872931654956098e97,1.8388881729914786e97,6.485535375568367e99,5.704112343764398e97,6.108710290517068e98,5.50361485965105e98,7.143541380998202e98,1.7757024512551575e99,2.7874611937061025e98,5.159209621093063e96,2.062319536233379e98,2.0742698045808272e97,1.2713148834871607e98,1.335248689600589e98,6.251562824372392e98,1.08955406059098e99,1.8360423598121204e97,3.724179625019234e97,2.4107948294583355e97,2.823691618185753e97,5.884606666104969e98,7.508596468952811e105,4.064749137586262e98,9.642996020401092e97,2.673632856372592e97,1.3960697253532767e100,3.43503135966849e98,6.150306130010393e97,6.423370392240202e97,1.2683709832797665e98,1.0398364885494774e95,5.297981467624688e99,3.3044640440176493e98,3.6945540171043166e98,6.049732254284567e97,1.2325315213801702e97,4.694842691920432e97,7.514491321298757e97,1.0330935502897937e96,3.340476546190469e98,5.119475965256478e97,5.474600369844346e98,8.18824905758123e96,8.906156421056205e96,1.6491797501936182e101,1.015058560755625e98,6.049670007694388e96,1.0212072566053935e97,1.9655260445705972e98,7.76902564826524e98,3.7480780409853955e98,5.542980624324038e99,1.0928690448547366e100,1.7556812926398917e98,1.7509630370339873e98,4.639985674311505e97,1.7540238270452073e98,4.305075305047569e97,4.464896911495015e97,2.234270228566216e101,9.822921772595037e97,1.8909230819294106e101,6.128648372144394e99,3.504401496596475e97,2.463105077822958e97,5.563578204159363e97,9.464882589168374e100,2.4850314710057173e96,6.941090601545191e97,3.034478439535309e97,1.1398862683902459e98,1.2308709679577954e97,1.3052592070508627e98,1.717481957130013e99,1.725482098613174e96,2.088917933068659e100,1.2858939485991523e98,2.8283631228783035e98,2.2677549500817076e97,3.4065638543607646e97,4.9846748227464365e97,3.394656379089578e96,1.0302307204896834e97,5.683124359538338e97,5.879601502755548e97,2.4721444274117424e98,2.656459039220971e96,1.3547876271599983e96,1.0826970902667179e98,1.2539590722778635e99,2.580885052366505e99,3.703563063727774e97,4.722684854042004e98,3.330155475371347e99,4.3212459658273474e99,6.416306908199452e98,6.872811216629861e99,2.385633512391347e98,1.7674516767185905e97,2.0056694283827877e98,6.408732714855323e98,2.6938252443411704e97,9.490418543129029e97,4.3650754603546213e98,2.04824268152289e97,2.3014919926642944e98,9.141691925277431e97,3.412562572235672e98,4.879105325443332e97,1.7511426273999597e96,1.5000562766166356e98,9.109216429008015e98,6.618513854602373e97,1.4239248296584807e98,2.6687091959455288e98,7.818052004433644e97,7.897166389074305e98,4.140805867285738e97,1.9578087015552597e97,1.4293765434937353e101,1.890242269101826e99,2.8233946695019893e96,5.998841791858574e97,3.4448696577406944e96,7.02273134979362e96,1.3596492348059964e98,3.067596633458936e100,2.8387110438718587e98,2.3397786844461627e99,2.2962507471569168e97,1.1300768136928385e98,8.927490524813203e97,7.001757869515605e97,5.744800547164065e97,5.7602211975195244e97,5.78055998244402e97,2.2828837083488333e99,7.504583826604137e97,1.5098624792587317e97,1.4944389157815167e97,4.553067033771099e97,1.8959086197228875e98,3.691144704727405e97,2.1604539411950775e100,4.466258632830787e97,6.372021051233981e95,1.2469167298892058e98,1.0496855084334986e98,3.3151857792648515e100,3.029945362913514e98,5.926954123017609e98,8.892040002707257e97,2.272831108788216e97,1.7090722295907584e96,7.154490872532242e98,5.14270095480351e99,6.70575621325e97,1.3962795333938018e97,1.1365712772528205e98,9.889894473327863e96,1.6437414330220437e98,1.0014195219537453e97,5.563461517442079e97,2.1835146267795288e97,6.8108092592581105e97,2.2475994889624823e98,1.760566176559313e98,2.1845565676722916e99,8.024044167510434e96,7.403695054008402e97,3.436201367455009e98,2.937689493288271e97,7.012958475085568e96,9.113877826162293e96,2.8749076028672302e97,1.0516741380880183e98,7.723001301048431e97,9.441425000825457e97,1.5269918698583707e98,3.806410204324187e98,3.095323150492067e97,1.0868446224112263e98,2.4088015196869015e97,2.5851847112885556e96,6.715224823905997e98,1.6610346589871515e97,3.612656470805203e97,1.1930298983945125e96,6.951979835840597e97,5.465946373281563e97,7.187667276961247e97,3.3805892653015145e97,1.0792741247208501e101,2.1729965616987476e97,7.710737948113289e95,6.043907066473734e99,2.64906838774371e96,2.4873616633373768e98,1.5381040753064249e97,7.350921673124734e96,1.0273889148982515e98,5.7099203401716285e97,4.924076419857941e98,4.0803341004147165e97,4.315620947450437e100,5.0165133918280374e97,1.1170121403351156e99,2.8979720504792703e98,5.2862602669734604e98,1.7025316792494125e96,4.546408641735798e99,5.666488502290617e97,3.2413864056373593e97,1.2766057706573498e100,2.4496879809210936e99,3.800804780039996e97,3.1887509640262943e97,1.0162663578990448e98,5.738356301118718e98,2.1678733830174916e97,9.928271324036676e97,5.0312170916690855e97,1.0196805756983635e98,1.563927301624508e96,1.6346655425027478e96,2.8382396257411345e98,3.4709470941787893e100,8.832435880323679e97,1.590402041956426e98,4.549981524257358e96,5.836519989491109e97,5.467262209250477e97,3.5702116494397563e98,1.855490899188299e98,3.228248693348378e97,5.354536154720596e99,1.8144793070170062e99,5.455233955182441e97,1.5374203172163264e98,1.7518178832408654e97,6.175245636963646e98,1.1762035957681452e99,7.796361180155036e98,2.154769016307278e98,4.7867330688358936e97,1.2550858454650489e99,2.9025423132901844e100,1.6038048691519808e100,5.271023820257478e96,5.6856881550512595e97,6.208520953827132e96,4.841741376520324e97,1.6495335921839687e97,1.811726384106226e97,2.269980893092359e97,9.304805865410988e95,2.452238280831466e97,6.570341261542352e95,2.7765726010968616e100,1.750331868405871e100,3.402006131101783e98,1.3887030591333105e97,1.0148543394672902e98,1.0746984186024971e99,1.3473357800973359e98,3.341799938179741e98,2.59678378328656e98,1.6650608295420511e97,2.2583927534091454e99,1.0222025768651424e99,1.9588561222450772e99,3.294651382908203e96,6.21040055489816e96,1.5192674207373247e97,1.3296046589095389e97,7.74201453947987e97,7.274687518022823e98,1.996314652361537e97,7.138038771844538e97,5.8168407148330445e97,4.0367817919659893e98,1.1862721257451333e98,2.075600437290782e98,2.0080967818600584e98,3.240474341888721e95,3.8731314833389136e97,3.3613744398753807e96,3.718085134830993e97,3.030071769907707e98,6.965895548683419e98,4.717678356695937e96,5.279478293211392e98,8.431491442569132e94,1.3419536063324365e99,1.6199388779700247e100,1.8948011669430814e97,1.5761414874862805e97,8.023012777041431e100,1.8870017424959914e98,2.0365182536296752e98,3.8275584732126475e98,5.201780856184992e97,2.534765633572234e98,1.1113280714421452e99,3.05823801433723e95,7.871406388436985e97,2.3171662397317998e98,1.479261099882761e98,3.3889819062283156e98,6.62609695057436e97,5.435266964446085e96,2.993428120322546e97,2.6453701781768346e97,7.641359354654513e97,1.8639385717544874e97,2.081372190917155e98,2.847124893074967e97,5.205699466324076e98,2.6876366952615947e97,8.75334410794932e97,9.966424810032443e97,3.419247742926392e97,3.514010340853669e98,3.9044579324812593e99,3.376033360016029e97,1.1360288765050024e98,6.876520381573546e98,1.0435453203387458e98,5.699522230055493e97,1.758086669859534e98,7.220350325534752e97,6.956608134144493e97,1.401529470610389e97,3.3600986632724203e96,1.8470144912446673e98,7.108940818120821e97,8.87801357059473e97,2.7497853533496297e97,1.9282566491505526e97,6.709635176311505e96,7.881750423984228e97,8.880198738741088e98,1.5745721428702901e97,5.305661292596911e97,6.68499193201648e96,7.996398900278934e97,2.8003600754441224e96,7.791032246824214e97,2.274939420242886e97,1.1858032537827845e96,5.137047608665874e96,3.584857477135079e98,1.0924135452947923e98,2.8089427046366938e97,9.993672087449469e98,2.8071743093727567e98,1.8547345381382821e96,9.610629810752535e97,4.4634106650899116e97,3.488338437666491e97,1.9783159788545236e95,3.6641589429524e98,3.555176020955481e95,7.56979203229794e97,1.0246891901483681e98,4.828703475568612e96,6.620244996400024e98,1.259063591645112e99,8.30020876528566e97,1.9794779894817047e98,4.244167928128615e97,3.0072607784843886e97,1.0874742753821531e99,1.1421833634800629e98,6.541242297954874e97,7.885929294195101e97,1.48161109635427e100,4.0311113248363046e97,9.447086645488867e98,3.1407450115323226e98,6.0673160929328865e96,1.9718757623757417e97,6.990089125966776e97,7.079331539939243e96,4.67016160264652e99,5.377569358043157e97,1.0890898571299745e97,7.647232633221195e99,1.07595884081185e101,1.2006220772303806e98,4.317106902316501e97,2.6234901251623562e97,5.140754202696633e98,4.556170453193517e97,1.835739906438162e98,1.0582631733014759e97,9.962932831357392e94,1.2809132706360217e97,7.638331484831456e95,8.446929621659609e97,2.8879873874017636e97,3.4852080225555706e96,3.0071949033990222e97,1.8764927305156973e99,3.0947989976220135e97,1.0069052216761198e97,3.865809580156136e96,2.269841419458019e97,7.033597491569773e97,3.415644094908496e98,3.2133906690278803e98,1.100598928559831e98,5.646633848793245e97,1.1989965713557035e98,1.1826485888996383e98,9.74733605820488e96,1.0836389159105811e97,3.0425599662001508e97,2.5158588948693e96,1.3255038149608321e98,8.238889646560333e98,1.467043284194635e99,2.9165316762368864e98,3.907676957024322e97,4.405205919847405e97,5.017452751107092e97,8.501899712915728e97,3.2166777625231577e96,3.0322504323836233e99,1.798787027777856e100,1.5488481326474654e97,5.007988154097736e94,3.6915438900910895e98,1.4303312217609615e97,2.23917944128034e98,2.3422784156240606e97,4.776487282538384e97,8.354408562936267e98,2.9968067700725e101,2.2997639524515272e98,1.0094445129120877e98,4.393801500189e98,1.2432905942965574e100,3.020421072812128e97,1.7796488633533116e100,7.999488790981426e96,1.3250984243589961e98,2.2548120401596507e98,1.2447120857154946e98,3.9758209466506474e98,4.0517469797222e97,5.051491080711093e97,5.534710504467642e98,8.583146974166416e97,1.9033718598399537e97,5.220713993517239e97,7.315867437553404e97,3.856673932006466e97,1.1868501930255176e98,5.468013598772104e97,9.484626037221251e95,4.7208512571311174e97,7.457205910945782e98,1.1719001700054322e97,5.44916219826345e97,2.3835687182444693e98,5.295532085946053e96,1.1683894129604105e99,5.659980451165866e97,7.99452898045811e97,1.0210737948932154e98,2.463847910153868e97,3.8014951673322545e98,3.839974750734701e97,1.7676730814385083e95,4.704624809019598e97,8.698158575049886e100,3.197270843777956e100],"re2":[-8.491288120024425,-6.240643370864123,-4.109370403276751,-6.423401422969728,-6.294490631030028,5.0828782899821405,-2.5981106455642315,6.404972388473059,6.482239599744037,4.005920679039107,-6.4609120129829805,1.968263100356653,0.20540866929641233,9.112612078053726,-6.559020985860253,1.56496566114064,-6.211406300768654,-3.6614262399712105,2.3013868269521787,2.3949292508077633,2.13310000163618,6.71035678983235,6.348032879976703,-7.220586396093136,0.5460720634317173,-9.857619214336871,-3.7620903587063648,-3.0260438840031405,-2.7973487243047774,-1.1976865041998437,-3.4302636400497573,9.882965930878637,-3.772991091421045,7.905348353865026,-4.9035975299858965,-5.201102793589949,2.3943303784781804,2.2103987342731415,2.7836615443916948,-7.366978909926701,8.454058007252165,2.803569961626444,-3.4531425048178077,0.0009793507692261727,-4.0293824774168385,-3.1880006636378937,8.363965217266745,0.4157147988111163,-2.800573686207473,8.393559412099727,6.775360946447492,-2.7913724316989015,8.96503937171881,0.15707692208643387,-2.610701596768261,-3.5336045336547457,2.2995653563647185,5.31967046642869,8.993425008461063,-8.021075627020256,-6.873792665880294,4.10778294716949,-6.470104664004159,1.6167531891061984,9.699223964670008,-1.8394522811665084,-0.11899000018860129,8.23408295190886,-8.837568354155197,-2.8794048058521664,-1.9433622676915245,-3.1688473684702334,-3.2732326187267287,-0.2927196545049231,-0.47696739352841355,-4.610814396064149,-6.530268845147682,-6.499519836284957,3.9126708167420343,7.621578762811961,-7.563464747512418,-0.06841585560860786,-8.533221778333147,0.2179010443612448,0.9835909335569788,-8.438915500088225,-6.3442222645901225,9.36413188325108,0.06635273209085923,9.422948620734882,6.576690175513534,-7.9962831656188555,4.908953219937802,6.89563217719564,5.312121623910109,-1.2146968056989529,-8.235979964291394,-0.47955883379598774,-6.556751700935967,-3.4588480577177645,-5.267728319981774,-9.785366900914061,-3.0832105533383203,8.944593024130473,-6.411910867233082,8.139118270396391,3.9603863959949983,2.4113986974025927,7.755202369265916,-7.9168607979603545,-6.171686714668752,1.8981342331772275,1.452270278278009,9.557349475151852,-2.4132893931742183,1.0394579574620604,-1.0529338129938832,3.156516655778759,0.2641358653329622,-3.1279490464720583,8.197310228703635,4.314667072125307,2.7145973967236774,9.672613019822172,-7.476255985947051,2.9545770733548657,9.261391747478836,-1.864144754255463,7.130848540633796,-4.652098293500817,9.880400388977055,9.335105557161508,2.885876464245108,-2.0325805476124437,-7.792303629615507,-5.865503448827014,4.227165907738929,3.879877807299115,1.5294344684173282,6.905362812386041,9.180586284987434,-0.0925949297222104,-1.502481815369718,-9.679595074035623,-8.639737503653764,-4.7365210095349,-5.630778088124444,5.214012913678012,-0.41177778502121676,-4.402542053529983,-0.8114801355400285,-9.71491388820601,7.413043349836094,-6.4028673324360845,-5.120850252916904,7.6974625697774,-7.105364115280278,-4.516564628114567,-1.110505168998717,6.633882684208178,8.729311230514497,-2.100265732242585,4.954926702199922,6.108176805217639,-9.567308278312305,-0.4023526083699309,-7.13063167114033,-8.48616203051818,-4.826789370905726,3.094749194599869,-0.36481771579154554,1.9607287417214998,-3.1989777715779795,-2.5233062364120773,6.906033958453268,2.3912131459136674,-2.360848271829738,-0.817479404582766,4.157934498207219,4.103275435940464,-5.1058225335278085,-6.394777271431655,-0.8419731196755968,-9.7639191960425,-2.261977490760878,5.785821167611072,9.0735431583518,3.3635054440547663,5.720495779725706,-1.3215791199361409,-9.250319484256957,-7.050020003386672,-2.1633598973985695,-7.303734465433875,-9.096365524139976,8.634839424690806,-5.176186870002095,-3.2199960055135897,-5.60021287902972,6.969065867180046,6.893090235611126,2.588865970677558,7.128343587413518,-8.341576250934054,-5.533902634384502,-3.901490120130033,1.5254176900081333,-6.914685260357132,6.304465321407978,9.726701360181949,6.0201248652199375,6.200421487095216,-5.177914680860716,5.209866665413596,-0.2147857525144925,-6.052762216812944,9.540794244386717,-0.386014256615999,-9.039901769583976,4.298325002856236,9.94369294189515,6.224042790757306,1.7115416675939894,7.961875606886299,-2.554979799657591,7.429618884629278,0.2975188708035752,-2.821247128021467,-1.6643087730955575,-2.687784751983995,-3.09260349481484,9.37012229377924,-0.6915693472860127,-9.356147971970328,8.139801156121965,0.5388085548185284,-1.0565253345991525,-8.880810536689447,5.210389940583273,4.090504444848921,2.3925761244479844,-6.034506149696552,8.905001535368296,-9.304051267712893,-5.59022354233941,7.846847754959654,-6.678770604045798,-4.816593961281788,0.4329687176191648,-8.342894136701617,4.867322519003958,8.49918010404945,-7.175761763204401,8.613041955517375,2.7107027561673327,4.965254023990335,9.95979730209546,0.42274338063250916,-1.4119439272159937,-2.7718350417739535,-5.920588510439324,-8.50399015518629,-3.2541682430786594,0.5236050095110762,-2.5323462844955387,4.556121165617524,4.43359112410513,-0.3173275553106514,-0.19920174570944127,-0.6193871459007294,-7.7943434963892315,-9.651351609846255,-7.604650872143455,5.88212477400462,-9.39257002600944,-7.122512057427668,6.985647933980349,-6.716974451213393,-8.602089442968314,9.194581685919438,-0.15509609654422007,0.2199403512591651,-4.9741254223482745,7.831433945644989,5.698024397029709,1.2421557136983719,-4.081274209001393,0.8840467876833369,4.288308540594896,5.457671647644371,-1.028831465681721,1.5764194459585,1.6026468379831353,-8.810311718204616,5.043651118507896,-7.180798005193885,9.774652899405734,4.145544596944504,-1.6439589727397994,-6.89982639178033,6.492370180867102,8.42073880857009,-0.950310502325614,2.944473479989071,-3.9287911082061484,3.6789058234675203,9.604424324828479,5.309641224010251,-8.625150108901208,-6.23957381119329,4.8061297236254745,-1.5013762827492236,6.029620900776788,-3.2628018137519117,-9.06222577154904,-1.2903991169404136,-0.3937219678850745,-2.9400998811901857,9.82172753835438,-0.05584959134752587,-4.6020865629778696,5.738726243341926,-2.927863302868028,-7.4367069822151315,3.5290405495215733,-2.137977196497949,4.522679623641501,-7.9172312196051475,5.193389690333763,5.999241559550532,3.2323780015036974,-5.279587394589436,5.6476986978191395,-4.547280228349642,-7.071449725065282,8.683312040580795,6.568648231488275,6.03237911080852,-7.262865629270894,-2.488213169182771,6.407177574855577,-6.244225511538839,-9.051656755183826,9.783668575133202,2.768757958963059,-0.9721445412741954,3.7559093204823633,3.6584370406087814,2.745551050418447,-5.907270763480204,-5.277649300016892,4.759851723000342,-9.03837648331499,6.729637871330269,-7.692312412123989,7.8352498477270345,-6.670357641883291,8.924070005943594,-8.835298242235021,-6.305602727077584,4.386352530868985,7.514209992824885,7.107898975698031,1.8223187434145327,-9.881932173787558,-9.063599075763523,7.846206322230621,3.219705742112211,7.394618180064207,6.946344024987088,7.884347971012261,4.80220169686277,5.069819056201455,3.833192154929181,5.833857846911968,8.846393262502644,2.454348843150667,-2.30194601855324,9.03346267158043,8.932532560509024,8.830636968923585,-3.55118582437939,-9.914926214265687,2.878641983505082,5.488458623766942,-5.056658082037185,-4.279855885331026,-5.34827234474257,1.9473791994913867,1.1480548066169725,4.5774479912340045,4.705286609635511,-3.14815759148601,-0.3364628042392468,-0.8374337444492301,8.432183154800615,6.454034596618129,-4.127487801416829,-0.6361869235141899,8.29572466100593,1.9645240763830927,-2.357719597498158,9.140482901524706,6.8336989275443685,-5.131793161895484,-3.7006073321400246,0.47272800309713503,-4.676004369655322,8.895316635342859,0.9253680519962622,0.1566109301998413,8.256190159519932,-4.602474115954534,9.605950052422006,1.9189372345874212,-6.745451997600929,-3.034940442587857,5.515655309802945,-9.666042618682813,6.560610198380626,-6.4666853151124215,-6.568530263757979,-7.209233786552538,9.04142149131123,7.364935441160782,-2.023219581030114,-6.096913722423311,7.537098974221724,-7.6996717550254985,5.398136284478047,-5.519783275974712,2.9234745107518574,2.242452599655696,-4.968328180569143,-7.980398176412853,-4.525883962837232,-1.2291050947046767,-8.389106824954212,-8.576050404127836,8.314710004426793,-7.360114267278464,-3.4552797466804908,2.7575706645954945,1.1922423623116014,1.0365192727444228,-6.675588609921935,-8.245985161151681,5.0599883888339985,-4.585890964994435,6.710661592447789,1.726406259597674,-0.5367317567018262,6.795608189677488,-9.357960760256155,2.73380563577229,-5.524945894751047,3.956716614272363,-5.350707814671032,-8.090840509456985,2.664335750292226,-0.12773842699517424,-4.8648975776631165,5.493492182652995,1.154280330159093,0.6642443366773936,8.78737782470919,-0.5961038701282266,8.912717629309263,-4.7497694085714866,-4.88696900891088,7.3961703357205195,-1.687101932700143,-9.760495957081275,5.22155375335236,3.643132342506048,7.43863323700263,9.833160664219026,-5.504476355908636,-8.639644107028804,3.8803857252991847,-4.3467761867825345,-7.9751157739995,2.066347194986797,4.188965457051673,0.7945486734592073,7.708067413966987,-7.09821182588705,3.5578971144078686,4.529403115777557,1.69173336275019,4.7829369605055305,7.530646546036927,-4.127838773876727,7.20089194250999,2.944626193160243,8.387002220193349,-9.872602422015099,5.553605424542285,0.10997663697016158,0.09143175557056793],"im2":[9.033136430240158e-101,2.0867980671850605e-101,3.740922780395276e-101,3.907168371665149e-102,1.7716316123781206e-101,6.465553262281817e-101,8.381558097942487e-101,7.90486108529097e-101,4.589013954590415e-101,3.067464468377139e-101,9.239870691653009e-101,4.53075506467664e-102,6.489130472181019e-101,2.865118101055408e-101,3.635373899428764e-101,5.507174125339876e-102,4.525095613820321e-101,2.6136398993826882e-101,7.736327775889076e-101,8.513419040312213e-101,3.340685772957731e-101,1.6890335512772826e-101,4.657527957586966e-101,1.5172910796020023e-101,2.3464057581692278e-101,6.022540554447367e-101,8.782844317982671e-101,8.185068965315761e-101,7.691548970511278e-101,3.599329622561408e-101,4.0250896827953e-101,2.015426419983599e-101,4.819071019502372e-101,5.049271562969869e-101,9.894237952950403e-101,5.804340012359591e-101,8.828538207224193e-101,6.973274569237975e-101,5.943762952299992e-102,4.0219957186404265e-101,3.877835888040122e-101,4.147906596049145e-102,7.378896818662752e-101,7.823002867554234e-101,8.971580554204801e-101,8.569917261315943e-101,5.362944847281912e-101,6.16332874070955e-101,3.682905203464898e-101,5.492564656341604e-101,5.3493517277099624e-101,2.1303806512996106e-101,1.4094988259997222e-103,4.924583213258837e-102,3.694379051941309e-101,9.609986301363182e-101,3.5583974183381937e-101,9.72395425446494e-102,5.443532681185823e-101,9.33586970220074e-101,1.8055150068645898e-101,7.541395577599946e-101,2.689291897629996e-101,1.5490527618731075e-101,9.707497488092198e-102,5.22648119961886e-102,2.8812527170818e-101,7.271025581105497e-101,4.339956840705416e-101,9.167666307091316e-102,5.719354990414899e-101,9.173247058788512e-101,6.835013043458269e-101,6.003895937512975e-101,4.553025295881739e-101,3.793767327566894e-101,7.969047904422144e-101,7.637628051816706e-101,2.715608980632006e-101,5.360926652678443e-101,8.971582577057421e-101,1.7792086560511578e-101,8.268597861767843e-101,9.50541031401357e-101,7.796800043337817e-101,6.877866479298872e-101,1.0361353910678318e-101,5.050901483291334e-101,5.025513630508383e-102,7.881992809362837e-102,4.1350278608374414e-101,6.931242210322784e-101,9.079024956273582e-101,3.6833359246600264e-101,8.149914629098224e-101,8.36694787031195e-101,1.7819419290535322e-102,6.489066829304333e-101,6.378557314388157e-101,5.1551756649700534e-101,1.5540909093589683e-101,5.63991031160881e-101,8.787136334973445e-102,3.2185076337755025e-102,1.0785068169315238e-101,4.8073736913470534e-101,9.908441083317398e-102,8.95040633500925e-101,4.9888830114667625e-101,4.597321367520768e-102,7.205738938423112e-101,5.724286632953014e-101,8.960878426463497e-101,5.86769693372627e-101,6.679237822411815e-101,6.044993663288136e-101,5.723036070276772e-101,7.617323183512965e-101,1.6258511146261444e-101,9.228161964486428e-101,2.3671746689864947e-101,5.2131070263515235e-101,5.377664193891533e-101,5.4622217328069504e-101,7.272200517123852e-101,4.7229555079118025e-101,2.952195988641485e-101,8.574114656129475e-101,6.791055454641193e-101,9.418056048614488e-101,7.848824886211718e-101,4.435543283939469e-102,9.585197468087613e-101,6.249260652135558e-101,4.5519840135381754e-101,7.092141041711295e-101,7.703791484471303e-101,1.8218214924743236e-101,2.0665630740129315e-101,7.06721786102668e-101,9.203581572883323e-101,6.212252856526755e-101,7.65587087232082e-101,2.3221984745421722e-101,6.659239546350894e-101,3.774007542066469e-101,3.944571210521961e-101,9.734799093181936e-101,9.096611871134307e-101,6.663037566191414e-101,2.363532643282571e-101,3.846928757232065e-101,8.440807102079061e-101,3.772922409054863e-101,8.964202959725008e-101,6.644992019665553e-101,3.033698003869496e-101,3.8077254134260385e-101,3.7911795142134356e-101,7.17800119335043e-101,1.475465988662077e-101,7.741453782052155e-102,7.403645728879383e-101,8.350100663660782e-101,4.520268901115116e-101,4.1989037895610804e-101,3.6314320961525737e-101,7.601459193614705e-101,6.358973052525181e-101,1.4471739064335198e-101,8.024013008614715e-101,1.4236612485038102e-101,9.342797006815506e-101,2.3564949484012686e-101,6.606264890474522e-101,5.898784746367777e-101,6.665261023124973e-101,4.6179308689274646e-101,7.967543971576264e-101,1.107196778637699e-101,4.9965401227471586e-101,8.294232120142198e-102,4.742839380277182e-101,7.305330123697015e-101,1.9796162396070504e-101,1.3282133533371254e-101,5.845242021029449e-101,4.279209237696316e-101,9.443193167264738e-101,7.046984319555108e-101,6.987159735640843e-101,7.360007926679188e-101,5.072618785631207e-101,3.710291455919633e-101,3.5758759141833e-101,8.650047372561687e-102,2.9117991819322687e-101,3.10169684864687e-101,7.51861166893687e-101,6.597211040244276e-101,9.373525406125173e-101,4.9739827088648673e-101,9.080836203207912e-101,9.83550855428054e-101,5.878551998625626e-101,3.5961824569684687e-101,5.0701973764762675e-101,3.77718598122794e-101,8.000085453776902e-101,1.0036694839196226e-101,3.182585175222421e-101,8.067939823526901e-101,2.1305836008606562e-101,6.474927095954549e-101,8.646708929912079e-101,9.101919239769822e-101,3.502519820106842e-102,6.675862630264865e-101,2.961948517913515e-102,6.569867560755305e-101,6.360292190707773e-101,8.846348567941361e-101,3.4883699977803716e-102,5.237335000461332e-101,3.2197838834277884e-101,4.137961640136047e-101,6.456070007268795e-101,4.646760221769054e-101,9.052242557396472e-101,2.1327580331413554e-101,7.048105685960763e-101,2.9665866136016284e-101,5.5272029454653884e-101,9.946548111117178e-101,3.31206179290281e-101,7.989522407267977e-101,2.976824136877985e-101,4.053778447004327e-101,8.94435263612646e-101,3.344667277455362e-101,7.612149024682294e-101,9.067167249282017e-101,8.426113799239557e-101,6.877004186571996e-101,5.413663256534895e-101,1.4714944273609422e-102,4.8300612190342206e-102,7.816574274406939e-101,6.942595499775544e-101,7.284118392621905e-101,7.160536084070211e-101,9.02916064970466e-101,7.540852648529817e-101,5.664803592173092e-101,7.159642756745929e-101,8.811899412564991e-101,9.866732100080715e-101,1.3930321753352327e-101,7.582730967371265e-101,1.2085651022069788e-101,7.829717966079502e-101,3.350380700631951e-101,6.558542143805652e-101,1.522737450693348e-101,7.67979214509034e-101,9.072491178726497e-101,1.1949898296560891e-101,1.51806846016324e-101,1.7241478666066723e-101,6.606029323879635e-101,5.38056700663323e-102,7.896723874070076e-101,1.8168869072379048e-101,1.9863562755648635e-101,5.771640104277121e-101,2.4629244301389852e-101,2.1117783809012036e-101,8.265519138685685e-102,2.907789552663083e-101,1.3596577874399717e-102,4.753308577232435e-101,2.529555475282249e-101,9.815381454030363e-101,1.569283316388821e-101,3.338523772167627e-101,2.0755108454586336e-101,4.779013612462717e-101,6.6521622880972185e-102,6.354167435294071e-101,5.571738832744019e-101,2.60034939382222e-101,3.843018667323294e-101,6.356709801616455e-101,3.8826252508029626e-101,1.9180302284223937e-101,2.003348074201713e-101,1.7663273484442432e-101,3.523550752900771e-101,2.224986007094859e-101,8.120430734954059e-101,6.977457538852631e-101,6.21671205610873e-101,5.623550142553457e-102,2.7622384031043014e-101,6.300495271019746e-101,5.190744269189958e-101,5.588381091290229e-103,1.558235442525837e-101,7.707384881048002e-101,4.1854710801108143e-101,9.647793847837718e-101,3.922081343274872e-101,4.6138308214455674e-101,5.919047185914157e-101,1.1141203412929902e-102,7.979685062139711e-101,2.8010844155385705e-101,4.7252954427979336e-101,5.835029702906839e-101,5.933231475819542e-101,4.3908633704909815e-101,8.718507758379338e-101,5.607192266592219e-101,4.81174588677608e-101,7.968202652099774e-101,8.859557711108342e-101,2.627345980272855e-101,6.316843077060757e-101,8.66163275572571e-101,6.457784180136814e-101,3.683784746956852e-101,1.849734343699371e-101,5.2913141842574005e-102,1.2102389930693958e-101,1.6401580165405572e-101,6.509665042466935e-101,4.746961597438685e-101,9.195831683334748e-101,2.6807916303437863e-101,7.84989702560114e-101,2.4709134485575878e-101,7.280525188899379e-101,8.41960846010379e-101,6.532348000156718e-101,9.880290802021942e-101,6.740902335852021e-101,6.893735178971816e-102,2.824584387091629e-101,7.781942320583648e-101,5.833834187984853e-101,2.3052818483030124e-101,8.451011232024439e-101,9.888257745319773e-101,3.172253777305344e-101,5.0896937196767114e-101,8.003486495253021e-102,9.593397503927088e-101,9.568251875606684e-101,7.150662697884184e-101,2.6691144340149997e-101,5.129897185536936e-102,4.169790869483797e-101,5.611015280480155e-101,4.380905759658756e-101,6.294155071814611e-101,7.271601256708033e-101,2.6372934601915055e-101,8.90047177104173e-102,5.3330790112947156e-101,9.970506415391798e-101,1.61043490754038e-101,6.39184836937229e-101,1.798361342744548e-102,6.319832463276631e-101,3.98499503193551e-101,5.062838352239212e-101,6.592693449997046e-101,5.299811026325362e-101,2.817206385019877e-102,7.768035040312507e-101,8.386221436007102e-101,3.630697666968704e-101,4.6751085315827326e-101,9.726689069531818e-101,4.1629714036264256e-103,5.203554391974956e-101,3.062902129617442e-101,1.4516451281931353e-102,8.332470767562233e-101,6.454079100147496e-101,2.2473278329358804e-101,7.179346755063709e-101,2.1349820558486444e-101,2.244324347977499e-101,4.628864206483573e-101,9.033168639878975e-101,6.055817079619913e-101,2.6527494943122555e-101,7.404895059890953e-101,3.7659151986784726e-101,5.003528357851902e-101,8.907261357678425e-101,2.236579263594044e-101,2.3934831362635268e-101,6.844332625046971e-101,4.64337194177904e-102,9.992662591164976e-101,8.846246644231735e-101,4.2487511126369115e-101,8.645110146598158e-101,9.402111692857235e-101,9.961822464645572e-101,6.737643075222972e-101,3.6459731503652537e-101,2.1020092599824314e-101,2.531605876430123e-101,2.0149666647948428e-101,3.613063454931209e-102,2.7718373327015987e-102,5.869616466438754e-102,2.9877985965319433e-102,8.175049816812034e-101,3.325267909748014e-101,3.2301751327625004e-101,3.6487122834773654e-101,9.187351099648173e-101,1.1943719064497527e-101,1.137510752429789e-101,3.036763341194403e-101,9.10747512685891e-102,2.611568759421209e-101,7.869956042961666e-101,3.378716215312265e-101,3.205930624758748e-101,4.204244942460229e-101,3.768163859044613e-101,3.6280136492277574e-102,1.0587205823219203e-101,3.6223241846768094e-101,2.5292482594137566e-101,1.538117591136202e-101,8.52291760665902e-101,6.605956022795779e-101,5.763075272713318e-101,3.4317188687078695e-101,3.135034834204995e-101,3.029254669771734e-101,3.584275214210787e-101,1.8506034936441295e-101,3.1686286901579464e-101,9.441514329322366e-101,5.324546263445378e-101,1.701698122189348e-101,4.959432673568021e-104,2.946340497183114e-101,9.341132032573652e-101,3.871310979860967e-101,2.3306876450736947e-101,8.466448528028539e-101,6.737826034565303e-101,5.865930105905262e-101,8.104923891419824e-101,8.621262680054308e-101,6.949447404494946e-101,8.199464575850305e-101,8.554172090438416e-101,8.479642275076327e-101,2.9786911554524775e-101,4.6430529603702685e-101,7.542588208530177e-101,8.487912379331619e-101,6.723456704615668e-101,8.15812356906793e-101,2.323745604915528e-101,8.50378719290562e-101,5.852713381463017e-101,5.199579664998012e-101,4.2959440621319236e-101,8.38359354264966e-101,8.155188233939112e-101,4.346538286059949e-101,3.6150302743876654e-101,3.9255209027238005e-103,1.1461270977883587e-101,5.371971012234766e-102,5.798948410420844e-101,7.634562368854979e-101,4.244834126380602e-101,2.130299750513173e-101,4.283499738914684e-101,9.329656710720436e-101,9.045176797030211e-101,5.296844973725297e-101,3.011287421884069e-101,4.625326037491469e-101,4.307768706246332e-101,3.5282318637142042e-102,8.908438699877e-101,4.6890959792921726e-101,3.885946172262269e-101]} diff --git a/float64/base/div/test/fixtures/julia/large_negative_imaginary_components.json b/float64/base/div/test/fixtures/julia/large_negative_imaginary_components.json deleted file mode 100644 index b33b1801..00000000 --- a/float64/base/div/test/fixtures/julia/large_negative_imaginary_components.json +++ /dev/null @@ -1 +0,0 @@ -{"re1":[6.20026545486661,-1.7102517032468274,7.328313612470922,-1.8695904437542854,6.8324546940788125,7.111741475058469,-1.5656639384589006,7.06929071901736,-0.26481238325179746,9.081941052186416,-0.2848358266900526,0.26146011454497575,-8.82537188836119,5.375378550397951,-7.6778421961072585,8.549589678132836,-1.9246436125149824,3.255037074249394,-1.26529979309767,-7.675402742034716,-9.694302576823686,0.8365178519426042,9.753926001484011,-0.9345265698085452,9.025972792267552,4.645908553882235,-7.932556902106118,4.255265602658527,-0.23464500993881643,-0.9279563770461436,0.9602676951108684,-2.9418356011689877,-8.266160639994823,7.3051554276012745,6.413559651064201,7.293711310873331,6.920972884103744,-6.91591096429605,5.71829366631723,9.731354772991384,-8.619647658695373,2.665423318691211,4.153982640223104,9.338773297150883,-0.7910322080295824,7.466236691764333,5.054715406097557,-5.836460872995797,-0.18445096933335847,-5.391694246796157,0.8945828416740813,-6.968059573120129,-3.2883676269798823,8.793628003171861,-4.206956756753623,-9.622487266258712,-6.770071049963464,-7.022938751135291,-0.4779214836225023,-6.491432870167295,-6.211836491619613,-2.439117045024471,-4.843613429111048,9.368624483712708,9.224918482537337,-0.9667915666527271,0.31132544560685105,-5.856322106904049,-5.057411120293709,0.5771669373350381,5.426238965053509,-4.43480860401674,2.3736537104812676,8.83546162573467,-8.636760093603531,-6.4500035884099045,-3.8768181507281625,3.121574983101432,-9.051119178301883,9.853444008852257,4.58196493828018,7.956973576926352,-7.854671585047381,-4.691381193183986,-7.792642160961405,3.5535950555519307,-6.486297996639319,1.3722708596416986,-2.3750506873617727,-6.394750085506457,7.669234476178833,9.43306216351191,-0.352633384231936,-1.7311379572687926,2.548094652691532,-8.815316380710449,-7.082245296769775,7.0704909329081005,1.7931977162144648,2.7826701970400602,7.835084091108108,6.659390157140091,3.9147016541849347,-5.249488018589936,3.840460602513458,8.954521392208214,-1.1169482057551168,0.5996031636879913,-1.4520984061884512,1.277619438145667,-1.7622113888239141,-8.033282737111175,-8.006774800164504,5.029499638560962,9.61637765706222,0.29537340920229305,-3.3330341249045947,-9.235331469729735,0.8687179290263849,-2.981746906406584,-2.7689399849529135,-1.293428187992669,5.4480118707126035,-4.996218335329951,3.4486579687490817,-8.771630859734955,-7.414375238174942,0.8393074868827473,7.178627116538394,-1.903622686779272,-0.9124918712751011,2.4984683042078437,1.331534068469356,-4.70004714288984,5.220129876827382,-9.486851928217275,-0.7663431417453932,-8.21823994825587,-3.491757066901444,2.5939540654202062,2.854118788789826,0.9172667585217713,-8.398494356900382,4.163010407088482,-4.607186721996412,-1.9338713256015687,-2.6008450092183333,-8.396749846678876,8.777753507786294,-8.492885326464902,-3.0140496087397306,1.6253269227927056,-4.461950009962463,-1.491194615541847,-4.24624044881917,-6.196795081986155,6.2864471108278615,-2.352838671138593,-3.756444753148605,9.351497349167222,-0.18100449988698308,-2.3757051454594365,3.5299777922322484,-7.780820166306528,7.6122235082294765,3.998781661789481,5.961937599093323,5.22183874074268,7.82186930485511,-1.0401352103949097,9.313469861501627,-8.880013856029692,7.914415876854669,-0.9838516727390534,9.837153675166618,6.879150744004438,-8.963520120442494,8.931655123378047,-0.9184532735613402,3.3189431797513826,3.4189414476891002,-1.1803423124383254,-4.98930576443958,8.315977829370173,-9.824454763629591,2.9041467928296463,-6.178069880005217,9.784134286903722,9.723129145453278,-6.416741043161432,2.158005338411929,-7.4882772551340455,-2.10346038216779,5.293489946798955,0.12225354423272172,2.037422379933222,9.751588397460917,9.924787070599276,3.0510378508872904,-1.7232569167518736,-4.609136757042012,6.450430004155972,3.10826364198922,-2.8646275036156315,-8.294562912531392,-3.9781342822871313,6.020101956533413,-5.40365642584767,2.5449531683188127,8.789948476368053,-7.072130295274615,-1.8447746992897844,-8.31990064765889,-1.6823862130476908,-8.512081175150758,-8.344167372581959,-4.912515831766983,-3.1547329447374928,4.63844493795111,4.8456853916204405,7.006013344885563,-5.799548600700033,-4.0109028657951935,4.274306087796866,-6.27762459791994,-8.255312156515838,5.3464241344940415,-7.98316052802174,-8.843200162036247,-9.661327853409594,-5.09857212932708,-6.954422336077892,-0.6168612511942868,5.138510636308071,9.492644846848325,-3.73044854600116,-4.92959189612546,6.319939393521018,6.269683157136331,-0.8751762664280012,-4.604063815546954,-1.0146911750444616,-1.051744820720483,-3.4980098349404294,7.4816301413570265,8.837927772905175,0.7622406830681712,-4.995177445110331,5.152673501197697,4.869330823252751,3.638674561886784,-2.0816416527078463,-6.9426473426401625,-8.78845427048333,6.241802420431256,5.010180907999281,-1.804704101430744,-1.1597147689255465,-0.4031497587748145,-3.935067355186481,-2.52476497054019,-4.704516370382561,6.0124978838822365,-5.07153877602372,5.43815609870199,-7.332754171067714,-9.972461536626865,4.765796959926991,9.744625833427985,2.208070313652236,-7.191093599026043,-0.777224098696438,-9.00365093531134,1.709903724961137,-5.0737827275921195,-3.4256927368082195,1.7322069783509768,0.1813643660780695,-4.980428507114909,-2.4035950012483536,-5.250408309735071,9.808667549343888,1.047164181311306,4.604317053349604,-5.995622030704883,0.5205499715644493,-6.780936736573489,-2.9173852131046685,-7.937706866604137,-8.019142103062498,-2.168892466538055,-3.728634362302417,1.8017912536972318,-8.599137796143365,-3.7380071646938777,-9.636741468628443,-8.606419956215653,8.511699830069041,6.136172508038918,-0.6344433921856378,-2.4332536119269292,-6.873308736812824,-3.926344466987242,1.902191315702975,-6.248886819682418,4.906911507881615,-9.519205658072263,1.3303466814216591,5.423322157873843,-2.019861531986196,-6.670345993786553,-2.532291191601262,2.8475751582328215,-2.499517532379201,8.708240119875533,-7.483072413642109,-3.041326108174398,6.329880836875006,-3.6351915860641597,6.247355388048025,-3.879234753891339,0.30539651977603555,-0.7399683269754771,-0.585336136343944,1.6837318724779067,-6.925674156283213,8.863661316062668,-1.955247630430481,-0.4029731707601041,-3.11228880863802,-7.331954225315407,-6.6617814008472305,4.400786544871941,-1.7909101151169988,-9.422752780576884,4.389631893471309,-6.144758723794224,-5.333046449869263,-1.1674764644329638,4.956339270548151,6.8820809026168845,1.423298849312328,-2.367604200512403,-8.069261319113572,8.786866244375641,3.7247138871384102,-5.847289406217941,-4.431824991586739,-4.550346427002521,-7.342165536074907,-2.892592916010301,2.529146409461074,-4.235398066873907,-2.792952457492877,-9.867072827068386,-8.180487174990779,-0.9042941822235662,-5.130572031864007,9.050241643721748,8.721152483597571,6.774019619793933,-7.500629815884999,1.0642372372980518,-2.250118205171634,-8.579416868969368,3.749942684387168,-9.883411173877608,4.805295372729416,3.82763580927697,-8.303329277215209,6.861933731405223,0.17348567637265333,-0.8772195064475401,6.421304895274421,-4.600269254393288,-4.681733087461724,0.625394606282498,-4.09023776966944,-7.6893710695168345,7.378416314658985,-2.005028229331609,-8.536332107798692,6.504264730077779,-3.130242504475877,-2.140386452905661,-1.1025386701379976,-3.748396590296064,-6.367311260102451,4.121152506879053,5.932019456700292,-8.716486427183419,9.25540155928055,2.886795967426533,5.168760911582089,-2.5494369296830115,6.936164495581018,-1.9363221813190012,9.782118316265997,6.3729489281881335,1.195891865428484,3.373597873881762,6.174963546978525,9.099407128682369,4.068264164337654,5.596667360541339,9.356261537093857,7.961768429301944,-6.93753745233291,-3.877708324694387,8.860825636838488,-2.632392707659541,9.275718445374942,-1.4872694840990892,-7.671473402003903,-3.2151991362972465,-7.396064606614436,2.208990707034186,-9.361141219323022,1.4032814447757964,-7.669012250536773,7.7994600867626716,-7.197641689536809,-9.261393420892201,-2.6573493491777693,3.0783639714966853,-5.342382559524594,6.568492033144981,-6.377567676143143,7.503048247538317,-2.320297144639703,3.1930011652913883,-7.864459950650753,3.007203837791451,0.028970824336360224,-6.5052787948585955,-4.3628359830645,8.94211009679016,-9.910428984192796,-6.4205213358578135,-4.403099548439222,-8.980634797966703,9.336348338129056,3.41092427264857,-6.145468127439302,4.479632816332057,8.004193600298251,0.966927243387607,2.738135854326586,-1.6712860295066534,6.920485110786853,3.4039978692883324,5.766967123583386,9.75336384395047,-6.20094891181261,-4.6988436888709595,7.6997986911758005,1.9120687995522179,3.9868492631205505,9.274362817569862,9.410053675156657,0.28836147997657946,1.6080580294323141,4.391692356280316,-8.64624577620373,4.612973387214224,4.209095858669654,-6.063795274768495,-2.687704980101495,-1.9411284798494606,-3.3523455554583297,-7.012154295368765,5.821122664528293,-1.7734263135132977,0.0651914705093386,6.275895291073052,-3.6649085366287153,4.224294627880962,-4.943345620560143,6.759024432672856,6.991406232194507,-1.6064990317701842,5.529028983855946,-4.903286740078558,3.4257044039513005,-9.278778606939058,-3.491379862919306,-1.0099921295716285,-4.091398508358896,-6.9682431841900705,4.2400523890893265,3.7683544991630598,-9.74814340492792,-8.425066063605549,0.4762017913565799,-0.4277921204609729,5.531155524657908,6.064638697113406,0.7318742174337078,-9.331990082762797,2.651606968641154],"im1":[-3.317934998400073e299,-6.12915465235897e299,-5.333523066098432e299,-6.5688015972344264e299,-5.036473734408746e299,-7.341099036258461e299,-4.162310550281471e299,-4.2847430551726405e299,-3.0134766041582918e299,-2.7472758904524067e299,-3.3711604598917555e299,-9.478808667825916e299,-7.370637747724787e299,-7.063847364542796e299,-2.8570268677534152e299,-1.898812003982059e299,-8.413330313583719e299,-4.1547109852942604e299,-1.6372460359100028e299,-4.8331512566756246e299,-7.568065022061875e299,-5.3743739486284974e299,-7.754077467753056e299,-4.715012655786255e298,-1.3426014801888964e299,-8.789283983006661e299,-2.767148859818922e299,-6.722370365660732e299,-8.961295684613147e298,-9.780319055971108e299,-1.236782108165163e299,-5.922360641028113e299,-7.537403923747854e299,-7.043071673854161e299,-8.177028963387946e299,-7.636977280020752e299,-7.953483611605539e298,-9.897738736934815e299,-3.303990601655792e299,-1.940743825257655e299,-2.2218334950987864e299,-1.458902222714591e299,-9.836060208044576e299,-3.9674942047053274e299,-8.696942904119877e299,-4.9212804103916776e299,-5.280444177336208e299,-3.3772803139250645e299,-2.969775170664829e299,-2.619414413500114e299,-5.396886013964433e299,-6.719399167428276e299,-3.3190029136282942e299,-3.022021618525154e299,-9.854887167588388e299,-6.01866884318473e299,-1.6053434811917124e298,-5.998922279631668e299,-1.1445081569898241e299,-6.2346355281495065e299,-8.981136648775286e299,-9.76991840020944e299,-6.843141225647886e297,-8.891895384604749e299,-7.329475316180739e299,-8.960293187946783e299,-8.088930808509772e299,-4.913055715739623e299,-9.916333223722049e299,-3.2636149998172984e299,-1.7213563064308124e299,-1.1960834774328056e299,-2.6447082079990828e299,-9.578289838748436e299,-7.527455872776132e299,-9.843444678458133e299,-3.8899966753270525e299,-8.25370840359789e299,-4.516780825788907e299,-2.388562752888979e299,-7.453756138806266e299,-6.146103491945375e299,-9.336304880224845e299,-6.091163750216611e299,-6.317874641707412e299,-6.5223367072115774e299,-9.636879803772218e299,-6.569336265248859e299,-7.403264699067809e299,-1.1109246018888165e299,-2.6679980398818636e299,-2.5749426084784445e299,-9.311985692089504e299,-1.400294656771366e299,-1.568477263650323e299,-5.329411061781574e299,-1.3493162763414192e299,-1.622080732507355e299,-6.853859349280047e299,-5.506789579680316e298,-1.0665113633560653e299,-7.657986296622253e299,-3.1179985889241014e299,-1.5712521939690628e299,-2.088106887344544e299,-3.1531352327349773e299,-4.782976777656507e299,-3.4600925974811274e299,-2.8753105897159795e299,-2.341017057844065e299,-1.3792393211875842e299,-4.864032609030821e299,-3.0282320026524657e299,-7.025963725349497e299,-8.605932502887667e299,-2.1085318682318655e299,-7.66020983222633e299,-4.9174449593135704e299,-4.351250399016625e299,-5.293807653409678e299,-1.8156314522082086e299,-2.980554790335255e299,-4.60985344109507e299,-3.30675621745822e299,-5.983715192529212e299,-2.8369756589063645e299,-2.6486670572036775e299,-3.030141830358967e299,-5.1178052990344494e299,-8.585398060828982e299,-2.047607176487979e299,-2.7684134599621546e299,-7.619930131421329e299,-5.103558127794991e299,-7.267028681623638e299,-6.133358994769764e299,-5.994795445651123e299,-1.4176961808907685e299,-3.062012619601733e299,-9.20164652567351e299,-1.1044662007572137e299,-1.5129189261863018e298,-7.231602355841045e299,-6.514809979155623e299,-7.042140577832957e299,-4.345546301198211e299,-3.590564984649645e299,-6.05909279097587e299,-8.296700200465865e299,-6.624821206508229e299,-4.922187470043606e299,-4.186188723043235e299,-1.0087174575057457e299,-6.546370459559122e299,-1.4500975606679557e299,-9.965485506692445e299,-1.9819102487315712e299,-7.655854050961156e299,-4.636868923036099e299,-2.439864019674276e298,-3.6509274510492994e299,-8.827921647307071e299,-2.3445149200958128e299,-5.992905419607075e299,-7.519939487062871e299,-3.5859619849267544e299,-3.2447182493902206e299,-2.4606233246602473e299,-7.64648091008301e298,-5.311467085129961e299,-5.831728409953155e299,-5.576187873924613e299,-7.938608452679848e299,-5.50195189329062e299,-1.318815610452635e299,-8.746228877406935e299,-4.95258970804011e299,-5.65497756964113e299,-8.41088780627487e299,-2.0011685756884825e299,-2.619114036390733e299,-5.0233527821903214e299,-9.886278419684525e299,-2.418282800336954e299,-8.146576340047974e299,-8.447363026453936e299,-5.3224478781034504e299,-6.487642935362841e299,-2.84798037311958e299,-6.077968707057204e299,-8.890420959981104e299,-2.7793390590999634e299,-3.291862375205821e299,-5.81431564403145e299,-4.805442371695894e299,-6.464168351518841e299,-6.287679422291265e299,-3.536951179191834e299,-8.80664988534959e299,-4.3282690606115525e299,-8.51801847314822e299,-4.819985671743656e299,-9.769731060298156e299,-9.683570084875093e298,-2.953499319900549e299,-9.465205390543418e299,-7.26919541536048e299,-3.515600421771809e299,-6.887405535018314e299,-6.348567109974387e299,-3.502126834254662e299,-7.450278579015279e298,-4.506962158997219e299,-3.4954630390763155e299,-8.719148381081564e299,-4.956458172982483e299,-6.108102973241536e299,-8.182484850360657e299,-2.6396109415689964e299,-2.397630145664198e298,-1.7537940876307124e299,-8.049630055730462e298,-8.936149016367113e299,-7.770820893593078e299,-6.742007504596592e299,-6.523819512104664e299,-1.6088204638094683e299,-7.0276434325502015e298,-6.204966078173541e299,-1.0312675427008445e299,-8.702205553738283e299,-4.422272912697697e299,-8.099172808287039e299,-8.871610944291556e299,-6.3973693894399644e299,-3.858762725356112e299,-6.681662593567561e298,-2.2860337078204196e299,-2.7830845224694367e299,-2.0573857470060342e299,-5.957364839809489e299,-4.339703268223705e298,-7.746078972808876e299,-7.788841847930294e299,-3.489767815249298e299,-8.62104662593292e299,-2.3545815449199428e299,-6.941479692501459e299,-5.161347138188034e299,-5.74514089746648e299,-8.518418005727735e299,-1.5483856377837325e299,-3.994813344078457e299,-2.3418847446257265e299,-3.1848713957032694e299,-7.250303214859086e299,-9.268261602064655e299,-2.9276658084944685e299,-5.1452787711823624e299,-8.955464080482163e299,-7.582080473500273e299,-8.524368383007147e299,-3.647885788568254e299,-8.845653016983937e299,-6.5521783949799875e299,-6.555680540761619e299,-1.2515316437177826e299,-1.3097105322592917e299,-2.486046845951402e299,-2.9537334748627745e299,-9.323940375906854e299,-2.6235181245567954e299,-5.148810142012661e298,-5.5535025393649786e299,-7.54381605008522e299,-6.693883959765373e299,-8.54489916036929e299,-6.059098705122329e299,-7.070168096615073e299,-7.85705467836733e299,-8.701234129574342e298,-6.390113275967578e299,-5.524403962329561e299,-8.429491260881461e298,-9.043944294329674e299,-4.879013708514577e299,-1.2834992741514262e299,-8.49947926490805e299,-2.8294913841505266e299,-1.3918283037360779e299,-9.309907813429372e299,-3.507148020800022e298,-2.9554239044199116e299,-9.054935443078954e299,-6.239932211909471e298,-1.1464869724893978e299,-6.073293647346174e299,-6.557357942369514e299,-6.888443189703952e299,-1.3457990210170567e299,-8.542373736737785e299,-6.64759486756039e299,-7.442039758777896e299,-3.2399735464185797e299,-6.884181183911163e299,-7.789572178247137e299,-5.846348536364703e299,-6.653848475164774e299,-3.2072199659599645e299,-4.097893123716594e299,-7.814592575805847e299,-2.1087840666749136e299,-6.2776905086460826e299,-3.70865709362523e299,-1.3974253091506828e299,-3.3229646127875968e299,-9.180218366455015e299,-3.671270199783743e299,-3.2393920795468147e299,-9.838246826284655e299,-6.390618742490797e299,-1.740065546357883e298,-3.2544821949026494e299,-6.730865564638681e299,-2.8197923600416733e299,-7.80645811686573e299,-1.3893931860758257e299,-9.034379891305158e299,-2.610928045001434e299,-9.302497483723389e299,-8.254870802912837e299,-2.339326167615826e299,-7.83879327364353e299,-2.4401568944798214e299,-1.5111460187328453e299,-3.517806868606106e299,-5.0497984596524514e299,-3.764448859445625e299,-9.5815583800546e298,-6.500911225876217e298,-9.094359507561603e299,-4.190228449961997e299,-8.499749687588336e299,-2.073755145904387e299,-1.9670250121009537e298,-3.913945796640204e299,-5.1950938921159e299,-1.4785580119033216e299,-2.459995645572688e298,-7.708775140325031e299,-5.8168134713385646e299,-2.902322069224247e299,-3.503113951416886e299,-5.277996521978081e299,-3.290231821730847e299,-9.225924176952257e299,-8.462619464390453e299,-5.314529214891089e299,-4.958597628903022e299,-8.933014866954958e298,-5.171366868217149e299,-5.692275673116837e299,-2.8653169010594095e299,-8.578374998115924e299,-9.534913561224065e299,-1.9598158315848415e299,-9.839257791075877e299,-8.507456058500674e299,-5.3080846815202964e299,-3.653379303523785e298,-1.657742668275879e299,-5.476133149637839e299,-8.274956570623804e298,-9.021930598438639e299,-2.0896785854730761e298,-4.362584791076052e299,-9.840006805612807e299,-8.295677430193699e299,-9.271828084586743e299,-8.227598476770632e299,-5.2790187141824796e299,-9.759681347810263e299,-3.4750482717489966e299,-5.751609681856645e299,-2.976571305455923e299,-4.484122541746499e299,-6.97773321396059e299,-3.835821237384236e299,-3.0878030887626298e299,-8.708041255245624e298,-5.365870052225733e299,-5.688655676398541e299,-3.906743296302111e299,-9.008612620258683e298,-4.8136880297716524e299,-9.855834847983511e299,-5.690271434848753e299,-2.8032842053789086e298,-7.683210710236537e299,-5.6306096107528796e299,-1.1919447258349515e299,-6.268674226467079e299,-6.708190321303784e299,-4.940410890137057e299,-7.403217781058352e299,-1.092212868061484e299,-2.8241099304398634e299,-6.996918264205844e299,-7.596809627815904e298,-8.192115947940315e298,-2.636006421577212e299,-3.652870902487804e299,-9.558799869867441e299,-2.1129896127599933e299,-3.440474224436424e299,-6.724739346700199e299,-6.844039895829159e299,-6.511297965085723e299,-4.598725412843904e299,-6.543594665368525e299,-6.2315977364174896e299,-7.777903462139135e297,-3.246761702632174e299,-1.5326272499420391e299,-6.702824896817419e299,-2.734409300293752e299,-7.198224300553102e299,-2.2023191480250183e299,-8.453906295697504e299,-2.9920382387089495e298,-9.05413721302102e298,-8.562903548068191e299,-3.386676737203193e299,-9.480818318801386e299,-9.593494377834401e299,-9.102643170586844e299,-1.7430755488174666e299,-7.68534483166778e299,-3.3086910065919406e299,-3.506027141635883e299,-2.039392803531437e298,-3.420964350476853e299,-3.2350117589890705e299,-6.415226469410464e299,-2.9423319417103526e298,-2.1391236846395257e299,-9.16578646566783e299,-6.6928947228949556e299,-2.4185514742007886e299,-6.160050251965239e299,-6.420845414438231e299,-4.2354234360548614e299,-2.2959748063327845e299,-1.0330868982692988e299,-1.339243160121655e299,-8.2148043045914e299,-4.852812919318818e299,-6.5375965554185846e299,-5.103976051874439e299,-9.938193501052676e299,-9.267927245455851e299,-3.2723864014839567e299,-2.294826120226672e299,-4.7140235255452315e299,-2.268125815554276e299,-9.503866532884078e299,-6.1912542541210196e299,-5.0878379848566e299,-5.718387632369533e299,-2.3609232399542692e299,-7.132424096009574e299,-6.113231248127881e299,-8.519098186053154e298,-5.628003875432466e299,-7.276974499210785e299,-9.748288917264504e299,-9.017197664461249e299,-1.3037887032474006e299,-1.292228442666762e299,-4.7985437478105144e299,-3.514008466524468e299,-1.785755212789081e299,-6.129121203845356e299,-2.214099990767563e299,-5.682165099304893e299,-4.570933575935811e299,-4.672824715859121e299,-7.385068141267732e299,-6.715770094448835e299,-6.755268036874322e299,-1.6191257610757992e299,-8.994466906976256e299,-1.4583386918319275e299,-1.6983774382536244e299,-4.847210121840212e299,-7.155602574497238e299,-5.1443339810900474e299,-5.304471892631885e299,-3.037568244431416e299,-9.490917525303124e299],"qim":[1.4632791289730084e-299,4.185490992476883e-299,1.7250820582840987e-298,1.4795035033676092e-300,-7.942133687213761e-297,1.9980953388974346e-299,3.8957449613509164e-299,1.6634000701454356e-299,8.601263833363522e-301,1.730668753314786e-299,-7.672349469435134e-299,-1.1823584640481674e-296,-5.140350936626454e-299,4.160649127207899e-300,-1.4507604298274603e-300,1.4205084346780756e-299,3.9945486931893665e-299,-4.054962068889361e-298,6.44771682083507e-297,-9.326958131863183e-300,-1.6858885302739535e-299,-1.0695657083764908e-299,1.063593240281348e-298,-4.4038946701232023e-300,1.9935254448420921e-299,-1.8818931730025656e-298,-1.608564073725286e-299,3.579687371507468e-300,3.108100026445633e-301,1.826683229237427e-299,1.1295286301880168e-300,3.405819565871395e-299,5.0790039505592236e-300,5.624128819446658e-299,2.4757423494777944e-299,1.0957377192959074e-297,1.5332662085521298e-299,-2.2183646029474134e-299,6.540275176206319e-300,4.960805881988807e-299,-1.6858490261667086e-299,4.9547545562413416e-300,-2.3592771695485913e-297,6.558231804010907e-301,1.789813266914591e-299,-2.588097529442894e-298,6.543286662840478e-300,-4.9913010624543614e-300,3.3568350344384123e-298,-6.18639343001894e-300,4.564803923366998e-300,1.3150266820978956e-298,-3.11031327807252e-300,1.6935060513293107e-299,4.6818114430054997e-299,-5.036200869908814e-299,-1.1026370114705161e-299,5.385119247441092e-299,-1.120123051431345e-296,-2.832847944206069e-298,3.983209091061211e-298,-4.3740061044656355e-300,-5.472199193974544e-300,1.4532605822210452e-299,3.7811476433437524e-300,4.2601836923034396e-299,-7.636833040526661e-299,-1.0650468407520654e-300,-2.9708957208519577e-297,3.5613399213083697e-298,8.597494778752221e-300,-1.1072647271359613e-299,1.0440740527313029e-298,2.5988473348902947e-299,-3.045266520034289e-299,-5.672897186585532e-299,-4.664349085895418e-299,9.707033901958247e-300,-3.6380513175498445e-298,1.79208173185836e-299,5.034789735515659e-299,3.4321809920202486e-299,-6.17293857065715e-300,-8.273102684237512e-301,-6.0581208829969904e-298,-2.4421387521131243e-298,-2.586468489825143e-299,-1.3809561322274285e-299,3.3006620825165636e-299,-9.319307515200595e-300,9.4018424765501e-300,1.8979330957361032e-299,-7.320982998457012e-299,-4.645681634466134e-300,-1.9945795291468086e-297,7.746106082191038e-300,-1.1094934677078431e-299,-6.109400466158155e-299,8.43549206023734e-300,7.928551551371694e-300,2.7654323558893414e-299,3.222102590842902e-299,5.414117247049772e-299,-4.2762450156035787e-300,6.191101130980414e-300,1.8799066457661056e-299,-8.326269582351741e-300,-4.0665301869515253e-299,-3.103065672018438e-299,9.665503598619568e-300,-3.396399301334185e-300,-1.63820776011016e-299,5.224323987909416e-297,-1.701747432698006e-300,7.131384365283586e-298,1.0426976531705724e-300,-1.108289964483118e-299,-1.6283460679919958e-299,4.119178742863973e-300,1.1339934485838749e-300,-4.5923806047933474e-300,-8.166638514468518e-300,1.2817995100755595e-298,5.2492176198205986e-300,-5.1339737617703575e-301,-4.531568638274059e-299,-8.241825208459437e-298,9.399231449083982e-300,1.1241585214274116e-299,1.1622842448846682e-299,-7.669097078184149e-301,4.1375938524034615e-299,6.973076839719156e-300,5.133864845525995e-300,-2.2191210130925614e-301,7.838702342703928e-300,1.967635645459909e-300,-1.151369162489923e-299,1.723215068881091e-300,4.5054657930996933e-299,2.7537519615239015e-300,1.4108388407194255e-300,-1.7860450634962603e-299,1.3157217820538764e-298,-1.948587192063486e-300,-6.031243432650286e-300,-3.332431257943276e-300,-1.7882828649826995e-298,2.9339628698047533e-301,-1.5464672023032536e-299,-7.362490129591798e-300,-1.0369073090932249e-299,-3.681403092349215e-300,-1.346655207201545e-298,-9.311733908281446e-300,1.4060616724042598e-297,1.7629122578895745e-299,1.7278298148044894e-299,7.209967051805598e-300,4.7229358742239444e-299,-2.1496613942085877e-300,-1.315023590085064e-298,2.5619208415087074e-300,-5.3733265070492864e-300,2.922969350966566e-299,6.4303087732682e-300,2.6622908131407833e-300,3.093025599730447e-300,4.624786633935521e-299,-1.0857234012232135e-299,-1.7590586297525762e-297,-2.686949961094635e-299,8.143694399564503e-299,6.640506252017524e-300,1.3484687925564443e-299,-5.5961630403434775e-300,-2.9761579024427025e-299,-1.6212040322860285e-300,1.916256208484506e-297,6.830676325023041e-300,-1.7687543531429353e-296,-5.036710907712323e-299,-8.967810274300799e-300,5.873485634251776e-298,5.69629069156974e-300,1.1296830090626694e-299,-1.0469810931699101e-299,2.7299253287747e-298,1.4902201340295026e-299,-4.6776294142578075e-299,-6.096981600746991e-299,-1.289816734054603e-299,-4.6521758700025575e-300,8.660464070936066e-300,3.665760565054325e-300,1.2359128026336863e-298,-3.3446035947629755e-297,3.259256700201663e-300,4.5167851189287143e-299,7.812318788826697e-300,-1.0614341079922313e-299,9.36370232836503e-300,-6.758382824657926e-300,-2.5959780090391313e-300,-6.990363674260583e-300,8.101130112111295e-300,8.494943489954605e-301,-3.2013261262124483e-299,-2.8638755630781833e-301,4.2487248760697887e-299,-3.680296511757036e-300,-3.2305013688978206e-300,3.0514063024445925e-298,7.899431589865223e-301,1.3120699581646883e-299,-2.172409371296656e-299,-1.3087071998060168e-297,5.565936009951701e-299,1.3427291179215675e-299,1.0470753896686073e-299,1.11674079468999e-297,-1.3821780892015692e-299,-4.99852888295141e-298,-8.777208481424416e-297,-1.2797544834554323e-300,-1.4277670876115727e-299,-2.9126597531064764e-298,-5.671909722513297e-299,2.1009183381511314e-300,-9.780232681788452e-300,-3.1249527173686194e-300,7.416627496787079e-300,7.432742283953612e-300,5.412282765352407e-300,1.7090003855110468e-299,-4.7927109277266896e-300,-5.3269983125167606e-300,1.0903465709061443e-299,7.899511303107106e-300,8.199563028406667e-299,-1.0116029632790214e-299,-8.745034665280652e-301,-7.61500594682468e-301,1.773517964671697e-299,-2.9687628124255313e-300,2.152193151489033e-298,1.9524091429029985e-300,1.3644268500653689e-298,1.804812504553026e-299,-1.3129571837603925e-299,8.440814990851468e-300,-3.61427459636315e-300,6.447991815301775e-297,1.654963580462841e-299,8.158824542722327e-300,9.359079296651036e-297,-1.223113639896469e-299,2.5537102098559133e-300,4.7579391820787174e-300,1.7924247772654828e-297,3.2780451710737015e-298,1.1498902451650445e-299,6.000118895970578e-300,2.1944878212581342e-297,2.9292818070773225e-298,-1.851211613730505e-299,-2.1389472100989586e-298,-1.2986830420157802e-298,1.2491132066955445e-299,2.0377106406337265e-299,9.022706489376977e-299,-1.416397197542914e-299,-1.6216490569780894e-299,-1.9616353848680962e-299,9.073773511285968e-300,3.7918047981772964e-298,-2.1823280609559576e-299,-2.5429805408506264e-300,4.142118192789196e-299,4.7840043107285954e-300,-3.994657204042645e-299,5.4646989455483476e-300,-2.6972508111395806e-299,2.960104103501907e-299,-2.0811166798437198e-299,-1.5452109382336095e-299,-1.126391139156666e-299,-1.829352651610957e-299,-8.510503158888411e-300,-1.5175520814750622e-299,-1.0771302589563349e-297,-6.022065079670019e-300,3.1226673751427323e-299,-1.261057112891932e-299,-1.7031159177665473e-299,-6.333854197920145e-299,-2.1264212758927805e-299,-1.4219995514110552e-298,1.5677744662358882e-299,6.585590780015209e-301,3.335298965277128e-300,-9.981069953996719e-300,-6.335936226801128e-300,2.9490488161544922e-300,1.0335737937806367e-299,8.222779117421292e-300,-1.8528543463849932e-299,2.0070951480925357e-298,1.2555631783800509e-297,2.602712720557654e-298,-6.105001768765771e-300,-7.747277299380078e-300,-2.2159631938605953e-299,-8.400329773058598e-300,1.9358385401448387e-299,-1.0450994217900626e-299,5.107390468213931e-300,3.5634305286215063e-299,-1.528814790825811e-299,-4.201260803509748e-300,1.002082849381394e-298,1.0294094189224606e-299,7.572580726316996e-299,-1.3609424630908774e-301,1.7045904666947264e-298,-3.970059258811408e-299,1.0298465227257173e-299,-2.401367111777938e-300,-2.353913691431124e-300,-1.34680071624985e-299,6.279386375056364e-300,-1.028675096557784e-299,1.380216657454982e-299,-2.6300565462954576e-300,-3.442992078949181e-299,1.2631938733750266e-299,5.976943119253071e-298,5.1249490083516165e-297,-3.8859729054997947e-300,2.2051103974332606e-299,8.541162813200455e-299,-3.97312071143522e-299,2.844700278441258e-300,-1.1899423841429129e-299,9.359095036358498e-300,2.2510611562694e-300,-6.965358655097566e-300,-5.085029669584075e-300,-1.216568272315497e-299,-6.221773345818243e-299,-2.4899749091458678e-298,4.434437013603976e-299,-3.157287294014926e-299,-4.0735198243172594e-302,-4.861297479385839e-299,-2.2317570521022495e-299,-1.919708727906893e-301,-4.5878563843215827e-299,6.669669355143437e-299,9.203437993536105e-300,1.7252934568900608e-299,-4.231106113433344e-300,1.168032874456892e-300,-2.555034923750584e-299,3.6341957428950242e-298,2.728076414470661e-299,-1.2457293435870163e-299,6.97379581263092e-300,6.927815504222067e-300,-1.4607357914951644e-299,6.129786869497994e-300,-9.926763260054767e-301,-1.346146952770021e-301,2.731920246284914e-298,-1.2677455779004412e-299,7.551199394264126e-301,3.384294845102568e-295,4.920178286123469e-301,-6.58227717109777e-301,-5.945972644759739e-298,2.7044866201766584e-300,2.341275859046488e-301,7.874397361191764e-300,7.437034723419154e-299,-4.127068857933123e-300,-8.790828982462457e-300,-1.816501566961825e-300,-1.2693046935230068e-299,-3.7519782089904115e-295,1.504329977422705e-299,-5.379091028517097e-300,1.023976931445337e-299,-5.422255787277811e-298,-1.2612852755547946e-299,-1.8022888143991903e-299,6.549752033615658e-299,-6.624965820861127e-300,1.0411203660364841e-299,1.4454963604868958e-300,-1.193725056112543e-298,1.999176210970716e-300,-2.0165948584752166e-299,2.4768399811713884e-299,8.973689463275613e-299,1.4522916143812065e-299,1.764050598945412e-299,-4.403335504894028e-297,-1.0698472130908091e-299,-4.378014571255605e-300,1.269144339543764e-299,-1.3016273986600917e-299,-1.2436091928126494e-299,-2.017638563781444e-299,-1.1631322922169683e-299,-2.029307083768122e-301,-2.9251256966732456e-299,-4.573485217851417e-300,-2.7436805087936464e-299,-4.4488881634411505e-300,-4.7890447248575604e-300,1.0731293638769546e-298,-1.394675049271108e-298,-9.521323546834292e-300,-5.787674634083861e-299,-3.6570388808050213e-298,-2.0172668645910025e-299,2.435218323401141e-299,-6.513381273093445e-300,1.5427141819209967e-299,-1.4165160015324753e-299,7.103963478597417e-300,9.726253817868773e-298,-3.791246213981076e-301,-2.0676824802088204e-298,-1.7498702092831668e-300,-2.4772491594588537e-299,2.5466451418044604e-299,-5.317317287532108e-299,-2.783132153927861e-300,-1.5389409015147709e-298,-1.3361697412019377e-299,2.9570830563918345e-299,2.1738371787333952e-300,-3.0660139960469956e-299,5.692616517167742e-300,1.235405464459027e-299,5.323945190063014e-298,2.9819772510750438e-301,-5.712553451479053e-301,8.666300311905901e-299,1.3829788421996397e-299,4.5546462408396526e-299,1.4720481421813388e-298,-1.1243458777139514e-299,-1.298945373234262e-298,7.31583403253214e-299,1.7829505270167634e-299,1.0963026005330385e-298,-1.3094877620990093e-298,-5.700873658366494e-300,1.1680655280182919e-297,6.80567830571788e-299,-2.27764339312667e-297,-5.783117675401493e-300,1.1896217991452187e-299,-1.735754911366574e-300,-4.7587702825343436e-299,-5.618059971717406e-300,-4.0021974252476075e-300,1.2849215056377557e-299,-6.591300370502344e-299,-7.87951117162158e-300,-1.646821666825161e-300,6.604291133232333e-299,4.012241836508299e-299,2.0905366874826184e-298,2.854652990506957e-299,-1.219896270360736e-298,2.00459198194316e-299,1.1859833269956948e-299,-7.53317111642634e-299,3.189133887943926e-298,-1.7806614687768928e-298,7.674357753617054e-300,-7.724443723591441e-299,-4.7200795889550834e-301,-1.7784618308569947e-300,1.0877798050811693e-298,5.800167307406414e-299,5.06502963684301e-299,2.602725086343484e-299,2.564088450347546e-298,-5.009366810115403e-299,-1.010281237002337e-300,-1.2554546199581267e-300,5.778578117932708e-299,1.5895933955041654e-299,-4.6380852730703435e-299,-7.108078510371826e-299,1.9593244263882068e-300],"qre":[0.4799106910327272,1.7887056701876423,2.960593515542934,0.721147300558069,20.751665554624946,1.3803496590336823,1.5482919206802774,0.7095985715781996,0.3925253769481104,0.8970955188937539,2.7689224419203917,56.8300299755851,1.5964793559593948,1.4887071123719946,0.743568714139004,0.33557177841660274,5.561563504786764,5.073486006967405,14.2782836023738,0.6007766112899867,0.7921604454448162,0.9000102778962903,3.996925626690349,0.16480120266872525,0.552233737369421,8.572910141931732,0.39107504204405247,1.0194370380915385,0.11326686220636435,1.515869054097958,0.24341179988427852,1.761954742836761,1.3474017381314403,1.8982425365976598,1.5893749484110742,13.215261363278689,0.33232308602009536,1.2010324784861013,0.43355774207276215,0.7122870226315904,0.41840855024692447,0.2029226646152762,35.19885753740825,0.923708808226123,1.341438129582414,7.775764819726121,0.6316899677391276,0.3537953794639626,3.532505035759034,0.28070479867105436,0.7037631323676673,13.775817842762507,0.6228094583699317,0.6957655219701029,3.232808700862858,2.838678329789333,0.026547642851434433,2.6654501435711158,12.331378630781069,8.250513999710847,20.25951112419641,1.0991228959707073,0.007852421195319866,1.0951969699849573,1.0673516947028951,3.082595834603088,9.66423343689553,0.49163632232569193,21.679938728164405,3.633751643690613,0.2610590450971645,0.20988622972435492,1.657844018941139,2.7225766967393326,1.4335125037681697,2.6639745287478434,1.1946391039265478,1.7637040433512057,4.604652914184854,0.3407607632986023,3.889010842178046,1.146112495167175,1.1240120624599261,0.9632652706824176,11.682448870339961,4.332444190870297,1.4177294995786138,1.1050193110120765,2.565411016224309,0.21660108433358932,0.29547071450721474,0.44000844047626325,4.455788267864717,0.2792609410778722,7.692435805588864,1.8749405165340338,0.22346325989096175,1.8705225771755338,0.7708195055123657,0.1353338706524643,0.5370927694964549,2.65474358957546,1.5681029439280163,3.29923957540051,0.2634830274353603,0.5072317333782406,0.9501356131427016,1.2922475632298165,1.1895203996626116,0.4861409741130857,0.23161685046432784,0.590808576500294,19.723009033873346,1.0773062106400113,7.63551769375011,0.2397490211653399,1.3545464867359027,0.6234617284256382,0.4689750440541334,0.6532507745825566,0.2180325917146629,0.5337025630955418,2.48433295539167,0.7401311219636294,1.5088174881075813,0.8640710714694058,5.518151387125825,0.6419239604956236,1.7856747343604429,1.9703615974950321,0.5411046973988188,1.364895988067913,1.4214469253092785,0.9946710865852578,0.7402181307185204,1.4379779929054703,0.6439861184921037,0.16809282321797797,0.9858035053935809,2.0170637005309597,0.21083549615534006,0.019811182000014048,0.8473341569567775,2.748995538486025,1.1148712651748505,0.5337172407702863,0.37729581904805065,5.576041931779425,0.9123812723437268,1.7294985187116068,1.027704727139238,1.1396745159418409,0.10388324689923077,3.3988595088117566,0.2509138224130056,16.13545641111572,0.4523497402232687,1.685124227879875,1.3572470851807457,0.12186612543038272,0.3926495388543549,4.860595257685556,0.308590856447397,0.6702991250850993,1.2437170622342084,0.5475737774688032,0.3629024652463001,0.30911659031201183,0.34906878526094204,0.7346412349387321,11.039275728768995,1.2095483805485274,2.240872116076282,0.7227609083375823,0.18386657819457108,3.608561782759064,1.3717227711387348,1.0056333374381599,31.57922992745797,0.6494051223181847,43.44827116864744,1.85047756314861,1.3870918994140988,7.251749261791638,6.647575831072415,1.152105227843179,1.150186901109572,5.746309242232106,0.38504286462594584,1.8607589451815716,3.037465950210842,0.3384349600502313,0.38548777554849906,0.7586095063048562,0.5379115706444844,3.4996852923145894,39.076200175709545,1.21238024493591,2.1653125375959488,0.7398911034813515,1.0477429846777564,0.6693227110077873,1.3483658258199311,0.1875653011226519,0.30755679066310476,1.3459716958433592,0.8180796179602707,0.867232338879782,2.9901620478245103,2.784481335509042,0.4633014187546477,0.08946405795679653,4.38906259092792,0.4751174075899594,2.383412997078371,0.7657760155218641,9.652048016528735,3.154044726002071,0.4325561781802015,0.04842415115413294,12.413307854919893,0.1776475488172888,6.664512637862187,46.93822981025464,0.7755297910118919,1.1965391652555524,2.604514411751051,0.4398553175470249,1.0736204743613016,0.11650496021935197,1.5742781700440445,1.2484049668830464,0.9821397752226004,1.256977326052765,0.6909659795178682,0.38947319961529026,0.07043467502616499,0.992022866344827,0.4059222463205789,2.051630477070813,0.7765098153584905,0.050764525235059664,1.1413320362718606,1.4598145874625184,0.9060770529276975,4.148015111108895,0.24888956504733975,4.888017626958381,0.9025505327895239,1.2228107671304296,0.8892876982217615,0.1713865642332196,23.92135312891557,1.865309503840457,0.4325891443452446,29.906323629832936,1.1101974416107108,0.5636774362847735,0.5172986320683584,34.01250202225017,10.434090803434088,1.636501228969538,0.4739903788100688,15.01713870148882,4.566087602773197,1.0138677110892955,1.234823050663007,2.3583345283171466,0.28554474095986676,1.0722958107506202,4.960713448210813,0.9138824517046986,0.08714518536920024,1.5480358560349092,1.1835903588804848,6.628445337069926,1.4721599342908684,0.7027221882157649,3.01961167908822,0.8079147518409868,0.48496745512136025,1.735867488701538,1.3866429243480543,0.32688703710341693,1.219880805815252,0.9949006975181593,0.6374333832983929,1.5060878148528154,0.31631139491246707,0.2728535655207899,10.187750919338574,0.06551177567395472,1.6693520973299834,0.9858935344179713,0.2997264541828332,0.7917820310792932,0.7914945698487929,3.9309708659369624,2.5851562038202913,0.19168183844385708,0.8654515506013211,0.7164278470982076,1.7031949034021814,0.5942683001198666,2.0004865370508127,1.0745459631765282,0.7037323233559972,3.885417907711323,7.5322647501995315,5.077163113939072,1.4230492829981711,0.3015564362390046,5.3213696919482105,0.44924988844699537,0.350828520875426,0.33466376146150956,1.3091336545194938,0.9503423867524251,0.7650324583263335,1.0358665020979758,2.9007474664181094,0.13072888959113846,1.7698493102021557,0.6935608424463916,2.3743098681226416,1.582590711163158,0.1614454523428693,1.418881031919114,0.2626477819057908,1.4880514140332977,2.4674286335724123,0.266735174984289,1.1184551589269158,0.5699306034714521,0.39477171101327535,1.235320859714789,6.754945954724969,21.113363530488588,0.17928951703147483,0.24750571859873502,2.938947378400834,1.7378382440005637,0.9884012094050505,0.4105829333056103,0.021245735373269282,1.2947707040733394,0.755929284034946,0.19841813238483344,0.07169117826202533,2.352585416688063,4.892762963060371,3.0437359620142246,1.2424710484036716,0.8196782485686609,0.9116618842657133,1.9986200335096378,0.879644043945605,2.2883697165703127,2.8254151525127265,0.08993445322330236,0.7707251982051652,1.6071502233356003,0.5714899567251731,1.923810588557936,13.161290600421472,0.6157309328755309,0.9938340307090523,1.082328661787978,0.7059747725137098,0.06573552512311512,0.18223164367410574,1.8672288518078533,0.0844206496091432,5.892819707143646,0.05444207938186745,0.8252845142262679,182.57762037604715,1.1486511311841323,1.0345524680786475,11.700469015823208,0.6226540735870592,2.0554441603933915,0.39186573344413067,3.19922210366878,0.33095808900911217,0.6628005479608693,2.810386659090734,0.44872958522132644,251.8973976048407,0.2560352229170752,0.5814729950890708,0.7478757712820066,5.1446960010136245,0.7119366694751234,1.1689251870361217,3.640386132498295,1.1331278776935805,0.030530110638906073,0.8599462386423762,2.715218192575991,0.6782600448592602,2.2759668395378303,1.098412644191745,2.140694304222384,1.401055611327863,0.29124067922674945,19.508452472719636,1.6007661923496443,0.11300370414728043,0.11931563530863369,0.5084950430477545,1.6258687772835099,2.2122808472859834,0.25340253108147887,0.4187705123268385,1.3493550294989223,0.7064044362593961,1.186981388018568,0.5970804008864419,0.7061280593226457,4.469937280984243,0.13395126538840327,0.32841890253097294,4.3294254799748435,7.128622378649099,0.7638922423258444,1.9133504181617917,0.24653618892455295,0.8646683592704344,0.14698225074709384,0.14131562705551987,17.64589190483465,0.47965392830766695,4.7434656121411605,1.2161365729088969,1.6864648843175274,0.5628508261727677,2.069631679574949,0.7174163053004495,2.8927821206403923,0.031301874659980786,1.5503248485498462,2.1106977173270325,1.2166946298480874,0.03508759887151684,0.28012304779031627,11.146119740161586,1.9986997394795256,0.25760731491356215,3.0495687707766357,1.528563663341431,2.4178029853117975,1.7224068745873786,0.28312817325795003,1.599894548160939,4.125304222374063,0.9449782711936933,2.6872437248389645,5.888612207321563,1.4573618307589404,13.39471101633911,1.7652811713963588,7.998231399107503,0.5629185989822165,0.37510622797563653,1.9324557502886293,1.7614676810260952,0.5908662653563832,0.6474121262141842,0.7932524694035521,2.8468302561824426,1.9379509630881306,0.08908128334812578,1.9589882294602754,2.153016989057892,5.093267956928405,1.5793614028684313,1.2219155481755626,0.2952478408322241,1.8123579099690326,2.3081426943482724,3.5588270122991066,5.652506168382656,0.3160171585998327,2.0334111814748113,1.1582770868658168,0.551694901851914,3.8693768046513126,7.779000785184405,4.380839589105557,0.9808580734941605,5.591782898531098,0.6118107252383143,0.22883014463701523,0.5674308627466145,1.9378782988441388,0.6921937954316475,1.715464203741045,1.0803188516417825,1.2741325203209901],"re2":[-8.160550990856557,-8.974197815475183,-8.02174301593104,-4.4612850707887075,9.61801075860896,-2.5462446224920416,-7.77546469821647,-4.192168779582193,-2.3569034081499263,4.2157391094808325,3.270673917956902,3.474741977404479,9.337194645112984,2.2846465120277486,-9.576000017058107,1.5249529993621795,-1.432591949521937,7.186653813314141,-5.266686816802501,-0.28632084267189484,8.094540049388538,8.025891681828437,-2.722065652287129,1.9747496826329165,7.567945230620769,2.792495856301505,8.819889929752001,1.8586225139062016,-4.242613326831359,-8.387026898720432,1.5872322732678157,-8.16685437096212,-8.243547329674378,-7.144564410464893,-3.9787083735594457,-4.239640535170204,9.783879668279138,9.463263895510934,1.6933861660971132,-5.314123924179263,0.794796134506587,-4.419281522461322,1.9910372604171638,9.805130637145215,-9.240027094947967,3.0667468346474376,-0.6569218575765667,-3.0295363203226238,-8.041133866443928,1.3579302483605709,-3.7029332756959015,-0.9714367090123339,-2.618547350161551,2.066747875152913,-5.716076177522198,0.37180987674471133,-3.8569833431994516,-7.181829970782108,8.39189932164128,1.807820077478139,-1.1781918007408443,1.3181995900809547,-9.520854940877365,-2.219131857890244,6.210150432274482,-4.330772775489367,0.6936224171841321,-9.747025522807442,6.034629122649456,-8.643580529313725,-0.9297832153441554,8.934298965944166,-8.614889194708793,-0.11295780001317546,5.130131739462737,5.447303103691915,9.468370305301743,-0.8057373013715097,5.784395335423444,-7.9473758199793405,-1.3031113055004084,-9.11631479678536,-2.4263846731333967,-4.327193626742167,2.137369354905406,9.30631796819301,7.825874113971555,8.671387502340227,-4.638673215920668,-7.455980512893062,-2.776258517500785,-3.8037891084819346,3.354561527575843,2.1425853292175727,5.618155647511458,-5.875974509218724,-1.7134796683063662,6.612293339168254,-7.40426109003918,-3.2770014433495547,4.363739393970663,-0.9926472980213212,-4.3687624967136385,-1.5293927934841722,-4.045786956815361,-5.385419625257057,3.2358441154294475,8.889977397822499,5.084937459937493,-6.9461623938667705,1.1237834004739877,9.231111752088694,-4.472949198039389,5.698791426047018,-9.267334939522577,-2.5929313198388826,2.1664444541119323,5.786982883414835,-6.297017138196677,-5.971231312786729,4.840062348888868,6.1220862676058765,-7.380924490120084,-9.919137872097583,2.4206126462330495,7.067378066256229,5.825448108258218,-5.604264300250001,2.215829117472021,-3.5364114440703043,-1.1500246526708295,-4.3181297188787156,-1.6930025188812365,-7.373474592998345,7.346469876128616,-8.922436395081261,-4.034238153438274,8.878526231551731,-4.08499902595363,-8.903803305830252,6.695077593011629,-8.083686914753569,8.07776754252717,-9.828358895678557,-3.0284678593872805,5.577466954637524,1.5120472255275796,1.979049490956573,9.32828752968555,-1.4854960148346397,0.4984038022067878,4.768060363213181,-8.541013021816239,7.1924263005589175,4.524492338774117,-5.76600656144346,-3.1778918993011995,-6.0545759870304945,-4.58254213110161,-0.8552340088781811,4.629548551731418,4.42498208775967,5.1315903028099825,-4.440883869772625,-8.089501202604879,-0.3877316182222934,9.869257900146529,8.927812840929118,-6.61444692064042,9.269369658536963,9.261424886008502,2.8995969165081306,-9.342693237190504,-8.355289817612611,0.8975113045659455,2.282215943532197,1.2989976576667068,9.788166680301636,-1.6452738286844752,1.8694681542248386,2.5327033269001475,6.750927236708129,1.0110068130017602,-1.5542008242134742,-1.5829127895035473,-4.668682958999877,-1.1591186681093806,-3.6609597372749754,-3.374496947256132,4.762697350937762,6.585550357856459,9.171988130415244,4.84905791594338,-1.7720173127305436,-5.8607403225444665,-5.9407537731134985,1.626795561978442,7.401922110896631,-7.07491523259018,-8.5057979985991,3.836999037614852,-0.43722079501863753,5.936907609776812,-8.127212579007992,-5.142611776399704,-7.188151940400269,6.436131848402098,8.733450819441671,0.8731695324528399,-0.3221667983757328,-9.259995841813799,9.450530237301308,-9.034648188695567,-4.76419384848743,-5.585257952069444,7.465205652189102,8.071485644540996,-5.578344018606993,-8.219426051816166,-6.994652711240668,-0.7066350190921717,2.6086867335530677,9.454877563817458,3.1868410022834066,-6.660066601758259,-0.39345336403828135,8.960617201341641,2.452957451586556,-9.367762227212342,-8.618983831623595,-2.1414122099780375,-7.675107888699246,-6.868920207508513,1.0490082607551443,-9.16150137354788,2.613786902193123,1.7572614485266236,3.837942715813325,2.102913583202442,-4.434395450389477,4.065537875623653,-5.26164743701327,-0.46868377900991476,-8.878261940395797,9.519116566890187,-8.652880567902583,-4.358583824348146,-4.985951639614594,-5.726405797130829,9.026750168826247,-5.000312914950915,6.906384406047522,-4.791647505997789,-5.82544128169042,0.5432236834659925,-7.419351274012529,7.571820573758849,-4.410462094388212,-9.927736414681128,-1.5032550595807237,-2.5249105933934786,-6.53478131486014,2.942540114874701,-8.945447797944412,-8.014745180938473,4.573774111531373,9.480253069675872,5.079044189786014,-3.9593318761613405,-3.1754143814571396,-4.868206755065172,3.5988028543815265,6.627548534988517,5.650498474765806,-9.173028270560096,-6.293795980686121,9.780971864326293,3.3782976192502883,-4.861171980306511,-8.733704576570263,3.9523535741162963,4.491696918288152,8.504747178965587,-9.266055463590405,7.733007255059796,8.139803865708824,-7.079798937337918,4.917649394399282,-1.0269327184250052,-1.019214580715941,9.448883951884316,-7.7046408276260685,-2.2323538538637404,3.0257186906903772,-0.641690184205876,-0.5878232052127039,9.741101698939204,8.19961705926016,0.7576559006064443,-5.7220757900264925,-6.61543109602345,3.333109198974162,-0.6798301878630468,0.4953294655393403,-4.901645682102711,-0.9808098956252174,8.34639043970811,-8.503981220674898,-6.377663750212516,-4.535395801283992,-2.331486148659496,9.568290511810414,1.0263854399446242,9.872323666029224,2.842926383991241,8.647470324154686,-5.058957807447799,-7.824566400132982,3.710037541032083,9.883074014630736,-8.948059120695596,-8.145084354263776,-8.285895314816871,-0.6535251661174293,-7.817189152060764,7.997942526138647,0.005220453366273858,-0.3004025812926585,7.374912586746888,3.56653351961166,-3.8229050610326487,8.847447696029391,-4.714168128580569,-1.1665487955687368,9.51605988957428,0.6414943991270761,-7.5243567925739026,-4.580479897102842,5.071452349026433,-3.3758322590851435,-6.65133649420363,6.331532759078062,-4.870392999063142,-5.015186493579598,5.732835808529044,2.351183480238671,-1.4027428747327342,-3.2386104809397747,-5.2424897527688685,5.54490979171864,5.459029950862666,-0.5582822834982455,3.7558132048686854,-3.3753764107524376,8.42152662730112,1.061548343830916,-0.8180678571420863,2.4140786602410316,-0.9396898697033613,-4.675005152092311,-6.230824611878432,-3.734584278614525,0.8374825893314686,4.752505337562596,-2.652319369067815,-8.012067236438858,2.4648848814448154,-0.62488915380378,-1.9565170011303383,-2.814411298127366,7.0554659790496785,0.24882529436741763,-8.828047119613132,-6.008075143830187,4.881966110919503,-6.156545254740626,-9.986644064480474,-3.8702596640671754,-6.862345665902017,4.2040729470713,-6.902645575856776,-4.207120280064405,-1.221634204612423,-5.157708657182239,4.74808546173799,7.309626284687699,-1.1732865190874353,9.990278783145378,1.8421997091977733,3.1856036361862685,-6.453656137514326,1.9610276518179521,8.564537735532667,9.501898320607896,4.168335056867003,-2.965721235305903,1.2271890693060925,7.288506222180551,5.909051565951447,9.557404794099114,4.455918283612599,5.15352497353863,-5.4870728759916565,-7.773975491252525,-1.4826555806263997,9.410451977591464,3.6756350060792045,-1.4126084461273862,-8.269954470684986,1.2318776174851678,8.09282641773029,7.423575320000641,3.2683563023187485,8.000201399900526,-7.279591493154833,5.322390780034924,9.399768390872389,4.793315329175309,8.08906834904694,-4.575754006969451,-1.6020752831426943,6.723065853410187,0.461066884580978,-0.1405494380395318,5.255486473707293,2.459214339661324,-1.3552425420618555,-2.267959693994925,-8.76653607138139,3.8319451371398987,-9.613450961451537,-3.1204089568374416,6.827612411157997,8.718514600942342,-4.214077306211099,5.341375004306599,1.875243698782299,4.751971932509591,-7.160352431266772,4.925615449103562,-8.790717174245277,1.8133073293885733,1.4581651601087167,8.235924262287146,-8.379321726046285,-5.104262592412152,-3.8411089977601893,1.319998489156367,-4.405782484812311,-3.471054028874139,-1.5735737595210768,-0.9147578397310134,-5.729826731170111,-7.411486552977888,3.8592519179824727,-1.6649376075166504,-7.665828723474524,-8.441469546297766,3.5024204184379393,9.12446895692893,-6.012163839497521,-6.235807952177426,8.719563162043748,-6.756422596085914,-6.878640076291099,2.6198501768031424,6.053167683391347,3.6385568811136686,2.4619350342388167,-9.047059414963588,3.3376184176082972,4.286331473183825,-2.2285669212432424,-9.652108107373802,-3.3836549943804384,-8.575408496283348,-7.644891207048355,6.6068360044525605,-6.82338671457603,2.12502282473924,4.272829863313012,-2.942955553181008,2.5483861090054187,-6.174203001089255,6.052101238393117,-2.853471239916976,0.8996911392304305,-6.422919361256514,-1.5394838351891345,-0.8149667934817657,-0.5383304129559505,-9.119075750691225,5.746023567076705,5.357828067866109,1.1361118696028623,-8.156448879814365,-8.305627599324826,8.786850548981594,9.861930423024052,0.9356333727933048],"im2":[-6.913650936302664e299,-3.4265864722819366e299,-1.801504677389099e299,-9.108820891586332e299,-2.427021446134603e298,-5.318289455294695e299,-2.6883241426801896e299,-6.038263360146083e299,-7.677151035655603e299,-3.062411786250128e299,-1.2174990562587518e299,-1.6679225177072987e298,-4.616807427049657e299,-4.7449544009283255e299,-3.842317210806314e299,-5.65843770576183e299,-1.5127635073019442e299,-8.18906562388978e298,-1.1466686623578527e298,-8.04483923949351e299,-9.553702239970128e299,-5.971458416220215e299,-1.940010446022188e299,-2.8610304897253247e299,-2.4312195893434752e299,-1.025239252190059e299,-7.07574905664069e299,-6.594198674834795e299,-7.911665874778353e299,-6.451955087763858e299,-5.081027742916108e299,-3.3612444729954105e299,-5.594028648204529e299,-3.710311795287184e299,-5.144808008684587e299,-5.77890748437383e298,-2.393298553782868e299,-8.241025046559017e299,-7.620647219583724e299,-2.7246654278319594e299,-5.3102009836738944e299,-7.189449367228364e299,-2.794425983170368e298,-4.295178490637591e299,-6.483297822186708e299,-6.328998528745389e298,-8.359233875813114e299,-9.54585760572114e299,-8.406994867954122e298,-9.33156264481852e299,-7.66861144858173e299,-4.877677132583813e298,-5.3290823847072936e299,-4.343448364569882e299,-3.0483978730192275e299,-2.1202363015295902e299,-6.0470283187683156e299,-2.250622580242463e299,-9.281266849863413e297,-7.556663170764888e298,-4.433047072912289e298,-8.888831663888675e299,-8.714689463838844e299,-8.118991951490588e299,-6.866973044176362e299,-2.906736292628677e299,-8.36996628995771e298,-9.993272450860323e299,-4.573967365894693e298,-8.981392565680725e298,-6.5937432115793374e299,-5.6987229653114005e299,-1.5952696259617062e299,-3.5180973414705934e299,-5.251057003680999e299,-3.695022070306685e299,-3.2562107355613802e299,-4.679758168448181e299,-9.809166749299925e298,-7.009500535705533e299,-1.9166200458910987e299,-5.362565645049431e299,-8.306231927611283e299,-6.323454125883075e299,-5.408005386394266e298,-1.5054635258674565e299,-6.797403740725258e299,-5.944996797596295e299,-2.885800619178638e299,-5.128896770331358e299,-9.029653054894268e299,-5.852030033086042e299,-2.0898626982004132e299,-5.014287538266558e299,-2.0389864839830853e298,-2.84244274140141e299,-6.0382018815970655e299,-8.671805153812562e298,-8.891652715410036e299,-4.069040184198739e299,-1.9857116385237517e299,-2.8846425420117128e299,-1.9883889645112696e299,-4.76246770826978e298,-7.925014782429637e299,-6.2163603442840946e299,-5.0339937915137894e299,-2.6775771887184253e299,-2.4172015801759395e299,-4.81551069031984e299,-5.9548315177526596e299,-8.232840216781112e299,-1.5353803253102094e298,-6.52178893610525e299,-1.1270922088140623e299,-8.79474651442995e299,-5.655184157382004e299,-7.887324490199379e299,-9.278213103625965e299,-8.103790855498874e299,-8.327339678575703e299,-5.584673929702836e299,-1.8555698949653465e299,-4.467797825721908e299,-3.965831016469874e299,-3.2832665651934326e299,-4.799917348014727e298,-4.7204061802264276e299,-2.866034446563104e299,-4.357270295840014e299,-3.784123823598595e299,-2.028296283499961e299,-5.360685647663829e299,-5.1309002509721e299,-9.817415137575224e299,-4.265266245401405e299,-9.308889234581581e299,-8.434007792541748e299,-3.1061084717681423e299,-4.5619017997554184e299,-5.238521126174415e299,-7.636691875251203e299,-8.534534217071493e299,-2.369887432681529e299,-6.316550437532807e299,-8.142038460152629e299,-9.516577718006376e299,-1.0866297034897465e299,-9.093457364762964e299,-3.830486776851016e299,-4.789495795884109e299,-3.6731440990270084e299,-9.710107140607819e299,-1.9260491475411813e299,-5.779265353827685e299,-6.176141072667285e298,-4.3813670540704835e299,-4.543198610700236e299,-3.416377882600944e299,-2.002085494273036e299,-9.29818346839708e299,-1.816222330659685e299,-7.597486675680112e299,-8.940643356570447e299,-6.046342625190075e299,-6.5488197800543084e299,-8.941020136603499e299,-7.960178786187365e299,-2.1905370038650054e299,-7.230014914113729e299,-5.28270925850265e298,-4.610140415711048e299,-3.542642347025219e299,-7.61240934563772e299,-7.172677184741207e299,-2.4237436973351946e299,-3.610488804475208e299,-5.6232996253357365e299,-2.6634239737941324e298,-3.0815411011001895e299,-6.028120258742776e297,-2.7146250688081977e299,-7.12734204839668e299,-3.334757881217043e298,-1.2254958118670657e299,-7.332110663422634e299,-4.627463478299872e299,-1.129010406833373e299,-7.39652811352908e299,-3.26639230879211e299,-2.926920369054338e299,-8.212328474243463e299,-8.539472803053037e299,-7.664438153896398e299,-8.933517391972778e299,-1.847071325445846e299,-1.609081587774186e298,-2.917361276683297e299,-4.067149537279835e299,-5.849873096522027e299,-8.129874022270853e299,-7.201288096867787e299,-7.245608627285741e299,-5.1627726593965554e299,-9.603102287329392e299,-7.032246977981738e299,-8.885682097159279e299,-4.0538161045896495e299,-2.303355278028908e299,-2.2799819230297624e299,-7.559067795795584e299,-8.327677895645115e299,-1.0268621295838877e299,-7.357051085135161e299,-3.658261657450743e299,-6.47246462740771e299,-6.328297334184063e298,-2.5942830749684442e299,-6.102354040286863e299,-4.9513106343002225e299,-1.4128337975083838e298,-4.531236208617512e299,-1.3408555886891694e299,-1.6555419590824405e298,-8.693421687643732e299,-5.4522406800711205e299,-6.177045734708897e298,-1.5977170565407285e299,-5.779478154852518e299,-8.851705032637284e299,-5.527743266296335e299,-3.542338447866802e299,-8.246456372720853e299,-7.057892581205674e299,-9.258588091274514e299,-9.907646351963833e299,-9.486325579106406e299,-2.3044163450016633e299,-6.85620102789706e299,-1.0028052176059689e299,-7.671976222295605e299,-8.548692710370433e299,-6.78687597179108e299,-5.335500764839615e299,-3.8515132945627885e299,-2.0783546816993737e299,-9.460346577696387e299,-1.4201011989436841e299,-5.718624000182899e299,-4.698307417548018e299,-9.578922572257936e299,-9.034463376468171e299,-1.6699779993839981e298,-1.2554939219491758e299,-7.362347015258106e299,-2.424337843928959e298,-8.348300270461763e299,-5.193867307854049e299,-9.946437999670643e299,-2.6329918553547494e298,-7.266642217647602e298,-5.208898247130996e299,-7.696117794049122e299,-5.890371789738458e298,-1.4349655470912438e299,-6.466011757804401e299,-1.0135311638746981e299,-5.553540078955089e298,-8.706330355076703e299,-2.7545882817495337e299,-1.879556332621819e299,-2.870739141191573e299,-5.908312800298899e299,-3.5874508447043e299,-6.373671425661697e299,-1.0098723938069577e299,-5.804328022610752e299,-8.622324450159434e299,-2.3414163303110317e299,-9.725103620726744e299,-1.7941892878970424e299,-3.6812218199601776e299,-3.984013378878287e299,-2.5787168973037713e299,-7.413793422452914e299,-4.904020793920011e299,-2.0135426034795534e299,-5.6434154642826544e299,-8.945271746955346e299,-5.1010083048741705e299,-9.138334738589983e298,-5.353462006975253e299,-1.7704017679355444e299,-9.184496222936074e299,-2.081875698600535e299,-1.4479830653981874e299,-7.673196859084474e299,-1.6681268231191894e299,-2.664613913667712e299,-7.021004347322328e299,-9.870423977867382e299,-9.278805806454283e299,-4.36945868256898e299,-5.452038323035339e299,-3.4412534433048795e299,-7.249175414721142e299,-8.307631101104346e299,-1.712518095404614e299,-4.2579756186544085e298,-8.071226060210779e298,-5.491441982488171e299,-6.992999695100372e299,-1.179713282868673e299,-8.255220956082206e299,-3.983214664713328e299,-9.929263324705022e299,-7.01243783227354e299,-3.863102657484802e299,-4.2343197916512644e299,-9.497601096626753e299,-2.203093794435693e299,-1.331048976090924e299,-1.8388470567197134e299,-9.704794666459186e299,-1.1876260962817264e299,-4.932708161245438e299,-8.605960501910614e299,-6.367256794662809e299,-9.940796096035368e299,-6.251462413189998e299,-3.345535790010349e299,-8.770220004742962e299,-7.008589670384583e299,-4.281498272977105e299,-3.827898445038349e299,-2.8476867697500854e299,-7.4757051995659635e298,-1.782969754681485e298,-5.34418215782941e299,-2.6265701102509567e299,-3.0944274723660095e299,-2.4111728835682347e299,-8.599493410883825e299,-5.0507582699761736e299,-9.258446354254242e299,-3.0228872064582238e299,-6.872460165038051e299,-7.451728297873741e299,-3.43137845577263e299,-3.2767248685819607e299,-1.1888606734588692e299,-9.535393691979788e298,-2.8194733035572065e299,-6.439107700118465e299,-3.6090483528122084e299,-4.61614715266876e299,-9.620504478643136e299,-2.3224084711522154e299,-1.7549978892458308e299,-9.932806112441433e299,-6.709741526889255e299,-3.541844185108384e299,-5.013765976708716e299,-4.459053843001335e299,-7.244664562697767e298,-3.182909493327364e299,-9.90030275382706e299,-7.86032594244209e299,-7.518802212464631e299,-5.5576939511495855e299,-9.096897963783423e299,-2.932759497763673e299,-9.802052707407243e299,-1.5310040094221257e299,-3.838351894709347e299,-5.286158550019713e299,-5.389492307625532e297,-7.222103565633346e299,-8.962163225811271e299,-7.031853565565605e298,-8.478252914608724e299,-4.74821040428671e299,-8.867956483989032e299,-1.797815061124033e299,-8.993801343148227e299,-6.765417674354782e299,-2.4828374385388487e299,-8.548179936681236e299,-1.2258177806213633e297,-3.4011106581479955e299,-9.228064067538995e299,-7.606417930409838e299,-7.593730116478004e298,-1.265367132570977e299,-4.118046290008551e299,-2.7073597385724926e299,-5.021738099349377e299,-9.182030941632228e299,-8.934524467908902e299,-2.073722703445423e299,-1.7573565402666192e299,-2.754290667846474e299,-6.107167790516407e299,-2.3078544565622518e299,-5.2840285005117584e299,-3.750207117224605e299,-1.4476340111493015e298,-4.3709807826061055e299,-6.722620010681065e299,-6.865919899558657e299,-5.183937302078391e299,-2.2467193869058702e299,-4.3207895062664105e299,-8.338470826404588e299,-8.215655408304469e299,-4.983669382547457e299,-9.688557354014104e299,-5.485593987244446e299,-7.702020374503183e299,-9.26686679416971e299,-1.3941130142759729e299,-5.80651734762373e298,-9.886037854736373e299,-3.5400245529828235e298,-9.402693172376498e298,-3.579574642580763e299,-3.7621045430186454e299,-8.933046128570561e299,-9.777050594091941e299,-2.035645952828157e299,-6.4070318348188375e299,-4.852632892827658e298,-7.06066715465501e299,-1.9987112997161215e299,-7.888500840730054e299,-5.397469734017301e299,-3.096869486129932e299,-3.713387704447082e299,-4.611954010727817e299,-1.211991430885826e299,-6.5152417409005394e299,-2.2066113135429512e299,-1.5326741164461289e299,-5.272667694942854e299,-8.38567481486702e299,-7.636371592817841e299,-8.223298043929817e298,-3.348624403502363e299,-9.388520178521764e299,-2.0199742045484205e299,-4.2005744140236214e299,-1.7517653265320398e299,-1.3330037404099483e299,-3.6488311508585994e299,-8.370821449833055e298,-1.9913208485418998e299,-5.135369846323304e299,-2.4328260570448836e299,-8.667536377295227e298,-6.819304095453928e299,-6.919094584534647e298,-1.8537479776637845e299,-2.8691669516872746e298,-8.37425434879645e299,-6.046622653520945e299,-4.918025435492943e299,-3.5148270506527105e299,-8.610811419040569e299,-8.832685395944703e299,-2.97625703167297e299,-2.505391419288219e299,-3.1544819061811703e299,-9.563286322179361e299,-2.8729135738518698e299,-3.379896459802211e299,-1.9139556370687005e299,-5.709394726301556e299,-1.0670039391790066e299,-4.3767583160788515e299,-2.6476799761325876e299,-1.5224398712995014e299,-5.017819654109657e298,-1.0843192419901549e299,-7.006265104646553e299,-2.79440043955285e299,-3.946321331715458e299,-8.469943623139372e299,-1.9085936868154754e299,-8.633204032116104e298,-1.5420030565998322e299,-1.650723794634126e299,-1.6085150425527084e299,-2.383643554571344e299,-7.422000457796753e299,-8.542380120773811e299,-3.6924932689350245e299,-7.43192732301519e299,-3.092149565735044e299,-2.8117330728933978e299,-7.448924953985237e299]} diff --git a/float64/base/div/test/fixtures/julia/large_negative_real_components.json b/float64/base/div/test/fixtures/julia/large_negative_real_components.json deleted file mode 100644 index 967ac044..00000000 --- a/float64/base/div/test/fixtures/julia/large_negative_real_components.json +++ /dev/null @@ -1 +0,0 @@ -{"re1":[-8.82087980743345e299,-5.3920100100815566e299,-3.419171317790176e299,-2.6235061607545485e299,-9.341262587904767e299,-6.911543744593254e299,-7.309443664318098e299,-7.2041576923639445e298,-6.395345147090729e299,-9.006555369823011e298,-6.697516379210986e299,-7.944462268292213e299,-3.786836477772472e299,-7.01310690804359e299,-6.3428433811496625e299,-3.202184005210077e299,-8.992931139222863e299,-2.026451028116505e298,-2.7813422347247474e299,-1.2243556539927336e299,-6.762215137253597e299,-1.5067181961479605e299,-8.162599580965352e299,-9.47152007728325e299,-5.149197647920412e299,-7.590230829145054e299,-2.456005603941525e299,-2.761724089577592e299,-8.239661601006477e299,-9.923881805111226e299,-2.41861960813902e299,-5.8728701635146055e299,-3.95242552524949e299,-1.435701558094853e299,-4.708926108366953e299,-2.3094367989135246e299,-6.085002470135038e298,-5.24855146777844e299,-4.7002059306928124e299,-9.035934488954757e299,-4.870413567330545e299,-8.850479448985015e299,-1.0608284135014679e299,-8.554144207919327e299,-2.8456133633602556e298,-8.152686314097132e299,-5.356283649797329e299,-8.84932219099862e299,-3.95942144666781e299,-9.432557374380658e299,-1.2126318537452364e299,-6.5180307872058966e299,-2.8213008756255554e299,-1.0836123971873103e299,-4.5017009306931555e299,-9.20758812547548e299,-4.959716077914089e298,-2.392718700462171e298,-7.524623453070481e299,-2.6649236932602063e299,-5.457524747476322e299,-4.4568264279147474e299,-4.637849728796301e299,-7.948379492162403e299,-5.236353665013419e299,-5.6244604018526104e299,-5.409027972631436e299,-4.965358995063163e298,-7.513695392497276e299,-4.759664661347143e299,-1.2986626180998696e299,-9.917296289336739e299,-6.379974427858037e298,-7.635055158256837e299,-2.41722401972867e298,-7.328017599314086e299,-7.675506502828734e299,-2.3841555811923276e299,-2.6767398690551837e299,-9.75252262535883e298,-4.4116312898850445e299,-8.1168076633831e299,-7.960349089417646e299,-6.928773770107044e298,-4.527318053858999e299,-8.722878345257283e299,-2.72862376210412e299,-2.1227444202247382e299,-3.1768921760794967e299,-2.7346606617573255e299,-4.1273737005040505e299,-3.3893938841545235e298,-5.828589508645659e299,-5.9496049344340375e299,-3.303663773525225e299,-3.9879570214080485e299,-2.19973241823749e299,-4.901200819813799e299,-6.357318343175288e299,-6.610236764482557e299,-3.1033958326446687e299,-5.6015260838945346e299,-9.015111485153548e298,-3.418141144818189e299,-9.433492544297942e299,-5.841105261414244e299,-1.951777071064198e296,-3.2266425862238448e299,-7.88591752966942e299,-8.953410683813843e299,-9.21802582950583e299,-9.802135908870442e299,-5.452428689435871e299,-4.4332908721748824e299,-4.746105778394598e299,-8.492240190731583e299,-9.25508408141593e299,-6.1088026867413376e299,-3.1378791479172465e299,-6.982216729363337e299,-7.276044608595587e299,-8.547551691916956e299,-4.7399372050792134e299,-6.04707328506556e299,-2.986844515084184e299,-9.29810829059068e299,-4.432742763948228e298,-8.452399938641602e299,-7.023564432299843e299,-9.085994280809605e299,-9.181031640719454e299,-4.287913945927923e299,-2.858514026371848e299,-3.44183524925548e299,-1.6983936510913456e298,-4.005985728844919e297,-2.689222767659727e298,-1.980860349695054e299,-9.885123240657483e299,-9.749645446071582e299,-8.164320883846342e299,-7.8520519148883e299,-7.41447518792027e299,-2.8452140618579184e299,-5.490440176100922e299,-5.88562374056355e298,-1.5193148964715387e299,-9.280288778288563e299,-9.569003025842236e299,-2.82553840288729e299,-7.060156699798698e299,-9.303951781171117e298,-9.447121771749276e299,-1.2669129315857398e298,-7.060321779302409e299,-4.767235974467285e299,-1.0189504226405522e297,-9.77068440614415e299,-7.852947607714461e299,-6.0940330122070254e299,-6.0551337853382354e299,-8.829209449509878e298,-5.2272901024640974e299,-9.451957652683323e299,-4.148328542751571e299,-3.883271547550483e299,-7.582195249044595e299,-8.775526087845706e299,-7.273437491992399e299,-8.056316873725283e299,-6.855267818570282e299,-4.508626539394397e299,-9.531132215798842e299,-6.764479994044794e299,-8.04461669991079e299,-5.872828347733721e299,-7.778394312722815e299,-6.974938281797288e299,-6.4768139707221754e299,-9.998029725892249e299,-3.9204215182936375e299,-3.049442293500482e298,-1.0025066307128229e299,-2.7061393365303945e299,-4.116403756991523e299,-2.7451493856263354e299,-9.473095829030565e299,-9.441603884961464e299,-7.06638465375613e299,-9.160358302151693e299,-2.592454242086121e299,-9.298501695393276e299,-1.2108775882415169e299,-4.596852864961001e299,-4.151931238803249e299,-4.796388221863704e299,-5.149560485479932e298,-3.356306976897413e299,-5.773859036985463e298,-3.776513831037476e298,-2.126211345408863e299,-3.377000082008576e299,-4.02715395516268e299,-3.463922378158042e299,-3.4387412925138155e299,-1.7001554653846963e299,-8.654445360608821e299,-3.510896718677074e299,-2.1492202002237226e298,-3.752252930712258e299,-3.561772180986136e299,-9.967540343338162e299,-3.9114262041930275e299,-4.455914894490512e299,-7.007586786942928e299,-9.620744210882956e299,-3.1388261631026782e299,-9.956737027956351e299,-7.85862926529907e299,-7.164262886746217e299,-2.087251322575251e299,-6.645426412800935e299,-1.1771487596781739e299,-8.796416893066489e299,-8.26313196317984e299,-8.627512815597235e299,-7.740887831649934e299,-4.2227632107396796e299,-1.1020684789465007e299,-7.948212263131585e299,-4.2061881035052074e299,-4.350050184649098e299,-8.701994890308274e298,-5.38412343871916e299,-8.105778846326941e299,-2.114886582288611e299,-7.590736847385199e299,-3.6467634396728326e299,-7.50888377166325e299,-9.869260036408931e299,-6.1056325976534355e299,-3.3751547239795044e299,-8.37885539699371e299,-1.750822235915626e299,-2.530069319455062e299,-2.538626775378494e298,-4.987915006123625e299,-5.925668827644444e299,-3.77885238913813e299,-1.4064115115173049e299,-1.6736058049497739e298,-5.128492141050381e299,-5.1603718904068335e299,-5.563195289974614e299,-8.972083344744471e299,-9.487432989544904e299,-2.6036495346620005e298,-1.4285216047964234e299,-6.4935929689134954e299,-3.9262626035536056e299,-6.968530616014746e299,-6.683869783454877e298,-7.234961370705922e299,-1.3077620325599549e299,-9.784898344747094e299,-3.562366491043231e299,-9.806629408601917e299,-2.8040103851832845e299,-2.1485615791756807e299,-8.677107803330452e299,-7.194952105132153e299,-4.810142850681705e299,-4.266643722651868e299,-8.199233188570285e299,-1.1391527765313491e299,-8.849476633027388e298,-4.828551931277996e299,-6.728398811783701e299,-1.6582409657523078e299,-5.288710141248248e299,-1.4728345950542844e298,-5.778587939432771e299,-7.175662679706312e299,-7.551601442729615e299,-2.5828074725906613e299,-7.733730556310019e299,-9.535638697664608e299,-6.060558988244494e299,-8.948674645915984e299,-1.944201449538007e299,-4.810008165836534e299,-8.021158060022074e299,-4.751981933189302e299,-4.590735134536384e298,-8.737592166888309e299,-6.772890471008118e299,-1.982525940895149e299,-4.690866976016502e299,-9.230171831262483e299,-6.0723778747535185e299,-3.605664587211084e299,-6.091579608136533e299,-6.8842440938013285e298,-9.52158126326011e299,-2.3018974344111688e299,-7.170431836981044e299,-9.703305587277036e299,-9.243646180365005e299,-3.0810317948962274e298,-1.1096276299794961e299,-2.441478751649292e299,-1.3062418296854816e299,-3.0817572692108134e299,-8.760682193068174e299,-9.214906122983813e297,-8.412381880919659e299,-7.137232755977267e299,-1.7080189336767928e299,-3.247771635733863e299,-3.99150770858727e299,-4.753895076316316e299,-6.389146530959112e298,-1.2597524685464169e299,-1.4367910990750878e299,-3.4004452337929095e299,-2.3104325993994502e299,-1.0566932029728527e299,-8.520006496653516e299,-5.875161063971753e299,-7.408024419379839e299,-5.2613890440503176e299,-8.311333419858962e299,-9.749112333179731e299,-1.2702681716942e299,-8.946019564887226e299,-1.067808064665239e299,-3.91750599348537e299,-9.08192647498629e298,-1.4649067164414353e299,-5.4072964068972485e299,-5.409319917417578e299,-4.97520042567176e299,-5.7223136890098404e299,-2.5432287274053656e299,-1.8940595539790773e298,-4.967178682384921e299,-7.106364650026182e299,-7.080530736142501e299,-4.789562118547907e299,-1.299162019964567e299,-7.432777642027011e298,-6.6517426893561554e299,-1.1771083075631505e299,-8.720773321639527e299,-5.7705258212516045e298,-3.3296002028145867e297,-4.7470787974048905e299,-1.8805658199076758e299,-7.906451263813595e299,-8.004297545388377e299,-2.2117736625847562e299,-4.610002271682792e299,-4.460722914536051e299,-6.63115852496307e299,-3.3369852532174394e298,-1.2132499650198748e299,-9.739499113172008e299,-1.2130534017425077e299,-4.9323988620225534e299,-9.24729835922259e299,-4.4713700511640585e299,-1.7088043626254124e299,-3.545517414548057e299,-5.8083805456286446e299,-1.2974085967692085e299,-5.1761151352726576e299,-2.6897029239096084e299,-9.409121322162284e299,-2.337331805833053e299,-6.627786409818803e299,-4.231887692477208e299,-5.1012898086211234e299,-9.664283459993462e299,-5.036662394211148e299,-2.1315224442692573e299,-2.492517758824864e299,-2.5838511419141743e299,-6.392295515738933e298,-8.795685131559032e299,-1.3985027790932537e299,-2.3381682280465967e299,-4.229994753293636e299,-3.024865376420947e299,-4.600958678177776e299,-5.017204591986146e299,-9.385695844571817e299,-7.090533563859298e299,-3.2065463055613733e299,-2.6158725435096144e299,-4.232670602726047e299,-6.061868126796204e299,-7.091635112743918e299,-6.93327053440886e299,-4.907761507142402e299,-5.238078600606054e299,-5.362117391540138e299,-3.948417291408114e299,-9.52143399798142e299,-6.90314133525029e299,-6.722369587590384e299,-1.0195291671921525e299,-2.4755184840764923e299,-8.871805514606246e299,-8.537053983050507e299,-6.998763020283684e299,-7.043549209427314e299,-6.752582944754411e299,-4.467887612107908e299,-8.959315730322861e299,-9.848786151384652e299,-2.3165348087643733e299,-9.130523136038966e299,-8.072738187011257e299,-3.492205476186076e299,-7.968477917864763e299,-9.248004760642412e299,-5.486740428175217e299,-7.579717406236126e299,-7.038629756623825e299,-5.370761155920009e299,-6.878046962259752e299,-2.6871771764494802e299,-1.7394854107045975e299,-4.367169112646964e299,-2.1030760039187225e299,-2.3501306164448833e299,-2.381794798597453e299,-9.649349912450341e299,-1.1785280111644315e299,-1.8433986013767223e297,-8.582742295572588e299,-4.210155099882586e299,-2.295613138257141e299,-7.809134236414593e299,-4.583704155500709e299,-5.0905182830671164e299,-4.621881300674391e298,-8.841443031362734e299,-6.144859337857611e299,-7.772561683862705e299,-2.8081555356938392e299,-3.8290877476121032e298,-2.4362033779105244e299,-6.978516448096293e299,-4.721289901720589e299,-3.1583365581213932e299,-6.228644413351104e298,-1.9195000210123936e299,-9.074177463631439e299,-6.160490972102966e299,-2.339426428374418e299,-6.736543101651185e299,-3.398743754075834e299,-6.482533470682506e297,-7.124836556967411e299,-5.312989904012943e299,-2.2053340888343644e299,-6.4817138347003905e299,-9.857228080431858e299,-8.11523468984321e299,-8.448725256668801e299,-6.205349415630317e299,-8.022484809614141e299,-5.4443147680845605e299,-4.157569002895098e299,-2.6394486184347213e299,-2.117690357501747e299,-3.803188521021834e299,-4.396975463788778e299,-1.5375793021757667e299,-6.347696879348944e299,-5.818105950357591e299,-1.0639460059328366e298,-6.807322789041533e299,-4.053696391759536e299,-7.299129485969705e299,-1.2297668683989106e299,-2.048185848382518e299,-3.530373001447334e299,-4.2675206483619026e299,-8.022837590939458e298,-2.943821401092449e299,-1.032018036406639e299,-7.719825227311596e299,-9.365776030774684e299,-8.423610691668864e299,-9.866565882279411e297,-5.731795348625505e299,-8.660176559322273e299,-6.4473867706889146e299],"im1":[-4.206855349989402,3.0524910425063077,8.65133742591977,-1.0719496292834645,-5.632471746699612,-5.69224314035663,1.2660607884974802,-7.629490164307196,-8.95769832520193,4.120930386259769,-2.820837716265996,-1.0395426985398828,-9.50502059470381,-7.198770830667094,3.557283991938469,9.132868370995467,4.49096074014218,-2.2405020269038562,3.7718571016596805,3.1419578922723517,0.706939266405243,-4.240127428784525,-2.7446669011856955,-7.457073472577522,-6.295576541830448,-1.0250245698158693,-3.2911166587000507,0.22649481316463138,-4.257336499158216,4.2210318928623956,-7.46171260946425,-4.721158605272593,0.23490476983175412,4.512028836422399,-3.362163694547908,3.4284992269646946,4.237155759999137,8.166192249262576,-9.818630994462733,1.7220755066977418,-0.09018845312002632,-1.5525109169292168,2.7760229787979878,2.326792368200053,-3.491433487182043,9.66117321330971,-3.222816156203148,-4.544212876253715,2.348761448753095,-6.788914405271244,-2.9490219405726936,-9.235295887178586,8.855965331334122,0.1666193926482329,-5.431503036958738,6.968541776759174,3.818837067910417,-3.8761595695745594,-2.7554548458084005,5.744043668839037,-5.947999158538712,-2.0170200850307207,-1.4625422795272218,2.552459642877025,-6.379050015842265,7.926791912347685,-0.7319232619634981,8.397759933610264,-0.5306037207701166,3.9920047290259113,-0.16277224014292457,-8.988633147102746,0.12206124825966214,-8.40137887387101,1.996648607510629,6.2952173423395905,9.597987655048836,6.02797449079128,-8.008569319454748,8.749420466399087,0.9544834890599834,9.708370848529647,-5.262470453429334,1.5786480574409332,9.452256085632563,3.8091360591432117,9.945972580336242,-0.5201375341789785,-4.838586096342958,-4.052589891257769,-3.3567638268412985,-8.788193262245255,0.6519186053979382,-1.3549871369671678,3.137986720020759,3.2080303640854684,-2.2605422989273327,1.6268204072862975,8.693742077120511,-9.010539551997097,-7.3918673939637625,8.00048978367549,-3.9571221790669586,4.868049740853884,7.304979823090505,-3.1743630069442696,3.400277778821934,-1.7691669749530767,5.267930343297589,-9.184281022008491,-4.96659874274525,-7.310281753766064,-7.596213227318273,-2.8007068884816055,1.7131230898208667,8.732913763422395,-5.390407401012009,-0.05581406947681877,0.49066588304272507,3.891704614639856,-5.740688650665071,-8.737910607129072,-0.3702714041163766,-2.775811154748533,1.6108068705960186,4.385330464611936,-2.9477594415262676,2.145295441670978,1.3021529120605209,-4.94224811570837,-5.7088316096774,-8.330293836491865,9.71635846475182,-0.9121063504036506,8.119456920922264,8.005798983066132,-0.7110539490624532,-0.7737822964713317,-4.221464286833408,1.428716211857619,2.2541715068816615,1.9901349046841705,-6.7431330013954955,-8.824222522178314,6.282605309234754,2.985566155461921,-9.129212206956002,9.287140133533903,-3.5883673993970566,5.5459673440391875,-2.4701046026745015,-4.463809770368794,-1.865141590264173,-0.999317914912563,-6.894289893878729,-1.9921001032161243,8.874265379519919,-4.8289841374253895,-0.2627749845853735,-7.236021809692614,3.3108050234087134,8.79453381603805,-9.706042385319469,6.006849199547986,0.5590268547608996,3.3943606156194583,-3.0862041059369734,4.566286892181232,-5.999619032973287,7.020626781086708,3.288696885769099,-9.200456120521746,6.005633326453072,-9.976138625679694,-8.51914055178209,0.8840395958417346,9.84895956214903,3.6031584130602727,6.0950837234266615,-0.7760977083196163,6.89712168955538,9.446723524451397,5.991952043287043,9.043815672749467,4.101667611239961,0.3451534857237384,-0.25616890103403733,0.9707178532173657,2.514742846282136,9.941725090919856,4.115601233250397,-4.272350232707907,-8.036910577338844,8.057650750024717,-4.9220320656939665,-9.760710744581168,3.0077286167728197,5.22104166426228,2.081592957073699,-3.495339440349441,-6.623401719380684,8.625861060735335,-6.417387634978178,-8.365047616627523,-2.430288546444677,-4.196187391874179,-1.957646409751657,-7.001783328013578,-0.39157670327208116,-5.8295602701641425,0.9589927811905739,8.557521401428627,-0.6296081969445844,4.202663245987832,-0.9312118437319263,7.198587989290914,0.21829341470798624,1.8623097723052275,0.08242793885703747,1.1575458558569842,-5.876231851646434,-3.256553050708499,-7.712835775750575,-2.41211837456885,9.757874614179368,-6.121610009966513,8.53126486246704,9.101126333451202,8.34769866890273,-6.000322166126482,-5.693398317527563,-2.1298315760304387,9.024941501407454,-6.627672120370407,4.231485010716865,-0.8429684422572041,2.9454296070902135,-7.41132150026492,0.1325369566553256,8.606522592502856,8.81053867835956,1.50177888503298,0.898361818464446,4.2964661454875515,5.403594074193453,3.1421291360789887,-1.754610377384008,-0.9787471423715175,-0.07635038716113662,-6.358760499639722,8.380899833643447,1.3613787397491173,9.011936513522372,9.438901505957581,4.221725967559852,1.4420240971501013,5.062326368301527,-3.3790447996999156,-4.596350037810097,-4.62505174329523,-5.204434935160098,-3.95931838418573,-8.867648062005578,8.05864513096138,6.722238715941128,6.326704172342016,-9.86122715761044,0.9813794670481464,-5.956144973217869,-0.4235853680585482,-8.93214372953172,5.9026046920795,2.995255417633917,1.570781498956908,-3.182962400182574,-3.0529771644340142,-5.177284384130882,2.8008303466438527,9.032658755624503,-3.9690644821215493,-3.4732480402138695,-9.499014938245086,-5.885730350040421,-9.76918641819738,-0.5973496543898431,3.2447569452333163,-8.259782533719175,3.9981066127176277,9.98108286004188,0.3467094412792431,-5.316117420288407,-4.871069010397009,-3.8287503221634145,6.179376791805833,4.197699941221604,-4.279797570212722,-4.571123762325695,5.936018880938427,2.5213904244899865,-3.639418184066699,-2.8583363399776314,-2.643439198310567,2.2564718955822,2.1870631016191133,3.8223532186977813,-0.5109118174069138,-2.166948703185973,-3.8643518482292905,-6.869467144328912,6.908733707767066,0.5138440924627119,6.208387003887967,-3.5817769089449065,-4.090662297218815,4.291783297644944,8.286171690706333,-6.00820605714945,-0.5714709932758115,-3.811859201732344,-1.1266643688194407,-0.7314103779906294,6.058241766834463,2.5319502247094388,-8.166631681751959,5.5637358308014875,-6.445356939090967,5.690230492502584,8.806956523144116,-9.645555612115835,-9.318455424158483,-6.568823688446388,-3.4210977867946113,8.269309875195113,9.78677021654406,5.465297684921865,7.425656581564915,8.774830125148739,3.1999938585291776,-6.671229219123118,7.7643041027610735,-0.27048702159449434,5.2209917255358995,-3.428308322231393,-6.908059793045251,6.6820551283077805,8.055277810722597,9.268359632113551,-0.33427209097874666,1.5195968944028415,0.12550013068110744,1.7248415391629628,-5.303971179177578,-5.462646811510381,-0.7095626734822318,-3.36002723889613,-6.303408563078017,7.341466223382408,-2.3682495310679563,0.43877661164225046,2.1486471679963497,-5.748959525087079,2.818630414223284,-7.5615024119773455,4.798099975799957,4.645844968824539,-8.389706387213563,-6.905023971311406,4.955764470012863,-4.193103855435536,-7.792259781338709,-8.835642340073155,5.29556467332287,-0.2961549257862046,-0.9421799168894225,-6.302464381817829,-6.2581422562742155,-4.56893051835017,9.418056289275732,6.643623518751941,-0.9386623171992081,8.092062581158636,-8.280811636196383,0.3461949573179428,6.588496990160166,6.033596543387457,3.760407108199413,7.3118359607960635,9.141997362204116,-4.031817578879664,-6.890625751335877,6.63824117676856,8.695775277115906,-0.9100328696007374,-2.1370988712828236,5.33743372129857,7.343242257616755,0.3546819157798442,2.7347585294590537,-0.3853056754268991,-0.02669147648632908,2.5817971416808145,-3.111683702717185,-1.2289525178740863,1.1319371052110405,9.761611610341724,-8.18724705782156,3.785953820828251,-9.569939929004816,-6.446005072058563,5.116270763783273,-8.442531646191398,5.603572334927023,-5.8820549967055165,0.2762706383965696,-1.548784941059413,-0.718983822668104,1.8463503069804315,1.6415871487197684,-3.060155427159259,5.6223194175825935,-5.405105495599654,2.5716102716570397,-5.144032737014699,-9.527685854167467,7.930733739571501,-3.9725873555360813,3.3478571319047905,-6.884033641507202,-4.417129364868037,2.0698001471534155,9.220219838201299,-9.584641637644978,8.442753496665869,9.885671203945005,-7.2741035354068195,-4.970692906454392,4.60412379924456,3.9274726935489657,-7.811178580190199,-7.768945844855328,-4.653507298014583,3.189417835244603,-2.6543211071412465,9.464426795582316,-3.279840546208275,-4.613707704249692,-9.157503439982174,-1.966412710907786,0.5036542811881475,-9.602610644146228,2.3972875003977876,-8.859723083241352,-7.765851639185448,-1.9088923905459652,9.991960573192177,-7.906822317518312,-1.6620003684716256,-5.482340611072887,8.755741805320952,1.1375630055921366,-8.701723828472387,1.0487821566562445,-7.902666543755066,6.750052768645201,-4.807756968484254,9.055952541640817,-5.94505099869175,7.105669013263139,-2.7173192951280667,-8.6507333661866,9.546251625361972,6.913328655491963,1.6473496606464462,7.526299278890026,4.208394269325556,6.137147412146831,3.019267450691798,1.6921583985901112,-3.260993159150267,6.671237594961429,-7.222352732470347,9.51852297239174,-1.922897988581738,-9.401811459968798,2.459021114706605,-5.292185321541103,-7.614101293503297,-3.619532311671363,-3.0824567819593334,-4.420656116036219,-9.09119959850868,-3.5933463224713336,9.320146631372918,3.926858617932009,5.142749967252506,9.4338177433618,-9.645999976534597,-6.77773263790971,7.994146926646003,-3.507190849086596],"qim":[1.1140530754390409e-299,5.548391080890548e-298,-6.056357108907624e-300,-1.2632514958058033e-300,1.9771485678401804e-297,7.674302848858663e-300,-1.6340119666242726e-295,1.2815804267918114e-299,2.3607079189996275e-299,-7.143259720891209e-300,-1.074034580323164e-298,6.00144816254863e-295,5.188978440602873e-298,5.380104440480612e-299,-1.3884873105239995e-298,-1.3002313479496732e-299,4.0434245301747245e-301,4.1650008426735336e-300,1.4941141996460302e-297,-3.654296211214776e-300,2.4648096680585807e-299,-1.22492139345827e-298,-1.0678620352929783e-299,-8.358212553561588e-301,-6.770467357610585e-300,1.0617565194928545e-299,7.97149415647598e-300,-1.2631482330577807e-300,-4.244500996783697e-300,-3.2861423224221737e-299,2.290802562752464e-299,8.389709018760632e-300,4.7640666832219354e-300,-1.1985748393858954e-299,2.7107020903804113e-299,-2.2494280520452055e-300,-5.563329962241972e-300,1.3809065768439438e-297,-5.628495938817463e-299,4.870545776977194e-299,-1.354262819836215e-299,-3.5340514807766654e-299,-3.947391290724011e-300,-1.2620236135972068e-299,7.072088937566254e-300,1.3134362738454852e-300,6.93420786596824e-300,1.0580965547543964e-298,-5.1711751522596025e-298,1.4489662025267242e-298,5.6428365555632986e-300,1.3511580555874178e-299,-8.580854013946942e-300,-2.8617310676574495e-300,1.3962441991508033e-299,1.6599533822407472e-298,-4.08337761190553e-300,6.395188464124837e-300,-7.238621534786528e-299,1.767816317854455e-296,9.752161646316094e-300,4.849287491393657e-300,3.039142943440114e-298,3.447690039300504e-299,1.5909788182464423e-298,-4.723603985363679e-300,-2.1981794825639608e-299,-4.511609295532526e-299,-1.1209193935442322e-299,-1.0951913529884578e-299,-9.50411467365426e-301,1.937457861572261e-300,2.5930061867025143e-300,1.2533732693356268e-299,-7.556381423394928e-300,2.6223526171612503e-299,9.533517896530401e-300,-1.1802078498354646e-299,2.012355010482499e-299,-1.302326613499547e-299,1.0010325063427074e-298,-7.89796750160669e-299,1.4879713059148518e-299,-3.184717524423172e-301,-1.469314948427829e-299,-1.1195871466046646e-299,-4.7451576731475736e-299,-3.829668019966587e-300,2.3479173609310624e-299,4.2284780367579586e-300,2.2763418833124625e-298,1.367543618167749e-299,-4.2782824665238554e-300,2.299185378455179e-298,2.7229633370094326e-298,-3.1859141240752756e-299,1.1235196602262937e-298,-1.0109124228279562e-299,-1.4647087330575868e-299,2.157482334314837e-299,7.108200016904835e-299,-2.6758441868001457e-299,4.830014209683473e-300,-5.003907466111907e-299,-4.480342646164266e-301,8.201860634054115e-300,-2.1611013183624242e-299,1.8705836430972515e-300,8.071195991872906e-299,1.6686834998865474e-298,1.3211042021510799e-299,3.4452644606831174e-299,9.450138734596894e-300,5.765547963911575e-299,1.07423240890665e-300,-2.8243263086785344e-295,5.450082267498773e-299,-3.2109308762182816e-300,6.032151852855196e-300,1.0184061851049883e-299,-6.930244996405519e-299,-1.2594313142497337e-299,-4.737606301728981e-300,-4.18225225576051e-300,-4.098108595451881e-300,-1.2627204610483144e-299,1.5954066768425068e-299,-6.92717530060982e-300,-3.206392286508179e-300,5.1680698126069356e-300,-4.524918966306993e-300,2.1137533498119199e-299,-1.2731598252474e-299,-1.2983544285763806e-298,-2.708520866857447e-299,-1.7606479989442905e-299,4.0287833595429884e-300,7.211722398054065e-300,1.3088505639726845e-299,-2.4592247982935566e-301,3.0106706907679495e-300,7.974444209548583e-300,6.661974672182303e-300,3.773949338981512e-300,-1.9202349085225672e-299,-4.744894743480703e-300,1.059808530753081e-299,-1.3904503829425595e-301,-3.1171712504782374e-300,-1.341715150766025e-299,1.0257124841809912e-299,8.140268997101366e-300,-9.812918472882954e-300,6.122377823667961e-300,1.4327716542709745e-299,-8.386137880400224e-299,-1.7030806108911652e-299,1.2453529309531436e-297,1.0821689650134973e-298,8.351372813496436e-301,-1.3317670155085534e-299,-1.8804844000864814e-299,2.950642974828428e-299,-1.7629671157032293e-299,4.812924917264518e-301,1.0591261535434145e-299,8.956679917655018e-301,-7.905441529891919e-300,5.052403245268476e-299,3.820182250394191e-301,-4.435157058254491e-300,3.1725508089298734e-299,-2.669735940946462e-299,1.8886193925817202e-299,-2.6163707801677592e-298,-3.6503092838925794e-300,-3.393601229997087e-299,7.073534976910701e-300,-1.0153944492287395e-299,-8.2480409033183e-299,-1.143865195367977e-299,-3.381337747379109e-299,-7.048532959523924e-300,-9.395974015313292e-300,-8.576747398454981e-300,1.6272406194300092e-300,9.658160931858954e-300,-7.757331642639955e-298,3.2882759685777804e-300,2.7740926678900773e-298,-5.0402244721013113e-300,-1.0247023557635008e-296,2.943539045227827e-299,4.786110508945917e-299,4.536714269860369e-300,1.7097017301064445e-299,-9.667374606985678e-300,-6.442590882883018e-300,-6.192451886541067e-300,5.088574992497755e-300,1.9531427445583926e-299,-8.860569465597932e-300,8.871832339215696e-300,2.7873209021366855e-299,4.2099826324777974e-300,9.73882678937734e-300,9.940618389521556e-300,-8.260934159386203e-299,4.158102802101711e-301,1.0953378867473696e-299,-1.0070881019539785e-299,-3.630341896206293e-299,3.143627684553467e-300,2.2374495909141687e-299,4.583091154464341e-300,-1.0438176980109345e-298,1.0304844378625275e-300,-1.52760914363318e-299,-1.1557852460093563e-298,4.171071283667197e-300,3.3543735249372427e-299,-5.38164433897632e-300,8.863821655497314e-300,1.622914439105845e-298,-2.677549325135989e-298,-3.4977404313547754e-299,1.522755376329061e-298,-5.4088203805470194e-300,-9.496317256906098e-300,-4.1263119327360574e-300,1.075711056801975e-299,4.608500850113246e-300,-9.234029900141952e-299,7.599723935597601e-299,-1.280126768362187e-299,1.3469593976029656e-300,9.171587788136272e-300,1.8522953131048014e-299,-8.98775010089456e-300,-1.9074734450515576e-299,-4.996596758769464e-299,7.65907758278627e-299,-1.4912433946643439e-300,-6.498495169764395e-300,-1.0404526049261727e-298,-4.79161096562179e-300,5.8631801917851574e-300,-1.782503151036752e-300,-3.027321984757969e-299,-1.3320028116800784e-299,-1.6200182402703412e-299,7.931946736159231e-300,-1.2252899153295196e-299,1.1059045383424376e-298,4.978340358669549e-299,-1.0537261618512923e-299,-6.563286380763205e-300,6.268226762272483e-300,-1.7943118654618804e-299,1.1097301100259937e-299,7.793647634673859e-300,8.052180294800888e-300,2.3361334698271016e-300,-7.948566171056332e-299,-3.6664510781295467e-299,1.8186322125518517e-299,1.5092540059531646e-299,-1.1069286763437432e-299,5.776619136038748e-300,4.98626640317794e-299,1.9995020182027246e-298,-7.462020749555325e-300,-1.5935443130865422e-298,-1.062333828544221e-300,-2.3264411366399422e-299,6.5470165152883e-300,-3.750057183813806e-299,-3.579052329274802e-299,-8.435330147951289e-300,-3.330131245915223e-300,4.091114025657845e-300,2.112001385268053e-300,2.8813008267070032e-297,-4.300677342142604e-299,-4.362221099738568e-300,1.6211300263310004e-297,1.8592098364768177e-298,-2.5249216911630446e-298,-4.1411713358051076e-299,1.506932491666627e-298,-5.291806481757151e-299,4.772723583890137e-299,1.5165105001781079e-298,-8.929587699046952e-300,-2.4308114386654347e-299,5.209844210492284e-299,7.642739453390465e-300,-3.714983487285132e-299,3.510902263658298e-300,-1.6405598781782786e-299,7.064820852810499e-302,-4.29462424461028e-300,2.0756635610405126e-298,1.5120066497367739e-298,-3.7145625584365765e-300,2.2029575794586214e-300,2.583947495193857e-300,-8.810209747552748e-300,8.87490319175582e-300,-1.2745485647188486e-299,-5.806583524405668e-301,-1.0703908771562007e-299,-1.8396713492643173e-300,2.640664331474353e-296,-4.3725776411088684e-300,-2.2122368151277883e-299,1.4516279453592907e-299,1.8112857945553116e-298,6.970640619493116e-298,-4.590665074673718e-300,4.206615501994168e-300,-1.2393247270179743e-299,-3.469332582603103e-300,1.1456429217238607e-299,-2.1999767645436188e-299,3.7601547570178836e-299,-5.040641114098572e-300,3.697703787785942e-299,9.35551823692474e-300,1.5573341738202649e-299,2.3497445355241938e-299,8.00679570098009e-301,-2.6083275809077793e-299,-9.738910866242676e-300,-2.0570526705655127e-301,-1.5588525633790256e-299,-1.9409880884174985e-299,-7.923266894075547e-300,9.07481528778368e-300,-2.2636372493381662e-299,-3.9522937707723737e-299,3.814645730220215e-300,-1.8533966983620185e-300,-2.2171650295238316e-299,-8.509367471186849e-300,-1.859729197009901e-300,-2.488194444157425e-299,-1.9825683332238574e-298,2.7500314828791698e-298,-5.385202669767363e-301,7.290454151045161e-298,6.526900296920513e-300,7.03761828843484e-300,-7.461187366990703e-297,3.7911253563168404e-300,5.576973552167374e-299,-9.36473923620558e-300,2.6096611856678067e-300,2.5317931581614807e-299,6.055025869208936e-298,2.0410343808805833e-299,-6.907781412670777e-300,5.414098713197397e-300,-9.025438026042419e-299,-1.490374690894632e-299,7.858122296942519e-300,2.0319293785454715e-299,-4.0598121958619956e-300,8.755746178042537e-300,1.1134537465851428e-299,8.899551852680064e-300,-6.246282821883032e-300,1.0579945570634987e-299,-3.4925373894012454e-299,9.0126665480755e-300,3.608272543676478e-299,7.476637090842819e-300,-8.398071795910023e-300,-5.754509131180596e-300,-1.6702309412108373e-298,1.3710642166997076e-299,2.30488986838983e-299,1.3189808230059937e-299,-1.038275304190425e-300,-3.3007328689177064e-299,-4.196927171496605e-298,-2.068360823784129e-299,-4.311723046169152e-299,-5.25106600338651e-299,1.1181871546803955e-299,-9.363817408089675e-300,-1.162544703526804e-299,6.9891897579781005e-301,-2.214177659755629e-300,-2.3652585717451234e-299,2.114556125053395e-299,3.750131937050256e-300,-3.965081437497242e-300,6.0561001613312766e-301,4.7899824132409343e-300,-6.352630548849536e-300,4.6665669522389426e-299,8.154087548240288e-300,-5.7821821727706974e-300,-3.3766315558312025e-299,9.763011138996344e-300,-1.2169012730526238e-298,3.217191574811337e-299,3.8213575395746244e-299,1.478965411804186e-296,2.6918449067564876e-299,-3.190873270868709e-300,9.504627959121471e-300,9.215262581996983e-300,-8.606183367147675e-300,1.5368172820886714e-299,-3.430536743980013e-299,-1.0029178619605763e-299,-1.0299003547997701e-299,-7.670362857491129e-299,-4.051578658728311e-299,9.604740201106234e-299,-8.122253880501538e-299,-7.496843868044893e-300,-3.433056743580598e-299,-2.2657581650212676e-299,-1.2651784725959711e-299,1.2886916164143446e-300,-1.1197856907344529e-296,3.572841730874323e-297,-9.51758355906795e-297,2.576146517334956e-299,-1.268485134035188e-299,-2.03194997931637e-298,9.421822111112935e-300,1.2760725810526615e-297,-1.5721471339951674e-300,-2.2312567935897295e-295,1.3131965853862598e-299,2.6519168469282267e-299,1.2062615748333536e-299,-3.675355642750845e-300,2.839574106144401e-300,-2.877810653964991e-299,6.714005816853771e-301,4.433903681600014e-301,1.7294617746226716e-299,4.313288543480713e-300,-2.3644648676350574e-299,4.933682349718704e-299,-5.201753503528585e-299,2.1559711709980337e-299,5.2692728194414716e-300,-3.529410728824708e-300,-5.671427601554303e-300,3.450574763498295e-298,-2.1263567902834425e-299,5.470998832565232e-297,-1.7110939720543498e-299,2.835808469823799e-300,1.1660568630757688e-299,4.258908484355905e-299,1.024998000426323e-298,-1.8620573503075907e-299,1.785172086903348e-299,-8.9447868122124e-300,-1.6038657549446492e-299,-6.86576345380727e-299,9.619011104189734e-298,1.860716543480377e-297,-4.798968947995057e-299,4.7179309597990664e-297,1.536556506870375e-297,2.7285036411837508e-300,2.6025466915853793e-300,-6.055121114594042e-300,2.2814646255198588e-298,3.497238433802379e-300,9.479688372484286e-300,-1.1850140334435435e-298,1.468691364493201e-299,-7.330792795636594e-299,5.467485463015883e-300,2.0846229965053433e-298,-1.0240859451567781e-301,1.1685837390518541e-299,1.2819852832543255e-299,3.496115777450104e-300,5.895180900580784e-301,6.887321905482268e-300,1.200333582722822e-299,7.934514685656135e-301,-1.913848603514129e-299,-1.458094818871895e-298,8.25891954331024e-298,-2.2742538634295822e-299,1.1488869653524984e-299,-3.740512941578371e-300,-2.8594495996548308e-301,2.1740299248074438e-300],"qre":[7.2465544559374235,5.683129352443537,0.4147043706991266,0.3314929846323459,14.841293796547632,0.9264742710432751,167.78625320798733,0.1341727201734474,1.7041025937557641,0.1339423556446392,2.9765496138178333,332.3144280894207,4.238779687003059,2.8381936914052717,3.0933521693596435,0.35210106648150746,1.338426678736622,0.03471576379881464,8.472137273360673,0.13306489074912026,1.503260129872158,3.487339799303587,1.2433482798585898,1.028699230927161,1.1245285692953688,0.8772320277679582,0.3490212916421784,0.5986407280851118,0.9148130476735473,1.9199294023596205,0.48765614723626044,1.1253333662041511,0.4652042728136703,0.4645422831875706,1.388261640746636,0.26959315763058456,0.08999342564596484,11.58772118476838,2.3029334680405347,5.092655855234445,1.1367779800283095,1.9145450713270973,0.2154692095688106,1.0782133340692945,0.05109255083553147,3.450256908554628,0.8638177496534968,10.005849043491889,5.247550229039284,4.961117442256899,0.2186549501117572,0.7801689967080739,0.5774863000214315,0.6197823420876433,0.6694955110024222,5.011267752582368,0.06335676882930266,0.04255938223367756,3.258412514698082,30.747502171374293,3.2676431956969907,0.9993001061494945,4.102334196956665,1.8738025626757866,8.437654636832777,0.8367764609607273,1.1663317261799016,0.23255875894905326,1.2863245364265574,1.1185603980728684,0.20520941274449253,1.237292104089583,0.1397173527790567,1.1299154424469786,0.1150342494081689,2.0865029623922213,1.5012384860386558,0.3114938794919835,0.46716346161823036,0.15039522235486802,3.6098597874980327,2.6024811249130275,1.1715335693436972,0.2336723575687725,0.6891240952171905,0.9022114295281032,3.7174787153676805,0.4128676547721979,0.7216377960319399,0.40066665149816016,3.0368555336933567,0.05225050134709494,0.6522690651311528,3.9678293664038153,18.34163567974958,1.6617270809813798,1.846092328962412,0.6338382099864105,1.6346815555024004,0.9395266344438069,1.602409839453306,1.1744972454817335,0.11383779755078116,1.398299161123861,1.8230252788374701,0.6339969438172252,0.0012400707648555656,0.3282933175258414,3.6959281648136013,4.676475823999109,1.3504158831906021,1.797897756571311,0.5596675225829767,1.5173407885520405,0.753440976138512,172.04137875299108,2.598339864498956,1.094920260629049,1.1562802685363527,1.0962131608269627,2.5566207627004265,1.6363953453093445,0.5095526914655719,0.7743502734164344,0.3173918426081424,0.9365960897925122,0.15789237336698353,1.0653303765312931,0.9599173718005789,2.766479749705957,2.2220460315508674,0.6465546130062932,0.3660941494931954,6.718745394839725,0.05437419837084742,0.00882308429564378,0.08185553398847269,0.3831937374033391,1.2770500165562417,2.756750255548699,0.9595547346042079,0.9960417582662042,1.7574436190108957,0.8994501032396435,0.8747891764614741,0.11315799121853601,0.15745024652322895,0.9848074091864193,1.3111075218974293,0.8161829838085152,1.4333344669720829,0.14291864455490402,1.6638913533331403,0.05938483703024428,0.7351864599652126,2.408055480784638,0.001955172020528814,14.656462313249477,3.092240189971728,0.7368258905104835,0.7887433768371533,0.18519679505636508,1.6285698451979147,1.645988716750794,0.49519129005437384,1.9750608111348418,0.869455565696679,1.0553759682644748,1.9804963236368356,1.1367099488390433,0.9633128174071833,1.2948153774594056,1.8681647967462254,0.845558727927254,7.722754311972227,0.7042074867561239,2.0453229563482176,1.2254317197339686,0.6730580577022143,3.5019381505132365,2.515681840783284,0.10954964718129535,0.1197438218710248,0.28970093215571024,0.6684556109104355,0.3765356525907237,0.9692749894749774,9.251756191797854,0.709879386668774,5.617674047760682,0.634940800849184,62.25917259573506,0.35902820104189936,2.2777026654593673,0.6319982890476019,0.907601539678695,0.1628778043173928,0.5325789817985225,0.14248097668343238,0.061149694825206796,0.49951938190927303,0.3773746398140272,0.777163027033855,1.0818557106595252,0.3544636917582989,0.2644760047198159,0.8788611887880337,2.923632453108877,0.02392992535953455,0.5384409592406922,0.641243687564011,2.1634343803993685,0.4167149190367515,1.278990642923085,1.3816754885084837,3.313719412003642,0.32394543156433997,1.3449677866994625,6.705601879364942,1.1183202787408644,0.9106729315953004,0.9326389873161126,0.12369618795168147,5.901150263596118,5.31333320798717,2.172428125511459,4.412123720367796,0.4338520504736492,0.1533218925595575,1.1216797421692999,0.5664499776883372,1.3415873142346642,0.7448777766862167,1.8520088616887498,1.0802182526066821,0.629302804088814,1.34813099968771,0.5620489080893069,1.15629231116381,2.602903114727349,1.7259076115861078,1.7568205558288346,1.061194910964354,0.5554596901455405,1.3902804001063236,0.037909347454248406,0.5358598550974761,0.8611270986312826,1.8442354303400512,0.9397356542936776,0.031964212659700904,2.3287607017627874,0.6291616431431004,3.95361888747715,2.7603213605434194,1.17865258004312,0.035199875081954074,0.307340638723965,1.9988307224068977,0.6628065737598852,0.8095441230123325,0.12985939820290654,0.7612078406429483,1.0730610575390558,1.9163981501254843,1.6374545567814087,1.2108844623690982,2.4722683111945694,0.24727442152796414,2.6046071183239667,8.045065414802561,0.49482030947422206,2.919785214390176,1.056161814586601,1.2751531375949423,0.3360043927356617,1.7794142244481497,1.4405358286936543,0.17710733904796297,0.9268125379767764,0.017013623820064522,1.0296924258378217,15.24370973827496,2.412569899121966,0.5155583623150028,18.40561172943497,4.082743611742846,10.6846826725813,1.7129904354377852,2.2598140976994103,1.966746086452504,3.0830415286720703,2.9085649680347405,0.06349685429075796,1.4716442248904635,3.351285101326928,0.35481437461938736,1.643752476225335,1.2996421371465714,1.2742852551063355,1.2227186056680477,0.8834132266830663,1.8319621637064019,4.1643346246048125,0.4055747245096097,0.781706308344046,1.2797466564891864,1.2845368886902695,0.039973994937974884,0.4924837660892784,0.2586787667211896,0.24917119734379745,0.5623599336062859,66.10690109346748,0.009509892951491775,3.3343441491270647,0.8494348120669709,1.9282746991576298,7.766656972217364,0.4902286786588329,0.5211104923627795,0.14466589840001257,0.14716195384406708,0.1682834045695226,0.6934728180761098,0.7228052393364104,0.11563777584336161,2.4763819181728466,0.7392799088324209,0.9225557890352987,0.8332531246136519,1.7844595472879254,4.045158601423996,0.14246774906999063,1.6987009267206308,0.2163850837217101,0.657024325707158,0.1789972028683388,0.21030173586396644,1.6946777303166658,1.9425534499992692,1.2850005262535176,1.391129385402007,1.5125185338221878,0.023895199256192153,0.6810901776173428,1.1263255772791618,4.933626415002811,3.7931900800275153,0.13491771541173603,2.9132195170694053,0.9266461354940871,0.15484404553802128,26.327400918330383,0.0737878795768034,0.029977110407069144,0.8030767125227795,0.2759383532957418,2.3581386239834066,7.418496628294656,0.6491621188105036,0.7398615674176257,0.45462335013264754,2.2926395110124345,0.10134326963732268,0.12296573749231744,1.2050986499716851,0.12902759502697742,0.5269839649023689,1.1629541301110145,0.5648042541302937,0.21495678845028246,1.1357638469716547,4.894292935667253,0.16441502183205958,1.340377061708322,1.3434167321722197,1.0312158508817713,0.24042896521857263,4.570412299159921,2.1104699316166977,1.1863932479687238,1.5350634723790944,2.3404027973912926,1.1273079619455555,5.039942105364468,0.4814544775186107,0.33719576594022166,3.0826937590487447,0.23356336897892588,0.38182647594938796,0.5756005822120219,0.3188466927809359,0.8675471929262848,1.305489533379593,2.4006503850341363,0.7738438916765502,0.3628265307614247,0.27123402324335616,0.4777519753904169,1.5093396380743234,2.163574379426702,0.833664396275063,0.6083635227783342,1.1161849409660758,0.6296087489050365,3.1485251629238533,2.0031187268922515,1.4655377676738692,43.92669421792669,0.3345621136509173,0.26898179572305253,5.869395791117252,3.677083051055354,1.0442266988913913,1.0322254719497244,1.7902026750281357,0.6199056453289318,1.9534928641338882,11.094552250242517,1.5691887253067822,3.5535437062470128,3.5447754653537427,1.750882096056857,1.8492810442571166,2.8934149838982073,0.8307028406060601,1.0001016705797516,33.44845245155682,20.527369910995503,45.755413384020954,1.3626874023651878,0.5505331569809103,3.4923297049762216,0.23983684782434864,5.325502807360829,0.7439877582074026,225.74553656283604,0.36005591814319976,0.006336432269348076,0.8992499919951797,0.5188549873714212,0.25778798393378755,2.751019495976853,0.7925126607897621,0.7415035486446079,0.08155354780939543,0.9819605244021489,1.257721960769711,2.1183625383221427,1.2079057289035193,0.10390180690278739,0.5803609380843715,1.104580968647486,1.816612666379215,4.28098046533347,0.9938781073134918,10.393737751225416,0.949237965576035,1.1534132061439455,0.3084102116658987,2.35864803132266,5.591774986223528,0.0183409455517901,1.1518308886232025,0.6385129902625788,1.036560102073336,1.8520847688500204,12.657512448248752,17.944308800574575,1.608903646639048,18.49177821588508,30.48300530127944,1.3981936826176458,0.6474831392842989,0.7666788769278148,6.702299209701432,0.7621794086527657,0.795060863231281,1.1408932892621577,1.4455531795469312,10.59604200866794,0.0277246543808537,5.680168797019213,0.4106973229911857,0.750089853674871,0.3394438036847622,0.249741369173891,0.3558854927034129,0.5209757724068306,0.11663104666079079,0.2958593110869899,0.3039840091937209,4.982811959683796,14.706653690182279,1.0676573282365178,0.011770372300296738,1.1424227383371965,1.2740598078047796,0.7792667074762794],"re2":[-1.2172515726016675e299,-9.487748167764633e298,-8.244840323303053e299,-7.914213218310612e299,-6.294102600460428e298,-7.46004930801842e299,-4.3564019844088977e297,-5.369316268650591e299,-3.7529108696417626e299,-6.724202606767789e299,-2.2500939840275335e299,-2.3906462063556512e297,-8.933789338907294e298,-2.470975440922497e299,-2.0504756761861675e299,-9.094502431387147e299,-6.719031592908429e299,-5.837264707353774e299,-3.2829286695698956e298,-9.201192343825137e299,-4.4983665853152624e299,-4.320537380523826e298,-6.565014576522124e299,-9.207278271946039e299,-4.578983396701879e299,-8.652478009105238e299,-7.036836040534333e299,-4.613324753916415e299,-9.006934938193859e299,-5.168878497779467e299,-4.959682394749437e299,-5.218782575801796e299,-8.496107530019542e299,-3.090572397938537e299,-3.39195866986168e299,-8.566377645526437e299,-6.761607780187752e299,-4.529407796485008e298,-2.0409647069361547e299,-1.7743069128983546e299,-4.284401750295388e299,-4.622758472251669e299,-4.923341091863475e299,-7.933628659214457e299,-5.569526901329265e299,-2.3629215244474167e299,-6.200710337274148e299,-8.844149209661013e298,-7.545275936106089e298,-1.901296932428518e299,-5.54586965959584e299,-8.354639590535835e299,-4.885485379516107e299,-1.7483757177355608e299,-6.724019588948175e299,-1.8373770032005765e299,-7.828233935472112e299,-5.622071033185238e299,-2.3092912328099435e299,-8.667122546758389e297,-1.6701715642219095e299,-4.459947918036156e299,-1.1305392262378112e299,-4.2418447121836205e299,-6.205935049954803e298,-6.721580570508645e299,-4.637641119776173e299,-2.1350986810825415e299,-5.8412128352697946e299,-4.255170010977874e299,-6.328474901474633e299,-8.01532334729803e299,-4.5663436222894006e299,-6.757191619332269e299,-2.101308116639057e299,-3.512105053957054e299,-5.1127829283688475e299,-7.653940376230364e299,-5.72977145897304e299,-6.484596034804266e299,-1.2221059956854208e299,-3.1188728270428304e299,-6.79481091939781e299,-2.9651662020261962e299,-6.56967023106648e299,-9.668330570606645e299,-7.339984895742014e298,-5.141464572699391e299,-4.402336176885733e299,-6.825276452462335e299,-1.3590945155973322e299,-6.4868160051501005e299,-8.93586683813327e299,-1.4994608852916413e299,-1.8011827468433994e298,-2.399886880974972e299,-1.1915614315313472e299,-7.732573932264009e299,-3.889025554718173e299,-7.035709816141371e299,-1.9367054271855034e299,-4.76929691018305e299,-7.91926028007706e299,-2.4444991743189715e299,-5.174636168684184e299,-9.213144193165345e299,-1.5739239456157384e299,-9.828535684311824e299,-2.1336771652506225e299,-1.914563663061406e299,-6.826064432629875e299,-5.451998520518568e299,-9.742263878868351e299,-2.921750278924129e299,-6.299240323666811e299,-4.936161435281417e297,-3.561922059491863e299,-5.579221525439427e299,-2.713770383619232e299,-6.369396919205096e299,-2.845961636058324e299,-5.223402594255806e299,-9.302153210978513e299,-7.809222121645111e299,-9.410590047116602e299,-9.927554035219735e299,-2.8074457742460837e299,-7.934064516363973e299,-7.316842718582424e299,-3.2843162079083845e299,-4.1317918307532054e299,-6.631943937404381e299,-7.808139054746023e299,-5.122735044996574e298,-3.1235286256687778e299,-4.540346203903768e299,-3.2853279877673727e299,-5.169344267257832e299,-7.740592077445965e299,-3.5366444335854535e299,-8.508447292705941e299,-7.883255746783403e299,-4.218897896760523e299,-3.1632817113589886e299,-6.276300992097062e299,-5.2012444522781946e299,-9.64949201427507e299,-9.423455481468508e299,-7.298412118019135e299,-3.461893299591492e299,-4.925686825011102e299,-6.509963630110475e299,-5.677727546828472e299,-2.1333946423739614e299,-9.603443702753296e299,-1.9797035460802315e299,-5.211564056470884e299,-6.666468481491217e298,-2.53956585687681e299,-8.270655375566394e299,-7.676937725447802e299,-4.767474214023351e299,-3.209742657263092e299,-5.742419468914481e299,-8.37722436979065e299,-1.9661529030689496e299,-8.720624202306554e299,-8.315070981080536e299,-3.67253269051063e299,-7.087398928771096e299,-7.116346522847753e299,-3.482061317684458e299,-5.101869081570948e299,-8.000012028291384e299,-1.041677149749487e299,-8.339627820184703e299,-3.803015210180108e299,-5.691821232856198e299,-9.622964760029301e299,-2.8549989452060878e299,-1.55839321759105e299,-2.7836167180474015e299,-8.372094819159986e299,-9.341148184762769e299,-6.1580809403110365e299,-7.290543051470831e299,-9.773383128519401e299,-1.020520179004708e299,-9.954345465525213e299,-1.6306318636986772e299,-4.082985750197364e299,-1.4935151412581173e298,-3.372653136237075e299,-2.0181970784294215e299,-6.569529238852935e299,-5.284684977023838e299,-3.161609715369941e299,-6.3019891726916145e299,-4.0523718824681846e299,-6.175850659324537e299,-4.256514206279675e299,-8.948667254569052e299,-5.18186508502964e299,-3.201833982136445e299,-9.70125113648768e299,-6.428392122702509e299,-9.84734047994936e299,-1.2008680211986712e299,-8.981307580081504e299,-6.968736063474208e299,-5.5544752331469755e299,-4.607276483004842e299,-9.386335898974776e299,-3.4839308005465045e299,-5.071803650875797e299,-2.9033068328092895e299,-9.689366965125002e299,-7.402955763267821e299,-1.1719498721632016e299,-6.40627110402807e299,-2.2919878807848628e299,-7.125400613933916e299,-9.516451389253765e299,-1.4906275048325946e299,-1.5551691640114797e299,-3.9713685871959716e299,-1.7544584699462263e299,-9.733187168597137e299,-7.187939442623335e299,-7.08599073721341e299,-7.42552435198341e299,-3.2424652040860072e299,-1.168244665456576e299,-2.9071801707307488e299,-7.503834365663448e299,-3.360681961922635e299,-5.630563238397134e299,-6.4883382694756154e299,-6.493932113157051e299,-3.7916355705167016e299,-3.537635825154258e299,-1.9211721497573043e299,-7.89567996455946e299,-3.152023930767827e299,-1.819826647388233e299,-6.6965720748485125e299,-9.308245353099446e299,-6.88129410520583e299,-2.0490075870852144e299,-1.4966033321087402e299,-5.235873702779432e299,-2.202240933200349e299,-8.201981075367506e299,-1.4071147089052262e299,-3.2503763775454588e299,-8.049388895579233e299,-7.396757882236957e299,-4.648007535636822e299,-3.2486957980584853e299,-5.923692912822516e299,-8.607968877699564e299,-5.147005050039788e299,-9.504580726066835e299,-1.2187209883090522e299,-5.105879664988398e299,-2.1755513618927182e299,-8.098732549111436e299,-1.134185303628481e299,-8.688976263291758e299,-3.3314459375792794e299,-8.943310879602995e298,-9.72098913197962e299,-1.461286844533527e299,-7.763235780096441e299,-8.93345860152842e298,-2.633738374959094e299,-2.7135626235512847e299,-4.670761169394398e299,-9.362915024674582e299,-5.706342895180783e299,-8.65679534607636e299,-5.6119553707806995e299,-4.707294223589919e298,-3.1301067983472543e299,-5.009728599868161e299,-4.201832935518213e298,-2.3355957670812502e299,-5.672193713152485e298,-5.224007362089557e299,-8.603368974099635e298,-2.4456681007117354e299,-2.6017028915847763e299,-1.6337891659336469e299,-7.2298623070601e299,-5.9372992596350245e299,-2.020983075515246e299,-5.587501755028452e299,-2.853755078008138e299,-7.102087234204165e299,-4.765320677156227e299,-2.948891568752308e299,-6.895504192311522e299,-3.7578527713002632e298,-2.286459211755513e299,-5.675643217644909e299,-9.17279515393802e299,-7.582208195719578e299,-7.196092429692655e299,-7.707590396398632e299,-2.2531252934301607e299,-9.438265005649955e299,-5.242346802560716e299,-5.480044158637348e299,-1.3252295975395346e298,-9.68981056883328e299,-2.522949493117569e299,-8.402331355610318e299,-8.857757322766014e298,-4.1816854373145197e298,-8.14213423724461e299,-9.122623984716882e299,-4.4164841898625065e299,-8.560313556867094e299,-8.53792507199668e299,-4.903501831876711e299,-3.196480149369976e299,-9.137958554341341e299,-3.440505858215864e299,-7.947140174890817e299,-8.02989315922703e299,-6.3142746047184954e299,-4.657619407786953e299,-2.410069244194233e299,-8.916180539008524e299,-5.266388817575828e299,-4.934758192660509e299,-5.962497643095547e299,-5.0737812264398855e299,-6.965737636084037e299,-3.1907520292290892e299,-2.7846440556987574e299,-3.8717497184045534e299,-4.1134302452796025e299,-1.6814529346483686e299,-7.926527557573117e299,-7.292982406179455e299,-6.309334346462112e299,-1.4351574563106573e299,-1.2626739017816803e299,-9.629291572273076e299,-2.5513963498034366e298,-7.178298634795958e299,-7.601895852521605e299,-3.312432301499124e298,-7.820425054016158e299,-1.1107141941304011e299,-5.911114994845823e299,-6.815166494424015e299,-3.352835657497475e299,-1.0789649097984944e299,-3.407120653678182e299,-6.230898420326527e299,-9.811908942280518e299,-2.892368596594035e299,-3.292754679377835e299,-9.866569255486109e299,-8.081910234818407e299,-9.401503620127768e299,-9.359675418086677e299,-7.951558982244512e299,-7.916672047821662e299,-7.949524994976576e299,-3.121703005428155e299,-1.1867660195204012e299,-7.891058750668392e299,-3.861685851797296e299,-2.0021359415112606e299,-9.124298578340064e299,-9.721506739873033e299,-1.4501506595011227e299,-2.0051873893486016e299,-4.299830446064378e299,-6.2956898095004646e299,-2.1520493821940457e299,-1.8908075842829908e299,-4.945528553139233e298,-5.366761059594248e299,-1.8957223552066085e299,-2.853246484747547e299,-5.987680282259667e299,-6.123640908433303e299,-7.348836821946648e299,-9.486895881021996e299,-5.303410253289493e299,-3.84315956865455e299,-3.90964711191728e299,-9.162744114316775e299,-8.837684220148242e299,-9.644337801834712e299,-8.859556466024293e299,-4.0162386078524916e299,-3.2777403819243967e299,-8.316620651412905e299,-8.067152817988093e299,-4.692841130854546e299,-8.516586532295636e299,-1.2540529572078907e299,-4.7533048691294976e299,-4.710312819987638e299,-1.5303609131704143e298,-3.047353916038237e299,-9.203293767230706e299,-1.5115364222042828e299,-2.3216919129961722e299,-6.702340619823222e299,-6.823653747008461e299,-3.7719656209586904e299,-7.207367194949767e299,-4.586305839563491e299,-8.877137111296552e298,-1.4762627155070097e299,-2.5694134899727863e299,-2.2773623508493948e299,-1.9945406284357093e299,-4.3089599293793756e299,-3.19622481120315e299,-6.6049376022022845e299,-7.578946850315948e299,-2.104321497928141e298,-2.6163903019271628e298,-1.5032203740643625e298,-1.971968898945865e299,-3.1596378685778485e299,-1.2505030972374066e299,-8.768777704495894e299,-4.412974138698356e298,-3.201389770627753e299,-4.2744366331090023e297,-3.2731805027454454e299,-2.9092058796146183e299,-9.544334024991122e299,-8.114319419404087e299,-8.905043218953006e299,-2.838632822426315e299,-5.783761423991527e299,-6.865130035280423e299,-5.667296426485967e299,-9.003868090059635e299,-4.885705688161022e299,-3.669136676679995e299,-2.3248134920619613e299,-3.685294665948086e299,-4.1977383694220216e299,-6.317795296293399e299,-2.598952428935133e299,-7.377600957764175e298,-6.267010378352611e298,-1.846785119035821e298,-9.55943376972377e299,-5.341096269131965e299,-7.585437640789673e299,-2.8561035865421303e299,-6.078112517848677e298,-3.5344597978209484e299,-6.18566199894484e299,-8.320879896003456e299,-2.1275506209656704e299,-3.499685297193474e299,-7.78765031496822e298,-4.52245599428347e298,-5.251231342733256e299,-3.355734285359158e298,-2.6317893299311336e298,-3.893820173677168e299,-6.421123193247476e299,-3.4427042375438154e299,-3.1596475944201897e298,-4.989886210314157e299,-5.530363355980849e299,-1.3476977353159426e299,-4.391188763694225e299,-5.49082944895667e298,-3.837544704137356e299,-1.1984367071298685e299,-9.870277123395166e299,-9.731006825661632e299,-3.62288795685598e299,-8.201227754767366e299,-9.919968849051872e299,-8.191399436189887e299,-6.878818136883435e299,-9.950071844204672e299,-3.3949747525994414e299,-1.5492909003536804e299,-6.368393672740792e298,-7.889807402514062e299,-8.38254358532964e299,-5.017227998252354e299,-6.797307713712327e299,-8.273658695838961e299],"im2":[-0.39339695979428413,9.799922701094381,8.820663474967823,-6.24964597726515,8.005453520792983,0.035429613519211145,-4.235002707436719,-5.576987096799122,-0.057609158215337075,-5.094297274822801,-9.066747978669685,4.314270655619481,8.694063480291312,2.147610689790728,-8.053822912263158,-7.645784238032158,3.558386714358994,5.493735258284902,6.234856543701952,-1.6565627383492654,7.845985190444061,-2.7334434399905394,-7.8459084124909655,-7.997125995253289,-8.355289994596525,9.30403827923061,6.6422683501973765,-0.5950755958719949,-8.832767473113993,-6.648493680268002,7.997316455392877,-0.3045780843708634,9.20564857672911,1.738800858794134,4.201243909032385,5.569704447010546,5.283166419565683,6.102414898967027,-9.251762091438604,2.0350714524964015,-5.183417124810541,-9.344035619209874,3.8640676583702156,-7.128120287878206,8.756373759747103,2.8900827277041543,1.2466579712682684,0.48109369942508096,-6.9878667927861615,4.184588612732206,0.8251432866750577,2.6316640442861967,8.076038597402317,-0.5384450243707501,5.910226796236433,7.476779397108253,9.821737442140826,-6.596411255254175,-5.975775014946008,5.1699435438001125,-1.3218153246012996,0.14583895187485219,8.018888578581883,9.166934525269966,0.4141507736989709,5.6786772297732355,-9.3680816303758,-5.31036168416909,-5.502602390922863,-0.5973934654258386,-3.7241846835947,-6.009654469869434,9.34828028588332,0.060096955071006875,3.553898494351909,7.431187734596879,9.64021942183551,-9.647913558718075,7.538613941959532,2.023724342530656,3.653372303685753,-5.734675743939379,4.13817695934007,6.351696474581551,-0.2911791831215602,-7.77578552790259,1.7385530652097518,-6.028924161032143,7.618413935983202,-2.9114894626045507,9.082050021642008,1.5848760431230264,-4.861640396271434,8.347233521115609,0.43848550060389613,-2.670596872968325,6.027263357003946,-9.7661115151258,1.8336613476497234,6.565944870041214,3.978147162695125,-4.053994717210916,-1.1604951396974794,-5.26639658605424,3.879890462381079,6.911909439263422,-0.9123149117690907,0.21122219068196557,6.084873927346305,4.867709740206497,3.000071099418701,6.38150581518812,2.8773534860221783,9.25618331042828,3.171858149773602,-8.05271474126373,5.396661555027665,-1.6871215211097184,1.840084489648163,9.467445022022687,-9.95998327574565,-9.359857595031665,-9.375409945483884,-7.802444249797327,-7.0756548340559515,-8.702145175118519,9.69811434793096,-3.145287328011084,-1.0875039082030202,-1.1729312571829098,-3.410565678681648,8.797400501890987,-0.6136412996684584,-1.1256911280351911,-6.265573564958364,1.3427871990871871,7.483104609635934,7.709429979443328,4.627707562426522,0.48671154458725496,5.018770292116185,8.309484165928815,-2.2376330401623745,-8.483423374276672,-6.5951512746442065,4.574404368357438,6.9698318766655305,9.297362687664542,-4.472102664589004,1.1040326391481141,1.8015570869234594,5.845813492548368,-4.469432050472455,5.166754767574933,9.338109990679278,-7.721652242374208,-0.7407621722017854,5.334989768793468,8.802556364440573,-8.883114219323778,-8.764685222685841,-0.9213284236127794,-0.14444438066480814,-2.5011395563202665,1.943120553925846,2.7729599748264064,-2.651228884213035,-1.9018282715900376,6.339570995951767,6.414458098501871,0.13753106197256848,1.4261186280199212,-4.076198170463032,6.070352137953485,-4.63219153120725,-3.0675369552401115,-1.4946087234427772,6.2257961398368735,-5.461670411584711,-6.945938146778841,2.033059127088583,0.31378687532674654,0.7587315533826526,0.9212849577019107,-1.7652074990914066,4.067344630693075,9.474217233579598,-8.451845821614283,8.153506712124837,9.822030184193196,3.240750571958573,-2.5267473375489313,5.265952952159406,7.778436257239292,-3.072198762124845,-0.7993328179597476,-0.2991072441577387,2.179822909159446,-3.0026382731250294,-5.768001281342247,3.383608686541761,1.84652651199794,-2.342010296144754,0.5171587684385859,4.665982360966209,7.8052916446332645,8.910643769961222,-5.788030902192894,-0.7574073402664077,3.3495972621496968,-7.227912303225801,-3.7756945698172455,5.5700101817190415,9.380665024275235,1.008371367087765,-6.973023266674754,3.7560881654118266,-7.023598063085428,-2.007693867967264,3.4244637000669353,1.9896842788125735,-7.603360287142453,5.839929483413865,3.6907195481869053,-6.000479471832514,-9.21200855862727,7.988755024325464,8.843153367015223,9.925544920165859,-7.956123877470899,4.050349405637467,-0.4737233308170463,-2.366381069846888,8.350983047739884,-4.975267001049158,-0.6202073542730862,6.0154021476621935,8.19679035012243,-4.93304927205346,0.5279022567742668,-5.136776128570095,9.23041649080772,-0.2629830184873718,4.047323246788352,-9.732453742901983,-1.7570252981399257,6.910354572837498,-2.560992434741392,-3.4048560173915865,-8.887861504261041,-3.1695155356907705,1.3346946792900667,-1.649604986508919,6.323383118846188,7.3916052530723455,-5.972775768054969,5.898382900202366,-1.514828234302497,-5.215811093291915,2.9399959532046473,1.8582219923297814,1.425717988020292,-8.732504832460997,-1.5175644267651762,-6.2608176102495605,6.280010591166544,1.950489463427731,-0.11086287381704985,-3.7887231195085764,6.215099187363567,1.1124862213278224,-2.730723745473642,-6.949483095985142,0.7063943136713355,-4.125997735779721,-3.95430634056833,-8.62828855887647,-9.660341672156264,6.4070231289672535,-6.3328357344507635,4.017112771929552,-8.07403160197605,8.511417447421788,-9.629053986286815,-5.397456889508259,3.8771834029867964,8.612797435296415,-0.9662185248226596,-6.802388644336044,5.890487053646648,-9.283414800531952,2.447628313912169,7.2021200008286925,-4.35599784550484,-6.9546394711268045,1.8647203136459272,-0.847603064965627,-2.8384043084953543,3.8586497743347863,-8.991088963598248,-2.3206508318238335,-6.344481809114497,5.489474706387529,8.826975193034542,4.226348280553019,1.9314364325783213,-0.16233362642189064,-7.943921505804761,-0.7268546313552733,8.197257202914749,-0.13219735341463945,2.396050658753479,-8.161898915247406,5.231798570280192,5.766457513095419,0.8111969905781251,7.2858480214196355,8.0239910962,3.2623002736171287,-9.92280890165378,5.960591496101319,4.042305134254516,-2.9756824903831802,9.59560895098608,-7.532889722652431,7.711486852797368,9.37508116012981,8.69370265910089,-2.990199113957117,3.454286063462561,9.922685334811913,-1.7081764172892644,0.4902304183988342,7.744780626307499,3.1535658860499147,-1.2334670769766554,-4.259061145575236,-4.581627032447882,-1.6640422801213894,0.31958817084093205,-5.804843298780405,5.212392479124784,-3.012437354685553,-7.032058252972271,-2.6330999296353097,9.83567345333402,-5.709264856276355,-5.834906604228252,9.554893362801092,-2.9133070846116276,6.977050486396511,-0.6677492155776026,-0.7279755787212494,-9.414387081426064,-5.355975388060273,-3.635603195769379,2.2486782931532225,-2.137151202753258,3.7858092390912077,9.096216518938316,1.8563789136164832,-2.0078594164296026,-4.947475868716329,-9.29356466155539,-2.5812594125018755,-5.175714911375464,7.8971517143489045,8.827030869878577,7.594140691299781,0.9127044060911196,-3.169521100375798,1.5355017809731244,2.647196308230953,-1.0393747737213825,4.923417168741167,5.726651846225206,-2.286711234615688,1.702267117939238,4.364588881604398,-5.50487038794826,5.136914341237343,1.3737637141158885,5.63500418014449,2.7196408347152374,-0.1840261985697893,-3.372184778827707,-7.868993938959545,2.871232951048846,-6.1681129169596876,-0.8360839040545454,2.3680276245710807,0.26480854500410267,-0.7745907984185578,-3.816931399949148,-2.874502089136821,6.502575552956571,4.898703588625326,-2.1207248381296218,0.7328176582441888,8.826798646315751,0.020160561441539215,5.631473249751998,6.6603453339829315,-5.80678736222469,-5.451053508514628,0.20251602364649912,-3.644446839844475,2.8567215570623112,7.883648303854088,5.269036532344792,-0.7159433732815206,9.914864012180267,-0.7573856016767273,0.6569801840562413,-7.007043762772556,9.46278254912059,-6.196793529298795,-9.012355655899212,-3.9844493836924944,-0.10696843221644947,-7.256169907923658,7.668446363599934,-6.66934990934611,-6.295661967746216,-3.7107232700584873,-3.8758559975570073,-6.029313360222853,-5.906740573043492,-7.17689525161207,4.65472611012747,-2.925337691016301,-3.305645020651302,8.055463645024414,-4.44514909334047,4.118144646738731,9.640791103415808,5.511943145215007,-4.207432489728982,-9.756398780355237,-8.518004963733944,7.627974595237511,0.3991806453955924,-0.48748623329918317,0.47087235056078036,-3.6485454565319575,-5.811589787730278,7.89504702586089,1.9524363245111704,-8.784473450166875,4.012412447128932,-8.02696683605223,-8.799981964509243,-9.56981837579466,-3.7468523885028144,4.688937645750803,4.099561188055203,-3.0130358579331817,9.193540762571136,-8.007842048008882,2.299432324235081,0.4647310192145859,5.601796358810933,-0.29912029198506573,9.197231531476774,5.412872872773253,2.5263430662545368,-9.027316952343769,-9.136915698810977,5.70350421184742,4.207426116555039,-9.729758870181296,8.935568743253764,1.3806473292532306,6.142732325188181,9.080578635776327,5.285848380720417,1.5260273148751295,4.509752616076209,2.4924116537777152,-8.150779555331859,-0.5347791601934393,0.5184303413718006,6.32195436469577,2.7430656186834312,5.741310843627037,8.104777034038882,-8.748465041042392,-3.012268809806871,-7.018146915890037,2.343725804494518,-7.153525611334011,-9.476992292242494,9.285616534999814,-3.745530010039369,3.9260325392097464,-7.970354343538951,-1.308787390674679,-7.575508586547848,6.1219899494970065,-2.192410728516691]} diff --git a/float64/base/div/test/fixtures/julia/large_positive_imaginary_components.json b/float64/base/div/test/fixtures/julia/large_positive_imaginary_components.json deleted file mode 100644 index 9c468397..00000000 --- a/float64/base/div/test/fixtures/julia/large_positive_imaginary_components.json +++ /dev/null @@ -1 +0,0 @@ -{"re1":[-1.2710423107295927,1.4009844619474237,5.713222511224945,-3.6337859532091326,-1.7655944782976611,5.889543618246979,8.741727582708762,-8.459273454914612,-7.862769230737483,-5.973667316347743,0.8403436724421649,2.31162832096917,8.857853590962566,3.0660461358615265,0.6724972558891995,3.7887483301054843,-0.12179725694448251,-5.698482421368691,6.213043508160652,-5.121432357881943,-4.281749672657666,3.827610525774075,-4.93185704838857,-2.8336397353248817,4.542272957631599,-1.156808578636067,5.7796432347843645,1.5850327468065313,5.827946787341103,-2.881644987419218,-0.7064292480332153,9.019948960557805,0.8983769133796375,-1.905951213800952,-2.1495937814861605,-6.20469588125947,0.012576743786620881,1.7421205263924975,4.704672808252415,2.0932391569089823,-5.902589266749414,-2.707715009338097,0.5245310079726284,-2.1376360863574373,-8.95024757821632,-0.17718270352003884,7.603179278151163,-4.193408572198485,-3.7987507327033203,0.6695134595942083,-5.870310201293618,-0.6764438384419122,-7.971186296500326,3.325105221835676,9.464856977725074,2.96880604855615,9.293718186675715,7.581641483132266,4.797843577714815,6.790885123811229,7.690709385642233,-1.522830878953183,-1.9511380013680935,-8.059478945814567,2.9793247762221675,-8.783389115018569,-5.011335279429881,9.761099222753739,-2.7957068787754906,-7.425604883547187,-0.9861723758847152,6.8345095985729785,-0.11162881398295177,9.57328493038721,-6.910826063346147,-4.336141862805816,-8.38012833470322,-7.191284129476577,-8.940635801507248,-7.237027182574016,-9.845442800508827,-3.6223183544745545,-5.958697501853029,-3.452671016377744,6.7349708949720934,-4.827503533298914,1.789523555387266,-0.41884623321660364,6.558279580475524,-2.7653179836712383,2.7996808518660625,-7.690668856543064,0.6648645879799879,7.9179862855570065,-6.952559937321503,6.664369497209435,5.507970186918705,1.580090796372012,1.0451485893742056,-2.160568637925433,3.8428934640286414,2.781091784586243,6.861845107424692,-4.505943671369423,-0.09565525292590848,8.526301727477744,7.797672867694704,8.790819131740207,-6.34294526451183,8.356771841578208,-1.050859389757985,-5.76580774938096,-4.106731594978584,5.4480835796268945,-6.6078137768221445,9.221198012178537,7.693644960797567,4.77541365974345,-4.736690507563804,9.313438317331904,-2.99313383253536,-7.325949212717237,3.2373506244174806,-2.5050648377955653,-6.000696748961243,9.620160166220032,3.015299798085069,0.6140125419840317,1.4174080759216494,-9.715944564225062,-3.8300328746648615,6.574839810746763,-4.801704059655323,-0.6169418663638986,-0.873655390305343,2.819055723197554,-9.10318558025436,1.8428154473806764,4.305576886804829,-3.1663677946375586,-9.215794740247595,0.00665134718046545,-0.5854879245756415,4.815679474426247,-5.404565417971123,2.5792681294000133,9.759426930907583,0.43044694715043796,-7.4682478266678975,-6.371148005413931,5.167658229493044,4.595333505442076,-5.228738857050901,9.890332518861378,8.207707575162633,-2.3240904666352407,2.9759934719732684,3.4050775599155347,5.754549998980885,-2.9444742352228825,-7.684505813095592,8.054375414752428,0.24404575504144788,-9.478785968132975,7.875092457422198,-6.938572250710249,9.474872191769471,2.514607797465114,-8.513986816926963,-8.250618357262628,2.3538453476123156,-4.5465037676574305,3.766389547004522,0.3042043727144019,1.3783226664015267,-5.357158026392397,7.361252382353356,7.398307686142857,-4.476131762826632,-8.22887103511756,-6.857938655804807,9.538773904928629,2.3255155998902843,-7.372545306847784,1.651277791134973,-2.3052157571764553,-9.690951860052122,-9.407310511065566,-8.383373281463232,-6.6002503924044635,-3.4723932969266436,0.28963216368079614,1.9870658983073213,1.941662780511626,5.975056686014369,6.374743163216262,8.686950040153153,2.984870643567417,-7.310530483493096,-9.175230554289048,-1.8668132921082865,4.567160776563586,-1.514866212735555,-0.323546694684385,2.5994916151432506,2.448372064465536,5.732667765360349,3.492523427240439,-7.544414012831371,3.083275653777605,0.34801716479176115,3.6901135935616622,-0.11181525816051696,-3.3728949607249747,7.534160417915373,6.875083555999165,4.53878392889626,7.589220985264372,-0.9400454163195668,-4.924394383257198,1.7752726399393914,-9.322396647810061,-6.170900759456135,-5.653993711729155,7.928549443156264,2.105272609924045,-5.697071316675746,6.234456398036084,-6.30634412404802,-5.308740472990349,-4.443278792935683,5.246600934526596,-9.66733218364828,0.6181174696351448,3.3993237411514787,-0.5431677045731309,-3.8501746645682244,9.085981708948768,-6.417655813409819,1.036714724784492,-0.7117236380974283,-5.96481670356273,6.491440749886742,0.726457791130052,3.016673369818248,6.21337110704394,6.214065626930562,7.425031570730312,7.872214553068503,7.255182601202581,9.889779924727087,0.46511828520640464,-8.642684839646995,5.312796958208594,-5.158535699181037,8.750564271692767,-5.369771532607352,1.5295296632056825,-3.945931619220591,-2.298427829241656,-0.12577021668186816,3.484892886542447,-1.6722182444257498,5.453743978212188,9.174304012243493,8.613359450763618,1.0750483662358068,8.725658902140797,-4.3666668885015785,-8.41399976328848,8.124237524066015,6.637347737567961,-3.913287107206811,6.20187120355703,-2.441205044144099,-5.687544324462605,-9.335229495989967,4.687171642610915,-1.78938310698509,-6.747323899916486,8.801637029388267,-5.148633252701318,-1.0098734247961012,1.3333568154927633,-7.926161350006041,-0.9858381396303084,4.823377697650431,3.2600372051897892,8.8452660024989,-9.85845126184119,-0.5839413043026056,7.961647338092174,-3.7479841651176056,9.516223409823041,6.653511244050076,2.890289774590153,5.175731927078397,4.69974170918295,-8.622092985323057,2.5578722249553536,-1.6933152861096055,-3.806388001585283,2.418025748557085,3.5137589077014137,-2.410414628875264,-6.0271402178829785,3.5870413822862766,1.980682978327124,4.508806997367607,3.8787577567438234,2.2416030786376844,-1.4034647573887238,-8.075497184958815,2.1703958938241286,-9.91979865715362,-1.3277914727127342,8.480642152306352,3.006197876078428,-6.7458665035904435,8.04659911995413,9.669049296014926,0.4767909845804077,-2.6834820382042635,7.407937587730192,1.4339110007014284,2.892253035068652,5.815607427010818,-2.880225995978229,-9.998534109976315,4.762661164401916,9.093590357807532,-2.7363482949224753,-2.890959668601263,3.749565996824053,8.121276806907883,2.0666830801450295,-7.086789077158528,-8.564995650065141,5.23955595470327,-4.416351035110786,-0.48082382566231807,-3.6140100204812997,3.736851976785502,-0.12151942356061873,-0.7988943087082934,-1.2365424139260472,5.79844325299559,9.370376083474362,2.206217666933499,-1.118101490226092,-9.458526759874804,-3.785054794537599,7.346142143907727,-5.308162291433575,-2.9605082047868425,-3.823172689362389,-9.62477284990679,-0.6103474280839123,-1.5326858859109809,-1.2355998511904698,3.6778765646568186,0.48437328318236084,9.216779230737178,3.134465669199111,-0.7231117367483222,-6.372699897953405,-1.0422105735750904,-2.9923647242398506,2.7730011589137646,-6.034513833513451,-5.068691924156424,6.652002736262549,-5.483847496830199,1.4057561226133721,1.456724681868689,0.012977556634758969,-2.7527798472194736,-2.9379964443686024,9.616131005994685,6.827745402618227,-3.624256073131664,2.1752322993829587,-5.597950166588661,-8.064112099479388,-5.404745651371535,5.405292125595782,8.879759405303325,4.393985315392047,-5.3966093279684335,-3.390194901805068,8.556609745651144,1.9293232934728604,-0.7407402490010089,3.0377914369805996,4.9013144784350935,-7.709986260147286,6.672856065819573,-6.00377452972708,-8.881163694083462,-8.487171270025417,-0.44366407818114517,-7.086583102732336,-1.4393826425164775,-0.7994247946753568,-4.4193675857844195,7.1660321029696625,7.028945938612022,6.231415613238653,2.1396532001521944,0.055075167479097686,-4.21176699999979,5.642806690719972,7.091198994869174,7.19997022238314,1.876297345579962,1.8474511891258452,0.31129007663790986,-7.238922383344724,-6.914407612050226,3.2584621044411257,0.7149662322531718,-7.171592143432544,-0.973725938194832,-3.2702050311328428,4.80541209903523,-1.7182139099545317,1.6572375097881125,9.933753666154818,2.2251551968232413,-7.953685723619824,-3.964910545576239,8.302323762393765,1.5380965435110756,2.478562313140852,6.211801619111416,7.474727501389715,2.1444592014861623,0.367884708686244,4.88192306278302,-7.1151351965778815,1.2254168967779862,-3.164687526776822,0.12918199652007623,-1.0945669890588565,-4.331000556671951,-6.991692835158196,2.1528547461532117,6.787563899901539,5.284053748747979,0.6015213777156436,6.20996064103959,-0.033589362015987945,-1.3956782217117425,-6.927090490146091,4.608914624456467,8.462345755854578,8.862546755818098,-9.458211671357493,2.323385523826662,4.643109088573567,-5.148061457451241,3.2810469621330096,7.05167874127477,9.782626503862772,-6.875349607808323,6.576319816840417,8.167797558804871,5.852367005658696,-2.780873300582128,8.535193254603794,4.4316925311650035,0.53617401239541,7.370231684761993,-8.981548216241857,-9.04350429733074,-8.752194265172314,5.644094603212599,1.2158747139197956,-2.2883435650046486,8.493916281716555,4.240404525899102,-8.268390132102168,-6.3771048799153585,-0.624557902308446,-1.547362261739913,-6.97601908954187,-4.311424379501481,-1.7022774167687622,-8.220633891379476,-5.589949322561609,-4.686972910266533,4.30826303697193,-1.7113348426436747,1.2155994374344719,0.0916643936488164,6.2715833251039115,-6.8868548467290625,-3.4160480931011916,7.010363039753841,-4.5088299400017835],"im1":[4.0412777442757044e299,1.0717559131011989e299,5.750291582944949e299,6.0617851170512594e299,5.5877433045557095e299,8.300584460610698e299,5.738846729543459e299,7.312592471148684e299,3.5724081120735665e298,9.857521209029526e299,8.057329597150973e299,9.046411380835465e299,8.961520408027445e298,5.9818640754376245e299,7.210603705223486e299,6.144548111727732e299,5.338148247587272e298,9.634539080767345e299,6.79850089710693e298,5.721160995970541e299,5.390630260305909e299,8.865032343987384e299,9.492445240710688e299,5.616587205552395e299,2.068538985670878e299,6.96207299884163e299,5.878126033043775e299,3.354860564032336e297,8.530294700119225e299,6.061576238379525e299,7.908974985225784e299,2.8779715410909946e299,8.656133621475615e299,1.7215345699891395e299,3.476489443209676e299,5.438939238752164e299,4.04596433170871e299,2.8715513807804995e299,6.412864172491629e299,9.345596165908875e299,8.239345761836004e299,4.106705097617913e298,4.612399602080951e299,9.771611376463584e299,2.4659571131303673e299,6.464745616788388e299,9.551530285618055e299,2.4022802347828678e299,7.25525251239199e299,1.1273708363276092e299,7.666247692956397e299,2.702753122357996e299,3.205813371024361e299,6.933654074817774e299,6.974101970373507e299,5.4880190325035575e299,1.93214338079325e299,9.840112726944825e299,2.004579956506506e299,8.906881113858252e299,8.473247660035849e299,7.137397536847444e299,3.837043814015949e299,6.115760226969846e298,7.323335510080588e299,6.278495755589679e299,1.4851747429245944e299,5.871893709713274e299,5.868902521007633e299,8.746364420331057e299,3.7130705279148415e298,3.3522574723871546e298,3.348613884601448e299,6.681237118304238e299,5.674321139142246e298,7.861839497535433e299,2.592945384829788e299,2.313238075980495e299,1.6189249265593065e299,1.701059135414791e299,9.355301886941508e299,2.51969691597437e299,1.8580955673844326e299,1.7026668253604538e299,2.383280863364198e299,5.146834094407048e299,1.8730801124910756e299,7.259032876150573e299,8.896160976260815e299,5.281998120907652e299,3.2726726691076403e299,2.832077593926771e299,3.686077701477354e299,1.9907359312728334e299,1.407732609674387e299,3.683441003264409e299,4.779767835182611e299,3.253260601563508e299,4.620289163130362e299,9.339338177087801e299,2.959908220416847e299,3.4361347408199586e299,7.109678127953692e299,4.75204985461513e299,9.434017499333341e299,7.686733452932486e299,5.7409961222830315e299,9.993417391386564e299,5.435437923147453e299,2.4816411073263677e299,5.4788339456596475e299,5.591485149849547e299,3.2291988951898187e299,3.666536696180592e299,7.253878863217983e299,9.994194729556891e299,7.841215241452894e299,1.4702390723506098e299,4.0897621544024344e299,6.679344224827131e299,1.788467140621436e299,2.6483350692466957e299,3.811008930933753e299,5.087273385336506e299,2.158522776237749e299,3.657612815579302e299,6.937966845760721e299,3.2934851164812987e299,5.418406722576674e299,8.949233038547944e299,4.212605828281818e299,6.6367432798597386e299,9.404623242062592e299,5.115919572173159e299,5.705948936453709e298,4.23354433826472e299,5.572022920372888e299,4.483438684828793e299,1.0617668430767924e299,7.417626777358751e299,7.793562919598652e297,5.5008908883531306e299,5.2244273242377305e299,6.235472446169544e298,6.735675260093481e299,1.4602310978655676e299,7.847962630896238e299,4.179786390305329e298,1.959093517012961e299,7.275081823109255e299,1.4950638384813254e299,1.608753679905801e299,5.386219999755024e299,3.3586507718907514e299,6.97865238343401e299,7.594226789528346e299,5.133871494074943e299,8.161685984199841e299,7.233235002349861e299,5.39674636892445e299,7.940506513810825e299,5.567675941422811e299,6.055079637710025e299,7.281958825067743e299,4.295070717163627e299,3.631423116010497e299,2.0145437904811038e299,5.550872504294604e299,3.0511822683520254e299,3.9473308138735954e299,9.020415508902252e299,1.964540882649959e299,5.967013803830557e299,1.5105663344703535e299,3.980163421826887e299,1.8833983636739262e299,4.419035808362035e299,3.1013340842216064e299,2.148077568607576e298,2.2417862312165627e299,5.318328946775475e299,5.647078421125982e299,8.823808013146886e299,1.3561224051172905e299,1.6085464847120535e299,1.139448785228724e299,6.3711183305586066e299,3.9409556548600856e299,4.350674139347025e299,2.695825750854507e299,7.549801072362695e299,5.2280443201238306e299,6.96873529327142e299,6.835232572290428e299,9.16761779200347e299,9.861603746857112e299,6.47071799941645e299,5.657999791361938e299,9.55898595033662e299,8.603043201831925e299,4.480539721270078e299,1.2802526622462197e299,1.1429123086335124e299,4.417228852727521e299,9.982310275566876e299,8.203127734516747e299,3.2862253765965812e299,2.7709788242304335e299,1.8000267274699e299,1.3909784578204044e299,9.196051796025499e299,8.906595059127036e299,8.507986937297476e299,5.1879268489204204e299,3.3446261833296024e298,4.042352300420695e299,3.757898636803224e299,1.5795056507570671e299,3.9282913161621226e299,6.295515268865387e299,6.6000650192296484e299,9.946994477038782e299,1.0768430736686963e299,9.140639025579328e299,8.06291371369821e299,1.5082992181156808e299,7.647763024167514e299,1.87105452196773e298,8.19001950377043e299,8.87884674424725e299,5.265028836166384e299,3.0731861107231786e299,1.7764500689531626e299,9.062877779254322e299,7.844814199539528e299,6.406363410565646e299,1.4866736091410394e299,8.02014430047127e299,2.070388764493806e299,7.045844296160845e299,8.616232467778099e299,9.230504399264505e299,3.3108583352636736e299,5.3134837657321115e299,5.078341081946037e299,1.195100075701574e299,4.369857853096039e299,2.8676347664388315e299,8.350598375916895e299,6.389920153754863e299,4.0357410717498416e299,1.4070167868640682e298,9.72539309129788e299,4.323595781246577e299,6.8929879013317265e298,7.878298014711419e299,4.181362769718785e299,9.088838630211256e299,2.419473225945057e298,2.4559091019172943e299,1.0412538698102226e299,9.031734525655424e299,3.807503866429584e299,2.0472722132047218e299,2.5839680436380375e299,4.3775323180471806e299,5.204023121535094e299,7.980598770282711e299,1.0674750762116315e299,9.658026054291094e299,6.751468416906989e299,3.550795555494134e299,8.387753689662064e299,8.242954364626615e299,7.658915379529329e299,3.1381885626304785e299,3.7076883433577734e297,5.639896672885913e299,7.646508004174275e299,7.439141458961929e299,5.074247124457758e299,8.461345819091204e298,3.218564188570824e299,3.31615176625108e299,7.312521658883616e299,5.518408347494426e299,4.038277356603555e299,2.9043666268261836e299,7.879819567089658e299,7.131922214020212e299,7.451665453250492e299,4.14150381938614e299,7.237898118463876e299,8.180750056969929e299,4.478107579824127e299,8.168800595301917e299,6.109696932641515e299,5.8692720687512e299,7.368978686047487e299,2.4028916718440107e299,9.397178806517973e299,4.151361822972999e299,8.433580822372366e299,7.748961737323901e298,2.7027617209306745e299,1.9340415270933997e299,7.135524362112511e299,7.524763086139354e299,3.473962078526598e299,1.6917789230660573e299,1.471323567878491e297,4.861744729655665e299,8.195418941879624e299,6.580168803449369e299,1.8595905497915535e299,2.821837488263759e299,7.1480979668507e299,5.3026467658408645e299,8.037436194344927e298,7.295633506234088e299,8.268632779193477e299,1.9483253621253295e299,5.4064275094163474e299,4.6846673436416075e299,5.757429049013968e299,4.1060942594461806e298,8.290508588904872e299,5.7082007249982585e299,4.8500248278504116e299,3.839931015088086e299,6.951482517779055e299,9.599567634240545e299,4.587276862369262e299,7.284284441593683e299,7.560922910764226e299,2.6864352803404947e299,9.056471507978126e299,3.080645509545137e299,8.749228939406746e299,6.742407562246143e299,9.163173253104546e299,4.5375071300536144e299,4.5819125723977164e299,7.204323532654243e299,8.410520404505132e299,8.770309891517811e299,3.0233697721798827e299,9.9997724911784e299,8.59533504002214e299,1.342111494612519e298,5.082994746489291e299,8.602381303496791e299,8.639294647105833e298,2.2572002297966577e299,9.433725142032754e299,7.882199797606294e297,8.24286064414136e299,1.3578564640716152e299,2.671489128518573e299,4.008123678531817e299,1.8824100025179793e299,7.233794271145331e299,8.805757672529879e298,9.438314150699624e299,2.6914679835038327e299,9.865320880313701e299,5.374656059081241e299,9.611728503507016e299,7.645962837485493e299,8.580394882063174e299,9.398220478892853e299,5.491538029289827e299,8.443625912465654e299,2.697123452591266e299,8.133618853945205e299,3.9632979346904875e299,8.807686303924317e299,8.565845210159397e299,3.536782263597144e299,6.636580591371304e299,7.645789610091132e299,4.080324904113343e299,3.813894473751176e299,5.944503954142092e299,2.359071096515677e299,9.763578661547489e299,5.370933080817064e299,5.560214445380477e299,2.0024726588936392e299,2.1075831170911352e299,5.1674274663597274e299,3.0223742706117875e299,1.2202230602547849e299,5.77143906446288e298,9.788832816413422e299,3.4923756171861934e299,1.949080627533616e299,4.180117875512859e299,9.959009291494625e298,5.517911248735152e299,4.997488571438269e299,3.861498007829471e299,8.803564525272203e299,1.996884534189051e299,7.386556105053067e299,7.513038455593593e299,9.464708202315379e299,1.846291086934989e299,8.566332368300281e299,5.501252102626786e299,6.830352503191971e299,1.2258049501909685e299,2.3878629078384185e299,7.671221463109713e298,5.464263577037667e299,1.5657916968769448e299,1.7957728849135614e299,7.805308520779042e298,6.358669785518043e299,1.2206141420032258e299,1.6346076819002309e299,7.519280362021168e299,8.780943461814528e299,8.273955506326636e298,8.2995301186919e298,5.7336624881397746e299,8.661247720685275e299,8.214813643177657e299,7.672382855941473e298,5.979811418521379e299,3.547119295955105e299,2.1060459001316645e299,7.78541303495822e299,9.703994527956073e299,8.079471145518807e299,9.655794641220707e299,1.8229602987316797e298,1.5446683578624644e299,3.0796262806844045e299,6.356160271836742e299,9.351792745457624e299,7.851073559084516e299,1.2455712698740952e299,3.1306922098148316e299,6.104934771276683e299,7.954824213029223e299,4.655001040525103e299,8.658508491750676e299,7.096539717541405e299,9.530867778444378e299,2.1775196385119312e299,3.86735613262137e299,2.0596034350707893e298,6.595278596852901e299,8.74758369060569e299,6.699193855475808e299,3.976784743596343e299,7.603097688701888e299,4.038882827207208e299,9.443171323028249e299,6.687884269258782e298,5.394670890608758e299,7.190415451205248e299,2.1434898209658593e299,9.265350702933701e299,4.3385992996549185e299,6.382369319019685e299,8.54143560488763e299,9.455108007558222e297,4.120798400239986e299,4.914986669197119e298,4.595594599182349e299,9.8362172727214e299,3.3067083979021673e299,9.60216088122384e299,1.891431629634981e299,4.76076995950422e299,6.13502050899932e299,7.740450631965253e299,1.6766297123989694e299,1.3553484623496926e299,5.730836765464086e299,4.117520404307196e299,3.44131441226704e299,6.96188908964361e299,1.2823514940181936e299,7.308483579537173e299,4.829477884199619e299,1.828841281658228e299,7.905760389299304e299,5.375472065475323e299,3.952726809489857e299,6.919892026976713e299,7.72049102492255e298,2.859624900471626e299,9.706144081846144e299,7.924614845503675e298,5.061411369436921e299,1.6954422131780734e299,9.380265355396838e299],"qim":[6.648560592512399e-301,-1.8519941754850562e-300,1.2088977490069535e-299,6.773826587353327e-300,2.6336579545375023e-300,-1.485821503308804e-299,-1.3464814421107374e-299,7.699817279934534e-299,2.152083682306552e-299,6.329923319643085e-300,-1.8211659930072113e-298,1.7936205521573774e-297,-1.270830860851252e-299,-1.570414392045263e-299,-1.1515202235443683e-299,-3.323190930095344e-300,-4.47845355138824e-301,-1.5491935816182628e-300,-1.4661417106328296e-299,1.2386195459044274e-299,1.84100485192486e-298,5.573710816933553e-300,9.702387709708332e-300,5.428543227269273e-299,-4.93107314034693e-300,3.127347736206724e-299,-9.259456836633514e-300,-1.1422586692096659e-299,3.3253341241230375e-299,2.139795025084958e-301,1.1080248669075926e-299,-1.3925269293862791e-299,-1.0942980148722123e-296,1.872764224174705e-301,5.147421034098798e-301,-5.31751566954499e-299,-1.0673847663921642e-299,-1.605758486344292e-296,-1.335464810552163e-299,-6.637679900124209e-297,7.342982140048428e-300,3.524114348990233e-300,4.3954742238807514e-300,4.566932476703537e-300,4.785478448750302e-299,9.472653642776916e-300,-1.391587758348547e-299,8.505024231480775e-300,-1.875546351844178e-299,-1.962514566204412e-300,-1.7080323084978205e-300,-1.0766638232699673e-299,-3.6833978634903216e-298,1.3271595447275518e-300,-3.1061704533896704e-299,-7.966931217532299e-300,6.504462350902212e-299,-7.703771823509445e-300,-3.49113246752571e-300,4.4076656290695216e-300,2.740766887305628e-299,4.968585350621379e-300,4.447633965846402e-299,1.0941415187129932e-299,-6.090453749475813e-300,-1.753376173552592e-299,7.514612112075837e-300,-1.7627900972444022e-299,1.5289330132061825e-299,2.7566665399513854e-300,1.2176446372441676e-300,-1.1628478086699574e-299,8.59228830597396e-298,6.49041017810949e-298,9.529363025709744e-299,3.5090844105792874e-299,1.245988578231491e-299,2.3516432459392936e-299,9.510014659644609e-300,1.2129046347550152e-299,4.475981378705919e-299,5.440288775585236e-300,3.6765338963699647e-296,4.599921390963038e-300,-1.2186762889926674e-299,1.319933888184302e-298,-4.939304984173464e-300,-2.4868596192581208e-300,-1.7646460863197983e-299,7.560249057244014e-300,-5.856781950396997e-300,1.60606918078751e-298,3.0967704192902634e-300,-1.4046484803907006e-299,2.3503417514588292e-299,-8.318660275729842e-300,-1.9230143926572854e-300,3.375590292085958e-299,8.187296341264371e-299,-1.9924976859875397e-298,-4.489835207480977e-301,-1.559111585404009e-297,-9.904305996642305e-300,4.883840224932806e-300,1.5306282632545239e-298,-2.472635042020406e-299,-2.3220590409217145e-299,3.1097248797912535e-300,8.199565057701432e-300,-1.4024345468216736e-299,4.762892782683863e-299,1.1515867049234822e-299,1.0579430698522837e-300,-1.0451720821156524e-299,4.5134088818588924e-299,-3.057354755369793e-299,7.11049971756196e-299,-9.898559629952759e-300,9.636573602093785e-300,-6.783225606593996e-300,2.3695342750328332e-300,2.979240395536047e-299,2.3382706751489308e-299,-8.468591854792539e-300,6.924047814697885e-296,-2.0787047310807418e-299,6.318520125785476e-299,1.8349599912551594e-298,-2.834258863121596e-295,3.6199447852269815e-300,1.1361532176522153e-299,-6.508745638067835e-300,-4.1955554072356004e-299,-6.653304472712971e-299,1.2268453604378393e-300,8.474711114318353e-298,-6.965463530932627e-299,-1.1423652929146458e-299,-7.841593588374447e-300,3.206273500899723e-299,1.412023671531553e-299,2.3530964230292157e-298,-3.963791417824726e-299,-1.3050417554046945e-298,2.2980511310266953e-297,-3.34426590994229e-300,-3.2809684737331213e-299,-8.077084893244603e-301,2.0449732841226494e-299,5.1302691736993854e-300,-2.960367610048088e-299,-6.653157363418611e-298,7.236542709918281e-300,-1.2885219244658532e-299,-3.886278177109279e-299,-1.2804995412447002e-298,-1.2620198006722434e-299,-7.226408522485537e-300,-2.3748535521504528e-299,1.6798000431157632e-299,9.848142725980453e-301,-1.6271169288864527e-299,-1.5607665327161105e-298,3.1578462273368987e-299,-1.1242943144172411e-299,4.827056956084098e-299,-9.950597962064819e-300,-1.2500189277424057e-298,-7.027206486058556e-299,1.1272087091851237e-299,9.242310264841347e-300,1.18820855147686e-299,-1.1239501270482809e-299,-2.7530159075678403e-300,-1.804153488628092e-299,8.184571210331041e-300,-2.150217758687008e-298,-1.738181166640616e-299,5.3364405508883096e-300,7.863898961064788e-300,3.882325043077263e-298,-1.3972845806660774e-299,-5.836221037711978e-299,1.0266078470313066e-299,5.444715690039752e-301,3.1866115754178217e-299,2.0642728981902405e-300,8.898721860221754e-299,2.3676457625493018e-299,1.13837927534573e-299,2.0796386988315563e-299,2.428690437751484e-299,-8.012825044470557e-300,2.4729523125195046e-299,-3.0292003220955715e-299,2.5138815418432858e-300,-7.820017790419987e-300,-3.861832234475994e-299,-6.381120082450392e-299,3.1788110958156553e-299,-5.4653647222766656e-300,-1.8140911237280312e-299,2.2289039814569907e-300,-6.638964519606383e-301,-3.360540229580409e-298,-1.4199518375957897e-300,-4.1550223045137316e-300,-1.727182525740993e-299,8.122127697871874e-300,-9.362763861521703e-300,9.478292457647822e-300,1.5857090519943815e-299,1.6930450201437203e-299,8.370331409791501e-300,-4.000815410315588e-299,-2.7591658803305554e-299,-4.197435976989441e-300,-8.747250531947383e-300,-6.8003360618351135e-301,2.4982048915579172e-300,-1.2351552097703297e-299,1.818962134643328e-299,7.485391540227769e-300,1.142799763710969e-298,-1.417844586412597e-299,1.0212703124900888e-297,-7.556108415772269e-298,-6.779961439478076e-300,5.462266433140427e-299,-7.329154397115577e-299,-4.490919019539672e-299,-1.5820428787676405e-298,1.2541698424808508e-299,-2.266246235215088e-299,-1.204234367006374e-298,1.885480966142818e-300,3.0652912415158126e-299,-1.2180708076740242e-299,9.509628073984435e-300,4.459041446291837e-298,-2.585021348348735e-299,-4.647198621693373e-300,8.033907673591664e-300,9.95738781110582e-301,1.8842263550152058e-300,-2.5946939320886253e-299,-1.0603320942337941e-299,-1.2602706342633034e-299,-2.857064421859508e-300,-1.94235768832904e-299,-1.9894828446944566e-299,-3.463036660567896e-301,-5.198560550274945e-299,2.3091412733214088e-299,7.128850691890057e-300,-7.192422752069337e-300,-2.8198845363305372e-301,-1.4240760154253502e-300,8.443377772992572e-300,8.581438439245423e-300,-9.439759496523711e-301,4.0507295485055805e-299,5.898875116800663e-300,-4.126541688808719e-300,-1.1707473190804664e-299,-8.747413691212933e-300,-1.0416219408266131e-299,2.6685827844996998e-300,1.2964008694928928e-299,5.041443064493624e-299,-2.192351704694493e-300,-6.249871479128435e-300,-2.9577298808435293e-297,1.3280540437684794e-299,1.4397008164975983e-299,3.884442201909761e-300,9.993968785036243e-300,2.8007203691072776e-299,6.387327782761064e-300,2.298695430459905e-299,-6.42361684153929e-300,2.873341737490757e-299,-1.382749949547086e-300,7.542817686395932e-302,1.482461847510709e-299,-6.683493799974894e-299,-2.644488088957123e-298,-4.132307886813587e-300,2.7780287957019507e-299,-8.641596552703386e-299,1.8208963843951227e-300,-6.190277932225652e-300,6.180321940280733e-300,-2.0006017749479964e-300,5.722798713693207e-299,1.5959621597525922e-300,-1.6091714950027e-299,-4.334009140856563e-299,3.104200286782869e-299,-5.0065636947628316e-300,-9.202569102783059e-297,6.43339313172861e-300,-9.612826953012222e-298,-9.296291844555289e-300,4.357179325986149e-301,1.6052450618635972e-299,-3.8734649783973196e-297,-8.510201805806943e-300,-1.0453456318515748e-300,5.987627017558905e-300,-7.587231059579262e-300,2.067150031278155e-299,1.3383317640889074e-300,5.635480502688683e-300,8.19261547144594e-299,4.77289758990698e-300,-2.9215936433140333e-300,-1.41370633253162e-299,6.914410930881998e-300,1.832963315088958e-300,-2.733562604792011e-299,-2.3724805489816142e-299,4.8270808715170524e-300,-9.676768378319273e-300,-5.500661303535935e-300,-4.9817254676618e-300,-5.632344461352344e-300,2.7467168094568032e-300,-1.283437230606755e-299,8.331016295794933e-300,-2.2255372637408415e-299,7.895489884347979e-299,2.144849602978069e-300,9.050021129736771e-301,9.293763666324084e-300,-4.0709497642715496e-300,1.0392759640482404e-300,1.7609911334430904e-299,1.873533769583692e-299,5.2648157349936575e-300,1.0706967177763246e-298,-8.397198522022287e-301,7.86447399184048e-298,4.1686821869837094e-300,9.07524167200926e-299,-1.376997669423192e-298,-1.4434072943789723e-299,-1.3822747768839057e-299,1.785303882693383e-299,1.1941568694255729e-300,5.3402029092402226e-300,5.295509001528514e-299,-4.142922144149809e-299,1.20699944402533e-297,-1.7747236868158986e-299,5.7068067933236366e-300,-1.5745017693685428e-299,9.163045053511544e-300,1.5533040053934006e-300,-3.266767035546906e-300,-1.7316877753961527e-299,6.919547017335083e-300,-8.68415506478664e-299,-1.3715716847872797e-299,2.791806461932965e-300,-6.607819059792443e-300,5.727763487121765e-299,-6.087521335246675e-300,1.2388043434019802e-300,4.308722763288444e-299,2.5876288803129044e-299,-1.2375850135438343e-299,-8.226530208482839e-300,-8.709048484507286e-300,-2.2506350225864133e-299,8.598641598473047e-300,3.0790065574510777e-298,-5.1563582989178315e-300,-2.4196982254643993e-299,9.777016699015425e-301,-1.4078480918746926e-298,-4.614498426302635e-300,3.190480617595676e-300,3.597472243559009e-300,1.608825814559868e-298,-1.4127768606440125e-300,-2.4049288100819845e-299,-1.3810990896630452e-298,1.9821337280963935e-299,2.5656215329491875e-300,5.36677812784723e-300,-3.609282238591318e-300,-1.0608671540990312e-300,-1.5246343755262333e-299,-4.5976272752436894e-299,2.278798060822148e-299,-9.880040805254298e-301,2.754179267531542e-301,1.4340235329638557e-299,4.3318067636173324e-300,-7.05286556503978e-299,-1.8595368038728147e-297,8.233684403480284e-299,-1.542469688768963e-296,1.3892894209320024e-299,1.305563874808347e-300,-8.810415915314667e-300,-1.5180995372262411e-299,1.0228347923107086e-299,-3.3722797620152816e-300,1.4852405486813154e-297,-1.9719672032330904e-299,-5.773416572117967e-300,-1.583879049248528e-299,7.403212352037139e-301,-6.17293674891347e-301,4.2649277194811603e-300,9.939278905765008e-300,1.7988157620919871e-298,-4.184464005528565e-300,-2.7968841925890396e-300,-4.4189285706895885e-299,-1.700969984680166e-297,1.201884030211825e-299,-5.221383653253843e-300,6.0757414926288215e-301,-2.523827012481695e-299,-2.432897151401594e-299,-2.758866556802279e-299,-6.498214566867485e-302,4.618017606304079e-300,-7.35387959135155e-300,-4.3352344447884364e-300,-4.462563446349201e-299,-1.0146887001598483e-299,-6.763522134333529e-296,-2.4726656686811815e-299,6.706505263892138e-301,-1.0354628730708456e-300,3.075249164106938e-300,-5.720451479627884e-300,-9.804734560062496e-300,2.004102473909205e-300,-3.522501581459826e-299,3.412579857870225e-299,-4.2150589176491525e-298,5.2467681111048755e-298,-4.216545950330649e-300,-5.5144248174149004e-300,3.348143943469809e-300,-5.300787607791898e-299,4.571420077387482e-300,1.5713578337430054e-300,6.963102141133292e-300,5.347501815109546e-300,-2.0045561320097017e-299,-8.608850946788329e-300,1.7156673288635763e-300,2.421479102148866e-299,-1.0694617625722334e-299,9.174631600037521e-300,7.358884984659551e-300,-4.665097140824909e-299,-1.7506448877738038e-299,1.1745346873009623e-299,3.1684445360805656e-299,-9.927802689659726e-300,-1.1660023470316977e-298,2.902828134529009e-300,1.5725759615890612e-297,-6.557347552522543e-300,-3.118729975404409e-300,6.018738333017881e-298,1.2110495188218807e-299,2.6801960388020245e-299,7.852250959888518e-300,3.5620226233119415e-295,-2.017624131598436e-299,1.5696000838859226e-299,-1.272427053817264e-299,-6.996087469625202e-300,1.8609661598397678e-299,6.067784649320173e-300,5.1009675718185304e-300,-9.011616508850048e-301,9.660840173266874e-300,-1.2433799888302872e-297,4.7923318961908053e-300,1.0181939653158822e-299,-2.0541937748119325e-297,-6.09335216910624e-300,-4.1042266371504086e-299,1.5262897065549648e-298,-3.161174735719156e-299,-1.3139784243526385e-297,-5.531755251540377e-299,1.9187261295628189e-299,4.593441760676784e-300,-6.922062863696532e-300,5.606373406101383e-301],"qre":[0.5433640649474031,0.11357098219201787,2.0898124316370144,1.4557498798566977,0.5965825964692096,1.3144926356003452,0.7957604319350846,3.6840780946968574,0.1043213805609705,2.6420376163873156,8.259753147736904,17.891991111713892,0.1157357095197236,0.992256773409713,1.6953234512781223,0.7206970825065427,0.06049529154012731,2.264381315083787,0.19459124813948098,0.6480335875139588,3.1542432374787746,0.9263018876100161,1.4086045389697868,1.658845999252643,0.2702908902730822,1.4969852609873064,0.8057470266376782,0.022500664692425013,2.4235915623712483,0.7806087596710399,1.348010870556959,0.40649983108894966,45.56408814141959,0.29843211037324674,0.40659300291151956,2.21711656611486,0.8142992790283105,37.000023919026546,0.9582467590740636,53.99895211207643,0.824248591970588,0.05862117095034784,0.5284392527592908,2.567843399548872,0.8756819322878877,0.7770286554436434,1.2293718928515636,0.3434851841009082,1.6898015609438586,0.13221938739167,0.7749541812876123,0.7140404511053718,4.848323066380508,0.8084329354634797,1.2662686112807675,0.7711014824494595,2.1824237662798045,1.0513246273834187,0.6266068578267271,1.6926416868999543,1.9768778602496486,0.9608986801275967,2.138616888604158,0.08210214322011797,0.7568449459901938,2.26148427709244,0.22538490475062636,0.8487813384733296,0.9958080721989688,0.9360238829988148,0.038140025012482315,0.0581887189451734,8.800302806460685,7.8452350720994,0.993995885120195,1.4678351760118313,0.39155142033662016,0.5466231726725861,0.1692967884709617,0.2604868064303715,2.6951191480871284,0.2938955608974714,28.546240454542147,0.7778708397708436,0.35080511305599743,3.0307778646042887,0.31695721123655946,1.0066931681588012,1.1156068870408993,1.1360280338972308,0.3347375806731857,2.4257817619360362,0.40442874507937054,0.30134954108744805,0.3252861029553242,0.379328613464341,1.0400280345508983,1.348391552267365,2.7553037599303956,4.4350158979954,0.4368107974229603,11.223458975274008,0.77386874086964,0.507244298823544,21.29367447380926,2.8455216021280525,1.2382158725164332,1.2513279645320277,0.8898400375911794,0.3157932479392551,3.650512889008118,0.7451611807075906,1.9872483302494062,0.8945515063621473,1.5561856978030182,1.7856968128345858,3.34164712944068,0.35098296666096,0.825933104807262,0.7643154615340318,0.47163690344553155,0.7399383957846813,1.3320024317506935,0.8040907967952361,54.536158619746494,4.259482160052879,2.8121113177595305,3.765417075004917,226.32151445950845,2.2023494400569414,0.5632793060321238,0.7313933447724231,3.0191678431658673,4.181157071634238,0.08169109152911974,7.974103994984214,2.613056610080629,1.2492201656290582,0.27911810402386505,1.814935075118778,0.011900301828892944,5.935120583377731,2.107523989203728,0.8721680543430304,14.62250620575655,0.2853820262142917,2.2841627760867595,0.0580017401139135,0.44672863194535406,0.7709453073386314,0.468437931391783,3.1134753011033345,1.0030742164727264,0.4021174308587397,1.4887219479014984,9.987536640342663,0.6833783894759167,0.9372463087602831,1.1006258447142507,1.2297296519407344,0.924788530300987,0.8600038795464139,3.179399484221598,1.5069096079419437,0.7159115988933192,1.098219842214029,0.2131593959052033,2.9895095762886172,3.7713432260066333,0.7001799604605724,1.372444751941886,0.32906670363976426,0.705008701843623,0.2261938985395395,1.3544823690576182,0.25140017381795715,2.873481370044226,0.6048407051155181,0.027088923048519606,0.4441459717012114,13.413194260063161,0.6420698032141511,2.244970780028931,0.1898647520702633,0.3378345952046462,0.6107439626552156,0.9108148254024356,1.699535131889736,0.8384711639115892,0.36240762983396224,1.2321677348161928,1.2383987944405084,0.700746641992706,1.4793044774939146,2.415936437110143,1.0137929713322253,1.0558781729073796,1.574120656687823,3.2218966866027396,1.661558388517914,0.6147986124405544,0.34178813081133624,0.42740105182806504,0.5220558729324252,5.827191745976025,0.9232548175731158,0.8589979455253579,1.2760783382175722,0.25578169803101597,0.3190900867829544,1.2260483539033522,1.5041494079765507,1.2042760933626075,1.1844544980057594,0.613577713522549,1.3851534799423535,0.38842000809080973,0.18040251691939968,0.44569099664324363,1.1947239906297464,1.2300202787997288,1.2438496642986552,0.1833882016149125,6.591523519437364,2.5115474429955325,4.117024106393019,10.594922065671348,0.020942769142729047,2.3555801632617692,4.068580519942061,2.4497774332175664,2.701366290849812,0.22818311089052182,1.6825587656192602,4.171830231268799,0.7810361996502523,0.6500478677879463,1.586316057590304,0.27881793233758173,5.689787415267444,2.234737701451384,1.1367984277204621,1.0610492565843495,0.5448133008468614,1.609713095457253,0.5024951155697154,1.313784763666242,0.4035773645032677,1.7551283244606288,1.4516796818690276,0.7386559404285543,0.015334628712005525,3.6228785733509423,1.3708239340869202,0.08310569587627892,0.8287788548035808,0.6170845616256612,0.9437492979311949,0.05500273130277863,0.5247600506688649,0.12163143488817472,7.35960235051557,0.42668880627807404,0.308976667933939,0.34809549015179975,0.5712406029323385,0.7150748962533402,1.3569463745583943,0.43967589179284333,2.0667831804804395,1.188801032886747,0.9312572792451217,30.84210493100398,1.799266716419185,1.364704864934378,0.3945956366880471,0.0039851725654571,1.770106955618009,0.8528041284664037,1.4645070020160407,1.0092592043014916,0.3126561298922949,0.7282381103172972,0.6929585000585877,1.0844170376769013,2.5403178649203695,3.150045547360245,0.3998379917712928,5.394915990528185,3.279659945873283,0.887788878000904,1.1944404942390465,0.9151123714772925,1.0074607446629964,2.3736750928509998,1.1955589745326696,1.146984494360067,2.087829724473217,1.1994813161814017,0.2889257083230118,34.378564092053146,0.45877072276034586,16.23776101618031,0.18699234064215275,0.2901656514904569,0.3361411116281368,24.63189475692958,1.2193829013027595,0.5872174402467044,2.0597747391707735,0.005044624624955417,1.517323972275676,1.0665574222991274,0.958454951908241,0.8562710627256268,0.3101590294546924,0.7896112053084539,0.9565803765824266,0.08795640358454329,2.2884742126814364,1.4432909915534824,0.7153976348989916,0.6205409974145395,0.5004522592739685,1.1014856714274965,0.12107620152260556,0.9288803671414485,0.7354965280883418,1.8611696626537237,0.9604901786881294,1.2246535304870494,3.0493579140834925,0.6386958344987741,0.7581122409071825,1.3413949140207013,0.2765910216281781,1.8742286239380488,0.554989227457279,1.5904892431899804,1.968770933238616,4.4803453241965805,0.5543551705183258,8.313772266935947,0.9788024743505104,4.162947998347988,5.4328751687698285,0.450977909931938,1.8979002938408231,1.7587363392708495,0.013711692580217427,1.9197387916431878,3.819204300085747,0.3795458340405645,5.401730889910548,2.8561691112111167,0.012069783667326068,1.8561843502775461,0.3900505927833336,0.4236664829160331,0.71340740723326,0.42562845971113444,1.075883998855627,0.7468683423489191,1.6242151556840316,0.3655937498139488,1.2971599482148326,2.267299857184765,1.2006431091702405,0.7828143532702131,7.483363964462745,1.4062237262050763,0.6520939497587911,2.321318207333351,2.0591461256521417,1.829910664769122,0.680730408348134,12.156063952191872,1.6375457600070744,1.5908681262921793,0.8588356309285421,4.005894666544883,0.521781058502566,0.5313235892753253,0.9668532136677315,1.8998458636537832,1.327016481572491,0.9841615311576598,7.689578035594825,0.5282545785172524,0.4320881302757489,1.749769317415023,0.3570800460869132,0.19603609363229618,0.23808988986789884,2.4489083770250852,0.6079480008261544,1.1934173602983782,2.076156948017379,0.1413583399289081,0.5739480205390977,3.235071601548018,15.98600654531202,2.778976336145926,19.415637637144822,0.9905048437907437,0.8625646418422505,1.072326467101683,0.3211399408085414,1.203042319626746,3.9623498952543432,17.75936610990233,0.3261244620929962,0.2445456776131437,0.18218016335812226,0.6089019980221635,0.16089497580083156,0.40212628017858526,0.12616660762121057,3.4654559070652335,0.27477261735027986,0.22070036057352296,2.878010441019745,13.158341119463262,0.2682480490363991,0.09266299317715589,0.6656585945821344,1.5009363426323985,1.2673383512800145,0.4155788488466169,1.0453074188749885,0.5020193841839223,0.26238074294510866,0.953979509216961,2.266073787224318,0.9335311369799231,108.01340231142802,0.28963346849567795,0.18116349511584345,0.48059866285591735,2.0425934618626416,0.9951510886796834,1.6182362588066035,0.16897774698071594,1.1429494148551431,2.305968563850829,11.411001162147077,14.224289250342057,0.9264200333756433,0.9153862002162874,1.1069850398964227,1.1354702917962356,0.46178469081717605,0.02629691859427991,0.7296831168055723,1.0545284417474396,0.9912216381184455,0.4044238963481783,1.0398658944170622,1.4889349351939751,1.2656536947485335,0.12683518695408613,1.3419177603898742,1.6389648157558234,0.4339009621140078,0.9677521444310928,1.6266924572345156,0.8638074934569872,4.341590090607641,0.009722935108507327,10.204761115045219,0.07892749392674656,0.7567335818304337,9.492550151240401,0.9773507540049449,1.7802815586198153,0.2163211247515634,148.15405329961519,1.1372415160236728,1.974832650077256,0.2688169519057405,0.21888974339290085,0.9076226637099689,0.5678087141321229,0.3915424147686264,1.5835327071211018,0.23222819372389758,11.127007121489738,0.683447400306777,0.2332077221990355,16.90876609117802,1.5514717338427721,1.3762711566185362,3.4460521144969998,0.5958126084934046,6.302556745636414,2.1293045450130483,0.2805830916386475,0.5630727865164923,0.1993813463815572,1.0630783688963648],"re2":[-1.4291609395782263,-3.052897040417344,4.3255578442024785,-0.5585744797186436,1.1752875399990295,-2.6572425362486474,-1.2174470949599687,1.8523579956111007,-4.726918587290607,-1.3671092376473943,-2.0490926157119604,5.197817004166117,-8.487479158446762,-6.451220108189563,-2.4922590646826563,1.3257287871029675,-8.545776404975435,-2.807670531487285,5.605257941580788,8.971315168555954,8.61734112972276,9.89077796639991,1.1404798428009997,9.371900280678304,2.84329808506347,8.943066486269462,-1.2105065537882513,-5.2478781189380985,7.233932242826469,-3.47867709616583,4.298565558763096,-2.063911787117525,-4.5429021395885805,-6.0245494062770995,-4.20438662642197,-8.682180752914235,-6.497463224914483,-3.3210764201475484,-4.417070563619387,-2.088652687246486,1.7441284284301233,-4.0752738212438455,8.25270285940626,-0.15567392245652023,5.168384351253966,9.914567735485186,-2.610013572688965,5.109008823650019,-7.013550358713994,-7.592138449926058,-9.755394977492298,-6.654780254881998,-6.667581483329781,5.5210080977882985,-6.035599173077008,-3.5032375401626776,6.897032988911519,0.3530027368027415,5.87448773239201,5.382267891542661,9.832737126850443,2.2559638586261777,2.818960557553037,1.1052494777712614,-3.8500380123452693,-6.036406551859887,-0.2643415003933942,-2.867562298848152,6.241388563448645,-5.181202577266053,5.224146673188335,2.3257537874080914,3.702485272632373,8.265853222843141,-1.4797822842192367,9.85041625639106,-0.32920220933513633,5.05021366362168,0.9064123879544876,2.624370667236919,2.111814205612257,3.545076885011646,8.174441394386683,-3.144227505060309,-4.402462548504156,5.802955995622144,-3.5632323447814374,-2.1973562272147777,-6.734900416519956,0.6600573250482462,-8.742357891876944,4.559371038630317,8.622899764208618,-4.517076139442066,9.895768087992423,-3.726059213202781,4.446216626407516,7.211828213855199,5.362090807396292,-9.947867824973212,8.101114275236881,-4.005193092976236,-2.8912237408915438,0.1368496921834339,0.31397535751941064,0.6490420746656476,-2.3974569977396527,9.009886570848494,-1.4995719040335196,-8.436439530480758,1.6703072764651843,3.858739762661328,-1.9800344154638658,1.3014251828615322,9.273075467092728,-4.418564608112421,7.295359819315685,1.792074484572467,0.04242358261040913,4.429565090308261,-4.441120638836884,4.510019889829135,7.4529941248548965,-9.77865028265802,4.915101993330444,1.839467410064648,6.615735949389737,4.42548518123899,-2.991929141643044,-3.743721199425223,8.28529303318507,0.9143271113340425,-5.919095105911856,-2.094562719519491,-0.20479599698999706,5.995943923015437,-9.167877443592207,-1.8068249534435505,4.73860434291864,5.47548471311808,2.6565581150162227,3.6757510500072943,-4.94015369349701,-5.176269972695648,6.86970446247177,3.041844704689714,-0.6625519486113536,-2.6139387362744877,3.3573463855904517,-1.9844883072432822,-9.138103292713334,-9.56551001166547,-1.3388078020407672,-2.1683578330619184,-6.7238356109337865,-1.2075679739340508,-9.518759143995037,-3.081144040254646,-8.952015059566907,3.6003315926858157,-7.3951125782421805,-2.883242881867023,-9.27229418478291,3.8364111576841218,1.5783414918018774,8.215833479716675,0.33159149867368143,-6.922720517531918,-3.7650525491002007,-2.707693239241193,6.141135245118424,7.74051879666462,-8.150874722916264,-6.783173993613207,-2.896460719733007,3.08044361706796,-8.946034736697072,-2.503559452708581,-9.025100068687749,-9.590630382276899,0.6363489944777179,-4.283811667559121,-9.182133829798362,-0.21028775374362496,5.655191693496214,5.959880116010872,-9.05452990901657,6.606177682645757,4.653599878132367,5.153759113970322,7.523387348249148,8.513114617284717,-8.535854359618325,9.036757973255064,-2.2846954542790288,8.700104433485457,3.688515970583719,-6.921992454097574,-8.145065067118622,4.383646725795529,-9.515101230794636,-6.518569942082797,-2.1498202573504592,-1.695764840792453,-9.433097917749171,1.2853910958753705,4.823180001785348,-0.20219699154296578,-7.14900269362089,-3.128092040544277,6.082361469366877,8.695713191377482,9.83929967247716,0.24764278283480046,8.724741214485192,-0.8498029826153708,1.2302013021875329,-0.38465420130649797,-3.454013215493717,-3.0199298395564895,-3.9449312895355337,4.199654864467561,-9.681809589443366,1.5464575291357274,1.3445059536972632,9.599212946857161,-5.685699747352782,8.458754061786117,5.38516367257624,-5.2360090312210605,-5.753625446581525,-4.720342352695548,0.42345336123563015,-6.887554267804063,-4.613179410534769,1.284674504432747,4.861508232191676,1.8455482268753016,2.309062027480877,9.886914171818336,-4.778415939372691,-8.566355815176363,8.480578197298353,3.1159061921298026,2.2433259950775764,0.08423605891108643,2.0454125266188896,-3.790774469187303,3.710767128715153,-0.8917778516439263,-1.3267526064456057,9.61028043798126,-6.237553405752032,9.188530353387293,9.076464518155685,2.3088321093583417,-9.011482628408245,0.16748521008563166,-4.215036561062801,3.273377601648697,-7.677970236506346,1.1489703634204318,8.417302444246097,8.801658306552543,1.3894490291062418,3.3436687535947485,-9.097579633732,7.586984079054975,-2.7728983623038905,7.327588879436828,5.786629971340432,4.568373529317061,-2.734932787049549,6.828373865726096,4.131734482583454,-6.584658469646179,-9.31763222830028,7.689251876364295,4.6173490737233855,3.3657600441563478,5.520919292602027,8.40357710711136,-2.225922731974048,1.9762409394679885,1.9093075972993958,-6.103405992244331,-9.231066303465635,0.6462297254045417,2.3916697866179426,-8.735783065588487,1.0638002446479256,4.8686240807563745,1.2459866063859053,7.833259298936973,7.351460933486717,3.3296141927048097,-2.9607362007102145,-3.5845607288365677,8.710824692992382,-5.558202345305496,-7.366222224392871,4.392418677361089,-2.9258435856694343,-1.810897732630572,-6.908340404920588,9.546268811744334,-4.409809455206066,-2.6824457650199696,6.625115598137846,2.121856560231258,5.688968297542079,3.4402733137509767,-6.607355544548998,6.301155903215996,9.193770525225993,9.719553000479483,7.390747155672884,-5.04970824473967,-4.860288421756563,3.7714849449237846,-4.1513224274831995,-8.365222639714922,2.452834265082341,-3.297731499531462,-1.3084749486376257,9.934117712618601,0.8489657418726626,-1.017672424669323,-7.169171833452841,8.426225857412195,-2.8899549436369583,7.2537050892129145,-2.1144240268082193,6.092940606843516,9.959640382838202,-6.823406899820954,-3.5132319631442144,2.1801320584712904,9.774227381587888,-1.3273869729188181,4.7802110292843345,-7.759172493934543,5.662867500795825,3.0105914187840295,4.2124164310813015,-4.319161494266304,-8.599542320021506,1.0998273624655788,6.215482074964129,3.701137176668185,-4.190451742790122,2.132003611066578,-5.490921127006063,8.354406000607653,-3.088856099143036,-7.981044095297896,-8.95210115001548,6.6132980024601835,-1.3058101724391857,-4.304639282780432,-9.3527341968907,4.774480756927677,-1.3684457205299836,-2.9772763009283,3.643910286964619,-8.787011957568485,5.528826578819794,-6.551255552825199,5.088020392079159,-0.14621094596998496,8.693650926003677,-5.781658284711549,-3.6514545561913847,0.1287048889785165,-4.670685462257849,7.373278216389842,1.6087598744622866,-3.4412706370727424,2.6631448728288714,8.82969444592445,-7.612515049557416,-2.7469430272548223,-6.225567564474817,-6.05291271780541,7.670264139926292,3.2899634378142277,-4.313139148932079,-0.7272866817939949,4.007788530132084,-4.949845525635976,5.795923631424376,-3.152297339547154,-7.14702600153728,-2.7637125878176594,-5.503034331845084,8.850490316163487,5.456176664108989,-2.8650637945427615,8.643641992844195,-7.531328581864383,-3.50496777477046,-3.253132872533211,8.86810022179003,-8.212006176786872,5.9980228110455265,9.626169489606767,-0.6970066336007523,-7.773591640467705,7.832482117331786,-0.10426283032395389,2.979353146691519,-5.425021096131704,5.944714838638232,2.9124491048701913,4.172525036186659,7.748630044820995,5.5103990088423345,-8.639199983854535,7.529043522211008,5.093703462007076,-6.146496332432234,-6.503373589021065,-8.700518983341318,1.6288526990864955,1.3898161644359384,-1.7950324898602226,-8.599075719878584,-4.605040532751383,-6.901799202805812,-7.644506702962683,-1.39826669892172,9.1454918727879,-2.096357441333712,-7.3393228109673725,-2.753060070297842,-5.528446908586904,2.0306950190405875,5.187064134413681,8.777405227696569,-3.0148811185944835,-4.170519608347645,-4.895191196752615,9.50686707219279,-9.39951722091606,2.0397639158643237,-3.187771461152858,1.358470760869448,3.072790855145783,1.102257133420931,3.1474595332482664,-3.483571266140288,8.217867085444993,-6.273494513058891,-0.8681228687175775,8.577108092829324,-5.130529838436077,0.9823445154380295,-7.889269227786617,5.971977785363814,-2.6359929491209826,-2.4470809320887117,4.649619724136631,-8.18497759928269,2.6143381182018572,4.515367672987606,9.237745812192767,0.963749255042357,-3.93565541905212,4.319044536727114,7.059214344159052,4.412779475091311,-1.7943048508989516,7.346459123037114,-4.997343869185611,3.040222834105517,-8.72072690829996,7.763955423807566,-8.50171416803392,1.9565094402608967,2.07465238589508,-0.4181056927085631,3.8363631467499104,-3.4817914351532053,9.855241865817675,-1.2273517137105898,-7.067856412778264,-7.727108081104641,2.464200718425321,-1.0112953412770906,-6.010763309950828,-4.381756386381628,-5.434468791576537,8.39730020423676,-4.834783413175801,-9.444860020018702,-8.896880370602378,-5.230977182403098,1.2661879745932332,5.638324332061064,-3.775959987815476],"im2":[7.4375138235667e299,9.436881608447737e299,2.7515826281311617e299,4.164029275171896e299,9.366252615523791e299,6.3146679074544354e299,7.211776935915324e299,1.984917877195651e299,3.424425647804457e299,3.731029849040741e299,9.754927844736628e298,5.056123337168872e298,7.743090222728733e299,6.028544461210397e299,4.253231853654437e299,8.525840135716034e299,8.824072273536212e299,4.254821843206583e299,3.493734154083762e299,8.828494550596585e299,1.7090090568331395e299,9.570349000216726e299,6.73890008025474e299,3.385840040656472e299,7.653010368129601e299,4.650729155643079e299,7.295250045876996e299,1.4910050924681218e299,3.519691532418591e299,7.765191157903433e299,5.867144811642377e299,7.079883731762834e299,1.8997710641347922e298,5.76859697783871e299,8.550293335879687e299,2.453158901014857e299,4.9686453567006605e299,7.760944660643476e297,6.692288924293636e299,1.7306995414488437e298,9.996190278150954e299,7.005498237311387e299,8.728344039540802e299,3.8053766745200645e299,2.8160420150357326e299,8.319829097032915e299,7.769439289410631e299,6.993839460851772e299,4.2935529710006204e299,8.526516863884935e299,9.89251736176024e299,3.785154073797911e299,6.6122107110689e298,8.576659572686343e299,5.507600763569074e299,7.117116433326608e299,8.853199871841633e298,9.359728166394537e299,3.1991031241806547e299,5.2621184878006044e299,4.286176617388902e299,7.427835717184747e299,1.7941707252299534e299,7.448965382759053e299,9.676137165056096e299,2.7762721232189405e299,6.589504051160138e299,6.918028759061579e299,5.893608100653144e299,9.344168005959023e299,9.73536469024245e299,5.761009235391004e299,3.805112117441101e298,8.516299456806876e298,5.708596206568905e298,5.356077866246792e299,6.6222346546479385e299,4.23186976261994e299,9.56264404765711e299,6.530308228372736e299,3.471201595514422e299,8.573443260864335e299,6.50907278085644e297,2.1888811590649805e299,6.79374608483476e299,1.6981891528625904e299,5.909567746332521e299,7.210769980119199e299,7.974279362739961e299,4.649531493327109e299,9.776830741639519e299,1.1674906780016626e299,9.114282172880538e299,6.606069231395131e299,4.327675227698643e299,9.710422236867911e299,4.595806724812563e299,2.412697258517411e299,1.676871069651892e299,2.1058184213745715e299,6.77617915555048e299,3.0615648423449327e298,9.187188669701461e299,9.368365234733241e299,4.430431915795918e298,2.7013442622202846e299,4.636506646143675e299,7.986249548194112e299,6.1083314905242165e299,7.858436250681735e299,1.5008395018017053e299,7.503725763787079e299,1.6249599237476998e299,4.0987429679608e299,4.661319579956824e299,5.596803812228499e299,2.3465120456226464e299,4.188918585815079e299,4.951686923067229e299,8.738988756581274e299,3.792042411346174e299,3.579129133362812e299,2.8611125926585745e299,6.326739972167589e299,3.9579662940473214e297,8.58698939951399e298,2.4671736150503276e299,8.746667502900719e298,2.3941191519138982e297,4.0634936835076286e299,7.478715768836665e299,9.074109475148145e299,3.114971982545033e299,1.2235655069933937e299,6.984787238911793e299,5.309116034764106e298,2.1323774230061388e299,3.5889900020715e299,3.8040056440982754e299,4.0869929062742405e299,6.549046428954035e299,9.268372581610673e298,2.4789408571390172e299,7.149393302264984e298,4.606375381425243e298,5.1167591639744284e299,3.435815832854702e299,7.206312055632067e299,4.385421880128352e299,9.436573196383352e299,3.191594314404298e299,5.167067422489913e298,5.369712341620612e299,8.352412788269842e299,4.687680189891145e299,7.603703558746389e298,7.512487332255433e299,8.708154844584544e299,6.571929086607797e299,4.38856325893046e299,8.586294329609021e299,6.474012587430807e299,1.9044727369931214e299,4.832379319030987e299,5.999442841550682e299,3.3066449689066713e299,9.450879619573588e299,1.856783650509606e299,8.090439096901914e298,5.637594671057245e299,6.572516304309644e299,5.970038478279407e299,8.463744898788627e299,6.678192224563039e299,2.9385125364135135e299,7.491635089471835e299,1.537868264757193e299,5.127522102913502e299,7.92972671803934e299,5.047408676543555e299,3.964998078504256e298,8.795116033890942e299,3.930477889352828e299,7.142570647422909e299,4.761343295045502e299,1.865673432570596e299,6.994965554873992e299,2.318843300684278e299,5.18881784681837e299,7.438656167613261e299,6.1272510706417164e299,4.221616125269073e299,9.944728773090513e299,4.620571813498446e299,3.794643621903169e299,9.727433534973101e299,6.1282808617960275e299,3.594387614013773e299,2.9668815856463385e299,5.177695386019937e299,7.287816905577851e299,3.745749330753989e299,2.674098025133741e299,8.461218581673319e299,1.7130567708639713e299,8.88500940193265e299,3.825649867633555e299,2.171480183654665e299,7.037355453210063e299,4.359202981967127e299,7.500562083663474e299,5.9213499748729004e299,7.064814276551217e299,4.380013632989044e299,5.451022926057903e298,2.918342522295022e299,9.674832806050133e299,8.755452405704292e299,8.813934644738965e299,5.269430695492255e299,5.3658180543739376e299,7.996942687320171e299,5.8719321318712964e299,1.386726300623069e299,3.210337012022174e299,3.663566642161642e298,7.218328720837941e298,8.93413143799719e299,3.4768587507672504e299,2.1822959385288733e299,2.1491866015155648e299,1.1376413932212049e299,7.785195240875963e299,5.386366268115907e299,1.8804250807573365e299,8.20238986801689e299,2.2870217453370846e299,5.055829991820346e299,7.425593996540585e299,1.2383317305062547e299,3.855590059711328e299,8.119737126813021e299,3.1203625229631107e299,9.752852504652138e299,3.154811311579403e299,2.3783317263623585e299,3.326159637368249e299,7.105539157203185e299,4.757827823491556e299,4.401742501161058e299,5.463627720110639e299,9.175421285306443e299,2.6844380495762745e299,3.154012469242771e299,8.294242444697718e299,9.505910978603046e299,6.77599640267018e299,9.630564653277111e299,4.39882378317971e299,4.680061103712003e299,8.56072996892233e299,1.227204147113018e299,8.923374155609382e299,6.625976734406497e299,7.423158635325048e299,7.66320232766382e299,7.277591688369644e299,5.881292672954688e299,2.4278681095268707e299,4.67297496201126e299,5.679224891412235e299,3.812905020589384e299,2.7195788706465e298,4.581285414444475e299,5.612140453458125e299,7.952922614578771e299,9.303708390184857e299,3.186189769485889e299,8.966312133039244e299,5.079621639719854e299,5.027694672321215e299,2.7062785629714038e299,4.419659096347592e299,4.7854983609706905e299,6.74327440903078e299,2.172329858282286e299,1.2819742749395014e299,7.263858579220456e299,1.4606009770910612e299,2.1745919795721924e299,8.393510707218957e299,3.467316990139895e299,7.909299823779593e299,8.12016756018266e299,1.886571415486149e299,6.832620363621132e299,5.3267476262181525e299,2.811183306738333e299,6.143471004206164e299,8.316641969283113e299,2.7334413331969843e298,9.048881319180434e299,5.1938077016705835e298,4.143999540683374e299,9.314547421611561e299,5.753659579828409e299,2.8968637746006553e298,6.170959981561228e299,5.915972245420881e299,8.2134171804977845e298,2.9166165518043755e299,3.2041573312547367e299,7.683992226328656e299,6.865391837507382e299,2.1717311617097335e299,9.098034299452723e299,9.052680507564943e299,5.543336342300501e299,9.137977301015246e299,3.1879902625975823e299,5.7290129485901914e299,2.7234159956377514e299,8.712442098011287e299,9.360867608906177e299,5.2269668125164906e299,3.39133059000001e299,8.925270553858532e299,7.761016547331189e299,2.6059015065478066e299,3.9978868085177054e299,5.676285042851609e299,3.148061954257596e299,7.182255800946618e299,9.608451161370333e299,5.6366121801528915e299,9.712662632816315e299,4.832106068761802e299,5.550820371161662e299,5.5009670620964205e299,3.424678538480312e299,2.0451935264047297e299,8.185198535824993e299,5.511231755312907e298,7.360344626667102e299,2.02032800021589e299,1.6143035904695158e299,6.704030742073759e299,5.268860816150483e299,4.887222062850911e299,9.78808040481343e299,2.647753313427883e299,2.2524014500359812e299,2.276219068230504e299,4.178661017735441e298,3.3029294746600358e299,6.530522845197366e299,4.4407553823567395e299,3.481231638137469e299,6.3056419052343075e299,5.61828155678414e299,4.422660091375312e299,6.72358198359639e299,1.1790240894178961e299,5.810999926745983e299,7.36190918163542e299,7.60532337888668e299,2.370509591860859e299,8.005483419756302e299,9.767274712764813e299,1.1465959590913987e299,6.6833038753054475e299,8.421390861425936e299,3.637427167801089e299,1.3098261551190661e299,4.444817449583757e299,5.822125596398519e299,7.245508364026166e298,5.230904332177192e299,2.2231775249908914e299,7.72741646058172e299,1.9086347112281134e299,7.819994301485893e299,7.178101162331158e299,6.148300352223868e299,1.2417171001329087e299,7.357541369778485e299,5.457369456921656e299,7.230844683079374e298,3.7907341276896095e299,4.877669552612157e299,2.9532049824680285e299,8.464136553505828e299,6.224481612776627e299,2.424058857629398e299,3.9972229701401976e299,5.744530144749756e299,1.6331927893577036e299,2.013392041244595e299,7.045222302768417e299,9.613956405934271e299,1.5447845324495801e299,2.4155488719988516e298,3.1679163333508578e299,1.0284928939798156e298,7.45736495016431e299,8.710116426227926e299,8.826330872814212e299,5.7491792590063374e299,7.120557796302676e299,1.3883812000589768e299,3.846056475733939e298,3.758702865537953e299,9.764486255266681e299,4.210788552225602e299,8.973962303928543e299,9.731762530703287e299,4.465693921113672e299,6.186508988347285e299,1.8348725120277077e299,4.442269953148891e299,7.406456779918519e299,2.6126661164428978e299,6.673290639065533e298,3.0844420065861978e299,8.956682526782413e299,8.613518303236313e299,5.770562997691731e299,6.481941965127685e299,1.8461918543821798e299,5.720624679921575e299,7.065701858746482e299,8.026678621655781e299,8.160985597425033e299,4.282294152408143e299,8.654742006417476e299,8.939441249504188e297,6.294025024800898e298,8.526377551254128e299,6.407896065261571e299,3.1118087815871877e299,9.397359709333297e299,4.851623807313789e299,7.371214802717437e299,2.7391345313489782e299,2.6474492614425793e299,6.971188680110918e298,3.272571977832328e298,9.346201700972757e299,7.752508958366027e299,8.609753009251284e299,1.91772488830795e299,8.37480368995707e299,7.832109407369094e299,9.038551728763988e299,8.295256291153446e299,6.758522612755242e299,9.833209114262213e299,7.311613670110898e299,2.712598604371541e299,7.461102007768773e299,5.272893453202202e299,4.0201203455578505e299,4.387168889827158e299,4.9400439457948376e299,9.574094726889467e299,2.6671294136513202e299,7.388647780163638e299,1.9673519209852875e299,9.724540894328542e299,4.0381135371846736e298,6.227217443086145e299,6.0729359837133734e299,1.0362038773570338e299,3.383338463036001e299,5.3936192478834815e299,8.743628861061158e299,3.2133916376060336e297,5.3946504964488234e299,3.919547629345932e299,6.2370683861740695e299,6.191923117735493e299,6.3141181843552735e299,7.251597768450404e299,8.789122921205384e299,4.3964289833333986e299,5.521945778654318e299,6.568238430819551e298,7.066349044610933e299,7.842112878652316e299,4.675539508127713e298,3.464756687613672e299,2.872055256321442e299,2.0080636615638558e299,1.295791816901104e299,4.5372457811688755e298,4.558363482846304e299,2.8243379881598465e299,8.988911363928389e299,8.503514716635006e299,8.823681893871065e299]} diff --git a/float64/base/div/test/fixtures/julia/large_positive_real_components.json b/float64/base/div/test/fixtures/julia/large_positive_real_components.json deleted file mode 100644 index 52f877eb..00000000 --- a/float64/base/div/test/fixtures/julia/large_positive_real_components.json +++ /dev/null @@ -1 +0,0 @@ -{"re1":[2.706514494089891e299,2.740893862198547e299,6.0299846833481596e299,9.077410504648816e299,3.482332866396986e299,3.248253997273093e299,1.4655663726750301e299,2.277422672549503e299,4.959843796228393e299,7.658617826780587e299,5.990373215252666e299,3.824267363326049e299,5.811392124253019e299,9.8514777740813e299,6.358969085024974e299,1.5851538027740331e299,3.440719917458329e299,5.126075442269641e299,7.696927417479702e299,9.447042244834507e299,4.969815419759457e299,3.742280811549798e299,4.681219801139647e298,9.16972414438936e299,4.802672515155415e298,7.640105105297314e299,1.1599541244255908e299,4.732444321488023e299,6.364488877655284e299,1.8545940591717335e299,4.653080554980815e297,8.43076849753554e299,2.869685936843114e298,1.4952376597214602e299,5.915997768016689e299,2.168606604814617e299,8.940627246709286e299,5.423392542313391e299,4.528794141299895e299,2.834615607351697e299,6.6324600929709344e299,3.0523067368268687e299,9.796763719576383e299,7.452215967452456e299,7.639964342323502e299,4.72920379928426e299,7.003979148767292e298,8.481515735012676e299,6.099809115043374e299,6.544730841872374e299,9.629751758447936e299,5.310925891448742e299,3.2456646688634682e298,9.160786727027612e299,6.331558499529711e297,7.396949251361387e299,1.4768223939273684e299,7.636322368288994e299,4.748946187380965e298,1.5125078883294253e299,4.3711286521006225e299,4.012173706904203e299,1.886790507938596e299,1.8828593295268704e299,9.721467787752708e299,9.277695815411614e299,5.3611021087767465e299,8.656605939521173e299,9.731140224289504e299,5.586639055993427e299,7.512320046327216e299,5.008819955131931e299,8.916536506527386e299,9.960366797053769e299,8.832618106725398e299,4.322091335729392e299,9.128924525472208e299,7.72318970718845e299,3.542421955946596e299,7.553670529893216e299,7.961916182972367e299,2.172474751613234e299,3.2064772274560394e298,7.290968002575216e299,5.8919006330874e298,1.144964953411044e299,2.8054178128817542e299,6.265098552471001e299,3.301833348689598e298,6.822226756787823e299,4.268391611961022e299,1.5335774022698434e299,4.746880024749167e299,2.437315691677299e299,6.503529219391446e298,3.734459427806268e299,5.0970152750107344e299,8.04684432820025e299,9.645047879380757e299,9.097758033744402e299,4.671737880401638e299,3.3975556599104784e298,4.112028996189419e299,3.888342277304532e299,5.074725517416661e299,8.59632876188917e299,8.438358755356783e299,8.818061424469606e299,9.201075732313801e299,5.848024322702882e299,7.3253045917086e299,8.635581594576019e299,3.871836909222964e299,3.659258790498594e299,7.38287444243855e299,5.620492347532307e299,7.862144145511513e299,3.2981656389137562e299,1.1755492345450047e299,8.215574380378034e299,1.9037715374152364e299,1.805012489379929e299,1.735594232265937e299,2.312431604004993e299,8.179425598943245e299,4.1197852919431104e299,4.205564756977401e299,8.973633402722671e299,2.417509542668952e299,4.0399851515546896e299,5.125392378584875e299,9.238066470771092e299,3.415242144706706e299,5.8371311797453135e299,2.4941986368600924e299,8.977163128050114e299,2.978371686001491e298,5.093384132027534e298,9.878802880796424e299,9.959037830858859e299,6.741750784773839e299,6.6654749022602525e299,7.375970452054635e299,2.613275721968833e298,8.725494655669949e299,5.0104090691002635e299,7.553560100852699e299,2.2250882475959266e299,9.06552395063638e299,1.1380758935475644e299,6.365530400025376e299,3.199559518544788e299,1.656763013768392e299,9.074528072122579e298,2.478036689215033e299,4.5414843301458175e298,5.575514740392599e299,8.085032690794615e299,3.4384489261456987e298,7.649719098099854e299,8.341812522946918e299,3.6883598680879074e299,3.957956345449356e299,1.947682524597122e299,9.80819130707672e298,7.590367682238005e299,5.1797474134494894e299,3.422889296521181e298,3.0018570226465235e299,1.2664153503232302e299,5.6165833266993904e299,2.3688820645917153e299,6.087098686556781e299,2.2963235353249747e299,1.0292926352976961e298,2.1280426572439114e298,2.1606615056723532e299,5.120327302188976e298,5.689470410710946e299,4.0080597151356495e299,1.5362872864443311e299,1.1995010513063298e299,9.35794460663133e298,3.2907681320517415e299,9.855289257915935e299,8.73071541234042e299,7.817533247177864e299,7.058159600840773e299,8.011644970906782e299,3.0082762531110053e299,7.904215428167927e299,7.127010795564418e299,5.530915348198297e299,6.3230397443598424e299,6.103001718063339e299,8.497369824588896e299,8.890255794550191e299,4.366275841443293e299,7.328887403557835e299,2.425449224717392e299,4.945575329336466e299,5.117019761927023e299,4.857578518444985e299,5.5328018328645496e299,3.620161088172229e299,7.312743277723858e299,7.633502354944507e299,3.707953917951972e299,6.56596505940906e299,7.16550372705267e299,4.756658883838028e298,3.889221968111251e299,9.791140847373865e299,4.217038967781849e299,8.030823922029156e299,2.941817704219395e299,8.439954626516532e298,5.845122964194557e299,7.617643317018807e298,1.4084848345693492e299,1.332948899866101e299,4.991981924233474e299,9.798210223311668e299,7.452322819869403e299,9.981013526394497e299,4.4389082199408816e299,7.688244115614056e299,5.379228627767586e299,3.2313819469605868e299,2.304543667431578e299,7.202251285840759e299,7.729855017608074e299,9.895351139791993e299,2.736888124699578e299,9.147902662415711e299,2.9340846919364494e299,1.6019488393112891e299,2.9114529649485155e299,9.955118918572565e299,4.987978654071199e299,8.137358273135401e299,3.5237595381275714e299,4.804081448674056e299,8.159157988288667e299,4.8505464442654394e299,7.71533376804997e299,1.1428139383227699e299,9.761181626630683e299,4.2346417608040556e299,2.9895628969200718e299,1.1077662885729434e299,2.5503225650447573e299,7.934811087480276e299,5.586101207071166e299,7.742840760725384e299,7.991751928001286e299,4.313032528868171e299,5.0559282668622445e299,5.427587122296185e299,4.834853788034555e299,4.996925001424019e299,6.752663531630344e299,4.276320644546821e299,6.806340958269492e299,1.3131246292520193e299,2.7767741192583908e299,5.641865375816411e299,2.019512127894524e299,1.7966564304506507e299,4.333861533284193e299,7.0870796875943e298,5.750469483351588e299,3.819506182480187e299,8.65168339155592e299,5.677214292711877e299,3.5803919572111656e299,7.046802427828973e299,7.266315784794438e299,1.4852076269970983e299,6.6105927134893186e299,3.2246659093829034e299,7.639625027486986e299,3.663093219757119e298,1.6487661386539011e299,5.189171871625264e298,9.382478545364189e299,1.9115211605895134e299,9.063492813546315e299,9.297849206577276e299,3.522682295600351e299,1.896383345321411e299,2.7384181244196837e298,6.490123542332944e299,7.315672704678166e299,1.630414576103192e299,7.566066419764994e298,5.874974480124818e298,1.157653244580673e299,5.106003494674505e299,4.867918017592408e299,9.217616771275666e299,7.396938887095342e299,4.854192063895111e299,1.2142648593713446e299,5.232970468814536e299,2.7389779297189312e299,6.192389467433823e299,9.36977618272691e299,3.800719019583463e299,5.216517409859123e298,2.363633694441656e299,3.1473199022526034e299,6.019023929032857e299,5.334440734035675e299,2.878994414688989e299,3.1135615869571446e299,1.6473202501737394e299,8.73620750494497e298,2.661051030849755e299,3.3408228604954982e299,2.328587098521069e299,8.991661863767115e299,6.1230927746670744e299,7.282930422009271e299,8.884133469499236e299,4.6956189956933214e299,1.5048533859993098e299,2.352633488662841e299,1.1787769927710812e299,9.980742257376379e299,7.604219562269175e299,6.0134636422323466e299,2.3317054643934223e299,3.3106578493476315e299,6.837218915266969e299,1.0076649833342643e299,7.040923319533515e299,3.536476567118352e298,7.065955853414378e299,3.716136002091619e299,6.4140668404935365e299,4.238693693769724e298,2.9066446231609024e299,3.3393463605808318e299,7.38746953465049e299,2.3784435887658883e298,9.566696490042371e298,8.04760300804714e299,8.969882917099105e299,2.721811506584804e299,6.43693245065374e299,9.900887928921423e299,1.097114565585483e299,6.6102973160840584e299,7.76515115595529e299,9.949769049267416e299,7.155143440549592e299,4.028011918790344e299,3.994910505024766e299,3.746074864217466e299,6.202930514045634e299,2.428102392785547e299,4.046884144271477e299,7.310502512131866e299,2.6526435995514453e299,8.181985200358288e299,9.672668182294167e299,2.581850604894848e299,9.183842134123158e299,2.6007121095331877e298,9.448607466848248e299,1.2198280753903291e299,7.606819570248907e299,1.8073688885547814e299,5.120098711827237e298,6.595093926451718e299,5.501717302100554e299,9.76507030900142e299,7.140179751966973e299,8.830320044936137e299,1.815634102374042e299,7.170678935377204e299,2.512321609203105e298,8.341746300633883e299,9.658322622275723e299,2.3679661811014063e299,9.863136944082685e298,2.6194245813058383e299,9.327874523648199e299,8.0802979311201e299,2.2135791529823335e299,1.4316707446490275e298,7.29281222537477e299,1.1417674967734448e299,6.636082006965853e299,6.473845551189277e299,8.438507176592012e299,5.151167607970328e299,4.702025550939782e298,4.034067451859521e299,7.422808656932413e299,1.2471821038034826e299,9.02927764163024e299,5.3965058354875285e299,4.1622057598012745e298,3.1059637260160147e298,3.51892604235248e299,5.158413302145467e299,9.9602007922818e299,1.3040578692869743e299,6.967833743892063e299,7.305891690898986e299,2.8021640645949666e299,1.0165201037841543e299,9.045424785903683e299,8.798075770029055e299,9.321558837422217e299,9.175685441185107e299,4.578714015291049e299,5.633882463014406e298,8.484890581732677e299,1.6243506885468396e299,2.1387995777283454e299,9.402905908378069e299,9.925337221200492e298,3.9519022809788634e299,9.291131533526596e299,8.504268946070831e299,5.4381038889840696e299,3.446745809000732e299,3.935102460845392e299,9.291488065400445e298,8.480444323330367e299,7.236439204130075e298,1.2422883375422956e299,3.864262032008006e299,7.260771486235955e299,7.76919911476715e299,2.5194692748179327e299,5.1391450169456754e299,7.163174313522725e298,2.2007223704763135e299,9.48100512077362e299,1.5672831488808815e299,9.359977919132085e299,7.988857736939614e299,1.801976281187536e299,2.9026434788941613e299,9.358966946646176e298,9.227947541161831e299,4.6495188704588345e299,5.945423985403892e299,3.195485095130616e299,8.868622636245386e299,2.0387055918932862e298,3.722305772955359e299,3.8871994030359836e299,8.621915443869608e299,3.880690077911065e299,2.6904019813161686e299,4.1037664613072225e299,1.818226016008414e299,3.1787305404662128e299,5.230051780637418e299,1.9326431458867277e299,8.798828487429138e299,1.117134712140756e299,2.792861287356261e299,6.608144126133398e299,7.176946978712024e299,6.325277587484303e299,4.061756923501843e299,2.078116418398426e299,1.0365452546170008e299,5.6710980302097294e299,5.0184306876281915e299,9.676086859199844e299,3.209416267236047e299,8.530598487489005e298,5.027220434065438e299,4.958902225801978e299,9.123787325915517e299,8.61273187482902e299,1.9937039181163176e299,6.2427347801126065e299,6.4970281943806275e299,6.239187963662453e299,6.2436682938625235e299,7.638113619532467e299,1.1650004560226935e299,8.495397481002529e299,6.981198121892923e299,9.238395777834873e299,5.233588877326451e299,8.593961158489557e299,8.45559661658426e299,1.806626328779979e299,5.894345717600725e297,3.418216664299323e299,2.655097353500692e299],"im1":[-3.3929271697236096,-3.4986107979202474,-8.859118169061052,5.307360933040366,-3.076720632509593,5.176108514827957,3.438074685497126,-2.3760226662935064,-5.3779135261054005,4.769378001644961,9.964298479158614,7.974439125380471,-8.713443437147406,0.8397906450298933,-9.214301611534285,2.5413800117464795,3.480732756924194,-6.39296245437767,-8.506301690378347,-8.850395225418854,1.8259975343778674,9.867206826227449,-8.385281690111182,-7.728315492959954,-7.772503943465406,-4.04604387519041,9.001309336409292,-1.3570005892329196,1.1165648467823797,5.091780118268874,4.827217769278247,5.429717670464049,9.830695155037464,-6.385093753328515,-7.459017630327276,6.571532470399589,-6.764389931370429,5.304107225213228,-1.5847632338127031,-4.348868765313489,2.7090605303260578,-9.544203821742316,-6.5524157415899875,-5.007005292502722,-9.99165404371287,-6.022298293508421,4.750204870994505,-8.295258297828404,8.839283924147718,-3.8923298537913347,4.5392536256224165,-5.869003184222583,9.027518066802529,-3.325090920000866,-1.8739988037002693,-0.25318083720053863,-4.712328183915386,0.05320284302330158,-9.841618755271845,0.22135580268024668,6.0959132215790035,-8.062039691756729,-2.1382640711939978,0.40684510128311047,-9.589751560164208,7.471671446585354,6.448999404783798,-8.976739942267084,-2.068285070451714,-5.6915538137127015,4.73799881263991,-6.359776064355791,-5.069717776119706,-5.573670567002504,2.8376752310332947,6.9344318122027175,-4.214091934847817,2.0213644854251953,5.894041764016366,-1.8208202130452946,-3.9197421262893446,9.305097932153142,-6.098640064082188,7.792330129050811,0.12449378506821596,-9.661774645243792,6.617552118904367,0.5188287466919341,9.343176681703767,-4.961110864734497,5.362336483069649,1.9619786655061606,6.580101521639744,-4.10636791753376,5.5110728564628,1.1347117943308493,2.2368749911726376,-6.665565348788787,-8.251265667357808,-3.532966528065007,3.339702800618481,-1.000653007189154,-8.825555918276631,-8.373225670334257,4.746916386369026,-5.334622924756685,9.343349194130859,-4.5595178092208695,0.6904004280849385,5.607515040794235,-6.681838459338425,0.7618543752093423,9.280058529587542,-3.1332353044673322,-1.6122427562562773,-0.7122986675276444,-8.699770038701493,-5.3493398918783,1.479049198160915,-3.3435514912959547,-1.3006576777500278,-2.929927963611993,-5.1157983213181435,4.910451621387049,2.3046192924957936,0.17944374662043572,-0.34000760929598783,-4.227653948678219,-1.1051499598910386,1.5743572409452185,-2.169977877888578,5.600216322027796,-7.937438898497431,0.8800209160268118,9.669201549858474,-8.542145820628521,1.5115981599198456,8.856819189113363,-9.596434356307494,8.373201397315018,-9.714278102977012,-0.26467935950163124,-9.372124171689102,9.751924565517804,-8.07312694623601,-8.894062514910416,2.142429432028216,9.487004712023463,0.013721651940464596,0.4337107237614184,-3.5602628501816476,-5.228762140001743,-5.186026694578169,7.616016764224266,8.735715319659256,2.474756888639476,-7.308843578729953,9.451919512175468,5.319655991353308,3.4356425448030414,9.985077393287284,8.635000048873053,-7.413297377619397,1.6334792427905107,9.035542479399172,-3.2925339321137574,4.88443241203033,8.101250922981016,-7.767672450889891,3.264004675623756,-4.086664514237775,9.053015159262323,0.1496295900319815,-3.1148140984684503,-6.211889599130275,-5.238714847366532,9.553282900292931,5.719036937741171,-7.964436940096857,3.3023610272817194,2.17385502828658,9.090132268678598,-1.0638832160889358,-0.71385643489862,7.581531172961014,2.4875675746997317,-4.661293505686396,5.249633263764286,-0.9826296994778154,7.137542947384329,-1.3022517287309459,-1.2461885205272019,-9.186174269590826,-7.661697270540122,-0.9797412954113298,-8.497820632466102,-4.3338158466627075,7.62675422687612,-1.4060446828390045,-0.4582739733598977,6.237751638235977,3.1361186039205773,7.9279061357355545,-7.882105424509335,0.7519974772706739,-8.219437978362494,-7.239861788608533,3.7562007228787824,5.015662582412254,-2.3585908259566457,6.554353862557068,3.7244019433162574,-6.3322024773093215,6.664166371770847,5.365144431589821,-8.509072836617369,6.797548150834789,8.641887423830525,-4.1716539064580775,0.6553166851519876,-2.077418699111016,-6.528621183282968,-6.130063587673291,-9.807683576387365,-9.091716814085519,5.621358607077241,8.36682055434445,-1.5785096453906906,0.6064670855755754,-8.824693438111797,9.220550438451916,6.705294087914201,0.3441619024150082,4.144557111984952,6.60785816635121,-7.9032143557938745,9.953083058167756,-2.519972783121558,-9.211217908439108,-3.8510031541380574,0.6114749987397765,-3.0131302525157615,-2.677492767838519,6.949842771006672,-2.5078534595062347,7.078641638382766,-1.6835135004247341,1.6968677696819778,2.5139665829089815,-2.5401216178193087,-3.5141055615079875,7.606315043726134,2.42499756797611,5.0237502131717005,0.2625112945388697,-6.663366451417662,9.027572781242675,-2.408287641539621,1.2994588572405554,-7.089085366439702,0.8619073270233919,-8.539905332323208,3.78854090580141,8.163180057619439,-6.9482257474414855,-2.3828940926724362,-8.000827881165925,-6.730517129496656,-7.074742792761226,-5.794388902048113,2.1078442480722064,-1.2963275900354319,-1.114383336025428,-2.3558515816173298,-5.118978137349575,5.954756578458722,-5.1750667400475,2.1753402297495477,-6.3991213594543765,1.8023203818672044,-0.7868280713227893,-7.511180727909947,-8.431493671386628,-9.748240521112201,7.330007998938935,-2.9063517422645884,2.7045219556443776,-8.952211011573644,8.557515578944585,5.069360154340172,4.170514282536873,-9.19120095076427,-8.571441958215736,-2.957767507899076,8.120113007825388,-5.927103630489197,-1.6745656035152923,3.787460021582511,-5.826525378596759,2.629851773648138,9.595967552674804,-4.246989010760965,-3.030107279450009,-5.436309976766108,6.003045636001513,0.36344527295923257,1.286946931888055,-3.683842178030461,-5.288254211682903,2.2704286119905746,6.330738544156183,8.415756533383146,-7.258944563749276,0.2571494833586314,3.5488921944801177,3.2732050138574014,-4.733049573693611,-5.996742969182853,-5.490241615642677,6.722660311987557,-2.6555296053016715,-0.6990183804311183,5.997594073418181,4.5752643106901285,7.404497364893189,-9.965073226876983,-3.471623516841751,-4.625643101854648,-1.8560421773790896,2.177276982851499,2.057601517122512,0.48379403276484645,-9.652834958971031,0.8172961076385388,-9.465535396844649,4.320164695880408,-6.48647572888917,-0.9041733697677508,-9.38995361127243,-2.332425745116124,-8.122427295413317,-0.9108762218376061,-5.697836952989626,-8.879036968965384,6.724965163059,1.3640662906048355,5.752402741805012,-1.0191351147993633,-9.797756480545036,-5.951825420672609,0.28146697127100495,1.0310311771665184,-6.830884291077104,-7.2555926382935425,-7.7005205999566435,3.39008938698883,7.865463532944471,4.0791554292245,4.474146130770503,-1.0944616270378553,5.634623837910439,1.7889634855670238,6.46057129241996,-9.506338715823068,-4.219594595871536,1.3013514588781288,0.6380923416288109,-1.6921849863640759,-8.330200999579295,-6.8867493720240365,-5.122337413633831,4.045603283506495,4.454239192856379,6.0126654918788205,-9.01226766408455,2.81308875780244,4.492707083263895,-2.1263870749005642,5.573752298158748,8.666825425963097,-5.310212543735431,-8.286996445597982,0.16294616923485705,4.397332600312252,-0.6095511637384714,1.7942529002404974,2.20515265509556,-2.1665886680878206,-4.907083081656403,0.2348065211760435,7.716212254621148,3.6380132354969703,1.9707750298349413,-6.335112823790732,-5.788655073511981,5.136588465804772,-0.5958664415823822,-8.100946130878405,-3.772101770045908,9.939604942950066,-0.9294465422805569,-4.385300853690149,-2.190562970242949,8.911270225995384,1.8302737822752917,1.8161853663802177,-2.9853923976217,4.04743726336484,-8.522740657250234,-9.942395941258603,-5.49163239424961,-8.898735627693888,-9.111674846608565,1.261964601781525,5.615338427289778,-9.867797142547152,1.239528925488596,-1.556709035981516,-3.3800859041391913,2.7990216181489807,-4.580707992355668,-7.4068955842283835,-8.47451894651897,6.994276601058008,6.394664537452691,-0.515421975620427,-1.7229624269566184,-9.490948095438936,3.8713940137115,-0.27897184628383975,8.053872698148968,7.416789951225265,5.03768899112994,9.908127817207731,-2.0608621941531364,9.673225085434279,-9.022443322336432,-6.09008456051952,-6.373606712557711,-4.044521253400111,-5.094423027722563,1.1341527772101916,-6.692222773081438,-2.376906567346875,-4.1485825392193565,0.2181247425812174,4.445290036337944,2.567242186030068,-8.619530768040363,4.611217263500967,2.423682013813739,6.2940532669756735,-4.530678370674687,-4.587329351429088,0.0547942110380184,-7.621789933124223,-7.899264536234258,-8.044453566567329,-3.869587889617203,-1.5529069091132932,2.162205303490241,6.426649879254484,5.079365472137052,7.61986596451483,-7.739081691391457,-3.799974810939249,2.492037689817451,7.522251645454343,-3.4511020547797404,-8.351602919217187,2.8507346298795184,-6.847441972188326,-7.659212630599761,4.364411334267096,3.176845686414371,6.545898628060613,-1.3936194480450688,-6.073303073414699,-2.6795053411224217,8.754055045457982,-3.7048772516265593,-6.851095341914726,-9.059407915497715,-1.4804526087307064,-0.35263235565527395,1.0586974726211338,8.409590478401665,-3.9106143692481172,0.15137856144841777,7.871589593566661,2.861155610494734,-9.379056202973807,-0.7799342926036132,-0.6559743623457326,-5.878559369512894,1.2712904787131798,5.737073802864618,-1.1697530587859628,1.2601078942675077,9.766962928156289],"qim":[-9.354178793727828e-300,-1.0558481294756887e-300,-1.768340479286621e-299,-1.8428009262619089e-298,7.367823610149929e-301,9.180478292715952e-300,-4.535187401273064e-295,-5.145424641933921e-300,-7.96079097241925e-300,2.1029045618966348e-299,-3.858081106803514e-299,2.533203894414943e-299,-9.988726317689964e-300,-3.5300573350738987e-299,-5.031258119631762e-299,2.0954885853759832e-300,7.333029474969831e-300,5.145105721921595e-300,1.0144724793148948e-299,-2.5166980825949077e-299,-1.4956234966718633e-298,1.5447850389792451e-299,-1.0242544906138135e-299,-9.582127974494657e-299,-1.9785208138145782e-299,2.912678555265068e-299,1.076955016960132e-299,-3.672200635072662e-299,1.4350028249162587e-299,1.1712075988905756e-299,1.3733890987138253e-299,-8.433334113331255e-300,3.8081437952359104e-299,-4.744039336103537e-299,-5.281807262042815e-299,2.707645068770659e-299,6.230027899908354e-300,1.1907226551459918e-299,-4.9166856378007694e-300,-3.844047662279394e-300,1.5775073357737955e-297,-1.3584604397952864e-299,-2.413884582671954e-298,-2.7102783826442553e-298,-3.822959616404478e-300,-1.1271449590537596e-300,2.3084134179593797e-299,-5.2440703684056054e-297,2.1219825008740756e-298,-2.0911426442849546e-299,4.537071381869181e-299,-3.352574088150752e-299,2.1029445916527509e-299,5.6059046197967335e-298,-2.8176160273942712e-300,4.789919081498482e-301,-2.4637827779391958e-300,-1.1470204737557268e-299,-2.8865312724561263e-298,-3.6117897414808466e-300,2.053477890849661e-301,-1.5109141026780976e-299,5.207442271483993e-300,-6.840625115091469e-301,-2.2681358553709116e-299,-8.592975820945977e-298,6.103452456839588e-300,-2.1672998518501687e-300,2.3502878386277966e-299,-8.83937703160978e-299,-3.4841172109682007e-298,-6.651532231266079e-300,-4.316597621687246e-300,-1.1575747338695918e-299,1.290850251862734e-299,2.377495906280456e-299,-1.516125246285905e-299,4.057700918323121e-299,-7.378657833381408e-300,-4.099384694814897e-300,1.9063188384407451e-299,2.7530471802735955e-299,-1.0375943022643219e-299,7.90209058216197e-300,1.5199809131575152e-300,-1.1080855047361201e-299,6.601515998748917e-300,-1.3882701167005039e-298,9.086029179515642e-299,-1.4408647106900266e-299,4.6352555630059665e-299,1.5499146836428076e-299,3.345322371240764e-300,-1.6794826673790774e-298,2.3699627391015016e-299,4.274883896188032e-299,3.184331978868057e-298,-6.537872088279786e-300,-2.902925816113679e-299,-1.1293967807945476e-300,-2.6945041808073602e-300,-3.507184043054622e-300,-7.227547854610476e-300,2.3978020861546573e-299,2.884310448727979e-299,6.928065503835363e-300,5.319536807573526e-300,-1.7590859854099237e-299,-7.251931985585002e-300,1.5780175294355105e-299,-2.143687843175508e-300,-4.917116846525168e-301,2.568967205055355e-299,4.8880499291384254e-300,-4.539607417807e-299,-6.299115908015441e-300,-4.3601930039001204e-300,-4.873254275899107e-300,1.8029444042354693e-299,-1.3585723636583745e-299,-1.4626843788468737e-299,-5.00374621769895e-300,-5.3697546993923794e-300,3.4491937369636414e-300,1.082029775314587e-299,-2.782673718679295e-298,-6.512845555025335e-300,-6.660749900411098e-300,-2.5745867084886178e-300,-2.3883305096850903e-300,-3.5736832272878097e-299,-5.966260267212064e-298,-6.371481228210611e-299,-1.5845899941337574e-299,1.0780543816681805e-299,2.6646465934153274e-299,1.9982670538614103e-300,1.1148541430442674e-299,4.198385720756905e-299,-1.855571677168356e-299,-9.259903988961313e-299,8.119555980099631e-300,-5.532556299509732e-300,1.1061822561634523e-299,-9.305902106812319e-300,-1.3097625643981225e-299,-3.232879555981396e-295,2.7455772003071524e-299,2.2925073850733966e-299,-6.130289993015329e-297,3.5201155427612284e-299,3.0373791802160756e-298,-4.720489095080455e-300,4.023947018767401e-299,1.6429598762888205e-299,4.919519611991837e-299,7.32767425788318e-299,3.8609326492395e-300,8.108593677240512e-300,1.1804582799425841e-299,1.6872993914037638e-298,1.0796867517420915e-299,1.0099483357894161e-299,4.8760006956515125e-300,2.8325057695909706e-299,-7.529014082307076e-300,1.106907435694666e-299,8.382405438893017e-300,-1.1344945599424052e-299,2.439061256943884e-300,-1.2322590554478745e-299,1.3995164418517842e-299,6.435962547916843e-300,-3.63434074046355e-300,-1.4308436253705517e-299,-1.25872322836721e-299,3.907127386778067e-299,1.5078887390499985e-299,-1.4462985693894819e-299,8.680395809704672e-299,1.5293676793482339e-299,2.748286091689855e-299,-1.6558829965159783e-300,3.2465690160027e-300,-1.8235888754955697e-299,6.409672164353452e-299,1.3120204395001876e-298,4.4745185365520553e-299,5.5247663258095574e-300,1.0401897765431174e-297,1.0511303788239829e-299,-2.440616508388295e-299,-8.991975698748111e-299,9.694167443250092e-300,1.2368016967376812e-300,-4.89289165285967e-300,-6.130743790757571e-299,1.824717387085208e-299,-5.9723612213177414e-300,8.976313333966662e-300,1.310633894133817e-300,5.286435474835798e-300,1.437337901120392e-299,-1.221264764572958e-298,-4.3500397145177167e-300,-5.203144695250004e-299,-1.6236389186027627e-299,6.099546782075791e-300,5.4187542101410694e-300,2.1048101942825707e-298,8.573679197532889e-300,-9.70178121783908e-301,-3.231259069970384e-298,9.124819374288277e-300,2.2607377723638887e-296,-9.001428551355638e-300,1.7669734701868905e-299,6.101180009631354e-300,-1.0758549575908095e-298,-3.614192023034856e-302,-5.029259014415519e-301,-2.298857953457591e-299,1.014280587392427e-299,-1.0499186116564006e-299,-5.03662276472952e-300,8.655109160875857e-300,4.844649290174429e-298,-3.948414608770297e-300,5.197415090894198e-300,4.539804955188009e-299,1.9249109598610288e-299,2.8834485990870493e-299,-2.214656278958455e-301,6.169510560476625e-300,-5.224349594805286e-299,8.001301527740213e-299,4.413329816509606e-300,-5.175142813657755e-299,-1.7545020914740815e-298,4.2120839381097874e-299,9.34611502258254e-300,-1.1605940391083046e-299,5.547953368137698e-300,4.747449525548525e-300,5.8787900860779434e-300,-2.1760917290588638e-298,-1.4852381903388111e-300,1.424730015059566e-298,7.35983924077469e-300,1.8390175075002884e-299,-7.524637690996296e-300,8.849895828783506e-298,-1.0389209195032695e-299,9.094117653847352e-300,7.025184170695475e-300,-1.315931665894831e-296,1.6927778152682326e-299,5.523927958342814e-299,2.9717416996768888e-300,1.533139826537783e-300,-1.3913368365965521e-299,-1.5079573726867243e-299,1.2902856088846917e-299,-1.0370591585769824e-300,-7.366872067040597e-300,-4.035567463776745e-299,-9.554968190222456e-299,8.692579348873447e-300,-5.313212503216416e-299,5.832699195044959e-298,-6.035816595678666e-300,-1.729639564736317e-295,-8.968382165160972e-301,-1.1304206693792033e-299,-1.0011234480175109e-299,1.103729342938108e-299,2.6172865272967553e-299,-5.759586523132067e-299,-1.2949534780441885e-299,1.8235890103637579e-298,-3.563525315881639e-299,-2.766265790491832e-299,5.206137173732518e-294,-3.579406142436732e-299,3.6496556023082785e-299,-8.912643622694994e-300,9.197164474777938e-300,5.827215785108449e-299,-6.491837762777417e-299,-5.635777191630501e-299,7.257906015856426e-299,-2.0967259730495434e-298,-1.0894084745138397e-299,-5.503609520000582e-299,8.581759397711246e-300,-9.684079347412128e-300,-2.2439197593568497e-300,1.1636915659982994e-299,-1.0524147678776621e-299,2.1204515341562002e-299,4.4715515346742325e-300,-7.553806247820637e-297,4.329733936348823e-298,-1.3781556631358146e-299,-5.440473366533278e-300,-2.329413968070413e-300,1.1258702184638907e-298,-1.5851207545221388e-298,-1.5568010129876891e-298,5.1454814465132405e-300,-1.8910695858594767e-298,7.001590225778983e-300,-8.02738578739851e-300,-6.767435948765116e-300,4.172496813354476e-300,4.658279723457296e-300,-3.500257651279493e-300,-1.4788268595968125e-299,9.82063226972012e-299,9.025594559264776e-299,-1.2246561066000854e-297,-4.665955953168194e-299,-3.438374600031577e-299,1.6613452630637346e-299,2.256210337157237e-298,-2.3423262680164947e-299,-1.1125208405834914e-299,-4.419246991496679e-300,-2.943441284087346e-299,3.8326197936695454e-299,7.331611381762937e-300,-2.1868321298536216e-300,-5.3818106674705854e-297,4.8043949593228e-300,-6.017215342064428e-299,6.711706204903725e-299,1.565356238774406e-300,2.302180205611406e-296,-4.717123828837839e-300,-2.1480480614676827e-298,-1.3742591472474548e-299,-1.7479194128562026e-299,-6.587128989182731e-300,-7.938393678676674e-299,-6.519306940126183e-298,1.5419723214040958e-300,7.235078534184915e-300,3.1051292356825458e-298,-5.838322415551156e-300,-5.548426044672868e-300,2.157848299831621e-300,-3.0608468141898644e-300,-1.9801600143801042e-300,-2.329637146904141e-300,-2.542595477366784e-299,5.652651553906593e-300,4.5593752028340606e-300,1.1181541717997466e-299,3.8400696120644146e-300,1.6506864733463923e-299,2.6712359599549856e-300,-3.691456971709145e-300,2.6844460476918666e-300,-1.4631779206451466e-299,2.6250794971399325e-298,-6.321269486344933e-300,-8.085684045469539e-300,-3.3378089885450593e-301,-3.9436000433984275e-300,-8.409248716502536e-300,-8.861722011059486e-300,9.613323799367287e-300,8.156836211310953e-300,3.812527636240633e-299,-7.1868615719152975e-298,3.2068106980417015e-299,-1.772383165453764e-299,-1.373924746776734e-299,-2.146936408917595e-300,-8.210918261869237e-300,-6.658093454179554e-300,-1.1198304727454754e-299,7.958841326421335e-301,1.464710687278057e-299,-3.3797385646640835e-299,8.258821579607203e-300,3.8221897628127245e-300,-1.1390854204474277e-300,-1.341965176730912e-297,-7.424286978417545e-298,1.4225711624853181e-295,4.599098800417917e-300,-5.546373243523137e-300,-6.227935399200536e-300,-6.40314538385347e-300,5.797630129469763e-299,5.284728222086272e-299,-1.3653990158879704e-299,-2.30982713773655e-299,9.976979641792013e-300,1.2499462949555373e-299,-9.085262025221561e-300,7.88454688665957e-300,1.3992485353304096e-298,2.0379515786662107e-300,5.341168155141073e-298,-4.403235392064947e-299,-2.0871714011740417e-300,-3.1345574110388936e-300,-5.967594614184178e-299,-1.7546735714630429e-299,-4.380694467312493e-300,-9.680732990707864e-300,6.934586339587553e-299,-6.946477351263866e-300,-3.925268541563128e-299,1.2306161920769736e-299,9.351803647471918e-299,3.419892203781973e-300,3.248131129472485e-300,7.069546494900418e-293,-1.23746855148528e-298,-1.4611927566652808e-299,2.0438613749844553e-299,7.427586586143811e-300,-6.482141794694244e-299,4.986935168428077e-296,-2.959802184839962e-298,-9.152185752483961e-300,-6.954982576307082e-300,1.9851713726541067e-300,5.190272746174909e-299,4.83512635121215e-299,8.392591573120224e-298,2.1480709356504057e-300,1.8110959027942417e-299,-1.4497713347405885e-299,-2.6293485907362952e-300,-1.534650194759921e-298,-1.3215303522675492e-299,-6.471396572553288e-300,7.612953167267072e-300,5.62536189245351e-300,-3.453063583835946e-300,-2.253520158633728e-298,2.1221683073656627e-300,1.0766438120537728e-299,6.618568036470606e-300,-1.1049085104477957e-299,-1.4915489816621987e-299,1.0836490997304824e-298,5.178467075596592e-300,-3.632979398661015e-300,1.5191422032287724e-299,-1.8497294827771657e-301,4.88754028784873e-299,-1.171793775587192e-299,-1.1144741950616791e-299,-4.311244806132542e-299,2.490861897292893e-301,-9.844685328010557e-301,1.7972099112308095e-299,7.236010015029422e-300,4.6357002504259735e-298,-9.216557898022201e-300,1.2319420898715686e-299,1.4164230442462242e-300,5.677814248184471e-299,-9.296287576033163e-300,8.061955512623604e-300,1.3565140169744037e-299,-3.957126340798999e-300,-1.9911799735171389e-299,1.7785120068897908e-299,5.866327895261729e-299,3.917978651516216e-299,-3.480618214787589e-299,6.551735611162099e-299,-2.6136132005414748e-300,8.387334904329444e-300,-6.495855500861886e-300,-1.9863355595639494e-299,8.07949102025904e-300,-2.0638880842474946e-300,-3.666239515188384e-300,-5.4433141695075595e-300,5.235049455288143e-301,-5.690273262729475e-300,1.1479513494743302e-299,1.4831666396552576e-299,6.294818565841648e-300,-1.3827969117533763e-299,8.543505739414294e-298,-5.7377560676301983e-300,-1.342768741047266e-299,-1.2385889289121738e-300,2.0229207002300432e-299,-3.2309944669960934e-300,-7.691338220460323e-300,1.4474836364758695e-299],"qre":[0.373584940344492,0.4010290905466761,0.8667020786402653,5.939456298935278,0.4070802115521645,0.5830144822443959,128.16655578760395,0.3440785719843918,0.7876789899373597,1.402863897837821,2.621583325873019,1.5157533912252532,1.3817898202472039,10.25313757730568,1.4561949363406275,0.26539964387748877,0.36177636990116124,0.9322563338741648,2.5632976643473038,1.3249635482980624,3.5917886598900837,0.9028597050371368,0.05652277302807325,2.8160879968753254,0.12031415681050958,2.5448312162711146,0.15372881388154344,1.2893540199761728,0.9631546806979675,0.3222667881395588,0.012922920962953846,1.377633641181007,0.11358003350664704,0.8073161149027921,1.8319799504317245,0.7257254258220002,1.3104805693729014,0.7260885231646204,0.8635963308033476,0.39341506714077995,19.497608282444222,0.34197362388196606,6.605468796084088,11.72405330316497,0.8911460129356163,0.6465770758313104,0.3292681025879468,24.215412590149782,4.515637095696304,2.4011781976615834,2.509599040017119,1.8160435949973617,0.07158392370681542,14.295016869311036,0.009215130957565702,4.100595457417918,0.5575694630957065,1.7876056247604728,1.1523893021393554,0.29026519285469,0.727587299905347,0.6586274499824526,0.543723882433029,0.18856708960224017,2.7237045024221835,23.226585504593714,0.6871279475978789,0.8981178215568247,1.7806081562975065,4.043198210415558,9.55233574098547,0.6861190921807276,0.9762915350868363,1.0369350216279327,2.6734637999894773,0.7639001163590228,1.7487574127381522,2.150941244875565,0.9991288511634111,0.8285694815283751,3.0524147978667253,0.6572555756157961,0.05111374158342852,1.069272715564425,0.1384054094722423,0.12917637260039846,0.31749713257040507,3.9923989922043717,0.3901115559156103,1.151284476338906,1.2512928218666153,0.4555529516172143,0.7599167488514725,2.211077741883153,0.26167741272872475,1.525216677765696,5.437315868131782,0.8641972808012465,2.875738708469842,1.059961667293476,0.7878732322243096,0.07667461094818502,0.7140726017589641,1.758815441856431,1.158717477296988,1.558271097540432,1.0983457177766152,2.05414927874438,1.1783582758405597,0.7905587610205094,0.8348551794990282,0.8989843127180428,0.8302296051820945,0.7093372594143004,2.430413072817835,0.6338325294146956,0.874317740830596,0.3466055379083666,0.4598408218777221,1.1459563044983672,0.5660464574923106,0.25207495982968026,0.18293795617219905,0.27682076029161623,0.8931213730532026,5.60299999231286,0.676209764803986,0.9522952778756798,0.3465789848921845,0.46911426204967055,1.7166941131016022,8.756467906315645,6.749681608865537,1.3306709028060424,0.2930992220403206,3.150129296980023,0.034114689435906474,0.06014786354027931,2.978373414243349,2.707806517047919,5.313442846085473,0.8180643772335603,1.041841848815034,0.03007560077891846,0.9800228112525683,0.5505864185888264,234.6907693686122,0.6248305460751953,1.6214720835824588,10.845450679464461,1.8237388704640694,6.533470093046748,0.22836469173905583,0.4248044317954124,0.9403151298003602,0.5056911007386846,2.683202372118657,1.4946327877006025,0.05693825329588747,0.9207573413250278,4.2011520119579,0.5713751207663396,1.3737456336764544,0.7890264103902754,0.33549464782160565,0.7972219732862234,0.634695765781844,0.034462718474804116,0.39987209484971065,0.16868937286477712,0.6700104241157577,0.34528607963404134,0.6712992956977332,0.3181234707468043,0.02346269771762189,0.05131366944054705,0.7133895331975502,0.11576927931978637,0.6278710760486786,1.978960259220687,0.503365130507731,0.337531385558824,0.12414470327239895,0.45900870818844713,1.8525247677348937,2.9138110595400843,4.604309857282405,1.647906260259769,1.172013391216564,7.772835839887457,1.6317582171184468,1.49379174182001,2.9625391279593436,1.3675093644366303,0.7269320240498497,0.8796021672071178,2.292200096797972,0.6084726457861769,0.8541909967731502,0.5614000084553521,0.6226545978799807,1.051474343455632,0.8444071484185275,3.1935239327333496,0.6430451503988258,2.005055113160602,1.1729733469708101,1.0013507702530011,0.7594185439919168,5.9709018045519615,0.06937372855708998,0.8650847823527539,8.022748941232175,0.7361580951929796,96.40777654450355,0.3261500225587344,0.19307306329490695,0.6973254071052545,1.2998094677770877,0.17127800615631678,0.2729729419886333,1.1972825605207447,1.7055520366787715,0.7813860834460505,3.92067049006712,0.7019768040117713,5.707439839845798,0.7364901125671062,0.4266160166696462,2.1189448468043577,0.9044582129034993,1.2191713735872458,1.2010648138732136,0.7523346651091608,7.081290217708269,2.364413642858046,1.0762741463029044,1.3398502249789395,6.384297575467263,1.8207876204953697,0.906905638892455,0.8374036350613906,1.4105278226264903,1.6980536833622777,0.7384941278821919,6.362791010572716,0.12370757617728198,7.088454598411893,0.8482703110489949,1.3490435896334447,0.31422248835232863,5.323873406172244,1.224586659228969,0.9453246090817468,1.2630585148767417,36.365065268204866,0.8533128237848007,5.703961062547734,0.6081690930494155,1.0929231881050685,0.989438428826443,1.0894250341816787,0.7931442807879353,0.9056960202681998,0.13587643861805476,1.4145788238668464,2.913585404300763,1.2930851598671889,0.8089913325102752,5.834473162053455,0.4447051218399908,126.2690919929677,0.638323648854033,1.0007275470397785,0.6167193358054942,0.6235857309199864,1.8165408000260426,2.8903330791517017,0.2909612082091029,3.844494820753348,1.5389385624942211,2.3425096407580295,145.97735610740642,0.5980229357088767,0.2786173857007093,0.978301388637711,0.40706545348701734,2.8924336637905155,5.463629771188588,4.175780043153296,1.2091909826668141,0.47868619335799323,0.9810807244881898,1.885865247242214,0.19228357990012387,0.10801219686884596,0.07047373411545756,0.2460565382883672,0.5388457834353613,1.904880586289883,1.1126969227308572,23.57137103003351,4.9052160810743235,0.3331336004660691,1.1516608068853955,0.3676191514184643,3.6372838836808903,8.175728659334613,3.4811381873225784,0.12801111760581513,3.5899626778358185,0.6562752083648926,1.0692839666882108,1.6925829485045483,0.3204244689975093,0.3596098687639021,0.33728548275388315,0.21709087640253064,2.7983749643478286,1.892810825317119,7.018274793251124,2.472066965921371,2.6022577240700224,0.9015683984370046,4.729699619839691,0.8591407840386925,0.48954495857766006,0.2519400422033735,0.7365385148713702,2.0664515957171883,0.9011080009069065,0.84979737160321,13.677640681812324,0.7761916924826686,2.421245373946959,1.0081687286254537,1.4135745044302688,9.464874685684993,0.7693999443682631,4.143605356887628,0.6695878754125243,0.3305518281775301,0.41930720604409777,5.1092778974413715,9.407067968898005,0.03674588791590505,0.1023386078366756,7.737333129236365,1.0510846808130148,0.368717616491756,0.9662293312811965,1.0938537947171478,0.9291786054074475,0.7042622335090688,1.092064232060987,1.095933758910553,0.8319907774236318,0.5441652616818753,0.6981798278567658,1.0432850754230418,3.0523363402266233,0.5096594700273027,0.4437421968411238,1.6398723800022352,4.779159849499581,1.3557509187041636,0.9766723191538343,0.8273207345682019,0.9210015058209087,0.03226335276491073,3.1397282879972135,0.20721012811363346,0.8987009115277331,0.7724392349209973,2.187933102414569,4.328251063042367,1.4509781844657614,1.652487009197817,0.7882726244460185,1.6678696275438867,0.43128114558820585,0.7309117460996362,0.038609478737624645,0.9439560815708102,2.69909476214473,0.4589942761794884,0.12761861713517977,0.29259296066410867,15.987433582322874,10.381939896090907,75.23552307276539,0.018672053397071883,1.268304794893717,0.12976221780955616,1.05838032132844,2.0790032857610536,2.8292624248688982,0.992866321319638,0.32171896970271824,0.6479823381041171,1.6066107758613497,0.19327383012181387,1.012310354463742,2.5024800000581715,0.04426585161661857,1.2659505334942636,1.2963456087923328,1.1699456648471607,1.3712299677442812,0.6717909349904433,1.0744338514992098,0.7408023788978352,0.3130539517345144,1.2639187953755187,1.1292074156891099,1.774740485224037,1.2414665633620368,4.404905908551505,0.983683019853408,0.08263001392872264,3037.491897973484,1.4475875875380417,0.30854510238413085,4.375458723983102,0.14533501998869877,1.8461971068779368,90.3887411340615,6.505251643726912,2.0461696740416517,0.4903282885185374,0.7786919933910232,0.42259086436283905,3.1081595159238113,2.38320138375627,0.350730485115715,0.9903038813347023,1.1299667227429209,0.8290125171513624,1.7211160650982193,0.6468965205312076,0.09191763886386956,0.7661562517900714,1.1414881767354115,0.20840050239619234,6.715789522865758,0.8411119339673481,0.8609327082779411,0.45854889984367625,0.12862980252328546,1.4633059501059429,3.241998604475699,0.6294065801003057,0.3961430852380206,2.0574872482897133,0.03122452734198568,2.3149760538963484,1.230341770987787,0.903331247781863,1.6835560002733316,0.4258990909199932,0.5481276619487819,0.5342836921259526,0.4047348503500931,4.941799159958158,0.25032772321901847,1.365738456793786,0.16620889847824855,0.9552608640167015,0.7211607692215927,1.6802691595487342,0.8132526591119895,0.43094485394481546,0.3936871769457136,0.27315212408659584,2.2212651053825465,1.1997949916531612,5.105096355347196,1.935667696964436,0.0987139026035691,0.8855161505600652,0.628375507847839,1.668404112122802,1.766982091232877,0.21263948782140712,1.3889163177382482,1.2898097673924553,2.9166210303716373,0.7633511266421878,0.980176858716365,0.19573638680454744,0.9775851410058235,0.7764764553788843,46.84493432921851,0.7827286593778431,1.3284279920743074,8.122414357646287,0.7525995048739625,0.016787536794543586,1.0341717501447163,0.4972946166248371],"re2":[7.244709841874639e299,6.834650968741959e299,6.957390355874495e299,1.5283234773991106e299,8.554414504991848e299,5.57148080570569e299,1.143485805379485e297,6.618902942473303e299,6.296783156070755e299,5.459273589251611e299,2.2850211000856893e299,2.523014222145146e299,4.205699042719358e299,9.60825669196772e298,4.366839168528401e299,5.9727050858657395e299,9.5106264635204e299,5.498568640415968e299,3.0027442869923507e299,7.130039356153902e299,1.3836603125506676e299,4.144919515923982e299,8.282006614952558e299,3.2561923329682532e299,3.991776730579968e299,3.0022050407304394e299,7.545456802388391e299,3.670399477697738e299,6.6079613225189765e299,5.754840794728729e299,3.6006415022732145e299,6.119746386497993e299,2.526576061165866e299,1.852109269367799e299,3.2292917652414943e299,2.9881915772185097e299,6.822403517961053e299,7.469326906140601e299,5.244109984912803e299,7.20515263422119e299,3.401678809468567e298,8.925561866959622e299,1.4831292103573613e299,6.35634773635897e298,8.57319028691595e299,7.314215081324801e299,2.1271356361937746e299,3.5025278646141022e298,1.350819161454956e299,2.72563312803941e299,3.837167453802599e299,2.92444845821912e299,4.534069244592767e299,6.40837769607272e298,6.870828563029206e299,1.8038719810754344e299,2.6486787596433927e299,4.27181603286363e299,4.1209565019084908e298,5.210779402980652e299,6.007703340436632e299,6.091719540403451e299,3.470126232998408e299,9.985089834597002e299,3.569207958905759e299,3.9944294926934855e298,7.802188991902527e299,9.638608355990028e299,5.465065511394643e299,1.3817376159303441e299,7.864380241677105e298,7.30021946949784e299,9.133067517311112e299,9.605584332002332e299,3.303810624538909e299,5.6579273168981515e299,5.220234927369606e299,3.590609332350799e299,3.545510623401286e299,9.11652033811305e299,2.6083991561490263e299,3.3053728750460554e299,6.273219545515731e299,6.81862344044439e299,4.256987248947839e299,8.863578767248278e299,8.836041416089489e299,1.5692566210702743e299,8.46381835816178e298,5.925752406983337e299,3.4111852456674785e299,3.3664086618814326e299,6.246579025825572e299,1.1023202149380152e299,2.485323112749327e299,2.448477965292717e299,9.374138634991658e298,9.311351131236565e299,3.3539374947290714e299,8.58310098795815e299,5.929555275297869e299,4.431135180074758e299,5.758558704059392e299,2.2107733334433224e299,4.3796055698191306e299,5.516581020759211e299,7.682789324693302e299,4.2928045764326044e299,7.80838554874186e299,7.397330358029095e299,8.774341672173967e299,9.605931352090768e299,4.663573648850732e299,5.1587009450484004e299,3.0377035595347593e299,8.867472221286082e299,8.9923191287901e299,9.515617259946102e299,2.5564264384896198e299,7.169186423713017e299,3.363277893919331e299,7.160617978872331e299,9.487338049367e299,8.353533895250367e299,9.158246399345773e299,7.352820449036813e298,6.219319767138345e299,9.423162763907101e299,6.975349481795622e299,8.611942714985991e299,2.98561772855659e299,1.054999181131937e299,5.059856660825113e298,4.386607663424748e299,8.509741579992916e299,2.8497760827329758e299,8.730466949133906e299,8.468104820741703e299,3.3168449710010986e299,3.6778986120900225e299,1.2688102573156746e299,8.147861082523627e299,7.079740999503799e299,8.68902251090064e299,8.903358733576705e299,9.10013196827871e299,3.218516058886345e297,3.561106705766188e299,5.590922003792463e299,1.0493578618198664e298,3.4903738156360074e299,4.897182466557737e298,7.254900051105606e299,2.136166054993727e299,2.6353257654602968e299,8.980747977395443e298,2.0779329946664337e299,5.4093773114886125e299,6.038908338612577e299,8.308072881712162e299,1.98560121109717e299,6.4552335830461186e299,2.8811420749392803e299,2.4684630310837652e299,2.9235015732030637e299,9.521021668469324e299,8.160992545883564e299,9.932151170905667e299,7.507043030283851e299,7.507380748509866e299,8.382829765838111e299,6.860635873599145e299,9.067637528548262e299,7.218340507647194e299,4.386932175001495e299,4.147126253969228e299,3.028726109826492e299,4.422872226789314e299,9.061526526298916e299,2.0253361311631493e299,3.0520335901986676e299,3.55374671105151e299,7.537933041007864e299,7.169293465126829e299,5.319923074478581e299,2.996321736014852e299,1.6978729689126516e299,4.2831074625131614e299,6.83579644306845e299,3.870242875416963e298,4.843986900293435e299,4.7710872915129334e299,1.866950986739575e299,4.623763397016832e299,8.395560404757767e299,9.660469404673532e299,3.87848155445469e299,7.175796433382552e299,8.579916472128525e299,4.320358368698327e299,7.942726747983875e299,4.866518896799825e299,5.752649687467288e299,1.7325067697642094e299,5.629715247719314e299,3.647153252658805e299,6.507822513323032e299,3.702952080433434e299,8.646042569483196e299,1.2000706026667518e299,6.856570899059596e299,4.495769718123825e299,1.2204221918316806e299,5.728442022601649e299,8.330058227535187e297,9.019829835178444e299,4.371378628630879e299,8.382202777407611e299,5.8605845747887745e298,8.223384112049368e299,4.883080682486125e299,4.169426740887521e299,5.744890811066523e299,9.53731193548181e299,2.545741487758546e299,6.323440026184179e299,1.3470565317113837e299,7.30387080013576e299,7.574450608268736e299,1.087590208356356e299,7.96305587487567e299,6.340253048153541e299,8.238815279153256e299,3.637859920096154e299,1.2918412296588888e299,1.240935443254252e299,1.488420812498491e299,2.172968971210405e299,1.5593131117237992e299,2.7394620865854483e299,8.97266256175563e299,4.2079582540494256e299,3.4058750005572796e299,4.805005912494417e299,6.568158447211406e299,1.212570671460025e299,9.238027076733231e299,1.3770535581645105e299,4.9920900279621704e299,2.21606100788217e299,3.525420139028487e299,4.790351630239809e298,6.479583153777158e299,5.909188392437279e299,6.130231235946331e299,2.1976454239967304e298,5.0544564767444384e299,8.86388986779647e298,8.924470487445797e299,4.4237818729212974e299,5.0502637211602866e299,6.19837374739842e299,5.391604967886278e299,7.515039048370733e299,9.664108381168125e299,1.9629688161652892e299,1.9363995191245864e299,1.5617781338561998e299,2.2208599255021445e299,7.428025483896273e298,1.5936582106972675e299,4.554138619823012e297,5.983651380200708e299,8.64539346113555e299,9.205507210661546e299,5.741619443294436e299,3.879242584437381e299,2.5140063742850928e299,5.1044867325741076e299,1.719495804183172e299,2.0953831348254437e299,3.261299289686093e299,2.5093571478729263e296,2.7570282679869263e299,1.862472386127214e299,9.59058083156698e299,4.695857003376186e299,3.1335179530681668e299,1.7017714588949118e299,8.435986232982319e298,1.5683075481914579e299,5.72069585966043e298,6.615279844294883e299,3.8792128522312e299,8.479218958530227e299,7.004825972526146e299,8.336402993063786e299,4.70482618602053e299,9.475815997151642e299,2.5554977317888485e299,8.284031871547877e299,3.1381029460146873e298,9.895980082557266e298,3.6449786442212154e299,4.5438469708514455e299,7.450585528938146e299,1.70247626126097e299,1.1460478415008302e299,1.091803546732134e299,4.075050282681192e299,6.584006315816505e298,4.795731824296913e299,5.629022894334602e299,3.1516569032843124e299,8.984939332805347e299,8.658165021053188e299,4.884053226138366e299,4.024216793314826e299,9.509272576950467e298,1.7650062097123634e299,3.317891030371556e298,3.6373051327983775e299,2.3529924488379817e299,8.078067548324956e299,1.878371605721624e299,5.465482587871009e299,3.073984032787428e299,9.338068963105616e299,1.6004281771699937e299,4.829894045455459e299,8.438743807197388e299,7.076350013753833e299,1.7047570693196957e298,4.2652580302146875e299,2.8238438734201366e299,9.995003363257694e298,4.9809354211374305e299,3.736421964959602e297,9.18372285458907e299,8.968363736460916e298,9.579126319367588e299,1.2823083499914091e299,6.932016863204626e299,6.535847976194664e298,7.85310530239094e298,6.472679593997252e299,9.348081522967432e299,1.040100364509108e299,8.533929835378149e299,7.38183201682109e299,6.661909592537958e299,9.051381433916062e299,1.1807359308541066e299,9.386130622321574e299,7.110526036825314e299,9.078805145265618e299,8.600027349709848e299,7.402184965539315e299,5.721893336976124e299,3.590653170897197e299,2.0321910243957888e299,4.76416614539797e299,9.11989928629756e299,4.4579703892091296e299,5.55043916312864e298,6.035020952210519e299,9.903698500101178e299,3.1207372147422077e299,9.971582105001446e299,8.060886072453368e299,3.0093710665884966e299,5.886913378680886e299,8.464239295493546e299,2.3398201526358687e299,2.340153227800601e298,1.5237318331104312e299,3.791729855763643e299,5.909317443736985e299,9.058008017194485e299,5.294370674487137e299,4.209861991295206e299,9.810594745045611e299,6.507007323968005e299,8.837006788231739e299,3.578356254006108e299,5.159032048964855e299,7.728603526266999e299,8.952452497013041e299,5.834504003170293e298,7.783032855124272e298,2.942199459212147e297,7.667452069698662e299,5.750047035015667e299,8.798920949772493e299,6.2700353296785496e299,3.113917902645074e299,2.982581998198005e299,5.1881784056526464e299,1.4615319560685681e299,6.2255824189012566e299,4.6201661089649015e299,6.452927967627207e299,8.919475733717434e299,2.1564631227270882e299,9.402746378516915e299,2.4534637364091675e298,2.714496827455364e299,4.4091050184107075e299,7.263698304863233e299,1.9411662190790435e299,6.485121195846078e299,9.862133139702767e299,8.95105795365057e299,8.042606119186158e298,8.010419219912424e299,4.957387202962476e299,7.508505756432412e299,2.0830604856670843e299,4.6546640766182844e299,6.818203453135372e299,2.7933870662810722e296,1.1221087432156174e299,6.931886331047944e299,2.1490103098991965e299,6.829281216579654e299,2.140563575934662e299,1.0279080576801381e298,1.3072928476597201e299,2.6576993872861843e299,7.029465543207027e299,5.053477490771329e299,2.1986959134598604e299,2.72844565405447e299,3.0364363051537005e298,3.542002735041503e299,3.902097229791595e299,6.425650720590163e299,9.371630649756085e299,1.463857857066806e299,7.944307712036538e299,7.79303559367035e299,2.87241977773395e299,8.305828578872129e299,7.520534407836039e299,1.3937271094133398e299,9.497972165556911e299,2.0930512499541265e299,6.330063118423577e299,7.275893115790137e299,6.306232500792968e299,1.4341520270983466e299,9.446078533936517e299,8.066492169642755e299,4.31041438707211e299,6.529179992268339e299,1.6079240935085815e299,3.1594468258320797e299,9.54457787776166e299,2.305055535593126e299,6.316993951559224e299,7.486880787437226e299,3.403109701465085e299,7.853859230843677e299,1.0583294891898643e299,7.72045189815355e299,6.4425428189854955e299,6.721268971570456e299,2.9236634646716056e299,9.163205221584786e299,4.271307925832263e299,7.777752112598105e299,9.425235935227041e299,5.278598186816184e299,3.79475450935315e299,2.5530937376486865e299,4.182740153560274e299,1.895377909775373e299,1.6580409293749832e299,8.641739676474479e299,5.677164025620375e299,7.891622387998571e299,5.468571588634376e299,4.874260988587415e299,9.375981566466155e299,4.494680277267142e299,5.037198785922787e299,2.139183630198076e299,8.179287454944927e299,7.792587176089124e299,5.951884956300969e299,8.690186792591523e299,8.990869038632245e299,1.972122687355893e298,6.686338636797077e299,6.46927135664335e299,1.0410201011998755e299,2.400514904779978e299,3.511143885931228e299,3.3052698101848133e299,5.339083241079438e299],"im2":[9.057923866292661,-6.924623473170439,3.9735878248188747,5.6354182009605065,-9.106300672253255,0.10501052235581732,4.073061909846135,2.9925838102766527,-0.46361027824478995,-4.783752254354394,7.163646117482301,1.0444506879172355,-3.265681726552801,0.41270882346018567,8.760086368866702,4.859865144419688,-9.656345610058901,-9.892165723854163,-4.506890983686729,6.863404780245457,6.269953055561505,3.836916356913388,1.7267513838857376,8.335299243899787,1.041518350040267,-5.026070897769124,5.693088730233383,9.401174941823257,-8.685913577149666,-5.114809256140525,-9.120540058879687,7.687605725135931,1.8412585210660737,2.974529346046131,5.238855951626853,-2.0936702286227993,-8.405135196147398,-4.94401085555517,1.1505384579967508,-4.01401441687534,-2.6132780744385675,7.54683606346925,4.42793880514129,1.042341437207707,-7.534296199712534,-8.03907286844408,-0.48624076294180973,7.242485212367985,-4.39026916473752,0.752696244988309,-5.128408487268703,2.167033296874667,-7.087880951747774,-2.745701205577449,6.721213692120596,-0.08281354475325564,-7.281157849184896,2.770780771905173,1.7820809826209878,7.246407126099143,8.208700677585053,1.733947273878444,-7.2560952387264095,5.779840302843866,-0.5486289030127711,1.799477047003215,2.455103818067405,-7.669110144290117,-8.375094782332953,1.613115556752014,3.3644568446617225,-2.192056119452106,-1.1547165812781692,5.347983281605108,-0.5337830068112943,-8.531569876986346,2.116038510045069,-5.833843360291389,8.517572811131036,2.3128925504505364,-2.9131632378547483,0.3122840891269245,8.02948053662293,2.248436799004349,-3.7755760668599354,1.2372890151149853,2.4706529950727685,5.586703512075442,4.237061423588081,3.1070484630779305,-8.350866176764724,-7.146628156240846,5.909093953442582,6.515785835325616,-1.4485404430905895,-6.118637021030429,-5.078515780261563,-0.6687397601443124,0.5163772589454023,-2.418572241491985,6.266774585857014,7.217873629674575,-6.530890621026117,-7.774677351505732,-6.80513229019545,-5.876093322986491,4.785798359570821,1.4565127229283625,5.391389571413017,-7.672550396344009,-5.750570422008449,1.3728707236916282,-3.2527257710570616,-7.9719964069356,5.0105634272233,7.6888210049292915,-5.465913729192713,-2.0546054924298467,-6.806802256424891,5.581632588229704,6.393037729515246,2.59075137667865,-0.11659971628198562,7.330215912810633,-8.514941228274607,3.6837308578690386,5.487260749404307,2.1515165968453296,1.9929490145319395,7.740489019595984,4.951187318042713,7.827838121336271,-0.6983382325942493,5.8849979443952485,1.6896576839602684,-5.122263383585093,-6.829383202971733,-9.707452927777737,-7.897541929442228,5.612589303453959,0.3829500229732403,-8.410561526381969,-5.236128315754957,4.664313826543413,0.21657815611704123,5.4940506450861974,4.442654088928226,-0.46458782947233956,-7.89622495555718,5.971387693500832,-8.689172679977146,-3.0769808263205256,-7.712921920856952,-2.3064784428419944,4.685642808909504,-3.842938285916235,-8.398643325422913,4.926558165571496,7.428232685054333,-6.92005438654582,-5.597978766376688,2.9146699065648836,-7.514565847063135,0.5447935474079291,2.2495363511566886,4.861703289355203,-6.537038914299334,-6.507927593514937,1.8731665396711499,8.494361552287643,9.31799439274932,-1.588704496802361,-8.47054063603631,-1.5447561877995533,2.775654325319586,-0.36307480496122935,-3.1964806383393984,-8.207378441622835,8.188362400333773,-7.215080834686978,-4.954309207578518,-2.0044962324693794,1.4846408602285663,-6.626055200462773,9.329367148599236,-5.737459330915103,-5.850547580320424,-8.444175986746815,-4.060744983820528,-4.26103528394739,-3.918419682020005,6.960947496892619,2.5658407553797407,-8.880415187802594,-2.77619579824667,-4.287230934362629,8.48275021366597,-8.984867814784591,4.352880530508585,-7.724194783212035,8.34612153697222,0.5358806840389789,-0.40335434460431685,4.157285048776441,4.977793497370904,5.365053583996584,2.83594859846783,1.4955476369799428,0.4353128160788966,-4.625398325663317,9.740718111083034,4.809438069308152,4.126116937058125,1.9521166797219873,-1.8977268736588737,-1.1955769706337538,-4.7990221851023325,5.05897904431076,1.6413829223426895,3.999565325316251,-6.710686818850265,2.5526961989956405,-7.010630316100532,0.2632728355494418,-1.9918845209855203,0.21133495628607335,-9.968277501633116,1.7724085484895813,-7.806292248676002,-6.494808430704097,-6.752797422752428,-9.495383448496863,0.43846371671508777,2.52570522222641,1.8862224199864954,-7.5419599559474,8.637384717425096,6.512259213656815,2.8424369376385723,-8.45230230855718,-8.572533132392374,2.2338104775643295,-3.237834988191974,2.7494363180611323,-8.624490967987521,5.259530239703045,-2.5176019793936337,-2.528397036068892,-1.3676435566676481,-4.9038419957956165,-2.741225303610541,-6.534302229427189,7.477439009389101,-0.3703862476676445,-3.201822403297834,7.769317938780816,0.5525535021020218,-1.2806252475216198,-2.2241565178606955,-7.10691571768733,7.972729830351678,0.7407375757068415,-3.994442713381357,9.873659445018845,1.2599628228981565,3.915511034663929,3.6042904086938243,-6.254889790642579,5.840801676634813,-8.418896753559753,6.902882303148612,6.228012683164891,-0.9050998092508618,7.411687530443569,6.6430071902757355,-0.6132874088140117,-8.438101743815253,5.762303861200049,0.7250158528736819,-7.687412134708442,4.340733892113509,0.6447956087024806,-9.00713152850383,0.20113508865563112,1.9116725951101508,5.76651656830591,-3.9657872008929225,-9.407958644400566,3.588299467654153,2.352541066075162,-5.964413074177058,5.856719247396537,-1.3910170697444215,9.752502360730432,4.386496808524578,7.928969575782009,2.7819774098141092,-6.858206420021416,7.694155622903494,-1.464111363373302,5.294990836645727,9.876354968564126,-9.352710934251522,-1.2396288325338052,7.359036122427419,5.709700011551105,-4.9159556531429205,1.7713895137428448,3.3635419893181826,1.3562810240493235,5.23168465150334,7.707104523024178,-2.5627530302771984,1.412050799646945,-0.6243932605309155,-2.1134304371204653,-8.964231373382734,-0.2101566272354063,-5.299128500520678,-4.864495705701741,5.411191015917407,6.582543022403009,5.413784888890472,-9.810897277192502,-7.394870665129034,3.301985261070193,-0.10571494167811224,-1.9803115865663194,3.875865462403251,-7.90430831815293,-4.582533384660379,2.390302744934818,6.002055819560951,-1.5871109190548598,3.1083761120935076,-2.3688375223626457,-5.140280572235376,-9.183781416213607,-6.573795406162737,4.086308693799914,7.529668407616047,4.025073598036226,-2.698804154486057,-0.7223376017405574,6.157260610211498,9.960216868792322,-9.879044437185481,-4.305824120164317,-4.581336959223341,-5.033853647622206,-1.1964779168782549,3.4753459723120077,-7.099904845960534,-7.19755304312053,9.503718223045471,-1.5893687004794792,4.740903980886188,-7.713885589559418,3.2611931299711383,-6.730187570131816,1.6681574689590128,6.960794662675408,9.042150062667144,-1.8193701582060626,-3.9316405466309146,3.7737395326527583,8.852416381023566,-1.9194741201915662,-4.7750278469479435,-3.352093843033364,-0.7820792776870782,-7.7876365407063215,-2.7260483820442927,-3.764650178826847,3.567791735759405,-0.4789996595311852,7.727962672089642,3.6263948607487944,9.537879136524356,7.802762096431184,-5.813486429117399,3.6929308087665795,-9.192981370983622,-9.053732321675197,4.254892279849887,-5.373704530429908,-5.868001782254146,-3.919533312849537,4.590475919600152,5.588384885749205,-5.460619950014099,5.9809315837316355,4.068395667201106,-6.590529296134006,-1.6760140565563049,-6.212955927357857,-5.781719489277791,-1.0243196085021111,-1.231558075719521,5.753789599714965,-4.173012003275003,7.643835106677855,-9.11100572296382,-8.496774572907492,-1.941912268148723,-8.916759947297743,6.91727271173583,4.246088688173213,-4.554956403278558,2.443761961416042,5.479758821467694,-6.180374888112765,-1.4259351807282776,-3.4141829893553766,9.90053540251705,5.404327547291125,-6.4444424624806995,-4.775829976959791,-5.0544034434641505,7.072245326407575,-6.502917905558245,4.475616731109431,5.361625051418869,0.5946799177762543,9.097303470480888,7.236505026670006,-5.690244606235655,4.4890398974819306,3.0807659503284075,9.401882981339472,9.054505341376139,-9.453686443399851,-2.6236396320268485,-6.535512288597438,-8.045235948440215,2.631669762559614,0.259548262375791,-4.373825607356618,9.349451247500927,9.977055542839302,-0.5574625859574418,-1.3738802558779497,-9.955908577929595,1.0555722255568316,4.058992428952914,-2.137057787706018,2.5458660574617387,-3.5380155899773857,-4.511664730187672,9.579180572025237,-4.046113252021383,2.2281822960973443,-4.0392939902914105,-5.412165625566412,5.622707316453772,-6.687146371943939,-3.411283360765598,2.870189852638312,3.604317774443233,-4.015633141673591,5.289397633370358,0.5812406392941192,-1.4915812968474729,-8.385835902028546,-2.490665003265324,-8.593749716179707,9.265578907786573,-9.502918807941201,7.026556694835008,-7.019775552068457,-9.468023307565689,-7.234700692897354,7.242873362943431,-8.729952702328907,-5.312485798015485,-8.203058078169857,1.0192691903209408,-8.74961590862166,-4.263724162593617,4.508587950613837,2.2620337689835086,2.404287327910639,-7.355797644331538,2.1381026602477,0.9325436470639037,2.946638427857934,2.844937025076611,0.9741568147388371,-8.97198533615271,-4.884363261694357,-2.6689842105051227,3.9324949474945115,-0.37632192345421345,4.063328470090211,2.11390907320113,0.17239086979195406,1.1706392378267552,-2.103013228858055,3.6766646311275117,4.099636784222993]} diff --git a/float64/base/div/test/fixtures/julia/real_component_scales.json b/float64/base/div/test/fixtures/julia/real_component_scales.json deleted file mode 100644 index fdb54171..00000000 --- a/float64/base/div/test/fixtures/julia/real_component_scales.json +++ /dev/null @@ -1 +0,0 @@ -{"re1":[5.5628392900573425e199,5.78039898717605e199,3.6033097299587777e199,6.493345774044879e199,4.287434653462461e199,4.184063826445872e198,9.23032718997384e199,8.701494594819193e199,1.5782656854239973e199,9.34720740356119e199,2.4378619966185276e199,9.720170126601884e199,6.623962708781628e199,5.422293738762669e199,4.1390820299144e199,9.4878010980071e199,3.37072334017411e199,7.852518844916644e199,8.268791905147304e199,5.2833734922814225e199,5.914766394366345e199,4.389455887792408e199,8.49691944425077e199,4.915105473697102e199,8.240811700648621e199,9.83540138877593e199,3.5238570039129325e199,4.75573838104485e199,7.133785365493953e199,7.20219200797705e199,4.928863531786347e199,7.688322523120248e199,1.0459179618283166e199,6.860897533870557e199,1.218932387587679e199,2.4567678305663766e199,2.3826503699685808e199,9.181677708402411e199,9.670970416765273e199,7.519561854710563e199,3.590514599591876e198,1.2374447478475436e199,1.5921718708661326e197,9.114330882882882e199,4.930982526531355e199,7.726349742915086e199,6.0486199409673564e199,1.6466210478913555e199,4.848301927923541e199,8.381554964083624e199,4.9781634907430594e199,9.508166942205865e199,1.6110470520482533e199,4.939772821220404e199,1.1392435708375337e198,3.0256518711313295e199,8.970749755995385e199,9.112306890725796e199,5.507310839977256e199,8.996743301002618e199,3.7259172894648762e199,5.801655840796215e199,4.628037523144353e199,4.509188929479118e199,6.167093620265344e199,6.191933785079899e199,7.170016145269399e199,6.229568247469401e199,7.693450019421034e199,3.0360790916049273e199,6.862507193214106e199,8.212175046546511e199,4.638533668657813e199,7.888679027305377e199,1.6488426150145052e199,2.2819931742935516e199,8.035464264261773e199,3.232426892975656e199,5.802648846855853e199,5.481343045951172e199,2.0570159923283613e199,6.583592520388947e199,1.7946025463057047e199,2.294569412665991e199,9.217602466669444e199,3.498547993296821e199,2.4692448332146677e199,3.4217058635606024e199,5.871427948037678e198,2.990376905248897e199,5.526976275564243e199,4.1436115379456796e198,1.5439526561070915e199,5.395649436534181e199,9.20331156085015e199,8.773333609006067e199,2.7750278508168122e199,5.239816821368801e199,9.063011413699172e199,8.59635563452063e199,7.868750393517089e199,6.096960016462231e199,6.029101905335559e199,3.8123963840261285e198,4.622259622504351e199,2.9017019450839562e199,6.135448628769276e199,6.64135651821455e199,6.811045422421699e199,5.266665205588977e199,2.4188024612626957e199,9.001733619643658e199,2.2636628671914227e199,2.954670627921766e199,5.961384670870748e199,5.5823803017685226e199,3.0586038281229022e199,2.0173717332472495e199,2.5471313318807173e199,6.054137185902708e198,9.459155703921135e199,8.694806533824936e199,7.821072250742745e199,9.746452504190554e199,6.548449103282948e199,4.985773078020158e199,4.4885569569595774e198,2.741545540751071e199,2.0920689579480744e199,2.2713916517407885e199,4.952317360465924e199,4.856740513439982e199,4.837783699755966e199,5.226229799677604e199,9.031816903522624e199,1.3600852260026164e198,9.529034418694631e199,7.205665737007299e199,1.2984532704366324e199,8.752629825023538e199,1.6917964647853512e199,3.744626837867574e199,6.048589186550057e199,3.959989576479536e199,1.9776215748413818e197,4.710676410813519e198,7.876178960208332e199,4.415996317163824e199,7.539122375066952e199,8.654162315940458e199,1.0048191610608447e199,7.1098344936847336e199,7.265215200693565e198,5.14031973137344e199,5.4938738445888315e199,1.8092517936018336e199,3.1258926296398e199,2.9316257404141567e198,8.753721527131372e199,3.3519923911587554e199,6.198063940424423e199,1.6764179673941214e199,3.964697612392416e199,9.804830281136254e199,8.553538210861927e199,6.953766116491688e199,7.144635805528109e199,9.31266515571548e199,5.221468574924647e199,6.949154262670009e199,8.640501206912531e199,6.145083128386457e199,3.039483151123804e199,1.7674913957862537e199,5.205095396486476e199,3.972114430594933e199,5.500662016370397e199,4.313250673657941e199,2.0151329970187468e199,3.451260602058592e198,4.660875984932121e199,8.495118752134481e199,5.988857164619392e199,7.368881232907618e199,7.145057606784198e199,6.603739857421181e199,9.273552352475327e199,5.414172328590383e199,4.718408165631287e199,2.3191590910518277e199,3.2111390272505125e199,5.571218816090306e199,8.86398825670019e199,5.033910726161228e198,7.486075090898032e199,9.95566949494093e199,7.567314173780035e199,1.1728605022523963e199,8.701516875088922e199,7.880519349706267e199,3.439051155873193e199,4.09138335287754e199,5.275677823893696e199,6.967755424512234e198,7.60648076586406e199,1.317079167316324e199,6.816239648387633e199,4.115613961778856e199,8.992041445035609e199,9.732203080863447e199,4.70522651249821e199,2.804449337386087e199,4.6897425648968695e199,7.1339462536268395e199,7.966986397660025e198,3.7910819612355115e199,2.355215148343447e199,1.128828284923078e199,1.916492817165909e199,3.26678877134976e199,5.204801199573657e199,4.650526643879572e199,2.05233327097871e199,9.3735825438864e199,5.765401002959181e199,7.223624396268075e199,6.293393787398756e199,1.2500544808918835e199,4.3046669364781505e199,7.70943128721415e199,6.395317343854893e199,2.7801559622702497e199,6.934099912258623e199,4.632675607168303e199,7.154472197604971e199,9.82900364213824e199,2.4602269945246668e199,1.8607967370960765e199,3.7762025404365863e199,1.7701417823613696e199,8.441895014093065e199,3.2003778024669625e199,3.994447381111504e199,8.645758903596265e199,4.968932541324061e199,9.092992979766059e199,5.5999367813931e199,5.120847741581423e199,8.552118071193468e199,4.531652139937473e199,2.9589643983575154e199,9.353050009268618e199,4.745273422766692e199,9.987517172916453e199,7.4770675683059325e199,1.793555827139176e199,3.745784039058787e199,3.597179597625173e199,8.351125006285068e199,4.123782946559515e199,3.6946795414103174e198,4.320896075150582e199,6.681311997039876e199,1.4745757515492053e199,1.1057133103896544e199,3.7446516945700492e199,8.912248548258061e199,7.008569373125849e199,3.816441542109814e199,1.0683066872024294e199,6.8481426526263166e199,8.650904631488531e199,4.84596644683547e198,2.329984956142672e197,4.810970543279441e199,2.894011561061557e199,8.453973310800797e199,3.7235771753739454e199,9.129896484602966e199,5.032997379008927e199,2.3399605189771075e199,5.6786977305186616e199,9.208647211969598e199,2.104242766689616e199,6.585652918298931e199,9.856407270728322e199,7.761287084803065e199,9.92703219729344e198,5.2296985365642644e199,4.753502804880987e199,1.06317512904451e199,6.772270250498745e199,1.5127508029335923e199,8.746147595299403e198,5.36806439955643e199,7.922181470411635e199,7.673770918837516e199,1.213473835793255e199,6.460675759715182e199,8.031574552820433e199,7.67439406353717e199,7.893187784567548e199,5.71042006197923e199,1.4393515774028297e199,2.3766781534637593e199,5.26900117807304e199,9.287904248106409e199,6.410210427515843e199,4.908966900035997e199,2.9773528963650964e199,5.351503755463948e199,8.07338445294337e199,8.455717928188626e199,4.841973076845667e199,5.123235505562005e199,5.216416014780855e199,6.969677375449701e198,6.179784637261328e199,9.324586522794293e199,6.914204272971369e198,5.455045946015511e199,9.04852674351202e199,4.8903489738740165e199,8.445389750179987e198,9.416824270932604e199,6.064731692272709e199,5.643298365158691e199,5.354956687209845e199,8.02917529590851e199,2.1543722733175394e199,3.3280116707730854e199,6.434931200021476e198,3.357878502340188e199,3.885986547959988e199,9.191812605088374e199,9.816131858602501e199,7.619274507687759e199,6.384198563544997e199,9.902461532378334e199,6.973697182605814e199,6.192727647455809e199,8.143442096058223e199,6.725858848373397e199,3.432724606749249e199,2.66447352001969e199,4.436392560743674e199,4.0228798703741804e199,2.5852849764435103e199,3.622437121087352e199,2.7071068136243714e198,4.866008983572741e199,8.406313600767618e199,5.026007857009471e199,3.820563595131355e199,4.74568495268428e199,2.909866928866972e199,4.700255398653041e198,5.080921262447805e199,3.991592701435403e199,6.104154506993441e199,5.444181689994796e199,1.3341142083549517e199,8.947351778542392e199,5.031361064532076e199,6.802695420601817e199,7.304711732721654e199,6.42368324796334e199,4.689421239847454e199,3.861347657786341e199,2.611735162388087e199,8.527851626181293e198,3.5243517397894354e199,1.93984413856342e199,1.3883964407920868e199,5.78824891865023e199,2.9748251503885247e199,8.683853776602817e199,4.8927982925296945e199,9.997090868546525e199,1.0058326484614299e199,7.74617311401095e199,5.3364813258997e197,5.3896498147860995e199,9.674887175085177e199,5.296871435915264e199,4.276999865674995e199,2.4037614964634824e199,6.2950039372523805e199,9.947351309711552e199,2.4042715517314393e199,3.881696344372495e199,8.95406564679706e198,6.3401906773613735e199,3.6657102568912126e199,6.7463382992528755e199,6.940154493658706e199,9.456226562519957e199,1.169017182884794e199,4.341138697811796e199,4.618055780600122e199,7.812429087545842e199,9.159420073702612e199,1.5591530165521405e199,9.418096943591626e199,1.431693180015462e199,6.375544432668424e199,6.614373327208226e199,3.393798632561865e199,8.004736553782318e199,6.946191500918994e199,6.753366664528028e199,8.080844065396556e199,5.646423895515154e199,4.042934428808695e199,8.9749350261125e199,6.625668355056232e199,9.98065069348009e199,5.0444664518990865e199,5.901243438334323e199,8.341966291538439e199,6.117653782889826e199,3.7914771242920065e199,4.300383831431076e198,9.62387757664761e199,6.564913267632528e199,3.683019862458956e199,7.45311387720911e199,3.1844209613575866e199,9.688777338537762e199,2.1231334913031084e197,2.5925840238390997e199,6.934295022949777e198,5.445698566954279e199,3.863166539325734e199,2.300134985020412e199,8.187437880576801e199,8.83440064172616e199,8.038096415134206e199,5.3770497073164646e199,8.99691638814882e199,2.7539340595622663e199,9.979500686764847e199,4.3545687835767844e198,7.924326460088182e198,2.192719952985419e199,9.4004346531431e199,1.722422551600361e199,9.26886759227119e197,3.9087514218359404e199,8.307682882362718e199,9.70639032368991e199,4.6402974909853343e198,6.11758684743402e198,1.4472033070669243e199,5.2700775142469364e199,7.066573368019779e198,4.2053209989127536e198,5.231776573614167e199,5.103290214388256e198,8.823274515270078e199,2.6035793657290974e199,2.1633265906331465e199,3.847731190222795e199,1.0009807599133323e199,5.247094332499384e199,4.721131753649895e199,4.407469662348928e199,1.8636766775891332e199,9.6705876712395e199,5.693676505263136e199,4.662411295140136e199,8.673956701926827e199,7.885647652532183e199,4.904504194652478e199,5.639887753159892e199,4.789350066059783e198,3.6030731030913966e199,3.4981928291712128e199,8.776997932297422e199,4.5859127465986193e198,6.747560946615018e199,1.3957129316222616e199,1.912771729839191e198,2.639985492269574e199,5.620435939994985e199,4.278516631278939e199,7.892112528032828e199,5.227544769157074e199,8.688884978932054e199,7.178949661103239e199,3.323585485006354e199,9.834406211260725e199,1.9304419391970805e198,2.8159945670002993e199,3.5582849295486916e199,6.314357494093936e199,4.845635010922042e199,7.131738510918369e199,7.949532062284387e199,9.293266004074559e199],"im1":[4.866377659373946,9.433587587175385,-8.366532603399977,-3.0255377696451973,-6.7097262840402365,-3.7568997952507077,5.472590135306765,-4.346142014983316,6.105402468108082,3.7234988647800087,5.4623200568102614,-9.95563922256954,-1.0571614483667435,-8.588323581383793,-2.324663278538215,9.781525568737433,-4.709734926529421,4.496976497883818,8.57945526080777,8.902044452246617,-2.371880720570985,7.866115996257889,4.523122086493066,4.734216476494124,8.200083517774111,-6.775364536612898,2.4273791149967483,-4.655471542992582,3.926765409689372,-8.154950333234574,3.1980674685504873,0.672518464922188,8.460819684753659,-8.14375148235002,-3.477820823373139,-6.453759009300642,-6.081433698961676,-9.387607027987714,0.9927922490061452,4.492771835462332,-1.015123028349409,-0.9572768923322634,-3.835228649190361,5.443251940344808,5.4280827551088535,-4.768714030202082,0.5477104223979516,-4.397541040591896,2.2546093283885487,5.058621416065181,-2.4360944692551882,8.869164822830594,6.51779678612424,-9.428663465352756,-6.041175707205553,-6.251819653207282,3.2338197345797575,-0.9470301687270304,0.7008600056701493,6.899777716948812,4.166540118285024,3.0864231731841194,-2.641383107468087,-4.454248152258755,-0.6456559727738096,-2.650591610419739,-5.6141634358955645,5.4870708271851125,6.3771183389259924,8.129077945338569,8.58270105227298,7.605164543529167,5.180218778484596,7.450723559604743,0.06092069236530939,-9.569483689890761,-4.539385136249388,5.419937502040398,-8.468672912894625,0.5951855295827873,1.3034008266108934,-6.436298202330038,1.4217974451621131,8.534456080885192,-9.041279497093303,-6.468381012410078,-8.166178512411221,9.334115001891039,-7.33071720666119,-9.3160353266677,7.728085939211521,9.958023522458205,-8.936968699579896,4.547461235271847,-1.59786093786866,4.74808884985354,-8.7367758745898,1.4057177804596215,7.799406073780851,0.5744933372258316,-8.332924338001991,7.493058288938489,-6.762098761441655,8.091783128892608,6.54235104236983,7.279588132973661,-8.601906902562718,-0.04625221645096289,6.344668182854946,-9.243987586559513,6.83278447186159,-7.838058896007551,9.064699054992825,-1.4020280126192084,5.9201484883642586,-6.255230644960774,-9.369983571537839,-3.6870614231985126,-9.4370180263879,8.20974082220857,-5.402265576561414,-5.42825321911616,4.158635510572905,-1.3860926067864021,-6.8372217183608335,8.469680589084973,-4.50026166893859,5.545913652500488,-3.5175502616983962,9.162516050343733,0.25562469338467153,5.929827197878597,4.4792991258497885,5.756028174590552,-5.967838285152219,4.046688042569766,-0.7065667592582159,-0.3195811073187542,-2.19804396305761,-5.960428984114101,7.017916810335787,5.6114835101337395,-9.228385212905954,9.896003173073641,0.4670844701670269,-7.889328596635822,3.3889406191489986,-8.889474455802105,2.9875338288215794,-7.3893522496370405,-4.1070658228208785,-9.119581546313718,8.827855013565966,3.121446213419608,1.7989042493569194,2.336595628587144,-0.6691683399317618,-8.369328979680946,5.935516584203295,4.263626360871573,-2.892376610335785,9.438551465052697,4.133709079975876,-2.923263368329092,-3.4456765775077924,2.488192609357654,2.8144586820367845,0.9751367237235904,9.813080181878302,-0.23940885708678294,3.5518484358194513,6.965830442085977,5.52037509532232,8.03150687059141,-3.9097693429588904,5.304518067349468,-7.280843615503958,1.0082280738642435,8.948091364861313,-3.0607681753318765,-9.339011264333351,0.027668297825901078,2.440414819488998,2.0628587117900725,7.586772921815264,-0.5246260320328808,8.781145368440448,-6.383839771529338,6.273802874586657,1.7695821432666055,-4.952019668182852,2.6975209752174685,-0.3227895713429305,8.52967796528344,-8.713206704285373,8.26101519108893,-5.2984106523711,-5.919031184708265,3.798264340406144,2.5754948330250134,5.912788373019598,2.0577673658735645,-0.7781561749620263,9.952869408414692,-6.046315719011166,7.043856997032606,9.846237574328732,-2.1356967148350385,-2.2383879398891278,3.5815847360577457,-2.5219699820648733,-3.6046212402630573,3.8810680867959224,5.6208127863106085,0.8648636520020645,-8.828631957467547,-4.925556979030812,-7.493894540345067,-5.81620282591669,-0.20085656242673977,-0.10661554280586927,1.365503539264541,6.458488457713308,-5.773923213432967,1.2759322739041163,-8.504143194815018,-1.0762382098804935,0.987131802945564,8.399473683963365,5.47455135459721,1.2644782546434605,-0.756924766511835,2.7368781801423268,-7.884819374063731,-7.690336047156063,-6.527067430563869,8.2016583671493,9.391477550085416,8.00068944886511,2.008479397094833,-4.669264593986653,-7.195854533341127,9.879764858359344,4.513667981375654,3.5248518748955693,9.947333062957242,-4.790843918532721,0.8208910265094378,2.402446293157583,-0.5844893386905028,6.901495893102684,-1.3769848834770997,-0.38184800484622095,-9.05124062315248,6.789000567022413,-4.044132008906198,-2.413764486904828,3.509956292304601,7.478000214652095,-4.240364180985892,6.587474225931921,-1.3928123826522736,0.6977828485058559,8.185140308852791,7.857405792389702,-7.989634900254552,-4.2346017955877,4.082648580857285,8.247160191066996,4.233337050336406,6.135141208470692,9.354052558936,-6.651559710958375,6.241230929267182,-8.26555885933539,-6.356064341298291,9.92295880869829,7.157652504524165,6.004107305172781,-1.0929631422287027,2.0594255872995664,-6.496794916697599,-9.164070866258607,-7.975911543488019,-5.221018557310478,9.781304184958863,-3.45686670985258,-3.0165690589724026,3.4545944678990015,1.6239997301573599,-6.394247111157901,-1.1590583908151046,7.697041154263026,-6.069853546089221,-3.495361214155639,-0.3721074075278157,-1.892988475656896,-4.610117452122675,3.747680453495816,4.616716229027613,3.6823966720052006,-9.092831026306548,-6.38648011614412,2.354541817328206,5.395991920427573,7.155588881524679,-5.217924864963961,-7.851690124021095,-5.65101635192546,-3.0696868424981982,-8.829586178401861,-3.041084185833025,7.659846711002459,1.1279805853325655,0.9487520574526727,-5.929330255464578,-3.2834964659633004,9.019069108942798,0.19737696338593835,-9.421810990043012,5.236672933629446,5.2301906542248915,-7.441954514020333,8.68431556282803,7.559525181790079,0.4568721696693867,1.0568282257194639,1.7884082726712887,8.031933316539288,5.422339804569869,6.135867381130343,9.58252535171836,-4.861449419641741,-1.1877648759960717,5.455646870606694,7.895471127651604,-0.8745071980606482,-4.8061560511275925,-0.1562992167938333,3.817804120943329,1.8096822264934325,-9.903881725401957,-3.1765535565546044,-2.897577880143574,6.16151903069078,-3.9473800843337763,1.1320858943831258,5.760785714986351,-2.1296944802540008,8.919926509132178,6.954364796702787,-2.3537608781274884,-6.367898698058112,-1.595764514534201,-5.599349095374373,-4.648997537475658,-7.92600056374849,-3.260230780417956,0.38762096411758584,4.151919194181504,-3.377330060561583,-0.018295218363949317,1.9793572842797111,8.188985031409633,-8.371786422352018,-4.791642185017883,6.093365526908304,-8.02958365447016,-7.878102818610799,1.8803232593399777,1.303905241406028,0.23491669680104366,0.10950459179116301,-6.1991825123445565,-9.849316875282984,-7.167558536430068,2.677674267823333,0.27500758463407493,-2.968184431181136,7.87919860117222,2.4426112658905392,3.4784919999780364,5.449579371683198,-0.7824147998841031,-5.370343507489026,0.4454684464429022,6.355241764224338,-6.982061390022913,-1.7577471900730544,-4.7570099604208815,6.965776590334556,-6.734263849037003,-6.740510250924226,-5.158442780452002,-3.1450038774544513,-8.896342045504952,8.868170130642326,-6.651185525017585,-4.1667223077206295,-2.976325547649054,0.026214459083744757,-7.8361545174699465,-3.610126724886264,9.934082465670716,-2.869384682389864,-9.426155618474972,-8.955143490959248,-4.421928349077875,-4.700808890864532,2.140231598909919,-2.7700466725003103,-6.538861986770048,-6.346448250090058,1.8722748074214515,7.940890171849247,7.565791597150412,3.230031515895263,-4.801694865579973,9.732161603271873,-9.623295850132285,0.6621712188289823,-0.7883451703550826,0.2475000083995198,9.685289493896782,-1.96362445901695,8.12454354625547,-8.214780113553037,6.16197054582387,5.537478968442324,9.990214275450437,4.407929897501122,6.034549480178949,-0.30323011563739755,-7.321042672640258,-3.5624086047002335,-4.436652169433042,6.648419026430183,-3.895850621156203,-3.8532616829870676,3.7143586143081073,1.5125542612443503,-0.8260057076748577,-5.984208273754472,-1.485099105640213,2.4153678716895755,5.119761575850951,9.209429366284212,4.824309250925969,-6.946610080172211,-2.876123707514447,4.904438603001498,-6.7991390931579705,-9.357371619240848,2.669940458906554,-1.807568819389795,0.7405946261633023,9.88691015769248,-4.566920234175644,4.841497378921407,8.302372947091495,-1.3843516560920008,5.424563849835128,8.276681223204672,-1.253679523927886,7.4649353669382705,-7.27128908277119,-7.156030806626921,-6.27568603474754,6.104791550730543,4.586087261511748,5.522627981493608,-2.8178117398318054,9.798604059157654,6.2076221288719005,6.123013412849218,6.158591377212737,-9.628611250484603,5.267134687990978,5.2481972225707665,2.881728080339691,4.687976323212622,-8.20184557245409,-5.700444485429498,8.494065219920923,7.855335040284178,-1.0183654689523678,2.4291631225643293,-7.2779913572848205,-0.9391979325143645,1.957607233565346,8.149904985831967,3.745116887697913,6.771216762955209,-2.017394597468501,-4.483385576391374,1.826103052765049,-9.558725365334894,-3.2633871393565395,9.410948495958571,6.167907352315812],"qim":[-3.357182392208598e199,-7.908891796924761e198,-4.866520957920371e198,-7.698413344943914e198,1.922522464991547e199,5.219956249240213e197,-1.4451935640883037e199,5.812696688972851e199,-2.063495051999722e198,1.8078643321472892e199,-3.062610469337666e198,-1.0666301133522117e199,-6.932346207115122e198,1.8560449501535832e199,-6.031004785797042e198,3.1755564625124047e199,3.587130685784693e199,-1.6111570120163664e199,5.064546345995192e199,-2.3491260348546345e199,6.505768275803787e198,4.653669327728792e198,1.1471191830004637e199,-8.549921616963502e199,-4.142046351676262e199,-4.9792900432682465e199,5.0163197783018936e200,2.7694541185654985e199,1.128174372562358e199,-7.820744264918683e200,1.932064542212771e199,1.5983406480705553e199,-1.0746541936074816e198,1.6466843821788698e199,-1.9773785020804176e198,6.687447141248851e198,3.4648669734261653e198,-2.56567387832689e199,2.369575729148489e199,1.0221792932936302e200,-1.1704099177917865e199,-2.481135318845284e198,2.3868990724147045e196,-1.243437629420058e199,-5.019762892659754e199,-2.203152321165891e199,-3.1063495135051914e199,-3.500013739948055e198,8.16623163170206e198,1.0755354532772333e199,-8.204318802391394e198,-1.3210043323120304e199,-4.915097758196483e198,-8.631044125199547e198,1.2672008853940524e197,-8.083556358334118e198,3.895506916918939e199,4.001705442897981e199,-1.4271120324791558e199,-9.064538225063091e198,-4.131193829533326e198,-6.343502184297156e198,-6.358003264542746e198,-7.717085262249783e198,7.798665531096978e199,4.645045673091112e199,1.1262118842014243e199,-6.771486858701156e198,1.5553188536248768e199,-8.119118791581663e198,-6.532946252290336e199,-1.193130482511109e199,1.0090488793292346e200,-3.4941169734125998e199,-2.502402366451586e198,7.040942699456949e198,-9.131633814019389e198,2.4018086624480303e200,2.1331453700615388e199,-1.6721716322277312e199,-2.574453099771683e198,-1.758988102481274e200,-2.4591650524046314e198,3.4386672763989655e198,-2.535377874871538e199,6.848904398891268e198,9.51004359711545e198,5.172463821121285e198,1.7595693574786486e198,-3.5573615098975846e199,-3.6387100095351694e199,-1.0074733118595682e198,-1.7132281526113446e198,-5.817589846136758e198,2.2958884710180167e199,-1.4172687577346177e199,-3.851312317907869e198,-7.61056747092688e198,2.368811062036947e199,1.2984463734960474e200,2.5847656441129783e199,1.5426343971807466e199,-5.3717045099828e199,2.587825822892591e198,4.701575810321786e198,1.5858445378810898e199,9.101070629889869e198,1.9553225187699077e199,1.4817908933094928e199,-8.711169591224783e199,-5.290371115352676e198,9.193588325902357e198,-7.121352736342138e198,-1.7983274186039736e199,-1.3685252034779811e199,6.594890550723294e198,-3.268194132286805e198,-3.1456437599920914e198,9.08889772685129e198,-5.906477709114375e198,1.6755018998050585e199,1.1945877699990584e199,1.2874684422541009e199,-1.3942028335359162e199,-1.1135216313061078e199,-6.399684215272981e198,5.982630980056143e197,2.9636229574842096e199,5.783416759936243e198,-2.7195795838100663e198,5.414194389001263e198,5.394704152119254e198,3.438815867548259e199,-5.955541967475227e198,1.9956543864569406e199,-2.5955999903309723e197,1.2502267579722523e199,1.0885564742530188e199,2.869566541931917e198,-3.3238711736131543e199,-1.7872051071355264e198,-6.302297933788003e198,1.210622871951811e199,-1.277912743289556e199,-6.768054988475576e196,1.546601467444599e198,-7.114096010478158e199,-1.4659365275644844e199,-1.2761938185438484e199,1.6206688502943645e200,3.619285715369185e198,2.2611170532056793e199,1.6948187211122456e198,1.8777485750984204e199,2.2228663749447397e199,3.2247276272804797e198,-5.185764591243453e198,-2.96696448012062e197,-3.4761292691671917e199,-7.983800932908801e198,-5.311212412582144e199,-2.992235514913158e198,1.88563477362778e199,2.0888158943967824e199,-1.0049999428104326e199,7.413307471347136e198,-1.1802037435421013e199,-1.8925016881496583e199,2.642541279800953e199,-2.5649571680915183e199,-2.8014058292532212e199,6.730196137573296e198,2.3238589594126403e200,3.380841428229702e198,7.477865919720744e198,-3.9840035686337805e198,3.001529343808087e199,-4.804009730356301e198,1.1053557577035587e199,9.465472108225956e197,-6.546448673435167e198,-1.2605537911575456e200,7.866154764006898e198,-1.9058444808372659e199,-9.638910597934074e198,-8.12619890992452e199,1.9964267057291584e200,-7.793137333730687e198,-9.146475929839095e198,-2.4958548545802514e200,-5.200209133457428e198,9.957935681148713e198,-1.7181039271151995e199,-7.254227335637327e197,1.6397465670916545e199,-6.887021690701005e199,2.377767068963902e199,1.4751106209165845e198,1.4279329814242033e199,-8.245217837053935e198,1.475012261278152e199,4.179835780898563e198,1.1693546781527595e199,7.301613985716259e197,1.984733210400749e200,-3.331339737564479e198,-1.1806726449609306e199,4.393312389433267e198,-5.329814999359538e199,1.2045299923220367e199,5.262464699301154e198,1.9557452853524494e199,-6.574215716336722e198,9.114917825749296e198,-1.718593890827847e198,-6.272136562123314e198,-1.1214824740818345e199,4.990458186502429e198,2.204151437706873e199,5.156912672377184e198,7.289162392771327e198,3.93950004427981e199,-2.061958329884562e198,2.2746424108661365e199,-1.2940920002168414e200,-8.826689505218424e198,1.8959509178045392e199,-1.2744602536440304e199,-1.13873200990559e200,1.2393271650351403e199,3.6487818868357135e199,1.3129665935447705e199,1.665426235281785e199,6.753028348730927e198,-1.4587297997062601e199,1.2534293164347517e199,-4.0425269754979906e198,-8.78569191900222e199,2.0570826815889477e199,-2.573449139239307e198,8.919923594674239e198,-8.310522063859082e198,-9.925445129872359e199,5.360486390549316e199,3.0027438568130595e200,8.136475039391945e199,1.5665199830873034e199,-4.626202814955132e199,5.4719726212630445e199,1.458425933631671e199,3.913057130515436e198,-9.75753662994674e198,1.3038883112313045e199,1.6303753533537867e200,-3.264926264728303e199,2.6114204945452975e198,4.135121394054702e198,-9.221796394234403e198,-1.742009489692381e200,5.537295881931846e198,1.0846702161177465e198,-6.036163837442948e198,2.1192042536120735e199,1.7535294929284728e198,6.443967588015373e198,6.328169219145669e198,2.3361803263511995e199,2.8537766608584056e200,2.2595582364324973e199,1.3898657574176798e198,-4.248623011861975e199,1.9629806889515185e199,-6.707548872067765e197,-8.019320995454683e196,-7.725785635467236e198,7.621669074483993e198,-5.499655117970538e199,6.178653448506993e198,-1.5998815793067432e199,-1.4962290271657137e199,-4.109558430841477e198,6.295906626008482e198,1.7343991205202735e199,3.728460297157894e198,-1.7183799765730251e199,-1.507103009631508e199,9.70490748915373e198,-1.565568638834384e198,-9.90196174731589e198,9.983471292274015e199,1.0929330402932624e198,-9.98721154701376e198,-4.074256490455755e198,-8.811723599707789e197,-5.780938807376189e198,-1.4267811376994434e199,1.3528939893532488e199,1.84208157163724e198,2.2054922226544447e200,1.3187216444497662e199,-1.866176574685891e199,3.0193506769296176e200,-1.465234628036882e200,2.2275602496217858e198,-8.399273929880886e198,9.472990074676044e199,1.127111553111777e199,2.057105739310495e199,-6.75425228837939e198,-4.4522471180272955e200,-6.008573143309626e198,1.9754470855975265e199,1.1134716315771856e199,1.4163049865629763e199,-1.5435084700482233e199,-1.098667391216003e199,2.1279812164268953e198,7.861823274239872e199,1.440774217428944e199,-1.3617331746591099e198,9.281320549292466e198,-1.763044311918765e199,9.798166253954877e198,-1.25106878118437e198,4.1742811731692234e199,7.935546590353458e199,-8.940414669674622e198,1.5830802409710497e199,-1.0263188775341758e199,-4.050615433683471e198,1.0339598163170638e199,-1.0760357390262838e198,3.6404748700110403e198,6.630042013453883e198,9.396995676998699e198,3.4332300626601653e199,9.643539670268463e199,9.764394622763574e198,-1.189980466350407e200,3.784555123418849e199,6.701945784763691e198,-5.065347629851163e199,-1.8831901853444465e199,1.1937733517950163e199,2.8931158373917384e198,6.652662195456408e198,4.352525281699607e198,-5.770053607394037e198,-1.4472854215394276e199,-5.866961452042817e197,-6.466853324633674e198,3.6602992382349092e199,-1.4828419915448797e199,4.858090111220131e198,1.0062148995668561e200,-9.0345366929656e198,-6.023114360435e197,1.3315389978072134e199,6.958326430036174e198,1.0733450326995064e199,-2.8350027534373975e199,-1.524996081955213e198,2.3131187074244253e199,9.21911907279486e198,2.3962459868522532e199,-3.143815174531152e199,-2.548192068116284e199,1.0720251547054963e199,-5.159553947768137e198,8.040026438419304e198,-1.1258443117813363e198,-4.816325906257434e198,-2.1231503837712198e198,-2.4649432099800273e198,2.690264589257521e199,5.60690467139467e199,-1.0753251131969398e199,1.8543434794892788e199,1.2083961805665597e199,-3.642130000880971e198,-4.210526256913687e199,6.251024960125207e196,1.2590549139013057e199,1.5338002579659737e199,2.3185065622125523e199,7.045783327927512e198,7.040548978300972e198,-2.7659683823115733e199,-3.4673562695600047e199,-3.970062402210161e198,-4.5323906733270595e198,-1.6967844826757423e198,-6.170386174845137e199,3.7813094711058847e198,-1.3067229295376312e199,-2.398461017013758e199,-1.040550442215867e199,1.3808761890432817e198,2.083307966366433e199,-3.054490396117452e199,1.1546550733959326e199,1.0805417765106573e199,-4.2354585406902947e198,1.391866245359519e199,-4.1069509924272634e200,-8.902760373228365e198,1.005079882303293e199,6.394748374639741e198,3.296535360178782e199,-7.019394040933645e198,-1.7357631510344326e199,-3.401294389025734e199,1.9819153419686763e200,1.560910447716674e199,-1.2013419170078694e199,-1.1399369887045407e199,-3.4673878955021324e199,5.658120158195747e198,-1.8687991445208867e199,-2.2761444204042903e199,1.629569584308309e199,-1.3069239936489153e199,9.573676336052866e197,-4.894240181403616e200,-2.8015066163034944e199,5.398801500802579e198,2.3634982066406733e199,1.1241128648690474e199,-9.756556803423685e198,-2.701505434653012e196,6.921389001584778e198,-2.908167525212213e198,9.699236396951085e198,-6.047011830278154e198,9.111444280668802e198,4.679267483074928e199,6.538735486010409e199,2.634839863045168e199,8.470825282186169e198,-1.7408260588106733e199,-3.094821054673857e198,6.639826322987165e199,-6.990012003244023e197,1.4937938978561796e198,-2.713140131952192e199,-1.3489443034779637e199,1.3505757653329303e199,-5.690031513148127e197,7.033203552033566e198,1.8655260661099378e199,5.879908514911684e199,-9.01308637692402e197,4.864841179902866e198,-7.929098306294447e198,-3.8803034236953795e199,-5.189190869352882e198,-9.955389564886535e197,-5.505542026388041e198,-6.01620261938616e197,-2.6889108796511963e199,9.573804252983048e198,2.523641127059022e198,8.500193635571115e198,-1.1311193446175256e198,-8.949975337236439e198,-2.6135176373120644e199,-8.12119876246866e198,2.893421100619173e198,1.111942202473816e199,1.0102015342605797e199,8.730187658717983e198,2.532985919180136e199,-1.0536794519382453e199,-5.731424896314723e198,2.729295416140653e200,-1.2936425243586821e198,8.618772408789814e198,1.6784494607890727e199,2.022837136076055e199,-8.792523344481157e198,8.919043863316472e199,-1.8002646775633035e198,2.1280158546201785e197,1.580710539812333e199,7.354446121912858e198,3.16066992137022e199,-8.493355514552519e198,-5.350105241170267e198,2.285703213499173e199,-7.55459299267905e198,3.852305774057929e198,2.4990428112396845e200,-3.8542092874952483e197,5.19634985539304e198,5.541435880810259e198,6.71570370986478e198,1.2999083769602559e199,-2.996616900049349e199,-3.4131231299629413e199,1.3851370822010141e199],"qre":[1.2066380194946013e99,2.6633261000576556e97,4.589570016273541e97,6.2742117541557446e97,2.9661421351673215e98,2.9546610225362766e96,1.8983527159317995e98,1.0036365857451955e99,6.67138706086747e96,7.752271052392686e97,4.571570703826788e96,1.0307344215182146e98,5.4129997429109705e97,5.6231994860339755e97,7.91844620370871e97,2.895168511015589e98,2.7380700545168586e99,2.9679238280243073e98,3.0442497403072727e99,1.9545005192197532e98,6.701093481602585e97,3.684034197390559e97,4.423025324688015e97,5.517377394406676e99,6.557899245307104e98,2.22869084910674e99,6.528824716936505e101,1.0799135714403683e99,7.002548008395537e97,2.934042848644618e100,4.7930234347076035e98,1.4946411781525024e98,9.786925012775168e95,3.328434718269303e98,7.875648833934828e96,1.279129735349156e98,4.1338052015247726e97,4.201390964451957e97,3.522870326421296e98,2.9484050890040807e99,1.937466370961681e99,2.89719504402094e97,2.974258324419385e95,8.131800407003433e97,3.690380015771336e99,5.910455610134204e98,1.814098296527403e98,9.14873550125086e96,1.1199840185640209e98,1.1303749165165543e98,2.55124612389468e97,1.8002728149478404e98,1.4245443849680133e98,1.3377898370570009e98,6.262375845374192e95,1.7432870022401667e98,1.4010459046413298e99,1.535409491762906e99,7.107886442930358e97,8.004466376274506e97,2.2130876939919234e97,3.8218606157037896e97,7.363383940964121e97,5.124381177405298e97,7.458840300510092e99,1.7865215645860366e99,1.4047670638985936e98,5.0185373064192125e97,1.2902261345469321e98,5.3411006977270055e96,4.703818130723036e99,1.1367756106432575e98,1.53457853778489e100,4.2751824890509837e98,2.9291572659297127e97,2.081968839436454e98,1.0227519023730196e98,1.1301511846567334e101,7.385564414453103e98,3.144854386264566e98,2.832499341010407e97,8.289101684479004e99,3.2395558633775582e97,2.2199104830792873e97,2.4605020521879166e98,7.992288778840706e97,1.780323340364156e98,5.6751374586131135e97,2.4713958783680727e97,3.94419784296996e99,2.053004427060166e99,1.1491675564297355e97,1.4903991624158528e97,4.125129016571331e97,3.420464966241176e98,1.9653432364492174e98,5.2409212819572616e97,1.0263563482104606e98,1.1879331556559104e98,1.8579723957223468e100,3.266427179295732e98,1.6724544372910076e98,1.0891934956345665e98,1.6910848997272836e98,1.7753058483843954e97,9.102338991999758e96,9.291362272877695e97,2.2362251956079408e97,3.0697680237437384e98,1.1094541909992555e100,1.0605675737971356e98,7.194985978893117e96,2.068382275455093e98,2.8799497627142623e98,6.178116386293888e97,2.4574872564816648e97,1.3574246151611864e97,2.7410170286257214e97,1.7220082753995632e98,1.3532654032807846e98,6.706326577655794e97,8.533603031082702e97,1.1662292816125787e98,3.453224261102279e97,3.18566592920084e97,7.626175307876687e97,2.914528152566282e95,1.6573207329217866e99,7.608926708169212e97,1.689896608368876e97,1.955711444867827e97,3.442384858622184e96,9.091816851283023e98,3.58607487911309e97,4.458775733081282e97,2.5497266677265907e96,6.413624296428024e97,3.970441048636387e97,5.023577475433796e96,3.981683706223561e98,8.042088991881076e96,3.627554189984473e97,6.094225911514172e97,8.792100384865747e97,1.9320999857598847e96,8.199855513667936e96,3.272983494936223e99,2.9659320597958695e98,1.1335512571701428e98,1.956144859203878e100,1.5492557832955152e97,1.1339921439719095e98,3.583781080416763e97,8.077604155234823e97,2.7445889358566053e98,3.500282809595313e97,3.874579837306522e97,2.1811939769755743e96,3.419724812788564e98,9.50418013270416e97,2.5764752406400387e99,1.9697112540356005e96,8.656946357582447e97,1.8224821894199333e98,2.7386846517824953e97,6.7490803601179944e97,2.8677408311255515e97,2.6527010449867748e98,1.2570714823254788e99,5.644945298110716e98,5.684911484354622e98,4.624931351525241e97,1.462988523221529e101,2.2700385426694263e97,9.523636994559498e97,2.5924726456335705e97,2.484875580450981e97,3.607052735301139e97,1.9597298525300094e98,1.139386545945029e96,6.785590457899655e97,1.7074420523055117e100,8.012396776393473e97,5.176599414658334e97,5.089951753103176e97,1.495058327681389e99,4.3597893313167206e98,6.83728852891998e97,1.474692301274975e98,1.7184878587762688e101,1.0506312490017217e97,9.447194934540595e96,1.4891222619623608e98,3.5669375919533385e96,1.0177968711584974e98,3.0733145693661456e99,2.3800369891295615e98,7.606439825885762e96,1.4801075125711068e98,4.450479078505273e97,5.33239421208735e97,2.1574756604367112e97,3.9321172576168225e97,2.677622340411535e96,3.1763042911736853e100,4.078505927857864e97,6.6810963072285045e97,2.1020244280951406e97,2.808852879300496e99,4.720341193984996e96,4.55803615557153e97,1.1256970429382325e99,8.432593106904838e96,3.614985729523863e97,2.4325214828793536e97,2.0894530990623807e97,5.086722760349495e98,1.6583159315933358e97,9.690408312283696e98,2.4377962852401717e97,5.069529007987133e97,2.3383021774305636e99,1.9158922772710293e97,3.987133227533226e96,2.170823764876676e100,6.091563509392659e97,2.5567813666019296e98,5.292177354032423e98,1.9793894413357633e100,6.512102199982187e97,2.0466913606752002e99,3.0073268738671876e98,1.4415028950128023e98,4.09448757240222e97,6.145423443896072e97,1.3598777067939212e98,3.157087826615293e97,3.1429851475287e100,1.0233251675972471e99,2.629618979021868e97,5.808696650756927e96,1.4070457566943404e98,1.997014829749923e100,9.397982067344895e98,4.009494217204972e100,4.2729585812609375e99,2.0569318616330314e98,3.825340771386296e98,5.486032030471263e98,4.2296227315355566e98,9.725755915276806e96,5.1418171553847785e97,3.2750017744866e98,1.3082237406824329e100,9.916489100760897e98,2.3775344022468965e97,4.004191385691663e97,1.8087642367205364e98,1.3717245760483631e100,7.142690790572285e96,1.9555971068726112e97,5.994237901463307e97,4.1775666846643024e98,7.762995017253456e96,1.1045425897273955e98,9.906589961615309e97,2.830833829502951e98,7.408001184124946e100,7.957787177441638e98,8.390588628459647e96,9.845619610042619e98,2.990789367455559e98,2.063964884143677e96,2.700969402588691e96,7.091563484711286e97,2.973104097456077e97,6.465838639591771e98,8.579726119500888e96,9.84257956942067e96,3.0269065530430536e98,6.665716197550573e97,4.241643843852046e97,6.057872546203764e97,3.395636734110042e97,1.5248800541611197e98,1.0674592875455367e98,3.0525220428052555e97,5.542015973552316e96,1.794373653996808e98,2.0928689328124757e99,2.6234567817282785e96,3.9559048541599754e97,1.0560157050530086e98,2.069371047963978e96,2.807008282779762e97,2.3525571422956633e98,6.753934460584044e97,1.4384666462425808e97,5.655418118735491e100,1.583010232544464e98,2.0749121330346986e98,4.439320128330157e100,4.095866875971722e99,1.143809780757774e97,1.6916113127819043e98,1.2314511684781126e100,1.3075601903368097e98,3.818368918621153e98,6.927471044119653e97,6.400530336318259e101,1.8917565809092695e97,8.890854853523713e97,7.899152577911956e97,3.155504683029545e98,2.4918298829991593e98,9.941228182023656e97,4.990983920187321e97,1.4554198050396834e99,1.6087966338197995e98,1.9750840663557513e97,3.0243518979884748e97,1.5384769998361544e98,1.482939538255287e98,9.840554949537688e96,1.0709834760941245e99,4.573699141187941e99,5.6743511884873955e97,2.3009589996043644e98,1.1800639096444449e98,6.194011685806216e97,3.069987985838045e97,4.1460427802105746e96,1.7457843455501925e97,3.581059075821081e97,1.4512488117510183e97,1.0377198465415338e99,7.809232394758065e99,3.451329818260033e97,1.1476229835073464e98,8.408971958881351e98,3.827434066292361e97,2.0642746412862402e99,2.3713805309681224e98,3.333254007797944e98,1.0589417299659657e97,3.182632802866573e97,2.198307982359847e97,2.896010484700152e97,4.0070707163249676e98,2.6594513111137525e96,4.563173429058761e97,4.2330453669135294e98,1.9571477270876283e98,1.7432281532142424e96,1.8771531699855564e99,5.768379396335099e97,3.3483885740181277e96,1.9129158211609905e98,6.252642058487005e97,1.5509312406739507e98,1.44401473421905e99,1.571471341094617e97,2.9075693457334076e98,1.2381190382060195e98,7.608406782981703e98,9.35114828259989e98,2.6956370418363664e98,2.3196024133570076e98,6.154326856767525e97,2.2948771590710746e98,1.3470560855484958e97,1.9947930538641913e97,1.401714483345053e97,2.4303355404057246e97,5.072017220467961e98,2.124733886550737e99,4.759157737290283e97,2.9538757187950965e98,2.9365089737531253e97,4.387620315195897e97,1.2822212145715694e99,3.190575122237133e95,7.404560534976871e97,1.3659753413770887e98,4.7176095371331965e98,2.092596456644791e97,5.441942732495794e95,7.254285796692514e98,1.122005777007155e99,2.2056571962757377e97,7.506467231438505e96,1.5316879026328408e97,5.096250058239747e99,2.6880210419253568e97,2.2893429386490674e98,4.354235038252923e98,7.59176443940752e97,1.2777753924119365e97,9.778858623600387e98,8.224713980932877e98,9.206689244763757e97,1.2414852360669825e98,3.3562610989117703e97,5.623122665234975e97,5.5927970521629e101,4.703719259184075e96,8.51667060748164e97,8.028774915061991e97,1.2092824353671868e99,4.671076640875407e96,3.495090254644698e98,1.373182200422692e98,3.3039774848905775e100,9.752783801285804e97,1.5567953795206176e98,1.814680150632297e98,8.714571494681113e98,6.016705724036479e97,1.4371700096179089e96,2.8082052339800457e97,9.289639530643701e97,4.3337825103079396e98,1.3382836396792251e97,1.1284066421479494e101,2.9893291085166505e98,2.3073547644394278e97,5.0784727787197704e98,2.6966907656505717e98,9.28198638009667e97,1.9974636017359758e95,1.7312620264877146e97,1.4061320719042479e97,7.852959730810423e97,7.52276050483782e97,3.168862994633145e98,1.94955368768524e99,3.0276126321305144e99,3.3801909668377834e98,4.361934904126174e97,1.6829692153539058e98,7.7397675136268e96,2.3331333687085305e99,3.870563215676074e96,1.7146100803979407e97,3.702298010226094e97,9.267782893593349e97,7.061888522803976e97,3.110124997635298e97,1.097400671803299e98,1.8125876433722465e98,3.2351876934111195e99,1.7047141320977018e94,1.7496680711751537e98,2.21361864214735e98,1.6404097660035952e99,2.1895071353971704e98,1.6743339822959237e97,3.4149374699463825e97,7.099457406762751e95,4.6114694451242615e98,1.8644827031881965e98,1.043261906746244e96,5.8945309481463e97,1.0207720834690941e97,5.5973180753056054e97,1.1622200535908846e99,1.031197496374821e98,3.379478749832968e97,1.1225229911349105e98,1.3392735020880556e98,3.67121827723482e97,8.362303400225865e97,1.2874086086923935e97,6.977788749076937e96,8.573818281960706e100,1.436905214213963e97,8.004875904992134e97,6.223408136159328e98,3.3946023797460326e98,2.449749932046291e98,2.1373735040774026e99,1.9271432305314327e97,2.7847150998821977e94,7.118515593288138e98,4.1260070771992496e97,1.7979662613575106e99,5.692354704208616e97,4.5204178999434675e97,2.257257329515539e98,6.4017136406600124e97,1.0785457725407734e96,1.5806836347787639e100,6.31798277494264e96,5.3941012570419764e97,6.577183136421367e97,6.2676328904352394e97,1.9702742419222653e97,1.1224354063537169e99,7.611833421296621e98,2.034532015505104e98],"re2":[5.955574274684827e-101,2.4612225956238766e-101,6.982909250131503e-101,6.874248865539412e-101,3.440698558176111e-101,4.537036132638751e-101,8.389613737365087e-101,2.5847290007228964e-101,2.472802259281255e-101,2.2170687232986775e-101,1.188204061748136e-101,8.806289623909508e-101,7.460971792403342e-101,8.8509431559331e-102,9.01082712799694e-101,2.7239538166318178e-101,7.17254473427413e-101,8.978132414720062e-101,9.81389123874714e-101,1.8712614333671685e-101,9.364532308924461e-101,7.466950983057426e-101,2.8560370829740733e-101,3.709721153430916e-101,3.1499584238730074e-101,8.841115598590185e-101,9.142876592047714e-101,6.696048727532434e-101,3.924855510351103e-101,3.4548959910752466e-102,6.328679253956298e-101,4.498107682962416e-101,8.863523623786296e-102,8.421709247471379e-101,2.4551969920657746e-101,7.026806381281139e-101,8.204218065156867e-101,5.860197276113211e-102,6.067719928689885e-101,2.1219030165016916e-101,5.078259429204002e-101,5.823748994079266e-101,8.311904051246297e-101,4.793618738536135e-101,7.22167842401067e-101,9.40819422198506e-101,1.1371466443528843e-101,1.2297454825506139e-101,8.142506138008249e-101,8.190259225194513e-101,1.8868460097887652e-101,9.809042992032208e-101,9.499918721194213e-101,8.870910444457533e-101,4.442882010726055e-101,8.072032615647924e-101,8.282341763117882e-101,8.736999742101055e-101,1.9220466952916148e-101,8.764483835405906e-101,4.831485598301185e-101,5.510215945380994e-101,8.430101901702962e-101,3.88001372834888e-101,7.563298840378471e-101,5.126896959324118e-101,7.941165334735592e-101,6.818157433936279e-101,4.103440100415246e-101,2.459948729799799e-102,7.563366821048583e-101,6.557783317309925e-101,6.991098553683114e-101,2.7623840886881534e-101,7.712720774451917e-101,9.583561768379561e-101,9.855627820177001e-101,6.332693112491433e-101,9.418225275151688e-101,6.164896947974892e-101,8.790984548786895e-101,1.763780782950889e-101,9.61343061807015e-101,4.3078081201601815e-101,3.5282253293800523e-101,5.960968066227659e-101,4.8606911136427845e-101,7.258119859609632e-101,4.686766028778456e-101,9.320272662311315e-101,8.570034995506773e-101,4.6913225014882056e-101,7.83982145515775e-101,6.576503608401051e-101,5.972108601078926e-101,8.584176232272799e-101,9.80522368247674e-101,9.284963409150016e-101,1.9186850241592358e-101,9.47339390978362e-101,3.84712594916808e-101,4.284909169304979e-101,2.2757965474613617e-102,9.627053296811164e-101,3.7122792040489305e-101,1.0502303995699624e-102,6.882413286559681e-101,3.884503588539878e-102,9.52237963367829e-101,7.700025249045176e-101,9.165717541172369e-101,7.662773759512364e-102,9.232462633086185e-101,2.631215720292206e-101,1.966516668716245e-101,3.1542456249778926e-101,3.8870780064464704e-101,5.5882855473364083e-101,5.309628541961393e-101,2.348432588236923e-101,2.2596814659355103e-101,5.1994359302724667e-101,5.502715429799784e-101,1.7314877849696386e-101,1.682446918308228e-101,9.283723625025298e-101,3.6550267859257965e-102,5.17316257655655e-101,4.759161228883083e-101,5.189776021644803e-101,3.304041976938873e-101,5.744722539400471e-102,3.7194547660377886e-101,5.284030026188825e-101,1.0111604898163173e-101,5.1473561873245625e-101,3.909982666574879e-101,2.4144095137091215e-101,7.921489102678735e-102,3.154401372324941e-101,4.25959387690637e-101,3.419988094709371e-101,2.515097866277948e-101,2.1319856586680307e-101,8.341516852583857e-101,1.6148516682428192e-101,5.093542645741613e-101,6.094801530565778e-101,5.2472128607963053e-101,6.445216040029947e-101,1.1884072610734086e-101,1.5769700533116106e-101,9.064491584567916e-101,1.1776000561919854e-101,3.051611747170468e-101,6.089982858572238e-101,4.50373755041416e-101,7.264038242214198e-101,2.477376703621441e-101,4.998023381521356e-101,5.6610199360830794e-101,3.688020500997935e-102,9.652940707560409e-102,4.0954633737551015e-101,2.319293728627967e-101,8.539661426990175e-101,1.4709774663494835e-101,6.897468807804316e-101,9.3995937159723e-101,5.962542063170588e-101,6.259081205946737e-101,6.274478146568375e-101,8.234194612868361e-101,3.5102733456607715e-101,8.864947727267296e-101,6.48778570525739e-101,1.5171706132660945e-102,6.741389710471351e-101,3.232181701011347e-101,4.388986858878219e-102,7.379784117968193e-101,9.12835795120135e-101,7.75499334106728e-101,1.050198027297241e-101,3.91438461718424e-101,1.4951101707116366e-101,1.014389840607155e-102,6.095247189241696e-101,8.317433325790675e-101,6.397913421212435e-101,1.247578274663298e-101,5.307798890281534e-102,4.4715765222692553e-101,3.4120760085497826e-101,2.8337519360608465e-101,6.450814950263167e-101,3.1855678215309956e-101,4.099950515613765e-101,6.316442983229469e-101,5.158902680997361e-101,8.4288751960805e-102,5.052398993428168e-101,1.5170930243083992e-101,3.499487786747535e-101,6.133404382978964e-101,4.840331739769912e-101,3.2668829996140537e-101,4.482168924786888e-101,8.89125412231482e-101,3.1662799990165637e-102,7.744259729798686e-101,8.253621334793913e-101,9.150024313845085e-102,3.104065700429298e-101,6.56151661403701e-101,2.0135609945966504e-101,9.525409867864913e-101,7.516476669232175e-102,3.8226665231077315e-101,2.994600625105982e-101,4.9661119644881583e-101,7.006813395369473e-101,9.248242389499457e-101,7.223373824041257e-103,7.473495573683032e-101,5.647916052494029e-101,4.476352919014978e-101,4.0729655780144435e-101,6.570943698401693e-101,3.2686740210187304e-101,9.831474323067924e-101,4.850007860993384e-101,3.603751286462956e-101,4.1594346207731734e-101,2.0662349491667077e-101,8.507650761425274e-101,4.752870592957533e-101,7.576861074391125e-101,9.131990258204013e-101,7.028614109372814e-101,6.1630597035442824e-102,6.520078981044679e-101,8.097258588890287e-101,2.827673990301286e-101,2.2096124991821388e-101,5.868984276015303e-101,4.6938710130944576e-101,9.152982992197445e-102,1.5669105171951582e-101,9.011341324459926e-101,1.8794497928896957e-101,5.051141151106044e-101,9.140963967245506e-101,4.915462218636576e-101,6.955726368893813e-101,6.252995163428694e-101,8.771644751561533e-101,7.650908804084301e-101,3.774947109633813e-101,9.606433646196277e-102,6.141305921246193e-101,7.108627510971751e-101,6.214976767847435e-101,3.722804633948008e-101,2.9411576864991777e-101,9.263592623204086e-101,4.622627963523311e-101,6.375150708164409e-101,5.948450564238081e-101,4.6402637431141715e-101,3.7352481298712625e-101,6.714525043182775e-101,2.2230796104459637e-101,9.785828177770561e-101,5.715962690558361e-101,1.481188054082965e-101,1.8072358079596373e-101,8.368470898218295e-102,3.5107435917199335e-102,6.805022508440843e-101,9.235598176997004e-101,6.076680394544797e-101,1.8544617404087006e-101,5.139939657723798e-101,3.4009176450255705e-101,4.632165699888216e-101,2.5154156405000615e-101,2.2446207719218026e-101,9.57077376488168e-101,9.981427091512086e-102,2.3350254165100747e-101,2.6859110124441565e-101,9.623676971670552e-101,2.330952580692214e-101,4.508838366025202e-101,9.155250862754212e-101,2.8316406460199583e-101,5.144136657649623e-101,7.511585300015808e-101,7.311022969504513e-101,4.572338119479806e-101,3.843631877070276e-101,1.0894305293843753e-101,3.317888408666081e-101,5.698853126485966e-101,7.230549877348202e-101,9.559729777244327e-101,5.784115290017904e-101,7.454358335870697e-101,9.613637687035545e-101,2.804131547553782e-101,1.8393668366363792e-101,5.3873187994623784e-101,7.616889072592433e-101,5.3585177758384393e-101,4.296153522685886e-101,7.681804770245688e-101,1.4551744695501412e-101,7.226680851531344e-101,7.364508296692981e-101,1.9151870237910972e-101,4.4786015543754544e-101,7.553942721450399e-101,5.30978472342153e-101,5.787937569998825e-101,4.404792898224108e-101,4.006211731374335e-101,4.916533310063157e-101,8.995220916102612e-101,8.132999492622887e-101,9.556837358048521e-102,2.3042218725959164e-101,4.4232297500542376e-101,3.1657762559788636e-101,1.510653929728072e-101,8.6420085748573e-101,6.398070556825275e-101,2.3110120181561044e-101,8.025326984629988e-103,4.094268488753526e-101,5.2770095219633174e-101,6.551744884842102e-101,4.4973908772371706e-101,8.029039842835336e-101,3.370946237380366e-101,3.1902561875604886e-101,4.668130582276862e-101,2.24878976608885e-101,6.929780642571058e-101,2.0915630753767755e-101,5.3095028690068203e-101,2.6559832238681546e-101,4.473598652909051e-101,2.821957910824036e-102,8.798671978844074e-102,2.05643588393032e-101,4.338255138543048e-101,5.481892856002517e-101,5.1546619662697636e-101,8.217493333649644e-101,9.781315448467224e-101,9.014922943419567e-101,4.862154468953272e-101,7.329410359967773e-101,9.013883766440543e-101,6.911208799556261e-101,2.6667433097996552e-101,9.465048550238974e-101,8.926786493854561e-101,9.272004330942546e-101,9.062930257227427e-101,3.030716822846007e-101,6.032049330460422e-101,5.553488714007644e-101,4.056373419375131e-101,2.0105720657315096e-101,3.5740697546288026e-101,4.203094630760837e-101,2.0104176305134392e-101,3.326931663771706e-101,5.602442355066771e-101,4.357340537743929e-101,2.517505869036417e-101,5.6176044443034246e-101,4.648627701254639e-101,1.8028772353004585e-101,2.6389568768708795e-103,5.968926687176659e-101,9.283369015859782e-101,3.36454907020574e-101,1.4184122628079299e-101,4.763620863417957e-101,8.486494968314802e-101,6.891382469964748e-101,9.045070276730707e-101,5.2531001211092263e-101,6.630317367086622e-101,7.833681911320776e-101,9.781036507815301e-101,4.0710126369211086e-101,5.3949203431790536e-101,9.739270127684614e-101,2.9170482224880634e-101,2.7336676191404042e-101,4.747226740932292e-101,3.783635588203727e-102,5.576444624258038e-101,6.66328566729023e-101,8.907571376781266e-101,6.585132229300838e-102,7.8342566719791e-101,9.591718983753084e-102,4.749417618690546e-101,1.618338326936958e-101,9.681208776308922e-101,9.252691679577867e-101,7.234358657788733e-101,9.480465818038577e-101,2.4284346625919053e-103,4.521657326343698e-102,2.1401190727042997e-101,9.61999597277886e-101,6.279107340720305e-101,4.533620539544008e-101,2.5004571638632356e-101,2.9155716266981846e-101,6.775796148028354e-101,6.795818724757018e-101,9.447496667105343e-101,5.810914484856965e-101,9.369342753196696e-102,1.1528945549332104e-101,4.545816283745335e-101,7.94765543077056e-101,8.779753831311263e-101,7.289999089719797e-101,6.255900911295288e-101,3.91368616709564e-101,3.2686753131409855e-101,4.996421841628561e-101,2.2254117013871557e-101,5.281228252949524e-101,3.4495582015512196e-101,6.089005545603595e-101,1.1028338594101573e-102,4.787797232093258e-101,6.668415551822549e-102,8.903795543634843e-101,8.671553351516656e-101,4.32689426164335e-101,9.08272354492138e-101,9.737563872243005e-104,4.522707246098429e-101,5.095475821772757e-101,5.741666658729949e-101,5.745871995261975e-101,7.104356155656384e-101,5.89429381382308e-101,1.0009917905075206e-101,5.6275104507004406e-101,5.29614775137088e-101,3.5437269039034437e-102,3.139036298920317e-101,7.986153519460864e-101,3.6665294858202334e-101,8.033108164740936e-101,6.891137285312601e-101,7.52310289475198e-101,8.779781016595292e-101,7.472157494446417e-101,2.2458132034517652e-101,1.1305183587268508e-101,9.144011322108436e-102,1.041808066461224e-101,6.491478807381266e-101,4.112218062177181e-101,3.8827269660908225e-101,7.727793184417295e-101,7.28136951861402e-101,1.4531835786828983e-101,1.8129700839188336e-101,8.29922187464556e-101,1.17623526389955e-102,7.521185200597786e-101,4.287459487357276e-101,7.70045656489642e-101,6.227684702146327e-101,8.255658060803917e-101,3.754096588652287e-101,8.052579268084177e-101,2.415482699383553e-102,2.489119273649406e-101,8.210405266524542e-101,5.6254094818933523e-101,7.621422380934584e-101,8.775051272467821e-101,5.650044824542877e-102,8.914445206762663e-101,5.194298804061206e-101,9.854790230791129e-101],"im2":[1.656996445283303,7.30873444168709,7.404282774318091,8.434654626994682,-2.2301090008232034,-8.015515124393772,6.386914126480189,-1.496980671867263,7.648507244514633,-5.170303566119396,7.960078570311133,9.112971783679793,9.555152773505483,-2.9214237178436804,6.863005712848874,-2.9877601642455565,-0.9396711844181826,4.873838357373501,-1.6326816540411127,2.2490804724355122,-9.091572499384135,-9.432247069292023,-7.407181023706526,0.5748714074694288,1.989550816425222,1.9752617950169231,-0.07024785419692314,-1.7172114710852089,-6.323300315084621,0.09209087733866639,-2.55108637630779,-4.810190200944488,9.732600198742063,-4.166492139065722,6.164385757735452,-3.6737005596841037,-6.8765998471004615,3.578661257754982,-4.081308859557129,-0.735640205592631,0.306774109225433,4.987413376645044,-6.670461643170413,7.3299461647576365,0.9823138327393472,3.506952137937681,1.9471794512080258,4.704613096506854,-5.937012500480623,-7.7929136957265595,6.067735311909168,7.197680363064826,3.277751799263097,5.723262156426756,-8.990236543934163,3.74297120847298,-2.302845290052929,-2.277105854179709,3.859059915856813,9.925208629080494,9.018984446647881,9.145824612715924,7.279073839036776,5.84312441322508,-0.7907883208574873,-1.333018924001104,-6.366489508635866,9.19970514225335,-4.946541991367512,3.7394194733951878,1.0504459899403322,6.882880931231298,-0.45969365445817445,2.2577031871948865,6.589038745805571,-3.2410335827183427,8.799590990962958,-0.1345830308431406,-2.7202313205163575,3.2779787315544375,7.990108627384934,0.3742829477414862,7.297609180607452,-6.672845111868182,3.6355931626706646,-5.108186345633882,-2.5964600561490903,-6.61523401978836,-3.336855079387755,0.8406165347347532,1.5189383768096132,4.112874742356707,9.011950064874668,9.27471612684629,-4.008605677944505,6.1903104553221695,7.205408499106813,6.88492263078334,-3.825974793407907,-0.6620493391171074,-3.0442800148782663,-3.952303946809936,1.1223815260372287,-1.4732043981865637,-9.831298715542765,-1.8297518298742173,-6.74145809683,-3.3965529750010877,-4.596495668298804,0.6045876102440211,4.572084658188388,-9.791316840108927,3.1786978555904906,1.6430103869602632,4.3560649491294985,-8.464704999776343,9.358696895960556,6.4132237696627215,-2.8024645104716477,1.0249995825025255,-5.645565489971506,-7.27849953949536,-6.074768121733225,6.990699107583957,5.880845884962225,7.790654835939414,-7.502647199739963,-0.9250655633597678,-3.6173581202734173,8.351995526303455,-9.14691458165295,-9.002793066107365,-1.406816731715594,8.77540587946389,-4.525742014656955,5.239964675100758,-7.621844883683188,-6.61946890899888,-4.5249108235087565,2.6332638564656374,9.4661572867644,5.941684885749066,-4.996262111584178,3.098794966459037,2.921993952780838,-3.0458243509860505,1.1071229497897868,3.0124062223216352,5.907505792238656,-0.5339870828250071,-2.7762913460905043,-3.1443902842645084,-4.286721116654693,-2.7374909503547435,-2.471526811738924,-5.610556929819328,6.027833648519451,9.880892609455753,2.5182382038480924,4.198491945536896,1.166977228352108,5.602560223080486,-2.1025798144169343,-4.693965757076803,8.510983778707867,-9.380112916358046,6.053730844883766,4.9208226412842375,-1.9759269665289576,2.7092671757324496,3.0843446946120814,-9.130615219487774,-0.1307946482213378,-5.227963018400892,-6.960669597939056,9.970157812777952,-1.8326197702240759,8.97843867051876,-1.823062831106343,-3.6461579122495946,7.1197014097819,0.6739195750094531,-7.613449448035981,3.8664651323860166,7.412723185040861,0.8126480696105087,-0.4645075286692446,6.947359063154789,5.158717086039818,0.09292043112185944,6.175019013351765,-5.594752762499898,5.159168847011113,6.9392789793497265,-4.565385432808529,1.4455696441878896,-3.182529639910207,-7.951000322427479,-6.0937852044079355,9.557684836768392,-2.3315407242060004,-9.788383006755332,-4.511614758515982,-9.542760598057999,-0.3832495332875592,3.9536020672548755,5.773183343816006,-9.367906483676581,1.6871207436123292,-8.07966853702178,-8.941107981442716,-1.433954287600745,7.133539219352059,-7.826670947568735,4.635758593219673,6.044323052736772,2.100090908929877,-2.2619732351955024,-0.8694923517413873,-6.334776209898212,-7.140465418544202,-1.1804865063099008,9.953320788464282,-4.120903795299031,0.4455170885835873,8.183843322003565,-3.3193864505133597,0.9808501107175651,0.3780228270596382,-6.2206586805474835,-1.7527266748742338,-2.1174613093272505,-4.163558712695188,-6.860145356918139,4.904590417667237,-7.841689605677815,6.0858641375462845,0.2117985417940087,-1.8357077108440496,6.8784797623185625,-9.464088929117523,3.8509948928296716,0.40244516279572373,-1.6128683618783128,-0.16547973381245384,-1.1175592545596498,-3.574762430005345,1.1069224472881416,-1.5628948942400704,-3.1072213099317754,-7.561771524577139,9.58546236000107,-3.6393250724715642,-0.6125900488112439,2.2901183555298914,-6.8681234251072665,-9.058462091208042,3.900736303258853,0.47939606848868443,-7.447286607918835,-3.4062699302598354,7.158347903593366,-3.1527456523607515,-8.409187056709253,-1.7158890005065874,-5.917432933431566,-3.814880404449685,-0.24558927365457173,-1.6890211018129815,-7.686401952856976,1.6118499178455217,-4.407024827182184,7.224645752512547,2.9054641377534303,6.2271602789409854,-3.7970837263850754,1.5371824468004913,-6.026518895106035,5.7066076656492974,3.363788088340236,5.693946340843182,-9.019666376657936,-5.309416444588169,-5.643731189235471,3.8324776871718065,6.53996920432018,-7.997280853503375,6.3408476326432,5.281477216352478,-0.47613727387182614,-9.7277242964421,6.78094202632936,3.7129493601527592,9.925580956249512,9.285800418276438,5.552485424068223,-5.672115464498415,-6.587514117057916,-0.29293577612073207,-6.090424455095366,4.112362231761965,-0.2614200412319825,0.3897273482834649,-6.461560703676657,2.8296233380466305,-0.5562131002499999,-8.240448092705616,-3.1161307389402504,7.267964965540028,0.06687303775906095,8.906446884852677,-4.086864442892106,-7.594012894797739,-3.418736164020677,3.3192143774902263,4.747948338584379,-3.2752532407934147,-0.7860498031684422,-6.471927669162474,5.077502995182767,-5.877445905508953,5.132330867886289,-4.991085930900696,6.750539920103233,-2.255915181627093,-0.7642487663855526,6.312121499577014,-3.382618611881072,7.8232754669770195,5.318629498625194,-3.2187050388741127,5.9802206995880205,-9.223737622806347,-5.861179371223328,-9.781650349789393,-2.85915353164439,-0.7900910628468072,-6.538243086429157,0.8321532842256261,-1.8426729047893993,-9.240193589053574,1.6076768449350247,3.571523949474704,-2.875524572221046,-9.209702168101991,-6.668597368093652,-9.242634126190064,4.480521590181755,2.5029182683497844,4.614154764357254,7.5245389671001774,-2.296619225268959,3.3894426281880445,-7.8643325003533215,-0.47163731671307474,3.220825846147296,7.803696090395302,-3.815826101086861,-5.736426339824147,-5.687038483460666,1.9203444100341027,8.748312367101104,-3.86809018915633,-5.457529103164922,-2.838896948780265,2.323518186405799,2.520878754917387,-4.3743574665798945,7.483878833085253,-3.248416136926986,7.574627803277998,7.317510916797701,9.136630892427863,5.632569688302622,-2.151553769753076,-0.5305646028842794,8.075561214027388,-2.63856094981781,-8.273024219473585,2.7616604794945143,1.8397161403023503,-8.536970112806607,-4.280710678524528,-6.307788204388089,-2.2846048927549534,-6.070297178629048,-3.4141677074783434,2.2758770409340414,2.868857578045718,6.056004435580068,8.564346333197015,5.277078932662654,1.0275192666560287,-9.694287878053887,5.162791703394987,2.8935865308745594,9.087715673238087,-8.465763926994274,-2.0837719472571887,1.5118907515538798,-6.7660284595371545,-8.476692223118569,3.6811905997267296,-6.766524423587075,0.03486024504931606,7.161311958749813,-6.580942911771737,-5.307165245189276,-2.428227117014208,9.895713875602695,3.8907189961391566,2.375814363928443,-0.2848973301708462,-2.590112991249926,7.470758240473273,5.812311049390409,2.8784350047558593,-8.91544596237005,3.1577729771742025,3.66495474397742,-3.7541531468179308,2.901069337403662,-4.491883452583987,0.19663680612191747,2.343350977444679,-6.821921239207336,-3.153424807460503,-2.832830279661067,9.930529318640222,7.859075403177226,-3.745756846271002,2.384420760782607,-5.614564223495071,6.388554624587254,-2.5244460857873747,-1.7497264070051664,-1.3510870199027494,-3.0506963735717596,-6.347728265183559,5.168188023503902,8.898524376403682,-1.5029761625263731,6.229701439076006,-5.304832528410238,0.8081852931819213,6.9687344606490385,-1.2753246399144196,1.6289659505142176,-5.557569026572211,-4.453265506863808,-1.6507723375413264,5.148400111715086,-1.25751008536648,1.8251801795899976,1.3581611896803718,1.361787135207269,4.22416518359589,9.5027456852355,8.482577029476694,3.2813562480042577,-2.719482555660006,-8.572243364706235,-4.526639456918997,8.849470789059858,5.862691387169313,1.8064281205714217,5.427117093498099,-6.441083453736889,-8.697023684976308,-5.636178833791458,-5.340562514122182,-3.424399889571581,7.483915186944682,8.557216195585237,-0.20664262724388216,3.702220648964893,-4.180494543998887,-2.0841812106315327,-4.338954321020248,0.521569584398895,-0.7565341139723909,7.752820732512447,-8.988521987213268,-1.6701258236583918,-7.642228723722207,-1.3536739797947988,9.292101943113625,9.77091951188163,-3.801405592649221,9.502761655141665,-8.627522527905064,-0.39352692026841396,5.008658832981084,-5.419178164221785,-6.4212327022872735,-9.402376529534347,-3.727674270592223,2.3799300173475366,2.3291079048679677,-6.709275293754571]} diff --git a/float64/base/div/test/fixtures/julia/runner.jl b/float64/base/div/test/fixtures/julia/runner.jl deleted file mode 100644 index 14232d0c..00000000 --- a/float64/base/div/test/fixtures/julia/runner.jl +++ /dev/null @@ -1,168 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import JSON - -""" - gen( re1, im1, re2, im2, name ) - -Generate fixture data and write to file. - -# Arguments - -* `re1`: real components for first complex number -* `im1`: imaginary components for first complex number -* `re2`: real components for second complex number -* `im2`: imaginary components for second complex number -* `name::AbstractString`: output filename - -# Examples - -``` julia -julia> re1 = rand( 1000 ); -julia> im1 = rand( 1000 ); -julia> re2 = rand( 1000 ); -julia> im2 = rand( 1000 ); -julia> gen( re1, im1, re2, im2, \"data.json\" ); -``` -""" -function gen( re1, im1, re2, im2, name ) - zre = Array{Float64}( undef, length(re1) ); - zim = Array{Float64}( undef, length(re1) ); - for i in eachindex(re1) - z = Complex{Float64}( re1[i], im1[i] ) / Complex{Float64}( re2[i], im2[i] ); - zre[ i ] = real( z ); - zim[ i ] = imag( z ); - end - - # Store data to be written to file as a collection: - data = Dict([ - ("re1", re1), - ("im1", im1), - ("re2", re2), - ("im2", im2), - ("qre", zre), - ("qim", zim), - ]); - - # Based on the script directory, create an output filepath: - filepath = joinpath( dir, name ); - - # Write the data to the output filepath as JSON: - outfile = open( filepath, "w" ); - write( outfile, JSON.json(data) ); - write( outfile, "\n" ); - close( outfile ); -end - -# Get the filename: -file = @__FILE__; - -# Extract the directory in which this file resides: -dir = dirname( file ); - -# Large positive real components: -re1 = rand( 500 ) .* 1.0e300; -re2 = rand( 500 ) .* 1.0e300; -im1 = ( rand( 500 ) .* 20.0 ) .- 10.0; -im2 = ( rand( 500 ) .* 20.0 ) .- 10.0; -gen( re1, im1, re2, im2, "large_positive_real_components.json" ); - -# Large negative real components: -re1 = -rand( 500 ) .* 1.0e300; -re2 = -rand( 500 ) .* 1.0e300; -im1 = ( rand( 500 ) .* 20.0 ) .- 10.0; -im2 = ( rand( 500 ) .* 20.0 ) .- 10.0; -gen( re1, im1, re2, im2, "large_negative_real_components.json" ); - -# Large positive imaginary components: -re1 = ( rand( 500 ) .* 20.0 ) .- 10.0; -re2 = ( rand( 500 ) .* 20.0 ) .- 10.0; -im1 = rand( 500 ) .* 1.0e300; -im2 = rand( 500 ) .* 1.0e300; -gen( re1, im1, re2, im2, "large_positive_imaginary_components.json" ); - -# Large negative imaginary components: -re1 = ( rand( 500 ) .* 20.0 ) .- 10.0; -re2 = ( rand( 500 ) .* 20.0 ) .- 10.0; -im1 = -rand( 500 ) .* 1.0e300; -im2 = -rand( 500 ) .* 1.0e300; -gen( re1, im1, re2, im2, "large_negative_imaginary_components.json" ); - -# Tiny positive real components: -re1 = rand( 500 ) .* 1.0e-324; -re2 = rand( 500 ) .* 1.0e-324; -im1 = ( rand( 500 ) .* 20.0 ) .- 10.0; -im2 = ( rand( 500 ) .* 20.0 ) .- 10.0; -gen( re1, im1, re2, im2, "tiny_positive_real_components.json" ); - -# Tiny negative real components: -re1 = -rand( 500 ) .* 1.0e-324; -re2 = -rand( 500 ) .* 1.0e-324; -im1 = ( rand( 500 ) .* 20.0 ) .- 10.0; -im2 = ( rand( 500 ) .* 20.0 ) .- 10.0; -gen( re1, im1, re2, im2, "tiny_negative_real_components.json" ); - -# Tiny positive imaginary components: -re1 = ( rand( 500 ) .* 20.0 ) .- 10.0; -re2 = ( rand( 500 ) .* 20.0 ) .- 10.0; -im1 = rand( 500 ) .* 1.0e-324; -im2 = rand( 500 ) .* 1.0e-324; -gen( re1, im1, re2, im2, "tiny_positive_imaginary_components.json" ); - -# Tiny negative imaginary components: -re1 = ( rand( 500 ) .* 20.0 ) .- 10.0; -re2 = ( rand( 500 ) .* 20.0 ) .- 10.0; -im1 = -rand( 500 ) .* 1.0e-324; -im2 = -rand( 500 ) .* 1.0e-324; -gen( re1, im1, re2, im2, "tiny_negative_imaginary_components.json" ); - -# Real components different scales: -re1 = rand( 500 ) .* 1.0e200; -re2 = rand( 500 ) .* 1.0e-100; -im1 = ( rand( 500 ) .* 20.0 ) .- 10.0; -im2 = ( rand( 500 ) .* 20.0 ) .- 10.0; -gen( re1, im1, re2, im2, "real_component_scales.json" ); - -# Imaginary components different scales: -re1 = ( rand( 500 ) .* 20.0 ) .- 10.0; -re2 = ( rand( 500 ) .* 20.0 ) .- 10.0; -im1 = rand( 500 ) .* 1.0e200; -im2 = rand( 500 ) .* 1.0e-100; -gen( re1, im1, re2, im2, "imaginary_component_scales.json" ); - -# Components different scales: -re1 = rand( 500 ) .* 1.0e200; -re2 = rand( 500 ) .* 1.0e200; -im1 = ( rand( 500 ) .* 1.0e-200 ) .- 0.5e-200; -im2 = ( rand( 500 ) .* 1.0e-200 ) .- 0.5e-200; -gen( re1, im1, re2, im2, "component_scales1.json" ); - -# Components different scales: -re1 = ( rand( 500 ) .* 1.0e-200 ) .- 0.5e-200; -re2 = ( rand( 500 ) .* 1.0e-200 ) .- 0.5e-200; -im1 = rand( 500 ) .* 1.0e200; -im2 = rand( 500 ) .* 1.0e200; -gen( re1, im1, re2, im2, "component_scales2.json" ); - -# Normal: -re1 = ( rand( 500 ) .* 100.0 ) .- 50.0; -re2 = ( rand( 500 ) .* 100.0 ) .- 50.0; -im1 = ( rand( 500 ) .* 100.0 ) .- 50.0; -im2 = ( rand( 500 ) .* 100.0 ) .- 50.0; -gen( re1, im1, re2, im2, "data.json" ); diff --git a/float64/base/div/test/fixtures/julia/tiny_negative_imaginary_components.json b/float64/base/div/test/fixtures/julia/tiny_negative_imaginary_components.json deleted file mode 100644 index 3b034a9f..00000000 --- a/float64/base/div/test/fixtures/julia/tiny_negative_imaginary_components.json +++ /dev/null @@ -1 +0,0 @@ -{"re1":[-3.042843872119965,6.548141801150791,4.306180916934515,-8.627028199868283,8.694192661157636,3.4168573226446775,-6.993430905932241,9.819292662920432,4.141848608752037,4.133232035660711,9.302345355939707,5.814523201376666,-2.4378642595124456,8.158638730831473,3.6329726532730007,8.5307638229201,9.729968937026008,6.507388000089726,1.7706964298540449,3.228573842355715,-3.4802182002356297,-9.72241434646226,1.4266131382948828,3.485118427207407,-1.7356087918332186,-7.605303930823702,1.3838751741984812,-9.261547789610807,-3.13604144445285,-3.1677264468823534,6.922263637072888,1.055317077189839,3.0218730254938553,-5.067896049490821,-6.949758884937401,-8.04316706459221,-9.179037024817994,-0.060153356261029245,-7.1981451798377405,-1.510249755974641,-4.09815924104179,9.366773689038894,-9.907853595764035,-2.4645908929672267,3.1676710991387242,9.918376202255445,-5.985878350622684,4.969020388787474,7.431025348821109,7.742834178258377,0.060005980813205184,4.600670753011842,-6.807903738454664,-1.2568832155119019,-9.996348655550767,-0.05350228339389673,-9.45098376107853,-1.7644080270952163,9.62575828972875,7.056071876597393,-0.7322723742245696,7.046719090576804,5.86682618459346,3.5743397593330055,5.136807355044704,5.972597972865795,-1.8877072603315792,8.92157262190753,-7.225767354504871,8.874402507037548,3.0577539438566994,-6.557232795138226,-8.296950593016723,2.1033595543473567,8.83683778886683,-4.388250871777468,8.547658147459117,6.2382324819218695,-8.352290125287507,-8.023256622707088,7.650992032577026,9.801669976180488,8.118190920928804,2.6586420287077495,-7.883350336249038,-6.690615839007068,7.629679559788734,4.566910344087969,-4.996190845696571,9.662165004193287,-1.634168339207422,-2.797569760945837,1.2083307166898916,-1.8029653953564466,-2.766935421610399,-7.995522729376654,9.468309831641253,-7.356716385728406,0.906658708814895,8.657800780768927,9.271913088906928,9.368565475238029,8.605425828611356,-3.979103817019962,6.4619281394964965,-8.959396533574234,8.740913420279455,-6.8274972781152865,6.905560442166696,6.813059992298005,3.966140550109799,8.944807538858694,-1.2796105592288232,7.192364236459309,6.670952471198145,-8.83900879585342,8.3690921021743,-5.589809332420376,-5.543550700026838,3.3417118783080273,-3.891744440714529,-4.0328034461785744,-8.407521354450173,3.5083443184460013,-9.580761968448224,-4.79469526993493,-8.43238440478257,-8.345798527936436,9.443134607230729,-9.921811016265616,5.754653384585737,0.22266917539534425,9.895883192068403,-9.826439012916088,5.992054673116744,-3.3928757986773466,8.969127155799175,-2.9389253095593393,9.048349392347568,9.397914769132612,-6.734708064489576,8.344571443355473,-5.116275582118817,-8.72082076975596,3.939252003308127,-4.113662362069553,9.79868457443164,7.315827040164741,-3.167342964754276,-9.853362462967109,-1.5206753015404715,-8.568599620391854,9.346220035433475,-8.493099713890604,-7.417842472957796,6.345520482426522,0.06664497476595344,0.5849701319253917,3.6628094698386686,0.6524168534702319,-8.105247148061917,8.651504288143347,0.13866792759808533,-5.081635759037752,-2.721897043413117,6.375172342151693,-8.131247975908746,-7.698257053023793,-2.035519656222357,-4.7170576395058745,-8.815844955021543,-2.6982549812879997,2.2654914953047047,-4.159469418274573,5.102085995840849,3.3652732938801613,8.274041820336496,9.267096679514612,-9.139241993551924,3.9891825599796995,9.523064884592781,-2.9751788181097822,-4.6966832436505594,1.002615150014032,-3.589922840370403,6.3487282168991825,-5.436683792357762,-9.284697978365175,8.396374110314898,3.6548930052163087,-5.753917265579112,-7.563692700180942,-8.413885764424034,1.904241413313187,-9.25415396753145,7.05310532765877,7.991553504602997,-0.5592847963272867,-1.110382130785192,-8.405072880877384,-2.6903993945727915,-5.6755772461063785,-2.1288523282030747,9.151501226435187,-4.425730821162544,7.07916713906917,-8.269928018363588,2.3770133857886258,0.5626461896917831,-9.960198723402874,-9.844292284106416,-4.569325731766279,3.36511772527653,-7.9059504836328465,-3.0819102580978512,-4.397113714426664,4.665948138433551,0.9719761377299676,1.6566957270008835,7.9535886909671305,-0.7586424585901881,-3.6649782017584247,-1.910035830665116,3.7435158834473885,9.772024255056785,5.035072433819135,-7.644477301220141,-9.838275427696843,-4.932068113799646,1.886279592063108,8.173003907667592,-1.8789560872823436,8.57520032082207,-4.105030113352639,-8.792432379078974,-4.4713864955951195,-5.726696250864527,-5.839689721100807,8.545211435886404,5.581101959465277,9.641234280677999,-2.7195979177959213,0.03953273872000729,-6.0628279707929895,2.148133892187536,4.190385573835476,-0.9789608784679142,-5.426727999247203,7.366116527771066,-6.880038568398685,0.12647305851323232,7.4621726507404205,3.701268492821521,2.3368720499152573,-8.1625982911432,-1.0158008413019477,-5.309423238976596,-3.7304006400847296,-3.1869606186569683,0.9111521543270751,-5.621238442120891,2.1280604121725517,7.008132322608564,-1.8846166887689009,-8.866494253299567,4.646988074864144,3.367641273613277,-8.764425833793535,-8.68555127473658,5.420986380270707,0.7443924842169771,7.1399081258298445,-4.55787023045636,7.862411051977681,3.3371215816451834,2.231498807190759,-3.0252312826797256,2.4772397025180375,2.185908006995952,-9.079415461322046,-7.704446648867473,-6.561191275664104,1.2954395484305437,2.8726682494371563,7.578115584960955,-6.40738277512513,2.7029918853954413,-6.460460815943412,-1.7514545881436323,-6.383575340680164,9.511396147581738,7.860098324615009,6.61637532952885,-7.240955884920847,3.5026977843062586,5.385364417167848,-6.211432473544065,-1.2729057232423955,5.658759385578875,6.810087893079579,8.182889371219197,-0.19134507791882704,9.462177517669446,5.200358095065226,9.353349300550839,-4.796647002947241,0.7574004342462395,2.6882148796553373,-1.3752501964161308,-6.896672094482472,-1.448974849705131,4.787683263337417,2.9343427113557237,-6.277412540466685,-5.670362922269538,-3.377997282339753,-9.376815352830805,6.397159219544545,3.50927136063029,3.7254955809744708,9.91239883215087,5.955641213431093,9.330955128361488,0.6530124948522609,-5.849060033170086,-9.75397780060373,0.04115070614436611,1.3915936352953278,-2.3208781481791636,-3.870766196836688,-9.237930596293848,9.95442304869433,1.5136167539969652,-8.985440427578288,5.017085348888926,7.080928267332403,-7.750338238827188,5.932419358072574,-4.777035638570304,5.69086388509559,-8.722052881536923,-8.765657770624205,6.303276766929706,-9.188880023775521,4.127138374288355,-2.6602014608896525,2.0865343282703037,-1.8760264218096783,9.52475828714962,-5.718999335228199,1.6919102082580544,4.774168146539122,-3.652322316209289,0.048611899195250885,4.4518830103871725,-3.4351258989105737,7.048879272858628,7.635251558423498,-6.955125445959749,-2.7438500359246305,-6.172612268375952,-6.150547322797819,3.149594110605463,3.7753221108206674,-3.6152225930360338,-1.0213156360870954,-0.7310719339187504,2.376825062356323,7.314978213397627,4.644437835003396,8.799187662055697,-5.832821411307321,-0.74851921746356,-5.20833278655116,7.672376442610055,-9.798978488800818,-5.14108579104763,-0.46872795358297203,-9.081445278056108,8.401496080006005,-1.267431330742248,4.493562926986186,-2.9104976487697716,0.7606669375390513,8.304241711117385,-4.276849619057479,7.359040313280445,6.281546700980105,2.1870780965816294,4.839509654401041,1.066271863084669,-0.0913197580840226,-1.6346548211615186,-0.5289696124112311,4.858875840764652,4.4016488015277915,6.294905518114099,-8.225340694035882,-0.778115042984652,-6.271199691369143,2.7627668025680503,-5.740656040263099,3.970935922638347,-2.071702629641594,-7.016660006690629,2.0527764244747555,3.3267778385791598,7.188324021212679,6.029548103081453,0.8637413254483128,-8.547593293884383,3.0790228690783383,-1.3117280451964124,-4.042543038216804,-8.65553773261958,9.027331764099696,-0.7002283870808981,-6.886693675446198,7.798800903809241,7.845186223512208,3.414542560884044,-9.255950706655202,-1.1711615160199411,3.360491457753106,-5.303850334469766,-6.816915718733718,3.9497073267477774,4.683550445009461,7.066963761511246,1.0065642875517433,4.145726231281191,-4.508200703935947,4.093779087932997,8.731939438525767,-8.500887319972104,5.7136592764689915,0.04473663941029571,1.2528919764290194,-1.6020368576110382,5.723075549177686,2.205433777497099,-9.492964900537446,9.777309052683066,-1.8833650326937423,8.172769971877106,-0.28407229189378924,-5.101881920162141,-1.2017871542282883,-0.20163858488139574,2.1760486147224096,-4.912247426367983,-2.7071189621073692,-9.393403173292288,-1.7668569609003129,5.579672486252235,3.750270908352073,6.896693042601168,1.068793073765864,1.8280189861408846,-4.394573506257036,-3.850344246187138,-3.27222370526699,2.4639161377749463,-1.7391179621202504,4.675840782758101,-8.846651301093393,-7.275168826162277,7.558885371765456,6.63968772563053,0.0530666162681257,-1.3979605792019676,-4.692240303104951,-5.126187427063864,-7.932839648778072,-0.04770535029115841,7.581469878710102,8.016018205487697,-3.8501401947633322,-7.577811584716876,5.136393505156523,8.563924970571794,-6.985199163555686,5.421943314016813,-2.136329609839458,2.466144894762415,-6.685982726468762,6.706137280900542,-7.800020256556504,6.492260637261683,0.6745052831678109,-5.663003584299558,-7.977424596674028,3.1045145370389484,-7.342630331873725,-9.592228041149667,-1.5675102061806712,9.624871456155176,-7.158631365774291,-5.43541653207265,-1.1397163982596226],"im1":[-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0],"qim":[-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0],"qre":[1.4395613916235401,-2.2392356908719675,0.5431397930735995,-2.6638827682954838,2.2900868808126305,2.516374986556177,0.7651608270834719,8.906234383865492,0.7011285966369056,0.6366694850404137,1.2933658999899371,-1.0936799644639659,-5.87737395425365,-0.9041641030323189,-0.6245906346779102,-0.9015883530916701,3.799928040910205,0.7253415952155992,0.2548735375538292,-0.6007181006509001,-2.028722664991603,-1.224334272343933,0.20866061928639773,-0.6935473847599998,1.7412815045118966,-2.698996317435884,0.17242405095179858,-1.3450948487711578,0.5346372162254344,0.33110403960190643,15.46619621352619,-0.14465528103185143,0.3505395337472815,-2.882770429619868,1.1633675452845742,-1.1297240371900354,-3.5228436642207637,0.05809344287509494,-1.409335169678288,468.38046002118494,-0.6105289067452172,10.63667621948668,-2.722585467218949,0.24772708404042043,-1.0302912132808824,1.0382065072331539,-8.504729057461839,-0.6655113387043023,-0.7463797926619561,-4.283412716692822,-0.008274503958704797,0.4649599475969143,0.9847260581735333,-0.1467860853434043,1.102739987474462,-0.006170236808778128,-25.664113766754607,-0.41885145242977606,-1.063220266884304,-4.568149912029127,0.08402170992226829,1.7471983578807633,3.814487836602643,-0.6511600053320284,-0.6608213835521082,4.844411754608086,0.1923485541635795,-31.95326453192313,-4.108118452145626,-3.169040961990774,-0.3885839682342337,-0.7994118608367874,24.923178062418206,0.23560972280237016,10.927907020375056,-0.6390344249928346,-1.7833197965668368,2.0185825336929537,-11.3985731431211,1.4695294332822468,-0.7771333322578327,-3.1045784567188264,-7.312770815875596,0.523700736457176,-2.2588369629866643,0.7842777591623062,1.1104038844716582,-2.4282647733551372,-18.81001019645112,-2.1468350456094414,-0.3523691751563009,0.5122824512662331,0.5632811982123825,0.19408525718761888,-0.3861448026995291,-4.1444966706639885,-2.0403994886439896,-1.6262135572286807,0.11976081046238035,1.3421792833638,2.303987964229517,-1.7989350400047364,-0.8899086087354178,0.4469640612632758,1.7202861538188134,3.1414419602455537,1.1545353596349839,1.5979321357851872,5.017189605045748,1.5698259392841742,-1.079481459060283,1.0156461094661537,0.1751304491137193,-30.458102468819106,1.1181289478281156,0.9913955806771335,-1.3940000796643013,-5.537074123656754,-0.5589544608253866,0.932665667270341,0.6833857504050496,0.5661344387049271,-47.034734553463544,10.915723247781822,-2.2932784447599452,-0.7315475711647074,-0.9832729863076606,6.428391030996862,0.9491371921725921,2.2939699736721257,-6.661459160198579,-0.024775080265128476,-3.52136352870372,-0.9935261117207207,1.0237583979955238,-0.3533718380120083,-1.0454607181694706,0.4013039664184172,3.6466653866708634,-15.172460091364792,0.9169232069953934,-4.766247564626238,-5.4960946648065985,1.3255141003839939,-0.7195458936424962,-1.2143501633228841,-0.9883720485460403,-1.5431212312631188,-0.35734101876145863,9.95071816845199,0.37044484821660784,4.622444955836608,1.3064191258600235,0.8520329267713339,0.8735636240168907,-1.1470953379261772,0.030358501364078905,0.07358603601537664,-0.6923874583633903,0.4101394531004637,-8.208150967514236,34.61488958932374,-0.022323091069366335,-1.3450926232165716,-0.28745592753754323,-0.9270830550675413,1.3728794507827218,-1.354889395953991,24.219514935173592,-0.49004657242031985,-1.1112132152946685,0.6320809344484782,-0.2689548601137384,0.9607778000963659,0.6647762968167301,0.6055059395058602,-3.4491993929085947,-2.1243079693204177,-0.9478732205548391,9.42080153806432,0.967399786702622,5.794002521879008,1.3703192510337043,-4.216410050880911,0.9855046015058054,-1.3585326594967007,2.816127242656528,2.109738042912592,1.2333198345356875,0.5966306798860155,1.9812219782646932,2.033153128758443,-3.0013566147464603,0.5485519372576129,5.669124000043859,0.8486366021127214,-28.78218257879604,0.10559282673886213,0.13179684112611892,3.6161221574268296,0.9480080656305382,-0.9383010527861908,0.2850709226301847,-1.240862554937641,-1.4165709970258265,1.4921995234974756,1.819646106789416,-0.34980281168772687,-0.06670103839685279,1.530486055763648,1.1053247226197485,0.6817577181260053,6.338697856531822,1.0648871739227939,7.621390739232178,-1.6539883424009398,-1.565642055455047,0.9518107399056007,0.19409899599168437,-1.7693816283386798,-0.08878693759555384,0.7267692962910898,-0.5850354973378726,0.38371370849766073,-1.6169962975937002,1.0852713324578065,1.3939591728647704,-0.9842963449325807,-0.758854485426027,0.3295219536551039,-2.687670640488405,-7.849366287313872,-1.5729037367040313,-0.6986616516365378,0.8859264113625545,-1.2430076140253261,-1.6329276045738728,-1.1317320379959686,1.2713470879711743,-1.889346446854534,-1.7612377494605522,0.7141417729586257,0.0050843954388494,-15.626603747735636,-0.3170983728306247,0.6809515201918566,0.14112709453104594,-0.557965740491991,-37.23391590343909,0.9825674375234417,0.07158968419183094,-2.2476504836044544,-0.8923963061516273,1.2930773452296345,6.186988520743221,4.204849692897508,0.6394752187153666,-0.8783429742576844,-0.503390959973148,0.2129352513481659,-2.0001849543481782,4.112585505031983,0.7726155956773421,0.32593682470676966,-1.834278146119508,-0.6247959508825719,-0.644838791335447,-0.9230414126917662,1.6975874034535103,-1.05673427177432,0.12164487149905813,-0.8833148108001018,0.652089475490706,2.320346383022961,-0.9689798766595604,-0.3464338468112226,-1.1117585341089793,0.3619619375648927,-0.33146041028975204,1.0385131527246876,5.4306702987022675,3.1844574561462284,-0.14658403781784377,0.7308068309234804,-9.178224556735001,1.0161511982435751,-0.37037763192708045,0.7278858246801506,-0.5612962748276644,5.919535728697435,1.2869223626887054,4.843167928318361,1.684262957605034,1.885576521899153,1.1932574666355116,0.5665303902674612,11.46698409860306,0.19630794003234,-0.9228137775210495,2.529877426718242,28.12590814635533,-0.024880475324972878,-1.4901672538303532,-2.1851653657159402,-1.0938879162483046,-1.0348183736417171,-0.07901160776278231,0.40374977764237974,-0.14426828959131602,0.9069379368656274,1.2942665755215834,3.4649701017997403,-0.36898313097868407,-4.804294207790076,-3.086612586546134,-1.5534072255307592,-2.799476373325581,-0.8721236023087775,-1.023866632597736,0.4231429279812578,1.994525331377006,-3.2572559315491003,-2.6103175795504274,0.12213353816987288,58.19564798352647,2.539919714621281,0.015956353517493985,-0.5755570417829875,-0.8594655511840429,-0.3919337840646662,-1.8359868184009236,-3.513609941148684,-0.21839574854084923,39.03790108124937,0.5354482747315346,-0.7112980391530143,-0.925345918286376,0.7177525719801275,-3.160165761440483,3.290896005317005,-1.1833669878820678,5.712200014881635,-0.7077808640364804,1.313809211198667,-1.2461840190615954,-0.2789419082290407,0.2955997816521746,-0.5690615354541821,1.0560646314006448,-24.180780035414152,0.6899601104341131,-14.654508434272929,0.502040953777514,-0.008744522285534887,-2.3667804893576663,-0.4811995008729455,4.394350018301942,0.903457510053844,36.328255299708005,-0.30837418506415665,-0.6984419207078125,-9.374204130578324,1.2291310613892183,-2.8356976187740024,1.9779190709096717,-0.14960747736267271,0.10021567192423554,0.34545625050495365,-1.3138218861074344,0.47548006512726515,-1.1253979319710015,2.908637480631182,0.11537641549828255,1.4289975256358196,-0.8125300689272775,-1.3111443909331437,-0.9366206478125736,0.04721092226962202,-38.7013907491248,-3.34996846405803,-0.7687872920544027,-0.676531517703237,-0.49924122718165004,-0.5306381094368896,1.3170178675578321,-0.5725428755161411,3.606093715828098,-4.120542421085133,0.2792181843365749,-3.724192320213537,0.23626456139882884,0.06385053034266949,0.27415502589045626,0.10090683527535749,0.6622036513352889,-0.49559434879367814,-1.068320523437993,2.952607267828817,-0.13625484823929768,-0.9210041287741921,0.7689102208151993,-8.332324338743572,1.1440196883120124,0.21176277575887129,-2.4752020462645072,0.21177788084405896,-13.09511751027764,-8.65996193429305,-0.7987410794965049,0.3217784323793787,-1.6541201304557311,-0.5296684901507522,0.20617052135518413,-0.4153420785305474,-1.51270974877789,-1.2195288285776646,0.13194307148121986,-1.0141318530240908,-0.9823102442399471,1.0022370266727407,-0.554394124585677,-2.0024636725897795,1.0982274400389407,0.4867188277778202,1.731909824355962,2.356139224881264,-0.512871823749432,1.4866160270175608,-15.517872252825814,0.14736014557592036,0.8000984137757061,-1.4805247145244875,-3.6271534002719337,-1.4532887478090861,-5.722778016225148,-5.041171007122669,-0.10605399546445488,-0.2934227353688123,-0.32072916012684277,1.0541156905317797,-0.24281874350085225,-1.0912356955610996,-1.53578362385742,2.3102157921397404,-0.8639399253062039,-0.04332638680013506,9.016799524561888,0.12940482203982667,-0.02235300009722006,3.7476783897913837,2.9823157146140806,-0.32252591228196165,-1.8002148033472962,0.23367031421920767,-0.6030869747186574,-0.6752591317416268,3.3344831341026726,-0.38182827769873295,0.9495887519279115,2.255496046562849,-2.707304769364039,-0.41889460134349793,-0.8762664805843214,0.2867548190789044,0.544403726715637,1.8173830516614404,-1.2691876626798646,-0.8917053470618519,-1.4717966428399167,-0.014858508074987392,-0.2658630806113369,0.6678695077993876,6.3573389866150585,-1.2620883316837894,0.0068455708201102345,-0.8003719798681532,-0.9801835151817133,-0.9946874472263675,1.4286123000631956,-1.1690662118285622,-1.022925431576937,0.7781466573921774,-1.2546056294861194,-11.971164439547794,0.35388967235606283,4.605149567482052,-1.0072916675814374,2.983198073994724,-1.0879598763171066,0.10527454189288278,-0.9719920830303407,1.0711746850211772,-1.3008935259701457,1.3052091368541008,1.8991623555818626,0.21461949641259934,17.611521183900333,-2.7371246028060052,0.6677656295155415,-0.2146568508445247],"re2":[-2.1137298414819528,-2.92427538014139,7.928310486267382,3.238516462715207,3.7964466475055865,1.357849025244393,-9.139818268779882,1.1025190040707926,5.907402192150181,6.491958752190467,7.192353962642809,-5.316475925593533,0.41478801221216877,-9.023404826037256,-5.816566005903143,-9.461927711984012,2.560566629755275,8.971480531397738,6.947352976885938,-5.374523988635329,1.7154726273292926,7.940980307485091,6.837002320676433,-5.025061738807397,-0.9967422196445668,2.817826716432476,8.025998499393484,6.88542358040543,-5.865737268709912,-9.567163392784273,0.44757376290227846,-7.29539267188918,8.620634007211436,1.7579950166753626,-5.9738290904766504,7.119585668547863,2.60557603450971,-1.0354586212141577,5.107475733739673,-0.003224408114519406,6.7124737187129,0.8806109630260917,3.639134093331018,-9.948814852093811,-3.0745395654220147,9.553375107124076,0.7038294001113208,-7.4664699153913165,-9.956091284731103,-1.807632065918817,-7.251912756664858,9.89476787579192,-6.913500137370125,8.562686392047574,-9.065009675077436,8.671025934982165,0.36825677469219187,4.212491127486382,-9.053399929947151,-1.544623537423087,-8.71527578886484,4.033153453236993,1.5380377224688502,-5.4891881105480955,-7.773367331778616,1.232884047724589,-9.813992460407118,-0.27920692150232007,1.758899466672128,-2.8003432626704505,-7.868965767557148,8.202571310706372,-0.332900987676517,8.927303717901566,0.8086486984553005,6.867002308720181,-4.793115718176104,3.090402486793124,0.7327487414798064,-5.459745440271213,-9.845147177445511,-3.157166137956036,-1.1101388413957523,5.076643669996351,3.4900041328461207,-8.530926398006455,6.87108507677728,-1.8807299740126204,0.2656134044328802,-4.500655522627916,4.637659745585157,-5.4609908147955295,2.1451642989764697,-9.289553578062609,7.1655384256548835,1.9291902888887336,-4.6404196258320525,4.523831665913171,7.5705792680794985,6.450554622680922,4.024288856043384,-5.207839786818185,-9.670010767554974,-8.902514009232938,3.756310033160384,-2.852001293340436,7.570936088993385,-4.272707911190741,1.3763802020202363,4.340009820072597,-3.6741164165639573,8.807012064035064,-7.3066138167550765,-0.23613960337228335,5.966174549148366,-8.915723418714743,-6.003652527903527,1.0095240207347622,9.917714390973622,3.582968683824623,-5.694798930776437,-7.123402447312515,0.1787513299324246,0.3214028277199983,4.1777578254136145,6.55418110718518,8.575832471964326,-1.2982717584686565,9.949177721731907,-4.325170394616389,-0.8638728011678136,-8.987626801304717,-2.810241859837534,9.890468802976255,5.8529968446158165,9.601432354555797,-8.5791144515726,-7.323439476038187,2.4812667006467635,-0.6194061287715176,-7.344898692833947,-1.750763326959044,0.930892914723632,-6.579198793305623,-5.4746362089105745,3.3875421491385502,-9.913963662616869,-4.740928251098189,8.863642286945574,-0.990216213158007,-4.104997839384978,-1.8536942467151647,7.154074714943263,-9.968041664861572,-8.491473624838537,-5.531816120793001,2.195265634713108,7.949471986820374,-5.290115275190748,1.5907195675477297,0.9874632155451835,0.24993592037374945,-6.2118604975982645,3.777907685558368,9.468919520045809,-6.876592455556465,-5.922769090376336,5.681834307665664,-0.08404460872443842,9.625733358787759,7.933531417446094,-4.268844121429418,-8.423314954586246,-4.3292730305148375,7.674891569197186,5.5577874209235425,-2.3988296638772377,-4.362407340814725,9.641840064014314,0.4234440714902643,9.843980756965127,-0.513492841412317,-3.4274372487342664,-0.2377888151093277,-3.64272559954075,-4.673224579857516,-1.930553318048652,-4.400877165559008,6.8079454130208745,6.125888474113609,-2.9042264464574714,-3.7201785705141432,2.803360894564939,3.4713967520251607,-1.632378118287738,8.31110196060331,-0.2776562716439166,-5.296617332827296,-8.424952535263316,-2.3243332263029215,-2.837949899490946,6.0487806437532186,-7.467798920217412,-7.375112731075273,3.1242562712738184,4.744115667907963,-4.544800215551281,-6.795295253117102,-8.435343784967685,-6.507866364344728,-8.906244547551868,-6.7022720979621635,0.5308847024170564,-7.424214205256304,-0.40437636168334556,2.658491357952249,-2.9802138503985276,1.0211863524741975,8.535313222701369,-4.49512336037702,8.544527822842472,-5.042835767088469,3.264820407234234,9.756012882897068,-6.043318880568139,4.639459537198169,-5.484003728394519,9.995237184763411,6.49935950636273,5.724291116692619,-3.040924652204553,0.23937678769292603,-5.451827801484612,5.87556237520273,-9.924562882775124,3.5972317829293807,3.5070117222734805,5.1599579450286885,6.721383575529259,-2.9539854740547655,-5.474124253600062,-3.8082045061289023,7.77530764384321,0.3879811677999143,-6.7743453648528895,6.1537208590926475,-6.936732324299051,9.725916136826143,-0.1978335168096219,-7.002103169365965,1.7666380281038325,-3.3199880075543042,-4.147561422326906,1.8072175330705047,-1.3193168637336754,-0.24157839530334613,-8.302781849221033,4.247088835927002,6.330985003836716,4.279010396626482,2.810359326971712,0.5174507398250441,9.070658632595457,-5.782153306747109,4.833778493221983,-7.437609139911869,-5.222454540364989,9.495159928128018,-5.11640888537875,-5.129942810663788,6.119390608446167,-8.083084352862322,-6.9896393083579555,3.3884643730366175,-3.443953442200989,-6.441341767644138,2.7211226087904983,6.84392320138334,-6.59477855918027,-8.742706279165462,-1.4186916577698625,-2.0603796301315125,-8.837521245255594,3.9308174580239257,-0.8256624729670747,-6.305540736654485,-7.297935005771632,-8.875651368512752,3.120374509311297,-1.0783912173606964,7.390808041994106,1.6229250030040117,3.9283505581201617,-3.8401813985399835,2.93540822684513,9.505870311079686,-0.54167969713159,-6.4842294358174986,-6.132070763811064,2.691864760386288,0.29093778336467935,7.690571639793848,-6.349741945642471,-2.379846475994918,-8.550555465161292,4.635254963696628,-9.585938771429557,6.658121015824847,9.532588209868898,-7.604348450035438,-1.1195335467279612,1.3817386940368248,-7.952511822350054,1.3066253374508108,1.8370828094803358,2.1745729174045643,3.349489012365483,-7.335152038781327,-3.427469212202599,8.80434324815062,4.969803429524468,-1.8284228622461,-3.5746436377938924,5.346709058276851,-0.10050682887534457,-3.8402701252539835,2.5789542766929756,-2.417820536057354,2.7003736740603568,9.876071811655919,5.031588736753427,-2.833104190683155,-6.930614556875656,-0.23017222183326247,9.369878633756763,-9.954938545541465,8.37561185030117,8.265270776677657,1.5116408439261146,1.7292749074723197,7.370539292419526,-1.5345502166919207,-8.905689722920826,-6.994074897215825,-3.3118209760033546,9.536757949993468,7.058646378587248,3.2967022104426285,9.019105463760354,0.2365101260940463,2.452185543296885,-0.3257815277770515,-7.27494896328291,-5.559125771303055,-1.8809868639720762,7.138673029957225,1.6040777915962288,8.451146261398009,-0.1914522288114302,8.89779420204638,8.837688697322928,0.6561140804193659,2.562455875979289,-1.3313556727014166,-1.827790957783396,6.826634965652559,-7.294986102287984,6.880249116587457,-5.567709208338963,9.76789181216311,-7.818734522325769,-2.0053449252952564,-6.487627599027828,-3.6447458397338783,-9.442575402457805,7.47360745053172,5.488973367237158,-9.928379515783705,0.2346542359918029,-2.507932886576711,1.6486111878297791,-6.642059991885409,5.8298423493594616,-1.4334947377719764,6.305337167912594,7.469920248683465,2.040723534438296,-1.5244465555886393,7.832864115845993,-1.2994789845126888,4.513041891562983,-1.430211426497678,-5.9625199860996725,-5.242158382707807,7.337434384372628,-8.881555676011654,-5.892337907968184,-2.7857889478421356,5.7107328879636405,6.809089661428313,3.593094132158839,0.6889621439206639,3.4710380976899238,-9.783129363588374,2.8347827270424,9.693063394029814,-0.2540471924721679,-0.8300641591445395,-7.54881432526576,2.6842735203270447,5.167456181994117,-5.813113157254264,-6.3623452886196485,9.733044753180444,5.721876083374449,-7.4023110832306145,-5.3070493146778475,6.7907281039545495,-7.939244194529893,7.827675504622807,-6.159052575522659,4.622281459260888,-1.0664107208780127,6.904379419830292,-3.062428689924481,-2.8932567510212603,-7.701158737621434,3.150477567772203,-0.4554080383168735,6.830641240328841,5.1815203728717485,3.0450019913270303,-1.1286479054417935,-6.008399536354805,1.4854476787096225,-1.1333992178396972,-0.4218288921070368,-4.2699212617393805,4.99498348381376,5.429267015549794,-9.082634007985295,8.699280035607966,-6.366332405684498,-0.8152333817047257,-9.459882258573074,6.5565654760046534,-0.5658196022063642,-9.287035330556822,9.020649756382035,0.5806391019704176,-1.6471252196059467,8.393492922642217,5.217934635259256,-7.561324025279534,-9.251853746062375,-5.553824794163662,2.0682944748068444,-2.799145941226371,1.9250638578327006,-1.9483844863988686,1.4222056894952413,7.8115681003578565,-2.8118342905595695,-6.064825580635523,8.588921334112161,-4.867796743788184,5.73214587573354,-8.476886896183593,-4.511280656829648,-3.5714632990278012,5.2581974751343346,-7.025684281598301,-0.8063416844463855,6.285486878873712,-6.968790703474193,-9.47243290545855,-8.178078983507115,3.8707035114389363,-5.304316352576319,-4.393586482259697,-8.371993408522151,-8.97671293347884,-4.321631584131833,0.17845629141822705,6.9686828619319705,-1.451849202397229,-6.6575923307321165,-2.614650473447007,-5.967371388032136,6.407107274369547,5.8261828292307065,-7.447361021714505,-2.3864478337869706,-5.6256350990396875,-5.050767783468841,-7.303671066151331,0.5465099440106176,2.6153838076774107,-8.139706944809364,5.309480660764541],"im2":[-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0]} diff --git a/float64/base/div/test/fixtures/julia/tiny_negative_real_components.json b/float64/base/div/test/fixtures/julia/tiny_negative_real_components.json deleted file mode 100644 index a251a56a..00000000 --- a/float64/base/div/test/fixtures/julia/tiny_negative_real_components.json +++ /dev/null @@ -1 +0,0 @@ -{"re1":[-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0],"im1":[8.798302001899852,2.2677389706535855,-4.239045404844914,-1.7404254986998176,6.801988303300163,7.878744548360817,-4.151647041659173,0.6809731992652672,-9.295935082309047,4.080603008443218,0.8976768296347082,-0.5679526880896546,-2.3909433745020747,6.311046124096116,-2.832186268427506,1.207541581813782,-0.719370926691985,-0.9705832295301242,9.174522318096901,-5.8256007440792,3.4487211472114225,1.938087367670482,-3.985786640768321,-0.36701159275461137,-4.6843483602373865,4.609580845195918,-6.20279502931975,-6.332922846508908,-2.42529565856824,-2.0848443260290006,-2.35450849906357,7.714635979773796,-1.881845971784088,3.0046591115008425,-1.838696193536114,-3.482409131372634,-6.937489381798891,7.334722842843732,2.3566510452643357,8.460418769237602,9.179183517259453,-0.7793301991602437,-3.2718164055751053,1.7770703626032631,-5.624395554012609,-1.7470810047672973,4.146560596370337,-2.2791258060945596,-2.7932366929433528,5.941317695183237,3.4748017274898775,-0.4653813932837707,7.241370778418098,6.983266104193021,-0.35867841547147705,3.055641493102062,-8.749820671515762,5.716542663078714,-5.618344732127191,9.128213986381205,-3.402641657293664,1.2921658829765192,-5.848716265597806,-4.268041584851019,8.369840854250924,1.8290208203090295,3.5724246253731895,9.750772384513237,4.513590421292504,-3.7228566960740217,6.999205966107766,2.744717348178302,-8.433329896208242,-1.2763667224259088,5.21511599705223,-9.376925173029562,-3.7111871842726156,-2.5832557485736345,7.30932261799985,-8.155230892014133,-2.6050145034604437,-6.174003763956037,3.5803931474528756,-2.1366247909813723,-8.101461709805962,4.567804766821791,-5.5845781636951,-0.8295056760431088,3.6600231384243127,-2.3108782501785186,-4.456385537271965,4.452234404865115,4.172247487879195,6.1182094890178504,3.720047056867557,9.289686403688872,9.172523380663115,-3.5951387976421163,-7.688821507733521,8.049543800317348,9.748636655901702,-6.838097987121752,-0.29597356285937515,-7.069803525115472,-4.073352091594671,-2.0173650021700507,-6.55237300919969,2.9604026988070693,3.8775639587976194,6.258683267323985,5.379671949235812,-3.632397430187069,-0.6166465168761253,-1.7478461783655685,6.273614547766236,-5.1987351454025665,-0.4637774570423776,-2.176876030468371,1.086730776264858,-6.876197727687876,-6.155534887776231,-3.8945387663065256,-5.278783204018625,-0.3427796411064108,6.948864172714547,-3.5676884357563647,-8.611484130122344,9.64450546061353,-1.6757270758827598,9.61641572232477,-9.794279595477116,7.392083693724466,2.1948686048480965,8.526761521156779,3.4113881691764742,8.187330539298863,-5.232907804703364,-4.400888682594117,-3.2748141267843778,-4.233410998494653,3.0570371825605474,0.037528798392825635,-2.5619866162501914,9.210054706866046,9.938340537334525,3.752075504310966,-2.927330248270952,-0.16665334004541243,8.772733019616744,-1.8465672864416067,6.333245806685728,-5.58153699515316,6.194734464130683,-5.128018697375573,5.271454393384012,-1.8374359014643815,-8.784991111719027,-1.9747821093169993,-2.051576488437437,3.3867932690246363,5.387690308232333,-4.775655007869705,-6.413729367496446,-5.573451969385628,-4.4241538076180635,0.8028416800026363,7.336333026542533,-3.4462439690636444,-1.6404317484936133,3.4104248478082155,-5.290187241350893,-3.93883075769174,4.285835476004273,-4.616995465851382,-2.5981638949831716,7.420661059463956,5.345006630846562,1.0057497750396287,5.228764880753907,-3.3970900237748385,4.9790064181299805,4.130362612312483,7.91590684313811,-8.284328894645673,-8.648662147776456,-9.573687379103685,5.5254957667449105,6.1855148835741645,2.3720627919713166,-0.8101033513016596,-9.121561088314145,-4.9097431370467115,7.693374110548518,-3.027378656218616,8.792892296507787,1.7930414015715535,-7.686461952748964,6.556231384892307,1.3717088506341906,7.117258765652,-4.446407774784234,4.393071650765972,0.1798488103708067,1.6876311385062763,0.6125608754846503,5.025738235432222,-8.244009276748336,1.2585852716840247,-1.299089448543409,-3.174293487890809,-0.9300274113633318,9.880549541641976,-9.762637061335852,-0.26348792134289134,-1.6063037104697422,-5.208290260066044,-0.680169882994397,-8.38959999036035,-1.268941162473098,-9.98594027641121,-5.627222732499799,0.7323823010179975,0.17334389843481723,2.12866370078682,0.08773526171355783,2.913672442608334,4.717483541832827,-9.118536712527066,-4.801158595680295,9.88663765810906,-1.1921436823771199,-1.7244724136009086,7.375520997778764,6.147412683740448,5.898188380053712,1.3241121533524431,-6.588462484040189,0.11710304131401728,9.561775526785816,7.6843755433254195,6.388337144891121,-1.1711079977431194,0.11160339308698752,-0.8976877028375014,4.034981146631001,7.824148420514618,-2.188478930290742,-4.771485554220234,-0.4964600362354403,-8.504184415915077,-6.762614599983047,-8.19304844176193,-1.6349345732672038,1.1727232647001014,6.895040365490246,0.18215450612498962,1.1977042163915925,-5.1649423801561305,-4.9676251222977825,5.420266638045955,-9.052048025503964,2.5906002653488116,6.236685929109111,2.33142232343695,8.962747457705312,-5.546106371875792,9.062663988412911,-0.3540183422825578,7.862742131996669,6.721902080233807,7.670251349142447,-5.132565859590541,6.9171447883202966,4.3443193092789905,-1.7211243160667422,4.078684169736155,1.658706025272318,4.385745860676771,-9.5034624860495,3.8908657324302816,-1.5846056739692056,3.771296466931995,5.360991998667053,3.5648903389889703,9.77656440179954,9.96010796428315,4.916980376527091,6.125526627296736,-6.581937417663863,7.986415985044317,-1.0750577960593404,-6.845932001529775,1.2860437128940116,5.474310690788105,-1.7763503102883291,-0.7910833943590667,-5.300691089494958,2.929450990735692,9.414773770739988,-8.148938717304885,-8.936028656677452,7.377676891659924,1.3843028921011111,-0.7341059275951238,-2.078441845717787,8.33902781288495,1.1964299361343826,-2.722103809789072,5.23122415355135,-4.89928745818122,-2.8647441819567554,-6.8549618273699515,-6.218920918021822,-4.179135118859922,2.226229223918086,9.908931132485439,-1.5879268263369912,5.304176153178474,-6.493822982779919,-3.764021363127849,-1.6488470140627527,7.975071083100445,-0.6728132861160478,3.495781878128641,-1.5028194743598426,7.576606974613263,-8.322837139808357,-4.141449969721435,2.0460891028722443,-3.287082818944045,7.919244694582311,6.00987814047636,-3.479210364487053,8.20005999556263,2.9379839698943027,9.60958420548641,5.860740943221277,3.296466595502771,8.281968482911996,-7.056188008861777,-0.13711368346618968,-4.2458286215624526,3.997231825915682,-8.417876854771034,-2.966793094662677,8.285782993298337,-5.156912964924376,4.693495726827434,4.849798482132066,-8.30589425588813,-8.731322723980508,7.588214999635653,-6.148384865662752,4.633905340982958,-6.149636940769614,-5.092338377689987,1.3442405256468888,-8.527559070510017,4.80863185415717,3.251193159300543,-1.6958241264077678,9.762802652993319,9.71601461218301,6.647001133402156,8.418007583850414,-1.6770670338061588,-3.0171554208012763,2.3760236768880816,-4.989650424945018,0.09117024922330685,0.4561778393099445,3.1872128802125914,5.9375816449981365,0.8073172506156681,-6.151472074306106,-2.917094413586576,-5.953769813650274,-3.3766031733943453,-5.778776865721397,5.286131775175917,-8.499295049438961,-7.593106992761793,-2.992155485278552,-9.195959869359609,0.9380893299922928,-4.790749761414499,-7.371660005749073,7.8616921752575735,7.563317303072857,8.882694966521914,1.759453352511306,9.773487985640088,2.9877182381992675,-5.419768594161436,-6.3728005049701935,1.1710194301077301,-3.3431962082539073,-2.7875200960180058,0.8065352910182728,5.132243593142247,6.873040367656259,1.9869887053959623,-4.424071437295143,-0.9770760258233224,3.606375464571748,6.541279739394554,8.469721683528793,9.179711104969886,0.2966391308880052,-2.9674616387014874,1.2041790988738281,-8.671914774861126,2.7261230840191537,-3.6711114628018056,6.598485224807678,7.6718519984924285,9.249260094835975,8.223955838525189,-5.996566636235761,0.8403501043318418,-0.7123431323533183,-3.4788711672085926,6.113978159648106,-9.63027937072953,4.057838351339777,1.174644682159327,4.637369537825542,1.7128636262537213,8.44960074731486,8.046615984194506,8.628880135336576,-6.287528260246271,8.778631340569916,-9.355406589149428,8.77985455138204,-3.6587873905860686,-6.73519196786911,-0.5387194862936475,-9.454586737067112,6.8776285852020465,-1.8116172948907732,-6.839047405731165,-2.1940901215780766,-9.934667077028552,0.6631400538787737,6.575013484878724,8.708963973291127,4.19147882292204,-4.559125935377049,-6.0415224088699855,3.1259089332809715,7.884426039789538,-6.166475985856361,-4.348596952815482,8.678441848500459,-3.2196945276634388,0.9205744220608416,-0.7722009522394799,2.764031632113726,6.429690137583918,2.8602743028089037,-5.649766617821241,-2.6369198102343976,7.9739924359588485,9.390129291892464,-4.700974944105334,8.808406657555679,5.008455202037194,-6.159061544635889,-3.037303112194829,6.03599888398729,4.345224669176943,3.182972469395196,1.1870780929444145,4.9894130902513325,-7.49561084518562,-6.422076174959265,9.564191392527977,-8.126910350216152,-0.341810191499075,0.6935619442461842,-6.011711992823516,0.44212897621369507,2.8547117918860376,-1.973637590862264,-3.04433227770998,-2.9620707735420426,4.830145980493105,-1.4117965280989466,1.190640705108855,-5.107612117644638,-4.601288325834414,9.262811247799917,-2.3949742129482594,-9.973854727206259,6.29645669645296,6.545493067671032,-6.458601041078149,-2.3764141354568125,6.808747848309714],"qim":[-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0],"qre":[7.253134928114676,0.9065826663395041,-6.555599820349855,-2.0650955458374343,-1.466797730323729,0.8552357715232366,-4.917976049698179,-0.08285109844924846,-2.7831030704596205,1.508489649721319,0.11752613393465865,-3.193472421907401,-0.8161282869907047,-0.8613898591482915,-0.37046818079422444,0.24808768031789452,-0.07236176514685719,1.1239711321340025,-1.2950086938141228,-1.0752715433285711,0.396089691699366,-0.22891234714642503,0.7820757842522326,-0.044234174642780844,1.0543885461655347,-2.3861251913562795,-1.1494887414933617,-1.775607216190921,0.2635015111674644,0.23134163617384637,-2.741396425186186,1.217282597689966,-0.44073125140632285,-1.4213973657409156,-0.8092974107064203,-0.5213064112002702,0.7667957430795067,-2.0716718671126717,0.42793907976925954,2.7765865420680527,3.870502906415834,0.0935312299682873,-0.590770985034335,0.2819409422664443,1.0813360008271375,0.40819959456391736,1.1550289391603252,-0.2763144034204496,0.338570545439874,1.3390211950331443,0.42589921228128486,-0.06201504793428465,1.1565078537091615,0.7215343914566468,0.040306186908860286,-0.37113695760783216,-0.9592655888912442,1.3096851850924205,-3.2675073907601964,1.1959949202344378,-11.406969934078473,5.7327400699367415,-1.0066667445169268,-5.072537126793048,1.3265534491207593,0.6958319772945296,-2.1390298718409917,3.771800235378231,1.0353420819057502,-2.8586770988824584,1.4152395302593914,0.2786488924585483,-1.117784394430819,1.3036624948997424,-0.5764262584562064,-3.406509695641883,-0.5379400103261189,-0.362079981318535,-0.9208289574920087,3.074587222567753,-0.2937117991840558,0.640056688922689,0.7728936372608574,0.5595131371068763,-1.791775422588347,8.886289541592381,1.7864145164060241,0.3318624704654603,-1.4020433651198267,0.8966204072564109,0.5988164774488698,0.4919463037523292,0.4872596271447995,0.784402222421051,23.762796252813466,-1.730686601502983,-3.727556233481547,-0.4172621509653212,4.746063431955921,1.2542952947305348,-6.248733571303716,6.513008587200754,-0.07415844308843907,0.7576428659591743,-2.593230008833169,0.8079336504597352,-1.4184589104479315,0.8554956091088126,-0.8472573986113154,-0.9646972799446982,0.6014540329824786,0.41873041493094865,-0.4913030051241791,-0.2645211782864398,-1.53982498007612,-1.8813390011197857,-0.4389425945354772,0.3118872638476049,-0.7851256268716261,-1.1400189920804085,1.0115465697827613,-0.6732157606956292,-0.7132844390242412,-0.05064124091096076,-2.6886055283350965,1.515323683560362,0.8882055661372784,-4.9769751086597385,-0.18501638599189962,-1.9426247966078138,-5.72426682681945,-0.8752521468480348,-0.5186704401600083,-2.0122150107737498,-0.4196543845301626,0.9740792305672866,-1.3680258974643003,-1.0337598322877535,0.39507030957030875,-1.5717943992489716,-1.445855603219197,-0.03240288244465513,1.1542689014591485,-198.78295455378824,-2.6814320816526567,-0.6927195615250491,-198.9162256869109,-0.02194046472378892,-1.9729573802601876,-0.20738146949953878,0.9281742177061845,-0.9985083458312113,-0.6491553268986259,2.21707002460927,0.6570915348630985,0.45071803429460605,-2.204979694063927,1.3998422966400514,-0.29809229564899786,0.5558350270328013,2.533879846041481,1.037132077778493,1.0678096914348916,-0.5728125565909784,-0.796754916064253,-0.26392661284934144,1.9209752804163855,-0.6115214086374016,-0.4989360588133947,-6.942922916331854,0.7522504455738969,0.4304263578753105,-0.5823415110373014,0.5039589926055312,-0.427106044828504,-1.4787222174102412,1.6115398589915915,0.14332728800186864,4.8896396008977705,1.663642641955511,-5.730618626228688,5.953927214861792,1.3872181150769929,-1.0304253960392815,-1.2066672632931696,-1.520580537289924,0.9245649822078785,1.3874628062495657,0.27366821301502375,-0.11389541703615971,-1.9095852545149914,-3.5504037675823192,-0.8670697088088924,-0.42732587706725705,2.3388187280561303,0.2111801310896856,-0.9076936529546452,-1.6340571388034706,0.5500864234303586,1.546317008589899,0.8935009211486976,0.546397544192645,0.08176982492392028,0.19176182539467349,0.20904011100761294,-4.959581954465055,-1.6962453958689228,0.34458592051754455,-1.021140687372666,-1.0067949288454523,-4.068603478425157,1.2158719484345561,-86.1419702108722,-0.08500202648190766,-0.343131376465194,0.5886746895042261,-1.046481970443115,-1.5384868039646025,-0.17371828762784372,1.1961681653261544,-5.624922059981841,-0.5059093088929706,-0.0188183715795196,-0.5406711876989634,0.050288135870186663,-0.4194664828386153,-1.0154953746271411,3.7214108986564978,-0.5398516316429774,-1.0797601145647728,-0.16391624480442113,0.21748435516375458,-6.000965984447561,0.6442734797928921,0.8212751191799087,-0.33303796679929204,0.7406791731798551,-0.023051798360875102,-15.316104526219796,-1.866409694885565,-0.7113463886288455,-0.12443480590980688,0.011743562914759162,0.2461005614483974,-0.5842492364777323,-5.655176402449507,0.6552710749452443,-0.4981159767904209,-0.0865541620407885,-1.1904808964490008,-8.074021305231181,1.5772565141566337,-2.3335702696579133,0.8655762239650581,-1.1171623929317416,0.05741239255941923,-0.19265121018925876,0.8562584927027493,-7.3964419072756895,0.8764366289487482,1.8031490926883336,-0.6524009546451801,-1.228328830120793,1.200598003077658,6.125385339112418,6.818770026310808,1.2102560869595553,-0.04095418415923888,1.5456307339244484,-0.6948012750412724,-10.79608020317931,1.0513164110313764,1.0142222169456347,-0.5329706175527645,0.1953038271925336,-0.7188184554732038,0.2370828126594801,-0.44975892894657316,37.829780188185055,-0.438233465799361,-0.7512806579549739,1.1307521849812083,-5.542083287673507,-0.6500867252911895,2.912579556661036,-1.5094598154588188,-0.8166224440525682,1.3626134048790306,-0.8367555096942292,-2.653507032528549,0.3628392012189865,0.6995153401052756,-0.1740871602713973,-0.6507466552154771,0.19328639845119783,-0.08327477133858609,0.7885606849466397,0.40986494293182657,-1.0433801429288923,1.5520375351576483,0.9606155012457395,-1.2540497321690562,-1.7465400770485386,-0.07931536891353086,0.21042442329345482,13.840184725611719,0.13365325988984328,0.373410763197501,17.933324632450304,0.6396262935488533,0.3703922574620845,-5.970317066980582,2.322838115171293,0.5582213169230634,-0.2633103950100957,3.5899497660813964,-0.45967716863768854,1.144012716874186,-0.6782866392845449,-0.4267442976239436,0.31739744265435793,1.5373842737922834,0.19485427422562662,-0.8060881524313526,0.16123749738776752,1.7325355264180353,-2.5941610414738463,0.8798542601620187,-0.8960277387199093,-0.49919741743509294,21.525442793966846,-0.9167919679071849,-0.5183807339422032,0.9687524797374223,0.41418961803460197,1.4421798521835727,-37.27904658600168,-0.9392968366580716,-0.8310493069957441,-1.2070633913741788,0.059253717677579726,-0.834597901407642,0.6014166317428717,0.8592558114199934,0.5046282039048668,-1.1954868922118855,-0.5219006687474594,-0.735845399780428,-0.4908227275665508,-1.2478955879177993,3.6730952152873155,-3.443204108099114,-1.2425588266114878,-0.5682698401857514,1.1827569197745544,-0.7115113130051975,-10.754618320432758,-1.6139617632706145,0.8251645397439976,0.5446157405001378,1.1180367830727138,3.025336375645916,-0.9993445499845288,-0.9539708558351778,-1.3068676102094343,6.6130599332630196,0.3616975067046898,-0.42295602418748285,-0.6335342174546963,-0.0146483748244319,-0.20801313411281874,-0.8453025913880231,1.0300303136521087,-0.6026728209479756,0.6638670703845981,-1.7406517929212513,1.6023089381352507,-75.59095233793836,-0.8393411877191956,0.6072846396430184,-3.133052927443736,-1.3092365333723592,2.895905356445802,-8.929021311429558,-0.2826277346219192,0.497811380263002,-1.9715773491854258,0.79122969104337,-0.8649565268756679,1.0969835529655427,28.23014394835392,-1.3758990827794653,-0.3568349856730001,0.7529987143706582,2.346789445102557,0.13336833431271575,13.999681121555582,-0.8299900351156855,0.08125655735345262,0.7400781088583035,-0.8028498932180741,0.7860623702448036,-0.5348581080689743,-0.34839243143548004,1.8669053901573422,-1.3363095388317623,-11.217420380409447,-3.1054197465080953,0.04185042247588895,1.1288103734864476,1.2086764133977452,-0.9576657779155752,0.6948563330775474,-0.5578665753200327,16.317553025237046,-20.532149179115628,2.1103452474413134,-2.780246796043443,1.177932567263264,-0.11050984365763347,-0.14269224233371355,0.8632373100250119,3.1650020260606935,1.0191178782374535,-2.4507611937423013,0.23618448590603577,0.9033860813021569,-2.633131635276166,3.901236069319525,4.856989595870032,-0.8863541235330773,-2.3755372869961784,3.1474188430591155,-8.491997333170932,1.7408627892416675,-1.8167364575976779,-1.2460623925514565,0.2683010634859591,-2.3583753554234264,0.8186255001327483,1.1106089380697528,0.8213838270369409,-0.27161887180998884,1.8116671716115291,2.4430423606358804,-0.7673093852777529,1.315493585481265,-0.5809475759294105,0.8353663989452592,0.756194748420763,0.7749445529677327,-2.7895088735496256,-16.16212526212927,-0.5030241716386014,-3.4386897671899157,-0.32551681900303164,-16.21948280979206,1.2756825065448263,0.6605375301274294,-1.309527418244795,-0.42739755466686186,-3.800273184969437,1.309148539527368,1.1264788476737606,2.8591414345071278,0.9353612591712654,1.2670737746739607,11.78024765728628,-0.6540884812955533,0.541586236613418,-5.099405280616186,0.5071887772416681,-0.3515078251302616,-0.1541092021544529,0.7819310699881861,-5.23146519939759,-1.058236288872536,-1.454131111099212,1.6491083874075703,-0.08886301237755936,-0.4056539910300371,0.976253043152103,-0.0955160776704664,-1.7284154964769824,0.5013197684142319,-16.455375191453708,-0.6274710641779356,0.5848449239997334,-2.2947414413513747,0.17486174762625115,0.5607775875142763,2.2969552773705684,3.3089777874457775,0.9132983506482466,-1.3508523437793916,2.440395312770135,-1.399176235016946,0.6545342953667513,0.6160814955259811,0.9892342296430299],"re2":[-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0],"im2":[1.2130343760455613,2.5014144378140415,0.6466296785972343,0.8427820699182433,-4.637304900791559,9.212365537900975,0.8441779707149983,-8.219241651725431,3.3401332422711363,2.705091817631679,7.6381039653171285,0.17784800150252345,2.9296170866937565,-7.326585119467543,7.644884001524105,4.867398414409223,9.941312587276329,-0.8635303895104034,-7.084525657565781,5.417794956282098,8.706919719155476,-8.466504283540345,-5.096419964695951,8.297014598293377,-4.442715521970364,-1.9318269057692738,5.39613378140735,3.566623737931444,-9.204105311665101,-9.011971906614779,0.8588719520576671,6.3375883253517635,4.269826488998303,-2.1138769382301748,2.2719659907612346,6.6801578813401505,-9.047375972560094,-3.5404848418713497,5.506977877633934,3.0470574718467542,2.371573859831969,-8.332299269714333,5.538214449352063,6.30298795314328,-5.201339407649783,-4.2799675159739365,3.590005804863015,8.248306197149493,-8.25008770126283,4.437060232669561,8.158741850865287,7.504330138983693,6.261410811170467,9.678355164880049,-8.898842658634889,-8.233191091496888,9.121374489862749,4.364821964963523,1.7194589208932332,7.632318358502644,0.298294961497902,0.2254010939293778,5.8099825959826,0.8414017439729129,6.309463715765439,2.6285380379045833,-1.6701144160733588,2.5851773095123747,4.3595160480527895,1.302300528286107,4.945598124174019,9.850092436978212,7.544683874838434,-0.9790622399734428,-9.047325517438141,2.7526489019027096,6.898886703041029,7.134489289262998,-7.937763640608884,-2.65246366476579,8.869287889343525,-9.646026470479995,4.632452610351178,-3.8187214013050808,4.521471612833501,0.5140283518156963,-3.126137921746384,-2.4995464985229248,-2.610492107076521,-2.5773206046576913,-7.441988831465438,9.050244652527354,8.562678406843101,7.799837014910601,0.1565492132024282,-5.367630624528679,-2.4607337370993747,8.616019424059647,-1.6200418763819275,6.4175827128863325,-1.5600979854015087,-1.0499138601720652,3.9910973118247135,-9.33131405674244,1.570763903595072,-2.4969439025371916,4.619360462919953,3.4604534111998326,-4.576606784612425,-6.4877173362433105,8.944444054284912,-8.674787645378172,1.25512465921161,6.607585032276294,-4.074238714750624,2.763316522066594,1.0565788392743762,-6.979688761936882,-1.3841489044180015,6.031651907078825,-6.085270882880051,5.784978596285871,7.400670637424664,6.768784392726438,-2.5845606949330318,-2.3544068336435053,-9.69537284884722,-1.9378247329050282,9.05718197282335,-4.950217735878195,1.7110103165681867,-8.44566188194442,-4.231721021485216,-4.2375002052479545,-8.129042123546027,8.405199784960722,3.825152589876261,4.257167424327919,-8.289193208029658,2.693361803883157,-2.114344735223943,-1.1581932087963374,-2.2195751899851945,-0.0463322155943402,-3.7063554976224466,-5.41644225557977,0.014716397509364043,7.595706934353071,-4.446488863565731,8.904205814038335,6.823337349681189,5.589875155732216,-9.542761504748572,-2.3129710114949216,8.022404967494051,-4.076686002458391,3.984159643451271,-1.41071756015441,6.882353279110433,6.093162726905248,2.1262611629549752,-4.604673898525076,-6.006434872189503,9.729975199139005,5.552716046575714,-3.0419125655241386,3.8190668569937714,5.63552464457884,3.2878596756366036,-0.49120880195657435,-7.032481366381875,-9.150998040953555,-7.359659915656859,-9.161450700543979,6.08318221304129,-5.018292801781341,3.316707682421928,7.01715485627912,1.0693558845919586,-2.0419589749044693,-0.8688427450644465,0.6937207095851878,5.706317382323661,8.039717311402388,7.167396026119913,6.296073864108852,5.976319537378458,4.458148251407298,8.667659154996915,7.112694894865406,4.7767236716702115,1.3828689519417807,-8.872843823730193,7.084473041968707,3.7595441626277086,8.490578125505902,8.468123499298098,-4.012241205771465,2.49362426013019,4.602716471535352,-4.9763885739120095,8.040064779678243,2.1994520660664296,8.80066267116976,2.9303508907070075,-1.0133390841354295,4.860151306424175,3.6524570411748556,1.2721943847775652,3.152869960847884,0.22858639734617725,8.126307671102417,0.11333194536225832,3.0997839963141782,4.681308153795955,-8.84748461744193,0.6499585298219621,5.4531504389512975,7.304591703042501,-8.348274570313768,1.000409014114938,-1.447655317156734,-9.211418623674685,-3.9370762659763265,1.7446513018505367,-6.946138873577974,-4.645499782374629,-2.4502902154177697,8.893477974806729,-9.156327896121763,7.272883073910961,-7.929179146253851,-1.2290556248599938,9.541619943314434,7.181744877335866,-3.9758594675496255,-8.895163685722196,-5.079995906643518,-0.6242955256943379,-4.117196542850454,-8.980627788390056,9.41141820554584,9.503367410475214,-3.6476458954594033,-6.9062668715781665,-1.3835374643884908,-3.3398070111268314,9.57906547179033,5.735830889350929,7.1434866710432665,0.8375770070858657,-5.19449332954113,0.7006151023285341,1.354846901094458,-6.171923087560942,3.1727384629802344,-6.216956619244587,-6.031989666874047,0.6716236245175207,6.184436454404416,-5.020132867664411,-3.970871358944832,-5.077374865894663,1.941884225577999,1.4632136529395936,-0.8133587656535806,7.488220126353944,8.644253317464624,5.087076725003195,-9.67456785371402,-0.7104663178478106,-4.882037230404615,6.820147175587927,-8.151142232243036,-8.812547817457927,-5.674150599056511,6.996314944410173,-9.751325829037079,-0.2512164342159622,-8.878522605144125,2.1092060033630933,3.3352104174750448,-0.9673243292086156,-5.483715018780256,3.356668620240999,-6.59845850964615,-6.021118342187728,4.495425192034233,7.866022202912131,-3.0097587408441857,-2.962904207835317,-9.786678874689834,-7.387355339067529,-8.41235317448606,-9.190249932339825,9.499676572423219,-6.721982455736613,7.147356809247654,-9.023339992183097,-5.2504778606898554,-9.302398977623291,-5.883081589514947,-0.7925972671869239,9.255531905745048,-9.877379313613337,0.6025228693265419,8.951745263231722,-7.289837567829618,0.2917040906115904,-7.659609224315016,-7.734352228596483,1.148173832388565,-2.6772941589875803,-7.486520116959112,-8.454771502024176,2.7601865703267254,3.4544391905367267,4.636466076768102,9.57386244498283,8.820320234120121,-5.194896972936003,5.187428555795128,-3.4529049403195566,-4.336724051314407,-9.320533366662486,4.373132244091796,3.208296249441716,-4.7069726854068055,-2.2835108941999334,6.5847352252607365,0.36790159303026826,-6.55533463517952,6.711689182636498,8.464556392965552,7.093330788529951,6.663235650488911,-0.15721273691108806,-3.5095046281974973,-9.965676420393681,5.845747670989072,-2.314009801246115,5.08727449997345,6.646360634111378,-9.796706339244626,-5.879166229127337,-6.930885689568718,9.88102386858549,-6.378372044220086,-9.880957440941811,6.655920844905857,-2.377102201881671,-2.203823752936003,4.948164009610448,-8.154410129293971,-5.199408972337103,7.157072958097558,-0.1249919323583022,5.28361902033499,5.827482426291633,5.969701052552887,-1.5167874188782182,3.227013938543921,-9.722387150991544,-6.96771928905823,-6.4413621686602,-0.25359924917218457,-8.34165390933881,-5.617661272120495,7.8758972877448805,-6.223915643614251,-2.193024210973766,-3.7704993604468324,5.764472721143182,-1.3395614047200546,-9.266120204971717,1.6758632745788624,-3.715743994150844,0.044669409088786693,6.8848960950248355,8.704537263256448,2.7127837436099593,5.799644906946881,-1.0332366279231167,1.0298956121415408,-3.319169405816478,-9.623624431573797,3.7389656605634762,9.936042926916208,-8.744158888993546,8.097382082446707,0.06232534115767052,-7.103346537521185,-8.372828781248433,-7.197580142870727,-2.7155399553502324,8.780340821847407,-0.23880516843389543,3.3584982687526796,9.925787127677307,6.934732336644313,-8.560803738924294,2.527774869540128,8.271486157829028,2.804527129930692,1.931739810482739,-4.89503333569939,-0.7550507510907458,-2.956029089237311,7.088079721510727,-2.628839801973271,0.9962791409892127,9.055262258338331,3.9232902605133386,6.580626309607794,0.4043795791318914,-0.37365070415014756,4.3828184540184765,-2.9579948982330144,-5.090755449751945,-7.604300906761752,4.992164400131616,-4.030028738108868,1.9317454173190036,-9.44962263578864,-1.6557461256122945,4.973420153543238,5.133319666759924,-0.6505043664761843,2.16587783901749,1.6567085074748071,-9.735251302200954,2.646781549026633,2.789152565420107,1.1016732839288466,5.043392624416201,2.0139340383052513,5.405180357042978,-2.007891729142699,4.008940610460892,8.40143458038721,-1.631192792342711,-8.326250384552052,8.077826503575768,-5.483715349432194,0.2714402601296566,-8.568920973772112,6.620301360196301,-7.214900270848769,-5.457636243369903,-7.989373665298656,4.033719472328659,-2.826456698005293,0.38153868292962123,8.644906543258003,-2.523764118329421,9.891023565309087,-0.056757322835538915,-0.6053237763140444,4.18451867766014,-4.9099316654261855,-6.692303855220616,1.4866738107583384,-2.0142250711950416,7.078688119555526,3.284247913923565,-5.02583883821575,6.95177094942418,0.42515703809837824,9.416251349414736,-5.6081615574046495,-1.1836672223192917,8.567272905383131,-9.055196618213696,-7.7028371852492565,6.380886093101168,1.4327937890227673,6.068659941534854,-6.577255186637318,-4.928063196010912,3.846484407334728,-1.7097377557782458,-6.157944433558988,-4.628843509875422,-1.6516351523720871,-3.936883632387465,0.18500533973185185,4.720649194274353,8.25884911073505,0.6152311988872867,6.809040406331327,-9.108088895429702,-2.003211978555248,2.7992968955376227,-2.6223349809493683,7.3833789260057685,2.580097029159486,-4.6781048047115785,-9.867475374165442,-3.8573048415095528,6.882846998497701]} diff --git a/float64/base/div/test/fixtures/julia/tiny_positive_imaginary_components.json b/float64/base/div/test/fixtures/julia/tiny_positive_imaginary_components.json deleted file mode 100644 index 422c83f2..00000000 --- a/float64/base/div/test/fixtures/julia/tiny_positive_imaginary_components.json +++ /dev/null @@ -1 +0,0 @@ -{"re1":[7.111284923931137,4.309818524809481,-6.334477229245429,-4.007329188256898,-9.287072571274852,3.6500696623244,6.021803278014325,9.522792162592228,7.950270020363625,7.404116261478979,-2.192436446139343,-9.065622307171612,0.004911465822260652,0.8755424916748193,3.441296184708378,-1.6513855797359493,2.7477428335744207,-5.2330616497620985,-4.833520612007847,3.428960896996358,3.7096824617006856,-0.35506475281821714,0.6825944502107983,7.444630983536381,8.292987521191055,5.0577360796556015,1.2946268053700933,5.407046483802551,3.1081959841535944,-1.5654894513547006,-1.5391007112912582,8.542869992854143,-1.3629346148581067,1.0522873693380461,7.406701459172105,3.239661495462027,-2.246227322766721,0.3198785790854757,-6.219693344177443,-2.065387121322284,-6.79230570337233,-2.1196626526294837,1.5583075865751326,2.8018971707138167,-3.17331363232811,5.096741236303705,5.120772312940584,0.7556164969306032,-4.848690225486458,4.579486046277237,-1.0962342066248354,-2.0593040945600034,-3.508765231497808,8.005203056552933,-1.973860776139169,-7.37023232822639,-9.936698159070588,-2.4125652548411374,-7.345286593115614,-0.9082301564932145,-1.866207426557601,-6.135100871304808,-7.418676842519756,8.59952807902675,-8.170694681854393,-0.8824708878690473,0.6959543945762707,-4.503656584256572,9.34037915679066,7.656846198456503,-5.040957191113233,-5.904950882936831,8.778040696504025,-0.785903730127,1.5438748637335937,4.293843864009062,-7.305686890563052,6.504581285116167,8.978671184058605,7.000804963314053,-0.7552084340058958,7.659761882091267,-3.0262386408006092,-8.621717639204029,8.229258223381155,5.649162655806084,9.324323209661294,-5.211799239030219,3.0715309235958017,-0.3027060939226658,-8.741872725798316,-0.7307821320852792,5.481994932247094,5.374204058371143,-0.2863076519233694,8.898355917092655,-0.37896222006889246,-3.858695689557406,-1.236370626334292,9.91357971766202,0.4010829054012639,-3.644613385331632,-3.1753199349747323,-7.835267227974601,9.955880921636336,-3.5934091451937444,-9.074733826411379,-7.031814933932461,-5.927811971303301,-1.3898153389476384,-8.183303831233417,-0.04683439517683041,-9.50174793781797,-5.162824431168094,3.006002459503197,-9.655901251791402,-2.9367419984296372,-7.5565488284626925,0.3549877803015651,8.596903608048404,-7.024082563230316,-1.3014389105686508,2.584955862946332,-1.2338220535779776,5.597283278081033,-2.3711829365677755,4.513489344150871,-8.21131383783117,5.4502271263274515,-1.7491361386575157,-7.645613384228094,1.4248006018123647,8.13201421517763,-3.8759974941100506,4.636696279125248,-9.68609611368598,-4.5730364224253295,7.465533613320222,-7.784143841960789,-9.948230441951505,-4.612642531441853,-4.250772365705324,-2.0415182986081355,0.21452575708327437,-4.954073979738176,3.9571261176850197,-4.375462164754729,9.503241135601183,8.377692989934868,-1.2749261941663743,-9.46108688733041,0.13484866616570557,-8.763676494380464,-1.8580897622369559,-4.687743820839934,-2.5976616516094975,-8.854714022741847,7.917326942444451,0.13895488561399283,7.053611915110508,9.333635190054657,-4.251013392259837,-8.306432942011245,6.634154584032402,6.545458648048797,-8.959921238091944,7.178969560688284,8.810102198840163,7.669793469246187,-6.131551275662788,6.172557989592104,-1.1710419370405276,2.717792583289194,6.2161820664435545,6.445300809556727,-2.696250965125264,9.191699568990789,8.561703858570002,-0.34274207964120684,7.882663072880437,-4.060889359866621,2.085607277495928,2.7577421007884624,3.7328512529674267,-0.6204565156181054,3.47226650947556,3.672317256522298,-7.585873493191533,-2.5717854524573074,1.641146042517903,-4.4065030342637135,5.890465854734481,9.61925999803832,7.008631261098472,6.683563955329184,0.9988941958628832,-2.214851504636486,7.203784118459936,6.618318239529124,7.496816800477582,-2.196348789058547,6.5509096587155256,7.8853552554557425,2.348569708879287,3.07144987393988,-4.627609384195706,9.451024285740413,0.8595905335172116,3.7615689437269246,-5.900427385018682,0.8538822275959657,-2.873540142338877,-0.43374563191844295,-0.1351688929826338,-9.332671120916995,-0.3428377002096248,7.252303318803335,-4.968450951671379,-5.099313835392527,8.638016581472836,2.2170628653469198,7.5777089921348875,3.0125309343102096,9.207697209804877,2.7963166173026934,8.022312415569981,-1.411076895407529,-3.602568877600369,-9.268749245805182,8.915309292456104,1.234022368428544,-5.730211977068931,-2.3832787086407965,-7.265511747235214,7.695961465914486,-9.238179755397356,3.714320325067531,9.2633095860559,-6.057726068971121,7.548366245443429,2.387752911316717,-2.0828384876188366,9.571346041363633,4.981554057933064,0.19858508944825104,9.945608098409135,8.430906507116458,7.016411226209421,8.538762177603417,-7.112429631497637,7.605172688819518,0.725597993535418,3.710825160768458,-0.9115544234292656,6.566125045374665,-3.234329855827389,-9.343469802284488,-8.523677321891263,5.463203997694892,3.533083938497189,-2.8345241712193525,1.5914364643017862,0.5637070295708231,6.933003789618503,9.607295534177382,8.952299256287269,6.352479969662429,-0.04451377513573718,3.5521352895066745,1.4782842802004392,-5.892189163298012,-9.553898603549122,-6.2999285345157,7.914423367588881,-4.042217735562521,0.8563205461490604,-1.4268006961874864,8.292082890427437,-7.117198225140388,-8.527058721757063,5.675072652873659,-3.1741795904429715,4.0585545951931685,0.9089080034356307,5.798281984328593,5.768780311399652,-3.393234937478695,9.208285096321134,-1.4267660038242056,-4.990431091237948,5.969456638634835,-0.511785734087951,-2.8399159684420745,9.027543745838948,-6.24868381885451,3.3751718271000826,7.078271470841134,-3.0656015429296124,-9.790610510563608,0.7862997348966889,5.63233610293131,-5.362291151649467,8.735080053218386,2.621131822933453,-5.374483483994224,-1.305102457252831,-3.983401021268702,-8.736529671705071,6.678259781090169,-9.591986815417112,1.9121211637039774,4.426099371569052,9.108276813884892,0.2501314035018982,0.3960743472164765,-6.927165972928401,3.0611420466294845,-5.980117428238623,-7.898856226788393,2.4235007279963643,-9.099203309846885,-9.659816881777719,4.196787705408694,6.893366266731157,-8.165435971394013,2.6470546649133375,-0.1617163664027128,6.153254660723036,9.8296771113016,4.542635361919245,2.4227728395579327,-7.4783432337235345,-8.28469712597095,-5.419776210474425,-2.9835504021045933,-8.44837504603996,-5.4054080050669295,3.199177657802876,7.1555167494712855,-3.7424454276640713,4.401571941106804,-8.634614880520086,-5.254774257544497,-7.450116408164307,-1.7293420079895334,4.374401420173083,4.229537459593548,-1.0177585390380024,7.8044888641570545,0.031136907846288864,9.872404164672858,5.390400484086083,1.5612036289134856,-6.882955394606263,2.172660327333391,-4.813944131133756,1.9237644652351769,-6.516269476833612,7.105251460460725,-7.782329394408549,9.920425318067998,-6.423179126263734,8.975750826561072,9.963509861431625,5.921031473949554,1.9337618108735395,-4.081647273774321,2.182288958595656,6.8607562654868985,9.86250857305712,-0.6578696364564696,-9.113049726242565,1.9472559439606378,-1.3967303660823998,-5.681712042131998,2.863341018972683,-0.5487608018871892,9.603409018475404,5.8908566891400245,5.45904023885981,2.094630958407233,7.92223399859936,1.3817802617058756,0.5452784722027975,9.369631581515176,-6.84197111758299,-6.5872435947700385,4.120336036730592,-9.38038653160559,8.378066010394878,-2.692788884052244,-7.728820956686729,2.6533538650208683,8.648737813615448,-5.832565652240193,-6.497712873630988,-7.745140803171524,-9.682515111441646,-8.601447199219866,7.8992526664488665,8.037963783029,-1.9239126789905114,3.321908844242232,-1.7869827331480188,2.89449924771732,0.48646390002562967,-8.884539913045963,-3.256077609479206,-3.377804713622494,-3.626997543903487,4.669078780334763,3.409514788819582,3.7994791341367407,0.5301800541973467,1.3000079915595784,-6.385098949326878,5.3456266961504575,5.708898440894686,2.598256135636854,5.79965833664285,-0.9009832308073555,7.031066474519026,-4.680054375933718,5.385225840591634,-9.466184096453123,-0.8747899341086214,3.7189248668033166,-5.396140260658138,-0.4773755545607692,4.54527848184453,7.672205451103856,-0.7619213055102758,8.805245129369109,-3.4658123084329144,7.991109013030172,2.2066786272160304,-0.11403368939165937,-9.10484226705245,-6.4509605687228415,-0.6104874340915885,9.196681361248377,6.62702715449965,9.688085166788323,-8.90300470132887,8.867883231375618,-7.482915984096552,-3.5631816980480586,-9.836216855053754,5.767357808764162,3.0686967381863255,4.461407177550871,6.729817514568126,4.09094576536183,4.89929401680811,-3.645653984590398,6.889593370526409,-5.87445523547477,-2.218862177310788,-1.160438030715472,8.336728177312825,-1.537705500900561,7.126708224390637,4.326064206479074,-0.676470269549494,5.72160247508422,1.0967699027464288,-5.19327549831178,6.821812616421969,7.09133579941868,6.4728906696769535,4.594397847842444,-1.9503617464254663,-8.641484831799623,6.840579027296712,5.659547857547301,-8.764207409007746,3.215581660161895,9.059498377813828,-8.561609485214312,-9.836749524079096,-2.1928836845145616,6.011937209484394,3.5534208773208658,-0.4915286054423067,-4.144509662355809,7.047504769457028,8.370214640110994,0.9205296567376351,-8.382592079563388,-2.5926371548686555,6.837084690505289,-2.0050551332915916,-2.966077068043546,9.842515986402411,-0.6697118233917898,7.268166281902047,4.196298911784158,2.52473352581913,-2.2041538355313017,-0.813299826881055],"im1":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"qim":[0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0],"qre":[7.885201297297603,0.47906548144084693,-2.9416074729199417,0.4064223383503825,-8.33574420532809,-0.9420434899748835,-1.9364992927403093,-1.1143334586725115,-2.4395972771486067,2.577346686066119,-0.48865644776694755,-3.7138795873156534,0.0008608949947905768,0.6639836314048745,2.062757079289087,-0.25384888024926777,0.35171461396280396,-1.2594445036154405,-0.9034435588698215,-0.41143354259237225,0.7476255931644863,-1.132102634106686,-0.6053666102800167,-1.3487301032728696,-2.5718223069331843,0.5631640427402568,0.33880174223636267,1.5969610332741633,-0.4177459189081941,0.9151661336420506,-0.3591833029419582,-2.1834374638762086,-0.34324958409716866,0.6939937431815892,1.0233779126373002,-1.099767778001886,0.28983916641595275,0.04228413069294783,4.154963801030291,-2.0243846285916214,1.0528234789179496,-0.30776459933692,-0.18630375649252034,-0.3332746405190238,-0.36406255436088136,2.742808701326774,-0.7303588492889805,0.13453190075521285,1.457627620186489,10.207397525022106,0.17115953261559003,-0.335380357478966,2.796441954240329,-2.686023467395936,-0.6434886005016708,-1.3070988647480617,19.356948163351667,0.2886406633640223,-0.9271262541963228,0.14150937012480813,-0.9705991325129678,-1.1428907243071178,0.8000801821456673,1.0800128552366994,1.468615874241175,0.08975736966704169,0.09842126287792882,-5.161387111801499,1.5992260286422233,-2.3883323439523703,-5.019126107982078,0.9100194122177324,0.951243177188558,-0.4611926139478672,0.34160811630699195,-0.471892480122808,-4.88359496059556,-200.2905083266967,-19.937972425683604,1.7516868125205953,0.10363026855780245,0.8890401622351246,-0.39247464488061345,0.9641050402131139,-22.271384257882204,-0.919014973375275,38.12260543429001,-2.395909234348377,-0.5285885290348766,0.034876545681198384,-0.9143162620023348,-0.0930643521468905,0.8538245784611953,0.6624011428899362,0.03488522190032331,-8.422384669622431,0.07503156813800595,-1.3645641910866386,0.2056645831730461,-1.1434187763153836,-0.06357235822971556,18.378842760441856,-1.489279908984431,0.8337430861388788,-3.622175162270829,0.4142816536914308,-1.7084480892648344,2.372744721908932,0.9965720274607357,1.0185547745768095,1.0386340325726509,0.009143484712400963,7.832187963482005,0.5817435240220107,-0.7893216870846882,-1.5399529247661077,-0.41186001532166344,-1.1160425180797104,-0.04294051163607493,2.512572240324447,13.018443160967442,0.2015721664795929,-2.2364821867994973,-0.1888847236913363,-0.8577232184667597,0.33208122511706784,0.6390698209156949,0.9934060573132012,7.155202839706864,-0.22232889485381818,-0.984169529576188,-0.20415123463102966,-0.9315309640885088,-5.600432824762169,1.6069377409295686,-1.460989085188642,75.7693886098767,-1.8301449690894656,0.9550654077065651,-1.4508137333251054,0.5254349559083111,0.7227193908143708,0.2714982730023354,0.041143950655782795,0.6569290686021747,1.5019341435627525,0.6808502955450817,6.484277411049826,5.675668618105645,-0.20565519637354487,1.4929870489170285,0.016027574207349043,-3.5394912665098843,0.5711793306032497,-1.5807450996962245,-36.21555067342699,-2.672478987792455,-0.9665271006470756,0.08929943086801156,0.8580748995755344,5.28235833208427,0.9464514154165535,-3.760374299175464,1.2287907535062297,0.8895523659151916,-1.6515055004450474,0.831722020071275,1.37543658581841,1.0345407995359361,-2.002964582865403,0.661343314939569,-0.2636009404966726,0.9487884686338469,-1.6078642717798293,-3.999536323406878,0.6421327538657611,6.055848246595402,4.470019537722377,-0.08631134933603624,2.5678483596325434,-0.8299042614043642,-0.428007635424976,0.29172196151275964,-0.4072409429136102,0.2932919927955491,-13.747885321436991,1.336079073394418,1.4796791623242993,-0.483253216513579,-0.5435445323781045,1.345885072654138,-3.646395992969168,3.611046217781026,1.1850593666174765,0.7125125792669728,0.11016614406451199,-0.40453131713126306,7.608688445570774,-0.8219476324921396,-1.5282014841503089,0.3465095883631199,1.1723805614321352,1.0817085813681757,2.9620827743686347,-5.894043030690832,0.6098365652134667,-7.088957035291191,-0.12950483670715784,-0.8118323980735614,-3.90293188379685,-0.2670132000644404,-0.3331330623518673,-0.09530723092797504,-0.07133794583698319,1.0679383524885981,0.03870424744783725,-1.6919531821177023,4.262071171213179,4.337216638068587,-0.8839894616785734,0.9875437234748706,-14.889348086198018,-2.2610482135297394,2.355632496449496,2.120666745535781,0.9713470702338703,-0.3622664672690565,0.43688282593138916,-2.282671697953413,-1.329837142328496,0.13847221010195374,-0.8294935393132647,0.26488871450258955,1.9246419792202496,-1.1820747618038459,1.4584553223009928,1.3800228411300282,7.379136416227198,-0.7270575775360234,0.970835825107052,1.0245470813637254,-1.0139185923719265,-1.1928888307795613,-0.9753919328431336,-0.034333531597551946,1.356332999200756,-1.522558450837666,-1.0757280006673022,1.0445931174115741,-1.2235104016791991,0.8102794094811432,0.18752647555993443,-1.0666390097321492,-0.09454814985738025,2.517667066983109,0.32673006278662614,1.2629424309263007,-1.907917431257141,1.1264432232882127,0.38725735590526517,0.3410799043440959,-0.3774728415963562,-0.4450912992806767,1.591697540600502,-2.2298718103498776,-4.442646548642201,5.0032199158281605,0.0067144973207034905,1.544786028548652,-0.19177295282777174,-1.0544713977329696,6.744071221411066,0.6608425211963713,1.275302468777143,-1.7934273543348052,0.25335112994839587,0.1907866176328586,-1.074520828801923,2.5365852862942986,-2.561636045956398,0.8074056348276918,0.7331739887113932,-22.26227229291352,0.2787836847363538,1.020214404802111,0.6281834886707505,-0.45974533486804386,2.7154325925152376,0.4118430072845044,0.7664928227958951,-1.2177538331011883,0.9336079035954628,0.3658839390442722,-1.76990123036844,-0.7623328579499362,0.4825793763986945,-0.8961182795616552,-0.692714561126269,2.7391477105147324,0.9932215299560729,-0.6022622743336814,1.1767153565521165,-15.058116659021524,-3.1780711082413005,-1.2169386033996907,0.13109710577711084,-0.5935728197234106,-8.20900950577781,1.6559321346408682,-2.6725734968859682,-0.878938250405172,0.9037548268037426,-0.9835119977380951,-0.13572648730270556,0.044340233514376326,-8.170428583897811,1.0940569196041723,-0.778708141915402,-1.109332213825363,0.29046803534465643,3.150342687821394,-11.908335116083261,-0.42390143308792094,-2.6781024372976043,1.6974758338463602,-1.22139199168459,-1.155599841354743,2.332896458821549,-0.9829803499300535,-0.7498546671854446,1.1855297512297271,-3.187477081707237,-2.1137051315745436,-1.4605157359020493,0.530400428099127,-1.226772461395565,-1.402673017121585,0.33999129512232434,-1.4157951234935031,-0.3797032253567793,2.1006518937793284,3.232088410522276,0.5900378415743677,1.2458126434934536,0.2619802553506251,-0.6357355485185072,-0.533049479837425,-0.19912017384231742,1.8547011512688634,-0.006909914562238707,1.3967660637417603,-0.5888464864529219,-0.6213793194606073,4.776448027260072,21.812196831259357,0.554160818659049,0.25816302186866863,3.3085489146378633,-3.005277415977788,1.9878313017756326,1.2259017036427544,1.8224417878788055,-1.407905382904281,1.0788536929535704,-0.711490816623814,0.2545405475831662,-0.605955283688559,0.26840566257209997,11.637683208169486,1.0623194580740345,-0.13946798691898032,9.63051091772955,0.739679583919597,-0.24037638814793125,0.7339439926063256,8.349561362630876,-0.09702603149645905,0.9764759947258009,0.8864385778091892,-2.8755329813977735,3.6862548004652376,-1.5952661603198317,-1.2977034546358313,0.0559650795272119,0.9818645259447338,2.3668471106520568,-1.410723681073285,-0.457458980552903,2.7616280626581284,-10.908603889083949,-0.693612726181206,3.582883307073169,-0.4711254809663572,17.125321338707007,-2.8984370329491016,-1.5838036482765505,-0.9680218150899105,3.1065786562263042,1.6872652864722453,1.1071436376291082,-3.2530960006081786,0.2355584992277874,3.225793570185234,-0.37598019005305944,-5.5399039672056665,-0.32002960497304345,-2.5718221606038423,-15.631697552373256,0.35206779510736436,1.1000733997317829,0.5173846226767093,0.7551246519744901,-2.460741257865614,0.0635727033181243,3.0198547542697565,-1.646296017515394,0.6534752373843644,-1.803111830180197,5.459138784465595,0.8250751980428666,0.10176045887994588,-1.1033455193892823,-4.6721425632220255,1.9831787243782808,-1.5491570930644565,-0.09425963190253206,-0.8956698468057294,-20.41129638612551,-0.06601809474680305,-1.2090217804943917,5.168423939875707,-0.09858089480382913,0.9927642476801107,-0.3510457542002118,-1.6617184246074537,0.5736032749626695,0.015823215389565243,-3.664223603510814,1.1025653078808766,-0.0797925980268443,-2.1543791117088995,8.915943549666926,-2.7715879623598876,-2.38289905944216,-2.116577470142228,-3.298415721807241,-0.5053069230641938,-1.2597511102718892,-0.9372447016486146,0.4285124095190722,0.5483891524337405,-1.5010955924936913,0.5443388265729899,-0.5024555178264151,-6.037599606373927,-0.8260847649662707,0.78602628529162,-0.25990618575922136,-0.12212912446047186,10.558190253297093,-0.20035035692274336,4.273795966034279,-0.7761075447077024,-0.4525626526616818,0.8948260685671147,-0.2361481691537933,-0.5847320881313958,0.9054614104530238,1.0235577714985011,-1.0484397283619102,-0.8548795662431514,-0.22975630129316904,-4.967595689911646,2.1572243368259874,-0.7432982962287772,-61.73932702713092,-1.7916787015788076,-2.5241493352143465,-1.4606252236980741,-11.873924456413969,-1.3037903871598333,-1.6120274773241001,0.6301547836701484,0.09405750459235766,1.75269475400375,-5.940622668079379,-1.8052523525385349,0.09243225244953457,0.909291232859373,-3.633504474972181,-0.7546846791905271,-0.5475993717862023,-0.8157851828157107,-1.1455105123207263,0.1918058220776364,0.8934782189534839,-0.7270486479550192,-0.2571808599310691,-0.3513080890600445,0.10294287876581562],"re2":[0.9018520461067112,8.996303619804092,2.153406696019033,-9.860012135460238,1.1141263866204874,-3.874629675984192,-3.109633605645663,-8.545729367165,-3.2588452589420314,2.8727669046262854,4.486662267853612,2.441011372079549,5.705069552013629,1.3186205958455979,1.6682992967326982,6.505388474096737,7.8124215613770644,4.155055371427437,5.350108000165969,-8.334179258674592,4.9619522065833195,0.3136330065148112,-1.1275720177151154,-5.519733685391179,-3.2245569605779556,8.980928638564265,3.821192880604805,3.385834952225963,-7.440398202517608,-1.710606843726378,4.285000718811162,-3.91257827814687,3.9706810379478306,1.5162778910856929,7.237503729276934,-2.945768697959135,-7.749909546534939,7.564979434207103,-1.4969308138461201,1.0202542995790225,-6.451514275074102,6.887285468167246,-8.364337981760958,-8.407171833867391,8.716396658532823,1.8582197270404848,-7.01131001277764,5.6166343647034545,-3.326425870597949,0.4486438423752208,-6.40475111068973,6.140204840974196,-1.2547248571268792,-2.9803176158821394,3.0674370526538084,5.6386188734445675,-0.5133401234128243,-8.358369284228344,7.922638971628366,-6.4181626679009,1.922737579340117,5.368055528689533,-9.272416700316503,7.962431222304339,-5.563534226453967,-9.83173739540949,7.071179277992581,0.8725671000260711,5.840562240423788,-3.205938326734481,1.0043495785245238,-6.488818594041161,9.227967050915328,1.7040683357861361,4.519432618943293,-9.09919959498318,1.4959649499007828,-0.03247573406976656,-0.45033020371181287,3.996607677396522,-7.287527519864129,8.615765864653355,7.710660243341728,-8.942716073031017,-0.3694991801180336,-6.146975641820449,0.24458777419432032,2.175290768244686,-5.81081645718638,-8.679359954098086,9.561103842398893,7.852438825683013,6.420516661779654,8.113216766088996,-8.207132886854762,-1.0565126464939247,-5.050703716759129,2.8277861274408966,-6.011587446215813,-8.670121501422333,-6.309077035524949,-0.1983048352302248,2.132117619944289,-9.397699792942522,-2.7485917923954712,-8.67383122852508,5.311682504978155,-2.963578369389519,-5.948202245258036,-1.3644973973295453,-7.878909774373302,-5.12216038523154,-1.2131664845277434,-8.874743281152115,-3.8083363331947524,6.270257419237648,7.130437258241823,6.770843140873048,-8.266966712230202,3.4215547995301776,-0.539548583220018,-6.456441547947584,-1.1558133027857984,6.532143147765687,-6.525745319202818,-7.1403703588839385,7.062591905347201,-8.2658181690977,0.7617152509055547,7.867336091458455,7.768593879878111,-6.979142714407098,-8.729730442331247,0.6920889180158412,2.8854237230392314,6.6298209972152655,-0.0603546696934707,-4.0792034179863235,-8.150377742874333,6.857000463561409,-8.778712720907674,-5.881635970657286,-7.519452245615479,5.214029126129207,-7.541261631608938,2.6346868367332554,-6.426467306225929,1.4655821355524914,1.4760715527347106,6.199338585399239,-6.337018726447239,8.413541838656663,2.47597065072628,-3.2530759827645355,2.9655279790149525,0.07172779657649997,3.313296030834689,-8.191520896976316,1.556055668701564,8.220275314660448,1.7669447249277894,-4.491528379604013,2.2089378027694195,5.398929447591069,7.358148771055969,5.425305114440992,8.631453042535867,6.405313258115779,7.413717731274229,3.061237990983898,9.3333641546768,4.442480117233533,2.8644873679825835,-3.8661111982807705,-1.6115120074885336,-4.198899602758653,1.5178219788050935,1.9153616189634093,3.9709966566135826,3.0697541166365596,4.89320220261887,-4.872827269600211,9.45332359102433,-9.166198335218208,-2.115490810724654,-0.25256731695755974,2.748577782295831,-5.126701575816979,5.32181755770071,-3.0193405411284253,-3.274055953064341,-1.6154213272755449,2.6638429468646674,5.914160470376483,9.38027502925658,9.067161280310788,5.475105166994542,0.9467839523188069,-8.051995015135487,-4.905646852349359,-6.338493544821951,5.587698972689537,7.28972238112609,0.7928778119240381,-0.521110867013789,-7.588277988178458,-1.333203775772665,-6.637516832370951,-4.633430437924064,1.5117935851031632,-3.197902678181796,8.625802921067436,4.551025433172331,1.8947685049904983,-8.738960539406824,-8.857883121785957,-4.286349879803484,-1.1657362704849277,-1.175711120960587,-9.771628459314934,2.245027549307629,-0.5089349075772631,-1.3323603257479082,3.9088003853245734,1.3186025683616833,8.258955692982589,3.8951352744429357,-8.24607575250884,4.06048283426623,-6.704060977606419,8.911696921136475,6.90808512120897,-8.99728292734607,-3.774993908310556,-6.510553912994852,-6.334221977278231,2.6914919190946645,1.2553378964082142,8.331838159916543,7.7751212411337285,2.330544837567146,2.0542462711392986,-8.023669762343813,-5.107233195391023,-5.783998330728394,7.33271851696432,-5.537328634232745,-6.522477077715703,8.174247020468457,5.813133767997581,9.385864431245313,3.8693096074506723,-3.4789887927503305,9.641166165644556,2.6080195953958185,-9.899088649028284,-7.398175541090621,4.467529455022039,4.849959487303048,9.123348813447684,-8.310440266688254,-4.216029046146743,-1.266497526421757,4.355729410125795,-4.308451943105174,-2.015082487042177,1.2696783424541778,-6.629502256033872,2.299435147561475,-7.70851289716576,5.587813169675114,-1.4166366709202922,-9.533176713735793,6.205918643894599,2.2539065916398986,3.3799752395952645,-7.478515599732258,-7.717005262404271,-2.805818619068754,3.328754970955856,7.028775138638679,-4.329367434354598,-0.1823063945042609,3.2602625375842447,5.683395526505308,9.183272746640498,7.380683783235391,3.3910932356423285,-3.464344370520256,-6.51073427280717,-4.902022458375466,-0.5481805928559389,-7.7617945621232725,-5.100591824527793,8.196791931097469,6.99402417958202,-7.898813842190049,4.4254902595743335,-3.5743273256058856,0.7916660192932632,-9.351965651779699,-4.556999381193996,-0.5800911396170569,-0.8247555619936868,4.416396578249586,-9.955234705728323,6.710888519330894,1.0642611225575962,4.032930843834686,3.5890451007590674,-2.1754897603131162,4.8974558589330925,-9.26097173682917,-1.8429078102053857,8.932617530939666,0.8478338561798804,2.7979732971635514,7.679536281114544,7.120370370883212,8.343433469781782,-2.888321751478853,0.8111811422514705,-9.900385744952748,-2.5739740835630815,-4.810340040536372,-2.167244163163719,0.1399414923881679,2.6376029838166595,-9.99987142367704,-6.058021054893052,2.043620446509113,2.346163765895401,3.9195141281601114,3.7108646468139845,-5.625090486440925,6.8866683202434835,3.8536479557861085,9.409586962077526,-5.054062293854285,9.856238182194975,2.09533619260821,-2.6715280598171542,-8.905825842497581,-5.980125861680947,-6.601039477860815,-6.880850741109277,-7.93460573469374,5.111277875058315,4.207949544225894,-4.506120526648159,7.068044120592344,-9.154169394058265,-2.5124808309821116,-1.4410196353700417,0.09960758854971097,-8.686908148400809,7.451742899933301,-1.9695249019907113,-2.3642580956703396,-3.914984831689175,8.092349728032481,-3.5244906964846674,-6.375251444841805,9.235274371777503,-8.322006884145319,7.5970678512103085,6.735888577336265,8.130562290240217,0.5895293885187343,9.283938553603889,4.7169938491952195,-0.9462685629134846,2.6325668387953023,5.810597192361634,-7.741342799135856,0.342933106856103,5.655810027716285,9.834762011914165,6.645532850904491,-1.8984446619722704,0.5682273938694831,-4.966089167848359,-1.0647889213592627,9.743191232984252,9.54269283993112,-2.8907533092401794,4.669407399299084,-9.007006555539888,-3.3966871420682043,-0.7680236715514681,3.882265682865736,-2.1571511808461175,-5.631947267166266,0.5050263082694624,2.012314080290947,4.102600016549786,8.000998203178046,-3.116777710435768,-5.0978629550329195,7.134803830300388,-2.4708658402722428,-8.16745175953116,1.029795853939742,4.752864061523653,-0.522481845326519,-1.520059058494308,3.4545700900873904,0.2082996807333224,-9.594188280107868,-3.297050492074267,9.024386453890152,4.515168164493673,-1.5440384567015855,8.339743734732682,0.4304869264727067,3.878463460637736,8.180304914914839,-3.1661366451819895,0.47594615894917247,7.029248182953538,-8.853961948720281,-6.372497418950704,1.0016934013901828,2.7154516001980014,6.1105385237126875,9.280642375234251,-4.152115737809304,0.2643702858739605,7.230980481815347,-3.7594678236366263,1.4844381073136894,7.728894194219475,8.869422070693204,9.872822180484938,-4.808942895916861,3.847046771759876,-7.2067330554610205,2.4847943936414794,-5.850864817360839,7.650928146069447,-4.268831475047756,0.7432782764475014,-3.49549979952263,3.7362072329715357,-4.1897276884364265,2.268639436388744,7.051519651543334,7.808063652296227,-6.1535240461955905,7.161278576810375,8.135476709835036,-4.483270451409583,7.515439953305037,-9.750701988510524,0.6038250666277474,-8.340056205742655,-7.473611691363877,8.537165711655494,9.501730531860627,0.789598214969601,7.675082413222313,1.6675359050899239,-5.574052508545522,1.4947549594977225,6.394094535317041,-4.644414168767699,8.881461448280898,7.534073277632952,6.928124622645264,-6.173831928126421,-5.374321751580702,8.488828099373016,1.7395708852371037,3.1710095749065843,-7.614100403918278,0.14195502009855687,-1.7947311966863033,-3.5891293163304505,5.861605938542988,0.8284328875585487,1.6819296307986455,-3.7294260141669326,5.638965170787131,-5.225830810338596,-2.364650007018245,-1.186324256432787,-4.636589797731519,9.958965970673695,-9.218819863910205,0.7135362492951121,-9.059524963245218,3.661536584220954,3.6358555297683015,-8.592252869388465,-3.4916136337129196,8.134687704435738,-5.7716893134828755,-9.816957321380066,6.274133457697225,-7.900496242496072],"im2":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]} diff --git a/float64/base/div/test/fixtures/julia/tiny_positive_real_components.json b/float64/base/div/test/fixtures/julia/tiny_positive_real_components.json deleted file mode 100644 index 3d99c27d..00000000 --- a/float64/base/div/test/fixtures/julia/tiny_positive_real_components.json +++ /dev/null @@ -1 +0,0 @@ -{"re1":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"im1":[-3.1778941864748766,9.080540919103115,-6.087652208529073,7.413982123503061,-8.534337646227435,-0.562992409850045,-3.0589757238166104,7.190407967252732,4.968932970680232,-7.258603517720628,-5.2323155393589715,-1.1101419489774855,6.447897196510027,-9.536444230933805,7.771707011782361,4.431002025424522,-4.104690454733952,-8.51601075964572,1.2231693277379208,4.4513716463970034,2.367140927218996,-0.17512636585014718,0.28066578048876245,3.4602848230498946,4.863114035209399,-3.8033395799379432,4.3490275590549885,-2.3700494169837754,-3.519128099246829,8.638312609337817,9.827773791476048,-2.320835779221813,5.8693061766940975,1.7003619478506042,-3.5973248883756153,-8.406380660410626,-0.5281534301705015,2.905229821569817,-6.178410606931138,4.5707249524075735,2.0119596323025863,9.283277943960282,4.75763178834778,-0.18069434764217007,-7.976739574514877,-2.772671677606386,7.652358850888529,-6.819848740783721,4.326421203294988,-4.141661415847486,-2.3323020882614154,8.380405565456105,-7.923311318749016,-6.653781468868656,-4.755435998102248,5.126313653912703,-8.934900175757278,-8.097674001698081,9.614786086821468,3.578120688124457,-6.4809363994978035,9.741977550040165,-6.903234542281518,-6.77781034832438,9.66564307124052,-6.66791778970156,-3.4488171672929475,-5.970633896087767,1.6925774127583626,7.4246117468582575,-1.2192694375791433,-2.8247870984801615,-3.7459834791885482,7.800747138600407,-3.681938613433071,8.5743178455437,7.6271227707964755,-4.086216130389683,0.20141612711249657,9.781178060501784,-2.5507906663811752,-0.7372874782476195,7.1600955772238315,8.360847530087966,6.295785838046083,5.418447002410737,-3.665669111630276,5.7727909343955,-0.9526889975617223,9.672873141138211,8.973612516975145,8.135475939857425,5.388186166724385,-8.900457769492524,-2.6231541549519033,-5.963624200678859,5.359866833102473,-8.083678293495993,-2.519329245522483,-4.969987993017526,1.9717464268848062,-3.804180488677593,-4.192545048092551,-6.563323783659039,-1.7959439450213885,6.0371803999886495,7.965809214501412,-5.906370657347663,-3.3540977595665122,-4.364627697533601,-6.467961299402509,8.461517807315087,-2.774021337052888,-9.647133522961582,5.92154035283003,-0.28376729652868704,-0.6771794772852715,-5.938841661023013,-9.335983711857692,8.280370411830319,0.8160843208806323,-6.821797730314758,7.287986899599858,-2.3956231237861108,4.998892096027303,-3.5543594620729397,1.837089242367064,-1.5810997760849972,-1.6972099256950663,1.0672094083491253,0.7240736244901882,-5.29421130292145,-6.779820375746565,-3.7908842006897725,-0.5459468712883364,-7.938860698268306,-0.4168354723236263,-2.7198285238209463,-9.691161857728934,8.193467230820776,-6.647755761779159,7.611750386326843,8.213702349809324,8.938342708848129,-1.9462069616310913,-4.432981340818271,7.805077096881128,4.240906127525289,0.24307482352532261,8.718304857137625,4.907743596977351,3.8096122421123564,-7.01903448336751,-4.534234570885436,-8.739902136564218,5.658829468018123,7.527271869588624,-0.7195741629878256,8.350774265977602,-5.206330369981966,8.315656701359643,5.594728191264974,-1.8058404484280377,9.547162643257042,-3.4076525346447273,9.915646184194962,-3.027415504661157,2.3552679210300944,-9.472425050603464,-0.4650075581214619,9.553278262735997,4.259734380967242,-6.4703344094175685,-4.61967367811072,-1.7355819863258315,-9.993730148115993,-2.881743513272883,-6.240938859757734,-0.8493715331218823,2.046406573726758,2.386695459360146,7.3940671886843,-0.7351084987257135,6.124994279065852,6.46833805033738,7.834571941463555,-0.53711961815889,-0.7887885139437874,2.5619186354011436,4.78469706314768,-3.0350113896153115,8.192644573372906,-3.9700368268203023,-9.652078390585528,9.953073291952204,7.27801236893394,-3.045959657901916,-9.324694484033763,-5.803526634020086,-3.9522952676793537,6.043039911930418,2.0784229940037378,2.046870718162131,8.352498732362697,6.160516325216285,-6.933128952824221,0.9415799305818968,8.605955543763713,-8.87920007391003,-1.0470891315224211,-5.135061951090433,3.943059617497804,-6.673416622840163,-6.85599855158692,0.25495228325701014,-2.87513436199122,-5.383050516708645,5.821356580635328,5.325546001418882,-0.309684306779225,-4.520912316959118,-4.990353127257574,-9.819256110862899,7.106748941625845,4.996962317135608,-4.80384562740525,-7.1431030089323855,-1.8232390516812558,9.401473775405364,-9.484532128973566,9.606496144272839,-4.448131194516634,9.719683970127374,7.816660157940049,-6.726237048816028,-7.515975659393148,2.2467392362236005,9.722068424530917,-6.300867144983295,-2.622028190965273,-3.573835862453338,2.019026990020894,-0.004988245310105555,-6.698945579463571,-5.580926177008488,-2.645840393469854,-3.5269092077748425,-1.701900039277156,7.62764568718228,-8.732557364151727,2.324629470376827,4.891907665957291,-7.6682324488121,-3.421382953896643,9.976612365361675,-9.25757818419381,6.85617539766756,-1.3069154468713933,8.612091482233978,-6.804907600373278,2.197635580958824,-1.116661479822966,2.2695189930871607,-9.346539582256758,-2.4909814526237355,6.093121799939912,5.357086087851119,9.72912460380154,-3.300824412180468,-4.578029494492792,5.113150460529683,-0.08233123437703149,-2.890453115900673,8.038005930002004,1.688575642664068,-6.456203596928178,-1.246404635159502,1.1695045862036064,0.6817321005837584,-5.792958553566995,3.586346177863879,-5.387773023650322,-3.594754773271154,-2.75957986092439,1.9496575915807206,1.7675840504221956,-2.035161008966499,4.003795926521905,-7.462181858258576,9.149144334202585,-4.011612608610642,5.731474972094947,-5.731250613347976,-5.733885904719367,1.3274180623666005,0.5246074056213086,-7.002913453407944,9.115847511054483,8.568841800532173,-4.788616980044131,6.55710477195213,-3.809926833713913,-5.52942631879473,-3.995830563474323,-2.4818404762900803,-8.347643640624296,0.47921689910019616,9.772272035012012,-9.467276076492166,5.82185544551011,-2.988565028200054,-9.148603570706499,-1.3230692532674837,-9.424611292851136,-6.311923918193676,3.6210494385784173,-7.609778615064866,4.5890620304785745,-9.38393935010126,5.636714115706072,5.637520832389555,-1.0348068062812175,8.000976778599242,9.840429028511817,4.2556273020013755,5.9390196507501365,7.17359029649117,0.9474394597760138,0.0773145886881963,4.155572074766285,8.934452282496775,4.785971001255444,7.121291316716306,0.34713309445008633,-5.412083871234898,-6.556774371483536,9.705846951954523,-2.942119245405208,-0.6149856949976833,-7.328591398543745,-9.17327471371589,5.0422303860830535,-4.55005714557476,-8.80543482084464,1.7470703564914931,-4.1650132019301545,0.40685239223802583,-1.8425985631550432,-1.9688804216427442,4.651157042896175,-8.229155624049309,2.214668299086606,2.397610666698707,5.244512791909688,-2.5514902820686807,0.04121230203143078,-1.0388570163427424,-9.076972177484512,6.571130601246789,-1.475349962086998,-9.149872270988881,-8.44166711388069,-2.7538142476284317,1.6076036303556798,-7.077815811930415,9.121516955109389,9.949226567587623,9.586150740443127,6.966094630651998,4.770143645496422,-6.090663241111322,0.4695568062585167,-8.69457944420706,-2.7876659639451695,-9.765781321407134,-2.296960970059178,-0.8640740607444712,7.282111759365279,-3.926388372319485,0.8009591379114624,5.030714285093179,9.545242089850582,-6.310615144183731,1.7264209658432215,-4.965983278802765,9.907036855925249,0.4984836574342584,6.671338552369438,-3.124932731896073,6.629640100009723,-3.7259087125857686,6.996440338831253,0.15571881503723795,1.7196584059442053,-0.2564638996917594,0.9639159976355156,3.636828824826466,0.32239362898781465,-8.365923757380205,-3.6164322910479747,-7.460107464340635,-4.97123556712501,-5.7702989758756384,5.8275002438271795,8.163788903275385,8.465169461899368,-6.963273725128259,4.41284562944732,-7.220414152225551,-8.633147964688492,-6.125518129827356,4.089740994919316,-2.3452478476313665,-2.405400548101495,4.111630485319413,-4.005338137955679,5.795899504237509,9.582972182446735,-4.646933306835772,-7.2594743954888745,8.604485222139079,3.123668401811237,-1.8808572184410544,4.2726897981535,-4.587184901354249,2.219889005650179,3.1598185126397773,-2.765075268867559,5.654263315488135,-3.9923354918554192,-5.236814443930042,5.1109582038437456,3.6000970419427887,7.2945922537588075,-9.961423050417055,9.785027022036495,-0.7500012575500854,-4.257099947944645,3.7234663275537034,-3.8854158200745363,-8.982303669250404,4.022755863227076,-2.9426540156364407,-4.642560639070066,8.118206320199931,-8.68877244902947,7.9565756104506775,5.571766587203504,2.656025559249473,1.0562892142962816,-1.7730627205283618,5.682842176652025,6.603496837936397,-2.5889083896722447,0.8579050504022696,1.8337924917522557,-1.656025279093713,1.9614530582760832,4.130163963105753,-8.824325670794925,-2.2960057847908715,-7.419777407158302,-0.23412759514028814,3.8067370697343392,-0.9842916609354404,-4.308662085802954,5.610823078809407,-1.5208791467237326,-9.451270639167419,-3.7614725283442514,6.3628773621171035,-0.9787764603219777,3.0784669090117696,-3.446045058748437,-2.1241734589823587,-4.298425925181428,5.900060070824928,6.203284980447361,-6.7100016723729805,7.443158291504556,-7.831847475916874,4.189821465718673,5.928187547758066,9.509409980367995,6.520482660219397,-5.61487895021698,6.623914971410308,-8.044563828781248,3.8944906287216767,5.864168390094042,-6.037917658781728,6.9858009654695365,9.704481205981647,4.749331898798703,-0.6931055520835585,8.683032771653092,-1.6884637695490738,3.284621082867778,3.5545678283682687,7.118869659398918],"qim":[0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,-0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,-0.0,0.0,0.0],"qre":[1.6626464983838982,-1.2420766558897705,5.943686031865195,1.9750829098084433,-1.423002700652387,0.19021190551702927,0.8650450772828336,-4.506546553929319,-1.0031142506932937,-1.495808449961582,-1.7965846904516263,-0.34599676262830176,1.4523125327846216,-1.1564820200143657,-7.321160676559587,-1.5364112153012155,0.6613079803369004,-1.2981808757991447,1.3812852840711547,-1.0184001068075448,-0.34522728899829086,-0.022751280396602323,0.10392566098853978,-3.8273188092424704,0.5686150080024056,1.2924940620549783,-0.48378106604810556,-0.5608109040557107,4.1146940619500105,-0.9774833131098625,-1.491980652014456,-0.6111784546495338,1.0461276236896146,-31.929472850384823,-0.4170587159396081,-1.1131426094481636,0.12435374468767962,2.1157665298215957,1.310366576198714,-1.890540481888021,-0.7947952091232339,-2.1612418063584924,-0.4791890499810882,-0.030391287178275588,1.3104203071563478,7.880589759729683,-1.1668842976330986,0.774195304450791,0.4912960819359692,2.032607565913522,0.42497170429426534,-5.468928841763459,1.6790258454235591,1.555950122766711,2.4159017979753683,3.4068280708092,-2.5553816102457922,-1.8965011079640874,1.5630767089245576,0.4758466225271141,1.2244218021925801,-39.54545444772055,-5.930794979209607,2.0934042212733965,-2.024185545008452,0.9533972498294999,-0.5210819527707453,-1.1957035146552952,0.8265717431344323,-1.7406777048297255,-0.22283988182136416,-0.49172074255880527,-0.8854995651551562,2.5406710679538747,0.6456065363173011,1.3541127274170581,1.9405412259319879,2.4260745253865177,0.0805212669253249,-3.4772494343301164,0.3914130224355455,-0.07907460808966633,1.5770898613190243,1.0149408537264923,-1.56481106709174,-1.2502794615365107,-0.8699339822586063,-0.6133983072702948,-0.2889529853762045,2.169027038375357,-1.5452662244206432,0.8245650271341631,-0.6609381331309861,2.592695312480497,-0.2684943601926784,0.9645589717960734,0.9346690527759463,-2.382145055963305,-0.25752432932113967,0.6608242507359886,0.507480408514403,1.9024115916537492,-0.5902067204870415,6.24937551845412,-2.7031074102059804,0.8439898534117914,1.3214764122018512,2.2738839035079694,-0.43982463561252766,-1.0508492797678022,0.7463648069205724,-1.7395829401479068,0.4310534384477083,7.700288440549924,4.089272342689655,0.42462341974779355,0.10565644478776587,1.1360684411606032,-1.0378603850217736,-2.357930746514602,1.1586631842127857,-8.210109411897452,1.0712609380378677,25.808088535509174,0.6235382273172405,3.947926867024567,-0.25191553072693273,-0.2510435123730188,-0.2005496850827004,-0.2771182368721144,0.18761732770533865,5.052454363155631,0.8059004052977153,-0.4308577131984084,-0.15320290514669488,-1.0360642460161855,0.679535871589594,0.31293814709428197,-4.771750529190886,-0.8744882002854555,-1.3938951221199385,2.9946657876958,2.024676088521534,0.9518965835736188,0.553139617183041,2.296551748221863,-0.9503124522536537,-0.5125757739178424,-0.02701865110258173,2.4212580319594155,1.5304496985349496,-0.8178255799176561,-0.8197049933201007,0.5413700097112915,1.2367515635556423,-0.8203054654728823,1.4881471709952436,0.10164074554271557,8.347650244166857,0.5860442946579331,-1.715760925893436,2.2446171983506242,0.22742252919343164,1.170741413600474,0.7466797827590493,-3.205415304227411,-8.979329365537415,-0.304440600590794,-1.1391406681682543,0.08540564439473476,1.4728267933143684,-0.7139230435345988,-1.903324098834543,0.6952604355089348,-1.9636472921587538,15.042562623592085,0.520948891438047,12.028984496192692,0.2710723206135684,-0.2061609344218411,-0.6650436571140145,-22.843420232716213,0.14001899650387975,-1.488985194467788,3.2326259505361636,-3.1920070305089854,-0.36334742671866926,0.1857855070922989,0.2752241775227528,-0.6156150694433544,1.711668326367439,0.8897435112804705,0.5947888313880914,-1.2036706515723194,1.5469999970974315,0.8215433018970228,-0.6265763240756415,-68.37710601993847,-0.6676494092605971,0.6378083444464457,0.712831275223196,0.22911693492592183,-0.22863048197450833,-6.530011698329877,-3.7991924076767316,-1.012116335130894,-0.4477076516299171,0.9729985996519346,1.5317522305751892,-0.12420553546907999,1.2923346209061386,-0.4936587574371815,1.0584519987129495,-0.8300452655763282,-0.04531791817719148,-29.142973525407747,-0.7738091787726499,-1.0682812536922273,0.7905050404378788,-0.03974490844581012,-11.216015026729105,7.469462228251657,1.2824503288404792,3.7120221807437557,0.8280489301996435,1.1988734093242508,3.6818333120312663,-1.1171779799243482,-4.4464317444151,13.014114307906707,-5.717982302116151,-1.0099295444817125,-4.60332771796179,-3.524200310776569,-19.550428346505818,1.297032285883369,-0.24434684678066812,1.3319291164692062,-1.3689769241370027,-0.38227153096232636,0.5068530132544226,0.4099554999275995,0.0017649149768937298,-2.471550876220196,-1.0672108669087497,0.31194966192060997,-0.6586320693500547,-0.8712949316091918,-1.4315418822913908,-1.4395950858189333,1.0602427563177559,-0.6927733457191101,-0.7941290120065744,0.9870981328005213,1.7593136153702174,-44.20934304351244,1.1156079498201699,-0.21683322490391724,-1.285728810980385,4.3895436118116375,0.4282966707448077,-0.546722948142678,0.7534576952940747,2.6700817747429757,5.690725810352027,-1.2136070883804215,3.757247673193976,1.6567693204768237,0.5426131740755995,-1.3012306080642448,-1.9432439571507425,-0.010151967987876024,-2.886329199987341,-4.3683753354747,0.4778723179360267,22.211506936401808,0.14886240377063406,-0.38748142267241337,0.16499870911041992,-0.7064407661887409,-0.5838067476668941,2.604302385290756,0.3731410782229626,-0.7131061275691449,0.3145749988591998,0.33275644329614545,-0.20777039557491447,-0.4140292148001478,-0.7905366868269713,1.0739769192286592,2.4144133455636276,-10.489403394350415,0.6530553109860958,0.6784022114165527,-0.3483815478777326,0.07608168843717313,1.3091414907678254,1.3494877486374486,-1.064601479856548,1.914888659294956,0.7315501663677413,-5.065849468703463,-0.7321413321742345,0.3999654818647109,-1.5787991577265097,0.9581384962020619,0.06329565025692703,2.2423869633524,-0.9545252375792425,7.263736329641015,-2.413725056475675,-1.3865745797659939,-0.3020915237542287,1.2338985437925756,-2.481729478834045,0.5394411893291644,1.0824659586368865,-0.4883320586568175,1.0766418923679177,-1.6326576068404461,-0.9768749141228408,0.12608629359980128,0.9837537649912914,-2.4869174224039163,2.8080859200224255,-1.495104709236387,0.8429945897045988,-0.21006828402225197,0.02322992120292394,1.0653717510590472,2.8413435038691786,0.5078782448589221,1.925355734960744,0.0925668235571843,1.1536219107038088,2.2302855569905433,-6.1274403812664495,0.6184781525175134,-0.07460669088578549,1.7038082669714305,-0.9392771595479039,-1.1538384473435954,-2.1867104853153254,2.7774106711585405,0.1978825688363634,2.6319856491503306,0.047231171327097525,-0.318570498068339,0.6893879085664645,0.8202088766503394,-6.528995936992788,0.24258839941216734,0.4009211097724144,-2.5342163582312836,-7.288468257365103,-0.013182988118800212,0.7281857969203759,2.4108836911058105,-1.296531833141757,2.876264501051321,1.3484063962992439,8.14896706255997,0.5731972753010759,0.7416582073223901,0.8525895069863012,1.0652729983044134,-1.266948801007969,1.5199311290543076,3.2097656902741094,2.1615345971042568,0.6194105613314947,-0.11033220328046248,-10.545823073741623,-0.3664122197839053,2.4852550904270507,-0.4058345859992969,0.20660465358529856,-0.8572734299437416,-0.8971765496515162,0.13821755346687717,0.5868135826841696,-1.3121128879916084,-1.022635870978695,-0.2745792097641216,2.174651619584022,1.1036508860105967,-0.051534912768980604,0.67192759398379,-1.5664946119808982,16.47711713783018,0.7084548932080503,-0.9888340717410055,0.07932925192147944,0.7784809617173306,-0.03047655083021295,-0.9834925898184528,8.824726044547775,-0.03959200691410726,-1.2007407819264213,-0.41178816761752945,3.175569126222832,-0.8174487777630486,0.5810135296697927,-0.5954014922114729,0.9276923433646237,-0.9349338496493554,-0.9608896388721289,-1.097271119513759,-1.3802003162557588,-3.893320472383011,-1.5366920705869567,-2.6775678899462574,0.4780368446138258,-0.2866494142885794,-0.6002189853929453,-1.137834555914526,0.6372398214112701,1.0384774521298152,0.6681053199094609,2.901019261886992,0.9270513407319363,-0.6427309644504299,-0.3319279756282364,-1.31513631686271,8.86976792698808,0.2860374355912984,-1.0633666813578178,-0.49461316809446887,-0.8613441640013313,2.6745728836968863,0.8785878422354593,-12.789185087852013,0.5712867470390476,-1.1436981733857214,10.034999375593848,1.1660566051745573,-0.16161764746412918,1.9764875298357194,1.2201557782542594,2.3248096733611954,-1.0286063710303506,-0.470144585181332,0.7110268845112149,3.6776441825511834,-8.058095561975323,2.3438913365055427,3.888710722144093,-0.6572182638835345,-0.32214010123003933,-0.1725825617097733,-0.2263781908825619,-0.7287327696420081,15.611947484745034,0.42513080229883915,-0.11259172760603786,-0.44576292517499344,0.6107500552040951,0.6078680058998458,0.6302582179242305,0.9130057710687443,0.3532775515221897,3.641104529574475,0.032704491525246085,-0.8200038678060428,0.19067034592185259,0.6322053387215615,0.6371788477045204,-0.44784863025780686,-0.9497512266819268,-0.9667139697913051,24.34194300526046,0.2175139223482005,-0.4007552869063503,-1.2955573944552352,0.38809621942004957,0.5217592483009423,0.844235488385222,-0.7650962754481068,-2.1061978254913694,-0.916658810098297,-1.8001603602333713,-0.6093796718330136,-7.705171233761008,-1.1663731066570728,-1.150377415747016,0.6763763596705487,-1.8066180221288957,-2.2260075032542557,-0.6277988450870883,0.9313920794632776,-1.934477040264202,-0.904680061694549,1.390693146209643,-0.6291696448803777,-0.5903862172021055,-2.373730684718854,0.1826922173513258,0.5196083335519649,-1.8169354995589135,-1.03470338002359],"re2":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"im2":[-1.9113468735319312,-7.3107733536769555,-1.0242216994457731,3.7537574178200543,5.997414932743837,-2.9598168859080243,-3.536203839717884,-1.5955472513610935,-4.95350650959848,4.852629036764069,2.9123678762083127,3.208532763556784,4.439744924700896,8.246080843362652,-1.0615402878214795,-2.883994845452764,-6.2069271455681445,6.5599570278705315,0.8855298335857107,-4.370945777245696,-6.856760756333822,7.697429014865492,2.7006398402384217,-0.9041015383128688,8.552560109684663,-2.942636017910125,-8.989660539179795,4.226111510749684,-0.8552587498033972,-8.837299310875222,-6.587065172867151,3.797312816847647,5.610506828978943,-0.053253680567109996,8.625463875682492,7.551935025268737,-4.247185571266745,1.373133462799787,-4.715024573394031,-2.4176816080885715,-2.531418923023012,-4.295344424972887,-9.928506898343244,5.945597058203401,-6.08716114284328,-0.3518355557314905,-6.557941405510837,-8.808951309284518,8.80613821760307,-2.037609957427313,-5.488135009210984,-1.5323669054640394,-4.718993063951462,-4.2763462475501735,-1.9683896100774927,1.50471745194206,3.496503277605518,4.269796610027301,6.151192729009903,7.519483208942127,-5.293058640325048,-0.24634885819605756,1.1639644544248782,-3.237697850920309,-4.7750776084117135,-6.993850455194844,6.618569591509697,4.99340666219336,2.04770780856839,-4.265356950489889,5.471504596096269,5.744697862003132,4.230361737706987,3.07034910460988,-5.703068984455697,6.332056166327476,3.930410067497217,-1.6842912646051857,2.5014028567047895,-2.8129066508529332,-6.516877365267573,9.323947295591719,4.540068231264495,8.2377682397846,-4.023352064953782,-4.3337887001293485,4.213732520384033,-9.41116215348751,3.2970380850066725,4.459544749789464,-5.807162788625348,9.866384908577647,-8.152330598931478,-3.432897697869956,9.769866871950164,-6.18274711557987,5.7345076497224206,3.3934450268928185,9.782878581467202,-7.520892260661189,3.885364624531796,-1.9996621684641092,7.103519669570762,-1.0502367419397096,0.6643997712560505,7.153143341218637,6.027961710817628,-2.597481185488748,7.625988832788739,4.153428832817983,-8.665951608957394,-4.864107144322565,-6.435446489053835,-1.25282755281731,1.448067004736405,-0.6682799000988489,-6.409258598900758,-5.227538628707893,8.995413878969693,-3.511710606458662,0.7043326585327669,0.8309021704910702,6.80318551794543,-0.09282450811845244,8.016977752165936,-0.9003103608025427,-7.292481083107186,6.298110479492031,8.462790280598995,-3.8510977133620594,3.859311042034337,-1.0478494059300765,-8.412727343451289,8.79845964123215,3.563554299218943,7.662517772227307,-0.6134120209850735,-8.69126550749825,2.0309447860787895,-9.369442867435167,4.769193647559913,2.541769574956005,4.056798218922594,9.390035496599559,-3.518473277221556,-1.930277140173553,-8.213169340643162,-8.273715503778448,-8.996556586131568,3.600733479067612,3.206733028648623,-4.6582209405774915,8.562878768052748,-8.37548162910522,-7.066821174203435,-6.8984417466437,5.058150172441971,-7.0795836762670845,1.0003742396625839,-8.883851301753289,-4.846629023813145,2.492508831962999,-7.940464187222633,8.154800481428172,-4.563740191348349,-3.093404518009841,0.3371538543045709,-7.736379170384923,8.315412938276697,-5.4446935143098045,6.4863555620398685,-5.966657638444475,3.3994916648087052,-6.644522602136984,0.8838562776810104,-0.6643635395236629,-5.531720214084743,-0.5188250813468969,-3.133376108631607,-9.926257753272761,-3.5887801256797385,-0.3236847684522548,-5.250062613506479,-4.1135360524891755,2.0009546880190516,-2.454434425294572,1.4782535354922661,-4.24569454468757,9.30847957639677,-7.772222124897061,-1.7731305433782936,9.20787223453026,-6.674699687206987,8.01886992756474,6.433790116759354,8.858951624495393,4.861274741581525,0.1363715873162974,8.692476251042187,-6.196681655379647,8.47751792321159,9.071450762361735,-8.952746372595895,-1.2790939922050892,-1.6215331218203666,6.850130476283223,-2.103113331107915,8.844776905991719,-5.79676000900994,8.430293606222452,-3.973477045356808,-7.987419564818641,-6.304883576161098,8.259788756010277,-5.625860443548081,0.09865617725948894,6.956560692710806,-5.449273363653413,6.736890631929356,7.791798217410957,0.4030765210447065,-0.6681007246254786,-7.656636588600612,1.9145222187766961,6.034622031249814,-4.0069665321153085,-1.9400940791074373,1.6320041071743283,-2.1143861675632376,-0.7287881376000556,-1.6800499960829889,4.40439753329464,-2.1114473193385734,-2.217995422688565,0.344045507832476,-5.794748319834033,-9.194877142164762,7.299238603855304,4.602610192977018,6.85907261878646,-7.05103011917855,4.924990615755773,-2.8263374584111256,2.710421882841608,5.229450289589,-8.481626096915631,5.354900515632703,1.9532995975701617,-5.328272809575871,6.065981643153563,2.192544543714037,-7.061339319975439,9.656154520077674,-3.4661021434512795,5.670741292627504,0.20940320635577336,6.145685317832971,6.0272840910359164,-6.698217702430691,-1.5502540132104485,5.1311059157595995,2.042463159112815,3.0121385809210786,-3.500469412835292,-0.4377264931816569,-5.020670905994198,1.4258006268980257,5.872347153918486,-6.083199910882704,3.518230716462492,-2.6312447501582747,8.109879234780436,1.0014287753154942,-1.840044710610595,3.5335288931511606,-0.2906693190792602,-8.372863823158141,-3.018221049509089,4.131742025493859,8.200204222103572,-6.143036530831878,-2.0687970237560593,-9.633768520986006,3.8698024799356574,6.197751247400831,5.3119453763637186,9.795240574746337,-9.670322246352928,9.43938716900037,8.518939439381612,-1.6615268532961824,-0.5464061926707782,-8.776056969346048,-8.4520448315559,-3.8102421625167953,6.895317603979304,-5.34924108875402,6.7550428081015,-8.048872712150278,-2.500728675163419,8.96330159353139,0.7520805458692426,7.552402897913215,-9.990438536958347,1.5719798583272375,-8.712355962852223,7.571087383650838,4.357977545678525,9.918308813397104,0.8014959769055707,1.2381547020785018,6.597988816620646,4.37969671186103,-7.638076355842964,2.5433569500730258,6.712593532357928,-7.030039655609686,-9.397421179148111,-8.715933697752225,-3.452477783516632,-5.770975127815232,-8.20713161389057,8.1331091817169,-3.9568780771980006,1.515490417033746,-3.9723101760434183,8.509651644389475,-4.510149945698867,3.3282329291097525,3.9005840643281395,3.1444463755721017,9.423461330943375,3.6986886046081775,3.750081088562368,-4.69138443108545,-2.9398811066736137,-1.5839969625209918,-4.757030193272504,8.243036753086365,-4.301300528122529,9.766312978515522,-4.369962188113458,2.080777119847504,-3.170375527207012,8.828823916957596,-1.5824604527288066,8.61406526254423,5.78395857220832,-2.855983397992718,5.670698251756418,1.260401400684529,9.12932483355808,5.980255487319505,-2.0694810744454406,0.3500722225812485,-3.126173039074356,-1.4266372960530802,-3.7649979594499383,-5.068236994477506,-0.5129395997995783,-6.785693316273993,-1.0359186690869713,-4.804304497403571,2.167580179769889,-8.301551630571657,8.562609743819692,-7.852903416201302,6.306963886191063,2.1702813547293864,2.2068319664588483,-9.832998694789342,-4.255845458509622,0.824457169763825,7.608004901117159,-3.929488509660006,5.659845289930903,-4.182258461994084,-8.494503043029301,4.376383192187294,5.794916186990724,8.572934290447009,-7.27471102312016,6.170930751866031,-6.287515239505243,-2.283576474540176,8.976603907542305,-9.672736998097742,9.928656914974653,1.9948569934399352,0.4023543708861901,-5.25920386506751,-7.0754442416338525,1.9629431926494068,2.208992243240779,8.415122207251674,-0.980094824927404,0.41211804269815566,-8.142896865198836,6.967302088264418,8.782263735190497,-2.34921904320629,6.081403143972903,-9.93143650054943,-9.787513669444056,8.800103786203891,-9.05429776135949,7.246694566611829,-4.021654767877982,5.231424791883303,2.2174254664950155,3.98617149595081,-1.527408888594568,-4.90599809210509,8.391437164005154,-6.8502173129822825,3.520141058412854,9.095319076892523,9.227905875850265,-6.955390367892155,-2.502387519746039,9.281562783076897,-4.8599936436579565,5.66646187288425,-3.2488569765498587,-0.5171707917404245,7.760833826038226,-2.9715229638425296,5.5903794060319925,-6.56446464932384,-1.492700205027532,-5.960490450909961,-0.39963126412944483,6.301733867627636,-6.378074586028606,-0.9926680289232763,8.391554045158628,4.640590116970655,-2.1538713923980506,3.051631925950522,-1.6712834020761047,8.73249857499217,-8.556422832511242,-4.138597400095955,-1.2623735219130197,-1.0074596730408931,-3.7069860337396765,2.0460703248360197,-8.477802418757607,-8.244939233295929,-6.120486356394514,7.832303604935923,-7.7982525466005015,0.4229771362214034,-6.0896749322163,-7.619609971738843,-4.113829096559258,-2.7114615299384903,3.2267746274497267,6.553129884935956,-9.665136793675867,-6.499155621119779,-2.037782037536129,-7.158881982909118,-4.642340383002626,-5.162269235819494,-6.815288992206048,8.805727150269934,3.395966949476275,9.951311852669672,3.8909880749486643,0.2613956232147139,-4.499833618719511,-7.6816626245311515,2.6598937827817757,-5.473316545460327,-8.238332026080668,6.9886425671467975,-8.107848880605488,3.1858363878082336,-8.119878639148624,4.350638781370321,-6.875551744474333,-0.7693777812208893,-8.15297431507384,-5.668124713649057,-8.301412179680394,-3.666472320255485,3.6138978943335545,-6.203405213626083,6.296132981368402,3.121214433207797,-7.721846939330672,6.978161381201431,-7.548571259666668,1.1739866749739676,-3.657968794670367,-9.242122045637434,6.321340268764743,-1.9563533373810955,-6.880106701919361]} diff --git a/float64/base/div/test/test.assign.js b/float64/base/div/test/test.assign.js deleted file mode 100644 index 7f99b50f..00000000 --- a/float64/base/div/test/test.assign.js +++ /dev/null @@ -1,967 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable id-length */ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var isAlmostEqualFloat64Array = require( '@stdlib/assert/is-almost-equal-float64array' ); -var toBinaryString = require( '@stdlib/number/float64/base/to-binary-string' ); -var Float64Array = require( '@stdlib/array/float64' ); -var cdiv = require( './../lib/assign.js' ); - - -// FIXTURES // - -var data = require( './fixtures/julia/data.json' ); -var componentScales1 = require( './fixtures/julia/component_scales1.json' ); -var componentScales2 = require( './fixtures/julia/component_scales2.json' ); -var imaginaryComponentScales = require( './fixtures/julia/imaginary_component_scales.json' ); -var realComponentScales = require( './fixtures/julia/real_component_scales.json' ); -var largeNegativeImaginaryComponents = require( './fixtures/julia/large_negative_imaginary_components.json' ); -var largeNegativeRealComponents = require( './fixtures/julia/large_negative_real_components.json' ); -var largePositiveImaginaryComponents = require( './fixtures/julia/large_positive_imaginary_components.json' ); -var largePositiveRealComponents = require( './fixtures/julia/large_positive_real_components.json' ); -var tinyNegativeImaginaryComponents = require( './fixtures/julia/tiny_negative_imaginary_components.json' ); -var tinyNegativeRealComponents = require( './fixtures/julia/tiny_negative_real_components.json' ); -var tinyPositiveImaginaryComponents = require( './fixtures/julia/tiny_positive_imaginary_components.json' ); -var tinyPositiveRealComponents = require( './fixtures/julia/tiny_positive_real_components.json' ); - - -// FUNCTIONS // - -/** -* Compares the binary representations of two double-precision floating-point numbers and returns the first index of a differing bit. If all bits match, the function returns `-1`. -* -* TODO: revisit once ULP distance fcn is written -* -* @private -* @param {number} a - first number -* @param {number} b - second number -* @returns {integer} index -*/ -function bitdiff( a, b ) { - var astr; - var bstr; - var i; - - astr = toBinaryString( a ); - bstr = toBinaryString( b ); - for ( i = 0; i < 64; i++ ) { - if ( astr[ i ] !== bstr[ i ] ) { - return i; - } - } - return -1; -} - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof cdiv, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function computes a complex quotient (base behavior)', function test( t ) { - var expected; - var out; - var v; - - out = new Float64Array( 2 ); - - v = cdiv( 2.0, 4.0, 1.0, 2.0, out, 1, 0 ); - expected = new Float64Array( [ 2.0, 0.0 ] ); - - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - t.end(); -}); - -tape( 'the function computes a complex quotient (difficult cases)', function test( t ) { - var idx; - var re1; - var im1; - var re2; - var im2; - var out; - var v; - - // Note: test cases extracted from Figure 6 of https://arxiv.org/pdf/1210.4539.pdf. - - // Test case #1: - out = new Float64Array( 2 ); - v = cdiv( 1.0, 1.0, 1.0, pow( 2.0, 1023.0 ), out, 1, 0 ); - - idx = bitdiff( v[ 0 ], pow( 2.0, -1023.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( v[ 1 ], -pow( 2.0, -1023.0 ) ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #2: - out = new Float64Array( 2 ); - v = cdiv( 1.0, 1.0, pow( 2.0, -1023.0 ), pow( 2.0, -1023.0 ), out, 1, 0 ); - - idx = bitdiff( v[ 0 ], pow( 2.0, 1023.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( v[ 1 ], 0.0 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #3: - re1 = pow( 2.0, 1023.0 ); - im1 = pow( 2.0, -1023.0 ); - re2 = pow( 2.0, 677.0 ); - im2 = pow( 2.0, -677.0 ); - - out = new Float64Array( 2 ); - v = cdiv( re1, im1, re2, im2, out, 1, 0 ); - - idx = bitdiff( v[ 0 ], pow( 2.0, 346.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( v[ 1 ], -pow( 2.0, -1008.0 ) ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #4: - out = new Float64Array( 2 ); - v = cdiv( pow( 2.0, 1023.0 ), pow( 2.0, 1023.0 ), 1.0, 1.0, out, 1, 0 ); - - idx = bitdiff( v[ 0 ], pow( 2.0, 1023.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( v[ 1 ], 0.0 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #5: - re1 = pow( 2.0, 1020.0 ); - im1 = pow( 2.0, -844.0 ); - re2 = pow( 2.0, 656.0 ); - im2 = pow( 2.0, -780.0 ); - - out = new Float64Array( 2 ); - v = cdiv( re1, im1, re2, im2, out, 1, 0 ); - - idx = bitdiff( v[ 0 ], pow( 2.0, 364.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( v[ 1 ], -pow( 2.0, -1072.0 ) ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #6: - re1 = pow( 2.0, -71.0 ); - im1 = pow( 2.0, 1021.0 ); - re2 = pow( 2.0, 1001.0 ); - im2 = pow( 2.0, -323.0 ); - - out = new Float64Array( 2 ); - v = cdiv( re1, im1, re2, im2, out, 1, 0 ); - - idx = bitdiff( v[ 0 ], pow( 2.0, -1072.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( v[ 1 ], pow( 2.0, 20.0 ) ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #7: - re1 = pow( 2.0, -347.0 ); - im1 = pow( 2.0, -54.0 ); - re2 = pow( 2.0, -1037.0 ); - im2 = pow( 2.0, -1058.0 ); - - out = new Float64Array( 2 ); - v = cdiv( re1, im1, re2, im2, out, 1, 0 ); - - idx = bitdiff( v[ 0 ], 3.898125604559113300e289 ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( v[ 1 ], 8.174961907852353577e295 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #8: - re1 = pow( 2.0, -1074.0 ); - im1 = pow( 2.0, -1074.0 ); - re2 = pow( 2.0, -1073.0 ); - im2 = pow( 2.0, -1074.0 ); - - out = new Float64Array( 2 ); - v = cdiv( re1, im1, re2, im2, out, 1, 0 ); - - /* - * See section 3.6 in https://arxiv.org/pdf/1210.4539.pdf. - * - * ```text - * real(q): 0011111111100011001100110011001100110011001100110011001100110100 - * 0.6: 0011111111100011001100110011001100110011001100110011001100110011 - * ``` - * - * If we add - * - * ```text - * 0000000000000000000000000000000000000000000000000000000000000001 - * ``` - * - * to `0.6`, we get `real( q )`; thus, the result is 1 bit off. - */ - idx = bitdiff( v[ 0 ], 0.6 ); - t.strictEqual( idx, 61, 'real component has expected binary representation' ); - - idx = bitdiff( v[ 1 ], 0.2 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #9: - re1 = pow( 2.0, 1015.0 ); - im1 = pow( 2.0, -989.0 ); - re2 = pow( 2.0, 1023.0 ); - im2 = pow( 2.0, 1023.0 ); - - out = new Float64Array( 2 ); - v = cdiv( re1, im1, re2, im2, out, 1, 0 ); - - idx = bitdiff( v[ 0 ], 0.001953125 ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( v[ 1 ], -0.001953125 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #10: - re1 = pow( 2.0, -622.0 ); - im1 = pow( 2.0, -1071.0 ); - re2 = pow( 2.0, -343.0 ); - im2 = pow( 2.0, -798.0 ); - - out = new Float64Array( 2 ); - v = cdiv( re1, im1, re2, im2, out, 1, 0 ); - - idx = bitdiff( v[ 0 ], 1.02951151789360578e-84 ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( v[ 1 ], 6.97145987515076231e-220 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - t.end(); -}); - -tape( 'the function computes a complex quotient (tested against fixtures)', function test( t ) { - var delta; - var out; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var i; - var q; - - re1 = data.re1; - im1 = data.im1; - re2 = data.re2; - im2 = data.im2; - qre = data.qre; - qim = data.qim; - out = new Float64Array( 2 ); - - for ( i = 0; i < re1.length; i++ ) { - q = cdiv( re1[ i ], im1[ i ], re2[ i ], im2[ i ], out, 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[ 0 ]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[ 1 ]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (different component scales)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var out; - var i; - var q; - - re1 = componentScales1.re1; - im1 = componentScales1.im1; - re2 = componentScales1.re2; - im2 = componentScales1.im2; - qre = componentScales1.qre; - qim = componentScales1.qim; - out = new Float64Array( 2 ); - - for ( i = 0; i < re1.length; i++ ) { - q = cdiv( re1[ i ], im1[ i ], re2[ i ], im2[ i ], out, 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[ 0 ]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[ 1 ]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (different component scales)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var out; - var i; - var q; - - re1 = componentScales2.re1; - im1 = componentScales2.im1; - re2 = componentScales2.re2; - im2 = componentScales2.im2; - qre = componentScales2.qre; - qim = componentScales2.qim; - out = new Float64Array( 2 ); - - for ( i = 0; i < re1.length; i++ ) { - q = cdiv( re1[ i ], im1[ i ], re2[ i ], im2[ i ], out, 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[ 0 ]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[ 1 ]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (different imaginary component scales)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var out; - var i; - var q; - - re1 = imaginaryComponentScales.re1; - im1 = imaginaryComponentScales.im1; - re2 = imaginaryComponentScales.re2; - im2 = imaginaryComponentScales.im2; - qre = imaginaryComponentScales.qre; - qim = imaginaryComponentScales.qim; - out = new Float64Array( 2 ); - - for ( i = 0; i < re1.length; i++ ) { - q = cdiv( re1[ i ], im1[ i ], re2[ i ], im2[ i ], out, 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[ 0 ]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[ 1 ]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (real imaginary component scales)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var out; - var i; - var q; - - re1 = realComponentScales.re1; - im1 = realComponentScales.im1; - re2 = realComponentScales.re2; - im2 = realComponentScales.im2; - qre = realComponentScales.qre; - qim = realComponentScales.qim; - out = new Float64Array( 2 ); - - for ( i = 0; i < re1.length; i++ ) { - q = cdiv( re1[ i ], im1[ i ], re2[ i ], im2[ i ], out, 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[ 0 ]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[ 1 ]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (large negative imaginary components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var out; - var i; - var q; - - re1 = largeNegativeImaginaryComponents.re1; - im1 = largeNegativeImaginaryComponents.im1; - re2 = largeNegativeImaginaryComponents.re2; - im2 = largeNegativeImaginaryComponents.im2; - qre = largeNegativeImaginaryComponents.qre; - qim = largeNegativeImaginaryComponents.qim; - out = new Float64Array( 2 ); - - for ( i = 0; i < re1.length; i++ ) { - q = cdiv( re1[ i ], im1[ i ], re2[ i ], im2[ i ], out, 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[ 0 ]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[ 1 ]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (large negative real components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var out; - var i; - var q; - - re1 = largeNegativeRealComponents.re1; - im1 = largeNegativeRealComponents.im1; - re2 = largeNegativeRealComponents.re2; - im2 = largeNegativeRealComponents.im2; - qre = largeNegativeRealComponents.qre; - qim = largeNegativeRealComponents.qim; - out = new Float64Array( 2 ); - - for ( i = 0; i < re1.length; i++ ) { - q = cdiv( re1[ i ], im1[ i ], re2[ i ], im2[ i ], out, 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[ 0 ]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[ 1 ]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (large positive imaginary components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var out; - var i; - var q; - - re1 = largePositiveImaginaryComponents.re1; - im1 = largePositiveImaginaryComponents.im1; - re2 = largePositiveImaginaryComponents.re2; - im2 = largePositiveImaginaryComponents.im2; - qre = largePositiveImaginaryComponents.qre; - qim = largePositiveImaginaryComponents.qim; - out = new Float64Array( 2 ); - - for ( i = 0; i < re1.length; i++ ) { - q = cdiv( re1[ i ], im1[ i ], re2[ i ], im2[ i ], out, 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[ 0 ]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[ 1 ]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (large positive real components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var out; - var i; - var q; - - re1 = largePositiveRealComponents.re1; - im1 = largePositiveRealComponents.im1; - re2 = largePositiveRealComponents.re2; - im2 = largePositiveRealComponents.im2; - qre = largePositiveRealComponents.qre; - qim = largePositiveRealComponents.qim; - out = new Float64Array( 2 ); - - for ( i = 0; i < re1.length; i++ ) { - q = cdiv( re1[ i ], im1[ i ], re2[ i ], im2[ i ], out, 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[ 0 ]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[ 1 ]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (tiny negative imaginary components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var out; - var i; - var q; - - re1 = tinyNegativeImaginaryComponents.re1; - im1 = tinyNegativeImaginaryComponents.im1; - re2 = tinyNegativeImaginaryComponents.re2; - im2 = tinyNegativeImaginaryComponents.im2; - qre = tinyNegativeImaginaryComponents.qre; - qim = tinyNegativeImaginaryComponents.qim; - out = new Float64Array( 2 ); - - for ( i = 0; i < re1.length; i++ ) { - q = cdiv( re1[ i ], im1[ i ], re2[ i ], im2[ i ], out, 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[ 0 ]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[ 1 ]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (tiny negative real components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var out; - var i; - var q; - - re1 = tinyNegativeRealComponents.re1; - im1 = tinyNegativeRealComponents.im1; - re2 = tinyNegativeRealComponents.re2; - im2 = tinyNegativeRealComponents.im2; - qre = tinyNegativeRealComponents.qre; - qim = tinyNegativeRealComponents.qim; - out = new Float64Array( 2 ); - - for ( i = 0; i < re1.length; i++ ) { - q = cdiv( re1[ i ], im1[ i ], re2[ i ], im2[ i ], out, 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[ 0 ]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[ 1 ]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (tiny positive imaginary components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var out; - var i; - var q; - - re1 = tinyPositiveImaginaryComponents.re1; - im1 = tinyPositiveImaginaryComponents.im1; - re2 = tinyPositiveImaginaryComponents.re2; - im2 = tinyPositiveImaginaryComponents.im2; - qre = tinyPositiveImaginaryComponents.qre; - qim = tinyPositiveImaginaryComponents.qim; - out = new Float64Array( 2 ); - - for ( i = 0; i < re1.length; i++ ) { - q = cdiv( re1[ i ], im1[ i ], re2[ i ], im2[ i ], out, 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[ 0 ]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[ 1 ]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (tiny positive real components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var out; - var qim; - var i; - var q; - - re1 = tinyPositiveRealComponents.re1; - im1 = tinyPositiveRealComponents.im1; - re2 = tinyPositiveRealComponents.re2; - im2 = tinyPositiveRealComponents.im2; - qre = tinyPositiveRealComponents.qre; - qim = tinyPositiveRealComponents.qim; - out = new Float64Array( 2 ); - - for ( i = 0; i < re1.length; i++ ) { - q = cdiv( re1[ i ], im1[ i ], re2[ i ], im2[ i ], out, 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[ 0 ]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[ 1 ]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function handles large and small numbers', function test( t ) { - var expected; - var out; - var v; - - out = new Float64Array( 2 ); - v = cdiv( 1.0e308, 5.0e307, 1.0, 0.5, out, 1, 0 ); - expected = new Float64Array( [ 1.0e308, 0.0 ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( 1.0, 0.5, 1.0e308, 5.0e307, out, 1, 0 ); - expected = new Float64Array( [ 1.0e-308, 0.0 ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( 1.0e-304, 2.0e-304, 1.0, 2.0, out, 1, 0 ); - expected = new Float64Array( [ 1.0e-304, 0.0 ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( 1.0, 2.0, 1.0e-304, 2.0e-304, out, 1, 0 ); - expected = new Float64Array( [ 1.0e+304, 0.0 ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( 2.0, 4.0, 0.0, 2.0, out, 1, 0 ); - expected = new Float64Array( [ 2.0, -1.0 ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( 1.0e-180, 1.0e-180, 1.0, 1.0e-180, out, 1, 0 ); - expected = new Float64Array( [ 1.0e-180, 1.0e-180 ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - t.end(); -}); - -tape( 'the function may overflow during complex division', function test( t ) { - var expected; - var out; - var v; - - out = new Float64Array( 2 ); - v = cdiv( 1.0e308, 1.0e308, 5.0e-324, 5.0e-324, out, 1, 0 ); - expected = new Float64Array( [ PINF, 0.0 ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( 1.0e308, 1.0e308, -5.0e-324, 5.0e-324, out, 1, 0 ); - expected = new Float64Array( [ 0.0, NINF ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( 1.0e308, -1.0e308, 5.0e-324, 5.0e-324, out, 1, 0 ); - expected = new Float64Array( [ 0.0, NINF ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( -1.0e308, 1.0e308, 5.0e-324, 5.0e-324, out, 1, 0 ); - expected = new Float64Array( [ 0.0, PINF ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( 1.0e308, 1.0e308, 5.0e-324, -5.0e-324, out, 1, 0 ); - expected = new Float64Array( [ 0.0, PINF ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( -1.0e308, 1.0e308, -5.0e-324, 5.0e-324, out, 1, 0 ); - expected = new Float64Array( [ PINF, 0.0 ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( 1.0e308, -1.0e308, 5.0e-324, -5.0e-324, out, 1, 0 ); - expected = new Float64Array( [ PINF, 0.0 ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( 1.0e308, -1.0e308, -5.0e-324, 5.0e-324, out, 1, 0 ); - expected = new Float64Array( [ NINF, 0.0 ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( -1.0e308, 1.0e308, 5.0e-324, -5.0e-324, out, 1, 0 ); - expected = new Float64Array( [ NINF, 0.0 ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( -1.0e308, -1.0e308, -5.0e-324, 5.0e-324, out, 1, 0 ); - expected = new Float64Array( [ 0.0, PINF ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( 1.0e308, -1.0e308, -5.0e-324, -5.0e-324, out, 1, 0 ); - expected = new Float64Array( [ 0.0, PINF ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( -1.0e308, 1.0e308, -5.0e-324, -5.0e-324, out, 1, 0 ); - expected = new Float64Array( [ 0.0, NINF ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( -1.0e308, -1.0e308, 5.0e-324, -5.0e-324, out, 1, 0 ); - expected = new Float64Array( [ 0.0, NINF ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', function test( t ) { - var out; - var v; - - out = new Float64Array( 2 ); - v = cdiv( NaN, 3.0, -2.0, 1.0, out, 1, 0 ); - t.strictEqual( isnan( v[ 0 ] ), true, 'returns expected values' ); - t.strictEqual( isnan( v[ 1 ] ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( 5.0, NaN, -2.0, 1.0, out, 1, 0 ); - t.strictEqual( isnan( v[ 0 ] ), true, 'returns expected values' ); - t.strictEqual( isnan( v[ 1 ] ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( 5.0, 3.0, NaN, 1.0, out, 1, 0 ); - t.strictEqual( isnan( v[ 0 ] ), true, 'returns expected values' ); - t.strictEqual( isnan( v[ 1 ] ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( 5.0, 3.0, -2.0, NaN, out, 1, 0 ); - t.strictEqual( isnan( v[ 0 ] ), true, 'returns expected values' ); - t.strictEqual( isnan( v[ 1 ] ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( 5.0, 3.0, NaN, NaN, out, 1, 0 ); - t.strictEqual( isnan( v[ 0 ] ), true, 'returns expected values' ); - t.strictEqual( isnan( v[ 1 ] ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( NaN, NaN, -2.0, 1.0, out, 1, 0 ); - t.strictEqual( isnan( v[ 0 ] ), true, 'returns expected values' ); - t.strictEqual( isnan( v[ 1 ] ), true, 'returns expected values' ); - - out = new Float64Array( 2 ); - v = cdiv( NaN, NaN, NaN, NaN, out, 1, 0 ); - t.strictEqual( isnan( v[ 0 ] ), true, 'returns expected values' ); - t.strictEqual( isnan( v[ 1 ] ), true, 'returns expected values' ); - - t.end(); -}); diff --git a/float64/base/div/test/test.js b/float64/base/div/test/test.js deleted file mode 100644 index 20cb9b74..00000000 --- a/float64/base/div/test/test.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isMethod = require( '@stdlib/assert/is-method' ); -var div = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof div, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'attached to the main export is an `assign` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( div, 'assign' ), true, 'returns expected value' ); - t.end(); -}); - -tape( 'attached to the main export is a `strided` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( div, 'strided' ), true, 'returns expected value' ); - t.end(); -}); diff --git a/float64/base/div/test/test.main.js b/float64/base/div/test/test.main.js deleted file mode 100644 index eb2b73fc..00000000 --- a/float64/base/div/test/test.main.js +++ /dev/null @@ -1,1057 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable id-length, max-statements */ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var toBinaryString = require( '@stdlib/number/float64/base/to-binary-string' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var cdiv = require( './../lib' ); - - -// FIXTURES // - -var data = require( './fixtures/julia/data.json' ); -var componentScales1 = require( './fixtures/julia/component_scales1.json' ); -var componentScales2 = require( './fixtures/julia/component_scales2.json' ); -var imaginaryComponentScales = require( './fixtures/julia/imaginary_component_scales.json' ); -var realComponentScales = require( './fixtures/julia/real_component_scales.json' ); -var largeNegativeImaginaryComponents = require( './fixtures/julia/large_negative_imaginary_components.json' ); -var largeNegativeRealComponents = require( './fixtures/julia/large_negative_real_components.json' ); -var largePositiveImaginaryComponents = require( './fixtures/julia/large_positive_imaginary_components.json' ); -var largePositiveRealComponents = require( './fixtures/julia/large_positive_real_components.json' ); -var tinyNegativeImaginaryComponents = require( './fixtures/julia/tiny_negative_imaginary_components.json' ); -var tinyNegativeRealComponents = require( './fixtures/julia/tiny_negative_real_components.json' ); -var tinyPositiveImaginaryComponents = require( './fixtures/julia/tiny_positive_imaginary_components.json' ); -var tinyPositiveRealComponents = require( './fixtures/julia/tiny_positive_real_components.json' ); - - -// FUNCTIONS // - -/** -* Compares the binary representations of two double-precision floating-point numbers and returns the first index of a differing bit. If all bits match, the function returns `-1`. -* -* TODO: revisit once ULP distance fcn is written -* -* @private -* @param {number} a - first number -* @param {number} b - second number -* @returns {integer} index -*/ -function bitdiff( a, b ) { - var astr; - var bstr; - var i; - - astr = toBinaryString( a ); - bstr = toBinaryString( b ); - for ( i = 0; i < 64; i++ ) { - if ( astr[ i ] !== bstr[ i ] ) { - return i; - } - } - return -1; -} - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof cdiv, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function computes a complex quotient (base behavior)', function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex128( 2.0, 4.0 ); - z2 = new Complex128( 1.0, 2.0 ); - - v = cdiv( z1, z2 ); - - t.strictEqual( real( v ), 2.0, 'returns expected value' ); - t.strictEqual( imag( v ), 0.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function computes a complex quotient (difficult cases)', function test( t ) { - var idx; - var re1; - var im1; - var re2; - var im2; - var z1; - var z2; - var q; - - // Note: test cases extracted from Figure 6 of https://arxiv.org/pdf/1210.4539.pdf. - - // Test case #1: - z1 = new Complex128( 1.0, 1.0 ); - z2 = new Complex128( 1.0, pow( 2.0, 1023.0 ) ); - - q = cdiv( z1, z2 ); - - idx = bitdiff( real( q ), pow( 2.0, -1023.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), -pow( 2.0, -1023.0 ) ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #2: - z1 = new Complex128( 1.0, 1.0 ); - z2 = new Complex128( pow( 2.0, -1023.0 ), pow( 2.0, -1023.0 ) ); - - q = cdiv( z1, z2 ); - - idx = bitdiff( real( q ), pow( 2.0, 1023.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), 0.0 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #3: - re1 = pow( 2.0, 1023.0 ); - im1 = pow( 2.0, -1023.0 ); - re2 = pow( 2.0, 677.0 ); - im2 = pow( 2.0, -677.0 ); - - z1 = new Complex128( re1, im1 ); - z2 = new Complex128( re2, im2 ); - - q = cdiv( z1, z2 ); - - idx = bitdiff( real( q ), pow( 2.0, 346.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), -pow( 2.0, -1008.0 ) ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #4: - z1 = new Complex128( pow( 2.0, 1023.0 ), pow( 2.0, 1023.0 ) ); - z2 = new Complex128( 1.0, 1.0 ); - - q = cdiv( z1, z2 ); - - idx = bitdiff( real( q ), pow( 2.0, 1023.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), 0.0 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #5: - re1 = pow( 2.0, 1020.0 ); - im1 = pow( 2.0, -844.0 ); - re2 = pow( 2.0, 656.0 ); - im2 = pow( 2.0, -780.0 ); - - z1 = new Complex128( re1, im1 ); - z2 = new Complex128( re2, im2 ); - - q = cdiv( z1, z2 ); - - idx = bitdiff( real( q ), pow( 2.0, 364.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), -pow( 2.0, -1072.0 ) ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #6: - re1 = pow( 2.0, -71.0 ); - im1 = pow( 2.0, 1021.0 ); - re2 = pow( 2.0, 1001.0 ); - im2 = pow( 2.0, -323.0 ); - - z1 = new Complex128( re1, im1 ); - z2 = new Complex128( re2, im2 ); - - q = cdiv( z1, z2 ); - - idx = bitdiff( real( q ), pow( 2.0, -1072.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), pow( 2.0, 20.0 ) ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #7: - re1 = pow( 2.0, -347.0 ); - im1 = pow( 2.0, -54.0 ); - re2 = pow( 2.0, -1037.0 ); - im2 = pow( 2.0, -1058.0 ); - - z1 = new Complex128( re1, im1 ); - z2 = new Complex128( re2, im2 ); - - q = cdiv( z1, z2 ); - - idx = bitdiff( real( q ), 3.898125604559113300e289 ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), 8.174961907852353577e295 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #8: - re1 = pow( 2.0, -1074.0 ); - im1 = pow( 2.0, -1074.0 ); - re2 = pow( 2.0, -1073.0 ); - im2 = pow( 2.0, -1074.0 ); - - z1 = new Complex128( re1, im1 ); - z2 = new Complex128( re2, im2 ); - - q = cdiv( z1, z2 ); - - /* - * See section 3.6 in https://arxiv.org/pdf/1210.4539.pdf. - * - * ```text - * real(q): 0011111111100011001100110011001100110011001100110011001100110100 - * 0.6: 0011111111100011001100110011001100110011001100110011001100110011 - * ``` - * - * If we add - * - * ```text - * 0000000000000000000000000000000000000000000000000000000000000001 - * ``` - * - * to `0.6`, we get `real( q )`; thus, the result is 1 bit off. - */ - idx = bitdiff( real( q ), 0.6 ); - t.strictEqual( idx, 61, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), 0.2 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #9: - re1 = pow( 2.0, 1015.0 ); - im1 = pow( 2.0, -989.0 ); - re2 = pow( 2.0, 1023.0 ); - im2 = pow( 2.0, 1023.0 ); - - z1 = new Complex128( re1, im1 ); - z2 = new Complex128( re2, im2 ); - - q = cdiv( z1, z2 ); - - idx = bitdiff( real( q ), 0.001953125 ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), -0.001953125 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #10: - re1 = pow( 2.0, -622.0 ); - im1 = pow( 2.0, -1071.0 ); - re2 = pow( 2.0, -343.0 ); - im2 = pow( 2.0, -798.0 ); - - z1 = new Complex128( re1, im1 ); - z2 = new Complex128( re2, im2 ); - - q = cdiv( z1, z2 ); - - idx = bitdiff( real( q ), 1.02951151789360578e-84 ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), 6.97145987515076231e-220 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - t.end(); -}); - -tape( 'the function computes a complex quotient (tested against fixtures)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = data.re1; - im1 = data.im1; - re2 = data.re2; - im2 = data.im2; - qre = data.qre; - qim = data.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (different component scales)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = componentScales1.re1; - im1 = componentScales1.im1; - re2 = componentScales1.re2; - im2 = componentScales1.im2; - qre = componentScales1.qre; - qim = componentScales1.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (different component scales)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = componentScales2.re1; - im1 = componentScales2.im1; - re2 = componentScales2.re2; - im2 = componentScales2.im2; - qre = componentScales2.qre; - qim = componentScales2.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (different imaginary component scales)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = imaginaryComponentScales.re1; - im1 = imaginaryComponentScales.im1; - re2 = imaginaryComponentScales.re2; - im2 = imaginaryComponentScales.im2; - qre = imaginaryComponentScales.qre; - qim = imaginaryComponentScales.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (real imaginary component scales)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = realComponentScales.re1; - im1 = realComponentScales.im1; - re2 = realComponentScales.re2; - im2 = realComponentScales.im2; - qre = realComponentScales.qre; - qim = realComponentScales.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (large negative imaginary components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = largeNegativeImaginaryComponents.re1; - im1 = largeNegativeImaginaryComponents.im1; - re2 = largeNegativeImaginaryComponents.re2; - im2 = largeNegativeImaginaryComponents.im2; - qre = largeNegativeImaginaryComponents.qre; - qim = largeNegativeImaginaryComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (large negative real components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = largeNegativeRealComponents.re1; - im1 = largeNegativeRealComponents.im1; - re2 = largeNegativeRealComponents.re2; - im2 = largeNegativeRealComponents.im2; - qre = largeNegativeRealComponents.qre; - qim = largeNegativeRealComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (large positive imaginary components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = largePositiveImaginaryComponents.re1; - im1 = largePositiveImaginaryComponents.im1; - re2 = largePositiveImaginaryComponents.re2; - im2 = largePositiveImaginaryComponents.im2; - qre = largePositiveImaginaryComponents.qre; - qim = largePositiveImaginaryComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (large positive real components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = largePositiveRealComponents.re1; - im1 = largePositiveRealComponents.im1; - re2 = largePositiveRealComponents.re2; - im2 = largePositiveRealComponents.im2; - qre = largePositiveRealComponents.qre; - qim = largePositiveRealComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (tiny negative imaginary components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = tinyNegativeImaginaryComponents.re1; - im1 = tinyNegativeImaginaryComponents.im1; - re2 = tinyNegativeImaginaryComponents.re2; - im2 = tinyNegativeImaginaryComponents.im2; - qre = tinyNegativeImaginaryComponents.qre; - qim = tinyNegativeImaginaryComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (tiny negative real components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = tinyNegativeRealComponents.re1; - im1 = tinyNegativeRealComponents.im1; - re2 = tinyNegativeRealComponents.re2; - im2 = tinyNegativeRealComponents.im2; - qre = tinyNegativeRealComponents.qre; - qim = tinyNegativeRealComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (tiny positive imaginary components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = tinyPositiveImaginaryComponents.re1; - im1 = tinyPositiveImaginaryComponents.im1; - re2 = tinyPositiveImaginaryComponents.re2; - im2 = tinyPositiveImaginaryComponents.im2; - qre = tinyPositiveImaginaryComponents.qre; - qim = tinyPositiveImaginaryComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (tiny positive real components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = tinyPositiveRealComponents.re1; - im1 = tinyPositiveRealComponents.im1; - re2 = tinyPositiveRealComponents.re2; - im2 = tinyPositiveRealComponents.im2; - qre = tinyPositiveRealComponents.qre; - qim = tinyPositiveRealComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function handles large and small numbers', function test( t ) { - var expected; - var z1; - var z2; - var v; - - z1 = new Complex128( 1.0e308, 5.0e307 ); - z2 = new Complex128( 1.0, 0.5 ); - v = cdiv( z1, z2 ); - expected = [ 1.0e308, 0.0 ]; - - t.strictEqual( real( v ), expected[ 0 ], 'returns expected values' ); - t.strictEqual( imag( v ), expected[ 1 ], 'returns expected values' ); - - z1 = new Complex128( 1.0, 0.5 ); - z2 = new Complex128( 1.0e308, 5.0e307 ); - v = cdiv( z1, z2 ); - expected = [ 1.0e-308, 0.0 ]; - - t.strictEqual( real( v ), expected[ 0 ], 'returns expected values' ); - t.strictEqual( imag( v ), expected[ 1 ], 'returns expected values' ); - - z1 = new Complex128( 1.0e-304, 2.0e-304 ); - z2 = new Complex128( 1.0, 2.0 ); - v = cdiv( z1, z2 ); - expected = [ 1.0e-304, 0.0 ]; - - t.strictEqual( real( v ), expected[ 0 ], 'returns expected values' ); - t.strictEqual( imag( v ), expected[ 1 ], 'returns expected values' ); - - z1 = new Complex128( 1.0, 2.0 ); - z2 = new Complex128( 1.0e-304, 2.0e-304 ); - v = cdiv( z1, z2 ); - expected = [ 1.0e+304, 0.0 ]; - - t.strictEqual( real( v ), expected[ 0 ], 'returns expected values' ); - t.strictEqual( imag( v ), expected[ 1 ], 'returns expected values' ); - - z1 = new Complex128( 2.0, 4.0 ); - z2 = new Complex128( 0.0, 2.0 ); - v = cdiv( z1, z2 ); - expected = [ 2.0, -1.0 ]; - - t.strictEqual( real( v ), expected[ 0 ], 'returns expected values' ); - t.strictEqual( imag( v ), expected[ 1 ], 'returns expected values' ); - - z1 = new Complex128( 1.0e-180, 1.0e-180 ); - z2 = new Complex128( 1.0, 1.0e-180 ); - v = cdiv( z1, z2 ); - expected = [ 1.0e-180, 1.0e-180 ]; - - t.strictEqual( real( v ), expected[ 0 ], 'returns expected values' ); - t.strictEqual( imag( v ), expected[ 1 ], 'returns expected values' ); - - t.end(); -}); - -tape( 'the function may overflow during complex division', function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex128( 1.0e308, 1.0e308 ); - z2 = new Complex128( 5.0e-324, 5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), PINF, 'real component is +infinity' ); - t.strictEqual( imag( v ), 0.0, 'imaginary component is 0' ); - - z1 = new Complex128( 1.0e308, 1.0e308 ); - z2 = new Complex128( -5.0e-324, 5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), 0.0, 'real component is 0' ); - t.strictEqual( imag( v ), NINF, 'imaginary component is -infinity' ); - - z1 = new Complex128( 1.0e308, -1.0e308 ); - z2 = new Complex128( 5.0e-324, 5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), 0.0, 'real component is 0' ); - t.strictEqual( imag( v ), NINF, 'imaginary component is -infinity' ); - - z1 = new Complex128( -1.0e308, 1.0e308 ); - z2 = new Complex128( 5.0e-324, 5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), 0.0, 'real component is 0' ); - t.strictEqual( imag( v ), PINF, 'imaginary component is +infinity' ); - - z1 = new Complex128( 1.0e308, 1.0e308 ); - z2 = new Complex128( 5.0e-324, -5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), 0.0, 'real component is 0' ); - t.strictEqual( imag( v ), PINF, 'imaginary component is +infinity' ); - - z1 = new Complex128( -1.0e308, 1.0e308 ); - z2 = new Complex128( -5.0e-324, 5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), PINF, 'real component is +infinity' ); - t.strictEqual( imag( v ), 0.0, 'imaginary component is 0' ); - - z1 = new Complex128( 1.0e308, -1.0e308 ); - z2 = new Complex128( 5.0e-324, -5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), PINF, 'real component is +infinity' ); - t.strictEqual( imag( v ), 0.0, 'imaginary component is 0' ); - - z1 = new Complex128( 1.0e308, -1.0e308 ); - z2 = new Complex128( -5.0e-324, 5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), NINF, 'real component is -infinity' ); - t.strictEqual( imag( v ), 0.0, 'imaginary component is 0' ); - - z1 = new Complex128( -1.0e308, 1.0e308 ); - z2 = new Complex128( 5.0e-324, -5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), NINF, 'real component is -infinity' ); - t.strictEqual( imag( v ), 0.0, 'imaginary component is 0' ); - - z1 = new Complex128( -1.0e308, -1.0e308 ); - z2 = new Complex128( -5.0e-324, 5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), 0.0, 'real component is 0' ); - t.strictEqual( imag( v ), PINF, 'imaginary component is +infinity' ); - - z1 = new Complex128( 1.0e308, -1.0e308 ); - z2 = new Complex128( -5.0e-324, -5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), 0.0, 'real component is 0' ); - t.strictEqual( imag( v ), PINF, 'imaginary component is +infinity' ); - - z1 = new Complex128( -1.0e308, 1.0e308 ); - z2 = new Complex128( -5.0e-324, -5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), 0.0, 'real component is 0' ); - t.strictEqual( imag( v ), NINF, 'imaginary component is -infinity' ); - - z1 = new Complex128( -1.0e308, -1.0e308 ); - z2 = new Complex128( 5.0e-324, -5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), 0.0, 'real component is 0' ); - t.strictEqual( imag( v ), NINF, 'imaginary component is -infinity' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - v = cdiv( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, 1.0 ); - v = cdiv( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - v = cdiv( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, NaN ); - v = cdiv( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, NaN ); - v = cdiv( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( -2.0, 1.0 ); - v = cdiv( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - v = cdiv( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/div/test/test.native.js b/float64/base/div/test/test.native.js deleted file mode 100644 index 6b9f94bd..00000000 --- a/float64/base/div/test/test.native.js +++ /dev/null @@ -1,1074 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable id-length, max-statements */ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var tape = require( 'tape' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var toBinaryString = require( '@stdlib/number/float64/base/to-binary-string' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var cdiv = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( cdiv instanceof Error ) -}; - - -// FIXTURES // - -var data = require( './fixtures/julia/data.json' ); -var componentScales1 = require( './fixtures/julia/component_scales1.json' ); -var componentScales2 = require( './fixtures/julia/component_scales2.json' ); -var imaginaryComponentScales = require( './fixtures/julia/imaginary_component_scales.json' ); -var realComponentScales = require( './fixtures/julia/real_component_scales.json' ); -var largeNegativeImaginaryComponents = require( './fixtures/julia/large_negative_imaginary_components.json' ); -var largeNegativeRealComponents = require( './fixtures/julia/large_negative_real_components.json' ); -var largePositiveImaginaryComponents = require( './fixtures/julia/large_positive_imaginary_components.json' ); -var largePositiveRealComponents = require( './fixtures/julia/large_positive_real_components.json' ); -var tinyNegativeImaginaryComponents = require( './fixtures/julia/tiny_negative_imaginary_components.json' ); -var tinyNegativeRealComponents = require( './fixtures/julia/tiny_negative_real_components.json' ); -var tinyPositiveImaginaryComponents = require( './fixtures/julia/tiny_positive_imaginary_components.json' ); -var tinyPositiveRealComponents = require( './fixtures/julia/tiny_positive_real_components.json' ); - - -// FUNCTIONS // - -/** -* Compares the binary representations of two double-precision floating-point numbers and returns the first index of a differing bit. If all bits match, the function returns `-1`. -* -* TODO: revisit once ULP distance fcn is written -* -* @private -* @param {number} a - first number -* @param {number} b - second number -* @returns {integer} index -*/ -function bitdiff( a, b ) { - var astr; - var bstr; - var i; - - astr = toBinaryString( a ); - bstr = toBinaryString( b ); - for ( i = 0; i < 64; i++ ) { - if ( astr[ i ] !== bstr[ i ] ) { - return i; - } - } - return -1; -} - - -// TESTS // - -tape( 'main export is a function', opts, function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof cdiv, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function computes a complex quotient (base behavior)', opts, function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex128( 2.0, 4.0 ); - z2 = new Complex128( 1.0, 2.0 ); - - v = cdiv( z1, z2 ); - - t.strictEqual( real( v ), 2.0, 'returns expected value' ); - t.strictEqual( imag( v ), 0.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function computes a complex quotient (difficult cases)', opts, function test( t ) { - var idx; - var re1; - var im1; - var re2; - var im2; - var z1; - var z2; - var q; - - // Note: test cases extracted from Figure 6 of https://arxiv.org/pdf/1210.4539.pdf. - - // Test case #1: - z1 = new Complex128( 1.0, 1.0 ); - z2 = new Complex128( 1.0, pow( 2.0, 1023.0 ) ); - - q = cdiv( z1, z2 ); - - idx = bitdiff( real( q ), pow( 2.0, -1023.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), -pow( 2.0, -1023.0 ) ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #2: - z1 = new Complex128( 1.0, 1.0 ); - z2 = new Complex128( pow( 2.0, -1023.0 ), pow( 2.0, -1023.0 ) ); - - q = cdiv( z1, z2 ); - - idx = bitdiff( real( q ), pow( 2.0, 1023.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), 0.0 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #3: - re1 = pow( 2.0, 1023.0 ); - im1 = pow( 2.0, -1023.0 ); - re2 = pow( 2.0, 677.0 ); - im2 = pow( 2.0, -677.0 ); - - z1 = new Complex128( re1, im1 ); - z2 = new Complex128( re2, im2 ); - - q = cdiv( z1, z2 ); - - idx = bitdiff( real( q ), pow( 2.0, 346.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), -pow( 2.0, -1008.0 ) ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #4: - z1 = new Complex128( pow( 2.0, 1023.0 ), pow( 2.0, 1023.0 ) ); - z2 = new Complex128( 1.0, 1.0 ); - - q = cdiv( z1, z2 ); - - idx = bitdiff( real( q ), pow( 2.0, 1023.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), 0.0 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #5: - re1 = pow( 2.0, 1020.0 ); - im1 = pow( 2.0, -844.0 ); - re2 = pow( 2.0, 656.0 ); - im2 = pow( 2.0, -780.0 ); - - z1 = new Complex128( re1, im1 ); - z2 = new Complex128( re2, im2 ); - - q = cdiv( z1, z2 ); - - idx = bitdiff( real( q ), pow( 2.0, 364.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), -pow( 2.0, -1072.0 ) ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #6: - re1 = pow( 2.0, -71.0 ); - im1 = pow( 2.0, 1021.0 ); - re2 = pow( 2.0, 1001.0 ); - im2 = pow( 2.0, -323.0 ); - - z1 = new Complex128( re1, im1 ); - z2 = new Complex128( re2, im2 ); - - q = cdiv( z1, z2 ); - - idx = bitdiff( real( q ), pow( 2.0, -1072.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), pow( 2.0, 20.0 ) ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #7: - re1 = pow( 2.0, -347.0 ); - im1 = pow( 2.0, -54.0 ); - re2 = pow( 2.0, -1037.0 ); - im2 = pow( 2.0, -1058.0 ); - - z1 = new Complex128( re1, im1 ); - z2 = new Complex128( re2, im2 ); - - q = cdiv( z1, z2 ); - - idx = bitdiff( real( q ), 3.898125604559113300e289 ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), 8.174961907852353577e295 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #8: - re1 = pow( 2.0, -1074.0 ); - im1 = pow( 2.0, -1074.0 ); - re2 = pow( 2.0, -1073.0 ); - im2 = pow( 2.0, -1074.0 ); - - z1 = new Complex128( re1, im1 ); - z2 = new Complex128( re2, im2 ); - - q = cdiv( z1, z2 ); - - /* - * See section 3.6 in https://arxiv.org/pdf/1210.4539.pdf. - * - * ```text - * q[0]: 0011111111100011001100110011001100110011001100110011001100110100 - * 0.6: 0011111111100011001100110011001100110011001100110011001100110011 - * ``` - * - * If we add - * - * ```text - * 0000000000000000000000000000000000000000000000000000000000000001 - * ``` - * - * to `0.6`, we get `q[0]`; thus, the result is 1 bit off. - */ - idx = bitdiff( real( q ), 0.6 ); - t.strictEqual( idx, 61, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), 0.2 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #9: - re1 = pow( 2.0, 1015.0 ); - im1 = pow( 2.0, -989.0 ); - re2 = pow( 2.0, 1023.0 ); - im2 = pow( 2.0, 1023.0 ); - - z1 = new Complex128( re1, im1 ); - z2 = new Complex128( re2, im2 ); - - q = cdiv( z1, z2 ); - - idx = bitdiff( real( q ), 0.001953125 ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), -0.001953125 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #10: - re1 = pow( 2.0, -622.0 ); - im1 = pow( 2.0, -1071.0 ); - re2 = pow( 2.0, -343.0 ); - im2 = pow( 2.0, -798.0 ); - - z1 = new Complex128( re1, im1 ); - z2 = new Complex128( re2, im2 ); - - q = cdiv( z1, z2 ); - - idx = bitdiff( real( q ), 1.02951151789360578e-84 ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( imag( q ), 6.97145987515076231e-220 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - t.end(); -}); - -tape( 'the function computes a complex quotient (tested against fixtures)', opts, function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = data.re1; - im1 = data.im1; - re2 = data.re2; - im2 = data.im2; - qre = data.qre; - qim = data.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - - // NOTE: the tolerance here is larger than for the JavaScript implementation due to compiler optimizations which may be performed resulting in result divergence. For discussion, see https://github.com/stdlib-js/stdlib/pull/2298#discussion_r1624765205 - tol = 2.0 * EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real(q)+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - - // NOTE: the tolerance here is larger than for the JavaScript implementation due to compiler optimizations which may be performed resulting in result divergence. For discussion, see https://github.com/stdlib-js/stdlib/pull/2298#discussion_r1624765205 - tol = 2.0 * EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag(q)+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (different component scales)', opts, function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = componentScales1.re1; - im1 = componentScales1.im1; - re2 = componentScales1.re2; - im2 = componentScales1.im2; - qre = componentScales1.qre; - qim = componentScales1.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real(q)+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag(q)+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (different component scales)', opts, function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = componentScales2.re1; - im1 = componentScales2.im1; - re2 = componentScales2.re2; - im2 = componentScales2.im2; - qre = componentScales2.qre; - qim = componentScales2.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real(q)+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag(q)+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (different imaginary component scales)', opts, function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = imaginaryComponentScales.re1; - im1 = imaginaryComponentScales.im1; - re2 = imaginaryComponentScales.re2; - im2 = imaginaryComponentScales.im2; - qre = imaginaryComponentScales.qre; - qim = imaginaryComponentScales.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real(q)+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag(q)+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (real imaginary component scales)', opts, function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = realComponentScales.re1; - im1 = realComponentScales.im1; - re2 = realComponentScales.re2; - im2 = realComponentScales.im2; - qre = realComponentScales.qre; - qim = realComponentScales.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real(q)+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag(q)+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (large negative imaginary components)', opts, function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = largeNegativeImaginaryComponents.re1; - im1 = largeNegativeImaginaryComponents.im1; - re2 = largeNegativeImaginaryComponents.re2; - im2 = largeNegativeImaginaryComponents.im2; - qre = largeNegativeImaginaryComponents.qre; - qim = largeNegativeImaginaryComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real(q)+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag(q)+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (large negative real components)', opts, function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = largeNegativeRealComponents.re1; - im1 = largeNegativeRealComponents.im1; - re2 = largeNegativeRealComponents.re2; - im2 = largeNegativeRealComponents.im2; - qre = largeNegativeRealComponents.qre; - qim = largeNegativeRealComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real(q)+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag(q)+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (large positive imaginary components)', opts, function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = largePositiveImaginaryComponents.re1; - im1 = largePositiveImaginaryComponents.im1; - re2 = largePositiveImaginaryComponents.re2; - im2 = largePositiveImaginaryComponents.im2; - qre = largePositiveImaginaryComponents.qre; - qim = largePositiveImaginaryComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real(q)+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag(q)+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (large positive real components)', opts, function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = largePositiveRealComponents.re1; - im1 = largePositiveRealComponents.im1; - re2 = largePositiveRealComponents.re2; - im2 = largePositiveRealComponents.im2; - qre = largePositiveRealComponents.qre; - qim = largePositiveRealComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - - // NOTE: the tolerance here is larger than for the JavaScript implementation due to compiler optimizations which may be performed resulting in result divergence. For discussion, see https://github.com/stdlib-js/stdlib/pull/2298#discussion_r1624765205 - tol = 2.0 * EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real(q)+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - - // NOTE: the tolerance here is larger than for the JavaScript implementation due to compiler optimizations which may be performed resulting in result divergence. For discussion, see https://github.com/stdlib-js/stdlib/pull/2298#discussion_r1624765205 - tol = 2.0 * EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag(q)+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (tiny negative imaginary components)', opts, function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = tinyNegativeImaginaryComponents.re1; - im1 = tinyNegativeImaginaryComponents.im1; - re2 = tinyNegativeImaginaryComponents.re2; - im2 = tinyNegativeImaginaryComponents.im2; - qre = tinyNegativeImaginaryComponents.qre; - qim = tinyNegativeImaginaryComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real(q)+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag(q)+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (tiny negative real components)', opts, function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = tinyNegativeRealComponents.re1; - im1 = tinyNegativeRealComponents.im1; - re2 = tinyNegativeRealComponents.re2; - im2 = tinyNegativeRealComponents.im2; - qre = tinyNegativeRealComponents.qre; - qim = tinyNegativeRealComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real(q)+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag(q)+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (tiny positive imaginary components)', opts, function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = tinyPositiveImaginaryComponents.re1; - im1 = tinyPositiveImaginaryComponents.im1; - re2 = tinyPositiveImaginaryComponents.re2; - im2 = tinyPositiveImaginaryComponents.im2; - qre = tinyPositiveImaginaryComponents.qre; - qim = tinyPositiveImaginaryComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real(q)+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag(q)+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (tiny positive real components)', opts, function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = tinyPositiveRealComponents.re1; - im1 = tinyPositiveRealComponents.im1; - re2 = tinyPositiveRealComponents.re2; - im2 = tinyPositiveRealComponents.im2; - qre = tinyPositiveRealComponents.qre; - qim = tinyPositiveRealComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Complex128( re1[ i ], im1[ i ] ); - z2 = new Complex128( re2[ i ], im2[ i ] ); - q = cdiv( z1, z2 ); - - if ( real( q ) === qre[ i ] ) { - t.strictEqual( real( q ), qre[ i ], 'returns expected real component' ); - } else { - delta = abs( real( q ) - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+real(q)+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( imag( q ) === qim[ i ] ) { - t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( imag( q ) - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+imag(q)+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function handles large and small numbers', opts, function test( t ) { - var expected; - var z1; - var z2; - var v; - - z1 = new Complex128( 1.0e308, 5.0e307 ); - z2 = new Complex128( 1.0, 0.5 ); - v = cdiv( z1, z2 ); - expected = [ 1.0e308, 0.0 ]; - - t.strictEqual( real( v ), expected[ 0 ], 'returns expected values' ); - t.strictEqual( imag( v ), expected[ 1 ], 'returns expected values' ); - - z1 = new Complex128( 1.0, 0.5 ); - z2 = new Complex128( 1.0e308, 5.0e307 ); - v = cdiv( z1, z2 ); - expected = [ 1.0e-308, 0.0 ]; - - t.strictEqual( real( v ), expected[ 0 ], 'returns expected values' ); - t.strictEqual( imag( v ), expected[ 1 ], 'returns expected values' ); - - z1 = new Complex128( 1.0e-304, 2.0e-304 ); - z2 = new Complex128( 1.0, 2.0 ); - v = cdiv( z1, z2 ); - expected = [ 1.0e-304, 0.0 ]; - - t.strictEqual( real( v ), expected[ 0 ], 'returns expected values' ); - t.strictEqual( imag( v ), expected[ 1 ], 'returns expected values' ); - - z1 = new Complex128( 1.0, 2.0 ); - z2 = new Complex128( 1.0e-304, 2.0e-304 ); - v = cdiv( z1, z2 ); - expected = [ 1.0e+304, 0.0 ]; - - t.strictEqual( real( v ), expected[ 0 ], 'returns expected values' ); - t.strictEqual( imag( v ), expected[ 1 ], 'returns expected values' ); - - z1 = new Complex128( 2.0, 4.0 ); - z2 = new Complex128( 0.0, 2.0 ); - v = cdiv( z1, z2 ); - expected = [ 2.0, -1.0 ]; - - t.strictEqual( real( v ), expected[ 0 ], 'returns expected values' ); - t.strictEqual( imag( v ), expected[ 1 ], 'returns expected values' ); - - z1 = new Complex128( 1.0e-180, 1.0e-180 ); - z2 = new Complex128( 1.0, 1.0e-180 ); - v = cdiv( z1, z2 ); - expected = [ 1.0e-180, 1.0e-180 ]; - - t.strictEqual( real( v ), expected[ 0 ], 'returns expected values' ); - t.strictEqual( imag( v ), expected[ 1 ], 'returns expected values' ); - - t.end(); -}); - -tape( 'the function may overflow during complex division', opts, function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex128( 1.0e308, 1.0e308 ); - z2 = new Complex128( 5.0e-324, 5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), PINF, 'real component is +infinity' ); - t.strictEqual( imag( v ), 0.0, 'imaginary component is 0' ); - - z1 = new Complex128( 1.0e308, 1.0e308 ); - z2 = new Complex128( -5.0e-324, 5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), 0.0, 'real component is 0' ); - t.strictEqual( imag( v ), NINF, 'imaginary component is -infinity' ); - - z1 = new Complex128( 1.0e308, -1.0e308 ); - z2 = new Complex128( 5.0e-324, 5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), 0.0, 'real component is 0' ); - t.strictEqual( imag( v ), NINF, 'imaginary component is -infinity' ); - - z1 = new Complex128( -1.0e308, 1.0e308 ); - z2 = new Complex128( 5.0e-324, 5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), 0.0, 'real component is 0' ); - t.strictEqual( imag( v ), PINF, 'imaginary component is +infinity' ); - - z1 = new Complex128( 1.0e308, 1.0e308 ); - z2 = new Complex128( 5.0e-324, -5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), 0.0, 'real component is 0' ); - t.strictEqual( imag( v ), PINF, 'imaginary component is +infinity' ); - - z1 = new Complex128( -1.0e308, 1.0e308 ); - z2 = new Complex128( -5.0e-324, 5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), PINF, 'real component is +infinity' ); - t.strictEqual( imag( v ), 0.0, 'imaginary component is 0' ); - - z1 = new Complex128( 1.0e308, -1.0e308 ); - z2 = new Complex128( 5.0e-324, -5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), PINF, 'real component is +infinity' ); - t.strictEqual( imag( v ), 0.0, 'imaginary component is 0' ); - - z1 = new Complex128( 1.0e308, -1.0e308 ); - z2 = new Complex128( -5.0e-324, 5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), NINF, 'real component is -infinity' ); - t.strictEqual( imag( v ), 0.0, 'imaginary component is 0' ); - - z1 = new Complex128( -1.0e308, 1.0e308 ); - z2 = new Complex128( 5.0e-324, -5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), NINF, 'real component is -infinity' ); - t.strictEqual( imag( v ), 0.0, 'imaginary component is 0' ); - - z1 = new Complex128( -1.0e308, -1.0e308 ); - z2 = new Complex128( -5.0e-324, 5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), 0.0, 'real component is 0' ); - t.strictEqual( imag( v ), PINF, 'imaginary component is +infinity' ); - - z1 = new Complex128( 1.0e308, -1.0e308 ); - z2 = new Complex128( -5.0e-324, -5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), 0.0, 'real component is 0' ); - t.strictEqual( imag( v ), PINF, 'imaginary component is +infinity' ); - - z1 = new Complex128( -1.0e308, 1.0e308 ); - z2 = new Complex128( -5.0e-324, -5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), 0.0, 'real component is 0' ); - t.strictEqual( imag( v ), NINF, 'imaginary component is -infinity' ); - - z1 = new Complex128( -1.0e308, -1.0e308 ); - z2 = new Complex128( 5.0e-324, -5.0e-324 ); - v = cdiv( z1, z2 ); - t.strictEqual( real( v ), 0.0, 'real component is 0' ); - t.strictEqual( imag( v ), NINF, 'imaginary component is -infinity' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', opts, function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - v = cdiv( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, 1.0 ); - v = cdiv( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - v = cdiv( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, NaN ); - v = cdiv( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, NaN ); - v = cdiv( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( -2.0, 1.0 ); - v = cdiv( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - v = cdiv( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/div/test/test.strided.js b/float64/base/div/test/test.strided.js deleted file mode 100644 index d825ba68..00000000 --- a/float64/base/div/test/test.strided.js +++ /dev/null @@ -1,1054 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable id-length, max-statements */ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var pow = require( '@stdlib/math/base/special/pow' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var isAlmostEqualFloat64Array = require( '@stdlib/assert/is-almost-equal-float64array' ); -var toBinaryString = require( '@stdlib/number/float64/base/to-binary-string' ); -var Float64Array = require( '@stdlib/array/float64' ); -var cdiv = require( './../lib/strided.js' ); - - -// FIXTURES // - -var data = require( './fixtures/julia/data.json' ); -var componentScales1 = require( './fixtures/julia/component_scales1.json' ); -var componentScales2 = require( './fixtures/julia/component_scales2.json' ); -var imaginaryComponentScales = require( './fixtures/julia/imaginary_component_scales.json' ); -var realComponentScales = require( './fixtures/julia/real_component_scales.json' ); -var largeNegativeImaginaryComponents = require( './fixtures/julia/large_negative_imaginary_components.json' ); -var largeNegativeRealComponents = require( './fixtures/julia/large_negative_real_components.json' ); -var largePositiveImaginaryComponents = require( './fixtures/julia/large_positive_imaginary_components.json' ); -var largePositiveRealComponents = require( './fixtures/julia/large_positive_real_components.json' ); -var tinyNegativeImaginaryComponents = require( './fixtures/julia/tiny_negative_imaginary_components.json' ); -var tinyNegativeRealComponents = require( './fixtures/julia/tiny_negative_real_components.json' ); -var tinyPositiveImaginaryComponents = require( './fixtures/julia/tiny_positive_imaginary_components.json' ); -var tinyPositiveRealComponents = require( './fixtures/julia/tiny_positive_real_components.json' ); - - -// FUNCTIONS // - -/** -* Compares the binary representations of two double-precision floating-point numbers and returns the first index of a differing bit. If all bits match, the function returns `-1`. -* -* TODO: revisit once ULP distance fcn is written -* -* @private -* @param {number} a - first number -* @param {number} b - second number -* @returns {integer} index -*/ -function bitdiff( a, b ) { - var astr; - var bstr; - var i; - - astr = toBinaryString( a ); - bstr = toBinaryString( b ); - for ( i = 0; i < 64; i++ ) { - if ( astr[ i ] !== bstr[ i ] ) { - return i; - } - } - return -1; -} - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof cdiv, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function computes a complex quotient (base behavior)', function test( t ) { - var expected; - var out; - var z1; - var z2; - var v; - - out = new Float64Array( 2 ); - z1 = new Float64Array( [ 2.0, 4.0 ] ); - z2 = new Float64Array( [ 1.0, 2.0 ] ); - expected = new Float64Array( [ 2.0, 0.0 ] ); - - v = cdiv( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - t.end(); -}); - -tape( 'the function computes a complex quotient (difficult cases)', function test( t ) { - var idx; - var re1; - var im1; - var re2; - var im2; - var z1; - var z2; - var q; - - // Note: test cases extracted from Figure 6 of https://arxiv.org/pdf/1210.4539.pdf. - - // Test case #1: - z1 = new Float64Array( [ 1.0, 1.0 ] ); - z2 = new Float64Array( [ 1.0, pow( 2.0, 1023.0 ) ] ); - - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - idx = bitdiff( q[ 0 ], pow( 2.0, -1023.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( q[ 1 ], -pow( 2.0, -1023.0 ) ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #2: - z1 = new Float64Array( [ 1.0, 1.0 ] ); - z2 = new Float64Array( [ pow( 2.0, -1023.0 ), pow( 2.0, -1023.0 ) ] ); - - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - idx = bitdiff( q[ 0 ], pow( 2.0, 1023.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( q[ 1 ], 0.0 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #3: - re1 = pow( 2.0, 1023.0 ); - im1 = pow( 2.0, -1023.0 ); - re2 = pow( 2.0, 677.0 ); - im2 = pow( 2.0, -677.0 ); - - z1 = new Float64Array( [ re1, im1 ] ); - z2 = new Float64Array( [ re2, im2 ] ); - - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - idx = bitdiff( q[ 0 ], pow( 2.0, 346.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( q[ 1 ], -pow( 2.0, -1008.0 ) ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #4: - z1 = new Float64Array( [ pow( 2.0, 1023.0 ), pow( 2.0, 1023.0 ) ] ); - z2 = new Float64Array( [ 1.0, 1.0 ] ); - - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - idx = bitdiff( q[ 0 ], pow( 2.0, 1023.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( q[ 1 ], 0.0 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #5: - re1 = pow( 2.0, 1020.0 ); - im1 = pow( 2.0, -844.0 ); - re2 = pow( 2.0, 656.0 ); - im2 = pow( 2.0, -780.0 ); - - z1 = new Float64Array( [ re1, im1 ] ); - z2 = new Float64Array( [ re2, im2 ] ); - - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - idx = bitdiff( q[ 0 ], pow( 2.0, 364.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( q[ 1 ], -pow( 2.0, -1072.0 ) ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #6: - re1 = pow( 2.0, -71.0 ); - im1 = pow( 2.0, 1021.0 ); - re2 = pow( 2.0, 1001.0 ); - im2 = pow( 2.0, -323.0 ); - - z1 = new Float64Array( [ re1, im1 ] ); - z2 = new Float64Array( [ re2, im2 ] ); - - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - idx = bitdiff( q[ 0 ], pow( 2.0, -1072.0 ) ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( q[ 1 ], pow( 2.0, 20.0 ) ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #7: - re1 = pow( 2.0, -347.0 ); - im1 = pow( 2.0, -54.0 ); - re2 = pow( 2.0, -1037.0 ); - im2 = pow( 2.0, -1058.0 ); - - z1 = new Float64Array( [ re1, im1 ] ); - z2 = new Float64Array( [ re2, im2 ] ); - - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - idx = bitdiff( q[ 0 ], 3.898125604559113300e289 ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( q[ 1 ], 8.174961907852353577e295 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #8: - re1 = pow( 2.0, -1074.0 ); - im1 = pow( 2.0, -1074.0 ); - re2 = pow( 2.0, -1073.0 ); - im2 = pow( 2.0, -1074.0 ); - - z1 = new Float64Array( [ re1, im1 ] ); - z2 = new Float64Array( [ re2, im2 ] ); - - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - /* - * See section 3.6 in https://arxiv.org/pdf/1210.4539.pdf. - * - * ```text - * real(q): 0011111111100011001100110011001100110011001100110011001100110100 - * 0.6: 0011111111100011001100110011001100110011001100110011001100110011 - * ``` - * - * If we add - * - * ```text - * 0000000000000000000000000000000000000000000000000000000000000001 - * ``` - * - * to `0.6`, we get `real( q )`; thus, the result is 1 bit off. - */ - idx = bitdiff( q[ 0 ], 0.6 ); - t.strictEqual( idx, 61, 'real component has expected binary representation' ); - - idx = bitdiff( q[ 1 ], 0.2 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #9: - re1 = pow( 2.0, 1015.0 ); - im1 = pow( 2.0, -989.0 ); - re2 = pow( 2.0, 1023.0 ); - im2 = pow( 2.0, 1023.0 ); - - z1 = new Float64Array( [ re1, im1 ] ); - z2 = new Float64Array( [ re2, im2 ] ); - - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - idx = bitdiff( q[ 0 ], 0.001953125 ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( q[ 1 ], -0.001953125 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - // Test case #10: - re1 = pow( 2.0, -622.0 ); - im1 = pow( 2.0, -1071.0 ); - re2 = pow( 2.0, -343.0 ); - im2 = pow( 2.0, -798.0 ); - - z1 = new Float64Array( [ re1, im1 ] ); - z2 = new Float64Array( [ re2, im2 ] ); - - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - idx = bitdiff( q[ 0 ], 1.02951151789360578e-84 ); - t.strictEqual( idx, -1, 'real component has expected binary representation' ); - - idx = bitdiff( q[ 1 ], 6.97145987515076231e-220 ); - t.strictEqual( idx, -1, 'imaginary component has expected binary representation' ); - - t.end(); -}); - -tape( 'the function computes a complex quotient (tested against fixtures)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = data.re1; - im1 = data.im1; - re2 = data.re2; - im2 = data.im2; - qre = data.qre; - qim = data.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Float64Array( [ re1[ i ], im1[ i ] ] ); - z2 = new Float64Array( [ re2[ i ], im2[ i ] ] ); - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (different component scales)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = componentScales1.re1; - im1 = componentScales1.im1; - re2 = componentScales1.re2; - im2 = componentScales1.im2; - qre = componentScales1.qre; - qim = componentScales1.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Float64Array( [ re1[ i ], im1[ i ] ] ); - z2 = new Float64Array( [ re2[ i ], im2[ i ] ] ); - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (different component scales)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = componentScales2.re1; - im1 = componentScales2.im1; - re2 = componentScales2.re2; - im2 = componentScales2.im2; - qre = componentScales2.qre; - qim = componentScales2.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Float64Array( [ re1[ i ], im1[ i ] ] ); - z2 = new Float64Array( [ re2[ i ], im2[ i ] ] ); - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (different imaginary component scales)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = imaginaryComponentScales.re1; - im1 = imaginaryComponentScales.im1; - re2 = imaginaryComponentScales.re2; - im2 = imaginaryComponentScales.im2; - qre = imaginaryComponentScales.qre; - qim = imaginaryComponentScales.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Float64Array( [ re1[ i ], im1[ i ] ] ); - z2 = new Float64Array( [ re2[ i ], im2[ i ] ] ); - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (real imaginary component scales)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = realComponentScales.re1; - im1 = realComponentScales.im1; - re2 = realComponentScales.re2; - im2 = realComponentScales.im2; - qre = realComponentScales.qre; - qim = realComponentScales.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Float64Array( [ re1[ i ], im1[ i ] ] ); - z2 = new Float64Array( [ re2[ i ], im2[ i ] ] ); - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (large negative imaginary components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = largeNegativeImaginaryComponents.re1; - im1 = largeNegativeImaginaryComponents.im1; - re2 = largeNegativeImaginaryComponents.re2; - im2 = largeNegativeImaginaryComponents.im2; - qre = largeNegativeImaginaryComponents.qre; - qim = largeNegativeImaginaryComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Float64Array( [ re1[ i ], im1[ i ] ] ); - z2 = new Float64Array( [ re2[ i ], im2[ i ] ] ); - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (large negative real components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = largeNegativeRealComponents.re1; - im1 = largeNegativeRealComponents.im1; - re2 = largeNegativeRealComponents.re2; - im2 = largeNegativeRealComponents.im2; - qre = largeNegativeRealComponents.qre; - qim = largeNegativeRealComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Float64Array( [ re1[ i ], im1[ i ] ] ); - z2 = new Float64Array( [ re2[ i ], im2[ i ] ] ); - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (large positive imaginary components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = largePositiveImaginaryComponents.re1; - im1 = largePositiveImaginaryComponents.im1; - re2 = largePositiveImaginaryComponents.re2; - im2 = largePositiveImaginaryComponents.im2; - qre = largePositiveImaginaryComponents.qre; - qim = largePositiveImaginaryComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Float64Array( [ re1[ i ], im1[ i ] ] ); - z2 = new Float64Array( [ re2[ i ], im2[ i ] ] ); - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (large positive real components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = largePositiveRealComponents.re1; - im1 = largePositiveRealComponents.im1; - re2 = largePositiveRealComponents.re2; - im2 = largePositiveRealComponents.im2; - qre = largePositiveRealComponents.qre; - qim = largePositiveRealComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Float64Array( [ re1[ i ], im1[ i ] ] ); - z2 = new Float64Array( [ re2[ i ], im2[ i ] ] ); - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (tiny negative imaginary components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = tinyNegativeImaginaryComponents.re1; - im1 = tinyNegativeImaginaryComponents.im1; - re2 = tinyNegativeImaginaryComponents.re2; - im2 = tinyNegativeImaginaryComponents.im2; - qre = tinyNegativeImaginaryComponents.qre; - qim = tinyNegativeImaginaryComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Float64Array( [ re1[ i ], im1[ i ] ] ); - z2 = new Float64Array( [ re2[ i ], im2[ i ] ] ); - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (tiny negative real components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = tinyNegativeRealComponents.re1; - im1 = tinyNegativeRealComponents.im1; - re2 = tinyNegativeRealComponents.re2; - im2 = tinyNegativeRealComponents.im2; - qre = tinyNegativeRealComponents.qre; - qim = tinyNegativeRealComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Float64Array( [ re1[ i ], im1[ i ] ] ); - z2 = new Float64Array( [ re2[ i ], im2[ i ] ] ); - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (tiny positive imaginary components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = tinyPositiveImaginaryComponents.re1; - im1 = tinyPositiveImaginaryComponents.im1; - re2 = tinyPositiveImaginaryComponents.re2; - im2 = tinyPositiveImaginaryComponents.im2; - qre = tinyPositiveImaginaryComponents.qre; - qim = tinyPositiveImaginaryComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Float64Array( [ re1[ i ], im1[ i ] ] ); - z2 = new Float64Array( [ re2[ i ], im2[ i ] ] ); - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function computes a complex quotient (tiny positive real components)', function test( t ) { - var delta; - var tol; - var re1; - var im1; - var re2; - var im2; - var qre; - var qim; - var z1; - var z2; - var i; - var q; - - re1 = tinyPositiveRealComponents.re1; - im1 = tinyPositiveRealComponents.im1; - re2 = tinyPositiveRealComponents.re2; - im2 = tinyPositiveRealComponents.im2; - qre = tinyPositiveRealComponents.qre; - qim = tinyPositiveRealComponents.qim; - - for ( i = 0; i < re1.length; i++ ) { - z1 = new Float64Array( [ re1[ i ], im1[ i ] ] ); - z2 = new Float64Array( [ re2[ i ], im2[ i ] ] ); - q = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - - if ( q[ 0 ] === qre[ i ] ) { - t.strictEqual( q[ 0 ], qre[ i ], 'returns expected real component' ); - } else { - delta = abs( q[ 0 ] - qre[ i ] ); - tol = EPS * abs( qre[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - if ( q[ 1 ] === qim[ i ] ) { - t.strictEqual( q[ 1 ], qim[ i ], 'returns expected imaginary component' ); - } else { - delta = abs( q[ 1 ] - qim[ i ] ); - tol = EPS * abs( qim[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' ); - } - } - t.end(); -}); - -tape( 'the function handles large and small numbers', function test( t ) { - var expected; - var z1; - var z2; - var v; - - z1 = new Float64Array( [ 1.0e308, 5.0e307 ] ); - z2 = new Float64Array( [ 1.0, 0.5 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ 1.0e308, 0.0 ] ); - - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - z1 = new Float64Array( [ 1.0, 0.5 ] ); - z2 = new Float64Array( [ 1.0e308, 5.0e307 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ 1.0e-308, 0.0 ] ); - - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - z1 = new Float64Array( [ 1.0e-304, 2.0e-304 ] ); - z2 = new Float64Array( [ 1.0, 2.0 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ 1.0e-304, 0.0 ] ); - - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - z1 = new Float64Array( [ 1.0, 2.0 ] ); - z2 = new Float64Array( [ 1.0e-304, 2.0e-304 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ 1.0e+304, 0.0 ] ); - - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - z1 = new Float64Array( [ 2.0, 4.0 ] ); - z2 = new Float64Array( [ 0.0, 2.0 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ 2.0, -1.0 ] ); - - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - z1 = new Float64Array( [ 1.0e-180, 1.0e-180 ] ); - z2 = new Float64Array( [ 1.0, 1.0e-180 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ 1.0e-180, 1.0e-180 ] ); - - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - t.end(); -}); - -tape( 'the function may overflow during complex division', function test( t ) { - var expected; - var z1; - var z2; - var v; - - z1 = new Float64Array( [ 1.0e308, 1.0e308 ] ); - z2 = new Float64Array( [ 5.0e-324, 5.0e-324 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ PINF, 0.0 ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - z1 = new Float64Array( [ 1.0e308, 1.0e308 ] ); - z2 = new Float64Array( [ -5.0e-324, 5.0e-324 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ 0.0, NINF ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - z1 = new Float64Array( [ 1.0e308, -1.0e308 ] ); - z2 = new Float64Array( [ 5.0e-324, 5.0e-324 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ 0.0, NINF ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - z1 = new Float64Array( [ -1.0e308, 1.0e308 ] ); - z2 = new Float64Array( [ 5.0e-324, 5.0e-324 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ 0.0, PINF ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - z1 = new Float64Array( [ 1.0e308, 1.0e308 ] ); - z2 = new Float64Array( [ 5.0e-324, -5.0e-324 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ 0.0, PINF ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - z1 = new Float64Array( [ -1.0e308, 1.0e308 ] ); - z2 = new Float64Array( [ -5.0e-324, 5.0e-324 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ PINF, 0.0 ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - z1 = new Float64Array( [ 1.0e308, -1.0e308 ] ); - z2 = new Float64Array( [ 5.0e-324, -5.0e-324 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ PINF, 0.0 ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - z1 = new Float64Array( [ 1.0e308, -1.0e308 ] ); - z2 = new Float64Array( [ -5.0e-324, 5.0e-324 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ NINF, 0.0 ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - z1 = new Float64Array( [ -1.0e308, 1.0e308 ] ); - z2 = new Float64Array( [ 5.0e-324, -5.0e-324 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ NINF, 0.0 ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - z1 = new Float64Array( [ -1.0e308, -1.0e308 ] ); - z2 = new Float64Array( [ -5.0e-324, 5.0e-324 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ 0.0, PINF ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - z1 = new Float64Array( [ 1.0e308, -1.0e308 ] ); - z2 = new Float64Array( [ -5.0e-324, -5.0e-324 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ 0.0, PINF ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - z1 = new Float64Array( [ -1.0e308, 1.0e308 ] ); - z2 = new Float64Array( [ -5.0e-324, -5.0e-324 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ 0.0, NINF ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - z1 = new Float64Array( [ -1.0e308, -1.0e308 ] ); - z2 = new Float64Array( [ 5.0e-324, -5.0e-324 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - expected = new Float64Array( [ 0.0, NINF ] ); - t.strictEqual( isAlmostEqualFloat64Array( v, expected, 1 ), true, 'returns expected values' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', function test( t ) { - var z1; - var z2; - var v; - - z1 = new Float64Array( [ NaN, 3.0 ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - t.strictEqual( isnan( v[ 0 ] ), true, 'returns expected value' ); - t.strictEqual( isnan( v[ 1 ] ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, NaN ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - t.strictEqual( isnan( v[ 0 ] ), true, 'returns expected value' ); - t.strictEqual( isnan( v[ 1 ] ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ NaN, 1.0 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - t.strictEqual( isnan( v[ 0 ] ), true, 'returns expected value' ); - t.strictEqual( isnan( v[ 1 ] ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ -2.0, NaN ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - t.strictEqual( isnan( v[ 0 ] ), true, 'returns expected value' ); - t.strictEqual( isnan( v[ 1 ] ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ NaN, NaN ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - t.strictEqual( isnan( v[ 0 ] ), true, 'returns expected value' ); - t.strictEqual( isnan( v[ 1 ] ), true, 'returns expected value' ); - - z1 = new Float64Array( [ NaN, NaN ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - t.strictEqual( isnan( v[ 0 ] ), true, 'returns expected value' ); - t.strictEqual( isnan( v[ 1 ] ), true, 'returns expected value' ); - - z1 = new Float64Array( [ NaN, NaN ] ); - z2 = new Float64Array( [ NaN, NaN ] ); - v = cdiv( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - t.strictEqual( isnan( v[ 0 ] ), true, 'returns expected value' ); - t.strictEqual( isnan( v[ 1 ] ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/docs/types/index.d.ts b/float64/base/docs/types/index.d.ts deleted file mode 100644 index e74c6bca..00000000 --- a/float64/base/docs/types/index.d.ts +++ /dev/null @@ -1,316 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/* eslint-disable max-lines */ - -import add = require( './../../../../float64/base/add' ); -import add3 = require( './../../../../float64/base/add3' ); -import assert = require( './../../../../float64/base/assert' ); -import div = require( './../../../../float64/base/div' ); -import identity = require( './../../../../float64/base/identity' ); -import mul = require( './../../../../float64/base/mul' ); -import muladd = require( './../../../../float64/base/mul-add' ); -import neg = require( './../../../../float64/base/neg' ); -import scale = require( './../../../../float64/base/scale' ); -import sub = require( './../../../../float64/base/sub' ); - -/** -* Interface describing the `base` namespace. -*/ -interface Namespace { - /** - * Adds two double-precision complex floating-point numbers. - * - * @param z1 - complex number - * @param z2 - complex number - * @returns result - * - * @example - * var Complex128 = require( './../../../../float64/ctor' ); - * - * var z = new Complex128( 5.0, 3.0 ); - * - * var out = ns.add( z, z ); - * // returns [ 10.0, 6.0 ] - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var out = new Float64Array( 2 ); - * var v = ns.add.assign( 5.0, 3.0, 5.0, 3.0, out, 1, 0 ); - * // returns [ 10.0, 6.0 ] - * - * var bool = ( out === v ); - * // returns true - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var z1 = new Float64Array( [ 5.0, 3.0 ] ); - * var z2 = new Float64Array( [ 5.0, 3.0 ] ); - * - * var out = ns.add.strided( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - * // returns [ 10.0, 6.0 ] - */ - add: typeof add; - - /** - * Computes the sum of three double-precision complex floating-point numbers. - * - * @param z1 - first complex number - * @param z2 - second complex number - * @param z3 - third complex number - * @returns result - * - * @example - * var Complex128 = require( './../../../../float64/ctor' ); - * - * var z = new Complex128( 5.0, 3.0 ); - * - * var out = ns.add3( z, z, z ); - * // returns [ 15.0, 9.0 ] - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var out = new Float64Array( 2 ); - * var v = ns.add3.assign( 5.0, 3.0, 5.0, 3.0, 5.0, 3.0, out, 1, 0 ); - * // returns [ 15.0, 9.0 ] - * - * var bool = ( out === v ); - * // returns true - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var z1 = new Float64Array( [ 5.0, 3.0 ] ); - * var z2 = new Float64Array( [ 5.0, 3.0 ] ); - * var z3 = new Float64Array( [ 5.0, 3.0 ] ); - * - * var out = ns.add3.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, new Float64Array( 2 ), 1, 0 ); - * // returns [ 15.0, 9.0 ] - */ - add3: typeof add3; - - /** - * Base (i.e., lower-level) double-precision complex number assertion functions. - */ - assert: typeof assert; - - /** - * Divides two double-precision complex floating-point numbers. - * - * @param z1 - complex number - * @param z2 - complex number - * @returns result - * - * @example - * var Complex128 = require( './../../../../float64/ctor' ); - * - * var z1 = new Complex128( -13.0, -1.0 ); - * var z2 = new Complex128( -2.0, 1.0 ); - * - * var out = ns.div( z1, z2 ); - * // returns [ 5.0, 3.0 ] - */ - div: typeof div; - - /** - * Evaluates the identity function for double-precision complex floating-point number. - * - * @param z - input value - * @returns input value - * - * @example - * var Complex128 = require( './../../../../float64/ctor' ); - * - * var v = ns.identity( new Complex128( -1.0, 2.0 ) ); - * // returns [ -1.0, 2.0 ] - */ - identity: typeof identity; - - /** - * Multiplies two double-precision complex floating-point numbers. - * - * @param z1 - complex number - * @param z2 - complex number - * @returns result - * - * @example - * var Complex128 = require( './../../../../float64/ctor' ); - * - * var z1 = new Complex128( 5.0, 3.0 ); - * var z2 = new Complex128( -2.0, 1.0 ); - * - * var out = ns.mul( z1, z2 ); - * // returns [ -13.0, -1.0 ] - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var out = new Float64Array( 2 ); - * var v = ns.mul.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ); - * // returns [ -13.0, -1.0 ] - * - * var bool = ( out === v ); - * // returns true - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var z1 = new Float64Array( [ 5.0, 3.0 ] ); - * var z2 = new Float64Array( [ -2.0, 1.0 ] ); - * - * var out = ns.mul.strided( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - * // returns [ -13.0, -1.0 ] - */ - mul: typeof mul; - - /** - * Performs a multiply-add operation involving three double-precision complex floating-point numbers. - * - * @param alpha - complex number - * @param x - complex number - * @param y - complex number - * @returns result - * - * @example - * var Complex128 = require( './../../../../float64/ctor' ); - * - * var z1 = new Complex128( 5.0, 3.0 ); - * var z2 = new Complex128( -2.0, 1.0 ); - * var z3 = new Complex128( 7.0, -8.0 ); - * - * var out = ns.muladd( z1, z2, z3 ); - * // returns [ -6.0, -9.0 ] - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var out = ns.muladd.assign( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, new Float64Array( 2 ), 1, 0 ); - * // returns [ -6.0, -9.0 ] - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var alpha = new Float64Array( [ 5.0, 3.0 ] ); - * var x = new Float64Array( [ -2.0, 1.0 ] ); - * var y = new Float64Array( [ 7.0, -8.0 ] ); - * - * var out = ns.muladd.strided( alpha, 1, 0, x, 1, 0, y, 1, 0, new Float64Array( 2 ), 1, 0 ); - * // returns [ -6.0, -9.0 ] - */ - muladd: typeof muladd; - - /** - * Negates a double-precision complex floating-point number. - * - * @param z - complex number - * @returns result - * - * @example - * var Complex128 = require( './../../../../float64/ctor' ); - * - * var z1 = new Complex128( -4.2, 5.5 ); - * - * var out = ns.neg( z1 ); - * // returns [ 4.2, -5.5 ] - * - * @example - * var Complex128 = require( './../../../../float64/ctor' ); - * - * var z2 = new Complex128( 0.0, 0.0 ); - * - * var out = ns.neg( z2 ); - * // returns [ -0.0, -0.0 ] - * - * @example - * var Complex128 = require( './../../../../float64/ctor' ); - * - * var z3 = new Complex128( NaN, NaN ); - * - * var out = ns.neg( z3 ); - * // returns [ NaN, NaN ] - */ - neg: typeof neg; - - /** - * Scales a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant. - * - * @param alpha - scalar constant - * @param z - complex number - * @returns result - * - * @example - * var Complex128 = require( './../../../../float64/ctor' ); - * - * var z = new Complex128( 5.0, 3.0 ); - * - * var out = ns.scale( 5.0, z ); - * // returns [ 25.0, 15.0 ] - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var out = new Float64Array( 2 ); - * var v = ns.scale.assign( 5.0, 5.0, 3.0, out, 1, 0 ); - * // returns [ 25.0, 15.0 ] - * - * var bool = ( out === v ); - * // returns true - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var z = new Float64Array( [ 5.0, 3.0 ] ); - * - * var out = ns.scale.strided( 5.0, z, 1, 0, new Float64Array( 2 ), 1, 0 ); - * // returns [ 25.0, 15.0 ] - */ - scale: typeof scale; - - /** - * Subtracts two double-precision complex floating-point numbers. - * - * @param z1 - complex number - * @param z2 - complex number - * @returns result - * - * @example - * var Complex128 = require( './../../../../float64/ctor' ); - * - * var z1 = new Complex128( 5.0, 3.0 ); - * var z2 = new Complex128( -2.0, 1.0 ); - * - * var out = ns.sub( z1, z2 ); - * // returns [ 7.0, 2.0 ] - */ - sub: typeof sub; -} - -/** -* Base (i.e., lower-level) double-precision complex number functions. -*/ -declare var ns: Namespace; - - -// EXPORTS // - -export = ns; diff --git a/float64/base/docs/types/test.ts b/float64/base/docs/types/test.ts deleted file mode 100644 index 2f81653a..00000000 --- a/float64/base/docs/types/test.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable @typescript-eslint/no-unused-expressions */ - -import ns = require( './index' ); - - -// TESTS // - -// The exported value is the expected interface... -{ - ns; // $ExpectType Namespace -} diff --git a/float64/base/examples/index.js b/float64/base/examples/index.js deleted file mode 100644 index 6115ca08..00000000 --- a/float64/base/examples/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - -console.log( objectKeys( ns ) ); diff --git a/float64/base/identity/README.md b/float64/base/identity/README.md deleted file mode 100644 index fb71db97..00000000 --- a/float64/base/identity/README.md +++ /dev/null @@ -1,239 +0,0 @@ - - -# cidentity - -> Evaluate the [identity function][identity-function] of a double-precision [complex][@stdlib/complex/float64/ctor] floating-point number. - -
- -The [identity-function][identity-function] is defined as - - - -```math -f(z) = z -``` - - - - - -for all `z`. - -
- - - -
- -## Usage - -```javascript -var cidentity = require( '@stdlib/complex/float64/base/identity' ); -``` - -#### cidentity( z ) - -Evaluates the [identity function][identity-function] for a double-precision [complex][@stdlib/complex/float64/ctor] floating-point number. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var v = cidentity( new Complex128( -1.0, 2.0 ) ); -// returns [ -1.0, 2.0 ] -``` - -
- - - -
- -## Examples - - - - - -```javascript -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var cidentity = require( '@stdlib/complex/float64/base/identity' ); - -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = new Complex128( discreteUniform( -50, 50 ), discreteUniform( -50, 50 ) ); - console.log( 'identity(%s) = %s', z, cidentity( z ) ); -} -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float64/base/identity.h" -``` - -#### stdlib_base_complex128_identity( z ) - -Evaluates the identity function for a double-precision complex floating-point number. - -```c -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/imag.h" - -stdlib_complex128_t z = stdlib_complex128( 2.5, -1.5 ); -stdlib_complex128_t out = stdlib_base_complex128_identity( z ); - -double re = stdlib_complex128_real( out ); -// returns 2.5 - -double im = stdlib_complex128_imag( out ); -// returns -1.5 -``` - -The function accepts the following arguments: - -- **z**: `[in] stdlib_complex128_t` input value. - -```c -stdlib_complex128_t stdlib_base_complex128_identity( const stdlib_complex128_t z ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float64/base/identity.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 3.14, 1.5 ), - stdlib_complex128( -3.14, -1.5 ), - stdlib_complex128( 0.0, 0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - stdlib_complex128_t y; - double re1; - double im1; - double re2; - double im2; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - y = stdlib_base_complex128_identity( v ); - stdlib_complex128_reim( v, &re1, &im1 ); - stdlib_complex128_reim( y, &re2, &im2 ); - printf( "cidentity(%lf + %lfi) = %lf + %lfi\n", re1, im1, re2, im2 ); - } -} -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/float64/base/identity/benchmark/benchmark.js b/float64/base/identity/benchmark/benchmark.js deleted file mode 100644 index 5e5cc9d3..00000000 --- a/float64/base/identity/benchmark/benchmark.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var pkg = require( './../package.json' ).name; -var cidentity = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var y; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - y = cidentity( values[ i%values.length ] ); - if ( isnan( real( y ) ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( imag( y ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/identity/benchmark/benchmark.native.js b/float64/base/identity/benchmark/benchmark.native.js deleted file mode 100644 index 51f537d2..00000000 --- a/float64/base/identity/benchmark/benchmark.native.js +++ /dev/null @@ -1,66 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var tryRequire = require( '@stdlib/utils/try-require' ); -var pkg = require( './../package.json' ).name; - - -// VARIABLES // - -var cidentity = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( cidentity instanceof Error ) -}; - - -// MAIN // - -bench( pkg+'::native', opts, function benchmark( b ) { - var values; - var y; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - y = cidentity( values[ i%values.length ] ); - if ( isnan( real( y ) ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( real( y ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/identity/benchmark/c/native/Makefile b/float64/base/identity/benchmark/c/native/Makefile deleted file mode 100644 index 3cbfe3fe..00000000 --- a/float64/base/identity/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/identity/benchmark/c/native/benchmark.c b/float64/base/identity/benchmark/c/native/benchmark.c deleted file mode 100644 index a3fbd5e4..00000000 --- a/float64/base/identity/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,141 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/identity.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include -#include -#include -#include -#include - -#define NAME "cidentity" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double re; - double im; - double t; - double v; - int i; - - stdlib_complex128_t x; - stdlib_complex128_t y; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - v = ( 1000.0*rand_double() ) - 500.0; - x = stdlib_complex128( v, v ); - y = stdlib_base_complex128_identity( x ); - stdlib_complex128_reim( y, &re, &im ); - if ( re != re ) { - printf( "unexpected result\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "unexpected result\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/base/identity/binding.gyp b/float64/base/identity/binding.gyp deleted file mode 100644 index f2b466ae..00000000 --- a/float64/base/identity/binding.gyp +++ /dev/null @@ -1,170 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A `.gyp` file for building a Node.js native add-on. -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # List of files to include in this file: - 'includes': [ - './include.gypi', - ], - - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Target name should match the add-on export name: - 'addon_target_name%': 'addon', - - # Set variables based on the host OS: - 'conditions': [ - [ - 'OS=="win"', - { - # Define the object file suffix: - 'obj': 'obj', - }, - { - # Define the object file suffix: - 'obj': 'o', - } - ], # end condition (OS=="win") - ], # end conditions - }, # end variables - - # Define compile targets: - 'targets': [ - - # Target to generate an add-on: - { - # The target name should match the add-on export name: - 'target_name': '<(addon_target_name)', - - # Define dependencies: - 'dependencies': [], - - # Define directories which contain relevant include headers: - 'include_dirs': [ - # Local include directory: - '<@(include_dirs)', - ], - - # List of source files: - 'sources': [ - '<@(src_files)', - ], - - # Settings which should be applied when a target's object files are used as linker input: - 'link_settings': { - # Define libraries: - 'libraries': [ - '<@(libraries)', - ], - - # Define library directories: - 'library_dirs': [ - '<@(library_dirs)', - ], - }, - - # C/C++ compiler flags: - 'cflags': [ - # Enable commonly used warning options: - '-Wall', - - # Aggressive optimization: - '-O3', - ], - - # C specific compiler flags: - 'cflags_c': [ - # Specify the C standard to which a program is expected to conform: - '-std=c99', - ], - - # C++ specific compiler flags: - 'cflags_cpp': [ - # Specify the C++ standard to which a program is expected to conform: - '-std=c++11', - ], - - # Linker flags: - 'ldflags': [], - - # Apply conditions based on the host OS: - 'conditions': [ - [ - 'OS=="mac"', - { - # Linker flags: - 'ldflags': [ - '-undefined dynamic_lookup', - '-Wl,-no-pie', - '-Wl,-search_paths_first', - ], - }, - ], # end condition (OS=="mac") - [ - 'OS!="win"', - { - # C/C++ flags: - 'cflags': [ - # Generate platform-independent code: - '-fPIC', - ], - }, - ], # end condition (OS!="win") - ], # end conditions - }, # end target <(addon_target_name) - - # Target to copy a generated add-on to a standard location: - { - 'target_name': 'copy_addon', - - # Declare that the output of this target is not linked: - 'type': 'none', - - # Define dependencies: - 'dependencies': [ - # Require that the add-on be generated before building this target: - '<(addon_target_name)', - ], - - # Define a list of actions: - 'actions': [ - { - 'action_name': 'copy_addon', - 'message': 'Copying addon...', - - # Explicitly list the inputs in the command-line invocation below: - 'inputs': [], - - # Declare the expected outputs: - 'outputs': [ - '<(addon_output_dir)/<(addon_target_name).node', - ], - - # Define the command-line invocation: - 'action': [ - 'cp', - '<(PRODUCT_DIR)/<(addon_target_name).node', - '<(addon_output_dir)/<(addon_target_name).node', - ], - }, - ], # end actions - }, # end target copy_addon - ], # end targets -} diff --git a/float64/base/identity/docs/img/equation_identity_function.svg b/float64/base/identity/docs/img/equation_identity_function.svg deleted file mode 100644 index 86516c97..00000000 --- a/float64/base/identity/docs/img/equation_identity_function.svg +++ /dev/null @@ -1,18 +0,0 @@ - -f left-parenthesis x right-parenthesis equals x - - - \ No newline at end of file diff --git a/float64/base/identity/docs/repl.txt b/float64/base/identity/docs/repl.txt deleted file mode 100644 index 2afc3a55..00000000 --- a/float64/base/identity/docs/repl.txt +++ /dev/null @@ -1,27 +0,0 @@ - -{{alias}}( z ) - Evaluates the identity function for a double-precision complex floating- - point number. - - Parameters - ---------- - z: Complex128 - Input value. - - Returns - ------- - v: Complex128 - Input value. - - Examples - -------- - > var v = {{alias}}( new {{alias:@stdlib/complex/float64/ctor}}( -1.0, 2.0 ) ) - - > var re = {{alias:@stdlib/complex/float64/real}}( v ) - -1.0 - > var img = {{alias:@stdlib/complex/float64/imag}}( v ) - 2.0 - - See Also - -------- - diff --git a/float64/base/identity/docs/types/index.d.ts b/float64/base/identity/docs/types/index.d.ts deleted file mode 100644 index b307da50..00000000 --- a/float64/base/identity/docs/types/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex128 } from '@stdlib/types/complex'; - -/** -* Evaluates the identity function for double-precision complex floating-point number. -* -* @param z - input value -* @returns input value -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var v = cidentity( new Complex128( -1.0, 2.0 ) ); -* // returns [ -1.0, 2.0 ] -*/ -declare function cidentity( z: Complex128 ): Complex128; - - -// EXPORTS // - -export = cidentity; diff --git a/float64/base/identity/docs/types/test.ts b/float64/base/identity/docs/types/test.ts deleted file mode 100644 index 8b4a53fa..00000000 --- a/float64/base/identity/docs/types/test.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../../float64/ctor' ); -import cidentity = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - cidentity( new Complex128( 1.0, 2.0 ) ); // $ExpectType Complex128 -} - -// The compiler throws an error if the function is provided a value other than a complex number... -{ - cidentity( true ); // $ExpectError - cidentity( false ); // $ExpectError - cidentity( null ); // $ExpectError - cidentity( undefined ); // $ExpectError - cidentity( '5' ); // $ExpectError - cidentity( [] ); // $ExpectError - cidentity( {} ); // $ExpectError - cidentity( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided insufficient arguments... -{ - cidentity(); // $ExpectError -} diff --git a/float64/base/identity/examples/c/Makefile b/float64/base/identity/examples/c/Makefile deleted file mode 100644 index f0ae66fe..00000000 --- a/float64/base/identity/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/identity/examples/c/example.c b/float64/base/identity/examples/c/example.c deleted file mode 100644 index ea5b186a..00000000 --- a/float64/base/identity/examples/c/example.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/identity.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 3.14, 1.5 ), - stdlib_complex128( -3.14, -1.5 ), - stdlib_complex128( 0.0, 0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - stdlib_complex128_t y; - double re1; - double im1; - double re2; - double im2; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - y = stdlib_base_complex128_identity( v ); - stdlib_complex128_reim( v, &re1, &im1 ); - stdlib_complex128_reim( y, &re2, &im2 ); - printf( "cidentity(%lf + %lfi) = %lf + %lfi\n", re1, im1, re2, im2 ); - } -} diff --git a/float64/base/identity/examples/index.js b/float64/base/identity/examples/index.js deleted file mode 100644 index 34b77d69..00000000 --- a/float64/base/identity/examples/index.js +++ /dev/null @@ -1,30 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var Complex128 = require( './../../../../float64/ctor' ); -var cidentity = require( './../lib' ); - -var z; -var i; -for ( i = 0; i < 100; i++ ) { - z = new Complex128( discreteUniform( -50, 50 ), discreteUniform( -50, 50 ) ); // eslint-disable-line max-len - console.log( 'identity(%s) = %s', z, cidentity( z ) ); -} diff --git a/float64/base/identity/include.gypi b/float64/base/identity/include.gypi deleted file mode 100644 index 78db9faf..00000000 --- a/float64/base/identity/include.gypi +++ /dev/null @@ -1,53 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A GYP include file for building a Node.js native add-on. -# -# Main documentation: -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Source directory: - 'src_dir': './src', - - # Include directories: - 'include_dirs': [ - '[ -1.0, 2.0 ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float64/base/identity/lib/main.js b/float64/base/identity/lib/main.js deleted file mode 100644 index 8f9e4830..00000000 --- a/float64/base/identity/lib/main.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Evaluates the identity function for a double-precision complex floating-point number. -* -* @param {Complex128} z - input value -* @returns {Complex128} input value -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var v = cidentity( new Complex128( -1.0, 2.0 ) ); -* // returns [ -1.0, 2.0 ] -*/ -function cidentity( z ) { - return z; -} - - -// EXPORTS // - -module.exports = cidentity; diff --git a/float64/base/identity/lib/native.js b/float64/base/identity/lib/native.js deleted file mode 100644 index 52ec0344..00000000 --- a/float64/base/identity/lib/native.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex128 = require( './../../../../float64/ctor' ); -var addon = require( './../src/addon.node' ); - - -// MAIN // - -/** -* Evaluates the identity function for a double-precision complex floating-point number. -* -* @private -* @param {Complex128} z - input value -* @returns {Complex128} input value -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var v = cidentity( new Complex128( -1.0, 2.0 ) ); -* // returns [ -1.0, 2.0 ] -*/ -function cidentity( z ) { - var v = addon( z ); - return new Complex128( v.re, v.im ); -} - - -// EXPORTS // - -module.exports = cidentity; diff --git a/float64/base/identity/manifest.json b/float64/base/identity/manifest.json deleted file mode 100644 index 00d5fd64..00000000 --- a/float64/base/identity/manifest.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/napi/unary", - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - } - ] -} diff --git a/float64/base/identity/package.json b/float64/base/identity/package.json deleted file mode 100644 index be7b70a8..00000000 --- a/float64/base/identity/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "@stdlib/complex/float64/base/identity", - "version": "0.0.0", - "description": "Evaluate the identity function for a double-precision complex floating-point number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "identity", - "double", - "double-precision", - "dbl", - "float64", - "complex", - "cmplx" - ], - "__stdlib__": {} -} diff --git a/float64/base/identity/src/Makefile b/float64/base/identity/src/Makefile deleted file mode 100644 index 904c7dc4..00000000 --- a/float64/base/identity/src/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - - -# RULES # - -#/ -# Removes generated files for building an add-on. -# -# @example -# make clean-addon -#/ -clean-addon: - $(QUIET) -rm -f *.o *.node - -.PHONY: clean-addon - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: clean-addon - -.PHONY: clean diff --git a/float64/base/identity/src/addon.c b/float64/base/identity/src/addon.c deleted file mode 100644 index f803d4cd..00000000 --- a/float64/base/identity/src/addon.c +++ /dev/null @@ -1,22 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/identity.h" -#include "stdlib/math/base/napi/unary.h" - -STDLIB_MATH_BASE_NAPI_MODULE_Z_Z( stdlib_base_complex128_identity ) diff --git a/float64/base/identity/src/main.c b/float64/base/identity/src/main.c deleted file mode 100644 index 66c49a99..00000000 --- a/float64/base/identity/src/main.c +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/identity.h" -#include "stdlib/complex/float64/ctor.h" - -/** -* Evaluates the identity function for a double-precision complex floating-point number. -* -* @param z number -* @return input value -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* #include "stdlib/complex/float64/real.h" -* #include "stdlib/complex/float64/imag.h" -* -* stdlib_complex128_t z = stdlib_complex128( 3.0, 3.0 ); -* stdlib_complex128_t out = stdlib_base_complex128_identity( z ); -* -* double re = stdlib_complex128_real( out ); -* // returns 3.0 -* -* double im = stdlib_complex128_imag( out ); -* // returns 3.0 -*/ -stdlib_complex128_t stdlib_base_complex128_identity( const stdlib_complex128_t z ) { - return z; -} diff --git a/float64/base/identity/test/test.js b/float64/base/identity/test/test.js deleted file mode 100644 index b78ea166..00000000 --- a/float64/base/identity/test/test.js +++ /dev/null @@ -1,117 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' ); -var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var cidentity = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof cidentity, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function evaluates the identity function when provided a finite number', function test( t ) { - var v; - - v = cidentity( new Complex128( -2.0, 1.0 ) ); - t.strictEqual( real( v ), -2.0, 'returns expected value' ); - t.strictEqual( imag( v ), 1.0, 'returns expected value' ); - - v = cidentity( new Complex128( 3.0, -2.0 ) ); - t.strictEqual( real( v ), 3.0, 'returns expected value' ); - t.strictEqual( imag( v ), -2.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function evaluates the identity function when provided +-zero', function test( t ) { - var v; - - v = cidentity( new Complex128( -0.0, -0.0 ) ); - t.strictEqual( isNegativeZero( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isNegativeZero( imag( v ) ), true, 'returns expected value' ); - - v = cidentity( new Complex128( 0.0, 0.0 ) ); - t.strictEqual( isPositiveZero( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isPositiveZero( imag( v ) ), true, 'returns expected value' ); - - v = cidentity( new Complex128( -0.0, 0.0 ) ); - t.strictEqual( isNegativeZero( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isPositiveZero( imag( v ) ), true, 'returns expected value' ); - - v = cidentity( new Complex128( 0.0, -0.0 ) ); - t.strictEqual( isPositiveZero( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isNegativeZero( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function evaluates the identity function when provided +-infinity', function test( t ) { - var v; - - v = cidentity( new Complex128( PINF, PINF ) ); - t.strictEqual( real( v ), PINF, 'returns expected value' ); - t.strictEqual( imag( v ), PINF, 'returns expected value' ); - - v = cidentity( new Complex128( NINF, NINF ) ); - t.strictEqual( real( v ), NINF, 'returns expected value' ); - t.strictEqual( imag( v ), NINF, 'returns expected value' ); - - v = cidentity( new Complex128( NINF, PINF ) ); - t.strictEqual( real( v ), NINF, 'returns expected value' ); - t.strictEqual( imag( v ), PINF, 'returns expected value' ); - - v = cidentity( new Complex128( PINF, NINF ) ); - t.strictEqual( real( v ), PINF, 'returns expected value' ); - t.strictEqual( imag( v ), NINF, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function evaluates the identity function when provided `NaN`', function test( t ) { - var v; - - v = cidentity( new Complex128( NaN, NaN ) ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - v = cidentity( new Complex128( 1.0, NaN ) ); - t.strictEqual( real( v ), 1.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - v = cidentity( new Complex128( NaN, 1.0 ) ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 1.0, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/identity/test/test.native.js b/float64/base/identity/test/test.native.js deleted file mode 100644 index 9e71715f..00000000 --- a/float64/base/identity/test/test.native.js +++ /dev/null @@ -1,126 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var tape = require( 'tape' ); -var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' ); -var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var cidentity = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( cidentity instanceof Error ) -}; - - -// TESTS // - -tape( 'main export is a function', opts, function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof cidentity, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function evaluates the identity function when provided a finite number', opts, function test( t ) { - var v; - - v = cidentity( new Complex128( -2.0, 1.0 ) ); - t.strictEqual( real( v ), -2.0, 'returns expected value' ); - t.strictEqual( imag( v ), 1.0, 'returns expected value' ); - - v = cidentity( new Complex128( 3.0, -2.0 ) ); - t.strictEqual( real( v ), 3.0, 'returns expected value' ); - t.strictEqual( imag( v ), -2.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function evaluates the identity function when provided +-zero', opts, function test( t ) { - var v; - - v = cidentity( new Complex128( -0.0, -0.0 ) ); - t.strictEqual( isNegativeZero( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isNegativeZero( imag( v ) ), true, 'returns expected value' ); - - v = cidentity( new Complex128( 0.0, 0.0 ) ); - t.strictEqual( isPositiveZero( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isPositiveZero( imag( v ) ), true, 'returns expected value' ); - - v = cidentity( new Complex128( -0.0, 0.0 ) ); - t.strictEqual( isNegativeZero( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isPositiveZero( imag( v ) ), true, 'returns expected value' ); - - v = cidentity( new Complex128( 0.0, -0.0 ) ); - t.strictEqual( isPositiveZero( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isNegativeZero( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function evaluates the identity function when provided +-infinity', opts, function test( t ) { - var v; - - v = cidentity( new Complex128( PINF, PINF ) ); - t.strictEqual( real( v ), PINF, 'returns expected value' ); - t.strictEqual( imag( v ), PINF, 'returns expected value' ); - - v = cidentity( new Complex128( NINF, NINF ) ); - t.strictEqual( real( v ), NINF, 'returns expected value' ); - t.strictEqual( imag( v ), NINF, 'returns expected value' ); - - v = cidentity( new Complex128( NINF, PINF ) ); - t.strictEqual( real( v ), NINF, 'returns expected value' ); - t.strictEqual( imag( v ), PINF, 'returns expected value' ); - - v = cidentity( new Complex128( PINF, NINF ) ); - t.strictEqual( real( v ), PINF, 'returns expected value' ); - t.strictEqual( imag( v ), NINF, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function evaluates the identity function when provided `NaN`', opts, function test( t ) { - var v; - - v = cidentity( new Complex128( NaN, NaN ) ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - v = cidentity( new Complex128( 1.0, NaN ) ); - t.strictEqual( real( v ), 1.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - v = cidentity( new Complex128( NaN, 1.0 ) ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 1.0, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/lib/index.js b/float64/base/lib/index.js deleted file mode 100644 index 5afac1f9..00000000 --- a/float64/base/lib/index.js +++ /dev/null @@ -1,132 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/* -* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name. -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); - - -// MAIN // - -/** -* Top-level namespace. -* -* @namespace ns -*/ -var ns = {}; - -/** -* @name add -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/base/add} -*/ -setReadOnly( ns, 'add', require( './../../../float64/base/add' ) ); - -/** -* @name add3 -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/base/add3} -*/ -setReadOnly( ns, 'add3', require( './../../../float64/base/add3' ) ); - -/** -* @name assert -* @memberof ns -* @readonly -* @type {Namespace} -* @see {@link module:@stdlib/complex/float64/base/assert} -*/ -setReadOnly( ns, 'assert', require( './../../../float64/base/assert' ) ); - -/** -* @name div -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/base/div} -*/ -setReadOnly( ns, 'div', require( './../../../float64/base/div' ) ); - -/** -* @name identity -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/base/identity} -*/ -setReadOnly( ns, 'identity', require( './../../../float64/base/identity' ) ); - -/** -* @name mul -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/base/mul} -*/ -setReadOnly( ns, 'mul', require( './../../../float64/base/mul' ) ); - -/** -* @name muladd -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/base/mul-add} -*/ -setReadOnly( ns, 'muladd', require( './../../../float64/base/mul-add' ) ); - -/** -* @name neg -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/base/neg} -*/ -setReadOnly( ns, 'neg', require( './../../../float64/base/neg' ) ); - -/** -* @name scale -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/base/scale} -*/ -setReadOnly( ns, 'scale', require( './../../../float64/base/scale' ) ); - -/** -* @name sub -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/base/sub} -*/ -setReadOnly( ns, 'sub', require( './../../../float64/base/sub' ) ); - - -// EXPORTS // - -module.exports = ns; diff --git a/float64/base/mul-add/README.md b/float64/base/mul-add/README.md deleted file mode 100644 index 432102ee..00000000 --- a/float64/base/mul-add/README.md +++ /dev/null @@ -1,286 +0,0 @@ - - -# muladd - -> Perform a multiply-add operation involving three double-precision complex floating-point numbers. - -
- -
- - - -
- -## Usage - -```javascript -var muladd = require( '@stdlib/complex/float64/base/mul-add' ); -``` - -#### muladd( alpha, x, y ) - -Performs a multiply-add operation involving three double-precision complex floating-point numbers. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( -2.0, 1.0 ); -var z3 = new Complex128( 7.0, -8.0 ); - -// Compute `alpha*x + y`: -var v = muladd( z1, z2, z3 ); -// returns [ -6.0, -9.0 ] -``` - -The function supports the following parameters: - -- **alpha**: first [complex number][@stdlib/complex/float64/ctor]. -- **x**: second [complex number][@stdlib/complex/float64/ctor]. -- **y**: third [complex number][@stdlib/complex/float64/ctor]. - -#### muladd.assign( ar, ai, xr, xi, yr, yi, out, strideOut, offsetOut ) - -Performs a multiply-add operation involving three double-precision complex floating-point numbers and assigns the results to an output strided array. - -```javascript -var Float64Array = require( '@stdlib/array/float64' ); - -var out = new Float64Array( 2 ); -var v = muladd.assign( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, out, 1, 0 ); -// returns [ -6.0, -9.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **ar**: real component of the first complex number. -- **ai**: imaginary component of the first complex number. -- **xr**: real component of the second complex number. -- **xi**: imaginary component of the second complex number. -- **yr**: real component of the third complex number. -- **yi**: imaginary component of the third complex number. -- **out**: output array. -- **strideOut**: stride length for `out`. -- **offsetOut**: starting index for `out`. - -#### muladd.strided( alpha, sa, oa, x, sx, ox, y, sy, oy, out, so, oo ) - -Performs a multiply-add operation involving three double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. - -```javascript -var Float64Array = require( '@stdlib/array/float64' ); - -var z1 = new Float64Array( [ 5.0, 3.0 ] ); -var z2 = new Float64Array( [ -2.0, 1.0 ] ); -var z3 = new Float64Array( [ 7.0, -8.0 ] ); -var out = new Float64Array( 2 ); - -var v = muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); -// returns [ -6.0, -9.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **alpha**: first complex number strided array view. -- **sa**: stride length for `alpha`. -- **oa**: starting index for `alpha`. -- **x**: second complex number strided array view. -- **sx**: stride length for `x`. -- **ox**: starting index for `x`. -- **y**: third complex number strided array view. -- **sy**: stride length for `y`. -- **oy**: starting index for `y`. -- **out**: output array. -- **so**: stride length for `out`. -- **oo**: starting index for `out`. - -
- - - -
- -## Examples - - - -```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var muladd = require( '@stdlib/complex/float64/base/mul-add' ); - -// Generate arrays of random values: -var z1 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); -var z3 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise computation: -logEachMap( '( (%s) * (%s) ) + (%s) = %s', z1, z2, z3, muladd ); -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float64/base/mul_add.h" -``` - -#### stdlib_base_complex128_muladd( alpha, x, y ) - -Performs a multiply-add operation involving three double-precision complex floating-point numbers. - -```c -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/imag.h" - -stdlib_complex128_t z1 = stdlib_complex128( 5.0, 3.0 ); -stdlib_complex128_t z2 = stdlib_complex128( -2.0, 1.0 ); -stdlib_complex128_t z3 = stdlib_complex128( 7.0, -8.0 ); - -stdlib_complex128_t out = stdlib_base_complex128_muladd( z1, z2, z3 ); - -double re = stdlib_complex128_real( out ); -// returns -6.0 - -double im = stdlib_complex128_imag( out ); -// returns -9.0 -``` - -The function accepts the following arguments: - -- **alpha**: `[in] stdlib_complex128_t` input value. -- **x**: `[in] stdlib_complex128_t` input value. -- **y**: `[in] stdlib_complex128_t` input value. - -```c -stdlib_complex128_t stdlib_base_complex128_muladd( const stdlib_complex128_t alpha, const stdlib_complex128_t x, const stdlib_complex128_t y ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float64/base/mul_add.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 3.14, 1.5 ), - stdlib_complex128( -3.14, 1.5 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - stdlib_complex128_t y; - double re; - double im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex128_reim( v, &re, &im ); - printf( "z = %lf + %lfi\n", re, im ); - - y = stdlib_base_complex128_muladd( v, v, v ); - stdlib_complex128_reim( y, &re, &im ); - printf( "z*z + z = %lf + %lfi\n", re, im ); - } -} -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/float64/base/mul-add/benchmark/benchmark.assign.js b/float64/base/mul-add/benchmark/benchmark.assign.js deleted file mode 100644 index 4fe9f9eb..00000000 --- a/float64/base/mul-add/benchmark/benchmark.assign.js +++ /dev/null @@ -1,70 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Float64Array = require( '@stdlib/array/float64' ); -var pkg = require( './../package.json' ).name; -var muladd = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float64' -}; - - -// MAIN // - -bench( pkg+':assign', function benchmark( b ) { - var out; - var re; - var im; - var N; - var i; - var j; - var k; - - N = 100; - re = uniform( N, -500.0, 500.0, options ); - im = uniform( N, -500.0, 500.0, options ); - - out = new Float64Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = i % N; - k = ( i+1 ) % N; - out = muladd.assign( re[ j ], im[ j ], re[ k ], im[ k ], re[ k ], im[ k ], out, 1, 0 ); // eslint-disable-line max-len - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( out[ 0 ] ) || isnan( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/mul-add/benchmark/benchmark.js b/float64/base/mul-add/benchmark/benchmark.js deleted file mode 100644 index 683def93..00000000 --- a/float64/base/mul-add/benchmark/benchmark.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var pkg = require( './../package.json' ).name; -var muladd = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = muladd( z, z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( real( out ) ) || isnan( imag( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/mul-add/benchmark/benchmark.native.js b/float64/base/mul-add/benchmark/benchmark.native.js deleted file mode 100644 index b701642c..00000000 --- a/float64/base/mul-add/benchmark/benchmark.native.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); -var pkg = require( './../package.json' ).name; - - -// VARIABLES // - -var muladd = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( muladd instanceof Error ) -}; - - -// MAIN // - -bench( pkg+'::native', opts, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = muladd( z, z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( real( out ) ) || isnan( imag( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/mul-add/benchmark/benchmark.strided.js b/float64/base/mul-add/benchmark/benchmark.strided.js deleted file mode 100644 index 53b92486..00000000 --- a/float64/base/mul-add/benchmark/benchmark.strided.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Float64Array = require( '@stdlib/array/float64' ); -var pkg = require( './../package.json' ).name; -var muladd = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float64' -}; - - -// MAIN // - -bench( pkg+':strided', function benchmark( b ) { - var out; - var z1; - var z2; - var N; - var i; - var j; - - N = 50; - z1 = uniform( N*2, -500.0, 500.0, options ); - z2 = uniform( N*2, -500.0, 500.0, options ); - - out = new Float64Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = ( i % N ) * 2; - out = muladd.strided( z1, 1, j, z2, 1, j, z2, 1, j, out, 1, 0 ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( out[ 0 ] ) || isnan( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/mul-add/benchmark/c/Makefile b/float64/base/mul-add/benchmark/c/Makefile deleted file mode 100644 index 85a01e54..00000000 --- a/float64/base/mul-add/benchmark/c/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/mul-add/benchmark/c/benchmark.c b/float64/base/mul-add/benchmark/c/benchmark.c deleted file mode 100644 index d312505d..00000000 --- a/float64/base/mul-add/benchmark/c/benchmark.c +++ /dev/null @@ -1,151 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include -#include -#include -#include - -#define NAME "cmuladd" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double complex z1[ 100 ]; - double complex z2[ 100 ]; - double complex z3[ 100 ]; - double complex z4; - double elapsed; - double re; - double im; - double t; - int i; - - for ( i = 0; i < 100; i++ ) { - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z1[ i ] = re + im*I; - - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z2[ i ] = re + im*I; - - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z3[ i ] = re + im*I; - } - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( creal(z1[i%100])*creal(z2[i%100]) ) - ( cimag(z1[i%100])*cimag(z2[i%100]) ) + creal(z3[i%100]); - im = ( creal(z1[i%100])*cimag(z2[i%100]) ) + ( cimag(z1[i%100])*creal(z2[i%100]) ) + cimag(z3[i%100]); - z4 = re + im*I; - if ( z4 != z4 ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( z4 != z4 ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/base/mul-add/benchmark/c/native/Makefile b/float64/base/mul-add/benchmark/c/native/Makefile deleted file mode 100644 index a4bd7b38..00000000 --- a/float64/base/mul-add/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/mul-add/benchmark/c/native/benchmark.c b/float64/base/mul-add/benchmark/c/native/benchmark.c deleted file mode 100644 index 53a4260d..00000000 --- a/float64/base/mul-add/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,153 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/mul_add.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include -#include -#include -#include -#include - -#define NAME "muladd" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - stdlib_complex128_t z1[ 100 ]; - stdlib_complex128_t z2[ 100 ]; - stdlib_complex128_t z3[ 100 ]; - stdlib_complex128_t z4; - double elapsed; - double re; - double im; - double t; - int i; - - for ( i = 0; i < 100; i++ ) { - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z1[ i ] = stdlib_complex128( re, im ); - - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z2[ i ] = stdlib_complex128( re, im ); - - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z3[ i ] = stdlib_complex128( re, im ); - } - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - z4 = stdlib_base_complex128_muladd( z1[ i%100 ], z2[ i%100 ], z3[ i%100 ] ); - stdlib_complex128_reim( z4, &re, &im ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/base/mul-add/benchmark/julia/REQUIRE b/float64/base/mul-add/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float64/base/mul-add/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float64/base/mul-add/benchmark/julia/benchmark.jl b/float64/base/mul-add/benchmark/julia/benchmark.jl deleted file mode 100644 index 4cd221c1..00000000 --- a/float64/base/mul-add/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "muladd"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark ( ComplexF64( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) * ComplexF64( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) ) + ComplexF64( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float64/base/mul-add/binding.gyp b/float64/base/mul-add/binding.gyp deleted file mode 100644 index 68a1ca11..00000000 --- a/float64/base/mul-add/binding.gyp +++ /dev/null @@ -1,170 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A `.gyp` file for building a Node.js native add-on. -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # List of files to include in this file: - 'includes': [ - './include.gypi', - ], - - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Target name should match the add-on export name: - 'addon_target_name%': 'addon', - - # Set variables based on the host OS: - 'conditions': [ - [ - 'OS=="win"', - { - # Define the object file suffix: - 'obj': 'obj', - }, - { - # Define the object file suffix: - 'obj': 'o', - } - ], # end condition (OS=="win") - ], # end conditions - }, # end variables - - # Define compile targets: - 'targets': [ - - # Target to generate an add-on: - { - # The target name should match the add-on export name: - 'target_name': '<(addon_target_name)', - - # Define dependencies: - 'dependencies': [], - - # Define directories which contain relevant include headers: - 'include_dirs': [ - # Local include directory: - '<@(include_dirs)', - ], - - # List of source files: - 'sources': [ - '<@(src_files)', - ], - - # Settings which should be applied when a target's object files are used as linker input: - 'link_settings': { - # Define libraries: - 'libraries': [ - '<@(libraries)', - ], - - # Define library directories: - 'library_dirs': [ - '<@(library_dirs)', - ], - }, - - # C/C++ compiler flags: - 'cflags': [ - # Enable commonly used warning options: - '-Wall', - - # Aggressive optimization: - '-O3', - ], - - # C specific compiler flags: - 'cflags_c': [ - # Specify the C standard to which a program is expected to conform: - '-std=c99', - ], - - # C++ specific compiler flags: - 'cflags_cpp': [ - # Specify the C++ standard to which a program is expected to conform: - '-std=c++11', - ], - - # Linker flags: - 'ldflags': [], - - # Apply conditions based on the host OS: - 'conditions': [ - [ - 'OS=="mac"', - { - # Linker flags: - 'ldflags': [ - '-undefined dynamic_lookup', - '-Wl,-no-pie', - '-Wl,-search_paths_first', - ], - }, - ], # end condition (OS=="mac") - [ - 'OS!="win"', - { - # C/C++ flags: - 'cflags': [ - # Generate platform-independent code: - '-fPIC', - ], - }, - ], # end condition (OS!="win") - ], # end conditions - }, # end target <(addon_target_name) - - # Target to copy a generated add-on to a standard location: - { - 'target_name': 'copy_addon', - - # Declare that the output of this target is not linked: - 'type': 'none', - - # Define dependencies: - 'dependencies': [ - # Require that the add-on be generated before building this target: - '<(addon_target_name)', - ], - - # Define a list of actions: - 'actions': [ - { - 'action_name': 'copy_addon', - 'message': 'Copying addon...', - - # Explicitly list the inputs in the command-line invocation below: - 'inputs': [], - - # Declare the expected outputs: - 'outputs': [ - '<(addon_output_dir)/<(addon_target_name).node', - ], - - # Define the command-line invocation: - 'action': [ - 'cp', - '<(PRODUCT_DIR)/<(addon_target_name).node', - '<(addon_output_dir)/<(addon_target_name).node', - ], - }, - ], # end actions - }, # end target copy_addon - ], # end targets -} diff --git a/float64/base/mul-add/docs/repl.txt b/float64/base/mul-add/docs/repl.txt deleted file mode 100644 index 11a4c536..00000000 --- a/float64/base/mul-add/docs/repl.txt +++ /dev/null @@ -1,142 +0,0 @@ - -{{alias}}( alpha, x, y ) - Performs a multiply-add operation involving three double-precision complex - floating-point numbers. - - Parameters - ---------- - alpha: Complex128 - Complex number. - - x: Complex128 - Complex number. - - y: Complex128 - Complex number. - - Returns - ------- - out: Complex128 - Result. - - Examples - -------- - > var z1 = new {{alias:@stdlib/complex/float64/ctor}}( 5.0, 3.0 ) - - > var z2 = new {{alias:@stdlib/complex/float64/ctor}}( -2.0, 1.0 ) - - > var z3 = new {{alias:@stdlib/complex/float64/ctor}}( 7.0, -8.0 ) - - > var out = {{alias}}( z1, z2, z3 ) - - > var re = {{alias:@stdlib/complex/float64/real}}( out ) - -6.0 - > var im = {{alias:@stdlib/complex/float64/imag}}( out ) - -9.0 - - -{{alias}}.assign( ar, ai, xr, xi, yr, yi, out, strideOut, offsetOut ) - Performs a multiply-add operation involving three double-precision complex - floating-point numbers and assigns the results to an output strided array. - - Parameters - ---------- - ar: number - Real component of the first complex number. - - ai: number - Imaginary component of the first complex number. - - xr: number - Real component of the second complex number. - - xi: number - Imaginary component of the second complex number. - - yr: number - Real component of the third complex number. - - yi: number - Imaginary component of the third complex number. - - out: ArrayLikeObject - Output array. - - strideOut: integer - Stride length. - - offsetOut: integer - Starting index. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var out = new {{alias:@stdlib/array/float64}}( 2 ); - > {{alias}}.assign( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, out, 1, 0 ) - [ -6.0, -9.0 ] - - -{{alias}}.strided( a, sa, oa, x, sx, ox, y, sy, oy, out, so, oo ) - Performs a multiply-add operation involving three double-precision complex - floating-point numbers stored in real-valued strided array views and assigns - results to a provided strided output array. - - Parameters - ---------- - a: ArrayLikeObject - First complex number view. - - sa: integer - Stride length for `a`. - - oa: integer - Starting index for `a`. - - x: ArrayLikeObject - Second complex number view. - - sx: integer - Stride length for `x`. - - ox: integer - Starting index for `x`. - - y: ArrayLikeObject - Third complex number view. - - sy: integer - Stride length for `y`. - - oy: integer - Starting index for `y`. - - out: ArrayLikeObject - Output array. - - so: integer - Stride length for `out`. - - oo: integer - Starting index for `out`. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var z1 = new {{alias:@stdlib/array/float64}}( [ 5.0, 3.0 ] ); - > var z2 = new {{alias:@stdlib/array/float64}}( [ -2.0, 1.0 ] ); - > var z3 = new {{alias:@stdlib/array/float64}}( [ 7.0, -8.0 ] ); - > var out = new {{alias:@stdlib/array/float64}}( 2 ); - > {{alias}}.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ) - [ -6.0, -9.0 ] - - See Also - -------- - diff --git a/float64/base/mul-add/docs/types/index.d.ts b/float64/base/mul-add/docs/types/index.d.ts deleted file mode 100644 index 3c3e14c0..00000000 --- a/float64/base/mul-add/docs/types/index.d.ts +++ /dev/null @@ -1,151 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex128 } from '@stdlib/types/complex'; -import { Collection, NumericArray } from '@stdlib/types/array'; - -/** -* Input array. -*/ -type InputArray = NumericArray | Collection; - -/** -* Output array. -*/ -type OutputArray = NumericArray | Collection; - -/** -* Interface for performing a multiply-add operation involving three double-precision complex floating-point numbers. -*/ -interface MulAdd { - /** - * Performs a multiply-add operation involving three double-precision complex floating-point numbers. - * - * @param alpha - complex number - * @param x - complex number - * @param y - complex number - * @returns result - * - * @example - * var Complex128 = require( './../../../../../float64/ctor' ); - * - * var z1 = new Complex128( 5.0, 3.0 ); - * var z2 = new Complex128( -2.0, 1.0 ); - * var z3 = new Complex128( 7.0, -8.0 ); - * - * var out = muladd( z1, z2, z3 ); - * // returns [ -6.0, -9.0 ] - */ - ( alpha: Complex128, x: Complex128, y: Complex128 ): Complex128; - - /** - * Performs a multiply-add operation involving three double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. - * - * @param ar - real component of the first complex number - * @param ai - imaginary component of the first complex number - * @param xr - real component of the second complex number - * @param xi - imaginary component of the second complex number - * @param yr - real component of the third complex number - * @param yi - imaginary component of the third complex number - * @param out - output array - * @param strideOut - stride length - * @param offsetOut - starting index - * @returns output array - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var out = muladd.assign( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, new Float64Array( 2 ), 1, 0 ); - * // returns [ -6.0, -9.0 ] - */ - assign( ar: number, ai: number, xr: number, xi: number, yr: number, yi: number, out: T, strideOut: number, offsetOut: number ): T; - - /** - * Performs a multiply‐add operation involving three double‐precision complex floating‐point numbers stored in real‐valued strided array views and assigns the results to a provided strided output array. - * - * @param alpha - first complex number view - * @param strideA - stride length for `alpha` - * @param offsetA - starting index for `alpha` - * @param x - second complex number view - * @param strideX - stride length for `x` - * @param offsetX - starting index for `x` - * @param y - third complex number view - * @param strideY - stride length for `y` - * @param offsetY - starting index for `y` - * @param out - output array - * @param strideOut - stride length for `out` - * @param offsetOut - starting index for `out` - * @returns output array - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var alpha = new Float64Array( [ 5.0, 3.0 ] ); - * var x = new Float64Array( [ -2.0, 1.0 ] ); - * var y = new Float64Array( [ 7.0, -8.0 ] ); - * - * var out = muladd.strided( alpha, 1, 0, x, 1, 0, y, 1, 0, new Float64Array( 2 ), 1, 0 ); - * // returns [ -6.0, -9.0 ] - */ - strided( alpha: T, strideA: number, offsetA: number, x: U, strideX: number, offsetX: number, y: V, strideY: number, offsetY: number, out: W, strideOut: number, offsetOut: number ): W; -} - -/** -* Performs a multiply-add operation involving three double-precision complex floating-point numbers. -* -* @param alpha - complex number -* @param x - complex number -* @param y - complex number -* @returns result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( -2.0, 1.0 ); -* var z3 = new Complex128( 7.0, -8.0 ); -* -* var out = muladd( z1, z2, z3 ); -* // returns [ -6.0, -9.0 ] -* -* @example -* var Float64Array = require( '@stdlib/array/float64' ); -* -* var out = muladd.assign( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, new Float64Array( 2 ), 1, 0 ); -* // returns [ -6.0, -9.0 ] -* -* @example -* var Float64Array = require( '@stdlib/array/float64' ); -* -* var alpha = new Float64Array( [ 5.0, 3.0 ] ); -* var x = new Float64Array( [ -2.0, 1.0 ] ); -* var y = new Float64Array( [ 7.0, -8.0 ] ); -* -* var out = muladd.strided( alpha, 1, 0, x, 1, 0, y, 1, 0, new Float64Array( 2 ), 1, 0 ); -* // returns [ -6.0, -9.0 ] -*/ -declare var muladd: MulAdd; - - -// EXPORTS // - -export = muladd; diff --git a/float64/base/mul-add/docs/types/test.ts b/float64/base/mul-add/docs/types/test.ts deleted file mode 100644 index 14ab7399..00000000 --- a/float64/base/mul-add/docs/types/test.ts +++ /dev/null @@ -1,467 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../../float64/ctor' ); -import muladd = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - muladd( z, z, z ); // $ExpectType Complex128 -} - -// The compiler throws an error if the function is provided a first argument which is not a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - muladd( true, z, z ); // $ExpectError - muladd( false, z, z ); // $ExpectError - muladd( null, z, z ); // $ExpectError - muladd( undefined, z, z ); // $ExpectError - muladd( '5', z, z ); // $ExpectError - muladd( [], z, z ); // $ExpectError - muladd( {}, z, z ); // $ExpectError - muladd( ( x: number ): number => x, z, z ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument which is not a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - muladd( z, true, z ); // $ExpectError - muladd( z, false, z ); // $ExpectError - muladd( z, null, z ); // $ExpectError - muladd( z, undefined, z ); // $ExpectError - muladd( z, '5', z ); // $ExpectError - muladd( z, [], z ); // $ExpectError - muladd( z, {}, z ); // $ExpectError - muladd( z, ( x: number ): number => x, z ); // $ExpectError -} - -// The compiler throws an error if the function is provided a third argument which is not a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - muladd( z, z, true ); // $ExpectError - muladd( z, z, false ); // $ExpectError - muladd( z, z, null ); // $ExpectError - muladd( z, z, undefined ); // $ExpectError - muladd( z, z, '5' ); // $ExpectError - muladd( z, z, [] ); // $ExpectError - muladd( z, z, {} ); // $ExpectError - muladd( z, z, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z = new Complex128( 1.0, 1.0 ); - - muladd(); // $ExpectError - muladd( z ); // $ExpectError - muladd( z, z ); // $ExpectError - muladd( z, z, z, z ); // $ExpectError -} - -// Attached to the main export is an `assign` method which returns a collection... -{ - muladd.assign( 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, new Float64Array( 2 ), 1, 0 ); // $ExpectType Float64Array - muladd.assign( 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - muladd.assign( 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `assign` method is provided a first argument which is not a number... -{ - const out = new Float64Array( 2 ); - - muladd.assign( true, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( false, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( null, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( undefined, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( '5', 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( [], 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( {}, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( ( x: number ): number => x, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a second argument which is not a number... -{ - const out = new Float64Array( 2 ); - - muladd.assign( 1.0, true, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, false, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, null, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, undefined, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, '5', 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, [], 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, {}, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, ( x: number ): number => x, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a third argument which is not a number... -{ - const out = new Float64Array( 2 ); - - muladd.assign( 1.0, 2.0, true, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, false, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, null, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, undefined, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, '5', 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, [], 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, {}, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, ( x: number ): number => x, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fourth argument which is not a number... -{ - const out = new Float64Array( 2 ); - - muladd.assign( 1.0, 2.0, 3.0, true, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, false, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, null, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, undefined, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, '5', 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, [], 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, {}, 5.0, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, ( x: number ): number => x, 5.0, 6.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fifth argument which is not a number... -{ - const out = new Float64Array( 2 ); - - muladd.assign( 1.0, 2.0, 3.0, 4.0, true, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, false, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, null, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, undefined, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, '5', 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, [], 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, {}, 6.0, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, ( x: number ): number => x, 6.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a sixth argument which is not a number... -{ - const out = new Float64Array( 2 ); - - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, true, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, false, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, null, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, undefined, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, '5', out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, [], out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, {}, out, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a seventh argument which is not a collection... -{ - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 1, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, true, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, false, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, null, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, undefined, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, '5', 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, [ '5' ], 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, {}, 1, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided an eighth argument which is not a number... -{ - const out = new Float64Array( 2 ); - - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, true, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, false, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, null, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, undefined, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, '5', 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, [], 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, {}, 0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a ninth argument which is not a number... -{ - const out = new Float64Array( 2 ); - - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, true ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, false ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, null ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, undefined ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, '5' ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, [] ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, {} ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided an unsupported number of arguments... -{ - const out = new Float64Array( 2 ); - - muladd.assign(); // $ExpectError - muladd.assign( 1.0 ); // $ExpectError - muladd.assign( 1.0, 2.0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1 ); // $ExpectError - muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0, {} ); // $ExpectError -} - -// Attached to the main export is a `strided` method which returns a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z2.length ); - - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, new Float64Array( 2 ), 1, 0 ); // $ExpectType Float64Array - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `strided` method is provided a first argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z2.length ); - const out = new Float64Array( z2.length ); - - muladd.strided( true, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( false, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( null, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( undefined, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( '5', 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( [ '5' ], 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( {}, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( ( x: number ): number => x, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a second argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z2.length ); - const out = new Float64Array( z2.length ); - - muladd.strided( z1, true, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, false, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, null, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, undefined, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, '5', 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, [], 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, {}, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, ( x: number ): number => x, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a third argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z2.length ); - const out = new Float64Array( z2.length ); - - muladd.strided( z1, 1, true, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, false, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, null, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, undefined, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, '5', z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, [], z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, {}, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, ( x: number ): number => x, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fourth argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z2.length ); - const out = new Float64Array( z2.length ); - - muladd.strided( z1, 1, 0, true, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, false, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, null, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, undefined, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, '5', 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, [ '5' ], 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, {}, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, ( x: number ): number => x, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fifth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z2.length ); - const out = new Float64Array( z2.length ); - - muladd.strided( z1, 1, 0, z2, true, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, false, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, null, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, undefined, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, '5', 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, [], 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, {}, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, ( x: number ): number => x, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a sixth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z2.length ); - const out = new Float64Array( z2.length ); - - muladd.strided( z1, 1, 0, z2, 1, true, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, false, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, null, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, undefined, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, '5', z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, [], z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, {}, z3, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, ( x: number ): number => x, z3, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a seventh argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z2.length ); - const out = new Float64Array( z3.length ); - - muladd.strided( z1, 1, 0, z2, 1, 0, true, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, false, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, null, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, undefined, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, '5', 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, [ '5' ], 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, {}, 1, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, ( x: number ): number => x, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an eighth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z2.length ); - const out = new Float64Array( z2.length ); - - muladd.strided( z1, 1, 0, z2, 1, 0, z3, true, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, false, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, null, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, undefined, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, '5', 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, [], 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, {}, 0, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, ( x: number ): number => x, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a ninth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z2.length ); - const out = new Float64Array( z2.length ); - - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, true, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, false, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, null, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, undefined, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, '5', out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, [], out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, {}, out, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a tenth argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z2.length ); - - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, 1, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, true, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, false, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, null, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, undefined, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, '5', 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, [ '5' ], 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, {}, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an eleventh argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z2.length ); - const out = new Float64Array( z2.length ); - - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, true, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, false, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, null, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, undefined, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, '5', 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, [], 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, {}, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a twelfth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z2.length ); - const out = new Float64Array( z2.length ); - - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, true ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, false ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, null ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, undefined ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, '5' ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, [] ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, {} ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an unsupported number of arguments... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const z3 = new Float64Array( z2.length ); - const out = new Float64Array( z2.length ); - - muladd.strided(); // $ExpectError - muladd.strided( z1 ); // $ExpectError - muladd.strided( z1, 1 ); // $ExpectError - muladd.strided( z1, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1 ); // $ExpectError - muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0, {} ); // $ExpectError -} diff --git a/float64/base/mul-add/examples/c/Makefile b/float64/base/mul-add/examples/c/Makefile deleted file mode 100644 index 25ced822..00000000 --- a/float64/base/mul-add/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/mul-add/examples/c/example.c b/float64/base/mul-add/examples/c/example.c deleted file mode 100644 index 4107b2b2..00000000 --- a/float64/base/mul-add/examples/c/example.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/mul_add.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 3.14, 1.5 ), - stdlib_complex128( -3.14, 1.5 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - stdlib_complex128_t y; - double re; - double im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex128_reim( v, &re, &im ); - printf( "z = %lf + %lfi\n", re, im ); - - y = stdlib_base_complex128_muladd( v, v, v ); - stdlib_complex128_reim( y, &re, &im ); - printf( "z*z + z = %lf + %lfi\n", re, im ); - } -} diff --git a/float64/base/mul-add/examples/index.js b/float64/base/mul-add/examples/index.js deleted file mode 100644 index 054655db..00000000 --- a/float64/base/mul-add/examples/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128Array = require( '@stdlib/array/complex128' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var muladd = require( './../lib' ); - -// Generate arrays of random values: -var z1 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); -var z3 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise computation: -logEachMap( '( (%s) * (%s) ) + (%s) = %s', z1, z2, z3, muladd ); diff --git a/float64/base/mul-add/include.gypi b/float64/base/mul-add/include.gypi deleted file mode 100644 index ecfaf82a..00000000 --- a/float64/base/mul-add/include.gypi +++ /dev/null @@ -1,53 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A GYP include file for building a Node.js native add-on. -# -# Main documentation: -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Source directory: - 'src_dir': './src', - - # Include directories: - 'include_dirs': [ - '[ -6.0, -9.0 ] -*/ -function assign( ar, ai, xr, xi, yr, yi, out, strideOut, offsetOut ) { - out[ offsetOut ] = (ar*xr) - (ai*xi) + yr; - out[ offsetOut+strideOut ] = (ar*xi) + (ai*xr) + yi; - return out; -} - - -// EXPORTS // - -module.exports = assign; diff --git a/float64/base/mul-add/lib/index.js b/float64/base/mul-add/lib/index.js deleted file mode 100644 index 31c2410b..00000000 --- a/float64/base/mul-add/lib/index.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Perform a multiply-add operation involving three double-precision complex floating-point numbers. -* -* @module @stdlib/complex/float64/base/mul-add -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var muladd = require( '@stdlib/complex/float64/base/mul-add' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( -2.0, 1.0 ); -* var z3 = new Complex128( 7.0, -8.0 ); -* -* var out = muladd( z1, z2, z3 ); -* // returns [ -6.0, -9.0 ] -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var main = require( './main.js' ); -var assign = require( './assign.js' ); -var strided = require( './strided.js' ); - - -// MAIN // - -setReadOnly( main, 'assign', assign ); -setReadOnly( main, 'strided', strided ); - - -// EXPORTS // - -module.exports = main; - -// exports: { "assign": "main.assign", "strided": "main.strided" } diff --git a/float64/base/mul-add/lib/main.js b/float64/base/mul-add/lib/main.js deleted file mode 100644 index c86746d1..00000000 --- a/float64/base/mul-add/lib/main.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); - - -// MAIN // - -/** -* Performs a multiply-add operation involving three double-precision complex floating-point numbers. -* -* @param {Complex128} alpha - complex number -* @param {Complex128} x - complex number -* @param {Complex128} y - complex number -* @returns {Complex128} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( -2.0, 1.0 ); -* var z3 = new Complex128( 7.0, -8.0 ); -* -* var out = muladd( z1, z2, z3 ); -* // returns [ -6.0, -9.0 ] -*/ -function muladd( alpha, x, y ) { - var re0 = real( alpha ); - var im0 = imag( alpha ); - var re1 = real( x ); - var im1 = imag( x ); - var re2 = real( y ); - var im2 = imag( y ); - var re = (re0*re1) - (im0*im1) + re2; - var im = (re0*im1) + (im0*re1) + im2; - return new Complex128( re, im ); -} - - -// EXPORTS // - -module.exports = muladd; diff --git a/float64/base/mul-add/lib/native.js b/float64/base/mul-add/lib/native.js deleted file mode 100644 index 5146d3d3..00000000 --- a/float64/base/mul-add/lib/native.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex128 = require( './../../../../float64/ctor' ); -var addon = require( './../src/addon.node' ); - - -// MAIN // - -/** -* Performs a multiply-add operation involving three double-precision complex floating-point numbers. -* -* @private -* @param {Complex128} alpha - complex number -* @param {Complex128} x - complex number -* @param {Complex128} y - complex number -* @returns {Complex128} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( -2.0, 1.0 ); -* var z3 = new Complex128( 7.0, -8.0 ); -* -* var out = muladd( z1, z2, z3 ); -* // returns [ -6.0, -9.0 ] -*/ -function muladd( alpha, x, y ) { - var v = addon( alpha, x, y ); - return new Complex128( v.re, v.im ); -} - - -// EXPORTS // - -module.exports = muladd; diff --git a/float64/base/mul-add/lib/strided.js b/float64/base/mul-add/lib/strided.js deleted file mode 100644 index 028b57e4..00000000 --- a/float64/base/mul-add/lib/strided.js +++ /dev/null @@ -1,65 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Performs a multiply-add operation involving three double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. -* -* @param {Float64Array} alpha - first complex number view -* @param {integer} strideA - stride length for `alpha` -* @param {NonNegativeInteger} offsetA - starting index for `alpha` -* @param {Float64Array} x - second complex number view -* @param {integer} strideX - stride length for `x` -* @param {NonNegativeInteger} offsetX - starting index for `x` -* @param {Float64Array} y - third complex number view -* @param {integer} strideY - stride length for `y` -* @param {NonNegativeInteger} offsetY - starting index for `y` -* @param {Collection} out - output array -* @param {integer} strideOut - stride length for `out` -* @param {NonNegativeInteger} offsetOut - starting index for `out` -* @returns {Collection} output array -* -* @example -* var Float64Array = require( '@stdlib/array/float64' ); -* -* var alpha = new Float64Array( [ 5.0, 3.0 ] ); -* var x = new Float64Array( [ -2.0, 1.0 ] ); -* var y = new Float64Array( [ 7.0, -8.0 ] ); -* -* var out = strided( alpha, 1, 0, x, 1, 0, y, 1, 0, new Float64Array( 2 ), 1, 0 ); -* // returns [ -6.0, -9.0 ] -*/ -function strided( alpha, strideA, offsetA, x, strideX, offsetX, y, strideY, offsetY, out, strideOut, offsetOut ) { // eslint-disable-line max-len, max-params - var re0 = alpha[ offsetA ]; - var im0 = alpha[ offsetA+strideA ]; - var re1 = x[ offsetX ]; - var im1 = x[ offsetX+strideX ]; - var re2 = y[ offsetY ]; - var im2 = y[ offsetY+strideY ]; - out[ offsetOut ] = (re0*re1) - (im0*im1) + re2; - out[ offsetOut+strideOut ] = (re0*im1) + (im0*re1) + im2; - return out; -} - - -// EXPORTS // - -module.exports = strided; diff --git a/float64/base/mul-add/manifest.json b/float64/base/mul-add/manifest.json deleted file mode 100644 index 2f74ff72..00000000 --- a/float64/base/mul-add/manifest.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/napi/ternary", - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - } - ] -} diff --git a/float64/base/mul-add/package.json b/float64/base/mul-add/package.json deleted file mode 100644 index d765df45..00000000 --- a/float64/base/mul-add/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "@stdlib/complex/float64/base/mul-add", - "version": "0.0.0", - "description": "Perform a multiply-add operation involving three double-precision complex floating-point numbers.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "mul", - "mult", - "multiply", - "multiplication", - "addition", - "add", - "arithmetic", - "complex", - "cmplx", - "number" - ] -} diff --git a/float64/base/mul-add/src/Makefile b/float64/base/mul-add/src/Makefile deleted file mode 100644 index 7733b618..00000000 --- a/float64/base/mul-add/src/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - - -# RULES # - -#/ -# Removes generated files for building an add-on. -# -# @example -# make clean-addon -#/ -clean-addon: - $(QUIET) -rm -f *.o *.node - -.PHONY: clean-addon - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: clean-addon - -.PHONY: clean diff --git a/float64/base/mul-add/src/addon.c b/float64/base/mul-add/src/addon.c deleted file mode 100644 index e5b5c4be..00000000 --- a/float64/base/mul-add/src/addon.c +++ /dev/null @@ -1,22 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/mul_add.h" -#include "stdlib/math/base/napi/ternary.h" - -STDLIB_MATH_BASE_NAPI_MODULE_ZZZ_Z( stdlib_base_complex128_muladd ) diff --git a/float64/base/mul-add/src/main.c b/float64/base/mul-add/src/main.c deleted file mode 100644 index 232ef21f..00000000 --- a/float64/base/mul-add/src/main.c +++ /dev/null @@ -1,66 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/mul_add.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" - -/** -* Performs a multiply-add operation involving three double-precision complex floating-point numbers. -* -* @param alpha input value -* @param x input value -* @param y input value -* @return result -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* #include "stdlib/complex/float64/real.h" -* #include "stdlib/complex/float64/imag.h" -* -* stdlib_complex128_t z1 = stdlib_complex128( 5.0, 3.0 ); -* stdlib_complex128_t z2 = stdlib_complex128( -2.0, 1.0 ); -* stdlib_complex128_t z3 = stdlib_complex128( 7.0, -8.0 ); -* -* stdlib_complex128_t out = stdlib_base_complex128_muladd( z1, z2, z3 ); -* -* double re = stdlib_complex128_real( out ); -* // returns -6.0 -* -* double im = stdlib_complex128_imag( out ); -* // returns -9.0 -*/ -stdlib_complex128_t stdlib_base_complex128_muladd( const stdlib_complex128_t alpha, const stdlib_complex128_t x, const stdlib_complex128_t y ) { - double re1; - double re2; - double re3; - double im1; - double im2; - double im3; - double re; - double im; - - stdlib_complex128_reim( alpha, &re1, &im1 ); - stdlib_complex128_reim( x, &re2, &im2 ); - stdlib_complex128_reim( y, &re3, &im3 ); - - re = (re1*re2) - (im1*im2) + re3; - im = (re1*im2) + (im1*re2) + im3; - - return stdlib_complex128( re, im ); -} diff --git a/float64/base/mul-add/test/test.assign.js b/float64/base/mul-add/test/test.assign.js deleted file mode 100644 index fc600caa..00000000 --- a/float64/base/mul-add/test/test.assign.js +++ /dev/null @@ -1,153 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' ); -var Float64Array = require( '@stdlib/array/float64' ); -var muladd = require( './../lib/assign.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof muladd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function performs a multiply-add operation', function test( t ) { - var expected; - var out; - var v; - - out = new Float64Array( 2 ); - v = muladd( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, out, 1, 0 ); - - expected = new Float64Array( [ -6.0, -9.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 4 ); - v = muladd( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, out, 2, 0 ); - - expected = new Float64Array( [ -6.0, 0.0, -9.0, 0.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 4 ); - v = muladd( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, out, 2, 1 ); - - expected = new Float64Array( [ 0.0, -6.0, 0.0, -9.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 4 ); - v = muladd( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, out, -2, 3 ); - - expected = new Float64Array( [ 0.0, -9.0, 0.0, -6.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the function propagates `NaN` values', function test( t ) { - var expected; - var out; - var v; - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = muladd( NaN, 3.0, -2.0, 1.0, 7.0, -8.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = muladd( 5.0, 3.0, NaN, 1.0, 7.0, -8.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = muladd( NaN, 3.0, NaN, 1.0, 7.0, -8.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = muladd( 5.0, NaN, -2.0, 1.0, 7.0, -8.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = muladd( 5.0, 3.0, -2.0, NaN, 7.0, -8.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = muladd( 5.0, NaN, -2.0, NaN, 7.0, -8.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = muladd( NaN, NaN, NaN, NaN, 7.0, -8.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, -9.0 ] ); - - v = muladd( 5.0, 3.0, -2.0, 1.0, NaN, -8.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ -6.0, NaN ] ); - - v = muladd( 5.0, 3.0, -2.0, 1.0, 7.0, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = muladd( NaN, NaN, NaN, NaN, NaN, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/mul-add/test/test.js b/float64/base/mul-add/test/test.js deleted file mode 100644 index 3925eb02..00000000 --- a/float64/base/mul-add/test/test.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isMethod = require( '@stdlib/assert/is-method' ); -var muladd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof muladd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'attached to the main export is an `assign` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( muladd, 'assign' ), true, 'returns expected value' ); - t.end(); -}); - -tape( 'attached to the main export is a `strided` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( muladd, 'strided' ), true, 'returns expected value' ); - t.end(); -}); diff --git a/float64/base/mul-add/test/test.main.js b/float64/base/mul-add/test/test.main.js deleted file mode 100644 index c4c06421..00000000 --- a/float64/base/mul-add/test/test.main.js +++ /dev/null @@ -1,138 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var muladd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof muladd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function performs a multiply-add operation', function test( t ) { - var z1; - var z2; - var z3; - var v; - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - z3 = new Complex128( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - - t.strictEqual( real( v ), -6.0, 'returns expected value' ); - t.strictEqual( imag( v ), -9.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the function propagates `NaN` values', function test( t ) { - var z1; - var z2; - var z3; - var v; - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - z3 = new Complex128( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - z3 = new Complex128( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - z3 = new Complex128( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, 1.0 ); - z3 = new Complex128( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, NaN ); - z3 = new Complex128( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, NaN ); - z3 = new Complex128( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - z3 = new Complex128( NaN, -8.0 ); - - v = muladd( z1, z2, z3 ); - - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), -9.0, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - z3 = new Complex128( 7.0, NaN ); - - v = muladd( z1, z2, z3 ); - - t.strictEqual( real( v ), -6.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - z3 = new Complex128( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/mul-add/test/test.native.js b/float64/base/mul-add/test/test.native.js deleted file mode 100644 index fa5f63e7..00000000 --- a/float64/base/mul-add/test/test.native.js +++ /dev/null @@ -1,147 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var tape = require( 'tape' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var muladd = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( muladd instanceof Error ) -}; - - -// TESTS // - -tape( 'main export is a function', opts, function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof muladd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function performs a multiply-add operation', opts, function test( t ) { - var z1; - var z2; - var z3; - var v; - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - z3 = new Complex128( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - - t.strictEqual( real( v ), -6.0, 'returns expected value' ); - t.strictEqual( imag( v ), -9.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the function propagates `NaN` values', opts, function test( t ) { - var z1; - var z2; - var z3; - var v; - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - z3 = new Complex128( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - z3 = new Complex128( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - z3 = new Complex128( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, 1.0 ); - z3 = new Complex128( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, NaN ); - z3 = new Complex128( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, NaN ); - z3 = new Complex128( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - z3 = new Complex128( NaN, -8.0 ); - - v = muladd( z1, z2, z3 ); - - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), -9.0, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - z3 = new Complex128( 7.0, NaN ); - - v = muladd( z1, z2, z3 ); - - t.strictEqual( real( v ), -6.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - z3 = new Complex128( 7.0, -8.0 ); - - v = muladd( z1, z2, z3 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/mul-add/test/test.strided.js b/float64/base/mul-add/test/test.strided.js deleted file mode 100644 index 5e6583e7..00000000 --- a/float64/base/mul-add/test/test.strided.js +++ /dev/null @@ -1,211 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' ); -var Float64Array = require( '@stdlib/array/float64' ); -var muladd = require( './../lib/strided.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof muladd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function performs a multiply-add operation', function test( t ) { - var expected; - var out; - var z1; - var z2; - var z3; - var v; - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - z3 = new Float64Array( [ 7.0, -8.0 ] ); - out = new Float64Array( 2 ); - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - - expected = new Float64Array( [ -6.0, -9.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 0.0, 3.0, 0.0 ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - z3 = new Float64Array( [ 7.0, -8.0 ] ); - out = new Float64Array( 4 ); - v = muladd( z1, 2, 0, z2, 1, 0, z3, 1, 0, out, 2, 0 ); - - expected = new Float64Array( [ -6.0, 0.0, -9.0, 0.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ 0.0, -2.0, 0.0, 1.0 ] ); - z3 = new Float64Array( [ 7.0, -8.0 ] ); - out = new Float64Array( 4 ); - v = muladd( z1, 1, 0, z2, 2, 1, z3, 1, 0, out, 2, 1 ); - - expected = new Float64Array( [ 0.0, -6.0, 0.0, -9.0 ] ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - z3 = new Float64Array( [ 0.0, 7.0, 0.0, -8.0 ] ); - out = new Float64Array( 2 ); - v = muladd( z1, 1, 0, z2, 1, 0, z3, 2, 1, out, 1, 0 ); - - expected = new Float64Array( [ -6.0, -9.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 3.0, 5.0 ] ); - z2 = new Float64Array( [ 1.0, -2.0 ] ); - z3 = new Float64Array( [ -8.0, 7.0 ] ); - out = new Float64Array( 4 ); - v = muladd( z1, -1, 1, z2, -1, 1, z3, -1, 1, out, -2, 3 ); - - expected = new Float64Array( [ 0.0, -9.0, 0.0, -6.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the function propagates `NaN` values', function test( t ) { - var expected; - var out; - var z1; - var z2; - var z3; - var v; - - z1 = new Float64Array( [ NaN, 3.0 ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - z3 = new Float64Array( [ 7.0, -8.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ NaN, 1.0 ] ); - z3 = new Float64Array( [ 7.0, -8.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ NaN, 3.0 ] ); - z2 = new Float64Array( [ NaN, 1.0 ] ); - z3 = new Float64Array( [ 7.0, -8.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, NaN ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - z3 = new Float64Array( [ 7.0, -8.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ -2.0, NaN ] ); - z3 = new Float64Array( [ 7.0, -8.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, NaN ] ); - z2 = new Float64Array( [ -2.0, NaN ] ); - z3 = new Float64Array( [ 7.0, -8.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ NaN, NaN ] ); - z2 = new Float64Array( [ NaN, NaN ] ); - z3 = new Float64Array( [ 7.0, -8.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - z3 = new Float64Array( [ NaN, -8.0 ] ); - out = new Float64Array( 2 ); - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - - expected = new Float64Array( [ NaN, -9.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - z3 = new Float64Array( [ 7.0, NaN ] ); - out = new Float64Array( 2 ); - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - - expected = new Float64Array( [ -6.0, NaN ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ NaN, NaN ] ); - z2 = new Float64Array( [ NaN, NaN ] ); - z3 = new Float64Array( [ NaN, NaN ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/mul/README.md b/float64/base/mul/README.md deleted file mode 100644 index 993f9199..00000000 --- a/float64/base/mul/README.md +++ /dev/null @@ -1,288 +0,0 @@ - - -# mul - -> Multiply two double-precision complex floating-point numbers. - -
- -
- - - -
- -## Usage - -```javascript -var mul = require( '@stdlib/complex/float64/base/mul' ); -``` - -#### mul( z1, z2 ) - -Multiplies two double-precision complex floating-point numbers. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( -2.0, 1.0 ); - -var v = mul( z1, z2 ); -// returns [ -13.0, -1.0 ] -``` - -The function supports the following parameters: - -- **z1**: first [complex number][@stdlib/complex/float64/ctor]. -- **z2**: second [complex number][@stdlib/complex/float64/ctor]. - -#### mul.assign( re1, im1, re2, im2, out, strideOut, offsetOut ) - -Multiplies two double-precision complex floating-point numbers and assigns results to a provided output array. - -```javascript -var Float64Array = require( '@stdlib/array/float64' ); - -var out = new Float64Array( 2 ); -var v = mul.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ); -// returns [ -13.0, -1.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **re1**: real component of the first complex number. -- **im1**: imaginary component of the first complex number. -- **re2**: real component of the second complex number. -- **im2**: imaginary component of the second complex number. -- **out**: output array. -- **strideOut**: stride length for `out`. -- **offsetOut**: starting index for `out`. - -#### mul.strided( z1, sz1, oz1, z2, sz2, oz2, out, so, oo ) - -Multiplies two double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. - -```javascript -var Float64Array = require( '@stdlib/array/float64' ); - -var z1 = new Float64Array( [ 5.0, 3.0 ] ); -var z2 = new Float64Array( [ -2.0, 1.0 ] ); -var out = new Float64Array( 2 ); - -var v = mul.strided( z1, 1, 0, z2, 1, 0, out, 1, 0 ); -// returns [ -13.0, -1.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **z1**: first complex number strided array view. -- **sz1**: stride length for `z1`. -- **oz1**: starting index for `z1`. -- **z2**: second complex number strided array view. -- **sz2**: stride length for `z2`. -- **oz2**: starting index for `z2`. -- **out**: output array. -- **so**: stride length for `out`. -- **oo**: starting index for `out`. - -
- - - -
- -## Examples - - - -```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var mul = require( '@stdlib/complex/float64/base/mul' ); - -// Generate arrays of random values: -var z1 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise multiplication: -logEachMap( '(%s) * (%s) = %s', z1, z2, mul ); -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float64/base/mul.h" -``` - -#### stdlib_base_complex128_mul( z1, z2 ) - -Multiplies two double-precision complex floating-point numbers. - -```c -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/imag.h" - -stdlib_complex128_t z1 = stdlib_complex128( 5.0, 3.0 ); -stdlib_complex128_t z2 = stdlib_complex128( -2.0, 1.0 ); - -stdlib_complex128_t out = stdlib_base_complex128_mul( z1, z2 ); - -double re = stdlib_complex128_real( out ); -// returns -13.0 - -double im = stdlib_complex128_imag( out ); -// returns -1.0 -``` - -The function accepts the following arguments: - -- **z1**: `[in] stdlib_complex128_t` input value. -- **z2**: `[in] stdlib_complex128_t` input value. - -```c -stdlib_complex128_t stdlib_base_complex128_mul( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float64/base/mul.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 3.14, 1.5 ), - stdlib_complex128( -3.14, 1.5 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - stdlib_complex128_t y; - double re; - double im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex128_reim( v, &re, &im ); - printf( "z = %lf + %lfi\n", re, im ); - - y = stdlib_base_complex128_mul( v, v ); - stdlib_complex128_reim( y, &re, &im ); - printf( "mul(z, z) = %lf + %lfi\n", re, im ); - } -} -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/float64/base/mul/benchmark/benchmark.assign.js b/float64/base/mul/benchmark/benchmark.assign.js deleted file mode 100644 index d7b8ffa4..00000000 --- a/float64/base/mul/benchmark/benchmark.assign.js +++ /dev/null @@ -1,70 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Float64Array = require( '@stdlib/array/float64' ); -var pkg = require( './../package.json' ).name; -var mul = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float64' -}; - - -// MAIN // - -bench( pkg+':assign', function benchmark( b ) { - var out; - var re; - var im; - var N; - var i; - var j; - var k; - - N = 100; - re = uniform( N, -500.0, 500.0, options ); - im = uniform( N, -500.0, 500.0, options ); - - out = new Float64Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = i % N; - k = ( i+1 ) % N; - out = mul.assign( re[ j ], im[ j ], re[ k ], im[ k ], out, 1, 0 ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( out[ 0 ] ) || isnan( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/mul/benchmark/benchmark.js b/float64/base/mul/benchmark/benchmark.js deleted file mode 100644 index 5737d924..00000000 --- a/float64/base/mul/benchmark/benchmark.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var pkg = require( './../package.json' ).name; -var mul = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = mul( z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( real( out ) ) || isnan( imag( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/mul/benchmark/benchmark.native.js b/float64/base/mul/benchmark/benchmark.native.js deleted file mode 100644 index edce751b..00000000 --- a/float64/base/mul/benchmark/benchmark.native.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); -var pkg = require( './../package.json' ).name; - - -// VARIABLES // - -var mul = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( mul instanceof Error ) -}; - - -// MAIN // - -bench( pkg+'::native', opts, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = mul( z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( real( out ) ) || isnan( imag( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/mul/benchmark/benchmark.strided.js b/float64/base/mul/benchmark/benchmark.strided.js deleted file mode 100644 index ab42981d..00000000 --- a/float64/base/mul/benchmark/benchmark.strided.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Float64Array = require( '@stdlib/array/float64' ); -var pkg = require( './../package.json' ).name; -var mul = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float64' -}; - - -// MAIN // - -bench( pkg+':strided', function benchmark( b ) { - var out; - var z1; - var z2; - var N; - var i; - var j; - - N = 50; - z1 = uniform( N*2, -500.0, 500.0, options ); - z2 = uniform( N*2, -500.0, 500.0, options ); - - out = new Float64Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = ( i % N ) * 2; - out = mul.strided( z1, 1, j, z2, 1, j, out, 1, 0 ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( out[ 0 ] ) || isnan( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/mul/benchmark/c/Makefile b/float64/base/mul/benchmark/c/Makefile deleted file mode 100644 index d7adc1ad..00000000 --- a/float64/base/mul/benchmark/c/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/mul/benchmark/c/benchmark.c b/float64/base/mul/benchmark/c/benchmark.c deleted file mode 100644 index 17354396..00000000 --- a/float64/base/mul/benchmark/c/benchmark.c +++ /dev/null @@ -1,145 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include -#include -#include -#include - -#define NAME "cmul" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double re; - double im; - double t; - int i; - - double complex z1; - double complex z2; - double complex z3; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z1 = re + im*I; - - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z2 = re + im*I; - - re = ( creal(z1)*creal(z2) ) - ( cimag(z1)*cimag(z2) ); - im = ( creal(z1)*cimag(z2) ) + ( cimag(z1)*creal(z2) ); - z3 = re + im*I; - if ( z3 != z3 ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( z3 != z3 ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/base/mul/benchmark/c/native/Makefile b/float64/base/mul/benchmark/c/native/Makefile deleted file mode 100644 index 7f6bbc4c..00000000 --- a/float64/base/mul/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/mul/benchmark/c/native/benchmark.c b/float64/base/mul/benchmark/c/native/benchmark.c deleted file mode 100644 index c309566c..00000000 --- a/float64/base/mul/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,147 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/mul.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include -#include -#include -#include -#include - -#define NAME "mul" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double re; - double im; - double t; - int i; - - stdlib_complex128_t z1; - stdlib_complex128_t z2; - stdlib_complex128_t z3; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z1 =stdlib_complex128( re, im ); - - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z2 = stdlib_complex128( re, im ); - - z3 = stdlib_base_complex128_mul( z1, z2 ); - stdlib_complex128_reim( z3, &re, &im ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/base/mul/benchmark/julia/REQUIRE b/float64/base/mul/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float64/base/mul/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float64/base/mul/benchmark/julia/benchmark.jl b/float64/base/mul/benchmark/julia/benchmark.jl deleted file mode 100644 index d4d809c9..00000000 --- a/float64/base/mul/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "mul"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark ComplexF64( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) * ComplexF64( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float64/base/mul/binding.gyp b/float64/base/mul/binding.gyp deleted file mode 100644 index 1058b57b..00000000 --- a/float64/base/mul/binding.gyp +++ /dev/null @@ -1,170 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2022 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A `.gyp` file for building a Node.js native add-on. -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # List of files to include in this file: - 'includes': [ - './include.gypi', - ], - - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Target name should match the add-on export name: - 'addon_target_name%': 'addon', - - # Set variables based on the host OS: - 'conditions': [ - [ - 'OS=="win"', - { - # Define the object file suffix: - 'obj': 'obj', - }, - { - # Define the object file suffix: - 'obj': 'o', - } - ], # end condition (OS=="win") - ], # end conditions - }, # end variables - - # Define compile targets: - 'targets': [ - - # Target to generate an add-on: - { - # The target name should match the add-on export name: - 'target_name': '<(addon_target_name)', - - # Define dependencies: - 'dependencies': [], - - # Define directories which contain relevant include headers: - 'include_dirs': [ - # Local include directory: - '<@(include_dirs)', - ], - - # List of source files: - 'sources': [ - '<@(src_files)', - ], - - # Settings which should be applied when a target's object files are used as linker input: - 'link_settings': { - # Define libraries: - 'libraries': [ - '<@(libraries)', - ], - - # Define library directories: - 'library_dirs': [ - '<@(library_dirs)', - ], - }, - - # C/C++ compiler flags: - 'cflags': [ - # Enable commonly used warning options: - '-Wall', - - # Aggressive optimization: - '-O3', - ], - - # C specific compiler flags: - 'cflags_c': [ - # Specify the C standard to which a program is expected to conform: - '-std=c99', - ], - - # C++ specific compiler flags: - 'cflags_cpp': [ - # Specify the C++ standard to which a program is expected to conform: - '-std=c++11', - ], - - # Linker flags: - 'ldflags': [], - - # Apply conditions based on the host OS: - 'conditions': [ - [ - 'OS=="mac"', - { - # Linker flags: - 'ldflags': [ - '-undefined dynamic_lookup', - '-Wl,-no-pie', - '-Wl,-search_paths_first', - ], - }, - ], # end condition (OS=="mac") - [ - 'OS!="win"', - { - # C/C++ flags: - 'cflags': [ - # Generate platform-independent code: - '-fPIC', - ], - }, - ], # end condition (OS!="win") - ], # end conditions - }, # end target <(addon_target_name) - - # Target to copy a generated add-on to a standard location: - { - 'target_name': 'copy_addon', - - # Declare that the output of this target is not linked: - 'type': 'none', - - # Define dependencies: - 'dependencies': [ - # Require that the add-on be generated before building this target: - '<(addon_target_name)', - ], - - # Define a list of actions: - 'actions': [ - { - 'action_name': 'copy_addon', - 'message': 'Copying addon...', - - # Explicitly list the inputs in the command-line invocation below: - 'inputs': [], - - # Declare the expected outputs: - 'outputs': [ - '<(addon_output_dir)/<(addon_target_name).node', - ], - - # Define the command-line invocation: - 'action': [ - 'cp', - '<(PRODUCT_DIR)/<(addon_target_name).node', - '<(addon_output_dir)/<(addon_target_name).node', - ], - }, - ], # end actions - }, # end target copy_addon - ], # end targets -} diff --git a/float64/base/mul/docs/repl.txt b/float64/base/mul/docs/repl.txt deleted file mode 100644 index a08f0cc2..00000000 --- a/float64/base/mul/docs/repl.txt +++ /dev/null @@ -1,120 +0,0 @@ - -{{alias}}( z1, z2 ) - Multiplies two double-precision complex floating-point numbers. - - Parameters - ---------- - z1: Complex128 - Complex number. - - z2: Complex128 - Complex number. - - Returns - ------- - out: Complex128 - Result. - - Examples - -------- - > var z1 = new {{alias:@stdlib/complex/float64/ctor}}( 5.0, 3.0 ) - - > var z2 = new {{alias:@stdlib/complex/float64/ctor}}( -2.0, 1.0 ) - - > var out = {{alias}}( z1, z2 ) - - > var re = {{alias:@stdlib/complex/float64/real}}( out ) - -13.0 - > var im = {{alias:@stdlib/complex/float64/imag}}( out ) - -1.0 - - -{{alias}}.assign( re1, im1, re2, im2, out, strideOut, offsetOut ) - Multiplies two double-precision complex floating-point numbers and assigns - results to a provided output array. - - Parameters - ---------- - re1: number - Real component of the first complex number. - - im1: number - Imaginary component of the first complex number. - - re2: number - Real component of the second complex number. - - im2: number - Imaginary component of the second complex number. - - out: ArrayLikeObject - Output array. - - strideOut: integer - Stride length. - - offsetOut: integer - Starting index. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var out = new {{alias:@stdlib/array/float64}}( 2 ); - > {{alias}}.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ) - [ -13.0, -1.0 ] - - -{{alias}}.strided( z1, sz1, oz1, z2, sz2, oz2, out, so, oo ) - Multiplies two double-precision complex floating-point numbers stored in - real-valued strided array views and assigns results to a provided strided - output array. - - Parameters - ---------- - z1: ArrayLikeObject - First complex number view. - - sz1: integer - Stride length for `z1`. - - oz1: integer - Starting index for `z1`. - - z2: ArrayLikeObject - Second complex number view. - - sz2: integer - Stride length for `z2`. - - oz2: integer - Starting index for `z2`. - - out: ArrayLikeObject - Output array. - - so: integer - Stride length for `out`. - - oo: integer - Starting index for `out`. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var z1 = new {{alias:@stdlib/array/float64}}( [ 5.0, 3.0 ] ); - > var z2 = new {{alias:@stdlib/array/float64}}( [ -2.0, 1.0 ] ); - > var out = new {{alias:@stdlib/array/float64}}( 2 ); - > {{alias}}.strided( z1, 1, 0, z2, 1, 0, out, 1, 0 ) - [ -13.0, -1.0 ] - - See Also - -------- - diff --git a/float64/base/mul/docs/types/index.d.ts b/float64/base/mul/docs/types/index.d.ts deleted file mode 100644 index 498c63d2..00000000 --- a/float64/base/mul/docs/types/index.d.ts +++ /dev/null @@ -1,138 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex128 } from '@stdlib/types/complex'; -import { Collection, NumericArray } from '@stdlib/types/array'; - -/** -* Interface for multiplying two double-precision complex floating-point numbers. -*/ -interface Mul { - /** - * Multiplies two double-precision complex floating-point numbers. - * - * @param z1 - complex number - * @param z2 - complex number - * @returns result - * - * @example - * var Complex128 = require( './../../../../../float64/ctor' ); - * - * var z1 = new Complex128( 5.0, 3.0 ); - * var z2 = new Complex128( -2.0, 1.0 ); - * - * var out = mul( z1, z2 ); - * // returns [ -13.0, -1.0 ] - */ - ( z1: Complex128, z2: Complex128 ): Complex128; - - /** - * Multiplies two double-precision complex floating-point numbers and assigns results to a provided output array. - * - * @param re1 - real component of the first complex number - * @param im1 - imaginary component of the first complex number - * @param re2 - real component of the second complex number - * @param im2 - imaginary component of the second complex number - * @param out - output array - * @param strideOut - stride length - * @param offsetOut - starting index - * @returns output array - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var out = new Float64Array( 2 ); - * var v = mul.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ); - * // returns [ -13.0, -1.0 ] - * - * var bool = ( out === v ); - * // returns true - */ - assign>( re1: number, im1: number, re2: number, im2: number, out: T, strideOut: number, offsetOut: number ): T; - - /** - * Multiplies two double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. - * - * @param z1 - first complex number view - * @param strideZ1 - stride length for `z1` - * @param offsetZ1 - starting index for `z1` - * @param z2 - second complex number view - * @param strideZ2 - stride length for `z2` - * @param offsetZ2 - starting index for `z2` - * @param out - output array - * @param strideOut - stride length for `out` - * @param offsetOut - starting index for `out` - * @returns output array - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var z1 = new Float64Array( [ 5.0, 3.0 ] ); - * var z2 = new Float64Array( [ -2.0, 1.0 ] ); - * - * var out = mul.strided( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); - * // returns [ -13.0, -1.0 ] - */ - strided, U extends NumericArray | Collection, V extends NumericArray | Collection>( z1: T, strideZ1: number, offsetZ1: number, z2: U, strideZ2: number, offsetZ2: number, out: V, strideOut: number, offsetOut: number ): V; -} - -/** -* Multiplies two double-precision complex floating-point numbers. -* -* @param z1 - complex number -* @param z2 - complex number -* @returns result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( -2.0, 1.0 ); -* -* var out = mul( z1, z2 ); -* // returns [ -13.0, -1.0 ] -* -* @example -* var Float64Array = require( '@stdlib/array/float64' ); -* -* var out = new Float64Array( 2 ); -* var v = mul.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ); -* // returns [ -13.0, -1.0 ] -* -* var bool = ( out === v ); -* // returns true -* -* @example -* var Float64Array = require( '@stdlib/array/float64' ); -* -* var z1 = new Float64Array( [ 5.0, 3.0 ] ); -* var z2 = new Float64Array( [ -2.0, 1.0 ] ); -* -* var out = mul.strided( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); -* // returns [ -13.0, -1.0 ] -*/ -declare var mul: Mul; - - -// EXPORTS // - -export = mul; diff --git a/float64/base/mul/docs/types/test.ts b/float64/base/mul/docs/types/test.ts deleted file mode 100644 index cd0225f4..00000000 --- a/float64/base/mul/docs/types/test.ts +++ /dev/null @@ -1,358 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../../float64/ctor' ); -import mul = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - mul( z, z ); // $ExpectType Complex128 -} - -// The compiler throws an error if the function is provided a first argument which is not a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - mul( true, z ); // $ExpectError - mul( false, z ); // $ExpectError - mul( null, z ); // $ExpectError - mul( undefined, z ); // $ExpectError - mul( '5', z ); // $ExpectError - mul( [], z ); // $ExpectError - mul( {}, z ); // $ExpectError - mul( ( x: number ): number => x, z ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument which is not a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - mul( z, true ); // $ExpectError - mul( z, false ); // $ExpectError - mul( z, null ); // $ExpectError - mul( z, undefined ); // $ExpectError - mul( z, '5' ); // $ExpectError - mul( z, [] ); // $ExpectError - mul( z, {} ); // $ExpectError - mul( z, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z = new Complex128( 1.0, 1.0 ); - - mul(); // $ExpectError - mul( z ); // $ExpectError - mul( z, z, z ); // $ExpectError -} - -// Attached to the main export is an `assign` method which returns a collection... -{ - mul.assign( 1.0, 1.0, 1.0, 1.0, new Float64Array( 2 ), 1, 0 ); // $ExpectType Float64Array - mul.assign( 1.0, 1.0, 1.0, 1.0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - mul.assign( 1.0, 1.0, 1.0, 1.0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `assign` method is provided a first argument which is not a number... -{ - const out = new Float64Array( 2 ); - - mul.assign( true, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( false, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( null, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( undefined, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( '5', 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( [], 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( {}, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( ( x: number ): number => x, 2.0, 3.0, 4.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a second argument which is not a number... -{ - const out = new Float64Array( 2 ); - - mul.assign( 1.0, true, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, false, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, null, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, undefined, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, '5', 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, [], 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, {}, 3.0, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, ( x: number ): number => x, 3.0, 4.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a third argument which is not a number... -{ - const out = new Float64Array( 2 ); - - mul.assign( 1.0, 2.0, true, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, false, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, null, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, undefined, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, '5', 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, [], 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, {}, 4.0, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, ( x: number ): number => x, 4.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fourth argument which is not a number... -{ - const out = new Float64Array( 2 ); - - mul.assign( 1.0, 2.0, 3.0, true, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, false, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, null, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, undefined, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, '5', out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, [], out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, {}, out, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fifth argument which is not a collection... -{ - mul.assign( 1.0, 2.0, 3.0, 4.0, 1, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, true, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, false, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, null, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, undefined, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, '5', 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, [ '5' ], 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, {}, 1, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a sixth argument which is not a number... -{ - const out = new Float64Array( 2 ); - - mul.assign( 1.0, 2.0, 3.0, 4.0, out, true, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, false, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, null, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, undefined, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, '5', 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, [], 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, {}, 0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a seventh argument which is not a number... -{ - const out = new Float64Array( 2 ); - - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1, true ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1, false ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1, null ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1, undefined ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1, '5' ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1, [] ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1, {} ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided an unsupported number of arguments... -{ - const out = new Float64Array( 2 ); - - mul.assign(); // $ExpectError - mul.assign( 1.0 ); // $ExpectError - mul.assign( 1.0, 2.0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1 ); // $ExpectError - mul.assign( 1.0, 2.0, 3.0, 4.0, out, 1, 0, {} ); // $ExpectError -} - -// Attached to the main export is a `strided` method which returns a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - - mul.strided( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); // $ExpectType Float64Array - mul.strided( z1, 1, 0, z2, 1, 0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - mul.strided( z1, 1, 0, z2, 1, 0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `strided` method is provided a first argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - mul.strided( true, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( false, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( null, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( undefined, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( '5', 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( [ '5' ], 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( {}, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( ( x: number ): number => x, 1, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a second argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - mul.strided( z1, true, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, false, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, null, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, undefined, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, '5', 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, [], 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, {}, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, ( x: number ): number => x, 0, z2, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a third argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( 2 ); - - mul.strided( z1, 1, true, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, false, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, null, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, undefined, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, '5', z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, [], z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, {}, z2, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, ( x: number ): number => x, z2, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fourth argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - mul.strided( z1, 1, 0, true, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, false, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, null, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, undefined, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, '5', 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, [ '5' ], 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, {}, 1, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, ( x: number ): number => x, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fifth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - mul.strided( z1, 1, 0, z2, true, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, false, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, null, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, undefined, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, '5', 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, [], 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, {}, 0, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, ( x: number ): number => x, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a sixth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - mul.strided( z1, 1, 0, z2, 1, true, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, false, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, null, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, undefined, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, '5', out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, [], out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, {}, out, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a seventh argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - - mul.strided( z1, 1, 0, z2, 1, 0, 1, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, true, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, false, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, null, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, undefined, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, '5', 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, [ '5' ], 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, {}, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an eighth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - mul.strided( z1, 1, 0, z2, 1, 0, out, true, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, false, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, null, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, undefined, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, '5', 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, [], 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, {}, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a ninth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - mul.strided( z1, 1, 0, z2, 1, 0, out, 1, true ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, 1, false ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, 1, null ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, 1, undefined ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, 1, '5' ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, 1, [] ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, 1, {} ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an unsupported number of arguments... -{ - const z1 = new Float64Array( 2 ); - const z2 = new Float64Array( z1.length ); - const out = new Float64Array( z2.length ); - - mul.strided(); // $ExpectError - mul.strided( z1 ); // $ExpectError - mul.strided( z1, 1 ); // $ExpectError - mul.strided( z1, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, 1 ); // $ExpectError - mul.strided( z1, 1, 0, z2, 1, 0, out, 1, 0, {} ); // $ExpectError -} - diff --git a/float64/base/mul/examples/c/Makefile b/float64/base/mul/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float64/base/mul/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/mul/examples/c/example.c b/float64/base/mul/examples/c/example.c deleted file mode 100644 index 2b96ac51..00000000 --- a/float64/base/mul/examples/c/example.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/mul.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 3.14, 1.5 ), - stdlib_complex128( -3.14, 1.5 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - stdlib_complex128_t y; - double re; - double im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex128_reim( v, &re, &im ); - printf( "z = %lf + %lfi\n", re, im ); - - y = stdlib_base_complex128_mul( v, v ); - stdlib_complex128_reim( y, &re, &im ); - printf( "mul(z, z) = %lf + %lfi\n", re, im ); - } -} diff --git a/float64/base/mul/examples/index.js b/float64/base/mul/examples/index.js deleted file mode 100644 index 698d6f56..00000000 --- a/float64/base/mul/examples/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128Array = require( '@stdlib/array/complex128' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var mul = require( './../lib' ); - -// Generate arrays of random values: -var z1 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise multiplication: -logEachMap( '(%s) * (%s) = %s', z1, z2, mul ); diff --git a/float64/base/mul/include.gypi b/float64/base/mul/include.gypi deleted file mode 100644 index 3b437d52..00000000 --- a/float64/base/mul/include.gypi +++ /dev/null @@ -1,53 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2022 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A GYP include file for building a Node.js native add-on. -# -# Main documentation: -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Source directory: - 'src_dir': './src', - - # Include directories: - 'include_dirs': [ - '[ -13.0, -1.0 ] -*/ -function assign( re1, im1, re2, im2, out, strideOut, offsetOut ) { - out[ offsetOut ] = (re1*re2) - (im1*im2); - out[ offsetOut+strideOut ] = (re1*im2) + (im1*re2); - return out; -} - - -// EXPORTS // - -module.exports = assign; diff --git a/float64/base/mul/lib/index.js b/float64/base/mul/lib/index.js deleted file mode 100644 index 5084bd1e..00000000 --- a/float64/base/mul/lib/index.js +++ /dev/null @@ -1,55 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Multiply two double-precision complex floating-point numbers. -* -* @module @stdlib/complex/float64/base/mul -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var mul = require( '@stdlib/complex/float64/base/mul' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( -2.0, 1.0 ); -* -* var out = mul( z1, z2 ); -* // returns [ -13.0, -1.0 ] -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var main = require( './main.js' ); -var assign = require( './assign.js' ); -var strided = require( './strided.js' ); - - -// MAIN // - -setReadOnly( main, 'assign', assign ); -setReadOnly( main, 'strided', strided ); - - -// EXPORTS // - -module.exports = main; - -// exports: { "assign": "main.assign", "strided": "main.strided" } diff --git a/float64/base/mul/lib/main.js b/float64/base/mul/lib/main.js deleted file mode 100644 index 9dbec614..00000000 --- a/float64/base/mul/lib/main.js +++ /dev/null @@ -1,59 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); - - -// MAIN // - -/** -* Multiplies two double-precision complex floating-point numbers. -* -* @param {Complex128} z1 - complex number -* @param {Complex128} z2 - complex number -* @returns {Complex128} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( -2.0, 1.0 ); -* -* var out = mul( z1, z2 ); -* // returns [ -13.0, -1.0 ] -*/ -function mul( z1, z2 ) { - var re1 = real( z1 ); - var re2 = real( z2 ); - var im1 = imag( z1 ); - var im2 = imag( z2 ); - var re = (re1*re2) - (im1*im2); - var im = (re1*im2) + (im1*re2); - return new Complex128( re, im ); -} - - -// EXPORTS // - -module.exports = mul; diff --git a/float64/base/mul/lib/native.js b/float64/base/mul/lib/native.js deleted file mode 100644 index b5ef5b64..00000000 --- a/float64/base/mul/lib/native.js +++ /dev/null @@ -1,54 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex128 = require( './../../../../float64/ctor' ); -var addon = require( './../src/addon.node' ); - - -// MAIN // - -/** -* Multiplies two double-precision complex floating-point numbers. -* -* @private -* @param {Complex128} z1 - complex number -* @param {Complex128} z2 - complex number -* @returns {Complex128} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( -2.0, 1.0 ); -* -* var out = mul( z1, z2 ); -* // returns [ -13.0, -1.0 ] -*/ -function mul( z1, z2 ) { - var v = addon( z1, z2 ); - return new Complex128( v.re, v.im ); -} - - -// EXPORTS // - -module.exports = mul; diff --git a/float64/base/mul/lib/strided.js b/float64/base/mul/lib/strided.js deleted file mode 100644 index f4665f13..00000000 --- a/float64/base/mul/lib/strided.js +++ /dev/null @@ -1,59 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Multiplies two double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. -* -* @param {Float64Array} z1 - first complex number view -* @param {integer} strideZ1 - stride length for `z1` -* @param {NonNegativeInteger} offsetZ1 - starting index for `z1` -* @param {Float64Array} z2 - second complex number view -* @param {integer} strideZ2 - stride length for `z2` -* @param {NonNegativeInteger} offsetZ2 - starting index for `z2` -* @param {Collection} out - output array -* @param {integer} strideOut - stride length for `out` -* @param {NonNegativeInteger} offsetOut - starting index for `out` -* @returns {Collection} output array -* -* @example -* var Float64Array = require( '@stdlib/array/float64' ); -* -* var z1 = new Float64Array( [ 5.0, 3.0 ] ); -* var z2 = new Float64Array( [ -2.0, 1.0 ] ); -* -* var out = strided( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 ); -* // returns [ -13.0, -1.0 ] -*/ -function strided( z1, strideZ1, offsetZ1, z2, strideZ2, offsetZ2, out, strideOut, offsetOut ) { // eslint-disable-line max-len - var re1 = z1[ offsetZ1 ]; - var im1 = z1[ offsetZ1+strideZ1 ]; - var re2 = z2[ offsetZ2 ]; - var im2 = z2[ offsetZ2+strideZ2 ]; - out[ offsetOut ] = (re1*re2) - (im1*im2); - out[ offsetOut+strideOut ] = (re1*im2) + (im1*re2); - return out; -} - - -// EXPORTS // - -module.exports = strided; diff --git a/float64/base/mul/manifest.json b/float64/base/mul/manifest.json deleted file mode 100644 index 8f4352d2..00000000 --- a/float64/base/mul/manifest.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "options": { - "task": "build", - "wasm": false - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "wasm": false, - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/napi/binary", - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "benchmark", - "wasm": false, - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "examples", - "wasm": false, - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "build", - "wasm": true, - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - } - ] -} diff --git a/float64/base/mul/package.json b/float64/base/mul/package.json deleted file mode 100644 index 03bc802e..00000000 --- a/float64/base/mul/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "@stdlib/complex/float64/base/mul", - "version": "0.0.0", - "description": "Multiply two double-precision complex floating-point numbers.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "mul", - "cmul", - "mult", - "multiply", - "multiplication", - "arithmetic", - "complex", - "cmplx", - "number" - ] -} diff --git a/float64/base/mul/src/Makefile b/float64/base/mul/src/Makefile deleted file mode 100644 index f79b8723..00000000 --- a/float64/base/mul/src/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - - -# RULES # - -#/ -# Removes generated files for building an add-on. -# -# @example -# make clean-addon -#/ -clean-addon: - $(QUIET) -rm -f *.o *.node - -.PHONY: clean-addon - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: clean-addon - -.PHONY: clean diff --git a/float64/base/mul/src/addon.c b/float64/base/mul/src/addon.c deleted file mode 100644 index cf523f07..00000000 --- a/float64/base/mul/src/addon.c +++ /dev/null @@ -1,22 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/mul.h" -#include "stdlib/math/base/napi/binary.h" - -STDLIB_MATH_BASE_NAPI_MODULE_ZZ_Z( stdlib_base_complex128_mul ) diff --git a/float64/base/mul/src/main.c b/float64/base/mul/src/main.c deleted file mode 100644 index 331f7540..00000000 --- a/float64/base/mul/src/main.c +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/mul.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" - -/** -* Multiplies two double-precision complex floating-point numbers. -* -* @param z1 input value -* @param z2 input value -* @return result -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* #include "stdlib/complex/float64/real.h" -* #include "stdlib/complex/float64/imag.h" -* -* stdlib_complex128_t z1 = stdlib_complex128( 5.0, 3.0 ); -* stdlib_complex128_t z2 = stdlib_complex128( -2.0, 1.0 ); -* -* stdlib_complex128_t out = stdlib_base_complex128_mul( z1, z2 ); -* -* double re = stdlib_complex128_real( out ); -* // returns -13.0 -* -* double im = stdlib_complex128_imag( out ); -* // returns -1.0 -*/ -stdlib_complex128_t stdlib_base_complex128_mul( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ) { - double re1; - double re2; - double im1; - double im2; - double re; - double im; - - stdlib_complex128_reim( z1, &re1, &im1 ); - stdlib_complex128_reim( z2, &re2, &im2 ); - - re = (re1*re2) - (im1*im2); - im = (re1*im2) + (im1*re2); - - return stdlib_complex128( re, im ); -} diff --git a/float64/base/mul/test/test.assign.js b/float64/base/mul/test/test.assign.js deleted file mode 100644 index b3418bc0..00000000 --- a/float64/base/mul/test/test.assign.js +++ /dev/null @@ -1,132 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' ); -var Float64Array = require( '@stdlib/array/float64' ); -var mul = require( './../lib/assign.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof mul, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function multiplies two complex numbers', function test( t ) { - var expected; - var out; - var v; - - out = new Float64Array( 2 ); - v = mul( 5.0, 3.0, -2.0, 1.0, out, 1, 0 ); - - expected = new Float64Array( [ -13.0, -1.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 4 ); - v = mul( 5.0, 3.0, -2.0, 1.0, out, 2, 0 ); - - expected = new Float64Array( [ -13.0, 0.0, -1.0, 0.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 4 ); - v = mul( 5.0, 3.0, -2.0, 1.0, out, 2, 1 ); - - expected = new Float64Array( [ 0.0, -13.0, 0.0, -1.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 4 ); - v = mul( 5.0, 3.0, -2.0, 1.0, out, -2, 3 ); - - expected = new Float64Array( [ 0.0, -1.0, 0.0, -13.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', function test( t ) { - var expected; - var out; - var v; - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = mul( NaN, 3.0, -2.0, 1.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = mul( 5.0, 3.0, NaN, 1.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = mul( NaN, 3.0, NaN, 1.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = mul( 5.0, NaN, -2.0, 1.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = mul( 5.0, 3.0, -2.0, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = mul( 5.0, NaN, -2.0, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = mul( NaN, NaN, NaN, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/mul/test/test.js b/float64/base/mul/test/test.js deleted file mode 100644 index ec16fef0..00000000 --- a/float64/base/mul/test/test.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isMethod = require( '@stdlib/assert/is-method' ); -var mul = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof mul, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'attached to the main export is an `assign` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( mul, 'assign' ), true, 'returns expected value' ); - t.end(); -}); - -tape( 'attached to the main export is a `strided` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( mul, 'strided' ), true, 'returns expected value' ); - t.end(); -}); diff --git a/float64/base/mul/test/test.main.js b/float64/base/mul/test/test.main.js deleted file mode 100644 index f58d06eb..00000000 --- a/float64/base/mul/test/test.main.js +++ /dev/null @@ -1,110 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var mul = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof mul, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function multiplies two complex numbers', function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - - v = mul( z1, z2 ); - - t.strictEqual( real( v ), -13.0, 'returns expected value' ); - t.strictEqual( imag( v ), -1.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - - v = mul( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - - v = mul( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - - v = mul( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, 1.0 ); - - v = mul( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, NaN ); - - v = mul( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, NaN ); - - v = mul( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - - v = mul( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/mul/test/test.native.js b/float64/base/mul/test/test.native.js deleted file mode 100644 index ad64a498..00000000 --- a/float64/base/mul/test/test.native.js +++ /dev/null @@ -1,119 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var tape = require( 'tape' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var mul = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( mul instanceof Error ) -}; - - -// TESTS // - -tape( 'main export is a function', opts, function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof mul, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function multiplies two complex numbers', opts, function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - - v = mul( z1, z2 ); - - t.strictEqual( real( v ), -13.0, 'returns expected value' ); - t.strictEqual( imag( v ), -1.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', opts, function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - - v = mul( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - - v = mul( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - - v = mul( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, 1.0 ); - - v = mul( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, NaN ); - - v = mul( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, NaN ); - - v = mul( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - - v = mul( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/mul/test/test.strided.js b/float64/base/mul/test/test.strided.js deleted file mode 100644 index 1502ecde..00000000 --- a/float64/base/mul/test/test.strided.js +++ /dev/null @@ -1,158 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' ); -var Float64Array = require( '@stdlib/array/float64' ); -var mul = require( './../lib/strided.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof mul, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function multiplies two complex numbers', function test( t ) { - var expected; - var out; - var z1; - var z2; - var v; - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - out = new Float64Array( 2 ); - v = mul( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - - expected = new Float64Array( [ -13.0, -1.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 0.0, 3.0, 0.0 ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - out = new Float64Array( 4 ); - v = mul( z1, 2, 0, z2, 1, 0, out, 2, 0 ); - - expected = new Float64Array( [ -13.0, 0.0, -1.0, 0.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ 0.0, -2.0, 0.0, 1.0 ] ); - out = new Float64Array( 4 ); - v = mul( z1, 1, 0, z2, 2, 1, out, 2, 1 ); - - expected = new Float64Array( [ 0.0, -13.0, 0.0, -1.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 3.0, 5.0 ] ); - z2 = new Float64Array( [ 1.0, -2.0 ] ); - out = new Float64Array( 4 ); - v = mul( z1, -1, 1, z2, -1, 1, out, -2, 3 ); - - expected = new Float64Array( [ 0.0, -1.0, 0.0, -13.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', function test( t ) { - var expected; - var out; - var z1; - var z2; - var v; - - z1 = new Float64Array( [ NaN, 3.0 ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = mul( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ NaN, 1.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = mul( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ NaN, 3.0 ] ); - z2 = new Float64Array( [ NaN, 1.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = mul( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, NaN ] ); - z2 = new Float64Array( [ -2.0, 1.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = mul( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - z2 = new Float64Array( [ -2.0, NaN ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = mul( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, NaN ] ); - z2 = new Float64Array( [ -2.0, NaN ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = mul( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ NaN, NaN ] ); - z2 = new Float64Array( [ NaN, NaN ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = mul( z1, 1, 0, z2, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/neg/README.md b/float64/base/neg/README.md deleted file mode 100644 index 336bf351..00000000 --- a/float64/base/neg/README.md +++ /dev/null @@ -1,257 +0,0 @@ - - -# cneg - -> Negate a double-precision complex floating-point number. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var cneg = require( '@stdlib/complex/float64/base/neg' ); -``` - -#### cneg( z ) - -Negates a double-precision complex floating-point number. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z = new Complex128( -4.2, 5.5 ); - -var out = cneg( z ); -// returns [ 4.2, -5.5 ] - -z = new Complex128( 0.0, 0.0 ); - -out = cneg( z ); -// returns [ -0.0, -0.0 ] - -z = new Complex128( NaN, NaN ); - -out = cneg( z ); -// returns [ NaN, NaN ] -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var cneg = require( '@stdlib/complex/float64/base/neg' ); - -function randomComplex() { - var re = discreteUniform( -50, 50 ); - var im = discreteUniform( -50, 50 ); - return new Complex128( re, im ); -} - -var z; -var o; -var i; - -for ( i = 0; i < 100; i++ ) { - z = randomComplex(); - o = cneg( z ); - console.log( 'negate(%s) = %s', z.toString(), o.toString() ); -} -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float64/base/neg.h" -``` - -#### stdlib_base_complex128_neg( z ) - -Negates a double-precision complex floating-point number. - -```c -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/imag.h" - -stdlib_complex128_t z = stdlib_complex128( 3.0, -2.0 ); - -stdlib_complex128_t out = stdlib_base_complex128_neg( z ); - -double re = stdlib_complex128_real( out ); -// returns -3.0 - -double im = stdlib_complex128_imag( out ); -// returns 2.0 -``` - -The function accepts the following arguments: - -- **z**: `[in] stdlib_complex128_t` input value. - -```c -stdlib_complex128_t stdlib_base_complex128_neg( const stdlib_complex128_t z ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float64/base/neg.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 3.14, 1.5 ), - stdlib_complex128( -3.14, 1.5 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - stdlib_complex128_t y; - double re; - double im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex128_reim( v, &re, &im ); - printf( "z = %lf + %lfi\n", re, im ); - - y = stdlib_base_complex128_neg( v ); - stdlib_complex128_reim( y, &re, &im ); - printf( "cneg(z) = %lf + %lfi\n", re, im ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float64/base/neg/benchmark/benchmark.js b/float64/base/neg/benchmark/benchmark.js deleted file mode 100644 index 6cb500e4..00000000 --- a/float64/base/neg/benchmark/benchmark.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex128 = require( './../../../../float64/ctor' ); -var isComplex128 = require( '@stdlib/assert/is-complex128' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var pkg = require( './../package.json' ).name; -var cneg = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var z; - var y; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - y = cneg( z ); - if ( typeof y !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isComplex128( y ) ) { - b.fail( 'should return a Complex128' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/neg/benchmark/benchmark.native.js b/float64/base/neg/benchmark/benchmark.native.js deleted file mode 100644 index 6f8dc99a..00000000 --- a/float64/base/neg/benchmark/benchmark.native.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); -var pkg = require( './../package.json' ).name; - - -// VARIABLES // - -var cneg = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( cneg instanceof Error ) -}; - - -// MAIN // - -bench( pkg+'::native', opts, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = cneg( z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( real( out ) ) || isnan( imag( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/neg/benchmark/c/Makefile b/float64/base/neg/benchmark/c/Makefile deleted file mode 100644 index e64c0050..00000000 --- a/float64/base/neg/benchmark/c/Makefile +++ /dev/null @@ -1,127 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler -# @param {string} [CFLAGS] - C compiler flags -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/neg/benchmark/c/benchmark.c b/float64/base/neg/benchmark/c/benchmark.c deleted file mode 100644 index 0414a671..00000000 --- a/float64/base/neg/benchmark/c/benchmark.c +++ /dev/null @@ -1,141 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/** -* Benchmark complex number negation. -*/ - -#include -#include -#include -#include -#include - -#define NAME "negate" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double re; - double im; - double t; - int i; - - double complex z; - double complex y; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z = re + im*I; - y = -creal(z) - ( cimag(z) )*I; - if ( y != y ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( y != y ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/base/neg/benchmark/c/native/Makefile b/float64/base/neg/benchmark/c/native/Makefile deleted file mode 100644 index 3cbfe3fe..00000000 --- a/float64/base/neg/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/neg/benchmark/c/native/benchmark.c b/float64/base/neg/benchmark/c/native/benchmark.c deleted file mode 100644 index 909dd9a4..00000000 --- a/float64/base/neg/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,142 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/neg.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include -#include -#include -#include -#include - -#define NAME "cneg" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double re; - double im; - double t; - int i; - - stdlib_complex128_t z1; - stdlib_complex128_t z2; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z1 = stdlib_complex128( re, im ); - - z2 = stdlib_base_complex128_neg( z1 ); - stdlib_complex128_reim( z2, &re, &im ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/base/neg/benchmark/julia/REQUIRE b/float64/base/neg/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float64/base/neg/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float64/base/neg/benchmark/julia/benchmark.jl b/float64/base/neg/benchmark/julia/benchmark.jl deleted file mode 100644 index bf8b5778..00000000 --- a/float64/base/neg/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "negate"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark -( ComplexF64( (rand()*1000.0) - 500.0, (rand()*1000.0) - 500.0 ) ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float64/base/neg/binding.gyp b/float64/base/neg/binding.gyp deleted file mode 100644 index 038bb487..00000000 --- a/float64/base/neg/binding.gyp +++ /dev/null @@ -1,170 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A `.gyp` file for building a Node.js native add-on. -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # List of files to include in this file: - 'includes': [ - './include.gypi', - ], - - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Target name should match the add-on export name: - 'addon_target_name%': 'addon', - - # Set variables based on the host OS: - 'conditions': [ - [ - 'OS=="win"', - { - # Define the object file suffix: - 'obj': 'obj', - }, - { - # Define the object file suffix: - 'obj': 'o', - } - ], # end condition (OS=="win") - ], # end conditions - }, # end variables - - # Define compile targets: - 'targets': [ - - # Target to generate an add-on: - { - # The target name should match the add-on export name: - 'target_name': '<(addon_target_name)', - - # Define dependencies: - 'dependencies': [], - - # Define directories which contain relevant include headers: - 'include_dirs': [ - # Local include directory: - '<@(include_dirs)', - ], - - # List of source files: - 'sources': [ - '<@(src_files)', - ], - - # Settings which should be applied when a target's object files are used as linker input: - 'link_settings': { - # Define libraries: - 'libraries': [ - '<@(libraries)', - ], - - # Define library directories: - 'library_dirs': [ - '<@(library_dirs)', - ], - }, - - # C/C++ compiler flags: - 'cflags': [ - # Enable commonly used warning options: - '-Wall', - - # Aggressive optimization: - '-O3', - ], - - # C specific compiler flags: - 'cflags_c': [ - # Specify the C standard to which a program is expected to conform: - '-std=c99', - ], - - # C++ specific compiler flags: - 'cflags_cpp': [ - # Specify the C++ standard to which a program is expected to conform: - '-std=c++11', - ], - - # Linker flags: - 'ldflags': [], - - # Apply conditions based on the host OS: - 'conditions': [ - [ - 'OS=="mac"', - { - # Linker flags: - 'ldflags': [ - '-undefined dynamic_lookup', - '-Wl,-no-pie', - '-Wl,-search_paths_first', - ], - }, - ], # end condition (OS=="mac") - [ - 'OS!="win"', - { - # C/C++ flags: - 'cflags': [ - # Generate platform-independent code: - '-fPIC', - ], - }, - ], # end condition (OS!="win") - ], # end conditions - }, # end target <(addon_target_name) - - # Target to copy a generated add-on to a standard location: - { - 'target_name': 'copy_addon', - - # Declare that the output of this target is not linked: - 'type': 'none', - - # Define dependencies: - 'dependencies': [ - # Require that the add-on be generated before building this target: - '<(addon_target_name)', - ], - - # Define a list of actions: - 'actions': [ - { - 'action_name': 'copy_addon', - 'message': 'Copying addon...', - - # Explicitly list the inputs in the command-line invocation below: - 'inputs': [], - - # Declare the expected outputs: - 'outputs': [ - '<(addon_output_dir)/<(addon_target_name).node', - ], - - # Define the command-line invocation: - 'action': [ - 'cp', - '<(PRODUCT_DIR)/<(addon_target_name).node', - '<(addon_output_dir)/<(addon_target_name).node', - ], - }, - ], # end actions - }, # end target copy_addon - ], # end targets -} diff --git a/float64/base/neg/docs/repl.txt b/float64/base/neg/docs/repl.txt deleted file mode 100644 index 207d8119..00000000 --- a/float64/base/neg/docs/repl.txt +++ /dev/null @@ -1,28 +0,0 @@ - -{{alias}}( z ) - Negates a double-precision complex floating-point number. - - Parameters - ---------- - z: Complex128 - Complex number. - - Returns - ------- - out: Complex128 - Result. - - Examples - -------- - > var z = new {{alias:@stdlib/complex/float64/ctor}}( -4.2, 5.5 ) - - > var v = {{alias}}( z ) - - > var re = {{alias:@stdlib/complex/float64/real}}( v ) - 4.2 - > var im = {{alias:@stdlib/complex/float64/imag}}( v ) - -5.5 - - See Also - -------- - diff --git a/float64/base/neg/docs/types/index.d.ts b/float64/base/neg/docs/types/index.d.ts deleted file mode 100644 index 4fb87d72..00000000 --- a/float64/base/neg/docs/types/index.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex128 } from '@stdlib/types/complex'; - -/** -* Negates a double-precision complex floating-point number. -* -* @param z - complex number -* @returns result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( -4.2, 5.5 ); -* -* var out = cneg( z1 ); -* // returns [ 4.2, -5.5 ] -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z2 = new Complex128( 0.0, 0.0 ); -* -* var out = cneg( z2 ); -* // returns [ -0.0, -0.0 ] -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z3 = new Complex128( NaN, NaN ); -* -* var out = cneg( z3 ); -* // returns [ NaN, NaN ] -*/ -declare function cneg( z: Complex128 ): Complex128; - - -// EXPORTS // - -export = cneg; diff --git a/float64/base/neg/docs/types/test.ts b/float64/base/neg/docs/types/test.ts deleted file mode 100644 index 9a7544e7..00000000 --- a/float64/base/neg/docs/types/test.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../../float64/ctor' ); -import cneg = require( './index' ); - - -// TESTS // - -// The function returns a double-precision complex floating-point number... -{ - const z = new Complex128( 1.0, 1.0 ); - - cneg( z ); // $ExpectType Complex128 -} - -// The compiler throws an error if the function is provided an argument which is not a complex number... -{ - cneg( true ); // $ExpectError - cneg( false ); // $ExpectError - cneg( null ); // $ExpectError - cneg( undefined ); // $ExpectError - cneg( '5' ); // $ExpectError - cneg( [] ); // $ExpectError - cneg( {} ); // $ExpectError - cneg( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z = new Complex128( 1.0, 1.0 ); - - cneg(); // $ExpectError - cneg( z, z ); // $ExpectError - cneg( z, z, z ); // $ExpectError -} diff --git a/float64/base/neg/examples/c/Makefile b/float64/base/neg/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float64/base/neg/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/neg/examples/c/example.c b/float64/base/neg/examples/c/example.c deleted file mode 100644 index e4538238..00000000 --- a/float64/base/neg/examples/c/example.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/neg.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 3.14, 1.5 ), - stdlib_complex128( -3.14, 1.5 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - stdlib_complex128_t y; - double re; - double im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex128_reim( v, &re, &im ); - printf( "z = %lf + %lfi\n", re, im ); - - y = stdlib_base_complex128_neg( v ); - stdlib_complex128_reim( y, &re, &im ); - printf( "cneg(z) = %lf + %lfi\n", re, im ); - } -} diff --git a/float64/base/neg/examples/index.js b/float64/base/neg/examples/index.js deleted file mode 100644 index 18b3e496..00000000 --- a/float64/base/neg/examples/index.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128 = require( './../../../../float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var cneg = require( './../lib' ); - -function randomComplex() { - var re = discreteUniform( -50, 50 ); - var im = discreteUniform( -50, 50 ); - return new Complex128( re, im ); -} - -var z; -var o; -var i; - -for ( i = 0; i < 100; i++ ) { - z = randomComplex(); - o = cneg( z ); - console.log( 'negate(%s) = %s', z.toString(), o.toString() ); -} diff --git a/float64/base/neg/include.gypi b/float64/base/neg/include.gypi deleted file mode 100644 index de5f9994..00000000 --- a/float64/base/neg/include.gypi +++ /dev/null @@ -1,53 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A GYP include file for building a Node.js native add-on. -# -# Main documentation: -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Source directory: - 'src_dir': './src', - - # Include directories: - 'include_dirs': [ - '[ 4.2, -5.5 ] -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var cneg = require( '@stdlib/complex/float64/base/neg' ); -* -* var z = new Complex128( 0.0, 0.0 ); -* -* var out = cneg( z ); -* // returns [ -0.0, -0.0 ] -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var cneg = require( '@stdlib/complex/float64/base/neg' ); -* -* var z = new Complex128( NaN, NaN ); -* -* var out = cneg( z ); -* // returns [ NaN, NaN ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float64/base/neg/lib/main.js b/float64/base/neg/lib/main.js deleted file mode 100644 index 5e17994a..00000000 --- a/float64/base/neg/lib/main.js +++ /dev/null @@ -1,67 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var Complex128 = require( './../../../../float64/ctor' ); - - -// MAIN // - -/** -* Negates a double-precision complex floating-point number. -* -* @param {Complex128} z - complex number -* @returns {Complex128} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( -4.2, 5.5 ); -* -* var out = cneg( z ); -* // returns [ 4.2, -5.5 ] -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 0.0, 0.0 ); -* -* var out = cneg( z ); -* // returns [ -0.0, -0.0 ] -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( NaN, NaN ); -* -* var out = cneg( z ); -* // returns [ NaN, NaN ] -*/ -function cneg( z ) { - return new Complex128( -real( z ), -imag( z ) ); -} - - -// EXPORTS // - -module.exports = cneg; diff --git a/float64/base/neg/lib/native.js b/float64/base/neg/lib/native.js deleted file mode 100644 index 39689282..00000000 --- a/float64/base/neg/lib/native.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex128 = require( './../../../../float64/ctor' ); -var addon = require( './../src/addon.node' ); - - -// MAIN // - -/** -* Negate a double-precision complex floating-point number. -* -* @private -* @param {Complex128} z - complex number -* @returns {Complex128} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( -4.2, 5.5 ); -* -* var out = cneg( z ); -* // returns [ 4.2, -5.5 ] -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 0.0, 0.0 ); -* -* var out = cneg( z ); -* // returns [ -0.0, -0.0 ] -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( NaN, NaN ); -* -* var out = cneg( z ); -* // returns [ NaN, NaN ] -*/ -function cneg( z ) { - var v = addon( z ); - return new Complex128( v.re, v.im ); -} - - -// EXPORTS // - -module.exports = cneg; diff --git a/float64/base/neg/manifest.json b/float64/base/neg/manifest.json deleted file mode 100644 index 00d5fd64..00000000 --- a/float64/base/neg/manifest.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/napi/unary", - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - } - ] -} diff --git a/float64/base/neg/package.json b/float64/base/neg/package.json deleted file mode 100644 index 77ebc2d0..00000000 --- a/float64/base/neg/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@stdlib/complex/float64/base/neg", - "version": "0.0.0", - "description": "Negate a double-precision complex floating-point number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "neg", - "negate", - "negation", - "negative", - "complex", - "cmplx", - "number" - ] -} diff --git a/float64/base/neg/src/Makefile b/float64/base/neg/src/Makefile deleted file mode 100644 index a28d8988..00000000 --- a/float64/base/neg/src/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - - -# RULES # - -#/ -# Removes generated files for building an add-on. -# -# @example -# make clean-addon -#/ -clean-addon: - $(QUIET) -rm -f *.o *.node - -.PHONY: clean-addon - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: clean-addon - -.PHONY: clean diff --git a/float64/base/neg/src/addon.c b/float64/base/neg/src/addon.c deleted file mode 100644 index 048c74cb..00000000 --- a/float64/base/neg/src/addon.c +++ /dev/null @@ -1,22 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/neg.h" -#include "stdlib/math/base/napi/unary.h" - -STDLIB_MATH_BASE_NAPI_MODULE_Z_Z( stdlib_base_complex128_neg ) diff --git a/float64/base/neg/src/main.c b/float64/base/neg/src/main.c deleted file mode 100644 index 6c62b057..00000000 --- a/float64/base/neg/src/main.c +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/neg.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" - -/** -* Negates a double-precision complex floating-point number. -* -* @param z input value -* @return result -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* #include "stdlib/complex/float64/real.h" -* #include "stdlib/complex/float64/imag.h" -* -* stdlib_complex128_t z = stdlib_complex128( 3.0, -2.0 ); -* -* stdlib_complex128_t out = stdlib_base_complex128_neg( z ); -* -* double re = stdlib_complex128_real( out ); -* // returns -3.0 -* -* double im = stdlib_complex128_imag( out ); -* // returns 2.0 -*/ -stdlib_complex128_t stdlib_base_complex128_neg( const stdlib_complex128_t z ) { - double re; - double im; - stdlib_complex128_reim( z, &re, &im ); - return stdlib_complex128( -re, -im ); -} diff --git a/float64/base/neg/test/test.js b/float64/base/neg/test/test.js deleted file mode 100644 index 8ec41186..00000000 --- a/float64/base/neg/test/test.js +++ /dev/null @@ -1,137 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' ); -var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var cneg = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof cneg, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function negates real and imaginary components', function test( t ) { - var actual; - var z; - - z = new Complex128( -4.2, 5.5 ); - actual = cneg( z ); - - t.strictEqual( real( actual ), 4.2, 'returns expected value' ); - t.strictEqual( imag( actual ), -5.5, 'returns expected value' ); - - z = new Complex128( 9.99999, 0.1 ); - actual = cneg( z ); - - t.strictEqual( real( actual ), -9.99999, 'returns expected value' ); - t.strictEqual( imag( actual ), -0.1, 'returns expected value' ); - - z = new Complex128( 4.0, 7.0 ); - actual = cneg( z ); - - t.strictEqual( real( actual ), -4.0, 'returns expected value' ); - t.strictEqual( imag( actual ), -7.0, 'returns expected value' ); - - z = new Complex128( -4.0, -7.0 ); - actual = cneg( z ); - - t.strictEqual( real( actual ), 4.0, 'returns expected value' ); - t.strictEqual( imag( actual ), 7.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `NaN` if provided `NaN`', function test( t ) { - var actual; - var z; - - z = new Complex128( NaN, NaN ); - actual = cneg( z ); - - t.strictEqual( isnan( real( actual ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( actual ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `+0` if provided `-0`', function test( t ) { - var actual; - var z; - - z = new Complex128( -0.0, -0.0 ); - actual = cneg( z ); - - t.strictEqual( isPositiveZero( real( actual ) ), true, 'returns expected value' ); - t.strictEqual( isPositiveZero( imag( actual ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `-0` if provided `+0`', function test( t ) { - var actual; - var z; - - z = new Complex128( +0.0, +0.0 ); - actual = cneg( z ); - - t.strictEqual( isNegativeZero( real( actual ) ), true, 'returns expected value' ); - t.strictEqual( isNegativeZero( imag( actual ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `-infinity` if provided `+infinity`', function test( t ) { - var actual; - var z; - - z = new Complex128( PINF, PINF ); - actual = cneg( z ); - - t.strictEqual( real( actual ), NINF, 'returns expected value' ); - t.strictEqual( imag( actual ), NINF, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `+infinity` if provided `-infinity`', function test( t ) { - var actual; - var z; - - z = new Complex128( NINF, NINF ); - actual = cneg( z ); - - t.strictEqual( real( actual ), PINF, 'returns expected value' ); - t.strictEqual( imag( actual ), PINF, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/neg/test/test.native.js b/float64/base/neg/test/test.native.js deleted file mode 100644 index bfe81d62..00000000 --- a/float64/base/neg/test/test.native.js +++ /dev/null @@ -1,146 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var tape = require( 'tape' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' ); -var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var cneg = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( cneg instanceof Error ) -}; - - -// TESTS // - -tape( 'main export is a function', opts, function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof cneg, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function negates real and imaginary components', opts, function test( t ) { - var actual; - var z; - - z = new Complex128( -4.2, 5.5 ); - actual = cneg( z ); - - t.strictEqual( real( actual ), 4.2, 'returns expected value' ); - t.strictEqual( imag( actual ), -5.5, 'returns expected value' ); - - z = new Complex128( 9.99999, 0.1 ); - actual = cneg( z ); - - t.strictEqual( real( actual ), -9.99999, 'returns expected value' ); - t.strictEqual( imag( actual ), -0.1, 'returns expected value' ); - - z = new Complex128( 4.0, 7.0 ); - actual = cneg( z ); - - t.strictEqual( real( actual ), -4.0, 'returns expected value' ); - t.strictEqual( imag( actual ), -7.0, 'returns expected value' ); - - z = new Complex128( -4.0, -7.0 ); - actual = cneg( z ); - - t.strictEqual( real( actual ), 4.0, 'returns expected value' ); - t.strictEqual( imag( actual ), 7.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `NaN` if provided `NaN`', opts, function test( t ) { - var actual; - var z; - - z = new Complex128( NaN, NaN ); - actual = cneg( z ); - - t.strictEqual( isnan( real( actual ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( actual ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `+0` if provided `-0`', opts, function test( t ) { - var actual; - var z; - - z = new Complex128( -0.0, -0.0 ); - actual = cneg( z ); - - t.strictEqual( isPositiveZero( real( actual ) ), true, 'returns expected value' ); - t.strictEqual( isPositiveZero( imag( actual ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `-0` if provided `+0`', opts, function test( t ) { - var actual; - var z; - - z = new Complex128( +0.0, +0.0 ); - actual = cneg( z ); - - t.strictEqual( isNegativeZero( real( actual ) ), true, 'returns expected value' ); - t.strictEqual( isNegativeZero( imag( actual ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `-infinity` if provided `+infinity`', opts, function test( t ) { - var actual; - var z; - - z = new Complex128( PINF, PINF ); - actual = cneg( z ); - - t.strictEqual( real( actual ), NINF, 'returns expected value' ); - t.strictEqual( imag( actual ), NINF, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `+infinity` if provided `-infinity`', opts, function test( t ) { - var actual; - var z; - - z = new Complex128( NINF, NINF ); - actual = cneg( z ); - - t.strictEqual( real( actual ), PINF, 'returns expected value' ); - t.strictEqual( imag( actual ), PINF, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/package.json b/float64/base/package.json deleted file mode 100644 index 394a68e4..00000000 --- a/float64/base/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@stdlib/complex/float64/base", - "version": "0.0.0", - "description": "Base (i.e., lower-level) double-precision complex number functions.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "lib/index.js", - "directories": { - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "types", - "complex", - "cmplx", - "number", - "namespace", - "ns", - "float64", - "base" - ], - "__stdlib__": { - "scaffold": { - "alias_prefix": "stdlib_base_complex128_" - } - } -} diff --git a/float64/base/scale/README.md b/float64/base/scale/README.md deleted file mode 100644 index 9232e7b6..00000000 --- a/float64/base/scale/README.md +++ /dev/null @@ -1,263 +0,0 @@ - - -# scale - -> Scale a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant. - -
- -
- - - -
- -## Usage - -```javascript -var scale = require( '@stdlib/complex/float64/base/scale' ); -``` - -#### scale( alpha, z ) - -Scales a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z = new Complex128( 5.0, 3.0 ); - -var v = scale( 5.0, z ); -// returns [ 25.0, 15.0 ] -``` - -The function supports the following parameters: - -- **alpha**: real-valued scalar constant. -- **z**: [complex number][@stdlib/complex/float64/ctor]. - -#### scale.assign( alpha, re1, im1, out, strideOut, offsetOut ) - -Scales a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant and assigns results to a provided output array. - -```javascript -var Float64Array = require( '@stdlib/array/float64' ); - -var out = new Float64Array( 2 ); -var v = scale.assign( 5.0, 5.0, 3.0, out, 1, 0 ); -// returns [ 25.0, 15.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **alpha**: real-valued scalar constant. -- **re**: real component of the complex number. -- **im**: imaginary component of the complex number. -- **out**: output array. -- **strideOut**: stride length for `out`. -- **offsetOut**: starting index for `out`. - -#### scale.strided( alpha, z, sz, oz, out, so, oo ) - -Scales a double-precision complex floating-point number stored in a real-valued strided array view by a real-valued double-precision floating-point scalar constant and assigns results to a provided strided output array. - -```javascript -var Float64Array = require( '@stdlib/array/float64' ); - -var z = new Float64Array( [ 5.0, 3.0 ] ); -var out = new Float64Array( 2 ); - -var v = scale.strided( 5.0, z, 1, 0, out, 1, 0 ); -// returns [ 25.0, 15.0 ] - -var bool = ( out === v ); -// returns true -``` - -The function supports the following parameters: - -- **alpha**: real-valued scalar constant. -- **z**: complex number strided array view. -- **sz**: stride length for `z`. -- **oz**: starting index for `z`. -- **out**: output array. -- **so**: stride length for `out`. -- **oo**: starting index for `out`. - -
- - - -
- -## Examples - - - -```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var scale = require( '@stdlib/complex/float64/base/scale' ); - -// Generate an array of random values: -var values = new Complex128Array( discreteUniform( 200, -50, 50 ) ); - -// Scale each by a scalar constant: -logEachMap( '%0.1f * (%s) = %s', 5.0, values, scale ); -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float64/base/scale.h" -``` - -#### stdlib_base_complex128_scale( alpha, z ) - -Scales a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant. - -```c -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/imag.h" - -stdlib_complex128_t z = stdlib_complex128( 5.0, 3.0 ); - -stdlib_complex128_t out = stdlib_base_complex128_scale( 5.0, z ); - -double re = stdlib_complex128_real( out ); -// returns 25.0 - -double im = stdlib_complex128_imag( out ); -// returns 15.0 -``` - -The function accepts the following arguments: - -- **alpha**: `[in] double` scalar constant. -- **z**: `[in] stdlib_complex128_t` complex number. - -```c -stdlib_complex128_t stdlib_base_complex128_scale( const double alpha, const stdlib_complex128_t z ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float64/base/scale.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 3.14, 1.5 ), - stdlib_complex128( -3.14, 1.5 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - stdlib_complex128_t y; - double re; - double im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex128_reim( v, &re, &im ); - printf( "z = %lf + %lfi\n", re, im ); - - y = stdlib_base_complex128_scale( 5.0, v ); - stdlib_complex128_reim( y, &re, &im ); - printf( "scale(5.0, z) = %lf + %lfi\n", re, im ); - } -} -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/float64/base/scale/benchmark/benchmark.assign.js b/float64/base/scale/benchmark/benchmark.assign.js deleted file mode 100644 index bf89fac7..00000000 --- a/float64/base/scale/benchmark/benchmark.assign.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Float64Array = require( '@stdlib/array/float64' ); -var pkg = require( './../package.json' ).name; -var scale = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float64' -}; - - -// MAIN // - -bench( pkg+':assign', function benchmark( b ) { - var out; - var re; - var im; - var N; - var i; - var j; - - N = 100; - re = uniform( N, -500.0, 500.0, options ); - im = uniform( N, -500.0, 500.0, options ); - - out = new Float64Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = i % N; - out = scale.assign( 5.0, re[ j ], im[ j ], out, 1, 0 ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( out[ 0 ] ) || isnan( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/scale/benchmark/benchmark.js b/float64/base/scale/benchmark/benchmark.js deleted file mode 100644 index 1f458222..00000000 --- a/float64/base/scale/benchmark/benchmark.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var pkg = require( './../package.json' ).name; -var scale = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = scale( 5.0, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( real( out ) ) || isnan( imag( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/scale/benchmark/benchmark.native.js b/float64/base/scale/benchmark/benchmark.native.js deleted file mode 100644 index 8cb419d5..00000000 --- a/float64/base/scale/benchmark/benchmark.native.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); -var pkg = require( './../package.json' ).name; - - -// VARIABLES // - -var scale = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( scale instanceof Error ) -}; - - -// MAIN // - -bench( pkg+'::native', opts, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = scale( 5.0, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( real( out ) ) || isnan( imag( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/scale/benchmark/benchmark.strided.js b/float64/base/scale/benchmark/benchmark.strided.js deleted file mode 100644 index 9538bb58..00000000 --- a/float64/base/scale/benchmark/benchmark.strided.js +++ /dev/null @@ -1,66 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/array/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Float64Array = require( '@stdlib/array/float64' ); -var pkg = require( './../package.json' ).name; -var scale = require( './../lib' ); - - -// VARIABLES // - -var options = { - 'dtype': 'float64' -}; - - -// MAIN // - -bench( pkg+':strided', function benchmark( b ) { - var out; - var z1; - var N; - var i; - var j; - - N = 50; - z1 = uniform( N*2, -500.0, 500.0, options ); - - out = new Float64Array( 2 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = ( i % N ) * 2; - out = scale.strided( 5.0, z1, 1, j, out, 1, 0 ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( out[ 0 ] ) || isnan( out[ 1 ] ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/scale/benchmark/c/Makefile b/float64/base/scale/benchmark/c/Makefile deleted file mode 100644 index 85a01e54..00000000 --- a/float64/base/scale/benchmark/c/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/scale/benchmark/c/benchmark.c b/float64/base/scale/benchmark/c/benchmark.c deleted file mode 100644 index 538375b8..00000000 --- a/float64/base/scale/benchmark/c/benchmark.c +++ /dev/null @@ -1,140 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include -#include -#include -#include - -#define NAME "cscale" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double re; - double im; - double t; - int i; - - double complex z1; - double complex z2; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z1 = re + im*I; - - re = creal( z1 ) * 5.0; - im = cimag( z1 ) * 5.0; - z2 = re + im*I; - if ( z2 != z2 ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( z2 != z2 ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/base/scale/benchmark/c/native/Makefile b/float64/base/scale/benchmark/c/native/Makefile deleted file mode 100644 index a4bd7b38..00000000 --- a/float64/base/scale/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/scale/benchmark/c/native/benchmark.c b/float64/base/scale/benchmark/c/native/benchmark.c deleted file mode 100644 index e8603f0a..00000000 --- a/float64/base/scale/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,142 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/scale.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include -#include -#include -#include -#include - -#define NAME "scale" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double re; - double im; - double t; - int i; - - stdlib_complex128_t z1; - stdlib_complex128_t z2; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z1 = stdlib_complex128( re, im ); - - z2 = stdlib_base_complex128_scale( 5.0, z1 ); - stdlib_complex128_reim( z2, &re, &im ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/base/scale/benchmark/julia/REQUIRE b/float64/base/scale/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float64/base/scale/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float64/base/scale/benchmark/julia/benchmark.jl b/float64/base/scale/benchmark/julia/benchmark.jl deleted file mode 100644 index ac6979bf..00000000 --- a/float64/base/scale/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "scale"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark ComplexF64( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) * 5.0 samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float64/base/scale/binding.gyp b/float64/base/scale/binding.gyp deleted file mode 100644 index 68a1ca11..00000000 --- a/float64/base/scale/binding.gyp +++ /dev/null @@ -1,170 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A `.gyp` file for building a Node.js native add-on. -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # List of files to include in this file: - 'includes': [ - './include.gypi', - ], - - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Target name should match the add-on export name: - 'addon_target_name%': 'addon', - - # Set variables based on the host OS: - 'conditions': [ - [ - 'OS=="win"', - { - # Define the object file suffix: - 'obj': 'obj', - }, - { - # Define the object file suffix: - 'obj': 'o', - } - ], # end condition (OS=="win") - ], # end conditions - }, # end variables - - # Define compile targets: - 'targets': [ - - # Target to generate an add-on: - { - # The target name should match the add-on export name: - 'target_name': '<(addon_target_name)', - - # Define dependencies: - 'dependencies': [], - - # Define directories which contain relevant include headers: - 'include_dirs': [ - # Local include directory: - '<@(include_dirs)', - ], - - # List of source files: - 'sources': [ - '<@(src_files)', - ], - - # Settings which should be applied when a target's object files are used as linker input: - 'link_settings': { - # Define libraries: - 'libraries': [ - '<@(libraries)', - ], - - # Define library directories: - 'library_dirs': [ - '<@(library_dirs)', - ], - }, - - # C/C++ compiler flags: - 'cflags': [ - # Enable commonly used warning options: - '-Wall', - - # Aggressive optimization: - '-O3', - ], - - # C specific compiler flags: - 'cflags_c': [ - # Specify the C standard to which a program is expected to conform: - '-std=c99', - ], - - # C++ specific compiler flags: - 'cflags_cpp': [ - # Specify the C++ standard to which a program is expected to conform: - '-std=c++11', - ], - - # Linker flags: - 'ldflags': [], - - # Apply conditions based on the host OS: - 'conditions': [ - [ - 'OS=="mac"', - { - # Linker flags: - 'ldflags': [ - '-undefined dynamic_lookup', - '-Wl,-no-pie', - '-Wl,-search_paths_first', - ], - }, - ], # end condition (OS=="mac") - [ - 'OS!="win"', - { - # C/C++ flags: - 'cflags': [ - # Generate platform-independent code: - '-fPIC', - ], - }, - ], # end condition (OS!="win") - ], # end conditions - }, # end target <(addon_target_name) - - # Target to copy a generated add-on to a standard location: - { - 'target_name': 'copy_addon', - - # Declare that the output of this target is not linked: - 'type': 'none', - - # Define dependencies: - 'dependencies': [ - # Require that the add-on be generated before building this target: - '<(addon_target_name)', - ], - - # Define a list of actions: - 'actions': [ - { - 'action_name': 'copy_addon', - 'message': 'Copying addon...', - - # Explicitly list the inputs in the command-line invocation below: - 'inputs': [], - - # Declare the expected outputs: - 'outputs': [ - '<(addon_output_dir)/<(addon_target_name).node', - ], - - # Define the command-line invocation: - 'action': [ - 'cp', - '<(PRODUCT_DIR)/<(addon_target_name).node', - '<(addon_output_dir)/<(addon_target_name).node', - ], - }, - ], # end actions - }, # end target copy_addon - ], # end targets -} diff --git a/float64/base/scale/docs/repl.txt b/float64/base/scale/docs/repl.txt deleted file mode 100644 index 302166be..00000000 --- a/float64/base/scale/docs/repl.txt +++ /dev/null @@ -1,106 +0,0 @@ - -{{alias}}( alpha, z ) - Scales a double-precision complex floating-point number by a real-valued - double-precision floating-point scalar constant. - - Parameters - ---------- - alpha: number - Scalar constant. - - z: Complex128 - Complex number. - - Returns - ------- - out: Complex128 - Result. - - Examples - -------- - > var z = new {{alias:@stdlib/complex/float64/ctor}}( 5.0, 3.0 ) - - > var out = {{alias}}( 5.0, z ) - [ 25.0, 15.0 ] - - -{{alias}}.assign( alpha, re, im, out, strideOut, offsetOut ) - Scales a double-precision complex floating-point number by a real-valued - double-precision floating-point scalar constant and assigns results to a - provided output array. - - Parameters - ---------- - alpha: number - Scalar constant. - - re: number - Real component of the complex number. - - im: number - Imaginary component of the complex number. - - out: ArrayLikeObject - Output array. - - strideOut: integer - Stride length. - - offsetOut: integer - Starting index. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var out = new {{alias:@stdlib/array/float64}}( 2 ); - > {{alias}}.assign( 5.0, 5.0, 3.0, out, 1, 0 ) - [ 25.0, 15.0 ] - - -{{alias}}.strided( alpha, z, sz, oz, out, so, oo ) - Scales a double-precision complex floating-point number stored in a real- - valued strided array view by a real-valued double-precision floating-point - scalar constant and assigns results to a provided strided output array. - - Parameters - ---------- - alpha: number - Scalar constant. - - z: ArrayLikeObject - Complex number view. - - sz: integer - Stride length for `z`. - - oz: integer - Starting index for `z`. - - out: ArrayLikeObject - Output array. - - so: integer - Stride length for `out`. - - oo: integer - Starting index for `out`. - - Returns - ------- - out: ArrayLikeObject - Output array. - - Examples - -------- - > var z = new {{alias:@stdlib/array/float64}}( [ 5.0, 3.0 ] ); - > var out = new {{alias:@stdlib/array/float64}}( 2 ); - > {{alias}}.strided( 5.0, z, 1, 0, out, 1, 0 ) - [ 25.0, 15.0 ] - - See Also - -------- - diff --git a/float64/base/scale/docs/types/index.d.ts b/float64/base/scale/docs/types/index.d.ts deleted file mode 100644 index 8ee4323d..00000000 --- a/float64/base/scale/docs/types/index.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex128 } from '@stdlib/types/complex'; -import { Collection, NumericArray } from '@stdlib/types/array'; - -/** -* Interface for scaling a double-precision complex floating-point number. -*/ -interface Scale { - /** - * Scales a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant. - * - * @param alpha - scalar constant - * @param z - complex number - * @returns result - * - * @example - * var Complex128 = require( './../../../../../float64/ctor' ); - * - * var z = new Complex128( 5.0, 3.0 ); - * - * var out = scale( 5.0, z ); - * // returns [ 25.0, 15.0 ] - */ - ( alpha: number, z: Complex128 ): Complex128; - - /** - * Scales a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant and assigns results to a provided output array. - * - * @param alpha - scalar constant - * @param re - real component of the complex number - * @param im - imaginary component of the complex number - * @param out - output array - * @param strideOut - stride length - * @param offsetOut - starting index - * @returns output array - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var out = new Float64Array( 2 ); - * var v = scale.assign( 5.0, 5.0, 3.0, out, 1, 0 ); - * // returns [ 25.0, 15.0 ] - * - * var bool = ( out === v ); - * // returns true - */ - assign>( alpha: number, re: number, im: number, out: T, strideOut: number, offsetOut: number ): T; - - /** - * Scales a double-precision complex floating-point number stored in a real-valued strided array view by a real-valued double-precision floating-point scalar constant and assigns results to a provided strided output array. - * - * @param alpha - scalar constant - * @param z - complex number view - * @param strideZ - stride length for `z` - * @param offsetZ - starting index for `z` - * @param out - output array - * @param strideOut - stride length for `out` - * @param offsetOut - starting index for `out` - * @returns output array - * - * @example - * var Float64Array = require( '@stdlib/array/float64' ); - * - * var z = new Float64Array( [ 5.0, 3.0 ] ); - * - * var out = scale.strided( 5.0, z, 1, 0, new Float64Array( 2 ), 1, 0 ); - * // returns [ 25.0, 15.0 ] - */ - strided, U extends NumericArray | Collection>( alpha: number, z: T, strideZ: number, offsetZ: number, out: U, strideOut: number, offsetOut: number ): U; -} - -/** -* Scales a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant. -* -* @param alpha - scalar constant -* @param z - complex number -* @returns result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var out = scale( 5.0, z ); -* // returns [ 25.0, 15.0 ] -* -* @example -* var Float64Array = require( '@stdlib/array/float64' ); -* -* var out = new Float64Array( 2 ); -* var v = scale.assign( 5.0, 5.0, 3.0, out, 1, 0 ); -* // returns [ 25.0, 15.0 ] -* -* var bool = ( out === v ); -* // returns true -* -* @example -* var Float64Array = require( '@stdlib/array/float64' ); -* -* var z = new Float64Array( [ 5.0, 3.0 ] ); -* -* var out = scale.strided( 5.0, z, 1, 0, new Float64Array( 2 ), 1, 0 ); -* // returns [ 25.0, 15.0 ] -*/ -declare var scale: Scale; - - -// EXPORTS // - -export = scale; diff --git a/float64/base/scale/docs/types/test.ts b/float64/base/scale/docs/types/test.ts deleted file mode 100644 index 6df313db..00000000 --- a/float64/base/scale/docs/types/test.ts +++ /dev/null @@ -1,297 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../../float64/ctor' ); -import scale = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - scale( 5.0, z ); // $ExpectType Complex128 -} - -// The compiler throws an error if the function is provided a first argument which is not a number... -{ - const z = new Complex128( 1.0, 1.0 ); - - scale( true, z ); // $ExpectError - scale( false, z ); // $ExpectError - scale( null, z ); // $ExpectError - scale( undefined, z ); // $ExpectError - scale( '5', z ); // $ExpectError - scale( [], z ); // $ExpectError - scale( {}, z ); // $ExpectError - scale( ( x: number ): number => x, z ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument which is not a complex number... -{ - scale( 5.0, true ); // $ExpectError - scale( 5.0, false ); // $ExpectError - scale( 5.0, null ); // $ExpectError - scale( 5.0, undefined ); // $ExpectError - scale( 5.0, '5' ); // $ExpectError - scale( 5.0, [] ); // $ExpectError - scale( 5.0, {} ); // $ExpectError - scale( 5.0, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z = new Complex128( 1.0, 1.0 ); - - scale(); // $ExpectError - scale( 5.0 ); // $ExpectError - scale( 5.0, z, z ); // $ExpectError -} - -// Attached to the main export is an `assign` method which returns a collection... -{ - scale.assign( 5.0, 1.0, 1.0, new Float64Array( 2 ), 1, 0 ); // $ExpectType Float64Array - scale.assign( 5.0, 1.0, 1.0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - scale.assign( 5.0, 1.0, 1.0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `assign` method is provided a first argument which is not a number... -{ - const out = new Float64Array( 2 ); - - scale.assign( true, 1.0, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( false, 1.0, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( null, 1.0, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( undefined, 1.0, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( '5', 1.0, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( [], 1.0, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( {}, 1.0, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( ( x: number ): number => x, 1.0, 2.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a second argument which is not a number... -{ - const out = new Float64Array( 2 ); - - scale.assign( 5.0, true, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, false, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, null, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, undefined, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, '5', 2.0, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, [], 2.0, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, {}, 2.0, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, ( x: number ): number => x, 2.0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a third argument which is not a number... -{ - const out = new Float64Array( 2 ); - - scale.assign( 5.0, 1.0, true, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, 1.0, false, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, 1.0, null, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, 1.0, undefined, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, 1.0, '5', out, 1, 0 ); // $ExpectError - scale.assign( 5.0, 1.0, [], out, 1, 0 ); // $ExpectError - scale.assign( 5.0, 1.0, {}, out, 1, 0 ); // $ExpectError - scale.assign( 5.0, 1.0, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fourth argument which is not a collection... -{ - scale.assign( 1.0, 2.0, 3.0, 1, 1, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, true, 1, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, false, 1, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, null, 1, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, undefined, 1, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, '5', 1, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, [ '5' ], 1, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, {}, 1, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a fifth argument which is not a number... -{ - const out = new Float64Array( 2 ); - - scale.assign( 1.0, 2.0, 3.0, out, true, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, false, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, null, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, undefined, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, '5', 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, [], 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, {}, 0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided a sixth argument which is not a number... -{ - const out = new Float64Array( 2 ); - - scale.assign( 1.0, 2.0, 3.0, out, 1, true ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, 1, false ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, 1, null ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, 1, undefined ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, 1, '5' ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, 1, [] ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, 1, {} ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `assign` method is provided an unsupported number of arguments... -{ - const out = new Float64Array( 2 ); - - scale.assign(); // $ExpectError - scale.assign( 1.0 ); // $ExpectError - scale.assign( 1.0, 2.0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, 1 ); // $ExpectError - scale.assign( 1.0, 2.0, 3.0, out, 1, 0, {} ); // $ExpectError -} - -// Attached to the main export is a `strided` method which returns a collection... -{ - const z1 = new Float64Array( 2 ); - - scale.strided( 5.0, z1, 1, 0, new Float64Array( 2 ), 1, 0 ); // $ExpectType Float64Array - scale.strided( 5.0, z1, 1, 0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array - scale.strided( 5.0, z1, 1, 0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] -} - -// The compiler throws an error if the `strided` method is provided a first argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const out = new Float64Array( z1.length ); - - scale.strided( true, z1, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( false, z1, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( null, z1, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( undefined, z1, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( '5', z1, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( [ '5' ], z1, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( {}, z1, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( ( x: number ): number => x, z1, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a second argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - const out = new Float64Array( z1.length ); - - scale.strided( 5.0, true, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, false, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, null, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, undefined, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, '5', 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, [ '5' ], 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, {}, 1, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, ( x: number ): number => x, 1, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a third argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const out = new Float64Array( z1.length ); - - scale.strided( 5.0, z1, true, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, false, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, null, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, undefined, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, '5', 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, [], 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, {}, 0, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, ( x: number ): number => x, 0, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fourth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const out = new Float64Array( 2 ); - - scale.strided( 5.0, z1, 1, true, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, false, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, null, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, undefined, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, '5', out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, [], out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, {}, out, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, ( x: number ): number => x, out, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a fifth argument which is not a collection... -{ - const z1 = new Float64Array( 2 ); - - scale.strided( 5.0, z1, 1, 0, true, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, false, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, null, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, undefined, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, '5', 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, [ '5' ], 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, {}, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a sixth argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const out = new Float64Array( z1.length ); - - scale.strided( 5.0, z1, 1, 0, out, true, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, false, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, null, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, undefined, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, '5', 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, [], 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, {}, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided a seventh argument which is not a number... -{ - const z1 = new Float64Array( 2 ); - const out = new Float64Array( z1.length ); - - scale.strided( 5.0, z1, 1, 0, out, 1, true ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, 1, false ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, 1, null ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, 1, undefined ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, 1, '5' ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, 1, [] ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, 1, {} ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `strided` method is provided an unsupported number of arguments... -{ - const z1 = new Float64Array( 2 ); - const out = new Float64Array( z1.length ); - - scale.strided(); // $ExpectError - scale.strided( 5.0 ); // $ExpectError - scale.strided( 5.0, z1 ); // $ExpectError - scale.strided( 5.0, z1, 1 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, 1 ); // $ExpectError - scale.strided( 5.0, z1, 1, 0, out, 1, 0, {} ); // $ExpectError -} - diff --git a/float64/base/scale/examples/c/Makefile b/float64/base/scale/examples/c/Makefile deleted file mode 100644 index 25ced822..00000000 --- a/float64/base/scale/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/scale/examples/c/example.c b/float64/base/scale/examples/c/example.c deleted file mode 100644 index 55777269..00000000 --- a/float64/base/scale/examples/c/example.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/scale.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 3.14, 1.5 ), - stdlib_complex128( -3.14, 1.5 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - stdlib_complex128_t y; - double re; - double im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex128_reim( v, &re, &im ); - printf( "z = %lf + %lfi\n", re, im ); - - y = stdlib_base_complex128_scale( 5.0, v ); - stdlib_complex128_reim( y, &re, &im ); - printf( "scale(5.0, z) = %lf + %lfi\n", re, im ); - } -} diff --git a/float64/base/scale/examples/index.js b/float64/base/scale/examples/index.js deleted file mode 100644 index 3f9ce5a7..00000000 --- a/float64/base/scale/examples/index.js +++ /dev/null @@ -1,30 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128Array = require( '@stdlib/array/complex128' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var scale = require( './../lib' ); - -// Generate an array of random values: -var values = new Complex128Array( discreteUniform( 200, -50, 50 ) ); - -// Scale each by a scalar constant: -logEachMap( '%0.1f * (%s) = %s', 5.0, values, scale ); diff --git a/float64/base/scale/include.gypi b/float64/base/scale/include.gypi deleted file mode 100644 index ecfaf82a..00000000 --- a/float64/base/scale/include.gypi +++ /dev/null @@ -1,53 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A GYP include file for building a Node.js native add-on. -# -# Main documentation: -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Source directory: - 'src_dir': './src', - - # Include directories: - 'include_dirs': [ - '[ 25.0, 15.0 ] -*/ -function assign( alpha, re, im, out, strideOut, offsetOut ) { - out[ offsetOut ] = re * alpha; - out[ offsetOut+strideOut ] = im * alpha; - return out; -} - - -// EXPORTS // - -module.exports = assign; diff --git a/float64/base/scale/lib/index.js b/float64/base/scale/lib/index.js deleted file mode 100644 index f0fef85a..00000000 --- a/float64/base/scale/lib/index.js +++ /dev/null @@ -1,54 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Scale a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant. -* -* @module @stdlib/complex/float64/base/scale -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var scale = require( '@stdlib/complex/float64/base/scale' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var out = scale( 5.0, z ); -* // returns [ 25.0, 15.0 ] -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var main = require( './main.js' ); -var assign = require( './assign.js' ); -var strided = require( './strided.js' ); - - -// MAIN // - -setReadOnly( main, 'assign', assign ); -setReadOnly( main, 'strided', strided ); - - -// EXPORTS // - -module.exports = main; - -// exports: { "assign": "main.assign", "strided": "main.strided" } diff --git a/float64/base/scale/lib/main.js b/float64/base/scale/lib/main.js deleted file mode 100644 index d3f77661..00000000 --- a/float64/base/scale/lib/main.js +++ /dev/null @@ -1,52 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); - - -// MAIN // - -/** -* Scales a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant. -* -* @param {number} alpha - scalar constant -* @param {Complex128} z - complex number -* @returns {Complex128} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var out = scale( 5.0, z ); -* // returns [ 25.0, 15.0 ] -*/ -function scale( alpha, z ) { - return new Complex128( real( z ) * alpha, imag( z ) * alpha ); -} - - -// EXPORTS // - -module.exports = scale; diff --git a/float64/base/scale/lib/native.js b/float64/base/scale/lib/native.js deleted file mode 100644 index 9c0e3dc2..00000000 --- a/float64/base/scale/lib/native.js +++ /dev/null @@ -1,53 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex128 = require( './../../../../float64/ctor' ); -var addon = require( './../src/addon.node' ); - - -// MAIN // - -/** -* Scales a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant. -* -* @private -* @param {number} alpha - scalar constant -* @param {Complex128} z - complex number -* @returns {Complex128} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var out = scale( 5.0, z ); -* // returns [ 25.0, 15.0 ] -*/ -function scale( alpha, z ) { - var v = addon( alpha, z ); - return new Complex128( v.re, v.im ); -} - - -// EXPORTS // - -module.exports = scale; diff --git a/float64/base/scale/lib/strided.js b/float64/base/scale/lib/strided.js deleted file mode 100644 index 40f04f7a..00000000 --- a/float64/base/scale/lib/strided.js +++ /dev/null @@ -1,52 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Scales a double-precision complex floating-point number stored in a real-valued strided array view by a real-valued double-precision floating-point scalar constant and assigns results to a provided strided output array. -* -* @param {number} alpha - scalar constant -* @param {Float64Array} z - complex number view -* @param {integer} strideZ - stride length for `z` -* @param {NonNegativeInteger} offsetZ - starting index for `z` -* @param {Collection} out - output array -* @param {integer} strideOut - stride length for `out` -* @param {NonNegativeInteger} offsetOut - starting index for `out` -* @returns {Collection} output array -* -* @example -* var Float64Array = require( '@stdlib/array/float64' ); -* -* var z = new Float64Array( [ 5.0, 3.0 ] ); -* -* var out = strided( 5.0, z, 1, 0, new Float64Array( 2 ), 1, 0 ); -* // returns [ 25.0, 15.0 ] -*/ -function strided( alpha, z, strideZ, offsetZ, out, strideOut, offsetOut ) { - out[ offsetOut ] = alpha * z[ offsetZ ]; - out[ offsetOut+strideOut ] = alpha * z[ offsetZ+strideZ ]; - return out; -} - - -// EXPORTS // - -module.exports = strided; diff --git a/float64/base/scale/manifest.json b/float64/base/scale/manifest.json deleted file mode 100644 index 48efffba..00000000 --- a/float64/base/scale/manifest.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/napi/binary", - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - } - ] -} diff --git a/float64/base/scale/package.json b/float64/base/scale/package.json deleted file mode 100644 index 6a44d2e4..00000000 --- a/float64/base/scale/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "@stdlib/complex/float64/base/scale", - "version": "0.0.0", - "description": "Scale a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "mul", - "cmul", - "mult", - "multiply", - "multiplication", - "arithmetic", - "complex", - "cmplx", - "number" - ] -} diff --git a/float64/base/scale/src/Makefile b/float64/base/scale/src/Makefile deleted file mode 100644 index 7733b618..00000000 --- a/float64/base/scale/src/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - - -# RULES # - -#/ -# Removes generated files for building an add-on. -# -# @example -# make clean-addon -#/ -clean-addon: - $(QUIET) -rm -f *.o *.node - -.PHONY: clean-addon - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: clean-addon - -.PHONY: clean diff --git a/float64/base/scale/src/addon.c b/float64/base/scale/src/addon.c deleted file mode 100644 index f3d7d751..00000000 --- a/float64/base/scale/src/addon.c +++ /dev/null @@ -1,22 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/scale.h" -#include "stdlib/math/base/napi/binary.h" - -STDLIB_MATH_BASE_NAPI_MODULE_DZ_Z( stdlib_base_complex128_scale ) diff --git a/float64/base/scale/src/main.c b/float64/base/scale/src/main.c deleted file mode 100644 index 8ae2c3c6..00000000 --- a/float64/base/scale/src/main.c +++ /dev/null @@ -1,51 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/scale.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" - -/** -* Scales a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant. -* -* @param alpha scalar constant -* @param z input value -* @return result -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* #include "stdlib/complex/float64/real.h" -* #include "stdlib/complex/float64/imag.h" -* -* stdlib_complex128_t z = stdlib_complex128( 5.0, 3.0 ); -* -* stdlib_complex128_t out = stdlib_base_complex128_scale( 5.0, z ); -* -* double re = stdlib_complex128_real( out ); -* // returns 25.0 -* -* double im = stdlib_complex128_imag( out ); -* // returns 15.0 -*/ -stdlib_complex128_t stdlib_base_complex128_scale( const double alpha, const stdlib_complex128_t z ) { - double re; - double im; - - stdlib_complex128_reim( z, &re, &im ); - return stdlib_complex128( re * alpha, im * alpha ); -} diff --git a/float64/base/scale/test/test.assign.js b/float64/base/scale/test/test.assign.js deleted file mode 100644 index 388257a1..00000000 --- a/float64/base/scale/test/test.assign.js +++ /dev/null @@ -1,111 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' ); -var Float64Array = require( '@stdlib/array/float64' ); -var scale = require( './../lib/assign.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof scale, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function scales a complex number', function test( t ) { - var expected; - var out; - var v; - - out = new Float64Array( 2 ); - v = scale( 5.0, 5.0, 3.0, out, 1, 0 ); - - expected = new Float64Array( [ 25.0, 15.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 4 ); - v = scale( 5.0, 5.0, 3.0, out, 2, 0 ); - - expected = new Float64Array( [ 25.0, 0.0, 15.0, 0.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 4 ); - v = scale( 5.0, 5.0, 3.0, out, 2, 1 ); - - expected = new Float64Array( [ 0.0, 25.0, 0.0, 15.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 4 ); - v = scale( 5.0, 5.0, 3.0, out, -2, 3 ); - - expected = new Float64Array( [ 0.0, 15.0, 0.0, 25.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the respective component is `NaN`', function test( t ) { - var expected; - var out; - var v; - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, 15.0 ] ); - - v = scale( 5.0, NaN, 3.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ 25.0, NaN ] ); - - v = scale( 5.0, 5.0, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = scale( 5.0, NaN, NaN, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = scale( NaN, 5.0, 3.0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/scale/test/test.js b/float64/base/scale/test/test.js deleted file mode 100644 index 4869937e..00000000 --- a/float64/base/scale/test/test.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isMethod = require( '@stdlib/assert/is-method' ); -var scale = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof scale, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'attached to the main export is an `assign` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( scale, 'assign' ), true, 'returns expected value' ); - t.end(); -}); - -tape( 'attached to the main export is a `strided` method', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( isMethod( scale, 'strided' ), true, 'returns expected value' ); - t.end(); -}); diff --git a/float64/base/scale/test/test.main.js b/float64/base/scale/test/test.main.js deleted file mode 100644 index 60ee6101..00000000 --- a/float64/base/scale/test/test.main.js +++ /dev/null @@ -1,82 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var scale = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof scale, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function scales a complex number', function test( t ) { - var z1; - var v; - - z1 = new Complex128( 5.0, 3.0 ); - - v = scale( 5.0, z1 ); - - t.strictEqual( real( v ), 25.0, 'returns expected value' ); - t.strictEqual( imag( v ), 15.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the respective component is `NaN`', function test( t ) { - var z1; - var v; - - z1 = new Complex128( NaN, 3.0 ); - - v = scale( 5.0, z1 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 15.0, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - - v = scale( 5.0, z1 ); - t.strictEqual( real( v ), 25.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - - v = scale( 5.0, z1 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - - v = scale( NaN, z1 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/scale/test/test.native.js b/float64/base/scale/test/test.native.js deleted file mode 100644 index 717e2057..00000000 --- a/float64/base/scale/test/test.native.js +++ /dev/null @@ -1,91 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var tape = require( 'tape' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var scale = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( scale instanceof Error ) -}; - - -// TESTS // - -tape( 'main export is a function', opts, function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof scale, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function scales a complex number', opts, function test( t ) { - var z1; - var v; - - z1 = new Complex128( 5.0, 3.0 ); - - v = scale( 5.0, z1 ); - - t.strictEqual( real( v ), 25.0, 'returns expected value' ); - t.strictEqual( imag( v ), 15.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the respective component is `NaN`', opts, function test( t ) { - var z1; - var v; - - z1 = new Complex128( NaN, 3.0 ); - - v = scale( 5.0, z1 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 15.0, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - - v = scale( 5.0, z1 ); - t.strictEqual( real( v ), 25.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - - v = scale( 5.0, z1 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - - v = scale( NaN, z1 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/scale/test/test.strided.js b/float64/base/scale/test/test.strided.js deleted file mode 100644 index c9cece0f..00000000 --- a/float64/base/scale/test/test.strided.js +++ /dev/null @@ -1,104 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' ); -var Float64Array = require( '@stdlib/array/float64' ); -var scale = require( './../lib/strided.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof scale, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function scales a complex number', function test( t ) { - var expected; - var out; - var z1; - var v; - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - out = new Float64Array( 2 ); - v = scale( 5.0, z1, 1, 0, out, 1, 0 ); - - expected = new Float64Array( [ 25.0, 15.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 0.0, 3.0, 0.0 ] ); - out = new Float64Array( 4 ); - v = scale( 5.0, z1, 2, 0, out, 2, 0 ); - - expected = new Float64Array( [ 25.0, 0.0, 15.0, 0.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 3.0, 5.0 ] ); - out = new Float64Array( 4 ); - v = scale( 5.0, z1, -1, 1, out, -2, 3 ); - - expected = new Float64Array( [ 0.0, 15.0, 0.0, 25.0 ] ); - - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the respective component is `NaN`', function test( t ) { - var expected; - var out; - var z1; - var v; - - z1 = new Float64Array( [ NaN, 3.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, 15.0 ] ); - - v = scale( 5.0, z1, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, NaN ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ 25.0, NaN ] ); - - v = scale( 5.0, z1, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - z1 = new Float64Array( [ 5.0, 3.0 ] ); - out = new Float64Array( 2 ); - expected = new Float64Array( [ NaN, NaN ] ); - - v = scale( NaN, z1, 1, 0, out, 1, 0 ); - t.strictEqual( v, out, 'returns expected value' ); - t.strictEqual( isSameFloat64Array( out, expected ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/sub/README.md b/float64/base/sub/README.md deleted file mode 100644 index e2be5da5..00000000 --- a/float64/base/sub/README.md +++ /dev/null @@ -1,226 +0,0 @@ - - -# csub - -> Subtract two double-precision complex floating-point numbers. - -
- -
- - - -
- -## Usage - -```javascript -var csub = require( '@stdlib/complex/float64/base/sub' ); -``` - -#### csub( z1, z2 ) - -Subtracts two double-precision complex floating-point numbers. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z1 = new Complex128( 5.0, 3.0 ); -var z2 = new Complex128( -2.0, 1.0 ); - -var v = csub( z1, z2 ); -// returns [ 7.0, 2.0 ] -``` - -
- - - -
- -## Examples - - - -```javascript -var Complex128Array = require( '@stdlib/array/complex128' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var csub = require( '@stdlib/complex/float64/base/sub' ); - -// Generate arrays of random values: -var z1 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise subtraction: -logEachMap( '(%s) - (%s) = %s', z1, z2, csub ); -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float64/base/sub.h" -``` - -#### stdlib_base_complex128_sub( z1, z2 ) - -Subtracts two double-precision complex floating-point numbers. - -```c -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/imag.h" - -stdlib_complex128_t z1 = stdlib_complex128( 5.0, 3.0 ); -stdlib_complex128_t z2 = stdlib_complex128( -2.0, 1.0 ); - -stdlib_complex128_t out = stdlib_base_complex128_sub( z1, z2 ); - -double re = stdlib_complex128_real( out ); -// returns 7.0 - -double im = stdlib_complex128_imag( out ); -// returns 2.0 -``` - -The function accepts the following arguments: - -- **z1**: `[in] stdlib_complex128_t` input value. -- **z2**: `[in] stdlib_complex128_t` input value. - -```c -stdlib_complex128_t stdlib_base_complex128_sub( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float64/base/sub.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 3.14, 1.5 ), - stdlib_complex128( -3.14, 1.5 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - stdlib_complex128_t y; - double re; - double im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex128_reim( v, &re, &im ); - printf( "z = %lf + %lfi\n", re, im ); - - y = stdlib_base_complex128_sub( v, v ); - stdlib_complex128_reim( y, &re, &im ); - printf( "csub(z, z) = %lf + %lfi\n", re, im ); - } -} -``` - -
- - - -
- - - - - - - - - - - - - - diff --git a/float64/base/sub/benchmark/benchmark.js b/float64/base/sub/benchmark/benchmark.js deleted file mode 100644 index fb081b5d..00000000 --- a/float64/base/sub/benchmark/benchmark.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var pkg = require( './../package.json' ).name; -var csub = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = csub( z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( real( out ) ) || isnan( imag( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/sub/benchmark/benchmark.native.js b/float64/base/sub/benchmark/benchmark.native.js deleted file mode 100644 index be872b4a..00000000 --- a/float64/base/sub/benchmark/benchmark.native.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); -var pkg = require( './../package.json' ).name; - - -// VARIABLES // - -var csub = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( csub instanceof Error ) -}; - - -// MAIN // - -bench( pkg+'::native', opts, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = csub( z, z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( real( out ) ) || isnan( imag( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/base/sub/benchmark/c/Makefile b/float64/base/sub/benchmark/c/Makefile deleted file mode 100644 index d7adc1ad..00000000 --- a/float64/base/sub/benchmark/c/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/sub/benchmark/c/benchmark.c b/float64/base/sub/benchmark/c/benchmark.c deleted file mode 100644 index 5c13a885..00000000 --- a/float64/base/sub/benchmark/c/benchmark.c +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include -#include -#include -#include - -#define NAME "csub" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double re; - double im; - double t; - int i; - - double complex z1; - double complex z2; - double complex z3; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z1 = re + im*I; - - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z2 = re + im*I; - - z3 = (creal(z1)-creal(z2)) + (cimag(z1)-cimag(z2))*I; - if ( z3 != z3 ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( z3 != z3 ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/base/sub/benchmark/c/native/Makefile b/float64/base/sub/benchmark/c/native/Makefile deleted file mode 100644 index 7f6bbc4c..00000000 --- a/float64/base/sub/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/sub/benchmark/c/native/benchmark.c b/float64/base/sub/benchmark/c/native/benchmark.c deleted file mode 100644 index dfa78766..00000000 --- a/float64/base/sub/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,148 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/sub.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include -#include -#include -#include -#include -#include - -#define NAME "csub" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double re; - double im; - double t; - int i; - - stdlib_complex128_t z1; - stdlib_complex128_t z2; - stdlib_complex128_t z3; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z1 = stdlib_complex128( re, im ); - - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z2 = stdlib_complex128( re, im ); - - z3 = stdlib_base_complex128_sub( z1, z2 ); - stdlib_complex128_reim( z3, &re, &im ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/base/sub/benchmark/julia/REQUIRE b/float64/base/sub/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float64/base/sub/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float64/base/sub/benchmark/julia/benchmark.jl b/float64/base/sub/benchmark/julia/benchmark.jl deleted file mode 100644 index d6670d27..00000000 --- a/float64/base/sub/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "csub"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark ComplexF64( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) - ComplexF64( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float64/base/sub/binding.gyp b/float64/base/sub/binding.gyp deleted file mode 100644 index f2b466ae..00000000 --- a/float64/base/sub/binding.gyp +++ /dev/null @@ -1,170 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A `.gyp` file for building a Node.js native add-on. -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # List of files to include in this file: - 'includes': [ - './include.gypi', - ], - - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Target name should match the add-on export name: - 'addon_target_name%': 'addon', - - # Set variables based on the host OS: - 'conditions': [ - [ - 'OS=="win"', - { - # Define the object file suffix: - 'obj': 'obj', - }, - { - # Define the object file suffix: - 'obj': 'o', - } - ], # end condition (OS=="win") - ], # end conditions - }, # end variables - - # Define compile targets: - 'targets': [ - - # Target to generate an add-on: - { - # The target name should match the add-on export name: - 'target_name': '<(addon_target_name)', - - # Define dependencies: - 'dependencies': [], - - # Define directories which contain relevant include headers: - 'include_dirs': [ - # Local include directory: - '<@(include_dirs)', - ], - - # List of source files: - 'sources': [ - '<@(src_files)', - ], - - # Settings which should be applied when a target's object files are used as linker input: - 'link_settings': { - # Define libraries: - 'libraries': [ - '<@(libraries)', - ], - - # Define library directories: - 'library_dirs': [ - '<@(library_dirs)', - ], - }, - - # C/C++ compiler flags: - 'cflags': [ - # Enable commonly used warning options: - '-Wall', - - # Aggressive optimization: - '-O3', - ], - - # C specific compiler flags: - 'cflags_c': [ - # Specify the C standard to which a program is expected to conform: - '-std=c99', - ], - - # C++ specific compiler flags: - 'cflags_cpp': [ - # Specify the C++ standard to which a program is expected to conform: - '-std=c++11', - ], - - # Linker flags: - 'ldflags': [], - - # Apply conditions based on the host OS: - 'conditions': [ - [ - 'OS=="mac"', - { - # Linker flags: - 'ldflags': [ - '-undefined dynamic_lookup', - '-Wl,-no-pie', - '-Wl,-search_paths_first', - ], - }, - ], # end condition (OS=="mac") - [ - 'OS!="win"', - { - # C/C++ flags: - 'cflags': [ - # Generate platform-independent code: - '-fPIC', - ], - }, - ], # end condition (OS!="win") - ], # end conditions - }, # end target <(addon_target_name) - - # Target to copy a generated add-on to a standard location: - { - 'target_name': 'copy_addon', - - # Declare that the output of this target is not linked: - 'type': 'none', - - # Define dependencies: - 'dependencies': [ - # Require that the add-on be generated before building this target: - '<(addon_target_name)', - ], - - # Define a list of actions: - 'actions': [ - { - 'action_name': 'copy_addon', - 'message': 'Copying addon...', - - # Explicitly list the inputs in the command-line invocation below: - 'inputs': [], - - # Declare the expected outputs: - 'outputs': [ - '<(addon_output_dir)/<(addon_target_name).node', - ], - - # Define the command-line invocation: - 'action': [ - 'cp', - '<(PRODUCT_DIR)/<(addon_target_name).node', - '<(addon_output_dir)/<(addon_target_name).node', - ], - }, - ], # end actions - }, # end target copy_addon - ], # end targets -} diff --git a/float64/base/sub/docs/repl.txt b/float64/base/sub/docs/repl.txt deleted file mode 100644 index 25298ea2..00000000 --- a/float64/base/sub/docs/repl.txt +++ /dev/null @@ -1,33 +0,0 @@ - -{{alias}}( z1, z2 ) - Subtracts two double-precision complex floating-point numbers. - - Parameters - ---------- - z1: Complex128 - Complex number. - - z2: Complex128 - Complex number. - - Returns - ------- - out: Complex128 - Result. - - Examples - -------- - > var z1 = new {{alias:@stdlib/complex/float64/ctor}}( 5.0, 3.0 ) - - > var z2 = new {{alias:@stdlib/complex/float64/ctor}}( -2.0, 1.0 ) - - > var out = {{alias}}( z1, z2 ) - - > var re = {{alias:@stdlib/complex/float64/real}}( out ) - 7.0 - > var im = {{alias:@stdlib/complex/float64/imag}}( out ) - 2.0 - - See Also - -------- - diff --git a/float64/base/sub/docs/types/index.d.ts b/float64/base/sub/docs/types/index.d.ts deleted file mode 100644 index d07c5dbc..00000000 --- a/float64/base/sub/docs/types/index.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex128 } from '@stdlib/types/complex'; - -/** -* Subtracts two double-precision complex floating-point numbers. -* -* @param z1 - complex number -* @param z2 - complex number -* @returns result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( -2.0, 1.0 ); -* -* var out = csub( z1, z2 ); -* // returns [ 7.0, 2.0 ] -*/ -declare function csub( z1: Complex128, z2: Complex128 ): Complex128; - - -// EXPORTS // - -export = csub; diff --git a/float64/base/sub/docs/types/test.ts b/float64/base/sub/docs/types/test.ts deleted file mode 100644 index ca87800d..00000000 --- a/float64/base/sub/docs/types/test.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../../float64/ctor' ); -import csub = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - csub( z, z ); // $ExpectType Complex128 -} - -// The compiler throws an error if the function is provided a first argument which is not a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - csub( true, z ); // $ExpectError - csub( false, z ); // $ExpectError - csub( null, z ); // $ExpectError - csub( undefined, z ); // $ExpectError - csub( '5', z ); // $ExpectError - csub( [], z ); // $ExpectError - csub( {}, z ); // $ExpectError - csub( ( x: number ): number => x, z ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument which is not a complex number... -{ - const z = new Complex128( 1.0, 1.0 ); - - csub( z, true ); // $ExpectError - csub( z, false ); // $ExpectError - csub( z, null ); // $ExpectError - csub( z, undefined ); // $ExpectError - csub( z, '5' ); // $ExpectError - csub( z, [] ); // $ExpectError - csub( z, {} ); // $ExpectError - csub( z, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const z = new Complex128( 1.0, 1.0 ); - - csub(); // $ExpectError - csub( z ); // $ExpectError - csub( z, z, z ); // $ExpectError -} diff --git a/float64/base/sub/examples/c/Makefile b/float64/base/sub/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float64/base/sub/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/base/sub/examples/c/example.c b/float64/base/sub/examples/c/example.c deleted file mode 100644 index 98582203..00000000 --- a/float64/base/sub/examples/c/example.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/sub.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 3.14, 1.5 ), - stdlib_complex128( -3.14, 1.5 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - stdlib_complex128_t y; - double re; - double im; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - stdlib_complex128_reim( v, &re, &im ); - printf( "z = %lf + %lfi\n", re, im ); - - y = stdlib_base_complex128_sub( v, v ); - stdlib_complex128_reim( y, &re, &im ); - printf( "csub(z, z) = %lf + %lfi\n", re, im ); - } -} diff --git a/float64/base/sub/examples/index.js b/float64/base/sub/examples/index.js deleted file mode 100644 index f97ff9b9..00000000 --- a/float64/base/sub/examples/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128Array = require( '@stdlib/array/complex128' ); -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var logEachMap = require( '@stdlib/console/log-each-map' ); -var csub = require( './../lib' ); - -// Generate arrays of random values: -var z1 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); -var z2 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); - -// Perform element-wise subtraction: -logEachMap( '(%s) - (%s) = %s', z1, z2, csub ); diff --git a/float64/base/sub/include.gypi b/float64/base/sub/include.gypi deleted file mode 100644 index 78db9faf..00000000 --- a/float64/base/sub/include.gypi +++ /dev/null @@ -1,53 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A GYP include file for building a Node.js native add-on. -# -# Main documentation: -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Source directory: - 'src_dir': './src', - - # Include directories: - 'include_dirs': [ - '[ 7.0, 2.0 ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float64/base/sub/lib/main.js b/float64/base/sub/lib/main.js deleted file mode 100644 index 7135c402..00000000 --- a/float64/base/sub/lib/main.js +++ /dev/null @@ -1,55 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); - - -// MAIN // - -/** -* Subtracts two double-precision complex floating-point numbers. -* -* @param {Complex128} z1 - complex number -* @param {Complex128} z2 - complex number -* @returns {Complex128} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( -2.0, 1.0 ); -* -* var out = csub( z1, z2 ); -* // returns [ 7.0, 2.0 ] -*/ -function csub( z1, z2 ) { - var re = real( z1 ) - real( z2 ); - var im = imag( z1 ) - imag( z2 ); - return new Complex128( re, im ); -} - - -// EXPORTS // - -module.exports = csub; diff --git a/float64/base/sub/lib/native.js b/float64/base/sub/lib/native.js deleted file mode 100644 index ca98caf6..00000000 --- a/float64/base/sub/lib/native.js +++ /dev/null @@ -1,54 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex128 = require( './../../../../float64/ctor' ); -var addon = require( './../src/addon.node' ); - - -// MAIN // - -/** -* Subtracts two double-precision complex floating-point numbers. -* -* @private -* @param {Complex128} z1 - complex number -* @param {Complex128} z2 - complex number -* @returns {Complex128} result -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z1 = new Complex128( 5.0, 3.0 ); -* var z2 = new Complex128( -2.0, 1.0 ); -* -* var out = csub( z1, z2 ); -* // returns [ 7.0, 2.0 ] -*/ -function csub( z1, z2 ) { - var v = addon( z1, z2 ); - return new Complex128( v.re, v.im ); -} - - -// EXPORTS // - -module.exports = csub; diff --git a/float64/base/sub/manifest.json b/float64/base/sub/manifest.json deleted file mode 100644 index 48efffba..00000000 --- a/float64/base/sub/manifest.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/napi/binary", - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/reim" - ] - } - ] -} diff --git a/float64/base/sub/package.json b/float64/base/sub/package.json deleted file mode 100644 index e89aa963..00000000 --- a/float64/base/sub/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "@stdlib/complex/float64/base/sub", - "version": "0.0.0", - "description": "Subtract two double-precision complex floating-point numbers.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "csubtract", - "subtract", - "sub", - "csub", - "subtraction", - "difference", - "sum", - "arithmetic", - "complex", - "cmplx", - "number" - ] -} diff --git a/float64/base/sub/src/Makefile b/float64/base/sub/src/Makefile deleted file mode 100644 index 904c7dc4..00000000 --- a/float64/base/sub/src/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2023 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - - -# RULES # - -#/ -# Removes generated files for building an add-on. -# -# @example -# make clean-addon -#/ -clean-addon: - $(QUIET) -rm -f *.o *.node - -.PHONY: clean-addon - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: clean-addon - -.PHONY: clean diff --git a/float64/base/sub/src/addon.c b/float64/base/sub/src/addon.c deleted file mode 100644 index 1136f844..00000000 --- a/float64/base/sub/src/addon.c +++ /dev/null @@ -1,22 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/sub.h" -#include "stdlib/math/base/napi/binary.h" - -STDLIB_MATH_BASE_NAPI_MODULE_ZZ_Z( stdlib_base_complex128_sub ) diff --git a/float64/base/sub/src/main.c b/float64/base/sub/src/main.c deleted file mode 100644 index c62cb989..00000000 --- a/float64/base/sub/src/main.c +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/base/sub.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/reim.h" - -/** -* Subtracts two double-precision complex floating-point numbers. -* -* @param z1 input value -* @param z2 input value -* @return result -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* #include "stdlib/complex/float64/real.h" -* #include "stdlib/complex/float64/imag.h" -* -* stdlib_complex128_t z1 = stdlib_complex128( 5.0, 3.0 ); -* stdlib_complex128_t z2 = stdlib_complex128( -2.0, 1.0 ); -* -* stdlib_complex128_t out = stdlib_base_complex128_sub( z1, z2 ); -* -* double re = stdlib_complex128_real( out ); -* // returns 7.0 -* -* double im = stdlib_complex128_imag( out ); -* // returns 2.0 -*/ -stdlib_complex128_t stdlib_base_complex128_sub( const stdlib_complex128_t z1, const stdlib_complex128_t z2 ) { - double re1; - double re2; - double im1; - double im2; - double re; - double im; - - stdlib_complex128_reim( z1, &re1, &im1 ); - stdlib_complex128_reim( z2, &re2, &im2 ); - - re = re1 - re2; - im = im1 - im2; - - return stdlib_complex128( re, im ); -} diff --git a/float64/base/sub/test/test.js b/float64/base/sub/test/test.js deleted file mode 100644 index bf45ad97..00000000 --- a/float64/base/sub/test/test.js +++ /dev/null @@ -1,110 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var csub = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof csub, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function subtracts two complex numbers', function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - - v = csub( z1, z2 ); - - t.strictEqual( real( v ), 7.0, 'returns expected value' ); - t.strictEqual( imag( v ), 2.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the resulting component is `NaN`', function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - - v = csub( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 2.0, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - - v = csub( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 2.0, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - - v = csub( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 2.0, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, 1.0 ); - - v = csub( z1, z2 ); - t.strictEqual( real( v ), 7.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, NaN ); - - v = csub( z1, z2 ); - t.strictEqual( real( v ), 7.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, NaN ); - - v = csub( z1, z2 ); - t.strictEqual( real( v ), 7.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - - v = csub( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/sub/test/test.native.js b/float64/base/sub/test/test.native.js deleted file mode 100644 index fd9232a4..00000000 --- a/float64/base/sub/test/test.native.js +++ /dev/null @@ -1,119 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var tape = require( 'tape' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../../float64/ctor' ); -var real = require( './../../../../float64/real' ); -var imag = require( './../../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var csub = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( csub instanceof Error ) -}; - - -// TESTS // - -tape( 'main export is a function', opts, function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof csub, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function subtracts two complex numbers', opts, function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - - v = csub( z1, z2 ); - - t.strictEqual( real( v ), 7.0, 'returns expected value' ); - t.strictEqual( imag( v ), 2.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'if a real or imaginary component is `NaN`, the resulting component is `NaN`', opts, function test( t ) { - var z1; - var z2; - var v; - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( -2.0, 1.0 ); - - v = csub( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 2.0, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - - v = csub( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 2.0, 'returns expected value' ); - - z1 = new Complex128( NaN, 3.0 ); - z2 = new Complex128( NaN, 1.0 ); - - v = csub( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( imag( v ), 2.0, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, 1.0 ); - - v = csub( z1, z2 ); - t.strictEqual( real( v ), 7.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, 3.0 ); - z2 = new Complex128( -2.0, NaN ); - - v = csub( z1, z2 ); - t.strictEqual( real( v ), 7.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( 5.0, NaN ); - z2 = new Complex128( -2.0, NaN ); - - v = csub( z1, z2 ); - t.strictEqual( real( v ), 7.0, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - z1 = new Complex128( NaN, NaN ); - z2 = new Complex128( NaN, NaN ); - - v = csub( z1, z2 ); - t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/base/test/test.js b/float64/base/test/test.js deleted file mode 100644 index 2fbefe9d..00000000 --- a/float64/base/test/test.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - - -// TESTS // - -tape( 'main export is an object', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ns, 'object', 'main export is an object' ); - t.end(); -}); - -tape( 'the exported object contains key-value pairs', function test( t ) { - var keys = objectKeys( ns ); - t.strictEqual( keys.length > 0, true, 'has keys' ); - t.end(); -}); diff --git a/float64/conj/README.md b/float64/conj/README.md deleted file mode 100644 index 0f042cf3..00000000 --- a/float64/conj/README.md +++ /dev/null @@ -1,255 +0,0 @@ - - -# conj - -> Return the [complex conjugate][complex-conjugate] of a double-precision complex floating-point number. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var conj = require( '@stdlib/complex/float64/conj' ); -``` - -#### conj( z ) - -Returns the [complex conjugate][complex-conjugate] of a double-precision complex floating-point number. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z = new Complex128( 5.0, 3.0 ); - -var v = conj( z ); -// returns [ 5.0, -3.0 ] -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - - - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var conj = require( '@stdlib/complex/float64/conj' ); - -function random() { - return new Complex128( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); -} - -// Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex128', random ); -// returns - -// Compute the complex conjugate of each complex number... -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); - console.log( 'conj(%s) = %s', z.toString(), conj( z ).toString() ); -} -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float64/conj.h" -``` - -#### stdlib_complex128_conj( z ) - -Returns the [complex conjugate][complex-conjugate] of a double-precision complex floating-point number. - -```c -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/imag.h" - -stdlib_complex128_t z = stdlib_complex128( 5.0, 2.0 ); - -// ... - -stdlib_complex128_t v = stdlib_complex128_conj( z ); - -double re = stdlib_complex128_real( v ); -// returns 5.0 - -double im = stdlib_complex128_imag( v ); -// returns -2.0 -``` - -The function accepts the following arguments: - -- **z**: `[in] stdlib_complex128_t` double-precision complex floating-point number. - -```c -stdlib_complex128_t stdlib_complex128_conj( const stdlib_complex128_t z ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float64/conj.h" -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/imag.h" -#include "stdlib/complex/float64/ctor.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t z; - stdlib_complex128_t v; - int i; - for ( i = 0; i < 4; i++ ) { - z = x[ i ]; - v = stdlib_complex128_conj( z ); - printf( "conj(%lf + %lfi) = %lf + %lfi\n", stdlib_complex128_real( z ), stdlib_complex128_imag( z ), stdlib_complex128_real( v ), stdlib_complex128_imag( v ) ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float64/conj/benchmark/benchmark.js b/float64/conj/benchmark/benchmark.js deleted file mode 100644 index 7944d71e..00000000 --- a/float64/conj/benchmark/benchmark.js +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex128 = require( './../../../float64/ctor' ); -var isComplex128 = require( '@stdlib/assert/is-complex128' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var pkg = require( './../package.json' ).name; -var conj = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var z; - var y; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - y = conj( z ); - if ( typeof y !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isComplex128( y ) ) { - b.fail( 'should return a complex number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/conj/benchmark/benchmark.native.js b/float64/conj/benchmark/benchmark.native.js deleted file mode 100644 index 918f6e2e..00000000 --- a/float64/conj/benchmark/benchmark.native.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var Complex128 = require( './../../../float64/ctor' ); -var real = require( './../../../float64/real' ); -var imag = require( './../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); -var pkg = require( './../package.json' ).name; - - -// VARIABLES // - -var conj = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( conj instanceof Error ) -}; - - -// MAIN // - -bench( pkg+'::native', opts, function benchmark( b ) { - var values; - var out; - var z; - var i; - - values = [ - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), - new Complex128( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = values[ i%values.length ]; - out = conj( z ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( isnan( real( out ) ) || isnan( imag( out ) ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/conj/benchmark/c/Makefile b/float64/conj/benchmark/c/Makefile deleted file mode 100644 index d7adc1ad..00000000 --- a/float64/conj/benchmark/c/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/conj/benchmark/c/benchmark.c b/float64/conj/benchmark/c/benchmark.c deleted file mode 100644 index 65030113..00000000 --- a/float64/conj/benchmark/c/benchmark.c +++ /dev/null @@ -1,137 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include -#include -#include -#include - -#define NAME "conj" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double re; - double im; - double t; - int i; - - double complex z; - double complex v; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = rand_double(); - im = rand_double(); - z = re + im*I; - v = conj( z ); - if ( v != v ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( v != v ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/conj/benchmark/c/native/Makefile b/float64/conj/benchmark/c/native/Makefile deleted file mode 100644 index 7f6bbc4c..00000000 --- a/float64/conj/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/conj/benchmark/c/native/benchmark.c b/float64/conj/benchmark/c/native/benchmark.c deleted file mode 100644 index f490c250..00000000 --- a/float64/conj/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,143 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/conj.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/imag.h" -#include -#include -#include -#include -#include -#include - -#define NAME "complex128_conj" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - stdlib_complex128_t z; - stdlib_complex128_t v; - double elapsed; - double re; - double im; - double t; - int i; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = rand_double(); - im = rand_double(); - z = stdlib_complex128( re, im ); - v = stdlib_complex128_conj( z ); - re = stdlib_complex128_real( v ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - im = stdlib_complex128_imag( v ); - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/conj/benchmark/julia/REQUIRE b/float64/conj/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float64/conj/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float64/conj/benchmark/julia/benchmark.jl b/float64/conj/benchmark/julia/benchmark.jl deleted file mode 100644 index d956d374..00000000 --- a/float64/conj/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "conj"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark conj( ComplexF64( rand(), rand() ) ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float64/conj/binding.gyp b/float64/conj/binding.gyp deleted file mode 100644 index 68a1ca11..00000000 --- a/float64/conj/binding.gyp +++ /dev/null @@ -1,170 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A `.gyp` file for building a Node.js native add-on. -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # List of files to include in this file: - 'includes': [ - './include.gypi', - ], - - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Target name should match the add-on export name: - 'addon_target_name%': 'addon', - - # Set variables based on the host OS: - 'conditions': [ - [ - 'OS=="win"', - { - # Define the object file suffix: - 'obj': 'obj', - }, - { - # Define the object file suffix: - 'obj': 'o', - } - ], # end condition (OS=="win") - ], # end conditions - }, # end variables - - # Define compile targets: - 'targets': [ - - # Target to generate an add-on: - { - # The target name should match the add-on export name: - 'target_name': '<(addon_target_name)', - - # Define dependencies: - 'dependencies': [], - - # Define directories which contain relevant include headers: - 'include_dirs': [ - # Local include directory: - '<@(include_dirs)', - ], - - # List of source files: - 'sources': [ - '<@(src_files)', - ], - - # Settings which should be applied when a target's object files are used as linker input: - 'link_settings': { - # Define libraries: - 'libraries': [ - '<@(libraries)', - ], - - # Define library directories: - 'library_dirs': [ - '<@(library_dirs)', - ], - }, - - # C/C++ compiler flags: - 'cflags': [ - # Enable commonly used warning options: - '-Wall', - - # Aggressive optimization: - '-O3', - ], - - # C specific compiler flags: - 'cflags_c': [ - # Specify the C standard to which a program is expected to conform: - '-std=c99', - ], - - # C++ specific compiler flags: - 'cflags_cpp': [ - # Specify the C++ standard to which a program is expected to conform: - '-std=c++11', - ], - - # Linker flags: - 'ldflags': [], - - # Apply conditions based on the host OS: - 'conditions': [ - [ - 'OS=="mac"', - { - # Linker flags: - 'ldflags': [ - '-undefined dynamic_lookup', - '-Wl,-no-pie', - '-Wl,-search_paths_first', - ], - }, - ], # end condition (OS=="mac") - [ - 'OS!="win"', - { - # C/C++ flags: - 'cflags': [ - # Generate platform-independent code: - '-fPIC', - ], - }, - ], # end condition (OS!="win") - ], # end conditions - }, # end target <(addon_target_name) - - # Target to copy a generated add-on to a standard location: - { - 'target_name': 'copy_addon', - - # Declare that the output of this target is not linked: - 'type': 'none', - - # Define dependencies: - 'dependencies': [ - # Require that the add-on be generated before building this target: - '<(addon_target_name)', - ], - - # Define a list of actions: - 'actions': [ - { - 'action_name': 'copy_addon', - 'message': 'Copying addon...', - - # Explicitly list the inputs in the command-line invocation below: - 'inputs': [], - - # Declare the expected outputs: - 'outputs': [ - '<(addon_output_dir)/<(addon_target_name).node', - ], - - # Define the command-line invocation: - 'action': [ - 'cp', - '<(PRODUCT_DIR)/<(addon_target_name).node', - '<(addon_output_dir)/<(addon_target_name).node', - ], - }, - ], # end actions - }, # end target copy_addon - ], # end targets -} diff --git a/float64/conj/docs/repl.txt b/float64/conj/docs/repl.txt deleted file mode 100644 index 59a86473..00000000 --- a/float64/conj/docs/repl.txt +++ /dev/null @@ -1,27 +0,0 @@ - -{{alias}}( z ) - Returns the complex conjugate of a double-precision complex floating-point - number. - - Parameters - ---------- - z: Complex128 - Complex number. - - Returns - ------- - out: Complex128 - Complex conjugate. - - Examples - -------- - > var z = new {{alias:@stdlib/complex/float64/ctor}}( 5.0, 3.0 ); - > z.toString() - '5 + 3i' - > var v = {{alias}}( z ); - > v.toString() - '5 - 3i' - - See Also - -------- - diff --git a/float64/conj/docs/types/index.d.ts b/float64/conj/docs/types/index.d.ts deleted file mode 100644 index 8c6b2fde..00000000 --- a/float64/conj/docs/types/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -import Complex128 = require( './../../../../float64/ctor' ); - -/** -* Returns the complex conjugate of a double-precision complex floating-point number. -* -* @param z - complex number -* @returns complex conjugate -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var v = conj( z ); -* // returns [ 5.0, -3.0 ] -*/ -declare function conj( z: Complex128 ): Complex128; - - -// EXPORTS // - -export = conj; diff --git a/float64/conj/docs/types/test.ts b/float64/conj/docs/types/test.ts deleted file mode 100644 index 38164dbf..00000000 --- a/float64/conj/docs/types/test.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../float64/ctor' ); -import conj = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - conj( new Complex128( 5.0, 3.0 ) ); // $ExpectType Complex128 -} - -// The compiler throws an error if the function is provided an argument that is not a complex number... -{ - conj( 'abc' ); // $ExpectError - conj( 123 ); // $ExpectError - conj( true ); // $ExpectError - conj( false ); // $ExpectError - conj( [] ); // $ExpectError - conj( {} ); // $ExpectError - conj( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - conj(); // $ExpectError - conj( new Complex128( 5.0, 3.0 ), 123 ); // $ExpectError -} diff --git a/float64/conj/examples/c/Makefile b/float64/conj/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float64/conj/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/conj/examples/c/example.c b/float64/conj/examples/c/example.c deleted file mode 100644 index bda70273..00000000 --- a/float64/conj/examples/c/example.c +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/conj.h" -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/imag.h" -#include "stdlib/complex/float64/ctor.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t z; - stdlib_complex128_t v; - int i; - for ( i = 0; i < 4; i++ ) { - z = x[ i ]; - v = stdlib_complex128_conj( z ); - printf( "conj(%lf + %lfi) = %lf + %lfi\n", stdlib_complex128_real( z ), stdlib_complex128_imag( z ), stdlib_complex128_real( v ), stdlib_complex128_imag( v ) ); - } -} diff --git a/float64/conj/examples/index.js b/float64/conj/examples/index.js deleted file mode 100644 index 5e398495..00000000 --- a/float64/conj/examples/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128 = require( './../../../float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var conj = require( './../lib' ); - -function random() { - return new Complex128( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); // eslint-disable-line max-len -} - -// Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex128', random ); -// returns - -// Compute the complex conjugate of each complex number... -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); - console.log( 'conj(%s) = %s', z.toString(), conj( z ).toString() ); -} diff --git a/float64/conj/include.gypi b/float64/conj/include.gypi deleted file mode 100644 index ecfaf82a..00000000 --- a/float64/conj/include.gypi +++ /dev/null @@ -1,53 +0,0 @@ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A GYP include file for building a Node.js native add-on. -# -# Main documentation: -# -# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md -# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md -{ - # Define variables to be used throughout the configuration for all targets: - 'variables': { - # Source directory: - 'src_dir': './src', - - # Include directories: - 'include_dirs': [ - '[ 5.0, -3.0 ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float64/conj/lib/main.js b/float64/conj/lib/main.js deleted file mode 100644 index 008a44bf..00000000 --- a/float64/conj/lib/main.js +++ /dev/null @@ -1,48 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var real = require( './../../../float64/real' ); -var imag = require( './../../../float64/imag' ); -var Complex128 = require( './../../../float64/ctor' ); - -/** -* Returns the complex conjugate of a double-precision complex floating-point number. -* -* @param {Complex128} z - complex number -* @returns {Complex128} complex conjugate -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var v = conj( z ); -* // returns [ 5.0, -3.0 ] -*/ -function conj( z ) { - return new Complex128( real( z ), -imag( z ) ); -} - - -// EXPORTS // - -module.exports = conj; diff --git a/float64/conj/lib/native.js b/float64/conj/lib/native.js deleted file mode 100644 index 4c582a8b..00000000 --- a/float64/conj/lib/native.js +++ /dev/null @@ -1,52 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex128 = require( './../../../float64/ctor' ); -var addon = require( './../src/addon.node' ); - - -// MAIN // - -/** -* Returns the complex conjugate of a double-precision complex floating-point number. -* -* @private -* @param {Complex128} z - complex number -* @returns {Complex128} complex conjugate -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var v = conj( z ); -* // returns [ 5.0, -3.0 ] -*/ -function conj( z ) { - var v = addon( z ); - return new Complex128( v.re, v.im ); -} - - -// EXPORTS // - -module.exports = conj; diff --git a/float64/conj/manifest.json b/float64/conj/manifest.json deleted file mode 100644 index 5ce0235f..00000000 --- a/float64/conj/manifest.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/napi/unary", - "@stdlib/complex/float64/ctor" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/real", - "@stdlib/complex/float64/imag" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor", - "@stdlib/complex/float64/real", - "@stdlib/complex/float64/imag" - ] - } - ] -} diff --git a/float64/conj/package.json b/float64/conj/package.json deleted file mode 100644 index 891e1b84..00000000 --- a/float64/conj/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "@stdlib/complex/float64/conj", - "version": "0.0.0", - "description": "Return the complex conjugate of a double-precision complex floating-point number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "number", - "conjugate", - "conj" - ] -} diff --git a/float64/conj/src/Makefile b/float64/conj/src/Makefile deleted file mode 100644 index 7733b618..00000000 --- a/float64/conj/src/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2025 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - - -# RULES # - -#/ -# Removes generated files for building an add-on. -# -# @example -# make clean-addon -#/ -clean-addon: - $(QUIET) -rm -f *.o *.node - -.PHONY: clean-addon - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: clean-addon - -.PHONY: clean diff --git a/float64/conj/src/addon.c b/float64/conj/src/addon.c deleted file mode 100644 index f63541a9..00000000 --- a/float64/conj/src/addon.c +++ /dev/null @@ -1,22 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/conj.h" -#include "stdlib/math/base/napi/unary.h" - -STDLIB_MATH_BASE_NAPI_MODULE_Z_Z( stdlib_complex128_conj ) diff --git a/float64/conj/src/main.c b/float64/conj/src/main.c deleted file mode 100644 index 83e590be..00000000 --- a/float64/conj/src/main.c +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/conj.h" -#include "stdlib/complex/float64/ctor.h" - -/** -* Returns the complex conjugate of a double-precision complex floating-point number. -* -* @param z double-precision complex floating-point number -* @return complex conjugate -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* #include "stdlib/complex/float64/real.h" -* #include "stdlib/complex/float64/imag.h" -* -* stdlib_complex128_t z = stdlib_complex128( 5.0, 2.0 ); -* -* // ... -* -* stdlib_complex128_t v = stdlib_complex128_conj( z ); -* -* double re = stdlib_complex128_real( v ); -* // returns 5.0 -* -* double im = stdlib_complex128_imag( v ); -* // returns -2.0 -*/ -stdlib_complex128_t stdlib_complex128_conj( const stdlib_complex128_t z ) { - stdlib_complex128_parts_t v; - v.value = z; // cppcheck-suppress unreadVariable - return stdlib_complex128( v.parts[ 0 ], -v.parts[ 1 ] ); -} diff --git a/float64/conj/test/test.js b/float64/conj/test/test.js deleted file mode 100644 index ad4cc0c6..00000000 --- a/float64/conj/test/test.js +++ /dev/null @@ -1,137 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' ); -var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' ); -var Complex128 = require( './../../../float64/ctor' ); -var real = require( './../../../float64/real' ); -var imag = require( './../../../float64/imag' ); -var conj = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof conj, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns the complex conjugate of a complex number', function test( t ) { - var actual; - var z; - - z = new Complex128( -4.2, 5.5 ); - actual = conj( z ); - - t.strictEqual( real( actual ), -4.2, 'returns expected value' ); - t.strictEqual( imag( actual ), -5.5, 'returns expected value' ); - - z = new Complex128( 9.99999, 0.1 ); - actual = conj( z ); - - t.strictEqual( real( actual ), 9.99999, 'returns expected value' ); - t.strictEqual( imag( actual ), -0.1, 'returns expected value' ); - - z = new Complex128( 4.0, 7.0 ); - actual = conj( z ); - - t.strictEqual( real( actual ), 4.0, 'returns expected value' ); - t.strictEqual( imag( actual ), -7.0, 'returns expected value' ); - - z = new Complex128( -4.0, -7.0 ); - actual = conj( z ); - - t.strictEqual( real( actual ), -4.0, 'returns expected value' ); - t.strictEqual( imag( actual ), 7.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `NaN` if provided `NaN`', function test( t ) { - var actual; - var z; - - z = new Complex128( NaN, NaN ); - actual = conj( z ); - - t.strictEqual( isnan( real( actual ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( actual ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `+0` if provided `-0`', function test( t ) { - var actual; - var z; - - z = new Complex128( -0.0, -0.0 ); - actual = conj( z ); - - t.strictEqual( isNegativeZero( real( actual ) ), true, 'returns expected value' ); - t.strictEqual( isPositiveZero( imag( actual ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `-0` if provided `+0`', function test( t ) { - var actual; - var z; - - z = new Complex128( +0.0, +0.0 ); - actual = conj( z ); - - t.strictEqual( isPositiveZero( real( actual ) ), true, 'returns expected value' ); - t.strictEqual( isNegativeZero( imag( actual ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `-infinity` if provided `+infinity`', function test( t ) { - var actual; - var z; - - z = new Complex128( PINF, PINF ); - actual = conj( z ); - - t.strictEqual( real( actual ), PINF, 'returns expected value' ); - t.strictEqual( imag( actual ), NINF, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `+infinity` if provided `-infinity`', function test( t ) { - var actual; - var z; - - z = new Complex128( NINF, NINF ); - actual = conj( z ); - - t.strictEqual( real( actual ), NINF, 'returns expected value' ); - t.strictEqual( imag( actual ), PINF, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/conj/test/test.native.js b/float64/conj/test/test.native.js deleted file mode 100644 index 03f2141e..00000000 --- a/float64/conj/test/test.native.js +++ /dev/null @@ -1,146 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; -var tape = require( 'tape' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' ); -var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' ); -var Complex128 = require( './../../../float64/ctor' ); -var real = require( './../../../float64/real' ); -var imag = require( './../../../float64/imag' ); -var tryRequire = require( '@stdlib/utils/try-require' ); - - -// VARIABLES // - -var conj = tryRequire( resolve( __dirname, './../lib/native.js' ) ); -var opts = { - 'skip': ( conj instanceof Error ) -}; - - -// TESTS // - -tape( 'main export is a function', opts, function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof conj, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns the complex conjugate of a complex number', opts, function test( t ) { - var actual; - var z; - - z = new Complex128( -4.2, 5.5 ); - actual = conj( z ); - - t.strictEqual( real( actual ), -4.2, 'returns expected value' ); - t.strictEqual( imag( actual ), -5.5, 'returns expected value' ); - - z = new Complex128( 9.99999, 0.1 ); - actual = conj( z ); - - t.strictEqual( real( actual ), 9.99999, 'returns expected value' ); - t.strictEqual( imag( actual ), -0.1, 'returns expected value' ); - - z = new Complex128( 4.0, 7.0 ); - actual = conj( z ); - - t.strictEqual( real( actual ), 4.0, 'returns expected value' ); - t.strictEqual( imag( actual ), -7.0, 'returns expected value' ); - - z = new Complex128( -4.0, -7.0 ); - actual = conj( z ); - - t.strictEqual( real( actual ), -4.0, 'returns expected value' ); - t.strictEqual( imag( actual ), 7.0, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `NaN` if provided `NaN`', opts, function test( t ) { - var actual; - var z; - - z = new Complex128( NaN, NaN ); - actual = conj( z ); - - t.strictEqual( isnan( real( actual ) ), true, 'returns expected value' ); - t.strictEqual( isnan( imag( actual ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `+0` if provided `-0`', opts, function test( t ) { - var actual; - var z; - - z = new Complex128( -0.0, -0.0 ); - actual = conj( z ); - - t.strictEqual( isNegativeZero( real( actual ) ), true, 'returns expected value' ); - t.strictEqual( isPositiveZero( imag( actual ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `-0` if provided `+0`', opts, function test( t ) { - var actual; - var z; - - z = new Complex128( +0.0, +0.0 ); - actual = conj( z ); - - t.strictEqual( isPositiveZero( real( actual ) ), true, 'returns expected value' ); - t.strictEqual( isNegativeZero( imag( actual ) ), true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `-infinity` if provided `+infinity`', opts, function test( t ) { - var actual; - var z; - - z = new Complex128( PINF, PINF ); - actual = conj( z ); - - t.strictEqual( real( actual ), PINF, 'returns expected value' ); - t.strictEqual( imag( actual ), NINF, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns `+infinity` if provided `-infinity`', opts, function test( t ) { - var actual; - var z; - - z = new Complex128( NINF, NINF ); - actual = conj( z ); - - t.strictEqual( real( actual ), NINF, 'returns expected value' ); - t.strictEqual( imag( actual ), PINF, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/ctor/README.md b/float64/ctor/README.md deleted file mode 100644 index 46a1bd54..00000000 --- a/float64/ctor/README.md +++ /dev/null @@ -1,617 +0,0 @@ - - -# Complex128 - -> 128-bit complex number. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -``` - -#### Complex128( real, imag ) - -128-bit complex number constructor, where `real` and `imag` are the **real** and **imaginary** components, respectively. - -```javascript -var z = new Complex128( 5.0, 3.0 ); -// returns -``` - -* * * - -## Properties - -#### Complex128.name - -Static property returning the constructor name. - -```javascript -var str = Complex128.name; -// returns 'Complex128' -``` - -#### Complex128.BYTES_PER_ELEMENT - -Size (in bytes) of each component. - -```javascript -var nbytes = Complex128.BYTES_PER_ELEMENT; -// returns 8 -``` - -#### Complex128.prototype.BYTES_PER_ELEMENT - -Size (in bytes) of each component. - -```javascript -var z = new Complex128( 5.0, 3.0 ); - -var nbytes = z.BYTES_PER_ELEMENT; -// returns 8 -``` - -#### Complex128.prototype.byteLength - -Length (in bytes) of a complex number. - -```javascript -var z = new Complex128( 5.0, 3.0 ); - -var nbytes = z.byteLength; -// returns 16 -``` - -### Instance - -A `Complex128` instance has the following properties... - -#### re - -A **read-only** property returning the **real** component. - -```javascript -var z = new Complex128( 5.0, 3.0 ); - -var re = z.re; -// returns 5.0 -``` - -#### im - -A **read-only** property returning the **imaginary** component. - -```javascript -var z = new Complex128( 5.0, -3.0 ); - -var im = z.im; -// returns -3.0 -``` - -* * * - -## Methods - -### Accessor Methods - -These methods do **not** mutate a `Complex128` instance and, instead, return a complex number representation. - -#### Complex128.prototype.toString() - -Returns a `string` representation of a `Complex128` instance. - -```javascript -var z = new Complex128( 5.0, 3.0 ); -var str = z.toString(); -// returns '5 + 3i' - -z = new Complex128( -5.0, -3.0 ); -str = z.toString(); -// returns '-5 - 3i' -``` - -#### Complex128.prototype.toJSON() - -Returns a [JSON][json] representation of a `Complex128` instance. [`JSON.stringify()`][mdn-json-stringify] implicitly calls this method when stringifying a `Complex128` instance. - -```javascript -var z = new Complex128( 5.0, -3.0 ); - -var o = z.toJSON(); -/* - { - "type": "Complex128", - "re": 5.0, - "im": -3.0 - } -*/ -``` - -To [revive][mdn-json-parse] a `Complex128` number from a [JSON][json] `string`, see [@stdlib/complex/float64/reviver][@stdlib/complex/float64/reviver]. - -
- - - -* * * - - - -
- -## Notes - -- Both the **real** and **imaginary** components are stored as double-precision floating-point numbers. - -
- - - -* * * - - - -
- -## Examples - - - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z = new Complex128( 3.0, -2.0 ); - -console.log( 'type: %s', typeof z ); -// => 'type: object' - -console.log( 'str: %s', z ); -// => 'str: 3 - 2i' - -console.log( 'real: %d', z.re ); -// => 'real: 3' - -console.log( 'imaginary: %d', z.im ); -// => 'imaginary: -2' - -console.log( 'JSON: %s', JSON.stringify( z ) ); -// => 'JSON: {"type":"Complex128","re":3,"im":-2}' -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float64/ctor.h" -``` - -#### stdlib_complex128_t - -An opaque type definition for a double-precision complex floating-point number. - -```c -stdlib_complex128_t z = stdlib_complex128( 5.0, 2.0 ); -``` - -#### stdlib_complex128_parts_t - -An opaque type definition for a union for accessing the real and imaginary parts of a double-precision complex floating-point number. - -```c -double real( const stdlib_complex128_t z ) { - stdlib_complex128_parts_t v; - - // Assign a double-precision complex floating-point number: - v.value = z; - - // Extract the real component: - double re = v.parts[ 0 ]; - - return re; -} - -// ... - -// Create a complex number: -stdlib_complex128_t z = stdlib_complex128( 5.0, 2.0 ); - -// ... - -// Access the real component: -double re = real( z ); -// returns 5.0 -``` - -The union has the following members: - -- **value**: `stdlib_complex128_t` double-precision complex floating-point number. - -- **parts**: `double[]` array having the following elements: - - - **0**: `double` real component. - - **1**: `double` imaginary component. - -#### stdlib_complex128( real, imag ) - -Returns a double-precision complex floating-point number. - -```c -stdlib_complex128_t z = stdlib_complex128( 5.0, 2.0 ); -``` - -The function accepts the following arguments: - -- **real**: `[in] double` real component. -- **imag**: `[in] double` imaginary component. - -```c -stdlib_complex128_t stdlib_complex128( const double real, const double imag ); -``` - -#### stdlib_complex128_from_float32( real ) - -Converts a single-precision floating-point number to a double-precision complex floating-point number. - -```c -stdlib_complex128_t z = stdlib_complex128_from_float32( 5.0f ); -``` - -The function accepts the following arguments: - -- **real**: `[in] float` real component. - -```c -stdlib_complex128_t stdlib_complex128_from_float32( const float real ); -``` - -#### stdlib_complex128_from_float64( real ) - -Converts a double-precision floating-point number to a double-precision complex floating-point number. - -```c -stdlib_complex128_t z = stdlib_complex128_from_float64( 5.0 ); -``` - -The function accepts the following arguments: - -- **real**: `[in] double` real component. - -```c -stdlib_complex128_t stdlib_complex128_from_float64( const double real ); -``` - -#### stdlib_complex128_from_complex64( z ) - -Converts a single-precision complex floating-point number to a double-precision complex floating-point number. - -```c -#include "stdlib/complex/float32/ctor.h" - -stdlib_complex64_t z1 = stdlib_complex64( 5.0f, 3.0f ); -stdlib_complex128_t z2 = stdlib_complex128_from_complex64( z1 ); -``` - -The function accepts the following arguments: - -- **z**: `[in] stdlib_complex64_t` single-precision complex floating-point number. - -```c -stdlib_complex128_t stdlib_complex128_from_complex64( const stdlib_complex64_t z ); -``` - -#### stdlib_complex128_from_complex128( z ) - -Converts (copies) a double-precision complex floating-point number to a double-precision complex floating-point number. - -```c -stdlib_complex128_t z1 = stdlib_complex128( 5.0, 3.0 ); -stdlib_complex128_t z2 = stdlib_complex128_from_complex128( z1 ); -``` - -The function accepts the following arguments: - -- **z**: `[in] stdlib_complex128_t` double-precision complex floating-point number. - -```c -stdlib_complex128_t stdlib_complex128_from_complex128( const stdlib_complex128_t z ); -``` - -#### stdlib_complex128_from_int8( real ) - -Converts a signed 8-bit integer to a double-precision complex floating-point number. - -```c -stdlib_complex128_t z = stdlib_complex128_from_int8( 5 ); -``` - -The function accepts the following arguments: - -- **real**: `[in] int8_t` real component. - -```c -stdlib_complex128_t stdlib_complex128_from_int8( const int8_t real ); -``` - -#### stdlib_complex128_from_uint8( real ) - -Converts an unsigned 8-bit integer to a double-precision complex floating-point number. - -```c -stdlib_complex128_t z = stdlib_complex128_from_uint8( 5 ); -``` - -The function accepts the following arguments: - -- **real**: `[in] uint8_t` real component. - -```c -stdlib_complex128_t stdlib_complex128_from_uint8( const uint8_t real ); -``` - -#### stdlib_complex128_from_int16( real ) - -Converts a signed 16-bit integer to a double-precision complex floating-point number. - -```c -stdlib_complex128_t z = stdlib_complex128_from_int16( 5 ); -``` - -The function accepts the following arguments: - -- **real**: `[in] int16_t` real component. - -```c -stdlib_complex128_t stdlib_complex128_from_int16( const int16_t real ); -``` - -#### stdlib_complex128_from_uint16( real ) - -Converts an unsigned 16-bit integer to a double-precision complex floating-point number. - -```c -stdlib_complex128_t z = stdlib_complex128_from_uint16( 5 ); -``` - -The function accepts the following arguments: - -- **real**: `[in] uint16_t` real component. - -```c -stdlib_complex128_t stdlib_complex128_from_uint16( const uint16_t real ); -``` - -#### stdlib_complex128_from_int32( real ) - -Converts a signed 32-bit integer to a double-precision complex floating-point number. - -```c -stdlib_complex128_t z = stdlib_complex128_from_int32( 5 ); -``` - -The function accepts the following arguments: - -- **real**: `[in] int32_t` real component. - -```c -stdlib_complex128_t stdlib_complex128_from_int32( const int32_t real ); -``` - -#### stdlib_complex128_from_uint32( real ) - -Converts an unsigned 32-bit integer to a double-precision complex floating-point number. - -```c -stdlib_complex128_t z = stdlib_complex128_from_uint32( 5 ); -``` - -The function accepts the following arguments: - -- **real**: `[in] uint32_t` real component. - -```c -stdlib_complex128_t stdlib_complex128_from_uint32( const uint32_t real ); -``` - -#### stdlib_complex128_to_complex64( z ) - -Converts a double-precision complex floating-point number to a single-precision complex floating-point number. - -```c -#include "stdlib/complex/float32/ctor.h" - -stdlib_complex128_t z1 = stdlib_complex128( 5.0, 3.0 ); -stdlib_complex64_t z2 = stdlib_complex128_to_complex64( z1 ); -``` - -The function accepts the following arguments: - -- **z**: `[in] stdlib_complex64_t` double-precision complex floating-point number. - -```c -stdlib_complex64_t stdlib_complex128_to_complex64( const stdlib_complex128_t z ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float64/ctor.h" -#include -#include - -/** -* Return the real component of a double-precision complex floating-point number. -* -* @param z complex number -* @return real component -*/ -static double real( const stdlib_complex128_t z ) { - stdlib_complex128_parts_t v; - - // Assign a double-precision complex floating-point number: - v.value = z; - - // Extract the real component: - double re = v.parts[ 0 ]; - - return re; -} - -/** -* Return the imaginary component of a double-precision complex floating-point number. -* -* @param z complex number -* @return imaginary component -*/ -static double imag( const stdlib_complex128_t z ) { - stdlib_complex128_parts_t v; - - // Assign a double-precision complex floating-point number: - v.value = z; - - // Extract the imaginary component: - double im = v.parts[ 1 ]; - - return im; -} - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - printf( "%lf + %lfi\n", real( v ), imag( v ) ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float64/ctor/benchmark/benchmark.js b/float64/ctor/benchmark/benchmark.js deleted file mode 100644 index c744615d..00000000 --- a/float64/ctor/benchmark/benchmark.js +++ /dev/null @@ -1,138 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var pkg = require( './../package.json' ).name; -var Complex128 = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var z; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - z = new Complex128( i, i ); - if ( isnan( z ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !( z instanceof Complex128 ) ) { - b.fail( 'should return a complex number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:real', function benchmark( b ) { - var re; - var z; - var i; - - z = new Complex128( randu(), randu() ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: this is likely to be optimized away due to loop invariant code motion. - re = z.re; - if ( isnan( re ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( re ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:imag', function benchmark( b ) { - var im; - var z; - var i; - - z = new Complex128( randu(), randu() ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: this is likely to be optimized away due to loop invariant code motion. - im = z.im; - if ( isnan( im ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( im ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':toString', function benchmark( b ) { - var o; - var z; - var i; - - z = new Complex128( randu(), randu() ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - o = z.toString(); - if ( typeof o !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof o !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':toJSON', function benchmark( b ) { - var o; - var z; - var i; - - z = new Complex128( randu(), randu() ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - o = z.toJSON(); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/ctor/benchmark/julia/REQUIRE b/float64/ctor/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float64/ctor/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float64/ctor/benchmark/julia/benchmark.jl b/float64/ctor/benchmark/julia/benchmark.jl deleted file mode 100644 index e2d019cd..00000000 --- a/float64/ctor/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "complex128"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark ComplexF64( rand(), rand() ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float64/ctor/benchmark/python/benchmark.py b/float64/ctor/benchmark/python/benchmark.py deleted file mode 100644 index 16e15dd5..00000000 --- a/float64/ctor/benchmark/python/benchmark.py +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env python -# -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Benchmark complex.""" - -from __future__ import print_function -import timeit - -NAME = "complex128" -REPEATS = 3 -ITERATIONS = 1000000 - - -def print_version(): - """Print the TAP version.""" - print("TAP version 13") - - -def print_summary(total, passing): - """Print the benchmark summary. - - # Arguments - - * `total`: total number of tests - * `passing`: number of passing tests - - """ - print("#") - print("1.." + str(total)) # TAP plan - print("# total " + str(total)) - print("# pass " + str(passing)) - print("#") - print("# ok") - - -def print_results(elapsed): - """Print benchmark results. - - # Arguments - - * `elapsed`: elapsed time (in seconds) - - # Examples - - ``` python - python> print_results(0.131009101868) - ``` - """ - rate = ITERATIONS / elapsed - - print(" ---") - print(" iterations: " + str(ITERATIONS)) - print(" elapsed: " + str(elapsed)) - print(" rate: " + str(rate)) - print(" ...") - - -def benchmark(): - """Run the benchmark and print benchmark results.""" - setup = "from random import random;" - stmt = "z = complex(random(), random())" - - t = timeit.Timer(stmt, setup=setup) - - print_version() - - for i in range(REPEATS): - print("# python::" + NAME) - elapsed = t.timeit(number=ITERATIONS) - print_results(elapsed) - print("ok " + str(i+1) + " benchmark finished") - - print_summary(REPEATS, REPEATS) - - -def main(): - """Run the benchmark.""" - benchmark() - - -if __name__ == "__main__": - main() diff --git a/float64/ctor/docs/repl.txt b/float64/ctor/docs/repl.txt deleted file mode 100644 index 0788a5c5..00000000 --- a/float64/ctor/docs/repl.txt +++ /dev/null @@ -1,84 +0,0 @@ - -{{alias}}( real, imag ) - 128-bit complex number constructor. - - Both the real and imaginary components are stored as double-precision - floating-point numbers. - - Parameters - ---------- - real: number - Real component. - - imag: number - Imaginary component. - - Returns - ------- - z: Complex128 - 128-bit complex number. - - z.re: number - Read-only property returning the real component. - - z.im: number - Read-only property returning the imaginary component. - - -{{alias}}.name - Constructor name. - - Examples - -------- - > var str = {{alias}}.name - 'Complex128' - - -{{alias}}.BYTES_PER_ELEMENT - Size (in bytes) of each component. - - Returns - ------- - v: integer - Size (in bytes) of each component. - - Examples - -------- - > var s = {{alias}}.BYTES_PER_ELEMENT - 8 - - -{{alias}}.prototype.BYTES_PER_ELEMENT - Size (in bytes) of each component. - - Returns - ------- - s: integer - Size (in bytes) of each component. - - Examples - -------- - > var z = new {{alias}}( 5.0, 3.0 ) - - > var s = z.BYTES_PER_ELEMENT - 8 - - -{{alias}}.prototype.byteLength - Length (in bytes) of a complex number. - - Returns - ------- - len: integer - Length (in bytes) of a complex number. - - Examples - -------- - > var z = new {{alias}}( 5.0, 3.0 ) - - > var s = z.byteLength - 16 - - See Also - -------- - diff --git a/float64/ctor/docs/types/index.d.ts b/float64/ctor/docs/types/index.d.ts deleted file mode 100644 index 4a6e5870..00000000 --- a/float64/ctor/docs/types/index.d.ts +++ /dev/null @@ -1,120 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/** -* 128-bit complex number. -*/ -declare class Complex128 { - /** - * 128-bit complex number constructor. - * - * @param real - real component - * @param imag - imaginary component - * @returns 128-bit complex number - * - * @example - * var z = new Complex128( 5.0, 3.0 ); - * // returns - */ - constructor( real: number, imag: number ); - - /** - * Constructor name. - * - * @example - * var str = Complex128.name; - * // returns 'Complex128' - */ - static readonly name: 'Complex128'; - - /** - * Read-only property returning the real component. - * - * @returns real component - */ - readonly re: number; - - /** - * Read-only property returning the imaginary component. - * - * @returns imaginary component - */ - readonly im: number; - - /** - * Size (in bytes) of each component. - * - * @returns size of each component - * - * @example - * var nbytes = Complex128.BYTES_PER_ELEMENT; - * // returns 8 - */ - readonly BYTES_PER_ELEMENT: 8; - - /** - * Length (in bytes) of a complex number. - * - * @returns byte length - * - * @example - * var z = new Complex128( 5.0, 3.0 ); - * - * var nbytes = z.byteLength; - * // returns 16 - */ - readonly byteLength: 16; - - /** - * Serializes a complex number as a string. - * - * @returns serialized complex number - * - * @example - * var z = new Complex128( 5.0, 3.0 ); - * - * var str = z.toString(); - * // returns '5 + 3i' - */ - toString(): string; - - /** - * Serializes a complex number as a JSON object. - * - * ## Notes - * - * - `JSON.stringify()` implicitly calls this method when stringifying a `Complex128` instance. - * - * - * @returns serialized complex number - * - * @example - * var z = new Complex128( 5.0, 3.0 ); - * - * var obj = z.toJSON(); - * // returns { 'type': 'Complex128', 're': 5.0, 'im': 3.0 } - */ - toJSON(): any; -} - - -// EXPORTS // - -export = Complex128; diff --git a/float64/ctor/docs/types/test.ts b/float64/ctor/docs/types/test.ts deleted file mode 100644 index 98f2e8b6..00000000 --- a/float64/ctor/docs/types/test.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './index' ); - - -// TESTS // - -// The function returns a 128-bit complex number with the expected properties... -{ - const x = new Complex128( 5.0, 3.0 ); // $ExpectType Complex128 - - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - x.im; // $ExpectType number - - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - x.re; // $ExpectType number - - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - x.BYTES_PER_ELEMENT; // $ExpectType 8 - - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - x.byteLength; // $ExpectType 16 -} - -// 128-bit complex number comes with a `toString` method to serialize a complex number as a string... -{ - const x = new Complex128( 5.0, 3.0 ); // $ExpectType Complex128 - - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - x.toString(); // $ExpectType string -} - -// 128-bit complex number comes with a `toJSON` method to serialize a complex number as a JSON object... -{ - const x = new Complex128( 5.0, 3.0 ); // $ExpectType Complex128 - - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - x.toJSON(); // $ExpectType any -} - -// The compiler throws an error if the constructor is invoked without the `new` keyword... -{ - Complex128( 5.0, 3.0 ); // $ExpectError -} - -// The compiler throws an error if the constructor is provided an unsupported number of arguments... -{ - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - new Complex128( 5.0 ); // $ExpectError - - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - new Complex128( 5.0, 3.0, 1.0 ); // $ExpectError -} diff --git a/float64/ctor/examples/c/Makefile b/float64/ctor/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float64/ctor/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/ctor/examples/c/example.c b/float64/ctor/examples/c/example.c deleted file mode 100644 index d9f5b3d5..00000000 --- a/float64/ctor/examples/c/example.c +++ /dev/null @@ -1,73 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/ctor.h" -#include -#include - -/** -* Return the real component of a double-precision complex floating-point number. -* -* @param z complex number -* @return real component -*/ -static double real( const stdlib_complex128_t z ) { - stdlib_complex128_parts_t v; - - // Assign a double-precision complex floating-point number: - v.value = z; // cppcheck-suppress unreadVariable - - // Extract the real component: - double re = v.parts[ 0 ]; - - return re; -} - -/** -* Return the imaginary component of a double-precision complex floating-point number. -* -* @param z complex number -* @return imaginary component -*/ -static double imag( const stdlib_complex128_t z ) { - stdlib_complex128_parts_t v; - - // Assign a double-precision complex floating-point number: - v.value = z; // cppcheck-suppress unreadVariable - - // Extract the imaginary component: - double im = v.parts[ 1 ]; - - return im; -} - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - stdlib_complex128_t v; - int i; - for ( i = 0; i < 4; i++ ) { - v = x[ i ]; - printf( "%lf + %lfi\n", real( v ), imag( v ) ); - } -} diff --git a/float64/ctor/examples/index.js b/float64/ctor/examples/index.js deleted file mode 100644 index d41d7074..00000000 --- a/float64/ctor/examples/index.js +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128 = require( './../lib' ); - -var z = new Complex128( 3.0, -2.0 ); - -console.log( 'type: %s', typeof z ); -// => 'type: object' - -console.log( 'str: %s', z ); -// => 'str: 3 - 2i' - -console.log( 'real: %d', z.re ); -// => 'real: 3' - -console.log( 'imaginary: %d', z.im ); -// => 'imaginary: -2' - -console.log( 'JSON: %s', JSON.stringify( z ) ); -// => 'JSON: {"type":"Complex128","re":3,"im":-2}' diff --git a/float64/ctor/include/stdlib/complex/float64/ctor.h b/float64/ctor/include/stdlib/complex/float64/ctor.h deleted file mode 100644 index f23acfc4..00000000 --- a/float64/ctor/include/stdlib/complex/float64/ctor.h +++ /dev/null @@ -1,169 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef STDLIB_COMPLEX_FLOAT64_CTOR_H -#define STDLIB_COMPLEX_FLOAT64_CTOR_H - -#include "stdlib/complex/float32/ctor.h" -#include -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -// Check for C11 support where we can precisely define a complex number and thus avoid issues concerning infinities and NaNs as real and/or imaginary components... (TODO: revisit the following check; similar to NumPy, we may want to check for a compile time variable (e.g., STDLIB_USE_C99_COMPLEX), rather than checking for C11 support, especially if we are not using C11 functionality) -#if defined(_Imaginary_I) && defined(CMPLX) - -/** -* An opaque type definition for a double-precision complex floating-point number. -*/ -typedef double complex stdlib_complex128_t; - -// If we aren't going to use the native complex number type, we need to define a complex number as an "opaque" struct (here, "opaque" meaning type consumers should **not** be accessing the components directly, but only through dedicated functions) for storing the real and imaginary components... -#else - -/** -* An opaque type definition for a double-precision complex floating-point number. -* -* @example -* stdlib_complex128_t z; -* -* // Set the real component: -* z.re = 5.0; -* -* // Set the imaginary component: -* z.im = 2.0; -*/ -typedef struct { - /** - * Real component. - */ - double re; - - /** - * Imaginary component. - */ - double im; -} stdlib_complex128_t; - -#endif - -/** -* An opaque type definition for a union for accessing the real and imaginary parts of a double-precision complex floating-point number. -* -* @example -* double real( const stdlib_complex128_t z ) { -* stdlib_complex128_parts_t v; -* -* // Assign a double-precision complex floating-point number: -* v.value = z; -* -* // Extract the real component: -* double re = v.parts[ 0 ]; -* -* return re; -* } -* -* // ... -* -* // Create a complex number: -* stdlib_complex128_t z = stdlib_complex128( 5.0, 2.0 ); -* -* // ... -* -* // Access the real component: -* double re = real( z ); -* // returns 5.0 -*/ -typedef union { - // An opaque type for the output value (e.g., could be a `struct` or a C99 complex number): - stdlib_complex128_t value; - - // Leverage the fact that C99 specifies that complex numbers have the same representation and alignment as a two-element array (see ), where the first element is the real component and the second element is the imaginary component, thus allowing us to create a complex number irrespective of its native data type (e.g., `struct` vs `double complex`): - double parts[ 2 ]; -} stdlib_complex128_parts_t; - -/** -* Returns a double-precision complex floating-point number. -*/ -stdlib_complex128_t stdlib_complex128( const double real, const double imag ); - -/** -* Converts a single-precision floating-point number to a double-precision complex floating-point number. -*/ -stdlib_complex128_t stdlib_complex128_from_float32( const float real ); - -/** -* Converts a double-precision floating-point number to a double-precision complex floating-point number. -*/ -stdlib_complex128_t stdlib_complex128_from_float64( const double real ); - -/** -* Converts a single-precision complex floating-point number to a double-precision complex floating-point number. -*/ -stdlib_complex128_t stdlib_complex128_from_complex64( const stdlib_complex64_t z ); - -/** -* Converts (copies) a double-precision complex floating-point number to a double-precision complex floating-point number. -*/ -stdlib_complex128_t stdlib_complex128_from_complex128( const stdlib_complex128_t z ); - -/** -* Converts a signed 8-bit integer to a double-precision complex floating-point number. -*/ -stdlib_complex128_t stdlib_complex128_from_int8( const int8_t real ); - -/** -* Converts an unsigned 8-bit integer to a double-precision complex floating-point number. -*/ -stdlib_complex128_t stdlib_complex128_from_uint8( const uint8_t real ); - -/** -* Converts a signed 16-bit integer to a double-precision complex floating-point number. -*/ -stdlib_complex128_t stdlib_complex128_from_int16( const int16_t real ); - -/** -* Converts an unsigned 16-bit integer to a double-precision complex floating-point number. -*/ -stdlib_complex128_t stdlib_complex128_from_uint16( const uint16_t real ); - -/** -* Converts a signed 32-bit integer to a double-precision complex floating-point number. -*/ -stdlib_complex128_t stdlib_complex128_from_int32( const int32_t real ); - -/** -* Converts an unsigned 32-bit integer to a double-precision complex floating-point number. -*/ -stdlib_complex128_t stdlib_complex128_from_uint32( const uint32_t real ); - -/** -* Converts a double-precision complex floating-point number to a single-precision complex floating-point number. -*/ -stdlib_complex64_t stdlib_complex128_to_complex64( const stdlib_complex128_t z ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_FLOAT64_CTOR_H diff --git a/float64/ctor/lib/index.js b/float64/ctor/lib/index.js deleted file mode 100644 index 841163ae..00000000 --- a/float64/ctor/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* 128-bit complex number constructor. -* -* @module @stdlib/complex/float64/ctor -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* // returns -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float64/ctor/lib/main.js b/float64/ctor/lib/main.js deleted file mode 100644 index 8b1d3035..00000000 --- a/float64/ctor/lib/main.js +++ /dev/null @@ -1,163 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var setEnumerableReadOnly = require( '@stdlib/utils/define-read-only-property' ); -var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var format = require( '@stdlib/string/format' ); -var toStr = require( './tostring.js' ); -var toJSON = require( './tojson.js' ); - - -// MAIN // - -/** -* 128-bit complex number constructor. -* -* @constructor -* @param {number} real - real component -* @param {number} imag - imaginary component -* @throws {TypeError} must invoke using the `new` keyword -* @throws {TypeError} real component must be a number -* @throws {TypeError} imaginary component must be a number -* @returns {Complex128} 128-bit complex number -* -* @example -* var z = new Complex128( 5.0, 3.0 ); -* // returns -*/ -function Complex128( real, imag ) { - if ( !( this instanceof Complex128 ) ) { - throw new TypeError( 'invalid invocation. Constructor must be called with the `new` keyword.' ); - } - if ( !isNumber( real ) ) { - throw new TypeError( format( 'invalid argument. Real component must be a number. Value: `%s`.', real ) ); - } - if ( !isNumber( imag ) ) { - throw new TypeError( format( 'invalid argument. Imaginary component must be a number. Value: `%s`.', imag ) ); - } - setEnumerableReadOnly( this, 're', real ); - setEnumerableReadOnly( this, 'im', imag ); - return this; -} - -/** -* Constructor name. -* -* @name name -* @memberof Complex128 -* @readonly -* @type {string} -* @default 'Complex128' -* -* @example -* var name = Complex128.name; -* // returns 'Complex128' -*/ -setReadOnly( Complex128, 'name', 'Complex128' ); - -/** -* Size (in bytes) of each component. -* -* @name BYTES_PER_ELEMENT -* @memberof Complex128 -* @type {integer} -* @returns {integer} size of each component -* -* @example -* var nbytes = Complex128.BYTES_PER_ELEMENT; -* // returns 8 -*/ -setReadOnly( Complex128, 'BYTES_PER_ELEMENT', 8 ); - -/** -* Size (in bytes) of each component. -* -* @name BYTES_PER_ELEMENT -* @memberof Complex128.prototype -* @type {integer} -* @returns {integer} size of each component -* -* @example -* var z = new Complex128( 5.0, 3.0 ); -* -* var nbytes = z.BYTES_PER_ELEMENT; -* // returns 8 -*/ -setReadOnly( Complex128.prototype, 'BYTES_PER_ELEMENT', 8 ); - -/** -* Length (in bytes) of a complex number. -* -* @name byteLength -* @memberof Complex128.prototype -* @type {integer} -* @returns {integer} byte length -* -* @example -* var z = new Complex128( 5.0, 3.0 ); -* -* var nbytes = z.byteLength; -* // returns 16 -*/ -setReadOnly( Complex128.prototype, 'byteLength', 16 ); - -/** -* Serializes a complex number as a string. -* -* @name toString -* @memberof Complex128.prototype -* @type {Function} -* @returns {string} serialized complex number -* -* @example -* var z = new Complex128( 5.0, 3.0 ); -* -* var str = z.toString(); -* // returns '5 + 3i' -*/ -setReadOnly( Complex128.prototype, 'toString', toStr ); - -/** -* Serializes a complex number as a JSON object. -* -* ## Notes -* -* - `JSON.stringify()` implicitly calls this method when stringifying a `Complex128` instance. -* -* @name toJSON -* @memberof Complex128.prototype -* @type {Function} -* @returns {Object} serialized complex number -* -* @example -* var z = new Complex128( 5.0, 3.0 ); -* -* var obj = z.toJSON(); -* // returns { 'type': 'Complex128', 're': 5.0, 'im': 3.0 } -*/ -setReadOnly( Complex128.prototype, 'toJSON', toJSON ); - - -// EXPORTS // - -module.exports = Complex128; diff --git a/float64/ctor/lib/tojson.js b/float64/ctor/lib/tojson.js deleted file mode 100644 index 407760ed..00000000 --- a/float64/ctor/lib/tojson.js +++ /dev/null @@ -1,39 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Serializes a complex number as a JSON object. -* -* @private -* @returns {Object} JSON representation -*/ -function toJSON() { - /* eslint-disable no-invalid-this */ - var out = {}; - out.type = 'Complex128'; - out.re = this.re; - out.im = this.im; - return out; -} - - -// EXPORTS // - -module.exports = toJSON; diff --git a/float64/ctor/lib/tostring.js b/float64/ctor/lib/tostring.js deleted file mode 100644 index d57bdc16..00000000 --- a/float64/ctor/lib/tostring.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Serializes a complex number as a string. -* -* @private -* @returns {string} serialized complex number -*/ -function toString() { // eslint-disable-line stdlib/no-redeclare - /* eslint-disable no-invalid-this */ - var str = '' + this.re; - if ( this.im < 0 ) { - str += ' - ' + (-this.im); - } else { - str += ' + ' + this.im; - } - str += 'i'; - return str; -} - - -// EXPORTS // - -module.exports = toString; diff --git a/float64/ctor/manifest.json b/float64/ctor/manifest.json deleted file mode 100644 index fde543aa..00000000 --- a/float64/ctor/manifest.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "options": {}, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float32/ctor" - ] - } - ] -} diff --git a/float64/ctor/package.json b/float64/ctor/package.json deleted file mode 100644 index 24224a21..00000000 --- a/float64/ctor/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "@stdlib/complex/float64/ctor", - "version": "0.0.0", - "description": "128-bit complex number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "types", - "data", - "structure", - "constructor", - "ctor", - "complex", - "complex128", - "128-bit", - "float64", - "double", - "double-precision", - "ieee754" - ] -} diff --git a/float64/ctor/src/main.c b/float64/ctor/src/main.c deleted file mode 100644 index cbd0d95d..00000000 --- a/float64/ctor/src/main.c +++ /dev/null @@ -1,224 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float32/ctor.h" -#include - -/** -* Returns a double-precision complex floating-point number. -* -* @param real real component -* @param imag imaginary component -* @return double-precision complex floating-point number -* -* @example -* stdlib_complex128_t z = stdlib_complex128( 5.0, 2.0 ); -*/ -stdlib_complex128_t stdlib_complex128( const double real, const double imag ) { - stdlib_complex128_parts_t z; - z.parts[ 0 ] = real; - z.parts[ 1 ] = imag; // cppcheck-suppress unreadVariable - return z.value; -} - -/** -* Converts a single-precision floating-point number to a double-precision complex floating-point number. -* -* @param real real component -* @return double-precision complex floating-point number -* -* @example -* stdlib_complex128_t z = stdlib_complex128_from_float32( 5.0f ); -*/ -stdlib_complex128_t stdlib_complex128_from_float32( const float real ) { - stdlib_complex128_parts_t z; - z.parts[ 0 ] = (double)real; - z.parts[ 1 ] = 0.0; // cppcheck-suppress unreadVariable - return z.value; -} - -/** -* Converts a double-precision floating-point number to a double-precision complex floating-point number. -* -* @param real real component -* @return double-precision complex floating-point number -* -* @example -* stdlib_complex128_t z = stdlib_complex128_from_float64( 5.0 ); -*/ -stdlib_complex128_t stdlib_complex128_from_float64( const double real ) { - stdlib_complex128_parts_t z; - z.parts[ 0 ] = real; - z.parts[ 1 ] = 0.0; // cppcheck-suppress unreadVariable - return z.value; -} - -/** -* Converts a single-precision complex floating-point number to a double-precision complex floating-point number. -* -* @param z single-precision complex floating-point number -* @return double-precision complex floating-point number -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* -* stdlib_complex64_t z1 = stdlib_complex64( 5.0f, 3.0f ); -* stdlib_complex128_t z2 = stdlib_complex128_from_complex64( z1 ); -*/ -stdlib_complex128_t stdlib_complex128_from_complex64( const stdlib_complex64_t z ) { - stdlib_complex64_parts_t v1 = { z }; - stdlib_complex128_parts_t v2; - v2.parts[ 0 ] = (double)v1.parts[ 0 ]; - v2.parts[ 1 ] = (double)v1.parts[ 1 ]; // cppcheck-suppress unreadVariable - return v2.value; -} - -/** -* Converts (copies) a double-precision complex floating-point number to a double-precision complex floating-point number. -* -* @param z double-precision complex floating-point number -* @return double-precision complex floating-point number -* -* @example -* stdlib_complex128_t z1 = stdlib_complex128( 5.0, 3.0 ); -* stdlib_complex128_t z2 = stdlib_complex128_from_complex128( z1 ); -*/ -stdlib_complex128_t stdlib_complex128_from_complex128( const stdlib_complex128_t z ) { - stdlib_complex128_parts_t v1 = { z }; - stdlib_complex128_parts_t v2; - v2.parts[ 0 ] = v1.parts[ 0 ]; - v2.parts[ 1 ] = v1.parts[ 1 ]; // cppcheck-suppress unreadVariable - return v2.value; -} - -/** -* Converts a signed 8-bit integer to a double-precision complex floating-point number. -* -* @param real real component -* @return double-precision complex floating-point number -* -* @example -* stdlib_complex128_t z = stdlib_complex128_from_int8( 5 ); -*/ -stdlib_complex128_t stdlib_complex128_from_int8( const int8_t real ) { - stdlib_complex128_parts_t z; - z.parts[ 0 ] = (double)real; - z.parts[ 1 ] = 0.0; // cppcheck-suppress unreadVariable - return z.value; -} - -/** -* Converts an unsigned 8-bit integer to a double-precision complex floating-point number. -* -* @param real real component -* @return double-precision complex floating-point number -* -* @example -* stdlib_complex128_t z = stdlib_complex128_from_uint8( 5 ); -*/ -stdlib_complex128_t stdlib_complex128_from_uint8( const uint8_t real ) { - stdlib_complex128_parts_t z; - z.parts[ 0 ] = (double)real; - z.parts[ 1 ] = 0.0; // cppcheck-suppress unreadVariable - return z.value; -} - -/** -* Converts a signed 16-bit integer to a double-precision complex floating-point number. -* -* @param real real component -* @return double-precision complex floating-point number -* -* @example -* stdlib_complex128_t z = stdlib_complex128_from_int16( 5 ); -*/ -stdlib_complex128_t stdlib_complex128_from_int16( const int16_t real ) { - stdlib_complex128_parts_t z; - z.parts[ 0 ] = (double)real; - z.parts[ 1 ] = 0.0; // cppcheck-suppress unreadVariable - return z.value; -} - -/** -* Converts an unsigned 16-bit integer to a double-precision complex floating-point number. -* -* @param real real component -* @return double-precision complex floating-point number -* -* @example -* stdlib_complex128_t z = stdlib_complex128_from_uint16( 5 ); -*/ -stdlib_complex128_t stdlib_complex128_from_uint16( const uint16_t real ) { - stdlib_complex128_parts_t z; - z.parts[ 0 ] = (double)real; - z.parts[ 1 ] = 0.0; // cppcheck-suppress unreadVariable - return z.value; -} - -/** -* Converts a signed 32-bit integer to a double-precision complex floating-point number. -* -* @param real real component -* @return double-precision complex floating-point number -* -* @example -* stdlib_complex128_t z = stdlib_complex128_from_int32( 5 ); -*/ -stdlib_complex128_t stdlib_complex128_from_int32( const int32_t real ) { - stdlib_complex128_parts_t z; - z.parts[ 0 ] = (double)real; - z.parts[ 1 ] = 0.0; // cppcheck-suppress unreadVariable - return z.value; -} - -/** -* Converts an unsigned 32-bit integer to a double-precision complex floating-point number. -* -* @param real real component -* @return double-precision complex floating-point number -* -* @example -* stdlib_complex128_t z = stdlib_complex128_from_uint32( 5 ); -*/ -stdlib_complex128_t stdlib_complex128_from_uint32( const uint32_t real ) { - stdlib_complex128_parts_t z; - z.parts[ 0 ] = (double)real; - z.parts[ 1 ] = 0.0; // cppcheck-suppress unreadVariable - return z.value; -} - -/** -* Converts a double-precision complex floating-point number to a single-precision complex floating-point number. -* -* @param z double-precision complex floating-point number -* @return single-precision complex floating-point number -* -* @example -* #include "stdlib/complex/float32/ctor.h" -* -* stdlib_complex128_t z1 = stdlib_complex128( 5.0, 3.0 ); -* stdlib_complex64_t z2 = stdlib_complex128_to_complex64( z1 ); -*/ -stdlib_complex64_t stdlib_complex128_to_complex64( const stdlib_complex128_t z ) { - stdlib_complex128_parts_t v1 = { z }; - stdlib_complex64_parts_t v2; - v2.parts[ 0 ] = (float)v1.parts[ 0 ]; - v2.parts[ 1 ] = (float)v1.parts[ 1 ]; // cppcheck-suppress unreadVariable - return v2.value; -} diff --git a/float64/ctor/test/test.js b/float64/ctor/test/test.js deleted file mode 100644 index f5402a05..00000000 --- a/float64/ctor/test/test.js +++ /dev/null @@ -1,224 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); -var Complex128 = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof Complex128, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function is a constructor', function test( t ) { - var z = new Complex128( 5.0, 3.0 ); - t.strictEqual( z instanceof Complex128, true, 'is an instance' ); - t.end(); -}); - -tape( 'the constructor throws an error if provided a real component which is not a number', function test( t ) { - var values; - var i; - - values = [ - '5', - null, - void 0, - true, - false, - [], - {}, - function noop() {} - ]; - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var z = new Complex128( value, 3.0 ); // eslint-disable-line no-unused-vars - }; - } -}); - -tape( 'the constructor throws an error if provided an imaginary component which is not a number', function test( t ) { - var values; - var i; - - values = [ - '5', - null, - void 0, - true, - false, - [], - {}, - function noop() {} - ]; - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - var z = new Complex128( 5.0, value ); // eslint-disable-line no-unused-vars - }; - } -}); - -tape( 'the constructor requires the `new` keyword', function test( t ) { - var ctor = Complex128; - t.throws( foo, TypeError, 'throws an error' ); - t.end(); - - function foo() { - ctor( 5.0, 3.0 ); - } -}); - -tape( 'the constructor has a read-only `name` property', function test( t ) { - t.strictEqual( hasOwnProp( Complex128, 'name' ), true, 'has property' ); - t.strictEqual( Complex128.name, 'Complex128', 'returns expected value' ); - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - Complex128.name = 'Foo'; - } -}); - -tape( 'the constructor has a read-only `BYTES_PER_ELEMENT` property', function test( t ) { - t.strictEqual( hasOwnProp( Complex128, 'BYTES_PER_ELEMENT' ), true, 'has property' ); - t.strictEqual( Complex128.BYTES_PER_ELEMENT, 8, 'returns expected value' ); - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - Complex128.BYTES_PER_ELEMENT = 16; - } -}); - -tape( 'the constructor prototype has a read-only `BYTES_PER_ELEMENT` property', function test( t ) { - t.strictEqual( hasOwnProp( Complex128.prototype, 'BYTES_PER_ELEMENT' ), true, 'has property' ); - t.strictEqual( Complex128.prototype.BYTES_PER_ELEMENT, 8, 'returns expected value' ); - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - Complex128.prototype.BYTES_PER_ELEMENT = 16; - } -}); - -tape( 'the constructor prototype has a read-only `byteLength` property', function test( t ) { - t.strictEqual( hasOwnProp( Complex128.prototype, 'byteLength' ), true, 'has property' ); - t.strictEqual( Complex128.prototype.byteLength, 16, 'returns expected value' ); - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - Complex128.prototype.byteLength = 64; - } -}); - -tape( 'the constructor returns an instance having a property for getting the real component', function test( t ) { - var z = new Complex128( 5.0, 3.0 ); - t.strictEqual( z.re, 5.0, 'returns expected value' ); - t.end(); -}); - -tape( 'the constructor returns an instance which throws an error when attempting to mutate the real component', function test( t ) { - var z = new Complex128( 5.0, 3.0 ); - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - z.re = -5.0; - } -}); - -tape( 'the constructor returns an instance having a property for getting the imaginary component', function test( t ) { - var z = new Complex128( 5.0, 3.0 ); - t.strictEqual( z.im, 3.0, 'returns expected value' ); - t.end(); -}); - -tape( 'the constructor returns an instance which throws an error when attempting to mutate the imaginary component', function test( t ) { - var z = new Complex128( 5.0, 3.0 ); - t.throws( foo, Error, 'throws an error' ); - t.end(); - - function foo() { - z.im = -3.0; - } -}); - -tape( 'the constructor returns an instance which stores real and imaginary components as double-precision floating-point numbers', function test( t ) { - var z = new Complex128( 3.14, -3.14 ); - - t.strictEqual( z.re, 3.14, 'stores as double-precision' ); - t.strictEqual( z.im, -3.14, 'stores as double-precision' ); - - t.end(); -}); - -tape( 'the constructor returns an instance which supports serializing an instance as a string', function test( t ) { - var z; - - z = new Complex128( 5.0, -3.0 ); - t.strictEqual( z.toString(), '5 - 3i', 'returns expected value' ); - - z = new Complex128( 5.0, 3.0 ); - t.strictEqual( z.toString(), '5 + 3i', 'returns expected value' ); - - t.end(); -}); - -tape( 'the constructor returns an instance which supports serializing an instance as a JSON object', function test( t ) { - var expected; - var z; - - z = new Complex128( 5.0, -3.0 ); - expected = { - 'type': 'Complex128', - 're': 5.0, - 'im': -3.0 - }; - t.deepEqual( z.toJSON(), expected, 'returns expected value' ); - t.strictEqual( JSON.stringify( z ), JSON.stringify( expected ), 'serializes as JSON when called by JSON.stringify()' ); - - z = new Complex128( 5.0, 3.0 ); - expected = { - 'type': 'Complex128', - 're': 5.0, - 'im': 3.0 - }; - t.deepEqual( z.toJSON(), expected, 'returns expected value' ); - t.strictEqual( JSON.stringify( z ), JSON.stringify( expected ), 'serializes as JSON when called by JSON.stringify()' ); - - t.end(); -}); diff --git a/float64/docs/types/index.d.ts b/float64/docs/types/index.d.ts deleted file mode 100644 index 952085ae..00000000 --- a/float64/docs/types/index.d.ts +++ /dev/null @@ -1,151 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/* eslint-disable max-lines */ - -import base = require( './../../../float64/base' ); -import conj = require( './../../../float64/conj' ); -import Complex128 = require( './../../../float64/ctor' ); -import imag = require( './../../../float64/imag' ); -import parseComplex128 = require( './../../../float64/parse' ); -import real = require( './../../../float64/real' ); -import reim = require( './../../../float64/reim' ); -import reviveComplex128 = require( './../../../float64/reviver' ); - -/** -* Interface describing the `float64` namespace. -*/ -interface Namespace { - /** - * Base (i.e., lower-level) double-precision complex number functions. - */ - base: typeof base; - - /** - * Returns the complex conjugate of a double-precision complex floating-point number. - * - * @param z - complex number - * @returns complex conjugate - * - * @example - * var Complex128 = require( './../../../float64/ctor' ); - * - * var z = new Complex128( 5.0, 3.0 ); - * - * var v = ns.conj( z ); - * // returns [ 5.0, -3.0 ] - */ - conj: typeof conj; - - /** - * 128-bit complex number. - */ - Complex128: typeof Complex128; - - /** - * Returns the imaginary component of a double-precision complex floating-point number. - * - * @param z - complex number - * @returns imaginary component - * - * @example - * var Complex128 = require( './../../../float64/ctor' ); - * - * var z = new Complex128( 5.0, 3.0 ); - * - * var im = ns.imag( z ); - * // returns 3.0 - */ - imag: typeof imag; - - /** - * Parse a string representation of a 128-bit complex number. - * - * @param str - string representation of a complex number - * @throws must provide a string recognized as a complex number - * @returns Complex128 instance - * - * @example - * var str = '5 + 3i'; - * - * var z = ns.parseComplex128( str ); - * // returns - */ - parseComplex128: typeof parseComplex128; - - /** - * Returns the real component of a double-precision complex floating-point number. - * - * @param z - complex number - * @returns real component - * - * @example - * var Complex128 = require( './../../../float64/ctor' ); - * - * var z = new Complex128( 5.0, 3.0 ); - * - * var re = ns.real( z ); - * // returns 5.0 - */ - real: typeof real; - - /** - * Returns the real and imaginary components of a double-precision complex floating-point number. - * - * @param z - complex number - * @returns real and imaginary components - * - * @example - * var Complex128 = require( './../../../float64/ctor' ); - * - * var z = new Complex128( 5.0, 3.0 ); - * - * var out = ns.reim( z ); - * // returns [ 5.0, 3.0 ] - */ - reim: typeof reim; - - /** - * Revives a JSON-serialized 128-bit complex number. - * - * @param key - key - * @param value - value - * @returns value or 128-bit complex number - * - * @example - * var parseJSON = require( '@stdlib/utils/parse-json' ); - * - * var str = '{"type":"Complex128","re":5,"im":3}'; - * - * var z = parseJSON( str, ns.reviveComplex128 ); - * // returns - */ - reviveComplex128: typeof reviveComplex128; -} - -/** -* Double-precision complex number functions. -*/ -declare var ns: Namespace; - - -// EXPORTS // - -export = ns; diff --git a/float64/docs/types/test.ts b/float64/docs/types/test.ts deleted file mode 100644 index 2f81653a..00000000 --- a/float64/docs/types/test.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable @typescript-eslint/no-unused-expressions */ - -import ns = require( './index' ); - - -// TESTS // - -// The exported value is the expected interface... -{ - ns; // $ExpectType Namespace -} diff --git a/float64/examples/index.js b/float64/examples/index.js deleted file mode 100644 index 6115ca08..00000000 --- a/float64/examples/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - -console.log( objectKeys( ns ) ); diff --git a/float64/imag/README.md b/float64/imag/README.md deleted file mode 100644 index 5285a7a0..00000000 --- a/float64/imag/README.md +++ /dev/null @@ -1,236 +0,0 @@ - - -# imag - -> Return the imaginary component of a double-precision complex floating-point number. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var imag = require( '@stdlib/complex/float64/imag' ); -``` - -#### imag( z ) - -Returns the **imaginary** component of a double-precision complex floating-point number. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z = new Complex128( 5.0, 3.0 ); -var im = imag( z ); -// returns 3.0 -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - - - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var imag = require( '@stdlib/complex/float64/imag' ); - -function random() { - return new Complex128( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); -} - -// Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex128', random ); -// returns - -// Retrieve the imaginary component of each complex number... -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); - console.log( 'imag(%s) = %d', z.toString(), imag( z ) ); -} -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float64/imag.h" -``` - -#### stdlib_complex128_imag( z ) - -Returns the imaginary component of a double-precision complex floating-point number. - -```c -#include "stdlib/complex/float64/ctor.h" - -stdlib_complex128_t z = stdlib_complex128( 5.0, 2.0 ); - -// ... - -double im = stdlib_complex128_imag( z ); -// returns 2.0 -``` - -The function accepts the following arguments: - -- **z**: `[in] stdlib_complex128_t` double-precision complex floating-point number. - -```c -double stdlib_complex128_imag( const stdlib_complex128_t z ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float64/imag.h" -#include "stdlib/complex/float64/ctor.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - int i; - for ( i = 0; i < 4; i++ ) { - printf( "imag(v) = %lf\n", stdlib_complex128_imag( x[ i ] ) ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float64/imag/benchmark/benchmark.js b/float64/imag/benchmark/benchmark.js deleted file mode 100644 index 15f0a7ef..00000000 --- a/float64/imag/benchmark/benchmark.js +++ /dev/null @@ -1,57 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex128 = require( './../../../float64/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var pkg = require( './../package.json' ).name; -var imag = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var im; - var i; - - values = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - im = imag( values[ i%values.length ] ); - if ( isnan( im ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( im ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/imag/benchmark/c/Makefile b/float64/imag/benchmark/c/Makefile deleted file mode 100644 index d7adc1ad..00000000 --- a/float64/imag/benchmark/c/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/imag/benchmark/c/benchmark.c b/float64/imag/benchmark/c/benchmark.c deleted file mode 100644 index 387f9240..00000000 --- a/float64/imag/benchmark/c/benchmark.c +++ /dev/null @@ -1,135 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include -#include -#include -#include - -#define NAME "imag" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double re; - double im; - double v; - double t; - int i; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = rand_double(); - im = rand_double(); - double complex z = re + im*I; - v = cimag( z ); - if ( v != v ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( v != v ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/imag/benchmark/c/native/Makefile b/float64/imag/benchmark/c/native/Makefile deleted file mode 100644 index 7f6bbc4c..00000000 --- a/float64/imag/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/imag/benchmark/c/native/benchmark.c b/float64/imag/benchmark/c/native/benchmark.c deleted file mode 100644 index 045280b4..00000000 --- a/float64/imag/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,139 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/imag.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include -#include -#include -#include -#include - -#define NAME "complex128_imag" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - stdlib_complex128_t z; - double elapsed; - double re; - double im; - double v; - double t; - int i; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = rand_double(); - im = rand_double(); - z = stdlib_complex128( re, im ); - v = stdlib_complex128_imag( z ); - if ( v != v ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( v != v ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/imag/benchmark/julia/REQUIRE b/float64/imag/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float64/imag/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float64/imag/benchmark/julia/benchmark.jl b/float64/imag/benchmark/julia/benchmark.jl deleted file mode 100644 index 8e1676ee..00000000 --- a/float64/imag/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "imag"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark imag( ComplexF64( rand(), rand() ) ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float64/imag/docs/repl.txt b/float64/imag/docs/repl.txt deleted file mode 100644 index 2fd88fd1..00000000 --- a/float64/imag/docs/repl.txt +++ /dev/null @@ -1,24 +0,0 @@ - -{{alias}}( z ) - Returns the imaginary component of a double-precision complex floating-point - number. - - Parameters - ---------- - z: Complex128 - Complex number. - - Returns - ------- - im: number - Imaginary component. - - Examples - -------- - > var z = new {{alias:@stdlib/complex/float64/ctor}}( 5.0, 3.0 ); - > var im = {{alias}}( z ) - 3.0 - - See Also - -------- - diff --git a/float64/imag/docs/types/index.d.ts b/float64/imag/docs/types/index.d.ts deleted file mode 100644 index 0a733bba..00000000 --- a/float64/imag/docs/types/index.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex128 } from '@stdlib/types/complex'; - -/** -* Returns the imaginary component of a double-precision complex floating-point number. -* -* @param z - complex number -* @returns imaginary component -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var im = imag( z ); -* // returns 3.0 -*/ -declare function imag( z: Complex128 ): number; - - -// EXPORTS // - -export = imag; diff --git a/float64/imag/docs/types/test.ts b/float64/imag/docs/types/test.ts deleted file mode 100644 index 3a999e85..00000000 --- a/float64/imag/docs/types/test.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../float64/ctor' ); -import imag = require( './index' ); - - -// TESTS // - -// The function returns a number... -{ - imag( new Complex128( 5.0, 3.0 ) ); // $ExpectType number -} - -// The compiler throws an error if the function is provided an argument that is not a complex number... -{ - imag( 'abc' ); // $ExpectError - imag( 123 ); // $ExpectError - imag( true ); // $ExpectError - imag( false ); // $ExpectError - imag( [] ); // $ExpectError - imag( {} ); // $ExpectError - imag( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - imag(); // $ExpectError - imag( new Complex128( 5.0, 3.0 ), 123 ); // $ExpectError -} diff --git a/float64/imag/examples/c/Makefile b/float64/imag/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float64/imag/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/imag/examples/c/example.c b/float64/imag/examples/c/example.c deleted file mode 100644 index 40a06ed8..00000000 --- a/float64/imag/examples/c/example.c +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/imag.h" -#include "stdlib/complex/float64/ctor.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - int i; - for ( i = 0; i < 4; i++ ) { - printf( "imag(v) = %lf\n", stdlib_complex128_imag( x[ i ] ) ); - } -} diff --git a/float64/imag/examples/index.js b/float64/imag/examples/index.js deleted file mode 100644 index 6cdbfdf6..00000000 --- a/float64/imag/examples/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128 = require( './../../../float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var imag = require( './../lib' ); - -function random() { - return new Complex128( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); // eslint-disable-line max-len -} - -// Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex128', random ); -// returns - -// Retrieve the imaginary component of each complex number... -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); - console.log( 'imag(%s) = %d', z.toString(), imag( z ) ); -} diff --git a/float64/imag/include/stdlib/complex/float64/imag.h b/float64/imag/include/stdlib/complex/float64/imag.h deleted file mode 100644 index e1fce5bf..00000000 --- a/float64/imag/include/stdlib/complex/float64/imag.h +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef STDLIB_COMPLEX_FLOAT64_IMAG_H -#define STDLIB_COMPLEX_FLOAT64_IMAG_H - -#include "stdlib/complex/float64/ctor.h" - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Returns the imaginary component of a double-precision complex floating-point number. -*/ -double stdlib_complex128_imag( const stdlib_complex128_t z ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_FLOAT64_IMAG_H diff --git a/float64/imag/lib/index.js b/float64/imag/lib/index.js deleted file mode 100644 index a9a9c37c..00000000 --- a/float64/imag/lib/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Return the imaginary component of a double-precision complex floating-point number. -* -* @module @stdlib/complex/float64/imag -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var imag = require( '@stdlib/complex/float64/imag' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var im = imag( z ); -* // returns 3.0 -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float64/imag/lib/main.js b/float64/imag/lib/main.js deleted file mode 100644 index 66cb0e8c..00000000 --- a/float64/imag/lib/main.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Returns the imaginary component of a double-precision complex floating-point number. -* -* @param {Complex} z - complex number -* @returns {number} imaginary component -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var im = imag( z ); -* // returns 3.0 -*/ -function imag( z ) { - return z.im; -} - - -// EXPORTS // - -module.exports = imag; diff --git a/float64/imag/manifest.json b/float64/imag/manifest.json deleted file mode 100644 index fb0dbf4f..00000000 --- a/float64/imag/manifest.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "options": {}, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor" - ] - } - ] -} diff --git a/float64/imag/package.json b/float64/imag/package.json deleted file mode 100644 index ec9555cb..00000000 --- a/float64/imag/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@stdlib/complex/float64/imag", - "version": "0.0.0", - "description": "Return the imaginary component of a double-precision complex floating-point number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "real", - "re", - "imaginary", - "imag", - "im", - "number" - ] -} diff --git a/float64/imag/src/main.c b/float64/imag/src/main.c deleted file mode 100644 index 30a1ca8a..00000000 --- a/float64/imag/src/main.c +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/imag.h" -#include "stdlib/complex/float64/ctor.h" - -/** -* Returns the imaginary component of a double-precision complex floating-point number. -* -* @param z double-precision complex floating-point number -* @return imaginary component -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* stdlib_complex128_t z = stdlib_complex128( 5.0, 2.0 ); -* -* // ... -* -* double im = stdlib_complex128_imag( z ); -* // returns 2.0 -*/ -double stdlib_complex128_imag( const stdlib_complex128_t z ) { - stdlib_complex128_parts_t v; - v.value = z; // cppcheck-suppress unreadVariable - return v.parts[ 1 ]; -} diff --git a/float64/imag/test/test.js b/float64/imag/test/test.js deleted file mode 100644 index f1924c5e..00000000 --- a/float64/imag/test/test.js +++ /dev/null @@ -1,45 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex128 = require( './../../../float64/ctor' ); -var imag = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof imag, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns the imaginary component of a complex number', function test( t ) { - var im; - var z; - - z = new Complex128( 3.14, -3.14 ); - im = imag( z ); - t.strictEqual( im, -3.14, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/lib/index.js b/float64/lib/index.js deleted file mode 100644 index 7c1d3f6a..00000000 --- a/float64/lib/index.js +++ /dev/null @@ -1,114 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/* -* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name. -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); - - -// MAIN // - -/** -* Top-level namespace. -* -* @namespace ns -*/ -var ns = {}; - -/** -* @name base -* @memberof ns -* @readonly -* @type {Namespace} -* @see {@link module:@stdlib/complex/float64/base} -*/ -setReadOnly( ns, 'base', require( './../../float64/base' ) ); - -/** -* @name conj -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/conj} -*/ -setReadOnly( ns, 'conj', require( './../../float64/conj' ) ); - -/** -* @name Complex128 -* @memberof ns -* @readonly -* @constructor -* @see {@link module:@stdlib/complex/float64/ctor} -*/ -setReadOnly( ns, 'Complex128', require( './../../float64/ctor' ) ); - -/** -* @name imag -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/imag} -*/ -setReadOnly( ns, 'imag', require( './../../float64/imag' ) ); - -/** -* @name parseComplex128 -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/parse} -*/ -setReadOnly( ns, 'parseComplex128', require( './../../float64/parse' ) ); - -/** -* @name real -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/real} -*/ -setReadOnly( ns, 'real', require( './../../float64/real' ) ); - -/** -* @name reim -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/reim} -*/ -setReadOnly( ns, 'reim', require( './../../float64/reim' ) ); - -/** -* @name reviveComplex128 -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/float64/reviver} -*/ -setReadOnly( ns, 'reviveComplex128', require( './../../float64/reviver' ) ); - - -// EXPORTS // - -module.exports = ns; diff --git a/float64/package.json b/float64/package.json deleted file mode 100644 index 6d002416..00000000 --- a/float64/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "@stdlib/complex/float64", - "version": "0.0.0", - "description": "Double-precision complex number functions.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "lib/index.js", - "directories": { - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "types", - "complex", - "cmplx", - "number", - "namespace", - "ns", - "float64" - ] -} diff --git a/float64/parse/README.md b/float64/parse/README.md deleted file mode 100644 index 40fe8359..00000000 --- a/float64/parse/README.md +++ /dev/null @@ -1,132 +0,0 @@ - - -# parseComplex128 - -> Parse a string representation of a 128-bit [complex number][@stdlib/complex/float64/ctor]. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var parseComplex128 = require( '@stdlib/complex/float64/parse' ); -``` - -#### parseComplex128( str ) - -Parses a string representation of a 128-bit [complex number][@stdlib/complex/float64/ctor]. - -```javascript -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); - -var str = '5 + 3i'; - -var z = parseComplex128( str ); -// returns - -var re = real( z ); -// returns 5.0 - -var im = imag( z ); -// returns 3.0 -``` - -For details on the string format, see [Complex128][@stdlib/complex/float64/ctor]. - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var parseComplex128 = require( '@stdlib/complex/float64/parse' ); -var isComplex128 = require( '@stdlib/assert/is-complex128' ); -var real = require( '@stdlib/complex/float64/real' ); -var imag = require( '@stdlib/complex/float64/imag' ); - -var str = '1e3 - 2.75i'; - -var z = parseComplex128( str ); -var bool = isComplex128( z ); -// returns true - -bool = ( real( z ) === 1e3 ); -// returns true - -bool = ( imag( z ) === -2.75 ); -// returns true -``` - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float64/parse/benchmark/benchmark.js b/float64/parse/benchmark/benchmark.js deleted file mode 100644 index ab0e8cf7..00000000 --- a/float64/parse/benchmark/benchmark.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var isComplex128 = require( '@stdlib/assert/is-complex128' ); -var pkg = require( './../package.json' ).name; -var parse = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var str; - var z; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - str = i + ' + ' + (i+1) + 'i'; - z = parse( str ); - if ( !(isComplex128(z)) ) { - b.fail( 'should return a Complex128' ); - } - } - b.toc(); - if ( !(isComplex128(z)) ) { - b.fail( 'should return a Complex128' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/parse/docs/repl.txt b/float64/parse/docs/repl.txt deleted file mode 100644 index 6605e96d..00000000 --- a/float64/parse/docs/repl.txt +++ /dev/null @@ -1,23 +0,0 @@ - -{{alias}}( str ) - Parse a string representation of a 128-bit complex number. - - Parameters - ---------- - str: string - String representation of a complex number. - - Returns - ------- - out: Complex128 - 128-bit complex number. - - Examples - -------- - > var str = '5 + 3i'; - > var z = {{alias}}( str ) - - - - See Also - -------- diff --git a/float64/parse/docs/types/index.d.ts b/float64/parse/docs/types/index.d.ts deleted file mode 100644 index bd822f50..00000000 --- a/float64/parse/docs/types/index.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -// MODULES // - -/// - -import { Complex128 } from '@stdlib/types/complex'; - - -/** -* Parse a string representation of a 128-bit complex number. -* -* @param str - string representation of a complex number -* @throws must provide a string recognized as a complex number -* @returns Complex128 instance -* -* @example -* var str = '5 + 3i'; -* -* var z = parseComplex128( str ); -* // returns -*/ -declare function parseComplex128( str: string ): Complex128; - - -// EXPORTS // - -export = parseComplex128; diff --git a/float64/parse/docs/types/test.ts b/float64/parse/docs/types/test.ts deleted file mode 100644 index ad896843..00000000 --- a/float64/parse/docs/types/test.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import parseComplex128 = require( './index' ); - - -// TESTS // - -// The function returns a complex number... -{ - parseComplex128( '5 + 3.5i' ); // $ExpectType Complex128 - parseComplex128( '3' ); // $ExpectType Complex128 - parseComplex128( '-8i' ); // $ExpectType Complex128 - parseComplex128( '1e3 + 1e-3i' ); // $ExpectType Complex128 - parseComplex128( 'NaN + NaNi' ); // $ExpectType Complex128 - parseComplex128( 'Infinity - Infinityi' ); // $ExpectType Complex128 -} - -// The compiler throws an error if the function is provided a first argument that is not a string... -{ - parseComplex128( true ); // $ExpectError - parseComplex128( false ); // $ExpectError - parseComplex128( null ); // $ExpectError - parseComplex128( undefined ); // $ExpectError - parseComplex128( 5 ); // $ExpectError - parseComplex128( [] ); // $ExpectError - parseComplex128( {} ); // $ExpectError - parseComplex128( ( x: number ): number => x ); // $ExpectError -} diff --git a/float64/parse/examples/index.js b/float64/parse/examples/index.js deleted file mode 100644 index 4d73af7e..00000000 --- a/float64/parse/examples/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var isComplex128 = require( '@stdlib/assert/is-complex128' ); -var real = require( './../../../float64/real' ); -var imag = require( './../../../float64/imag' ); -var parseComplex128 = require( './../lib' ); - -var str = '-0.5 + 1.25i'; - -var z = parseComplex128( str ); -console.log( z ); -// => - -var bool = ( isComplex128( z ) ); -console.log( bool ); -// => true - -bool = ( real( z ) === -0.5 ); -console.log( bool ); -// => true - -bool = ( imag( z ) === 1.25 ); -console.log( bool ); -// => true diff --git a/float64/parse/lib/index.js b/float64/parse/lib/index.js deleted file mode 100644 index 50981745..00000000 --- a/float64/parse/lib/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Parse a string representation of a complex number and returns a Complex128 instance. -* -* @module @stdlib/complex/float64/parse -* -* @example -* var parseComplex128 = require( '@stdlib/complex/float64/parse' ); -* -* var str = '1 + 2i'; -* -* var z = parseComplex128( str ); -* // returns -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float64/parse/lib/main.js b/float64/parse/lib/main.js deleted file mode 100644 index ae5506b5..00000000 --- a/float64/parse/lib/main.js +++ /dev/null @@ -1,90 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex128 = require( './../../../float64/ctor' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var replace = require( '@stdlib/string/base/replace' ); -var format = require( '@stdlib/string/format' ); - - -// FUNCTIONS // - -/** -* Matches a complex number string. -* -* @private -* @returns {RegExp} regular expression -* -* @example -* var re = regexp(); -* // returns /^([-+]?(\d*\.?\d*(?:[eE][-+]?\d+)?|Infinity|NaN)i?)?([-+])?((\d*\.?\d*(?:[eE][-+]?\d+)?|Infinity|NaN)i)?$/ -*/ -function regexp() { - return /^([-+]?(\d*\.?\d*(?:[eE][-+]?\d+)?|Infinity|NaN)i?)?([-+])?((\d*\.?\d*(?:[eE][-+]?\d+)?|Infinity|NaN)i)?$/; -} - - -// MAIN // - -/** -* Parse a string representation of a complex number and returns a Complex128 instance. -* -* @param {string} str - string representation of a complex number -* @throws {TypeError} must provide a string -* @throws {Error} must provide a valid string representation of a complex number -* @returns {Complex128} 128-bit complex number -* -* @example -* var str = '1 + 2i'; -* var z = parseComplex128( str ); -* // returns -*/ -function parseComplex128( str ) { - var match; - var re; - var im = 0; - - if ( !isString( str ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) ); - } - - match = replace( str, /\s/g, '' ).match( regexp() ); - if ( !match ) { - throw new Error( format( 'invalid argument. Unable to parse input string as a complex number. Value: `%s`.', str ) ); - } - - // Real part: - re = ( match[1] && !match[1].endsWith( 'i' ) ) ? parseFloat( match[1] ) : 0; - - // Imaginary part: - if ( match[4] ) { - im = ( ( match[3] === '-' ) ? -1 : 1 ) * parseFloat( replace( match[4], /i$/, '' ) ); - } else if ( match[1] && match[1].endsWith( 'i' ) ) { - im = parseFloat( replace( match[1], /i$/, '' ) ); - } - return new Complex128( re, im ); -} - - -// EXPORTS // - -module.exports = parseComplex128; diff --git a/float64/parse/package.json b/float64/parse/package.json deleted file mode 100644 index d9f33b29..00000000 --- a/float64/parse/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@stdlib/complex/float64/parse", - "version": "0.0.0", - "description": "Parse a string representation of a 128-bit complex number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "utils", - "util", - "utilities", - "utility", - "complex", - "complex128", - "cmplx", - "parse", - "string", - "convert", - "object", - "obj" - ] -} diff --git a/float64/parse/test/test.js b/float64/parse/test/test.js deleted file mode 100644 index 7b07f44a..00000000 --- a/float64/parse/test/test.js +++ /dev/null @@ -1,192 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var Complex128 = require( './../../../float64/ctor' ); -var isComplex128 = require( '@stdlib/assert/is-complex128' ); -var isSameComplex128 = require( '@stdlib/assert/is-same-complex128' ); -var isNan = require( '@stdlib/math/base/assert/is-nan' ); -var real = require( './../../../float64/real' ); -var imag = require( './../../../float64/imag' ); -var parseComplex128 = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof parseComplex128, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function throws an error for inputs not recognized as complex numbers', function test( t ) { - t.throws( function invalidInput() { - parseComplex128( 'beep boop' ); - }, Error, 'throws an Error for invalid input' ); - t.throws( function invalidType() { - parseComplex128( true ); - }, TypeError, 'throws TypeError for non string input type' ); - - t.end(); -}); - -tape( 'the function will parse a string representation of a complex number', function test( t ) { - var z; - var w; - - z = new Complex128( 5.0, 12.0 ); - w = parseComplex128( '5 + 12i' ); - - t.ok( isComplex128( w ), 'is an instance' ); - t.ok( isSameComplex128( w, z ), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will parse a string representation of a complex number (negative values)', function test( t ) { - var z; - var w; - - z = new Complex128( -2.5, -4.0 ); - w = parseComplex128( '-2.5 - 4i' ); - - t.ok( isComplex128( w ), 'is an instance' ); - t.ok( isSameComplex128( w, z ), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will parse a string representation of a complex number (only real part)', function test( t ) { - var z; - var w; - - z = new Complex128( 3.0, 0.0 ); - w = parseComplex128( '3' ); - - t.ok( isComplex128( w ), 'is an instance' ); - t.ok( isSameComplex128( w, z ), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will parse a string representation of a complex number (only imaginary part)', function test( t ) { - var z; - var w; - - z = new Complex128( 0.0, 8.5 ); - w = parseComplex128( '8.5i' ); - - t.ok( isComplex128( w ), 'is an instance' ); - t.ok( isSameComplex128( w, z ), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will parse a string representation of a complex number (only real part, negative)', function test( t ) { - var z; - var w; - - z = new Complex128( -3.753, 0.0 ); - w = parseComplex128( '-3.753' ); - - t.ok( isComplex128( w ), 'is an instance' ); - t.ok( isSameComplex128( w, z ), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will parse a string representation of a complex number (only imaginary part, negative)', function test( t ) { - var z; - var w; - - z = new Complex128( 0.0, -0.3 ); - w = parseComplex128( '-0.3i' ); - - t.ok( isComplex128( w ), 'is an instance' ); - t.ok( isSameComplex128( w, z ), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function correctly parses a string representation of a complex number with no space (a+ib format)', function test( t ) { - var z; - var w; - - z = new Complex128( 5.0, 3.0 ); - w = parseComplex128( '5+3i' ); - - t.ok( isComplex128( w ), 'is an instance' ); - t.ok( isSameComplex128( w, z ), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function correctly parses a string representation of a complex number with unconventional spacing (a+ ib format)', function test( t ) { - var z; - var w; - - z = new Complex128( 5.0, 3.0 ); - w = parseComplex128( '5+ 3i' ); - - t.ok( isComplex128( w ), 'is an instance' ); - t.ok( isSameComplex128( w, z ), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will parse a string representation of a complex number with NaNs', function test( t ) { - var w = parseComplex128( 'NaN + NaNi' ); - - t.ok( isComplex128(w), 'is an instance' ); - t.ok( isNan(real( w )), 'has expected property value' ); - t.ok( isNan(imag( w )), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will parse a string representation of a complex number with Infinity', function test( t ) { - var z; - var w; - - z = new Complex128( PINF, NINF ); - w = parseComplex128( 'Infinity - Infinityi' ); - - t.ok( isComplex128( w ), 'is an instance' ); - t.ok( isSameComplex128( w, z ), 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will parse a string representation of a complex number in scientific notation', function test( t ) { - var z; - var w; - - z = new Complex128( 1e3, 4.1e-3 ); - w = parseComplex128( '1E3 + 4.1e-3i' ); - - t.ok( isComplex128( w ), 'is an instance' ); - t.ok( isSameComplex128( w, z ), 'has expected property value' ); - - t.end(); -}); diff --git a/float64/real/README.md b/float64/real/README.md deleted file mode 100644 index df0eb059..00000000 --- a/float64/real/README.md +++ /dev/null @@ -1,236 +0,0 @@ - - -# real - -> Return the real component of a double-precision complex floating-point number. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var real = require( '@stdlib/complex/float64/real' ); -``` - -#### real( z ) - -Returns the **real** component of a double-precision complex floating-point number. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z = new Complex128( 5.0, 3.0 ); -var re = real( z ); -// returns 5.0 -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - - - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var real = require( '@stdlib/complex/float64/real' ); - -function random() { - return new Complex128( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); // eslint-disable-line max-len -} - -// Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex128', random ); -// returns - -// Retrieve the real component of each complex number... -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); - console.log( 'real(%s) = %d', z.toString(), real( z ) ); -} -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float64/real.h" -``` - -#### stdlib_complex128_real( z ) - -Returns the real component of a double-precision complex floating-point number. - -```c -#include "stdlib/complex/float64/ctor.h" - -stdlib_complex128_t z = stdlib_complex128( 5.0, 2.0 ); - -// ... - -double re = stdlib_complex128_real( z ); -// returns 5.0 -``` - -The function accepts the following arguments: - -- **z**: `[in] stdlib_complex128_t` double-precision complex floating-point number. - -```c -double stdlib_complex128_real( const stdlib_complex128_t z ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/ctor.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - int i; - for ( i = 0; i < 4; i++ ) { - printf( "real(v) = %lf\n", stdlib_complex128_real( x[ i ] ) ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float64/real/benchmark/benchmark.js b/float64/real/benchmark/benchmark.js deleted file mode 100644 index dc0cafd6..00000000 --- a/float64/real/benchmark/benchmark.js +++ /dev/null @@ -1,57 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex128 = require( './../../../float64/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var pkg = require( './../package.json' ).name; -var real = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var re; - var i; - - values = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - re = real( values[ i%values.length ] ); - if ( isnan( re ) ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( isnan( re ) ) { - b.fail( 'should not return NaN' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/real/benchmark/c/Makefile b/float64/real/benchmark/c/Makefile deleted file mode 100644 index d7adc1ad..00000000 --- a/float64/real/benchmark/c/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles C source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler -# @param {string} CFLAGS - C compiler flags -# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/real/benchmark/c/benchmark.c b/float64/real/benchmark/c/benchmark.c deleted file mode 100644 index 32c5bac2..00000000 --- a/float64/real/benchmark/c/benchmark.c +++ /dev/null @@ -1,135 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include -#include -#include -#include - -#define NAME "creal" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - double elapsed; - double re; - double im; - double v; - double t; - int i; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = rand_double(); - im = rand_double(); - double complex z = re + im*I; - v = creal( z ); - if ( v != v ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( v != v ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/real/benchmark/c/native/Makefile b/float64/real/benchmark/c/native/Makefile deleted file mode 100644 index 7f6bbc4c..00000000 --- a/float64/real/benchmark/c/native/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/real/benchmark/c/native/benchmark.c b/float64/real/benchmark/c/native/benchmark.c deleted file mode 100644 index c137f1f3..00000000 --- a/float64/real/benchmark/c/native/benchmark.c +++ /dev/null @@ -1,139 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include -#include -#include -#include -#include - -#define NAME "real" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - stdlib_complex128_t z; - double elapsed; - double re; - double im; - double v; - double t; - int i; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = rand_double(); - im = rand_double(); - z = stdlib_complex128( re, im ); - v = stdlib_complex128_real( z ); - if ( v != v ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( v != v ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/real/benchmark/julia/REQUIRE b/float64/real/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float64/real/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float64/real/benchmark/julia/benchmark.jl b/float64/real/benchmark/julia/benchmark.jl deleted file mode 100644 index dfdb2ca6..00000000 --- a/float64/real/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "real"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark real( ComplexF64( rand(), rand() ) ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float64/real/docs/repl.txt b/float64/real/docs/repl.txt deleted file mode 100644 index 58e261e1..00000000 --- a/float64/real/docs/repl.txt +++ /dev/null @@ -1,24 +0,0 @@ - -{{alias}}( z ) - Returns the real component of a double-precision complex floating-point - number. - - Parameters - ---------- - z: Complex128 - Complex number. - - Returns - ------- - re: number - Real component. - - Examples - -------- - > var z = new {{alias:@stdlib/complex/float64/ctor}}( 5.0, 3.0 ); - > var re = {{alias}}( z ) - 5.0 - - See Also - -------- - diff --git a/float64/real/docs/types/index.d.ts b/float64/real/docs/types/index.d.ts deleted file mode 100644 index 726826a3..00000000 --- a/float64/real/docs/types/index.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex128 } from '@stdlib/types/complex'; - -/** -* Returns the real component of a double-precision complex floating-point number. -* -* @param z - complex number -* @returns real component -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var re = real( z ); -* // returns 5.0 -*/ -declare function real( z: Complex128 ): number; - - -// EXPORTS // - -export = real; diff --git a/float64/real/docs/types/test.ts b/float64/real/docs/types/test.ts deleted file mode 100644 index 93b12fc8..00000000 --- a/float64/real/docs/types/test.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../float64/ctor' ); -import real = require( './index' ); - - -// TESTS // - -// The function returns a number... -{ - real( new Complex128( 5.0, 3.0 ) ); // $ExpectType number -} - -// The compiler throws an error if the function is provided an argument that is not a complex number... -{ - real( 'abc' ); // $ExpectError - real( 123 ); // $ExpectError - real( true ); // $ExpectError - real( false ); // $ExpectError - real( [] ); // $ExpectError - real( {} ); // $ExpectError - real( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - real(); // $ExpectError - real( new Complex128( 5.0, 3.0 ), 123 ); // $ExpectError -} diff --git a/float64/real/examples/c/Makefile b/float64/real/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float64/real/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/real/examples/c/example.c b/float64/real/examples/c/example.c deleted file mode 100644 index ac21f385..00000000 --- a/float64/real/examples/c/example.c +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/ctor.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - int i; - for ( i = 0; i < 4; i++ ) { - printf( "real(v) = %lf\n", stdlib_complex128_real( x[ i ] ) ); - } -} diff --git a/float64/real/examples/index.js b/float64/real/examples/index.js deleted file mode 100644 index e695bede..00000000 --- a/float64/real/examples/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128 = require( './../../../float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var real = require( './../lib' ); - -function random() { - return new Complex128( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); // eslint-disable-line max-len -} - -// Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex128', random ); -// returns - -// Retrieve the real component of each complex number... -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); - console.log( 'real(%s) = %d', z.toString(), real( z ) ); -} diff --git a/float64/real/include/stdlib/complex/float64/real.h b/float64/real/include/stdlib/complex/float64/real.h deleted file mode 100644 index e376c6b6..00000000 --- a/float64/real/include/stdlib/complex/float64/real.h +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef STDLIB_COMPLEX_FLOAT64_REAL_H -#define STDLIB_COMPLEX_FLOAT64_REAL_H - -#include "stdlib/complex/float64/ctor.h" - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Returns the real component of a double-precision complex floating-point number. -*/ -double stdlib_complex128_real( const stdlib_complex128_t z ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_FLOAT64_REAL_H diff --git a/float64/real/lib/index.js b/float64/real/lib/index.js deleted file mode 100644 index b89fc3bf..00000000 --- a/float64/real/lib/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Return the real component of a double-precision complex floating-point number. -* -* @module @stdlib/complex/float64/real -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var real = require( '@stdlib/complex/float64/real' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var re = real( z ); -* // returns 5.0 -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float64/real/lib/main.js b/float64/real/lib/main.js deleted file mode 100644 index ac627ac3..00000000 --- a/float64/real/lib/main.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Returns the real component of a double-precision complex floating-point number. -* -* @param {Complex} z - complex number -* @returns {number} real component -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var re = real( z ); -* // returns 5.0 -*/ -function real( z ) { - return z.re; -} - - -// EXPORTS // - -module.exports = real; diff --git a/float64/real/manifest.json b/float64/real/manifest.json deleted file mode 100644 index fb0dbf4f..00000000 --- a/float64/real/manifest.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "options": {}, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor" - ] - } - ] -} diff --git a/float64/real/package.json b/float64/real/package.json deleted file mode 100644 index e4c2a2e5..00000000 --- a/float64/real/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@stdlib/complex/float64/real", - "version": "0.0.0", - "description": "Return the real component of a double-precision complex floating-point number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "complex", - "cmplx", - "real", - "re", - "imaginary", - "imag", - "im", - "number" - ] -} diff --git a/float64/real/src/main.c b/float64/real/src/main.c deleted file mode 100644 index 4f0e34cf..00000000 --- a/float64/real/src/main.c +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/ctor.h" - -/** -* Returns the real component of a double-precision complex floating-point number. -* -* @param z double-precision complex floating-point number -* @return real component -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* stdlib_complex128_t z = stdlib_complex128( 5.0, 2.0 ); -* -* // ... -* -* double re = stdlib_complex128_real( z ); -* // returns 5.0 -*/ -double stdlib_complex128_real( const stdlib_complex128_t z ) { - stdlib_complex128_parts_t v; - v.value = z; // cppcheck-suppress unreadVariable - return v.parts[ 0 ]; -} diff --git a/float64/real/test/test.js b/float64/real/test/test.js deleted file mode 100644 index 535694d3..00000000 --- a/float64/real/test/test.js +++ /dev/null @@ -1,45 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex128 = require( './../../../float64/ctor' ); -var real = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof real, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns the real component of a complex number', function test( t ) { - var re; - var z; - - z = new Complex128( 3.14, -3.14 ); - re = real( z ); - t.strictEqual( re, 3.14, 'returns expected value' ); - - t.end(); -}); diff --git a/float64/reim/README.md b/float64/reim/README.md deleted file mode 100644 index 224136b4..00000000 --- a/float64/reim/README.md +++ /dev/null @@ -1,245 +0,0 @@ - - -# reim - -> Return the real and imaginary components of a double-precision complex floating-point number. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var reim = require( '@stdlib/complex/float64/reim' ); -``` - -#### reim( z ) - -Returns the **real** and **imaginary** components of a double-precision complex floating-point number. - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); - -var z = new Complex128( 5.0, 3.0 ); -var out = reim( z ); -// returns [ 5.0, 3.0 ] -``` - -
- - - - - -
- -
- - - - - -
- -## Examples - - - - - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var reim = require( '@stdlib/complex/float64/reim' ); - -function random() { - return new Complex128( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); -} - -// Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex128', random ); -// returns - -// Return the real and imaginary components of each complex number... -var out; -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); - out = reim( z ); - console.log( '%s => %d, %d', z.toString(), out[ 0 ], out[ 1 ] ); -} -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/complex/float64/reim.h" -``` - -#### stdlib_complex128_reim( z, \*re, \*im ) - -Returns the real and imaginary components of a double-precision complex floating-point number. - -```c -#include "stdlib/complex/float64/ctor.h" - -stdlib_complex128_t z = stdlib_complex128( 5.0, 2.0 ); - -// ... - -double re; -double im; - -stdlib_complex128_reim( z, &re, &im ); -``` - -The function accepts the following arguments: - -- **z**: `[in] stdlib_complex128_t` double-precision complex floating-point number. -- **re**: `[out] double*` destination for real component. -- **im**: `[out] double*` destination for imaginary component. - -```c -void stdlib_complex128_reim( const stdlib_complex128_t z, double *re, double *im ); -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#include "stdlib/complex/float64/reim.h" -#include "stdlib/complex/float64/ctor.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - double re; - double im; - int i; - for ( i = 0; i < 4; i++ ) { - stdlib_complex128_reim( x[ i ], &re, &im ); - printf( "reim(v) = %lf, %lf\n", re, im ); - } -} -``` - -
- - - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float64/reim/benchmark/benchmark.js b/float64/reim/benchmark/benchmark.js deleted file mode 100644 index 5b877c81..00000000 --- a/float64/reim/benchmark/benchmark.js +++ /dev/null @@ -1,57 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var Complex128 = require( './../../../float64/ctor' ); -var randu = require( '@stdlib/random/base/randu' ); -var isArrayLike = require( '@stdlib/assert/is-array-like' ); -var pkg = require( './../package.json' ).name; -var reim = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var values; - var arr; - var i; - - values = [ - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ), - new Complex128( randu(), randu() ) - ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = reim( values[ i%values.length ] ); - if ( arr.length === 0 ) { - b.fail( 'should not be empty' ); - } - } - b.toc(); - if ( !isArrayLike( arr ) ) { - b.fail( 'should return an array' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/reim/benchmark/c/Makefile b/float64/reim/benchmark/c/Makefile deleted file mode 100644 index 7f6bbc4c..00000000 --- a/float64/reim/benchmark/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := benchmark.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled benchmarks. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/reim/benchmark/c/benchmark.c b/float64/reim/benchmark/c/benchmark.c deleted file mode 100644 index 3beb9f11..00000000 --- a/float64/reim/benchmark/c/benchmark.c +++ /dev/null @@ -1,138 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/reim.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include -#include -#include -#include -#include - -#define NAME "complex128_reim" -#define ITERATIONS 1000000 -#define REPEATS 3 - -/** -* Prints the TAP version. -*/ -static void print_version( void ) { - printf( "TAP version 13\n" ); -} - -/** -* Prints the TAP summary. -* -* @param total total number of tests -* @param passing total number of passing tests -*/ -static void print_summary( int total, int passing ) { - printf( "#\n" ); - printf( "1..%d\n", total ); // TAP plan - printf( "# total %d\n", total ); - printf( "# pass %d\n", passing ); - printf( "#\n" ); - printf( "# ok\n" ); -} - -/** -* Prints benchmarks results. -* -* @param elapsed elapsed time in seconds -*/ -static void print_results( double elapsed ) { - double rate = (double)ITERATIONS / elapsed; - printf( " ---\n" ); - printf( " iterations: %d\n", ITERATIONS ); - printf( " elapsed: %0.9f\n", elapsed ); - printf( " rate: %0.9f\n", rate ); - printf( " ...\n" ); -} - -/** -* Returns a clock time. -* -* @return clock time -*/ -static double tic( void ) { - struct timeval now; - gettimeofday( &now, NULL ); - return (double)now.tv_sec + (double)now.tv_usec/1.0e6; -} - -/** -* Generates a random number on the interval [0,1). -* -* @return random number -*/ -static double rand_double( void ) { - int r = rand(); - return (double)r / ( (double)RAND_MAX + 1.0 ); -} - -/** -* Runs a benchmark. -* -* @return elapsed time in seconds -*/ -static double benchmark( void ) { - stdlib_complex128_t z; - double elapsed; - double re; - double im; - double t; - int i; - - t = tic(); - for ( i = 0; i < ITERATIONS; i++ ) { - re = rand_double(); - im = rand_double(); - z = stdlib_complex128( re, im ); - stdlib_complex128_reim( z, &re, &im ); - if ( re != re ) { - printf( "should not return NaN\n" ); - break; - } - } - elapsed = tic() - t; - if ( im != im ) { - printf( "should not return NaN\n" ); - } - return elapsed; -} - -/** -* Main execution sequence. -*/ -int main( void ) { - double elapsed; - int i; - - // Use the current time to seed the random number generator: - srand( time( NULL ) ); - - print_version(); - for ( i = 0; i < REPEATS; i++ ) { - printf( "# c::native::%s\n", NAME ); - elapsed = benchmark(); - print_results( elapsed ); - printf( "ok %d benchmark finished\n", i+1 ); - } - print_summary( REPEATS, REPEATS ); -} diff --git a/float64/reim/benchmark/julia/REQUIRE b/float64/reim/benchmark/julia/REQUIRE deleted file mode 100644 index 98645e19..00000000 --- a/float64/reim/benchmark/julia/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 1.5 -BenchmarkTools 0.5.0 diff --git a/float64/reim/benchmark/julia/benchmark.jl b/float64/reim/benchmark/julia/benchmark.jl deleted file mode 100644 index 671c19a0..00000000 --- a/float64/reim/benchmark/julia/benchmark.jl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env julia -# -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import BenchmarkTools -using Printf - -# Benchmark variables: -name = "reim"; -repeats = 3; - -""" - print_version() - -Prints the TAP version. - -# Examples - -``` julia -julia> print_version() -``` -""" -function print_version() - @printf( "TAP version 13\n" ); -end - -""" - print_summary( total, passing ) - -Print the benchmark summary. - -# Arguments - -* `total`: total number of tests -* `passing`: number of passing tests - -# Examples - -``` julia -julia> print_summary( 3, 3 ) -``` -""" -function print_summary( total, passing ) - @printf( "#\n" ); - @printf( "1..%d\n", total ); # TAP plan - @printf( "# total %d\n", total ); - @printf( "# pass %d\n", passing ); - @printf( "#\n" ); - @printf( "# ok\n" ); -end - -""" - print_results( iterations, elapsed ) - -Print benchmark results. - -# Arguments - -* `iterations`: number of iterations -* `elapsed`: elapsed time (in seconds) - -# Examples - -``` julia -julia> print_results( 1000000, 0.131009101868 ) -``` -""" -function print_results( iterations, elapsed ) - rate = iterations / elapsed - - @printf( " ---\n" ); - @printf( " iterations: %d\n", iterations ); - @printf( " elapsed: %0.9f\n", elapsed ); - @printf( " rate: %0.9f\n", rate ); - @printf( " ...\n" ); -end - -""" - benchmark() - -Run a benchmark. - -# Notes - -* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. -* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. -* The elapsed time is in seconds. - -# Examples - -``` julia -julia> out = benchmark(); -``` -""" -function benchmark() - t = BenchmarkTools.@benchmark reim( ComplexF64( rand(), rand() ) ) samples=1e6 - - # Compute the total "elapsed" time and convert from nanoseconds to seconds: - s = sum( t.times ) / 1.0e9; - - # Determine the number of "iterations": - iter = length( t.times ); - - # Return the results: - [ iter, s ]; -end - -""" - main() - -Run benchmarks. - -# Examples - -``` julia -julia> main(); -``` -""" -function main() - print_version(); - for i in 1:repeats - @printf( "# julia::%s\n", name ); - results = benchmark(); - print_results( results[ 1 ], results[ 2 ] ); - @printf( "ok %d benchmark finished\n", i ); - end - print_summary( repeats, repeats ); -end - -main(); diff --git a/float64/reim/docs/repl.txt b/float64/reim/docs/repl.txt deleted file mode 100644 index b1cb3841..00000000 --- a/float64/reim/docs/repl.txt +++ /dev/null @@ -1,24 +0,0 @@ - -{{alias}}( z ) - Returns the real and imaginary components of a double-precision complex - floating-point number. - - Parameters - ---------- - z: Complex128 - Complex number. - - Returns - ------- - out: Float64Array - Array containing the real and imaginary components, respectively. - - Examples - -------- - > var z = new {{alias:@stdlib/complex/float64/ctor}}( 5.0, 3.0 ); - > var out = {{alias}}( z ) - [ 5.0, 3.0 ] - - See Also - -------- - diff --git a/float64/reim/docs/types/index.d.ts b/float64/reim/docs/types/index.d.ts deleted file mode 100644 index f791e242..00000000 --- a/float64/reim/docs/types/index.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Complex128 } from '@stdlib/types/complex'; - -/** -* Returns the real and imaginary components of a double-precision complex floating-point number. -* -* @param z - complex number -* @returns real and imaginary components -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var out = reim( z ); -* // returns [ 5.0, 3.0 ] -*/ -declare function reim( z: Complex128 ): Float64Array; - - -// EXPORTS // - -export = reim; diff --git a/float64/reim/docs/types/test.ts b/float64/reim/docs/types/test.ts deleted file mode 100644 index d1620809..00000000 --- a/float64/reim/docs/types/test.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import Complex128 = require( './../../../../float64/ctor' ); -import reim = require( './index' ); - - -// TESTS // - -// The function returns a floating-point typed array... -{ - reim( new Complex128( 5.0, 3.0 ) ); // $ExpectType Float64Array -} - -// The compiler throws an error if the function is provided an argument that is not a complex number... -{ - reim( 'abc' ); // $ExpectError - reim( 123 ); // $ExpectError - reim( true ); // $ExpectError - reim( false ); // $ExpectError - reim( [] ); // $ExpectError - reim( {} ); // $ExpectError - reim( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - reim(); // $ExpectError - reim( new Complex128( 5.0, 3.0 ), 123 ); // $ExpectError -} diff --git a/float64/reim/examples/c/Makefile b/float64/reim/examples/c/Makefile deleted file mode 100644 index 70c91f4e..00000000 --- a/float64/reim/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/float64/reim/examples/c/example.c b/float64/reim/examples/c/example.c deleted file mode 100644 index 1305d66b..00000000 --- a/float64/reim/examples/c/example.c +++ /dev/null @@ -1,38 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/reim.h" -#include "stdlib/complex/float64/ctor.h" -#include - -int main( void ) { - const stdlib_complex128_t x[] = { - stdlib_complex128( 5.0, 2.0 ), - stdlib_complex128( -2.0, 1.0 ), - stdlib_complex128( 0.0, -0.0 ), - stdlib_complex128( 0.0/0.0, 0.0/0.0 ) - }; - - double re; - double im; - int i; - for ( i = 0; i < 4; i++ ) { - stdlib_complex128_reim( x[ i ], &re, &im ); - printf( "reim(v) = %lf, %lf\n", re, im ); - } -} diff --git a/float64/reim/examples/index.js b/float64/reim/examples/index.js deleted file mode 100644 index 34b137b2..00000000 --- a/float64/reim/examples/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128 = require( './../../../float64/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); -var filledarrayBy = require( '@stdlib/array/filled-by' ); -var reim = require( './../lib' ); - -function random() { - return new Complex128( discreteUniform( -10, 10 ), discreteUniform( -10, 10 ) ); // eslint-disable-line max-len -} - -// Generate an array of random complex numbers: -var x = filledarrayBy( 100, 'complex128', random ); -// returns - -// Return the real and imaginary components of each complex number... -var out; -var z; -var i; -for ( i = 0; i < x.length; i++ ) { - z = x.get( i ); - out = reim( z ); - console.log( '%s => %d, %d', z.toString(), out[ 0 ], out[ 1 ] ); -} diff --git a/float64/reim/include/stdlib/complex/float64/reim.h b/float64/reim/include/stdlib/complex/float64/reim.h deleted file mode 100644 index 642b61b9..00000000 --- a/float64/reim/include/stdlib/complex/float64/reim.h +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef STDLIB_COMPLEX_FLOAT64_REIM_H -#define STDLIB_COMPLEX_FLOAT64_REIM_H - -#include "stdlib/complex/float64/ctor.h" - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Returns the real and imaginary components of a double-precision complex floating-point number. -*/ -void stdlib_complex128_reim( const stdlib_complex128_t z, double *re, double *im ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_COMPLEX_FLOAT64_REIM_H diff --git a/float64/reim/lib/index.js b/float64/reim/lib/index.js deleted file mode 100644 index bf44e74e..00000000 --- a/float64/reim/lib/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Return the real and imaginary components of a double-precision complex floating-point number. -* -* @module @stdlib/complex/float64/reim -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* var reim = require( '@stdlib/complex/float64/reim' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var out = reim( z ); -* // returns [ 5.0, 3.0 ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float64/reim/lib/main.js b/float64/reim/lib/main.js deleted file mode 100644 index f3973e03..00000000 --- a/float64/reim/lib/main.js +++ /dev/null @@ -1,52 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Float64Array = require( '@stdlib/array/float64' ); - - -// MAIN // - -/** -* Returns the real and imaginary components of a double-precision complex floating-point number. -* -* @param {Complex128} z - complex number -* @returns {Float64Array} real and imaginary components -* -* @example -* var Complex128 = require( '@stdlib/complex/float64/ctor' ); -* -* var z = new Complex128( 5.0, 3.0 ); -* -* var out = reim( z ); -* // returns [ 5.0, 3.0 ] -*/ -function reim( z ) { - var out = new Float64Array( 2 ); - out[ 0 ] = z.re; - out[ 1 ] = z.im; - return out; -} - - -// EXPORTS // - -module.exports = reim; diff --git a/float64/reim/manifest.json b/float64/reim/manifest.json deleted file mode 100644 index fb0dbf4f..00000000 --- a/float64/reim/manifest.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "options": {}, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64/ctor" - ] - } - ] -} diff --git a/float64/reim/package.json b/float64/reim/package.json deleted file mode 100644 index e0c82f41..00000000 --- a/float64/reim/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@stdlib/complex/float64/reim", - "version": "0.0.0", - "description": "Return the real and imaginary components of a double-precision complex floating-point number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "mathematics", - "math", - "complex", - "cmplx", - "real", - "re", - "imaginary", - "imag", - "im", - "number" - ] -} diff --git a/float64/reim/src/main.c b/float64/reim/src/main.c deleted file mode 100644 index 5eb3fbe0..00000000 --- a/float64/reim/src/main.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/complex/float64/reim.h" -#include "stdlib/complex/float64/ctor.h" - -/** -* Returns the real and imaginary components of a double-precision complex floating-point number. -* -* @param z double-precision complex floating-point number -* @param re destination for real component -* @param im destination for imaginary component -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* stdlib_complex128_t z = stdlib_complex128( 5.0, 2.0 ); -* -* // ... -* -* double re; -* double im; -* -* stdlib_complex128_reim( z, &re, &im ); -*/ -void stdlib_complex128_reim( const stdlib_complex128_t z, double *re, double *im ) { - stdlib_complex128_parts_t v; - v.value = z; // cppcheck-suppress unreadVariable - *re = v.parts[ 0 ]; - *im = v.parts[ 1 ]; -} diff --git a/float64/reim/test/test.js b/float64/reim/test/test.js deleted file mode 100644 index fbfc7b7b..00000000 --- a/float64/reim/test/test.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var Complex128 = require( './../../../float64/ctor' ); -var Float64Array = require( '@stdlib/array/float64' ); -var reim = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof reim, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns the real and imaginary components of a complex number', function test( t ) { - var expected; - var out; - var z; - - z = new Complex128( 3.14, -3.14 ); - out = reim( z ); - expected = new Float64Array( [ 3.14, -3.14 ] ); - t.strictEqual( out[ 0 ], expected[ 0 ], 'returns expected value' ); - t.strictEqual( out[ 1 ], expected[ 1 ], 'returns expected value' ); - - t.end(); -}); diff --git a/float64/reviver/README.md b/float64/reviver/README.md deleted file mode 100644 index b4bd3360..00000000 --- a/float64/reviver/README.md +++ /dev/null @@ -1,145 +0,0 @@ - - -# reviveComplex128 - -> Revive a JSON-serialized 128-bit [complex number][@stdlib/complex/float64/ctor]. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var reviveComplex128 = require( '@stdlib/complex/float64/reviver' ); -``` - -#### reviveComplex128( key, value ) - -Revives a JSON-serialized 128-bit [complex number][@stdlib/complex/float64/ctor]. - -```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); - -var str = '{"type":"Complex128","re":5,"im":3}'; - -var z = parseJSON( str, reviveComplex128 ); -// returns -``` - -For details on the JSON serialization format, see [`Complex128`][@stdlib/complex/float64/ctor]. - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var parseJSON = require( '@stdlib/utils/parse-json' ); -var reviveComplex128 = require( '@stdlib/complex/float64/reviver' ); - -var z = new Complex128( 5.0, 3.0 ); -var str = JSON.stringify( z ); -// returns '{"type":"Complex128","re":5,"im":3}' - -var w = parseJSON( str, reviveComplex128 ); -if ( w instanceof Error ) { - throw w; -} -var bool = ( w instanceof z.constructor ); -// returns true - -bool = ( w.re === z.re ); -// returns true - -bool = ( w.im === z.im ); -// returns true -``` - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/float64/reviver/benchmark/benchmark.js b/float64/reviver/benchmark/benchmark.js deleted file mode 100644 index ecd89396..00000000 --- a/float64/reviver/benchmark/benchmark.js +++ /dev/null @@ -1,92 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var parseJSON = require( '@stdlib/utils/parse-json' ); -var pkg = require( './../package.json' ).name; -var reviver = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var str; - var o; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - str = '{"type":"Complex128","re":'+i+',"im":'+(i+1)+'}'; - o = parseJSON( str, reviver ); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::no_reviver', function benchmark( b ) { - var str; - var o; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - str = '{"type":"Complex128","re":'+i+',"im":'+(i+1)+'}'; - o = parseJSON( str ); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::no_reviver,built-in', function benchmark( b ) { - var str; - var o; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - str = '{"type":"Complex128","re":'+i+',"im":'+(i+1)+'}'; - o = JSON.parse( str ); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/float64/reviver/docs/repl.txt b/float64/reviver/docs/repl.txt deleted file mode 100644 index 09c3a99c..00000000 --- a/float64/reviver/docs/repl.txt +++ /dev/null @@ -1,26 +0,0 @@ - -{{alias}}( key, value ) - Revives a JSON-serialized 128-bit complex number. - - Parameters - ---------- - key: string - Key. - - value: any - Value. - - Returns - ------- - out: any - Value or complex number. - - Examples - -------- - > var str = '{"type":"Complex128","re":5,"im":3}'; - > var z = {{alias:@stdlib/utils/parse-json}}( str, {{alias}} ) - - - See Also - -------- - diff --git a/float64/reviver/docs/types/index.d.ts b/float64/reviver/docs/types/index.d.ts deleted file mode 100644 index 2f61e256..00000000 --- a/float64/reviver/docs/types/index.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/** -* Revives a JSON-serialized 128-bit complex number. -* -* @param key - key -* @param value - value -* @returns value or 128-bit complex number -* -* @example -* var parseJSON = require( '@stdlib/utils/parse-json' ); -* -* var str = '{"type":"Complex128","re":5,"im":3}'; -* -* var z = parseJSON( str, reviveComplex128 ); -* // returns -*/ -declare function reviveComplex128( key: string, value: any ): any; - - -// EXPORTS // - -export = reviveComplex128; diff --git a/float64/reviver/docs/types/test.ts b/float64/reviver/docs/types/test.ts deleted file mode 100644 index a2fa097f..00000000 --- a/float64/reviver/docs/types/test.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import reviveComplex128 = require( './index' ); - - -// TESTS // - -// The function revives a serialized object... -{ - const o = { - 'type': 'Complex128', - 're': 5, - 'im': 3 - }; - reviveComplex128( 'foo', o ); // $ExpectType any -} - -// The compiler throws an error if the function is provided a first argument that is not a string... -{ - reviveComplex128( true, 1 ); // $ExpectError - reviveComplex128( false, 1 ); // $ExpectError - reviveComplex128( null, 1 ); // $ExpectError - reviveComplex128( undefined, 1 ); // $ExpectError - reviveComplex128( 5, 1 ); // $ExpectError - reviveComplex128( [], 1 ); // $ExpectError - reviveComplex128( {}, 1 ); // $ExpectError - reviveComplex128( ( x: number ): number => x, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided insufficient arguments... -{ - reviveComplex128(); // $ExpectError - reviveComplex128( 'beep' ); // $ExpectError -} diff --git a/float64/reviver/examples/index.js b/float64/reviver/examples/index.js deleted file mode 100644 index 554f0efd..00000000 --- a/float64/reviver/examples/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128 = require( './../../../float64/ctor' ); -var parseJSON = require( '@stdlib/utils/parse-json' ); -var reviveComplex128 = require( './../lib' ); - -var z = new Complex128( 5.0, 3.0 ); -var str = JSON.stringify( z ); -// returns '{"type":"Complex128","re":5,"im":3}' - -var w = parseJSON( str, reviveComplex128 ); -if ( w instanceof Error ) { - throw w; -} -var bool = ( w instanceof z.constructor ); -console.log( bool ); -// => true - -bool = ( w.re === z.re ); -console.log( bool ); -// => true - -bool = ( w.im === z.im ); -console.log( bool ); -// => true diff --git a/float64/reviver/lib/index.js b/float64/reviver/lib/index.js deleted file mode 100644 index ee914b28..00000000 --- a/float64/reviver/lib/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Revive a JSON-serialized 128-bit complex number. -* -* @module @stdlib/complex/float64/reviver -* -* @example -* var parseJSON = require( '@stdlib/utils/parse-json' ); -* var reviveComplex128 = require( '@stdlib/complex/float64/reviver' ); -* -* var str = '{"type":"Complex128","re":5,"im":3}'; -* -* var z = parseJSON( str, reviveComplex128 ); -* // returns -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/float64/reviver/lib/main.js b/float64/reviver/lib/main.js deleted file mode 100644 index 65828fcf..00000000 --- a/float64/reviver/lib/main.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var Complex128 = require( './../../../float64/ctor' ); - - -// MAIN // - -/** -* Revives a JSON-serialized 128-bit complex number. -* -* @param {string} key - key -* @param {*} value - value -* @returns {(*|Complex128)} value or 128-bit complex number -* -* @example -* var parseJSON = require( '@stdlib/utils/parse-json' ); -* -* var str = '{"type":"Complex128","re":5,"im":3}'; -* -* var z = parseJSON( str, reviveComplex128 ); -* // returns -*/ -function reviveComplex128( key, value ) { - if ( - value && - value.type && - value.type === 'Complex128' && - isNumber( value.re ) && - isNumber( value.im ) - ) { - return new Complex128( value.re, value.im ); - } - return value; -} - - -// EXPORTS // - -module.exports = reviveComplex128; diff --git a/float64/reviver/package.json b/float64/reviver/package.json deleted file mode 100644 index 396d8aac..00000000 --- a/float64/reviver/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "@stdlib/complex/float64/reviver", - "version": "0.0.0", - "description": "Revive a JSON-serialized 128-bit complex number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "utils", - "util", - "utilities", - "utility", - "complex", - "complex128", - "cmplx", - "json", - "reviver", - "revive", - "unmarshal", - "deserialize", - "from", - "convert", - "parse", - "object", - "obj" - ] -} diff --git a/float64/reviver/test/test.js b/float64/reviver/test/test.js deleted file mode 100644 index 4cd8213a..00000000 --- a/float64/reviver/test/test.js +++ /dev/null @@ -1,207 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var copy = require( '@stdlib/utils/copy' ); -var parseJSON = require( '@stdlib/utils/parse-json' ); -var Complex128 = require( './../../../float64/ctor' ); -var reviveComplex128 = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof reviveComplex128, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'values which are not recognized as serialized 128-bit complex numbers are unaffected', function test( t ) { - var expected; - var actual; - - expected = { - 'beep': 'boop' - }; - actual = parseJSON( '{"beep":"boop"}', reviveComplex128 ); - - t.deepEqual( actual, expected, 'deep equal' ); - - // Null edge case: - actual = parseJSON( 'null', reviveComplex128 ); - t.strictEqual( actual, null, 'equals null' ); - - t.end(); -}); - -tape( 'an object must have a recognized "type" field in order to be revived', function test( t ) { - var expected; - var actual; - var json; - - json = { - 'type': 'Boop', - 're': 5.0, - 'im': 3.0 - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviveComplex128 ); - - t.deepEqual( actual, expected, 'deep equal' ); - t.end(); -}); - -tape( 'an object must have a numeric "re" field in order to be revived', function test( t ) { - var expected; - var actual; - var json; - - json = { - 'type': 'Complex128', - 'im': 3.0 - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviveComplex128 ); - - t.deepEqual( actual, expected, 'deep equal' ); - - json = { - 'type': 'Complex128', - 'im': 3.0, - 're': '5.0' - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviveComplex128 ); - - t.deepEqual( actual, expected, 'deep equal' ); - - json = { - 'type': 'Complex128', - 'im': 3.0, - 're': null - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviveComplex128 ); - - t.deepEqual( actual, expected, 'deep equal' ); - - t.end(); -}); - -tape( 'an object must have a numeric "im" field in order to be revived', function test( t ) { - var expected; - var actual; - var json; - - json = { - 'type': 'Complex128', - 're': 3.0 - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviveComplex128 ); - - t.deepEqual( actual, expected, 'deep equal' ); - - json = { - 'type': 'Complex128', - 're': 3.0, - 'im': '5.0' - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviveComplex128 ); - - t.deepEqual( actual, expected, 'deep equal' ); - - json = { - 'type': 'Complex128', - 're': 3.0, - 'im': null - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviveComplex128 ); - - t.deepEqual( actual, expected, 'deep equal' ); - - t.end(); -}); - -tape( 'the function will revive a JSON-serialized 128-bit complex number', function test( t ) { - var json; - var z; - var w; - - z = new Complex128( 5.0, 3.0 ); - json = JSON.stringify( z ); - - w = parseJSON( json, reviveComplex128 ); - - t.strictEqual( w instanceof Complex128, true, 'is an instance' ); - t.strictEqual( w.re, z.re, true, 'has expected property value' ); - t.strictEqual( w.im, z.im, true, 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will revive deeply nested serialized 128-bit complex numbers (array)', function test( t ) { - var actual; - var arr; - var i; - - arr = [ - new Complex128( 5.0, 3.0 ), - new Complex128( -2.0, -4.0 ) - ]; - - actual = parseJSON( JSON.stringify( arr ), reviveComplex128 ); - - for ( i = 0; i < arr.length; i++ ) { - t.strictEqual( actual[i] instanceof Complex128, true, 'is an instance' ); - t.strictEqual( actual[i].re, arr[i].re, 'has expected property value' ); - t.strictEqual( actual[i].im, arr[i].im, 'has expected property value' ); - } - t.end(); -}); - -tape( 'the function will revive deeply nested serialized 128-bit complex numbers (object)', function test( t ) { - var actual; - var json; - - json = { - 'beep': { - 'boop': new Complex128( 5.0, 3.0 ) - } - }; - actual = parseJSON( JSON.stringify( json ), reviveComplex128 ); - - t.strictEqual( actual.beep.boop instanceof Complex128, true, 'is an instance' ); - t.strictEqual( actual.beep.boop.re, json.beep.boop.re, 'has expected property value' ); - t.strictEqual( actual.beep.boop.im, json.beep.boop.im, 'has expected property value' ); - - t.end(); -}); diff --git a/float64/test/test.js b/float64/test/test.js deleted file mode 100644 index 2fbefe9d..00000000 --- a/float64/test/test.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - - -// TESTS // - -tape( 'main export is an object', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ns, 'object', 'main export is an object' ); - t.end(); -}); - -tape( 'the exported object contains key-value pairs', function test( t ) { - var keys = objectKeys( ns ); - t.strictEqual( keys.length > 0, true, 'has keys' ); - t.end(); -}); diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 100% rename from docs/types/index.d.ts rename to index.d.ts diff --git a/index.mjs b/index.mjs new file mode 100644 index 00000000..050703c0 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2026 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/utils-define-read-only-property@v0.2.3-esm/index.mjs";import t from"https://cdn.jsdelivr.net/gh/stdlib-js/number-float64-base-assert-is-almost-equal@esm/index.mjs";import n from"https://cdn.jsdelivr.net/gh/stdlib-js/number-float32-base-assert-is-almost-equal@v0.0.0-esm/index.mjs";import r from"https://cdn.jsdelivr.net/gh/stdlib-js/array-float64@v0.2.3-esm/index.mjs";import i from"https://cdn.jsdelivr.net/gh/stdlib-js/array-float32@v0.2.3-esm/index.mjs";import o from"https://cdn.jsdelivr.net/gh/stdlib-js/number-float64-base-assert-is-almost-same-value@v0.1.1-esm/index.mjs";import s from"https://cdn.jsdelivr.net/gh/stdlib-js/number-float32-base-assert-is-almost-same-value@v0.1.1-esm/index.mjs";import a from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-function@v0.2.3-esm/index.mjs";import{isPrimitive as m}from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-nonnegative-integer@v0.2.3-esm/index.mjs";import u from"https://cdn.jsdelivr.net/gh/stdlib-js/string-format@v0.2.3-esm/index.mjs";import l from"https://cdn.jsdelivr.net/gh/stdlib-js/string-replace@v0.2.3-esm/index.mjs";import p from"https://cdn.jsdelivr.net/gh/stdlib-js/number-ctor@v0.2.3-esm/index.mjs";import{isPrimitive as c}from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-number@v0.2.3-esm/index.mjs";import f from"https://cdn.jsdelivr.net/gh/stdlib-js/utils-define-nonenumerable-read-only-property@v0.2.3-esm/index.mjs";import d from"https://cdn.jsdelivr.net/gh/stdlib-js/number-float64-base-to-float32@v0.2.3-esm/index.mjs";import v from"https://cdn.jsdelivr.net/gh/stdlib-js/utils-constructor-name@v0.2.3-esm/index.mjs";import h from"https://cdn.jsdelivr.net/gh/stdlib-js/number-float32-base-assert-is-same-value@esm/index.mjs";import x from"https://cdn.jsdelivr.net/gh/stdlib-js/number-float32-base-assert-is-same-value-zero@esm/index.mjs";import g from"https://cdn.jsdelivr.net/gh/stdlib-js/number-float64-base-to-float32@esm/index.mjs";import{isPrimitive as j}from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-string@v0.2.3-esm/index.mjs";import b from"https://cdn.jsdelivr.net/gh/stdlib-js/string-base-replace@v0.2.3-esm/index.mjs";import w from"https://cdn.jsdelivr.net/gh/stdlib-js/number-float64-base-assert-is-same-value@esm/index.mjs";import y from"https://cdn.jsdelivr.net/gh/stdlib-js/number-float64-base-assert-is-same-value-zero@esm/index.mjs";import E from"https://cdn.jsdelivr.net/gh/stdlib-js/math-base-special-abs@esm/index.mjs";import T from"https://cdn.jsdelivr.net/gh/stdlib-js/math-base-special-max@esm/index.mjs";import N from"https://cdn.jsdelivr.net/gh/stdlib-js/constants-float64-max@esm/index.mjs";import V from"https://cdn.jsdelivr.net/gh/stdlib-js/constants-float64-smallest-normal@esm/index.mjs";import S from"https://cdn.jsdelivr.net/gh/stdlib-js/constants-float64-eps@esm/index.mjs";import C from"https://cdn.jsdelivr.net/gh/stdlib-js/utils-keys@v0.2.3-esm/index.mjs";import _ from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-has-own-property@v0.2.3-esm/index.mjs";function R(e){var t=new r(2);return t[0]=e.re,t[1]=e.im,t}function F(e){var t=new i(2);return t[0]=e.re,t[1]=e.im,t}var L={};e(L,"isAlmostEqual",(function(e,r,i){var o,s,a,m,u;return a=e.BYTES_PER_ELEMENT,m=r.BYTES_PER_ELEMENT,4===a&&4===m?(u=n,o=F(e),s=F(r)):(u=t,o=R(e),s=R(r)),u(o[0],s[0],i)&&u(o[1],s[1],i)})),e(L,"isAlmostSameValue",(function(e,t,n){var r,i,a,m,u;return a=e.BYTES_PER_ELEMENT,m=t.BYTES_PER_ELEMENT,4===a&&4===m?(u=s,r=F(e),i=F(t)):(u=o,r=R(e),i=R(t)),u(r[0],i[0],n)&&u(r[1],i[1],n)}));var P="number";var q="number";var M={};function B(t,n){if(!(this instanceof B))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!c(t))throw new TypeError(u("invalid argument. Real component must be a number. Value: `%s`.",t));if(!c(n))throw new TypeError(u("invalid argument. Imaginary component must be a number. Value: `%s`.",n));return e(this,"re",d(t)),e(this,"im",d(n)),this}function Y(t,n){if(!(this instanceof Y))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!c(t))throw new TypeError(u("invalid argument. Real component must be a number. Value: `%s`.",t));if(!c(n))throw new TypeError(u("invalid argument. Imaginary component must be a number. Value: `%s`.",n));return e(this,"re",t),e(this,"im",n),this}e(M,"assert",L),e(M,"cast",(function(e,t,n){if(!a(e))throw new TypeError(u("invalid argument. First argument must be a function. Value: `%s`.",e));if(!m(t))throw new TypeError(u("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",t));if(!a(n))throw new TypeError(u("invalid argument. Third argument must be a constructor function. Value: `%s`.",n));return t<=5?[function(){var t=e();if(typeof t===P)return new n(t,0);return t},function(t){var r=e(t);if(typeof r===P)return new n(r,0);return r},function(t,r){var i=e(t,r);if(typeof i===P)return new n(i,0);return i},function(t,r,i){var o=e(t,r,i);if(typeof o===P)return new n(o,0);return o},function(t,r,i,o){var s=e(t,r,i,o);if(typeof s===P)return new n(s,0);return s},function(t,r,i,o,s){var a=e(t,r,i,o,s);if(typeof a===P)return new n(a,0);return a}][t]:function(){var t,r,i;for(t=[],i=0;i2){if(r=I($[n]))return new r(e,t);throw new TypeError(u("invalid argument. Must provide a recognized data type. Value: `%s`.",n))}return new k(e,t)}var z={Complex64:"complex64",Complex128:"complex128"},J=["complex64","complex128"];function O(){return J.slice()}var U,Z=O(),D=[];for(U=0;U=ce?(e*=.5,t*=.5,l*=2):m<=fe&&(e*=de,t*=de,l/=de),u>=ce?(n*=.5,r*=.5,l*=.5):u<=fe&&(n*=de,r*=de,l*=de),E(r)<=E(n)?a=pe(e,t,n,r):(a=pe(t,e,r,n))[1]*=-1,a[0]*=l,a[1]*=l,i[s]=a[0],i[s+o]=a[1],i}var he=new r(2);function xe(e,t){var n,r,i,o;return n=oe(e),r=oe(t),i=se(e),o=se(t),new Y((he=ve(n,i,r,o,he,1,0))[0],he[1])}function ge(e,t){var n=oe(e),r=oe(t),i=se(e),o=se(t);return new Y(n*r-i*o,n*o+i*r)}function je(e,t,n){var r=oe(e),i=se(e),o=oe(t),s=se(t);return new Y(r*o-i*s+oe(n),r*s+i*o+se(n))}function be(e,t){return new Y(oe(t)*e,se(t)*e)}f(xe,"assign",ve),f(xe,"strided",(function(e,t,n,r,i,o,s,a,m){return ve(e[n],e[n+t],r[o],r[o+i],s,a,m)})),f(ge,"assign",(function(e,t,n,r,i,o,s){return i[s]=e*n-t*r,i[s+o]=e*r+t*n,i})),f(ge,"strided",(function(e,t,n,r,i,o,s,a,m){var u=e[n],l=e[n+t],p=r[o],c=r[o+i];return s[m]=u*p-l*c,s[m+a]=u*c+l*p,s})),f(je,"assign",(function(e,t,n,r,i,o,s,a,m){return s[m]=e*n-t*r+i,s[m+a]=e*r+t*n+o,s})),f(je,"strided",(function(e,t,n,r,i,o,s,a,m,u,l,p){var c=e[n],f=e[n+t],d=r[o],v=r[o+i],h=s[m],x=s[m+a];return u[p]=c*d-f*v+h,u[p+l]=c*v+f*d+x,u})),f(be,"assign",(function(e,t,n,r,i,o){return r[o]=t*e,r[o+i]=n*e,r})),f(be,"strided",(function(e,t,n,r,i,o,s){return i[s]=e*t[r],i[s+o]=e*t[r+n],i}));var we={};e(we,"add",ae),e(we,"add3",me),e(we,"assert",ue),e(we,"div",xe),e(we,"identity",(function(e){return e})),e(we,"mul",ge),e(we,"muladd",je),e(we,"neg",(function(e){return new Y(-oe(e),-se(e))})),e(we,"scale",be),e(we,"sub",(function(e,t){return new Y(oe(e)-oe(t),se(e)-se(t))}));var ye={};e(ye,"base",we),e(ye,"conj",(function(e){return new Y(oe(e),-se(e))})),e(ye,"Complex128",Y),e(ye,"imag",se),e(ye,"parseComplex128",(function(e){var t,n,r=0;if(!j(e))throw new TypeError(u("invalid argument. First argument must be a string. Value: `%s`.",e));if(!(t=b(e,/\s/g,"").match(/^([-+]?(\d*\.?\d*(?:[eE][-+]?\d+)?|Infinity|NaN)i?)?([-+])?((\d*\.?\d*(?:[eE][-+]?\d+)?|Infinity|NaN)i)?$/)))throw new Error(u("invalid argument. Unable to parse input string as a complex number. Value: `%s`.",e));return n=t[1]&&!t[1].endsWith("i")?parseFloat(t[1]):0,t[4]?r=("-"===t[3]?-1:1)*parseFloat(b(t[4],/i$/,"")):t[1]&&t[1].endsWith("i")&&(r=parseFloat(b(t[1],/i$/,""))),new Y(n,r)})),e(ye,"real",oe),e(ye,"reim",R),e(ye,"reviveComplex128",(function(e,t){return t&&t.type&&"Complex128"===t.type&&c(t.re)&&c(t.im)?new Y(t.re,t.im):t}));var Ee={float64:{complex64:"complex128",complex128:"complex128"},float32:{complex64:"complex64",complex128:"complex128"},int32:{complex64:"complex128",complex128:"complex128"},int16:{complex64:"complex64",complex128:"complex128"},int8:{complex64:"complex64",complex128:"complex128"},uint32:{complex64:"complex128",complex128:"complex128"},uint16:{complex64:"complex64",complex128:"complex128"},uint8:{complex64:"complex64",complex128:"complex128"},uint8c:{complex64:"complex64",complex128:"complex128"},complex128:{float64:"complex128",float32:"complex128",int32:"complex128",int16:"complex128",int8:"complex128",uint32:"complex128",uint16:"complex128",uint8:"complex128",uint8c:"complex128",complex64:"complex128",complex128:"complex128"},complex64:{float64:"complex128",float32:"complex64",int32:"complex128",int16:"complex64",int8:"complex64",uint32:"complex128",uint16:"complex64",uint8:"complex64",uint8c:"complex64",complex64:"complex64",complex128:"complex128"}};function Te(e,t){var n;return 0===arguments.length?function(){var e,t,n,r,i,o,s,a,m;for(n={},t=(e=C(Ee)).length,m=0;m[ 5.0, 3.0 ]\n*/\nfunction reim( z ) {\n\tvar out = new Float64Array( 2 );\n\tout[ 0 ] = z.re;\n\tout[ 1 ] = z.im;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default reim;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Float32Array from '@stdlib/array/float32';\n\n\n// MAIN //\n\n/**\n* Returns the real and imaginary components of a single-precision complex floating-point number.\n*\n* @param {Complex64} z - complex number\n* @returns {Float32Array} real and imaginary components\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var out = reim( z );\n* // returns [ 5.0, 3.0 ]\n*/\nfunction reim( z ) {\n\tvar out = new Float32Array( 2 );\n\tout[ 0 ] = z.re;\n\tout[ 1 ] = z.im;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default reim;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name isAlmostEqual\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/base/assert/is-almost-equal}\n*/\nimport isAlmostEqual from './../../../base/assert/is-almost-equal';\nsetReadOnly( ns, 'isAlmostEqual', isAlmostEqual );\n\n/**\n* @name isAlmostSameValue\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/base/assert/is-almost-same-value}\n*/\nimport isAlmostSameValue from './../../../base/assert/is-almost-same-value';\nsetReadOnly( ns, 'isAlmostSameValue', isAlmostSameValue );\n\n\n// EXPORTS //\n\nexport default ns;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isAlmostEqualF64 from '@stdlib/number/float64/base/assert/is-almost-equal';\nimport isAlmostEqualF32 from '@stdlib/number/float32/base/assert/is-almost-equal';\nimport reim from './../../../../float64/reim';\nimport reimf from './../../../../float32/reim';\n\n\n// MAIN //\n\n/**\n* Tests whether two complex numbers are approximately equal within a specified number of ULPs (units in the last place).\n*\n* ## Notes\n*\n* - The function returns `false` if either input value has a `NaN` real or imaginary component.\n* - The function does not distinguish between `-0` and `+0`, treating them as equal.\n*\n* @param {ComplexLike} z1 - first complex number\n* @param {ComplexLike} z2 - second complex number\n* @param {number} maxULP - maximum allowed ULP difference\n* @returns {boolean} boolean indicating whether two complex numbers are approximately equal within a specified number of ULPs\n*\n* @example\n* import EPS from '@stdlib/constants/float64/eps';\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z1 = new Complex128( 1.0, 3.0 );\n* var z2 = new Complex128( 1.0+EPS, 3.0 );\n*\n* var bool = isAlmostEqual( z1, z2, 0 );\n* // returns false\n*\n* bool = isAlmostEqual( z1, z2, 1 );\n* // returns true\n*/\nfunction isAlmostEqual( z1, z2, maxULP ) {\n\tvar parts1;\n\tvar parts2;\n\tvar nb1;\n\tvar nb2;\n\tvar f;\n\n\t// Complex-like values will not, in general, have these properties, but complex instances will, thus allowing us to distinguish between complex number data types without expensive constructor checks, including when given cross-realm complex number instances:\n\tnb1 = z1.BYTES_PER_ELEMENT;\n\tnb2 = z2.BYTES_PER_ELEMENT;\n\n\t// Case: isAlmostEqual( complex64, complex64 )\n\tif ( nb1 === 4 && nb2 === 4 ) {\n\t\tf = isAlmostEqualF32;\n\t\tparts1 = reimf( z1 );\n\t\tparts2 = reimf( z2 );\n\t}\n\t// Case: isAlmostEqual( complexLike, complexLike )\n\telse {\n\t\tf = isAlmostEqualF64;\n\t\tparts1 = reim( z1 );\n\t\tparts2 = reim( z2 );\n\t}\n\treturn (\n\t\tf( parts1[ 0 ], parts2[ 0 ], maxULP ) &&\n\t\tf( parts1[ 1 ], parts2[ 1 ], maxULP )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isAlmostEqual;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isAlmostSameValueF64 from '@stdlib/number/float64/base/assert/is-almost-same-value';\nimport isAlmostSameValueF32 from '@stdlib/number/float32/base/assert/is-almost-same-value';\nimport reim from './../../../../float64/reim';\nimport reimf from './../../../../float32/reim';\n\n\n// MAIN //\n\n/**\n* Tests whether two complex numbers are approximately the same value within a specified number of ULPs (units in the last place).\n*\n* ## Notes\n*\n* - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5.\n* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.\n*\n* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12\n*\n* @param {ComplexLike} z1 - first complex number\n* @param {ComplexLike} z2 - second complex number\n* @param {number} maxULP - maximum allowed ULP difference\n* @returns {boolean} boolean indicating whether two complex numbers are approximately the same value within a specified number of ULPs\n*\n* @example\n* import EPS from '@stdlib/constants/float64/eps';\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z1 = new Complex128( 1.0, 3.0 );\n* var z2 = new Complex128( 1.0+EPS, 3.0 );\n*\n* var bool = isAlmostSameValue( z1, z2, 0 );\n* // returns false\n*\n* bool = isAlmostSameValue( z1, z2, 1 );\n* // returns true\n*/\nfunction isAlmostSameValue( z1, z2, maxULP ) {\n\tvar parts1;\n\tvar parts2;\n\tvar nb1;\n\tvar nb2;\n\tvar f;\n\n\t// Complex-like values will not, in general, have these properties, but complex instances will, thus allowing us to distinguish between complex number data types without expensive constructor checks, including when given cross-realm complex number instances:\n\tnb1 = z1.BYTES_PER_ELEMENT;\n\tnb2 = z2.BYTES_PER_ELEMENT;\n\n\t// Case: isAlmostSameValue( complex64, complex64 )\n\tif ( nb1 === 4 && nb2 === 4 ) {\n\t\tf = isAlmostSameValueF32;\n\t\tparts1 = reimf( z1 );\n\t\tparts2 = reimf( z2 );\n\t}\n\t// Case: isAlmostSameValue( complexLike, complexLike )\n\telse {\n\t\tf = isAlmostSameValueF64;\n\t\tparts1 = reim( z1 );\n\t\tparts2 = reim( z2 );\n\t}\n\treturn (\n\t\tf( parts1[ 0 ], parts2[ 0 ], maxULP ) &&\n\t\tf( parts1[ 1 ], parts2[ 1 ], maxULP )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isAlmostSameValue;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable valid-typeof */\n\n'use strict';\n\n// MODULES //\n\nimport isFunction from '@stdlib/assert/is-function';\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar T = 'number';\n\n\n// FUNCTIONS //\n\n/**\n* Wraps a function and casts a function's return value to a complex number.\n*\n* ## Notes\n*\n* - The returned function **assumes** that the wrapped function returns either a real or complex number.\n* - The returned function **assumes** that, if a return value is non-numeric (i.e., not of type `number`), then the return value is a complex number. The returned function does **not** verify that non-numeric return values are, in fact, complex number objects. The returned function returns non-numeric return values from the wrapped function without modification.\n*\n* @param {Function} fcn - function to wrap\n* @param {NonNegativeInteger} nargs - number of arguments\n* @param {Function} ctor - complex number constructor\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {TypeError} third argument must be a constructor function\n* @returns {Function} wrapped function\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n* import addf from '@stdlib/number/float32/base/add';\n*\n* var f = wrap( addf, 2, Complex64 );\n*\n* // ...\n*\n* var z = f( 3.0, 4.0 );\n* // returns [ 7.0, 0.0 ]\n*/\nfunction wrap( fcn, nargs, ctor ) {\n\tvar fcns;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isNonNegativeInteger( nargs ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', nargs ) );\n\t}\n\tif ( !isFunction( ctor ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a constructor function. Value: `%s`.', ctor ) );\n\t}\n\tfcns = [ fcn0, fcn1, fcn2, fcn3, fcn4, fcn5 ];\n\treturn ( nargs <= 5 ) ? fcns[ nargs ] : fcnN;\n\n\t/**\n\t* Invokes a nullary function and returns a complex number.\n\t*\n\t* @private\n\t* @returns {Complex} result\n\t*/\n\tfunction fcn0() {\n\t\tvar r = fcn();\n\t\tif ( typeof r === T ) {\n\t\t\treturn new ctor( r, 0.0 );\n\t\t}\n\t\treturn r;\n\t}\n\n\t/**\n\t* Invokes a unary function and returns a complex number.\n\t*\n\t* @private\n\t* @param {*} x - input value\n\t* @returns {Complex} result\n\t*/\n\tfunction fcn1( x ) {\n\t\tvar r = fcn( x );\n\t\tif ( typeof r === T ) {\n\t\t\treturn new ctor( r, 0.0 );\n\t\t}\n\t\treturn r;\n\t}\n\n\t/**\n\t* Invokes a binary function and returns a complex number.\n\t*\n\t* @private\n\t* @param {*} x - input value\n\t* @param {*} y - input value\n\t* @returns {Complex} result\n\t*/\n\tfunction fcn2( x, y ) {\n\t\tvar r = fcn( x, y );\n\t\tif ( typeof r === T ) {\n\t\t\treturn new ctor( r, 0.0 );\n\t\t}\n\t\treturn r;\n\t}\n\n\t/**\n\t* Invokes a ternary function and returns a complex number.\n\t*\n\t* @private\n\t* @param {*} x - input value\n\t* @param {*} y - input value\n\t* @param {*} z - input value\n\t* @returns {Complex} result\n\t*/\n\tfunction fcn3( x, y, z ) {\n\t\tvar r = fcn( x, y, z );\n\t\tif ( typeof r === T ) {\n\t\t\treturn new ctor( r, 0.0 );\n\t\t}\n\t\treturn r;\n\t}\n\n\t/**\n\t* Invokes a quaternary function and returns a complex number.\n\t*\n\t* @private\n\t* @param {*} x - input value\n\t* @param {*} y - input value\n\t* @param {*} z - input value\n\t* @param {*} w - input value\n\t* @returns {Complex} result\n\t*/\n\tfunction fcn4( x, y, z, w ) {\n\t\tvar r = fcn( x, y, z, w );\n\t\tif ( typeof r === T ) {\n\t\t\treturn new ctor( r, 0.0 );\n\t\t}\n\t\treturn r;\n\t}\n\n\t/**\n\t* Invokes a quinary function and returns a complex number.\n\t*\n\t* @private\n\t* @param {*} x - input value\n\t* @param {*} y - input value\n\t* @param {*} z - input value\n\t* @param {*} w - input value\n\t* @param {*} v - input value\n\t* @returns {Complex} result\n\t*/\n\tfunction fcn5( x, y, z, w, v ) {\n\t\tvar r = fcn( x, y, z, w, v );\n\t\tif ( typeof r === T ) {\n\t\t\treturn new ctor( r, 0.0 );\n\t\t}\n\t\treturn r;\n\t}\n\n\t/**\n\t* Invokes a function and returns a complex number.\n\t*\n\t* @private\n\t* @param {...*} args - input values\n\t* @returns {Complex} result\n\t*/\n\tfunction fcnN() {\n\t\tvar args;\n\t\tvar r;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\tr = fcn.apply( null, args );\n\t\tif ( typeof r === T ) {\n\t\t\treturn new ctor( r, 0.0 );\n\t\t}\n\t\treturn r;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default wrap;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable valid-typeof */\n\n'use strict';\n\n// MODULES //\n\nimport isFunction from '@stdlib/assert/is-function';\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert/is-nonnegative-integer';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar T = 'number';\n\n\n// FUNCTIONS //\n\n/**\n* Wraps a function accepting complex number arguments to support providing both real and complex numbers.\n*\n* ## Notes\n*\n* - The returned function **assumes** that the wrapped function accepts **only** complex number input arguments (i.e., every argument must be a complex number).\n* - The returned function **assumes** that, if an input argument is non-numeric (i.e., not of type `number`), then the input argument is a complex number. The returned function does **not** verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification.\n*\n* @param {Function} fcn - function to wrap\n* @param {NonNegativeInteger} nargs - number of arguments\n* @param {Function} ctor - complex number constructor\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {TypeError} third argument must be a constructor function\n* @returns {Function} wrapped function\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n* import caddf from '@stdlib/complex/float32/base/add';\n*\n* var f = wrap( caddf, 2, Complex64 );\n*\n* // ...\n*\n* var z = f( 3.0, 4.0 );\n* // returns [ 7.0, 0.0 ]\n*/\nfunction wrap( fcn, nargs, ctor ) {\n\tvar fcns;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isNonNegativeInteger( nargs ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', nargs ) );\n\t}\n\tif ( !isFunction( ctor ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a constructor function. Value: `%s`.', ctor ) );\n\t}\n\tfcns = [ fcn0, fcn1, fcn2, fcn3, fcn4, fcn5 ];\n\treturn ( nargs <= 5 ) ? fcns[ nargs ] : fcnN;\n\n\t/**\n\t* Invokes a nullary function.\n\t*\n\t* @private\n\t* @returns {*} result\n\t*/\n\tfunction fcn0() {\n\t\treturn fcn();\n\t}\n\n\t/**\n\t* Invokes a unary function accepting complex numbers.\n\t*\n\t* @private\n\t* @param {(number|Complex)} x - input value\n\t* @returns {*} result\n\t*/\n\tfunction fcn1( x ) {\n\t\tif ( typeof x === T ) {\n\t\t\tx = new ctor( x, 0.0 );\n\t\t}\n\t\treturn fcn( x );\n\t}\n\n\t/**\n\t* Invokes a binary function accepting complex numbers.\n\t*\n\t* @private\n\t* @param {(number|Complex)} x - input value\n\t* @param {(number|Complex)} y - input value\n\t* @returns {*} result\n\t*/\n\tfunction fcn2( x, y ) {\n\t\tif ( typeof x === T ) {\n\t\t\tx = new ctor( x, 0.0 );\n\t\t}\n\t\tif ( typeof y === T ) {\n\t\t\ty = new ctor( y, 0.0 );\n\t\t}\n\t\treturn fcn( x, y );\n\t}\n\n\t/**\n\t* Invokes a ternary function accepting complex numbers.\n\t*\n\t* @private\n\t* @param {(number|Complex)} x - input value\n\t* @param {(number|Complex)} y - input value\n\t* @param {(number|Complex)} z - input value\n\t* @returns {*} result\n\t*/\n\tfunction fcn3( x, y, z ) {\n\t\tif ( typeof x === T ) {\n\t\t\tx = new ctor( x, 0.0 );\n\t\t}\n\t\tif ( typeof y === T ) {\n\t\t\ty = new ctor( y, 0.0 );\n\t\t}\n\t\tif ( typeof z === T ) {\n\t\t\tz = new ctor( z, 0.0 );\n\t\t}\n\t\treturn fcn( x, y, z );\n\t}\n\n\t/**\n\t* Invokes a quaternary function accepting complex numbers.\n\t*\n\t* @private\n\t* @param {(number|Complex)} x - input value\n\t* @param {(number|Complex)} y - input value\n\t* @param {(number|Complex)} z - input value\n\t* @param {(number|Complex)} w - input value\n\t* @returns {*} result\n\t*/\n\tfunction fcn4( x, y, z, w ) {\n\t\tif ( typeof x === T ) {\n\t\t\tx = new ctor( x, 0.0 );\n\t\t}\n\t\tif ( typeof y === T ) {\n\t\t\ty = new ctor( y, 0.0 );\n\t\t}\n\t\tif ( typeof z === T ) {\n\t\t\tz = new ctor( z, 0.0 );\n\t\t}\n\t\tif ( typeof w === T ) {\n\t\t\tw = new ctor( w, 0.0 );\n\t\t}\n\t\treturn fcn( x, y, z, w );\n\t}\n\n\t/**\n\t* Invokes a quinary function accepting complex numbers.\n\t*\n\t* @private\n\t* @param {(number|Complex)} x - input value\n\t* @param {(number|Complex)} y - input value\n\t* @param {(number|Complex)} z - input value\n\t* @param {(number|Complex)} w - input value\n\t* @param {(number|Complex)} v - input value\n\t* @returns {*} result\n\t*/\n\tfunction fcn5( x, y, z, w, v ) {\n\t\tif ( typeof x === T ) {\n\t\t\tx = new ctor( x, 0.0 );\n\t\t}\n\t\tif ( typeof y === T ) {\n\t\t\ty = new ctor( y, 0.0 );\n\t\t}\n\t\tif ( typeof z === T ) {\n\t\t\tz = new ctor( z, 0.0 );\n\t\t}\n\t\tif ( typeof w === T ) {\n\t\t\tw = new ctor( w, 0.0 );\n\t\t}\n\t\tif ( typeof v === T ) {\n\t\t\tv = new ctor( v, 0.0 );\n\t\t}\n\t\treturn fcn( x, y, z, w, v );\n\t}\n\n\t/**\n\t* Invokes a function accepting an arbitrary number of complex number input arguments.\n\t*\n\t* @private\n\t* @param {...(number|Complex)} args - input values\n\t* @returns {*} result\n\t*/\n\tfunction fcnN() {\n\t\tvar args;\n\t\tvar v;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\tv = arguments[ i ];\n\t\t\tif ( typeof v === T ) {\n\t\t\t\tv = new ctor( v, 0.0 );\n\t\t\t}\n\t\t\targs.push( v );\n\t\t}\n\t\treturn fcn.apply( null, args );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default wrap;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name assert\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/complex/base/assert}\n*/\nimport assert from './../../base/assert';\nsetReadOnly( ns, 'assert', assert );\n\n/**\n* @name cast\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/base/cast-return}\n*/\nimport cast from './../../base/cast-return';\nsetReadOnly( ns, 'cast', cast );\n\n/**\n* @name parse\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/base/parse}\n*/\nimport parse from './../../base/parse';\nsetReadOnly( ns, 'parse', parse );\n\n/**\n* @name wrap\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/base/wrap-function}\n*/\nimport wrap from './../../base/wrap-function';\nsetReadOnly( ns, 'wrap', wrap );\n\n\n// EXPORTS //\n\nexport default ns;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\nimport setEnumerableReadOnly from '@stdlib/utils/define-read-only-property';\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport float64ToFloat32 from '@stdlib/number/float64/base/to-float32';\nimport format from '@stdlib/string/format';\nimport toStr from './tostring.js';\nimport toJSON from './tojson.js';\n\n\n// MAIN //\n\n/**\n* 64-bit complex number constructor.\n*\n* @constructor\n* @param {number} real - real component\n* @param {number} imag - imaginary component\n* @throws {TypeError} must invoke using the `new` keyword\n* @throws {TypeError} real component must be a number\n* @throws {TypeError} imaginary component must be a number\n* @returns {Complex64} 64-bit complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n* // returns \n*/\nfunction Complex64( real, imag ) {\n\tif ( !( this instanceof Complex64 ) ) {\n\t\tthrow new TypeError( 'invalid invocation. Constructor must be called with the `new` keyword.' );\n\t}\n\tif ( !isNumber( real ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Real component must be a number. Value: `%s`.', real ) );\n\t}\n\tif ( !isNumber( imag ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Imaginary component must be a number. Value: `%s`.', imag ) );\n\t}\n\tsetEnumerableReadOnly( this, 're', float64ToFloat32( real ) );\n\tsetEnumerableReadOnly( this, 'im', float64ToFloat32( imag ) );\n\treturn this;\n}\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex64\n* @readonly\n* @type {string}\n* @default 'Complex64'\n*\n* @example\n* var name = Complex64.name;\n* // returns 'Complex64'\n*/\nsetReadOnly( Complex64, 'name', 'Complex64' );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var nbytes = Complex64.BYTES_PER_ELEMENT;\n* // returns 4\n*/\nsetReadOnly( Complex64, 'BYTES_PER_ELEMENT', 4 );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64.prototype\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var nbytes = z.BYTES_PER_ELEMENT;\n* // returns 4\n*/\nsetReadOnly( Complex64.prototype, 'BYTES_PER_ELEMENT', 4 );\n\n/**\n* Length (in bytes) of a complex number.\n*\n* @name byteLength\n* @memberof Complex64.prototype\n* @type {integer}\n* @returns {integer} byte length\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var nbytes = z.byteLength;\n* // returns 8\n*/\nsetReadOnly( Complex64.prototype, 'byteLength', 8 );\n\n/**\n* Serializes a complex number as a string.\n*\n* @name toString\n* @memberof Complex64.prototype\n* @type {Function}\n* @returns {string} serialized complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var str = z.toString();\n* // returns '5 + 3i'\n*/\nsetReadOnly( Complex64.prototype, 'toString', toStr );\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `Complex64` instance.\n*\n* @name toJSON\n* @memberof Complex64.prototype\n* @type {Function}\n* @returns {Object} serialized complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var obj = z.toJSON();\n* // returns { 'type': 'Complex64', 're': 5.0, 'im': 3.0 }\n*/\nsetReadOnly( Complex64.prototype, 'toJSON', toJSON );\n\n\n// EXPORTS //\n\nexport default Complex64;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\nimport setEnumerableReadOnly from '@stdlib/utils/define-read-only-property';\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport format from '@stdlib/string/format';\nimport toStr from './tostring.js';\nimport toJSON from './tojson.js';\n\n\n// MAIN //\n\n/**\n* 128-bit complex number constructor.\n*\n* @constructor\n* @param {number} real - real component\n* @param {number} imag - imaginary component\n* @throws {TypeError} must invoke using the `new` keyword\n* @throws {TypeError} real component must be a number\n* @throws {TypeError} imaginary component must be a number\n* @returns {Complex128} 128-bit complex number\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n* // returns \n*/\nfunction Complex128( real, imag ) {\n\tif ( !( this instanceof Complex128 ) ) {\n\t\tthrow new TypeError( 'invalid invocation. Constructor must be called with the `new` keyword.' );\n\t}\n\tif ( !isNumber( real ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Real component must be a number. Value: `%s`.', real ) );\n\t}\n\tif ( !isNumber( imag ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Imaginary component must be a number. Value: `%s`.', imag ) );\n\t}\n\tsetEnumerableReadOnly( this, 're', real );\n\tsetEnumerableReadOnly( this, 'im', imag );\n\treturn this;\n}\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex128\n* @readonly\n* @type {string}\n* @default 'Complex128'\n*\n* @example\n* var name = Complex128.name;\n* // returns 'Complex128'\n*/\nsetReadOnly( Complex128, 'name', 'Complex128' );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var nbytes = Complex128.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex128, 'BYTES_PER_ELEMENT', 8 );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128.prototype\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var nbytes = z.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex128.prototype, 'BYTES_PER_ELEMENT', 8 );\n\n/**\n* Length (in bytes) of a complex number.\n*\n* @name byteLength\n* @memberof Complex128.prototype\n* @type {integer}\n* @returns {integer} byte length\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var nbytes = z.byteLength;\n* // returns 16\n*/\nsetReadOnly( Complex128.prototype, 'byteLength', 16 );\n\n/**\n* Serializes a complex number as a string.\n*\n* @name toString\n* @memberof Complex128.prototype\n* @type {Function}\n* @returns {string} serialized complex number\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var str = z.toString();\n* // returns '5 + 3i'\n*/\nsetReadOnly( Complex128.prototype, 'toString', toStr );\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `Complex128` instance.\n*\n* @name toJSON\n* @memberof Complex128.prototype\n* @type {Function}\n* @returns {Object} serialized complex number\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var obj = z.toJSON();\n* // returns { 'type': 'Complex128', 're': 5.0, 'im': 3.0 }\n*/\nsetReadOnly( Complex128.prototype, 'toJSON', toJSON );\n\n\n// EXPORTS //\n\nexport default Complex128;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport replace from '@stdlib/string/replace';\nimport Number from '@stdlib/number/ctor';\n\n\n// MAIN //\n\n/**\n* Parses a string representing a complex number into a complex-like object.\n*\n* ## Notes\n*\n* - The function returns an object containing the following properties:\n*\n* - **re**: real component\n* - **im**: imaginary component\n*\n* @param {string} str - input string\n* @returns {ComplexLike} an object containing real and imaginary parts\n*\n* @example\n* var str = '4 + 6i';\n*\n* var z = parse( str );\n* // returns { 're': 4, 'im': 6 }\n*/\nfunction parse( str ) {\n\tvar imaginaryParts = [];\n\tvar currentToken = '';\n\tvar isImaginary;\n\tvar realParts = [];\n\tvar parts = [];\n\tvar valid = true;\n\tvar value;\n\tvar part;\n\tvar re = 0;\n\tvar im = 0;\n\n\tvar i;\n\tif ( typeof str !== 'string' ) {\n\t\treturn null;\n\t}\n\n\tstr = replace( str, ' ', '' );\n\tfor ( i = 0; i < str.length; i++ ) {\n\t\tif ( (str[i] === '+' || str[i] === '-') && i !== 0 && str[i - 1] !== 'e' ) {\n\t\t\tparts.push( currentToken );\n\t\t\tcurrentToken = '';\n\t\t} else if ( i === str.length - 1 ) {\n\t\t\tcurrentToken += str[ i ];\n\t\t\tparts.push( currentToken );\n\t\t}\n\t\tcurrentToken += str[ i ];\n\t}\n\n\tfor ( i = 0; i < parts.length; i++ ) { // Check for invalid parts...\n\t\tpart = parts[ i ];\n\t\tisImaginary = false;\n\n\t\t// Check for Iota on either sides:\n\t\tif ( part[0] === 'i' ) {\n\t\t\tpart = part.slice( 1 );\n\t\t\tisImaginary = true;\n\t\t} else if ( part[part.length - 1] === 'i' ) {\n\t\t\tpart = part.slice( 0, part.length - 1 );\n\t\t\tisImaginary = true;\n\t\t}\n\n\t\tvalue = Number( part );\n\t\tif ( isNaN( value ) && part !== 'NaN' && part !== '+NaN' && part !== '-NaN' ) {\n\t\t\tvalid = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tif ( isImaginary ) {\n\t\t\timaginaryParts.push( value );\n\t\t}\n\t\telse {\n\t\t\trealParts.push( value );\n\t\t}\n\t}\n\n\tif ( !valid ) {\n\t\treturn null;\n\t}\n\n\tfor ( i = 0; i < realParts.length; i++ ) {\n\t\tre += realParts[i];\n\t}\n\tfor ( i = 0; i < imaginaryParts.length; i++ ) {\n\t\tim += imaginaryParts[i];\n\t}\n\n\treturn {\n\t\t're': re,\n\t\t'im': im\n\t};\n}\n\n\n// EXPORTS //\n\nexport default parse;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a string.\n*\n* @private\n* @returns {string} serialized complex number\n*/\nfunction toString() { // eslint-disable-line stdlib/no-redeclare\n\t/* eslint-disable no-invalid-this */\n\tvar str = '' + this.re;\n\tif ( this.im < 0 ) {\n\t\tstr += ' - ' + (-this.im);\n\t} else {\n\t\tstr += ' + ' + this.im;\n\t}\n\tstr += 'i';\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* @private\n* @returns {Object} JSON representation\n*/\nfunction toJSON() {\n\t/* eslint-disable no-invalid-this */\n\tvar out = {};\n\tout.type = 'Complex64';\n\tout.re = this.re;\n\tout.im = this.im;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default toJSON;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a string.\n*\n* @private\n* @returns {string} serialized complex number\n*/\nfunction toString() { // eslint-disable-line stdlib/no-redeclare\n\t/* eslint-disable no-invalid-this */\n\tvar str = '' + this.re;\n\tif ( this.im < 0 ) {\n\t\tstr += ' - ' + (-this.im);\n\t} else {\n\t\tstr += ' + ' + this.im;\n\t}\n\tstr += 'i';\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* @private\n* @returns {Object} JSON representation\n*/\nfunction toJSON() {\n\t/* eslint-disable no-invalid-this */\n\tvar out = {};\n\tout.type = 'Complex128';\n\tout.re = this.re;\n\tout.im = this.im;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default toJSON;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Complex64 from './../../float32/ctor';\nimport Complex128 from './../../float64/ctor';\n\n\n// MAIN //\n\n// Mapping from data types to constructors...\nvar ctors = {\n\t'complex64': Complex64,\n\t'complex128': Complex128\n};\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport table from './ctors.js';\n\n\n// MAIN //\n\n/**\n* Returns a complex number constructor.\n*\n* @param {string} dtype - data type\n* @returns {(Function|null)} constructor or null\n*\n* @example\n* var ctor = ctors( 'complex128' );\n* // returns \n*\n* @example\n* var ctor = ctors( 'complex' );\n* // returns null\n*/\nfunction ctors( dtype ) {\n\treturn table[ dtype ] || null;\n}\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctors from './../../ctors';\nimport format from '@stdlib/string/format';\n\n\n// VARIABLES //\n\nvar TABLE = {\n\t'float64': 'complex128',\n\t'float32': 'complex64'\n};\nvar DEFAULT_CTOR = ctors( TABLE[ 'float64' ] );\n\n\n// MAIN //\n\n/**\n* Creates a complex number.\n*\n* @param {number} real - real component\n* @param {number} imag - imaginary component\n* @param {string} [dtype=\"float64\"] - data type\n* @throws {TypeError} must provide a recognized data type\n* @returns {Complex} complex number\n*\n* @example\n* var z = complex( 5.0, 3.0, 'float64' );\n* // returns \n*/\nfunction complex( real, imag, dtype ) {\n\tvar ctor;\n\tif ( arguments.length > 2 ) {\n\t\tctor = ctors( TABLE[ dtype ] );\n\t\tif ( ctor ) {\n\t\t\treturn new ctor( real, imag );\n\t\t}\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized data type. Value: `%s`.', dtype ) );\n\t}\n\treturn new DEFAULT_CTOR( real, imag );\n}\n\n\n// EXPORTS //\n\nexport default complex;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n// Mapping from complex number constructors to data types...\nvar ctor2dtypes = {\n\t'Complex64': 'complex64',\n\t'Complex128': 'complex128'\n};\n\n\n// EXPORTS //\n\nexport default ctor2dtypes;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport DTYPES from './dtypes.json';\n\n\n// MAIN //\n\n/**\n* Returns a list of complex number data types.\n*\n* @returns {StringArray} list of complex number data types\n*\n* @example\n* var list = dtypes();\n* // e.g., returns [ 'complex64', 'complex128' ]\n*/\nfunction dtypes() {\n\treturn DTYPES.slice();\n}\n\n\n// EXPORTS //\n\nexport default dtypes;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport dtypes from './../../dtypes';\n\n\n// MAIN //\n\nvar DTYPES = dtypes();\n\n\n// EXPORTS //\n\nexport default DTYPES;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctors from './../../ctors';\nimport DTYPES from './dtypes.js';\n\n\n// MAIN //\n\nvar CTORS = [];\nvar i;\nfor ( i = 0; i < DTYPES.length; i++ ) {\n\tCTORS.push( ctors( DTYPES[ i ] ) );\n}\n\n\n// EXPORTS //\n\nexport default CTORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport constructorName from '@stdlib/utils/constructor-name';\nimport ctor2dtype from './ctor2dtype.js';\nimport CTORS from './ctors.js';\nimport DTYPES from './dtypes.js';\n\n\n// VARIABLES //\n\nvar NTYPES = DTYPES.length;\n\n\n// MAIN //\n\n/**\n* Returns the data type of a complex number.\n*\n* @param {*} value - input value\n* @returns {(string|null)} data type\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var dt = dtype( new Complex128( 1.0, 2.0 ) );\n* // returns 'complex128'\n*\n* var dt = dtype( 'beep' );\n* // returns null\n*/\nfunction dtype( value ) {\n\tvar i;\n\tfor ( i = 0; i < NTYPES; i++ ) {\n\t\tif ( value instanceof CTORS[ i ] ) {\n\t\t\treturn DTYPES[ i ];\n\t\t}\n\t}\n\t// If the above failed, fall back to a more robust (and significantly slower) means for resolving underlying data types:\n\treturn ctor2dtype[ constructorName( value ) ] || null;\n}\n\n\n// EXPORTS //\n\nexport default dtype;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the real component of a single-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} real component\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var re = real( z );\n* // returns 5.0\n*/\nfunction real( z ) {\n\treturn z.re;\n}\n\n\n// EXPORTS //\n\nexport default real;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the imaginary component of a single-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} imaginary component\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nfunction imag( z ) {\n\treturn z.im;\n}\n\n\n// EXPORTS //\n\nexport default imag;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport f32 from '@stdlib/number/float64/base/to-float32';\nimport Complex64 from './../../../../float32/ctor';\nimport realf from './../../../../float32/real';\nimport imagf from './../../../../float32/imag';\n\n\n// MAIN //\n\n/**\n* Adds two single-precision complex floating-point numbers.\n*\n* @param {Complex64} z1 - complex number\n* @param {Complex64} z2 - complex number\n* @returns {Complex64} result\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var out = add( z, z );\n* // returns [ 10.0, 6.0 ]\n*/\nfunction add( z1, z2 ) {\n\tvar re = f32( realf( z1 ) + realf( z2 ) );\n\tvar im = f32( imagf( z1 ) + imagf( z2 ) );\n\treturn new Complex64( re, im );\n}\n\n\n// EXPORTS //\n\nexport default add;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add two single-precision complex floating-point numbers.\n*\n* @module @stdlib/complex/float32/base/add\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n* import add from '@stdlib/complex/float32/base/add';\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var out = add( z, z );\n* // returns [ 10.0, 6.0 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\nimport strided from './strided.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\nsetReadOnly( main, 'strided', strided );\n\n\n// EXPORTS //\n\nexport default main;\n\n// exports: { \"assign\": \"main.assign\", \"strided\": \"main.strided\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport float64ToFloat32 from '@stdlib/number/float64/base/to-float32';\n\n\n// MAIN //\n\n/**\n* Adds two single-precision complex floating-point numbers and assigns results to a provided output array.\n*\n* @param {number} re1 - real component of the first complex number\n* @param {number} im1 - imaginary component of the first complex number\n* @param {number} re2 - real component of the second complex number\n* @param {number} im2 - imaginary component of the second complex number\n* @param {Collection} out - output array\n* @param {integer} strideOut - stride length\n* @param {NonNegativeInteger} offsetOut - starting index\n* @returns {Collection} output array\n*\n* @example\n* import Float32Array from '@stdlib/array/float32';\n*\n* var out = assign( 5.0, 3.0, -2.0, 1.0, new Float32Array( 2 ), 1, 0 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction assign( re1, im1, re2, im2, out, strideOut, offsetOut ) {\n\tout[ offsetOut ] = float64ToFloat32( re1 + re2 );\n\tout[ offsetOut+strideOut ] = float64ToFloat32( im1 + im2 );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default assign;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport float64ToFloat32 from '@stdlib/number/float64/base/to-float32';\n\n\n// MAIN //\n\n/**\n* Adds two single-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array.\n*\n* @param {Float32Array} z1 - first complex number view\n* @param {integer} strideZ1 - stride length for `z1`\n* @param {NonNegativeInteger} offsetZ1 - starting index for `z1`\n* @param {Float32Array} z2 - second complex number view\n* @param {integer} strideZ2 - stride length for `z2`\n* @param {NonNegativeInteger} offsetZ2 - starting index for `z2`\n* @param {Collection} out - output array\n* @param {integer} strideOut - stride length for `out`\n* @param {NonNegativeInteger} offsetOut - starting index for `out`\n* @returns {Collection} output array\n*\n* @example\n* import Float32Array from '@stdlib/array/float32';\n*\n* var z1 = new Float32Array( [ 5.0, 3.0 ] );\n* var z2 = new Float32Array( [ -2.0, 1.0 ] );\n*\n* var out = strided( z1, 1, 0, z2, 1, 0, new Float32Array( 2 ), 1, 0 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction strided( z1, strideZ1, offsetZ1, z2, strideZ2, offsetZ2, out, strideOut, offsetOut ) { // eslint-disable-line max-len\n\tout[ offsetOut ] = float64ToFloat32( z1[ offsetZ1 ] + z2[ offsetZ2 ] );\n\tout[ offsetOut+strideOut ] = float64ToFloat32( z1[ offsetZ1+strideZ1 ] + z2[ offsetZ2+strideZ2 ] ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default strided;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name isAlmostEqual\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/assert/is-almost-equal}\n*/\nimport isAlmostEqual from './../../../../float32/base/assert/is-almost-equal';\nsetReadOnly( ns, 'isAlmostEqual', isAlmostEqual );\n\n/**\n* @name isAlmostSameValue\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/assert/is-almost-same-value}\n*/\nimport isAlmostSameValue from './../../../../float32/base/assert/is-almost-same-value';\nsetReadOnly( ns, 'isAlmostSameValue', isAlmostSameValue );\n\n/**\n* @name isEqual\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/assert/is-equal}\n*/\nimport isEqual from './../../../../float32/base/assert/is-equal';\nsetReadOnly( ns, 'isEqual', isEqual );\n\n/**\n* @name isNotEqual\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/assert/is-not-equal}\n*/\nimport isNotEqual from './../../../../float32/base/assert/is-not-equal';\nsetReadOnly( ns, 'isNotEqual', isNotEqual );\n\n/**\n* @name isSameValue\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/assert/is-same-value}\n*/\nimport isSameValue from './../../../../float32/base/assert/is-same-value';\nsetReadOnly( ns, 'isSameValue', isSameValue );\n\n/**\n* @name isSameValueZero\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/assert/is-same-value-zero}\n*/\nimport isSameValueZero from './../../../../float32/base/assert/is-same-value-zero';\nsetReadOnly( ns, 'isSameValueZero', isSameValueZero );\n\n\n// EXPORTS //\n\nexport default ns;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport f32 from '@stdlib/number/float64/base/to-float32';\nimport Complex64 from './../../../../float32/ctor';\nimport realf from './../../../../float32/real';\nimport imagf from './../../../../float32/imag';\n\n\n// MAIN //\n\n/**\n* Multiplies two single-precision complex floating-point numbers.\n*\n* @param {Complex64} z1 - complex number\n* @param {Complex64} z2 - complex number\n* @returns {Complex64} result\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z1 = new Complex64( 5.0, 3.0 );\n* var z2 = new Complex64( -2.0, 1.0 );\n*\n* var out = mul( z1, z2 );\n* // returns [ -13.0, -1.0 ]\n*/\nfunction mul( z1, z2 ) {\n\tvar re1 = realf( z1 );\n\tvar re2 = realf( z2 );\n\tvar im1 = imagf( z1 );\n\tvar im2 = imagf( z2 );\n\tvar re = f32(re1*re2) - f32(im1*im2);\n\tvar im = f32(re1*im2) + f32(im1*re2);\n\treturn new Complex64( f32( re ), f32( im ) );\n}\n\n\n// EXPORTS //\n\nexport default mul;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport f32 from '@stdlib/number/float64/base/to-float32';\nimport Complex64 from './../../../../float32/ctor';\nimport realf from './../../../../float32/real';\nimport imagf from './../../../../float32/imag';\n\n\n// MAIN //\n\n/**\n* Scales a single-precision complex floating-point number by a real-valued single-precision floating-point scalar constant.\n*\n* @param {number} alpha - scalar constant\n* @param {Complex64} z - complex number\n* @returns {Complex64} result\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var out = scale( 5.0, z );\n* // returns [ 25.0, 15.0 ]\n*/\nfunction scale( alpha, z ) {\n\treturn new Complex64( f32( realf(z)*alpha ), f32( imagf(z)*alpha ) );\n}\n\n\n// EXPORTS //\n\nexport default scale;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isAlmostEqualF32 from '@stdlib/number/float32/base/assert/is-almost-equal';\nimport reimf from './../../../../../float32/reim';\n\n\n// MAIN //\n\n/**\n* Tests whether two single-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place).\n*\n* ## Notes\n*\n* - The function returns `false` if either input value has a `NaN` real or imaginary component.\n* - The function does not distinguish between `-0` and `+0`, treating them as equal.\n*\n* @param {Complex64} z1 - first complex number\n* @param {Complex64} z2 - second complex number\n* @param {number} maxULP - maximum allowed ULP difference\n* @returns {boolean} boolean indicating whether two single-precision complex floating-point numbers are approximately equal within a specified number of ULPs\n*\n* @example\n* import EPS from '@stdlib/constants/float32/eps';\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z1 = new Complex64( 1.0, 3.0 );\n* var z2 = new Complex64( 1.0+EPS, 3.0 );\n*\n* var bool = isAlmostEqual( z1, z2, 0 );\n* // returns false\n*\n* bool = isAlmostEqual( z1, z2, 1 );\n* // returns true\n*/\nfunction isAlmostEqual( z1, z2, maxULP ) {\n\tvar parts1 = reimf( z1 );\n\tvar parts2 = reimf( z2 );\n\treturn (\n\t\tisAlmostEqualF32( parts1[ 0 ], parts2[ 0 ], maxULP ) &&\n\t\tisAlmostEqualF32( parts1[ 1 ], parts2[ 1 ], maxULP )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isAlmostEqual;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isAlmostSameValueF32 from '@stdlib/number/float32/base/assert/is-almost-same-value';\nimport reim from './../../../../../float32/reim';\n\n\n// MAIN //\n\n/**\n* Tests whether two single-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place).\n*\n* ## Notes\n*\n* - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5.\n* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.\n*\n* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12\n*\n* @param {Complex64} z1 - first complex number\n* @param {Complex64} z2 - second complex number\n* @param {number} maxULP - maximum allowed ULP difference\n* @returns {boolean} boolean indicating whether two single-precision complex floating-point numbers are approximately the same value within a specified number of ULPs\n*\n* @example\n* import EPS from '@stdlib/constants/float32/eps';\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z1 = new Complex64( 1.0, 3.0 );\n* var z2 = new Complex64( 1.0+EPS, 3.0 );\n*\n* var bool = isAlmostSameValue( z1, z2, 0 );\n* // returns false\n*\n* bool = isAlmostSameValue( z1, z2, 1 );\n* // returns true\n*/\nfunction isAlmostSameValue( z1, z2, maxULP ) {\n\tvar parts1 = reim( z1 );\n\tvar parts2 = reim( z2 );\n\treturn (\n\t\tisAlmostSameValueF32( parts1[ 0 ], parts2[ 0 ], maxULP ) &&\n\t\tisAlmostSameValueF32( parts1[ 1 ], parts2[ 1 ], maxULP )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isAlmostSameValue;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport reimf from './../../../../../float32/reim';\n\n\n// MAIN //\n\n/**\n* Tests whether two single-precision complex floating-point numbers are equal.\n*\n* @param {Complex64} z1 - first complex number\n* @param {Complex64} z2 - second complex number\n* @returns {boolean} result\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z1 = new Complex64( 5.0, 3.0 );\n* var z2 = new Complex64( 5.0, 3.0 );\n*\n* var v = isEqual( z1, z2 );\n* // returns true\n*/\nfunction isEqual( z1, z2 ) {\n\tvar parts1 = reimf( z1 );\n\tvar parts2 = reimf( z2 );\n\treturn (\n\t\tparts1[ 0 ] === parts2[ 0 ] &&\n\t\tparts1[ 1 ] === parts2[ 1 ]\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isEqual;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport reimf from './../../../../../float32/reim';\n\n\n// MAIN //\n\n/**\n* Tests whether two single-precision complex floating-point numbers are not equal.\n*\n* @param {Complex64} z1 - first complex number\n* @param {Complex64} z2 - second complex number\n* @returns {boolean} result\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z1 = new Complex64( 5.0, 3.0 );\n* var z2 = new Complex64( 5.0, -3.0 );\n*\n* var v = isNotEqual( z1, z2 );\n* // returns true\n*/\nfunction isNotEqual( z1, z2 ) {\n\tvar parts1 = reimf( z1 );\n\tvar parts2 = reimf( z2 );\n\treturn (\n\t\tparts1[ 0 ] !== parts2[ 0 ] ||\n\t\tparts1[ 1 ] !== parts2[ 1 ]\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isNotEqual;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isSame from '@stdlib/number/float32/base/assert/is-same-value';\nimport reimf from './../../../../../float32/reim';\n\n\n// MAIN //\n\n/**\n* Tests whether two single-precision complex floating-point numbers are the same value.\n*\n* ## Notes\n*\n* - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5.\n* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.\n*\n* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12\n*\n* @param {Complex64} z1 - first complex number\n* @param {Complex64} z2 - second complex number\n* @returns {boolean} result\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z1 = new Complex64( 5.0, 3.0 );\n* var z2 = new Complex64( 5.0, 3.0 );\n*\n* var v = isSameValue( z1, z2 );\n* // returns true\n*/\nfunction isSameValue( z1, z2 ) {\n\tvar parts1 = reimf( z1 );\n\tvar parts2 = reimf( z2 );\n\treturn (\n\t\tisSame( parts1[ 0 ], parts2[ 0 ] ) &&\n\t\tisSame( parts1[ 1 ], parts2[ 1 ] )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isSameValue;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isSame from '@stdlib/number/float32/base/assert/is-same-value-zero';\nimport reimf from './../../../../../float32/reim';\n\n\n// MAIN //\n\n/**\n* Tests whether two single-precision complex floating-point numbers are the same value.\n*\n* ## Notes\n*\n* - The function implements the SameValueZero Algorithm used by `TypedArray` and `ArrayBuffer` constructors, `Map` and `Set` operations, `String.prototype.includes`, and `Array.prototype.includes` since ES2016.\n* - In contrast to the strict equality operator `===`, `NaNs` are considered the same value.\n*\n* @param {Complex64} z1 - first complex number\n* @param {Complex64} z2 - second complex number\n* @returns {boolean} result\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z1 = new Complex64( 5.0, 3.0 );\n* var z2 = new Complex64( 5.0, 3.0 );\n*\n* var v = isSameValueZero( z1, z2 );\n* // returns true\n*/\nfunction isSameValueZero( z1, z2 ) {\n\tvar parts1 = reimf( z1 );\n\tvar parts2 = reimf( z2 );\n\treturn (\n\t\tisSame( parts1[ 0 ], parts2[ 0 ] ) &&\n\t\tisSame( parts1[ 1 ], parts2[ 1 ] )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isSameValueZero;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Multiply two single-precision complex floating-point numbers.\n*\n* @module @stdlib/complex/float32/base/mul\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n* import mul from '@stdlib/complex/float32/base/mul';\n*\n* var z1 = new Complex64( 5.0, 3.0 );\n* var z2 = new Complex64( -2.0, 1.0 );\n*\n* var out = mul( z1, z2 );\n* // returns [ -13.0, -1.0 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\nimport strided from './strided.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\nsetReadOnly( main, 'strided', strided );\n\n\n// EXPORTS //\n\nexport default main;\n\n// exports: { \"assign\": \"main.assign\", \"strided\": \"main.strided\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport f32 from '@stdlib/number/float64/base/to-float32';\n\n\n// MAIN //\n\n/**\n* Multiplies two single-precision complex floating-point numbers and assigns results to a provided output array.\n*\n* @param {number} re1 - real component of the first complex number\n* @param {number} im1 - imaginary component of the first complex number\n* @param {number} re2 - real component of the second complex number\n* @param {number} im2 - imaginary component of the second complex number\n* @param {Collection} out - output array\n* @param {integer} strideOut - stride length\n* @param {NonNegativeInteger} offsetOut - starting index\n* @returns {Collection} output array\n*\n* @example\n* import Float32Array from '@stdlib/array/float32';\n*\n* var out = assign( 5.0, 3.0, -2.0, 1.0, new Float32Array( 2 ), 1, 0 );\n* // returns [ -13.0, -1.0 ]\n*/\nfunction assign( re1, im1, re2, im2, out, strideOut, offsetOut ) {\n\tout[ offsetOut ] = f32(re1*re2) - f32(im1*im2);\n\tout[ offsetOut+strideOut ] = f32(re1*im2) + f32(im1*re2);\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default assign;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport f32 from '@stdlib/number/float64/base/to-float32';\n\n\n// MAIN //\n\n/**\n* Multiplies two single-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array.\n*\n* @param {Float32Array} z1 - first complex number view\n* @param {integer} strideZ1 - stride length for `z1`\n* @param {NonNegativeInteger} offsetZ1 - starting index for `z1`\n* @param {Float32Array} z2 - second complex number view\n* @param {integer} strideZ2 - stride length for `z2`\n* @param {NonNegativeInteger} offsetZ2 - starting index for `z2`\n* @param {Collection} out - output array\n* @param {integer} strideOut - stride length for `out`\n* @param {NonNegativeInteger} offsetOut - starting index for `out`\n* @returns {Collection} output array\n*\n* @example\n* import Float32Array from '@stdlib/array/float32';\n*\n* var z1 = new Float32Array( [ 5.0, 3.0 ] );\n* var z2 = new Float32Array( [ -2.0, 1.0 ] );\n*\n* var out = strided( z1, 1, 0, z2, 1, 0, new Float32Array( 2 ), 1, 0 );\n* // returns [ -13.0, -1.0 ]\n*/\nfunction strided( z1, strideZ1, offsetZ1, z2, strideZ2, offsetZ2, out, strideOut, offsetOut ) { // eslint-disable-line max-len\n\tvar re1 = z1[ offsetZ1 ];\n\tvar im1 = z1[ offsetZ1+strideZ1 ];\n\tvar re2 = z2[ offsetZ2 ];\n\tvar im2 = z2[ offsetZ2+strideZ2 ];\n\tout[ offsetOut ] = f32(re1*re2) - f32(im1*im2);\n\tout[ offsetOut+strideOut ] = f32(re1*im2) + f32(im1*re2);\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default strided;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Scale a single-precision complex floating-point number by a real-valued single-precision floating-point scalar constant.\n*\n* @module @stdlib/complex/float32/base/scale\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n* import scale from '@stdlib/complex/float32/base/scale';\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var out = scale( 5.0, z );\n* // returns [ 25.0, 15.0 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\nimport strided from './strided.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\nsetReadOnly( main, 'strided', strided );\n\n\n// EXPORTS //\n\nexport default main;\n\n// exports: { \"assign\": \"main.assign\", \"strided\": \"main.strided\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport f32 from '@stdlib/number/float64/base/to-float32';\n\n\n// MAIN //\n\n/**\n* Scales a single-precision complex floating-point number by a real-valued single-precision floating-point scalar constant and assigns results to a provided output array.\n*\n* @param {number} alpha - scalar constant\n* @param {number} re - real component of the complex number\n* @param {number} im - imaginary component of the complex number\n* @param {Collection} out - output array\n* @param {integer} strideOut - stride length\n* @param {NonNegativeInteger} offsetOut - starting index\n* @returns {Collection} output array\n*\n* @example\n* import Float32Array from '@stdlib/array/float32';\n*\n* var out = assign( 5.0, 5.0, 3.0, new Float32Array( 2 ), 1, 0 );\n* // returns [ 25.0, 15.0 ]\n*/\nfunction assign( alpha, re, im, out, strideOut, offsetOut ) {\n\tout[ offsetOut ] = f32( re * alpha );\n\tout[ offsetOut+strideOut ] = f32( im * alpha );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default assign;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport f32 from '@stdlib/number/float64/base/to-float32';\n\n\n// MAIN //\n\n/**\n* Scales a single-precision complex floating-point number stored in a real-valued strided array view by a real-valued single-precision floating-point scalar constant and assigns results to a provided strided output array.\n*\n* @param {number} alpha - scalar constant\n* @param {Float32Array} z - complex number view\n* @param {integer} strideZ - stride length for `z`\n* @param {NonNegativeInteger} offsetZ - starting index for `z`\n* @param {Collection} out - output array\n* @param {integer} strideOut - stride length for `out`\n* @param {NonNegativeInteger} offsetOut - starting index for `out`\n* @returns {Collection} output array\n*\n* @example\n* import Float32Array from '@stdlib/array/float32';\n*\n* var z = new Float32Array( [ 5.0, 3.0 ] );\n*\n* var out = strided( 5.0, z, 1, 0, new Float32Array( 2 ), 1, 0 );\n* // returns [ 25.0, 15.0 ]\n*/\nfunction strided( alpha, z, strideZ, offsetZ, out, strideOut, offsetOut ) {\n\tout[ offsetOut ] = f32( alpha * z[ offsetZ ] );\n\tout[ offsetOut+strideOut ] = f32( alpha * z[ offsetZ+strideZ ] );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default strided;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name add\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/add}\n*/\nimport add from './../../../float32/base/add';\nsetReadOnly( ns, 'add', add );\n\n/**\n* @name assert\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/complex/float32/base/assert}\n*/\nimport assert from './../../../float32/base/assert';\nsetReadOnly( ns, 'assert', assert );\n\n/**\n* @name identity\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/identity}\n*/\nimport identity from './../../../float32/base/identity';\nsetReadOnly( ns, 'identity', identity );\n\n/**\n* @name mul\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/mul}\n*/\nimport mul from './../../../float32/base/mul';\nsetReadOnly( ns, 'mul', mul );\n\n/**\n* @name neg\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/neg}\n*/\nimport neg from './../../../float32/base/neg';\nsetReadOnly( ns, 'neg', neg );\n\n/**\n* @name scale\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/scale}\n*/\nimport scale from './../../../float32/base/scale';\nsetReadOnly( ns, 'scale', scale );\n\n/**\n* @name sub\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/sub}\n*/\nimport sub from './../../../float32/base/sub';\nsetReadOnly( ns, 'sub', sub );\n\n\n// EXPORTS //\n\nexport default ns;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates the identity function for a single-precision complex floating-point number.\n*\n* @param {Complex64} z - input value\n* @returns {Complex64} input value\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var v = cidentityf( new Complex64( -1.0, 2.0 ) );\n* // returns [ -1.0, 2.0 ]\n*/\nfunction cidentityf( z ) {\n\treturn z;\n}\n\n\n// EXPORTS //\n\nexport default cidentityf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport realf from './../../../../float32/real';\nimport imagf from './../../../../float32/imag';\nimport Complex64 from './../../../../float32/ctor';\n\n\n// MAIN //\n\n/**\n* Negates a single-precision complex floating-point number.\n*\n* @param {Complex64} z - complex number\n* @returns {Complex64} result\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z = new Complex64( -4.2, 5.5 );\n*\n* var out = cnegf( z );\n* // returns [ ~4.2, -5.5 ]\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z = new Complex64( 0.0, 0.0 );\n*\n* var out = cnegf( z );\n* // returns [ -0.0, -0.0 ]\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z = new Complex64( NaN, NaN );\n*\n* var out = cnegf( z );\n* // returns [ NaN, NaN ]\n*/\nfunction cnegf( z ) {\n\treturn new Complex64( -realf( z ), -imagf( z ) );\n}\n\n\n// EXPORTS //\n\nexport default cnegf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport f32 from '@stdlib/number/float64/base/to-float32';\nimport Complex64 from './../../../../float32/ctor';\nimport realf from './../../../../float32/real';\nimport imagf from './../../../../float32/imag';\n\n\n// MAIN //\n\n/**\n* Subtracts two single-precision complex floating-point numbers.\n*\n* @param {Complex64} z1 - complex number\n* @param {Complex64} z2 - complex number\n* @returns {Complex64} result\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z1 = new Complex64( 5.0, 3.0 );\n* var z2 = new Complex64( -2.0, 1.0 );\n*\n* var out = csubf( z1, z2 );\n* // returns [ 7.0, 2.0 ]\n*/\nfunction csubf( z1, z2 ) {\n\tvar re = f32( realf( z1 ) - realf( z2 ) );\n\tvar im = f32( imagf( z1 ) - imagf( z2 ) );\n\treturn new Complex64( re, im );\n}\n\n\n// EXPORTS //\n\nexport default csubf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name base\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/complex/float32/base}\n*/\nimport base from './../../float32/base';\nsetReadOnly( ns, 'base', base );\n\n/**\n* @name conj\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/conj}\n*/\nimport conj from './../../float32/conj';\nsetReadOnly( ns, 'conj', conj );\n\n/**\n* @name Complex64\n* @memberof ns\n* @readonly\n* @constructor\n* @see {@link module:@stdlib/complex/float32/ctor}\n*/\nimport Complex64 from './../../float32/ctor';\nsetReadOnly( ns, 'Complex64', Complex64 );\n\n/**\n* @name imag\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/imag}\n*/\nimport imag from './../../float32/imag';\nsetReadOnly( ns, 'imag', imag );\n\n/**\n* @name parseComplex64\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/parse}\n*/\nimport parseComplex64 from './../../float32/parse';\nsetReadOnly( ns, 'parseComplex64', parseComplex64 );\n\n/**\n* @name real\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/real}\n*/\nimport real from './../../float32/real';\nsetReadOnly( ns, 'real', real );\n\n/**\n* @name reim\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/reim}\n*/\nimport reim from './../../float32/reim';\nsetReadOnly( ns, 'reim', reim );\n\n/**\n* @name reviveComplex64\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/reviver}\n*/\nimport reviveComplex64 from './../../float32/reviver';\nsetReadOnly( ns, 'reviveComplex64', reviveComplex64 );\n\n\n// EXPORTS //\n\nexport default ns;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the real component of a double-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} real component\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var re = real( z );\n* // returns 5.0\n*/\nfunction real( z ) {\n\treturn z.re;\n}\n\n\n// EXPORTS //\n\nexport default real;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the imaginary component of a double-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} imaginary component\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nfunction imag( z ) {\n\treturn z.im;\n}\n\n\n// EXPORTS //\n\nexport default imag;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Complex128 from './../../../../float64/ctor';\nimport real from './../../../../float64/real';\nimport imag from './../../../../float64/imag';\n\n\n// MAIN //\n\n/**\n* Adds two double-precision complex floating-point numbers.\n*\n* @param {Complex128} z1 - complex number\n* @param {Complex128} z2 - complex number\n* @returns {Complex128} result\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var out = cadd( z, z );\n* // returns [ 10.0, 6.0 ]\n*/\nfunction cadd( z1, z2 ) {\n\tvar re = real( z1 ) + real( z2 );\n\tvar im = imag( z1 ) + imag( z2 );\n\treturn new Complex128( re, im );\n}\n\n\n// EXPORTS //\n\nexport default cadd;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Complex128 from './../../../../float64/ctor';\nimport real from './../../../../float64/real';\nimport imag from './../../../../float64/imag';\n\n\n// MAIN //\n\n/**\n* Computes the sum of three double-precision complex floating-point numbers.\n*\n* @param {Complex128} z1 - first complex number\n* @param {Complex128} z2 - second complex number\n* @param {Complex128} z3 - third complex number\n* @returns {Complex128} result\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var out = add3( z, z, z );\n* // returns [ 15.0, 9.0 ]\n*/\nfunction add3( z1, z2, z3 ) {\n\tvar re = real( z1 ) + real( z2 ) + real( z3 );\n\tvar im = imag( z1 ) + imag( z2 ) + imag( z3 );\n\treturn new Complex128( re, im );\n}\n\n\n// EXPORTS //\n\nexport default add3;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the complex conjugate of a single-precision complex floating-point number.\n*\n* @param {Complex64} z - complex number\n* @returns {Complex64} complex conjugate\n*\n* @example\n* import Complex64 from '@stdlib/complex/float32/ctor';\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var v = conj( z );\n* // returns [ 5.0, -3.0 ]\n*/\nfunction conj( z ) {\n\treturn new z.constructor( z.re, -z.im );\n}\n\n\n// EXPORTS //\n\nexport default conj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport Complex64 from './../../../float32/ctor';\nimport replace from '@stdlib/string/base/replace';\nimport format from '@stdlib/string/format';\n\n\n// FUNCTIONS //\n\n/**\n* Matches a complex number string.\n*\n* @private\n* @returns {RegExp} regular expression\n*\n* @example\n* var re = regexp();\n* // returns /^([-+]?(\\d*\\.?\\d*(?:[eE][-+]?\\d+)?|Infinity|NaN)i?)?([-+])?((\\d*\\.?\\d*(?:[eE][-+]?\\d+)?|Infinity|NaN)i)?$/\n*/\nfunction regexp() {\n\treturn /^([-+]?(\\d*\\.?\\d*(?:[eE][-+]?\\d+)?|Infinity|NaN)i?)?([-+])?((\\d*\\.?\\d*(?:[eE][-+]?\\d+)?|Infinity|NaN)i)?$/;\n}\n\n\n// MAIN //\n\n/**\n* Parse a string representation of a complex number and returns a Complex64 instance.\n*\n* @param {string} str - string representation of a complex number\n* @throws {TypeError} must provide a string\n* @throws {Error} must provide a valid string representation of a complex number\n* @returns {Complex64} 64-bit complex number\n*\n* @example\n* var str = '1 + 2i';\n* var z = parseComplex64( str );\n* // returns \n*/\nfunction parseComplex64( str ) {\n\tvar match;\n\tvar re;\n\tvar im = 0;\n\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\n\tmatch = replace( str, /\\s/g, '' ).match( regexp() );\n\tif ( !match ) {\n\t\tthrow new Error( format( 'invalid argument. Unable to parse input string as a complex number. Value: `%s`.', str ) );\n\t}\n\n\t// Real part:\n\tre = ( match[1] && !match[1].endsWith( 'i' ) ) ? parseFloat( match[1] ) : 0;\n\n\t// Imaginary part:\n\tif ( match[4] ) {\n\t\tim = ( ( match[3] === '-' ) ? -1 : 1 ) * parseFloat( replace( match[4], /i$/, '' ) );\n\t} else if ( match[1] && match[1].endsWith( 'i' ) ) {\n\t\tim = parseFloat( replace( match[1], /i$/, '' ) );\n\t}\n\treturn new Complex64( re, im );\n}\n\n\n// EXPORTS //\n\nexport default parseComplex64;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\nimport Complex64 from './../../../float32/ctor';\n\n\n// MAIN //\n\n/**\n* Revives a JSON-serialized 64-bit complex number.\n*\n* @param {string} key - key\n* @param {*} value - value\n* @returns {(*|Complex64)} value or 64-bit complex number\n*\n* @example\n* import parseJSON from '@stdlib/utils/parse-json';\n*\n* var str = '{\"type\":\"Complex64\",\"re\":5,\"im\":3}';\n*\n* var z = parseJSON( str, reviveComplex64 );\n* // returns \n*/\nfunction reviveComplex64( key, value ) {\n\tif (\n\t\tvalue &&\n\t\tvalue.type &&\n\t\tvalue.type === 'Complex64' &&\n\t\tisNumber( value.re ) &&\n\t\tisNumber( value.im )\n\t) {\n\t\treturn new Complex64( value.re, value.im );\n\t}\n\treturn value;\n}\n\n\n// EXPORTS //\n\nexport default reviveComplex64;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add two double-precision complex floating-point numbers.\n*\n* @module @stdlib/complex/float64/base/add\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n* import cadd from '@stdlib/complex/float64/base/add';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var out = cadd( z, z );\n* // returns [ 10.0, 6.0 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\nimport strided from './strided.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\nsetReadOnly( main, 'strided', strided );\n\n\n// EXPORTS //\n\nexport default main;\n\n// exports: { \"assign\": \"main.assign\", \"strided\": \"main.strided\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds two double-precision complex floating-point numbers and assigns results to a provided output array.\n*\n* @param {number} re1 - real component of the first complex number\n* @param {number} im1 - imaginary component of the first complex number\n* @param {number} re2 - real component of the second complex number\n* @param {number} im2 - imaginary component of the second complex number\n* @param {Collection} out - output array\n* @param {integer} strideOut - stride length\n* @param {NonNegativeInteger} offsetOut - starting index\n* @returns {Collection} output array\n*\n* @example\n* import Float64Array from '@stdlib/array/float64';\n*\n* var out = assign( 5.0, 3.0, -2.0, 1.0, new Float64Array( 2 ), 1, 0 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction assign( re1, im1, re2, im2, out, strideOut, offsetOut ) {\n\tout[ offsetOut ] = re1 + re2;\n\tout[ offsetOut+strideOut ] = im1 + im2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default assign;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds two double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array.\n*\n* @param {Float64Array} z1 - first complex number view\n* @param {integer} strideZ1 - stride length for `z1`\n* @param {NonNegativeInteger} offsetZ1 - starting index for `z1`\n* @param {Float64Array} z2 - second complex number view\n* @param {integer} strideZ2 - stride length for `z2`\n* @param {NonNegativeInteger} offsetZ2 - starting index for `z2`\n* @param {Collection} out - output array\n* @param {integer} strideOut - stride length for `out`\n* @param {NonNegativeInteger} offsetOut - starting index for `out`\n* @returns {Collection} output array\n*\n* @example\n* import Float64Array from '@stdlib/array/float64';\n*\n* var z1 = new Float64Array( [ 5.0, 3.0 ] );\n* var z2 = new Float64Array( [ -2.0, 1.0 ] );\n*\n* var out = strided( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction strided( z1, strideZ1, offsetZ1, z2, strideZ2, offsetZ2, out, strideOut, offsetOut ) { // eslint-disable-line max-len\n\tout[ offsetOut ] = z1[ offsetZ1 ] + z2[ offsetZ2 ];\n\tout[ offsetOut+strideOut ] = z1[ offsetZ1+strideZ1 ] + z2[ offsetZ2+strideZ2 ]; // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default strided;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of three double-precision complex floating-point numbers.\n*\n* @module @stdlib/complex/float64/base/add3\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n* import add3 from '@stdlib/complex/float64/base/add3';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var out = add3( z, z, z );\n* // returns [ 15.0, 9.0 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\nimport strided from './strided.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\nsetReadOnly( main, 'strided', strided );\n\n\n// EXPORTS //\n\nexport default main;\n\n// exports: { \"assign\": \"main.assign\", \"strided\": \"main.strided\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the sum of three double-precision complex floating-point numbers and assigns results to a provided output array.\n*\n* @param {number} re1 - real component of the first complex number\n* @param {number} im1 - imaginary component of the first complex number\n* @param {number} re2 - real component of the second complex number\n* @param {number} im2 - imaginary component of the second complex number\n* @param {number} re3 - real component of the third complex number\n* @param {number} im3 - imaginary component of the third complex number\n* @param {Collection} out - output array\n* @param {integer} strideOut - stride length\n* @param {NonNegativeInteger} offsetOut - starting index\n* @returns {Collection} output array\n*\n* @example\n* import Float64Array from '@stdlib/array/float64';\n*\n* var out = assign( 5.0, 3.0, -2.0, 1.0, 5.0, 3.0, new Float64Array( 2 ), 1, 0 );\n* // returns [ 8.0, 7.0 ]\n*/\nfunction assign( re1, im1, re2, im2, re3, im3, out, strideOut, offsetOut ) {\n\tout[ offsetOut ] = re1 + re2 + re3;\n\tout[ offsetOut+strideOut ] = im1 + im2 + im3;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default assign;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the sum of three double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array.\n*\n* @param {Float64Array} z1 - first complex number view\n* @param {integer} strideZ1 - stride length for `z1`\n* @param {NonNegativeInteger} offsetZ1 - starting index for `z1`\n* @param {Float64Array} z2 - second complex number view\n* @param {integer} strideZ2 - stride length for `z2`\n* @param {NonNegativeInteger} offsetZ2 - starting index for `z2`\n* @param {Float64Array} z3 - third complex number view\n* @param {integer} strideZ3 - stride length for `z3`\n* @param {NonNegativeInteger} offsetZ3 - starting index for `z3`\n* @param {Collection} out - output array\n* @param {integer} strideOut - stride length for `out`\n* @param {NonNegativeInteger} offsetOut - starting index for `out`\n* @returns {Collection} output array\n*\n* @example\n* import Float64Array from '@stdlib/array/float64';\n*\n* var z1 = new Float64Array( [ 5.0, 3.0 ] );\n* var z2 = new Float64Array( [ -2.0, 1.0 ] );\n* var z3 = new Float64Array( [ 5.0, 3.0 ] );\n*\n* var out = strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, new Float64Array( 2 ), 1, 0 );\n* // returns [ 8.0, 7.0 ]\n*/\nfunction strided( z1, strideZ1, offsetZ1, z2, strideZ2, offsetZ2, z3, strideZ3, offsetZ3, out, strideOut, offsetOut ) { // eslint-disable-line max-len, max-params\n\tout[ offsetOut ] = z1[ offsetZ1 ] + z2[ offsetZ2 ] + z3[ offsetZ3 ];\n\tout[ offsetOut+strideOut ] = z1[ offsetZ1+strideZ1 ] + z2[ offsetZ2+strideZ2 ] + z3[ offsetZ3+strideZ3 ]; // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default strided;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name isAlmostEqual\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/base/assert/is-almost-equal}\n*/\nimport isAlmostEqual from './../../../../float64/base/assert/is-almost-equal';\nsetReadOnly( ns, 'isAlmostEqual', isAlmostEqual );\n\n/**\n* @name isAlmostSameValue\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/base/assert/is-almost-same-value}\n*/\nimport isAlmostSameValue from './../../../../float64/base/assert/is-almost-same-value';\nsetReadOnly( ns, 'isAlmostSameValue', isAlmostSameValue );\n\n/**\n* @name isEqual\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/base/assert/is-equal}\n*/\nimport isEqual from './../../../../float64/base/assert/is-equal';\nsetReadOnly( ns, 'isEqual', isEqual );\n\n/**\n* @name isNotEqual\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/base/assert/is-not-equal}\n*/\nimport isNotEqual from './../../../../float64/base/assert/is-not-equal';\nsetReadOnly( ns, 'isNotEqual', isNotEqual );\n\n/**\n* @name isSameValue\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/base/assert/is-same-value}\n*/\nimport isSameValue from './../../../../float64/base/assert/is-same-value';\nsetReadOnly( ns, 'isSameValue', isSameValue );\n\n/**\n* @name isSameValueZero\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/base/assert/is-same-value-zero}\n*/\nimport isSameValueZero from './../../../../float64/base/assert/is-same-value-zero';\nsetReadOnly( ns, 'isSameValueZero', isSameValueZero );\n\n\n// EXPORTS //\n\nexport default ns;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the real part of the quotient.\n*\n* ## Notes\n*\n* - See figure 10 of [Baudin (2012)][@baudin:2012].\n*\n* [@baudin:2012]: https://arxiv.org/abs/1210.4539\n*\n* @private\n* @param {number} re1 - real component\n* @param {number} im1 - imaginary component\n* @param {number} re2 - real component\n* @param {number} im2 - imaginary component\n* @param {number} r - partial result\n* @param {number} t - partial result\n* @returns {number} real part of the quotient\n*/\nfunction internalCompreal( re1, im1, re2, im2, r, t ) {\n\tvar br;\n\tif ( r === 0.0 ) {\n\t\treturn ( re1 + (im2 * (im1/re2)) ) * t;\n\t}\n\tbr = im1 * r;\n\tif ( br === 0.0 ) {\n\t\treturn ( re1*t ) + ( (im1*t) * r );\n\t}\n\treturn ( re1+br ) * t;\n}\n\n\n// EXPORTS //\n\nexport default internalCompreal;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport internalCompreal from './internal_compreal.js';\n\n\n// MAIN //\n\n/**\n* Computes the complex division.\n*\n* ## Notes\n*\n* - See figure 10 of [reference][@baudin:2012].\n*\n* [@baudin:2012]: https://arxiv.org/abs/1210.4539\n*\n* @private\n* @param {number} re1 - real component\n* @param {number} im1 - imaginary component\n* @param {number} re2 - real component\n* @param {number} im2 - imaginary component\n* @returns {Array} result\n*/\nfunction robustInternal( re1, im1, re2, im2 ) {\n\tvar out;\n\tvar r;\n\tvar t;\n\n\tout = [ 0.0, 0.0 ];\n\tr = im2 / re2;\n\tt = 1.0 / ( re2 + (im2*r) );\n\n\tout[ 0 ] = internalCompreal( re1, im1, re2, im2, r, t );\n\tout[ 1 ] = internalCompreal( im1, -re1, re2, im2, r, t );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default robustInternal;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isAlmostEqualF64 from '@stdlib/number/float64/base/assert/is-almost-equal';\nimport reim from './../../../../../float64/reim';\n\n\n// MAIN //\n\n/**\n* Tests whether two double-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place).\n*\n* ## Notes\n*\n* - The function returns `false` if either input value has a `NaN` real or imaginary component.\n* - The function does not distinguish between `-0` and `+0`, treating them as equal.\n*\n* @param {Complex128} z1 - first complex number\n* @param {Complex128} z2 - second complex number\n* @param {number} maxULP - maximum allowed ULP difference\n* @returns {boolean} boolean indicating whether two double-precision complex floating-point numbers are approximately equal within a specified number of ULPs\n*\n* @example\n* import EPS from '@stdlib/constants/float64/eps';\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z1 = new Complex128( 1.0, 3.0 );\n* var z2 = new Complex128( 1.0+EPS, 3.0 );\n*\n* var bool = isAlmostEqual( z1, z2, 0 );\n* // returns false\n*\n* bool = isAlmostEqual( z1, z2, 1 );\n* // returns true\n*/\nfunction isAlmostEqual( z1, z2, maxULP ) {\n\tvar parts1 = reim( z1 );\n\tvar parts2 = reim( z2 );\n\treturn (\n\t\tisAlmostEqualF64( parts1[ 0 ], parts2[ 0 ], maxULP ) &&\n\t\tisAlmostEqualF64( parts1[ 1 ], parts2[ 1 ], maxULP )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isAlmostEqual;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isAlmostSameValueF64 from '@stdlib/number/float64/base/assert/is-almost-same-value';\nimport reim from './../../../../../float64/reim';\n\n\n// MAIN //\n\n/**\n* Tests whether two double-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place).\n*\n* ## Notes\n*\n* - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5.\n* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.\n*\n* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12\n*\n* @param {Complex128} z1 - first complex number\n* @param {Complex128} z2 - second complex number\n* @param {number} maxULP - maximum allowed ULP difference\n* @returns {boolean} boolean indicating whether two double-precision complex floating-point numbers are approximately the same value within a specified number of ULPs\n*\n* @example\n* import EPS from '@stdlib/constants/float64/eps';\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z1 = new Complex128( 1.0, 3.0 );\n* var z2 = new Complex128( 1.0+EPS, 3.0 );\n*\n* var bool = isAlmostSameValue( z1, z2, 0 );\n* // returns false\n*\n* bool = isAlmostSameValue( z1, z2, 1 );\n* // returns true\n*/\nfunction isAlmostSameValue( z1, z2, maxULP ) {\n\tvar parts1 = reim( z1 );\n\tvar parts2 = reim( z2 );\n\treturn (\n\t\tisAlmostSameValueF64( parts1[ 0 ], parts2[ 0 ], maxULP ) &&\n\t\tisAlmostSameValueF64( parts1[ 1 ], parts2[ 1 ], maxULP )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isAlmostSameValue;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport reim from './../../../../../float64/reim';\n\n\n// MAIN //\n\n/**\n* Tests whether two double-precision complex floating-point numbers are equal.\n*\n* @param {Complex128} z1 - first complex number\n* @param {Complex128} z2 - second complex number\n* @returns {boolean} result\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z1 = new Complex128( 5.0, 3.0 );\n* var z2 = new Complex128( 5.0, 3.0 );\n*\n* var v = isEqual( z1, z2 );\n* // returns true\n*/\nfunction isEqual( z1, z2 ) {\n\tvar parts1 = reim( z1 );\n\tvar parts2 = reim( z2 );\n\treturn (\n\t\tparts1[ 0 ] === parts2[ 0 ] &&\n\t\tparts1[ 1 ] === parts2[ 1 ]\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isEqual;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport reim from './../../../../../float64/reim';\n\n\n// MAIN //\n\n/**\n* Tests whether two double-precision complex floating-point numbers are not equal.\n*\n* @param {Complex128} z1 - first complex number\n* @param {Complex128} z2 - second complex number\n* @returns {boolean} result\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z1 = new Complex128( 5.0, 3.0 );\n* var z2 = new Complex128( 5.0, -3.0 );\n*\n* var v = isNotEqual( z1, z2 );\n* // returns true\n*/\nfunction isNotEqual( z1, z2 ) {\n\tvar parts1 = reim( z1 );\n\tvar parts2 = reim( z2 );\n\treturn (\n\t\tparts1[ 0 ] !== parts2[ 0 ] ||\n\t\tparts1[ 1 ] !== parts2[ 1 ]\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isNotEqual;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isSame from '@stdlib/number/float64/base/assert/is-same-value';\nimport reim from './../../../../../float64/reim';\n\n\n// MAIN //\n\n/**\n* Tests whether two double-precision complex floating-point numbers are the same value.\n*\n* ## Notes\n*\n* - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5.\n* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.\n*\n* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12\n*\n* @param {Complex128} z1 - first complex number\n* @param {Complex128} z2 - second complex number\n* @returns {boolean} result\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z1 = new Complex128( 5.0, 3.0 );\n* var z2 = new Complex128( 5.0, 3.0 );\n*\n* var v = isSameValue( z1, z2 );\n* // returns true\n*/\nfunction isSameValue( z1, z2 ) {\n\tvar parts1 = reim( z1 );\n\tvar parts2 = reim( z2 );\n\treturn (\n\t\tisSame( parts1[ 0 ], parts2[ 0 ] ) &&\n\t\tisSame( parts1[ 1 ], parts2[ 1 ] )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isSameValue;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isSame from '@stdlib/number/float64/base/assert/is-same-value-zero';\nimport reim from './../../../../../float64/reim';\n\n\n// MAIN //\n\n/**\n* Tests whether two double-precision complex floating-point numbers are the same value.\n*\n* ## Notes\n*\n* - The function implements the SameValueZero Algorithm used by `TypedArray` and `ArrayBuffer` constructors, `Map` and `Set` operations, `String.prototype.includes`, and `Array.prototype.includes` since ES2016.\n* - In contrast to the strict equality operator `===`, `NaNs` are considered the same value.\n*\n* @param {Complex128} z1 - first complex number\n* @param {Complex128} z2 - second complex number\n* @returns {boolean} result\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z1 = new Complex128( 5.0, 3.0 );\n* var z2 = new Complex128( 5.0, 3.0 );\n*\n* var v = isSameValueZero( z1, z2 );\n* // returns true\n*/\nfunction isSameValueZero( z1, z2 ) {\n\tvar parts1 = reim( z1 );\n\tvar parts2 = reim( z2 );\n\treturn (\n\t\tisSame( parts1[ 0 ], parts2[ 0 ] ) &&\n\t\tisSame( parts1[ 1 ], parts2[ 1 ] )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isSameValueZero;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport abs from '@stdlib/math/base/special/abs';\nimport max from '@stdlib/math/base/special/max';\nimport FLOAT64_BIGGEST from '@stdlib/constants/float64/max';\nimport FLOAT64_SMALLEST from '@stdlib/constants/float64/smallest-normal';\nimport EPS from '@stdlib/constants/float64/eps';\nimport robustInternal from './robust_internal.js';\n\n\n// VARIABLES //\n\nvar LARGE_THRESHOLD = FLOAT64_BIGGEST * 0.5;\nvar SMALL_THRESHOLD = FLOAT64_SMALLEST * ( 2.0 / EPS );\nvar RECIP_EPS_SQR = 2.0 / ( EPS * EPS );\n\n\n// MAIN //\n\n/**\n* Divides two double-precision complex floating-point numbers and assigns results to a provided output array.\n*\n* @param {number} re1 - real component of the first complex number\n* @param {number} im1 - imaginary component of the first complex number\n* @param {number} re2 - real component of the second complex number\n* @param {number} im2 - imaginary component of the second complex number\n* @param {Collection} out - output array\n* @param {integer} strideOut - stride length\n* @param {NonNegativeInteger} offsetOut - starting index\n* @returns {Collection} output array\n*\n* @example\n* import Float64Array from '@stdlib/array/float64';\n*\n* var out = assign( -13.0, -1.0, -2.0, 1.0, new Float64Array( 2 ), 1, 0 );\n* // returns [ 5.0, 3.0 ]\n*/\nfunction assign( re1, im1, re2, im2, out, strideOut, offsetOut ) {\n\tvar res;\n\tvar ab;\n\tvar cd;\n\tvar s;\n\n\tab = max( abs(re1), abs(im1) );\n\tcd = max( abs(re2), abs(im2) );\n\ts = 1.0;\n\n\tif ( ab >= LARGE_THRESHOLD ) {\n\t\tre1 *= 0.5;\n\t\tim1 *= 0.5;\n\t\ts *= 2.0;\n\t} else if ( ab <= SMALL_THRESHOLD ) {\n\t\tre1 *= RECIP_EPS_SQR;\n\t\tim1 *= RECIP_EPS_SQR;\n\t\ts /= RECIP_EPS_SQR;\n\t}\n\tif ( cd >= LARGE_THRESHOLD ) {\n\t\tre2 *= 0.5;\n\t\tim2 *= 0.5;\n\t\ts *= 0.5;\n\t} else if ( cd <= SMALL_THRESHOLD ) {\n\t\tre2 *= RECIP_EPS_SQR;\n\t\tim2 *= RECIP_EPS_SQR;\n\t\ts *= RECIP_EPS_SQR;\n\t}\n\n\tif ( abs( im2 ) <= abs( re2 ) ) {\n\t\tres = robustInternal( re1, im1, re2, im2 );\n\t} else {\n\t\tres = robustInternal( im1, re1, im2, re2 );\n\t\tres[ 1 ] *= -1.0;\n\t}\n\n\tres[ 0 ] *= s;\n\tres[ 1 ] *= s;\n\n\tout[ offsetOut ] = res[ 0 ];\n\tout[ offsetOut+strideOut ] = res[ 1 ];\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default assign;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport real from './../../../../float64/real';\nimport imag from './../../../../float64/imag';\nimport Float64Array from '@stdlib/array/float64';\nimport Complex128 from './../../../../float64/ctor';\nimport assign from './assign.js';\n\n\n// VARIABLES //\n\nvar out = new Float64Array( 2 );\n\n\n// MAIN //\n\n/**\n* Divides two double-precision complex floating-point numbers.\n*\n* ## References\n*\n* - Baudin, Michael, and Robert L. Smith. 2012. \"A Robust Complex Division in Scilab.\" _arXiv_ abs/1210.4539 \\[cs.MS\\] (October): 1–25. .\n*\n* @param {Complex128} z1 - complex number\n* @param {Complex128} z2 - complex number\n* @returns {Complex128} result\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z1 = new Complex128( -13.0, -1.0 );\n* var z2 = new Complex128( -2.0, 1.0 );\n*\n* var out = cdiv( z1, z2 );\n* // returns [ 5.0, 3.0 ]\n*/\nfunction cdiv( z1, z2 ) {\n\tvar re1;\n\tvar re2;\n\tvar im1;\n\tvar im2;\n\n\tre1 = real( z1 );\n\tre2 = real( z2 );\n\tim1 = imag( z1 );\n\tim2 = imag( z2 );\n\n\tout = assign( re1, im1, re2, im2, out, 1, 0 );\n\n\treturn new Complex128( out[ 0 ], out[ 1 ] );\n}\n\n\n// EXPORTS //\n\nexport default cdiv;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Complex128 from './../../../../float64/ctor';\nimport real from './../../../../float64/real';\nimport imag from './../../../../float64/imag';\n\n\n// MAIN //\n\n/**\n* Multiplies two double-precision complex floating-point numbers.\n*\n* @param {Complex128} z1 - complex number\n* @param {Complex128} z2 - complex number\n* @returns {Complex128} result\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z1 = new Complex128( 5.0, 3.0 );\n* var z2 = new Complex128( -2.0, 1.0 );\n*\n* var out = mul( z1, z2 );\n* // returns [ -13.0, -1.0 ]\n*/\nfunction mul( z1, z2 ) {\n\tvar re1 = real( z1 );\n\tvar re2 = real( z2 );\n\tvar im1 = imag( z1 );\n\tvar im2 = imag( z2 );\n\tvar re = (re1*re2) - (im1*im2);\n\tvar im = (re1*im2) + (im1*re2);\n\treturn new Complex128( re, im );\n}\n\n\n// EXPORTS //\n\nexport default mul;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Complex128 from './../../../../float64/ctor';\nimport real from './../../../../float64/real';\nimport imag from './../../../../float64/imag';\n\n\n// MAIN //\n\n/**\n* Performs a multiply-add operation involving three double-precision complex floating-point numbers.\n*\n* @param {Complex128} alpha - complex number\n* @param {Complex128} x - complex number\n* @param {Complex128} y - complex number\n* @returns {Complex128} result\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z1 = new Complex128( 5.0, 3.0 );\n* var z2 = new Complex128( -2.0, 1.0 );\n* var z3 = new Complex128( 7.0, -8.0 );\n*\n* var out = muladd( z1, z2, z3 );\n* // returns [ -6.0, -9.0 ]\n*/\nfunction muladd( alpha, x, y ) {\n\tvar re0 = real( alpha );\n\tvar im0 = imag( alpha );\n\tvar re1 = real( x );\n\tvar im1 = imag( x );\n\tvar re2 = real( y );\n\tvar im2 = imag( y );\n\tvar re = (re0*re1) - (im0*im1) + re2;\n\tvar im = (re0*im1) + (im0*re1) + im2;\n\treturn new Complex128( re, im );\n}\n\n\n// EXPORTS //\n\nexport default muladd;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Complex128 from './../../../../float64/ctor';\nimport real from './../../../../float64/real';\nimport imag from './../../../../float64/imag';\n\n\n// MAIN //\n\n/**\n* Scales a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant.\n*\n* @param {number} alpha - scalar constant\n* @param {Complex128} z - complex number\n* @returns {Complex128} result\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var out = scale( 5.0, z );\n* // returns [ 25.0, 15.0 ]\n*/\nfunction scale( alpha, z ) {\n\treturn new Complex128( real( z ) * alpha, imag( z ) * alpha );\n}\n\n\n// EXPORTS //\n\nexport default scale;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Divide two double-precision complex floating-point numbers.\n*\n* @module @stdlib/complex/float64/base/div\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n* import cdiv from '@stdlib/complex/float64/base/div';\n*\n* var z1 = new Complex128( -13.0, -1.0 );\n* var z2 = new Complex128( -2.0, 1.0 );\n*\n* var out = cdiv( z1, z2 );\n* // returns [ 5.0, 3.0 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\nimport strided from './strided.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\nsetReadOnly( main, 'strided', strided );\n\n\n// EXPORTS //\n\nexport default main;\n\n// exports: { \"assign\": \"main.assign\", \"strided\": \"main.strided\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport assign from './assign.js';\n\n\n// MAIN //\n\n/**\n* Divides two double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array.\n*\n* @param {Float64Array} z1 - first complex number view\n* @param {integer} strideZ1 - stride length for `z1`\n* @param {NonNegativeInteger} offsetZ1 - starting index for `z1`\n* @param {Float64Array} z2 - second complex number view\n* @param {integer} strideZ2 - stride length for `z2`\n* @param {NonNegativeInteger} offsetZ2 - starting index for `z2`\n* @param {Collection} out - output array\n* @param {integer} strideOut - stride length for `out`\n* @param {NonNegativeInteger} offsetOut - starting index for `out`\n* @returns {Collection} output array\n*\n* @example\n* import Float64Array from '@stdlib/array/float64';\n*\n* var z1 = new Float64Array( [ -13.0, -1.0 ] );\n* var z2 = new Float64Array( [ -2.0, 1.0 ] );\n*\n* var out = strided( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 );\n* // returns [ 5.0, 3.0 ]\n*/\nfunction strided( z1, strideZ1, offsetZ1, z2, strideZ2, offsetZ2, out, strideOut, offsetOut ) { // eslint-disable-line max-len\n\treturn assign( z1[ offsetZ1 ], z1[ offsetZ1+strideZ1 ], z2[ offsetZ2 ], z2[ offsetZ2+strideZ2 ], out, strideOut, offsetOut ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default strided;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Multiply two double-precision complex floating-point numbers.\n*\n* @module @stdlib/complex/float64/base/mul\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n* import mul from '@stdlib/complex/float64/base/mul';\n*\n* var z1 = new Complex128( 5.0, 3.0 );\n* var z2 = new Complex128( -2.0, 1.0 );\n*\n* var out = mul( z1, z2 );\n* // returns [ -13.0, -1.0 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\nimport strided from './strided.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\nsetReadOnly( main, 'strided', strided );\n\n\n// EXPORTS //\n\nexport default main;\n\n// exports: { \"assign\": \"main.assign\", \"strided\": \"main.strided\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Multiplies two double-precision complex floating-point numbers and assigns results to a provided output array.\n*\n* @param {number} re1 - real component of the first complex number\n* @param {number} im1 - imaginary component of the first complex number\n* @param {number} re2 - real component of the second complex number\n* @param {number} im2 - imaginary component of the second complex number\n* @param {Collection} out - output array\n* @param {integer} strideOut - stride length\n* @param {NonNegativeInteger} offsetOut - starting index\n* @returns {Collection} output array\n*\n* @example\n* import Float64Array from '@stdlib/array/float64';\n*\n* var out = assign( 5.0, 3.0, -2.0, 1.0, new Float64Array( 2 ), 1, 0 );\n* // returns [ -13.0, -1.0 ]\n*/\nfunction assign( re1, im1, re2, im2, out, strideOut, offsetOut ) {\n\tout[ offsetOut ] = (re1*re2) - (im1*im2);\n\tout[ offsetOut+strideOut ] = (re1*im2) + (im1*re2);\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default assign;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Multiplies two double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array.\n*\n* @param {Float64Array} z1 - first complex number view\n* @param {integer} strideZ1 - stride length for `z1`\n* @param {NonNegativeInteger} offsetZ1 - starting index for `z1`\n* @param {Float64Array} z2 - second complex number view\n* @param {integer} strideZ2 - stride length for `z2`\n* @param {NonNegativeInteger} offsetZ2 - starting index for `z2`\n* @param {Collection} out - output array\n* @param {integer} strideOut - stride length for `out`\n* @param {NonNegativeInteger} offsetOut - starting index for `out`\n* @returns {Collection} output array\n*\n* @example\n* import Float64Array from '@stdlib/array/float64';\n*\n* var z1 = new Float64Array( [ 5.0, 3.0 ] );\n* var z2 = new Float64Array( [ -2.0, 1.0 ] );\n*\n* var out = strided( z1, 1, 0, z2, 1, 0, new Float64Array( 2 ), 1, 0 );\n* // returns [ -13.0, -1.0 ]\n*/\nfunction strided( z1, strideZ1, offsetZ1, z2, strideZ2, offsetZ2, out, strideOut, offsetOut ) { // eslint-disable-line max-len\n\tvar re1 = z1[ offsetZ1 ];\n\tvar im1 = z1[ offsetZ1+strideZ1 ];\n\tvar re2 = z2[ offsetZ2 ];\n\tvar im2 = z2[ offsetZ2+strideZ2 ];\n\tout[ offsetOut ] = (re1*re2) - (im1*im2);\n\tout[ offsetOut+strideOut ] = (re1*im2) + (im1*re2);\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default strided;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Perform a multiply-add operation involving three double-precision complex floating-point numbers.\n*\n* @module @stdlib/complex/float64/base/mul-add\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n* import muladd from '@stdlib/complex/float64/base/mul-add';\n*\n* var z1 = new Complex128( 5.0, 3.0 );\n* var z2 = new Complex128( -2.0, 1.0 );\n* var z3 = new Complex128( 7.0, -8.0 );\n*\n* var out = muladd( z1, z2, z3 );\n* // returns [ -6.0, -9.0 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\nimport strided from './strided.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\nsetReadOnly( main, 'strided', strided );\n\n\n// EXPORTS //\n\nexport default main;\n\n// exports: { \"assign\": \"main.assign\", \"strided\": \"main.strided\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Performs a multiply-add operation involving three double-precision complex floating-point numbers and assigns the results to an output strided array.\n*\n* @param {number} ar - real component of the first complex number\n* @param {number} ai - imaginary component of the first complex number\n* @param {number} xr - real component of the second complex number\n* @param {number} xi - imaginary component of the second complex number\n* @param {number} yr - real component of the third complex number\n* @param {number} yi - imaginary component of the third complex number\n* @param {Collection} out - output array\n* @param {integer} strideOut - stride length\n* @param {NonNegativeInteger} offsetOut - starting index\n* @returns {Collection} output array\n*\n* @example\n* import Float64Array from '@stdlib/array/float64';\n*\n* var out = assign( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, new Float64Array( 2 ), 1, 0 );\n* // returns [ -6.0, -9.0 ]\n*/\nfunction assign( ar, ai, xr, xi, yr, yi, out, strideOut, offsetOut ) {\n\tout[ offsetOut ] = (ar*xr) - (ai*xi) + yr;\n\tout[ offsetOut+strideOut ] = (ar*xi) + (ai*xr) + yi;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default assign;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Performs a multiply-add operation involving three double-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array.\n*\n* @param {Float64Array} alpha - first complex number view\n* @param {integer} strideA - stride length for `alpha`\n* @param {NonNegativeInteger} offsetA - starting index for `alpha`\n* @param {Float64Array} x - second complex number view\n* @param {integer} strideX - stride length for `x`\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float64Array} y - third complex number view\n* @param {integer} strideY - stride length for `y`\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @param {Collection} out - output array\n* @param {integer} strideOut - stride length for `out`\n* @param {NonNegativeInteger} offsetOut - starting index for `out`\n* @returns {Collection} output array\n*\n* @example\n* import Float64Array from '@stdlib/array/float64';\n*\n* var alpha = new Float64Array( [ 5.0, 3.0 ] );\n* var x = new Float64Array( [ -2.0, 1.0 ] );\n* var y = new Float64Array( [ 7.0, -8.0 ] );\n*\n* var out = strided( alpha, 1, 0, x, 1, 0, y, 1, 0, new Float64Array( 2 ), 1, 0 );\n* // returns [ -6.0, -9.0 ]\n*/\nfunction strided( alpha, strideA, offsetA, x, strideX, offsetX, y, strideY, offsetY, out, strideOut, offsetOut ) { // eslint-disable-line max-len, max-params\n\tvar re0 = alpha[ offsetA ];\n\tvar im0 = alpha[ offsetA+strideA ];\n\tvar re1 = x[ offsetX ];\n\tvar im1 = x[ offsetX+strideX ];\n\tvar re2 = y[ offsetY ];\n\tvar im2 = y[ offsetY+strideY ];\n\tout[ offsetOut ] = (re0*re1) - (im0*im1) + re2;\n\tout[ offsetOut+strideOut ] = (re0*im1) + (im0*re1) + im2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default strided;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Scale a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant.\n*\n* @module @stdlib/complex/float64/base/scale\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n* import scale from '@stdlib/complex/float64/base/scale';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var out = scale( 5.0, z );\n* // returns [ 25.0, 15.0 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\nimport strided from './strided.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\nsetReadOnly( main, 'strided', strided );\n\n\n// EXPORTS //\n\nexport default main;\n\n// exports: { \"assign\": \"main.assign\", \"strided\": \"main.strided\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Scales a double-precision complex floating-point number by a real-valued double-precision floating-point scalar constant and assigns results to a provided output array.\n*\n* @param {number} alpha - scalar constant\n* @param {number} re - real component of the complex number\n* @param {number} im - imaginary component of the complex number\n* @param {Collection} out - output array\n* @param {integer} strideOut - stride length\n* @param {NonNegativeInteger} offsetOut - starting index\n* @returns {Collection} output array\n*\n* @example\n* import Float64Array from '@stdlib/array/float64';\n*\n* var out = assign( 5.0, 5.0, 3.0, new Float64Array( 2 ), 1, 0 );\n* // returns [ 25.0, 15.0 ]\n*/\nfunction assign( alpha, re, im, out, strideOut, offsetOut ) {\n\tout[ offsetOut ] = re * alpha;\n\tout[ offsetOut+strideOut ] = im * alpha;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default assign;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Scales a double-precision complex floating-point number stored in a real-valued strided array view by a real-valued double-precision floating-point scalar constant and assigns results to a provided strided output array.\n*\n* @param {number} alpha - scalar constant\n* @param {Float64Array} z - complex number view\n* @param {integer} strideZ - stride length for `z`\n* @param {NonNegativeInteger} offsetZ - starting index for `z`\n* @param {Collection} out - output array\n* @param {integer} strideOut - stride length for `out`\n* @param {NonNegativeInteger} offsetOut - starting index for `out`\n* @returns {Collection} output array\n*\n* @example\n* import Float64Array from '@stdlib/array/float64';\n*\n* var z = new Float64Array( [ 5.0, 3.0 ] );\n*\n* var out = strided( 5.0, z, 1, 0, new Float64Array( 2 ), 1, 0 );\n* // returns [ 25.0, 15.0 ]\n*/\nfunction strided( alpha, z, strideZ, offsetZ, out, strideOut, offsetOut ) {\n\tout[ offsetOut ] = alpha * z[ offsetZ ];\n\tout[ offsetOut+strideOut ] = alpha * z[ offsetZ+strideZ ];\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default strided;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name add\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/base/add}\n*/\nimport add from './../../../float64/base/add';\nsetReadOnly( ns, 'add', add );\n\n/**\n* @name add3\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/base/add3}\n*/\nimport add3 from './../../../float64/base/add3';\nsetReadOnly( ns, 'add3', add3 );\n\n/**\n* @name assert\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/complex/float64/base/assert}\n*/\nimport assert from './../../../float64/base/assert';\nsetReadOnly( ns, 'assert', assert );\n\n/**\n* @name div\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/base/div}\n*/\nimport div from './../../../float64/base/div';\nsetReadOnly( ns, 'div', div );\n\n/**\n* @name identity\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/base/identity}\n*/\nimport identity from './../../../float64/base/identity';\nsetReadOnly( ns, 'identity', identity );\n\n/**\n* @name mul\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/base/mul}\n*/\nimport mul from './../../../float64/base/mul';\nsetReadOnly( ns, 'mul', mul );\n\n/**\n* @name muladd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/base/mul-add}\n*/\nimport muladd from './../../../float64/base/mul-add';\nsetReadOnly( ns, 'muladd', muladd );\n\n/**\n* @name neg\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/base/neg}\n*/\nimport neg from './../../../float64/base/neg';\nsetReadOnly( ns, 'neg', neg );\n\n/**\n* @name scale\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/base/scale}\n*/\nimport scale from './../../../float64/base/scale';\nsetReadOnly( ns, 'scale', scale );\n\n/**\n* @name sub\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/base/sub}\n*/\nimport sub from './../../../float64/base/sub';\nsetReadOnly( ns, 'sub', sub );\n\n\n// EXPORTS //\n\nexport default ns;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates the identity function for a double-precision complex floating-point number.\n*\n* @param {Complex128} z - input value\n* @returns {Complex128} input value\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var v = cidentity( new Complex128( -1.0, 2.0 ) );\n* // returns [ -1.0, 2.0 ]\n*/\nfunction cidentity( z ) {\n\treturn z;\n}\n\n\n// EXPORTS //\n\nexport default cidentity;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport real from './../../../../float64/real';\nimport imag from './../../../../float64/imag';\nimport Complex128 from './../../../../float64/ctor';\n\n\n// MAIN //\n\n/**\n* Negates a double-precision complex floating-point number.\n*\n* @param {Complex128} z - complex number\n* @returns {Complex128} result\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z = new Complex128( -4.2, 5.5 );\n*\n* var out = cneg( z );\n* // returns [ 4.2, -5.5 ]\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z = new Complex128( 0.0, 0.0 );\n*\n* var out = cneg( z );\n* // returns [ -0.0, -0.0 ]\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z = new Complex128( NaN, NaN );\n*\n* var out = cneg( z );\n* // returns [ NaN, NaN ]\n*/\nfunction cneg( z ) {\n\treturn new Complex128( -real( z ), -imag( z ) );\n}\n\n\n// EXPORTS //\n\nexport default cneg;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Complex128 from './../../../../float64/ctor';\nimport real from './../../../../float64/real';\nimport imag from './../../../../float64/imag';\n\n\n// MAIN //\n\n/**\n* Subtracts two double-precision complex floating-point numbers.\n*\n* @param {Complex128} z1 - complex number\n* @param {Complex128} z2 - complex number\n* @returns {Complex128} result\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z1 = new Complex128( 5.0, 3.0 );\n* var z2 = new Complex128( -2.0, 1.0 );\n*\n* var out = csub( z1, z2 );\n* // returns [ 7.0, 2.0 ]\n*/\nfunction csub( z1, z2 ) {\n\tvar re = real( z1 ) - real( z2 );\n\tvar im = imag( z1 ) - imag( z2 );\n\treturn new Complex128( re, im );\n}\n\n\n// EXPORTS //\n\nexport default csub;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name base\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/complex/float64/base}\n*/\nimport base from './../../float64/base';\nsetReadOnly( ns, 'base', base );\n\n/**\n* @name conj\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/conj}\n*/\nimport conj from './../../float64/conj';\nsetReadOnly( ns, 'conj', conj );\n\n/**\n* @name Complex128\n* @memberof ns\n* @readonly\n* @constructor\n* @see {@link module:@stdlib/complex/float64/ctor}\n*/\nimport Complex128 from './../../float64/ctor';\nsetReadOnly( ns, 'Complex128', Complex128 );\n\n/**\n* @name imag\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/imag}\n*/\nimport imag from './../../float64/imag';\nsetReadOnly( ns, 'imag', imag );\n\n/**\n* @name parseComplex128\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/parse}\n*/\nimport parseComplex128 from './../../float64/parse';\nsetReadOnly( ns, 'parseComplex128', parseComplex128 );\n\n/**\n* @name real\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/real}\n*/\nimport real from './../../float64/real';\nsetReadOnly( ns, 'real', real );\n\n/**\n* @name reim\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/reim}\n*/\nimport reim from './../../float64/reim';\nsetReadOnly( ns, 'reim', reim );\n\n/**\n* @name reviveComplex128\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float64/reviver}\n*/\nimport reviveComplex128 from './../../float64/reviver';\nsetReadOnly( ns, 'reviveComplex128', reviveComplex128 );\n\n\n// EXPORTS //\n\nexport default ns;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport real from './../../../float64/real';\nimport imag from './../../../float64/imag';\nimport Complex128 from './../../../float64/ctor';\n\n/**\n* Returns the complex conjugate of a double-precision complex floating-point number.\n*\n* @param {Complex128} z - complex number\n* @returns {Complex128} complex conjugate\n*\n* @example\n* import Complex128 from '@stdlib/complex/float64/ctor';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var v = conj( z );\n* // returns [ 5.0, -3.0 ]\n*/\nfunction conj( z ) {\n\treturn new Complex128( real( z ), -imag( z ) );\n}\n\n\n// EXPORTS //\n\nexport default conj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Complex128 from './../../../float64/ctor';\nimport { isPrimitive as isString } from '@stdlib/assert/is-string';\nimport replace from '@stdlib/string/base/replace';\nimport format from '@stdlib/string/format';\n\n\n// FUNCTIONS //\n\n/**\n* Matches a complex number string.\n*\n* @private\n* @returns {RegExp} regular expression\n*\n* @example\n* var re = regexp();\n* // returns /^([-+]?(\\d*\\.?\\d*(?:[eE][-+]?\\d+)?|Infinity|NaN)i?)?([-+])?((\\d*\\.?\\d*(?:[eE][-+]?\\d+)?|Infinity|NaN)i)?$/\n*/\nfunction regexp() {\n\treturn /^([-+]?(\\d*\\.?\\d*(?:[eE][-+]?\\d+)?|Infinity|NaN)i?)?([-+])?((\\d*\\.?\\d*(?:[eE][-+]?\\d+)?|Infinity|NaN)i)?$/;\n}\n\n\n// MAIN //\n\n/**\n* Parse a string representation of a complex number and returns a Complex128 instance.\n*\n* @param {string} str - string representation of a complex number\n* @throws {TypeError} must provide a string\n* @throws {Error} must provide a valid string representation of a complex number\n* @returns {Complex128} 128-bit complex number\n*\n* @example\n* var str = '1 + 2i';\n* var z = parseComplex128( str );\n* // returns \n*/\nfunction parseComplex128( str ) {\n\tvar match;\n\tvar re;\n\tvar im = 0;\n\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\n\tmatch = replace( str, /\\s/g, '' ).match( regexp() );\n\tif ( !match ) {\n\t\tthrow new Error( format( 'invalid argument. Unable to parse input string as a complex number. Value: `%s`.', str ) );\n\t}\n\n\t// Real part:\n\tre = ( match[1] && !match[1].endsWith( 'i' ) ) ? parseFloat( match[1] ) : 0;\n\n\t// Imaginary part:\n\tif ( match[4] ) {\n\t\tim = ( ( match[3] === '-' ) ? -1 : 1 ) * parseFloat( replace( match[4], /i$/, '' ) );\n\t} else if ( match[1] && match[1].endsWith( 'i' ) ) {\n\t\tim = parseFloat( replace( match[1], /i$/, '' ) );\n\t}\n\treturn new Complex128( re, im );\n}\n\n\n// EXPORTS //\n\nexport default parseComplex128;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\nimport Complex128 from './../../../float64/ctor';\n\n\n// MAIN //\n\n/**\n* Revives a JSON-serialized 128-bit complex number.\n*\n* @param {string} key - key\n* @param {*} value - value\n* @returns {(*|Complex128)} value or 128-bit complex number\n*\n* @example\n* import parseJSON from '@stdlib/utils/parse-json';\n*\n* var str = '{\"type\":\"Complex128\",\"re\":5,\"im\":3}';\n*\n* var z = parseJSON( str, reviveComplex128 );\n* // returns \n*/\nfunction reviveComplex128( key, value ) {\n\tif (\n\t\tvalue &&\n\t\tvalue.type &&\n\t\tvalue.type === 'Complex128' &&\n\t\tisNumber( value.re ) &&\n\t\tisNumber( value.im )\n\t) {\n\t\treturn new Complex128( value.re, value.im );\n\t}\n\treturn value;\n}\n\n\n// EXPORTS //\n\nexport default reviveComplex128;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport objectKeys from '@stdlib/utils/keys';\nimport hasOwnProp from '@stdlib/assert/has-own-property';\nimport PROMOTION_RULES from './promotion_rules.json';\n\n\n// FUNCTIONS //\n\n/**\n* Generates a full table of promotion rules.\n*\n* @private\n* @returns {Object} table\n*/\nfunction generateFullTable() {\n\tvar dtypes;\n\tvar ntypes;\n\tvar out;\n\tvar tmp;\n\tvar dt1;\n\tvar dt2;\n\tvar o;\n\tvar j;\n\tvar i;\n\n\tout = {};\n\tdtypes = objectKeys( PROMOTION_RULES );\n\tntypes = dtypes.length;\n\tfor ( i = 0; i < ntypes; i++ ) {\n\t\tdt1 = dtypes[ i ];\n\t\to = PROMOTION_RULES[ dt1 ];\n\t\ttmp = {};\n\t\tfor ( j = 0; j < ntypes; j++ ) {\n\t\t\tdt2 = dtypes[ j ];\n\t\t\ttmp[ dt2 ] = o[ dt2 ];\n\t\t}\n\t\tout[ dt1 ] = tmp;\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Returns the complex number data type with the smallest size and closest \"kind\" to which data types can be safely cast.\n*\n* @param {string} [dtype1] - data type\n* @param {string} [dtype2] - data type\n* @returns {(Object|integer|string|null)} promotion rule(s) or null\n*\n* @example\n* var table = promotionRules();\n* // returns {...}\n*\n* @example\n* var dt = promotionRules( 'complex128', 'complex64' );\n* // returns 'complex128'\n*\n* @example\n* var dt = promotionRules( 'complex128', 'foo' );\n* // returns null\n*/\nfunction promotionRules( dtype1, dtype2 ) {\n\tvar o;\n\tif ( arguments.length === 0 ) {\n\t\treturn generateFullTable();\n\t}\n\tif ( hasOwnProp( PROMOTION_RULES, dtype1 ) ) {\n\t\to = PROMOTION_RULES[ dtype1 ];\n\t\tif ( hasOwnProp( o, dtype2 ) ) {\n\t\t\treturn o[ dtype2 ];\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default promotionRules;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Complex128 from './../../float64/ctor';\nimport Complex64 from './../../float32/ctor';\n\n\n// MAIN //\n\nvar ctors = {\n\t'Complex128': Complex128,\n\t'Complex64': Complex64\n};\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert/is-number';\nimport ctors from './ctors.js';\n\n\n// MAIN //\n\n/**\n* Revives a JSON-serialized complex number.\n*\n* @param {string} key - key\n* @param {*} value - value\n* @returns {(*|Complex)} value or complex number\n*\n* @example\n* import parseJSON from '@stdlib/utils/parse-json';\n*\n* var str = '{\"type\":\"Complex128\",\"re\":5,\"im\":3}';\n*\n* var z = parseJSON( str, reviveComplex );\n* // returns \n*/\nfunction reviveComplex( key, value ) {\n\tvar ctor;\n\tif (\n\t\tvalue &&\n\t\tvalue.type &&\n\t\tisNumber( value.re ) &&\n\t\tisNumber( value.im )\n\t) {\n\t\tctor = ctors[ value.type ];\n\t\tif ( ctor ) {\n\t\t\treturn new ctor( value.re, value.im );\n\t\t}\n\t}\n\treturn value;\n}\n\n\n// EXPORTS //\n\nexport default reviveComplex;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils/define-read-only-property';\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name base\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/complex/base}\n*/\nimport base from './../base';\nsetReadOnly( ns, 'base', base );\n\n/**\n* @name complex\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/cmplx}\n*/\nimport complex from './../cmplx';\nsetReadOnly( ns, 'complex', complex );\n\n/**\n* @name ctors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/ctors}\n*/\nimport ctors from './../ctors';\nsetReadOnly( ns, 'ctors', ctors );\n\n/**\n* @name dtype\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/dtype}\n*/\nimport dtype from './../dtype';\nsetReadOnly( ns, 'dtype', dtype );\n\n/**\n* @name dtypes\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/dtypes}\n*/\nimport dtypes from './../dtypes';\nsetReadOnly( ns, 'dtypes', dtypes );\n\n/**\n* @name float32\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/complex/float32}\n*/\nimport float32 from './../float32';\nsetReadOnly( ns, 'float32', float32 );\n\n/**\n* @name float64\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/complex/float64}\n*/\nimport float64 from './../float64';\nsetReadOnly( ns, 'float64', float64 );\n\n/**\n* @name promotionRules\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/promotion-rules}\n*/\nimport promotionRules from './../promotion-rules';\nsetReadOnly( ns, 'promotionRules', promotionRules );\n\n/**\n* @name reviveComplex\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/reviver}\n*/\nimport reviveComplex from './../reviver';\nsetReadOnly( ns, 'reviveComplex', reviveComplex );\n\n\n// EXPORTS //\n\nexport default ns;\n"],"names":["reim","z","out","Float64Array","re","im","Float32Array","ns","setReadOnly","z1","z2","maxULP","parts1","parts2","nb1","nb2","f","BYTES_PER_ELEMENT","isAlmostEqualF32","reimf","isAlmostEqualF64","isAlmostSameValueF32","isAlmostSameValueF64","T","Complex64","real","imag","this","TypeError","isNumber","format","setEnumerableReadOnly","float64ToFloat32","Complex128","assert","fcn","nargs","ctor","isFunction","isNonNegativeInteger","r","x","y","w","v","args","i","arguments","length","push","apply","str","isImaginary","value","part","imaginaryParts","currentToken","realParts","parts","valid","replace","slice","Number","isNaN","prototype","ctors","complex64","complex128","dtype","table","TABLE","float64","float32","DEFAULT_CTOR","complex","ctor2dtypes","dtypes","DTYPES","CTORS","NTYPES","ctor2dtype","constructorName","add","f32","realf","imagf","main","re1","im1","re2","im2","strideOut","offsetOut","strideZ1","offsetZ1","strideZ2","offsetZ2","mul","scale","alpha","isSame","strideZ","offsetZ","cadd","add3","z3","base","constructor","match","isString","Error","endsWith","parseFloat","key","type","re3","im3","strideZ3","offsetZ3","internalCompreal","t","br","robustInternal","LARGE_THRESHOLD","FLOAT64_BIGGEST","SMALL_THRESHOLD","FLOAT64_SMALLEST","EPS","RECIP_EPS_SQR","assign","res","ab","cd","s","max","abs","cdiv","muladd","re0","im0","ar","ai","xr","xi","yr","yi","strideA","offsetA","strideX","offsetX","strideY","offsetY","div","promotionRules","dtype1","dtype2","o","ntypes","tmp","dt1","dt2","j","objectKeys","PROMOTION_RULES","generateFullTable","hasOwnProp","reviveComplex"],"mappings":";;49FAyCA,SAASA,EAAMC,GACd,IAAIC,EAAM,IAAIC,EAAc,GAG5B,OAFAD,EAAK,GAAMD,EAAEG,GACbF,EAAK,GAAMD,EAAEI,GACNH,CACR,CCLA,SAASF,EAAMC,GACd,IAAIC,EAAM,IAAII,EAAc,GAG5B,OAFAJ,EAAK,GAAMD,EAAEG,GACbF,EAAK,GAAMD,EAAEI,GACNH,CACR,CCVA,IAAAK,EAAA,CAAA,EAUAC,EAAAD,EAAA,iBCUA,SAAwBE,EAAIC,EAAIC,GAC/B,IAAIC,EACAC,EACAC,EACAC,EACAC,EAkBJ,OAfAF,EAAML,EAAGQ,kBACTF,EAAML,EAAGO,kBAGI,IAARH,GAAqB,IAARC,GACjBC,EAAIE,EACJN,EAASO,EAAOV,GAChBI,EAASM,EAAOT,KAIhBM,EAAII,EACJR,EAASZ,EAAMS,GACfI,EAASb,EAAMU,IAGfM,EAAGJ,EAAQ,GAAKC,EAAQ,GAAKF,IAC7BK,EAAGJ,EAAQ,GAAKC,EAAQ,GAAKF,EAE/B,ID3BAH,EAAAD,EAAA,qBEEA,SAA4BE,EAAIC,EAAIC,GACnC,IAAIC,EACAC,EACAC,EACAC,EACAC,EAkBJ,OAfAF,EAAML,EAAGQ,kBACTF,EAAML,EAAGO,kBAGI,IAARH,GAAqB,IAARC,GACjBC,EAAIK,EACJT,EAASO,EAAOV,GAChBI,EAASM,EAAOT,KAIhBM,EAAIM,EACJV,EAASZ,EAAMS,GACfI,EAASb,EAAMU,IAGfM,EAAGJ,EAAQ,GAAKC,EAAQ,GAAKF,IAC7BK,EAAGJ,EAAQ,GAAKC,EAAQ,GAAKF,EAE/B,ICtDA,IAAIY,EAAI,SCAR,IAAIA,EAAI,SCKR,IAAAhB,EAAA,CAAA,ECYA,SAASiB,EAAWC,EAAMC,GACzB,KAAQC,gBAAgBH,GACvB,MAAM,IAAII,UAAW,0EAEtB,IAAMC,EAAUJ,GACf,MAAM,IAAIG,UAAWE,EAAQ,kEAAmEL,IAEjG,IAAMI,EAAUH,GACf,MAAM,IAAIE,UAAWE,EAAQ,uEAAwEJ,IAItG,OAFAK,EAAuBJ,KAAM,KAAMK,EAAkBP,IACrDM,EAAuBJ,KAAM,KAAMK,EAAkBN,IAC9CC,IACR,CCdA,SAASM,EAAYR,EAAMC,GAC1B,KAAQC,gBAAgBM,GACvB,MAAM,IAAIL,UAAW,0EAEtB,IAAMC,EAAUJ,GACf,MAAM,IAAIG,UAAWE,EAAQ,kEAAmEL,IAEjG,IAAMI,EAAUH,GACf,MAAM,IAAIE,UAAWE,EAAQ,uEAAwEJ,IAItG,OAFAK,EAAuBJ,KAAM,KAAMF,GACnCM,EAAuBJ,KAAM,KAAMD,GAC5BC,IACR,CFdAnB,EAAAD,EAAA,SAAA2B,GAUA1B,EAAAD,EAAA,QFOA,SAAe4B,EAAKC,EAAOC,GAE1B,IAAMC,EAAYH,GACjB,MAAM,IAAIP,UAAWE,EAAQ,oEAAqEK,IAEnG,IAAMI,EAAsBH,GAC3B,MAAM,IAAIR,UAAWE,EAAQ,gFAAiFM,IAE/G,IAAME,EAAYD,GACjB,MAAM,IAAIT,UAAWE,EAAQ,gFAAiFO,IAG/G,OAASD,GAAS,EADX,CASP,WACC,IAAII,EAAIL,IACR,UAAYK,IAAMjB,EACjB,OAAO,IAAIc,EAAMG,EAAG,GAErB,OAAOA,CACP,EASD,SAAeC,GACd,IAAID,EAAIL,EAAKM,GACb,UAAYD,IAAMjB,EACjB,OAAO,IAAIc,EAAMG,EAAG,GAErB,OAAOA,CACP,EAUD,SAAeC,EAAGC,GACjB,IAAIF,EAAIL,EAAKM,EAAGC,GAChB,UAAYF,IAAMjB,EACjB,OAAO,IAAIc,EAAMG,EAAG,GAErB,OAAOA,CACP,EAWD,SAAeC,EAAGC,EAAGzC,GACpB,IAAIuC,EAAIL,EAAKM,EAAGC,EAAGzC,GACnB,UAAYuC,IAAMjB,EACjB,OAAO,IAAIc,EAAMG,EAAG,GAErB,OAAOA,CACP,EAYD,SAAeC,EAAGC,EAAGzC,EAAG0C,GACvB,IAAIH,EAAIL,EAAKM,EAAGC,EAAGzC,EAAG0C,GACtB,UAAYH,IAAMjB,EACjB,OAAO,IAAIc,EAAMG,EAAG,GAErB,OAAOA,CACP,EAaD,SAAeC,EAAGC,EAAGzC,EAAG0C,EAAGC,GAC1B,IAAIJ,EAAIL,EAAKM,EAAGC,EAAGzC,EAAG0C,EAAGC,GACzB,UAAYJ,IAAMjB,EACjB,OAAO,IAAIc,EAAMG,EAAG,GAErB,OAAOA,CACP,GAnG6BJ,GA4G9B,WACC,IAAIS,EACAL,EACAM,EAGJ,IADAD,EAAO,GACDC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAClCD,EAAKI,KAAMF,UAAWD,IAGvB,UADAN,EAAIL,EAAIe,MAAO,KAAML,MACHtB,EACjB,OAAO,IAAIc,EAAMG,EAAG,GAErB,OAAOA,CACP,CACF,IEpIAhC,EAAAD,EAAA,SGnBA,SAAgB4C,GACf,IAEIC,EAIAC,EACAC,EAIAR,EAXAS,EAAiB,GACjBC,EAAe,GAEfC,EAAY,GACZC,EAAQ,GACRC,GAAQ,EAGRvD,EAAK,EACLC,EAAK,EAGT,GAAoB,iBAAR8C,EACX,OAAO,KAIR,IADAA,EAAMS,EAAST,EAAK,IAAK,IACnBL,EAAI,EAAGA,EAAIK,EAAIH,OAAQF,IACX,MAAXK,EAAIL,IAAyB,MAAXK,EAAIL,IAAqB,IAANA,GAA0B,MAAfK,EAAIL,EAAI,GAGlDA,IAAMK,EAAIH,OAAS,IAC9BQ,GAAgBL,EAAKL,GACrBY,EAAMT,KAAMO,KAJZE,EAAMT,KAAMO,GACZA,EAAe,IAKhBA,GAAgBL,EAAKL,GAGtB,IAAMA,EAAI,EAAGA,EAAIY,EAAMV,OAAQF,IAAM,CAcpC,GAZAM,GAAc,EAGG,OAJjBE,EAAOI,EAAOZ,IAIJ,IACTQ,EAAOA,EAAKO,MAAO,GACnBT,GAAc,GACuB,MAA1BE,EAAKA,EAAKN,OAAS,KAC9BM,EAAOA,EAAKO,MAAO,EAAGP,EAAKN,OAAS,GACpCI,GAAc,GAGfC,EAAQS,EAAQR,GACXS,MAAOV,IAAoB,QAATC,GAA2B,SAATA,GAA4B,SAATA,EAAkB,CAC7EK,GAAQ,EACR,KACA,CAEIP,EACJG,EAAeN,KAAMI,GAGrBI,EAAUR,KAAMI,EAEjB,CAED,IAAMM,EACL,OAAO,KAGR,IAAMb,EAAI,EAAGA,EAAIW,EAAUT,OAAQF,IAClC1C,GAAMqD,EAAUX,GAEjB,IAAMA,EAAI,EAAGA,EAAIS,EAAeP,OAAQF,IACvCzC,GAAMkD,EAAeT,GAGtB,MAAO,CACN1C,GAAMA,EACNC,GAAMA,EAER,IH1CAG,EAAAD,EAAA,QDbA,SAAe4B,EAAKC,EAAOC,GAE1B,IAAMC,EAAYH,GACjB,MAAM,IAAIP,UAAWE,EAAQ,oEAAqEK,IAEnG,IAAMI,EAAsBH,GAC3B,MAAM,IAAIR,UAAWE,EAAQ,gFAAiFM,IAE/G,IAAME,EAAYD,GACjB,MAAM,IAAIT,UAAWE,EAAQ,gFAAiFO,IAG/G,OAASD,GAAS,EADX,CASP,WACC,OAAOD,GACP,EASD,SAAeM,UACFA,IAAMlB,IACjBkB,EAAI,IAAIJ,EAAMI,EAAG,IAElB,OAAON,EAAKM,EACZ,EAUD,SAAeA,EAAGC,UACLD,IAAMlB,IACjBkB,EAAI,IAAIJ,EAAMI,EAAG,WAENC,IAAMnB,IACjBmB,EAAI,IAAIL,EAAMK,EAAG,IAElB,OAAOP,EAAKM,EAAGC,EACf,EAWD,SAAeD,EAAGC,EAAGzC,UACRwC,IAAMlB,IACjBkB,EAAI,IAAIJ,EAAMI,EAAG,WAENC,IAAMnB,IACjBmB,EAAI,IAAIL,EAAMK,EAAG,WAENzC,IAAMsB,IACjBtB,EAAI,IAAIoC,EAAMpC,EAAG,IAElB,OAAOkC,EAAKM,EAAGC,EAAGzC,EAClB,EAYD,SAAewC,EAAGC,EAAGzC,EAAG0C,UACXF,IAAMlB,IACjBkB,EAAI,IAAIJ,EAAMI,EAAG,WAENC,IAAMnB,IACjBmB,EAAI,IAAIL,EAAMK,EAAG,WAENzC,IAAMsB,IACjBtB,EAAI,IAAIoC,EAAMpC,EAAG,WAEN0C,IAAMpB,IACjBoB,EAAI,IAAIN,EAAMM,EAAG,IAElB,OAAOR,EAAKM,EAAGC,EAAGzC,EAAG0C,EACrB,EAaD,SAAeF,EAAGC,EAAGzC,EAAG0C,EAAGC,UACdH,IAAMlB,IACjBkB,EAAI,IAAIJ,EAAMI,EAAG,WAENC,IAAMnB,IACjBmB,EAAI,IAAIL,EAAMK,EAAG,WAENzC,IAAMsB,IACjBtB,EAAI,IAAIoC,EAAMpC,EAAG,WAEN0C,IAAMpB,IACjBoB,EAAI,IAAIN,EAAMM,EAAG,WAENC,IAAMrB,IACjBqB,EAAI,IAAIP,EAAMO,EAAG,IAElB,OAAOT,EAAKM,EAAGC,EAAGzC,EAAG0C,EAAGC,EACxB,GAxH6BR,GAiI9B,WACC,IAAIS,EACAD,EACAE,EAGJ,IADAD,EAAO,GACDC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,WAClCF,EAAIG,UAAWD,MACGvB,IACjBqB,EAAI,IAAIP,EAAMO,EAAG,IAElBC,EAAKI,KAAML,GAEZ,OAAOT,EAAIe,MAAO,KAAML,EACxB,CACF,IE/IArC,EAAagB,EAAW,OAAQ,aAchChB,EAAagB,EAAW,oBAAqB,GAgB7ChB,EAAagB,EAAUwC,UAAW,oBAAqB,GAgBvDxD,EAAagB,EAAUwC,UAAW,aAAc,GAgBhDxD,EAAagB,EAAUwC,UAAW,YGhHlC,WAEC,IAAIb,EAAM,GAAKxB,KAAKvB,GAOpB,OANKuB,KAAKtB,GAAK,EACd8C,GAAO,OAAUxB,KAAKtB,GAEtB8C,GAAO,MAAQxB,KAAKtB,GAErB8C,GAAO,GAER,IH0HA3C,EAAagB,EAAUwC,UAAW,UIpIlC,WAEC,IAAI9D,EAAM,CACVA,KAAW,aAGX,OAFAA,EAAIE,GAAKuB,KAAKvB,GACdF,EAAIG,GAAKsB,KAAKtB,GACPH,CACR,IH0CAM,EAAayB,EAAY,OAAQ,cAcjCzB,EAAayB,EAAY,oBAAqB,GAgB9CzB,EAAayB,EAAW+B,UAAW,oBAAqB,GAgBxDxD,EAAayB,EAAW+B,UAAW,aAAc,IAgBjDxD,EAAayB,EAAW+B,UAAW,YI/GnC,WAEC,IAAIb,EAAM,GAAKxB,KAAKvB,GAOpB,OANKuB,KAAKtB,GAAK,EACd8C,GAAO,OAAUxB,KAAKtB,GAEtB8C,GAAO,MAAQxB,KAAKtB,GAErB8C,GAAO,GAER,IJyHA3C,EAAayB,EAAW+B,UAAW,UKnInC,WAEC,IAAI9D,EAAM,CACVA,KAAW,cAGX,OAFAA,EAAIE,GAAKuB,KAAKvB,GACdF,EAAIG,GAAKsB,KAAKtB,GACPH,CACR,ICJA,IAAI+D,EAAQ,CACXC,UAAa1C,EACb2C,WAAclC,GCUf,SAASgC,EAAOG,GACf,OAAOC,EAAOD,IAAW,IAC1B,CCfA,IAAIE,EAAQ,CACXC,QAAW,aACXC,QAAW,aAERC,EAAeR,EAAOK,EAAkB,SAkB5C,SAASI,EAASjD,EAAMC,EAAM0C,GAC7B,IAAI/B,EACJ,GAAKU,UAAUC,OAAS,EAAI,CAE3B,GADAX,EAAO4B,EAAOK,EAAOF,IAEpB,OAAO,IAAI/B,EAAMZ,EAAMC,GAExB,MAAM,IAAIE,UAAWE,EAAQ,sEAAuEsC,GACpG,CACD,OAAO,IAAIK,EAAchD,EAAMC,EAChC,CCrCA,IAAIiD,EAAc,CACjBnD,UAAa,YACbS,WAAc,2CCWf,SAAS2C,IACR,OAAOC,EAAOhB,OACf,CCXA,ICEIf,EDFA+B,EAASD,ICCTE,EAAQ,GAEZ,IAAMhC,EAAI,EAAGA,EAAI+B,EAAO7B,OAAQF,IAC/BgC,EAAM7B,KAAMgB,EAAOY,EAAQ/B,KCD5B,IAAIiC,EAASF,EAAO7B,OAoBpB,SAASoB,EAAOf,GACf,IAAIP,EACJ,IAAMA,EAAI,EAAGA,EAAIiC,EAAQjC,IACxB,GAAKO,aAAiByB,EAAOhC,GAC5B,OAAO+B,EAAQ/B,GAIjB,OAAOkC,EAAYC,EAAiB5B,KAAa,IAClD,CCzBA,SAAS5B,EAAMxB,GACd,OAAOA,EAAEG,EACV,CCFA,SAASsB,EAAMzB,GACd,OAAOA,EAAEI,EACV,CCSA,SAAS6E,EAAKzE,EAAIC,GAGjB,OAAO,IAAIc,EAFF2D,EAAKC,EAAO3E,GAAO2E,EAAO1E,IAC1ByE,EAAKE,EAAO5E,GAAO4E,EAAO3E,IAEpC,CCJAF,EAAA8E,EAAA,UCAA,SAAiBC,EAAKC,EAAKC,EAAKC,EAAKxF,EAAKyF,EAAWC,GAGpD,OAFA1F,EAAK0F,GAAc5D,EAAkBuD,EAAME,GAC3CvF,EAAK0F,EAAUD,GAAc3D,EAAkBwD,EAAME,GAC9CxF,CACR,IDHAM,EAAA8E,EAAA,WEIA,SAAkB7E,EAAIoF,EAAUC,EAAUpF,EAAIqF,EAAUC,EAAU9F,EAAKyF,EAAWC,GAGjF,OAFA1F,EAAK0F,GAAc5D,EAAkBvB,EAAIqF,GAAapF,EAAIsF,IAC1D9F,EAAK0F,EAAUD,GAAc3D,EAAkBvB,EAAIqF,EAASD,GAAanF,EAAIsF,EAASD,IAC/E7F,CACR,IClBA,IAAAK,GAAA,CAAA,ECUA,SAAS0F,GAAKxF,EAAIC,GACjB,IAAI6E,EAAMH,EAAO3E,GACbgF,EAAML,EAAO1E,GACb8E,EAAMH,EAAO5E,GACbiF,EAAML,EAAO3E,GACbN,EAAK+E,EAAII,EAAIE,GAAON,EAAIK,EAAIE,GAC5BrF,EAAK8E,EAAII,EAAIG,GAAOP,EAAIK,EAAIC,GAChC,OAAO,IAAIjE,EAAW2D,EAAK/E,GAAM+E,EAAK9E,GACvC,CCTA,SAAS6F,GAAOC,EAAOlG,GACtB,OAAO,IAAIuB,EAAW2D,EAAKC,EAAMnF,GAAGkG,GAAShB,EAAKE,EAAMpF,GAAGkG,GAC5D,CFDA3F,EAAAD,GAAA,iBGQA,SAAwBE,EAAIC,EAAIC,GAC/B,IAAIC,EAASO,EAAOV,GAChBI,EAASM,EAAOT,GACpB,OACCQ,EAAkBN,EAAQ,GAAKC,EAAQ,GAAKF,IAC5CO,EAAkBN,EAAQ,GAAKC,EAAQ,GAAKF,EAE9C,IHLAH,EAAAD,GAAA,qBIAA,SAA4BE,EAAIC,EAAIC,GACnC,IAAIC,EAASZ,EAAMS,GACfI,EAASb,EAAMU,GACnB,OACCW,EAAsBT,EAAQ,GAAKC,EAAQ,GAAKF,IAChDU,EAAsBT,EAAQ,GAAKC,EAAQ,GAAKF,EAElD,IJGAH,EAAAD,GAAA,WKvBA,SAAkBE,EAAIC,GACrB,IAAIE,EAASO,EAAOV,GAChBI,EAASM,EAAOT,GACpB,OACCE,EAAQ,KAAQC,EAAQ,IACxBD,EAAQ,KAAQC,EAAQ,EAE1B,IL0BAL,EAAAD,GAAA,cMjCA,SAAqBE,EAAIC,GACxB,IAAIE,EAASO,EAAOV,GAChBI,EAASM,EAAOT,GACpB,OACCE,EAAQ,KAAQC,EAAQ,IACxBD,EAAQ,KAAQC,EAAQ,EAE1B,INoCAL,EAAAD,GAAA,eOnCA,SAAsBE,EAAIC,GACzB,IAAIE,EAASO,EAAOV,GAChBI,EAASM,EAAOT,GACpB,OACC0F,EAAQxF,EAAQ,GAAKC,EAAQ,KAC7BuF,EAAQxF,EAAQ,GAAKC,EAAQ,GAE/B,IPsCAL,EAAAD,GAAA,mBQ/CA,SAA0BE,EAAIC,GAC7B,IAAIE,EAASO,EAAOV,GAChBI,EAASM,EAAOT,GACpB,OACC0F,EAAQxF,EAAQ,GAAKC,EAAQ,KAC7BuF,EAAQxF,EAAQ,GAAKC,EAAQ,GAE/B,ICVAL,EAAA8E,GAAA,UCDA,SAAiBC,EAAKC,EAAKC,EAAKC,EAAKxF,EAAKyF,EAAWC,GAGpD,OAFA1F,EAAK0F,GAAcT,EAAII,EAAIE,GAAON,EAAIK,EAAIE,GAC1CxF,EAAK0F,EAAUD,GAAcR,EAAII,EAAIG,GAAOP,EAAIK,EAAIC,GAC7CvF,CACR,IDFAM,EAAA8E,GAAA,WEGA,SAAkB7E,EAAIoF,EAAUC,EAAUpF,EAAIqF,EAAUC,EAAU9F,EAAKyF,EAAWC,GACjF,IAAIL,EAAM9E,EAAIqF,GACVN,EAAM/E,EAAIqF,EAASD,GACnBJ,EAAM/E,EAAIsF,GACVN,EAAMhF,EAAIsF,EAASD,GAGvB,OAFA7F,EAAK0F,GAAcT,EAAII,EAAIE,GAAON,EAAIK,EAAIE,GAC1CxF,EAAK0F,EAAUD,GAAcR,EAAII,EAAIG,GAAOP,EAAIK,EAAIC,GAC7CvF,CACR,ICbAM,EAAA8E,GAAA,UCDA,SAAiBa,EAAO/F,EAAIC,EAAIH,EAAKyF,EAAWC,GAG/C,OAFA1F,EAAK0F,GAAcT,EAAK/E,EAAK+F,GAC7BjG,EAAK0F,EAAUD,GAAcR,EAAK9E,EAAK8F,GAChCjG,CACR,IDFAM,EAAA8E,GAAA,WECA,SAAkBa,EAAOlG,EAAGoG,EAASC,EAASpG,EAAKyF,EAAWC,GAG7D,OAFA1F,EAAK0F,GAAcT,EAAKgB,EAAQlG,EAAGqG,IACnCpG,EAAK0F,EAAUD,GAAcR,EAAKgB,EAAQlG,EAAGqG,EAAQD,IAC9CnG,CACR,ICfA,IAAAK,GAAA,CAAA,EAUAC,EAAAD,GAAA,MAAA2E,GAUA1E,EAAAD,GAAA,SAAA2B,IAUA1B,EAAAD,GAAA,YChCA,SAAqBN,GACpB,OAAOA,CACR,IDwCAO,EAAAD,GAAA,MAAA0F,IAUAzF,EAAAD,GAAA,OE3BA,SAAgBN,GACf,OAAO,IAAIuB,GAAY4D,EAAOnF,IAAMoF,EAAOpF,GAC5C,IFmCAO,EAAAD,GAAA,QAAA2F,IAUA1F,EAAAD,GAAA,OG5DA,SAAgBE,EAAIC,GAGnB,OAAO,IAAIc,EAFF2D,EAAKC,EAAO3E,GAAO2E,EAAO1E,IAC1ByE,EAAKE,EAAO5E,GAAO4E,EAAO3E,IAEpC,ICdA,IAAAH,GAAA,CAAA,ECFA,SAASkB,GAAMxB,GACd,OAAOA,EAAEG,EACV,CCFA,SAASsB,GAAMzB,GACd,OAAOA,EAAEI,EACV,CCQA,SAASkG,GAAM9F,EAAIC,GAGlB,OAAO,IAAIuB,EAFFR,GAAMhB,GAAOgB,GAAMf,GACnBgB,GAAMjB,GAAOiB,GAAMhB,GAE7B,CCHA,SAAS8F,GAAM/F,EAAIC,EAAI+F,GAGtB,OAAO,IAAIxE,EAFFR,GAAMhB,GAAOgB,GAAMf,GAAOe,GAAMgF,GAChC/E,GAAMjB,GAAOiB,GAAMhB,GAAOgB,GAAM+E,GAE1C,CJHAjG,EAAAD,GAAA,OAAAmG,IAUAlG,EAAAD,GAAA,QKtBA,SAAeN,GACd,OAAO,IAAIA,EAAE0G,YAAa1G,EAAEG,IAAKH,EAAEI,GACpC,IL8BAG,EAAAD,GAAA,YAAAiB,GAUAhB,EAAAD,GAAA,OAAAmB,GAUAlB,EAAAD,GAAA,kBM1BA,SAAyB4C,GACxB,IAAIyD,EACAxG,EACAC,EAAK,EAET,IAAMwG,EAAU1D,GACf,MAAM,IAAIvB,UAAWE,EAAQ,kEAAmEqB,IAIjG,KADAyD,EAAQhD,EAAST,EAAK,MAAO,IAAKyD,MA5B3B,8GA8BN,MAAM,IAAIE,MAAOhF,EAAQ,mFAAoFqB,IAY9G,OARA/C,EAAOwG,EAAM,KAAOA,EAAM,GAAGG,SAAU,KAAUC,WAAYJ,EAAM,IAAO,EAGrEA,EAAM,GACVvG,GAAsB,MAAbuG,EAAM,IAAgB,EAAI,GAAMI,WAAYpD,EAASgD,EAAM,GAAI,KAAM,KACnEA,EAAM,IAAMA,EAAM,GAAGG,SAAU,OAC1C1G,EAAK2G,WAAYpD,EAASgD,EAAM,GAAI,KAAM,MAEpC,IAAIpF,EAAWpB,EAAIC,EAC3B,INYAG,EAAAD,GAAA,OAAAkB,GAUAjB,EAAAD,GAAA,OAAAP,GAUAQ,EAAAD,GAAA,mBOzEA,SAA0B0G,EAAK5D,GAC9B,OACCA,GACAA,EAAM6D,MACS,cAAf7D,EAAM6D,MACNrF,EAAUwB,EAAMjD,KAChByB,EAAUwB,EAAMhD,IAET,IAAImB,EAAW6B,EAAMjD,GAAIiD,EAAMhD,IAEhCgD,CACR,ICTA7C,EAAA8E,GAAA,UCLA,SAAiBC,EAAKC,EAAKC,EAAKC,EAAKxF,EAAKyF,EAAWC,GAGpD,OAFA1F,EAAK0F,GAAcL,EAAME,EACzBvF,EAAK0F,EAAUD,GAAcH,EAAME,EAC5BxF,CACR,IDEAM,EAAA8E,GAAA,WEDA,SAAkB7E,EAAIoF,EAAUC,EAAUpF,EAAIqF,EAAUC,EAAU9F,EAAKyF,EAAWC,GAGjF,OAFA1F,EAAK0F,GAAcnF,EAAIqF,GAAapF,EAAIsF,GACxC9F,EAAK0F,EAAUD,GAAclF,EAAIqF,EAASD,GAAanF,EAAIsF,EAASD,GAC7D7F,CACR,ICJAM,EAAA8E,GAAA,UCHA,SAAiBC,EAAKC,EAAKC,EAAKC,EAAKyB,EAAKC,EAAKlH,EAAKyF,EAAWC,GAG9D,OAFA1F,EAAK0F,GAAcL,EAAME,EAAM0B,EAC/BjH,EAAK0F,EAAUD,GAAcH,EAAME,EAAM0B,EAClClH,CACR,IDAAM,EAAA8E,GAAA,WEGA,SAAkB7E,EAAIoF,EAAUC,EAAUpF,EAAIqF,EAAUC,EAAUS,EAAIY,EAAUC,EAAUpH,EAAKyF,EAAWC,GAGzG,OAFA1F,EAAK0F,GAAcnF,EAAIqF,GAAapF,EAAIsF,GAAaS,EAAIa,GACzDpH,EAAK0F,EAAUD,GAAclF,EAAIqF,EAASD,GAAanF,EAAIsF,EAASD,GAAaU,EAAIa,EAASD,GACvFnH,CACR,ICjBA,IAAAK,GAAA,CAAA,ECIA,SAASgH,GAAkBhC,EAAKC,EAAKC,EAAKC,EAAKlD,EAAGgF,GACjD,IAAIC,EACJ,OAAW,IAANjF,GACK+C,EAAOG,GAAOF,EAAIC,IAAU+B,EAG1B,KADZC,EAAKjC,EAAMhD,GAED+C,EAAIiC,EAAShC,EAAIgC,EAAKhF,GAEvB+C,EAAIkC,GAAOD,CACrB,CCPA,SAASE,GAAgBnC,EAAKC,EAAKC,EAAKC,GACvC,IAAIxF,EACAsC,EACAgF,EAQJ,OAJAA,EAAI,GAAQ/B,EAAOC,GADnBlD,EAAIkD,EAAMD,KADVvF,EAAM,CAAE,EAAK,IAIR,GAAMqH,GAAkBhC,EAAKC,EAAKC,EAAKC,EAAKlD,EAAGgF,GACpDtH,EAAK,GAAMqH,GAAkB/B,GAAMD,EAAKE,EAAKC,EAAKlD,EAAGgF,GAC9CtH,CACR,CFTAM,EAAAD,GAAA,iBGQA,SAAwBE,EAAIC,EAAIC,GAC/B,IAAIC,EAASZ,EAAMS,GACfI,EAASb,EAAMU,GACnB,OACCU,EAAkBR,EAAQ,GAAKC,EAAQ,GAAKF,IAC5CS,EAAkBR,EAAQ,GAAKC,EAAQ,GAAKF,EAE9C,IHLAH,EAAAD,GAAA,qBIAA,SAA4BE,EAAIC,EAAIC,GACnC,IAAIC,EAASZ,EAAMS,GACfI,EAASb,EAAMU,GACnB,OACCY,EAAsBV,EAAQ,GAAKC,EAAQ,GAAKF,IAChDW,EAAsBV,EAAQ,GAAKC,EAAQ,GAAKF,EAElD,IJGAH,EAAAD,GAAA,WKvBA,SAAkBE,EAAIC,GACrB,IAAIE,EAASZ,EAAMS,GACfI,EAASb,EAAMU,GACnB,OACCE,EAAQ,KAAQC,EAAQ,IACxBD,EAAQ,KAAQC,EAAQ,EAE1B,IL0BAL,EAAAD,GAAA,cMjCA,SAAqBE,EAAIC,GACxB,IAAIE,EAASZ,EAAMS,GACfI,EAASb,EAAMU,GACnB,OACCE,EAAQ,KAAQC,EAAQ,IACxBD,EAAQ,KAAQC,EAAQ,EAE1B,INoCAL,EAAAD,GAAA,eOnCA,SAAsBE,EAAIC,GACzB,IAAIE,EAASZ,EAAMS,GACfI,EAASb,EAAMU,GACnB,OACC0F,EAAQxF,EAAQ,GAAKC,EAAQ,KAC7BuF,EAAQxF,EAAQ,GAAKC,EAAQ,GAE/B,IPsCAL,EAAAD,GAAA,mBQ/CA,SAA0BE,EAAIC,GAC7B,IAAIE,EAASZ,EAAMS,GACfI,EAASb,EAAMU,GACnB,OACC0F,EAAQxF,EAAQ,GAAKC,EAAQ,KAC7BuF,EAAQxF,EAAQ,GAAKC,EAAQ,GAE/B,ICxBA,IAAI8G,GAAoC,GAAlBC,EAClBC,GAAkBC,GAAqB,EAAMC,GAC7CC,GAAgB,GAAQD,EAAMA,GAuBlC,SAASE,GAAQ1C,EAAKC,EAAKC,EAAKC,EAAKxF,EAAKyF,EAAWC,GACpD,IAAIsC,EACAC,EACAC,EACAC,EAsCJ,OApCAF,EAAKG,EAAKC,EAAIhD,GAAMgD,EAAI/C,IACxB4C,EAAKE,EAAKC,EAAI9C,GAAM8C,EAAI7C,IACxB2C,EAAI,EAECF,GAAMR,IACVpC,GAAO,GACPC,GAAO,GACP6C,GAAK,GACMF,GAAMN,KACjBtC,GAAOyC,GACPxC,GAAOwC,GACPK,GAAKL,IAEDI,GAAMT,IACVlC,GAAO,GACPC,GAAO,GACP2C,GAAK,IACMD,GAAMP,KACjBpC,GAAOuC,GACPtC,GAAOsC,GACPK,GAAKL,IAGDO,EAAK7C,IAAS6C,EAAK9C,GACvByC,EAAMR,GAAgBnC,EAAKC,EAAKC,EAAKC,IAErCwC,EAAMR,GAAgBlC,EAAKD,EAAKG,EAAKD,IAChC,KAAQ,EAGdyC,EAAK,IAAOG,EACZH,EAAK,IAAOG,EAEZnI,EAAK0F,GAAcsC,EAAK,GACxBhI,EAAK0F,EAAUD,GAAcuC,EAAK,GAE3BhI,CACR,CCrEA,IAAIA,GAAM,IAAIC,EAAc,GAyB5B,SAASqI,GAAM/H,EAAIC,GAClB,IAAI6E,EACAE,EACAD,EACAE,EASJ,OAPAH,EAAM9D,GAAMhB,GACZgF,EAAMhE,GAAMf,GACZ8E,EAAM9D,GAAMjB,GACZiF,EAAMhE,GAAMhB,GAIL,IAAIuB,GAFX/B,GAAM+H,GAAQ1C,EAAKC,EAAKC,EAAKC,EAAKxF,GAAK,EAAG,IAEd,GAAKA,GAAK,GACvC,CCzBA,SAAS+F,GAAKxF,EAAIC,GACjB,IAAI6E,EAAM9D,GAAMhB,GACZgF,EAAMhE,GAAMf,GACZ8E,EAAM9D,GAAMjB,GACZiF,EAAMhE,GAAMhB,GAGhB,OAAO,IAAIuB,EAFDsD,EAAIE,EAAQD,EAAIE,EAChBH,EAAIG,EAAQF,EAAIC,EAE3B,CCNA,SAASgD,GAAQtC,EAAO1D,EAAGC,GAC1B,IAAIgG,EAAMjH,GAAM0E,GACZwC,EAAMjH,GAAMyE,GACZZ,EAAM9D,GAAMgB,GACZ+C,EAAM9D,GAAMe,GAKhB,OAAO,IAAIR,EAFDyG,EAAInD,EAAQoD,EAAInD,EAFhB/D,GAAMiB,GAGNgG,EAAIlD,EAAQmD,EAAIpD,EAFhB7D,GAAMgB,GAIjB,CCbA,SAASwD,GAAOC,EAAOlG,GACtB,OAAO,IAAIgC,EAAYR,GAAMxB,GAAMkG,EAAOzE,GAAMzB,GAAMkG,EACvD,CCAA3F,EAAA8E,GAAA,SAAA2C,IACAzH,EAAA8E,GAAA,WCGA,SAAkB7E,EAAIoF,EAAUC,EAAUpF,EAAIqF,EAAUC,EAAU9F,EAAKyF,EAAWC,GACjF,OAAOqC,GAAQxH,EAAIqF,GAAYrF,EAAIqF,EAASD,GAAYnF,EAAIsF,GAAYtF,EAAIsF,EAASD,GAAY7F,EAAKyF,EAAWC,EAClH,ICNApF,EAAA8E,GAAA,UCNA,SAAiBC,EAAKC,EAAKC,EAAKC,EAAKxF,EAAKyF,EAAWC,GAGpD,OAFA1F,EAAK0F,GAAeL,EAAIE,EAAQD,EAAIE,EACpCxF,EAAK0F,EAAUD,GAAeJ,EAAIG,EAAQF,EAAIC,EACvCvF,CACR,IDGAM,EAAA8E,GAAA,WEFA,SAAkB7E,EAAIoF,EAAUC,EAAUpF,EAAIqF,EAAUC,EAAU9F,EAAKyF,EAAWC,GACjF,IAAIL,EAAM9E,EAAIqF,GACVN,EAAM/E,EAAIqF,EAASD,GACnBJ,EAAM/E,EAAIsF,GACVN,EAAMhF,EAAIsF,EAASD,GAGvB,OAFA7F,EAAK0F,GAAeL,EAAIE,EAAQD,EAAIE,EACpCxF,EAAK0F,EAAUD,GAAeJ,EAAIG,EAAQF,EAAIC,EACvCvF,CACR,ICNAM,EAAA8E,GAAA,UCLA,SAAiBsD,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAI/I,EAAKyF,EAAWC,GAGxD,OAFA1F,EAAK0F,GAAegD,EAAGE,EAAOD,EAAGE,EAAMC,EACvC9I,EAAK0F,EAAUD,GAAeiD,EAAGG,EAAOF,EAAGC,EAAMG,EAC1C/I,CACR,IDEAM,EAAA8E,GAAA,WECA,SAAkBa,EAAO+C,EAASC,EAAS1G,EAAG2G,EAASC,EAAS3G,EAAG4G,EAASC,EAASrJ,EAAKyF,EAAWC,GACpG,IAAI8C,EAAMvC,EAAOgD,GACbR,EAAMxC,EAAOgD,EAAQD,GACrB3D,EAAM9C,EAAG4G,GACT7D,EAAM/C,EAAG4G,EAAQD,GACjB3D,EAAM/C,EAAG6G,GACT7D,EAAMhD,EAAG6G,EAAQD,GAGrB,OAFApJ,EAAK0F,GAAe8C,EAAInD,EAAQoD,EAAInD,EAAOC,EAC3CvF,EAAK0F,EAAUD,GAAe+C,EAAIlD,EAAQmD,EAAIpD,EAAOG,EAC9CxF,CACR,ICdAM,EAAA8E,GAAA,UCNA,SAAiBa,EAAO/F,EAAIC,EAAIH,EAAKyF,EAAWC,GAG/C,OAFA1F,EAAK0F,GAAcxF,EAAK+F,EACxBjG,EAAK0F,EAAUD,GAActF,EAAK8F,EAC3BjG,CACR,IDGAM,EAAA8E,GAAA,WEJA,SAAkBa,EAAOlG,EAAGoG,EAASC,EAASpG,EAAKyF,EAAWC,GAG7D,OAFA1F,EAAK0F,GAAcO,EAAQlG,EAAGqG,GAC9BpG,EAAK0F,EAAUD,GAAcQ,EAAQlG,EAAGqG,EAAQD,GACzCnG,CACR,ICVA,IAAAK,GAAA,CAAA,EAUAC,EAAAD,GAAA,MAAA2E,IAUA1E,EAAAD,GAAA,OAAAiG,IAUAhG,EAAAD,GAAA,SAAA2B,IAUA1B,EAAAD,GAAA,MAAAiJ,IAUAhJ,EAAAD,GAAA,YCpDA,SAAoBN,GACnB,OAAOA,CACR,ID4DAO,EAAAD,GAAA,MAAA0F,IAUAzF,EAAAD,GAAA,SAAAkI,IAUAjI,EAAAD,GAAA,OEzDA,SAAeN,GACd,OAAO,IAAIgC,GAAaR,GAAMxB,IAAMyB,GAAMzB,GAC3C,IFiEAO,EAAAD,GAAA,QAAA2F,IAUA1F,EAAAD,GAAA,OG3FA,SAAeE,EAAIC,GAGlB,OAAO,IAAIuB,EAFFR,GAAMhB,GAAOgB,GAAMf,GACnBgB,GAAMjB,GAAOiB,GAAMhB,GAE7B,ICbA,IAAAH,GAAA,CAAA,EAUAC,EAAAD,GAAA,OAAAmG,IAUAlG,EAAAD,GAAA,QChBA,SAAeN,GACd,OAAO,IAAIgC,EAAYR,GAAMxB,IAAMyB,GAAMzB,GAC1C,IDwBAO,EAAAD,GAAA,aAAA0B,GAUAzB,EAAAD,GAAA,OAAAmB,IAUAlB,EAAAD,GAAA,mBE1BA,SAA0B4C,GACzB,IAAIyD,EACAxG,EACAC,EAAK,EAET,IAAMwG,EAAU1D,GACf,MAAM,IAAIvB,UAAWE,EAAQ,kEAAmEqB,IAIjG,KADAyD,EAAQhD,EAAST,EAAK,MAAO,IAAKyD,MA5B3B,8GA8BN,MAAM,IAAIE,MAAOhF,EAAQ,mFAAoFqB,IAY9G,OARA/C,EAAOwG,EAAM,KAAOA,EAAM,GAAGG,SAAU,KAAUC,WAAYJ,EAAM,IAAO,EAGrEA,EAAM,GACVvG,GAAsB,MAAbuG,EAAM,IAAgB,EAAI,GAAMI,WAAYpD,EAASgD,EAAM,GAAI,KAAM,KACnEA,EAAM,IAAMA,EAAM,GAAGG,SAAU,OAC1C1G,EAAK2G,WAAYpD,EAASgD,EAAM,GAAI,KAAM,MAEpC,IAAI3E,EAAY7B,EAAIC,EAC5B,IFYAG,EAAAD,GAAA,OAAAkB,IAUAjB,EAAAD,GAAA,OAAAP,GAUAQ,EAAAD,GAAA,oBGzEA,SAA2B0G,EAAK5D,GAC/B,OACCA,GACAA,EAAM6D,MACS,eAAf7D,EAAM6D,MACNrF,EAAUwB,EAAMjD,KAChByB,EAAUwB,EAAMhD,IAET,IAAI4B,EAAYoB,EAAMjD,GAAIiD,EAAMhD,IAEjCgD,CACR,88BC8BA,SAASoG,GAAgBC,EAAQC,GAChC,IAAIC,EACJ,OAA0B,IAArB7G,UAAUC,OAnDhB,WACC,IAAI4B,EACAiF,EACA3J,EACA4J,EACAC,EACAC,EACAJ,EACAK,EACAnH,EAKJ,IAHA5C,EAAM,CAAA,EAEN2J,GADAjF,EAASsF,EAAYC,KACLnH,OACVF,EAAI,EAAGA,EAAI+G,EAAQ/G,IAAM,CAI9B,IAHAiH,EAAMnF,EAAQ9B,GACd8G,EAAIO,GAAiBJ,GACrBD,EAAM,CAAA,EACAG,EAAI,EAAGA,EAAIJ,EAAQI,IAExBH,EADAE,EAAMpF,EAAQqF,IACDL,EAAGI,GAEjB9J,EAAK6J,GAAQD,CACb,CACD,OAAO5J,CACR,CA2BSkK,GAEHC,EAAYF,GAAiBT,KACjCE,EAAIO,GAAiBT,GAChBW,EAAYT,EAAGD,IACZC,EAAGD,GAGL,IACR,CCpEA,IAAI1F,GAAQ,CACXhC,WAAcA,EACdT,UAAaA,GCad,SAAS8I,GAAerD,EAAK5D,GAC5B,IAAIhB,EACJ,OACCgB,GACAA,EAAM6D,MACNrF,EAAUwB,EAAMjD,KAChByB,EAAUwB,EAAMhD,MAEhBgC,EAAO4B,GAAOZ,EAAM6D,OAEZ,IAAI7E,EAAMgB,EAAMjD,GAAIiD,EAAMhD,IAG5BgD,CACR,CCrBA,IAAA9C,GAAA,CAAA,EAUAC,EAAAD,GAAA,OAAAmG,GAUAlG,EAAAD,GAAA,UAAAmE,GAUAlE,EAAAD,GAAA,QAAA0D,GAUAzD,EAAAD,GAAA,QAAA6D,GAUA5D,EAAAD,GAAA,SAAAqE,GAUApE,EAAAD,GAAA,UAAAiE,IAUAhE,EAAAD,GAAA,UAAAgE,IAUA/D,EAAAD,GAAA,iBAAAkJ,IAUAjJ,EAAAD,GAAA,gBAAA+J"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 4a9ec1a7..00000000 --- a/lib/index.js +++ /dev/null @@ -1,123 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/* -* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name. -*/ - -// MODULES // - -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); - - -// MAIN // - -/** -* Top-level namespace. -* -* @namespace ns -*/ -var ns = {}; - -/** -* @name base -* @memberof ns -* @readonly -* @type {Namespace} -* @see {@link module:@stdlib/complex/base} -*/ -setReadOnly( ns, 'base', require( './../base' ) ); - -/** -* @name complex -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/cmplx} -*/ -setReadOnly( ns, 'complex', require( './../cmplx' ) ); - -/** -* @name ctors -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/ctors} -*/ -setReadOnly( ns, 'ctors', require( './../ctors' ) ); - -/** -* @name dtype -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/dtype} -*/ -setReadOnly( ns, 'dtype', require( './../dtype' ) ); - -/** -* @name dtypes -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/dtypes} -*/ -setReadOnly( ns, 'dtypes', require( './../dtypes' ) ); - -/** -* @name float32 -* @memberof ns -* @readonly -* @type {Namespace} -* @see {@link module:@stdlib/complex/float32} -*/ -setReadOnly( ns, 'float32', require( './../float32' ) ); - -/** -* @name float64 -* @memberof ns -* @readonly -* @type {Namespace} -* @see {@link module:@stdlib/complex/float64} -*/ -setReadOnly( ns, 'float64', require( './../float64' ) ); - -/** -* @name promotionRules -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/promotion-rules} -*/ -setReadOnly( ns, 'promotionRules', require( './../promotion-rules' ) ); - -/** -* @name reviveComplex -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/complex/reviver} -*/ -setReadOnly( ns, 'reviveComplex', require( './../reviver' ) ); - - -// EXPORTS // - -module.exports = ns; diff --git a/package.json b/package.json index f95afe1d..39aa691f 100644 --- a/package.json +++ b/package.json @@ -3,30 +3,8 @@ "version": "0.3.3", "description": "Complex numbers.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "lib/index.js", - "directories": { - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -35,39 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array": "github:stdlib-js/array#main", - "@stdlib/assert": "github:stdlib-js/assert#main", - "@stdlib/constants": "github:stdlib-js/constants#main", - "@stdlib/math": "github:stdlib-js/math#main", - "@stdlib/number": "github:stdlib-js/number#main", - "@stdlib/string": "github:stdlib-js/string#main", - "@stdlib/types": "github:stdlib-js/types#main", - "@stdlib/utils": "github:stdlib-js/utils#main" - }, - "devDependencies": { - "@stdlib/bench": "github:stdlib-js/bench#main", - "@stdlib/console": "github:stdlib-js/console#main", - "@stdlib/random": "github:stdlib-js/random#main", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", diff --git a/promotion-rules/README.md b/promotion-rules/README.md deleted file mode 100644 index 6b1a681f..00000000 --- a/promotion-rules/README.md +++ /dev/null @@ -1,164 +0,0 @@ - - -# Promotion Rules - -> Return the complex number [data type][@stdlib/complex/dtypes] with the smallest size and closest "kind" to which data types can be **safely** cast. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var promotionRules = require( '@stdlib/complex/promotion-rules' ); -``` - -#### promotionRules( \[dtype1, dtype2] ) - -If provided data types, returns the complex number [data type][@stdlib/complex/dtypes] with the smallest size and closest "kind" to which data types can be **safely** cast. - -```javascript -var out = promotionRules( 'complex128', 'complex64' ); -// returns 'complex128' -``` - -If not provided data types, the function returns a promotion table. - -```javascript -var out = promotionRules(); -// returns {...} - -var c128 = out[ 'complex128' ]; -// returns {...} - -var rule = c128[ 'uint32' ]; -// returns 'complex128' -``` - -If provided an unrecognized or unsupported `dtype`, the function returns `null`. - -```javascript -var out = promotionRules( 'foo', 'complex128' ); -// returns null -``` - -
- - - - - -
- -## Notes - -- If a [data type][@stdlib/complex/dtypes] to which data types can be safely cast does **not** exist (or is not supported), the function returns `-1`. - -
- - - - - -
- -## Examples - - - -```javascript -var dtypes = require( '@stdlib/complex/dtypes' ); -var promotionRules = require( '@stdlib/complex/promotion-rules' ); - -var DTYPES; -var dt1; -var dt2; -var dt; -var i; -var j; - -// Get the list of supported data types: -DTYPES = dtypes(); - -// Print the promotion rule for each pair of data types... -for ( i = 0; i < DTYPES.length; i++ ) { - dt1 = DTYPES[ i ]; - for ( j = 0; j < DTYPES.length; j++ ) { - dt2 = DTYPES[ j ]; - dt = promotionRules( dt1, dt2 ); - console.log( '(%s, %s) => %s', dt1, dt2, dt ); - } -} -``` - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/promotion-rules/benchmark/benchmark.js b/promotion-rules/benchmark/benchmark.js deleted file mode 100644 index c3420cb6..00000000 --- a/promotion-rules/benchmark/benchmark.js +++ /dev/null @@ -1,77 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var dtypes = require( './../../dtypes' ); -var pkg = require( './../package.json' ).name; -var promotionRules = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = promotionRules(); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( typeof out !== 'object' ) { - b.fail( 'should return an object' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::dtypes', function benchmark( b ) { - var out; - var dt; - var N; - var i; - var j; - var k; - - dt = dtypes(); - N = dt.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - j = i % N; - k = (i+1) % N; - out = promotionRules( dt[ j ], dt[ k ] ); - if ( typeof out !== 'string' && out !== -1 ) { - b.fail( 'should return a string or -1' ); - } - } - b.toc(); - if ( !isString( out ) && out !== -1 ) { - b.fail( 'should return a string or -1' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/promotion-rules/docs/repl.txt b/promotion-rules/docs/repl.txt deleted file mode 100644 index 07606936..00000000 --- a/promotion-rules/docs/repl.txt +++ /dev/null @@ -1,33 +0,0 @@ - -{{alias}}( [dtype1, dtype2] ) - Returns the complex number data type with the smallest size and closest - "kind" to which data types can be safely cast. - - If not provided data types, the function returns a type promotion table. - - If a data type to which data types can be safely cast does *not* exist (or - is not supported), the function returns `-1`. - - If provided an unrecognized data type, the function returns `null`. - - Parameters - ---------- - dtype1: string (optional) - Data type. - - dtype2: string (optional) - Data type. - - Returns - ------- - out: Object|string|integer|null - Promotion rule(s). - - Examples - -------- - > var out = {{alias}}( 'complex128', 'complex64' ) - 'complex128' - - See Also - -------- - diff --git a/promotion-rules/docs/types/index.d.ts b/promotion-rules/docs/types/index.d.ts deleted file mode 100644 index 5e9bd94e..00000000 --- a/promotion-rules/docs/types/index.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { ComplexFloatingPointDataType } from '@stdlib/types/complex'; - -/** -* Real number data types. -*/ -type RealDataTypes = 'float64' | 'float32' | 'int32' | 'int16' | 'int8' | 'uint32' | 'uint16' | 'uint8' | 'uint8c'; - -/** -* Number data types. -*/ -type DataType = RealDataTypes | ComplexFloatingPointDataType; - -/** -* Interface describing a promotion table. -*/ -interface Table { - /** - * Data type promotion rules. - */ - [key: string]: DataType | number; -} - -/** -* Promotion rule. -*/ -type PromotionRule = DataType | number; - -/** -* Returns the complex number data type with the smallest size and closest "kind" to which data types can be safely cast. -* -* @param dtype1 - data type -* @param dtype2 - data type -* @returns promotion rule -* -* @example -* var dt = promotionRules( 'complex128', 'complex64' ); -* // returns 'complex128' -* -* @example -* var dt = promotionRules( 'complex128', 'foo' ); -* // returns null -*/ -declare function promotionRules( dtype1: DataType, dtype2: DataType ): PromotionRule; - -/** -* Returns the complex number data type with the smallest size and closest "kind" to which data types can be safely cast. -* -* @param dtype1 - data type -* @param dtype2 - data type -* @returns promotion rule -* -* @example -* var dt = promotionRules( 'complex128', 'foo' ); -* // returns null -* -* @example -* var dt = promotionRules( 'bar', 'complex128' ); -* // returns null -* -* @example -* var dt = promotionRules( 'bar', 'foo' ); -* // returns null -*/ -declare function promotionRules( dtype1: string, dtype2: string ): null; - -/** -* Returns a type promotion table displaying complex number data types with the smallest size and closest "kind" to which data types can be safely cast. -* -* @returns promotion rule table -* -* @example -* var table = promotionRules(); -* // returns {...} -*/ -declare function promotionRules(): Table; - - -// EXPORTS // - -export = promotionRules; diff --git a/promotion-rules/docs/types/test.ts b/promotion-rules/docs/types/test.ts deleted file mode 100644 index 6632dea8..00000000 --- a/promotion-rules/docs/types/test.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import promotionRules = require( './index' ); - - -// TESTS // - -// The function returns an object when not provided any arguments... -{ - promotionRules(); // $ExpectType Table -} - -// The function returns a promoted data type promotion rule when provided recognized data types... -{ - promotionRules( 'complex128', 'complex64' ); // $ExpectType PromotionRule - promotionRules( 'float64', 'complex128' ); // $ExpectType PromotionRule -} - -// The function returns null when provided unrecognized data types... -{ - promotionRules( 'complex128', 'foo' ); // $ExpectType null - promotionRules( 'bar', 'foo' ); // $ExpectType null - promotionRules( 'bar', 'complex128' ); // $ExpectType null -} - -// The compiler throws an error if the function is provided a first argument that is not a string... -{ - promotionRules( 123, 'complex128' ); // $ExpectError - promotionRules( true, 'complex128' ); // $ExpectError - promotionRules( false, 'complex128' ); // $ExpectError - promotionRules( null, 'complex128' ); // $ExpectError - promotionRules( {}, 'complex128' ); // $ExpectError - promotionRules( ( x: number ): number => x, 'complex128' ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument that is not a string... -{ - promotionRules( 'complex64', 123 ); // $ExpectError - promotionRules( 'complex64', true ); // $ExpectError - promotionRules( 'complex64', false ); // $ExpectError - promotionRules( 'complex64', null ); // $ExpectError - promotionRules( 'complex64', {} ); // $ExpectError - promotionRules( 'complex64', ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided more than one argument... -{ - promotionRules( 'complex128' ); // $ExpectError - promotionRules( 'complex128', 'complex64', {} ); // $ExpectError -} diff --git a/promotion-rules/examples/index.js b/promotion-rules/examples/index.js deleted file mode 100644 index f38b26a9..00000000 --- a/promotion-rules/examples/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var dtypes = require( './../../dtypes' ); -var promotionRules = require( './../lib' ); - -var DTYPES; -var dt1; -var dt2; -var dt; -var i; -var j; - -// Get the list of supported complex number data types: -DTYPES = dtypes(); - -// Print the promotion rule for each pair of data types... -for ( i = 0; i < DTYPES.length; i++ ) { - dt1 = DTYPES[ i ]; - for ( j = 0; j < DTYPES.length; j++ ) { - dt2 = DTYPES[ j ]; - dt = promotionRules( dt1, dt2 ); - console.log( '(%s, %s) => %s', dt1, dt2, dt ); - } -} diff --git a/promotion-rules/lib/index.js b/promotion-rules/lib/index.js deleted file mode 100644 index dcd6a130..00000000 --- a/promotion-rules/lib/index.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Return the complex number data type with the smallest size and closest "kind" to which data types can be safely cast. -* -* @module @stdlib/complex/promotion-rules -* -* @example -* var promotionRules = require( '@stdlib/complex/promotion-rules' ); -* -* var table = promotionRules(); -* // returns {...} -* -* var dt = promotionRules( 'complex128', 'complex64' ); -* // returns 'complex128' -* -* dt = promotionRules( 'complex128', 'foo' ); -* // returns null -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/promotion-rules/lib/main.js b/promotion-rules/lib/main.js deleted file mode 100644 index 3eb2a688..00000000 --- a/promotion-rules/lib/main.js +++ /dev/null @@ -1,102 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var objectKeys = require( '@stdlib/utils/keys' ); -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); -var PROMOTION_RULES = require( './promotion_rules.json' ); - - -// FUNCTIONS // - -/** -* Generates a full table of promotion rules. -* -* @private -* @returns {Object} table -*/ -function generateFullTable() { - var dtypes; - var ntypes; - var out; - var tmp; - var dt1; - var dt2; - var o; - var j; - var i; - - out = {}; - dtypes = objectKeys( PROMOTION_RULES ); - ntypes = dtypes.length; - for ( i = 0; i < ntypes; i++ ) { - dt1 = dtypes[ i ]; - o = PROMOTION_RULES[ dt1 ]; - tmp = {}; - for ( j = 0; j < ntypes; j++ ) { - dt2 = dtypes[ j ]; - tmp[ dt2 ] = o[ dt2 ]; - } - out[ dt1 ] = tmp; - } - return out; -} - - -// MAIN // - -/** -* Returns the complex number data type with the smallest size and closest "kind" to which data types can be safely cast. -* -* @param {string} [dtype1] - data type -* @param {string} [dtype2] - data type -* @returns {(Object|integer|string|null)} promotion rule(s) or null -* -* @example -* var table = promotionRules(); -* // returns {...} -* -* @example -* var dt = promotionRules( 'complex128', 'complex64' ); -* // returns 'complex128' -* -* @example -* var dt = promotionRules( 'complex128', 'foo' ); -* // returns null -*/ -function promotionRules( dtype1, dtype2 ) { - var o; - if ( arguments.length === 0 ) { - return generateFullTable(); - } - if ( hasOwnProp( PROMOTION_RULES, dtype1 ) ) { - o = PROMOTION_RULES[ dtype1 ]; - if ( hasOwnProp( o, dtype2 ) ) { - return o[ dtype2 ]; - } - } - return null; -} - - -// EXPORTS // - -module.exports = promotionRules; diff --git a/promotion-rules/lib/promotion_rules.json b/promotion-rules/lib/promotion_rules.json deleted file mode 100644 index ef4a8b81..00000000 --- a/promotion-rules/lib/promotion_rules.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "float64": { - "complex64": "complex128", - "complex128": "complex128" - }, - "float32": { - "complex64": "complex64", - "complex128": "complex128" - }, - "int32": { - "complex64": "complex128", - "complex128": "complex128" - }, - "int16": { - "complex64": "complex64", - "complex128": "complex128" - }, - "int8": { - "complex64": "complex64", - "complex128": "complex128" - }, - "uint32": { - "complex64": "complex128", - "complex128": "complex128" - }, - "uint16": { - "complex64": "complex64", - "complex128": "complex128" - }, - "uint8": { - "complex64": "complex64", - "complex128": "complex128" - }, - "uint8c": { - "complex64": "complex64", - "complex128": "complex128" - }, - "complex128": { - "float64": "complex128", - "float32": "complex128", - "int32": "complex128", - "int16": "complex128", - "int8": "complex128", - "uint32": "complex128", - "uint16": "complex128", - "uint8": "complex128", - "uint8c": "complex128", - "complex64": "complex128", - "complex128": "complex128" - }, - "complex64": { - "float64": "complex128", - "float32": "complex64", - "int32": "complex128", - "int16": "complex64", - "int8": "complex64", - "uint32": "complex128", - "uint16": "complex64", - "uint8": "complex64", - "uint8c": "complex64", - "complex64": "complex64", - "complex128": "complex128" - } -} diff --git a/promotion-rules/package.json b/promotion-rules/package.json deleted file mode 100644 index 312e20f5..00000000 --- a/promotion-rules/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "@stdlib/complex/promotion-rules", - "version": "0.0.0", - "description": "Return the complex number data type with the smallest size and closest kind to which data types can be safely cast.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "types", - "complex", - "cmplx", - "casting", - "cast", - "convert", - "conversion", - "rules", - "promotion", - "utilities", - "utility", - "utils", - "util" - ], - "__stdlib__": {} -} diff --git a/promotion-rules/test/test.js b/promotion-rules/test/test.js deleted file mode 100644 index 79b52554..00000000 --- a/promotion-rules/test/test.js +++ /dev/null @@ -1,133 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2022 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var dtypes = require( './../../dtypes' ); -var isObject = require( '@stdlib/assert/is-plain-object' ); -var promotionRules = require( './../lib' ); - - -// VARIABLES // - -var DTYPES = dtypes(); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof promotionRules, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'if not provided data types, the function returns a table', function test( t ) { - var out = promotionRules(); - t.strictEqual( isObject( out ), true, 'returns expected value' ); - t.strictEqual( out[ 'complex128' ][ 'uint32' ], 'complex128', 'returns expected value' ); - t.end(); -}); - -tape( 'the function returns the complex data type with the smallest size and closest "kind" to which data types can be safely cast', function test( t ) { - var table; - var dt1; - var dt2; - var dt; - var j; - var i; - - table = promotionRules(); - - for ( i = 0; i < DTYPES.length; i++ ) { - dt1 = DTYPES[ i ]; - for ( j = 0; j < DTYPES.length; j++ ) { - dt2 = DTYPES[ j ]; - dt = promotionRules( dt1, dt2 ); - t.strictEqual( dt, table[ dt1 ][ dt2 ], 'returns expected value when provided ('+dt1+','+dt2+')' ); - } - } - t.end(); -}); - -tape( 'the function returns the complex data type with the smallest size and closest "kind" to which data types can be safely cast (real data types)', function test( t ) { - var dtypes; - var table; - var dt1; - var dt2; - var dt; - var j; - var i; - - dtypes = [ - 'float64', - 'float32', - 'int32', - 'int16', - 'int8', - 'uint32', - 'uint16', - 'uint8', - 'uint8c' - ]; - - table = promotionRules(); - - for ( i = 0; i < DTYPES.length; i++ ) { - dt1 = DTYPES[ i ]; - for ( j = 0; j < dtypes.length; j++ ) { - dt2 = dtypes[ j ]; - dt = promotionRules( dt1, dt2 ); - t.strictEqual( dt, table[ dt1 ][ dt2 ], 'returns expected value when provided ('+dt1+','+dt2+')' ); - } - } - for ( i = 0; i < dtypes.length; i++ ) { - dt1 = dtypes[ i ]; - for ( j = 0; j < DTYPES.length; j++ ) { - dt2 = DTYPES[ j ]; - dt = promotionRules( dt1, dt2 ); - t.strictEqual( dt, table[ dt1 ][ dt2 ], 'returns expected value when provided ('+dt1+','+dt2+')' ); - } - } - t.end(); -}); - -tape( 'if provided an unrecognized or unsupported data type, the function returns `null`', function test( t ) { - var values; - var i; - var j; - - values = [ - 'beep', - 'boop', - 'foo', - 'bar', - true, - false - ]; - for ( i = 0; i < values.length; i++ ) { - t.strictEqual( promotionRules( values[ i ], 'complex128' ), null, 'returns expected value when provided '+values[ i ] ); - t.strictEqual( promotionRules( 'complex128', values[ i ] ), null, 'returns expected value when provided '+values[ i ] ); - - j = (i+1) % values.length; - t.strictEqual( promotionRules( values[ i ], values[ j ] ), null, 'returns expected value when provided ('+values[ i ]+','+values[ j ]+')' ); - } - t.end(); -}); diff --git a/reviver/README.md b/reviver/README.md deleted file mode 100644 index 838aca07..00000000 --- a/reviver/README.md +++ /dev/null @@ -1,148 +0,0 @@ - - -# reviveComplex - -> Revive a JSON-serialized complex number. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var reviveComplex = require( '@stdlib/complex/reviver' ); -``` - -#### reviveComplex( key, value ) - -Revives a JSON-serialized `complex` number. - -```javascript -var parseJSON = require( '@stdlib/utils/parse-json' ); - -var str = '{"type":"Complex128","re":5,"im":3}'; - -var z = parseJSON( str, reviveComplex ); -// returns -``` - -For details on the JSON serialization format, see [`Complex128`][@stdlib/complex/float64/ctor]. - -
- - - - - -
- -
- - - - - -
- -## Examples - - - -```javascript -var Complex128 = require( '@stdlib/complex/float64/ctor' ); -var parseJSON = require( '@stdlib/utils/parse-json' ); -var reviveComplex = require( '@stdlib/complex/reviver' ); - -var z = new Complex128( 5.0, 3.0 ); -var str = JSON.stringify( z ); -// returns '{"type":"Complex128","re":5,"im":3}' - -var w = parseJSON( str, reviveComplex ); -if ( w instanceof Error ) { - throw w; -} -var bool = ( w instanceof z.constructor ); -// returns true - -bool = ( w.re === z.re ); -// returns true - -bool = ( w.im === z.im ); -// returns true -``` - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/reviver/benchmark/benchmark.js b/reviver/benchmark/benchmark.js deleted file mode 100644 index ecd89396..00000000 --- a/reviver/benchmark/benchmark.js +++ /dev/null @@ -1,92 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var parseJSON = require( '@stdlib/utils/parse-json' ); -var pkg = require( './../package.json' ).name; -var reviver = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var str; - var o; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - str = '{"type":"Complex128","re":'+i+',"im":'+(i+1)+'}'; - o = parseJSON( str, reviver ); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::no_reviver', function benchmark( b ) { - var str; - var o; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - str = '{"type":"Complex128","re":'+i+',"im":'+(i+1)+'}'; - o = parseJSON( str ); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::no_reviver,built-in', function benchmark( b ) { - var str; - var o; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - str = '{"type":"Complex128","re":'+i+',"im":'+(i+1)+'}'; - o = JSON.parse( str ); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( typeof o !== 'object' ) { - b.fail( 'should return an object' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/reviver/docs/repl.txt b/reviver/docs/repl.txt deleted file mode 100644 index 42dc88b8..00000000 --- a/reviver/docs/repl.txt +++ /dev/null @@ -1,33 +0,0 @@ - -{{alias}}( key, value ) - Revives a JSON-serialized complex number. - - The serialization format for complex numbers is an object having the - following fields: - - - type: complex number type (e.g., "Complex128", "Complex64"). - - re: real component (number). - - im: imaginary component (number). - - Parameters - ---------- - key: string - Key. - - value: any - Value. - - Returns - ------- - out: any - Value or complex number. - - Examples - -------- - > var str = '{"type":"Complex128","re":5,"im":3}'; - > var z = {{alias:@stdlib/utils/parse-json}}( str, {{alias}} ) - - - See Also - -------- - diff --git a/reviver/docs/types/index.d.ts b/reviver/docs/types/index.d.ts deleted file mode 100644 index d5375b1f..00000000 --- a/reviver/docs/types/index.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/** -* Revives a JSON-serialized complex number. -* -* @param key - key -* @param value - value -* @returns value or complex number -* -* @example -* var parseJSON = require( '@stdlib/utils/parse-json' ); -* -* var str = '{"type":"Complex128","re":5,"im":3}'; -* -* var z = parseJSON( str, reviver ); -* // returns -*/ -declare function reviver( key: string, value: any ): any; - - -// EXPORTS // - -export = reviver; diff --git a/reviver/docs/types/test.ts b/reviver/docs/types/test.ts deleted file mode 100644 index a62c30af..00000000 --- a/reviver/docs/types/test.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2021 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import reviver = require( './index' ); - - -// TESTS // - -// The function can be used to revive a serialized object... -{ - JSON.parse( '{"type":"Complex128","re":5,"im":3}', reviver ); // $ExpectType any -} - -// The compiler throws an error if the function is provided a first argument that is not a string... -{ - reviver( true, 1 ); // $ExpectError - reviver( false, 1 ); // $ExpectError - reviver( null, 1 ); // $ExpectError - reviver( undefined, 1 ); // $ExpectError - reviver( 5, 1 ); // $ExpectError - reviver( [], 1 ); // $ExpectError - reviver( {}, 1 ); // $ExpectError - reviver( ( x: number ): number => x, 1 ); // $ExpectError -} - -// The compiler throws an error if the function is provided insufficient arguments... -{ - reviver(); // $ExpectError - reviver( 'beep' ); // $ExpectError -} diff --git a/reviver/examples/index.js b/reviver/examples/index.js deleted file mode 100644 index e0cde8d5..00000000 --- a/reviver/examples/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Complex128 = require( './../../float64/ctor' ); -var parseJSON = require( '@stdlib/utils/parse-json' ); -var reviveComplex = require( './../lib' ); - -var z = new Complex128( 5.0, 3.0 ); -var str = JSON.stringify( z ); -console.log( str ); -// => '{"type":"Complex128","re":5,"im":3}' - -var w = parseJSON( str, reviveComplex ); -if ( w instanceof Error ) { - throw w; -} -var bool = ( w instanceof z.constructor ); -console.log( bool ); -// => true - -bool = ( w.re === z.re ); -console.log( bool ); -// => true - -bool = ( w.im === z.im ); -console.log( bool ); -// => true diff --git a/reviver/lib/ctors.js b/reviver/lib/ctors.js deleted file mode 100644 index dfa97158..00000000 --- a/reviver/lib/ctors.js +++ /dev/null @@ -1,37 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var Complex128 = require( './../../float64/ctor' ); -var Complex64 = require( './../../float32/ctor' ); - - -// MAIN // - -var ctors = { - 'Complex128': Complex128, - 'Complex64': Complex64 -}; - - -// EXPORTS // - -module.exports = ctors; diff --git a/reviver/lib/index.js b/reviver/lib/index.js deleted file mode 100644 index d4c3abc0..00000000 --- a/reviver/lib/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Revive a JSON-serialized complex number. -* -* @module @stdlib/complex/reviver -* -* @example -* var parseJSON = require( '@stdlib/utils/parse-json' ); -* var reviveComplex = require( '@stdlib/complex/reviver' ); -* -* var str = '{"type":"Complex128","re":5,"im":3}'; -* -* var z = parseJSON( str, reviveComplex ); -* // returns -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/reviver/lib/main.js b/reviver/lib/main.js deleted file mode 100644 index e0582c15..00000000 --- a/reviver/lib/main.js +++ /dev/null @@ -1,63 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var ctors = require( './ctors.js' ); - - -// MAIN // - -/** -* Revives a JSON-serialized complex number. -* -* @param {string} key - key -* @param {*} value - value -* @returns {(*|Complex)} value or complex number -* -* @example -* var parseJSON = require( '@stdlib/utils/parse-json' ); -* -* var str = '{"type":"Complex128","re":5,"im":3}'; -* -* var z = parseJSON( str, reviveComplex ); -* // returns -*/ -function reviveComplex( key, value ) { - var ctor; - if ( - value && - value.type && - isNumber( value.re ) && - isNumber( value.im ) - ) { - ctor = ctors[ value.type ]; - if ( ctor ) { - return new ctor( value.re, value.im ); - } - } - return value; -} - - -// EXPORTS // - -module.exports = reviveComplex; diff --git a/reviver/package.json b/reviver/package.json deleted file mode 100644 index f2f16d2a..00000000 --- a/reviver/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "@stdlib/complex/reviver", - "version": "0.0.0", - "description": "Revive a JSON-serialized complex number.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdtypes", - "utils", - "util", - "utilities", - "utility", - "complex", - "complex128", - "complex64", - "cmplx", - "json", - "reviver", - "revive", - "unmarshal", - "deserialize", - "from", - "convert", - "parse", - "object", - "obj" - ] -} diff --git a/reviver/test/test.js b/reviver/test/test.js deleted file mode 100644 index 7db8f564..00000000 --- a/reviver/test/test.js +++ /dev/null @@ -1,230 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var copy = require( '@stdlib/utils/copy' ); -var parseJSON = require( '@stdlib/utils/parse-json' ); -var Complex128 = require( './../../float64/ctor' ); -var Complex64 = require( './../../float32/ctor' ); -var reviver = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof reviver, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'values which are not recognized as serialized complex numbers are unaffected', function test( t ) { - var expected; - var actual; - - expected = { - 'beep': 'boop' - }; - actual = parseJSON( '{"beep":"boop"}', reviver ); - - t.deepEqual( actual, expected, 'deep equal' ); - - // Null edge case: - actual = parseJSON( 'null', reviver ); - t.strictEqual( actual, null, 'equals null' ); - - t.end(); -}); - -tape( 'an object must have a recognized "type" field in order to be revived', function test( t ) { - var expected; - var actual; - var json; - - json = { - 'type': 'Boop', - 're': 5.0, - 'im': 3.0 - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviver ); - - t.deepEqual( actual, expected, 'deep equal' ); - t.end(); -}); - -tape( 'an object must have a numeric "re" field in order to be revived', function test( t ) { - var expected; - var actual; - var json; - - json = { - 'type': 'Complex128', - 'im': 3.0 - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviver ); - - t.deepEqual( actual, expected, 'deep equal' ); - - json = { - 'type': 'Complex128', - 'im': 3.0, - 're': '5.0' - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviver ); - - t.deepEqual( actual, expected, 'deep equal' ); - - json = { - 'type': 'Complex128', - 'im': 3.0, - 're': null - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviver ); - - t.deepEqual( actual, expected, 'deep equal' ); - - t.end(); -}); - -tape( 'an object must have a numeric "im" field in order to be revived', function test( t ) { - var expected; - var actual; - var json; - - json = { - 'type': 'Complex128', - 're': 3.0 - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviver ); - - t.deepEqual( actual, expected, 'deep equal' ); - - json = { - 'type': 'Complex128', - 're': 3.0, - 'im': '5.0' - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviver ); - - t.deepEqual( actual, expected, 'deep equal' ); - - json = { - 'type': 'Complex128', - 're': 3.0, - 'im': null - }; - - expected = copy( json ); - actual = parseJSON( JSON.stringify( json ), reviver ); - - t.deepEqual( actual, expected, 'deep equal' ); - - t.end(); -}); - -tape( 'the function will revive a JSON-serialized complex number (128-bit)', function test( t ) { - var json; - var z; - var w; - - z = new Complex128( 5.0, 3.0 ); - json = JSON.stringify( z ); - - w = parseJSON( json, reviver ); - - t.strictEqual( w instanceof Complex128, true, 'is an instance' ); - t.strictEqual( w.re, z.re, true, 'has expected property value' ); - t.strictEqual( w.im, z.im, true, 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will revive a JSON-serialized complex number (64-bit)', function test( t ) { - var json; - var z; - var w; - - z = new Complex64( 3.14, -3.14 ); - json = JSON.stringify( z ); - - w = parseJSON( json, reviver ); - - t.strictEqual( w instanceof Complex64, true, 'is an instance' ); - t.strictEqual( w.re, z.re, true, 'has expected property value' ); - t.strictEqual( w.im, z.im, true, 'has expected property value' ); - - t.end(); -}); - -tape( 'the function will revive deeply nested serialized complex numbers (array)', function test( t ) { - var actual; - var arr; - var i; - - arr = [ - new Complex128( 5.0, 3.0 ), - new Complex64( -2.0, -4.0 ) - ]; - - actual = parseJSON( JSON.stringify( arr ), reviver ); - - for ( i = 0; i < arr.length; i++ ) { - t.strictEqual( actual[i] instanceof arr[i].constructor, true, 'is an instance' ); - t.strictEqual( actual[i].re, arr[i].re, 'has expected property value' ); - t.strictEqual( actual[i].im, arr[i].im, 'has expected property value' ); - } - t.end(); -}); - -tape( 'the function will revive deeply nested serialized complex numbers (object)', function test( t ) { - var actual; - var json; - - json = { - 'a': { - 'b': new Complex128( 5.0, 3.0 ), - 'c': new Complex64( 3.14, -3.14 ) - } - }; - actual = parseJSON( JSON.stringify( json ), reviver ); - - t.strictEqual( actual.a.b instanceof Complex128, true, 'is an instance' ); - t.strictEqual( actual.a.b.re, json.a.b.re, 'has expected property value' ); - t.strictEqual( actual.a.b.im, json.a.b.im, 'has expected property value' ); - - t.strictEqual( actual.a.c instanceof Complex64, true, 'is an instance' ); - t.strictEqual( actual.a.c.re, json.a.c.re, 'has expected property value' ); - t.strictEqual( actual.a.c.im, json.a.c.im, 'has expected property value' ); - - t.end(); -}); diff --git a/stats.html b/stats.html new file mode 100644 index 00000000..60367d81 --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 6dd0e95c..00000000 --- a/test/test.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var ns = require( './../lib' ); - - -// TESTS // - -tape( 'main export is an object', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ns, 'object', 'main export is an object' ); - t.end(); -}); - -tape( 'the exported object contains key-value pairs', function test( t ) { - var keys = objectKeys( ns ); - t.strictEqual( keys.length > 0, true, 'has keys' ); - t.end(); -});