MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / quadratic_formula

Function quadratic_formula

benchmarks/python-performance.py:77–79  ·  view source on GitHub ↗

r"""Quadratic Formula: \frac{-b + \sqrt{b^2 - 4ac}}{2a}

(a, b, c)

Source from the content-addressed store, hash-verified

75
76import numpy as np
77def quadratic_formula(a, b, c):
78 r"""Quadratic Formula: \frac{-b + \sqrt{b^2 - 4ac}}{2a}"""
79 return (-b + np.emath.sqrt(b ** 2 + -4 * a * c)) / (2 * a)
80
81
82import numpy as np

Callers 1

run_benchmarksFunction · 0.85

Calls 1

sqrtMethod · 0.65

Tested by

no test coverage detected