
(FPCore (a b_2 c) :precision binary64 (/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))
double code(double a, double b_2, double c) {
return (-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a;
}
real(8) function code(a, b_2, c)
real(8), intent (in) :: a
real(8), intent (in) :: b_2
real(8), intent (in) :: c
code = (-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a
end function
public static double code(double a, double b_2, double c) {
return (-b_2 + Math.sqrt(((b_2 * b_2) - (a * c)))) / a;
}
def code(a, b_2, c): return (-b_2 + math.sqrt(((b_2 * b_2) - (a * c)))) / a
function code(a, b_2, c) return Float64(Float64(Float64(-b_2) + sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))) / a) end
function tmp = code(a, b_2, c) tmp = (-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a; end
code[a_, b$95$2_, c_] := N[(N[((-b$95$2) + N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b_2 c) :precision binary64 (/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))
double code(double a, double b_2, double c) {
return (-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a;
}
real(8) function code(a, b_2, c)
real(8), intent (in) :: a
real(8), intent (in) :: b_2
real(8), intent (in) :: c
code = (-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a
end function
public static double code(double a, double b_2, double c) {
return (-b_2 + Math.sqrt(((b_2 * b_2) - (a * c)))) / a;
}
def code(a, b_2, c): return (-b_2 + math.sqrt(((b_2 * b_2) - (a * c)))) / a
function code(a, b_2, c) return Float64(Float64(Float64(-b_2) + sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))) / a) end
function tmp = code(a, b_2, c) tmp = (-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a; end
code[a_, b$95$2_, c_] := N[(N[((-b$95$2) + N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\end{array}
(FPCore (a b_2 c)
:precision binary64
(if (<= b_2 -2e+156)
(/ (* b_2 -2.0) a)
(if (<= b_2 1.52e-86)
(/ (- (sqrt (- (* b_2 b_2) (* a c))) b_2) a)
(pow (+ (* 0.5 (/ a b_2)) (* -2.0 (/ b_2 c))) -1.0))))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -2e+156) {
tmp = (b_2 * -2.0) / a;
} else if (b_2 <= 1.52e-86) {
tmp = (sqrt(((b_2 * b_2) - (a * c))) - b_2) / a;
} else {
tmp = pow(((0.5 * (a / b_2)) + (-2.0 * (b_2 / c))), -1.0);
}
return tmp;
}
real(8) function code(a, b_2, c)
real(8), intent (in) :: a
real(8), intent (in) :: b_2
real(8), intent (in) :: c
real(8) :: tmp
if (b_2 <= (-2d+156)) then
tmp = (b_2 * (-2.0d0)) / a
else if (b_2 <= 1.52d-86) then
tmp = (sqrt(((b_2 * b_2) - (a * c))) - b_2) / a
else
tmp = ((0.5d0 * (a / b_2)) + ((-2.0d0) * (b_2 / c))) ** (-1.0d0)
end if
code = tmp
end function
public static double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -2e+156) {
tmp = (b_2 * -2.0) / a;
} else if (b_2 <= 1.52e-86) {
tmp = (Math.sqrt(((b_2 * b_2) - (a * c))) - b_2) / a;
} else {
tmp = Math.pow(((0.5 * (a / b_2)) + (-2.0 * (b_2 / c))), -1.0);
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= -2e+156: tmp = (b_2 * -2.0) / a elif b_2 <= 1.52e-86: tmp = (math.sqrt(((b_2 * b_2) - (a * c))) - b_2) / a else: tmp = math.pow(((0.5 * (a / b_2)) + (-2.0 * (b_2 / c))), -1.0) return tmp
function code(a, b_2, c) tmp = 0.0 if (b_2 <= -2e+156) tmp = Float64(Float64(b_2 * -2.0) / a); elseif (b_2 <= 1.52e-86) tmp = Float64(Float64(sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c))) - b_2) / a); else tmp = Float64(Float64(0.5 * Float64(a / b_2)) + Float64(-2.0 * Float64(b_2 / c))) ^ -1.0; end return tmp end
function tmp_2 = code(a, b_2, c) tmp = 0.0; if (b_2 <= -2e+156) tmp = (b_2 * -2.0) / a; elseif (b_2 <= 1.52e-86) tmp = (sqrt(((b_2 * b_2) - (a * c))) - b_2) / a; else tmp = ((0.5 * (a / b_2)) + (-2.0 * (b_2 / c))) ^ -1.0; end tmp_2 = tmp; end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -2e+156], N[(N[(b$95$2 * -2.0), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b$95$2, 1.52e-86], N[(N[(N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b$95$2), $MachinePrecision] / a), $MachinePrecision], N[Power[N[(N[(0.5 * N[(a / b$95$2), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[(b$95$2 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -2 \cdot 10^{+156}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\
\mathbf{elif}\;b_2 \leq 1.52 \cdot 10^{-86}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\\
\mathbf{else}:\\
\;\;\;\;{\left(0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}\right)}^{-1}\\
\end{array}
\end{array}
if b_2 < -2e156Initial program 35.2%
+-commutative35.2%
unsub-neg35.2%
Simplified35.2%
Taylor expanded in b_2 around -inf 97.6%
*-commutative97.6%
Simplified97.6%
if -2e156 < b_2 < 1.52e-86Initial program 83.7%
+-commutative83.7%
unsub-neg83.7%
Simplified83.7%
if 1.52e-86 < b_2 Initial program 18.0%
+-commutative18.0%
unsub-neg18.0%
Simplified18.0%
clear-num18.0%
inv-pow18.0%
sub-neg18.0%
add-sqr-sqrt16.1%
hypot-def25.4%
*-commutative25.4%
distribute-rgt-neg-in25.4%
Applied egg-rr25.4%
Taylor expanded in b_2 around inf 0.0%
fma-def0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt86.8%
neg-mul-186.8%
Simplified86.8%
Taylor expanded in a around 0 86.8%
Final simplification86.9%
(FPCore (a b_2 c)
:precision binary64
(if (<= b_2 -2e+156)
(/ (* b_2 -2.0) a)
(if (<= b_2 1.6e-84)
(/ (- (sqrt (- (* b_2 b_2) (* a c))) b_2) a)
(* -0.5 (/ c b_2)))))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -2e+156) {
tmp = (b_2 * -2.0) / a;
} else if (b_2 <= 1.6e-84) {
tmp = (sqrt(((b_2 * b_2) - (a * c))) - b_2) / a;
} else {
tmp = -0.5 * (c / b_2);
}
return tmp;
}
real(8) function code(a, b_2, c)
real(8), intent (in) :: a
real(8), intent (in) :: b_2
real(8), intent (in) :: c
real(8) :: tmp
if (b_2 <= (-2d+156)) then
tmp = (b_2 * (-2.0d0)) / a
else if (b_2 <= 1.6d-84) then
tmp = (sqrt(((b_2 * b_2) - (a * c))) - b_2) / a
else
tmp = (-0.5d0) * (c / b_2)
end if
code = tmp
end function
public static double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -2e+156) {
tmp = (b_2 * -2.0) / a;
} else if (b_2 <= 1.6e-84) {
tmp = (Math.sqrt(((b_2 * b_2) - (a * c))) - b_2) / a;
} else {
tmp = -0.5 * (c / b_2);
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= -2e+156: tmp = (b_2 * -2.0) / a elif b_2 <= 1.6e-84: tmp = (math.sqrt(((b_2 * b_2) - (a * c))) - b_2) / a else: tmp = -0.5 * (c / b_2) return tmp
function code(a, b_2, c) tmp = 0.0 if (b_2 <= -2e+156) tmp = Float64(Float64(b_2 * -2.0) / a); elseif (b_2 <= 1.6e-84) tmp = Float64(Float64(sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c))) - b_2) / a); else tmp = Float64(-0.5 * Float64(c / b_2)); end return tmp end
function tmp_2 = code(a, b_2, c) tmp = 0.0; if (b_2 <= -2e+156) tmp = (b_2 * -2.0) / a; elseif (b_2 <= 1.6e-84) tmp = (sqrt(((b_2 * b_2) - (a * c))) - b_2) / a; else tmp = -0.5 * (c / b_2); end tmp_2 = tmp; end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -2e+156], N[(N[(b$95$2 * -2.0), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b$95$2, 1.6e-84], N[(N[(N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b$95$2), $MachinePrecision] / a), $MachinePrecision], N[(-0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -2 \cdot 10^{+156}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\
\mathbf{elif}\;b_2 \leq 1.6 \cdot 10^{-84}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\
\end{array}
\end{array}
if b_2 < -2e156Initial program 35.2%
+-commutative35.2%
unsub-neg35.2%
Simplified35.2%
Taylor expanded in b_2 around -inf 97.6%
*-commutative97.6%
Simplified97.6%
if -2e156 < b_2 < 1.6e-84Initial program 83.5%
+-commutative83.5%
unsub-neg83.5%
Simplified83.5%
if 1.6e-84 < b_2 Initial program 17.6%
+-commutative17.6%
unsub-neg17.6%
Simplified17.6%
Taylor expanded in b_2 around inf 86.7%
Final simplification86.8%
(FPCore (a b_2 c) :precision binary64 (if (<= b_2 -1.12e-14) (+ (* -2.0 (/ b_2 a)) (* 0.5 (/ c b_2))) (if (<= b_2 1.75e-92) (/ (- (sqrt (* c (- a))) b_2) a) (* -0.5 (/ c b_2)))))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -1.12e-14) {
tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
} else if (b_2 <= 1.75e-92) {
tmp = (sqrt((c * -a)) - b_2) / a;
} else {
tmp = -0.5 * (c / b_2);
}
return tmp;
}
real(8) function code(a, b_2, c)
real(8), intent (in) :: a
real(8), intent (in) :: b_2
real(8), intent (in) :: c
real(8) :: tmp
if (b_2 <= (-1.12d-14)) then
tmp = ((-2.0d0) * (b_2 / a)) + (0.5d0 * (c / b_2))
else if (b_2 <= 1.75d-92) then
tmp = (sqrt((c * -a)) - b_2) / a
else
tmp = (-0.5d0) * (c / b_2)
end if
code = tmp
end function
public static double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -1.12e-14) {
tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
} else if (b_2 <= 1.75e-92) {
tmp = (Math.sqrt((c * -a)) - b_2) / a;
} else {
tmp = -0.5 * (c / b_2);
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= -1.12e-14: tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2)) elif b_2 <= 1.75e-92: tmp = (math.sqrt((c * -a)) - b_2) / a else: tmp = -0.5 * (c / b_2) return tmp
function code(a, b_2, c) tmp = 0.0 if (b_2 <= -1.12e-14) tmp = Float64(Float64(-2.0 * Float64(b_2 / a)) + Float64(0.5 * Float64(c / b_2))); elseif (b_2 <= 1.75e-92) tmp = Float64(Float64(sqrt(Float64(c * Float64(-a))) - b_2) / a); else tmp = Float64(-0.5 * Float64(c / b_2)); end return tmp end
function tmp_2 = code(a, b_2, c) tmp = 0.0; if (b_2 <= -1.12e-14) tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2)); elseif (b_2 <= 1.75e-92) tmp = (sqrt((c * -a)) - b_2) / a; else tmp = -0.5 * (c / b_2); end tmp_2 = tmp; end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -1.12e-14], N[(N[(-2.0 * N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, 1.75e-92], N[(N[(N[Sqrt[N[(c * (-a)), $MachinePrecision]], $MachinePrecision] - b$95$2), $MachinePrecision] / a), $MachinePrecision], N[(-0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.12 \cdot 10^{-14}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\
\mathbf{elif}\;b_2 \leq 1.75 \cdot 10^{-92}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(-a\right)} - b_2}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\
\end{array}
\end{array}
if b_2 < -1.12000000000000006e-14Initial program 61.7%
+-commutative61.7%
unsub-neg61.7%
Simplified61.7%
Taylor expanded in b_2 around -inf 89.6%
if -1.12000000000000006e-14 < b_2 < 1.75e-92Initial program 80.7%
+-commutative80.7%
unsub-neg80.7%
Simplified80.7%
Taylor expanded in b_2 around 0 68.8%
mul-1-neg68.8%
distribute-rgt-neg-out68.8%
Simplified68.8%
if 1.75e-92 < b_2 Initial program 18.0%
+-commutative18.0%
unsub-neg18.0%
Simplified18.0%
Taylor expanded in b_2 around inf 86.4%
Final simplification81.3%
(FPCore (a b_2 c) :precision binary64 (if (<= b_2 2.1e-277) (/ (- b_2) a) (* -0.5 (/ c b_2))))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= 2.1e-277) {
tmp = -b_2 / a;
} else {
tmp = -0.5 * (c / b_2);
}
return tmp;
}
real(8) function code(a, b_2, c)
real(8), intent (in) :: a
real(8), intent (in) :: b_2
real(8), intent (in) :: c
real(8) :: tmp
if (b_2 <= 2.1d-277) then
tmp = -b_2 / a
else
tmp = (-0.5d0) * (c / b_2)
end if
code = tmp
end function
public static double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= 2.1e-277) {
tmp = -b_2 / a;
} else {
tmp = -0.5 * (c / b_2);
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= 2.1e-277: tmp = -b_2 / a else: tmp = -0.5 * (c / b_2) return tmp
function code(a, b_2, c) tmp = 0.0 if (b_2 <= 2.1e-277) tmp = Float64(Float64(-b_2) / a); else tmp = Float64(-0.5 * Float64(c / b_2)); end return tmp end
function tmp_2 = code(a, b_2, c) tmp = 0.0; if (b_2 <= 2.1e-277) tmp = -b_2 / a; else tmp = -0.5 * (c / b_2); end tmp_2 = tmp; end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, 2.1e-277], N[((-b$95$2) / a), $MachinePrecision], N[(-0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq 2.1 \cdot 10^{-277}:\\
\;\;\;\;\frac{-b_2}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\
\end{array}
\end{array}
if b_2 < 2.09999999999999995e-277Initial program 73.0%
+-commutative73.0%
unsub-neg73.0%
Simplified73.0%
add-sqr-sqrt72.7%
pow272.7%
pow1/272.7%
sqrt-pow172.8%
fma-neg72.8%
*-commutative72.8%
distribute-rgt-neg-in72.8%
metadata-eval72.8%
Applied egg-rr72.8%
Taylor expanded in b_2 around inf 23.0%
associate-*r/23.0%
neg-mul-123.0%
Simplified23.0%
if 2.09999999999999995e-277 < b_2 Initial program 28.8%
+-commutative28.8%
unsub-neg28.8%
Simplified28.8%
Taylor expanded in b_2 around inf 74.0%
Final simplification47.7%
(FPCore (a b_2 c) :precision binary64 (if (<= b_2 2.1e-277) (/ (* b_2 -2.0) a) (* -0.5 (/ c b_2))))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= 2.1e-277) {
tmp = (b_2 * -2.0) / a;
} else {
tmp = -0.5 * (c / b_2);
}
return tmp;
}
real(8) function code(a, b_2, c)
real(8), intent (in) :: a
real(8), intent (in) :: b_2
real(8), intent (in) :: c
real(8) :: tmp
if (b_2 <= 2.1d-277) then
tmp = (b_2 * (-2.0d0)) / a
else
tmp = (-0.5d0) * (c / b_2)
end if
code = tmp
end function
public static double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= 2.1e-277) {
tmp = (b_2 * -2.0) / a;
} else {
tmp = -0.5 * (c / b_2);
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= 2.1e-277: tmp = (b_2 * -2.0) / a else: tmp = -0.5 * (c / b_2) return tmp
function code(a, b_2, c) tmp = 0.0 if (b_2 <= 2.1e-277) tmp = Float64(Float64(b_2 * -2.0) / a); else tmp = Float64(-0.5 * Float64(c / b_2)); end return tmp end
function tmp_2 = code(a, b_2, c) tmp = 0.0; if (b_2 <= 2.1e-277) tmp = (b_2 * -2.0) / a; else tmp = -0.5 * (c / b_2); end tmp_2 = tmp; end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, 2.1e-277], N[(N[(b$95$2 * -2.0), $MachinePrecision] / a), $MachinePrecision], N[(-0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq 2.1 \cdot 10^{-277}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\
\end{array}
\end{array}
if b_2 < 2.09999999999999995e-277Initial program 73.0%
+-commutative73.0%
unsub-neg73.0%
Simplified73.0%
Taylor expanded in b_2 around -inf 59.9%
*-commutative59.9%
Simplified59.9%
if 2.09999999999999995e-277 < b_2 Initial program 28.8%
+-commutative28.8%
unsub-neg28.8%
Simplified28.8%
Taylor expanded in b_2 around inf 74.0%
Final simplification66.7%
(FPCore (a b_2 c) :precision binary64 (if (<= b_2 2.35e-23) (/ (- b_2) a) (/ 0.0 a)))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= 2.35e-23) {
tmp = -b_2 / a;
} else {
tmp = 0.0 / a;
}
return tmp;
}
real(8) function code(a, b_2, c)
real(8), intent (in) :: a
real(8), intent (in) :: b_2
real(8), intent (in) :: c
real(8) :: tmp
if (b_2 <= 2.35d-23) then
tmp = -b_2 / a
else
tmp = 0.0d0 / a
end if
code = tmp
end function
public static double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= 2.35e-23) {
tmp = -b_2 / a;
} else {
tmp = 0.0 / a;
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= 2.35e-23: tmp = -b_2 / a else: tmp = 0.0 / a return tmp
function code(a, b_2, c) tmp = 0.0 if (b_2 <= 2.35e-23) tmp = Float64(Float64(-b_2) / a); else tmp = Float64(0.0 / a); end return tmp end
function tmp_2 = code(a, b_2, c) tmp = 0.0; if (b_2 <= 2.35e-23) tmp = -b_2 / a; else tmp = 0.0 / a; end tmp_2 = tmp; end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, 2.35e-23], N[((-b$95$2) / a), $MachinePrecision], N[(0.0 / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq 2.35 \cdot 10^{-23}:\\
\;\;\;\;\frac{-b_2}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{a}\\
\end{array}
\end{array}
if b_2 < 2.35e-23Initial program 70.1%
+-commutative70.1%
unsub-neg70.1%
Simplified70.1%
add-sqr-sqrt69.7%
pow269.7%
pow1/269.7%
sqrt-pow169.8%
fma-neg69.8%
*-commutative69.8%
distribute-rgt-neg-in69.8%
metadata-eval69.8%
Applied egg-rr69.8%
Taylor expanded in b_2 around inf 18.3%
associate-*r/18.3%
neg-mul-118.3%
Simplified18.3%
if 2.35e-23 < b_2 Initial program 12.4%
+-commutative12.4%
unsub-neg12.4%
Simplified12.4%
add-sqr-sqrt11.1%
pow211.1%
pow1/211.1%
sqrt-pow111.1%
fma-neg11.2%
*-commutative11.2%
distribute-rgt-neg-in11.2%
metadata-eval11.2%
Applied egg-rr11.2%
Taylor expanded in b_2 around inf 23.0%
distribute-lft1-in23.0%
metadata-eval23.0%
mul0-lft23.0%
Simplified23.0%
Final simplification19.8%
(FPCore (a b_2 c) :precision binary64 (/ 0.0 a))
double code(double a, double b_2, double c) {
return 0.0 / a;
}
real(8) function code(a, b_2, c)
real(8), intent (in) :: a
real(8), intent (in) :: b_2
real(8), intent (in) :: c
code = 0.0d0 / a
end function
public static double code(double a, double b_2, double c) {
return 0.0 / a;
}
def code(a, b_2, c): return 0.0 / a
function code(a, b_2, c) return Float64(0.0 / a) end
function tmp = code(a, b_2, c) tmp = 0.0 / a; end
code[a_, b$95$2_, c_] := N[(0.0 / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{0}{a}
\end{array}
Initial program 51.6%
+-commutative51.6%
unsub-neg51.6%
Simplified51.6%
add-sqr-sqrt51.0%
pow251.0%
pow1/251.0%
sqrt-pow151.0%
fma-neg51.0%
*-commutative51.0%
distribute-rgt-neg-in51.0%
metadata-eval51.0%
Applied egg-rr51.0%
Taylor expanded in b_2 around inf 9.5%
distribute-lft1-in9.5%
metadata-eval9.5%
mul0-lft9.5%
Simplified9.5%
Final simplification9.5%
herbie shell --seed 2023263
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))