ApCoCoA-1:Fn.ReduceModLn2
From ApCoCoAWiki
Revision as of 09:08, 4 May 2011 by S schuster (talk | contribs) (New page: <command> <title>Fn.ReduceModLn2</title> <short_description>Reduces a given value modulo the natural logarithm of 2.</short_description> <syntax> Fn.ReduceModLn2(Val:RAT,Acc:Int):LIST ...)
Fn.ReduceModLn2
Reduces a given value modulo the natural logarithm of 2.
Syntax
Fn.ReduceModLn2(Val:RAT,Acc:Int):LIST
Description
This function reduces Val modulo Ln(2) to the interval
[0, Ln(2)), thereby guaranteeing correctness of the result
up to the desired accuracy Acc.
@param Val The value to be reduced.
@param Acc The desired accuracy.
@return A pair [R, Q] such that Val = Ln(2)*Q + R where Q is an integer and R is between 0 and Ln(2) and rounded to accuracy Acc.
Example
Dec( Fn.ReduceModLn2(10^200, 300), 100); [0.6180561092210337097642318484686251333232148266475695585717410024884378860227783295022403476737844868, 144269504088896340735992468100189213742664595415298593413544940693110921918118507988552662289350634449699751830965254425559310168716835964272066215822347933627453736988471849363070138766353201553389431] -------------------------------
</types>