A microelectromechanical resonator device comprising, - a support structure, - a resonator suspended to the support structure and comprising at least one beam (10A, 11A, 11B), the beam (10A, 11A, 11B) ∘ having a longitudinal axis, ∘ being doped to a doping concentration with an n-type doping agent, and ∘ being capable of resonating in a length-extensional, flexural or torsional resonance mode, - an actuator for exciting said length-extensional, flexural or torsional resonance mode into the resonator, - the support structure and the resonator are manufactured from an or oriented semiconductor wafer, an out-of-plane aspect ratio of the at least one beam (10A, 11 A, 11B) is less than 2 if said resonance mode is torsional, - characterized in that said doping concentration is at least 1.1 ∗ 10 20 cm -3 if said resonance mode is torsional and said doping concentration is at least 1.2 ∗ 10 20 cm -3 if said resonance mode is length-extensional or flexural, - the longitudinal axis of the beam (10A, 11A, 11B) is oriented ∘ at an angle of 17±10 degrees with respect to the crystal direction of the wafer if said resonance mode is length-extensional or flexural, or ∘ at an angle of 0±35 degrees with respect to the crystal direction of the wafer if said resonance mode is torsional, - thereby causing the first order temperature coefficient of frequency (TCF 1) of the resonator to be 1 ppm/C or less, in particular 0.5 ppm/C or less, at least at one temperature and the second order temperature coefficient of frequency (TCF 2) to be 12 ppb/C 2 or less, in particular 6 ppb/C 2 or less, typically 3 ppb/C 2 or less at said at least one temperature, wherein said at least one temperature is about 25 degrees. - a support structure, - a resonator suspended to the support structure and comprising at least one beam (10A, 11A, 11B), the beam (10A, 11A, 11B) ∘ having a longitudinal axis, ∘ being doped to a doping concentration with an n-type doping agent, and ∘ being capable of resonating in a length-extensional, flexural or torsional resonance mode, ∘ having a longitudinal axis, ∘ being doped to a doping concentration with an n-type doping agent, and ∘ being capable of resonating in a length-extensional, flexural or torsional resonance mode, - an actuator for exciting said length-extensional, flexural or torsional resonance mode into the resonator, - the support structure and the resonator are manufactured from an or oriented semiconductor wafer, an out-of-plane aspect ratio of the at least one beam (10A, 11 A, 11B) is less than 2 if said resonance mode is torsional, - characterized in that said doping concentration is at least 1.1 ∗ 10 20 cm -3 if said resonance mode is torsional and said doping concentration is at least 1.2 ∗ 10 20 cm -3 if said resonance mode is length-extensional or flexural, - the longitudinal axis of the beam (10A, 11A, 11B) is oriented ∘ at an angle of 17±10 degrees with respect to the crystal direction of the wafer if said resonance mode is length-extensional or flexural, or ∘ at an angle of 0±35 degrees with respect to the crystal direction of the wafer if said resonance mode is torsional, ∘ at an angle of 17±10 degrees with respect to the crystal direction of the wafer if said resonance mode is length-extensional or flexural, or ∘ at an angle of 0±35 degrees with respect to the crystal direction of the wafer if said resonance mode is torsional, - thereby causing the first order temperature coefficient of frequency (TCF 1) of the resonator to be 1 ppm/C or less, in particular 0.5 ppm/C or less, at least at one temperature and the second order temperature coefficient of frequency (TCF 2) to be 12 ppb/C 2 or less, in particular 6 ppb/C 2 or less, typically 3 ppb/C 2 or less at said at least one temperature, wherein said at least one temperature is about 25 degrees.