Algorithm with three parameters length, width and height

Hello, good morning. I am planning to design an egg-shaped shader with three parameters: length, width, and cell depth, but my algorithm keeps running into a new problem and I can't find the bug. I would appreciate it if you have any advice or tips for writing it.

Hi -

Please see https://discourse.ladybug.tools for questions around the Ladybug Tools.
-wim