
(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (-b + sqrt(((b * b) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
return (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
def code(a, b, c): return (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
function code(a, b, c) return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a)) end
function tmp = code(a, b, c) tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a); end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (-b + sqrt(((b * b) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
return (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
def code(a, b, c): return (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
function code(a, b, c) return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a)) end
function tmp = code(a, b, c) tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a); end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\end{array}
(FPCore (a b c)
:precision binary64
(if (<= b -3.15e+94)
(/ b (- a))
(if (<= b 6e-173)
(/ (- (sqrt (fma a (* c -4.0) (* b b))) b) (* a 2.0))
(/ c (- b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -3.15e+94) {
tmp = b / -a;
} else if (b <= 6e-173) {
tmp = (sqrt(fma(a, (c * -4.0), (b * b))) - b) / (a * 2.0);
} else {
tmp = c / -b;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -3.15e+94) tmp = Float64(b / Float64(-a)); elseif (b <= 6e-173) tmp = Float64(Float64(sqrt(fma(a, Float64(c * -4.0), Float64(b * b))) - b) / Float64(a * 2.0)); else tmp = Float64(c / Float64(-b)); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -3.15e+94], N[(b / (-a)), $MachinePrecision], If[LessEqual[b, 6e-173], N[(N[(N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(c / (-b)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.15 \cdot 10^{+94}:\\
\;\;\;\;\frac{b}{-a}\\
\mathbf{elif}\;b \leq 6 \cdot 10^{-173}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{-b}\\
\end{array}
\end{array}
if b < -3.15e94Initial program 65.3%
*-commutative65.3%
Simplified65.3%
Taylor expanded in b around -inf 94.6%
mul-1-neg94.6%
distribute-neg-frac294.6%
Simplified94.6%
if -3.15e94 < b < 6.0000000000000002e-173Initial program 88.1%
*-commutative88.1%
Simplified88.1%
if 6.0000000000000002e-173 < b Initial program 18.7%
*-commutative18.7%
Simplified18.7%
Taylor expanded in b around inf 83.4%
mul-1-neg83.4%
distribute-neg-frac83.4%
Simplified83.4%
Final simplification88.2%
(FPCore (a b c)
:precision binary64
(if (<= b -3e+94)
(/ b (- a))
(if (<= b 6e-173)
(/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) (* a 2.0))
(/ c (- b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -3e+94) {
tmp = b / -a;
} else if (b <= 6e-173) {
tmp = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
} else {
tmp = c / -b;
}
return tmp;
}
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 <= (-3d+94)) then
tmp = b / -a
else if (b <= 6d-173) then
tmp = (sqrt(((b * b) - (c * (a * 4.0d0)))) - b) / (a * 2.0d0)
else
tmp = c / -b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -3e+94) {
tmp = b / -a;
} else if (b <= 6e-173) {
tmp = (Math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
} else {
tmp = c / -b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -3e+94: tmp = b / -a elif b <= 6e-173: tmp = (math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0) else: tmp = c / -b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -3e+94) tmp = Float64(b / Float64(-a)); elseif (b <= 6e-173) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b) / Float64(a * 2.0)); else tmp = Float64(c / Float64(-b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -3e+94) tmp = b / -a; elseif (b <= 6e-173) tmp = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0); else tmp = c / -b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -3e+94], N[(b / (-a)), $MachinePrecision], If[LessEqual[b, 6e-173], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(c / (-b)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3 \cdot 10^{+94}:\\
\;\;\;\;\frac{b}{-a}\\
\mathbf{elif}\;b \leq 6 \cdot 10^{-173}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{-b}\\
\end{array}
\end{array}
if b < -3.0000000000000001e94Initial program 65.3%
*-commutative65.3%
Simplified65.3%
Taylor expanded in b around -inf 94.6%
mul-1-neg94.6%
distribute-neg-frac294.6%
Simplified94.6%
if -3.0000000000000001e94 < b < 6.0000000000000002e-173Initial program 88.1%
if 6.0000000000000002e-173 < b Initial program 18.7%
*-commutative18.7%
Simplified18.7%
Taylor expanded in b around inf 83.4%
mul-1-neg83.4%
distribute-neg-frac83.4%
Simplified83.4%
Final simplification88.2%
(FPCore (a b c) :precision binary64 (if (<= b -4.4e-89) (- (/ c b) (/ b a)) (if (<= b 6e-173) (* (/ 0.5 a) (- (sqrt (* a (* c -4.0))) b)) (/ c (- b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4.4e-89) {
tmp = (c / b) - (b / a);
} else if (b <= 6e-173) {
tmp = (0.5 / a) * (sqrt((a * (c * -4.0))) - b);
} else {
tmp = c / -b;
}
return tmp;
}
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 <= (-4.4d-89)) then
tmp = (c / b) - (b / a)
else if (b <= 6d-173) then
tmp = (0.5d0 / a) * (sqrt((a * (c * (-4.0d0)))) - b)
else
tmp = c / -b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -4.4e-89) {
tmp = (c / b) - (b / a);
} else if (b <= 6e-173) {
tmp = (0.5 / a) * (Math.sqrt((a * (c * -4.0))) - b);
} else {
tmp = c / -b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4.4e-89: tmp = (c / b) - (b / a) elif b <= 6e-173: tmp = (0.5 / a) * (math.sqrt((a * (c * -4.0))) - b) else: tmp = c / -b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4.4e-89) tmp = Float64(Float64(c / b) - Float64(b / a)); elseif (b <= 6e-173) tmp = Float64(Float64(0.5 / a) * Float64(sqrt(Float64(a * Float64(c * -4.0))) - b)); else tmp = Float64(c / Float64(-b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4.4e-89) tmp = (c / b) - (b / a); elseif (b <= 6e-173) tmp = (0.5 / a) * (sqrt((a * (c * -4.0))) - b); else tmp = c / -b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4.4e-89], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e-173], N[(N[(0.5 / a), $MachinePrecision] * N[(N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision], N[(c / (-b)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.4 \cdot 10^{-89}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\mathbf{elif}\;b \leq 6 \cdot 10^{-173}:\\
\;\;\;\;\frac{0.5}{a} \cdot \left(\sqrt{a \cdot \left(c \cdot -4\right)} - b\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{-b}\\
\end{array}
\end{array}
if b < -4.40000000000000024e-89Initial program 79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in b around -inf 86.2%
+-commutative86.2%
mul-1-neg86.2%
unsub-neg86.2%
Simplified86.2%
if -4.40000000000000024e-89 < b < 6.0000000000000002e-173Initial program 76.6%
*-commutative76.6%
Simplified76.6%
Applied egg-rr76.5%
sub-neg76.5%
distribute-rgt-out--76.5%
Simplified76.5%
Taylor expanded in a around inf 72.4%
*-commutative72.4%
associate-*r*72.4%
Simplified72.4%
if 6.0000000000000002e-173 < b Initial program 18.7%
*-commutative18.7%
Simplified18.7%
Taylor expanded in b around inf 83.4%
mul-1-neg83.4%
distribute-neg-frac83.4%
Simplified83.4%
Final simplification82.5%
(FPCore (a b c) :precision binary64 (if (<= b -1e-310) (- (/ c b) (/ b a)) (/ c (- b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1e-310) {
tmp = (c / b) - (b / a);
} else {
tmp = c / -b;
}
return tmp;
}
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 <= (-1d-310)) then
tmp = (c / b) - (b / a)
else
tmp = c / -b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1e-310) {
tmp = (c / b) - (b / a);
} else {
tmp = c / -b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1e-310: tmp = (c / b) - (b / a) else: tmp = c / -b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1e-310) tmp = Float64(Float64(c / b) - Float64(b / a)); else tmp = Float64(c / Float64(-b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1e-310) tmp = (c / b) - (b / a); else tmp = c / -b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1e-310], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], N[(c / (-b)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{-b}\\
\end{array}
\end{array}
if b < -9.999999999999969e-311Initial program 78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in b around -inf 70.6%
+-commutative70.6%
mul-1-neg70.6%
unsub-neg70.6%
Simplified70.6%
if -9.999999999999969e-311 < b Initial program 28.0%
*-commutative28.0%
Simplified28.0%
Taylor expanded in b around inf 71.7%
mul-1-neg71.7%
distribute-neg-frac71.7%
Simplified71.7%
Final simplification71.1%
(FPCore (a b c) :precision binary64 (if (<= b 13.6) (/ b (- a)) (/ c b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 13.6) {
tmp = b / -a;
} else {
tmp = c / b;
}
return tmp;
}
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 <= 13.6d0) then
tmp = b / -a
else
tmp = c / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 13.6) {
tmp = b / -a;
} else {
tmp = c / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 13.6: tmp = b / -a else: tmp = c / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 13.6) tmp = Float64(b / Float64(-a)); else tmp = Float64(c / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 13.6) tmp = b / -a; else tmp = c / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 13.6], N[(b / (-a)), $MachinePrecision], N[(c / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 13.6:\\
\;\;\;\;\frac{b}{-a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b}\\
\end{array}
\end{array}
if b < 13.5999999999999996Initial program 73.3%
*-commutative73.3%
Simplified73.3%
Taylor expanded in b around -inf 55.4%
mul-1-neg55.4%
distribute-neg-frac255.4%
Simplified55.4%
if 13.5999999999999996 < b Initial program 11.2%
*-commutative11.2%
Simplified11.2%
Taylor expanded in b around inf 78.9%
clear-num77.3%
inv-pow77.3%
*-commutative77.3%
times-frac77.3%
metadata-eval77.3%
associate-/l*80.4%
Applied egg-rr80.4%
unpow-180.4%
associate-*r/80.4%
neg-mul-180.4%
Simplified80.4%
clear-num82.1%
associate-/l*80.5%
add-sqr-sqrt39.9%
sqrt-unprod37.6%
sqr-neg37.6%
sqrt-unprod13.1%
add-sqr-sqrt32.9%
Applied egg-rr32.9%
associate-*r/32.9%
associate-*l/32.7%
*-inverses32.7%
*-lft-identity32.7%
Simplified32.7%
Final simplification49.7%
(FPCore (a b c) :precision binary64 (if (<= b 4e-294) (/ b (- a)) (/ c (- b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 4e-294) {
tmp = b / -a;
} else {
tmp = c / -b;
}
return tmp;
}
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 <= 4d-294) then
tmp = b / -a
else
tmp = c / -b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 4e-294) {
tmp = b / -a;
} else {
tmp = c / -b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 4e-294: tmp = b / -a else: tmp = c / -b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 4e-294) tmp = Float64(b / Float64(-a)); else tmp = Float64(c / Float64(-b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 4e-294) tmp = b / -a; else tmp = c / -b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 4e-294], N[(b / (-a)), $MachinePrecision], N[(c / (-b)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4 \cdot 10^{-294}:\\
\;\;\;\;\frac{b}{-a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{-b}\\
\end{array}
\end{array}
if b < 4.00000000000000007e-294Initial program 78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in b around -inf 69.7%
mul-1-neg69.7%
distribute-neg-frac269.7%
Simplified69.7%
if 4.00000000000000007e-294 < b Initial program 27.3%
*-commutative27.3%
Simplified27.3%
Taylor expanded in b around inf 72.4%
mul-1-neg72.4%
distribute-neg-frac72.4%
Simplified72.4%
Final simplification70.8%
(FPCore (a b c) :precision binary64 (/ c b))
double code(double a, double b, double c) {
return c / b;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c / b
end function
public static double code(double a, double b, double c) {
return c / b;
}
def code(a, b, c): return c / b
function code(a, b, c) return Float64(c / b) end
function tmp = code(a, b, c) tmp = c / b; end
code[a_, b_, c_] := N[(c / b), $MachinePrecision]
\begin{array}{l}
\\
\frac{c}{b}
\end{array}
Initial program 57.5%
*-commutative57.5%
Simplified57.5%
Taylor expanded in b around inf 25.1%
clear-num24.7%
inv-pow24.7%
*-commutative24.7%
times-frac24.7%
metadata-eval24.7%
associate-/l*26.9%
Applied egg-rr26.9%
unpow-126.9%
associate-*r/26.9%
neg-mul-126.9%
Simplified26.9%
clear-num27.3%
associate-/l*27.4%
add-sqr-sqrt14.2%
sqrt-unprod15.2%
sqr-neg15.2%
sqrt-unprod5.0%
add-sqr-sqrt11.2%
Applied egg-rr11.2%
associate-*r/10.9%
associate-*l/10.9%
*-inverses10.9%
*-lft-identity10.9%
Simplified10.9%
Final simplification10.9%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (sqrt (- (* b b) (* (* 4.0 a) c)))))
(if (< b 0.0)
(/ (+ (- b) t_0) (* 2.0 a))
(/ c (* a (/ (- (- b) t_0) (* 2.0 a)))))))
double code(double a, double b, double c) {
double t_0 = sqrt(((b * b) - ((4.0 * a) * c)));
double tmp;
if (b < 0.0) {
tmp = (-b + t_0) / (2.0 * a);
} else {
tmp = c / (a * ((-b - t_0) / (2.0 * a)));
}
return tmp;
}
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
t_0 = sqrt(((b * b) - ((4.0d0 * a) * c)))
if (b < 0.0d0) then
tmp = (-b + t_0) / (2.0d0 * a)
else
tmp = c / (a * ((-b - t_0) / (2.0d0 * a)))
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double t_0 = Math.sqrt(((b * b) - ((4.0 * a) * c)));
double tmp;
if (b < 0.0) {
tmp = (-b + t_0) / (2.0 * a);
} else {
tmp = c / (a * ((-b - t_0) / (2.0 * a)));
}
return tmp;
}
def code(a, b, c): t_0 = math.sqrt(((b * b) - ((4.0 * a) * c))) tmp = 0 if b < 0.0: tmp = (-b + t_0) / (2.0 * a) else: tmp = c / (a * ((-b - t_0) / (2.0 * a))) return tmp
function code(a, b, c) t_0 = sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) tmp = 0.0 if (b < 0.0) tmp = Float64(Float64(Float64(-b) + t_0) / Float64(2.0 * a)); else tmp = Float64(c / Float64(a * Float64(Float64(Float64(-b) - t_0) / Float64(2.0 * a)))); end return tmp end
function tmp_2 = code(a, b, c) t_0 = sqrt(((b * b) - ((4.0 * a) * c))); tmp = 0.0; if (b < 0.0) tmp = (-b + t_0) / (2.0 * a); else tmp = c / (a * ((-b - t_0) / (2.0 * a))); end tmp_2 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Less[b, 0.0], N[(N[((-b) + t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], N[(c / N[(a * N[(N[((-b) - t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\
\mathbf{if}\;b < 0:\\
\;\;\;\;\frac{\left(-b\right) + t\_0}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) - t\_0}{2 \cdot a}}\\
\end{array}
\end{array}
herbie shell --seed 2024047
(FPCore (a b c)
:name "The quadratic formula (r1)"
:precision binary64
:alt
(if (< b 0.0) (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)) (/ c (* a (/ (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))