Math-MPFR
view release on metacpan or search on metacpan
In Rmpfr_exp2p1, set $rop = (2 ** $op) - 1.
In Rmpfr_exp10p1, set $rop = (10 ** $op) - 1.
For all three, the result is rounded to the direction $rnd
with the precision of $rop.
$inex = Rmpfr_fma($rop, $op1, $op2, $op3, $rnd);
Set $rop to $op1 * $op2 + $op3, rounded to the direction $rnd.
$inex = Rmpfr_fmma($rop, $op1, $op2, $op3, $op4, $rnd);
NOTE: Needs mpfr-4.0.0 or later
Set $rop to $op1 * $op2 + $op3 * $op4, rounded to the
direction $rnd.
$inex = Rmpfr_fms($rop, $op1, $op2, $op3, $rnd);
Set $rop to $op1 * $op2 - $op3, rounded to the direction $rnd.
$inex = Rmpfr_fmms($rop, $op1, $op2, $op3, $op4, $rnd);
NOTE: Needs mpfr-4.0.0 or later
Set $rop to $op1 * $op2 - $op3 * $op4, rounded to the
direction $rnd.
$inex = Rmpfr_agm($rop, $op1, $op2, $rnd);
Set $rop to the arithmetic-geometric mean of $op1 and $op2,
rounded to the direction $rnd with the precision of $rop.
Return zero if $rop is exact, a positive value if $rop is
larger than the exact value, or a negative value if $rop
is less than the exact value.
$inex = Rmpfr_hypot ($rop, $op1, $op2, $rnd);
Set $rop to the Euclidean norm of $op1 and $op2, i.e. the
square root of the sum of the squares of $op1 and $op2,
rounded in the direction $rnd. Special values are currently
handled as described in Section F.9.4.3 of the ISO C99
standard, for the hypot function (note this may change in
future versions): If $op1 or $op2 is an infinity, then plus
infinity is returned in $rop, even if the other number is
NaN.
$inex = Rmpfr_ai($rop, $op, $rnd); # mpfr-3.0.0 and later only
Set $rop to the value of the Airy function Ai on $op,
rounded in the direction $rnd. When $op is NaN, $rop is
always set to NaN. When $op is +Inf or -Inf, $rop is +0.
The current implementation is not intended to be used with
large arguments. It works with $op typically smaller than
500. For larger arguments, other methods should be used and
will be implemented soon.
$inex = Rmpfr_const_log2($rop, $rnd);
Set $rop to the logarithm of 2 rounded to the direction
$rnd with the precision of $rop. This function stores the
computed value to avoid another calculation if a lower or
equal precision is requested.
Return zero if $rop is exact, a positive value if $rop is
larger than the exact value, or a negative value if $rop
is less than the exact value.
$inex = Rmpfr_const_pi($rop, $rnd);
Set $rop to the value of Pi rounded to the direction $rnd
with the precision of $rop. This function uses the Borwein,
Borwein, Plouffe formula which directly gives the expansion
of Pi in base 16.
Return zero if $rop is exact, a positive value if $rop is
larger than the exact value, or a negative value if $rop
is less than the exact value.
$inex = Rmpfr_const_euler($rop, $rnd);
Set $rop to the value of Euler's constant 0.577... rounded
to the direction $rnd with the precision of $rop.
Return zero if $rop is exact, a positive value if $rop is
larger than the exact value, or a negative value if $rop
is less than the exact value.
inex = Rmpfr_const_catalan($rop, $rnd);
Set $rop to the value of Catalan's constant 0.915...
rounded to the direction $rnd with the precision of $rop.
Return zero if $rop is exact, a positive value if $rop is
larger than the exact value, or a negative value if $rop
is less than the exact value.
Rmpfr_free_cache();
Free the cache used by the functions computing constants if
needed (currently 'mpfr_const_log2', 'mpfr_const_pi' and
'mpfr_const_euler').
Rmpfr_free_cache2($ui); # mpfr-4.0.0 and later only
Free various caches and pools used by MPFR internally, as
specified by $ui, which is a set of flags:
a) those local to the current thread if flag
MPFR_FREE_LOCAL_CACHE is set;
b) those shared by all threads if flag
MPFR_FREE_GLOBAL_CACHE is set.
The other bits of $ui are currently ignored and are reserved for
future use; they should be zero.
Note:
Rmpfr_free_cache2(MPFR_FREE_LOCAL_CACHE|MPFR_FREE_GLOBAL_CACHE)
is currently equivalent to mpfr_free_cache().
Rmpfr_free_pool() # mpfr-4.0.0 and later only
Free the pools used by mpfr internally.
Note:
This function is automatically called after the thread-local
caches are freed (with mpfr_free_cache or mpfr_free_cache2).
$inex = Rmpfr_beta($rop, $op1, $op2, $rnd); # mpfr-4.0.0 &
# later only
Set $rop to the beta function at $op1, $op2, rounded
according to $rnd.
$inex = Rmpfr_gamma($rop, $op, $rnd);
$inex = Rmpfr_lngamma($rop, $op, $rnd);
Set $rop to the value of the Gamma function on $op
(and, respectively, its natural logarithm) rounded
to the direction $rnd. Return zero if $rop is exact, a
positive value if $rop is larger than the exact value, or a
negative value if $rop is less than the exact value.
'Rmpfr_gamma' sets $rop to NaN when $op is negative.
$inex = Rmpfr_gamma_inc($rop, $op1, $op2, $rnd); # mpfr-4.0.0 &
( run in 1.037 second using v1.01-cache-2.11-cpan-39bf76dae61 )