(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
(if (>= b 0.0) (/ (* 2.0 c) (- (- b) b)) (+ (- (/ b a)) (/ c b)))))
(if (<= b -1.15e+149)
t_0
(if (<= b 1.35e+113)
(if (>= b 0.0)
(/ (* 2.0 c) (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))))
(/ (- (sqrt (- (* b b) (* a (* c 4.0)))) b) (* 2.0 a)))
t_0))))
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 tmp;
if (b >= 0.0) {
tmp = (2.0 * c) / (-b - b);
} else {
tmp = -(b / a) + (c / b);
}
double t_0 = tmp;
double tmp_1;
if (b <= -1.15e+149) {
tmp_1 = t_0;
} else if (b <= 1.35e+113) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = (2.0 * c) / (-b - sqrt(((b * b) - ((4.0 * a) * c))));
} else {
tmp_2 = (sqrt(((b * b) - (a * (c * 4.0)))) - b) / (2.0 * a);
}
tmp_1 = tmp_2;
} else {
tmp_1 = t_0;
}
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
if (b >= 0.0d0) then
tmp = (2.0d0 * c) / (-b - b)
else
tmp = -(b / a) + (c / b)
end if
t_0 = tmp
if (b <= (-1.15d+149)) then
tmp_1 = t_0
else if (b <= 1.35d+113) then
if (b >= 0.0d0) then
tmp_2 = (2.0d0 * c) / (-b - sqrt(((b * b) - ((4.0d0 * a) * c))))
else
tmp_2 = (sqrt(((b * b) - (a * (c * 4.0d0)))) - b) / (2.0d0 * a)
end if
tmp_1 = tmp_2
else
tmp_1 = t_0
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 tmp;
if (b >= 0.0) {
tmp = (2.0 * c) / (-b - b);
} else {
tmp = -(b / a) + (c / b);
}
double t_0 = tmp;
double tmp_1;
if (b <= -1.15e+149) {
tmp_1 = t_0;
} else if (b <= 1.35e+113) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = (2.0 * c) / (-b - Math.sqrt(((b * b) - ((4.0 * a) * c))));
} else {
tmp_2 = (Math.sqrt(((b * b) - (a * (c * 4.0)))) - b) / (2.0 * a);
}
tmp_1 = tmp_2;
} else {
tmp_1 = t_0;
}
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):
tmp = 0
if b >= 0.0:
tmp = (2.0 * c) / (-b - b)
else:
tmp = -(b / a) + (c / b)
t_0 = tmp
tmp_1 = 0
if b <= -1.15e+149:
tmp_1 = t_0
elif b <= 1.35e+113:
tmp_2 = 0
if b >= 0.0:
tmp_2 = (2.0 * c) / (-b - math.sqrt(((b * b) - ((4.0 * a) * c))))
else:
tmp_2 = (math.sqrt(((b * b) - (a * (c * 4.0)))) - b) / (2.0 * a)
tmp_1 = tmp_2
else:
tmp_1 = t_0
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)
tmp = 0.0
if (b >= 0.0)
tmp = Float64(Float64(2.0 * c) / Float64(Float64(-b) - b));
else
tmp = Float64(Float64(-Float64(b / a)) + Float64(c / b));
end
t_0 = tmp
tmp_1 = 0.0
if (b <= -1.15e+149)
tmp_1 = t_0;
elseif (b <= 1.35e+113)
tmp_2 = 0.0
if (b >= 0.0)
tmp_2 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))));
else
tmp_2 = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(a * Float64(c * 4.0)))) - b) / Float64(2.0 * a));
end
tmp_1 = tmp_2;
else
tmp_1 = t_0;
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)
tmp = 0.0;
if (b >= 0.0)
tmp = (2.0 * c) / (-b - b);
else
tmp = -(b / a) + (c / b);
end
t_0 = tmp;
tmp_2 = 0.0;
if (b <= -1.15e+149)
tmp_2 = t_0;
elseif (b <= 1.35e+113)
tmp_3 = 0.0;
if (b >= 0.0)
tmp_3 = (2.0 * c) / (-b - sqrt(((b * b) - ((4.0 * a) * c))));
else
tmp_3 = (sqrt(((b * b) - (a * (c * 4.0)))) - b) / (2.0 * a);
end
tmp_2 = tmp_3;
else
tmp_2 = t_0;
end
tmp_4 = tmp_2;
end
herbie shell --seed 2023077
(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))))