I will guess your script is in the "calculate" event of a 3rd field.
You can add a bit more in the script to try to help you understand the error.
For information: Overflow means it calculated a value too large to handle and underflow means it calculated a value too small to handle. Either case suggests something is wrong because I guess you have "every day" kind of values in the hundreds/thousands/millions kind of range.
Try the following [I slightly extended your 'if' so it requires a value in NumericField12 also] and it should pop up a window showing the values of both fields before the calculation:
// show field values for debugging xfa.host.messageBox( Concat("NumericField1 val: ", NumericField1, " NumericField12 val: ", NumericField12) , null , 3)
// calculate them if(HasValue(NumericField1) & HasValue(NumericField12) & NumericField1 ne 0 & NumericField12 ne 0) then NumericField1*NumericField12 else null endif