Math function plotter

Type in a math expression (e.g. sin(x)*x) - the server samples the curve in PHP with its OWN, hand-written expression parser (tokenizer → syntax tree → safe, whitelisted evaluation). No eval(): the input never becomes executed code, it can only ever be a parameter to a strictly whitelisted set of math functions.

The PHP code that actually runs (excerpt)
// Fehérlistás dispatch - KIZÁRÓLAG ez a néhány függvény hívható,
// SOSEM dinamikus "$name(...)" hívás vagy eval()
public static function callOne(string $name, float $x): float
{
    return match ($name) {
        'sin' => sin($x),
        'sqrt' => sqrt($x),
        'ln' => log($x),
        // ...
    };
}

// Osztás/maradék fdiv()/fmod()-mal (nullával osztás -> csendes INF/NAN,
// SOSEM DivisionByZeroError), majd EGYSÉGES NaN/Inf-kapu:
'/' => fdiv($left, $right),
...
if (is_nan($result) || is_infinite($result)) {
    return null; // szakadt pont a grafikonon, nem hiba
}

The free variable is called 'x'. Available constants: pi, e. Functions: sin, cos, tan, sqrt, abs, exp, ln, log10, log2, floor, ceil, round, sign, pow(x,n), log(x,base), min(a,b), max(a,b).

Examples
sin(x)
x^2 - 3*x + 2
1/x
sqrt(x)
sin(x)/x
-10-50510-1-0.500.51The horizontal axis is x, the vertical axis is y = f(x). The line breaks wherever the function is undefined at that point (e.g. division by zero). The open circles mark the curve's roots (f(x) = 0), found with a real bisection search.

Roots (approximate x values): -9.4248, -6.2832, -3.1416, 0, 3.1416, 6.2832, 9.4248