## Parabolic Cylinder Functions C++ faster version

Version 1.2.2 (61.7 KB) by
11 times faster than the original Matlab code

Updated 19 Jul 2022

From GitHub

# Parabolic Cylinder Functions C++ Version

This project is a faster version of MATLAB code original from E. Cojocaru. Parabolic Cylinder Functions (https://www.mathworks.com/matlabcentral/fileexchange/22620-parabolic-cylinder-functions)

## Features:

• The API is similar to original functions, such as `val = pwlx(a,x);` -> `val = pcf_mex(a,x,'pwlx');`
• The MATLAB toolbox only support scalar inputs, pcf_mex now support 1D array of size (1,n) or (n,1), return value will have size(n,1).
• Intel compiler, OPENMP， AVX2 or AVX512 are utilized to speed up the calculation.
• Add two useful functions for bortfeld function
• Apple Silicon supported (Rosseta2(R2022a) and Native(R2022a beta) Matlab)

## What's inside the box

• `pcf_mex(a,x,'pu')` Compute parabolic cylinder function U(a,x), s.t. abs(a)<5 and abs(x)<5
• `pcf_mex(a,x,'dpu')` Compute derivative of parabolic cylinder function U(a,x), s.t. abs(a)<5 and abs(x)<5
• `pcf_mex(a,x,'pulx')` Compute parabolic cylinder function U(a,x) for large argument x (|x| >> |a| and |a| moderate)
• `pcf_mex(a,x,'dpulx')` Compute parabolic derivative of cylinder function U(a,x) for large argument x (|x| >> |a| and |a| moderate)
• `pcf_mex(a,x,'pd')` Compute parabolic cylinder function D(a,x) = U(-a-0.5,x), s.t. |a|<5 and |x|<5 (used in bortfeld function)
• `pcf_mex(a,x,'dpd')` Compute parabolic derivative of cylinder function D(a,x) = U(-a-0.5,x), s.t. |a|<5 and |x|<5 (used in bortfeld function)
• `pcf_mex(a,x,'pv')` Compute parabolic cylinder function V(a,x), s.t. abs(a)<5 and abs(x)<5
• `pcf_mex(a,x,'dpv')` Compute derivative of parabolic cylinder function V(a,x), s.t. abs(a)<5 and abs(x)<5
• `pcf_mex(a,x,'pvlx')` Compute parabolic cylinder function V(a,x) for large argument x (|x| >> |a| and |a| moderate)
• `pcf_mex(a,x,'dpvlx')` Compute parabolic derivative of cylinder function V(a,x) for large argument x (|x| >> |a| and |a| moderate)
• `pcf_mex(a,x,'pw')` Compute parabolic cylinder function W(a,x), s.t. abs(a)<5 and abs(x)<5
• `pcf_mex(a,x,'dpw')` Compute derivative of parabolic cylinder function W(a,x), s.t. abs(a)<5 and abs(x)<5
• `pcf_mex(a,x,'pwlx')` Compute parabolic cylinder function W(a,x) for large argument x (|x| >> |a| and |a| moderate)
• `pcf_mex(a,x,'dpwlx')` Compute parabolic derivative of cylinder function W(a,x) for large argument x (|x| >> |a| and |a| moderate)

## Speed benchmark

I tested it with simple benchmark : pcf_mex(-1,linspace(4,5,1e6),'pwlx'), unit is seconds % 0.7554 Apple M1 pro(8core) + openmp (Matlab2022a beta Native)

% 1.8453 Apple M1 pro(8core) + openmp (Matlab2022a Rosseta2)

% 0.3994 intel compiler 2021 + openmp + avx2

% 1.0733 vs + openmp + avx2

% 1.0858 vs + openmp

% 9.7933 vs

% 4.476539 original + parfor

% 32.521651 original

The first one is compiled with Visual Studio + Intel OneAPI, intel compiler 2021 is much more faster.

### Cite As

shuang zhou (2023). Parabolic Cylinder Functions C++ faster version (https://github.com/civerjia/Parabolic-Cylinder-Functions-C-/releases/tag/v1.2.2), GitHub. Retrieved .

##### MATLAB Release Compatibility
Created with R2022a
Compatible with any release
##### Platform Compatibility
Windows macOS Linux

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.2.2

See release notes for this release on GitHub: https://github.com/civerjia/Parabolic-Cylinder-Functions-C-/releases/tag/v1.2.2

1.2.1

See release notes for this release on GitHub: https://github.com/civerjia/Parabolic-Cylinder-Functions-C-/releases/tag/v1.2.1

1.1.0

See release notes for this release on GitHub: https://github.com/civerjia/Parabolic-Cylinder-Functions-C-/releases/tag/v1.1.0

1.0.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.