(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))))))
(if (or (<= b -2e+73) (not (<= b 1.7e+71)))
(if (>= b 0.0) (/ (* 2.0 c) (- (+ b b))) (- (/ c b) (/ b a)))
(if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_0)) (/ (- t_0 b) (* 2.0 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;
}
↓
double code(double a, double b, double c) {
double t_0 = sqrt(((b * b) + (c * (a * -4.0))));
double tmp_1;
if ((b <= -2e+73) || !(b <= 1.7e+71)) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = (2.0 * c) / -(b + b);
} else {
tmp_2 = (c / b) - (b / a);
}
tmp_1 = tmp_2;
} else if (b >= 0.0) {
tmp_1 = (2.0 * c) / (-b - t_0);
} else {
tmp_1 = (t_0 - b) / (2.0 * a);
}
return tmp_1;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b >= 0.0d0) then
tmp = (2.0d0 * c) / (-b - sqrt(((b * b) - ((4.0d0 * a) * c))))
else
tmp = (-b + sqrt(((b * b) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end if
code = tmp
end function
↓
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_0
real(8) :: tmp
real(8) :: tmp_1
real(8) :: tmp_2
t_0 = sqrt(((b * b) + (c * (a * (-4.0d0)))))
if ((b <= (-2d+73)) .or. (.not. (b <= 1.7d+71))) then
if (b >= 0.0d0) then
tmp_2 = (2.0d0 * c) / -(b + b)
else
tmp_2 = (c / b) - (b / a)
end if
tmp_1 = tmp_2
else if (b >= 0.0d0) then
tmp_1 = (2.0d0 * c) / (-b - t_0)
else
tmp_1 = (t_0 - b) / (2.0d0 * a)
end if
code = tmp_1
end function
public static double code(double a, double b, double c) {
double tmp;
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;
}
↓
public static double code(double a, double b, double c) {
double t_0 = Math.sqrt(((b * b) + (c * (a * -4.0))));
double tmp_1;
if ((b <= -2e+73) || !(b <= 1.7e+71)) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = (2.0 * c) / -(b + b);
} else {
tmp_2 = (c / b) - (b / a);
}
tmp_1 = tmp_2;
} else if (b >= 0.0) {
tmp_1 = (2.0 * c) / (-b - t_0);
} else {
tmp_1 = (t_0 - b) / (2.0 * a);
}
return tmp_1;
}
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_1 = 0
if (b <= -2e+73) or not (b <= 1.7e+71):
tmp_2 = 0
if b >= 0.0:
tmp_2 = (2.0 * c) / -(b + b)
else:
tmp_2 = (c / b) - (b / a)
tmp_1 = tmp_2
elif b >= 0.0:
tmp_1 = (2.0 * c) / (-b - t_0)
else:
tmp_1 = (t_0 - b) / (2.0 * a)
return tmp_1
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_1 = 0.0
if ((b <= -2e+73) || !(b <= 1.7e+71))
tmp_2 = 0.0
if (b >= 0.0)
tmp_2 = Float64(Float64(2.0 * c) / Float64(-Float64(b + b)));
else
tmp_2 = Float64(Float64(c / b) - Float64(b / a));
end
tmp_1 = tmp_2;
elseif (b >= 0.0)
tmp_1 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_0));
else
tmp_1 = Float64(Float64(t_0 - b) / Float64(2.0 * a));
end
return tmp_1
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_4 = code(a, b, c)
t_0 = sqrt(((b * b) + (c * (a * -4.0))));
tmp_2 = 0.0;
if ((b <= -2e+73) || ~((b <= 1.7e+71)))
tmp_3 = 0.0;
if (b >= 0.0)
tmp_3 = (2.0 * c) / -(b + b);
else
tmp_3 = (c / b) - (b / a);
end
tmp_2 = tmp_3;
elseif (b >= 0.0)
tmp_2 = (2.0 * c) / (-b - t_0);
else
tmp_2 = (t_0 - b) / (2.0 * a);
end
tmp_4 = tmp_2;
end
herbie shell --seed 2023126
(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))))