MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / f

Function f

maths/numerical_analysis/intersection.py:44–50  ·  view source on GitHub ↗

function is f(x) = x^3 - 2x - 5 >>> f(2) -1.0

(x: float)

Source from the content-addressed store, hash-verified

42
43
44def f(x: float) -> float:
45 """
46 function is f(x) = x^3 - 2x - 5
47 >>> f(2)
48 -1.0
49 """
50 return math.pow(x, 3) - (2 * x) - 5
51
52
53if __name__ == "__main__":

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected