commons-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r948064 [30/38] - in /websites/production/commons/content/proper/commons-math/testapidocs: ./ org/apache/commons/math3/ org/apache/commons/math3/analysis/ org/apache/commons/math3/analysis/class-use/ org/apache/commons/math3/analysis/differ...
Date Fri, 17 Apr 2015 19:44:43 GMT
Modified: websites/production/commons/content/proper/commons-math/testapidocs/src-html/org/apache/commons/math3/complex/ComplexTest.TestComplex.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/testapidocs/src-html/org/apache/commons/math3/complex/ComplexTest.TestComplex.html (original)
+++ websites/production/commons/content/proper/commons-math/testapidocs/src-html/org/apache/commons/math3/complex/ComplexTest.TestComplex.html Fri Apr 17 19:43:52 2015
@@ -25,13 +25,13 @@
 <span class="sourceLineNo">017</span><a name="line.17"></a>
 <span class="sourceLineNo">018</span>package org.apache.commons.math3.complex;<a name="line.18"></a>
 <span class="sourceLineNo">019</span><a name="line.19"></a>
-<span class="sourceLineNo">020</span>import org.apache.commons.math3.TestUtils;<a name="line.20"></a>
-<span class="sourceLineNo">021</span>import org.apache.commons.math3.exception.NullArgumentException;<a name="line.21"></a>
-<span class="sourceLineNo">022</span>import org.apache.commons.math3.util.FastMath;<a name="line.22"></a>
-<span class="sourceLineNo">023</span>import org.junit.Assert;<a name="line.23"></a>
-<span class="sourceLineNo">024</span>import org.junit.Test;<a name="line.24"></a>
-<span class="sourceLineNo">025</span><a name="line.25"></a>
-<span class="sourceLineNo">026</span>import java.util.List;<a name="line.26"></a>
+<span class="sourceLineNo">020</span>import java.util.List;<a name="line.20"></a>
+<span class="sourceLineNo">021</span><a name="line.21"></a>
+<span class="sourceLineNo">022</span>import org.apache.commons.math3.TestUtils;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import org.apache.commons.math3.exception.NullArgumentException;<a name="line.23"></a>
+<span class="sourceLineNo">024</span>import org.apache.commons.math3.util.FastMath;<a name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.junit.Assert;<a name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.junit.Test;<a name="line.26"></a>
 <span class="sourceLineNo">027</span><a name="line.27"></a>
 <span class="sourceLineNo">028</span><a name="line.28"></a>
 <span class="sourceLineNo">029</span>/**<a name="line.29"></a>
@@ -789,636 +789,705 @@
 <span class="sourceLineNo">781</span>    }<a name="line.781"></a>
 <span class="sourceLineNo">782</span><a name="line.782"></a>
 <span class="sourceLineNo">783</span>    @Test<a name="line.783"></a>
-<span class="sourceLineNo">784</span>    public void testExpInf() {<a name="line.784"></a>
+<span class="sourceLineNo">784</span>    public void testExpInf1() {<a name="line.784"></a>
 <span class="sourceLineNo">785</span>        TestUtils.assertSame(Complex.NaN, oneInf.exp());<a name="line.785"></a>
-<span class="sourceLineNo">786</span>        TestUtils.assertSame(Complex.NaN, oneNegInf.exp());<a name="line.786"></a>
-<span class="sourceLineNo">787</span>        TestUtils.assertSame(infInf, infOne.exp());<a name="line.787"></a>
-<span class="sourceLineNo">788</span>        TestUtils.assertSame(Complex.ZERO, negInfOne.exp());<a name="line.788"></a>
-<span class="sourceLineNo">789</span>        TestUtils.assertSame(Complex.NaN, infInf.exp());<a name="line.789"></a>
-<span class="sourceLineNo">790</span>        TestUtils.assertSame(Complex.NaN, infNegInf.exp());<a name="line.790"></a>
-<span class="sourceLineNo">791</span>        TestUtils.assertSame(Complex.NaN, negInfInf.exp());<a name="line.791"></a>
-<span class="sourceLineNo">792</span>        TestUtils.assertSame(Complex.NaN, negInfNegInf.exp());<a name="line.792"></a>
-<span class="sourceLineNo">793</span>    }<a name="line.793"></a>
-<span class="sourceLineNo">794</span><a name="line.794"></a>
-<span class="sourceLineNo">795</span>    @Test<a name="line.795"></a>
-<span class="sourceLineNo">796</span>    public void testLog() {<a name="line.796"></a>
-<span class="sourceLineNo">797</span>        Complex z = new Complex(3, 4);<a name="line.797"></a>
-<span class="sourceLineNo">798</span>        Complex expected = new Complex(1.60944, 0.927295);<a name="line.798"></a>
-<span class="sourceLineNo">799</span>        TestUtils.assertEquals(expected, z.log(), 1.0e-5);<a name="line.799"></a>
-<span class="sourceLineNo">800</span>    }<a name="line.800"></a>
-<span class="sourceLineNo">801</span><a name="line.801"></a>
-<span class="sourceLineNo">802</span>    @Test<a name="line.802"></a>
-<span class="sourceLineNo">803</span>    public void testLogNaN() {<a name="line.803"></a>
-<span class="sourceLineNo">804</span>        Assert.assertTrue(Complex.NaN.log().isNaN());<a name="line.804"></a>
-<span class="sourceLineNo">805</span>    }<a name="line.805"></a>
-<span class="sourceLineNo">806</span><a name="line.806"></a>
-<span class="sourceLineNo">807</span>    @Test<a name="line.807"></a>
-<span class="sourceLineNo">808</span>    public void testLogInf() {<a name="line.808"></a>
-<span class="sourceLineNo">809</span>        TestUtils.assertEquals(new Complex(inf, pi / 2),<a name="line.809"></a>
-<span class="sourceLineNo">810</span>                oneInf.log(), 10e-12);<a name="line.810"></a>
-<span class="sourceLineNo">811</span>        TestUtils.assertEquals(new Complex(inf, -pi / 2),<a name="line.811"></a>
-<span class="sourceLineNo">812</span>                oneNegInf.log(), 10e-12);<a name="line.812"></a>
-<span class="sourceLineNo">813</span>        TestUtils.assertEquals(infZero, infOne.log(), 10e-12);<a name="line.813"></a>
-<span class="sourceLineNo">814</span>        TestUtils.assertEquals(new Complex(inf, pi),<a name="line.814"></a>
-<span class="sourceLineNo">815</span>                negInfOne.log(), 10e-12);<a name="line.815"></a>
-<span class="sourceLineNo">816</span>        TestUtils.assertEquals(new Complex(inf, pi / 4),<a name="line.816"></a>
-<span class="sourceLineNo">817</span>                infInf.log(), 10e-12);<a name="line.817"></a>
-<span class="sourceLineNo">818</span>        TestUtils.assertEquals(new Complex(inf, -pi / 4),<a name="line.818"></a>
-<span class="sourceLineNo">819</span>                infNegInf.log(), 10e-12);<a name="line.819"></a>
-<span class="sourceLineNo">820</span>        TestUtils.assertEquals(new Complex(inf, 3d * pi / 4),<a name="line.820"></a>
-<span class="sourceLineNo">821</span>                negInfInf.log(), 10e-12);<a name="line.821"></a>
-<span class="sourceLineNo">822</span>        TestUtils.assertEquals(new Complex(inf, - 3d * pi / 4),<a name="line.822"></a>
-<span class="sourceLineNo">823</span>                negInfNegInf.log(), 10e-12);<a name="line.823"></a>
-<span class="sourceLineNo">824</span>    }<a name="line.824"></a>
-<span class="sourceLineNo">825</span><a name="line.825"></a>
-<span class="sourceLineNo">826</span>    @Test<a name="line.826"></a>
-<span class="sourceLineNo">827</span>    public void testLogZero() {<a name="line.827"></a>
-<span class="sourceLineNo">828</span>        TestUtils.assertSame(negInfZero, Complex.ZERO.log());<a name="line.828"></a>
-<span class="sourceLineNo">829</span>    }<a name="line.829"></a>
-<span class="sourceLineNo">830</span><a name="line.830"></a>
-<span class="sourceLineNo">831</span>    @Test<a name="line.831"></a>
-<span class="sourceLineNo">832</span>    public void testPow() {<a name="line.832"></a>
-<span class="sourceLineNo">833</span>        Complex x = new Complex(3, 4);<a name="line.833"></a>
-<span class="sourceLineNo">834</span>        Complex y = new Complex(5, 6);<a name="line.834"></a>
-<span class="sourceLineNo">835</span>        Complex expected = new Complex(-1.860893, 11.83677);<a name="line.835"></a>
-<span class="sourceLineNo">836</span>        TestUtils.assertEquals(expected, x.pow(y), 1.0e-5);<a name="line.836"></a>
-<span class="sourceLineNo">837</span>    }<a name="line.837"></a>
-<span class="sourceLineNo">838</span><a name="line.838"></a>
-<span class="sourceLineNo">839</span>    @Test<a name="line.839"></a>
-<span class="sourceLineNo">840</span>    public void testPowNaNBase() {<a name="line.840"></a>
-<span class="sourceLineNo">841</span>        Complex x = new Complex(3, 4);<a name="line.841"></a>
-<span class="sourceLineNo">842</span>        Assert.assertTrue(Complex.NaN.pow(x).isNaN());<a name="line.842"></a>
-<span class="sourceLineNo">843</span>    }<a name="line.843"></a>
-<span class="sourceLineNo">844</span><a name="line.844"></a>
-<span class="sourceLineNo">845</span>    @Test<a name="line.845"></a>
-<span class="sourceLineNo">846</span>    public void testPowNaNExponent() {<a name="line.846"></a>
-<span class="sourceLineNo">847</span>        Complex x = new Complex(3, 4);<a name="line.847"></a>
-<span class="sourceLineNo">848</span>        Assert.assertTrue(x.pow(Complex.NaN).isNaN());<a name="line.848"></a>
-<span class="sourceLineNo">849</span>    }<a name="line.849"></a>
-<span class="sourceLineNo">850</span><a name="line.850"></a>
-<span class="sourceLineNo">851</span>   @Test<a name="line.851"></a>
-<span class="sourceLineNo">852</span>   public void testPowInf() {<a name="line.852"></a>
-<span class="sourceLineNo">853</span>       TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(oneInf));<a name="line.853"></a>
-<span class="sourceLineNo">854</span>       TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(oneNegInf));<a name="line.854"></a>
-<span class="sourceLineNo">855</span>       TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(infOne));<a name="line.855"></a>
-<span class="sourceLineNo">856</span>       TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(infInf));<a name="line.856"></a>
-<span class="sourceLineNo">857</span>       TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(infNegInf));<a name="line.857"></a>
-<span class="sourceLineNo">858</span>       TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(negInfInf));<a name="line.858"></a>
-<span class="sourceLineNo">859</span>       TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(negInfNegInf));<a name="line.859"></a>
-<span class="sourceLineNo">860</span>       TestUtils.assertSame(Complex.NaN,infOne.pow(Complex.ONE));<a name="line.860"></a>
-<span class="sourceLineNo">861</span>       TestUtils.assertSame(Complex.NaN,negInfOne.pow(Complex.ONE));<a name="line.861"></a>
-<span class="sourceLineNo">862</span>       TestUtils.assertSame(Complex.NaN,infInf.pow(Complex.ONE));<a name="line.862"></a>
-<span class="sourceLineNo">863</span>       TestUtils.assertSame(Complex.NaN,infNegInf.pow(Complex.ONE));<a name="line.863"></a>
-<span class="sourceLineNo">864</span>       TestUtils.assertSame(Complex.NaN,negInfInf.pow(Complex.ONE));<a name="line.864"></a>
-<span class="sourceLineNo">865</span>       TestUtils.assertSame(Complex.NaN,negInfNegInf.pow(Complex.ONE));<a name="line.865"></a>
-<span class="sourceLineNo">866</span>       TestUtils.assertSame(Complex.NaN,negInfNegInf.pow(infNegInf));<a name="line.866"></a>
-<span class="sourceLineNo">867</span>       TestUtils.assertSame(Complex.NaN,negInfNegInf.pow(negInfNegInf));<a name="line.867"></a>
-<span class="sourceLineNo">868</span>       TestUtils.assertSame(Complex.NaN,negInfNegInf.pow(infInf));<a name="line.868"></a>
-<span class="sourceLineNo">869</span>       TestUtils.assertSame(Complex.NaN,infInf.pow(infNegInf));<a name="line.869"></a>
-<span class="sourceLineNo">870</span>       TestUtils.assertSame(Complex.NaN,infInf.pow(negInfNegInf));<a name="line.870"></a>
-<span class="sourceLineNo">871</span>       TestUtils.assertSame(Complex.NaN,infInf.pow(infInf));<a name="line.871"></a>
-<span class="sourceLineNo">872</span>       TestUtils.assertSame(Complex.NaN,infNegInf.pow(infNegInf));<a name="line.872"></a>
-<span class="sourceLineNo">873</span>       TestUtils.assertSame(Complex.NaN,infNegInf.pow(negInfNegInf));<a name="line.873"></a>
-<span class="sourceLineNo">874</span>       TestUtils.assertSame(Complex.NaN,infNegInf.pow(infInf));<a name="line.874"></a>
-<span class="sourceLineNo">875</span>   }<a name="line.875"></a>
-<span class="sourceLineNo">876</span><a name="line.876"></a>
-<span class="sourceLineNo">877</span>   @Test<a name="line.877"></a>
-<span class="sourceLineNo">878</span>   public void testPowZero() {<a name="line.878"></a>
-<span class="sourceLineNo">879</span>       TestUtils.assertSame(Complex.NaN,<a name="line.879"></a>
-<span class="sourceLineNo">880</span>               Complex.ZERO.pow(Complex.ONE));<a name="line.880"></a>
-<span class="sourceLineNo">881</span>       TestUtils.assertSame(Complex.NaN,<a name="line.881"></a>
-<span class="sourceLineNo">882</span>               Complex.ZERO.pow(Complex.ZERO));<a name="line.882"></a>
-<span class="sourceLineNo">883</span>       TestUtils.assertSame(Complex.NaN,<a name="line.883"></a>
-<span class="sourceLineNo">884</span>               Complex.ZERO.pow(Complex.I));<a name="line.884"></a>
-<span class="sourceLineNo">885</span>       TestUtils.assertEquals(Complex.ONE,<a name="line.885"></a>
-<span class="sourceLineNo">886</span>               Complex.ONE.pow(Complex.ZERO), 10e-12);<a name="line.886"></a>
-<span class="sourceLineNo">887</span>       TestUtils.assertEquals(Complex.ONE,<a name="line.887"></a>
-<span class="sourceLineNo">888</span>               Complex.I.pow(Complex.ZERO), 10e-12);<a name="line.888"></a>
-<span class="sourceLineNo">889</span>       TestUtils.assertEquals(Complex.ONE,<a name="line.889"></a>
-<span class="sourceLineNo">890</span>               new Complex(-1, 3).pow(Complex.ZERO), 10e-12);<a name="line.890"></a>
-<span class="sourceLineNo">891</span>   }<a name="line.891"></a>
-<span class="sourceLineNo">892</span><a name="line.892"></a>
-<span class="sourceLineNo">893</span>    @Test<a name="line.893"></a>
-<span class="sourceLineNo">894</span>    public void testScalarPow() {<a name="line.894"></a>
-<span class="sourceLineNo">895</span>        Complex x = new Complex(3, 4);<a name="line.895"></a>
-<span class="sourceLineNo">896</span>        double yDouble = 5.0;<a name="line.896"></a>
-<span class="sourceLineNo">897</span>        Complex yComplex = new Complex(yDouble);<a name="line.897"></a>
-<span class="sourceLineNo">898</span>        Assert.assertEquals(x.pow(yComplex), x.pow(yDouble));<a name="line.898"></a>
-<span class="sourceLineNo">899</span>    }<a name="line.899"></a>
-<span class="sourceLineNo">900</span><a name="line.900"></a>
-<span class="sourceLineNo">901</span>    @Test<a name="line.901"></a>
-<span class="sourceLineNo">902</span>    public void testScalarPowNaNBase() {<a name="line.902"></a>
-<span class="sourceLineNo">903</span>        Complex x = Complex.NaN;<a name="line.903"></a>
-<span class="sourceLineNo">904</span>        double yDouble = 5.0;<a name="line.904"></a>
-<span class="sourceLineNo">905</span>        Complex yComplex = new Complex(yDouble);<a name="line.905"></a>
-<span class="sourceLineNo">906</span>        Assert.assertEquals(x.pow(yComplex), x.pow(yDouble));<a name="line.906"></a>
-<span class="sourceLineNo">907</span>    }<a name="line.907"></a>
-<span class="sourceLineNo">908</span><a name="line.908"></a>
-<span class="sourceLineNo">909</span>    @Test<a name="line.909"></a>
-<span class="sourceLineNo">910</span>    public void testScalarPowNaNExponent() {<a name="line.910"></a>
-<span class="sourceLineNo">911</span>        Complex x = new Complex(3, 4);<a name="line.911"></a>
-<span class="sourceLineNo">912</span>        double yDouble = Double.NaN;<a name="line.912"></a>
-<span class="sourceLineNo">913</span>        Complex yComplex = new Complex(yDouble);<a name="line.913"></a>
-<span class="sourceLineNo">914</span>        Assert.assertEquals(x.pow(yComplex), x.pow(yDouble));<a name="line.914"></a>
-<span class="sourceLineNo">915</span>    }<a name="line.915"></a>
-<span class="sourceLineNo">916</span><a name="line.916"></a>
-<span class="sourceLineNo">917</span>   @Test<a name="line.917"></a>
-<span class="sourceLineNo">918</span>   public void testScalarPowInf() {<a name="line.918"></a>
-<span class="sourceLineNo">919</span>       TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(Double.POSITIVE_INFINITY));<a name="line.919"></a>
-<span class="sourceLineNo">920</span>       TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(Double.NEGATIVE_INFINITY));<a name="line.920"></a>
-<span class="sourceLineNo">921</span>       TestUtils.assertSame(Complex.NaN,infOne.pow(1.0));<a name="line.921"></a>
-<span class="sourceLineNo">922</span>       TestUtils.assertSame(Complex.NaN,negInfOne.pow(1.0));<a name="line.922"></a>
-<span class="sourceLineNo">923</span>       TestUtils.assertSame(Complex.NaN,infInf.pow(1.0));<a name="line.923"></a>
-<span class="sourceLineNo">924</span>       TestUtils.assertSame(Complex.NaN,infNegInf.pow(1.0));<a name="line.924"></a>
-<span class="sourceLineNo">925</span>       TestUtils.assertSame(Complex.NaN,negInfInf.pow(10));<a name="line.925"></a>
-<span class="sourceLineNo">926</span>       TestUtils.assertSame(Complex.NaN,negInfNegInf.pow(1.0));<a name="line.926"></a>
-<span class="sourceLineNo">927</span>       TestUtils.assertSame(Complex.NaN,negInfNegInf.pow(Double.POSITIVE_INFINITY));<a name="line.927"></a>
-<span class="sourceLineNo">928</span>       TestUtils.assertSame(Complex.NaN,negInfNegInf.pow(Double.POSITIVE_INFINITY));<a name="line.928"></a>
-<span class="sourceLineNo">929</span>       TestUtils.assertSame(Complex.NaN,infInf.pow(Double.POSITIVE_INFINITY));<a name="line.929"></a>
-<span class="sourceLineNo">930</span>       TestUtils.assertSame(Complex.NaN,infInf.pow(Double.NEGATIVE_INFINITY));<a name="line.930"></a>
-<span class="sourceLineNo">931</span>       TestUtils.assertSame(Complex.NaN,infNegInf.pow(Double.NEGATIVE_INFINITY));<a name="line.931"></a>
-<span class="sourceLineNo">932</span>       TestUtils.assertSame(Complex.NaN,infNegInf.pow(Double.POSITIVE_INFINITY));<a name="line.932"></a>
-<span class="sourceLineNo">933</span>   }<a name="line.933"></a>
-<span class="sourceLineNo">934</span><a name="line.934"></a>
-<span class="sourceLineNo">935</span>   @Test<a name="line.935"></a>
-<span class="sourceLineNo">936</span>   public void testScalarPowZero() {<a name="line.936"></a>
-<span class="sourceLineNo">937</span>       TestUtils.assertSame(Complex.NaN, Complex.ZERO.pow(1.0));<a name="line.937"></a>
-<span class="sourceLineNo">938</span>       TestUtils.assertSame(Complex.NaN, Complex.ZERO.pow(0.0));<a name="line.938"></a>
-<span class="sourceLineNo">939</span>       TestUtils.assertEquals(Complex.ONE, Complex.ONE.pow(0.0), 10e-12);<a name="line.939"></a>
-<span class="sourceLineNo">940</span>       TestUtils.assertEquals(Complex.ONE, Complex.I.pow(0.0), 10e-12);<a name="line.940"></a>
-<span class="sourceLineNo">941</span>       TestUtils.assertEquals(Complex.ONE, new Complex(-1, 3).pow(0.0), 10e-12);<a name="line.941"></a>
-<span class="sourceLineNo">942</span>   }<a name="line.942"></a>
-<span class="sourceLineNo">943</span><a name="line.943"></a>
-<span class="sourceLineNo">944</span>    @Test(expected=NullArgumentException.class)<a name="line.944"></a>
-<span class="sourceLineNo">945</span>    public void testpowNull() {<a name="line.945"></a>
-<span class="sourceLineNo">946</span>        Complex.ONE.pow(null);<a name="line.946"></a>
-<span class="sourceLineNo">947</span>    }<a name="line.947"></a>
-<span class="sourceLineNo">948</span><a name="line.948"></a>
-<span class="sourceLineNo">949</span>    @Test<a name="line.949"></a>
-<span class="sourceLineNo">950</span>    public void testSin() {<a name="line.950"></a>
-<span class="sourceLineNo">951</span>        Complex z = new Complex(3, 4);<a name="line.951"></a>
-<span class="sourceLineNo">952</span>        Complex expected = new Complex(3.853738, -27.01681);<a name="line.952"></a>
-<span class="sourceLineNo">953</span>        TestUtils.assertEquals(expected, z.sin(), 1.0e-5);<a name="line.953"></a>
-<span class="sourceLineNo">954</span>    }<a name="line.954"></a>
-<span class="sourceLineNo">955</span><a name="line.955"></a>
-<span class="sourceLineNo">956</span>    @Test<a name="line.956"></a>
-<span class="sourceLineNo">957</span>    public void testSinInf() {<a name="line.957"></a>
-<span class="sourceLineNo">958</span>        TestUtils.assertSame(infInf, oneInf.sin());<a name="line.958"></a>
-<span class="sourceLineNo">959</span>        TestUtils.assertSame(infNegInf, oneNegInf.sin());<a name="line.959"></a>
-<span class="sourceLineNo">960</span>        TestUtils.assertSame(Complex.NaN, infOne.sin());<a name="line.960"></a>
-<span class="sourceLineNo">961</span>        TestUtils.assertSame(Complex.NaN, negInfOne.sin());<a name="line.961"></a>
-<span class="sourceLineNo">962</span>        TestUtils.assertSame(Complex.NaN, infInf.sin());<a name="line.962"></a>
-<span class="sourceLineNo">963</span>        TestUtils.assertSame(Complex.NaN, infNegInf.sin());<a name="line.963"></a>
-<span class="sourceLineNo">964</span>        TestUtils.assertSame(Complex.NaN, negInfInf.sin());<a name="line.964"></a>
-<span class="sourceLineNo">965</span>        TestUtils.assertSame(Complex.NaN, negInfNegInf.sin());<a name="line.965"></a>
-<span class="sourceLineNo">966</span>    }<a name="line.966"></a>
-<span class="sourceLineNo">967</span><a name="line.967"></a>
-<span class="sourceLineNo">968</span>    @Test<a name="line.968"></a>
-<span class="sourceLineNo">969</span>    public void testSinNaN() {<a name="line.969"></a>
-<span class="sourceLineNo">970</span>        Assert.assertTrue(Complex.NaN.sin().isNaN());<a name="line.970"></a>
-<span class="sourceLineNo">971</span>    }<a name="line.971"></a>
-<span class="sourceLineNo">972</span><a name="line.972"></a>
-<span class="sourceLineNo">973</span>    @Test<a name="line.973"></a>
-<span class="sourceLineNo">974</span>    public void testSinh() {<a name="line.974"></a>
-<span class="sourceLineNo">975</span>        Complex z = new Complex(3, 4);<a name="line.975"></a>
-<span class="sourceLineNo">976</span>        Complex expected = new Complex(-6.54812, -7.61923);<a name="line.976"></a>
-<span class="sourceLineNo">977</span>        TestUtils.assertEquals(expected, z.sinh(), 1.0e-5);<a name="line.977"></a>
-<span class="sourceLineNo">978</span>    }<a name="line.978"></a>
-<span class="sourceLineNo">979</span><a name="line.979"></a>
-<span class="sourceLineNo">980</span>    @Test<a name="line.980"></a>
-<span class="sourceLineNo">981</span>    public void testSinhNaN() {<a name="line.981"></a>
-<span class="sourceLineNo">982</span>        Assert.assertTrue(Complex.NaN.sinh().isNaN());<a name="line.982"></a>
-<span class="sourceLineNo">983</span>    }<a name="line.983"></a>
-<span class="sourceLineNo">984</span><a name="line.984"></a>
-<span class="sourceLineNo">985</span>    @Test<a name="line.985"></a>
-<span class="sourceLineNo">986</span>    public void testSinhInf() {<a name="line.986"></a>
-<span class="sourceLineNo">987</span>        TestUtils.assertSame(Complex.NaN, oneInf.sinh());<a name="line.987"></a>
-<span class="sourceLineNo">988</span>        TestUtils.assertSame(Complex.NaN, oneNegInf.sinh());<a name="line.988"></a>
-<span class="sourceLineNo">989</span>        TestUtils.assertSame(infInf, infOne.sinh());<a name="line.989"></a>
-<span class="sourceLineNo">990</span>        TestUtils.assertSame(negInfInf, negInfOne.sinh());<a name="line.990"></a>
-<span class="sourceLineNo">991</span>        TestUtils.assertSame(Complex.NaN, infInf.sinh());<a name="line.991"></a>
-<span class="sourceLineNo">992</span>        TestUtils.assertSame(Complex.NaN, infNegInf.sinh());<a name="line.992"></a>
-<span class="sourceLineNo">993</span>        TestUtils.assertSame(Complex.NaN, negInfInf.sinh());<a name="line.993"></a>
-<span class="sourceLineNo">994</span>        TestUtils.assertSame(Complex.NaN, negInfNegInf.sinh());<a name="line.994"></a>
-<span class="sourceLineNo">995</span>    }<a name="line.995"></a>
-<span class="sourceLineNo">996</span><a name="line.996"></a>
-<span class="sourceLineNo">997</span>    @Test<a name="line.997"></a>
-<span class="sourceLineNo">998</span>    public void testSqrtRealPositive() {<a name="line.998"></a>
-<span class="sourceLineNo">999</span>        Complex z = new Complex(3, 4);<a name="line.999"></a>
-<span class="sourceLineNo">1000</span>        Complex expected = new Complex(2, 1);<a name="line.1000"></a>
-<span class="sourceLineNo">1001</span>        TestUtils.assertEquals(expected, z.sqrt(), 1.0e-5);<a name="line.1001"></a>
-<span class="sourceLineNo">1002</span>    }<a name="line.1002"></a>
+<span class="sourceLineNo">786</span>    }<a name="line.786"></a>
+<span class="sourceLineNo">787</span><a name="line.787"></a>
+<span class="sourceLineNo">788</span>    @Test<a name="line.788"></a>
+<span class="sourceLineNo">789</span>    public void testExpInf2() {<a name="line.789"></a>
+<span class="sourceLineNo">790</span>        TestUtils.assertSame(Complex.NaN, oneNegInf.exp());<a name="line.790"></a>
+<span class="sourceLineNo">791</span>    }<a name="line.791"></a>
+<span class="sourceLineNo">792</span><a name="line.792"></a>
+<span class="sourceLineNo">793</span>    @Test<a name="line.793"></a>
+<span class="sourceLineNo">794</span>    public void testExpInf3() {<a name="line.794"></a>
+<span class="sourceLineNo">795</span>        TestUtils.assertSame(infInf, infOne.exp());<a name="line.795"></a>
+<span class="sourceLineNo">796</span>    }<a name="line.796"></a>
+<span class="sourceLineNo">797</span><a name="line.797"></a>
+<span class="sourceLineNo">798</span>    @Test<a name="line.798"></a>
+<span class="sourceLineNo">799</span>    public void testJava() {// TODO more debug<a name="line.799"></a>
+<span class="sourceLineNo">800</span>        System.out.println("&gt;&gt;testJava()");<a name="line.800"></a>
+<span class="sourceLineNo">801</span>        // FastMathTest#testExpSpecialCases() checks the following:<a name="line.801"></a>
+<span class="sourceLineNo">802</span>        // Assert.assertEquals("exp of -infinity should be 0.0", 0.0, FastMath.exp(Double.NEGATIVE_INFINITY), Precision.EPSILON);<a name="line.802"></a>
+<span class="sourceLineNo">803</span>        // Let's check how well Math works:<a name="line.803"></a>
+<span class="sourceLineNo">804</span>        System.out.println("Math.exp="+Math.exp(Double.NEGATIVE_INFINITY));<a name="line.804"></a>
+<span class="sourceLineNo">805</span>        String props[] = {<a name="line.805"></a>
+<span class="sourceLineNo">806</span>        "java.version", //    Java Runtime Environment version<a name="line.806"></a>
+<span class="sourceLineNo">807</span>        "java.vendor", // Java Runtime Environment vendor<a name="line.807"></a>
+<span class="sourceLineNo">808</span>        "java.vm.specification.version", //   Java Virtual Machine specification version<a name="line.808"></a>
+<span class="sourceLineNo">809</span>        "java.vm.specification.vendor", //    Java Virtual Machine specification vendor<a name="line.809"></a>
+<span class="sourceLineNo">810</span>        "java.vm.specification.name", //  Java Virtual Machine specification name<a name="line.810"></a>
+<span class="sourceLineNo">811</span>        "java.vm.version", // Java Virtual Machine implementation version<a name="line.811"></a>
+<span class="sourceLineNo">812</span>        "java.vm.vendor", //  Java Virtual Machine implementation vendor<a name="line.812"></a>
+<span class="sourceLineNo">813</span>        "java.vm.name", //    Java Virtual Machine implementation name<a name="line.813"></a>
+<span class="sourceLineNo">814</span>        "java.specification.version", //  Java Runtime Environment specification version<a name="line.814"></a>
+<span class="sourceLineNo">815</span>        "java.specification.vendor", //   Java Runtime Environment specification vendor<a name="line.815"></a>
+<span class="sourceLineNo">816</span>        "java.specification.name", // Java Runtime Environment specification name<a name="line.816"></a>
+<span class="sourceLineNo">817</span>        "java.class.version", //  Java class format version number<a name="line.817"></a>
+<span class="sourceLineNo">818</span>        };<a name="line.818"></a>
+<span class="sourceLineNo">819</span>        for(String t : props) {<a name="line.819"></a>
+<span class="sourceLineNo">820</span>            System.out.println(t + "=" + System.getProperty(t));<a name="line.820"></a>
+<span class="sourceLineNo">821</span>        }    <a name="line.821"></a>
+<span class="sourceLineNo">822</span>        System.out.println("&lt;&lt;testJava()");<a name="line.822"></a>
+<span class="sourceLineNo">823</span>    }<a name="line.823"></a>
+<span class="sourceLineNo">824</span><a name="line.824"></a>
+<span class="sourceLineNo">825</span>    @Test<a name="line.825"></a>
+<span class="sourceLineNo">826</span>    public void testExpInf4() {<a name="line.826"></a>
+<span class="sourceLineNo">827</span>        // TODO: temp debug start<a name="line.827"></a>
+<span class="sourceLineNo">828</span>        System.out.println("&gt;&gt;testExpInf4()");<a name="line.828"></a>
+<span class="sourceLineNo">829</span>        double inf = negInfOne.getReal();<a name="line.829"></a>
+<span class="sourceLineNo">830</span>        System.out.println("inf="+inf);<a name="line.830"></a>
+<span class="sourceLineNo">831</span>        int intVal = (int) -inf;<a name="line.831"></a>
+<span class="sourceLineNo">832</span>        System.out.println("intval="+intVal);<a name="line.832"></a>
+<span class="sourceLineNo">833</span>        System.out.println("neginf&lt;0=" + (inf &lt; 0.0));<a name="line.833"></a>
+<span class="sourceLineNo">834</span>        // TODO: temp debug end<a name="line.834"></a>
+<span class="sourceLineNo">835</span>        System.out.println("expReal="+FastMath.exp(negInfOne.getReal())); // TODO temp debug<a name="line.835"></a>
+<span class="sourceLineNo">836</span>        System.out.println("cosImag="+FastMath.cos(negInfOne.getImaginary())); // TODO temp debug<a name="line.836"></a>
+<span class="sourceLineNo">837</span>        System.out.println("sinImag="+FastMath.sin(negInfOne.getImaginary())); // TODO temp debug<a name="line.837"></a>
+<span class="sourceLineNo">838</span>        final Complex exp = negInfOne.exp();<a name="line.838"></a>
+<span class="sourceLineNo">839</span>        System.out.println("result="+exp); // TODO temp debug<a name="line.839"></a>
+<span class="sourceLineNo">840</span>        TestUtils.assertSame(Complex.ZERO, exp);<a name="line.840"></a>
+<span class="sourceLineNo">841</span>        System.out.println("&lt;&lt;testExpInf4()"); // TODO debug<a name="line.841"></a>
+<span class="sourceLineNo">842</span>    }<a name="line.842"></a>
+<span class="sourceLineNo">843</span><a name="line.843"></a>
+<span class="sourceLineNo">844</span>    @Test<a name="line.844"></a>
+<span class="sourceLineNo">845</span>    public void testExpInf5() {<a name="line.845"></a>
+<span class="sourceLineNo">846</span>        TestUtils.assertSame(Complex.NaN, infInf.exp());<a name="line.846"></a>
+<span class="sourceLineNo">847</span>    }<a name="line.847"></a>
+<span class="sourceLineNo">848</span><a name="line.848"></a>
+<span class="sourceLineNo">849</span>    @Test<a name="line.849"></a>
+<span class="sourceLineNo">850</span>    public void testExpInf6() {<a name="line.850"></a>
+<span class="sourceLineNo">851</span>        TestUtils.assertSame(Complex.NaN, infNegInf.exp());<a name="line.851"></a>
+<span class="sourceLineNo">852</span>    }<a name="line.852"></a>
+<span class="sourceLineNo">853</span><a name="line.853"></a>
+<span class="sourceLineNo">854</span>    @Test<a name="line.854"></a>
+<span class="sourceLineNo">855</span>    public void testExpInf7() {<a name="line.855"></a>
+<span class="sourceLineNo">856</span>        TestUtils.assertSame(Complex.NaN, negInfInf.exp());<a name="line.856"></a>
+<span class="sourceLineNo">857</span>    }<a name="line.857"></a>
+<span class="sourceLineNo">858</span><a name="line.858"></a>
+<span class="sourceLineNo">859</span>    @Test<a name="line.859"></a>
+<span class="sourceLineNo">860</span>    public void testExpInf8() {<a name="line.860"></a>
+<span class="sourceLineNo">861</span>        TestUtils.assertSame(Complex.NaN, negInfNegInf.exp());<a name="line.861"></a>
+<span class="sourceLineNo">862</span>    }<a name="line.862"></a>
+<span class="sourceLineNo">863</span><a name="line.863"></a>
+<span class="sourceLineNo">864</span>    @Test<a name="line.864"></a>
+<span class="sourceLineNo">865</span>    public void testLog() {<a name="line.865"></a>
+<span class="sourceLineNo">866</span>        Complex z = new Complex(3, 4);<a name="line.866"></a>
+<span class="sourceLineNo">867</span>        Complex expected = new Complex(1.60944, 0.927295);<a name="line.867"></a>
+<span class="sourceLineNo">868</span>        TestUtils.assertEquals(expected, z.log(), 1.0e-5);<a name="line.868"></a>
+<span class="sourceLineNo">869</span>    }<a name="line.869"></a>
+<span class="sourceLineNo">870</span><a name="line.870"></a>
+<span class="sourceLineNo">871</span>    @Test<a name="line.871"></a>
+<span class="sourceLineNo">872</span>    public void testLogNaN() {<a name="line.872"></a>
+<span class="sourceLineNo">873</span>        Assert.assertTrue(Complex.NaN.log().isNaN());<a name="line.873"></a>
+<span class="sourceLineNo">874</span>    }<a name="line.874"></a>
+<span class="sourceLineNo">875</span><a name="line.875"></a>
+<span class="sourceLineNo">876</span>    @Test<a name="line.876"></a>
+<span class="sourceLineNo">877</span>    public void testLogInf() {<a name="line.877"></a>
+<span class="sourceLineNo">878</span>        TestUtils.assertEquals(new Complex(inf, pi / 2),<a name="line.878"></a>
+<span class="sourceLineNo">879</span>                oneInf.log(), 10e-12);<a name="line.879"></a>
+<span class="sourceLineNo">880</span>        TestUtils.assertEquals(new Complex(inf, -pi / 2),<a name="line.880"></a>
+<span class="sourceLineNo">881</span>                oneNegInf.log(), 10e-12);<a name="line.881"></a>
+<span class="sourceLineNo">882</span>        TestUtils.assertEquals(infZero, infOne.log(), 10e-12);<a name="line.882"></a>
+<span class="sourceLineNo">883</span>        TestUtils.assertEquals(new Complex(inf, pi),<a name="line.883"></a>
+<span class="sourceLineNo">884</span>                negInfOne.log(), 10e-12);<a name="line.884"></a>
+<span class="sourceLineNo">885</span>        TestUtils.assertEquals(new Complex(inf, pi / 4),<a name="line.885"></a>
+<span class="sourceLineNo">886</span>                infInf.log(), 10e-12);<a name="line.886"></a>
+<span class="sourceLineNo">887</span>        TestUtils.assertEquals(new Complex(inf, -pi / 4),<a name="line.887"></a>
+<span class="sourceLineNo">888</span>                infNegInf.log(), 10e-12);<a name="line.888"></a>
+<span class="sourceLineNo">889</span>        TestUtils.assertEquals(new Complex(inf, 3d * pi / 4),<a name="line.889"></a>
+<span class="sourceLineNo">890</span>                negInfInf.log(), 10e-12);<a name="line.890"></a>
+<span class="sourceLineNo">891</span>        TestUtils.assertEquals(new Complex(inf, - 3d * pi / 4),<a name="line.891"></a>
+<span class="sourceLineNo">892</span>                negInfNegInf.log(), 10e-12);<a name="line.892"></a>
+<span class="sourceLineNo">893</span>    }<a name="line.893"></a>
+<span class="sourceLineNo">894</span><a name="line.894"></a>
+<span class="sourceLineNo">895</span>    @Test<a name="line.895"></a>
+<span class="sourceLineNo">896</span>    public void testLogZero() {<a name="line.896"></a>
+<span class="sourceLineNo">897</span>        TestUtils.assertSame(negInfZero, Complex.ZERO.log());<a name="line.897"></a>
+<span class="sourceLineNo">898</span>    }<a name="line.898"></a>
+<span class="sourceLineNo">899</span><a name="line.899"></a>
+<span class="sourceLineNo">900</span>    @Test<a name="line.900"></a>
+<span class="sourceLineNo">901</span>    public void testPow() {<a name="line.901"></a>
+<span class="sourceLineNo">902</span>        Complex x = new Complex(3, 4);<a name="line.902"></a>
+<span class="sourceLineNo">903</span>        Complex y = new Complex(5, 6);<a name="line.903"></a>
+<span class="sourceLineNo">904</span>        Complex expected = new Complex(-1.860893, 11.83677);<a name="line.904"></a>
+<span class="sourceLineNo">905</span>        TestUtils.assertEquals(expected, x.pow(y), 1.0e-5);<a name="line.905"></a>
+<span class="sourceLineNo">906</span>    }<a name="line.906"></a>
+<span class="sourceLineNo">907</span><a name="line.907"></a>
+<span class="sourceLineNo">908</span>    @Test<a name="line.908"></a>
+<span class="sourceLineNo">909</span>    public void testPowNaNBase() {<a name="line.909"></a>
+<span class="sourceLineNo">910</span>        Complex x = new Complex(3, 4);<a name="line.910"></a>
+<span class="sourceLineNo">911</span>        Assert.assertTrue(Complex.NaN.pow(x).isNaN());<a name="line.911"></a>
+<span class="sourceLineNo">912</span>    }<a name="line.912"></a>
+<span class="sourceLineNo">913</span><a name="line.913"></a>
+<span class="sourceLineNo">914</span>    @Test<a name="line.914"></a>
+<span class="sourceLineNo">915</span>    public void testPowNaNExponent() {<a name="line.915"></a>
+<span class="sourceLineNo">916</span>        Complex x = new Complex(3, 4);<a name="line.916"></a>
+<span class="sourceLineNo">917</span>        Assert.assertTrue(x.pow(Complex.NaN).isNaN());<a name="line.917"></a>
+<span class="sourceLineNo">918</span>    }<a name="line.918"></a>
+<span class="sourceLineNo">919</span><a name="line.919"></a>
+<span class="sourceLineNo">920</span>   @Test<a name="line.920"></a>
+<span class="sourceLineNo">921</span>   public void testPowInf() {<a name="line.921"></a>
+<span class="sourceLineNo">922</span>       TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(oneInf));<a name="line.922"></a>
+<span class="sourceLineNo">923</span>       TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(oneNegInf));<a name="line.923"></a>
+<span class="sourceLineNo">924</span>       TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(infOne));<a name="line.924"></a>
+<span class="sourceLineNo">925</span>       TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(infInf));<a name="line.925"></a>
+<span class="sourceLineNo">926</span>       TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(infNegInf));<a name="line.926"></a>
+<span class="sourceLineNo">927</span>       TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(negInfInf));<a name="line.927"></a>
+<span class="sourceLineNo">928</span>       TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(negInfNegInf));<a name="line.928"></a>
+<span class="sourceLineNo">929</span>       TestUtils.assertSame(Complex.NaN,infOne.pow(Complex.ONE));<a name="line.929"></a>
+<span class="sourceLineNo">930</span>       TestUtils.assertSame(Complex.NaN,negInfOne.pow(Complex.ONE));<a name="line.930"></a>
+<span class="sourceLineNo">931</span>       TestUtils.assertSame(Complex.NaN,infInf.pow(Complex.ONE));<a name="line.931"></a>
+<span class="sourceLineNo">932</span>       TestUtils.assertSame(Complex.NaN,infNegInf.pow(Complex.ONE));<a name="line.932"></a>
+<span class="sourceLineNo">933</span>       TestUtils.assertSame(Complex.NaN,negInfInf.pow(Complex.ONE));<a name="line.933"></a>
+<span class="sourceLineNo">934</span>       TestUtils.assertSame(Complex.NaN,negInfNegInf.pow(Complex.ONE));<a name="line.934"></a>
+<span class="sourceLineNo">935</span>       TestUtils.assertSame(Complex.NaN,negInfNegInf.pow(infNegInf));<a name="line.935"></a>
+<span class="sourceLineNo">936</span>       TestUtils.assertSame(Complex.NaN,negInfNegInf.pow(negInfNegInf));<a name="line.936"></a>
+<span class="sourceLineNo">937</span>       TestUtils.assertSame(Complex.NaN,negInfNegInf.pow(infInf));<a name="line.937"></a>
+<span class="sourceLineNo">938</span>       TestUtils.assertSame(Complex.NaN,infInf.pow(infNegInf));<a name="line.938"></a>
+<span class="sourceLineNo">939</span>       TestUtils.assertSame(Complex.NaN,infInf.pow(negInfNegInf));<a name="line.939"></a>
+<span class="sourceLineNo">940</span>       TestUtils.assertSame(Complex.NaN,infInf.pow(infInf));<a name="line.940"></a>
+<span class="sourceLineNo">941</span>       TestUtils.assertSame(Complex.NaN,infNegInf.pow(infNegInf));<a name="line.941"></a>
+<span class="sourceLineNo">942</span>       TestUtils.assertSame(Complex.NaN,infNegInf.pow(negInfNegInf));<a name="line.942"></a>
+<span class="sourceLineNo">943</span>       TestUtils.assertSame(Complex.NaN,infNegInf.pow(infInf));<a name="line.943"></a>
+<span class="sourceLineNo">944</span>   }<a name="line.944"></a>
+<span class="sourceLineNo">945</span><a name="line.945"></a>
+<span class="sourceLineNo">946</span>   @Test<a name="line.946"></a>
+<span class="sourceLineNo">947</span>   public void testPowZero() {<a name="line.947"></a>
+<span class="sourceLineNo">948</span>       TestUtils.assertSame(Complex.NaN,<a name="line.948"></a>
+<span class="sourceLineNo">949</span>               Complex.ZERO.pow(Complex.ONE));<a name="line.949"></a>
+<span class="sourceLineNo">950</span>       TestUtils.assertSame(Complex.NaN,<a name="line.950"></a>
+<span class="sourceLineNo">951</span>               Complex.ZERO.pow(Complex.ZERO));<a name="line.951"></a>
+<span class="sourceLineNo">952</span>       TestUtils.assertSame(Complex.NaN,<a name="line.952"></a>
+<span class="sourceLineNo">953</span>               Complex.ZERO.pow(Complex.I));<a name="line.953"></a>
+<span class="sourceLineNo">954</span>       TestUtils.assertEquals(Complex.ONE,<a name="line.954"></a>
+<span class="sourceLineNo">955</span>               Complex.ONE.pow(Complex.ZERO), 10e-12);<a name="line.955"></a>
+<span class="sourceLineNo">956</span>       TestUtils.assertEquals(Complex.ONE,<a name="line.956"></a>
+<span class="sourceLineNo">957</span>               Complex.I.pow(Complex.ZERO), 10e-12);<a name="line.957"></a>
+<span class="sourceLineNo">958</span>       TestUtils.assertEquals(Complex.ONE,<a name="line.958"></a>
+<span class="sourceLineNo">959</span>               new Complex(-1, 3).pow(Complex.ZERO), 10e-12);<a name="line.959"></a>
+<span class="sourceLineNo">960</span>   }<a name="line.960"></a>
+<span class="sourceLineNo">961</span><a name="line.961"></a>
+<span class="sourceLineNo">962</span>    @Test<a name="line.962"></a>
+<span class="sourceLineNo">963</span>    public void testScalarPow() {<a name="line.963"></a>
+<span class="sourceLineNo">964</span>        Complex x = new Complex(3, 4);<a name="line.964"></a>
+<span class="sourceLineNo">965</span>        double yDouble = 5.0;<a name="line.965"></a>
+<span class="sourceLineNo">966</span>        Complex yComplex = new Complex(yDouble);<a name="line.966"></a>
+<span class="sourceLineNo">967</span>        Assert.assertEquals(x.pow(yComplex), x.pow(yDouble));<a name="line.967"></a>
+<span class="sourceLineNo">968</span>    }<a name="line.968"></a>
+<span class="sourceLineNo">969</span><a name="line.969"></a>
+<span class="sourceLineNo">970</span>    @Test<a name="line.970"></a>
+<span class="sourceLineNo">971</span>    public void testScalarPowNaNBase() {<a name="line.971"></a>
+<span class="sourceLineNo">972</span>        Complex x = Complex.NaN;<a name="line.972"></a>
+<span class="sourceLineNo">973</span>        double yDouble = 5.0;<a name="line.973"></a>
+<span class="sourceLineNo">974</span>        Complex yComplex = new Complex(yDouble);<a name="line.974"></a>
+<span class="sourceLineNo">975</span>        Assert.assertEquals(x.pow(yComplex), x.pow(yDouble));<a name="line.975"></a>
+<span class="sourceLineNo">976</span>    }<a name="line.976"></a>
+<span class="sourceLineNo">977</span><a name="line.977"></a>
+<span class="sourceLineNo">978</span>    @Test<a name="line.978"></a>
+<span class="sourceLineNo">979</span>    public void testScalarPowNaNExponent() {<a name="line.979"></a>
+<span class="sourceLineNo">980</span>        Complex x = new Complex(3, 4);<a name="line.980"></a>
+<span class="sourceLineNo">981</span>        double yDouble = Double.NaN;<a name="line.981"></a>
+<span class="sourceLineNo">982</span>        Complex yComplex = new Complex(yDouble);<a name="line.982"></a>
+<span class="sourceLineNo">983</span>        Assert.assertEquals(x.pow(yComplex), x.pow(yDouble));<a name="line.983"></a>
+<span class="sourceLineNo">984</span>    }<a name="line.984"></a>
+<span class="sourceLineNo">985</span><a name="line.985"></a>
+<span class="sourceLineNo">986</span>   @Test<a name="line.986"></a>
+<span class="sourceLineNo">987</span>   public void testScalarPowInf() {<a name="line.987"></a>
+<span class="sourceLineNo">988</span>       TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(Double.POSITIVE_INFINITY));<a name="line.988"></a>
+<span class="sourceLineNo">989</span>       TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(Double.NEGATIVE_INFINITY));<a name="line.989"></a>
+<span class="sourceLineNo">990</span>       TestUtils.assertSame(Complex.NaN,infOne.pow(1.0));<a name="line.990"></a>
+<span class="sourceLineNo">991</span>       TestUtils.assertSame(Complex.NaN,negInfOne.pow(1.0));<a name="line.991"></a>
+<span class="sourceLineNo">992</span>       TestUtils.assertSame(Complex.NaN,infInf.pow(1.0));<a name="line.992"></a>
+<span class="sourceLineNo">993</span>       TestUtils.assertSame(Complex.NaN,infNegInf.pow(1.0));<a name="line.993"></a>
+<span class="sourceLineNo">994</span>       TestUtils.assertSame(Complex.NaN,negInfInf.pow(10));<a name="line.994"></a>
+<span class="sourceLineNo">995</span>       TestUtils.assertSame(Complex.NaN,negInfNegInf.pow(1.0));<a name="line.995"></a>
+<span class="sourceLineNo">996</span>       TestUtils.assertSame(Complex.NaN,negInfNegInf.pow(Double.POSITIVE_INFINITY));<a name="line.996"></a>
+<span class="sourceLineNo">997</span>       TestUtils.assertSame(Complex.NaN,negInfNegInf.pow(Double.POSITIVE_INFINITY));<a name="line.997"></a>
+<span class="sourceLineNo">998</span>       TestUtils.assertSame(Complex.NaN,infInf.pow(Double.POSITIVE_INFINITY));<a name="line.998"></a>
+<span class="sourceLineNo">999</span>       TestUtils.assertSame(Complex.NaN,infInf.pow(Double.NEGATIVE_INFINITY));<a name="line.999"></a>
+<span class="sourceLineNo">1000</span>       TestUtils.assertSame(Complex.NaN,infNegInf.pow(Double.NEGATIVE_INFINITY));<a name="line.1000"></a>
+<span class="sourceLineNo">1001</span>       TestUtils.assertSame(Complex.NaN,infNegInf.pow(Double.POSITIVE_INFINITY));<a name="line.1001"></a>
+<span class="sourceLineNo">1002</span>   }<a name="line.1002"></a>
 <span class="sourceLineNo">1003</span><a name="line.1003"></a>
-<span class="sourceLineNo">1004</span>    @Test<a name="line.1004"></a>
-<span class="sourceLineNo">1005</span>    public void testSqrtRealZero() {<a name="line.1005"></a>
-<span class="sourceLineNo">1006</span>        Complex z = new Complex(0.0, 4);<a name="line.1006"></a>
-<span class="sourceLineNo">1007</span>        Complex expected = new Complex(1.41421, 1.41421);<a name="line.1007"></a>
-<span class="sourceLineNo">1008</span>        TestUtils.assertEquals(expected, z.sqrt(), 1.0e-5);<a name="line.1008"></a>
-<span class="sourceLineNo">1009</span>    }<a name="line.1009"></a>
-<span class="sourceLineNo">1010</span><a name="line.1010"></a>
-<span class="sourceLineNo">1011</span>    @Test<a name="line.1011"></a>
-<span class="sourceLineNo">1012</span>    public void testSqrtRealNegative() {<a name="line.1012"></a>
-<span class="sourceLineNo">1013</span>        Complex z = new Complex(-3.0, 4);<a name="line.1013"></a>
-<span class="sourceLineNo">1014</span>        Complex expected = new Complex(1, 2);<a name="line.1014"></a>
-<span class="sourceLineNo">1015</span>        TestUtils.assertEquals(expected, z.sqrt(), 1.0e-5);<a name="line.1015"></a>
+<span class="sourceLineNo">1004</span>   @Test<a name="line.1004"></a>
+<span class="sourceLineNo">1005</span>   public void testScalarPowZero() {<a name="line.1005"></a>
+<span class="sourceLineNo">1006</span>       TestUtils.assertSame(Complex.NaN, Complex.ZERO.pow(1.0));<a name="line.1006"></a>
+<span class="sourceLineNo">1007</span>       TestUtils.assertSame(Complex.NaN, Complex.ZERO.pow(0.0));<a name="line.1007"></a>
+<span class="sourceLineNo">1008</span>       TestUtils.assertEquals(Complex.ONE, Complex.ONE.pow(0.0), 10e-12);<a name="line.1008"></a>
+<span class="sourceLineNo">1009</span>       TestUtils.assertEquals(Complex.ONE, Complex.I.pow(0.0), 10e-12);<a name="line.1009"></a>
+<span class="sourceLineNo">1010</span>       TestUtils.assertEquals(Complex.ONE, new Complex(-1, 3).pow(0.0), 10e-12);<a name="line.1010"></a>
+<span class="sourceLineNo">1011</span>   }<a name="line.1011"></a>
+<span class="sourceLineNo">1012</span><a name="line.1012"></a>
+<span class="sourceLineNo">1013</span>    @Test(expected=NullArgumentException.class)<a name="line.1013"></a>
+<span class="sourceLineNo">1014</span>    public void testpowNull() {<a name="line.1014"></a>
+<span class="sourceLineNo">1015</span>        Complex.ONE.pow(null);<a name="line.1015"></a>
 <span class="sourceLineNo">1016</span>    }<a name="line.1016"></a>
 <span class="sourceLineNo">1017</span><a name="line.1017"></a>
 <span class="sourceLineNo">1018</span>    @Test<a name="line.1018"></a>
-<span class="sourceLineNo">1019</span>    public void testSqrtImaginaryZero() {<a name="line.1019"></a>
-<span class="sourceLineNo">1020</span>        Complex z = new Complex(-3.0, 0.0);<a name="line.1020"></a>
-<span class="sourceLineNo">1021</span>        Complex expected = new Complex(0.0, 1.73205);<a name="line.1021"></a>
-<span class="sourceLineNo">1022</span>        TestUtils.assertEquals(expected, z.sqrt(), 1.0e-5);<a name="line.1022"></a>
+<span class="sourceLineNo">1019</span>    public void testSin() {<a name="line.1019"></a>
+<span class="sourceLineNo">1020</span>        Complex z = new Complex(3, 4);<a name="line.1020"></a>
+<span class="sourceLineNo">1021</span>        Complex expected = new Complex(3.853738, -27.01681);<a name="line.1021"></a>
+<span class="sourceLineNo">1022</span>        TestUtils.assertEquals(expected, z.sin(), 1.0e-5);<a name="line.1022"></a>
 <span class="sourceLineNo">1023</span>    }<a name="line.1023"></a>
 <span class="sourceLineNo">1024</span><a name="line.1024"></a>
 <span class="sourceLineNo">1025</span>    @Test<a name="line.1025"></a>
-<span class="sourceLineNo">1026</span>    public void testSqrtImaginaryNegative() {<a name="line.1026"></a>
-<span class="sourceLineNo">1027</span>        Complex z = new Complex(-3.0, -4.0);<a name="line.1027"></a>
-<span class="sourceLineNo">1028</span>        Complex expected = new Complex(1.0, -2.0);<a name="line.1028"></a>
-<span class="sourceLineNo">1029</span>        TestUtils.assertEquals(expected, z.sqrt(), 1.0e-5);<a name="line.1029"></a>
-<span class="sourceLineNo">1030</span>    }<a name="line.1030"></a>
-<span class="sourceLineNo">1031</span><a name="line.1031"></a>
-<span class="sourceLineNo">1032</span>    @Test<a name="line.1032"></a>
-<span class="sourceLineNo">1033</span>    public void testSqrtPolar() {<a name="line.1033"></a>
-<span class="sourceLineNo">1034</span>        double r = 1;<a name="line.1034"></a>
-<span class="sourceLineNo">1035</span>        for (int i = 0; i &lt; 5; i++) {<a name="line.1035"></a>
-<span class="sourceLineNo">1036</span>            r += i;<a name="line.1036"></a>
-<span class="sourceLineNo">1037</span>            double theta = 0;<a name="line.1037"></a>
-<span class="sourceLineNo">1038</span>            for (int j =0; j &lt; 11; j++) {<a name="line.1038"></a>
-<span class="sourceLineNo">1039</span>                theta += pi /12;<a name="line.1039"></a>
-<span class="sourceLineNo">1040</span>                Complex z = ComplexUtils.polar2Complex(r, theta);<a name="line.1040"></a>
-<span class="sourceLineNo">1041</span>                Complex sqrtz = ComplexUtils.polar2Complex(FastMath.sqrt(r), theta / 2);<a name="line.1041"></a>
-<span class="sourceLineNo">1042</span>                TestUtils.assertEquals(sqrtz, z.sqrt(), 10e-12);<a name="line.1042"></a>
-<span class="sourceLineNo">1043</span>            }<a name="line.1043"></a>
-<span class="sourceLineNo">1044</span>        }<a name="line.1044"></a>
-<span class="sourceLineNo">1045</span>    }<a name="line.1045"></a>
-<span class="sourceLineNo">1046</span><a name="line.1046"></a>
-<span class="sourceLineNo">1047</span>    @Test<a name="line.1047"></a>
-<span class="sourceLineNo">1048</span>    public void testSqrtNaN() {<a name="line.1048"></a>
-<span class="sourceLineNo">1049</span>        Assert.assertTrue(Complex.NaN.sqrt().isNaN());<a name="line.1049"></a>
-<span class="sourceLineNo">1050</span>    }<a name="line.1050"></a>
-<span class="sourceLineNo">1051</span><a name="line.1051"></a>
-<span class="sourceLineNo">1052</span>    @Test<a name="line.1052"></a>
-<span class="sourceLineNo">1053</span>    public void testSqrtInf() {<a name="line.1053"></a>
-<span class="sourceLineNo">1054</span>        TestUtils.assertSame(infNaN, oneInf.sqrt());<a name="line.1054"></a>
-<span class="sourceLineNo">1055</span>        TestUtils.assertSame(infNaN, oneNegInf.sqrt());<a name="line.1055"></a>
-<span class="sourceLineNo">1056</span>        TestUtils.assertSame(infZero, infOne.sqrt());<a name="line.1056"></a>
-<span class="sourceLineNo">1057</span>        TestUtils.assertSame(zeroInf, negInfOne.sqrt());<a name="line.1057"></a>
-<span class="sourceLineNo">1058</span>        TestUtils.assertSame(infNaN, infInf.sqrt());<a name="line.1058"></a>
-<span class="sourceLineNo">1059</span>        TestUtils.assertSame(infNaN, infNegInf.sqrt());<a name="line.1059"></a>
-<span class="sourceLineNo">1060</span>        TestUtils.assertSame(nanInf, negInfInf.sqrt());<a name="line.1060"></a>
-<span class="sourceLineNo">1061</span>        TestUtils.assertSame(nanNegInf, negInfNegInf.sqrt());<a name="line.1061"></a>
-<span class="sourceLineNo">1062</span>    }<a name="line.1062"></a>
-<span class="sourceLineNo">1063</span><a name="line.1063"></a>
-<span class="sourceLineNo">1064</span>    @Test<a name="line.1064"></a>
-<span class="sourceLineNo">1065</span>    public void testSqrt1z() {<a name="line.1065"></a>
-<span class="sourceLineNo">1066</span>        Complex z = new Complex(3, 4);<a name="line.1066"></a>
-<span class="sourceLineNo">1067</span>        Complex expected = new Complex(4.08033, -2.94094);<a name="line.1067"></a>
-<span class="sourceLineNo">1068</span>        TestUtils.assertEquals(expected, z.sqrt1z(), 1.0e-5);<a name="line.1068"></a>
-<span class="sourceLineNo">1069</span>    }<a name="line.1069"></a>
-<span class="sourceLineNo">1070</span><a name="line.1070"></a>
-<span class="sourceLineNo">1071</span>    @Test<a name="line.1071"></a>
-<span class="sourceLineNo">1072</span>    public void testSqrt1zNaN() {<a name="line.1072"></a>
-<span class="sourceLineNo">1073</span>        Assert.assertTrue(Complex.NaN.sqrt1z().isNaN());<a name="line.1073"></a>
-<span class="sourceLineNo">1074</span>    }<a name="line.1074"></a>
-<span class="sourceLineNo">1075</span><a name="line.1075"></a>
-<span class="sourceLineNo">1076</span>    @Test<a name="line.1076"></a>
-<span class="sourceLineNo">1077</span>    public void testTan() {<a name="line.1077"></a>
-<span class="sourceLineNo">1078</span>        Complex z = new Complex(3, 4);<a name="line.1078"></a>
-<span class="sourceLineNo">1079</span>        Complex expected = new Complex(-0.000187346, 0.999356);<a name="line.1079"></a>
-<span class="sourceLineNo">1080</span>        TestUtils.assertEquals(expected, z.tan(), 1.0e-5);<a name="line.1080"></a>
-<span class="sourceLineNo">1081</span>        /* Check that no overflow occurs (MATH-722) */<a name="line.1081"></a>
-<span class="sourceLineNo">1082</span>        Complex actual = new Complex(3.0, 1E10).tan();<a name="line.1082"></a>
-<span class="sourceLineNo">1083</span>        expected = new Complex(0, 1);<a name="line.1083"></a>
-<span class="sourceLineNo">1084</span>        TestUtils.assertEquals(expected, actual, 1.0e-5);<a name="line.1084"></a>
-<span class="sourceLineNo">1085</span>        actual = new Complex(3.0, -1E10).tan();<a name="line.1085"></a>
-<span class="sourceLineNo">1086</span>        expected = new Complex(0, -1);<a name="line.1086"></a>
-<span class="sourceLineNo">1087</span>        TestUtils.assertEquals(expected, actual, 1.0e-5);<a name="line.1087"></a>
-<span class="sourceLineNo">1088</span>    }<a name="line.1088"></a>
-<span class="sourceLineNo">1089</span><a name="line.1089"></a>
-<span class="sourceLineNo">1090</span>    @Test<a name="line.1090"></a>
-<span class="sourceLineNo">1091</span>    public void testTanNaN() {<a name="line.1091"></a>
-<span class="sourceLineNo">1092</span>        Assert.assertTrue(Complex.NaN.tan().isNaN());<a name="line.1092"></a>
-<span class="sourceLineNo">1093</span>    }<a name="line.1093"></a>
-<span class="sourceLineNo">1094</span><a name="line.1094"></a>
-<span class="sourceLineNo">1095</span>    @Test<a name="line.1095"></a>
-<span class="sourceLineNo">1096</span>    public void testTanInf() {<a name="line.1096"></a>
-<span class="sourceLineNo">1097</span>        TestUtils.assertSame(Complex.valueOf(0.0, 1.0), oneInf.tan());<a name="line.1097"></a>
-<span class="sourceLineNo">1098</span>        TestUtils.assertSame(Complex.valueOf(0.0, -1.0), oneNegInf.tan());<a name="line.1098"></a>
-<span class="sourceLineNo">1099</span>        TestUtils.assertSame(Complex.NaN, infOne.tan());<a name="line.1099"></a>
-<span class="sourceLineNo">1100</span>        TestUtils.assertSame(Complex.NaN, negInfOne.tan());<a name="line.1100"></a>
-<span class="sourceLineNo">1101</span>        TestUtils.assertSame(Complex.NaN, infInf.tan());<a name="line.1101"></a>
-<span class="sourceLineNo">1102</span>        TestUtils.assertSame(Complex.NaN, infNegInf.tan());<a name="line.1102"></a>
-<span class="sourceLineNo">1103</span>        TestUtils.assertSame(Complex.NaN, negInfInf.tan());<a name="line.1103"></a>
-<span class="sourceLineNo">1104</span>        TestUtils.assertSame(Complex.NaN, negInfNegInf.tan());<a name="line.1104"></a>
-<span class="sourceLineNo">1105</span>    }<a name="line.1105"></a>
-<span class="sourceLineNo">1106</span><a name="line.1106"></a>
-<span class="sourceLineNo">1107</span>   @Test<a name="line.1107"></a>
-<span class="sourceLineNo">1108</span>   public void testTanCritical() {<a name="line.1108"></a>
-<span class="sourceLineNo">1109</span>        TestUtils.assertSame(infNaN, new Complex(pi/2, 0).tan());<a name="line.1109"></a>
-<span class="sourceLineNo">1110</span>        TestUtils.assertSame(negInfNaN, new Complex(-pi/2, 0).tan());<a name="line.1110"></a>
-<span class="sourceLineNo">1111</span>    }<a name="line.1111"></a>
-<span class="sourceLineNo">1112</span><a name="line.1112"></a>
-<span class="sourceLineNo">1113</span>    @Test<a name="line.1113"></a>
-<span class="sourceLineNo">1114</span>    public void testTanh() {<a name="line.1114"></a>
-<span class="sourceLineNo">1115</span>        Complex z = new Complex(3, 4);<a name="line.1115"></a>
-<span class="sourceLineNo">1116</span>        Complex expected = new Complex(1.00071, 0.00490826);<a name="line.1116"></a>
-<span class="sourceLineNo">1117</span>        TestUtils.assertEquals(expected, z.tanh(), 1.0e-5);<a name="line.1117"></a>
-<span class="sourceLineNo">1118</span>        /* Check that no overflow occurs (MATH-722) */<a name="line.1118"></a>
-<span class="sourceLineNo">1119</span>        Complex actual = new Complex(1E10, 3.0).tanh();<a name="line.1119"></a>
-<span class="sourceLineNo">1120</span>        expected = new Complex(1, 0);<a name="line.1120"></a>
-<span class="sourceLineNo">1121</span>        TestUtils.assertEquals(expected, actual, 1.0e-5);<a name="line.1121"></a>
-<span class="sourceLineNo">1122</span>        actual = new Complex(-1E10, 3.0).tanh();<a name="line.1122"></a>
-<span class="sourceLineNo">1123</span>        expected = new Complex(-1, 0);<a name="line.1123"></a>
-<span class="sourceLineNo">1124</span>        TestUtils.assertEquals(expected, actual, 1.0e-5);<a name="line.1124"></a>
-<span class="sourceLineNo">1125</span>    }<a name="line.1125"></a>
-<span class="sourceLineNo">1126</span><a name="line.1126"></a>
-<span class="sourceLineNo">1127</span>    @Test<a name="line.1127"></a>
-<span class="sourceLineNo">1128</span>    public void testTanhNaN() {<a name="line.1128"></a>
-<span class="sourceLineNo">1129</span>        Assert.assertTrue(Complex.NaN.tanh().isNaN());<a name="line.1129"></a>
-<span class="sourceLineNo">1130</span>    }<a name="line.1130"></a>
-<span class="sourceLineNo">1131</span><a name="line.1131"></a>
-<span class="sourceLineNo">1132</span>    @Test<a name="line.1132"></a>
-<span class="sourceLineNo">1133</span>    public void testTanhInf() {<a name="line.1133"></a>
-<span class="sourceLineNo">1134</span>        TestUtils.assertSame(Complex.NaN, oneInf.tanh());<a name="line.1134"></a>
-<span class="sourceLineNo">1135</span>        TestUtils.assertSame(Complex.NaN, oneNegInf.tanh());<a name="line.1135"></a>
-<span class="sourceLineNo">1136</span>        TestUtils.assertSame(Complex.valueOf(1.0, 0.0), infOne.tanh());<a name="line.1136"></a>
-<span class="sourceLineNo">1137</span>        TestUtils.assertSame(Complex.valueOf(-1.0, 0.0), negInfOne.tanh());<a name="line.1137"></a>
-<span class="sourceLineNo">1138</span>        TestUtils.assertSame(Complex.NaN, infInf.tanh());<a name="line.1138"></a>
-<span class="sourceLineNo">1139</span>        TestUtils.assertSame(Complex.NaN, infNegInf.tanh());<a name="line.1139"></a>
-<span class="sourceLineNo">1140</span>        TestUtils.assertSame(Complex.NaN, negInfInf.tanh());<a name="line.1140"></a>
-<span class="sourceLineNo">1141</span>        TestUtils.assertSame(Complex.NaN, negInfNegInf.tanh());<a name="line.1141"></a>
-<span class="sourceLineNo">1142</span>    }<a name="line.1142"></a>
-<span class="sourceLineNo">1143</span><a name="line.1143"></a>
-<span class="sourceLineNo">1144</span>    @Test<a name="line.1144"></a>
-<span class="sourceLineNo">1145</span>    public void testTanhCritical() {<a name="line.1145"></a>
-<span class="sourceLineNo">1146</span>        TestUtils.assertSame(nanInf, new Complex(0, pi/2).tanh());<a name="line.1146"></a>
-<span class="sourceLineNo">1147</span>    }<a name="line.1147"></a>
-<span class="sourceLineNo">1148</span><a name="line.1148"></a>
-<span class="sourceLineNo">1149</span>    /** test issue MATH-221 */<a name="line.1149"></a>
-<span class="sourceLineNo">1150</span>    @Test<a name="line.1150"></a>
-<span class="sourceLineNo">1151</span>    public void testMath221() {<a name="line.1151"></a>
-<span class="sourceLineNo">1152</span>        Assert.assertTrue(Complex.equals(new Complex(0,-1),<a name="line.1152"></a>
-<span class="sourceLineNo">1153</span>                                         new Complex(0,1).multiply(new Complex(-1,0))));<a name="line.1153"></a>
-<span class="sourceLineNo">1154</span>    }<a name="line.1154"></a>
-<span class="sourceLineNo">1155</span><a name="line.1155"></a>
-<span class="sourceLineNo">1156</span>    /**<a name="line.1156"></a>
-<span class="sourceLineNo">1157</span>     * Test: computing &lt;b&gt;third roots&lt;/b&gt; of z.<a name="line.1157"></a>
-<span class="sourceLineNo">1158</span>     * &lt;pre&gt;<a name="line.1158"></a>
-<span class="sourceLineNo">1159</span>     * &lt;code&gt;<a name="line.1159"></a>
-<span class="sourceLineNo">1160</span>     * &lt;b&gt;z = -2 + 2 * i&lt;/b&gt;<a name="line.1160"></a>
-<span class="sourceLineNo">1161</span>     *   =&gt; z_0 =  1      +          i<a name="line.1161"></a>
-<span class="sourceLineNo">1162</span>     *   =&gt; z_1 = -1.3660 + 0.3660 * i<a name="line.1162"></a>
-<span class="sourceLineNo">1163</span>     *   =&gt; z_2 =  0.3660 - 1.3660 * i<a name="line.1163"></a>
-<span class="sourceLineNo">1164</span>     * &lt;/code&gt;<a name="line.1164"></a>
-<span class="sourceLineNo">1165</span>     * &lt;/pre&gt;<a name="line.1165"></a>
-<span class="sourceLineNo">1166</span>     */<a name="line.1166"></a>
-<span class="sourceLineNo">1167</span>    @Test<a name="line.1167"></a>
-<span class="sourceLineNo">1168</span>    public void testNthRoot_normal_thirdRoot() {<a name="line.1168"></a>
-<span class="sourceLineNo">1169</span>        // The complex number we want to compute all third-roots for.<a name="line.1169"></a>
-<span class="sourceLineNo">1170</span>        Complex z = new Complex(-2,2);<a name="line.1170"></a>
-<span class="sourceLineNo">1171</span>        // The List holding all third roots<a name="line.1171"></a>
-<span class="sourceLineNo">1172</span>        Complex[] thirdRootsOfZ = z.nthRoot(3).toArray(new Complex[0]);<a name="line.1172"></a>
-<span class="sourceLineNo">1173</span>        // Returned Collection must not be empty!<a name="line.1173"></a>
-<span class="sourceLineNo">1174</span>        Assert.assertEquals(3, thirdRootsOfZ.length);<a name="line.1174"></a>
-<span class="sourceLineNo">1175</span>        // test z_0<a name="line.1175"></a>
-<span class="sourceLineNo">1176</span>        Assert.assertEquals(1.0,                  thirdRootsOfZ[0].getReal(),      1.0e-5);<a name="line.1176"></a>
-<span class="sourceLineNo">1177</span>        Assert.assertEquals(1.0,                  thirdRootsOfZ[0].getImaginary(), 1.0e-5);<a name="line.1177"></a>
-<span class="sourceLineNo">1178</span>        // test z_1<a name="line.1178"></a>
-<span class="sourceLineNo">1179</span>        Assert.assertEquals(-1.3660254037844386,  thirdRootsOfZ[1].getReal(),      1.0e-5);<a name="line.1179"></a>
-<span class="sourceLineNo">1180</span>        Assert.assertEquals(0.36602540378443843,  thirdRootsOfZ[1].getImaginary(), 1.0e-5);<a name="line.1180"></a>
-<span class="sourceLineNo">1181</span>        // test z_2<a name="line.1181"></a>
-<span class="sourceLineNo">1182</span>        Assert.assertEquals(0.366025403784439,    thirdRootsOfZ[2].getReal(),      1.0e-5);<a name="line.1182"></a>
-<span class="sourceLineNo">1183</span>        Assert.assertEquals(-1.3660254037844384,  thirdRootsOfZ[2].getImaginary(), 1.0e-5);<a name="line.1183"></a>
-<span class="sourceLineNo">1184</span>    }<a name="line.1184"></a>
-<span class="sourceLineNo">1185</span><a name="line.1185"></a>
-<span class="sourceLineNo">1186</span><a name="line.1186"></a>
-<span class="sourceLineNo">1187</span>    /**<a name="line.1187"></a>
-<span class="sourceLineNo">1188</span>     * Test: computing &lt;b&gt;fourth roots&lt;/b&gt; of z.<a name="line.1188"></a>
-<span class="sourceLineNo">1189</span>     * &lt;pre&gt;<a name="line.1189"></a>
-<span class="sourceLineNo">1190</span>     * &lt;code&gt;<a name="line.1190"></a>
-<span class="sourceLineNo">1191</span>     * &lt;b&gt;z = 5 - 2 * i&lt;/b&gt;<a name="line.1191"></a>
-<span class="sourceLineNo">1192</span>     *   =&gt; z_0 =  1.5164 - 0.1446 * i<a name="line.1192"></a>
-<span class="sourceLineNo">1193</span>     *   =&gt; z_1 =  0.1446 + 1.5164 * i<a name="line.1193"></a>
-<span class="sourceLineNo">1194</span>     *   =&gt; z_2 = -1.5164 + 0.1446 * i<a name="line.1194"></a>
-<span class="sourceLineNo">1195</span>     *   =&gt; z_3 = -1.5164 - 0.1446 * i<a name="line.1195"></a>
-<span class="sourceLineNo">1196</span>     * &lt;/code&gt;<a name="line.1196"></a>
-<span class="sourceLineNo">1197</span>     * &lt;/pre&gt;<a name="line.1197"></a>
-<span class="sourceLineNo">1198</span>     */<a name="line.1198"></a>
-<span class="sourceLineNo">1199</span>    @Test<a name="line.1199"></a>
-<span class="sourceLineNo">1200</span>    public void testNthRoot_normal_fourthRoot() {<a name="line.1200"></a>
-<span class="sourceLineNo">1201</span>        // The complex number we want to compute all third-roots for.<a name="line.1201"></a>
-<span class="sourceLineNo">1202</span>        Complex z = new Complex(5,-2);<a name="line.1202"></a>
-<span class="sourceLineNo">1203</span>        // The List holding all fourth roots<a name="line.1203"></a>
-<span class="sourceLineNo">1204</span>        Complex[] fourthRootsOfZ = z.nthRoot(4).toArray(new Complex[0]);<a name="line.1204"></a>
-<span class="sourceLineNo">1205</span>        // Returned Collection must not be empty!<a name="line.1205"></a>
-<span class="sourceLineNo">1206</span>        Assert.assertEquals(4, fourthRootsOfZ.length);<a name="line.1206"></a>
-<span class="sourceLineNo">1207</span>        // test z_0<a name="line.1207"></a>
-<span class="sourceLineNo">1208</span>        Assert.assertEquals(1.5164629308487783,     fourthRootsOfZ[0].getReal(),      1.0e-5);<a name="line.1208"></a>
-<span class="sourceLineNo">1209</span>        Assert.assertEquals(-0.14469266210702247,   fourthRootsOfZ[0].getImaginary(), 1.0e-5);<a name="line.1209"></a>
-<span class="sourceLineNo">1210</span>        // test z_1<a name="line.1210"></a>
-<span class="sourceLineNo">1211</span>        Assert.assertEquals(0.14469266210702256,    fourthRootsOfZ[1].getReal(),      1.0e-5);<a name="line.1211"></a>
-<span class="sourceLineNo">1212</span>        Assert.assertEquals(1.5164629308487783,     fourthRootsOfZ[1].getImaginary(), 1.0e-5);<a name="line.1212"></a>
-<span class="sourceLineNo">1213</span>        // test z_2<a name="line.1213"></a>
-<span class="sourceLineNo">1214</span>        Assert.assertEquals(-1.5164629308487783,    fourthRootsOfZ[2].getReal(),      1.0e-5);<a name="line.1214"></a>
-<span class="sourceLineNo">1215</span>        Assert.assertEquals(0.14469266210702267,    fourthRootsOfZ[2].getImaginary(), 1.0e-5);<a name="line.1215"></a>
-<span class="sourceLineNo">1216</span>        // test z_3<a name="line.1216"></a>
-<span class="sourceLineNo">1217</span>        Assert.assertEquals(-0.14469266210702275,   fourthRootsOfZ[3].getReal(),      1.0e-5);<a name="line.1217"></a>
-<span class="sourceLineNo">1218</span>        Assert.assertEquals(-1.5164629308487783,    fourthRootsOfZ[3].getImaginary(), 1.0e-5);<a name="line.1218"></a>
-<span class="sourceLineNo">1219</span>    }<a name="line.1219"></a>
-<span class="sourceLineNo">1220</span><a name="line.1220"></a>
-<span class="sourceLineNo">1221</span>    /**<a name="line.1221"></a>
-<span class="sourceLineNo">1222</span>     * Test: computing &lt;b&gt;third roots&lt;/b&gt; of z.<a name="line.1222"></a>
-<span class="sourceLineNo">1223</span>     * &lt;pre&gt;<a name="line.1223"></a>
-<span class="sourceLineNo">1224</span>     * &lt;code&gt;<a name="line.1224"></a>
-<span class="sourceLineNo">1225</span>     * &lt;b&gt;z = 8&lt;/b&gt;<a name="line.1225"></a>
-<span class="sourceLineNo">1226</span>     *   =&gt; z_0 =  2<a name="line.1226"></a>
-<span class="sourceLineNo">1227</span>     *   =&gt; z_1 = -1 + 1.73205 * i<a name="line.1227"></a>
-<span class="sourceLineNo">1228</span>     *   =&gt; z_2 = -1 - 1.73205 * i<a name="line.1228"></a>
-<span class="sourceLineNo">1229</span>     * &lt;/code&gt;<a name="line.1229"></a>
-<span class="sourceLineNo">1230</span>     * &lt;/pre&gt;<a name="line.1230"></a>
-<span class="sourceLineNo">1231</span>     */<a name="line.1231"></a>
-<span class="sourceLineNo">1232</span>    @Test<a name="line.1232"></a>
-<span class="sourceLineNo">1233</span>    public void testNthRoot_cornercase_thirdRoot_imaginaryPartEmpty() {<a name="line.1233"></a>
-<span class="sourceLineNo">1234</span>        // The number 8 has three third roots. One we all already know is the number 2.<a name="line.1234"></a>
-<span class="sourceLineNo">1235</span>        // But there are two more complex roots.<a name="line.1235"></a>
-<span class="sourceLineNo">1236</span>        Complex z = new Complex(8,0);<a name="line.1236"></a>
-<span class="sourceLineNo">1237</span>        // The List holding all third roots<a name="line.1237"></a>
-<span class="sourceLineNo">1238</span>        Complex[] thirdRootsOfZ = z.nthRoot(3).toArray(new Complex[0]);<a name="line.1238"></a>
-<span class="sourceLineNo">1239</span>        // Returned Collection must not be empty!<a name="line.1239"></a>
-<span class="sourceLineNo">1240</span>        Assert.assertEquals(3, thirdRootsOfZ.length);<a name="line.1240"></a>
-<span class="sourceLineNo">1241</span>        // test z_0<a name="line.1241"></a>
-<span class="sourceLineNo">1242</span>        Assert.assertEquals(2.0,                thirdRootsOfZ[0].getReal(),      1.0e-5);<a name="line.1242"></a>
-<span class="sourceLineNo">1243</span>        Assert.assertEquals(0.0,                thirdRootsOfZ[0].getImaginary(), 1.0e-5);<a name="line.1243"></a>
-<span class="sourceLineNo">1244</span>        // test z_1<a name="line.1244"></a>
-<span class="sourceLineNo">1245</span>        Assert.assertEquals(-1.0,               thirdRootsOfZ[1].getReal(),      1.0e-5);<a name="line.1245"></a>
-<span class="sourceLineNo">1246</span>        Assert.assertEquals(1.7320508075688774, thirdRootsOfZ[1].getImaginary(), 1.0e-5);<a name="line.1246"></a>
-<span class="sourceLineNo">1247</span>        // test z_2<a name="line.1247"></a>
-<span class="sourceLineNo">1248</span>        Assert.assertEquals(-1.0,               thirdRootsOfZ[2].getReal(),      1.0e-5);<a name="line.1248"></a>
-<span class="sourceLineNo">1249</span>        Assert.assertEquals(-1.732050807568877, thirdRootsOfZ[2].getImaginary(), 1.0e-5);<a name="line.1249"></a>
-<span class="sourceLineNo">1250</span>    }<a name="line.1250"></a>
-<span class="sourceLineNo">1251</span><a name="line.1251"></a>
-<span class="sourceLineNo">1252</span><a name="line.1252"></a>
-<span class="sourceLineNo">1253</span>    /**<a name="line.1253"></a>
-<span class="sourceLineNo">1254</span>     * Test: computing &lt;b&gt;third roots&lt;/b&gt; of z with real part 0.<a name="line.1254"></a>
-<span class="sourceLineNo">1255</span>     * &lt;pre&gt;<a name="line.1255"></a>
-<span class="sourceLineNo">1256</span>     * &lt;code&gt;<a name="line.1256"></a>
-<span class="sourceLineNo">1257</span>     * &lt;b&gt;z = 2 * i&lt;/b&gt;<a name="line.1257"></a>
-<span class="sourceLineNo">1258</span>     *   =&gt; z_0 =  1.0911 + 0.6299 * i<a name="line.1258"></a>
-<span class="sourceLineNo">1259</span>     *   =&gt; z_1 = -1.0911 + 0.6299 * i<a name="line.1259"></a>
-<span class="sourceLineNo">1260</span>     *   =&gt; z_2 = -2.3144 - 1.2599 * i<a name="line.1260"></a>
-<span class="sourceLineNo">1261</span>     * &lt;/code&gt;<a name="line.1261"></a>
-<span class="sourceLineNo">1262</span>     * &lt;/pre&gt;<a name="line.1262"></a>
-<span class="sourceLineNo">1263</span>     */<a name="line.1263"></a>
-<span class="sourceLineNo">1264</span>    @Test<a name="line.1264"></a>
-<span class="sourceLineNo">1265</span>    public void testNthRoot_cornercase_thirdRoot_realPartZero() {<a name="line.1265"></a>
-<span class="sourceLineNo">1266</span>        // complex number with only imaginary part<a name="line.1266"></a>
-<span class="sourceLineNo">1267</span>        Complex z = new Complex(0,2);<a name="line.1267"></a>
-<span class="sourceLineNo">1268</span>        // The List holding all third roots<a name="line.1268"></a>
-<span class="sourceLineNo">1269</span>        Complex[] thirdRootsOfZ = z.nthRoot(3).toArray(new Complex[0]);<a name="line.1269"></a>
-<span class="sourceLineNo">1270</span>        // Returned Collection must not be empty!<a name="line.1270"></a>
-<span class="sourceLineNo">1271</span>        Assert.assertEquals(3, thirdRootsOfZ.length);<a name="line.1271"></a>
-<span class="sourceLineNo">1272</span>        // test z_0<a name="line.1272"></a>
-<span class="sourceLineNo">1273</span>        Assert.assertEquals(1.0911236359717216,      thirdRootsOfZ[0].getReal(),      1.0e-5);<a name="line.1273"></a>
-<span class="sourceLineNo">1274</span>        Assert.assertEquals(0.6299605249474365,      thirdRootsOfZ[0].getImaginary(), 1.0e-5);<a name="line.1274"></a>
-<span class="sourceLineNo">1275</span>        // test z_1<a name="line.1275"></a>
-<span class="sourceLineNo">1276</span>        Assert.assertEquals(-1.0911236359717216,     thirdRootsOfZ[1].getReal(),      1.0e-5);<a name="line.1276"></a>
-<span class="sourceLineNo">1277</span>        Assert.assertEquals(0.6299605249474365,      thirdRootsOfZ[1].getImaginary(), 1.0e-5);<a name="line.1277"></a>
-<span class="sourceLineNo">1278</span>        // test z_2<a name="line.1278"></a>
-<span class="sourceLineNo">1279</span>        Assert.assertEquals(-2.3144374213981936E-16, thirdRootsOfZ[2].getReal(),      1.0e-5);<a name="line.1279"></a>
-<span class="sourceLineNo">1280</span>        Assert.assertEquals(-1.2599210498948732,     thirdRootsOfZ[2].getImaginary(), 1.0e-5);<a name="line.1280"></a>
-<span class="sourceLineNo">1281</span>    }<a name="line.1281"></a>
-<span class="sourceLineNo">1282</span><a name="line.1282"></a>
-<span class="sourceLineNo">1283</span>    /**<a name="line.1283"></a>
-<span class="sourceLineNo">1284</span>     * Test cornercases with NaN and Infinity.<a name="line.1284"></a>
-<span class="sourceLineNo">1285</span>     */<a name="line.1285"></a>
-<span class="sourceLineNo">1286</span>    @Test<a name="line.1286"></a>
-<span class="sourceLineNo">1287</span>    public void testNthRoot_cornercase_NAN_Inf() {<a name="line.1287"></a>
-<span class="sourceLineNo">1288</span>        // NaN + finite -&gt; NaN<a name="line.1288"></a>
-<span class="sourceLineNo">1289</span>        List&lt;Complex&gt; roots = oneNaN.nthRoot(3);<a name="line.1289"></a>
-<span class="sourceLineNo">1290</span>        Assert.assertEquals(1,roots.size());<a name="line.1290"></a>
-<span class="sourceLineNo">1291</span>        Assert.assertEquals(Complex.NaN, roots.get(0));<a name="line.1291"></a>
-<span class="sourceLineNo">1292</span><a name="line.1292"></a>
-<span class="sourceLineNo">1293</span>        roots = nanZero.nthRoot(3);<a name="line.1293"></a>
-<span class="sourceLineNo">1294</span>        Assert.assertEquals(1,roots.size());<a name="line.1294"></a>
-<span class="sourceLineNo">1295</span>        Assert.assertEquals(Complex.NaN, roots.get(0));<a name="line.1295"></a>
-<span class="sourceLineNo">1296</span><a name="line.1296"></a>
-<span class="sourceLineNo">1297</span>        // NaN + infinite -&gt; NaN<a name="line.1297"></a>
-<span class="sourceLineNo">1298</span>        roots = nanInf.nthRoot(3);<a name="line.1298"></a>
-<span class="sourceLineNo">1299</span>        Assert.assertEquals(1,roots.size());<a name="line.1299"></a>
-<span class="sourceLineNo">1300</span>        Assert.assertEquals(Complex.NaN, roots.get(0));<a name="line.1300"></a>
-<span class="sourceLineNo">1301</span><a name="line.1301"></a>
-<span class="sourceLineNo">1302</span>        // finite + infinite -&gt; Inf<a name="line.1302"></a>
-<span class="sourceLineNo">1303</span>        roots = oneInf.nthRoot(3);<a name="line.1303"></a>
-<span class="sourceLineNo">1304</span>        Assert.assertEquals(1,roots.size());<a name="line.1304"></a>
-<span class="sourceLineNo">1305</span>        Assert.assertEquals(Complex.INF, roots.get(0));<a name="line.1305"></a>
-<span class="sourceLineNo">1306</span><a name="line.1306"></a>
-<span class="sourceLineNo">1307</span>        // infinite + infinite -&gt; Inf<a name="line.1307"></a>
-<span class="sourceLineNo">1308</span>        roots = negInfInf.nthRoot(3);<a name="line.1308"></a>
-<span class="sourceLineNo">1309</span>        Assert.assertEquals(1,roots.size());<a name="line.1309"></a>
-<span class="sourceLineNo">1310</span>        Assert.assertEquals(Complex.INF, roots.get(0));<a name="line.1310"></a>
-<span class="sourceLineNo">1311</span>    }<a name="line.1311"></a>
-<span class="sourceLineNo">1312</span><a name="line.1312"></a>
-<span class="sourceLineNo">1313</span>    /**<a name="line.1313"></a>
-<span class="sourceLineNo">1314</span>     * Test standard values<a name="line.1314"></a>
-<span class="sourceLineNo">1315</span>     */<a name="line.1315"></a>
-<span class="sourceLineNo">1316</span>    @Test<a name="line.1316"></a>
-<span class="sourceLineNo">1317</span>    public void testGetArgument() {<a name="line.1317"></a>
-<span class="sourceLineNo">1318</span>        Complex z = new Complex(1, 0);<a name="line.1318"></a>
-<span class="sourceLineNo">1319</span>        Assert.assertEquals(0.0, z.getArgument(), 1.0e-12);<a name="line.1319"></a>
+<span class="sourceLineNo">1026</span>    public void testSinInf() {<a name="line.1026"></a>
+<span class="sourceLineNo">1027</span>        TestUtils.assertSame(infInf, oneInf.sin());<a name="line.1027"></a>
+<span class="sourceLineNo">1028</span>        TestUtils.assertSame(infNegInf, oneNegInf.sin());<a name="line.1028"></a>
+<span class="sourceLineNo">1029</span>        TestUtils.assertSame(Complex.NaN, infOne.sin());<a name="line.1029"></a>
+<span class="sourceLineNo">1030</span>        TestUtils.assertSame(Complex.NaN, negInfOne.sin());<a name="line.1030"></a>
+<span class="sourceLineNo">1031</span>        TestUtils.assertSame(Complex.NaN, infInf.sin());<a name="line.1031"></a>
+<span class="sourceLineNo">1032</span>        TestUtils.assertSame(Complex.NaN, infNegInf.sin());<a name="line.1032"></a>
+<span class="sourceLineNo">1033</span>        TestUtils.assertSame(Complex.NaN, negInfInf.sin());<a name="line.1033"></a>
+<span class="sourceLineNo">1034</span>        TestUtils.assertSame(Complex.NaN, negInfNegInf.sin());<a name="line.1034"></a>
+<span class="sourceLineNo">1035</span>    }<a name="line.1035"></a>
+<span class="sourceLineNo">1036</span><a name="line.1036"></a>
+<span class="sourceLineNo">1037</span>    @Test<a name="line.1037"></a>
+<span class="sourceLineNo">1038</span>    public void testSinNaN() {<a name="line.1038"></a>
+<span class="sourceLineNo">1039</span>        Assert.assertTrue(Complex.NaN.sin().isNaN());<a name="line.1039"></a>
+<span class="sourceLineNo">1040</span>    }<a name="line.1040"></a>
+<span class="sourceLineNo">1041</span><a name="line.1041"></a>
+<span class="sourceLineNo">1042</span>    @Test<a name="line.1042"></a>
+<span class="sourceLineNo">1043</span>    public void testSinh() {<a name="line.1043"></a>
+<span class="sourceLineNo">1044</span>        Complex z = new Complex(3, 4);<a name="line.1044"></a>
+<span class="sourceLineNo">1045</span>        Complex expected = new Complex(-6.54812, -7.61923);<a name="line.1045"></a>
+<span class="sourceLineNo">1046</span>        TestUtils.assertEquals(expected, z.sinh(), 1.0e-5);<a name="line.1046"></a>
+<span class="sourceLineNo">1047</span>    }<a name="line.1047"></a>
+<span class="sourceLineNo">1048</span><a name="line.1048"></a>
+<span class="sourceLineNo">1049</span>    @Test<a name="line.1049"></a>
+<span class="sourceLineNo">1050</span>    public void testSinhNaN() {<a name="line.1050"></a>
+<span class="sourceLineNo">1051</span>        Assert.assertTrue(Complex.NaN.sinh().isNaN());<a name="line.1051"></a>
+<span class="sourceLineNo">1052</span>    }<a name="line.1052"></a>
+<span class="sourceLineNo">1053</span><a name="line.1053"></a>
+<span class="sourceLineNo">1054</span>    @Test<a name="line.1054"></a>
+<span class="sourceLineNo">1055</span>    public void testSinhInf() {<a name="line.1055"></a>
+<span class="sourceLineNo">1056</span>        TestUtils.assertSame(Complex.NaN, oneInf.sinh());<a name="line.1056"></a>
+<span class="sourceLineNo">1057</span>        TestUtils.assertSame(Complex.NaN, oneNegInf.sinh());<a name="line.1057"></a>
+<span class="sourceLineNo">1058</span>        TestUtils.assertSame(infInf, infOne.sinh());<a name="line.1058"></a>
+<span class="sourceLineNo">1059</span>        TestUtils.assertSame(negInfInf, negInfOne.sinh());<a name="line.1059"></a>
+<span class="sourceLineNo">1060</span>        TestUtils.assertSame(Complex.NaN, infInf.sinh());<a name="line.1060"></a>
+<span class="sourceLineNo">1061</span>        TestUtils.assertSame(Complex.NaN, infNegInf.sinh());<a name="line.1061"></a>
+<span class="sourceLineNo">1062</span>        TestUtils.assertSame(Complex.NaN, negInfInf.sinh());<a name="line.1062"></a>
+<span class="sourceLineNo">1063</span>        TestUtils.assertSame(Complex.NaN, negInfNegInf.sinh());<a name="line.1063"></a>
+<span class="sourceLineNo">1064</span>    }<a name="line.1064"></a>
+<span class="sourceLineNo">1065</span><a name="line.1065"></a>
+<span class="sourceLineNo">1066</span>    @Test<a name="line.1066"></a>
+<span class="sourceLineNo">1067</span>    public void testSqrtRealPositive() {<a name="line.1067"></a>
+<span class="sourceLineNo">1068</span>        Complex z = new Complex(3, 4);<a name="line.1068"></a>
+<span class="sourceLineNo">1069</span>        Complex expected = new Complex(2, 1);<a name="line.1069"></a>
+<span class="sourceLineNo">1070</span>        TestUtils.assertEquals(expected, z.sqrt(), 1.0e-5);<a name="line.1070"></a>
+<span class="sourceLineNo">1071</span>    }<a name="line.1071"></a>
+<span class="sourceLineNo">1072</span><a name="line.1072"></a>
+<span class="sourceLineNo">1073</span>    @Test<a name="line.1073"></a>
+<span class="sourceLineNo">1074</span>    public void testSqrtRealZero() {<a name="line.1074"></a>
+<span class="sourceLineNo">1075</span>        Complex z = new Complex(0.0, 4);<a name="line.1075"></a>
+<span class="sourceLineNo">1076</span>        Complex expected = new Complex(1.41421, 1.41421);<a name="line.1076"></a>
+<span class="sourceLineNo">1077</span>        TestUtils.assertEquals(expected, z.sqrt(), 1.0e-5);<a name="line.1077"></a>
+<span class="sourceLineNo">1078</span>    }<a name="line.1078"></a>
+<span class="sourceLineNo">1079</span><a name="line.1079"></a>
+<span class="sourceLineNo">1080</span>    @Test<a name="line.1080"></a>
+<span class="sourceLineNo">1081</span>    public void testSqrtRealNegative() {<a name="line.1081"></a>
+<span class="sourceLineNo">1082</span>        Complex z = new Complex(-3.0, 4);<a name="line.1082"></a>
+<span class="sourceLineNo">1083</span>        Complex expected = new Complex(1, 2);<a name="line.1083"></a>
+<span class="sourceLineNo">1084</span>        TestUtils.assertEquals(expected, z.sqrt(), 1.0e-5);<a name="line.1084"></a>
+<span class="sourceLineNo">1085</span>    }<a name="line.1085"></a>
+<span class="sourceLineNo">1086</span><a name="line.1086"></a>
+<span class="sourceLineNo">1087</span>    @Test<a name="line.1087"></a>
+<span class="sourceLineNo">1088</span>    public void testSqrtImaginaryZero() {<a name="line.1088"></a>
+<span class="sourceLineNo">1089</span>        Complex z = new Complex(-3.0, 0.0);<a name="line.1089"></a>
+<span class="sourceLineNo">1090</span>        Complex expected = new Complex(0.0, 1.73205);<a name="line.1090"></a>
+<span class="sourceLineNo">1091</span>        TestUtils.assertEquals(expected, z.sqrt(), 1.0e-5);<a name="line.1091"></a>
+<span class="sourceLineNo">1092</span>    }<a name="line.1092"></a>
+<span class="sourceLineNo">1093</span><a name="line.1093"></a>
+<span class="sourceLineNo">1094</span>    @Test<a name="line.1094"></a>
+<span class="sourceLineNo">1095</span>    public void testSqrtImaginaryNegative() {<a name="line.1095"></a>
+<span class="sourceLineNo">1096</span>        Complex z = new Complex(-3.0, -4.0);<a name="line.1096"></a>
+<span class="sourceLineNo">1097</span>        Complex expected = new Complex(1.0, -2.0);<a name="line.1097"></a>
+<span class="sourceLineNo">1098</span>        TestUtils.assertEquals(expected, z.sqrt(), 1.0e-5);<a name="line.1098"></a>
+<span class="sourceLineNo">1099</span>    }<a name="line.1099"></a>
+<span class="sourceLineNo">1100</span><a name="line.1100"></a>
+<span class="sourceLineNo">1101</span>    @Test<a name="line.1101"></a>
+<span class="sourceLineNo">1102</span>    public void testSqrtPolar() {<a name="line.1102"></a>
+<span class="sourceLineNo">1103</span>        double r = 1;<a name="line.1103"></a>
+<span class="sourceLineNo">1104</span>        for (int i = 0; i &lt; 5; i++) {<a name="line.1104"></a>
+<span class="sourceLineNo">1105</span>            r += i;<a name="line.1105"></a>
+<span class="sourceLineNo">1106</span>            double theta = 0;<a name="line.1106"></a>
+<span class="sourceLineNo">1107</span>            for (int j =0; j &lt; 11; j++) {<a name="line.1107"></a>
+<span class="sourceLineNo">1108</span>                theta += pi /12;<a name="line.1108"></a>
+<span class="sourceLineNo">1109</span>                Complex z = ComplexUtils.polar2Complex(r, theta);<a name="line.1109"></a>
+<span class="sourceLineNo">1110</span>                Complex sqrtz = ComplexUtils.polar2Complex(FastMath.sqrt(r), theta / 2);<a name="line.1110"></a>
+<span class="sourceLineNo">1111</span>                TestUtils.assertEquals(sqrtz, z.sqrt(), 10e-12);<a name="line.1111"></a>
+<span class="sourceLineNo">1112</span>            }<a name="line.1112"></a>
+<span class="sourceLineNo">1113</span>        }<a name="line.1113"></a>
+<span class="sourceLineNo">1114</span>    }<a name="line.1114"></a>
+<span class="sourceLineNo">1115</span><a name="line.1115"></a>
+<span class="sourceLineNo">1116</span>    @Test<a name="line.1116"></a>
+<span class="sourceLineNo">1117</span>    public void testSqrtNaN() {<a name="line.1117"></a>
+<span class="sourceLineNo">1118</span>        Assert.assertTrue(Complex.NaN.sqrt().isNaN());<a name="line.1118"></a>
+<span class="sourceLineNo">1119</span>    }<a name="line.1119"></a>
+<span class="sourceLineNo">1120</span><a name="line.1120"></a>
+<span class="sourceLineNo">1121</span>    @Test<a name="line.1121"></a>
+<span class="sourceLineNo">1122</span>    public void testSqrtInf() {<a name="line.1122"></a>
+<span class="sourceLineNo">1123</span>        TestUtils.assertSame(infNaN, oneInf.sqrt());<a name="line.1123"></a>
+<span class="sourceLineNo">1124</span>        TestUtils.assertSame(infNaN, oneNegInf.sqrt());<a name="line.1124"></a>
+<span class="sourceLineNo">1125</span>        TestUtils.assertSame(infZero, infOne.sqrt());<a name="line.1125"></a>

[... 453 lines stripped ...]


Mime
View raw message