
(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 -7.5e+108)
(- (/ c b) (/ b a))
(if (<= b 3.6e-69)
(/ (- (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 <= -7.5e+108) {
tmp = (c / b) - (b / a);
} else if (b <= 3.6e-69) {
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 <= (-7.5d+108)) then
tmp = (c / b) - (b / a)
else if (b <= 3.6d-69) 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 <= -7.5e+108) {
tmp = (c / b) - (b / a);
} else if (b <= 3.6e-69) {
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 <= -7.5e+108: tmp = (c / b) - (b / a) elif b <= 3.6e-69: 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 <= -7.5e+108) tmp = Float64(Float64(c / b) - Float64(b / a)); elseif (b <= 3.6e-69) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b) / Float64(a * 2.0)); else tmp = Float64(Float64(-c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -7.5e+108) tmp = (c / b) - (b / a); elseif (b <= 3.6e-69) 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, -7.5e+108], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.6e-69], 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 -7.5 \cdot 10^{+108}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\mathbf{elif}\;b \leq 3.6 \cdot 10^{-69}:\\
\;\;\;\;\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 < -7.50000000000000039e108Initial program 49.4%
*-commutative49.4%
Simplified49.4%
Taylor expanded in b around -inf 93.4%
+-commutative93.4%
mul-1-neg93.4%
unsub-neg93.4%
Simplified93.4%
if -7.50000000000000039e108 < b < 3.60000000000000018e-69Initial program 85.9%
if 3.60000000000000018e-69 < b Initial program 15.8%
*-commutative15.8%
Simplified15.8%
Taylor expanded in b around inf 85.5%
mul-1-neg85.5%
distribute-neg-frac85.5%
Simplified85.5%
Final simplification87.4%
(FPCore (a b c)
:precision binary64
(if (<= b -4e-15)
(- (/ c b) (/ b a))
(if (<= b 1.56e-80)
(* (- b (sqrt (* a (* c -4.0)))) (/ -0.5 a))
(/ (- c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4e-15) {
tmp = (c / b) - (b / a);
} else if (b <= 1.56e-80) {
tmp = (b - sqrt((a * (c * -4.0)))) * (-0.5 / 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-15)) then
tmp = (c / b) - (b / a)
else if (b <= 1.56d-80) then
tmp = (b - sqrt((a * (c * (-4.0d0))))) * ((-0.5d0) / 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-15) {
tmp = (c / b) - (b / a);
} else if (b <= 1.56e-80) {
tmp = (b - Math.sqrt((a * (c * -4.0)))) * (-0.5 / a);
} else {
tmp = -c / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4e-15: tmp = (c / b) - (b / a) elif b <= 1.56e-80: tmp = (b - math.sqrt((a * (c * -4.0)))) * (-0.5 / a) else: tmp = -c / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4e-15) tmp = Float64(Float64(c / b) - Float64(b / a)); elseif (b <= 1.56e-80) tmp = Float64(Float64(b - sqrt(Float64(a * Float64(c * -4.0)))) * Float64(-0.5 / a)); else tmp = Float64(Float64(-c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4e-15) tmp = (c / b) - (b / a); elseif (b <= 1.56e-80) tmp = (b - sqrt((a * (c * -4.0)))) * (-0.5 / a); else tmp = -c / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4e-15], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.56e-80], N[(N[(b - N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-0.5 / a), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-15}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\mathbf{elif}\;b \leq 1.56 \cdot 10^{-80}:\\
\;\;\;\;\left(b - \sqrt{a \cdot \left(c \cdot -4\right)}\right) \cdot \frac{-0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\
\end{array}
\end{array}
if b < -4.0000000000000003e-15Initial program 66.2%
*-commutative66.2%
Simplified66.2%
Taylor expanded in b around -inf 93.0%
+-commutative93.0%
mul-1-neg93.0%
unsub-neg93.0%
Simplified93.0%
if -4.0000000000000003e-15 < b < 1.55999999999999994e-80Initial program 82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in b around 0 69.7%
*-commutative69.7%
associate-*r*69.8%
Simplified69.8%
frac-2neg69.8%
div-inv69.6%
distribute-neg-in69.6%
add-sqr-sqrt45.2%
sqrt-unprod69.1%
sqr-neg69.1%
sqrt-prod24.3%
add-sqr-sqrt66.4%
sub-neg66.4%
add-sqr-sqrt42.1%
sqrt-unprod66.5%
sqr-neg66.5%
sqrt-prod24.4%
add-sqr-sqrt69.6%
distribute-rgt-neg-in69.6%
metadata-eval69.6%
metadata-eval69.6%
div-inv69.6%
clear-num69.6%
Applied egg-rr69.6%
*-commutative69.6%
Simplified69.6%
if 1.55999999999999994e-80 < b Initial program 16.4%
*-commutative16.4%
Simplified16.4%
Taylor expanded in b around inf 83.9%
mul-1-neg83.9%
distribute-neg-frac83.9%
Simplified83.9%
Final simplification82.6%
(FPCore (a b c)
:precision binary64
(if (<= b -6e-16)
(- (/ c b) (/ b a))
(if (<= b 1.75e-86)
(/ (- b (sqrt (* a (* c -4.0)))) (* a -2.0))
(/ (- c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -6e-16) {
tmp = (c / b) - (b / a);
} else if (b <= 1.75e-86) {
tmp = (b - sqrt((a * (c * -4.0)))) / (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 <= (-6d-16)) then
tmp = (c / b) - (b / a)
else if (b <= 1.75d-86) then
tmp = (b - sqrt((a * (c * (-4.0d0))))) / (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 <= -6e-16) {
tmp = (c / b) - (b / a);
} else if (b <= 1.75e-86) {
tmp = (b - Math.sqrt((a * (c * -4.0)))) / (a * -2.0);
} else {
tmp = -c / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -6e-16: tmp = (c / b) - (b / a) elif b <= 1.75e-86: tmp = (b - math.sqrt((a * (c * -4.0)))) / (a * -2.0) else: tmp = -c / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -6e-16) tmp = Float64(Float64(c / b) - Float64(b / a)); elseif (b <= 1.75e-86) tmp = Float64(Float64(b - sqrt(Float64(a * Float64(c * -4.0)))) / Float64(a * -2.0)); else tmp = Float64(Float64(-c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -6e-16) tmp = (c / b) - (b / a); elseif (b <= 1.75e-86) tmp = (b - sqrt((a * (c * -4.0)))) / (a * -2.0); else tmp = -c / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -6e-16], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.75e-86], N[(N[(b - N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(a * -2.0), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6 \cdot 10^{-16}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\mathbf{elif}\;b \leq 1.75 \cdot 10^{-86}:\\
\;\;\;\;\frac{b - \sqrt{a \cdot \left(c \cdot -4\right)}}{a \cdot -2}\\
\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\
\end{array}
\end{array}
if b < -5.99999999999999987e-16Initial program 66.2%
*-commutative66.2%
Simplified66.2%
Taylor expanded in b around -inf 93.0%
+-commutative93.0%
mul-1-neg93.0%
unsub-neg93.0%
Simplified93.0%
if -5.99999999999999987e-16 < b < 1.7500000000000001e-86Initial program 82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in b around 0 69.7%
*-commutative69.7%
associate-*r*69.8%
Simplified69.8%
frac-2neg69.8%
div-inv69.6%
distribute-neg-in69.6%
add-sqr-sqrt45.2%
sqrt-unprod69.1%
sqr-neg69.1%
sqrt-prod24.3%
add-sqr-sqrt66.4%
sub-neg66.4%
add-sqr-sqrt42.1%
sqrt-unprod66.5%
sqr-neg66.5%
sqrt-prod24.4%
add-sqr-sqrt69.6%
distribute-rgt-neg-in69.6%
metadata-eval69.6%
metadata-eval69.6%
div-inv69.6%
clear-num69.6%
Applied egg-rr69.6%
*-commutative69.6%
Simplified69.6%
*-commutative69.6%
clear-num69.6%
un-div-inv69.8%
div-inv69.8%
metadata-eval69.8%
Applied egg-rr69.8%
if 1.7500000000000001e-86 < b Initial program 16.4%
*-commutative16.4%
Simplified16.4%
Taylor expanded in b around inf 83.9%
mul-1-neg83.9%
distribute-neg-frac83.9%
Simplified83.9%
Final simplification82.6%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (- (/ c b) (/ b a)) (/ (- c) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-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 <= (-5d-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 <= -5e-310) {
tmp = (c / b) - (b / a);
} else {
tmp = -c / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = (c / b) - (b / a) else: tmp = -c / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(c / b) - Float64(b / a)); else tmp = Float64(Float64(-c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = (c / b) - (b / a); else tmp = -c / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-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 -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 74.4%
*-commutative74.4%
Simplified74.4%
Taylor expanded in b around -inf 69.6%
+-commutative69.6%
mul-1-neg69.6%
unsub-neg69.6%
Simplified69.6%
if -4.999999999999985e-310 < b Initial program 28.5%
*-commutative28.5%
Simplified28.5%
Taylor expanded in b around inf 69.3%
mul-1-neg69.3%
distribute-neg-frac69.3%
Simplified69.3%
Final simplification69.5%
(FPCore (a b c) :precision binary64 (if (<= b -6e-305) (/ (- b) a) 0.0))
double code(double a, double b, double c) {
double tmp;
if (b <= -6e-305) {
tmp = -b / a;
} else {
tmp = 0.0;
}
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 <= (-6d-305)) then
tmp = -b / a
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -6e-305) {
tmp = -b / a;
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -6e-305: tmp = -b / a else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -6e-305) tmp = Float64(Float64(-b) / a); else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -6e-305) tmp = -b / a; else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -6e-305], N[((-b) / a), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6 \cdot 10^{-305}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -6.0000000000000002e-305Initial program 74.0%
*-commutative74.0%
Simplified74.0%
Taylor expanded in b around -inf 70.0%
associate-*r/70.0%
mul-1-neg70.0%
Simplified70.0%
if -6.0000000000000002e-305 < b Initial program 29.6%
*-commutative29.6%
Simplified29.6%
Applied egg-rr29.6%
*-commutative29.6%
associate-/r*29.6%
metadata-eval29.6%
Simplified29.6%
*-commutative29.6%
pow1/229.6%
exp-to-pow26.2%
sub-neg26.2%
distribute-lft-in25.9%
exp-to-pow28.5%
pow1/228.5%
fma-udef28.5%
add-sqr-sqrt27.9%
unpow227.9%
hypot-def32.0%
Applied egg-rr32.0%
Taylor expanded in a around 0 19.6%
distribute-rgt-out19.6%
metadata-eval19.6%
associate-*l/12.8%
mul0-rgt19.6%
Simplified19.6%
Final simplification45.8%
(FPCore (a b c) :precision binary64 (if (<= b 9e-278) (/ (- b) a) (/ (- c) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 9e-278) {
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 <= 9d-278) 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 <= 9e-278) {
tmp = -b / a;
} else {
tmp = -c / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 9e-278: tmp = -b / a else: tmp = -c / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 9e-278) tmp = Float64(Float64(-b) / a); else tmp = Float64(Float64(-c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 9e-278) tmp = -b / a; else tmp = -c / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 9e-278], N[((-b) / a), $MachinePrecision], N[((-c) / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 9 \cdot 10^{-278}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\
\end{array}
\end{array}
if b < 8.9999999999999996e-278Initial program 73.4%
*-commutative73.4%
Simplified73.4%
Taylor expanded in b around -inf 68.1%
associate-*r/68.1%
mul-1-neg68.1%
Simplified68.1%
if 8.9999999999999996e-278 < b Initial program 28.9%
*-commutative28.9%
Simplified28.9%
Taylor expanded in b around inf 70.4%
mul-1-neg70.4%
distribute-neg-frac70.4%
Simplified70.4%
Final simplification69.2%
(FPCore (a b c) :precision binary64 0.0)
double code(double a, double b, double c) {
return 0.0;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = 0.0d0
end function
public static double code(double a, double b, double c) {
return 0.0;
}
def code(a, b, c): return 0.0
function code(a, b, c) return 0.0 end
function tmp = code(a, b, c) tmp = 0.0; end
code[a_, b_, c_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 52.7%
*-commutative52.7%
Simplified52.7%
Applied egg-rr52.6%
*-commutative52.6%
associate-/r*52.6%
metadata-eval52.6%
Simplified52.6%
*-commutative52.6%
pow1/252.6%
exp-to-pow49.2%
sub-neg49.2%
distribute-lft-in49.1%
exp-to-pow52.1%
pow1/252.1%
fma-udef52.0%
add-sqr-sqrt40.3%
unpow240.3%
hypot-def49.0%
Applied egg-rr49.0%
Taylor expanded in a around 0 10.7%
distribute-rgt-out10.7%
metadata-eval10.7%
associate-*l/7.3%
mul0-rgt10.7%
Simplified10.7%
Final simplification10.7%
herbie shell --seed 2024020
(FPCore (a b c)
:name "Quadratic roots, full range"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))