(FPCore (a b c)
:precision binary64
(if (>= b 0.0)
(/ (* 2.0 c) (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a))))
↓
(FPCore (a b c)
:precision binary64
(let* ((t_0 (sqrt (+ (* b b) (* c (* a -4.0)))))
(t_1
(if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_0)) (/ (- t_0 b) (* 2.0 a)))))
(if (or (<= t_1 (- INFINITY))
(and (not (<= t_1 -5e-256))
(or (<= t_1 0.0) (not (<= t_1 5e+278)))))
(if (>= b 0.0) (/ (- c) b) (/ (- b) a))
t_1)))
double code(double a, double b, double c) {
double tmp;
if (b >= 0.0) {
tmp = (2.0 * c) / (-b - sqrt(((b * b) - ((4.0 * a) * c))));
} else {
tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
return tmp;
}
def code(a, b, c):
tmp = 0
if b >= 0.0:
tmp = (2.0 * c) / (-b - math.sqrt(((b * b) - ((4.0 * a) * c))))
else:
tmp = (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
return tmp
↓
def code(a, b, c):
t_0 = math.sqrt(((b * b) + (c * (a * -4.0))))
tmp = 0
if b >= 0.0:
tmp = (2.0 * c) / (-b - t_0)
else:
tmp = (t_0 - b) / (2.0 * a)
t_1 = tmp
tmp_2 = 0
if (t_1 <= -math.inf) or (not (t_1 <= -5e-256) and ((t_1 <= 0.0) or not (t_1 <= 5e+278))):
tmp_3 = 0
if b >= 0.0:
tmp_3 = -c / b
else:
tmp_3 = -b / a
tmp_2 = tmp_3
else:
tmp_2 = t_1
return tmp_2
function code(a, b, c)
tmp = 0.0
if (b >= 0.0)
tmp = Float64(Float64(2.0 * c) / Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))));
else
tmp = Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a));
end
return tmp
end
↓
function code(a, b, c)
t_0 = sqrt(Float64(Float64(b * b) + Float64(c * Float64(a * -4.0))))
tmp = 0.0
if (b >= 0.0)
tmp = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_0));
else
tmp = Float64(Float64(t_0 - b) / Float64(2.0 * a));
end
t_1 = tmp
tmp_2 = 0.0
if ((t_1 <= Float64(-Inf)) || (!(t_1 <= -5e-256) && ((t_1 <= 0.0) || !(t_1 <= 5e+278))))
tmp_3 = 0.0
if (b >= 0.0)
tmp_3 = Float64(Float64(-c) / b);
else
tmp_3 = Float64(Float64(-b) / a);
end
tmp_2 = tmp_3;
else
tmp_2 = t_1;
end
return tmp_2
end
function tmp_2 = code(a, b, c)
tmp = 0.0;
if (b >= 0.0)
tmp = (2.0 * c) / (-b - sqrt(((b * b) - ((4.0 * a) * c))));
else
tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
end
tmp_2 = tmp;
end
↓
function tmp_5 = code(a, b, c)
t_0 = sqrt(((b * b) + (c * (a * -4.0))));
tmp = 0.0;
if (b >= 0.0)
tmp = (2.0 * c) / (-b - t_0);
else
tmp = (t_0 - b) / (2.0 * a);
end
t_1 = tmp;
tmp_3 = 0.0;
if ((t_1 <= -Inf) || (~((t_1 <= -5e-256)) && ((t_1 <= 0.0) || ~((t_1 <= 5e+278)))))
tmp_4 = 0.0;
if (b >= 0.0)
tmp_4 = -c / b;
else
tmp_4 = -b / a;
end
tmp_3 = tmp_4;
else
tmp_3 = t_1;
end
tmp_5 = tmp_3;
end
if (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))) < -inf.0 or -5e-256 < (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))) < -0.0 or 5.00000000000000029e278 < (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a)))
if -inf.0 < (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))) < -5e-256 or -0.0 < (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))) < 5.00000000000000029e278
herbie shell --seed 2023140
(FPCore (a b c)
:name "jeff quadratic root 2"
:precision binary64
(if (>= b 0.0) (/ (* 2.0 c) (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c))))) (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a))))