
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Given that the center of ellipse $C$ is at the origin, its foci lie on the $x$-axis, the focal length is $4$, and the eccentricity is $\frac{\sqrt{2}}{2}$.

(1) Find the equation of ellipse $C$;

(2) Given that line $l$ passes through point $P\left( 0,-1 \right)$, and intersects the ellipse at points $A$ and $B$. If $\overrightarrow{AP}=2 \overrightarrow{PB}$, find the equation of line $l$.

Present the answer in LaTex format: \boxed{Your answer}
user