cdar-mBound-0.1.0.4: Exact real arithmetic using Centred Dyadic Approximations

Description

The Dyadic module provides dyadic numbers. Syntax for dyadic number 'a * 2 ^ s' is 'a :^ s'. The exponent s is an Int, but the a is an arbitrary Integer.

Synopsis

# Documentation

Constructors

 Integer :^ Int infix 8

#### Instances

Instances details

Shift a dyadic number to a given base and round in case of right shifts.

Computes the square root of a Dyadic number to the specified base. The Newton-Raphson method may overestimates the square root, but the overestimate is bounded by 1 ulp. For example, sqrtD 0 2 will give 2, whereas the closest integer to the square root is 1. Need double precision to guarantee correct rounding, which was not considered worthwhile.

This is actually Heron's method and is no longer used in Approx as it is faster to use sqrtRecD.

Square root with initial approximation as third argument.

Reciprocal of square root using Newton's iteration.

Reciprocal of square root using Newton's iteration with inital value as third argument.

Gives initial values for the iteration. Based on the three most significant bits of the argument. Should consider to use machine floating point to give initial value.

Compute dyadic values close to pi by Machin's formula.

Compute dyadic values close to pi by Borwein's formula.

Compute dyadic values close to ln 2.