#1891: Problems with acosh, asech, atanh and acoth  in Complex PMC
--------------------+-------------------------------------------------------
 Reporter:  fbrito  |       Owner:  Util             
     Type:  bug     |      Status:  assigned         
 Priority:  normal  |   Milestone:  2.11             
Component:  core    |     Version:  2.10.0           
 Severity:  medium  |    Keywords:  complex math trig
     Lang:          |       Patch:                   
 Platform:  all     |  
--------------------+-------------------------------------------------------
Changes (by Util):

  * status:  new => assigned


Comment:

 Be advised, problems are turning up in other data sources:

 I will rely on the standard C library as the "absolute truth", until
 counter-evidence arrives.
 {{{
     #include <stdio.h>
     #include <complex.h>
     int main(void) {
         const double complex z = 2.0 - 3.0 * I;
         const double complex c = cacosh(z);
         printf(
             "cacosh(%lg%+lgi) is %lf%+lfi\n",
             creal(z), cimag(z),
             creal(c), cimag(c)
         );
         return 0;
     }
 }}}
 Outputs:
     cacosh(2-3i) is 1.983387-1.000144i

 http://www.wolframalpha.com/input/?i=acosh(2-3i)
     1.983387-1.00014354247i
         More evidence that the C answer is correct.

 perl -MMath::Complex               -wle '$f=cplxe(2,-3); $g = acosh $f;
 print "$g"'
     1.32074266859523-2.97863118461102i
         Looks completely wrong to me. Also, when fed back into cosh(),
 does not even come close to (2,-3).

 perl -MMath::Cephes::Complex=cmplx -wle '$f=cmplx(2,-3); $g = $f->cacosh;
 print $g->as_string'
     -1.983387 + 1.000144 i
         The signs are backwards, but cosh(z) == cosh(-z), so maybe this is
 just another form of "correct"?

 Will pursue further tomorrow.

-- 
Ticket URL: <https://trac.parrot.org/parrot/ticket/1891#comment:2>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets

Reply via email to