(FPCore (a b c)
:precision binary64
(if (>= b 0.0)
(/ (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a))
(/ (* 2.0 c) (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))))))
↓
(FPCore (a b c)
:precision binary64
(let* ((t_0 (/ (- (- b) b) (* a 2.0)))
(t_1 (sqrt (+ (* b b) (* c (* a -4.0))))))
(if (<= b -1.5061884147831686e+150)
(if (>= b 0.0) t_0 (/ (- c) b))
(if (<= b 1.12e-302)
(if (>= b 0.0) t_0 (/ (* c 2.0) (- t_1 b)))
(if (<= b 8.6e+122)
(if (>= b 0.0) (- (/ (+ b t_1) (* a 2.0))) (/ b a))
(if (>= b 0.0)
(- (/ c b) (/ b a))
(/ (* c 2.0) (- (- (* a (/ (* c 2.0) b)) b) b))))))))
double code(double a, double b, double c) {
double tmp;
if (b >= 0.0) {
tmp = (-b - sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
} else {
tmp = (2.0 * c) / (-b + sqrt(((b * b) - ((4.0 * a) * c))));
}
return tmp;
}
↓
double code(double a, double b, double c) {
double t_0 = (-b - b) / (a * 2.0);
double t_1 = sqrt(((b * b) + (c * (a * -4.0))));
double tmp_1;
if (b <= -1.5061884147831686e+150) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = t_0;
} else {
tmp_2 = -c / b;
}
tmp_1 = tmp_2;
} else if (b <= 1.12e-302) {
double tmp_3;
if (b >= 0.0) {
tmp_3 = t_0;
} else {
tmp_3 = (c * 2.0) / (t_1 - b);
}
tmp_1 = tmp_3;
} else if (b <= 8.6e+122) {
double tmp_4;
if (b >= 0.0) {
tmp_4 = -((b + t_1) / (a * 2.0));
} else {
tmp_4 = b / a;
}
tmp_1 = tmp_4;
} else if (b >= 0.0) {
tmp_1 = (c / b) - (b / a);
} else {
tmp_1 = (c * 2.0) / (((a * ((c * 2.0) / b)) - b) - b);
}
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 = (-b - sqrt(((b * b) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
else
tmp = (2.0d0 * c) / (-b + sqrt(((b * b) - ((4.0d0 * a) * c))))
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) :: t_1
real(8) :: tmp
real(8) :: tmp_1
real(8) :: tmp_2
real(8) :: tmp_3
real(8) :: tmp_4
t_0 = (-b - b) / (a * 2.0d0)
t_1 = sqrt(((b * b) + (c * (a * (-4.0d0)))))
if (b <= (-1.5061884147831686d+150)) then
if (b >= 0.0d0) then
tmp_2 = t_0
else
tmp_2 = -c / b
end if
tmp_1 = tmp_2
else if (b <= 1.12d-302) then
if (b >= 0.0d0) then
tmp_3 = t_0
else
tmp_3 = (c * 2.0d0) / (t_1 - b)
end if
tmp_1 = tmp_3
else if (b <= 8.6d+122) then
if (b >= 0.0d0) then
tmp_4 = -((b + t_1) / (a * 2.0d0))
else
tmp_4 = b / a
end if
tmp_1 = tmp_4
else if (b >= 0.0d0) then
tmp_1 = (c / b) - (b / a)
else
tmp_1 = (c * 2.0d0) / (((a * ((c * 2.0d0) / b)) - b) - b)
end if
code = tmp_1
end function
public static double code(double a, double b, double c) {
double tmp;
if (b >= 0.0) {
tmp = (-b - Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
} else {
tmp = (2.0 * c) / (-b + Math.sqrt(((b * b) - ((4.0 * a) * c))));
}
return tmp;
}
↓
public static double code(double a, double b, double c) {
double t_0 = (-b - b) / (a * 2.0);
double t_1 = Math.sqrt(((b * b) + (c * (a * -4.0))));
double tmp_1;
if (b <= -1.5061884147831686e+150) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = t_0;
} else {
tmp_2 = -c / b;
}
tmp_1 = tmp_2;
} else if (b <= 1.12e-302) {
double tmp_3;
if (b >= 0.0) {
tmp_3 = t_0;
} else {
tmp_3 = (c * 2.0) / (t_1 - b);
}
tmp_1 = tmp_3;
} else if (b <= 8.6e+122) {
double tmp_4;
if (b >= 0.0) {
tmp_4 = -((b + t_1) / (a * 2.0));
} else {
tmp_4 = b / a;
}
tmp_1 = tmp_4;
} else if (b >= 0.0) {
tmp_1 = (c / b) - (b / a);
} else {
tmp_1 = (c * 2.0) / (((a * ((c * 2.0) / b)) - b) - b);
}
return tmp_1;
}
def code(a, b, c):
tmp = 0
if b >= 0.0:
tmp = (-b - math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
else:
tmp = (2.0 * c) / (-b + math.sqrt(((b * b) - ((4.0 * a) * c))))
return tmp
↓
def code(a, b, c):
t_0 = (-b - b) / (a * 2.0)
t_1 = math.sqrt(((b * b) + (c * (a * -4.0))))
tmp_1 = 0
if b <= -1.5061884147831686e+150:
tmp_2 = 0
if b >= 0.0:
tmp_2 = t_0
else:
tmp_2 = -c / b
tmp_1 = tmp_2
elif b <= 1.12e-302:
tmp_3 = 0
if b >= 0.0:
tmp_3 = t_0
else:
tmp_3 = (c * 2.0) / (t_1 - b)
tmp_1 = tmp_3
elif b <= 8.6e+122:
tmp_4 = 0
if b >= 0.0:
tmp_4 = -((b + t_1) / (a * 2.0))
else:
tmp_4 = b / a
tmp_1 = tmp_4
elif b >= 0.0:
tmp_1 = (c / b) - (b / a)
else:
tmp_1 = (c * 2.0) / (((a * ((c * 2.0) / b)) - b) - b)
return tmp_1
function code(a, b, c)
tmp = 0.0
if (b >= 0.0)
tmp = Float64(Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a));
else
tmp = Float64(Float64(2.0 * c) / Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))));
end
return tmp
end
↓
function code(a, b, c)
t_0 = Float64(Float64(Float64(-b) - b) / Float64(a * 2.0))
t_1 = sqrt(Float64(Float64(b * b) + Float64(c * Float64(a * -4.0))))
tmp_1 = 0.0
if (b <= -1.5061884147831686e+150)
tmp_2 = 0.0
if (b >= 0.0)
tmp_2 = t_0;
else
tmp_2 = Float64(Float64(-c) / b);
end
tmp_1 = tmp_2;
elseif (b <= 1.12e-302)
tmp_3 = 0.0
if (b >= 0.0)
tmp_3 = t_0;
else
tmp_3 = Float64(Float64(c * 2.0) / Float64(t_1 - b));
end
tmp_1 = tmp_3;
elseif (b <= 8.6e+122)
tmp_4 = 0.0
if (b >= 0.0)
tmp_4 = Float64(-Float64(Float64(b + t_1) / Float64(a * 2.0)));
else
tmp_4 = Float64(b / a);
end
tmp_1 = tmp_4;
elseif (b >= 0.0)
tmp_1 = Float64(Float64(c / b) - Float64(b / a));
else
tmp_1 = Float64(Float64(c * 2.0) / Float64(Float64(Float64(a * Float64(Float64(c * 2.0) / b)) - b) - b));
end
return tmp_1
end
function tmp_2 = code(a, b, c)
tmp = 0.0;
if (b >= 0.0)
tmp = (-b - sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
else
tmp = (2.0 * c) / (-b + sqrt(((b * b) - ((4.0 * a) * c))));
end
tmp_2 = tmp;
end
↓
function tmp_6 = code(a, b, c)
t_0 = (-b - b) / (a * 2.0);
t_1 = sqrt(((b * b) + (c * (a * -4.0))));
tmp_2 = 0.0;
if (b <= -1.5061884147831686e+150)
tmp_3 = 0.0;
if (b >= 0.0)
tmp_3 = t_0;
else
tmp_3 = -c / b;
end
tmp_2 = tmp_3;
elseif (b <= 1.12e-302)
tmp_4 = 0.0;
if (b >= 0.0)
tmp_4 = t_0;
else
tmp_4 = (c * 2.0) / (t_1 - b);
end
tmp_2 = tmp_4;
elseif (b <= 8.6e+122)
tmp_5 = 0.0;
if (b >= 0.0)
tmp_5 = -((b + t_1) / (a * 2.0));
else
tmp_5 = b / a;
end
tmp_2 = tmp_5;
elseif (b >= 0.0)
tmp_2 = (c / b) - (b / a);
else
tmp_2 = (c * 2.0) / (((a * ((c * 2.0) / b)) - b) - b);
end
tmp_6 = tmp_2;
end
herbie shell --seed 2022317
(FPCore (a b c)
:name "jeff quadratic root 1"
:precision binary64
(if (>= b 0.0) (/ (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)) (/ (* 2.0 c) (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))))))