analogRead() doesn't read more than 500Hz
You have 4 calls to analogRead() in your loop. At about 112 µs per
call, that's already taking 448 µs. Add to that the time taken by the
floating point calculations, and you are likely to end up with something
in the order of 500 µs per loop iteration. This should give you a
sampling rate close to 2 kHz, which should allow you to detect the highs
and lows of an input signal up to 1 kHz, provided the duty cycle is
close to 50%.
There are a couple of easy optimizations that could be done here. Two of
the calls to analogRead() serve no purpose, as the results are never
used. And the floating point calculations are also pointless. The whole
loop can be simplified to this:
void loop() {
    if (abs(analogRead(A0) - analogRead(A1)) &gt;= 512) {
        digitalWrite(6, LOW);
    } else {
        digitalWrite(6, HIGH);
    }
}

This should take about 224 µs per iteration. If you need to go faster,
you will have to increase the working frequency of the ADC. This can
cost some accuracy, but if accuracy is not critical to your application,
it can be a good trade-off. See Nick Gammon's page on the Arduino
ADC for details. If that's not enough, you will have to use
external components, e.g. an analog subtractor made from an op-amp, and
a couple of comparators.