Here you can find the source of copysign(final double x, final double y)
public static final double copysign(final double x, final double y)
//package com.java2s; public class Main { public static final double copysign(final double x, final double y) { //__HI(x) = (__HI(x)&0x7fffffff)|(__HI(y)&0x80000000); //return Double.longBitsToDouble((Double.doubleToLongBits(x) & 0x7fffffffffffffffL)| // (Double.doubleToLongBits(y) & 0x8000000000000000L)); return (y < 0.0D && x > 0.0D) ? -x : ((y > 0.0D && x < 0.0D) ? -x : x); }//from ww w . j a v a2 s .c om }