
(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(4.0 * Float64(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[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{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(4.0 * Float64(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[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}
\end{array}
(FPCore (a b c)
:precision binary64
(if (<= b -1.08e-120)
(/ (- c) b)
(if (<= b 2.2e+114)
(* -0.5 (/ (+ b (sqrt (fma a (* c -4.0) (* b b)))) a))
(- (/ c b) (/ b a)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.08e-120) {
tmp = -c / b;
} else if (b <= 2.2e+114) {
tmp = -0.5 * ((b + sqrt(fma(a, (c * -4.0), (b * b)))) / a);
} else {
tmp = (c / b) - (b / a);
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -1.08e-120) tmp = Float64(Float64(-c) / b); elseif (b <= 2.2e+114) tmp = Float64(-0.5 * Float64(Float64(b + sqrt(fma(a, Float64(c * -4.0), Float64(b * b)))) / a)); else tmp = Float64(Float64(c / b) - Float64(b / a)); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -1.08e-120], N[((-c) / b), $MachinePrecision], If[LessEqual[b, 2.2e+114], N[(-0.5 * N[(N[(b + N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.08 \cdot 10^{-120}:\\
\;\;\;\;\frac{-c}{b}\\
\mathbf{elif}\;b \leq 2.2 \cdot 10^{+114}:\\
\;\;\;\;-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\end{array}
\end{array}
if b < -1.0800000000000001e-120Initial program 16.5%
Taylor expanded in b around -inf 83.8%
associate-*r/83.8%
neg-mul-183.8%
Simplified83.8%
if -1.0800000000000001e-120 < b < 2.2e114Initial program 81.2%
sub-neg81.2%
distribute-neg-out81.2%
neg-mul-181.2%
times-frac82.1%
metadata-eval82.1%
sub-neg82.1%
+-commutative82.1%
*-commutative82.1%
distribute-lft-neg-in82.1%
distribute-rgt-neg-out82.1%
associate-*l*81.2%
fma-def81.2%
distribute-lft-neg-in81.2%
distribute-rgt-neg-in81.2%
metadata-eval81.2%
Simplified81.2%
if 2.2e114 < b Initial program 54.4%
Taylor expanded in b around inf 98.0%
+-commutative98.0%
mul-1-neg98.0%
unsub-neg98.0%
Simplified98.0%
Final simplification85.3%
(FPCore (a b c)
:precision binary64
(if (<= b -2.1e-119)
(/ (- c) b)
(if (<= b 2e+114)
(/ (- (- b) (sqrt (- (* b b) (* 4.0 (* c a))))) (* a 2.0))
(- (/ c b) (/ b a)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.1e-119) {
tmp = -c / b;
} else if (b <= 2e+114) {
tmp = (-b - sqrt(((b * b) - (4.0 * (c * a))))) / (a * 2.0);
} else {
tmp = (c / b) - (b / 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) :: tmp
if (b <= (-2.1d-119)) then
tmp = -c / b
else if (b <= 2d+114) then
tmp = (-b - sqrt(((b * b) - (4.0d0 * (c * a))))) / (a * 2.0d0)
else
tmp = (c / b) - (b / a)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -2.1e-119) {
tmp = -c / b;
} else if (b <= 2e+114) {
tmp = (-b - Math.sqrt(((b * b) - (4.0 * (c * a))))) / (a * 2.0);
} else {
tmp = (c / b) - (b / a);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.1e-119: tmp = -c / b elif b <= 2e+114: tmp = (-b - math.sqrt(((b * b) - (4.0 * (c * a))))) / (a * 2.0) else: tmp = (c / b) - (b / a) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.1e-119) tmp = Float64(Float64(-c) / b); elseif (b <= 2e+114) tmp = Float64(Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(c * a))))) / Float64(a * 2.0)); else tmp = Float64(Float64(c / b) - Float64(b / a)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.1e-119) tmp = -c / b; elseif (b <= 2e+114) tmp = (-b - sqrt(((b * b) - (4.0 * (c * a))))) / (a * 2.0); else tmp = (c / b) - (b / a); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.1e-119], N[((-c) / b), $MachinePrecision], If[LessEqual[b, 2e+114], N[(N[((-b) - N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(4.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.1 \cdot 10^{-119}:\\
\;\;\;\;\frac{-c}{b}\\
\mathbf{elif}\;b \leq 2 \cdot 10^{+114}:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\end{array}
\end{array}
if b < -2.1e-119Initial program 16.5%
Taylor expanded in b around -inf 83.8%
associate-*r/83.8%
neg-mul-183.8%
Simplified83.8%
if -2.1e-119 < b < 2e114Initial program 81.2%
if 2e114 < b Initial program 54.4%
Taylor expanded in b around inf 98.0%
+-commutative98.0%
mul-1-neg98.0%
unsub-neg98.0%
Simplified98.0%
Final simplification85.3%
(FPCore (a b c)
:precision binary64
(if (<= b -3.7e-125)
(/ (- c) b)
(if (<= b 1.22e-33)
(* -0.5 (/ (+ b (sqrt (* -4.0 (* c a)))) a))
(- (/ c b) (/ b a)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -3.7e-125) {
tmp = -c / b;
} else if (b <= 1.22e-33) {
tmp = -0.5 * ((b + sqrt((-4.0 * (c * a)))) / a);
} else {
tmp = (c / b) - (b / 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) :: tmp
if (b <= (-3.7d-125)) then
tmp = -c / b
else if (b <= 1.22d-33) then
tmp = (-0.5d0) * ((b + sqrt(((-4.0d0) * (c * a)))) / a)
else
tmp = (c / b) - (b / a)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -3.7e-125) {
tmp = -c / b;
} else if (b <= 1.22e-33) {
tmp = -0.5 * ((b + Math.sqrt((-4.0 * (c * a)))) / a);
} else {
tmp = (c / b) - (b / a);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -3.7e-125: tmp = -c / b elif b <= 1.22e-33: tmp = -0.5 * ((b + math.sqrt((-4.0 * (c * a)))) / a) else: tmp = (c / b) - (b / a) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -3.7e-125) tmp = Float64(Float64(-c) / b); elseif (b <= 1.22e-33) tmp = Float64(-0.5 * Float64(Float64(b + sqrt(Float64(-4.0 * Float64(c * a)))) / a)); else tmp = Float64(Float64(c / b) - Float64(b / a)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -3.7e-125) tmp = -c / b; elseif (b <= 1.22e-33) tmp = -0.5 * ((b + sqrt((-4.0 * (c * a)))) / a); else tmp = (c / b) - (b / a); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -3.7e-125], N[((-c) / b), $MachinePrecision], If[LessEqual[b, 1.22e-33], N[(-0.5 * N[(N[(b + N[Sqrt[N[(-4.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.7 \cdot 10^{-125}:\\
\;\;\;\;\frac{-c}{b}\\
\mathbf{elif}\;b \leq 1.22 \cdot 10^{-33}:\\
\;\;\;\;-0.5 \cdot \frac{b + \sqrt{-4 \cdot \left(c \cdot a\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\end{array}
\end{array}
if b < -3.6999999999999999e-125Initial program 16.5%
Taylor expanded in b around -inf 83.8%
associate-*r/83.8%
neg-mul-183.8%
Simplified83.8%
if -3.6999999999999999e-125 < b < 1.22e-33Initial program 77.5%
sub-neg77.5%
distribute-neg-out77.5%
neg-mul-177.5%
times-frac77.5%
metadata-eval77.5%
sub-neg77.5%
+-commutative77.5%
*-commutative77.5%
distribute-lft-neg-in77.5%
distribute-rgt-neg-out77.5%
associate-*l*76.1%
fma-def76.1%
distribute-lft-neg-in76.1%
distribute-rgt-neg-in76.1%
metadata-eval76.1%
Simplified76.1%
Taylor expanded in a around inf 72.2%
if 1.22e-33 < b Initial program 69.0%
Taylor expanded in b around inf 91.6%
+-commutative91.6%
mul-1-neg91.6%
unsub-neg91.6%
Simplified91.6%
Final simplification83.1%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (/ (- c) b) (- (/ c b) (/ b a))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = -c / b;
} else {
tmp = (c / b) - (b / 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) :: tmp
if (b <= (-5d-310)) then
tmp = -c / b
else
tmp = (c / b) - (b / a)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = -c / b;
} else {
tmp = (c / b) - (b / a);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = -c / b else: tmp = (c / b) - (b / a) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(-c) / b); else tmp = Float64(Float64(c / b) - Float64(b / a)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = -c / b; else tmp = (c / b) - (b / a); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[((-c) / b), $MachinePrecision], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{-c}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 27.1%
Taylor expanded in b around -inf 68.4%
associate-*r/68.4%
neg-mul-168.4%
Simplified68.4%
if -4.999999999999985e-310 < b Initial program 74.6%
Taylor expanded in b around inf 66.7%
+-commutative66.7%
mul-1-neg66.7%
unsub-neg66.7%
Simplified66.7%
Final simplification67.6%
(FPCore (a b c) :precision binary64 (if (<= b -29000000.0) (/ c b) (/ (- b) a)))
double code(double a, double b, double c) {
double tmp;
if (b <= -29000000.0) {
tmp = c / b;
} else {
tmp = -b / 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) :: tmp
if (b <= (-29000000.0d0)) then
tmp = c / b
else
tmp = -b / a
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -29000000.0) {
tmp = c / b;
} else {
tmp = -b / a;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -29000000.0: tmp = c / b else: tmp = -b / a return tmp
function code(a, b, c) tmp = 0.0 if (b <= -29000000.0) tmp = Float64(c / b); else tmp = Float64(Float64(-b) / a); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -29000000.0) tmp = c / b; else tmp = -b / a; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -29000000.0], N[(c / b), $MachinePrecision], N[((-b) / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -29000000:\\
\;\;\;\;\frac{c}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{-b}{a}\\
\end{array}
\end{array}
if b < -2.9e7Initial program 8.9%
clear-num8.9%
inv-pow8.9%
Applied egg-rr4.7%
unpow-14.7%
Simplified4.7%
Taylor expanded in a around 0 30.6%
if -2.9e7 < b Initial program 67.4%
Taylor expanded in b around inf 45.7%
associate-*r/45.7%
mul-1-neg45.7%
Simplified45.7%
Final simplification41.1%
(FPCore (a b c) :precision binary64 (if (<= b -3.5e-308) (/ (- c) b) (/ (- b) a)))
double code(double a, double b, double c) {
double tmp;
if (b <= -3.5e-308) {
tmp = -c / b;
} else {
tmp = -b / 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) :: tmp
if (b <= (-3.5d-308)) then
tmp = -c / b
else
tmp = -b / a
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -3.5e-308) {
tmp = -c / b;
} else {
tmp = -b / a;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -3.5e-308: tmp = -c / b else: tmp = -b / a return tmp
function code(a, b, c) tmp = 0.0 if (b <= -3.5e-308) tmp = Float64(Float64(-c) / b); else tmp = Float64(Float64(-b) / a); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -3.5e-308) tmp = -c / b; else tmp = -b / a; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -3.5e-308], N[((-c) / b), $MachinePrecision], N[((-b) / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.5 \cdot 10^{-308}:\\
\;\;\;\;\frac{-c}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{-b}{a}\\
\end{array}
\end{array}
if b < -3.5e-308Initial program 26.5%
Taylor expanded in b around -inf 68.8%
associate-*r/68.8%
neg-mul-168.8%
Simplified68.8%
if -3.5e-308 < b Initial program 74.8%
Taylor expanded in b around inf 65.8%
associate-*r/65.8%
mul-1-neg65.8%
Simplified65.8%
Final simplification67.4%
(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 49.3%
clear-num49.2%
inv-pow49.2%
Applied egg-rr31.8%
unpow-131.8%
Simplified31.8%
Taylor expanded in a around 0 11.5%
Final simplification11.5%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (sqrt (- (* b b) (* 4.0 (* a c))))))
(if (< b 0.0)
(/ c (* a (/ (+ (- b) t_0) (* 2.0 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 = c / (a * ((-b + t_0) / (2.0 * a)));
} else {
tmp = (-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 = c / (a * ((-b + t_0) / (2.0d0 * a)))
else
tmp = (-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 = c / (a * ((-b + t_0) / (2.0 * a)));
} else {
tmp = (-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 = c / (a * ((-b + t_0) / (2.0 * a))) else: tmp = (-b - t_0) / (2.0 * a) return tmp
function code(a, b, c) t_0 = sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(a * c)))) tmp = 0.0 if (b < 0.0) tmp = Float64(c / Float64(a * Float64(Float64(Float64(-b) + t_0) / Float64(2.0 * a)))); else tmp = 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 = c / (a * ((-b + t_0) / (2.0 * a))); else tmp = (-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[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Less[b, 0.0], N[(c / N[(a * N[(N[((-b) + t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-b) - t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\\
\mathbf{if}\;b < 0:\\
\;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) + t_0}{2 \cdot a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) - t_0}{2 \cdot a}\\
\end{array}
\end{array}
herbie shell --seed 2024024
(FPCore (a b c)
:name "The quadratic formula (r2)"
:precision binary64
:herbie-target
(if (< b 0.0) (/ c (* a (/ (+ (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))) (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))
(/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))