if x contains negative elements, then acosh must return positive values. test_run... 07/18107/8
Adeline CARNIS [Fri, 22 Apr 2016 13:54:47 +0000 (15:54 +0200)]
Change-Id: I707c6777b6face5a8167a29d910f22acb48754ca

scilab/modules/elementary_functions/help/en_US/trigonometry/acosh.xml
scilab/modules/elementary_functions/help/fr_FR/trigonometry/acosh.xml
scilab/modules/elementary_functions/help/ja_JP/trigonometry/acosh.xml [deleted file]
scilab/modules/elementary_functions/help/pt_BR/trigonometry/acosh.xml [deleted file]
scilab/modules/elementary_functions/help/ru_RU/trigonometry/acosh.xml [deleted file]
scilab/modules/elementary_functions/sci_gateway/cpp/sci_acosh.cpp
scilab/modules/helptools/etc/images_md5.txt
scilab/modules/helptools/images/acosh_1.png

index 37ca061..e6068e7 100644 (file)
@@ -2,7 +2,7 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA
- *
+ * Copyright (C) 2016 - Samuel GOUGEON
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>[t] = acosh(x)</synopsis>
+        <synopsis>t = acosh(x)</synopsis>
     </refsynopsisdiv>
-    <refsection>
+    <refsection role="parameters">
         <title>Arguments</title>
         <variablelist>
             <varlistentry>
-                <term>x</term>
-                <listitem>
-                    <para>a real or complex vector or matrix.</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>t</term>
+                <term>x, t</term>
                 <listitem>
-                    <para>a real or complex vector or matrix.</para>
+                    <para>each is a real or complex vector or matrix.
+                        <literal>t</literal> has the sizes of <literal>x</literal>.
+                    </para>
                 </listitem>
             </varlistentry>
         </variablelist>
     </refsection>
-    <refsection>
+    <refsection role="description">
         <title>Description</title>
         <para>
-            The components of <varname>t</varname> are the inverse hyperbolic
-            cosine of the corresponding entries of <varname>x</varname>.
-            Definition domain is <latex>]1,+\infty)</latex>].
+            <function>acosh(x)</function> returns <varname>t</varname> such that
+            <literal>cosh(t)==x</literal> and <literal>real(t)>=0</literal>.
+            <literal>-t</literal> are always other possible answers.
+        </para>
+        <para>For real input numbers <literal>-1 &lt; x &lt; 1</literal>,
+           <literal>real(t)==0</literal> and <literal>imag(t)</literal>
+           belongs to <literal>]0, %pi[</literal>.
+        </para>
+        <para>For complex numbers <literal>x</literal>,
+            <literal>imag(t)</literal> belongs to <literal>[-pi, pi]</literal>
+            and any <literal>t + k*%pi*%i</literal> with integer k are other
+            possible answers.
         </para>
     </refsection>
     <refsection>
         <title>Sample</title>
-        <scilab:image>
-            x=-360:1:360
-            plot(x,acosh(x))
-        </scilab:image>
+        <scilab:image><![CDATA[
+            subplot(2,2,1)
+            x = -20:0.2:-1;
+            t = acosh(x);
+            plot(x, real(acosh(x)))
+            xtitle("acosh(x) = a + pi.i", "x <= -1", "a > 0")
+            xstring(-18, 0.5, "-a + pi.i other solution")
+
+            subplot(2,1,2)
+            x = -1:0.01:1;
+            plot(x, imag(acosh(x)))
+            title("acosh(x) = b.i  is pure imaginary")
+            xlabel("-1 < x < 1")
+            ylabel("0 < b < pi")
+
+            subplot(2,2,2)
+            x = 1:0.2:20;
+            plot(x, acosh(x))
+            xlabel("x >= 1")
+            ylabel("acosh(x)")
+        ]]></scilab:image>
     </refsection>
-    <refsection>
+    <refsection role="examples">
         <title>Examples</title>
         <programlisting role="example"><![CDATA[
-x=[0,1,%i];
-cosh(acosh(x))
+x = [ -2 -1.001 -1 -0.999 -0.5  0
+       2  1.001  1  0.999  0.5  0]'
+t = acosh(x)
+cosh(t) - x
+cosh(-t) - x
+
+// With complex numbers:
+acosh([-0.01*%i  0.01*%i
+       -0.1*%i   0.1*%i
+       -%i       %i
+       -10*%i    10*%i
+       -1 - %i,  1 + %i
+       -2 - 2*%i, 2 + 2*%i
+       ])
  ]]></programlisting>
     </refsection>
+    <refsection role="see also">
+        <title>See also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="cosh">cosh</link>
+            </member>
+            <member>
+                <link linkend="sinh">sinh</link>
+            </member>
+            <member>
+                <link linkend="tanh">tanh</link>
+            </member>
+        </simplelist>
+    </refsection>
 </refentry>
index e1f17b6..9b04ac7 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="acosh" xml:lang="fr">
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ * Copyright (C) 2016 - Samuel GOUGEON
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+    xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+    xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+    xmlns:scilab="http://www.scilab.org"  xml:id="acosh" xml:lang="fr">
     <refnamediv>
         <refname>acosh</refname>
         <refpurpose>cosinus hyperbolique inverse</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
-        <title>Séquence d'appel</title>
-        <synopsis>[t]=acosh(x)</synopsis>
+        <title>Syntaxe</title>
+        <synopsis>t = acosh(x)</synopsis>
     </refsynopsisdiv>
-    <refsection>
-        <title>Paramètres</title>
+    <refsection role="parameters">
+        <title>Arguments</title>
         <variablelist>
             <varlistentry>
-                <term>x</term>
-                <listitem>
-                    <para>vecteur ou matrice (réelle ou complexe).</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>t</term>
+                <term>x, t</term>
                 <listitem>
-                    <para>vecteur ou matrice (réelle ou complexe).</para>
+                    <para>
+                        Eléments ou tableaux de nombres réels ou complexes.
+                        <literal>t</literal> a la taille de <literal>x</literal>.
+                    </para>
                 </listitem>
             </varlistentry>
         </variablelist>
     </refsection>
-    <refsection>
+    <refsection role="description">
         <title>Description</title>
         <para>
-            Les composantes de <literal>t</literal> sont les cosinus
-            hyperboliques inverses des composantes correspondantes de
-            <literal>x</literal>. Le domaine de définition est ]1,+infini[.
+            <function>acosh(x)</function> produit le résultat <varname>t</varname>
+            tel que
+            <literal>cosh(t)==x</literal> et par convention <literal>real(t)>=0</literal>.
+            <literal>cosh()</literal> étant une fonction symétrique, la ou les
+            valeurs <literal>-t</literal> sont toujours d'autres valeurs possibles.
+        </para>
+        <para>Pour des valeurs d'entrée réelles <literal>-1 &lt; x &lt; 1</literal>,
+           <literal>real(t)==0</literal> et <literal>imag(t)</literal>
+           est sur l'intervalle <literal>]0, %pi[</literal>.
+        </para>
+        <para>
+            Pour des valeurs d'entrée <literal>x</literal> complexes,
+            <literal>imag(t)</literal> est sur l'intervalle <literal>[-pi, pi]</literal>
+            et toute valeur <literal>t + k*%pi*%i</literal> avec k entier relatif
+            est une autre réponse possible.
         </para>
     </refsection>
     <refsection>
+        <title>Graphes</title>
+        <scilab:image><![CDATA[
+            subplot(2,2,1)
+            x = -20:0.2:-1;
+            t = acosh(x);
+            plot(x, real(acosh(x)))
+            xtitle("acosh(x) = a + pi.i", "x <= -1", "a > 0")
+            xstring(-18, 0.5, "-a + pi.i other solution")
+
+            subplot(2,1,2)
+            x = -1:0.01:1;
+            plot(x, imag(acosh(x)))
+            title("acosh(x) = b.i  is pure imaginary")
+            xlabel("-1 < x < 1")
+            ylabel("0 < b < pi")
+
+            subplot(2,2,2)
+            x = 1:0.2:20;
+            plot(x, acosh(x))
+            xlabel("x >= 1")
+            ylabel("acosh(x)")
+        ]]></scilab:image>
+    </refsection>
+    <refsection role="examples">
         <title>Exemples</title>
         <programlisting role="example"><![CDATA[
-x=[0,1,%i];
-cosh(acosh(x))
+x = [ -2 -1.001 -1 -0.999 -0.5  0
+       2  1.001  1  0.999  0.5  0]'
+t = acosh(x)
+cosh(t) - x
+cosh(-t) - x
+
+// Avec des nombres complexes :
+acosh([-0.01*%i  0.01*%i
+       -0.1*%i   0.1*%i
+       -%i       %i
+       -10*%i    10*%i
+       -1 - %i,  1 + %i
+       -2 - 2*%i, 2 + 2*%i
+       ])
  ]]></programlisting>
     </refsection>
+    <refsection role="see also">
+        <title>Voir aussi</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="cosh">cosh</link>
+            </member>
+            <member>
+                <link linkend="sinh">sinh</link>
+            </member>
+            <member>
+                <link linkend="tanh">tanh</link>
+            </member>
+        </simplelist>
+    </refsection>
 </refentry>
diff --git a/scilab/modules/elementary_functions/help/ja_JP/trigonometry/acosh.xml b/scilab/modules/elementary_functions/help/ja_JP/trigonometry/acosh.xml
deleted file mode 100644 (file)
index 1bf3703..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2008 - INRIA
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- -->
-
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:id="acosh" xml:lang="ja">
-
-    <refnamediv>
-
-        <refname>acosh</refname>
-
-        <refpurpose>逆双曲線余弦</refpurpose>
-
-    </refnamediv>
-
-    <refsynopsisdiv>
-
-        <title>呼び出し手順</title>
-
-        <synopsis>[t]=acosh(x)</synopsis>
-
-    </refsynopsisdiv>
-
-    <refsection>
-
-        <title>引数</title>
-
-        <variablelist>
-
-            <varlistentry>
-
-                <term>x</term>
-
-                <listitem>
-
-                    <para>実数または複素数のベクトルまたは行列</para>
-
-                </listitem>
-
-            </varlistentry>
-
-            <varlistentry>
-
-                <term>t</term>
-
-                <listitem>
-
-                    <para>実数または複素数のベクトルまたは行列</para>
-
-                </listitem>
-
-            </varlistentry>
-
-        </variablelist>
-
-    </refsection>
-
-    <refsection>
-
-        <title>説明</title>
-
-        <para>
-
-            <literal>t</literal> の要素は
-
-            <literal>x</literal>の対応するエントリの
-
-            逆双曲線余弦となります.
-
-            定義域は
-
-            <latex>]1,+\infty)</latex>] です.
-
-        </para>
-
-    </refsection>
-
-    <refsection>
-
-        <title>サンプル</title>
-
-        <scilab:image>
-
-            x=-360:1:360
-
-            plot(x,acosh(x))
-
-        </scilab:image>
-
-    </refsection>
-
-    <refsection>
-
-        <title>例</title>
-
-        <programlisting role="example"><![CDATA[
-x=[0,1,%i];
-cosh(acosh(x))
- ]]></programlisting>
-
-    </refsection>
-
-</refentry>
-
diff --git a/scilab/modules/elementary_functions/help/pt_BR/trigonometry/acosh.xml b/scilab/modules/elementary_functions/help/pt_BR/trigonometry/acosh.xml
deleted file mode 100644 (file)
index aca9304..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2008 - INRIA
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="acosh" xml:lang="pt">
-    <refnamediv>
-        <refname>acosh</refname>
-        <refpurpose>arco-coseno hiperbólico</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>Seqüência de Chamamento</title>
-        <synopsis>[t]=acosh(x)</synopsis>
-    </refsynopsisdiv>
-    <refsection>
-        <title>Parâmetros</title>
-        <variablelist>
-            <varlistentry>
-                <term>x</term>
-                <listitem>
-                    <para>vetor de reais ou complexos </para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>t</term>
-                <listitem>
-                    <para>vetor de reais ou complexos</para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection>
-        <title>Descrição</title>
-        <para>
-            Os componentes do vetor <literal>t</literal> são os arcos-cosenos
-            hiperbólicos das entradas correspondentes do vetor <literal>x</literal>. O
-            domínio de definição é ]1,+infinito[. A função toma valores em
-            conjuntos.
-        </para>
-    </refsection>
-    <refsection>
-        <title>Exemplos</title>
-        <programlisting role="example"><![CDATA[
-x=[0,1,%i];
-cosh(acosh(x))
- ]]></programlisting>
-    </refsection>
-</refentry>
diff --git a/scilab/modules/elementary_functions/help/ru_RU/trigonometry/acosh.xml b/scilab/modules/elementary_functions/help/ru_RU/trigonometry/acosh.xml
deleted file mode 100644 (file)
index 21fb8d6..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2008 - INRIA
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="acosh" xml:lang="ru">
-    <refnamediv>
-        <refname>acosh</refname>
-        <refpurpose>гиперболический арккосинус</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>Синтаксис</title>
-        <synopsis>[t]=acosh(x)</synopsis>
-    </refsynopsisdiv>
-    <refsection>
-        <title>Аргументы</title>
-        <variablelist>
-            <varlistentry>
-                <term>x</term>
-                <listitem>
-                    <para>вещественный или комплексный вектор или матрица</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>t</term>
-                <listitem>
-                    <para>вещественный или комплексный вектор или матрица</para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection>
-        <title>Описание</title>
-        <para>
-            Элементы <varname>t</varname> являются значениями гиперболического арккосинуса соответствующих элементов  <varname>x</varname>. Область определения <latex>]1,+\infty)</latex>.
-        </para>
-    </refsection>
-    <refsection>
-        <title>Образец</title>
-        <scilab:image>
-            x=-360:1:360
-            plot(x,acosh(x))
-        </scilab:image>
-    </refsection>
-    <refsection>
-        <title>Примеры</title>
-        <programlisting role="example"><![CDATA[
-x=[0,1,%i];
-cosh(acosh(x))
- ]]></programlisting>
-    </refsection>
-</refentry>
index ed5d75e..9e23710 100644 (file)
@@ -101,6 +101,10 @@ types::Function::ReturnValue sci_acosh(types::typed_list &in, int _iRetCount, ty
                     std::complex<double> c(pInR[i], 0);
                     std::complex<double> d = std::acosh(c);
                     pOutR[i] = d.real();
+                    if (pOutR[i] < 0)
+                    {
+                        pOutR[i] = -pOutR[i];
+                    }
                     pOutI[i] = d.imag();
                 }
             }
index 95db048..dec82ad 100644 (file)
@@ -637,7 +637,7 @@ _MathML_integrate.xml_ru_RU_1.png=797aceb1aba80a1d083dc5963bcc22a2
 _MathML_pspect.xml_1.png=1219d0564561afe97ea367612399e26a
 acos_1.png=17d595e24e7d60478a837a3b8abe0798
 acosd_1.png=a933487424afe251b71aaf38fb285f1c
-acosh_1.png=6f5c6ea39a6ae53c48d77bebde4044d7
+acosh_1.png=a4c877a5afc85aa549c2b29e0fd8507a
 acot_1.png=a102809de68b60a3b3d26ff22f77b598
 acotd_1.png=8c6cc74d7cd9304c123d573409dcd01f
 acoth_1.png=d6d4fa73c056224341009d0ed4735abd
index fa82cb2..a3cd89f 100644 (file)
Binary files a/scilab/modules/helptools/images/acosh_1.png and b/scilab/modules/helptools/images/acosh_1.png differ