Make sure you give it a while to run. It hangs for over three minutes just computing $e for me on OS X (Mac Pro late 2013 sitting otherwise idle) but does eventually produce an answer. These are hyoooooge numbers (checking with Wolfram Alpha which shows they're on the order of 10**6889) and I'm going to guess that it's just CPU bound.

$ time perl -MLog::Log4perl=:easy -Mbignum -E 'Log::Log4perl->easy_ini +t($DEBUG);$|=1;INFO(qq{before});my $z = -15863.8668285308; INFO(qq{z: + }, $z); my $e = exp( $z * -1 ); INFO(qq{e: }, $e); my $p = 1.0/$e;IN +FO(qq{p: }, $p);INFO(qq{DONE});' 2020/08/30 16:29:11 before 2020/08/30 16:29:11 z: -15863.8668285308 2020/08/30 16:32:45 e: 38888865970354639568651511148772888670670000000 +000000000000000000000000000000[boatload o 0s] 2020/08/30 16:32:45 p: 0.0[boatload o 0s]00025714300868590761106006809 +94899649646402 2020/08/30 16:32:45 DONE perl -MLog::Log4perl=:easy -Mbignum -E 214.12s user 0.15s system 99% + cpu 3:34.33 total

Edit: added missing phrase

Update: If you install a faster math library, e.g. Math::BigInt::GMP and make sure that's used (add a line use Math::BigFloat lib => q{GMP};), then this returns immediately. The problem is most likely the default pure Perl bignum implementation Math::BigInt::Calc.

The cake is a lie.
The cake is a lie.
The cake is a lie.


In reply to Re: exp() bignum issue by Fletch
in thread exp() bignum issue by cormanaz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.