
(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 23 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 (* a 4.0))))) (t_1 (/ (- t_0 b) (* a 2.0))))
(if (<= b -3.5e+153)
(/ (- b) a)
(if (<= b 2.4e-28)
(if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_0)) t_1)
(if (>= b 0.0)
(/
(* 2.0 c)
(fma (- b) (sqrt (fma a (* -4.0 (/ (/ c b) b)) 1.0)) (- b)))
t_1)))))
double code(double a, double b, double c) {
double t_0 = sqrt(((b * b) - (c * (a * 4.0))));
double t_1 = (t_0 - b) / (a * 2.0);
double tmp;
if (b <= -3.5e+153) {
tmp = -b / a;
} else if (b <= 2.4e-28) {
double tmp_1;
if (b >= 0.0) {
tmp_1 = (2.0 * c) / (-b - t_0);
} else {
tmp_1 = t_1;
}
tmp = tmp_1;
} else if (b >= 0.0) {
tmp = (2.0 * c) / fma(-b, sqrt(fma(a, (-4.0 * ((c / b) / b)), 1.0)), -b);
} else {
tmp = t_1;
}
return tmp;
}
function code(a, b, c) t_0 = sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) t_1 = Float64(Float64(t_0 - b) / Float64(a * 2.0)) tmp = 0.0 if (b <= -3.5e+153) tmp = Float64(Float64(-b) / a); elseif (b <= 2.4e-28) tmp_1 = 0.0 if (b >= 0.0) tmp_1 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_0)); else tmp_1 = t_1; end tmp = tmp_1; elseif (b >= 0.0) tmp = Float64(Float64(2.0 * c) / fma(Float64(-b), sqrt(fma(a, Float64(-4.0 * Float64(Float64(c / b) / b)), 1.0)), Float64(-b))); else tmp = t_1; end return tmp end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.5e+153], N[((-b) / a), $MachinePrecision], If[LessEqual[b, 2.4e-28], 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) * N[Sqrt[N[(a * N[(-4.0 * N[(N[(c / b), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision] + (-b)), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}\\
t_1 := \frac{t\_0 - b}{a \cdot 2}\\
\mathbf{if}\;b \leq -3.5 \cdot 10^{+153}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{-28}:\\
\;\;\;\;\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}{\mathsf{fma}\left(-b, \sqrt{\mathsf{fma}\left(a, -4 \cdot \frac{\frac{c}{b}}{b}, 1\right)}, -b\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.4999999999999999e153Initial program 42.1%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6496.1
Simplified96.1%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6496.1
Simplified96.1%
lift->=.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-neg.f64N/A
count-2N/A
times-fracN/A
metadata-evalN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f6496.1
if-same96.1
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6496.1
Applied egg-rr96.1%
if -3.4999999999999999e153 < b < 2.4000000000000002e-28Initial program 81.6%
if 2.4000000000000002e-28 < b Initial program 61.8%
Taylor expanded in b around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6462.0
Simplified62.0%
lift-*.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
unpow1N/A
sqrt-pow1N/A
metadata-evalN/A
pow1/2N/A
lift-sqrt.f64N/A
lift--.f64N/A
Applied egg-rr99.2%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6499.9
Applied egg-rr99.9%
Final simplification90.4%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (sqrt (- (* b b) (* c (* a 4.0))))) (t_1 (/ (- t_0 b) (* a 2.0))))
(if (<= b -3.5e+153)
(/ (- b) a)
(if (<= b 2.4e-28)
(if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_0)) t_1)
(if (>= b 0.0)
(/
(* 2.0 c)
(fma (- b) (sqrt (fma a (* -4.0 (* c (/ 1.0 (* b b)))) 1.0)) (- b)))
t_1)))))
double code(double a, double b, double c) {
double t_0 = sqrt(((b * b) - (c * (a * 4.0))));
double t_1 = (t_0 - b) / (a * 2.0);
double tmp;
if (b <= -3.5e+153) {
tmp = -b / a;
} else if (b <= 2.4e-28) {
double tmp_1;
if (b >= 0.0) {
tmp_1 = (2.0 * c) / (-b - t_0);
} else {
tmp_1 = t_1;
}
tmp = tmp_1;
} else if (b >= 0.0) {
tmp = (2.0 * c) / fma(-b, sqrt(fma(a, (-4.0 * (c * (1.0 / (b * b)))), 1.0)), -b);
} else {
tmp = t_1;
}
return tmp;
}
function code(a, b, c) t_0 = sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) t_1 = Float64(Float64(t_0 - b) / Float64(a * 2.0)) tmp = 0.0 if (b <= -3.5e+153) tmp = Float64(Float64(-b) / a); elseif (b <= 2.4e-28) tmp_1 = 0.0 if (b >= 0.0) tmp_1 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_0)); else tmp_1 = t_1; end tmp = tmp_1; elseif (b >= 0.0) tmp = Float64(Float64(2.0 * c) / fma(Float64(-b), sqrt(fma(a, Float64(-4.0 * Float64(c * Float64(1.0 / Float64(b * b)))), 1.0)), Float64(-b))); else tmp = t_1; end return tmp end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.5e+153], N[((-b) / a), $MachinePrecision], If[LessEqual[b, 2.4e-28], 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) * N[Sqrt[N[(a * N[(-4.0 * N[(c * N[(1.0 / N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision] + (-b)), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}\\
t_1 := \frac{t\_0 - b}{a \cdot 2}\\
\mathbf{if}\;b \leq -3.5 \cdot 10^{+153}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{-28}:\\
\;\;\;\;\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}{\mathsf{fma}\left(-b, \sqrt{\mathsf{fma}\left(a, -4 \cdot \left(c \cdot \frac{1}{b \cdot b}\right), 1\right)}, -b\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.4999999999999999e153Initial program 42.1%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6496.1
Simplified96.1%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6496.1
Simplified96.1%
lift->=.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-neg.f64N/A
count-2N/A
times-fracN/A
metadata-evalN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f6496.1
if-same96.1
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6496.1
Applied egg-rr96.1%
if -3.4999999999999999e153 < b < 2.4000000000000002e-28Initial program 81.6%
if 2.4000000000000002e-28 < b Initial program 61.8%
Taylor expanded in b around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6462.0
Simplified62.0%
lift-*.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
unpow1N/A
sqrt-pow1N/A
metadata-evalN/A
pow1/2N/A
lift-sqrt.f64N/A
lift--.f64N/A
Applied egg-rr99.2%
lift-*.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6499.2
Applied egg-rr99.2%
Final simplification90.1%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (sqrt (- (* b b) (* c (* a 4.0))))) (t_1 (/ (- t_0 b) (* a 2.0))))
(if (<= b -3.5e+153)
(/ (- b) a)
(if (<= b 2.4e-28)
(if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_0)) t_1)
(if (>= b 0.0)
(/ (* 2.0 (- c)) (fma b (sqrt (fma -4.0 (* a (/ c (* b b))) 1.0)) b))
t_1)))))
double code(double a, double b, double c) {
double t_0 = sqrt(((b * b) - (c * (a * 4.0))));
double t_1 = (t_0 - b) / (a * 2.0);
double tmp;
if (b <= -3.5e+153) {
tmp = -b / a;
} else if (b <= 2.4e-28) {
double tmp_1;
if (b >= 0.0) {
tmp_1 = (2.0 * c) / (-b - t_0);
} else {
tmp_1 = t_1;
}
tmp = tmp_1;
} else if (b >= 0.0) {
tmp = (2.0 * -c) / fma(b, sqrt(fma(-4.0, (a * (c / (b * b))), 1.0)), b);
} else {
tmp = t_1;
}
return tmp;
}
function code(a, b, c) t_0 = sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) t_1 = Float64(Float64(t_0 - b) / Float64(a * 2.0)) tmp = 0.0 if (b <= -3.5e+153) tmp = Float64(Float64(-b) / a); elseif (b <= 2.4e-28) tmp_1 = 0.0 if (b >= 0.0) tmp_1 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_0)); else tmp_1 = t_1; end tmp = tmp_1; elseif (b >= 0.0) tmp = Float64(Float64(2.0 * Float64(-c)) / fma(b, sqrt(fma(-4.0, Float64(a * Float64(c / Float64(b * b))), 1.0)), b)); else tmp = t_1; end return tmp end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.5e+153], N[((-b) / a), $MachinePrecision], If[LessEqual[b, 2.4e-28], 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 * N[Sqrt[N[(-4.0 * N[(a * N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}\\
t_1 := \frac{t\_0 - b}{a \cdot 2}\\
\mathbf{if}\;b \leq -3.5 \cdot 10^{+153}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{-28}:\\
\;\;\;\;\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 \left(-c\right)}{\mathsf{fma}\left(b, \sqrt{\mathsf{fma}\left(-4, a \cdot \frac{c}{b \cdot b}, 1\right)}, b\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.4999999999999999e153Initial program 42.1%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6496.1
Simplified96.1%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6496.1
Simplified96.1%
lift->=.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-neg.f64N/A
count-2N/A
times-fracN/A
metadata-evalN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f6496.1
if-same96.1
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6496.1
Applied egg-rr96.1%
if -3.4999999999999999e153 < b < 2.4000000000000002e-28Initial program 81.6%
if 2.4000000000000002e-28 < b Initial program 61.8%
Taylor expanded in b around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6462.0
Simplified62.0%
lift-*.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
unpow1N/A
sqrt-pow1N/A
metadata-evalN/A
pow1/2N/A
lift-sqrt.f64N/A
lift--.f64N/A
Applied egg-rr99.2%
lift-*.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-sqrt.f64N/A
lift-neg.f64N/A
lift-fma.f64N/A
lift-/.f6499.2
lift-fma.f64N/A
Applied egg-rr99.2%
Final simplification90.1%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (- (/ (* 2.0 c) (+ b (fma (/ c b) (* a -2.0) b))))))
(if (<= b -1.3e+83)
(/ (- b) a)
(if (<= b -2.9e-261)
(if (>= b 0.0)
t_0
(* (/ 0.5 a) (- (sqrt (fma c (* a -4.0) (* b b))) b)))
(if (<= b 1e+124)
(if (>= b 0.0)
(/ (* 2.0 c) (- (- b) (sqrt (fma b b (* a (* c -4.0))))))
(/ (- (- b) b) (* a 2.0)))
(if (>= b 0.0) t_0 (* b (+ (/ c (* b b)) (/ -1.0 a)))))))))
double code(double a, double b, double c) {
double t_0 = -((2.0 * c) / (b + fma((c / b), (a * -2.0), b)));
double tmp;
if (b <= -1.3e+83) {
tmp = -b / a;
} else if (b <= -2.9e-261) {
double tmp_1;
if (b >= 0.0) {
tmp_1 = t_0;
} else {
tmp_1 = (0.5 / a) * (sqrt(fma(c, (a * -4.0), (b * b))) - b);
}
tmp = tmp_1;
} else if (b <= 1e+124) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = (2.0 * c) / (-b - sqrt(fma(b, b, (a * (c * -4.0)))));
} else {
tmp_2 = (-b - b) / (a * 2.0);
}
tmp = tmp_2;
} else if (b >= 0.0) {
tmp = t_0;
} else {
tmp = b * ((c / (b * b)) + (-1.0 / a));
}
return tmp;
}
function code(a, b, c) t_0 = Float64(-Float64(Float64(2.0 * c) / Float64(b + fma(Float64(c / b), Float64(a * -2.0), b)))) tmp = 0.0 if (b <= -1.3e+83) tmp = Float64(Float64(-b) / a); elseif (b <= -2.9e-261) tmp_1 = 0.0 if (b >= 0.0) tmp_1 = t_0; else tmp_1 = Float64(Float64(0.5 / a) * Float64(sqrt(fma(c, Float64(a * -4.0), Float64(b * b))) - b)); end tmp = tmp_1; elseif (b <= 1e+124) tmp_2 = 0.0 if (b >= 0.0) tmp_2 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - sqrt(fma(b, b, Float64(a * Float64(c * -4.0)))))); else tmp_2 = Float64(Float64(Float64(-b) - b) / Float64(a * 2.0)); end tmp = tmp_2; elseif (b >= 0.0) tmp = t_0; else tmp = Float64(b * Float64(Float64(c / Float64(b * b)) + Float64(-1.0 / a))); end return tmp end
code[a_, b_, c_] := Block[{t$95$0 = (-N[(N[(2.0 * c), $MachinePrecision] / N[(b + N[(N[(c / b), $MachinePrecision] * N[(a * -2.0), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[b, -1.3e+83], N[((-b) / a), $MachinePrecision], If[LessEqual[b, -2.9e-261], If[GreaterEqual[b, 0.0], t$95$0, N[(N[(0.5 / a), $MachinePrecision] * N[(N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], If[LessEqual[b, 1e+124], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - N[Sqrt[N[(b * b + N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-b) - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]], If[GreaterEqual[b, 0.0], t$95$0, N[(b * N[(N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{2 \cdot c}{b + \mathsf{fma}\left(\frac{c}{b}, a \cdot -2, b\right)}\\
\mathbf{if}\;b \leq -1.3 \cdot 10^{+83}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{elif}\;b \leq -2.9 \cdot 10^{-261}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{a} \cdot \left(\sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)} - b\right)\\
\end{array}\\
\mathbf{elif}\;b \leq 10^{+124}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) - b}{a \cdot 2}\\
\end{array}\\
\mathbf{elif}\;b \geq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\frac{c}{b \cdot b} + \frac{-1}{a}\right)\\
\end{array}
\end{array}
if b < -1.3000000000000001e83Initial program 54.4%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6496.9
Simplified96.9%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6496.9
Simplified96.9%
lift->=.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-neg.f64N/A
count-2N/A
times-fracN/A
metadata-evalN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f6496.9
if-same96.9
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6496.9
Applied egg-rr96.9%
if -1.3000000000000001e83 < b < -2.89999999999999985e-261Initial program 85.8%
Taylor expanded in a around 0
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6485.8
Simplified85.8%
lift-neg.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-sqrt.f64N/A
lift-+.f64N/A
lift-*.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lower-/.f6485.5
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
Applied egg-rr85.6%
if -2.89999999999999985e-261 < b < 9.99999999999999948e123Initial program 79.7%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6479.7
Simplified79.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6479.7
Applied egg-rr79.7%
if 9.99999999999999948e123 < b Initial program 43.3%
Taylor expanded in a around 0
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6499.1
Simplified99.1%
Taylor expanded in b around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6499.1
Simplified99.1%
Final simplification89.0%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (- (/ (* 2.0 c) (+ b (fma (/ c b) (* a -2.0) b)))))
(t_1 (sqrt (fma c (* a -4.0) (* b b)))))
(if (<= b -1.3e+83)
(/ (- b) a)
(if (<= b -2.9e-261)
(if (>= b 0.0) t_0 (* (/ 0.5 a) (- t_1 b)))
(if (<= b 1.36e+125)
(if (>= b 0.0) (* c (/ -2.0 (+ b t_1))) (/ (- (- b) b) (* a 2.0)))
(if (>= b 0.0) t_0 (* b (+ (/ c (* b b)) (/ -1.0 a)))))))))
double code(double a, double b, double c) {
double t_0 = -((2.0 * c) / (b + fma((c / b), (a * -2.0), b)));
double t_1 = sqrt(fma(c, (a * -4.0), (b * b)));
double tmp;
if (b <= -1.3e+83) {
tmp = -b / a;
} else if (b <= -2.9e-261) {
double tmp_1;
if (b >= 0.0) {
tmp_1 = t_0;
} else {
tmp_1 = (0.5 / a) * (t_1 - b);
}
tmp = tmp_1;
} else if (b <= 1.36e+125) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = c * (-2.0 / (b + t_1));
} else {
tmp_2 = (-b - b) / (a * 2.0);
}
tmp = tmp_2;
} else if (b >= 0.0) {
tmp = t_0;
} else {
tmp = b * ((c / (b * b)) + (-1.0 / a));
}
return tmp;
}
function code(a, b, c) t_0 = Float64(-Float64(Float64(2.0 * c) / Float64(b + fma(Float64(c / b), Float64(a * -2.0), b)))) t_1 = sqrt(fma(c, Float64(a * -4.0), Float64(b * b))) tmp = 0.0 if (b <= -1.3e+83) tmp = Float64(Float64(-b) / a); elseif (b <= -2.9e-261) tmp_1 = 0.0 if (b >= 0.0) tmp_1 = t_0; else tmp_1 = Float64(Float64(0.5 / a) * Float64(t_1 - b)); end tmp = tmp_1; elseif (b <= 1.36e+125) tmp_2 = 0.0 if (b >= 0.0) tmp_2 = Float64(c * Float64(-2.0 / Float64(b + t_1))); else tmp_2 = Float64(Float64(Float64(-b) - b) / Float64(a * 2.0)); end tmp = tmp_2; elseif (b >= 0.0) tmp = t_0; else tmp = Float64(b * Float64(Float64(c / Float64(b * b)) + Float64(-1.0 / a))); end return tmp end
code[a_, b_, c_] := Block[{t$95$0 = (-N[(N[(2.0 * c), $MachinePrecision] / N[(b + N[(N[(c / b), $MachinePrecision] * N[(a * -2.0), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$1 = N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, -1.3e+83], N[((-b) / a), $MachinePrecision], If[LessEqual[b, -2.9e-261], If[GreaterEqual[b, 0.0], t$95$0, N[(N[(0.5 / a), $MachinePrecision] * N[(t$95$1 - b), $MachinePrecision]), $MachinePrecision]], If[LessEqual[b, 1.36e+125], If[GreaterEqual[b, 0.0], N[(c * N[(-2.0 / N[(b + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-b) - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]], If[GreaterEqual[b, 0.0], t$95$0, N[(b * N[(N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{2 \cdot c}{b + \mathsf{fma}\left(\frac{c}{b}, a \cdot -2, b\right)}\\
t_1 := \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}\\
\mathbf{if}\;b \leq -1.3 \cdot 10^{+83}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{elif}\;b \leq -2.9 \cdot 10^{-261}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{a} \cdot \left(t\_1 - b\right)\\
\end{array}\\
\mathbf{elif}\;b \leq 1.36 \cdot 10^{+125}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;c \cdot \frac{-2}{b + t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) - b}{a \cdot 2}\\
\end{array}\\
\mathbf{elif}\;b \geq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\frac{c}{b \cdot b} + \frac{-1}{a}\right)\\
\end{array}
\end{array}
if b < -1.3000000000000001e83Initial program 54.4%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6496.9
Simplified96.9%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6496.9
Simplified96.9%
lift->=.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-neg.f64N/A
count-2N/A
times-fracN/A
metadata-evalN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f6496.9
if-same96.9
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6496.9
Applied egg-rr96.9%
if -1.3000000000000001e83 < b < -2.89999999999999985e-261Initial program 85.8%
Taylor expanded in a around 0
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6485.8
Simplified85.8%
lift-neg.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-sqrt.f64N/A
lift-+.f64N/A
lift-*.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lower-/.f6485.5
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
Applied egg-rr85.6%
if -2.89999999999999985e-261 < b < 1.36e125Initial program 79.7%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6479.7
Simplified79.7%
*-commutativeN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-sqrt.f64N/A
lift--.f64N/A
associate-/l*N/A
metadata-evalN/A
lift--.f64N/A
sub-negN/A
lift-neg.f64N/A
distribute-neg-outN/A
lift--.f64N/A
Applied egg-rr79.6%
if 1.36e125 < b Initial program 43.3%
Taylor expanded in a around 0
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6499.1
Simplified99.1%
Taylor expanded in b around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6499.1
Simplified99.1%
Final simplification89.0%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (- (/ (* 2.0 c) (+ b (fma (/ c b) (* a -2.0) b))))))
(if (<= b -1.2e-45)
(if (>= b 0.0) t_0 (- (/ c b) (/ b a)))
(if (<= b -2.9e-261)
(if (>= b 0.0) (/ b a) (/ (- (sqrt (* -4.0 (* a c))) b) (* a 2.0)))
(if (<= b 1.36e+125)
(if (>= b 0.0)
(* c (/ -2.0 (+ b (sqrt (fma c (* a -4.0) (* b b))))))
(/ (- (- b) b) (* a 2.0)))
(if (>= b 0.0) t_0 (* b (+ (/ c (* b b)) (/ -1.0 a)))))))))
double code(double a, double b, double c) {
double t_0 = -((2.0 * c) / (b + fma((c / b), (a * -2.0), b)));
double tmp_1;
if (b <= -1.2e-45) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = t_0;
} else {
tmp_2 = (c / b) - (b / a);
}
tmp_1 = tmp_2;
} else if (b <= -2.9e-261) {
double tmp_3;
if (b >= 0.0) {
tmp_3 = b / a;
} else {
tmp_3 = (sqrt((-4.0 * (a * c))) - b) / (a * 2.0);
}
tmp_1 = tmp_3;
} else if (b <= 1.36e+125) {
double tmp_4;
if (b >= 0.0) {
tmp_4 = c * (-2.0 / (b + sqrt(fma(c, (a * -4.0), (b * b)))));
} else {
tmp_4 = (-b - b) / (a * 2.0);
}
tmp_1 = tmp_4;
} else if (b >= 0.0) {
tmp_1 = t_0;
} else {
tmp_1 = b * ((c / (b * b)) + (-1.0 / a));
}
return tmp_1;
}
function code(a, b, c) t_0 = Float64(-Float64(Float64(2.0 * c) / Float64(b + fma(Float64(c / b), Float64(a * -2.0), b)))) tmp_1 = 0.0 if (b <= -1.2e-45) tmp_2 = 0.0 if (b >= 0.0) tmp_2 = t_0; else tmp_2 = Float64(Float64(c / b) - Float64(b / a)); end tmp_1 = tmp_2; elseif (b <= -2.9e-261) tmp_3 = 0.0 if (b >= 0.0) tmp_3 = Float64(b / a); else tmp_3 = Float64(Float64(sqrt(Float64(-4.0 * Float64(a * c))) - b) / Float64(a * 2.0)); end tmp_1 = tmp_3; elseif (b <= 1.36e+125) tmp_4 = 0.0 if (b >= 0.0) tmp_4 = Float64(c * Float64(-2.0 / Float64(b + sqrt(fma(c, Float64(a * -4.0), Float64(b * b)))))); else tmp_4 = Float64(Float64(Float64(-b) - b) / Float64(a * 2.0)); end tmp_1 = tmp_4; elseif (b >= 0.0) tmp_1 = t_0; else tmp_1 = Float64(b * Float64(Float64(c / Float64(b * b)) + Float64(-1.0 / a))); end return tmp_1 end
code[a_, b_, c_] := Block[{t$95$0 = (-N[(N[(2.0 * c), $MachinePrecision] / N[(b + N[(N[(c / b), $MachinePrecision] * N[(a * -2.0), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[b, -1.2e-45], If[GreaterEqual[b, 0.0], t$95$0, N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]], If[LessEqual[b, -2.9e-261], If[GreaterEqual[b, 0.0], N[(b / a), $MachinePrecision], N[(N[(N[Sqrt[N[(-4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]], If[LessEqual[b, 1.36e+125], If[GreaterEqual[b, 0.0], N[(c * N[(-2.0 / N[(b + N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-b) - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]], If[GreaterEqual[b, 0.0], t$95$0, N[(b * N[(N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{2 \cdot c}{b + \mathsf{fma}\left(\frac{c}{b}, a \cdot -2, b\right)}\\
\mathbf{if}\;b \leq -1.2 \cdot 10^{-45}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\end{array}\\
\mathbf{elif}\;b \leq -2.9 \cdot 10^{-261}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-4 \cdot \left(a \cdot c\right)} - b}{a \cdot 2}\\
\end{array}\\
\mathbf{elif}\;b \leq 1.36 \cdot 10^{+125}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;c \cdot \frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) - b}{a \cdot 2}\\
\end{array}\\
\mathbf{elif}\;b \geq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\frac{c}{b \cdot b} + \frac{-1}{a}\right)\\
\end{array}
\end{array}
if b < -1.19999999999999995e-45Initial program 66.9%
Taylor expanded in a around 0
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6466.9
Simplified66.9%
Taylor expanded in b around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
lower-fma.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6489.4
Simplified89.4%
Taylor expanded in a around inf
mul-1-negN/A
+-commutativeN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f6489.4
Simplified89.4%
if -1.19999999999999995e-45 < b < -2.89999999999999985e-261Initial program 76.7%
Taylor expanded in a around 0
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6476.7
Simplified76.7%
Taylor expanded in c around inf
lower-/.f6476.7
Simplified76.7%
Taylor expanded in b around 0
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.7
Simplified61.7%
if -2.89999999999999985e-261 < b < 1.36e125Initial program 79.7%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6479.7
Simplified79.7%
*-commutativeN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-sqrt.f64N/A
lift--.f64N/A
associate-/l*N/A
metadata-evalN/A
lift--.f64N/A
sub-negN/A
lift-neg.f64N/A
distribute-neg-outN/A
lift--.f64N/A
Applied egg-rr79.6%
if 1.36e125 < b Initial program 43.3%
Taylor expanded in a around 0
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6499.1
Simplified99.1%
Taylor expanded in b around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6499.1
Simplified99.1%
Final simplification84.8%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (- (/ (* 2.0 c) (+ b (fma (/ c b) (* a -2.0) b)))))
(t_1 (sqrt (* -4.0 (* a c)))))
(if (<= b -1.2e-45)
(if (>= b 0.0) t_0 (- (/ c b) (/ b a)))
(if (<= b -2.9e-261)
(if (>= b 0.0) (/ b a) (/ (- t_1 b) (* a 2.0)))
(if (<= b 1.75e-28)
(if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_1)) (/ (- (- b) b) (* a 2.0)))
(if (>= b 0.0) t_0 (* b (+ (/ c (* b b)) (/ -1.0 a)))))))))
double code(double a, double b, double c) {
double t_0 = -((2.0 * c) / (b + fma((c / b), (a * -2.0), b)));
double t_1 = sqrt((-4.0 * (a * c)));
double tmp_1;
if (b <= -1.2e-45) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = t_0;
} else {
tmp_2 = (c / b) - (b / a);
}
tmp_1 = tmp_2;
} else if (b <= -2.9e-261) {
double tmp_3;
if (b >= 0.0) {
tmp_3 = b / a;
} else {
tmp_3 = (t_1 - b) / (a * 2.0);
}
tmp_1 = tmp_3;
} else if (b <= 1.75e-28) {
double tmp_4;
if (b >= 0.0) {
tmp_4 = (2.0 * c) / (-b - t_1);
} else {
tmp_4 = (-b - b) / (a * 2.0);
}
tmp_1 = tmp_4;
} else if (b >= 0.0) {
tmp_1 = t_0;
} else {
tmp_1 = b * ((c / (b * b)) + (-1.0 / a));
}
return tmp_1;
}
function code(a, b, c) t_0 = Float64(-Float64(Float64(2.0 * c) / Float64(b + fma(Float64(c / b), Float64(a * -2.0), b)))) t_1 = sqrt(Float64(-4.0 * Float64(a * c))) tmp_1 = 0.0 if (b <= -1.2e-45) tmp_2 = 0.0 if (b >= 0.0) tmp_2 = t_0; else tmp_2 = Float64(Float64(c / b) - Float64(b / a)); end tmp_1 = tmp_2; elseif (b <= -2.9e-261) tmp_3 = 0.0 if (b >= 0.0) tmp_3 = Float64(b / a); else tmp_3 = Float64(Float64(t_1 - b) / Float64(a * 2.0)); end tmp_1 = tmp_3; elseif (b <= 1.75e-28) tmp_4 = 0.0 if (b >= 0.0) tmp_4 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_1)); else tmp_4 = Float64(Float64(Float64(-b) - b) / Float64(a * 2.0)); end tmp_1 = tmp_4; elseif (b >= 0.0) tmp_1 = t_0; else tmp_1 = Float64(b * Float64(Float64(c / Float64(b * b)) + Float64(-1.0 / a))); end return tmp_1 end
code[a_, b_, c_] := Block[{t$95$0 = (-N[(N[(2.0 * c), $MachinePrecision] / N[(b + N[(N[(c / b), $MachinePrecision] * N[(a * -2.0), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$1 = N[Sqrt[N[(-4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, -1.2e-45], If[GreaterEqual[b, 0.0], t$95$0, N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]], If[LessEqual[b, -2.9e-261], If[GreaterEqual[b, 0.0], N[(b / a), $MachinePrecision], N[(N[(t$95$1 - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]], If[LessEqual[b, 1.75e-28], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[((-b) - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]], If[GreaterEqual[b, 0.0], t$95$0, N[(b * N[(N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{2 \cdot c}{b + \mathsf{fma}\left(\frac{c}{b}, a \cdot -2, b\right)}\\
t_1 := \sqrt{-4 \cdot \left(a \cdot c\right)}\\
\mathbf{if}\;b \leq -1.2 \cdot 10^{-45}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\end{array}\\
\mathbf{elif}\;b \leq -2.9 \cdot 10^{-261}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1 - b}{a \cdot 2}\\
\end{array}\\
\mathbf{elif}\;b \leq 1.75 \cdot 10^{-28}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) - b}{a \cdot 2}\\
\end{array}\\
\mathbf{elif}\;b \geq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\frac{c}{b \cdot b} + \frac{-1}{a}\right)\\
\end{array}
\end{array}
if b < -1.19999999999999995e-45Initial program 66.9%
Taylor expanded in a around 0
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6466.9
Simplified66.9%
Taylor expanded in b around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
lower-fma.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6489.4
Simplified89.4%
Taylor expanded in a around inf
mul-1-negN/A
+-commutativeN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f6489.4
Simplified89.4%
if -1.19999999999999995e-45 < b < -2.89999999999999985e-261Initial program 76.7%
Taylor expanded in a around 0
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6476.7
Simplified76.7%
Taylor expanded in c around inf
lower-/.f6476.7
Simplified76.7%
Taylor expanded in b around 0
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.7
Simplified61.7%
if -2.89999999999999985e-261 < b < 1.75e-28Initial program 72.8%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6472.8
Simplified72.8%
Taylor expanded in b around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6464.6
Simplified64.6%
if 1.75e-28 < b Initial program 61.8%
Taylor expanded in a around 0
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6491.8
Simplified91.8%
Taylor expanded in b around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6491.8
Simplified91.8%
Final simplification81.7%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (sqrt (* -4.0 (* a c)))))
(if (<= b -1.2e-45)
(/ (- b) a)
(if (<= b -2.9e-261)
(if (>= b 0.0) (/ b a) (/ (- t_0 b) (* a 2.0)))
(if (<= b 1.75e-28)
(if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_0)) (/ (- (- b) b) (* a 2.0)))
(if (>= b 0.0)
(- (/ (* 2.0 c) (+ b (fma (/ c b) (* a -2.0) b))))
(* b (+ (/ c (* b b)) (/ -1.0 a)))))))))
double code(double a, double b, double c) {
double t_0 = sqrt((-4.0 * (a * c)));
double tmp;
if (b <= -1.2e-45) {
tmp = -b / a;
} else if (b <= -2.9e-261) {
double tmp_1;
if (b >= 0.0) {
tmp_1 = b / a;
} else {
tmp_1 = (t_0 - b) / (a * 2.0);
}
tmp = tmp_1;
} else if (b <= 1.75e-28) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = (2.0 * c) / (-b - t_0);
} else {
tmp_2 = (-b - b) / (a * 2.0);
}
tmp = tmp_2;
} else if (b >= 0.0) {
tmp = -((2.0 * c) / (b + fma((c / b), (a * -2.0), b)));
} else {
tmp = b * ((c / (b * b)) + (-1.0 / a));
}
return tmp;
}
function code(a, b, c) t_0 = sqrt(Float64(-4.0 * Float64(a * c))) tmp = 0.0 if (b <= -1.2e-45) tmp = Float64(Float64(-b) / a); elseif (b <= -2.9e-261) tmp_1 = 0.0 if (b >= 0.0) tmp_1 = Float64(b / a); else tmp_1 = Float64(Float64(t_0 - b) / Float64(a * 2.0)); end tmp = tmp_1; elseif (b <= 1.75e-28) tmp_2 = 0.0 if (b >= 0.0) tmp_2 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_0)); else tmp_2 = Float64(Float64(Float64(-b) - b) / Float64(a * 2.0)); end tmp = tmp_2; elseif (b >= 0.0) tmp = Float64(-Float64(Float64(2.0 * c) / Float64(b + fma(Float64(c / b), Float64(a * -2.0), b)))); else tmp = Float64(b * Float64(Float64(c / Float64(b * b)) + Float64(-1.0 / a))); end return tmp end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(-4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, -1.2e-45], N[((-b) / a), $MachinePrecision], If[LessEqual[b, -2.9e-261], If[GreaterEqual[b, 0.0], N[(b / a), $MachinePrecision], N[(N[(t$95$0 - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]], If[LessEqual[b, 1.75e-28], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[((-b) - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]], If[GreaterEqual[b, 0.0], (-N[(N[(2.0 * c), $MachinePrecision] / N[(b + N[(N[(c / b), $MachinePrecision] * N[(a * -2.0), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), N[(b * N[(N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-4 \cdot \left(a \cdot c\right)}\\
\mathbf{if}\;b \leq -1.2 \cdot 10^{-45}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{elif}\;b \leq -2.9 \cdot 10^{-261}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0 - b}{a \cdot 2}\\
\end{array}\\
\mathbf{elif}\;b \leq 1.75 \cdot 10^{-28}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) - b}{a \cdot 2}\\
\end{array}\\
\mathbf{elif}\;b \geq 0:\\
\;\;\;\;-\frac{2 \cdot c}{b + \mathsf{fma}\left(\frac{c}{b}, a \cdot -2, b\right)}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\frac{c}{b \cdot b} + \frac{-1}{a}\right)\\
\end{array}
\end{array}
if b < -1.19999999999999995e-45Initial program 66.9%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6489.4
Simplified89.4%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6489.4
Simplified89.4%
lift->=.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-neg.f64N/A
count-2N/A
times-fracN/A
metadata-evalN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f6489.4
if-same89.4
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6489.4
Applied egg-rr89.4%
if -1.19999999999999995e-45 < b < -2.89999999999999985e-261Initial program 76.7%
Taylor expanded in a around 0
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6476.7
Simplified76.7%
Taylor expanded in c around inf
lower-/.f6476.7
Simplified76.7%
Taylor expanded in b around 0
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.7
Simplified61.7%
if -2.89999999999999985e-261 < b < 1.75e-28Initial program 72.8%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6472.8
Simplified72.8%
Taylor expanded in b around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6464.6
Simplified64.6%
if 1.75e-28 < b Initial program 61.8%
Taylor expanded in a around 0
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6491.8
Simplified91.8%
Taylor expanded in b around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6491.8
Simplified91.8%
Final simplification81.7%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (sqrt (- (* b b) (* c (* a 4.0))))))
(if (<= b -3.5e+153)
(/ (- b) a)
(if (<= b 1e+124)
(if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_0)) (/ (- t_0 b) (* a 2.0)))
(if (>= b 0.0)
(- (/ (* 2.0 c) (+ b (fma (/ c b) (* a -2.0) b))))
(* b (+ (/ c (* b b)) (/ -1.0 a))))))))
double code(double a, double b, double c) {
double t_0 = sqrt(((b * b) - (c * (a * 4.0))));
double tmp;
if (b <= -3.5e+153) {
tmp = -b / a;
} else if (b <= 1e+124) {
double tmp_1;
if (b >= 0.0) {
tmp_1 = (2.0 * c) / (-b - t_0);
} else {
tmp_1 = (t_0 - b) / (a * 2.0);
}
tmp = tmp_1;
} else if (b >= 0.0) {
tmp = -((2.0 * c) / (b + fma((c / b), (a * -2.0), b)));
} else {
tmp = b * ((c / (b * b)) + (-1.0 / a));
}
return tmp;
}
function code(a, b, c) t_0 = sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) tmp = 0.0 if (b <= -3.5e+153) tmp = Float64(Float64(-b) / a); elseif (b <= 1e+124) tmp_1 = 0.0 if (b >= 0.0) tmp_1 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_0)); else tmp_1 = Float64(Float64(t_0 - b) / Float64(a * 2.0)); end tmp = tmp_1; elseif (b >= 0.0) tmp = Float64(-Float64(Float64(2.0 * c) / Float64(b + fma(Float64(c / b), Float64(a * -2.0), b)))); else tmp = Float64(b * Float64(Float64(c / Float64(b * b)) + Float64(-1.0 / a))); end return tmp end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, -3.5e+153], N[((-b) / a), $MachinePrecision], If[LessEqual[b, 1e+124], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]], If[GreaterEqual[b, 0.0], (-N[(N[(2.0 * c), $MachinePrecision] / N[(b + N[(N[(c / b), $MachinePrecision] * N[(a * -2.0), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), N[(b * N[(N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}\\
\mathbf{if}\;b \leq -3.5 \cdot 10^{+153}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{elif}\;b \leq 10^{+124}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0 - b}{a \cdot 2}\\
\end{array}\\
\mathbf{elif}\;b \geq 0:\\
\;\;\;\;-\frac{2 \cdot c}{b + \mathsf{fma}\left(\frac{c}{b}, a \cdot -2, b\right)}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\frac{c}{b \cdot b} + \frac{-1}{a}\right)\\
\end{array}
\end{array}
if b < -3.4999999999999999e153Initial program 42.1%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6496.1
Simplified96.1%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6496.1
Simplified96.1%
lift->=.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-neg.f64N/A
count-2N/A
times-fracN/A
metadata-evalN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f6496.1
if-same96.1
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6496.1
Applied egg-rr96.1%
if -3.4999999999999999e153 < b < 9.99999999999999948e123Initial program 83.6%
if 9.99999999999999948e123 < b Initial program 43.3%
Taylor expanded in a around 0
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6499.1
Simplified99.1%
Taylor expanded in b around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6499.1
Simplified99.1%
Final simplification89.1%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (/ (- (- b) b) (* a 2.0))) (t_1 (sqrt (* -4.0 (* a c)))))
(if (<= b -1.2e-45)
(/ (- b) a)
(if (<= b -2.9e-261)
(if (>= b 0.0) (/ b a) (/ (- t_1 b) (* a 2.0)))
(if (<= b 1.75e-28)
(if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_1)) t_0)
(if (>= b 0.0) (/ (* 2.0 c) (* b -2.0)) t_0))))))
double code(double a, double b, double c) {
double t_0 = (-b - b) / (a * 2.0);
double t_1 = sqrt((-4.0 * (a * c)));
double tmp;
if (b <= -1.2e-45) {
tmp = -b / a;
} else if (b <= -2.9e-261) {
double tmp_1;
if (b >= 0.0) {
tmp_1 = b / a;
} else {
tmp_1 = (t_1 - b) / (a * 2.0);
}
tmp = tmp_1;
} else if (b <= 1.75e-28) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = (2.0 * c) / (-b - t_1);
} else {
tmp_2 = t_0;
}
tmp = tmp_2;
} else if (b >= 0.0) {
tmp = (2.0 * c) / (b * -2.0);
} else {
tmp = t_0;
}
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) :: t_1
real(8) :: tmp
real(8) :: tmp_1
real(8) :: tmp_2
t_0 = (-b - b) / (a * 2.0d0)
t_1 = sqrt(((-4.0d0) * (a * c)))
if (b <= (-1.2d-45)) then
tmp = -b / a
else if (b <= (-2.9d-261)) then
if (b >= 0.0d0) then
tmp_1 = b / a
else
tmp_1 = (t_1 - b) / (a * 2.0d0)
end if
tmp = tmp_1
else if (b <= 1.75d-28) then
if (b >= 0.0d0) then
tmp_2 = (2.0d0 * c) / (-b - t_1)
else
tmp_2 = t_0
end if
tmp = tmp_2
else if (b >= 0.0d0) then
tmp = (2.0d0 * c) / (b * (-2.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double t_0 = (-b - b) / (a * 2.0);
double t_1 = Math.sqrt((-4.0 * (a * c)));
double tmp;
if (b <= -1.2e-45) {
tmp = -b / a;
} else if (b <= -2.9e-261) {
double tmp_1;
if (b >= 0.0) {
tmp_1 = b / a;
} else {
tmp_1 = (t_1 - b) / (a * 2.0);
}
tmp = tmp_1;
} else if (b <= 1.75e-28) {
double tmp_2;
if (b >= 0.0) {
tmp_2 = (2.0 * c) / (-b - t_1);
} else {
tmp_2 = t_0;
}
tmp = tmp_2;
} else if (b >= 0.0) {
tmp = (2.0 * c) / (b * -2.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b, c): t_0 = (-b - b) / (a * 2.0) t_1 = math.sqrt((-4.0 * (a * c))) tmp = 0 if b <= -1.2e-45: tmp = -b / a elif b <= -2.9e-261: tmp_1 = 0 if b >= 0.0: tmp_1 = b / a else: tmp_1 = (t_1 - b) / (a * 2.0) tmp = tmp_1 elif b <= 1.75e-28: tmp_2 = 0 if b >= 0.0: tmp_2 = (2.0 * c) / (-b - t_1) else: tmp_2 = t_0 tmp = tmp_2 elif b >= 0.0: tmp = (2.0 * c) / (b * -2.0) else: tmp = t_0 return tmp
function code(a, b, c) t_0 = Float64(Float64(Float64(-b) - b) / Float64(a * 2.0)) t_1 = sqrt(Float64(-4.0 * Float64(a * c))) tmp = 0.0 if (b <= -1.2e-45) tmp = Float64(Float64(-b) / a); elseif (b <= -2.9e-261) tmp_1 = 0.0 if (b >= 0.0) tmp_1 = Float64(b / a); else tmp_1 = Float64(Float64(t_1 - b) / Float64(a * 2.0)); end tmp = tmp_1; elseif (b <= 1.75e-28) tmp_2 = 0.0 if (b >= 0.0) tmp_2 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_1)); else tmp_2 = t_0; end tmp = tmp_2; elseif (b >= 0.0) tmp = Float64(Float64(2.0 * c) / Float64(b * -2.0)); else tmp = t_0; end return tmp end
function tmp_4 = code(a, b, c) t_0 = (-b - b) / (a * 2.0); t_1 = sqrt((-4.0 * (a * c))); tmp = 0.0; if (b <= -1.2e-45) tmp = -b / a; elseif (b <= -2.9e-261) tmp_2 = 0.0; if (b >= 0.0) tmp_2 = b / a; else tmp_2 = (t_1 - b) / (a * 2.0); end tmp = tmp_2; elseif (b <= 1.75e-28) tmp_3 = 0.0; if (b >= 0.0) tmp_3 = (2.0 * c) / (-b - t_1); else tmp_3 = t_0; end tmp = tmp_3; elseif (b >= 0.0) tmp = (2.0 * c) / (b * -2.0); else tmp = t_0; end tmp_4 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[((-b) - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(-4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, -1.2e-45], N[((-b) / a), $MachinePrecision], If[LessEqual[b, -2.9e-261], If[GreaterEqual[b, 0.0], N[(b / a), $MachinePrecision], N[(N[(t$95$1 - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]], If[LessEqual[b, 1.75e-28], 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$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(-b\right) - b}{a \cdot 2}\\
t_1 := \sqrt{-4 \cdot \left(a \cdot c\right)}\\
\mathbf{if}\;b \leq -1.2 \cdot 10^{-45}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{elif}\;b \leq -2.9 \cdot 10^{-261}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1 - b}{a \cdot 2}\\
\end{array}\\
\mathbf{elif}\;b \leq 1.75 \cdot 10^{-28}:\\
\;\;\;\;\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\_0\\
\end{array}
\end{array}
if b < -1.19999999999999995e-45Initial program 66.9%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6489.4
Simplified89.4%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6489.4
Simplified89.4%
lift->=.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-neg.f64N/A
count-2N/A
times-fracN/A
metadata-evalN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f6489.4
if-same89.4
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6489.4
Applied egg-rr89.4%
if -1.19999999999999995e-45 < b < -2.89999999999999985e-261Initial program 76.7%
Taylor expanded in a around 0
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6476.7
Simplified76.7%
Taylor expanded in c around inf
lower-/.f6476.7
Simplified76.7%
Taylor expanded in b around 0
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.7
Simplified61.7%
if -2.89999999999999985e-261 < b < 1.75e-28Initial program 72.8%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6472.8
Simplified72.8%
Taylor expanded in b around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6464.6
Simplified64.6%
if 1.75e-28 < b Initial program 61.8%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6461.8
Simplified61.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6490.7
Simplified90.7%
Final simplification81.4%
(FPCore (a b c)
:precision binary64
(if (<= b -3.5e+153)
(/ (- b) a)
(if (<= b 1e+124)
(if (>= b 0.0)
(/ (* 2.0 c) (- (- b) (sqrt (fma b b (* c (* a -4.0))))))
(/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) (* a 2.0)))
(if (>= b 0.0)
(- (/ (* 2.0 c) (+ b (fma (/ c b) (* a -2.0) b))))
(* b (+ (/ c (* b b)) (/ -1.0 a)))))))
double code(double a, double b, double c) {
double tmp;
if (b <= -3.5e+153) {
tmp = -b / a;
} else if (b <= 1e+124) {
double tmp_1;
if (b >= 0.0) {
tmp_1 = (2.0 * c) / (-b - sqrt(fma(b, b, (c * (a * -4.0)))));
} else {
tmp_1 = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
}
tmp = tmp_1;
} else if (b >= 0.0) {
tmp = -((2.0 * c) / (b + fma((c / b), (a * -2.0), b)));
} else {
tmp = b * ((c / (b * b)) + (-1.0 / a));
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -3.5e+153) tmp = Float64(Float64(-b) / a); elseif (b <= 1e+124) tmp_1 = 0.0 if (b >= 0.0) tmp_1 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - sqrt(fma(b, b, Float64(c * Float64(a * -4.0)))))); else tmp_1 = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b) / Float64(a * 2.0)); end tmp = tmp_1; elseif (b >= 0.0) tmp = Float64(-Float64(Float64(2.0 * c) / Float64(b + fma(Float64(c / b), Float64(a * -2.0), b)))); else tmp = Float64(b * Float64(Float64(c / Float64(b * b)) + Float64(-1.0 / a))); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -3.5e+153], N[((-b) / a), $MachinePrecision], If[LessEqual[b, 1e+124], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - N[Sqrt[N[(b * b + N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]], If[GreaterEqual[b, 0.0], (-N[(N[(2.0 * c), $MachinePrecision] / N[(b + N[(N[(c / b), $MachinePrecision] * N[(a * -2.0), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), N[(b * N[(N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.5 \cdot 10^{+153}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{elif}\;b \leq 10^{+124}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\
\end{array}\\
\mathbf{elif}\;b \geq 0:\\
\;\;\;\;-\frac{2 \cdot c}{b + \mathsf{fma}\left(\frac{c}{b}, a \cdot -2, b\right)}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\frac{c}{b \cdot b} + \frac{-1}{a}\right)\\
\end{array}
\end{array}
if b < -3.4999999999999999e153Initial program 42.1%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6496.1
Simplified96.1%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6496.1
Simplified96.1%
lift->=.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-neg.f64N/A
count-2N/A
times-fracN/A
metadata-evalN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f6496.1
if-same96.1
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6496.1
Applied egg-rr96.1%
if -3.4999999999999999e153 < b < 9.99999999999999948e123Initial program 83.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
sub-negN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
metadata-eval83.6
Applied egg-rr83.6%
if 9.99999999999999948e123 < b Initial program 43.3%
Taylor expanded in a around 0
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6499.1
Simplified99.1%
Taylor expanded in b around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6499.1
Simplified99.1%
Final simplification89.1%
(FPCore (a b c)
:precision binary64
(if (<= b -3.5e+153)
(/ (- b) a)
(if (<= b 1.36e+125)
(if (>= b 0.0)
(* c (/ 2.0 (- (- b) (sqrt (fma c (* a -4.0) (* b b))))))
(/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) (* a 2.0)))
(if (>= b 0.0)
(- (/ (* 2.0 c) (+ b (fma (/ c b) (* a -2.0) b))))
(* b (+ (/ c (* b b)) (/ -1.0 a)))))))
double code(double a, double b, double c) {
double tmp;
if (b <= -3.5e+153) {
tmp = -b / a;
} else if (b <= 1.36e+125) {
double tmp_1;
if (b >= 0.0) {
tmp_1 = c * (2.0 / (-b - sqrt(fma(c, (a * -4.0), (b * b)))));
} else {
tmp_1 = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
}
tmp = tmp_1;
} else if (b >= 0.0) {
tmp = -((2.0 * c) / (b + fma((c / b), (a * -2.0), b)));
} else {
tmp = b * ((c / (b * b)) + (-1.0 / a));
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -3.5e+153) tmp = Float64(Float64(-b) / a); elseif (b <= 1.36e+125) tmp_1 = 0.0 if (b >= 0.0) tmp_1 = Float64(c * Float64(2.0 / Float64(Float64(-b) - sqrt(fma(c, Float64(a * -4.0), Float64(b * b)))))); else tmp_1 = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b) / Float64(a * 2.0)); end tmp = tmp_1; elseif (b >= 0.0) tmp = Float64(-Float64(Float64(2.0 * c) / Float64(b + fma(Float64(c / b), Float64(a * -2.0), b)))); else tmp = Float64(b * Float64(Float64(c / Float64(b * b)) + Float64(-1.0 / a))); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -3.5e+153], N[((-b) / a), $MachinePrecision], If[LessEqual[b, 1.36e+125], If[GreaterEqual[b, 0.0], N[(c * N[(2.0 / N[((-b) - N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]], If[GreaterEqual[b, 0.0], (-N[(N[(2.0 * c), $MachinePrecision] / N[(b + N[(N[(c / b), $MachinePrecision] * N[(a * -2.0), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), N[(b * N[(N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.5 \cdot 10^{+153}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{elif}\;b \leq 1.36 \cdot 10^{+125}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;c \cdot \frac{2}{\left(-b\right) - \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\
\end{array}\\
\mathbf{elif}\;b \geq 0:\\
\;\;\;\;-\frac{2 \cdot c}{b + \mathsf{fma}\left(\frac{c}{b}, a \cdot -2, b\right)}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\frac{c}{b \cdot b} + \frac{-1}{a}\right)\\
\end{array}
\end{array}
if b < -3.4999999999999999e153Initial program 42.1%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6496.1
Simplified96.1%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6496.1
Simplified96.1%
lift->=.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-neg.f64N/A
count-2N/A
times-fracN/A
metadata-evalN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f6496.1
if-same96.1
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6496.1
Applied egg-rr96.1%
if -3.4999999999999999e153 < b < 1.36e125Initial program 83.6%
Applied egg-rr83.5%
if 1.36e125 < b Initial program 43.3%
Taylor expanded in a around 0
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6499.1
Simplified99.1%
Taylor expanded in b around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6499.1
Simplified99.1%
Final simplification89.0%
(FPCore (a b c)
:precision binary64
(if (<= b -1.2e-45)
(/ (- b) a)
(if (<= b -2.9e-261)
(if (>= b 0.0) (/ b a) (/ (- (sqrt (* -4.0 (* a c))) b) (* a 2.0)))
(if (>= b 0.0) (/ (* 2.0 c) (* b -2.0)) (/ (- (- b) b) (* a 2.0))))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.2e-45) {
tmp = -b / a;
} else if (b <= -2.9e-261) {
double tmp_1;
if (b >= 0.0) {
tmp_1 = b / a;
} else {
tmp_1 = (sqrt((-4.0 * (a * c))) - b) / (a * 2.0);
}
tmp = tmp_1;
} else if (b >= 0.0) {
tmp = (2.0 * c) / (b * -2.0);
} else {
tmp = (-b - b) / (a * 2.0);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
real(8) :: tmp_1
if (b <= (-1.2d-45)) then
tmp = -b / a
else if (b <= (-2.9d-261)) then
if (b >= 0.0d0) then
tmp_1 = b / a
else
tmp_1 = (sqrt(((-4.0d0) * (a * c))) - b) / (a * 2.0d0)
end if
tmp = tmp_1
else if (b >= 0.0d0) then
tmp = (2.0d0 * c) / (b * (-2.0d0))
else
tmp = (-b - b) / (a * 2.0d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1.2e-45) {
tmp = -b / a;
} else if (b <= -2.9e-261) {
double tmp_1;
if (b >= 0.0) {
tmp_1 = b / a;
} else {
tmp_1 = (Math.sqrt((-4.0 * (a * c))) - b) / (a * 2.0);
}
tmp = tmp_1;
} else if (b >= 0.0) {
tmp = (2.0 * c) / (b * -2.0);
} else {
tmp = (-b - b) / (a * 2.0);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.2e-45: tmp = -b / a elif b <= -2.9e-261: tmp_1 = 0 if b >= 0.0: tmp_1 = b / a else: tmp_1 = (math.sqrt((-4.0 * (a * c))) - b) / (a * 2.0) tmp = tmp_1 elif b >= 0.0: tmp = (2.0 * c) / (b * -2.0) else: tmp = (-b - b) / (a * 2.0) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.2e-45) tmp = Float64(Float64(-b) / a); elseif (b <= -2.9e-261) tmp_1 = 0.0 if (b >= 0.0) tmp_1 = Float64(b / a); else tmp_1 = Float64(Float64(sqrt(Float64(-4.0 * Float64(a * c))) - b) / Float64(a * 2.0)); end tmp = tmp_1; elseif (b >= 0.0) tmp = Float64(Float64(2.0 * c) / Float64(b * -2.0)); else tmp = Float64(Float64(Float64(-b) - b) / Float64(a * 2.0)); end return tmp end
function tmp_3 = code(a, b, c) tmp = 0.0; if (b <= -1.2e-45) tmp = -b / a; elseif (b <= -2.9e-261) tmp_2 = 0.0; if (b >= 0.0) tmp_2 = b / a; else tmp_2 = (sqrt((-4.0 * (a * c))) - b) / (a * 2.0); end tmp = tmp_2; elseif (b >= 0.0) tmp = (2.0 * c) / (b * -2.0); else tmp = (-b - b) / (a * 2.0); end tmp_3 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.2e-45], N[((-b) / a), $MachinePrecision], If[LessEqual[b, -2.9e-261], If[GreaterEqual[b, 0.0], N[(b / a), $MachinePrecision], N[(N[(N[Sqrt[N[(-4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[(b * -2.0), $MachinePrecision]), $MachinePrecision], N[(N[((-b) - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.2 \cdot 10^{-45}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{elif}\;b \leq -2.9 \cdot 10^{-261}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-4 \cdot \left(a \cdot c\right)} - b}{a \cdot 2}\\
\end{array}\\
\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{b \cdot -2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) - b}{a \cdot 2}\\
\end{array}
\end{array}
if b < -1.19999999999999995e-45Initial program 66.9%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6489.4
Simplified89.4%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6489.4
Simplified89.4%
lift->=.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-neg.f64N/A
count-2N/A
times-fracN/A
metadata-evalN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f6489.4
if-same89.4
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6489.4
Applied egg-rr89.4%
if -1.19999999999999995e-45 < b < -2.89999999999999985e-261Initial program 76.7%
Taylor expanded in a around 0
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6476.7
Simplified76.7%
Taylor expanded in c around inf
lower-/.f6476.7
Simplified76.7%
Taylor expanded in b around 0
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.7
Simplified61.7%
if -2.89999999999999985e-261 < b Initial program 66.1%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6466.1
Simplified66.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6460.8
Simplified60.8%
Final simplification70.6%
(FPCore (a b c) :precision binary64 (if (<= b -3.4e-288) (/ (- b) a) (- (/ b a) (/ b a))))
double code(double a, double b, double c) {
double tmp;
if (b <= -3.4e-288) {
tmp = -b / a;
} else {
tmp = (b / a) - (b / 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) :: tmp
if (b <= (-3.4d-288)) then
tmp = -b / a
else
tmp = (b / a) - (b / a)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -3.4e-288) {
tmp = -b / a;
} else {
tmp = (b / a) - (b / a);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -3.4e-288: tmp = -b / a else: tmp = (b / a) - (b / a) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -3.4e-288) tmp = Float64(Float64(-b) / a); else tmp = Float64(Float64(b / a) - Float64(b / a)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -3.4e-288) tmp = -b / a; else tmp = (b / a) - (b / a); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -3.4e-288], N[((-b) / a), $MachinePrecision], N[(N[(b / a), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.4 \cdot 10^{-288}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{a} - \frac{b}{a}\\
\end{array}
\end{array}
if b < -3.39999999999999972e-288Initial program 68.9%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6471.9
Simplified71.9%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6471.9
Simplified71.9%
lift->=.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-neg.f64N/A
count-2N/A
times-fracN/A
metadata-evalN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f6471.9
if-same71.9
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6471.9
Applied egg-rr71.9%
if -3.39999999999999972e-288 < b Initial program 66.5%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6466.5
Simplified66.5%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f643.1
Simplified3.1%
Applied egg-rr12.2%
(FPCore (a b c) :precision binary64 (if (<= b 1.1e-308) (/ (- b) a) (/ a (* a (* a (+ b b))))))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.1e-308) {
tmp = -b / a;
} else {
tmp = a / (a * (a * (b + b)));
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 1.1d-308) then
tmp = -b / a
else
tmp = a / (a * (a * (b + b)))
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 1.1e-308) {
tmp = -b / a;
} else {
tmp = a / (a * (a * (b + b)));
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.1e-308: tmp = -b / a else: tmp = a / (a * (a * (b + b))) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.1e-308) tmp = Float64(Float64(-b) / a); else tmp = Float64(a / Float64(a * Float64(a * Float64(b + b)))); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 1.1e-308) tmp = -b / a; else tmp = a / (a * (a * (b + b))); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.1e-308], N[((-b) / a), $MachinePrecision], N[(a / N[(a * N[(a * N[(b + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.1 \cdot 10^{-308}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{a \cdot \left(a \cdot \left(b + b\right)\right)}\\
\end{array}
\end{array}
if b < 1.1000000000000001e-308Initial program 67.8%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6470.8
Simplified70.8%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6470.8
Simplified70.8%
lift->=.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-neg.f64N/A
count-2N/A
times-fracN/A
metadata-evalN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f6470.8
if-same70.8
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6470.8
Applied egg-rr70.8%
if 1.1000000000000001e-308 < b Initial program 67.4%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6467.4
Simplified67.4%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f643.1
Simplified3.1%
Applied egg-rr5.8%
lift-+.f64N/A
lift-*.f64N/A
mul0-lftN/A
lift-neg.f64N/A
neg-sub0N/A
lift-neg.f64N/A
remove-double-neg11.1
Applied egg-rr11.1%
(FPCore (a b c) :precision binary64 (if (<= b 9.2e-289) (/ (- b) a) (/ -1.0 (* a (* a (+ b b))))))
double code(double a, double b, double c) {
double tmp;
if (b <= 9.2e-289) {
tmp = -b / a;
} else {
tmp = -1.0 / (a * (a * (b + b)));
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 9.2d-289) then
tmp = -b / a
else
tmp = (-1.0d0) / (a * (a * (b + b)))
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 9.2e-289) {
tmp = -b / a;
} else {
tmp = -1.0 / (a * (a * (b + b)));
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 9.2e-289: tmp = -b / a else: tmp = -1.0 / (a * (a * (b + b))) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 9.2e-289) tmp = Float64(Float64(-b) / a); else tmp = Float64(-1.0 / Float64(a * Float64(a * Float64(b + b)))); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 9.2e-289) tmp = -b / a; else tmp = -1.0 / (a * (a * (b + b))); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 9.2e-289], N[((-b) / a), $MachinePrecision], N[(-1.0 / N[(a * N[(a * N[(b + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 9.2 \cdot 10^{-289}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{a \cdot \left(a \cdot \left(b + b\right)\right)}\\
\end{array}
\end{array}
if b < 9.2000000000000007e-289Initial program 68.1%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6470.8
Simplified70.8%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6465.5
Simplified65.5%
lift->=.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-neg.f64N/A
count-2N/A
times-fracN/A
metadata-evalN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f6465.5
if-same65.5
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6465.5
Applied egg-rr65.5%
if 9.2000000000000007e-289 < b Initial program 67.1%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6467.1
Simplified67.1%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f643.2
Simplified3.2%
Applied egg-rr8.7%
flip-+N/A
lift-*.f64N/A
lift-*.f64N/A
+-inversesN/A
mul0-lftN/A
mul0-lftN/A
lift-*.f64N/A
+-inversesN/A
mul0-lftN/A
lift-*.f64N/A
associate-*l/N/A
Applied egg-rr11.3%
Final simplification38.8%
(FPCore (a b c) :precision binary64 (if (>= b 0.0) (/ (* 2.0 c) (* b -2.0)) (/ (- (- b) b) (* a 2.0))))
double code(double a, double b, double c) {
double tmp;
if (b >= 0.0) {
tmp = (2.0 * c) / (b * -2.0);
} else {
tmp = (-b - b) / (a * 2.0);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b >= 0.0d0) then
tmp = (2.0d0 * c) / (b * (-2.0d0))
else
tmp = (-b - b) / (a * 2.0d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b >= 0.0) {
tmp = (2.0 * c) / (b * -2.0);
} else {
tmp = (-b - b) / (a * 2.0);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b >= 0.0: tmp = (2.0 * c) / (b * -2.0) else: tmp = (-b - b) / (a * 2.0) return tmp
function code(a, b, c) tmp = 0.0 if (b >= 0.0) tmp = Float64(Float64(2.0 * c) / Float64(b * -2.0)); else tmp = Float64(Float64(Float64(-b) - b) / Float64(a * 2.0)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b >= 0.0) tmp = (2.0 * c) / (b * -2.0); else tmp = (-b - b) / (a * 2.0); end tmp_2 = tmp; end
code[a_, b_, c_] := If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[(b * -2.0), $MachinePrecision]), $MachinePrecision], N[(N[((-b) - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{b \cdot -2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) - b}{a \cdot 2}\\
\end{array}
\end{array}
Initial program 67.6%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6469.0
Simplified69.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6466.1
Simplified66.1%
Final simplification66.1%
(FPCore (a b c) :precision binary64 (if (<= b 1.1e-308) (/ (- b) a) (/ 0.5 (* b a))))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.1e-308) {
tmp = -b / a;
} else {
tmp = 0.5 / (b * 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) :: tmp
if (b <= 1.1d-308) then
tmp = -b / a
else
tmp = 0.5d0 / (b * a)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 1.1e-308) {
tmp = -b / a;
} else {
tmp = 0.5 / (b * a);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.1e-308: tmp = -b / a else: tmp = 0.5 / (b * a) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.1e-308) tmp = Float64(Float64(-b) / a); else tmp = Float64(0.5 / Float64(b * a)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 1.1e-308) tmp = -b / a; else tmp = 0.5 / (b * a); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.1e-308], N[((-b) / a), $MachinePrecision], N[(0.5 / N[(b * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.1 \cdot 10^{-308}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{b \cdot a}\\
\end{array}
\end{array}
if b < 1.1000000000000001e-308Initial program 67.8%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6470.8
Simplified70.8%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6470.8
Simplified70.8%
lift->=.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-neg.f64N/A
count-2N/A
times-fracN/A
metadata-evalN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f6470.8
if-same70.8
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6470.8
Applied egg-rr70.8%
if 1.1000000000000001e-308 < b Initial program 67.4%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6467.4
Simplified67.4%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f643.1
Simplified3.1%
Applied egg-rr5.8%
Taylor expanded in a around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f649.2
Simplified9.2%
(FPCore (a b c) :precision binary64 (if (<= b 1.1e-308) (/ (- b) a) (/ a (+ b b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.1e-308) {
tmp = -b / a;
} else {
tmp = a / (b + b);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 1.1d-308) then
tmp = -b / a
else
tmp = a / (b + b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 1.1e-308) {
tmp = -b / a;
} else {
tmp = a / (b + b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.1e-308: tmp = -b / a else: tmp = a / (b + b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.1e-308) tmp = Float64(Float64(-b) / a); else tmp = Float64(a / Float64(b + b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 1.1e-308) tmp = -b / a; else tmp = a / (b + b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.1e-308], N[((-b) / a), $MachinePrecision], N[(a / N[(b + b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.1 \cdot 10^{-308}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{b + b}\\
\end{array}
\end{array}
if b < 1.1000000000000001e-308Initial program 67.8%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6470.8
Simplified70.8%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6470.8
Simplified70.8%
lift->=.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-neg.f64N/A
count-2N/A
times-fracN/A
metadata-evalN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f6470.8
if-same70.8
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6470.8
Applied egg-rr70.8%
if 1.1000000000000001e-308 < b Initial program 67.4%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6467.4
Simplified67.4%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f643.1
Simplified3.1%
Applied egg-rr5.8%
lift-+.f64N/A
lift-*.f64N/A
mul0-lftN/A
lift-neg.f64N/A
neg-sub0N/A
lift-neg.f64N/A
remove-double-negN/A
lift-+.f64N/A
*-commutativeN/A
lift-+.f64N/A
flip-+N/A
lift-*.f64N/A
lift-*.f64N/A
+-inversesN/A
mul0-lftN/A
lift-*.f64N/A
+-inversesN/A
mul0-lftN/A
lift-*.f64N/A
associate-*l/N/A
Applied egg-rr9.1%
(FPCore (a b c) :precision binary64 (if (<= b 4.3e+148) (/ (- b) a) (* (+ b b) (* a a))))
double code(double a, double b, double c) {
double tmp;
if (b <= 4.3e+148) {
tmp = -b / a;
} else {
tmp = (b + b) * (a * 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) :: tmp
if (b <= 4.3d+148) then
tmp = -b / a
else
tmp = (b + b) * (a * a)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 4.3e+148) {
tmp = -b / a;
} else {
tmp = (b + b) * (a * a);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 4.3e+148: tmp = -b / a else: tmp = (b + b) * (a * a) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 4.3e+148) tmp = Float64(Float64(-b) / a); else tmp = Float64(Float64(b + b) * Float64(a * a)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 4.3e+148) tmp = -b / a; else tmp = (b + b) * (a * a); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 4.3e+148], N[((-b) / a), $MachinePrecision], N[(N[(b + b), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.3 \cdot 10^{+148}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(b + b\right) \cdot \left(a \cdot a\right)\\
\end{array}
\end{array}
if b < 4.3000000000000002e148Initial program 74.4%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6476.1
Simplified76.1%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6442.1
Simplified42.1%
lift->=.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-neg.f64N/A
count-2N/A
times-fracN/A
metadata-evalN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
lift-neg.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f6442.1
if-same42.1
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f6442.1
Applied egg-rr42.1%
if 4.3000000000000002e148 < b Initial program 37.3%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6437.3
Simplified37.3%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f642.4
Simplified2.4%
Applied egg-rr6.9%
Applied egg-rr15.2%
(FPCore (a b c) :precision binary64 (* (+ b b) (* a a)))
double code(double a, double b, double c) {
return (b + b) * (a * a);
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (b + b) * (a * a)
end function
public static double code(double a, double b, double c) {
return (b + b) * (a * a);
}
def code(a, b, c): return (b + b) * (a * a)
function code(a, b, c) return Float64(Float64(b + b) * Float64(a * a)) end
function tmp = code(a, b, c) tmp = (b + b) * (a * a); end
code[a_, b_, c_] := N[(N[(b + b), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(b + b\right) \cdot \left(a \cdot a\right)
\end{array}
Initial program 67.6%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6469.0
Simplified69.0%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6434.8
Simplified34.8%
Applied egg-rr3.5%
Applied egg-rr4.7%
(FPCore (a b c) :precision binary64 (* b -2.0))
double code(double a, double b, double c) {
return b * -2.0;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = b * (-2.0d0)
end function
public static double code(double a, double b, double c) {
return b * -2.0;
}
def code(a, b, c): return b * -2.0
function code(a, b, c) return Float64(b * -2.0) end
function tmp = code(a, b, c) tmp = b * -2.0; end
code[a_, b_, c_] := N[(b * -2.0), $MachinePrecision]
\begin{array}{l}
\\
b \cdot -2
\end{array}
Initial program 67.6%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6469.0
Simplified69.0%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6434.8
Simplified34.8%
Applied egg-rr6.4%
lift-+.f64N/A
lift-*.f64N/A
div-invN/A
mul-1-negN/A
lift-*.f64N/A
lift-+.f64N/A
flip-+N/A
lift-*.f64N/A
lift-*.f64N/A
+-inversesN/A
mul0-lftN/A
lift-*.f64N/A
+-inversesN/A
mul0-lftN/A
lift-*.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
mul0-lftN/A
mul0-lftN/A
+-inversesN/A
lift-*.f64N/A
mul0-lftN/A
+-inversesN/A
lift-*.f64N/A
lift-*.f64N/A
Applied egg-rr3.3%
Final simplification3.3%
(FPCore (a b c) :precision binary64 (+ b b))
double code(double a, double b, double c) {
return b + b;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = b + b
end function
public static double code(double a, double b, double c) {
return b + b;
}
def code(a, b, c): return b + b
function code(a, b, c) return Float64(b + b) end
function tmp = code(a, b, c) tmp = b + b; end
code[a_, b_, c_] := N[(b + b), $MachinePrecision]
\begin{array}{l}
\\
b + b
\end{array}
Initial program 67.6%
Taylor expanded in b around -inf
mul-1-negN/A
lower-neg.f6469.0
Simplified69.0%
Taylor expanded in b around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6434.8
Simplified34.8%
Applied egg-rr3.5%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
div-invN/A
lift--.f64N/A
lift-*.f64N/A
mul0-lftN/A
neg-sub0N/A
lift-neg.f64N/A
remove-double-negN/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
flip-+N/A
Applied egg-rr3.0%
herbie shell --seed 2024208
(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))))