
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) + sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) + sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0}
\end{array}
\end{array}
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= (pow B 2.0) 5e+104)
(/
(*
(sqrt (* 2.0 (* F (+ (* B B) (* -4.0 (* A C))))))
(- (sqrt (+ A (+ C (hypot B (- A C)))))))
(- (* B B) (* (* A C) 4.0)))
(* (/ (sqrt 2.0) B) (* (sqrt F) (- (sqrt (+ C (hypot C B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (pow(B, 2.0) <= 5e+104) {
tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
} else {
tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((C + hypot(C, B))));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (Math.pow(B, 2.0) <= 5e+104) {
tmp = (Math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -Math.sqrt((A + (C + Math.hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
} else {
tmp = (Math.sqrt(2.0) / B) * (Math.sqrt(F) * -Math.sqrt((C + Math.hypot(C, B))));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if math.pow(B, 2.0) <= 5e+104: tmp = (math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -math.sqrt((A + (C + math.hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0)) else: tmp = (math.sqrt(2.0) / B) * (math.sqrt(F) * -math.sqrt((C + math.hypot(C, B)))) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if ((B ^ 2.0) <= 5e+104) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))))) * Float64(-sqrt(Float64(A + Float64(C + hypot(B, Float64(A - C))))))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0))); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(F) * Float64(-sqrt(Float64(C + hypot(C, B)))))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if ((B ^ 2.0) <= 5e+104) tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0)); else tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((C + hypot(C, B)))); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5e+104], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{+104}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{C + \mathsf{hypot}\left(C, B\right)}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 4.9999999999999997e104Initial program 33.5%
Simplified33.5%
sqrt-prod37.0%
*-commutative37.0%
cancel-sign-sub-inv37.0%
metadata-eval37.0%
associate-+l+37.1%
unpow237.1%
hypot-udef51.4%
Applied egg-rr51.4%
if 4.9999999999999997e104 < (pow.f64 B 2) Initial program 9.9%
Simplified9.9%
Taylor expanded in A around 0 8.2%
mul-1-neg8.2%
distribute-rgt-neg-in8.2%
+-commutative8.2%
unpow28.2%
unpow28.2%
hypot-def22.6%
Simplified22.6%
sqrt-prod38.4%
Applied egg-rr38.4%
Final simplification45.8%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (sqrt 2.0))))
(if (<= B 3.5e+152)
(/
(*
(sqrt (* 2.0 (* F (+ (* B B) (* -4.0 (* A C))))))
(- (sqrt (+ A (+ C (hypot B (- A C)))))))
(- (* B B) (* (* A C) 4.0)))
(if (<= B 1.75e+214)
(* (sqrt (/ F B)) t_0)
(* (sqrt (* F (+ A (hypot B A)))) (/ t_0 B))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = -sqrt(2.0);
double tmp;
if (B <= 3.5e+152) {
tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
} else if (B <= 1.75e+214) {
tmp = sqrt((F / B)) * t_0;
} else {
tmp = sqrt((F * (A + hypot(B, A)))) * (t_0 / B);
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = -Math.sqrt(2.0);
double tmp;
if (B <= 3.5e+152) {
tmp = (Math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -Math.sqrt((A + (C + Math.hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
} else if (B <= 1.75e+214) {
tmp = Math.sqrt((F / B)) * t_0;
} else {
tmp = Math.sqrt((F * (A + Math.hypot(B, A)))) * (t_0 / B);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = -math.sqrt(2.0) tmp = 0 if B <= 3.5e+152: tmp = (math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -math.sqrt((A + (C + math.hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0)) elif B <= 1.75e+214: tmp = math.sqrt((F / B)) * t_0 else: tmp = math.sqrt((F * (A + math.hypot(B, A)))) * (t_0 / B) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(-sqrt(2.0)) tmp = 0.0 if (B <= 3.5e+152) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))))) * Float64(-sqrt(Float64(A + Float64(C + hypot(B, Float64(A - C))))))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0))); elseif (B <= 1.75e+214) tmp = Float64(sqrt(Float64(F / B)) * t_0); else tmp = Float64(sqrt(Float64(F * Float64(A + hypot(B, A)))) * Float64(t_0 / B)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = -sqrt(2.0); tmp = 0.0; if (B <= 3.5e+152) tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0)); elseif (B <= 1.75e+214) tmp = sqrt((F / B)) * t_0; else tmp = sqrt((F * (A + hypot(B, A)))) * (t_0 / B); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = (-N[Sqrt[2.0], $MachinePrecision])}, If[LessEqual[B, 3.5e+152], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.75e+214], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := -\sqrt{2}\\
\mathbf{if}\;B \leq 3.5 \cdot 10^{+152}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\
\mathbf{elif}\;B \leq 1.75 \cdot 10^{+214}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)} \cdot \frac{t_0}{B}\\
\end{array}
\end{array}
if B < 3.49999999999999981e152Initial program 27.4%
Simplified27.4%
sqrt-prod31.0%
*-commutative31.0%
cancel-sign-sub-inv31.0%
metadata-eval31.0%
associate-+l+31.1%
unpow231.1%
hypot-udef42.5%
Applied egg-rr42.5%
if 3.49999999999999981e152 < B < 1.75e214Initial program 0.0%
Simplified0.0%
Taylor expanded in A around 0 2.4%
mul-1-neg2.4%
distribute-rgt-neg-in2.4%
+-commutative2.4%
unpow22.4%
unpow22.4%
hypot-def19.6%
Simplified19.6%
Taylor expanded in C around 0 63.1%
mul-1-neg63.1%
*-commutative63.1%
distribute-rgt-neg-in63.1%
Simplified63.1%
if 1.75e214 < B Initial program 0.0%
Simplified0.0%
Taylor expanded in C around 0 2.3%
mul-1-neg2.3%
distribute-rgt-neg-in2.3%
+-commutative2.3%
unpow22.3%
unpow22.3%
hypot-def53.4%
Simplified53.4%
Final simplification44.6%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C)))) (t_1 (- (sqrt 2.0))))
(if (<= B 7.2e+100)
(/ (- (sqrt (* 2.0 (* (* F t_0) (+ A (+ C (hypot B (- A C)))))))) t_0)
(if (<= B 1.8e+214)
(* (sqrt (/ F B)) t_1)
(* (sqrt (* F (+ A (hypot B A)))) (/ t_1 B))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = -sqrt(2.0);
double tmp;
if (B <= 7.2e+100) {
tmp = -sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) / t_0;
} else if (B <= 1.8e+214) {
tmp = sqrt((F / B)) * t_1;
} else {
tmp = sqrt((F * (A + hypot(B, A)))) * (t_1 / B);
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = -Math.sqrt(2.0);
double tmp;
if (B <= 7.2e+100) {
tmp = -Math.sqrt((2.0 * ((F * t_0) * (A + (C + Math.hypot(B, (A - C))))))) / t_0;
} else if (B <= 1.8e+214) {
tmp = Math.sqrt((F / B)) * t_1;
} else {
tmp = Math.sqrt((F * (A + Math.hypot(B, A)))) * (t_1 / B);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) t_1 = -math.sqrt(2.0) tmp = 0 if B <= 7.2e+100: tmp = -math.sqrt((2.0 * ((F * t_0) * (A + (C + math.hypot(B, (A - C))))))) / t_0 elif B <= 1.8e+214: tmp = math.sqrt((F / B)) * t_1 else: tmp = math.sqrt((F * (A + math.hypot(B, A)))) * (t_1 / B) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) t_1 = Float64(-sqrt(2.0)) tmp = 0.0 if (B <= 7.2e+100) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(C + hypot(B, Float64(A - C)))))))) / t_0); elseif (B <= 1.8e+214) tmp = Float64(sqrt(Float64(F / B)) * t_1); else tmp = Float64(sqrt(Float64(F * Float64(A + hypot(B, A)))) * Float64(t_1 / B)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); t_1 = -sqrt(2.0); tmp = 0.0; if (B <= 7.2e+100) tmp = -sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) / t_0; elseif (B <= 1.8e+214) tmp = sqrt((F / B)) * t_1; else tmp = sqrt((F * (A + hypot(B, A)))) * (t_1 / B); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[Sqrt[2.0], $MachinePrecision])}, If[LessEqual[B, 7.2e+100], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 1.8e+214], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
t_1 := -\sqrt{2}\\
\mathbf{if}\;B \leq 7.2 \cdot 10^{+100}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 1.8 \cdot 10^{+214}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)} \cdot \frac{t_1}{B}\\
\end{array}
\end{array}
if B < 7.2e100Initial program 27.5%
Simplified27.5%
distribute-frac-neg27.5%
Applied egg-rr36.9%
if 7.2e100 < B < 1.8000000000000001e214Initial program 15.3%
Simplified15.3%
Taylor expanded in A around 0 23.5%
mul-1-neg23.5%
distribute-rgt-neg-in23.5%
+-commutative23.5%
unpow223.5%
unpow223.5%
hypot-def32.6%
Simplified32.6%
Taylor expanded in C around 0 50.7%
mul-1-neg50.7%
*-commutative50.7%
distribute-rgt-neg-in50.7%
Simplified50.7%
if 1.8000000000000001e214 < B Initial program 0.0%
Simplified0.0%
Taylor expanded in C around 0 2.3%
mul-1-neg2.3%
distribute-rgt-neg-in2.3%
+-commutative2.3%
unpow22.3%
unpow22.3%
hypot-def53.4%
Simplified53.4%
Final simplification40.0%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
(if (<= B 3.2e+96)
(/ (- (sqrt (* 2.0 (* (* F t_0) (+ A (+ C (hypot B (- A C)))))))) t_0)
(if (<= B 2.9e+237)
(* (sqrt (/ F B)) (- (sqrt 2.0)))
(* (/ (sqrt 2.0) B) (- (sqrt (* B F))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double tmp;
if (B <= 3.2e+96) {
tmp = -sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) / t_0;
} else if (B <= 2.9e+237) {
tmp = sqrt((F / B)) * -sqrt(2.0);
} else {
tmp = (sqrt(2.0) / B) * -sqrt((B * F));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double tmp;
if (B <= 3.2e+96) {
tmp = -Math.sqrt((2.0 * ((F * t_0) * (A + (C + Math.hypot(B, (A - C))))))) / t_0;
} else if (B <= 2.9e+237) {
tmp = Math.sqrt((F / B)) * -Math.sqrt(2.0);
} else {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((B * F));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) tmp = 0 if B <= 3.2e+96: tmp = -math.sqrt((2.0 * ((F * t_0) * (A + (C + math.hypot(B, (A - C))))))) / t_0 elif B <= 2.9e+237: tmp = math.sqrt((F / B)) * -math.sqrt(2.0) else: tmp = (math.sqrt(2.0) / B) * -math.sqrt((B * F)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) tmp = 0.0 if (B <= 3.2e+96) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(C + hypot(B, Float64(A - C)))))))) / t_0); elseif (B <= 2.9e+237) tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0))); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(B * F)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); tmp = 0.0; if (B <= 3.2e+96) tmp = -sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) / t_0; elseif (B <= 2.9e+237) tmp = sqrt((F / B)) * -sqrt(2.0); else tmp = (sqrt(2.0) / B) * -sqrt((B * F)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 3.2e+96], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 2.9e+237], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 3.2 \cdot 10^{+96}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 2.9 \cdot 10^{+237}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\
\end{array}
\end{array}
if B < 3.20000000000000006e96Initial program 27.5%
Simplified27.5%
distribute-frac-neg27.5%
Applied egg-rr36.9%
if 3.20000000000000006e96 < B < 2.9000000000000001e237Initial program 11.6%
Simplified11.6%
Taylor expanded in A around 0 18.4%
mul-1-neg18.4%
distribute-rgt-neg-in18.4%
+-commutative18.4%
unpow218.4%
unpow218.4%
hypot-def37.3%
Simplified37.3%
Taylor expanded in C around 0 55.0%
mul-1-neg55.0%
*-commutative55.0%
distribute-rgt-neg-in55.0%
Simplified55.0%
if 2.9000000000000001e237 < B Initial program 0.0%
Simplified0.0%
Taylor expanded in A around 0 2.3%
mul-1-neg2.3%
distribute-rgt-neg-in2.3%
+-commutative2.3%
unpow22.3%
unpow22.3%
hypot-def51.2%
Simplified51.2%
Taylor expanded in C around 0 51.3%
*-commutative51.3%
Simplified51.3%
Final simplification40.4%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C)))) (t_1 (* F t_0)))
(if (<= C -65000000.0)
(/ (- (sqrt (* 2.0 (* t_1 (+ A (+ A (* -0.5 (/ (* B B) C)))))))) t_0)
(if (<= C 6e-50)
(* (/ (sqrt 2.0) B) (- (sqrt (* B F))))
(/ (- (sqrt (* 2.0 (* t_1 (+ C (hypot C B)))))) t_0)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = F * t_0;
double tmp;
if (C <= -65000000.0) {
tmp = -sqrt((2.0 * (t_1 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0;
} else if (C <= 6e-50) {
tmp = (sqrt(2.0) / B) * -sqrt((B * F));
} else {
tmp = -sqrt((2.0 * (t_1 * (C + hypot(C, B))))) / t_0;
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = F * t_0;
double tmp;
if (C <= -65000000.0) {
tmp = -Math.sqrt((2.0 * (t_1 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0;
} else if (C <= 6e-50) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((B * F));
} else {
tmp = -Math.sqrt((2.0 * (t_1 * (C + Math.hypot(C, B))))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) t_1 = F * t_0 tmp = 0 if C <= -65000000.0: tmp = -math.sqrt((2.0 * (t_1 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0 elif C <= 6e-50: tmp = (math.sqrt(2.0) / B) * -math.sqrt((B * F)) else: tmp = -math.sqrt((2.0 * (t_1 * (C + math.hypot(C, B))))) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) t_1 = Float64(F * t_0) tmp = 0.0 if (C <= -65000000.0) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(A + Float64(A + Float64(-0.5 * Float64(Float64(B * B) / C)))))))) / t_0); elseif (C <= 6e-50) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(B * F)))); else tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(C + hypot(C, B)))))) / t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); t_1 = F * t_0; tmp = 0.0; if (C <= -65000000.0) tmp = -sqrt((2.0 * (t_1 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0; elseif (C <= 6e-50) tmp = (sqrt(2.0) / B) * -sqrt((B * F)); else tmp = -sqrt((2.0 * (t_1 * (C + hypot(C, B))))) / t_0; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F * t$95$0), $MachinePrecision]}, If[LessEqual[C, -65000000.0], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(A + N[(A + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[C, 6e-50], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
t_1 := F \cdot t_0\\
\mathbf{if}\;C \leq -65000000:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(A + \left(A + -0.5 \cdot \frac{B \cdot B}{C}\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;C \leq 6 \cdot 10^{-50}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}}{t_0}\\
\end{array}
\end{array}
if C < -6.5e7Initial program 6.6%
Simplified6.6%
distribute-frac-neg6.6%
Applied egg-rr12.6%
Taylor expanded in C around -inf 42.3%
unpow242.3%
Simplified42.3%
if -6.5e7 < C < 5.99999999999999981e-50Initial program 29.2%
Simplified29.2%
Taylor expanded in A around 0 12.4%
mul-1-neg12.4%
distribute-rgt-neg-in12.4%
+-commutative12.4%
unpow212.4%
unpow212.4%
hypot-def22.3%
Simplified22.3%
Taylor expanded in C around 0 21.2%
*-commutative21.2%
Simplified21.2%
if 5.99999999999999981e-50 < C Initial program 27.2%
Simplified27.2%
distribute-frac-neg27.2%
Applied egg-rr40.8%
Taylor expanded in A around 0 24.8%
+-commutative24.8%
unpow224.8%
unpow224.8%
hypot-def37.2%
Simplified37.2%
Final simplification30.8%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= F 1.8e-308)
(*
(sqrt (* 2.0 (* (+ A (+ C (hypot B (- A C)))) (* -4.0 (* A (* F C))))))
(/ -1.0 (+ (* B B) (* -4.0 (* A C)))))
(if (<= F 2.7e-53)
(* (/ (sqrt 2.0) B) (- (sqrt (* B F))))
(* (sqrt (/ F B)) (- (sqrt 2.0))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= 1.8e-308) {
tmp = sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (-4.0 * (A * (F * C)))))) * (-1.0 / ((B * B) + (-4.0 * (A * C))));
} else if (F <= 2.7e-53) {
tmp = (sqrt(2.0) / B) * -sqrt((B * F));
} else {
tmp = sqrt((F / B)) * -sqrt(2.0);
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (F <= 1.8e-308) {
tmp = Math.sqrt((2.0 * ((A + (C + Math.hypot(B, (A - C)))) * (-4.0 * (A * (F * C)))))) * (-1.0 / ((B * B) + (-4.0 * (A * C))));
} else if (F <= 2.7e-53) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((B * F));
} else {
tmp = Math.sqrt((F / B)) * -Math.sqrt(2.0);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if F <= 1.8e-308: tmp = math.sqrt((2.0 * ((A + (C + math.hypot(B, (A - C)))) * (-4.0 * (A * (F * C)))))) * (-1.0 / ((B * B) + (-4.0 * (A * C)))) elif F <= 2.7e-53: tmp = (math.sqrt(2.0) / B) * -math.sqrt((B * F)) else: tmp = math.sqrt((F / B)) * -math.sqrt(2.0) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= 1.8e-308) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(A + Float64(C + hypot(B, Float64(A - C)))) * Float64(-4.0 * Float64(A * Float64(F * C)))))) * Float64(-1.0 / Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))))); elseif (F <= 2.7e-53) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(B * F)))); else tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (F <= 1.8e-308) tmp = sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (-4.0 * (A * (F * C)))))) * (-1.0 / ((B * B) + (-4.0 * (A * C)))); elseif (F <= 2.7e-53) tmp = (sqrt(2.0) / B) * -sqrt((B * F)); else tmp = sqrt((F / B)) * -sqrt(2.0); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[F, 1.8e-308], N[(N[Sqrt[N[(2.0 * N[(N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-4.0 * N[(A * N[(F * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.7e-53], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.8 \cdot 10^{-308}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(-4 \cdot \left(A \cdot \left(F \cdot C\right)\right)\right)\right)} \cdot \frac{-1}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{-53}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\
\end{array}
\end{array}
if F < 1.7999999999999999e-308Initial program 31.0%
Simplified31.0%
div-inv30.9%
Applied egg-rr52.8%
Taylor expanded in B around 0 47.0%
if 1.7999999999999999e-308 < F < 2.6999999999999999e-53Initial program 22.9%
Simplified22.9%
Taylor expanded in A around 0 8.9%
mul-1-neg8.9%
distribute-rgt-neg-in8.9%
+-commutative8.9%
unpow28.9%
unpow28.9%
hypot-def20.3%
Simplified20.3%
Taylor expanded in C around 0 17.8%
*-commutative17.8%
Simplified17.8%
if 2.6999999999999999e-53 < F Initial program 21.2%
Simplified21.2%
Taylor expanded in A around 0 10.1%
mul-1-neg10.1%
distribute-rgt-neg-in10.1%
+-commutative10.1%
unpow210.1%
unpow210.1%
hypot-def16.0%
Simplified16.0%
Taylor expanded in C around 0 24.6%
mul-1-neg24.6%
*-commutative24.6%
distribute-rgt-neg-in24.6%
Simplified24.6%
Final simplification26.2%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
(if (<= C -145000000.0)
(/
(- (sqrt (* 2.0 (* (* F t_0) (+ A (+ A (* -0.5 (/ (* B B) C))))))))
t_0)
(if (<= C 1.25e+44)
(* (/ (sqrt 2.0) B) (- (sqrt (* B F))))
(/
(- (sqrt (* 4.0 (* (* F C) (fma B B (* C (* -4.0 A)))))))
(- (* B B) (* (* A C) 4.0)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double tmp;
if (C <= -145000000.0) {
tmp = -sqrt((2.0 * ((F * t_0) * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0;
} else if (C <= 1.25e+44) {
tmp = (sqrt(2.0) / B) * -sqrt((B * F));
} else {
tmp = -sqrt((4.0 * ((F * C) * fma(B, B, (C * (-4.0 * A)))))) / ((B * B) - ((A * C) * 4.0));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) tmp = 0.0 if (C <= -145000000.0) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(A + Float64(-0.5 * Float64(Float64(B * B) / C)))))))) / t_0); elseif (C <= 1.25e+44) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(B * F)))); else tmp = Float64(Float64(-sqrt(Float64(4.0 * Float64(Float64(F * C) * fma(B, B, Float64(C * Float64(-4.0 * A))))))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0))); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -145000000.0], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(A + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[C, 1.25e+44], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[((-N[Sqrt[N[(4.0 * N[(N[(F * C), $MachinePrecision] * N[(B * B + N[(C * N[(-4.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;C \leq -145000000:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(A + -0.5 \cdot \frac{B \cdot B}{C}\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;C \leq 1.25 \cdot 10^{+44}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{4 \cdot \left(\left(F \cdot C\right) \cdot \mathsf{fma}\left(B, B, C \cdot \left(-4 \cdot A\right)\right)\right)}}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\
\end{array}
\end{array}
if C < -1.45e8Initial program 6.6%
Simplified6.6%
distribute-frac-neg6.6%
Applied egg-rr12.6%
Taylor expanded in C around -inf 42.3%
unpow242.3%
Simplified42.3%
if -1.45e8 < C < 1.2499999999999999e44Initial program 31.3%
Simplified31.3%
Taylor expanded in A around 0 11.8%
mul-1-neg11.8%
distribute-rgt-neg-in11.8%
+-commutative11.8%
unpow211.8%
unpow211.8%
hypot-def20.5%
Simplified20.5%
Taylor expanded in C around 0 19.6%
*-commutative19.6%
Simplified19.6%
if 1.2499999999999999e44 < C Initial program 21.8%
Simplified21.8%
Taylor expanded in A around -inf 34.8%
mul-1-neg34.8%
sub-neg34.8%
Simplified34.8%
Taylor expanded in F around 0 36.1%
associate-*r*37.6%
*-commutative37.6%
unpow237.6%
fma-neg37.6%
distribute-lft-neg-in37.6%
metadata-eval37.6%
associate-*r*37.6%
Simplified37.6%
Final simplification29.0%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C)))) (t_1 (* F t_0)))
(if (<= C -104000000.0)
(/ (- (sqrt (* 2.0 (* t_1 (+ A (+ A (* -0.5 (/ (* B B) C)))))))) t_0)
(if (<= C 1.5e+50)
(* (/ (sqrt 2.0) B) (- (sqrt (* B F))))
(/ (- (sqrt (* 2.0 (* t_1 (+ C C))))) t_0)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = F * t_0;
double tmp;
if (C <= -104000000.0) {
tmp = -sqrt((2.0 * (t_1 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0;
} else if (C <= 1.5e+50) {
tmp = (sqrt(2.0) / B) * -sqrt((B * F));
} else {
tmp = -sqrt((2.0 * (t_1 * (C + C)))) / t_0;
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (b * b) + ((-4.0d0) * (a * c))
t_1 = f * t_0
if (c <= (-104000000.0d0)) then
tmp = -sqrt((2.0d0 * (t_1 * (a + (a + ((-0.5d0) * ((b * b) / c))))))) / t_0
else if (c <= 1.5d+50) then
tmp = (sqrt(2.0d0) / b) * -sqrt((b * f))
else
tmp = -sqrt((2.0d0 * (t_1 * (c + c)))) / t_0
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = F * t_0;
double tmp;
if (C <= -104000000.0) {
tmp = -Math.sqrt((2.0 * (t_1 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0;
} else if (C <= 1.5e+50) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((B * F));
} else {
tmp = -Math.sqrt((2.0 * (t_1 * (C + C)))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) t_1 = F * t_0 tmp = 0 if C <= -104000000.0: tmp = -math.sqrt((2.0 * (t_1 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0 elif C <= 1.5e+50: tmp = (math.sqrt(2.0) / B) * -math.sqrt((B * F)) else: tmp = -math.sqrt((2.0 * (t_1 * (C + C)))) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) t_1 = Float64(F * t_0) tmp = 0.0 if (C <= -104000000.0) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(A + Float64(A + Float64(-0.5 * Float64(Float64(B * B) / C)))))))) / t_0); elseif (C <= 1.5e+50) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(B * F)))); else tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(C + C))))) / t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); t_1 = F * t_0; tmp = 0.0; if (C <= -104000000.0) tmp = -sqrt((2.0 * (t_1 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0; elseif (C <= 1.5e+50) tmp = (sqrt(2.0) / B) * -sqrt((B * F)); else tmp = -sqrt((2.0 * (t_1 * (C + C)))) / t_0; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F * t$95$0), $MachinePrecision]}, If[LessEqual[C, -104000000.0], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(A + N[(A + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[C, 1.5e+50], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(C + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
t_1 := F \cdot t_0\\
\mathbf{if}\;C \leq -104000000:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(A + \left(A + -0.5 \cdot \frac{B \cdot B}{C}\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;C \leq 1.5 \cdot 10^{+50}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(C + C\right)\right)}}{t_0}\\
\end{array}
\end{array}
if C < -1.04e8Initial program 6.6%
Simplified6.6%
distribute-frac-neg6.6%
Applied egg-rr12.6%
Taylor expanded in C around -inf 42.3%
unpow242.3%
Simplified42.3%
if -1.04e8 < C < 1.4999999999999999e50Initial program 31.3%
Simplified31.3%
Taylor expanded in A around 0 11.8%
mul-1-neg11.8%
distribute-rgt-neg-in11.8%
+-commutative11.8%
unpow211.8%
unpow211.8%
hypot-def20.5%
Simplified20.5%
Taylor expanded in C around 0 19.6%
*-commutative19.6%
Simplified19.6%
if 1.4999999999999999e50 < C Initial program 21.8%
Simplified21.8%
distribute-frac-neg21.8%
Applied egg-rr39.4%
Taylor expanded in A around -inf 36.1%
count-236.1%
Simplified36.1%
Final simplification28.6%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C)))) (t_1 (* F t_0)))
(if (<= C -6.2e+17)
(/ (- (sqrt (* 2.0 (* t_1 (+ A (+ A (* -0.5 (/ (* B B) C)))))))) t_0)
(if (<= C 3.8e+31)
(* (sqrt (/ F B)) (- (sqrt 2.0)))
(/ (- (sqrt (* 2.0 (* t_1 (+ C C))))) t_0)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = F * t_0;
double tmp;
if (C <= -6.2e+17) {
tmp = -sqrt((2.0 * (t_1 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0;
} else if (C <= 3.8e+31) {
tmp = sqrt((F / B)) * -sqrt(2.0);
} else {
tmp = -sqrt((2.0 * (t_1 * (C + C)))) / t_0;
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (b * b) + ((-4.0d0) * (a * c))
t_1 = f * t_0
if (c <= (-6.2d+17)) then
tmp = -sqrt((2.0d0 * (t_1 * (a + (a + ((-0.5d0) * ((b * b) / c))))))) / t_0
else if (c <= 3.8d+31) then
tmp = sqrt((f / b)) * -sqrt(2.0d0)
else
tmp = -sqrt((2.0d0 * (t_1 * (c + c)))) / t_0
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = F * t_0;
double tmp;
if (C <= -6.2e+17) {
tmp = -Math.sqrt((2.0 * (t_1 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0;
} else if (C <= 3.8e+31) {
tmp = Math.sqrt((F / B)) * -Math.sqrt(2.0);
} else {
tmp = -Math.sqrt((2.0 * (t_1 * (C + C)))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) t_1 = F * t_0 tmp = 0 if C <= -6.2e+17: tmp = -math.sqrt((2.0 * (t_1 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0 elif C <= 3.8e+31: tmp = math.sqrt((F / B)) * -math.sqrt(2.0) else: tmp = -math.sqrt((2.0 * (t_1 * (C + C)))) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) t_1 = Float64(F * t_0) tmp = 0.0 if (C <= -6.2e+17) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(A + Float64(A + Float64(-0.5 * Float64(Float64(B * B) / C)))))))) / t_0); elseif (C <= 3.8e+31) tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0))); else tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(C + C))))) / t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); t_1 = F * t_0; tmp = 0.0; if (C <= -6.2e+17) tmp = -sqrt((2.0 * (t_1 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0; elseif (C <= 3.8e+31) tmp = sqrt((F / B)) * -sqrt(2.0); else tmp = -sqrt((2.0 * (t_1 * (C + C)))) / t_0; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F * t$95$0), $MachinePrecision]}, If[LessEqual[C, -6.2e+17], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(A + N[(A + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[C, 3.8e+31], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(C + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
t_1 := F \cdot t_0\\
\mathbf{if}\;C \leq -6.2 \cdot 10^{+17}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(A + \left(A + -0.5 \cdot \frac{B \cdot B}{C}\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;C \leq 3.8 \cdot 10^{+31}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(C + C\right)\right)}}{t_0}\\
\end{array}
\end{array}
if C < -6.2e17Initial program 5.0%
Simplified5.0%
distribute-frac-neg5.0%
Applied egg-rr11.2%
Taylor expanded in C around -inf 41.9%
unpow241.9%
Simplified41.9%
if -6.2e17 < C < 3.8000000000000001e31Initial program 31.5%
Simplified31.5%
Taylor expanded in A around 0 11.8%
mul-1-neg11.8%
distribute-rgt-neg-in11.8%
+-commutative11.8%
unpow211.8%
unpow211.8%
hypot-def20.6%
Simplified20.6%
Taylor expanded in C around 0 18.9%
mul-1-neg18.9%
*-commutative18.9%
distribute-rgt-neg-in18.9%
Simplified18.9%
if 3.8000000000000001e31 < C Initial program 22.4%
Simplified22.4%
distribute-frac-neg22.4%
Applied egg-rr39.2%
Taylor expanded in A around -inf 36.0%
count-236.0%
Simplified36.0%
Final simplification28.1%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C))))
(t_1 (- (* B B) (* (* A C) 4.0)))
(t_2 (* F t_0)))
(if (<= C -2.4e-34)
(/ (- (sqrt (* 2.0 (* t_2 (+ A (+ A (* -0.5 (/ (* B B) C)))))))) t_0)
(if (<= C -8.8e-132)
(/
(-
(sqrt (* (* 2.0 (* F t_1)) (+ A (+ (+ B C) (* 0.5 (/ (* A A) B)))))))
t_1)
(if (<= C -3.9e-203)
(/ (- (sqrt (* 2.0 (* t_2 (* 2.0 A))))) t_0)
(if (<= C 8e-41)
(/ (- (sqrt (* 2.0 (* t_2 (+ A (+ B C)))))) t_0)
(/ (- (sqrt (* 2.0 (* t_2 (+ C C))))) t_0)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = (B * B) - ((A * C) * 4.0);
double t_2 = F * t_0;
double tmp;
if (C <= -2.4e-34) {
tmp = -sqrt((2.0 * (t_2 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0;
} else if (C <= -8.8e-132) {
tmp = -sqrt(((2.0 * (F * t_1)) * (A + ((B + C) + (0.5 * ((A * A) / B)))))) / t_1;
} else if (C <= -3.9e-203) {
tmp = -sqrt((2.0 * (t_2 * (2.0 * A)))) / t_0;
} else if (C <= 8e-41) {
tmp = -sqrt((2.0 * (t_2 * (A + (B + C))))) / t_0;
} else {
tmp = -sqrt((2.0 * (t_2 * (C + C)))) / t_0;
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (b * b) + ((-4.0d0) * (a * c))
t_1 = (b * b) - ((a * c) * 4.0d0)
t_2 = f * t_0
if (c <= (-2.4d-34)) then
tmp = -sqrt((2.0d0 * (t_2 * (a + (a + ((-0.5d0) * ((b * b) / c))))))) / t_0
else if (c <= (-8.8d-132)) then
tmp = -sqrt(((2.0d0 * (f * t_1)) * (a + ((b + c) + (0.5d0 * ((a * a) / b)))))) / t_1
else if (c <= (-3.9d-203)) then
tmp = -sqrt((2.0d0 * (t_2 * (2.0d0 * a)))) / t_0
else if (c <= 8d-41) then
tmp = -sqrt((2.0d0 * (t_2 * (a + (b + c))))) / t_0
else
tmp = -sqrt((2.0d0 * (t_2 * (c + c)))) / t_0
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = (B * B) - ((A * C) * 4.0);
double t_2 = F * t_0;
double tmp;
if (C <= -2.4e-34) {
tmp = -Math.sqrt((2.0 * (t_2 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0;
} else if (C <= -8.8e-132) {
tmp = -Math.sqrt(((2.0 * (F * t_1)) * (A + ((B + C) + (0.5 * ((A * A) / B)))))) / t_1;
} else if (C <= -3.9e-203) {
tmp = -Math.sqrt((2.0 * (t_2 * (2.0 * A)))) / t_0;
} else if (C <= 8e-41) {
tmp = -Math.sqrt((2.0 * (t_2 * (A + (B + C))))) / t_0;
} else {
tmp = -Math.sqrt((2.0 * (t_2 * (C + C)))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) t_1 = (B * B) - ((A * C) * 4.0) t_2 = F * t_0 tmp = 0 if C <= -2.4e-34: tmp = -math.sqrt((2.0 * (t_2 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0 elif C <= -8.8e-132: tmp = -math.sqrt(((2.0 * (F * t_1)) * (A + ((B + C) + (0.5 * ((A * A) / B)))))) / t_1 elif C <= -3.9e-203: tmp = -math.sqrt((2.0 * (t_2 * (2.0 * A)))) / t_0 elif C <= 8e-41: tmp = -math.sqrt((2.0 * (t_2 * (A + (B + C))))) / t_0 else: tmp = -math.sqrt((2.0 * (t_2 * (C + C)))) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) t_1 = Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0)) t_2 = Float64(F * t_0) tmp = 0.0 if (C <= -2.4e-34) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_2 * Float64(A + Float64(A + Float64(-0.5 * Float64(Float64(B * B) / C)))))))) / t_0); elseif (C <= -8.8e-132) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_1)) * Float64(A + Float64(Float64(B + C) + Float64(0.5 * Float64(Float64(A * A) / B))))))) / t_1); elseif (C <= -3.9e-203) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_2 * Float64(2.0 * A))))) / t_0); elseif (C <= 8e-41) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_2 * Float64(A + Float64(B + C)))))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_2 * Float64(C + C))))) / t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); t_1 = (B * B) - ((A * C) * 4.0); t_2 = F * t_0; tmp = 0.0; if (C <= -2.4e-34) tmp = -sqrt((2.0 * (t_2 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0; elseif (C <= -8.8e-132) tmp = -sqrt(((2.0 * (F * t_1)) * (A + ((B + C) + (0.5 * ((A * A) / B)))))) / t_1; elseif (C <= -3.9e-203) tmp = -sqrt((2.0 * (t_2 * (2.0 * A)))) / t_0; elseif (C <= 8e-41) tmp = -sqrt((2.0 * (t_2 * (A + (B + C))))) / t_0; else tmp = -sqrt((2.0 * (t_2 * (C + C)))) / t_0; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(F * t$95$0), $MachinePrecision]}, If[LessEqual[C, -2.4e-34], N[((-N[Sqrt[N[(2.0 * N[(t$95$2 * N[(A + N[(A + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[C, -8.8e-132], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(A + N[(N[(B + C), $MachinePrecision] + N[(0.5 * N[(N[(A * A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[C, -3.9e-203], N[((-N[Sqrt[N[(2.0 * N[(t$95$2 * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[C, 8e-41], N[((-N[Sqrt[N[(2.0 * N[(t$95$2 * N[(A + N[(B + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(t$95$2 * N[(C + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
t_1 := B \cdot B - \left(A \cdot C\right) \cdot 4\\
t_2 := F \cdot t_0\\
\mathbf{if}\;C \leq -2.4 \cdot 10^{-34}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_2 \cdot \left(A + \left(A + -0.5 \cdot \frac{B \cdot B}{C}\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;C \leq -8.8 \cdot 10^{-132}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_1\right)\right) \cdot \left(A + \left(\left(B + C\right) + 0.5 \cdot \frac{A \cdot A}{B}\right)\right)}}{t_1}\\
\mathbf{elif}\;C \leq -3.9 \cdot 10^{-203}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_2 \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;C \leq 8 \cdot 10^{-41}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_2 \cdot \left(A + \left(B + C\right)\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_2 \cdot \left(C + C\right)\right)}}{t_0}\\
\end{array}
\end{array}
if C < -2.39999999999999991e-34Initial program 6.6%
Simplified6.6%
distribute-frac-neg6.6%
Applied egg-rr11.8%
Taylor expanded in C around -inf 38.4%
unpow238.4%
Simplified38.4%
if -2.39999999999999991e-34 < C < -8.79999999999999963e-132Initial program 37.1%
Simplified37.1%
Taylor expanded in C around 0 36.0%
+-commutative36.0%
unpow236.0%
unpow236.0%
hypot-def40.5%
Simplified40.5%
Taylor expanded in A around 0 14.5%
associate-+r+14.5%
+-commutative14.5%
unpow214.5%
Simplified14.5%
if -8.79999999999999963e-132 < C < -3.8999999999999999e-203Initial program 36.0%
Simplified36.0%
distribute-frac-neg36.0%
Applied egg-rr43.4%
Taylor expanded in A around inf 42.9%
if -3.8999999999999999e-203 < C < 8.00000000000000005e-41Initial program 30.8%
Simplified30.8%
distribute-frac-neg30.8%
Applied egg-rr36.0%
Taylor expanded in B around inf 13.7%
+-commutative13.7%
Simplified13.7%
if 8.00000000000000005e-41 < C Initial program 25.3%
Simplified25.3%
distribute-frac-neg25.3%
Applied egg-rr39.2%
Taylor expanded in A around -inf 33.1%
count-233.1%
Simplified33.1%
Final simplification27.8%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C))))
(t_1 (* F t_0))
(t_2 (/ (- (sqrt (* 2.0 (* t_1 (+ A (+ B C)))))) t_0)))
(if (<= C -4.6e-34)
(/ (- (sqrt (* 2.0 (* t_1 (+ A (+ A (* -0.5 (/ (* B B) C)))))))) t_0)
(if (<= C -5.3e-132)
t_2
(if (<= C -3.9e-203)
(/ (- (sqrt (* 2.0 (* t_1 (* 2.0 A))))) t_0)
(if (<= C 9.5e-41)
t_2
(/ (- (sqrt (* 2.0 (* t_1 (+ C C))))) t_0)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = F * t_0;
double t_2 = -sqrt((2.0 * (t_1 * (A + (B + C))))) / t_0;
double tmp;
if (C <= -4.6e-34) {
tmp = -sqrt((2.0 * (t_1 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0;
} else if (C <= -5.3e-132) {
tmp = t_2;
} else if (C <= -3.9e-203) {
tmp = -sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0;
} else if (C <= 9.5e-41) {
tmp = t_2;
} else {
tmp = -sqrt((2.0 * (t_1 * (C + C)))) / t_0;
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (b * b) + ((-4.0d0) * (a * c))
t_1 = f * t_0
t_2 = -sqrt((2.0d0 * (t_1 * (a + (b + c))))) / t_0
if (c <= (-4.6d-34)) then
tmp = -sqrt((2.0d0 * (t_1 * (a + (a + ((-0.5d0) * ((b * b) / c))))))) / t_0
else if (c <= (-5.3d-132)) then
tmp = t_2
else if (c <= (-3.9d-203)) then
tmp = -sqrt((2.0d0 * (t_1 * (2.0d0 * a)))) / t_0
else if (c <= 9.5d-41) then
tmp = t_2
else
tmp = -sqrt((2.0d0 * (t_1 * (c + c)))) / t_0
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = F * t_0;
double t_2 = -Math.sqrt((2.0 * (t_1 * (A + (B + C))))) / t_0;
double tmp;
if (C <= -4.6e-34) {
tmp = -Math.sqrt((2.0 * (t_1 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0;
} else if (C <= -5.3e-132) {
tmp = t_2;
} else if (C <= -3.9e-203) {
tmp = -Math.sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0;
} else if (C <= 9.5e-41) {
tmp = t_2;
} else {
tmp = -Math.sqrt((2.0 * (t_1 * (C + C)))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) t_1 = F * t_0 t_2 = -math.sqrt((2.0 * (t_1 * (A + (B + C))))) / t_0 tmp = 0 if C <= -4.6e-34: tmp = -math.sqrt((2.0 * (t_1 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0 elif C <= -5.3e-132: tmp = t_2 elif C <= -3.9e-203: tmp = -math.sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0 elif C <= 9.5e-41: tmp = t_2 else: tmp = -math.sqrt((2.0 * (t_1 * (C + C)))) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) t_1 = Float64(F * t_0) t_2 = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(A + Float64(B + C)))))) / t_0) tmp = 0.0 if (C <= -4.6e-34) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(A + Float64(A + Float64(-0.5 * Float64(Float64(B * B) / C)))))))) / t_0); elseif (C <= -5.3e-132) tmp = t_2; elseif (C <= -3.9e-203) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(2.0 * A))))) / t_0); elseif (C <= 9.5e-41) tmp = t_2; else tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(C + C))))) / t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); t_1 = F * t_0; t_2 = -sqrt((2.0 * (t_1 * (A + (B + C))))) / t_0; tmp = 0.0; if (C <= -4.6e-34) tmp = -sqrt((2.0 * (t_1 * (A + (A + (-0.5 * ((B * B) / C))))))) / t_0; elseif (C <= -5.3e-132) tmp = t_2; elseif (C <= -3.9e-203) tmp = -sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0; elseif (C <= 9.5e-41) tmp = t_2; else tmp = -sqrt((2.0 * (t_1 * (C + C)))) / t_0; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(A + N[(B + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]}, If[LessEqual[C, -4.6e-34], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(A + N[(A + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[C, -5.3e-132], t$95$2, If[LessEqual[C, -3.9e-203], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[C, 9.5e-41], t$95$2, N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(C + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
t_1 := F \cdot t_0\\
t_2 := \frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(A + \left(B + C\right)\right)\right)}}{t_0}\\
\mathbf{if}\;C \leq -4.6 \cdot 10^{-34}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(A + \left(A + -0.5 \cdot \frac{B \cdot B}{C}\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;C \leq -5.3 \cdot 10^{-132}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;C \leq -3.9 \cdot 10^{-203}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;C \leq 9.5 \cdot 10^{-41}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(C + C\right)\right)}}{t_0}\\
\end{array}
\end{array}
if C < -4.60000000000000022e-34Initial program 6.6%
Simplified6.6%
distribute-frac-neg6.6%
Applied egg-rr11.8%
Taylor expanded in C around -inf 38.4%
unpow238.4%
Simplified38.4%
if -4.60000000000000022e-34 < C < -5.3000000000000003e-132 or -3.8999999999999999e-203 < C < 9.4999999999999997e-41Initial program 32.2%
Simplified32.2%
distribute-frac-neg32.2%
Applied egg-rr37.3%
Taylor expanded in B around inf 14.3%
+-commutative14.3%
Simplified14.3%
if -5.3000000000000003e-132 < C < -3.8999999999999999e-203Initial program 36.0%
Simplified36.0%
distribute-frac-neg36.0%
Applied egg-rr43.4%
Taylor expanded in A around inf 42.9%
if 9.4999999999999997e-41 < C Initial program 25.3%
Simplified25.3%
distribute-frac-neg25.3%
Applied egg-rr39.2%
Taylor expanded in A around -inf 33.1%
count-233.1%
Simplified33.1%
Final simplification27.9%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C)))) (t_1 (* F t_0)))
(if (<= A -3.5e+47)
(/ (- (sqrt (* 2.0 (* t_1 (+ C C))))) t_0)
(if (or (<= A -9.2e-144) (not (<= A 6.3e+22)))
(/ (- (sqrt (* 2.0 (* t_1 (* 2.0 A))))) t_0)
(/ (- (sqrt (* 2.0 (* t_1 (+ A (+ B C)))))) t_0)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = F * t_0;
double tmp;
if (A <= -3.5e+47) {
tmp = -sqrt((2.0 * (t_1 * (C + C)))) / t_0;
} else if ((A <= -9.2e-144) || !(A <= 6.3e+22)) {
tmp = -sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0;
} else {
tmp = -sqrt((2.0 * (t_1 * (A + (B + C))))) / t_0;
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (b * b) + ((-4.0d0) * (a * c))
t_1 = f * t_0
if (a <= (-3.5d+47)) then
tmp = -sqrt((2.0d0 * (t_1 * (c + c)))) / t_0
else if ((a <= (-9.2d-144)) .or. (.not. (a <= 6.3d+22))) then
tmp = -sqrt((2.0d0 * (t_1 * (2.0d0 * a)))) / t_0
else
tmp = -sqrt((2.0d0 * (t_1 * (a + (b + c))))) / t_0
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = F * t_0;
double tmp;
if (A <= -3.5e+47) {
tmp = -Math.sqrt((2.0 * (t_1 * (C + C)))) / t_0;
} else if ((A <= -9.2e-144) || !(A <= 6.3e+22)) {
tmp = -Math.sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0;
} else {
tmp = -Math.sqrt((2.0 * (t_1 * (A + (B + C))))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) t_1 = F * t_0 tmp = 0 if A <= -3.5e+47: tmp = -math.sqrt((2.0 * (t_1 * (C + C)))) / t_0 elif (A <= -9.2e-144) or not (A <= 6.3e+22): tmp = -math.sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0 else: tmp = -math.sqrt((2.0 * (t_1 * (A + (B + C))))) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) t_1 = Float64(F * t_0) tmp = 0.0 if (A <= -3.5e+47) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(C + C))))) / t_0); elseif ((A <= -9.2e-144) || !(A <= 6.3e+22)) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(2.0 * A))))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(A + Float64(B + C)))))) / t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); t_1 = F * t_0; tmp = 0.0; if (A <= -3.5e+47) tmp = -sqrt((2.0 * (t_1 * (C + C)))) / t_0; elseif ((A <= -9.2e-144) || ~((A <= 6.3e+22))) tmp = -sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0; else tmp = -sqrt((2.0 * (t_1 * (A + (B + C))))) / t_0; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F * t$95$0), $MachinePrecision]}, If[LessEqual[A, -3.5e+47], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(C + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[Or[LessEqual[A, -9.2e-144], N[Not[LessEqual[A, 6.3e+22]], $MachinePrecision]], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(A + N[(B + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
t_1 := F \cdot t_0\\
\mathbf{if}\;A \leq -3.5 \cdot 10^{+47}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(C + C\right)\right)}}{t_0}\\
\mathbf{elif}\;A \leq -9.2 \cdot 10^{-144} \lor \neg \left(A \leq 6.3 \cdot 10^{+22}\right):\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(A + \left(B + C\right)\right)\right)}}{t_0}\\
\end{array}
\end{array}
if A < -3.50000000000000015e47Initial program 6.4%
Simplified6.4%
distribute-frac-neg6.4%
Applied egg-rr9.0%
Taylor expanded in A around -inf 27.2%
count-227.2%
Simplified27.2%
if -3.50000000000000015e47 < A < -9.2e-144 or 6.30000000000000021e22 < A Initial program 22.9%
Simplified22.9%
distribute-frac-neg22.9%
Applied egg-rr35.6%
Taylor expanded in A around inf 34.4%
if -9.2e-144 < A < 6.30000000000000021e22Initial program 31.0%
Simplified31.0%
distribute-frac-neg31.0%
Applied egg-rr36.8%
Taylor expanded in B around inf 14.0%
+-commutative14.0%
Simplified14.0%
Final simplification24.2%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C)))) (t_1 (* F t_0)))
(if (<= A -1.5e+47)
(* (sqrt (* 2.0 (* t_1 (+ C C)))) (/ -1.0 t_0))
(if (or (<= A -3.5e-144) (not (<= A 6.3e+22)))
(/ (- (sqrt (* 2.0 (* t_1 (* 2.0 A))))) t_0)
(/ (- (sqrt (* 2.0 (* t_1 (+ A (+ B C)))))) t_0)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = F * t_0;
double tmp;
if (A <= -1.5e+47) {
tmp = sqrt((2.0 * (t_1 * (C + C)))) * (-1.0 / t_0);
} else if ((A <= -3.5e-144) || !(A <= 6.3e+22)) {
tmp = -sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0;
} else {
tmp = -sqrt((2.0 * (t_1 * (A + (B + C))))) / t_0;
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (b * b) + ((-4.0d0) * (a * c))
t_1 = f * t_0
if (a <= (-1.5d+47)) then
tmp = sqrt((2.0d0 * (t_1 * (c + c)))) * ((-1.0d0) / t_0)
else if ((a <= (-3.5d-144)) .or. (.not. (a <= 6.3d+22))) then
tmp = -sqrt((2.0d0 * (t_1 * (2.0d0 * a)))) / t_0
else
tmp = -sqrt((2.0d0 * (t_1 * (a + (b + c))))) / t_0
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = F * t_0;
double tmp;
if (A <= -1.5e+47) {
tmp = Math.sqrt((2.0 * (t_1 * (C + C)))) * (-1.0 / t_0);
} else if ((A <= -3.5e-144) || !(A <= 6.3e+22)) {
tmp = -Math.sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0;
} else {
tmp = -Math.sqrt((2.0 * (t_1 * (A + (B + C))))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) t_1 = F * t_0 tmp = 0 if A <= -1.5e+47: tmp = math.sqrt((2.0 * (t_1 * (C + C)))) * (-1.0 / t_0) elif (A <= -3.5e-144) or not (A <= 6.3e+22): tmp = -math.sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0 else: tmp = -math.sqrt((2.0 * (t_1 * (A + (B + C))))) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) t_1 = Float64(F * t_0) tmp = 0.0 if (A <= -1.5e+47) tmp = Float64(sqrt(Float64(2.0 * Float64(t_1 * Float64(C + C)))) * Float64(-1.0 / t_0)); elseif ((A <= -3.5e-144) || !(A <= 6.3e+22)) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(2.0 * A))))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(A + Float64(B + C)))))) / t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); t_1 = F * t_0; tmp = 0.0; if (A <= -1.5e+47) tmp = sqrt((2.0 * (t_1 * (C + C)))) * (-1.0 / t_0); elseif ((A <= -3.5e-144) || ~((A <= 6.3e+22))) tmp = -sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0; else tmp = -sqrt((2.0 * (t_1 * (A + (B + C))))) / t_0; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F * t$95$0), $MachinePrecision]}, If[LessEqual[A, -1.5e+47], N[(N[Sqrt[N[(2.0 * N[(t$95$1 * N[(C + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[A, -3.5e-144], N[Not[LessEqual[A, 6.3e+22]], $MachinePrecision]], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(A + N[(B + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
t_1 := F \cdot t_0\\
\mathbf{if}\;A \leq -1.5 \cdot 10^{+47}:\\
\;\;\;\;\sqrt{2 \cdot \left(t_1 \cdot \left(C + C\right)\right)} \cdot \frac{-1}{t_0}\\
\mathbf{elif}\;A \leq -3.5 \cdot 10^{-144} \lor \neg \left(A \leq 6.3 \cdot 10^{+22}\right):\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(A + \left(B + C\right)\right)\right)}}{t_0}\\
\end{array}
\end{array}
if A < -1.5000000000000001e47Initial program 6.4%
Simplified6.4%
div-inv6.4%
Applied egg-rr9.0%
Taylor expanded in A around -inf 27.2%
count-227.2%
Simplified27.2%
if -1.5000000000000001e47 < A < -3.4999999999999998e-144 or 6.30000000000000021e22 < A Initial program 22.9%
Simplified22.9%
distribute-frac-neg22.9%
Applied egg-rr35.6%
Taylor expanded in A around inf 34.4%
if -3.4999999999999998e-144 < A < 6.30000000000000021e22Initial program 31.0%
Simplified31.0%
distribute-frac-neg31.0%
Applied egg-rr36.8%
Taylor expanded in B around inf 14.0%
+-commutative14.0%
Simplified14.0%
Final simplification24.2%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C)))) (t_1 (* F t_0)))
(if (<= A -5.4e+46)
(/ (- (sqrt (* (* A -16.0) (* F (* C C))))) (- (* B B) (* (* A C) 4.0)))
(if (or (<= A -1.8e-144) (not (<= A 1.3e+16)))
(/ (- (sqrt (* 2.0 (* t_1 (* 2.0 A))))) t_0)
(/ (- (sqrt (* 2.0 (* B t_1)))) t_0)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = F * t_0;
double tmp;
if (A <= -5.4e+46) {
tmp = -sqrt(((A * -16.0) * (F * (C * C)))) / ((B * B) - ((A * C) * 4.0));
} else if ((A <= -1.8e-144) || !(A <= 1.3e+16)) {
tmp = -sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0;
} else {
tmp = -sqrt((2.0 * (B * t_1))) / t_0;
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (b * b) + ((-4.0d0) * (a * c))
t_1 = f * t_0
if (a <= (-5.4d+46)) then
tmp = -sqrt(((a * (-16.0d0)) * (f * (c * c)))) / ((b * b) - ((a * c) * 4.0d0))
else if ((a <= (-1.8d-144)) .or. (.not. (a <= 1.3d+16))) then
tmp = -sqrt((2.0d0 * (t_1 * (2.0d0 * a)))) / t_0
else
tmp = -sqrt((2.0d0 * (b * t_1))) / t_0
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = F * t_0;
double tmp;
if (A <= -5.4e+46) {
tmp = -Math.sqrt(((A * -16.0) * (F * (C * C)))) / ((B * B) - ((A * C) * 4.0));
} else if ((A <= -1.8e-144) || !(A <= 1.3e+16)) {
tmp = -Math.sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0;
} else {
tmp = -Math.sqrt((2.0 * (B * t_1))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) t_1 = F * t_0 tmp = 0 if A <= -5.4e+46: tmp = -math.sqrt(((A * -16.0) * (F * (C * C)))) / ((B * B) - ((A * C) * 4.0)) elif (A <= -1.8e-144) or not (A <= 1.3e+16): tmp = -math.sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0 else: tmp = -math.sqrt((2.0 * (B * t_1))) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) t_1 = Float64(F * t_0) tmp = 0.0 if (A <= -5.4e+46) tmp = Float64(Float64(-sqrt(Float64(Float64(A * -16.0) * Float64(F * Float64(C * C))))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0))); elseif ((A <= -1.8e-144) || !(A <= 1.3e+16)) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(2.0 * A))))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(B * t_1)))) / t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); t_1 = F * t_0; tmp = 0.0; if (A <= -5.4e+46) tmp = -sqrt(((A * -16.0) * (F * (C * C)))) / ((B * B) - ((A * C) * 4.0)); elseif ((A <= -1.8e-144) || ~((A <= 1.3e+16))) tmp = -sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0; else tmp = -sqrt((2.0 * (B * t_1))) / t_0; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F * t$95$0), $MachinePrecision]}, If[LessEqual[A, -5.4e+46], N[((-N[Sqrt[N[(N[(A * -16.0), $MachinePrecision] * N[(F * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[A, -1.8e-144], N[Not[LessEqual[A, 1.3e+16]], $MachinePrecision]], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(B * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
t_1 := F \cdot t_0\\
\mathbf{if}\;A \leq -5.4 \cdot 10^{+46}:\\
\;\;\;\;\frac{-\sqrt{\left(A \cdot -16\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\
\mathbf{elif}\;A \leq -1.8 \cdot 10^{-144} \lor \neg \left(A \leq 1.3 \cdot 10^{+16}\right):\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(B \cdot t_1\right)}}{t_0}\\
\end{array}
\end{array}
if A < -5.4000000000000003e46Initial program 6.4%
Simplified6.4%
Taylor expanded in A around -inf 6.9%
mul-1-neg6.9%
sub-neg6.9%
Simplified6.9%
Taylor expanded in B around 0 21.6%
associate-*r*21.6%
*-commutative21.6%
unpow221.6%
Simplified21.6%
if -5.4000000000000003e46 < A < -1.8e-144 or 1.3e16 < A Initial program 24.2%
Simplified24.2%
distribute-frac-neg24.2%
Applied egg-rr36.5%
Taylor expanded in A around inf 34.5%
if -1.8e-144 < A < 1.3e16Initial program 30.0%
Simplified30.0%
distribute-frac-neg30.0%
Applied egg-rr36.0%
Taylor expanded in B around inf 12.3%
Final simplification22.7%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C)))) (t_1 (* F t_0)))
(if (<= A -2.3e+47)
(/ (- (sqrt (* 2.0 (* t_1 (+ C C))))) t_0)
(if (or (<= A -7e-145) (not (<= A 6.1e+16)))
(/ (- (sqrt (* 2.0 (* t_1 (* 2.0 A))))) t_0)
(/ (- (sqrt (* 2.0 (* B t_1)))) t_0)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = F * t_0;
double tmp;
if (A <= -2.3e+47) {
tmp = -sqrt((2.0 * (t_1 * (C + C)))) / t_0;
} else if ((A <= -7e-145) || !(A <= 6.1e+16)) {
tmp = -sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0;
} else {
tmp = -sqrt((2.0 * (B * t_1))) / t_0;
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (b * b) + ((-4.0d0) * (a * c))
t_1 = f * t_0
if (a <= (-2.3d+47)) then
tmp = -sqrt((2.0d0 * (t_1 * (c + c)))) / t_0
else if ((a <= (-7d-145)) .or. (.not. (a <= 6.1d+16))) then
tmp = -sqrt((2.0d0 * (t_1 * (2.0d0 * a)))) / t_0
else
tmp = -sqrt((2.0d0 * (b * t_1))) / t_0
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = F * t_0;
double tmp;
if (A <= -2.3e+47) {
tmp = -Math.sqrt((2.0 * (t_1 * (C + C)))) / t_0;
} else if ((A <= -7e-145) || !(A <= 6.1e+16)) {
tmp = -Math.sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0;
} else {
tmp = -Math.sqrt((2.0 * (B * t_1))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) t_1 = F * t_0 tmp = 0 if A <= -2.3e+47: tmp = -math.sqrt((2.0 * (t_1 * (C + C)))) / t_0 elif (A <= -7e-145) or not (A <= 6.1e+16): tmp = -math.sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0 else: tmp = -math.sqrt((2.0 * (B * t_1))) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) t_1 = Float64(F * t_0) tmp = 0.0 if (A <= -2.3e+47) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(C + C))))) / t_0); elseif ((A <= -7e-145) || !(A <= 6.1e+16)) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(2.0 * A))))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(B * t_1)))) / t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); t_1 = F * t_0; tmp = 0.0; if (A <= -2.3e+47) tmp = -sqrt((2.0 * (t_1 * (C + C)))) / t_0; elseif ((A <= -7e-145) || ~((A <= 6.1e+16))) tmp = -sqrt((2.0 * (t_1 * (2.0 * A)))) / t_0; else tmp = -sqrt((2.0 * (B * t_1))) / t_0; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F * t$95$0), $MachinePrecision]}, If[LessEqual[A, -2.3e+47], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(C + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[Or[LessEqual[A, -7e-145], N[Not[LessEqual[A, 6.1e+16]], $MachinePrecision]], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(B * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
t_1 := F \cdot t_0\\
\mathbf{if}\;A \leq -2.3 \cdot 10^{+47}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(C + C\right)\right)}}{t_0}\\
\mathbf{elif}\;A \leq -7 \cdot 10^{-145} \lor \neg \left(A \leq 6.1 \cdot 10^{+16}\right):\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(B \cdot t_1\right)}}{t_0}\\
\end{array}
\end{array}
if A < -2.2999999999999999e47Initial program 6.4%
Simplified6.4%
distribute-frac-neg6.4%
Applied egg-rr9.0%
Taylor expanded in A around -inf 27.2%
count-227.2%
Simplified27.2%
if -2.2999999999999999e47 < A < -6.99999999999999994e-145 or 6.1e16 < A Initial program 24.2%
Simplified24.2%
distribute-frac-neg24.2%
Applied egg-rr36.5%
Taylor expanded in A around inf 34.5%
if -6.99999999999999994e-145 < A < 6.1e16Initial program 30.0%
Simplified30.0%
distribute-frac-neg30.0%
Applied egg-rr36.0%
Taylor expanded in B around inf 12.3%
Final simplification23.7%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C))))
(t_1 (- (* B B) (* (* A C) 4.0)))
(t_2 (* F t_0)))
(if (<= A -2.9e+47)
(/ (- (sqrt (* 2.0 (* t_2 (+ C C))))) t_0)
(if (or (<= A -9.5e-145) (not (<= A 6.3e+22)))
(/ (- (sqrt (* 2.0 (* t_2 (* 2.0 A))))) t_0)
(/ (- (sqrt (* (* 2.0 (* F t_1)) (+ B C)))) t_1)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = (B * B) - ((A * C) * 4.0);
double t_2 = F * t_0;
double tmp;
if (A <= -2.9e+47) {
tmp = -sqrt((2.0 * (t_2 * (C + C)))) / t_0;
} else if ((A <= -9.5e-145) || !(A <= 6.3e+22)) {
tmp = -sqrt((2.0 * (t_2 * (2.0 * A)))) / t_0;
} else {
tmp = -sqrt(((2.0 * (F * t_1)) * (B + C))) / t_1;
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (b * b) + ((-4.0d0) * (a * c))
t_1 = (b * b) - ((a * c) * 4.0d0)
t_2 = f * t_0
if (a <= (-2.9d+47)) then
tmp = -sqrt((2.0d0 * (t_2 * (c + c)))) / t_0
else if ((a <= (-9.5d-145)) .or. (.not. (a <= 6.3d+22))) then
tmp = -sqrt((2.0d0 * (t_2 * (2.0d0 * a)))) / t_0
else
tmp = -sqrt(((2.0d0 * (f * t_1)) * (b + c))) / t_1
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = (B * B) - ((A * C) * 4.0);
double t_2 = F * t_0;
double tmp;
if (A <= -2.9e+47) {
tmp = -Math.sqrt((2.0 * (t_2 * (C + C)))) / t_0;
} else if ((A <= -9.5e-145) || !(A <= 6.3e+22)) {
tmp = -Math.sqrt((2.0 * (t_2 * (2.0 * A)))) / t_0;
} else {
tmp = -Math.sqrt(((2.0 * (F * t_1)) * (B + C))) / t_1;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) t_1 = (B * B) - ((A * C) * 4.0) t_2 = F * t_0 tmp = 0 if A <= -2.9e+47: tmp = -math.sqrt((2.0 * (t_2 * (C + C)))) / t_0 elif (A <= -9.5e-145) or not (A <= 6.3e+22): tmp = -math.sqrt((2.0 * (t_2 * (2.0 * A)))) / t_0 else: tmp = -math.sqrt(((2.0 * (F * t_1)) * (B + C))) / t_1 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) t_1 = Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0)) t_2 = Float64(F * t_0) tmp = 0.0 if (A <= -2.9e+47) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_2 * Float64(C + C))))) / t_0); elseif ((A <= -9.5e-145) || !(A <= 6.3e+22)) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_2 * Float64(2.0 * A))))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_1)) * Float64(B + C)))) / t_1); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); t_1 = (B * B) - ((A * C) * 4.0); t_2 = F * t_0; tmp = 0.0; if (A <= -2.9e+47) tmp = -sqrt((2.0 * (t_2 * (C + C)))) / t_0; elseif ((A <= -9.5e-145) || ~((A <= 6.3e+22))) tmp = -sqrt((2.0 * (t_2 * (2.0 * A)))) / t_0; else tmp = -sqrt(((2.0 * (F * t_1)) * (B + C))) / t_1; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(F * t$95$0), $MachinePrecision]}, If[LessEqual[A, -2.9e+47], N[((-N[Sqrt[N[(2.0 * N[(t$95$2 * N[(C + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[Or[LessEqual[A, -9.5e-145], N[Not[LessEqual[A, 6.3e+22]], $MachinePrecision]], N[((-N[Sqrt[N[(2.0 * N[(t$95$2 * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(B + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
t_1 := B \cdot B - \left(A \cdot C\right) \cdot 4\\
t_2 := F \cdot t_0\\
\mathbf{if}\;A \leq -2.9 \cdot 10^{+47}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_2 \cdot \left(C + C\right)\right)}}{t_0}\\
\mathbf{elif}\;A \leq -9.5 \cdot 10^{-145} \lor \neg \left(A \leq 6.3 \cdot 10^{+22}\right):\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_2 \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_1\right)\right) \cdot \left(B + C\right)}}{t_1}\\
\end{array}
\end{array}
if A < -2.8999999999999998e47Initial program 6.4%
Simplified6.4%
distribute-frac-neg6.4%
Applied egg-rr9.0%
Taylor expanded in A around -inf 27.2%
count-227.2%
Simplified27.2%
if -2.8999999999999998e47 < A < -9.49999999999999981e-145 or 6.30000000000000021e22 < A Initial program 22.9%
Simplified22.9%
distribute-frac-neg22.9%
Applied egg-rr35.6%
Taylor expanded in A around inf 34.4%
if -9.49999999999999981e-145 < A < 6.30000000000000021e22Initial program 31.0%
Simplified31.0%
Taylor expanded in C around 0 25.2%
+-commutative25.2%
unpow225.2%
unpow225.2%
hypot-def25.2%
Simplified25.2%
Taylor expanded in A around 0 13.9%
+-commutative13.9%
Simplified13.9%
Final simplification24.2%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
(if (<= B 2.1e-90)
(/ (- (sqrt (* (* A -16.0) (* F (* C C))))) (- (* B B) (* (* A C) 4.0)))
(/ (- (sqrt (* 2.0 (* B (* F t_0))))) t_0))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double tmp;
if (B <= 2.1e-90) {
tmp = -sqrt(((A * -16.0) * (F * (C * C)))) / ((B * B) - ((A * C) * 4.0));
} else {
tmp = -sqrt((2.0 * (B * (F * t_0)))) / t_0;
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (b * b) + ((-4.0d0) * (a * c))
if (b <= 2.1d-90) then
tmp = -sqrt(((a * (-16.0d0)) * (f * (c * c)))) / ((b * b) - ((a * c) * 4.0d0))
else
tmp = -sqrt((2.0d0 * (b * (f * t_0)))) / t_0
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double tmp;
if (B <= 2.1e-90) {
tmp = -Math.sqrt(((A * -16.0) * (F * (C * C)))) / ((B * B) - ((A * C) * 4.0));
} else {
tmp = -Math.sqrt((2.0 * (B * (F * t_0)))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) tmp = 0 if B <= 2.1e-90: tmp = -math.sqrt(((A * -16.0) * (F * (C * C)))) / ((B * B) - ((A * C) * 4.0)) else: tmp = -math.sqrt((2.0 * (B * (F * t_0)))) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) tmp = 0.0 if (B <= 2.1e-90) tmp = Float64(Float64(-sqrt(Float64(Float64(A * -16.0) * Float64(F * Float64(C * C))))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0))); else tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(B * Float64(F * t_0))))) / t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); tmp = 0.0; if (B <= 2.1e-90) tmp = -sqrt(((A * -16.0) * (F * (C * C)))) / ((B * B) - ((A * C) * 4.0)); else tmp = -sqrt((2.0 * (B * (F * t_0)))) / t_0; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 2.1e-90], N[((-N[Sqrt[N[(N[(A * -16.0), $MachinePrecision] * N[(F * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(B * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 2.1 \cdot 10^{-90}:\\
\;\;\;\;\frac{-\sqrt{\left(A \cdot -16\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(B \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\
\end{array}
\end{array}
if B < 2.0999999999999999e-90Initial program 24.8%
Simplified24.8%
Taylor expanded in A around -inf 12.7%
mul-1-neg12.7%
sub-neg12.7%
Simplified12.7%
Taylor expanded in B around 0 12.1%
associate-*r*12.1%
*-commutative12.1%
unpow212.1%
Simplified12.1%
if 2.0999999999999999e-90 < B Initial program 20.7%
Simplified20.7%
distribute-frac-neg20.7%
Applied egg-rr26.0%
Taylor expanded in B around inf 16.5%
Final simplification13.6%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (/ (- (sqrt (* (* A -16.0) (* F (* C C))))) (- (* B B) (* (* A C) 4.0))))
B = abs(B);
double code(double A, double B, double C, double F) {
return -sqrt(((A * -16.0) * (F * (C * C)))) / ((B * B) - ((A * C) * 4.0));
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
code = -sqrt(((a * (-16.0d0)) * (f * (c * c)))) / ((b * b) - ((a * c) * 4.0d0))
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return -Math.sqrt(((A * -16.0) * (F * (C * C)))) / ((B * B) - ((A * C) * 4.0));
}
B = abs(B) def code(A, B, C, F): return -math.sqrt(((A * -16.0) * (F * (C * C)))) / ((B * B) - ((A * C) * 4.0))
B = abs(B) function code(A, B, C, F) return Float64(Float64(-sqrt(Float64(Float64(A * -16.0) * Float64(F * Float64(C * C))))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0))) end
B = abs(B) function tmp = code(A, B, C, F) tmp = -sqrt(((A * -16.0) * (F * (C * C)))) / ((B * B) - ((A * C) * 4.0)); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[((-N[Sqrt[N[(N[(A * -16.0), $MachinePrecision] * N[(F * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\frac{-\sqrt{\left(A \cdot -16\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}}{B \cdot B - \left(A \cdot C\right) \cdot 4}
\end{array}
Initial program 23.5%
Simplified23.5%
Taylor expanded in A around -inf 10.9%
mul-1-neg10.9%
sub-neg10.9%
Simplified10.9%
Taylor expanded in B around 0 9.5%
associate-*r*9.6%
*-commutative9.6%
unpow29.6%
Simplified9.6%
Final simplification9.6%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* 2.0 (/ (- (pow (* F C) 0.5)) B)))
B = abs(B);
double code(double A, double B, double C, double F) {
return 2.0 * (-pow((F * C), 0.5) / B);
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
code = 2.0d0 * (-((f * c) ** 0.5d0) / b)
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return 2.0 * (-Math.pow((F * C), 0.5) / B);
}
B = abs(B) def code(A, B, C, F): return 2.0 * (-math.pow((F * C), 0.5) / B)
B = abs(B) function code(A, B, C, F) return Float64(2.0 * Float64(Float64(-(Float64(F * C) ^ 0.5)) / B)) end
B = abs(B) function tmp = code(A, B, C, F) tmp = 2.0 * (-((F * C) ^ 0.5) / B); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(2.0 * N[((-N[Power[N[(F * C), $MachinePrecision], 0.5], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
2 \cdot \frac{-{\left(F \cdot C\right)}^{0.5}}{B}
\end{array}
Initial program 23.5%
Simplified31.2%
Taylor expanded in A around -inf 14.6%
Taylor expanded in B around inf 2.3%
associate-*l/2.3%
*-lft-identity2.3%
*-commutative2.3%
Simplified2.3%
pow1/22.5%
Applied egg-rr2.5%
Final simplification2.5%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* -2.0 (/ (sqrt (* F C)) B)))
B = abs(B);
double code(double A, double B, double C, double F) {
return -2.0 * (sqrt((F * C)) / B);
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
code = (-2.0d0) * (sqrt((f * c)) / b)
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return -2.0 * (Math.sqrt((F * C)) / B);
}
B = abs(B) def code(A, B, C, F): return -2.0 * (math.sqrt((F * C)) / B)
B = abs(B) function code(A, B, C, F) return Float64(-2.0 * Float64(sqrt(Float64(F * C)) / B)) end
B = abs(B) function tmp = code(A, B, C, F) tmp = -2.0 * (sqrt((F * C)) / B); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(-2.0 * N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
-2 \cdot \frac{\sqrt{F \cdot C}}{B}
\end{array}
Initial program 23.5%
Simplified23.5%
Taylor expanded in A around -inf 10.9%
mul-1-neg10.9%
sub-neg10.9%
Simplified10.9%
Taylor expanded in B around inf 2.3%
associate-*l/2.3%
*-commutative2.3%
*-lft-identity2.3%
Simplified2.3%
Final simplification2.3%
herbie shell --seed 2023279
(FPCore (A B C F)
:name "ABCF->ab-angle a"
:precision binary64
(/ (- (sqrt (* (* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F)) (+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))) (- (pow B 2.0) (* (* 4.0 A) C))))