This is an archive of the discontinued LLVM Phabricator instance.

[flang] Use naive algorithm for folding complex division when it doesn't over/underflow
ClosedPublic

Authored by klausler on Aug 18 2022, 11:25 AM.

Details

Summary

f18 unconditionally uses a scaling algorithm for complex/complex division
that avoids needless overflows and underflows when computing the sum of
the squares of the components of the denominator -- but testing has shown
some 1 ULP differences relative to the naive calculation due to the
extra operations and roundings. So use the scaling algorithm only when
the naive calculation actually would overflow or underflow.

Diff Detail

Event Timeline

klausler created this revision.Aug 18 2022, 11:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 18 2022, 11:25 AM
Herald added a subscriber: jdoerfert. · View Herald Transcript
klausler requested review of this revision.Aug 18 2022, 11:25 AM
vdonaldson accepted this revision.Aug 18 2022, 11:48 AM
This revision is now accepted and ready to land.Aug 18 2022, 11:48 AM