if output latency is not an issue or can be limited to some value - go for attiny avr micro with builtin adc as:
a. analog/digital conversion
b. math with signal
c. digital/analog conversion by pwm .
The circuit will cost - one dollar (if input/output signals bandwidth rdestrictions are not high).
Or go for analog implementation with analog multipliers and opamp for substraction (more costly).
Or there are otehr ways . Implementation mainly depends on :
- input signals bandwidth
- operation accuracy requirements