I’m doing a Numeric Differentiation calculating program, and the second and third derivative get waay too noisy, according to wikipedia, this is caused by floating-point arithmetic rounding. https://en.wikipedia.org/wiki/Numerical_differentiation
Wikipedia says that noise can be reduced by increasing floating-point datatype precision.
I’m already using double, but in Processing reference there isn’t a preciser datatype than double.
Is there any possible way to get more precise datatype?
Google java BigDecimal, it’s a class and a pain to work with (compared to how we would do it normally), but it should do the job. There is also BigInteger.
Keep in mind they are both slow.
i play here, but was just too slow for @clankill3r
float af =2;
float bf =3;
BigDecimal abd = BigDecimal.valueOf(ad);
BigDecimal bbd = BigDecimal.valueOf(bd);
BigDecimal resultb= new BigDecimal("0");
resultf = af/bf;
resultd = ad/bd;
resultb = abd.divide(bbd,20, RoundingMode.HALF_EVEN);
Make sure to use constants & methods from Math class only and all non-integer numerical literals are suffixed w/
2 * Math.PI
So much thanks to you guys , but may be I will have to do serious optimization