Inverse Error Function C
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers inverse error function calculator or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x
Inverse Error Function C++
Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it
Inverse Error Function Excel
only takes a minute: Sign up Inverse Error Function in C up vote 3 down vote favorite Is it possible to calculate the inverse error function in C? I can find erf(x) in which calculates the error function,
Erfinv C++
but I can't find anything to do the inverse. c function inverse share|improve this question edited Dec 1 '14 at 13:21 Smi 7,60163054 asked Dec 1 '14 at 13:20 user1763328 566 1 en.wikipedia.org/wiki/Error_function –BLUEPIXY Dec 1 '14 at 13:55 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote I don't think it's a standard implementation in , but there are other C math libraries that have implement the inverse error function erfinv(x), that you inverse error function matlab can use. share|improve this answer answered Dec 1 '14 at 13:34 Barnstokkr 1,069325 Do you know a long double version? –user2284570 Apr 24 '15 at 22:23 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged c function inverse or ask your own question. asked 1 year ago viewed 867 times active 1 year ago Blog Stack Overflow Podcast #91 - Can You Stump Nick Craver? Linked 1 Is there an Inverse Error Function available in Swift's Foundation import? Related 4442JavaScript function declaration syntax: var fn = function() {} vs function fn() {}1460Set a default parameter value for a JavaScript function3Blending two functions, where one is inverse14Solving for the inverse of a function in R4Inverse function in Scala-1Tridiagonal Matrix Inverse C5Fitting an inverse function0Inverse-square law equation1Defining a function with its inverse inside in Mathematica-4conflicting types for my function “inverse”, which is designed to return long long type Hot Network Questions How to photograph distant objects (10km)? Standardisation of Time in a FTL Universe Are D&D PDFs sold in multiple versions of different quality? How can I Avoid Being Frightened
documentation home page. Error Function Inverses Synopsis #include namespace boost{ namespace math{ template calculated-result-type erf_inv(T p); template calculated-result-type erf_inv(T p, const Policy&); template calculated-result-type erfc_inv(T p); template calculated-result-type erfc_inv(T p, const Policy&); inverse error function approximation }} // namespaces The return type of these functions is computed using the result type calculation rules: the return type is inverse complementary error function double if T is an integer type, and T otherwise. The final Policy argument is optional and can be used to control the behaviour of the function: how it handles errors, what level of http://stackoverflow.com/questions/27229371/inverse-error-function-in-c precision to use etc. Refer to the policy documentation for more details. Description template calculated-result-type erf_inv(T z); template calculated-result-type erf_inv(T z, const Policy&); Returns the inverse error function of z, that is a value x such that: p = erf(x); template calculated-result-type erfc_inv(T z); template calculated-result-type erfc_inv(T z, const Policy&); Returns the inverse of the complement of the http://www.boost.org/doc/libs/1_36_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_erf/error_inv.html error function of z, that is a value x such that: p = erfc(x); Accuracy For types up to and including 80-bit long doubles the approximations used are accurate to less than ~ 2 epsilon. For higher precision types these functions have the same accuracy as the forward error functions. Testing There are two sets of tests: Basic sanity checks attempt to "round-trip" from x to p and back again. These tests have quite generous tolerances: in general both the error functions and their inverses change so rapidly in some places that round tripping to more than a couple of significant digits isn't possible. This is especially true when p is very near one: in this case there isn't enough "information content" in the input to the inverse function to get back where you started. Accuracy checks using high-precision test values. These measure the accuracy of the result, given exact input values. Implementation These functions use a rational approximation devised by JM to calculate an initial approximation to the result that is accurate to ~10-19, then only if that has insufficient accuracy compared to the epsilon for T, do we clean up the result using Halley iteration. Constructing rational approximations to the erf/erfc functions is actually surprisingly hard, especia
a GitHub account Sign in Create a gist now https://gist.github.com/5870580 Instantly share code, notes, and snippets. Star 1 Fork 0 danielc192/InverseError.rb Last active Dec 19, 2015 Embed What would you like to do? Embed Embed this gist in your website. Embed Share Copy sharable URL for this gist. Share Clone via HTTPS Clone with error function Git or checkout with SVN using the repository's web address. HTTPS Learn more about clone URLs Download ZIP Code Revisions 2 Stars 1 Code to calculate the Inverse Error function using a power series approximation. Based on information at http://en.wikipedia.org/wiki/Error_function#Inverse_functions. Implemented as a method in inverse error function the Math module, but it could easily be run independently. Raw InverseError.rb module Math def self.invErf(x) c = [] c[0] = 1.0 c[1] = 1.0 result = 0.0 (0..100).each do |k| # Calculate C sub k if k > 1 then c[k] = 0.0 (0..(k-1)).each do |m| term = (c[m]*c[k-1.0-m])/((m+1.0)*(2.0*m+1.0)) c[k] += term end end result += (c[k]/(2.0*k+1))*((Math.sqrt(Math::PI)/2)*x)**(2.0*k+1) end return result end end Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Contact GitHub API Training Shop Blog About © 2016 GitHub, Inc. Terms Privacy Security Status Help You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.