(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 (/ (* 2.0 c) (- (- b) b)))
(t_1 (sqrt (+ (* b b) (* c (* a -4.0)))))
(t_2 (/ (- t_1 b) (* 2.0 a)))
(t_3 (if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_1)) t_2)))
(if (<= t_3 (- INFINITY))
(if (>= b 0.0) t_0 (/ (* b -2.0) (* 2.0 a)))
(if (<= t_3 -4e-187)
t_3
(if (<= t_3 0.0)
(if (>= b 0.0) t_0 t_2)
(if (<= t_3 1e+279) t_3 (if (>= b 0.0) t_0 (- (/ c b) (/ b a)))))))))
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 = (2.0 * c) / (-b - b)
t_1 = math.sqrt(((b * b) + (c * (a * -4.0))))
t_2 = (t_1 - b) / (2.0 * a)
tmp = 0
if b >= 0.0:
tmp = (2.0 * c) / (-b - t_1)
else:
tmp = t_2
t_3 = tmp
tmp_2 = 0
if t_3 <= -math.inf:
tmp_3 = 0
if b >= 0.0:
tmp_3 = t_0
else:
tmp_3 = (b * -2.0) / (2.0 * a)
tmp_2 = tmp_3
elif t_3 <= -4e-187:
tmp_2 = t_3
elif t_3 <= 0.0:
tmp_4 = 0
if b >= 0.0:
tmp_4 = t_0
else:
tmp_4 = t_2
tmp_2 = tmp_4
elif t_3 <= 1e+279:
tmp_2 = t_3
elif b >= 0.0:
tmp_2 = t_0
else:
tmp_2 = (c / b) - (b / a)
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 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - b))
t_1 = sqrt(Float64(Float64(b * b) + Float64(c * Float64(a * -4.0))))
t_2 = Float64(Float64(t_1 - b) / Float64(2.0 * a))
tmp = 0.0
if (b >= 0.0)
tmp = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_1));
else
tmp = t_2;
end
t_3 = tmp
tmp_2 = 0.0
if (t_3 <= Float64(-Inf))
tmp_3 = 0.0
if (b >= 0.0)
tmp_3 = t_0;
else
tmp_3 = Float64(Float64(b * -2.0) / Float64(2.0 * a));
end
tmp_2 = tmp_3;
elseif (t_3 <= -4e-187)
tmp_2 = t_3;
elseif (t_3 <= 0.0)
tmp_4 = 0.0
if (b >= 0.0)
tmp_4 = t_0;
else
tmp_4 = t_2;
end
tmp_2 = tmp_4;
elseif (t_3 <= 1e+279)
tmp_2 = t_3;
elseif (b >= 0.0)
tmp_2 = t_0;
else
tmp_2 = Float64(Float64(c / b) - Float64(b / a));
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_6 = code(a, b, c)
t_0 = (2.0 * c) / (-b - b);
t_1 = sqrt(((b * b) + (c * (a * -4.0))));
t_2 = (t_1 - b) / (2.0 * a);
tmp = 0.0;
if (b >= 0.0)
tmp = (2.0 * c) / (-b - t_1);
else
tmp = t_2;
end
t_3 = tmp;
tmp_3 = 0.0;
if (t_3 <= -Inf)
tmp_4 = 0.0;
if (b >= 0.0)
tmp_4 = t_0;
else
tmp_4 = (b * -2.0) / (2.0 * a);
end
tmp_3 = tmp_4;
elseif (t_3 <= -4e-187)
tmp_3 = t_3;
elseif (t_3 <= 0.0)
tmp_5 = 0.0;
if (b >= 0.0)
tmp_5 = t_0;
else
tmp_5 = t_2;
end
tmp_3 = tmp_5;
elseif (t_3 <= 1e+279)
tmp_3 = t_3;
elseif (b >= 0.0)
tmp_3 = t_0;
else
tmp_3 = (c / b) - (b / a);
end
tmp_6 = 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
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))) < -4.0000000000000001e-187 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))) < 1.00000000000000006e279
if -4.0000000000000001e-187 < (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
if 1.00000000000000006e279 < (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)))
herbie shell --seed 2023073
(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))))