Error functions in pure Julia form#82
Open
ziyixi wants to merge 1 commit intoJuliaMath:masterfrom
ziyixi:master
Open
Error functions in pure Julia form#82ziyixi wants to merge 1 commit intoJuliaMath:masterfrom ziyixi:master
ziyixi wants to merge 1 commit intoJuliaMath:masterfrom
ziyixi:master
Conversation
…) in pure Julia form
Member
|
Do also see the discussion in #52 |
simonbyrne
reviewed
May 14, 2018
| ysquared = y^2 | ||
| numerator = a[5]*ysquared | ||
| denominator = ysquared | ||
| for i in 1:3 |
Member
There was a problem hiding this comment.
this should use the @horner macro from Base, e.g. like https://github.com/JuliaLang/julia/blob/9ac2dfa09f0016c47fd14c0c2258a70274c19e69/base/special/trig.jl
simonbyrne
reviewed
May 14, 2018
| using Base.Math: @horner, libm | ||
| using Base.MPFR: ROUNDING_MODE | ||
|
|
||
| function ErrFunApprox(x::Float64,iserfc::Bool,result::Float64) |
Member
There was a problem hiding this comment.
simonbyrne
reviewed
May 14, 2018
|
|
||
| xxbig = 27.2e+0 | ||
| Maximum = 2.53e+307 | ||
| _HUGE = 6.71e+7 |
simonbyrne
reviewed
May 14, 2018
| result = ysquared*(numerator+pp[5])/(denominator+qq[5]) | ||
| result = (InvSqrtPI-result)/y | ||
| ysquared = trunc(y*16.0)/16.0 | ||
| del = (y-ysquared)*(y+ysquared) |
Member
There was a problem hiding this comment.
a comment to explain what this is doing
ararslan
reviewed
May 14, 2018
| function ErrFunApprox(x::Float64,iserfc::Bool,result::Float64) | ||
| if isinf(x) | ||
| if x > 0 | ||
| return iserfc?0.0:1.0 |
Member
There was a problem hiding this comment.
Ternaries need spaces in 0.7, so this should be iserfc ? 0.0 : 1.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello everyone, I'm a prospective applicant of GSoC this year, and I'm interested in developing error functions in pure Julia form as GSoC in julialang.org says.
Here I write some code of error functions in pure Julia form, which is adapted from https://github.com/simonbyrne/apple-libm. And it has passed tests. Hope you will find it's useful!
Let me have a brief self-introduction of myself. I'm now a senior year undergraduate student major in geophysics and dual major in computer science. And this year I will pursue my PhD degree in the United States. So I should have enough time and required background to do this project. Hope I could be chosen into the project!