Most efficient way to find smallest of 3 numbers Java?
I have an algorithm written in Java that I would like to make more efficient. A part that I think could be made more efficient is finding the smallest of 3 numbers. Currently I'm using the Math.min method as below: double smallest = Math.min(a, Math.min(b, c)); How efficient is this? Would it be more efficient to replace with if statements like below: double smallest; if (a <= b && a <= c) { smallest = a; } else if (b <= c && b <= a) { smallest = b; } else { smallest = c; } Or if any other way is more efficient I'm wondering if it is worth changing what I'm currently using? Any speed increase