
(FPCore (a b c) :precision binary64 (let* ((t_0 (sqrt (- (* b b) (* (* 4.0 a) c))))) (if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_0)) (/ (+ (- b) t_0) (* 2.0 a)))))
double code(double a, double b, double c) {
double t_0 = sqrt(((b * b) - ((4.0 * a) * c)));
double tmp;
if (b >= 0.0) {
tmp = (2.0 * c) / (-b - t_0);
} else {
tmp = (-b + t_0) / (2.0 * a);
}
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 = sqrt(((b * b) - ((4.0d0 * a) * c)))
if (b >= 0.0d0) then
tmp = (2.0d0 * c) / (-b - t_0)
else
tmp = (-b + t_0) / (2.0d0 * a)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double t_0 = Math.sqrt(((b * b) - ((4.0 * a) * c)));
double tmp;
if (b >= 0.0) {
tmp = (2.0 * c) / (-b - t_0);
} else {
tmp = (-b + t_0) / (2.0 * a);
}
return tmp;
}
def code(a, b, c): t_0 = math.sqrt(((b * b) - ((4.0 * a) * c))) tmp = 0 if b >= 0.0: tmp = (2.0 * c) / (-b - t_0) else: tmp = (-b + t_0) / (2.0 * a) return tmp
function code(a, b, c) t_0 = sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) tmp = 0.0 if (b >= 0.0) tmp = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_0)); else tmp = Float64(Float64(Float64(-b) + t_0) / Float64(2.0 * a)); end return tmp end
function tmp_2 = code(a, b, c) t_0 = sqrt(((b * b) - ((4.0 * a) * c))); tmp = 0.0; if (b >= 0.0) tmp = (2.0 * c) / (-b - t_0); else tmp = (-b + t_0) / (2.0 * a); end tmp_2 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[((-b) + t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + t\_0}{2 \cdot a}\\
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b c) :precision binary64 (let* ((t_0 (sqrt (- (* b b) (* (* 4.0 a) c))))) (if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_0)) (/ (+ (- b) t_0) (* 2.0 a)))))
double code(double a, double b, double c) {
double t_0 = sqrt(((b * b) - ((4.0 * a) * c)));
double tmp;
if (b >= 0.0) {
tmp = (2.0 * c) / (-b - t_0);
} else {
tmp = (-b + t_0) / (2.0 * a);
}
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 = sqrt(((b * b) - ((4.0d0 * a) * c)))
if (b >= 0.0d0) then
tmp = (2.0d0 * c) / (-b - t_0)
else
tmp = (-b + t_0) / (2.0d0 * a)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double t_0 = Math.sqrt(((b * b) - ((4.0 * a) * c)));
double tmp;
if (b >= 0.0) {
tmp = (2.0 * c) / (-b - t_0);
} else {
tmp = (-b + t_0) / (2.0 * a);
}
return tmp;
}
def code(a, b, c): t_0 = math.sqrt(((b * b) - ((4.0 * a) * c))) tmp = 0 if b >= 0.0: tmp = (2.0 * c) / (-b - t_0) else: tmp = (-b + t_0) / (2.0 * a) return tmp
function code(a, b, c) t_0 = sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) tmp = 0.0 if (b >= 0.0) tmp = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_0)); else tmp = Float64(Float64(Float64(-b) + t_0) / Float64(2.0 * a)); end return tmp end
function tmp_2 = code(a, b, c) t_0 = sqrt(((b * b) - ((4.0 * a) * c))); tmp = 0.0; if (b >= 0.0) tmp = (2.0 * c) / (-b - t_0); else tmp = (-b + t_0) / (2.0 * a); end tmp_2 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[((-b) + t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + t\_0}{2 \cdot a}\\
\end{array}
\end{array}
(FPCore (a b c)
:precision binary64
(let* ((t_0 (sqrt (- (* b b) (* c (* 4.0 a)))))
(t_1 (/ (* 2.0 c) (- (- b) t_0)))
(t_2 (/ (- t_0 b) (* 2.0 a))))
(if (<= b -1e+128)
(if (>= b 0.0) t_1 (/ (- (- b) b) (* 2.0 a)))
(if (<= b 1.15e+64)
(if (>= b 0.0) t_1 t_2)
(if (>= b 0.0) (/ (* 2.0 c) (* b -2.0)) t_2)))))
double code(double a, double b, double c) {
double t_0 = sqrt(((b * b) - (c * (4.0 * a))));
double t_1 = (2.0 * c) / (-b - t_0);
double t_2 = (t_0 - b) / (2.0 * a);
double tmp_1;
if (b <= -1e+128) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = t_1;
} else {
tmp_2 = (-b - b) / (2.0 * a);
}
tmp_1 = tmp_2;
} else if (b <= 1.15e+64) {
double tmp_3;
if (b >= 0.0) {
tmp_3 = t_1;
} else {
tmp_3 = t_2;
}
tmp_1 = tmp_3;
} else if (b >= 0.0) {
tmp_1 = (2.0 * c) / (b * -2.0);
} else {
tmp_1 = t_2;
}
return tmp_1;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
real(8) :: tmp_1
real(8) :: tmp_2
real(8) :: tmp_3
t_0 = sqrt(((b * b) - (c * (4.0d0 * a))))
t_1 = (2.0d0 * c) / (-b - t_0)
t_2 = (t_0 - b) / (2.0d0 * a)
if (b <= (-1d+128)) then
if (b >= 0.0d0) then
tmp_2 = t_1
else
tmp_2 = (-b - b) / (2.0d0 * a)
end if
tmp_1 = tmp_2
else if (b <= 1.15d+64) then
if (b >= 0.0d0) then
tmp_3 = t_1
else
tmp_3 = t_2
end if
tmp_1 = tmp_3
else if (b >= 0.0d0) then
tmp_1 = (2.0d0 * c) / (b * (-2.0d0))
else
tmp_1 = t_2
end if
code = tmp_1
end function
public static double code(double a, double b, double c) {
double t_0 = Math.sqrt(((b * b) - (c * (4.0 * a))));
double t_1 = (2.0 * c) / (-b - t_0);
double t_2 = (t_0 - b) / (2.0 * a);
double tmp_1;
if (b <= -1e+128) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = t_1;
} else {
tmp_2 = (-b - b) / (2.0 * a);
}
tmp_1 = tmp_2;
} else if (b <= 1.15e+64) {
double tmp_3;
if (b >= 0.0) {
tmp_3 = t_1;
} else {
tmp_3 = t_2;
}
tmp_1 = tmp_3;
} else if (b >= 0.0) {
tmp_1 = (2.0 * c) / (b * -2.0);
} else {
tmp_1 = t_2;
}
return tmp_1;
}
def code(a, b, c): t_0 = math.sqrt(((b * b) - (c * (4.0 * a)))) t_1 = (2.0 * c) / (-b - t_0) t_2 = (t_0 - b) / (2.0 * a) tmp_1 = 0 if b <= -1e+128: tmp_2 = 0 if b >= 0.0: tmp_2 = t_1 else: tmp_2 = (-b - b) / (2.0 * a) tmp_1 = tmp_2 elif b <= 1.15e+64: tmp_3 = 0 if b >= 0.0: tmp_3 = t_1 else: tmp_3 = t_2 tmp_1 = tmp_3 elif b >= 0.0: tmp_1 = (2.0 * c) / (b * -2.0) else: tmp_1 = t_2 return tmp_1
function code(a, b, c) t_0 = sqrt(Float64(Float64(b * b) - Float64(c * Float64(4.0 * a)))) t_1 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_0)) t_2 = Float64(Float64(t_0 - b) / Float64(2.0 * a)) tmp_1 = 0.0 if (b <= -1e+128) tmp_2 = 0.0 if (b >= 0.0) tmp_2 = t_1; else tmp_2 = Float64(Float64(Float64(-b) - b) / Float64(2.0 * a)); end tmp_1 = tmp_2; elseif (b <= 1.15e+64) tmp_3 = 0.0 if (b >= 0.0) tmp_3 = t_1; else tmp_3 = t_2; end tmp_1 = tmp_3; elseif (b >= 0.0) tmp_1 = Float64(Float64(2.0 * c) / Float64(b * -2.0)); else tmp_1 = t_2; end return tmp_1 end
function tmp_5 = code(a, b, c) t_0 = sqrt(((b * b) - (c * (4.0 * a)))); t_1 = (2.0 * c) / (-b - t_0); t_2 = (t_0 - b) / (2.0 * a); tmp_2 = 0.0; if (b <= -1e+128) tmp_3 = 0.0; if (b >= 0.0) tmp_3 = t_1; else tmp_3 = (-b - b) / (2.0 * a); end tmp_2 = tmp_3; elseif (b <= 1.15e+64) tmp_4 = 0.0; if (b >= 0.0) tmp_4 = t_1; else tmp_4 = t_2; end tmp_2 = tmp_4; elseif (b >= 0.0) tmp_2 = (2.0 * c) / (b * -2.0); else tmp_2 = t_2; end tmp_5 = tmp_2; end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$0 - b), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1e+128], If[GreaterEqual[b, 0.0], t$95$1, N[(N[((-b) - b), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]], If[LessEqual[b, 1.15e+64], If[GreaterEqual[b, 0.0], t$95$1, t$95$2], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[(b * -2.0), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}\\
t_1 := \frac{2 \cdot c}{\left(-b\right) - t\_0}\\
t_2 := \frac{t\_0 - b}{2 \cdot a}\\
\mathbf{if}\;b \leq -1 \cdot 10^{+128}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\
\end{array}\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{+64}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}\\
\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{b \cdot -2}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -1.0000000000000001e128Initial program 26.9%
add-cbrt-cube25.0%
pow325.0%
sqrt-pow225.0%
fma-neg25.3%
*-commutative25.3%
distribute-rgt-neg-in25.3%
distribute-lft-neg-in25.3%
metadata-eval25.3%
*-commutative25.3%
metadata-eval25.3%
Applied egg-rr25.3%
Taylor expanded in b around -inf 96.5%
if -1.0000000000000001e128 < b < 1.15e64Initial program 85.2%
if 1.15e64 < b Initial program 50.8%
Taylor expanded in b around inf 89.7%
*-commutative89.7%
Simplified89.7%
Final simplification88.6%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (sqrt (- (* b b) (* c (* 4.0 a))))) (t_1 (/ (- t_0 b) (* 2.0 a))))
(if (<= b -9e+127)
(if (>= b 0.0)
(* c (* (/ -4.0 a) (/ b (* c -4.0))))
(* 2.0 (* b (/ (cbrt -0.125) a))))
(if (<= b -2e-310)
(if (>= b 0.0) (/ b a) t_1)
(if (<= b 1.1e+64)
(if (>= b 0.0)
(/ (* 2.0 c) (- (- b) t_0))
(* 2.0 (/ (* b (cbrt -0.125)) a)))
(if (>= b 0.0) (/ (* 2.0 c) (* b -2.0)) t_1))))))
double code(double a, double b, double c) {
double t_0 = sqrt(((b * b) - (c * (4.0 * a))));
double t_1 = (t_0 - b) / (2.0 * a);
double tmp_1;
if (b <= -9e+127) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = c * ((-4.0 / a) * (b / (c * -4.0)));
} else {
tmp_2 = 2.0 * (b * (cbrt(-0.125) / a));
}
tmp_1 = tmp_2;
} else if (b <= -2e-310) {
double tmp_3;
if (b >= 0.0) {
tmp_3 = b / a;
} else {
tmp_3 = t_1;
}
tmp_1 = tmp_3;
} else if (b <= 1.1e+64) {
double tmp_4;
if (b >= 0.0) {
tmp_4 = (2.0 * c) / (-b - t_0);
} else {
tmp_4 = 2.0 * ((b * cbrt(-0.125)) / a);
}
tmp_1 = tmp_4;
} else if (b >= 0.0) {
tmp_1 = (2.0 * c) / (b * -2.0);
} else {
tmp_1 = t_1;
}
return tmp_1;
}
public static double code(double a, double b, double c) {
double t_0 = Math.sqrt(((b * b) - (c * (4.0 * a))));
double t_1 = (t_0 - b) / (2.0 * a);
double tmp_1;
if (b <= -9e+127) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = c * ((-4.0 / a) * (b / (c * -4.0)));
} else {
tmp_2 = 2.0 * (b * (Math.cbrt(-0.125) / a));
}
tmp_1 = tmp_2;
} else if (b <= -2e-310) {
double tmp_3;
if (b >= 0.0) {
tmp_3 = b / a;
} else {
tmp_3 = t_1;
}
tmp_1 = tmp_3;
} else if (b <= 1.1e+64) {
double tmp_4;
if (b >= 0.0) {
tmp_4 = (2.0 * c) / (-b - t_0);
} else {
tmp_4 = 2.0 * ((b * Math.cbrt(-0.125)) / a);
}
tmp_1 = tmp_4;
} else if (b >= 0.0) {
tmp_1 = (2.0 * c) / (b * -2.0);
} else {
tmp_1 = t_1;
}
return tmp_1;
}
function code(a, b, c) t_0 = sqrt(Float64(Float64(b * b) - Float64(c * Float64(4.0 * a)))) t_1 = Float64(Float64(t_0 - b) / Float64(2.0 * a)) tmp_1 = 0.0 if (b <= -9e+127) tmp_2 = 0.0 if (b >= 0.0) tmp_2 = Float64(c * Float64(Float64(-4.0 / a) * Float64(b / Float64(c * -4.0)))); else tmp_2 = Float64(2.0 * Float64(b * Float64(cbrt(-0.125) / a))); end tmp_1 = tmp_2; elseif (b <= -2e-310) tmp_3 = 0.0 if (b >= 0.0) tmp_3 = Float64(b / a); else tmp_3 = t_1; end tmp_1 = tmp_3; elseif (b <= 1.1e+64) tmp_4 = 0.0 if (b >= 0.0) tmp_4 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_0)); else tmp_4 = Float64(2.0 * Float64(Float64(b * cbrt(-0.125)) / a)); end tmp_1 = tmp_4; elseif (b >= 0.0) tmp_1 = Float64(Float64(2.0 * c) / Float64(b * -2.0)); else tmp_1 = t_1; end return tmp_1 end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 - b), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -9e+127], If[GreaterEqual[b, 0.0], N[(c * N[(N[(-4.0 / a), $MachinePrecision] * N[(b / N[(c * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(b * N[(N[Power[-0.125, 1/3], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], If[LessEqual[b, -2e-310], If[GreaterEqual[b, 0.0], N[(b / a), $MachinePrecision], t$95$1], If[LessEqual[b, 1.1e+64], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$0), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b * N[Power[-0.125, 1/3], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[(b * -2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}\\
t_1 := \frac{t\_0 - b}{2 \cdot a}\\
\mathbf{if}\;b \leq -9 \cdot 10^{+127}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;c \cdot \left(\frac{-4}{a} \cdot \frac{b}{c \cdot -4}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(b \cdot \frac{\sqrt[3]{-0.125}}{a}\right)\\
\end{array}\\
\mathbf{elif}\;b \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}\\
\mathbf{elif}\;b \leq 1.1 \cdot 10^{+64}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{b \cdot \sqrt[3]{-0.125}}{a}\\
\end{array}\\
\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{b \cdot -2}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -9.00000000000000068e127Initial program 26.9%
add-cbrt-cube26.9%
pow1/37.9%
Applied egg-rr8.0%
Taylor expanded in b around inf 95.2%
associate-/l*95.5%
Simplified95.5%
associate-/l*95.5%
add-sqr-sqrt95.5%
sqrt-unprod95.5%
sqr-neg95.5%
sqrt-prod95.5%
add-sqr-sqrt95.5%
pow295.5%
*-commutative95.5%
*-commutative95.5%
Applied egg-rr95.5%
associate-*r/95.5%
*-commutative95.5%
associate-*r/95.5%
associate-*r*95.5%
*-commutative95.5%
*-commutative95.5%
*-commutative95.5%
*-commutative95.5%
associate-*r*95.5%
sub-neg95.5%
unpow295.5%
rem-square-sqrt95.5%
distribute-rgt-neg-in95.5%
distribute-rgt-neg-in95.5%
metadata-eval95.5%
distribute-rgt-neg-in95.5%
Simplified95.5%
Taylor expanded in b around inf 95.5%
associate-*r/95.5%
rem-square-sqrt95.5%
unpow295.5%
times-frac95.5%
unpow295.5%
rem-square-sqrt95.5%
unpow295.5%
rem-square-sqrt95.5%
Simplified95.5%
if -9.00000000000000068e127 < b < -1.999999999999994e-310Initial program 84.0%
Taylor expanded in a around 0 84.0%
distribute-lft-out--84.0%
associate-/l*84.0%
fma-neg84.0%
Simplified84.0%
Taylor expanded in c around inf 84.0%
if -1.999999999999994e-310 < b < 1.10000000000000001e64Initial program 87.3%
add-cbrt-cube87.3%
pow1/387.3%
Applied egg-rr87.3%
Taylor expanded in b around inf 87.3%
if 1.10000000000000001e64 < b Initial program 50.8%
Taylor expanded in b around inf 89.7%
*-commutative89.7%
Simplified89.7%
Final simplification88.4%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (* 2.0 (* b (/ (cbrt -0.125) a))))
(t_1 (sqrt (- (* b b) (* c (* 4.0 a)))))
(t_2 (/ (- t_1 b) (* 2.0 a))))
(if (<= b -1.1e+126)
(if (>= b 0.0) (* c (* (/ -4.0 a) (/ b (* c -4.0)))) t_0)
(if (<= b -2e-310)
(if (>= b 0.0) (/ b a) t_2)
(if (<= b 1.15e+64)
(if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_1)) t_0)
(if (>= b 0.0) (/ (* 2.0 c) (* b -2.0)) t_2))))))
double code(double a, double b, double c) {
double t_0 = 2.0 * (b * (cbrt(-0.125) / a));
double t_1 = sqrt(((b * b) - (c * (4.0 * a))));
double t_2 = (t_1 - b) / (2.0 * a);
double tmp_1;
if (b <= -1.1e+126) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = c * ((-4.0 / a) * (b / (c * -4.0)));
} else {
tmp_2 = t_0;
}
tmp_1 = tmp_2;
} else if (b <= -2e-310) {
double tmp_3;
if (b >= 0.0) {
tmp_3 = b / a;
} else {
tmp_3 = t_2;
}
tmp_1 = tmp_3;
} else if (b <= 1.15e+64) {
double tmp_4;
if (b >= 0.0) {
tmp_4 = (2.0 * c) / (-b - t_1);
} else {
tmp_4 = t_0;
}
tmp_1 = tmp_4;
} else if (b >= 0.0) {
tmp_1 = (2.0 * c) / (b * -2.0);
} else {
tmp_1 = t_2;
}
return tmp_1;
}
public static double code(double a, double b, double c) {
double t_0 = 2.0 * (b * (Math.cbrt(-0.125) / a));
double t_1 = Math.sqrt(((b * b) - (c * (4.0 * a))));
double t_2 = (t_1 - b) / (2.0 * a);
double tmp_1;
if (b <= -1.1e+126) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = c * ((-4.0 / a) * (b / (c * -4.0)));
} else {
tmp_2 = t_0;
}
tmp_1 = tmp_2;
} else if (b <= -2e-310) {
double tmp_3;
if (b >= 0.0) {
tmp_3 = b / a;
} else {
tmp_3 = t_2;
}
tmp_1 = tmp_3;
} else if (b <= 1.15e+64) {
double tmp_4;
if (b >= 0.0) {
tmp_4 = (2.0 * c) / (-b - t_1);
} else {
tmp_4 = t_0;
}
tmp_1 = tmp_4;
} else if (b >= 0.0) {
tmp_1 = (2.0 * c) / (b * -2.0);
} else {
tmp_1 = t_2;
}
return tmp_1;
}
function code(a, b, c) t_0 = Float64(2.0 * Float64(b * Float64(cbrt(-0.125) / a))) t_1 = sqrt(Float64(Float64(b * b) - Float64(c * Float64(4.0 * a)))) t_2 = Float64(Float64(t_1 - b) / Float64(2.0 * a)) tmp_1 = 0.0 if (b <= -1.1e+126) tmp_2 = 0.0 if (b >= 0.0) tmp_2 = Float64(c * Float64(Float64(-4.0 / a) * Float64(b / Float64(c * -4.0)))); else tmp_2 = t_0; end tmp_1 = tmp_2; elseif (b <= -2e-310) tmp_3 = 0.0 if (b >= 0.0) tmp_3 = Float64(b / a); else tmp_3 = t_2; end tmp_1 = tmp_3; elseif (b <= 1.15e+64) tmp_4 = 0.0 if (b >= 0.0) tmp_4 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_1)); else tmp_4 = t_0; end tmp_1 = tmp_4; elseif (b >= 0.0) tmp_1 = Float64(Float64(2.0 * c) / Float64(b * -2.0)); else tmp_1 = t_2; end return tmp_1 end
code[a_, b_, c_] := Block[{t$95$0 = N[(2.0 * N[(b * N[(N[Power[-0.125, 1/3], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 - b), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.1e+126], If[GreaterEqual[b, 0.0], N[(c * N[(N[(-4.0 / a), $MachinePrecision] * N[(b / N[(c * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0], If[LessEqual[b, -2e-310], If[GreaterEqual[b, 0.0], N[(b / a), $MachinePrecision], t$95$2], If[LessEqual[b, 1.15e+64], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$1), $MachinePrecision]), $MachinePrecision], t$95$0], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[(b * -2.0), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \left(b \cdot \frac{\sqrt[3]{-0.125}}{a}\right)\\
t_1 := \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}\\
t_2 := \frac{t\_1 - b}{2 \cdot a}\\
\mathbf{if}\;b \leq -1.1 \cdot 10^{+126}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;c \cdot \left(\frac{-4}{a} \cdot \frac{b}{c \cdot -4}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}\\
\mathbf{elif}\;b \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{+64}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}\\
\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{b \cdot -2}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -1.09999999999999999e126Initial program 26.9%
add-cbrt-cube26.9%
pow1/37.9%
Applied egg-rr8.0%
Taylor expanded in b around inf 95.2%
associate-/l*95.5%
Simplified95.5%
associate-/l*95.5%
add-sqr-sqrt95.5%
sqrt-unprod95.5%
sqr-neg95.5%
sqrt-prod95.5%
add-sqr-sqrt95.5%
pow295.5%
*-commutative95.5%
*-commutative95.5%
Applied egg-rr95.5%
associate-*r/95.5%
*-commutative95.5%
associate-*r/95.5%
associate-*r*95.5%
*-commutative95.5%
*-commutative95.5%
*-commutative95.5%
*-commutative95.5%
associate-*r*95.5%
sub-neg95.5%
unpow295.5%
rem-square-sqrt95.5%
distribute-rgt-neg-in95.5%
distribute-rgt-neg-in95.5%
metadata-eval95.5%
distribute-rgt-neg-in95.5%
Simplified95.5%
Taylor expanded in b around inf 95.5%
associate-*r/95.5%
rem-square-sqrt95.5%
unpow295.5%
times-frac95.5%
unpow295.5%
rem-square-sqrt95.5%
unpow295.5%
rem-square-sqrt95.5%
Simplified95.5%
if -1.09999999999999999e126 < b < -1.999999999999994e-310Initial program 84.0%
Taylor expanded in a around 0 84.0%
distribute-lft-out--84.0%
associate-/l*84.0%
fma-neg84.0%
Simplified84.0%
Taylor expanded in c around inf 84.0%
if -1.999999999999994e-310 < b < 1.15e64Initial program 87.3%
add-cbrt-cube87.3%
pow1/387.3%
Applied egg-rr87.3%
Taylor expanded in b around inf 87.3%
associate-/l*87.3%
Simplified87.3%
if 1.15e64 < b Initial program 50.8%
Taylor expanded in b around inf 89.7%
*-commutative89.7%
Simplified89.7%
Final simplification88.4%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (* 2.0 (* b (/ (cbrt -0.125) a)))))
(if (<= b -8.6e+127)
(if (>= b 0.0) (* c (* (/ -4.0 a) (/ b (* c -4.0)))) t_0)
(if (<= b -2e-310)
(if (>= b 0.0)
(/ b a)
(/ (- (sqrt (- (* b b) (* c (* 4.0 a)))) b) (* 2.0 a)))
(if (<= b 4.6e-110)
(if (>= b 0.0) (/ (* 2.0 c) (- (- b) (sqrt (* c (* a -4.0))))) t_0)
(if (>= b 0.0) (/ (* 2.0 c) (* 2.0 (- (* a (/ c b)) b))) t_0))))))
double code(double a, double b, double c) {
double t_0 = 2.0 * (b * (cbrt(-0.125) / a));
double tmp_1;
if (b <= -8.6e+127) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = c * ((-4.0 / a) * (b / (c * -4.0)));
} else {
tmp_2 = t_0;
}
tmp_1 = tmp_2;
} else if (b <= -2e-310) {
double tmp_3;
if (b >= 0.0) {
tmp_3 = b / a;
} else {
tmp_3 = (sqrt(((b * b) - (c * (4.0 * a)))) - b) / (2.0 * a);
}
tmp_1 = tmp_3;
} else if (b <= 4.6e-110) {
double tmp_4;
if (b >= 0.0) {
tmp_4 = (2.0 * c) / (-b - sqrt((c * (a * -4.0))));
} else {
tmp_4 = t_0;
}
tmp_1 = tmp_4;
} else if (b >= 0.0) {
tmp_1 = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
} else {
tmp_1 = t_0;
}
return tmp_1;
}
public static double code(double a, double b, double c) {
double t_0 = 2.0 * (b * (Math.cbrt(-0.125) / a));
double tmp_1;
if (b <= -8.6e+127) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = c * ((-4.0 / a) * (b / (c * -4.0)));
} else {
tmp_2 = t_0;
}
tmp_1 = tmp_2;
} else if (b <= -2e-310) {
double tmp_3;
if (b >= 0.0) {
tmp_3 = b / a;
} else {
tmp_3 = (Math.sqrt(((b * b) - (c * (4.0 * a)))) - b) / (2.0 * a);
}
tmp_1 = tmp_3;
} else if (b <= 4.6e-110) {
double tmp_4;
if (b >= 0.0) {
tmp_4 = (2.0 * c) / (-b - Math.sqrt((c * (a * -4.0))));
} else {
tmp_4 = t_0;
}
tmp_1 = tmp_4;
} else if (b >= 0.0) {
tmp_1 = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
} else {
tmp_1 = t_0;
}
return tmp_1;
}
function code(a, b, c) t_0 = Float64(2.0 * Float64(b * Float64(cbrt(-0.125) / a))) tmp_1 = 0.0 if (b <= -8.6e+127) tmp_2 = 0.0 if (b >= 0.0) tmp_2 = Float64(c * Float64(Float64(-4.0 / a) * Float64(b / Float64(c * -4.0)))); else tmp_2 = t_0; end tmp_1 = tmp_2; elseif (b <= -2e-310) tmp_3 = 0.0 if (b >= 0.0) tmp_3 = Float64(b / a); else tmp_3 = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(4.0 * a)))) - b) / Float64(2.0 * a)); end tmp_1 = tmp_3; elseif (b <= 4.6e-110) tmp_4 = 0.0 if (b >= 0.0) tmp_4 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - sqrt(Float64(c * Float64(a * -4.0))))); else tmp_4 = t_0; end tmp_1 = tmp_4; elseif (b >= 0.0) tmp_1 = Float64(Float64(2.0 * c) / Float64(2.0 * Float64(Float64(a * Float64(c / b)) - b))); else tmp_1 = t_0; end return tmp_1 end
code[a_, b_, c_] := Block[{t$95$0 = N[(2.0 * N[(b * N[(N[Power[-0.125, 1/3], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -8.6e+127], If[GreaterEqual[b, 0.0], N[(c * N[(N[(-4.0 / a), $MachinePrecision] * N[(b / N[(c * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0], If[LessEqual[b, -2e-310], If[GreaterEqual[b, 0.0], N[(b / a), $MachinePrecision], 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]], If[LessEqual[b, 4.6e-110], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[(2.0 * N[(N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \left(b \cdot \frac{\sqrt[3]{-0.125}}{a}\right)\\
\mathbf{if}\;b \leq -8.6 \cdot 10^{+127}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;c \cdot \left(\frac{-4}{a} \cdot \frac{b}{c \cdot -4}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}\\
\mathbf{elif}\;b \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)} - b}{2 \cdot a}\\
\end{array}\\
\mathbf{elif}\;b \leq 4.6 \cdot 10^{-110}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{c \cdot \left(a \cdot -4\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}\\
\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -8.59999999999999968e127Initial program 26.9%
add-cbrt-cube26.9%
pow1/37.9%
Applied egg-rr8.0%
Taylor expanded in b around inf 95.2%
associate-/l*95.5%
Simplified95.5%
associate-/l*95.5%
add-sqr-sqrt95.5%
sqrt-unprod95.5%
sqr-neg95.5%
sqrt-prod95.5%
add-sqr-sqrt95.5%
pow295.5%
*-commutative95.5%
*-commutative95.5%
Applied egg-rr95.5%
associate-*r/95.5%
*-commutative95.5%
associate-*r/95.5%
associate-*r*95.5%
*-commutative95.5%
*-commutative95.5%
*-commutative95.5%
*-commutative95.5%
associate-*r*95.5%
sub-neg95.5%
unpow295.5%
rem-square-sqrt95.5%
distribute-rgt-neg-in95.5%
distribute-rgt-neg-in95.5%
metadata-eval95.5%
distribute-rgt-neg-in95.5%
Simplified95.5%
Taylor expanded in b around inf 95.5%
associate-*r/95.5%
rem-square-sqrt95.5%
unpow295.5%
times-frac95.5%
unpow295.5%
rem-square-sqrt95.5%
unpow295.5%
rem-square-sqrt95.5%
Simplified95.5%
if -8.59999999999999968e127 < b < -1.999999999999994e-310Initial program 84.0%
Taylor expanded in a around 0 84.0%
distribute-lft-out--84.0%
associate-/l*84.0%
fma-neg84.0%
Simplified84.0%
Taylor expanded in c around inf 84.0%
if -1.999999999999994e-310 < b < 4.6000000000000003e-110Initial program 79.4%
add-cbrt-cube79.4%
pow1/379.4%
Applied egg-rr79.4%
Taylor expanded in b around inf 79.4%
associate-/l*79.4%
Simplified79.4%
Taylor expanded in b around 0 75.8%
*-commutative75.8%
*-commutative75.8%
associate-*r*75.8%
Simplified75.8%
if 4.6000000000000003e-110 < b Initial program 64.0%
add-cbrt-cube64.0%
pow1/364.0%
Applied egg-rr64.0%
Taylor expanded in b around inf 64.0%
associate-/l*64.0%
Simplified64.0%
Taylor expanded in a around 0 73.4%
distribute-lft-out--73.4%
associate-/l*80.7%
Simplified80.7%
Final simplification84.4%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (* 2.0 (* b (/ (cbrt -0.125) a)))) (t_1 (sqrt (* c (* a -4.0)))))
(if (<= b -3e-27)
(if (>= b 0.0) (* c (* (/ -4.0 a) (/ b (* c -4.0)))) t_0)
(if (<= b -2e-310)
(if (>= b 0.0) (/ b a) (/ (- t_1 b) (* 2.0 a)))
(if (<= b 4.5e-110)
(if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_1)) t_0)
(if (>= b 0.0) (/ (* 2.0 c) (* 2.0 (- (* a (/ c b)) b))) t_0))))))
double code(double a, double b, double c) {
double t_0 = 2.0 * (b * (cbrt(-0.125) / a));
double t_1 = sqrt((c * (a * -4.0)));
double tmp_1;
if (b <= -3e-27) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = c * ((-4.0 / a) * (b / (c * -4.0)));
} else {
tmp_2 = t_0;
}
tmp_1 = tmp_2;
} else if (b <= -2e-310) {
double tmp_3;
if (b >= 0.0) {
tmp_3 = b / a;
} else {
tmp_3 = (t_1 - b) / (2.0 * a);
}
tmp_1 = tmp_3;
} else if (b <= 4.5e-110) {
double tmp_4;
if (b >= 0.0) {
tmp_4 = (2.0 * c) / (-b - t_1);
} else {
tmp_4 = t_0;
}
tmp_1 = tmp_4;
} else if (b >= 0.0) {
tmp_1 = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
} else {
tmp_1 = t_0;
}
return tmp_1;
}
public static double code(double a, double b, double c) {
double t_0 = 2.0 * (b * (Math.cbrt(-0.125) / a));
double t_1 = Math.sqrt((c * (a * -4.0)));
double tmp_1;
if (b <= -3e-27) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = c * ((-4.0 / a) * (b / (c * -4.0)));
} else {
tmp_2 = t_0;
}
tmp_1 = tmp_2;
} else if (b <= -2e-310) {
double tmp_3;
if (b >= 0.0) {
tmp_3 = b / a;
} else {
tmp_3 = (t_1 - b) / (2.0 * a);
}
tmp_1 = tmp_3;
} else if (b <= 4.5e-110) {
double tmp_4;
if (b >= 0.0) {
tmp_4 = (2.0 * c) / (-b - t_1);
} else {
tmp_4 = t_0;
}
tmp_1 = tmp_4;
} else if (b >= 0.0) {
tmp_1 = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
} else {
tmp_1 = t_0;
}
return tmp_1;
}
function code(a, b, c) t_0 = Float64(2.0 * Float64(b * Float64(cbrt(-0.125) / a))) t_1 = sqrt(Float64(c * Float64(a * -4.0))) tmp_1 = 0.0 if (b <= -3e-27) tmp_2 = 0.0 if (b >= 0.0) tmp_2 = Float64(c * Float64(Float64(-4.0 / a) * Float64(b / Float64(c * -4.0)))); else tmp_2 = t_0; end tmp_1 = tmp_2; elseif (b <= -2e-310) tmp_3 = 0.0 if (b >= 0.0) tmp_3 = Float64(b / a); else tmp_3 = Float64(Float64(t_1 - b) / Float64(2.0 * a)); end tmp_1 = tmp_3; elseif (b <= 4.5e-110) tmp_4 = 0.0 if (b >= 0.0) tmp_4 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_1)); else tmp_4 = t_0; end tmp_1 = tmp_4; elseif (b >= 0.0) tmp_1 = Float64(Float64(2.0 * c) / Float64(2.0 * Float64(Float64(a * Float64(c / b)) - b))); else tmp_1 = t_0; end return tmp_1 end
code[a_, b_, c_] := Block[{t$95$0 = N[(2.0 * N[(b * N[(N[Power[-0.125, 1/3], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, -3e-27], If[GreaterEqual[b, 0.0], N[(c * N[(N[(-4.0 / a), $MachinePrecision] * N[(b / N[(c * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0], If[LessEqual[b, -2e-310], If[GreaterEqual[b, 0.0], N[(b / a), $MachinePrecision], N[(N[(t$95$1 - b), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]], If[LessEqual[b, 4.5e-110], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$1), $MachinePrecision]), $MachinePrecision], t$95$0], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[(2.0 * N[(N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \left(b \cdot \frac{\sqrt[3]{-0.125}}{a}\right)\\
t_1 := \sqrt{c \cdot \left(a \cdot -4\right)}\\
\mathbf{if}\;b \leq -3 \cdot 10^{-27}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;c \cdot \left(\frac{-4}{a} \cdot \frac{b}{c \cdot -4}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}\\
\mathbf{elif}\;b \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1 - b}{2 \cdot a}\\
\end{array}\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{-110}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}\\
\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -3.0000000000000001e-27Initial program 55.9%
add-cbrt-cube33.1%
pow1/314.4%
Applied egg-rr5.4%
Taylor expanded in b around inf 87.1%
associate-/l*87.4%
Simplified87.4%
associate-/l*87.4%
add-sqr-sqrt87.4%
sqrt-unprod87.4%
sqr-neg87.4%
sqrt-prod87.4%
add-sqr-sqrt87.4%
pow287.4%
*-commutative87.4%
*-commutative87.4%
Applied egg-rr87.4%
associate-*r/87.4%
*-commutative87.4%
associate-*r/87.4%
associate-*r*87.4%
*-commutative87.4%
*-commutative87.4%
*-commutative87.4%
*-commutative87.4%
associate-*r*87.4%
sub-neg87.4%
unpow287.4%
rem-square-sqrt87.4%
distribute-rgt-neg-in87.4%
distribute-rgt-neg-in87.4%
metadata-eval87.4%
distribute-rgt-neg-in87.4%
Simplified87.4%
Taylor expanded in b around inf 87.4%
associate-*r/87.4%
rem-square-sqrt87.4%
unpow287.4%
times-frac87.4%
unpow287.4%
rem-square-sqrt87.4%
unpow287.4%
rem-square-sqrt87.4%
Simplified87.4%
if -3.0000000000000001e-27 < b < -1.999999999999994e-310Initial program 77.4%
Taylor expanded in a around 0 77.4%
distribute-lft-out--77.4%
associate-/l*77.4%
fma-neg77.4%
Simplified77.4%
Taylor expanded in c around inf 77.4%
Taylor expanded in b around 0 67.8%
*-commutative17.2%
*-commutative17.2%
associate-*r*17.2%
Simplified68.2%
if -1.999999999999994e-310 < b < 4.5000000000000001e-110Initial program 79.4%
add-cbrt-cube79.4%
pow1/379.4%
Applied egg-rr79.4%
Taylor expanded in b around inf 79.4%
associate-/l*79.4%
Simplified79.4%
Taylor expanded in b around 0 75.8%
*-commutative75.8%
*-commutative75.8%
associate-*r*75.8%
Simplified75.8%
if 4.5000000000000001e-110 < b Initial program 64.0%
add-cbrt-cube64.0%
pow1/364.0%
Applied egg-rr64.0%
Taylor expanded in b around inf 64.0%
associate-/l*64.0%
Simplified64.0%
Taylor expanded in a around 0 73.4%
distribute-lft-out--73.4%
associate-/l*80.7%
Simplified80.7%
Final simplification80.5%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (sqrt (- (* b b) (* c (* 4.0 a))))) (t_1 (/ (- t_0 b) (* 2.0 a))))
(if (<= b -1.05e+128)
(if (>= b 0.0)
(* c (* (/ -4.0 a) (/ b (* c -4.0))))
(* 2.0 (* b (/ (cbrt -0.125) a))))
(if (<= b 1.15e+64)
(if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_0)) t_1)
(if (>= b 0.0) (/ (* 2.0 c) (* b -2.0)) t_1)))))
double code(double a, double b, double c) {
double t_0 = sqrt(((b * b) - (c * (4.0 * a))));
double t_1 = (t_0 - b) / (2.0 * a);
double tmp_1;
if (b <= -1.05e+128) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = c * ((-4.0 / a) * (b / (c * -4.0)));
} else {
tmp_2 = 2.0 * (b * (cbrt(-0.125) / a));
}
tmp_1 = tmp_2;
} else if (b <= 1.15e+64) {
double tmp_3;
if (b >= 0.0) {
tmp_3 = (2.0 * c) / (-b - t_0);
} else {
tmp_3 = t_1;
}
tmp_1 = tmp_3;
} else if (b >= 0.0) {
tmp_1 = (2.0 * c) / (b * -2.0);
} else {
tmp_1 = t_1;
}
return tmp_1;
}
public static double code(double a, double b, double c) {
double t_0 = Math.sqrt(((b * b) - (c * (4.0 * a))));
double t_1 = (t_0 - b) / (2.0 * a);
double tmp_1;
if (b <= -1.05e+128) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = c * ((-4.0 / a) * (b / (c * -4.0)));
} else {
tmp_2 = 2.0 * (b * (Math.cbrt(-0.125) / a));
}
tmp_1 = tmp_2;
} else if (b <= 1.15e+64) {
double tmp_3;
if (b >= 0.0) {
tmp_3 = (2.0 * c) / (-b - t_0);
} else {
tmp_3 = t_1;
}
tmp_1 = tmp_3;
} else if (b >= 0.0) {
tmp_1 = (2.0 * c) / (b * -2.0);
} else {
tmp_1 = t_1;
}
return tmp_1;
}
function code(a, b, c) t_0 = sqrt(Float64(Float64(b * b) - Float64(c * Float64(4.0 * a)))) t_1 = Float64(Float64(t_0 - b) / Float64(2.0 * a)) tmp_1 = 0.0 if (b <= -1.05e+128) tmp_2 = 0.0 if (b >= 0.0) tmp_2 = Float64(c * Float64(Float64(-4.0 / a) * Float64(b / Float64(c * -4.0)))); else tmp_2 = Float64(2.0 * Float64(b * Float64(cbrt(-0.125) / a))); end tmp_1 = tmp_2; elseif (b <= 1.15e+64) tmp_3 = 0.0 if (b >= 0.0) tmp_3 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_0)); else tmp_3 = t_1; end tmp_1 = tmp_3; elseif (b >= 0.0) tmp_1 = Float64(Float64(2.0 * c) / Float64(b * -2.0)); else tmp_1 = t_1; end return tmp_1 end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 - b), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.05e+128], If[GreaterEqual[b, 0.0], N[(c * N[(N[(-4.0 / a), $MachinePrecision] * N[(b / N[(c * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(b * N[(N[Power[-0.125, 1/3], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], If[LessEqual[b, 1.15e+64], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$0), $MachinePrecision]), $MachinePrecision], t$95$1], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[(b * -2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}\\
t_1 := \frac{t\_0 - b}{2 \cdot a}\\
\mathbf{if}\;b \leq -1.05 \cdot 10^{+128}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;c \cdot \left(\frac{-4}{a} \cdot \frac{b}{c \cdot -4}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(b \cdot \frac{\sqrt[3]{-0.125}}{a}\right)\\
\end{array}\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{+64}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}\\
\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{b \cdot -2}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.05e128Initial program 26.9%
add-cbrt-cube26.9%
pow1/37.9%
Applied egg-rr8.0%
Taylor expanded in b around inf 95.2%
associate-/l*95.5%
Simplified95.5%
associate-/l*95.5%
add-sqr-sqrt95.5%
sqrt-unprod95.5%
sqr-neg95.5%
sqrt-prod95.5%
add-sqr-sqrt95.5%
pow295.5%
*-commutative95.5%
*-commutative95.5%
Applied egg-rr95.5%
associate-*r/95.5%
*-commutative95.5%
associate-*r/95.5%
associate-*r*95.5%
*-commutative95.5%
*-commutative95.5%
*-commutative95.5%
*-commutative95.5%
associate-*r*95.5%
sub-neg95.5%
unpow295.5%
rem-square-sqrt95.5%
distribute-rgt-neg-in95.5%
distribute-rgt-neg-in95.5%
metadata-eval95.5%
distribute-rgt-neg-in95.5%
Simplified95.5%
Taylor expanded in b around inf 95.5%
associate-*r/95.5%
rem-square-sqrt95.5%
unpow295.5%
times-frac95.5%
unpow295.5%
rem-square-sqrt95.5%
unpow295.5%
rem-square-sqrt95.5%
Simplified95.5%
if -1.05e128 < b < 1.15e64Initial program 85.2%
if 1.15e64 < b Initial program 50.8%
Taylor expanded in b around inf 89.7%
*-commutative89.7%
Simplified89.7%
Final simplification88.4%
(FPCore (a b c)
:precision binary64
(if (<= b -1.25e-26)
(if (>= b 0.0)
(* c (* (/ -4.0 a) (/ b (* c -4.0))))
(* 2.0 (* b (/ (cbrt -0.125) a))))
(if (<= b 5e-260)
(if (>= b 0.0) (/ b a) (/ (- (sqrt (* c (* a -4.0))) b) (* 2.0 a)))
(if (>= b 0.0)
(/ (* 2.0 c) (* 2.0 (- (* a (/ c b)) b)))
(* 2.0 (/ (* b (cbrt -0.125)) a))))))
double code(double a, double b, double c) {
double tmp_1;
if (b <= -1.25e-26) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = c * ((-4.0 / a) * (b / (c * -4.0)));
} else {
tmp_2 = 2.0 * (b * (cbrt(-0.125) / a));
}
tmp_1 = tmp_2;
} else if (b <= 5e-260) {
double tmp_3;
if (b >= 0.0) {
tmp_3 = b / a;
} else {
tmp_3 = (sqrt((c * (a * -4.0))) - b) / (2.0 * a);
}
tmp_1 = tmp_3;
} else if (b >= 0.0) {
tmp_1 = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
} else {
tmp_1 = 2.0 * ((b * cbrt(-0.125)) / a);
}
return tmp_1;
}
public static double code(double a, double b, double c) {
double tmp_1;
if (b <= -1.25e-26) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = c * ((-4.0 / a) * (b / (c * -4.0)));
} else {
tmp_2 = 2.0 * (b * (Math.cbrt(-0.125) / a));
}
tmp_1 = tmp_2;
} else if (b <= 5e-260) {
double tmp_3;
if (b >= 0.0) {
tmp_3 = b / a;
} else {
tmp_3 = (Math.sqrt((c * (a * -4.0))) - b) / (2.0 * a);
}
tmp_1 = tmp_3;
} else if (b >= 0.0) {
tmp_1 = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
} else {
tmp_1 = 2.0 * ((b * Math.cbrt(-0.125)) / a);
}
return tmp_1;
}
function code(a, b, c) tmp_1 = 0.0 if (b <= -1.25e-26) tmp_2 = 0.0 if (b >= 0.0) tmp_2 = Float64(c * Float64(Float64(-4.0 / a) * Float64(b / Float64(c * -4.0)))); else tmp_2 = Float64(2.0 * Float64(b * Float64(cbrt(-0.125) / a))); end tmp_1 = tmp_2; elseif (b <= 5e-260) tmp_3 = 0.0 if (b >= 0.0) tmp_3 = Float64(b / a); else tmp_3 = Float64(Float64(sqrt(Float64(c * Float64(a * -4.0))) - b) / Float64(2.0 * a)); end tmp_1 = tmp_3; elseif (b >= 0.0) tmp_1 = Float64(Float64(2.0 * c) / Float64(2.0 * Float64(Float64(a * Float64(c / b)) - b))); else tmp_1 = Float64(2.0 * Float64(Float64(b * cbrt(-0.125)) / a)); end return tmp_1 end
code[a_, b_, c_] := If[LessEqual[b, -1.25e-26], If[GreaterEqual[b, 0.0], N[(c * N[(N[(-4.0 / a), $MachinePrecision] * N[(b / N[(c * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(b * N[(N[Power[-0.125, 1/3], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], If[LessEqual[b, 5e-260], If[GreaterEqual[b, 0.0], N[(b / a), $MachinePrecision], N[(N[(N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[(2.0 * N[(N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b * N[Power[-0.125, 1/3], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.25 \cdot 10^{-26}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;c \cdot \left(\frac{-4}{a} \cdot \frac{b}{c \cdot -4}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(b \cdot \frac{\sqrt[3]{-0.125}}{a}\right)\\
\end{array}\\
\mathbf{elif}\;b \leq 5 \cdot 10^{-260}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} - b}{2 \cdot a}\\
\end{array}\\
\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{b \cdot \sqrt[3]{-0.125}}{a}\\
\end{array}
\end{array}
if b < -1.25000000000000005e-26Initial program 55.9%
add-cbrt-cube33.1%
pow1/314.4%
Applied egg-rr5.4%
Taylor expanded in b around inf 87.1%
associate-/l*87.4%
Simplified87.4%
associate-/l*87.4%
add-sqr-sqrt87.4%
sqrt-unprod87.4%
sqr-neg87.4%
sqrt-prod87.4%
add-sqr-sqrt87.4%
pow287.4%
*-commutative87.4%
*-commutative87.4%
Applied egg-rr87.4%
associate-*r/87.4%
*-commutative87.4%
associate-*r/87.4%
associate-*r*87.4%
*-commutative87.4%
*-commutative87.4%
*-commutative87.4%
*-commutative87.4%
associate-*r*87.4%
sub-neg87.4%
unpow287.4%
rem-square-sqrt87.4%
distribute-rgt-neg-in87.4%
distribute-rgt-neg-in87.4%
metadata-eval87.4%
distribute-rgt-neg-in87.4%
Simplified87.4%
Taylor expanded in b around inf 87.4%
associate-*r/87.4%
rem-square-sqrt87.4%
unpow287.4%
times-frac87.4%
unpow287.4%
rem-square-sqrt87.4%
unpow287.4%
rem-square-sqrt87.4%
Simplified87.4%
if -1.25000000000000005e-26 < b < 5.0000000000000003e-260Initial program 78.2%
Taylor expanded in a around 0 69.1%
distribute-lft-out--69.1%
associate-/l*69.0%
fma-neg69.0%
Simplified69.0%
Taylor expanded in c around inf 69.1%
Taylor expanded in b around 0 60.6%
*-commutative24.9%
*-commutative24.9%
associate-*r*24.9%
Simplified60.9%
if 5.0000000000000003e-260 < b Initial program 66.0%
add-cbrt-cube66.0%
pow1/366.0%
Applied egg-rr66.0%
Taylor expanded in b around inf 66.0%
associate-/l*66.0%
Simplified66.0%
Taylor expanded in a around 0 65.7%
distribute-lft-out--65.7%
associate-/l*72.3%
Simplified72.3%
Taylor expanded in b around 0 72.3%
Final simplification75.6%
(FPCore (a b c) :precision binary64 (if (>= b 0.0) (/ (* 2.0 c) (* 2.0 (- (* a (/ c b)) b))) (* 2.0 (* b (/ (cbrt -0.125) a)))))
double code(double a, double b, double c) {
double tmp;
if (b >= 0.0) {
tmp = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
} else {
tmp = 2.0 * (b * (cbrt(-0.125) / a));
}
return tmp;
}
public static double code(double a, double b, double c) {
double tmp;
if (b >= 0.0) {
tmp = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
} else {
tmp = 2.0 * (b * (Math.cbrt(-0.125) / a));
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b >= 0.0) tmp = Float64(Float64(2.0 * c) / Float64(2.0 * Float64(Float64(a * Float64(c / b)) - b))); else tmp = Float64(2.0 * Float64(b * Float64(cbrt(-0.125) / a))); end return tmp end
code[a_, b_, c_] := If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[(2.0 * N[(N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(b * N[(N[Power[-0.125, 1/3], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(b \cdot \frac{\sqrt[3]{-0.125}}{a}\right)\\
\end{array}
\end{array}
Initial program 64.7%
add-cbrt-cube48.7%
pow1/338.1%
Applied egg-rr32.6%
Taylor expanded in b around inf 65.5%
associate-/l*65.6%
Simplified65.6%
Taylor expanded in a around 0 63.6%
distribute-lft-out--63.6%
associate-/l*66.4%
Simplified66.4%
(FPCore (a b c) :precision binary64 (if (>= b 0.0) (* (/ 2.0 b) (/ c -2.0)) (* 2.0 (* b (/ (cbrt -0.125) a)))))
double code(double a, double b, double c) {
double tmp;
if (b >= 0.0) {
tmp = (2.0 / b) * (c / -2.0);
} else {
tmp = 2.0 * (b * (cbrt(-0.125) / a));
}
return tmp;
}
public static double code(double a, double b, double c) {
double tmp;
if (b >= 0.0) {
tmp = (2.0 / b) * (c / -2.0);
} else {
tmp = 2.0 * (b * (Math.cbrt(-0.125) / a));
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b >= 0.0) tmp = Float64(Float64(2.0 / b) * Float64(c / -2.0)); else tmp = Float64(2.0 * Float64(b * Float64(cbrt(-0.125) / a))); end return tmp end
code[a_, b_, c_] := If[GreaterEqual[b, 0.0], N[(N[(2.0 / b), $MachinePrecision] * N[(c / -2.0), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(b * N[(N[Power[-0.125, 1/3], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2}{b} \cdot \frac{c}{-2}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(b \cdot \frac{\sqrt[3]{-0.125}}{a}\right)\\
\end{array}
\end{array}
Initial program 64.7%
add-cbrt-cube48.7%
pow1/338.1%
Applied egg-rr32.6%
Taylor expanded in b around inf 65.5%
associate-/l*65.6%
Simplified65.6%
Taylor expanded in b around inf 65.9%
*-commutative65.1%
Simplified65.9%
times-frac65.8%
Applied egg-rr65.8%
(FPCore (a b c) :precision binary64 (if (>= b 0.0) (* c (* (/ -4.0 a) (/ b (* c -4.0)))) (* 2.0 (* b (/ (cbrt -0.125) a)))))
double code(double a, double b, double c) {
double tmp;
if (b >= 0.0) {
tmp = c * ((-4.0 / a) * (b / (c * -4.0)));
} else {
tmp = 2.0 * (b * (cbrt(-0.125) / a));
}
return tmp;
}
public static double code(double a, double b, double c) {
double tmp;
if (b >= 0.0) {
tmp = c * ((-4.0 / a) * (b / (c * -4.0)));
} else {
tmp = 2.0 * (b * (Math.cbrt(-0.125) / a));
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b >= 0.0) tmp = Float64(c * Float64(Float64(-4.0 / a) * Float64(b / Float64(c * -4.0)))); else tmp = Float64(2.0 * Float64(b * Float64(cbrt(-0.125) / a))); end return tmp end
code[a_, b_, c_] := If[GreaterEqual[b, 0.0], N[(c * N[(N[(-4.0 / a), $MachinePrecision] * N[(b / N[(c * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(b * N[(N[Power[-0.125, 1/3], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;c \cdot \left(\frac{-4}{a} \cdot \frac{b}{c \cdot -4}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(b \cdot \frac{\sqrt[3]{-0.125}}{a}\right)\\
\end{array}
\end{array}
Initial program 64.7%
add-cbrt-cube48.7%
pow1/338.1%
Applied egg-rr32.6%
Taylor expanded in b around inf 65.5%
associate-/l*65.6%
Simplified65.6%
associate-/l*65.6%
add-sqr-sqrt35.5%
sqrt-unprod45.8%
sqr-neg45.8%
sqrt-prod52.1%
add-sqr-sqrt51.4%
pow251.4%
*-commutative51.4%
*-commutative51.4%
Applied egg-rr51.4%
associate-*r/51.4%
*-commutative51.4%
associate-*r/51.4%
associate-*r*51.4%
*-commutative51.4%
*-commutative51.4%
*-commutative51.4%
*-commutative51.4%
associate-*r*51.4%
sub-neg51.4%
unpow251.4%
rem-square-sqrt49.6%
distribute-rgt-neg-in49.6%
distribute-rgt-neg-in49.6%
metadata-eval49.6%
distribute-rgt-neg-in49.6%
Simplified45.9%
Taylor expanded in b around inf 35.5%
associate-*r/35.5%
rem-square-sqrt35.5%
unpow235.5%
times-frac35.5%
unpow235.5%
rem-square-sqrt35.5%
unpow235.5%
rem-square-sqrt37.0%
Simplified37.0%
herbie shell --seed 2024148
(FPCore (a b c)
:name "jeff quadratic root 2"
:precision binary64
(if (>= b 0.0) (/ (* 2.0 c) (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c))))) (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a))))