Interval package: Difference between revisions

225 bytes added ,  14 October 2014
(→‎Arithmetic operations: added examples)
Line 137: Line 137:


One operation that should be noted is the <code>fma</code> function (fused multiply and add). It computes '''''x''''' * '''''y''''' + '''''z''''' in a single step and is much slower than multiplication followed by addition. However, it is more accurate and therefore preferred in some situations.
One operation that should be noted is the <code>fma</code> function (fused multiply and add). It computes '''''x''''' * '''''y''''' + '''''z''''' in a single step and is much slower than multiplication followed by addition. However, it is more accurate and therefore preferred in some situations.
octave:1> sin (infsup (0.5))
ans = [.47942553860420294, .47942553860420307]
octave:2> pow (infsup (2), infsup (3, 4))
ans = [8, 16]
octave:3> atan2 (infsup (1), infsup (1))
ans = [.7853981633974482, .7853981633974484]


=== Reverse arithmetic operations ===
=== Reverse arithmetic operations ===
240

edits