e0e7e55502fb6fa0142b2f173f8de6b73b254594,scipy/optimize/_trustregion.py,BaseQuadraticSubproblem,get_boundaries_intersections,#BaseQuadraticSubproblem#Any#Any#Any#,74

Before Change


        sqrt_discriminant = math.sqrt(b*b - 4*a*c)
        ta = (-b - sqrt_discriminant) / (2*a)
        tb = (-b + sqrt_discriminant) / (2*a)
        return ta, tb

    def solve(self, trust_radius):
        raise NotImplementedError("The solve method should be implemented by "
                                  "the child class")

After Change


        // but produce smaller round off errors.
        // Look at Matrix Computation p.97
        // for a better justification.
        aux = b + math.copysign(sqrt_discriminant, b)
        ta = -aux / (2*a)
        tb = -2*c / aux
        return sorted([ta, tb])

    def solve(self, trust_radius):
        raise NotImplementedError("The solve method should be implemented by "
                                  "the child class")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: scipy/scipy
Commit Name: e0e7e55502fb6fa0142b2f173f8de6b73b254594
Time: 2017-03-27
Author: antonior92@gmail.com
File Name: scipy/optimize/_trustregion.py
Class Name: BaseQuadraticSubproblem
Method Name: get_boundaries_intersections


Project Name: apache/incubator-mxnet
Commit Name: d1616c9e40755f9fe9c719d1d443dbf6ada5af4b
Time: 2020-04-08
Author: 57363390+Yiyan66@users.noreply.github.com
File Name: python/mxnet/ndarray/numpy/_op.py
Class Name:
Method Name: copysign


Project Name: chainer/chainer
Commit Name: d02772a31ca01d562d7d0e481e7ec2831decab4b
Time: 2019-10-11
Author: kataoka@preferred.jp
File Name: chainer/gradient_check.py
Class Name: _CheckBackward
Method Name: _sample_unit_vector