verry.affineform.AffineForm#

final class verry.affineform.AffineForm(value)#

Bases: Scalar, Generic

Affine form.

Parameters:

value (Interval) – Interval transformed into a new affine form that is independent of all existing affine forms.

Examples

>>> from verry import FloatInterval
>>> x0 = FloatInterval("-0.1", "0.1")
>>> y0 = (x0 + 1)**2 - 2 * x0
>>> print(format(y0, ".6f"))
[inf=0.609999, sup=1.410001]
>>> x1 = AffineForm(x0)
>>> y1 = (x1 + 1)**2 - 2 * x1
>>> print(format(y1.range(), ".6f"))
[inf=0.989999, sup=1.010001]
copy()#

Return a shallow copy of the affine form.

rad()#

Return an upper bound of the radius.

range()#

Return the range of the affine form.

Example

>>> from verry import FloatInterval
>>> x = AffineForm(FloatInterval("0.1"))
>>> x.range() == x.mid() + x.rad() * x.interval(-1, 1)
True
reciprocal()#

Return the reciprocal of the affine form.

Raises:

ZeroDivisionError – If the range contains zero.