
(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 8 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 -8.5e+154)
(/ (- b) a)
(if (<= b 4.8e-99)
(/ (- (sqrt (- (* b b) (* (* a 4.0) c))) b) (* a 2.0))
(/ (- c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -8.5e+154) {
tmp = -b / a;
} else if (b <= 4.8e-99) {
tmp = (sqrt(((b * b) - ((a * 4.0) * c))) - 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 <= (-8.5d+154)) then
tmp = -b / a
else if (b <= 4.8d-99) then
tmp = (sqrt(((b * b) - ((a * 4.0d0) * c))) - 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 <= -8.5e+154) {
tmp = -b / a;
} else if (b <= 4.8e-99) {
tmp = (Math.sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0);
} else {
tmp = -c / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -8.5e+154: tmp = -b / a elif b <= 4.8e-99: tmp = (math.sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0) else: tmp = -c / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -8.5e+154) tmp = Float64(Float64(-b) / a); elseif (b <= 4.8e-99) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(a * 4.0) * c))) - 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 <= -8.5e+154) tmp = -b / a; elseif (b <= 4.8e-99) tmp = (sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0); else tmp = -c / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -8.5e+154], N[((-b) / a), $MachinePrecision], If[LessEqual[b, 4.8e-99], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * c), $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 -8.5 \cdot 10^{+154}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{elif}\;b \leq 4.8 \cdot 10^{-99}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c} - b}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\
\end{array}
\end{array}
if b < -8.5000000000000002e154Initial program 31.1%
Taylor expanded in b around -inf 100.0%
associate-*r/100.0%
mul-1-neg100.0%
Simplified100.0%
if -8.5000000000000002e154 < b < 4.8000000000000001e-99Initial program 82.8%
if 4.8000000000000001e-99 < b Initial program 15.2%
Taylor expanded in b around inf 86.6%
associate-*r/86.6%
neg-mul-186.6%
Simplified86.6%
Final simplification86.8%
(FPCore (a b c)
:precision binary64
(if (<= b -2.5e-87)
(- (/ c b) (/ b a))
(if (<= b 3.1e-99)
(/ (- (sqrt (* c (* a -4.0))) b) (* a 2.0))
(/ (- c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.5e-87) {
tmp = (c / b) - (b / a);
} else if (b <= 3.1e-99) {
tmp = (sqrt((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 <= (-2.5d-87)) then
tmp = (c / b) - (b / a)
else if (b <= 3.1d-99) then
tmp = (sqrt((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 <= -2.5e-87) {
tmp = (c / b) - (b / a);
} else if (b <= 3.1e-99) {
tmp = (Math.sqrt((c * (a * -4.0))) - b) / (a * 2.0);
} else {
tmp = -c / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.5e-87: tmp = (c / b) - (b / a) elif b <= 3.1e-99: tmp = (math.sqrt((c * (a * -4.0))) - b) / (a * 2.0) else: tmp = -c / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.5e-87) tmp = Float64(Float64(c / b) - Float64(b / a)); elseif (b <= 3.1e-99) tmp = Float64(Float64(sqrt(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 <= -2.5e-87) tmp = (c / b) - (b / a); elseif (b <= 3.1e-99) tmp = (sqrt((c * (a * -4.0))) - b) / (a * 2.0); else tmp = -c / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.5e-87], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.1e-99], N[(N[(N[Sqrt[N[(c * N[(a * -4.0), $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 -2.5 \cdot 10^{-87}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\mathbf{elif}\;b \leq 3.1 \cdot 10^{-99}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\
\end{array}
\end{array}
if b < -2.50000000000000021e-87Initial program 64.7%
Taylor expanded in b around -inf 83.5%
+-commutative83.5%
mul-1-neg83.5%
unsub-neg83.5%
Simplified83.5%
if -2.50000000000000021e-87 < b < 3.0999999999999999e-99Initial program 77.2%
prod-diff76.9%
*-commutative76.9%
fma-def76.9%
associate-+l+76.9%
*-commutative76.9%
distribute-rgt-neg-in76.9%
fma-def76.9%
*-commutative76.9%
distribute-rgt-neg-in76.9%
metadata-eval76.9%
*-commutative76.9%
fma-udef76.9%
distribute-lft-neg-in76.9%
distribute-rgt-neg-in76.9%
fma-def76.9%
Applied egg-rr76.9%
Taylor expanded in b around 0 72.2%
distribute-rgt-out72.6%
metadata-eval72.6%
associate-*r*72.6%
neg-mul-172.6%
unsub-neg72.6%
associate-*r*72.6%
metadata-eval72.6%
distribute-rgt-out72.2%
associate-*r*72.2%
associate-*r*72.2%
distribute-rgt-in72.6%
distribute-rgt-out72.6%
metadata-eval72.6%
*-commutative72.6%
Simplified72.6%
if 3.0999999999999999e-99 < b Initial program 15.2%
Taylor expanded in b around inf 86.6%
associate-*r/86.6%
neg-mul-186.6%
Simplified86.6%
Final simplification81.5%
(FPCore (a b c) :precision binary64 (if (<= b -1.2e-87) (- (/ c b) (/ b a)) (if (<= b 7.8e-100) (* 0.5 (/ (sqrt (* c (* a -4.0))) a)) (/ (- c) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.2e-87) {
tmp = (c / b) - (b / a);
} else if (b <= 7.8e-100) {
tmp = 0.5 * (sqrt((c * (a * -4.0))) / 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 <= (-1.2d-87)) then
tmp = (c / b) - (b / a)
else if (b <= 7.8d-100) then
tmp = 0.5d0 * (sqrt((c * (a * (-4.0d0)))) / 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 <= -1.2e-87) {
tmp = (c / b) - (b / a);
} else if (b <= 7.8e-100) {
tmp = 0.5 * (Math.sqrt((c * (a * -4.0))) / a);
} else {
tmp = -c / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.2e-87: tmp = (c / b) - (b / a) elif b <= 7.8e-100: tmp = 0.5 * (math.sqrt((c * (a * -4.0))) / a) else: tmp = -c / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.2e-87) tmp = Float64(Float64(c / b) - Float64(b / a)); elseif (b <= 7.8e-100) tmp = Float64(0.5 * Float64(sqrt(Float64(c * Float64(a * -4.0))) / a)); else tmp = Float64(Float64(-c) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.2e-87) tmp = (c / b) - (b / a); elseif (b <= 7.8e-100) tmp = 0.5 * (sqrt((c * (a * -4.0))) / a); else tmp = -c / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.2e-87], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.8e-100], N[(0.5 * N[(N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.2 \cdot 10^{-87}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\mathbf{elif}\;b \leq 7.8 \cdot 10^{-100}:\\
\;\;\;\;0.5 \cdot \frac{\sqrt{c \cdot \left(a \cdot -4\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\
\end{array}
\end{array}
if b < -1.2e-87Initial program 64.7%
Taylor expanded in b around -inf 83.5%
+-commutative83.5%
mul-1-neg83.5%
unsub-neg83.5%
Simplified83.5%
if -1.2e-87 < b < 7.79999999999999955e-100Initial program 77.2%
prod-diff76.9%
*-commutative76.9%
fma-def76.9%
associate-+l+76.9%
*-commutative76.9%
distribute-rgt-neg-in76.9%
fma-def76.9%
*-commutative76.9%
distribute-rgt-neg-in76.9%
metadata-eval76.9%
*-commutative76.9%
fma-udef76.9%
distribute-lft-neg-in76.9%
distribute-rgt-neg-in76.9%
fma-def76.9%
Applied egg-rr76.9%
Taylor expanded in b around 0 71.5%
associate-*l/71.5%
distribute-rgt-out71.8%
metadata-eval71.8%
associate-*r*71.8%
*-lft-identity71.8%
associate-*r*71.8%
metadata-eval71.8%
distribute-rgt-out71.5%
associate-*r*71.5%
associate-*r*71.5%
distribute-rgt-in71.8%
distribute-rgt-out71.8%
metadata-eval71.8%
*-commutative71.8%
Simplified71.8%
if 7.79999999999999955e-100 < b Initial program 15.2%
Taylor expanded in b around inf 86.6%
associate-*r/86.6%
neg-mul-186.6%
Simplified86.6%
Final simplification81.3%
(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(Float64(-c) / 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 70.0%
Taylor expanded in b around -inf 64.1%
+-commutative64.1%
mul-1-neg64.1%
unsub-neg64.1%
Simplified64.1%
if -9.999999999999969e-311 < b Initial program 30.3%
Taylor expanded in b around inf 66.4%
associate-*r/66.4%
neg-mul-166.4%
Simplified66.4%
Final simplification65.2%
(FPCore (a b c) :precision binary64 (if (<= b 1.08e-20) (/ (- b) a) (/ c b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.08e-20) {
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 <= 1.08d-20) 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 <= 1.08e-20) {
tmp = -b / a;
} else {
tmp = c / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.08e-20: tmp = -b / a else: tmp = c / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.08e-20) tmp = Float64(Float64(-b) / a); else tmp = Float64(c / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 1.08e-20) tmp = -b / a; else tmp = c / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.08e-20], N[((-b) / a), $MachinePrecision], N[(c / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.08 \cdot 10^{-20}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b}\\
\end{array}
\end{array}
if b < 1.08e-20Initial program 67.4%
Taylor expanded in b around -inf 47.2%
associate-*r/47.2%
mul-1-neg47.2%
Simplified47.2%
if 1.08e-20 < b Initial program 11.8%
Taylor expanded in b around inf 68.2%
associate-/l*70.2%
associate-/r/64.7%
Simplified64.7%
times-frac64.7%
metadata-eval64.7%
associate-/r/70.2%
add-sqr-sqrt46.9%
sqrt-unprod43.9%
mul-1-neg43.9%
mul-1-neg43.9%
sqr-neg43.9%
sqrt-unprod28.3%
add-sqr-sqrt29.0%
div-inv29.0%
associate-/r/29.0%
associate-*l/28.8%
*-commutative28.8%
Applied egg-rr28.8%
Taylor expanded in c around 0 28.6%
Final simplification41.5%
(FPCore (a b c) :precision binary64 (if (<= b -1e-310) (/ (- b) a) (/ (- c) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -1e-310) {
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 <= (-1d-310)) 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 <= -1e-310) {
tmp = -b / a;
} else {
tmp = -c / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1e-310: tmp = -b / a else: tmp = -c / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1e-310) 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 <= -1e-310) tmp = -b / a; else tmp = -c / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1e-310], N[((-b) / a), $MachinePrecision], N[((-c) / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\
\end{array}
\end{array}
if b < -9.999999999999969e-311Initial program 70.0%
Taylor expanded in b around -inf 63.6%
associate-*r/63.6%
mul-1-neg63.6%
Simplified63.6%
if -9.999999999999969e-311 < b Initial program 30.3%
Taylor expanded in b around inf 66.4%
associate-*r/66.4%
neg-mul-166.4%
Simplified66.4%
Final simplification65.0%
(FPCore (a b c) :precision binary64 (/ b a))
double code(double a, double b, double c) {
return b / 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 / a
end function
public static double code(double a, double b, double c) {
return b / a;
}
def code(a, b, c): return b / a
function code(a, b, c) return Float64(b / a) end
function tmp = code(a, b, c) tmp = b / a; end
code[a_, b_, c_] := N[(b / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{b}{a}
\end{array}
Initial program 50.4%
add-sqr-sqrt50.2%
pow250.2%
Applied egg-rr28.3%
Taylor expanded in b around inf 2.7%
Final simplification2.7%
(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 50.4%
Taylor expanded in b around inf 24.2%
associate-/l*25.5%
associate-/r/23.7%
Simplified23.7%
times-frac23.7%
metadata-eval23.7%
associate-/r/25.5%
add-sqr-sqrt16.2%
sqrt-unprod16.2%
mul-1-neg16.2%
mul-1-neg16.2%
sqr-neg16.2%
sqrt-unprod10.0%
add-sqr-sqrt11.1%
div-inv11.1%
associate-/r/11.0%
associate-*l/11.0%
*-commutative11.0%
Applied egg-rr11.0%
Taylor expanded in c around 0 11.0%
Final simplification11.0%
herbie shell --seed 2023271
(FPCore (a b c)
:name "Quadratic roots, full range"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))