How to calculate field value in a form

I am designing a form for data entry which has multiple fields.
I need value of field ‘Machine Efficiency’ to be calculated on the field ‘Machine target’ and ‘Qty’…calculation is below

Machine efficiency = Machine target *100/Qty

Kindly help on how to do this

By using custom script you can calculate the fields value.
Refer link for some examples of custom script -

Thanks, Priya