[bug #68547] Provide fused multiply-add (FMA) function

<[email protected]> Wed, 22 Jul 2026 14:30:49 -0400 (EDT)
Newsgroups gmane.comp.gnu.octave.bugs
Message-ID <[email protected]>
--===============7609408317376825095==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

UGxlYXNlIHVzZSB0aGUgYnVnIHRyYWNrZXIgdG8gcG9zdCB1cGRhdGVzIHRvIGEgYnVnIHJlcG9y
dC4gIFRoZSBtYWlsaW5nIGxpc3QgaXMgaW50ZW5kZWQgYXMgYSByZWFkLW9ubHkgbm90aWZpY2F0
aW9uIHN0cmVhbS4gIEluZm8gcG9zdGVkIHRvIHRoaXMgbWFpbGluZyBsaXN0IGFkZHJlc3Mgd29u
J3QgYXBwZWFyIGluIHRoZSB0cmFja2VyIGRhdGFiYXNlIHdoZXJlIGl0IGlzIG1vc3QgdXNlZnVs
LgoK

--===============7609408317376825095==
Content-Type: MULTIPART/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; BOUNDARY="8323329-1714636915-1784745049=:4116529"
Content-Disposition: inline

--8323329-1714636915-1784745049=:4116529
Content-Type: TEXT/plain; CHARSET=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: inline

URL:=0A  <https://savannah.gnu.org/bugs/?68547>=0A=0A                 Summa=
ry: Provide fused multiply-add (FMA) function=0A                   Group: G=
NU Octave=0A               Submitter: vhihrvvkndet=0A               Submitt=
ed: Wed 22 Jul 2026 06:30:43 PM UTC=0A                Category: Octave Func=
tion=0A                Severity: 3 - Normal=0A                Priority: 5 -=
 Normal=0A              Item Group: Matlab Compatibility=0A                =
  Status: None=0A             Assigned to: None=0A         Originator Name:=
=0A        Originator Email:=0A             Open/Closed: Open=0A         Di=
scussion Lock: Unlocked=0A                 Release: dev=0A        Operating=
 System: Any=0A           Fixed Release: None=0A         Planned Release: N=
one=0A=0A=0A    _______________________________________________________=0A=
=0AFollow-up Comments:=0A=0A=0A--------------------------------------------=
-----------=0ADate: Wed 22 Jul 2026 06:30:43 PM UTC By: Anonymous=0AI propo=
se that Octave provide a fused multiply-add (FMA) function, ideally=0Aimple=
menting fusedMultiplyAdd as defined by IEEE 754 and ISO/IEC 60559, and=0Aid=
eally supporting broadcasting.=0A=0AMATLAB seems to provide fused multiply-=
add as=0A[https://www.mathworks.com/help/fixedpoint/ref/half.fma.html fma].=
=0A=0AIntended benefits:=0A* improves accuracy compared to A .* B + C=0A* i=
mproves performance compared to A .* B + C=0A* allows implementing certain =
error-free transformations and other specialized=0Anumerical algorithms=0A*=
 allows implementing existing algorithms (from literature or other language=
s)=0Athat use FMA=0A* brings Octave closer to IEEE 754 compliance (fusedMul=
tiplyAdd is a required=0Aoperation)=0A* improves MATLAB compatibility=0A=0A=
Given that Octave provides two floating point formats, there are 2^4 =3D 16=
=0Adifferent versions of FMA that could be provided.  I suspect that (doubl=
e,=0Adouble, double) --> double is most important, (single, single, single)=
 -->=0Asingle is next, and the other 14 are much less important.  I'm not s=
ure what=0Athe best interface would be if we want to provide all 16 version=
s.  I don't=0Aknow which versions are provided by MATLAB, but it seemingly =
can't be all of=0Athem.  It would be nice if someone with access could figu=
re this out.=0A=0AI don't have a good sense of what it would take to add th=
is to Octave.  I'm=0Anot very familiar with the C++ side of things.=0A=0A=
=0A=0A=0A=0A=0A=0A=0A    __________________________________________________=
_____=0A=0AReply to this item at:=0A=0A  <https://savannah.gnu.org/bugs/?68=
547>=0A=0A_______________________________________________=0AMessage sent vi=
a Savannah=0Ahttps://savannah.gnu.org/=0A
--8323329-1714636915-1784745049=:4116529
Content-Type: APPLICATION/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCamEMWQAKCRCqLAuaBUf3
TiXIAQD02FFnABUibXvuNEmp9EOHxN6JkHvY/9qkcrgqx0XYNwEAptVKF7v38AA5
VoJGHJ0RWIQgjfv1UgFHmQKWnXrAtg8=
=Q4Rg
-----END PGP SIGNATURE-----

--8323329-1714636915-1784745049=:4116529--



--===============7609408317376825095==--