Download conjunction/nasa_cara/DistributedMatlab/Utils/AugmentedMath/erf_dif.m from STAR-future/Trinity-SpaceData: direct link, hf CLI and curl.
- Browser
- Download file 1.32 kB
-
https://huggingface.co/datasets/STAR-future/Trinity-SpaceData/resolve/main/conjunction/nasa_cara/DistributedMatlab/Utils/AugmentedMath/erf_dif.m
- Command line
-
hf download hf://datasets/STAR-future/Trinity-SpaceData/conjunction/nasa_cara/DistributedMatlab/Utils/AugmentedMath/erf_dif.m
-
curl -L -o erf_dif.m https://huggingface.co/datasets/STAR-future/Trinity-SpaceData/resolve/main/conjunction/nasa_cara/DistributedMatlab/Utils/AugmentedMath/erf_dif.m
1.32 kB
| function d = erf_dif(a,b) | |
| % | |
| % Calculate the difference d = erf(a)-erf(b), but use erfc for cases of | |
| % large positive or negative values of a and b, which provides improved | |
| % accuracy. | |
| % | |
| % Large measure for argument of erf | |
| large = 3; | |
| % Handle different (a,b) cases | |
| if min(a,b) > large | |
| % For large positive a & b values, use erfc for better accuracy | |
| d = erfc(b)-erfc(a); | |
| elseif max(a,b) < -large | |
| % For large negative a & b values, use erfc with negated arguments | |
| d = erfc(-a)-erfc(-b); | |
| else | |
| % Use erf for all other cases | |
| d = erf(a)-erf(b); | |
| end | |
| return | |
| end | |
| % ----------------- END OF CODE ------------------ | |
| % | |
| % Please record any changes to the software in the change history | |
| % shown below: | |
| % | |
| % ----------------- CHANGE HISTORY ------------------ | |
| % Developer | Date | Description | |
| % --------------------------------------------------- | |
| % D.Hall | 2020-12-17 | Implemented to improve the accuracy | |
| % of the function Pc2D_SquareErrFunc.m for | |
| % very small Pc values, enabling it to | |
| % efficiently reproduce the results from | |
| % the numerical integration function | |
| % Pc2D_RotatedSquare.m. |