
(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 8 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 -1.5e-125)
(/ (* -0.5 c) b_2)
(if (<= b_2 2e+80)
(/ (- (- b_2) (sqrt (- (* b_2 b_2) (* c a)))) a)
(+ (* -2.0 (/ b_2 a)) (* 0.5 (/ c b_2))))))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -1.5e-125) {
tmp = (-0.5 * c) / b_2;
} else if (b_2 <= 2e+80) {
tmp = (-b_2 - sqrt(((b_2 * b_2) - (c * a)))) / a;
} else {
tmp = (-2.0 * (b_2 / a)) + (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.5d-125)) then
tmp = ((-0.5d0) * c) / b_2
else if (b_2 <= 2d+80) then
tmp = (-b_2 - sqrt(((b_2 * b_2) - (c * a)))) / a
else
tmp = ((-2.0d0) * (b_2 / a)) + (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.5e-125) {
tmp = (-0.5 * c) / b_2;
} else if (b_2 <= 2e+80) {
tmp = (-b_2 - Math.sqrt(((b_2 * b_2) - (c * a)))) / a;
} else {
tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= -1.5e-125: tmp = (-0.5 * c) / b_2 elif b_2 <= 2e+80: tmp = (-b_2 - math.sqrt(((b_2 * b_2) - (c * a)))) / a else: tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2)) return tmp
function code(a, b_2, c) tmp = 0.0 if (b_2 <= -1.5e-125) tmp = Float64(Float64(-0.5 * c) / b_2); elseif (b_2 <= 2e+80) tmp = Float64(Float64(Float64(-b_2) - sqrt(Float64(Float64(b_2 * b_2) - Float64(c * a)))) / a); else tmp = Float64(Float64(-2.0 * Float64(b_2 / a)) + 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.5e-125) tmp = (-0.5 * c) / b_2; elseif (b_2 <= 2e+80) tmp = (-b_2 - sqrt(((b_2 * b_2) - (c * a)))) / a; else tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2)); end tmp_2 = tmp; end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -1.5e-125], N[(N[(-0.5 * c), $MachinePrecision] / b$95$2), $MachinePrecision], If[LessEqual[b$95$2, 2e+80], N[(N[((-b$95$2) - N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(c * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(-2.0 * N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.5 \cdot 10^{-125}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b_2}\\
\mathbf{elif}\;b_2 \leq 2 \cdot 10^{+80}:\\
\;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - c \cdot a}}{a}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\
\end{array}
\end{array}
if b_2 < -1.49999999999999995e-125Initial program 22.3%
Taylor expanded in b_2 around -inf 78.4%
associate-*r/78.4%
Simplified78.4%
if -1.49999999999999995e-125 < b_2 < 2e80Initial program 88.2%
if 2e80 < b_2 Initial program 58.0%
Taylor expanded in b_2 around inf 95.0%
Final simplification86.0%
(FPCore (a b_2 c)
:precision binary64
(if (<= b_2 -1.5e-125)
(/ (* -0.5 c) b_2)
(if (<= b_2 1.15e-86)
(/ (- (- b_2) (sqrt (* c (- a)))) a)
(+ (* -2.0 (/ b_2 a)) (* 0.5 (/ c b_2))))))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -1.5e-125) {
tmp = (-0.5 * c) / b_2;
} else if (b_2 <= 1.15e-86) {
tmp = (-b_2 - sqrt((c * -a))) / a;
} else {
tmp = (-2.0 * (b_2 / a)) + (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.5d-125)) then
tmp = ((-0.5d0) * c) / b_2
else if (b_2 <= 1.15d-86) then
tmp = (-b_2 - sqrt((c * -a))) / a
else
tmp = ((-2.0d0) * (b_2 / a)) + (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.5e-125) {
tmp = (-0.5 * c) / b_2;
} else if (b_2 <= 1.15e-86) {
tmp = (-b_2 - Math.sqrt((c * -a))) / a;
} else {
tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= -1.5e-125: tmp = (-0.5 * c) / b_2 elif b_2 <= 1.15e-86: tmp = (-b_2 - math.sqrt((c * -a))) / a else: tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2)) return tmp
function code(a, b_2, c) tmp = 0.0 if (b_2 <= -1.5e-125) tmp = Float64(Float64(-0.5 * c) / b_2); elseif (b_2 <= 1.15e-86) tmp = Float64(Float64(Float64(-b_2) - sqrt(Float64(c * Float64(-a)))) / a); else tmp = Float64(Float64(-2.0 * Float64(b_2 / a)) + 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.5e-125) tmp = (-0.5 * c) / b_2; elseif (b_2 <= 1.15e-86) tmp = (-b_2 - sqrt((c * -a))) / a; else tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2)); end tmp_2 = tmp; end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -1.5e-125], N[(N[(-0.5 * c), $MachinePrecision] / b$95$2), $MachinePrecision], If[LessEqual[b$95$2, 1.15e-86], N[(N[((-b$95$2) - N[Sqrt[N[(c * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(-2.0 * N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.5 \cdot 10^{-125}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b_2}\\
\mathbf{elif}\;b_2 \leq 1.15 \cdot 10^{-86}:\\
\;\;\;\;\frac{\left(-b_2\right) - \sqrt{c \cdot \left(-a\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\
\end{array}
\end{array}
if b_2 < -1.49999999999999995e-125Initial program 22.3%
Taylor expanded in b_2 around -inf 78.4%
associate-*r/78.4%
Simplified78.4%
if -1.49999999999999995e-125 < b_2 < 1.14999999999999998e-86Initial program 81.9%
Taylor expanded in b_2 around 0 78.0%
mul-1-neg78.0%
distribute-rgt-neg-out78.0%
Simplified78.0%
if 1.14999999999999998e-86 < b_2 Initial program 75.2%
Taylor expanded in b_2 around inf 87.4%
Final simplification81.7%
(FPCore (a b_2 c) :precision binary64 (if (<= b_2 -1e-309) (/ (* -0.5 c) b_2) (+ (* -2.0 (/ b_2 a)) (* 0.5 (/ c b_2)))))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -1e-309) {
tmp = (-0.5 * c) / b_2;
} else {
tmp = (-2.0 * (b_2 / a)) + (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 <= (-1d-309)) then
tmp = ((-0.5d0) * c) / b_2
else
tmp = ((-2.0d0) * (b_2 / a)) + (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 <= -1e-309) {
tmp = (-0.5 * c) / b_2;
} else {
tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= -1e-309: tmp = (-0.5 * c) / b_2 else: tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2)) return tmp
function code(a, b_2, c) tmp = 0.0 if (b_2 <= -1e-309) tmp = Float64(Float64(-0.5 * c) / b_2); else tmp = Float64(Float64(-2.0 * Float64(b_2 / a)) + 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 <= -1e-309) tmp = (-0.5 * c) / b_2; else tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2)); end tmp_2 = tmp; end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -1e-309], N[(N[(-0.5 * c), $MachinePrecision] / b$95$2), $MachinePrecision], N[(N[(-2.0 * N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b_2}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\
\end{array}
\end{array}
if b_2 < -1.000000000000002e-309Initial program 36.0%
Taylor expanded in b_2 around -inf 62.4%
associate-*r/62.4%
Simplified62.4%
if -1.000000000000002e-309 < b_2 Initial program 77.4%
Taylor expanded in b_2 around inf 71.5%
Final simplification67.0%
(FPCore (a b_2 c) :precision binary64 (if (<= b_2 -1e-309) (/ 0.0 a) (/ -2.0 (/ a b_2))))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -1e-309) {
tmp = 0.0 / a;
} else {
tmp = -2.0 / (a / 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 <= (-1d-309)) then
tmp = 0.0d0 / a
else
tmp = (-2.0d0) / (a / b_2)
end if
code = tmp
end function
public static double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -1e-309) {
tmp = 0.0 / a;
} else {
tmp = -2.0 / (a / b_2);
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= -1e-309: tmp = 0.0 / a else: tmp = -2.0 / (a / b_2) return tmp
function code(a, b_2, c) tmp = 0.0 if (b_2 <= -1e-309) tmp = Float64(0.0 / a); else tmp = Float64(-2.0 / Float64(a / b_2)); end return tmp end
function tmp_2 = code(a, b_2, c) tmp = 0.0; if (b_2 <= -1e-309) tmp = 0.0 / a; else tmp = -2.0 / (a / b_2); end tmp_2 = tmp; end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -1e-309], N[(0.0 / a), $MachinePrecision], N[(-2.0 / N[(a / b$95$2), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{0}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-2}{\frac{a}{b_2}}\\
\end{array}
\end{array}
if b_2 < -1.000000000000002e-309Initial program 36.0%
add-sqr-sqrt34.3%
pow234.3%
pow1/234.3%
sqrt-pow134.4%
metadata-eval34.4%
Applied egg-rr34.4%
Taylor expanded in b_2 around -inf 20.2%
distribute-lft1-in20.2%
metadata-eval20.2%
mul0-lft20.2%
Simplified20.2%
if -1.000000000000002e-309 < b_2 Initial program 77.4%
pow1/277.4%
pow-to-exp73.7%
Applied egg-rr73.7%
Taylor expanded in b_2 around inf 70.8%
associate-*r/70.8%
associate-/l*70.6%
Simplified70.6%
Final simplification45.8%
(FPCore (a b_2 c) :precision binary64 (if (<= b_2 -1e-309) (/ (* -0.5 c) b_2) (/ -2.0 (/ a b_2))))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -1e-309) {
tmp = (-0.5 * c) / b_2;
} else {
tmp = -2.0 / (a / 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 <= (-1d-309)) then
tmp = ((-0.5d0) * c) / b_2
else
tmp = (-2.0d0) / (a / b_2)
end if
code = tmp
end function
public static double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -1e-309) {
tmp = (-0.5 * c) / b_2;
} else {
tmp = -2.0 / (a / b_2);
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= -1e-309: tmp = (-0.5 * c) / b_2 else: tmp = -2.0 / (a / b_2) return tmp
function code(a, b_2, c) tmp = 0.0 if (b_2 <= -1e-309) tmp = Float64(Float64(-0.5 * c) / b_2); else tmp = Float64(-2.0 / Float64(a / b_2)); end return tmp end
function tmp_2 = code(a, b_2, c) tmp = 0.0; if (b_2 <= -1e-309) tmp = (-0.5 * c) / b_2; else tmp = -2.0 / (a / b_2); end tmp_2 = tmp; end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -1e-309], N[(N[(-0.5 * c), $MachinePrecision] / b$95$2), $MachinePrecision], N[(-2.0 / N[(a / b$95$2), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{-2}{\frac{a}{b_2}}\\
\end{array}
\end{array}
if b_2 < -1.000000000000002e-309Initial program 36.0%
Taylor expanded in b_2 around -inf 62.4%
associate-*r/62.4%
Simplified62.4%
if -1.000000000000002e-309 < b_2 Initial program 77.4%
pow1/277.4%
pow-to-exp73.7%
Applied egg-rr73.7%
Taylor expanded in b_2 around inf 70.8%
associate-*r/70.8%
associate-/l*70.6%
Simplified70.6%
Final simplification66.6%
(FPCore (a b_2 c) :precision binary64 (if (<= b_2 -1e-309) (/ (* -0.5 c) b_2) (/ (* b_2 -2.0) a)))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -1e-309) {
tmp = (-0.5 * c) / b_2;
} else {
tmp = (b_2 * -2.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 <= (-1d-309)) then
tmp = ((-0.5d0) * c) / b_2
else
tmp = (b_2 * (-2.0d0)) / a
end if
code = tmp
end function
public static double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -1e-309) {
tmp = (-0.5 * c) / b_2;
} else {
tmp = (b_2 * -2.0) / a;
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= -1e-309: tmp = (-0.5 * c) / b_2 else: tmp = (b_2 * -2.0) / a return tmp
function code(a, b_2, c) tmp = 0.0 if (b_2 <= -1e-309) tmp = Float64(Float64(-0.5 * c) / b_2); else tmp = Float64(Float64(b_2 * -2.0) / a); end return tmp end
function tmp_2 = code(a, b_2, c) tmp = 0.0; if (b_2 <= -1e-309) tmp = (-0.5 * c) / b_2; else tmp = (b_2 * -2.0) / a; end tmp_2 = tmp; end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -1e-309], N[(N[(-0.5 * c), $MachinePrecision] / b$95$2), $MachinePrecision], N[(N[(b$95$2 * -2.0), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\
\end{array}
\end{array}
if b_2 < -1.000000000000002e-309Initial program 36.0%
Taylor expanded in b_2 around -inf 62.4%
associate-*r/62.4%
Simplified62.4%
if -1.000000000000002e-309 < b_2 Initial program 77.4%
Taylor expanded in b_2 around inf 70.8%
*-commutative70.8%
Simplified70.8%
Final simplification66.7%
(FPCore (a b_2 c) :precision binary64 (if (<= b_2 -1e-309) (/ 0.0 a) (/ (- b_2) a)))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -1e-309) {
tmp = 0.0 / a;
} else {
tmp = -b_2 / 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 <= (-1d-309)) then
tmp = 0.0d0 / a
else
tmp = -b_2 / a
end if
code = tmp
end function
public static double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -1e-309) {
tmp = 0.0 / a;
} else {
tmp = -b_2 / a;
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= -1e-309: tmp = 0.0 / a else: tmp = -b_2 / a return tmp
function code(a, b_2, c) tmp = 0.0 if (b_2 <= -1e-309) tmp = Float64(0.0 / a); else tmp = Float64(Float64(-b_2) / a); end return tmp end
function tmp_2 = code(a, b_2, c) tmp = 0.0; if (b_2 <= -1e-309) tmp = 0.0 / a; else tmp = -b_2 / a; end tmp_2 = tmp; end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -1e-309], N[(0.0 / a), $MachinePrecision], N[((-b$95$2) / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{0}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-b_2}{a}\\
\end{array}
\end{array}
if b_2 < -1.000000000000002e-309Initial program 36.0%
add-sqr-sqrt34.3%
pow234.3%
pow1/234.3%
sqrt-pow134.4%
metadata-eval34.4%
Applied egg-rr34.4%
Taylor expanded in b_2 around -inf 20.2%
distribute-lft1-in20.2%
metadata-eval20.2%
mul0-lft20.2%
Simplified20.2%
if -1.000000000000002e-309 < b_2 Initial program 77.4%
add-sqr-sqrt77.2%
pow277.2%
pow1/277.2%
sqrt-pow177.2%
metadata-eval77.2%
Applied egg-rr77.2%
Taylor expanded in b_2 around inf 27.9%
neg-mul-127.9%
Simplified27.9%
Final simplification24.1%
(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 57.0%
add-sqr-sqrt56.1%
pow256.1%
pow1/256.1%
sqrt-pow156.2%
metadata-eval56.2%
Applied egg-rr56.2%
Taylor expanded in b_2 around -inf 11.3%
distribute-lft1-in11.3%
metadata-eval11.3%
mul0-lft11.3%
Simplified11.3%
Final simplification11.3%
herbie shell --seed 2023263
(FPCore (a b_2 c)
:name "quad2m (problem 3.2.1, negative)"
:precision binary64
(/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))