Complementary error function in java?

Asked

Viewed 105 times

1

How to calculate complementary error function in java ?

inserir a descrição da imagem aqui

  • Friend, are there any examples of what you have already done? Or how is this function? It would be easier to help!

  • I edited the question take a look to see if it helps.

  • @Thiagoluizdomacoski is this function of excel "erfc" want to know how to do it with java. its name is complementary error function. I’m not finding anything

  • 2

    See there: https://commons.apache.org/proper/commons-math/jacoco/org.apache.commons.math3.special/Erf.java.html

  • 1

    By the way: erfc(x)=1-Erf(x).

  • Alexandre worked expensive . but I’m curious about one thing why we always have to subtract for less 1 ?

  • 1

    @Josevieiraneto Because the function erfc(x) is defined from the function Erf(x). The first is just a convenience to not always write 1-Erf(x). The error function (Erf) allows calculating the probability according to the normal distribution. erfc is the complement of this probability.

Show 2 more comments

1 answer

3


Add this dependency to the project.

   <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-math3</artifactId>
        <version>3.2</version>
    </dependency>

Just call this function.

double vlr = Erf.erf(x);
System.out.println("valor" + vlr);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.