create f_from_C function to select f values appropriately

Tested on bennet.

optimized fractal algorithm took 24.94 seconds