
(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 11 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 -5.8e-65)
(/ (* -0.5 c) b_2)
(if (<= b_2 1e+139)
(/ (- (- b_2) (sqrt (- (* b_2 b_2) (* c a)))) a)
(- (- (* 0.5 (/ c b_2)) (/ b_2 a)) (/ b_2 a)))))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -5.8e-65) {
tmp = (-0.5 * c) / b_2;
} else if (b_2 <= 1e+139) {
tmp = (-b_2 - sqrt(((b_2 * b_2) - (c * a)))) / a;
} else {
tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (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 <= (-5.8d-65)) then
tmp = ((-0.5d0) * c) / b_2
else if (b_2 <= 1d+139) then
tmp = (-b_2 - sqrt(((b_2 * b_2) - (c * a)))) / a
else
tmp = ((0.5d0 * (c / b_2)) - (b_2 / a)) - (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 <= -5.8e-65) {
tmp = (-0.5 * c) / b_2;
} else if (b_2 <= 1e+139) {
tmp = (-b_2 - Math.sqrt(((b_2 * b_2) - (c * a)))) / a;
} else {
tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (b_2 / a);
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= -5.8e-65: tmp = (-0.5 * c) / b_2 elif b_2 <= 1e+139: tmp = (-b_2 - math.sqrt(((b_2 * b_2) - (c * a)))) / a else: tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (b_2 / a) return tmp
function code(a, b_2, c) tmp = 0.0 if (b_2 <= -5.8e-65) tmp = Float64(Float64(-0.5 * c) / b_2); elseif (b_2 <= 1e+139) tmp = Float64(Float64(Float64(-b_2) - sqrt(Float64(Float64(b_2 * b_2) - Float64(c * a)))) / a); else tmp = Float64(Float64(Float64(0.5 * Float64(c / b_2)) - Float64(b_2 / a)) - Float64(b_2 / a)); end return tmp end
function tmp_2 = code(a, b_2, c) tmp = 0.0; if (b_2 <= -5.8e-65) tmp = (-0.5 * c) / b_2; elseif (b_2 <= 1e+139) tmp = (-b_2 - sqrt(((b_2 * b_2) - (c * a)))) / a; else tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (b_2 / a); end tmp_2 = tmp; end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -5.8e-65], N[(N[(-0.5 * c), $MachinePrecision] / b$95$2), $MachinePrecision], If[LessEqual[b$95$2, 1e+139], 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[(N[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision] - N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision] - N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b\_2 \leq -5.8 \cdot 10^{-65}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b\_2}\\
\mathbf{elif}\;b\_2 \leq 10^{+139}:\\
\;\;\;\;\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - c \cdot a}}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \frac{c}{b\_2} - \frac{b\_2}{a}\right) - \frac{b\_2}{a}\\
\end{array}
\end{array}
if b_2 < -5.7999999999999996e-65Initial program 16.0%
Taylor expanded in b_2 around -inf 90.1%
associate-*r/90.1%
Simplified90.1%
if -5.7999999999999996e-65 < b_2 < 1.00000000000000003e139Initial program 83.8%
if 1.00000000000000003e139 < b_2 Initial program 52.0%
div-sub52.0%
neg-mul-152.0%
associate-/l*52.0%
add-sqr-sqrt51.9%
sqrt-prod52.0%
sqr-neg52.0%
sqrt-unprod0.0%
add-sqr-sqrt2.2%
fma-neg2.2%
add-sqr-sqrt0.0%
sqrt-unprod52.0%
sqr-neg52.0%
sqrt-prod51.9%
add-sqr-sqrt52.0%
Applied egg-rr40.8%
fma-undefine40.8%
unsub-neg40.8%
mul-1-neg40.8%
distribute-frac-neg240.8%
Simplified40.8%
Taylor expanded in c around 0 0.0%
+-commutative0.0%
neg-mul-10.0%
sub-neg0.0%
associate-*r/0.0%
metadata-eval0.0%
distribute-lft-neg-in0.0%
distribute-rgt-neg-in0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt95.8%
mul-1-neg95.8%
remove-double-neg95.8%
associate-*r/95.8%
Simplified95.8%
Final simplification88.4%
(FPCore (a b_2 c)
:precision binary64
(if (<= b_2 -3e-65)
(/ (* -0.5 c) b_2)
(if (<= b_2 9.2e-57)
(/ (- (- b_2) (sqrt (* a (- c)))) a)
(- (- (* 0.5 (/ c b_2)) (/ b_2 a)) (/ b_2 a)))))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -3e-65) {
tmp = (-0.5 * c) / b_2;
} else if (b_2 <= 9.2e-57) {
tmp = (-b_2 - sqrt((a * -c))) / a;
} else {
tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (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 <= (-3d-65)) then
tmp = ((-0.5d0) * c) / b_2
else if (b_2 <= 9.2d-57) then
tmp = (-b_2 - sqrt((a * -c))) / a
else
tmp = ((0.5d0 * (c / b_2)) - (b_2 / a)) - (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 <= -3e-65) {
tmp = (-0.5 * c) / b_2;
} else if (b_2 <= 9.2e-57) {
tmp = (-b_2 - Math.sqrt((a * -c))) / a;
} else {
tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (b_2 / a);
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= -3e-65: tmp = (-0.5 * c) / b_2 elif b_2 <= 9.2e-57: tmp = (-b_2 - math.sqrt((a * -c))) / a else: tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (b_2 / a) return tmp
function code(a, b_2, c) tmp = 0.0 if (b_2 <= -3e-65) tmp = Float64(Float64(-0.5 * c) / b_2); elseif (b_2 <= 9.2e-57) tmp = Float64(Float64(Float64(-b_2) - sqrt(Float64(a * Float64(-c)))) / a); else tmp = Float64(Float64(Float64(0.5 * Float64(c / b_2)) - Float64(b_2 / a)) - Float64(b_2 / a)); end return tmp end
function tmp_2 = code(a, b_2, c) tmp = 0.0; if (b_2 <= -3e-65) tmp = (-0.5 * c) / b_2; elseif (b_2 <= 9.2e-57) tmp = (-b_2 - sqrt((a * -c))) / a; else tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (b_2 / a); end tmp_2 = tmp; end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -3e-65], N[(N[(-0.5 * c), $MachinePrecision] / b$95$2), $MachinePrecision], If[LessEqual[b$95$2, 9.2e-57], N[(N[((-b$95$2) - N[Sqrt[N[(a * (-c)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(N[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision] - N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision] - N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b\_2 \leq -3 \cdot 10^{-65}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b\_2}\\
\mathbf{elif}\;b\_2 \leq 9.2 \cdot 10^{-57}:\\
\;\;\;\;\frac{\left(-b\_2\right) - \sqrt{a \cdot \left(-c\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \frac{c}{b\_2} - \frac{b\_2}{a}\right) - \frac{b\_2}{a}\\
\end{array}
\end{array}
if b_2 < -2.99999999999999998e-65Initial program 16.0%
Taylor expanded in b_2 around -inf 90.1%
associate-*r/90.1%
Simplified90.1%
if -2.99999999999999998e-65 < b_2 < 9.2000000000000001e-57Initial program 79.4%
Taylor expanded in b_2 around 0 72.3%
mul-1-neg72.3%
distribute-rgt-neg-out72.3%
Simplified72.3%
if 9.2000000000000001e-57 < b_2 Initial program 69.6%
div-sub69.6%
neg-mul-169.6%
associate-/l*69.6%
add-sqr-sqrt69.5%
sqrt-prod69.6%
sqr-neg69.6%
sqrt-unprod0.0%
add-sqr-sqrt5.4%
fma-neg5.4%
add-sqr-sqrt0.0%
sqrt-unprod69.6%
sqr-neg69.6%
sqrt-prod69.5%
add-sqr-sqrt69.6%
Applied egg-rr45.6%
fma-undefine45.6%
unsub-neg45.6%
mul-1-neg45.6%
distribute-frac-neg245.6%
Simplified45.6%
Taylor expanded in c around 0 0.0%
+-commutative0.0%
neg-mul-10.0%
sub-neg0.0%
associate-*r/0.0%
metadata-eval0.0%
distribute-lft-neg-in0.0%
distribute-rgt-neg-in0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt89.8%
mul-1-neg89.8%
remove-double-neg89.8%
associate-*r/89.8%
Simplified89.8%
(FPCore (a b_2 c)
:precision binary64
(if (<= b_2 -2.15e-64)
(/ (* -0.5 c) b_2)
(if (<= b_2 2.05e-57)
(/ (sqrt (* a (- c))) (- a))
(- (- (* 0.5 (/ c b_2)) (/ b_2 a)) (/ b_2 a)))))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -2.15e-64) {
tmp = (-0.5 * c) / b_2;
} else if (b_2 <= 2.05e-57) {
tmp = sqrt((a * -c)) / -a;
} else {
tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (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 <= (-2.15d-64)) then
tmp = ((-0.5d0) * c) / b_2
else if (b_2 <= 2.05d-57) then
tmp = sqrt((a * -c)) / -a
else
tmp = ((0.5d0 * (c / b_2)) - (b_2 / a)) - (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 <= -2.15e-64) {
tmp = (-0.5 * c) / b_2;
} else if (b_2 <= 2.05e-57) {
tmp = Math.sqrt((a * -c)) / -a;
} else {
tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (b_2 / a);
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= -2.15e-64: tmp = (-0.5 * c) / b_2 elif b_2 <= 2.05e-57: tmp = math.sqrt((a * -c)) / -a else: tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (b_2 / a) return tmp
function code(a, b_2, c) tmp = 0.0 if (b_2 <= -2.15e-64) tmp = Float64(Float64(-0.5 * c) / b_2); elseif (b_2 <= 2.05e-57) tmp = Float64(sqrt(Float64(a * Float64(-c))) / Float64(-a)); else tmp = Float64(Float64(Float64(0.5 * Float64(c / b_2)) - Float64(b_2 / a)) - Float64(b_2 / a)); end return tmp end
function tmp_2 = code(a, b_2, c) tmp = 0.0; if (b_2 <= -2.15e-64) tmp = (-0.5 * c) / b_2; elseif (b_2 <= 2.05e-57) tmp = sqrt((a * -c)) / -a; else tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (b_2 / a); end tmp_2 = tmp; end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -2.15e-64], N[(N[(-0.5 * c), $MachinePrecision] / b$95$2), $MachinePrecision], If[LessEqual[b$95$2, 2.05e-57], N[(N[Sqrt[N[(a * (-c)), $MachinePrecision]], $MachinePrecision] / (-a)), $MachinePrecision], N[(N[(N[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision] - N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision] - N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b\_2 \leq -2.15 \cdot 10^{-64}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b\_2}\\
\mathbf{elif}\;b\_2 \leq 2.05 \cdot 10^{-57}:\\
\;\;\;\;\frac{\sqrt{a \cdot \left(-c\right)}}{-a}\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \frac{c}{b\_2} - \frac{b\_2}{a}\right) - \frac{b\_2}{a}\\
\end{array}
\end{array}
if b_2 < -2.14999999999999987e-64Initial program 16.0%
Taylor expanded in b_2 around -inf 90.1%
associate-*r/90.1%
Simplified90.1%
if -2.14999999999999987e-64 < b_2 < 2.0500000000000001e-57Initial program 79.4%
prod-diff79.0%
*-commutative79.0%
fma-neg79.0%
prod-diff79.0%
*-commutative79.0%
fma-neg79.0%
associate-+l+79.1%
pow279.1%
*-commutative79.1%
fma-undefine79.0%
distribute-lft-neg-in79.0%
*-commutative79.0%
distribute-rgt-neg-in79.0%
fma-define79.1%
*-commutative79.1%
fma-undefine79.0%
distribute-lft-neg-in79.0%
*-commutative79.0%
distribute-rgt-neg-in79.0%
Applied egg-rr79.1%
count-279.1%
Simplified79.1%
Taylor expanded in b_2 around 0 70.6%
mul-1-neg70.6%
*-commutative70.6%
distribute-lft1-in70.6%
metadata-eval70.6%
mul0-lft71.0%
metadata-eval71.0%
neg-sub071.0%
*-commutative71.0%
distribute-rgt-neg-in71.0%
sub0-neg71.0%
metadata-eval71.0%
mul0-lft71.0%
metadata-eval71.0%
distribute-rgt1-in71.0%
Simplified71.0%
if 2.0500000000000001e-57 < b_2 Initial program 69.6%
div-sub69.6%
neg-mul-169.6%
associate-/l*69.6%
add-sqr-sqrt69.5%
sqrt-prod69.6%
sqr-neg69.6%
sqrt-unprod0.0%
add-sqr-sqrt5.4%
fma-neg5.4%
add-sqr-sqrt0.0%
sqrt-unprod69.6%
sqr-neg69.6%
sqrt-prod69.5%
add-sqr-sqrt69.6%
Applied egg-rr45.6%
fma-undefine45.6%
unsub-neg45.6%
mul-1-neg45.6%
distribute-frac-neg245.6%
Simplified45.6%
Taylor expanded in c around 0 0.0%
+-commutative0.0%
neg-mul-10.0%
sub-neg0.0%
associate-*r/0.0%
metadata-eval0.0%
distribute-lft-neg-in0.0%
distribute-rgt-neg-in0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt89.8%
mul-1-neg89.8%
remove-double-neg89.8%
associate-*r/89.8%
Simplified89.8%
(FPCore (a b_2 c)
:precision binary64
(if (<= b_2 -4.2e-110)
(/ (* -0.5 c) b_2)
(if (<= b_2 5e-185)
(- (sqrt (/ (- c) a)))
(- (- (* 0.5 (/ c b_2)) (/ b_2 a)) (/ b_2 a)))))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -4.2e-110) {
tmp = (-0.5 * c) / b_2;
} else if (b_2 <= 5e-185) {
tmp = -sqrt((-c / a));
} else {
tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (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 <= (-4.2d-110)) then
tmp = ((-0.5d0) * c) / b_2
else if (b_2 <= 5d-185) then
tmp = -sqrt((-c / a))
else
tmp = ((0.5d0 * (c / b_2)) - (b_2 / a)) - (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 <= -4.2e-110) {
tmp = (-0.5 * c) / b_2;
} else if (b_2 <= 5e-185) {
tmp = -Math.sqrt((-c / a));
} else {
tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (b_2 / a);
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= -4.2e-110: tmp = (-0.5 * c) / b_2 elif b_2 <= 5e-185: tmp = -math.sqrt((-c / a)) else: tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (b_2 / a) return tmp
function code(a, b_2, c) tmp = 0.0 if (b_2 <= -4.2e-110) tmp = Float64(Float64(-0.5 * c) / b_2); elseif (b_2 <= 5e-185) tmp = Float64(-sqrt(Float64(Float64(-c) / a))); else tmp = Float64(Float64(Float64(0.5 * Float64(c / b_2)) - Float64(b_2 / a)) - Float64(b_2 / a)); end return tmp end
function tmp_2 = code(a, b_2, c) tmp = 0.0; if (b_2 <= -4.2e-110) tmp = (-0.5 * c) / b_2; elseif (b_2 <= 5e-185) tmp = -sqrt((-c / a)); else tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (b_2 / a); end tmp_2 = tmp; end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -4.2e-110], N[(N[(-0.5 * c), $MachinePrecision] / b$95$2), $MachinePrecision], If[LessEqual[b$95$2, 5e-185], (-N[Sqrt[N[((-c) / a), $MachinePrecision]], $MachinePrecision]), N[(N[(N[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision] - N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision] - N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b\_2 \leq -4.2 \cdot 10^{-110}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b\_2}\\
\mathbf{elif}\;b\_2 \leq 5 \cdot 10^{-185}:\\
\;\;\;\;-\sqrt{\frac{-c}{a}}\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \frac{c}{b\_2} - \frac{b\_2}{a}\right) - \frac{b\_2}{a}\\
\end{array}
\end{array}
if b_2 < -4.20000000000000004e-110Initial program 20.0%
Taylor expanded in b_2 around -inf 86.2%
associate-*r/86.2%
Simplified86.2%
if -4.20000000000000004e-110 < b_2 < 5.0000000000000003e-185Initial program 77.3%
prod-diff76.8%
*-commutative76.8%
fma-neg76.8%
prod-diff76.8%
*-commutative76.8%
fma-neg76.8%
associate-+l+77.0%
pow277.0%
*-commutative77.0%
fma-undefine76.8%
distribute-lft-neg-in76.8%
*-commutative76.8%
distribute-rgt-neg-in76.8%
fma-define77.0%
*-commutative77.0%
fma-undefine76.8%
distribute-lft-neg-in76.8%
*-commutative76.8%
distribute-rgt-neg-in76.8%
Applied egg-rr77.0%
count-277.0%
Simplified77.0%
Taylor expanded in a around inf 32.8%
mul-1-neg32.8%
distribute-rgt1-in32.8%
metadata-eval32.8%
mul0-lft32.8%
metadata-eval32.8%
neg-sub032.8%
Simplified32.8%
if 5.0000000000000003e-185 < b_2 Initial program 72.8%
div-sub72.8%
neg-mul-172.8%
associate-/l*72.8%
add-sqr-sqrt72.7%
sqrt-prod72.7%
sqr-neg72.7%
sqrt-unprod0.0%
add-sqr-sqrt17.7%
fma-neg17.7%
add-sqr-sqrt0.0%
sqrt-unprod72.7%
sqr-neg72.7%
sqrt-prod72.7%
add-sqr-sqrt72.8%
Applied egg-rr54.1%
fma-undefine54.1%
unsub-neg54.1%
mul-1-neg54.1%
distribute-frac-neg254.1%
Simplified54.1%
Taylor expanded in c around 0 0.0%
+-commutative0.0%
neg-mul-10.0%
sub-neg0.0%
associate-*r/0.0%
metadata-eval0.0%
distribute-lft-neg-in0.0%
distribute-rgt-neg-in0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt76.9%
mul-1-neg76.9%
remove-double-neg76.9%
associate-*r/76.9%
Simplified76.9%
(FPCore (a b_2 c) :precision binary64 (if (<= b_2 -1e-309) (/ (* -0.5 c) b_2) (- (- (* 0.5 (/ c b_2)) (/ b_2 a)) (/ b_2 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 = ((0.5 * (c / b_2)) - (b_2 / a)) - (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.5d0) * c) / b_2
else
tmp = ((0.5d0 * (c / b_2)) - (b_2 / a)) - (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.5 * c) / b_2;
} else {
tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (b_2 / a);
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= -1e-309: tmp = (-0.5 * c) / b_2 else: tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (b_2 / 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(Float64(0.5 * Float64(c / b_2)) - Float64(b_2 / a)) - 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.5 * c) / b_2; else tmp = ((0.5 * (c / b_2)) - (b_2 / a)) - (b_2 / 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[(N[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision] - N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision] - N[(b$95$2 / a), $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}:\\
\;\;\;\;\left(0.5 \cdot \frac{c}{b\_2} - \frac{b\_2}{a}\right) - \frac{b\_2}{a}\\
\end{array}
\end{array}
if b_2 < -1.000000000000002e-309Initial program 31.8%
Taylor expanded in b_2 around -inf 71.0%
associate-*r/71.0%
Simplified71.0%
if -1.000000000000002e-309 < b_2 Initial program 72.9%
div-sub72.9%
neg-mul-172.9%
associate-/l*72.9%
add-sqr-sqrt72.8%
sqrt-prod72.8%
sqr-neg72.8%
sqrt-unprod0.0%
add-sqr-sqrt23.9%
fma-neg23.9%
add-sqr-sqrt0.0%
sqrt-unprod72.8%
sqr-neg72.8%
sqrt-prod72.8%
add-sqr-sqrt72.9%
Applied egg-rr56.3%
fma-undefine56.3%
unsub-neg56.3%
mul-1-neg56.3%
distribute-frac-neg256.3%
Simplified56.3%
Taylor expanded in c around 0 0.0%
+-commutative0.0%
neg-mul-10.0%
sub-neg0.0%
associate-*r/0.0%
metadata-eval0.0%
distribute-lft-neg-in0.0%
distribute-rgt-neg-in0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt68.9%
mul-1-neg68.9%
remove-double-neg68.9%
associate-*r/68.9%
Simplified68.9%
(FPCore (a b_2 c) :precision binary64 (if (<= b_2 -1e-309) (/ (* -0.5 c) b_2) (+ (* 0.5 (/ c b_2)) (* (/ b_2 a) -2.0))))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -1e-309) {
tmp = (-0.5 * c) / b_2;
} else {
tmp = (0.5 * (c / b_2)) + ((b_2 / a) * -2.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 <= (-1d-309)) then
tmp = ((-0.5d0) * c) / b_2
else
tmp = (0.5d0 * (c / b_2)) + ((b_2 / a) * (-2.0d0))
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 = (0.5 * (c / b_2)) + ((b_2 / a) * -2.0);
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= -1e-309: tmp = (-0.5 * c) / b_2 else: tmp = (0.5 * (c / b_2)) + ((b_2 / a) * -2.0) 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(0.5 * Float64(c / b_2)) + Float64(Float64(b_2 / a) * -2.0)); 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 = (0.5 * (c / b_2)) + ((b_2 / a) * -2.0); 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[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(b$95$2 / a), $MachinePrecision] * -2.0), $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}:\\
\;\;\;\;0.5 \cdot \frac{c}{b\_2} + \frac{b\_2}{a} \cdot -2\\
\end{array}
\end{array}
if b_2 < -1.000000000000002e-309Initial program 31.8%
Taylor expanded in b_2 around -inf 71.0%
associate-*r/71.0%
Simplified71.0%
if -1.000000000000002e-309 < b_2 Initial program 72.9%
Taylor expanded in c around 0 68.9%
Final simplification69.8%
(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 31.8%
Taylor expanded in b_2 around -inf 71.0%
associate-*r/71.0%
Simplified71.0%
if -1.000000000000002e-309 < b_2 Initial program 72.9%
Taylor expanded in b_2 around inf 68.4%
*-commutative68.4%
Simplified68.4%
(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(b_2 * Float64(-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[(b$95$2 * N[(-2.0 / a), $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}:\\
\;\;\;\;b\_2 \cdot \frac{-2}{a}\\
\end{array}
\end{array}
if b_2 < -1.000000000000002e-309Initial program 31.8%
Taylor expanded in b_2 around -inf 71.0%
associate-*r/71.0%
Simplified71.0%
if -1.000000000000002e-309 < b_2 Initial program 72.9%
Taylor expanded in b_2 around inf 67.6%
associate-*r/67.6%
metadata-eval67.6%
Simplified67.6%
Taylor expanded in c around 0 68.1%
(FPCore (a b_2 c) :precision binary64 (if (<= b_2 -3e-309) (* c (/ -0.5 b_2)) (* b_2 (/ -2.0 a))))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -3e-309) {
tmp = c * (-0.5 / 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 <= (-3d-309)) then
tmp = c * ((-0.5d0) / 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 <= -3e-309) {
tmp = c * (-0.5 / b_2);
} else {
tmp = b_2 * (-2.0 / a);
}
return tmp;
}
def code(a, b_2, c): tmp = 0 if b_2 <= -3e-309: tmp = c * (-0.5 / b_2) else: tmp = b_2 * (-2.0 / a) return tmp
function code(a, b_2, c) tmp = 0.0 if (b_2 <= -3e-309) tmp = Float64(c * Float64(-0.5 / b_2)); else tmp = Float64(b_2 * Float64(-2.0 / a)); end return tmp end
function tmp_2 = code(a, b_2, c) tmp = 0.0; if (b_2 <= -3e-309) tmp = c * (-0.5 / 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, -3e-309], N[(c * N[(-0.5 / b$95$2), $MachinePrecision]), $MachinePrecision], N[(b$95$2 * N[(-2.0 / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b\_2 \leq -3 \cdot 10^{-309}:\\
\;\;\;\;c \cdot \frac{-0.5}{b\_2}\\
\mathbf{else}:\\
\;\;\;\;b\_2 \cdot \frac{-2}{a}\\
\end{array}
\end{array}
if b_2 < -3.000000000000001e-309Initial program 31.8%
Taylor expanded in b_2 around -inf 71.0%
associate-*r/71.0%
Simplified71.0%
Taylor expanded in c around 0 71.0%
associate-*r/71.0%
*-commutative71.0%
*-rgt-identity71.0%
associate-*r/70.7%
associate-*l*70.7%
metadata-eval70.7%
distribute-lft-neg-in70.7%
associate-*r/70.7%
metadata-eval70.7%
distribute-neg-frac70.7%
metadata-eval70.7%
Simplified70.7%
if -3.000000000000001e-309 < b_2 Initial program 72.9%
Taylor expanded in b_2 around inf 67.6%
associate-*r/67.6%
metadata-eval67.6%
Simplified67.6%
Taylor expanded in c around 0 68.1%
(FPCore (a b_2 c) :precision binary64 (if (<= b_2 -68000000000.0) (* 0.5 (/ c b_2)) (* b_2 (/ -2.0 a))))
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -68000000000.0) {
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 <= (-68000000000.0d0)) 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 <= -68000000000.0) {
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 <= -68000000000.0: 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 <= -68000000000.0) tmp = Float64(0.5 * Float64(c / b_2)); else tmp = Float64(b_2 * Float64(-2.0 / a)); end return tmp end
function tmp_2 = code(a, b_2, c) tmp = 0.0; if (b_2 <= -68000000000.0) 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, -68000000000.0], N[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision], N[(b$95$2 * N[(-2.0 / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b\_2 \leq -68000000000:\\
\;\;\;\;0.5 \cdot \frac{c}{b\_2}\\
\mathbf{else}:\\
\;\;\;\;b\_2 \cdot \frac{-2}{a}\\
\end{array}
\end{array}
if b_2 < -6.8e10Initial program 13.8%
Taylor expanded in b_2 around inf 2.4%
associate-*r/2.4%
metadata-eval2.4%
Simplified2.4%
Taylor expanded in b_2 around 0 29.5%
if -6.8e10 < b_2 Initial program 71.9%
Taylor expanded in b_2 around inf 52.5%
associate-*r/52.5%
metadata-eval52.5%
Simplified52.5%
Taylor expanded in c around 0 53.2%
(FPCore (a b_2 c) :precision binary64 (* 0.5 (/ c b_2)))
double code(double a, double b_2, double c) {
return 0.5 * (c / b_2);
}
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.5d0 * (c / b_2)
end function
public static double code(double a, double b_2, double c) {
return 0.5 * (c / b_2);
}
def code(a, b_2, c): return 0.5 * (c / b_2)
function code(a, b_2, c) return Float64(0.5 * Float64(c / b_2)) end
function tmp = code(a, b_2, c) tmp = 0.5 * (c / b_2); end
code[a_, b$95$2_, c_] := N[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \frac{c}{b\_2}
\end{array}
Initial program 53.5%
Taylor expanded in b_2 around inf 36.7%
associate-*r/36.7%
metadata-eval36.7%
Simplified36.7%
Taylor expanded in b_2 around 0 11.5%
(FPCore (a b_2 c)
:precision binary64
(let* ((t_0 (* (sqrt (fabs a)) (sqrt (fabs c))))
(t_1
(if (== (copysign a c) a)
(* (sqrt (- (fabs b_2) t_0)) (sqrt (+ (fabs b_2) t_0)))
(hypot b_2 t_0))))
(if (< b_2 0.0) (/ c (- t_1 b_2)) (/ (+ b_2 t_1) (- a)))))
double code(double a, double b_2, double c) {
double t_0 = sqrt(fabs(a)) * sqrt(fabs(c));
double tmp;
if (copysign(a, c) == a) {
tmp = sqrt((fabs(b_2) - t_0)) * sqrt((fabs(b_2) + t_0));
} else {
tmp = hypot(b_2, t_0);
}
double t_1 = tmp;
double tmp_1;
if (b_2 < 0.0) {
tmp_1 = c / (t_1 - b_2);
} else {
tmp_1 = (b_2 + t_1) / -a;
}
return tmp_1;
}
public static double code(double a, double b_2, double c) {
double t_0 = Math.sqrt(Math.abs(a)) * Math.sqrt(Math.abs(c));
double tmp;
if (Math.copySign(a, c) == a) {
tmp = Math.sqrt((Math.abs(b_2) - t_0)) * Math.sqrt((Math.abs(b_2) + t_0));
} else {
tmp = Math.hypot(b_2, t_0);
}
double t_1 = tmp;
double tmp_1;
if (b_2 < 0.0) {
tmp_1 = c / (t_1 - b_2);
} else {
tmp_1 = (b_2 + t_1) / -a;
}
return tmp_1;
}
def code(a, b_2, c): t_0 = math.sqrt(math.fabs(a)) * math.sqrt(math.fabs(c)) tmp = 0 if math.copysign(a, c) == a: tmp = math.sqrt((math.fabs(b_2) - t_0)) * math.sqrt((math.fabs(b_2) + t_0)) else: tmp = math.hypot(b_2, t_0) t_1 = tmp tmp_1 = 0 if b_2 < 0.0: tmp_1 = c / (t_1 - b_2) else: tmp_1 = (b_2 + t_1) / -a return tmp_1
function code(a, b_2, c) t_0 = Float64(sqrt(abs(a)) * sqrt(abs(c))) tmp = 0.0 if (copysign(a, c) == a) tmp = Float64(sqrt(Float64(abs(b_2) - t_0)) * sqrt(Float64(abs(b_2) + t_0))); else tmp = hypot(b_2, t_0); end t_1 = tmp tmp_1 = 0.0 if (b_2 < 0.0) tmp_1 = Float64(c / Float64(t_1 - b_2)); else tmp_1 = Float64(Float64(b_2 + t_1) / Float64(-a)); end return tmp_1 end
function tmp_3 = code(a, b_2, c) t_0 = sqrt(abs(a)) * sqrt(abs(c)); tmp = 0.0; if ((sign(c) * abs(a)) == a) tmp = sqrt((abs(b_2) - t_0)) * sqrt((abs(b_2) + t_0)); else tmp = hypot(b_2, t_0); end t_1 = tmp; tmp_2 = 0.0; if (b_2 < 0.0) tmp_2 = c / (t_1 - b_2); else tmp_2 = (b_2 + t_1) / -a; end tmp_3 = tmp_2; end
code[a_, b$95$2_, c_] := Block[{t$95$0 = N[(N[Sqrt[N[Abs[a], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Abs[c], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = If[Equal[N[With[{TMP1 = Abs[a], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision], a], N[(N[Sqrt[N[(N[Abs[b$95$2], $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(N[Abs[b$95$2], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[b$95$2 ^ 2 + t$95$0 ^ 2], $MachinePrecision]]}, If[Less[b$95$2, 0.0], N[(c / N[(t$95$1 - b$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(b$95$2 + t$95$1), $MachinePrecision] / (-a)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\left|a\right|} \cdot \sqrt{\left|c\right|}\\
t_1 := \begin{array}{l}
\mathbf{if}\;\mathsf{copysign}\left(a, c\right) = a:\\
\;\;\;\;\sqrt{\left|b\_2\right| - t\_0} \cdot \sqrt{\left|b\_2\right| + t\_0}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{hypot}\left(b\_2, t\_0\right)\\
\end{array}\\
\mathbf{if}\;b\_2 < 0:\\
\;\;\;\;\frac{c}{t\_1 - b\_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{b\_2 + t\_1}{-a}\\
\end{array}
\end{array}
herbie shell --seed 2024110
(FPCore (a b_2 c)
:name "quad2m (problem 3.2.1, negative)"
:precision binary64
:herbie-expected 10
:alt
(if (< b_2 0.0) (/ c (- (if (== (copysign a c) a) (* (sqrt (- (fabs b_2) (* (sqrt (fabs a)) (sqrt (fabs c))))) (sqrt (+ (fabs b_2) (* (sqrt (fabs a)) (sqrt (fabs c)))))) (hypot b_2 (* (sqrt (fabs a)) (sqrt (fabs c))))) b_2)) (/ (+ b_2 (if (== (copysign a c) a) (* (sqrt (- (fabs b_2) (* (sqrt (fabs a)) (sqrt (fabs c))))) (sqrt (+ (fabs b_2) (* (sqrt (fabs a)) (sqrt (fabs c)))))) (hypot b_2 (* (sqrt (fabs a)) (sqrt (fabs c)))))) (- a)))
(/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))