JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
public static void cublasDrotg(Pointer host_sa, Pointer host_sb, Pointer host_sc, Pointer host_ss)
    {
        cublasDrotgNative(host_sa, host_sb, host_sc, host_ss);
        checkResultBLAS();
    }
public static void cublasDrotg(Pointer host_sa, Pointer host_sb, Pointer host_sc, Pointer host_ss)
    {
        cublasDrotgNative(host_sa, host_sb, host_sc, host_ss);
        checkResultBLAS();
    }
<pre>
void
cublasDrotg (double *host_sa, double *host_sb, double *host_sc, double *host_ss)

constructs the Givens tranformation

( sc  ss )
G = (        ) ,  sc^2 + ss^2 = 1,
(-ss  sc )

which zeros the second entry of the 2-vector transpose(sa, sb).

The quantity r = (+/-) sqrt (sa^2 + sb^2) overwrites sa in storage. The
value of sb is overwritten by a value z which allows sc and ss to be
recovered by the following algorithm:

if z=1          set sc = 0.0 and ss = 1.0
if abs(z) < 1   set sc = sqrt(1-z^2) and ss = z
if abs(z) > 1   set sc = 1/z and ss = sqrt(1-sc^2)

The function drot (n, x, incx, y, incy, sc, ss) normally is called next
to apply the transformation to a 2 x n matrix.
Note that is function is provided for completeness and run exclusively
on the Host.

Input
-----
sa     double-precision scalar
sb     double-precision scalar

Output
------
sa     double-precision r
sb     double-precision z
sc     double-precision result
ss     double-precision result

Reference: http://www.netlib.org/blas/drotg.f

This function does not set any error status.
</pre>