# bug #26340: absolute value calculation for affine intervals is incorrect

 Submitted by: None Submitted on: Fri 24 Apr 2009 09:12:32 PM UTC Category: None Severity: 3 - Normal Item Group: None Status: None Privacy: Public Assigned to: None Open/Closed: Open

You are not logged in

## Discussion

Thu 08 Apr 2010 11:52:17 AM UTC, comment #2:

Ops -- Stolfi's implementation does have abs! But it's completely different...

Jeronimo Pellegrini <pellegrini>
Thu 08 Apr 2010 11:45:03 AM UTC, comment #1:

How exactly is abs defined (what should be the output of abs(x) when x straddles zero)? I didn't find a description of it in Affine Arithmetic literature, and other implementations (Like Stolfi's and ASOL -- http://reliablecomputing.eu/software.html) do not implement abs.

Jeronimo Pellegrini <pellegrini>
Fri 24 Apr 2009 09:12:32 PM UTC, original submission:

The absolute value calculation in aa_aafapprox.cpp for affine intervals doesn't work. It is:

AAF abs(const AAF & P) {
if(P.strictly_neg())
return -P;
AAF Temp(P);
Temp.cvalue = fabs(Temp.cvalue)/2;
Temp.special = P.special;

for (unsigned i=0; i<P.length; i++)
Temp.coefficients[i]=(Temp.coefficients[i])/2;
return Temp;
}
return P;
}

But the inverval can only be reduced by 1/2 if it is centered on zero, and even then the center value needs to be shifted. E.g. for abs(x+y) with x in [-1,1] and y in [0,2] the above gives an affine approx. corresponding to an interval [-0.5,1.5], when the true interval is [0,3]...

Cheers,
Moshe Looks (moshe@metacog.org)

Anonymous

## Attached Files

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Comment:

No files currently attached

## Dependencies

Depends on the following items: None found

Items that depend on this one: None found

Carbon-Copy List
• -email is unavailable- added by pellegrini (Posted a comment)
•

Do you think this task is very important?
This task has 0 encouragements so far.

Only logged-in users can vote.

## History

No changes have been made to this item