I am using [Jama matrix](http://math.nist.gov/javanumerics/jama/) to perform SVD operations. I have couple of questions regarding performance.

I am not worried about so much accuracy, and I think double is more accurate than Float, am I right? If I use float other than double, how much will it improve the performance and reduce accuracy?

In Jama matrix it uses one function that it calls a lot, it used double and Math.abs function, that requires a lot of Heap and CPU. If I change it to double and remove Math.abs, how much will it impact the performance and results in terms of accuracy?

Here is the Jama math function:

```
   public static double hypot(double a, double b) {
      double r;
      if (Math.abs(a) > Math.abs(b)) {
         r = b/a;
         r = Math.abs(a)*Math.sqrt(1+r*r);
      } else if (b != 0) {
         r = a/b;
         r = Math.abs(b)*Math.sqrt(1+r*r);
      } else {
         r = 0.0;
      }
      return r;
   }

```

Here is the what I am thinking to do with this function

```
   public static float hypot(float a, float b) {
      float r;
      if (a > b) {
         r = b/a;
         r = (float) (a*Math.sqrt(1+r*r));
      } else if (b != 0) {
         r = a/b;
         r = (float) (b*Math.sqrt(1+r*r));
      } else {
         r = 0;
      }
      return r;
   }

```

I do not know, if it is a good way to do it or not.
Thanks