Lines Matching refs:trial
1390 # this trial multiplication is very fast, even for large counts (like for
1396 my $trial = _copy($c,$base);
1406 $trial = _pow ($c, _copy($c, $base), $x);
1407 my $a = _acmp($x,$trial,$x_org);
1412 _mul($c,$trial,$base); _add($c, $x, [1]);
1417 _div($c,$trial,$base); _sub($c, $x, [1]);
1420 $a = _acmp($x,$trial,$x_org);
1425 _div($c,$trial,$base); _sub($c, $x, [1]);
1435 while (($a = _acmp($c,$trial,$x_org)) < 0)
1437 _mul($c,$trial,$base_mul); _add($c, $x, [2]);
1445 _div($c,$trial,$base);
1446 $a = _acmp($c,$trial,$x_org);
1590 # trial computation by starting with 2,4,8,16 etc until we overstep
1592 my $trial = _two();
1598 while (_acmp($c, _pow($c, _copy($c, $trial), $n), $x) < 0)
1601 _add ($c, $trial, $step);
1605 if (_acmp($c, _pow($c, _copy($c, $trial), $n), $x) == 0)
1607 @$x = @$trial; # make copy while preserving ref to $x
1611 _sub($c, $trial, $step);
1616 # add two, because $trial cannot be exactly the result (otherwise we would
1618 _add($c, $trial, $step);
1621 while (_acmp($c, _pow($c, _copy($c, $trial), $n), $x) < 0)
1623 _add ($c, $trial, $step);
1627 if (_acmp($c, _pow($c, _copy($c, $trial), $n), $x) > 0)
1629 _dec($c,$trial);
1634 if (_acmp($c, _pow($c, _copy($c, $trial), $n), $x) > 0)
1636 _dec ($c, $trial);
1639 @$x = @$trial; # make copy while preserving ref to $x