
(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 12 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
(let* ((t_0 (- (pow b 2.0) (* 4.0 (* a c)))))
(if (<= b 0.68)
(/ (/ (- t_0 (pow (- b) 2.0)) (+ b (sqrt t_0))) (* 2.0 a))
(-
(*
a
(-
(*
a
(+
(* -2.0 (/ (pow c 3.0) (pow b 5.0)))
(* -5.0 (/ (* a (pow c 4.0)) (pow b 7.0)))))
(/ (pow c 2.0) (pow b 3.0))))
(/ c b)))))
double code(double a, double b, double c) {
double t_0 = pow(b, 2.0) - (4.0 * (a * c));
double tmp;
if (b <= 0.68) {
tmp = ((t_0 - pow(-b, 2.0)) / (b + sqrt(t_0))) / (2.0 * a);
} else {
tmp = (a * ((a * ((-2.0 * (pow(c, 3.0) / pow(b, 5.0))) + (-5.0 * ((a * pow(c, 4.0)) / pow(b, 7.0))))) - (pow(c, 2.0) / pow(b, 3.0)))) - (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) :: t_0
real(8) :: tmp
t_0 = (b ** 2.0d0) - (4.0d0 * (a * c))
if (b <= 0.68d0) then
tmp = ((t_0 - (-b ** 2.0d0)) / (b + sqrt(t_0))) / (2.0d0 * a)
else
tmp = (a * ((a * (((-2.0d0) * ((c ** 3.0d0) / (b ** 5.0d0))) + ((-5.0d0) * ((a * (c ** 4.0d0)) / (b ** 7.0d0))))) - ((c ** 2.0d0) / (b ** 3.0d0)))) - (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double t_0 = Math.pow(b, 2.0) - (4.0 * (a * c));
double tmp;
if (b <= 0.68) {
tmp = ((t_0 - Math.pow(-b, 2.0)) / (b + Math.sqrt(t_0))) / (2.0 * a);
} else {
tmp = (a * ((a * ((-2.0 * (Math.pow(c, 3.0) / Math.pow(b, 5.0))) + (-5.0 * ((a * Math.pow(c, 4.0)) / Math.pow(b, 7.0))))) - (Math.pow(c, 2.0) / Math.pow(b, 3.0)))) - (c / b);
}
return tmp;
}
def code(a, b, c): t_0 = math.pow(b, 2.0) - (4.0 * (a * c)) tmp = 0 if b <= 0.68: tmp = ((t_0 - math.pow(-b, 2.0)) / (b + math.sqrt(t_0))) / (2.0 * a) else: tmp = (a * ((a * ((-2.0 * (math.pow(c, 3.0) / math.pow(b, 5.0))) + (-5.0 * ((a * math.pow(c, 4.0)) / math.pow(b, 7.0))))) - (math.pow(c, 2.0) / math.pow(b, 3.0)))) - (c / b) return tmp
function code(a, b, c) t_0 = Float64((b ^ 2.0) - Float64(4.0 * Float64(a * c))) tmp = 0.0 if (b <= 0.68) tmp = Float64(Float64(Float64(t_0 - (Float64(-b) ^ 2.0)) / Float64(b + sqrt(t_0))) / Float64(2.0 * a)); else tmp = Float64(Float64(a * Float64(Float64(a * Float64(Float64(-2.0 * Float64((c ^ 3.0) / (b ^ 5.0))) + Float64(-5.0 * Float64(Float64(a * (c ^ 4.0)) / (b ^ 7.0))))) - Float64((c ^ 2.0) / (b ^ 3.0)))) - Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) t_0 = (b ^ 2.0) - (4.0 * (a * c)); tmp = 0.0; if (b <= 0.68) tmp = ((t_0 - (-b ^ 2.0)) / (b + sqrt(t_0))) / (2.0 * a); else tmp = (a * ((a * ((-2.0 * ((c ^ 3.0) / (b ^ 5.0))) + (-5.0 * ((a * (c ^ 4.0)) / (b ^ 7.0))))) - ((c ^ 2.0) / (b ^ 3.0)))) - (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[Power[b, 2.0], $MachinePrecision] - N[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 0.68], N[(N[(N[(t$95$0 - N[Power[(-b), 2.0], $MachinePrecision]), $MachinePrecision] / N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(N[(a * N[(N[(-2.0 * N[(N[Power[c, 3.0], $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-5.0 * N[(N[(a * N[Power[c, 4.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[c, 2.0], $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {b}^{2} - 4 \cdot \left(a \cdot c\right)\\
\mathbf{if}\;b \leq 0.68:\\
\;\;\;\;\frac{\frac{t\_0 - {\left(-b\right)}^{2}}{b + \sqrt{t\_0}}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(a \cdot \left(-2 \cdot \frac{{c}^{3}}{{b}^{5}} + -5 \cdot \frac{a \cdot {c}^{4}}{{b}^{7}}\right) - \frac{{c}^{2}}{{b}^{3}}\right) - \frac{c}{b}\\
\end{array}
\end{array}
if b < 0.680000000000000049Initial program 87.0%
*-commutative87.0%
Simplified87.0%
add-cbrt-cube85.9%
pow1/383.0%
pow382.9%
pow282.9%
pow-pow83.2%
metadata-eval83.2%
Applied egg-rr83.2%
unpow1/386.4%
Simplified86.4%
flip-+86.1%
pow286.1%
add-sqr-sqrt86.5%
pow1/383.1%
pow-pow88.2%
metadata-eval88.2%
associate-*l*88.2%
pow1/388.0%
pow-pow88.1%
metadata-eval88.1%
associate-*l*88.1%
Applied egg-rr88.1%
if 0.680000000000000049 < b Initial program 50.6%
*-commutative50.6%
+-commutative50.6%
sqr-neg50.6%
unsub-neg50.6%
sqr-neg50.6%
fma-neg50.7%
distribute-lft-neg-in50.7%
*-commutative50.7%
*-commutative50.7%
distribute-rgt-neg-in50.7%
metadata-eval50.7%
Simplified50.7%
Taylor expanded in a around 0 95.7%
Taylor expanded in c around 0 95.7%
associate-*r/95.7%
neg-mul-195.7%
Applied egg-rr95.7%
associate-*r/95.7%
Applied egg-rr95.7%
associate-*r/95.7%
mul-1-neg95.7%
distribute-neg-frac295.7%
Simplified95.7%
Final simplification94.6%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (- (pow b 2.0) (* 4.0 (* a c)))))
(if (<= b 0.6)
(/ (/ (- t_0 (pow (- b) 2.0)) (+ b (sqrt t_0))) (* 2.0 a))
(*
c
(+
(*
c
(-
(*
c
(+
(* -5.0 (/ (* c (pow a 3.0)) (pow b 7.0)))
(* -2.0 (/ (pow a 2.0) (pow b 5.0)))))
(/ a (pow b 3.0))))
(/ -1.0 b))))))
double code(double a, double b, double c) {
double t_0 = pow(b, 2.0) - (4.0 * (a * c));
double tmp;
if (b <= 0.6) {
tmp = ((t_0 - pow(-b, 2.0)) / (b + sqrt(t_0))) / (2.0 * a);
} else {
tmp = c * ((c * ((c * ((-5.0 * ((c * pow(a, 3.0)) / pow(b, 7.0))) + (-2.0 * (pow(a, 2.0) / pow(b, 5.0))))) - (a / pow(b, 3.0)))) + (-1.0 / 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) :: t_0
real(8) :: tmp
t_0 = (b ** 2.0d0) - (4.0d0 * (a * c))
if (b <= 0.6d0) then
tmp = ((t_0 - (-b ** 2.0d0)) / (b + sqrt(t_0))) / (2.0d0 * a)
else
tmp = c * ((c * ((c * (((-5.0d0) * ((c * (a ** 3.0d0)) / (b ** 7.0d0))) + ((-2.0d0) * ((a ** 2.0d0) / (b ** 5.0d0))))) - (a / (b ** 3.0d0)))) + ((-1.0d0) / b))
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double t_0 = Math.pow(b, 2.0) - (4.0 * (a * c));
double tmp;
if (b <= 0.6) {
tmp = ((t_0 - Math.pow(-b, 2.0)) / (b + Math.sqrt(t_0))) / (2.0 * a);
} else {
tmp = c * ((c * ((c * ((-5.0 * ((c * Math.pow(a, 3.0)) / Math.pow(b, 7.0))) + (-2.0 * (Math.pow(a, 2.0) / Math.pow(b, 5.0))))) - (a / Math.pow(b, 3.0)))) + (-1.0 / b));
}
return tmp;
}
def code(a, b, c): t_0 = math.pow(b, 2.0) - (4.0 * (a * c)) tmp = 0 if b <= 0.6: tmp = ((t_0 - math.pow(-b, 2.0)) / (b + math.sqrt(t_0))) / (2.0 * a) else: tmp = c * ((c * ((c * ((-5.0 * ((c * math.pow(a, 3.0)) / math.pow(b, 7.0))) + (-2.0 * (math.pow(a, 2.0) / math.pow(b, 5.0))))) - (a / math.pow(b, 3.0)))) + (-1.0 / b)) return tmp
function code(a, b, c) t_0 = Float64((b ^ 2.0) - Float64(4.0 * Float64(a * c))) tmp = 0.0 if (b <= 0.6) tmp = Float64(Float64(Float64(t_0 - (Float64(-b) ^ 2.0)) / Float64(b + sqrt(t_0))) / Float64(2.0 * a)); else tmp = Float64(c * Float64(Float64(c * Float64(Float64(c * Float64(Float64(-5.0 * Float64(Float64(c * (a ^ 3.0)) / (b ^ 7.0))) + Float64(-2.0 * Float64((a ^ 2.0) / (b ^ 5.0))))) - Float64(a / (b ^ 3.0)))) + Float64(-1.0 / b))); end return tmp end
function tmp_2 = code(a, b, c) t_0 = (b ^ 2.0) - (4.0 * (a * c)); tmp = 0.0; if (b <= 0.6) tmp = ((t_0 - (-b ^ 2.0)) / (b + sqrt(t_0))) / (2.0 * a); else tmp = c * ((c * ((c * ((-5.0 * ((c * (a ^ 3.0)) / (b ^ 7.0))) + (-2.0 * ((a ^ 2.0) / (b ^ 5.0))))) - (a / (b ^ 3.0)))) + (-1.0 / b)); end tmp_2 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[Power[b, 2.0], $MachinePrecision] - N[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 0.6], N[(N[(N[(t$95$0 - N[Power[(-b), 2.0], $MachinePrecision]), $MachinePrecision] / N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], N[(c * N[(N[(c * N[(N[(c * N[(N[(-5.0 * N[(N[(c * N[Power[a, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[(N[Power[a, 2.0], $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {b}^{2} - 4 \cdot \left(a \cdot c\right)\\
\mathbf{if}\;b \leq 0.6:\\
\;\;\;\;\frac{\frac{t\_0 - {\left(-b\right)}^{2}}{b + \sqrt{t\_0}}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(c \cdot \left(c \cdot \left(-5 \cdot \frac{c \cdot {a}^{3}}{{b}^{7}} + -2 \cdot \frac{{a}^{2}}{{b}^{5}}\right) - \frac{a}{{b}^{3}}\right) + \frac{-1}{b}\right)\\
\end{array}
\end{array}
if b < 0.599999999999999978Initial program 87.0%
*-commutative87.0%
Simplified87.0%
add-cbrt-cube85.9%
pow1/383.0%
pow382.9%
pow282.9%
pow-pow83.2%
metadata-eval83.2%
Applied egg-rr83.2%
unpow1/386.4%
Simplified86.4%
flip-+86.1%
pow286.1%
add-sqr-sqrt86.5%
pow1/383.1%
pow-pow88.2%
metadata-eval88.2%
associate-*l*88.2%
pow1/388.0%
pow-pow88.1%
metadata-eval88.1%
associate-*l*88.1%
Applied egg-rr88.1%
if 0.599999999999999978 < b Initial program 50.6%
*-commutative50.6%
+-commutative50.6%
sqr-neg50.6%
unsub-neg50.6%
sqr-neg50.6%
fma-neg50.7%
distribute-lft-neg-in50.7%
*-commutative50.7%
*-commutative50.7%
distribute-rgt-neg-in50.7%
metadata-eval50.7%
Simplified50.7%
Taylor expanded in a around 0 95.7%
Taylor expanded in c around 0 95.5%
Final simplification94.4%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (- (pow b 2.0) (* 4.0 (* a c)))))
(if (<= b 4.8)
(/ (/ (- t_0 (pow (- b) 2.0)) (+ b (sqrt t_0))) (* 2.0 a))
(/
(-
(*
a
(fma -2.0 (/ (* a (pow c 3.0)) (pow b 4.0)) (- (pow (/ c (- b)) 2.0))))
c)
b))))
double code(double a, double b, double c) {
double t_0 = pow(b, 2.0) - (4.0 * (a * c));
double tmp;
if (b <= 4.8) {
tmp = ((t_0 - pow(-b, 2.0)) / (b + sqrt(t_0))) / (2.0 * a);
} else {
tmp = ((a * fma(-2.0, ((a * pow(c, 3.0)) / pow(b, 4.0)), -pow((c / -b), 2.0))) - c) / b;
}
return tmp;
}
function code(a, b, c) t_0 = Float64((b ^ 2.0) - Float64(4.0 * Float64(a * c))) tmp = 0.0 if (b <= 4.8) tmp = Float64(Float64(Float64(t_0 - (Float64(-b) ^ 2.0)) / Float64(b + sqrt(t_0))) / Float64(2.0 * a)); else tmp = Float64(Float64(Float64(a * fma(-2.0, Float64(Float64(a * (c ^ 3.0)) / (b ^ 4.0)), Float64(-(Float64(c / Float64(-b)) ^ 2.0)))) - c) / b); end return tmp end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[Power[b, 2.0], $MachinePrecision] - N[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 4.8], N[(N[(N[(t$95$0 - N[Power[(-b), 2.0], $MachinePrecision]), $MachinePrecision] / N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * N[(-2.0 * N[(N[(a * N[Power[c, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 4.0], $MachinePrecision]), $MachinePrecision] + (-N[Power[N[(c / (-b)), $MachinePrecision], 2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] - c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {b}^{2} - 4 \cdot \left(a \cdot c\right)\\
\mathbf{if}\;b \leq 4.8:\\
\;\;\;\;\frac{\frac{t\_0 - {\left(-b\right)}^{2}}{b + \sqrt{t\_0}}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{a \cdot \mathsf{fma}\left(-2, \frac{a \cdot {c}^{3}}{{b}^{4}}, -{\left(\frac{c}{-b}\right)}^{2}\right) - c}{b}\\
\end{array}
\end{array}
if b < 4.79999999999999982Initial program 85.6%
*-commutative85.6%
Simplified85.6%
add-cbrt-cube84.6%
pow1/382.4%
pow382.4%
pow282.4%
pow-pow82.6%
metadata-eval82.6%
Applied egg-rr82.6%
unpow1/384.9%
Simplified84.9%
flip-+84.8%
pow284.8%
add-sqr-sqrt84.9%
pow1/382.9%
pow-pow87.0%
metadata-eval87.0%
associate-*l*87.0%
pow1/386.8%
pow-pow86.9%
metadata-eval86.9%
associate-*l*86.9%
Applied egg-rr86.9%
if 4.79999999999999982 < b Initial program 48.8%
*-commutative48.8%
+-commutative48.8%
sqr-neg48.8%
unsub-neg48.8%
sqr-neg48.8%
fma-neg48.9%
distribute-lft-neg-in48.9%
*-commutative48.9%
*-commutative48.9%
distribute-rgt-neg-in48.9%
metadata-eval48.9%
Simplified48.9%
Taylor expanded in b around inf 94.1%
Taylor expanded in a around 0 94.1%
neg-mul-194.1%
+-commutative94.1%
unsub-neg94.1%
Simplified94.1%
Final simplification92.7%
(FPCore (a b c)
:precision binary64
(if (<= b 4.8)
(/ 1.0 (* 2.0 (/ a (- (sqrt (fma b b (* (* a c) -4.0))) b))))
(/
(-
(*
a
(fma -2.0 (/ (* a (pow c 3.0)) (pow b 4.0)) (- (pow (/ c (- b)) 2.0))))
c)
b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 4.8) {
tmp = 1.0 / (2.0 * (a / (sqrt(fma(b, b, ((a * c) * -4.0))) - b)));
} else {
tmp = ((a * fma(-2.0, ((a * pow(c, 3.0)) / pow(b, 4.0)), -pow((c / -b), 2.0))) - c) / b;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= 4.8) tmp = Float64(1.0 / Float64(2.0 * Float64(a / Float64(sqrt(fma(b, b, Float64(Float64(a * c) * -4.0))) - b)))); else tmp = Float64(Float64(Float64(a * fma(-2.0, Float64(Float64(a * (c ^ 3.0)) / (b ^ 4.0)), Float64(-(Float64(c / Float64(-b)) ^ 2.0)))) - c) / b); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, 4.8], N[(1.0 / N[(2.0 * N[(a / N[(N[Sqrt[N[(b * b + N[(N[(a * c), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * N[(-2.0 * N[(N[(a * N[Power[c, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 4.0], $MachinePrecision]), $MachinePrecision] + (-N[Power[N[(c / (-b)), $MachinePrecision], 2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] - c), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.8:\\
\;\;\;\;\frac{1}{2 \cdot \frac{a}{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)} - b}}\\
\mathbf{else}:\\
\;\;\;\;\frac{a \cdot \mathsf{fma}\left(-2, \frac{a \cdot {c}^{3}}{{b}^{4}}, -{\left(\frac{c}{-b}\right)}^{2}\right) - c}{b}\\
\end{array}
\end{array}
if b < 4.79999999999999982Initial program 85.6%
*-commutative85.6%
Simplified85.6%
add-cbrt-cube84.6%
pow1/382.4%
pow382.4%
pow282.4%
pow-pow82.6%
metadata-eval82.6%
Applied egg-rr82.6%
unpow1/384.9%
Simplified84.9%
add-cube-cbrt81.4%
fma-define81.4%
pow281.4%
pow1/380.2%
pow-pow81.2%
metadata-eval81.2%
associate-*l*81.2%
Applied egg-rr81.2%
clear-num81.2%
inv-pow81.2%
Applied egg-rr85.6%
unpow-185.6%
associate-/l*85.6%
fma-undefine85.6%
neg-mul-185.6%
+-commutative85.6%
unsub-neg85.6%
*-commutative85.6%
Simplified85.6%
if 4.79999999999999982 < b Initial program 48.8%
*-commutative48.8%
+-commutative48.8%
sqr-neg48.8%
unsub-neg48.8%
sqr-neg48.8%
fma-neg48.9%
distribute-lft-neg-in48.9%
*-commutative48.9%
*-commutative48.9%
distribute-rgt-neg-in48.9%
metadata-eval48.9%
Simplified48.9%
Taylor expanded in b around inf 94.1%
Taylor expanded in a around 0 94.1%
neg-mul-194.1%
+-commutative94.1%
unsub-neg94.1%
Simplified94.1%
Final simplification92.5%
(FPCore (a b c)
:precision binary64
(if (<= b 4.8)
(/ 1.0 (* 2.0 (/ a (- (sqrt (fma b b (* (* a c) -4.0))) b))))
(*
c
(+
(* c (- (* -2.0 (/ (* c (pow a 2.0)) (pow b 5.0))) (/ a (pow b 3.0))))
(/ -1.0 b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= 4.8) {
tmp = 1.0 / (2.0 * (a / (sqrt(fma(b, b, ((a * c) * -4.0))) - b)));
} else {
tmp = c * ((c * ((-2.0 * ((c * pow(a, 2.0)) / pow(b, 5.0))) - (a / pow(b, 3.0)))) + (-1.0 / b));
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= 4.8) tmp = Float64(1.0 / Float64(2.0 * Float64(a / Float64(sqrt(fma(b, b, Float64(Float64(a * c) * -4.0))) - b)))); else tmp = Float64(c * Float64(Float64(c * Float64(Float64(-2.0 * Float64(Float64(c * (a ^ 2.0)) / (b ^ 5.0))) - Float64(a / (b ^ 3.0)))) + Float64(-1.0 / b))); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, 4.8], N[(1.0 / N[(2.0 * N[(a / N[(N[Sqrt[N[(b * b + N[(N[(a * c), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * N[(N[(c * N[(N[(-2.0 * N[(N[(c * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.8:\\
\;\;\;\;\frac{1}{2 \cdot \frac{a}{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)} - b}}\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(c \cdot \left(-2 \cdot \frac{c \cdot {a}^{2}}{{b}^{5}} - \frac{a}{{b}^{3}}\right) + \frac{-1}{b}\right)\\
\end{array}
\end{array}
if b < 4.79999999999999982Initial program 85.6%
*-commutative85.6%
Simplified85.6%
add-cbrt-cube84.6%
pow1/382.4%
pow382.4%
pow282.4%
pow-pow82.6%
metadata-eval82.6%
Applied egg-rr82.6%
unpow1/384.9%
Simplified84.9%
add-cube-cbrt81.4%
fma-define81.4%
pow281.4%
pow1/380.2%
pow-pow81.2%
metadata-eval81.2%
associate-*l*81.2%
Applied egg-rr81.2%
clear-num81.2%
inv-pow81.2%
Applied egg-rr85.6%
unpow-185.6%
associate-/l*85.6%
fma-undefine85.6%
neg-mul-185.6%
+-commutative85.6%
unsub-neg85.6%
*-commutative85.6%
Simplified85.6%
if 4.79999999999999982 < b Initial program 48.8%
*-commutative48.8%
+-commutative48.8%
sqr-neg48.8%
unsub-neg48.8%
sqr-neg48.8%
fma-neg48.9%
distribute-lft-neg-in48.9%
*-commutative48.9%
*-commutative48.9%
distribute-rgt-neg-in48.9%
metadata-eval48.9%
Simplified48.9%
Taylor expanded in c around 0 93.9%
Final simplification92.3%
(FPCore (a b c) :precision binary64 (if (<= b 5.0) (/ 1.0 (* 2.0 (/ a (- (sqrt (fma b b (* (* a c) -4.0))) b)))) (/ (- (- c) (* a (pow (/ c (- b)) 2.0))) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 5.0) {
tmp = 1.0 / (2.0 * (a / (sqrt(fma(b, b, ((a * c) * -4.0))) - b)));
} else {
tmp = (-c - (a * pow((c / -b), 2.0))) / b;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= 5.0) tmp = Float64(1.0 / Float64(2.0 * Float64(a / Float64(sqrt(fma(b, b, Float64(Float64(a * c) * -4.0))) - b)))); else tmp = Float64(Float64(Float64(-c) - Float64(a * (Float64(c / Float64(-b)) ^ 2.0))) / b); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, 5.0], N[(1.0 / N[(2.0 * N[(a / N[(N[Sqrt[N[(b * b + N[(N[(a * c), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-c) - N[(a * N[Power[N[(c / (-b)), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5:\\
\;\;\;\;\frac{1}{2 \cdot \frac{a}{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)} - b}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-c\right) - a \cdot {\left(\frac{c}{-b}\right)}^{2}}{b}\\
\end{array}
\end{array}
if b < 5Initial program 85.6%
*-commutative85.6%
Simplified85.6%
add-cbrt-cube84.6%
pow1/382.4%
pow382.4%
pow282.4%
pow-pow82.6%
metadata-eval82.6%
Applied egg-rr82.6%
unpow1/384.9%
Simplified84.9%
add-cube-cbrt81.4%
fma-define81.4%
pow281.4%
pow1/380.2%
pow-pow81.2%
metadata-eval81.2%
associate-*l*81.2%
Applied egg-rr81.2%
clear-num81.2%
inv-pow81.2%
Applied egg-rr85.6%
unpow-185.6%
associate-/l*85.6%
fma-undefine85.6%
neg-mul-185.6%
+-commutative85.6%
unsub-neg85.6%
*-commutative85.6%
Simplified85.6%
if 5 < b Initial program 48.8%
*-commutative48.8%
+-commutative48.8%
sqr-neg48.8%
unsub-neg48.8%
sqr-neg48.8%
fma-neg48.9%
distribute-lft-neg-in48.9%
*-commutative48.9%
*-commutative48.9%
distribute-rgt-neg-in48.9%
metadata-eval48.9%
Simplified48.9%
Taylor expanded in a around 0 88.6%
mul-1-neg88.6%
unsub-neg88.6%
mul-1-neg88.6%
distribute-neg-frac288.6%
associate-/l*88.6%
Simplified88.6%
Taylor expanded in b around inf 88.6%
neg-mul-188.6%
mul-1-neg88.6%
associate-*r/88.6%
unsub-neg88.6%
unpow288.6%
unpow288.6%
times-frac88.6%
sqr-neg88.6%
distribute-frac-neg288.6%
distribute-frac-neg288.6%
unpow288.6%
distribute-frac-neg288.6%
distribute-neg-frac88.6%
Simplified88.6%
Final simplification88.1%
(FPCore (a b c) :precision binary64 (if (<= b 7.0) (/ (- (sqrt (fma b b (* c (* a -4.0)))) b) (* 2.0 a)) (/ (- (- c) (* a (pow (/ c (- b)) 2.0))) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 7.0) {
tmp = (sqrt(fma(b, b, (c * (a * -4.0)))) - b) / (2.0 * a);
} else {
tmp = (-c - (a * pow((c / -b), 2.0))) / b;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= 7.0) tmp = Float64(Float64(sqrt(fma(b, b, Float64(c * Float64(a * -4.0)))) - b) / Float64(2.0 * a)); else tmp = Float64(Float64(Float64(-c) - Float64(a * (Float64(c / Float64(-b)) ^ 2.0))) / b); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, 7.0], N[(N[(N[Sqrt[N[(b * b + N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[((-c) - N[(a * N[Power[N[(c / (-b)), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-c\right) - a \cdot {\left(\frac{c}{-b}\right)}^{2}}{b}\\
\end{array}
\end{array}
if b < 7Initial program 84.0%
*-commutative84.0%
+-commutative84.0%
sqr-neg84.0%
unsub-neg84.0%
sqr-neg84.0%
fma-neg84.0%
distribute-lft-neg-in84.0%
*-commutative84.0%
*-commutative84.0%
distribute-rgt-neg-in84.0%
metadata-eval84.0%
Simplified84.0%
if 7 < b Initial program 48.3%
*-commutative48.3%
+-commutative48.3%
sqr-neg48.3%
unsub-neg48.3%
sqr-neg48.3%
fma-neg48.4%
distribute-lft-neg-in48.4%
*-commutative48.4%
*-commutative48.4%
distribute-rgt-neg-in48.4%
metadata-eval48.4%
Simplified48.4%
Taylor expanded in a around 0 89.1%
mul-1-neg89.1%
unsub-neg89.1%
mul-1-neg89.1%
distribute-neg-frac289.1%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in b around inf 89.1%
neg-mul-189.1%
mul-1-neg89.1%
associate-*r/89.1%
unsub-neg89.1%
unpow289.1%
unpow289.1%
times-frac89.1%
sqr-neg89.1%
distribute-frac-neg289.1%
distribute-frac-neg289.1%
unpow289.1%
distribute-frac-neg289.1%
distribute-neg-frac89.1%
Simplified89.1%
Final simplification88.1%
(FPCore (a b c) :precision binary64 (if (<= b 6.5) (* (- (sqrt (fma b b (* (* a c) -4.0))) b) (/ 0.5 a)) (/ (- (- c) (* a (pow (/ c (- b)) 2.0))) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 6.5) {
tmp = (sqrt(fma(b, b, ((a * c) * -4.0))) - b) * (0.5 / a);
} else {
tmp = (-c - (a * pow((c / -b), 2.0))) / b;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= 6.5) tmp = Float64(Float64(sqrt(fma(b, b, Float64(Float64(a * c) * -4.0))) - b) * Float64(0.5 / a)); else tmp = Float64(Float64(Float64(-c) - Float64(a * (Float64(c / Float64(-b)) ^ 2.0))) / b); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, 6.5], N[(N[(N[Sqrt[N[(b * b + N[(N[(a * c), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * N[(0.5 / a), $MachinePrecision]), $MachinePrecision], N[(N[((-c) - N[(a * N[Power[N[(c / (-b)), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6.5:\\
\;\;\;\;\left(\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)} - b\right) \cdot \frac{0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-c\right) - a \cdot {\left(\frac{c}{-b}\right)}^{2}}{b}\\
\end{array}
\end{array}
if b < 6.5Initial program 84.0%
*-commutative84.0%
Simplified84.0%
add-cbrt-cube83.0%
pow1/380.9%
pow380.8%
pow280.8%
pow-pow81.1%
metadata-eval81.1%
Applied egg-rr81.1%
unpow1/383.2%
Simplified83.2%
add-cube-cbrt79.8%
fma-define79.8%
pow279.8%
pow1/378.7%
pow-pow79.6%
metadata-eval79.6%
associate-*l*79.6%
Applied egg-rr79.6%
*-un-lft-identity79.6%
fma-undefine79.6%
unpow279.6%
add-cube-cbrt84.0%
neg-mul-184.0%
fma-define84.0%
cancel-sign-sub-inv84.0%
unpow284.0%
fma-define84.0%
metadata-eval84.0%
*-commutative84.0%
*-commutative84.0%
Applied egg-rr84.0%
associate-*r/84.0%
*-commutative84.0%
associate-*r/84.0%
fma-undefine84.0%
neg-mul-184.0%
+-commutative84.0%
unsub-neg84.0%
*-commutative84.0%
associate-/r*84.0%
metadata-eval84.0%
Simplified84.0%
if 6.5 < b Initial program 48.3%
*-commutative48.3%
+-commutative48.3%
sqr-neg48.3%
unsub-neg48.3%
sqr-neg48.3%
fma-neg48.4%
distribute-lft-neg-in48.4%
*-commutative48.4%
*-commutative48.4%
distribute-rgt-neg-in48.4%
metadata-eval48.4%
Simplified48.4%
Taylor expanded in a around 0 89.1%
mul-1-neg89.1%
unsub-neg89.1%
mul-1-neg89.1%
distribute-neg-frac289.1%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in b around inf 89.1%
neg-mul-189.1%
mul-1-neg89.1%
associate-*r/89.1%
unsub-neg89.1%
unpow289.1%
unpow289.1%
times-frac89.1%
sqr-neg89.1%
distribute-frac-neg289.1%
distribute-frac-neg289.1%
unpow289.1%
distribute-frac-neg289.1%
distribute-neg-frac89.1%
Simplified89.1%
Final simplification88.1%
(FPCore (a b c) :precision binary64 (if (<= b 6.5) (/ (- (sqrt (- (* b b) (* c (* 4.0 a)))) b) (* 2.0 a)) (/ (- (- c) (* a (pow (/ c (- b)) 2.0))) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 6.5) {
tmp = (sqrt(((b * b) - (c * (4.0 * a)))) - b) / (2.0 * a);
} else {
tmp = (-c - (a * pow((c / -b), 2.0))) / 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 <= 6.5d0) then
tmp = (sqrt(((b * b) - (c * (4.0d0 * a)))) - b) / (2.0d0 * a)
else
tmp = (-c - (a * ((c / -b) ** 2.0d0))) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 6.5) {
tmp = (Math.sqrt(((b * b) - (c * (4.0 * a)))) - b) / (2.0 * a);
} else {
tmp = (-c - (a * Math.pow((c / -b), 2.0))) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 6.5: tmp = (math.sqrt(((b * b) - (c * (4.0 * a)))) - b) / (2.0 * a) else: tmp = (-c - (a * math.pow((c / -b), 2.0))) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 6.5) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(4.0 * a)))) - b) / Float64(2.0 * a)); else tmp = Float64(Float64(Float64(-c) - Float64(a * (Float64(c / Float64(-b)) ^ 2.0))) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 6.5) tmp = (sqrt(((b * b) - (c * (4.0 * a)))) - b) / (2.0 * a); else tmp = (-c - (a * ((c / -b) ^ 2.0))) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 6.5], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[((-c) - N[(a * N[Power[N[(c / (-b)), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6.5:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)} - b}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-c\right) - a \cdot {\left(\frac{c}{-b}\right)}^{2}}{b}\\
\end{array}
\end{array}
if b < 6.5Initial program 84.0%
if 6.5 < b Initial program 48.3%
*-commutative48.3%
+-commutative48.3%
sqr-neg48.3%
unsub-neg48.3%
sqr-neg48.3%
fma-neg48.4%
distribute-lft-neg-in48.4%
*-commutative48.4%
*-commutative48.4%
distribute-rgt-neg-in48.4%
metadata-eval48.4%
Simplified48.4%
Taylor expanded in a around 0 89.1%
mul-1-neg89.1%
unsub-neg89.1%
mul-1-neg89.1%
distribute-neg-frac289.1%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in b around inf 89.1%
neg-mul-189.1%
mul-1-neg89.1%
associate-*r/89.1%
unsub-neg89.1%
unpow289.1%
unpow289.1%
times-frac89.1%
sqr-neg89.1%
distribute-frac-neg289.1%
distribute-frac-neg289.1%
unpow289.1%
distribute-frac-neg289.1%
distribute-neg-frac89.1%
Simplified89.1%
Final simplification88.1%
(FPCore (a b c) :precision binary64 (/ (- (- c) (* a (pow (/ c (- b)) 2.0))) b))
double code(double a, double b, double c) {
return (-c - (a * pow((c / -b), 2.0))) / 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 - (a * ((c / -b) ** 2.0d0))) / b
end function
public static double code(double a, double b, double c) {
return (-c - (a * Math.pow((c / -b), 2.0))) / b;
}
def code(a, b, c): return (-c - (a * math.pow((c / -b), 2.0))) / b
function code(a, b, c) return Float64(Float64(Float64(-c) - Float64(a * (Float64(c / Float64(-b)) ^ 2.0))) / b) end
function tmp = code(a, b, c) tmp = (-c - (a * ((c / -b) ^ 2.0))) / b; end
code[a_, b_, c_] := N[(N[((-c) - N[(a * N[Power[N[(c / (-b)), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-c\right) - a \cdot {\left(\frac{c}{-b}\right)}^{2}}{b}
\end{array}
Initial program 55.9%
*-commutative55.9%
+-commutative55.9%
sqr-neg55.9%
unsub-neg55.9%
sqr-neg55.9%
fma-neg55.9%
distribute-lft-neg-in55.9%
*-commutative55.9%
*-commutative55.9%
distribute-rgt-neg-in55.9%
metadata-eval55.9%
Simplified55.9%
Taylor expanded in a around 0 82.2%
mul-1-neg82.2%
unsub-neg82.2%
mul-1-neg82.2%
distribute-neg-frac282.2%
associate-/l*82.2%
Simplified82.2%
Taylor expanded in b around inf 82.2%
neg-mul-182.2%
mul-1-neg82.2%
associate-*r/82.2%
unsub-neg82.2%
unpow282.2%
unpow282.2%
times-frac82.2%
sqr-neg82.2%
distribute-frac-neg282.2%
distribute-frac-neg282.2%
unpow282.2%
distribute-frac-neg282.2%
distribute-neg-frac82.2%
Simplified82.2%
Final simplification82.2%
(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 / Float64(-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 55.9%
*-commutative55.9%
+-commutative55.9%
sqr-neg55.9%
unsub-neg55.9%
sqr-neg55.9%
fma-neg55.9%
distribute-lft-neg-in55.9%
*-commutative55.9%
*-commutative55.9%
distribute-rgt-neg-in55.9%
metadata-eval55.9%
Simplified55.9%
Taylor expanded in b around inf 64.2%
associate-*r/64.2%
mul-1-neg64.2%
Simplified64.2%
Final simplification64.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 55.9%
*-commutative55.9%
Simplified55.9%
add-cbrt-cube55.4%
pow1/352.6%
pow352.6%
pow252.6%
pow-pow52.6%
metadata-eval52.6%
Applied egg-rr52.6%
unpow1/355.2%
Simplified55.2%
add-cube-cbrt52.5%
fma-define52.8%
pow252.8%
pow1/352.0%
pow-pow52.9%
metadata-eval52.9%
associate-*l*52.9%
Applied egg-rr52.9%
Taylor expanded in b around inf 3.2%
associate-*r/3.2%
rem-cube-cbrt3.2%
metadata-eval3.2%
mul0-rgt3.2%
metadata-eval3.2%
rem-cube-cbrt3.2%
rem-cube-cbrt3.2%
metadata-eval3.2%
metadata-eval3.2%
div03.2%
Simplified3.2%
herbie shell --seed 2024144
(FPCore (a b c)
:name "Quadratic roots, narrow range"
:precision binary64
:pre (and (and (and (< 1.0536712127723509e-8 a) (< a 94906265.62425156)) (and (< 1.0536712127723509e-8 b) (< b 94906265.62425156))) (and (< 1.0536712127723509e-8 c) (< c 94906265.62425156)))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))