omega-mcp
aien-dev/omega-mcp
Brought by drakestapleton
omega-mcp / data / examples / fma.om
| 1 | note fma rounds once: (1+2^-52)*(1-2^-52)-1 is -2^-104, while mul then add rounds twice and gives 0 |
| 2 | fn main to int |
| 3 | a = bitcast f64 ulong 4607182418800017409 |
| 4 | b = bitcast f64 ulong 4607182418800017406 |
| 5 | m = neg 1.0f64 |
| 6 | f = fma a b m |
| 7 | s = add mul a b m |
| 8 | if ne s 0.0f64 |
| 9 | ret 1 |
| 10 | end |
| 11 | if ge f 0.0f64 |
| 12 | ret 2 |
| 13 | end |
| 14 | ret int fma 2.0f64 3.0f64 1.0f64 |
| 15 | end |