Did you choose the correct elliptic curve to make the calculations ? Bitcoin is using secp256k1.
To generate a private key using openssl:
openssl ecparam -genkey -name secp256k1 -rand /dev/urandom -out $PRIVATE_KEY
To generate the public key related to the previously generated private key:
openssl ec -in $PRIVATE_KEY -pubout -out $PUBLIC_KEY