Errors in hc-sr04 sensor readings

'duration' should be 'unsigned long duration;', not 'double duration;'

1196.64 cm is over 11 meters! That is WAY outside the distance capability of the HC-SR04

You should probably set a timeout on the pulseIn(). Try:
duration = pulseIn(echoPin, HIGH, 30000ul);
That will limit the distance measurement to around 5 meters.