Design an advanced chess engine evaluation function that seamlessly integrates both tactical sharpness and positional understanding. The function should combine the principles of the **Optimized Tactical Evaluation and Search Method (OTESM)** and the **Weighted Positional and Tactical Evaluation Model (WPTEM)** for an average CPU. The engine should be able to handle high-level tactical situations with efficiency while maintaining a solid grasp of positional factors to evaluate positions dynamically throughout all phases of the game.

**Key Requirements:**

1. **Tactical Optimization (OTESM):**
   - Implement **selective depth extensions** for tactical motifs like forks, pins, skewers, and checks. Ensure deeper search only in these critical areas to optimize CPU usage.
   - Integrate aggressive **null move pruning** and **late move reduction (LMR)** to eliminate moves without immediate tactical relevance.
   - Utilize a **quiescence search** that evaluates only noisy moves (captures, checks) after the main search. The quiescence search should heavily favor moves leading to material gain or checks, thus focusing on active tactical lines.
   - Apply the **killer move heuristic** and **history heuristic** to prioritize tactical moves that have proven successful in similar positions or cause material imbalances.
   - Use **tactical pattern recognition** to quickly detect tactical opportunities (forks, pins, skewers, back-rank threats) and prioritize their evaluation.
   - Employ **move ordering heuristics** based on the MVV-LVA rule (Most Valuable Victim - Least Valuable Attacker) to search captures and checks first, improving tactical calculation speed.

2. **Positional Evaluation (WPTEM):**
   - Create a **dynamic material evaluation** system that adjusts piece values based on activity and phase of the game (e.g., centralization of the king in endgames, bishops becoming stronger in open positions).
   - Emphasize **piece mobility** by dynamically evaluating how many legal moves each piece has, applying higher weights to active pieces that control key squares, especially in the center.
   - Implement an advanced **pawn structure evaluation** that considers isolated, doubled, backward pawns, and passed pawns, adjusting their value based on the potential for promotion and impact on piece mobility.
   - Evaluate **king safety** by considering pawn shields, opponent’s piece proximity, and attack potential. Reward advanced king positions in the endgame.
   - Prioritize **central control** by assigning weights to pieces occupying or attacking central squares (e4, d4, e5, d5). Increase the central square’s value in the opening and middlegame.
   - Reward **piece coordination** and **synergy** between certain pieces (like connected rooks or queen-knight attack patterns), giving extra evaluation points for well-coordinated piece activity.
   - Use a system of **strategic imbalances**, dynamically weighing factors like bishop pair vs. knight, space advantage, and weak squares. Adapt the evaluation of these imbalances based on the phase of the game (e.g., open positions favor bishops, while closed positions may favor knights).

3. **Search Efficiency (Balancing OTESM and WPTEM):**
   - Ensure that **tactical moves** are prioritized in the search tree while still allowing for **positional depth** in quiet positions.
   - Apply **quiescence search** to mitigate the horizon effect in positions where tactical play is less obvious but could lead to material imbalances.
   - Use **parallel search** methods to divide CPU resources between evaluating tactical motifs and long-term positional factors, ensuring neither tactical calculation nor strategic understanding is compromised.

4. **Phase-Specific Adjustments:**
   - In the **opening**, prioritize development, king safety, and central control, while maintaining the ability to detect tactical opportunities like opening traps.
   - In the **middlegame**, focus heavily on tactical play (OTESM), but ensure the evaluation also reflects strategic imbalances and dynamic pawn structures (WPTEM).
   - In the **endgame**, shift the balance towards WPTEM, valuing king activity, passed pawns, and piece mobility, but keep tactical sharpness high to avoid missing forced sequences like queen promotions or mating nets.

5. **Efficient CPU Usage:**
   - Optimize the evaluation and search function for an average CPU, balancing resource allocation between deep tactical searches and complex positional evaluations. Implement multithreading where applicable, assigning different threads to focus on tactical and positional aspects concurrently.