{
    "type": "minecraft:find_top_surface",
    "density": {
        "type": "minecraft:min",
        "argument1": {
            "type": "minecraft:add",
            "argument1": 0,
            "argument2": {
                "type": "minecraft:add",
                "argument1": 0.1171875,
                "argument2": {
                    "type": "minecraft:mul",
                    "argument1": {
                        "type": "minecraft:y_clamped_gradient",
                        "from_value": 0,
                        "from_y": -64,
                        "to_value": 1,
                        "to_y": -40
                    },
                    "argument2": {
                        "type": "minecraft:add",
                        "argument1": -0.1171875,
                        "argument2": {
                            "type": "minecraft:add",
                            "argument1": -0.078125,
                            "argument2": {
                                "type": "minecraft:mul",
                                "argument1": {
                                    "type": "minecraft:y_clamped_gradient",
                                    "from_value": 1,
                                    "from_y": 250,
                                    "to_value": 0,
                                    "to_y": 292
                                },
                                "argument2": {
                                    "type": "minecraft:add",
                                    "argument1": 0.078125,
                                    "argument2": {
                                        "type": "minecraft:clamp",
                                        "input": {
                                            "type": "minecraft:add",
                                            "argument1": -0.703125,
                                            "argument2": {
                                                "type": "minecraft:mul",
                                                "argument1": 4,
                                                "argument2": {
                                                    "type": "minecraft:quarter_negative",
                                                    "argument": {
                                                        "type": "minecraft:mul",
                                                        "argument1": "minecraft:overworld/depth",
                                                        "argument2": {
                                                            "type": "minecraft:cache_2d",
                                                            "argument": "minecraft:overworld/factor"
                                                        }
                                                    }
                                                }
                                            }
                                        },
                                        "max": 64,
                                        "min": -64
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "argument2": {
            "type": "minecraft:mul",
            "argument1": 1,
            "argument2": "terralith:overworld/subtract_terrain_sum"
        }
    },
    "upper_bound": {
        "type": "minecraft:clamp",
        "input": {
            "type": "minecraft:add",
            "argument1": 128,
            "argument2": {
                "type": "minecraft:mul",
                "argument1": -128,
                "argument2": {
                    "type": "minecraft:add",
                    "argument1": {
                        "type": "minecraft:mul",
                        "argument1": 0.2734375,
                        "argument2": {
                            "type": "minecraft:invert",
                            "argument": {
                                "type": "minecraft:cache_2d",
                                "argument": "minecraft:overworld/factor"
                            }
                        }
                    },
                    "argument2": {
                        "type": "minecraft:mul",
                        "argument1": -1,
                        "argument2": {
                            "type": "minecraft:cache_2d",
                            "argument": "minecraft:overworld/offset"
                        }
                    }
                }
            }
        },
        "min": -40,
        "max": 320
    },
    "lower_bound": -64,
    "cell_height": 8
}