
(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
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= (pow B 2.0) 5e+203)
(/
(* (sqrt (* 2.0 (* F t_0))) (- (sqrt (+ C (+ A (hypot B (- A C)))))))
t_0)
(* (/ (sqrt 2.0) B) (* (sqrt (+ C (hypot B C))) (- (sqrt F)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (pow(B, 2.0) <= 5e+203) {
tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * (sqrt((C + hypot(B, C))) * -sqrt(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 * (C * A));
double tmp;
if (Math.pow(B, 2.0) <= 5e+203) {
tmp = (Math.sqrt((2.0 * (F * t_0))) * -Math.sqrt((C + (A + Math.hypot(B, (A - C)))))) / t_0;
} else {
tmp = (Math.sqrt(2.0) / B) * (Math.sqrt((C + Math.hypot(B, C))) * -Math.sqrt(F));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if math.pow(B, 2.0) <= 5e+203: tmp = (math.sqrt((2.0 * (F * t_0))) * -math.sqrt((C + (A + math.hypot(B, (A - C)))))) / t_0 else: tmp = (math.sqrt(2.0) / B) * (math.sqrt((C + math.hypot(B, C))) * -math.sqrt(F)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if ((B ^ 2.0) <= 5e+203) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * t_0))) * Float64(-sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(Float64(C + hypot(B, C))) * Float64(-sqrt(F)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (C * A)); tmp = 0.0; if ((B ^ 2.0) <= 5e+203) tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0; else tmp = (sqrt(2.0) / B) * (sqrt((C + hypot(B, C))) * -sqrt(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[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5e+203], N[(N[(N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{+203}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot t_0\right)} \cdot \left(-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 4.99999999999999994e203Initial program 24.2%
associate-*l*24.2%
unpow224.2%
+-commutative24.2%
unpow224.2%
associate-*l*24.2%
unpow224.2%
Simplified24.2%
sqrt-prod26.3%
*-commutative26.3%
*-commutative26.3%
associate-+l+26.9%
unpow226.9%
hypot-udef41.6%
associate-+r+40.5%
+-commutative40.5%
associate-+r+41.3%
Applied egg-rr41.3%
if 4.99999999999999994e203 < (pow.f64 B 2) Initial program 3.8%
Simplified3.9%
Taylor expanded in A around 0 6.1%
mul-1-neg6.1%
distribute-rgt-neg-in6.1%
*-commutative6.1%
unpow26.1%
unpow26.1%
hypot-def25.1%
Simplified25.1%
sqrt-prod34.5%
Applied egg-rr34.5%
Final simplification38.8%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= B 2.25e+111)
(/
(* (sqrt (* 2.0 (* F t_0))) (- (sqrt (+ C (+ A (hypot B (- A C)))))))
t_0)
(* (/ (sqrt 2.0) B) (* (sqrt F) (- (sqrt (+ B C))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (B <= 2.25e+111) {
tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((B + C)));
}
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 * (C * A));
double tmp;
if (B <= 2.25e+111) {
tmp = (Math.sqrt((2.0 * (F * t_0))) * -Math.sqrt((C + (A + Math.hypot(B, (A - C)))))) / t_0;
} else {
tmp = (Math.sqrt(2.0) / B) * (Math.sqrt(F) * -Math.sqrt((B + C)));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if B <= 2.25e+111: tmp = (math.sqrt((2.0 * (F * t_0))) * -math.sqrt((C + (A + math.hypot(B, (A - C)))))) / t_0 else: tmp = (math.sqrt(2.0) / B) * (math.sqrt(F) * -math.sqrt((B + C))) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (B <= 2.25e+111) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * t_0))) * Float64(-sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(F) * Float64(-sqrt(Float64(B + C))))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (C * A)); tmp = 0.0; if (B <= 2.25e+111) tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0; else tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((B + C))); 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[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 2.25e+111], N[(N[(N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(B + C), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;B \leq 2.25 \cdot 10^{+111}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot t_0\right)} \cdot \left(-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B + C}\right)\right)\\
\end{array}
\end{array}
if B < 2.25e111Initial program 19.4%
associate-*l*19.4%
unpow219.4%
+-commutative19.4%
unpow219.4%
associate-*l*19.4%
unpow219.4%
Simplified19.4%
sqrt-prod22.8%
*-commutative22.8%
*-commutative22.8%
associate-+l+23.3%
unpow223.3%
hypot-udef34.4%
associate-+r+33.6%
+-commutative33.6%
associate-+r+34.1%
Applied egg-rr34.1%
if 2.25e111 < B Initial program 3.1%
Simplified3.2%
Taylor expanded in A around 0 9.8%
mul-1-neg9.8%
distribute-rgt-neg-in9.8%
*-commutative9.8%
unpow29.8%
unpow29.8%
hypot-def50.8%
Simplified50.8%
sqrt-prod72.0%
Applied egg-rr72.0%
Taylor expanded in C around 0 66.6%
Final simplification39.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma C (* A -4.0) (* B B))) (t_1 (- (* B B) (* 4.0 (* C A)))))
(if (<= B 6.6e-242)
(/ (- (sqrt (* 2.0 (* 2.0 (* (* F C) (fma B B (* C (* A -4.0)))))))) t_0)
(if (<= B 6.2e-125)
(/ (- (sqrt (* 2.0 (* (* F t_0) (* 2.0 A))))) t_0)
(if (<= B 1.55e+88)
(- (/ (sqrt (* 2.0 (* (* F t_1) (+ C (+ A (hypot B (- A C))))))) t_1))
(* (/ (sqrt 2.0) B) (* (sqrt B) (- (sqrt F)))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(C, (A * -4.0), (B * B));
double t_1 = (B * B) - (4.0 * (C * A));
double tmp;
if (B <= 6.6e-242) {
tmp = -sqrt((2.0 * (2.0 * ((F * C) * fma(B, B, (C * (A * -4.0))))))) / t_0;
} else if (B <= 6.2e-125) {
tmp = -sqrt((2.0 * ((F * t_0) * (2.0 * A)))) / t_0;
} else if (B <= 1.55e+88) {
tmp = -(sqrt((2.0 * ((F * t_1) * (C + (A + hypot(B, (A - C))))))) / t_1);
} else {
tmp = (sqrt(2.0) / B) * (sqrt(B) * -sqrt(F));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(C, Float64(A * -4.0), Float64(B * B)) t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (B <= 6.6e-242) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(2.0 * Float64(Float64(F * C) * fma(B, B, Float64(C * Float64(A * -4.0)))))))) / t_0); elseif (B <= 6.2e-125) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(2.0 * A))))) / t_0); elseif (B <= 1.55e+88) tmp = Float64(-Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_1) * Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / t_1)); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(B) * Float64(-sqrt(F)))); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 6.6e-242], N[((-N[Sqrt[N[(2.0 * N[(2.0 * N[(N[(F * C), $MachinePrecision] * N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 6.2e-125], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 1.55e+88], (-N[(N[Sqrt[N[(2.0 * N[(N[(F * t$95$1), $MachinePrecision] * N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]), N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[B], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\\
t_1 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;B \leq 6.6 \cdot 10^{-242}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(2 \cdot \left(\left(F \cdot C\right) \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 6.2 \cdot 10^{-125}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 1.55 \cdot 10^{+88}:\\
\;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(F \cdot t_1\right) \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{B} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < 6.59999999999999963e-242Initial program 16.0%
Simplified20.1%
Taylor expanded in A around -inf 12.6%
Taylor expanded in F around 0 12.0%
metadata-eval12.0%
cancel-sign-sub-inv12.0%
*-commutative12.0%
*-commutative12.0%
cancel-sign-sub-inv12.0%
metadata-eval12.0%
associate-*r*12.0%
*-commutative12.0%
unpow212.0%
fma-def12.0%
*-commutative12.0%
Simplified12.0%
if 6.59999999999999963e-242 < B < 6.20000000000000026e-125Initial program 8.6%
Simplified13.3%
Taylor expanded in C around -inf 26.9%
if 6.20000000000000026e-125 < B < 1.5500000000000001e88Initial program 36.1%
associate-*l*36.1%
unpow236.1%
+-commutative36.1%
unpow236.1%
associate-*l*36.1%
unpow236.1%
Simplified36.1%
distribute-frac-neg36.1%
Applied egg-rr48.7%
if 1.5500000000000001e88 < B Initial program 7.3%
Simplified7.4%
Taylor expanded in A around 0 17.0%
mul-1-neg17.0%
distribute-rgt-neg-in17.0%
*-commutative17.0%
unpow217.0%
unpow217.0%
hypot-def53.6%
Simplified53.6%
sqrt-prod72.5%
Applied egg-rr72.5%
Taylor expanded in C around 0 67.6%
Final simplification29.7%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= B 9e-242)
(/
(- (sqrt (* 2.0 (* 2.0 (* (* F C) (fma B B (* C (* A -4.0))))))))
(fma C (* A -4.0) (* B B)))
(if (<= B 1.75e-124)
(/
(- (sqrt (* 2.0 (* F (* (* 2.0 A) (+ (* B B) (* (* C A) -4.0)))))))
t_0)
(if (<= B 1.95e+88)
(- (/ (sqrt (* 2.0 (* (* F t_0) (+ C (+ A (hypot B (- A C))))))) t_0))
(* (/ (sqrt 2.0) B) (* (sqrt B) (- (sqrt F)))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (B <= 9e-242) {
tmp = -sqrt((2.0 * (2.0 * ((F * C) * fma(B, B, (C * (A * -4.0))))))) / fma(C, (A * -4.0), (B * B));
} else if (B <= 1.75e-124) {
tmp = -sqrt((2.0 * (F * ((2.0 * A) * ((B * B) + ((C * A) * -4.0)))))) / t_0;
} else if (B <= 1.95e+88) {
tmp = -(sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0);
} else {
tmp = (sqrt(2.0) / B) * (sqrt(B) * -sqrt(F));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (B <= 9e-242) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(2.0 * Float64(Float64(F * C) * fma(B, B, Float64(C * Float64(A * -4.0)))))))) / fma(C, Float64(A * -4.0), Float64(B * B))); elseif (B <= 1.75e-124) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(Float64(2.0 * A) * Float64(Float64(B * B) + Float64(Float64(C * A) * -4.0))))))) / t_0); elseif (B <= 1.95e+88) tmp = Float64(-Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / t_0)); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(B) * Float64(-sqrt(F)))); 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[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 9e-242], N[((-N[Sqrt[N[(2.0 * N[(2.0 * N[(N[(F * C), $MachinePrecision] * N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.75e-124], N[((-N[Sqrt[N[(2.0 * N[(F * N[(N[(2.0 * A), $MachinePrecision] * N[(N[(B * B), $MachinePrecision] + N[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 1.95e+88], (-N[(N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[B], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;B \leq 9 \cdot 10^{-242}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(2 \cdot \left(\left(F \cdot C\right) \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right)\right)}}{\mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)}\\
\mathbf{elif}\;B \leq 1.75 \cdot 10^{-124}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(\left(2 \cdot A\right) \cdot \left(B \cdot B + \left(C \cdot A\right) \cdot -4\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 1.95 \cdot 10^{+88}:\\
\;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{B} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < 8.9999999999999997e-242Initial program 16.0%
Simplified20.1%
Taylor expanded in A around -inf 12.6%
Taylor expanded in F around 0 12.0%
metadata-eval12.0%
cancel-sign-sub-inv12.0%
*-commutative12.0%
*-commutative12.0%
cancel-sign-sub-inv12.0%
metadata-eval12.0%
associate-*r*12.0%
*-commutative12.0%
unpow212.0%
fma-def12.0%
*-commutative12.0%
Simplified12.0%
if 8.9999999999999997e-242 < B < 1.7499999999999999e-124Initial program 8.6%
associate-*l*8.6%
unpow28.6%
+-commutative8.6%
unpow28.6%
associate-*l*8.6%
unpow28.6%
Simplified8.6%
*-un-lft-identity8.6%
associate-*l*8.6%
*-commutative8.6%
*-commutative8.6%
unpow28.6%
hypot-udef12.2%
+-commutative12.2%
associate-+r+13.3%
Applied egg-rr13.3%
*-lft-identity13.3%
associate-*r*13.3%
fma-neg13.3%
*-commutative13.3%
*-commutative13.3%
distribute-rgt-neg-in13.3%
*-commutative13.3%
metadata-eval13.3%
associate-*r*13.3%
associate-*r*13.3%
associate-*l*13.3%
Simplified12.2%
Taylor expanded in A around inf 5.5%
associate-+r+23.8%
distribute-rgt1-in23.8%
metadata-eval23.8%
mul0-lft23.8%
Simplified23.8%
if 1.7499999999999999e-124 < B < 1.9500000000000001e88Initial program 36.1%
associate-*l*36.1%
unpow236.1%
+-commutative36.1%
unpow236.1%
associate-*l*36.1%
unpow236.1%
Simplified36.1%
distribute-frac-neg36.1%
Applied egg-rr48.7%
if 1.9500000000000001e88 < B Initial program 7.3%
Simplified7.4%
Taylor expanded in A around 0 17.0%
mul-1-neg17.0%
distribute-rgt-neg-in17.0%
*-commutative17.0%
unpow217.0%
unpow217.0%
hypot-def53.6%
Simplified53.6%
sqrt-prod72.5%
Applied egg-rr72.5%
Taylor expanded in C around 0 67.6%
Final simplification29.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* (* C A) -4.0))) (t_1 (- (* B B) (* 4.0 (* C A)))))
(if (<= B 7.4e-242)
(/ (- (sqrt (* 2.0 (* F (* t_0 (* 2.0 C)))))) t_1)
(if (<= B 5.8e-123)
(/ (- (sqrt (* 2.0 (* F (* (* 2.0 A) t_0))))) t_1)
(if (<= B 1.85e+89)
(- (/ (sqrt (* 2.0 (* (* F t_1) (+ C (+ A (hypot B (- A C))))))) t_1))
(* (/ (sqrt 2.0) B) (* (sqrt B) (- (sqrt F)))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + ((C * A) * -4.0);
double t_1 = (B * B) - (4.0 * (C * A));
double tmp;
if (B <= 7.4e-242) {
tmp = -sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1;
} else if (B <= 5.8e-123) {
tmp = -sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / t_1;
} else if (B <= 1.85e+89) {
tmp = -(sqrt((2.0 * ((F * t_1) * (C + (A + hypot(B, (A - C))))))) / t_1);
} else {
tmp = (sqrt(2.0) / B) * (sqrt(B) * -sqrt(F));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + ((C * A) * -4.0);
double t_1 = (B * B) - (4.0 * (C * A));
double tmp;
if (B <= 7.4e-242) {
tmp = -Math.sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1;
} else if (B <= 5.8e-123) {
tmp = -Math.sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / t_1;
} else if (B <= 1.85e+89) {
tmp = -(Math.sqrt((2.0 * ((F * t_1) * (C + (A + Math.hypot(B, (A - C))))))) / t_1);
} else {
tmp = (Math.sqrt(2.0) / B) * (Math.sqrt(B) * -Math.sqrt(F));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + ((C * A) * -4.0) t_1 = (B * B) - (4.0 * (C * A)) tmp = 0 if B <= 7.4e-242: tmp = -math.sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1 elif B <= 5.8e-123: tmp = -math.sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / t_1 elif B <= 1.85e+89: tmp = -(math.sqrt((2.0 * ((F * t_1) * (C + (A + math.hypot(B, (A - C))))))) / t_1) else: tmp = (math.sqrt(2.0) / B) * (math.sqrt(B) * -math.sqrt(F)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(Float64(C * A) * -4.0)) t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (B <= 7.4e-242) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(t_0 * Float64(2.0 * C)))))) / t_1); elseif (B <= 5.8e-123) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(Float64(2.0 * A) * t_0))))) / t_1); elseif (B <= 1.85e+89) tmp = Float64(-Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_1) * Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / t_1)); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(B) * Float64(-sqrt(F)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + ((C * A) * -4.0); t_1 = (B * B) - (4.0 * (C * A)); tmp = 0.0; if (B <= 7.4e-242) tmp = -sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1; elseif (B <= 5.8e-123) tmp = -sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / t_1; elseif (B <= 1.85e+89) tmp = -(sqrt((2.0 * ((F * t_1) * (C + (A + hypot(B, (A - C))))))) / t_1); else tmp = (sqrt(2.0) / B) * (sqrt(B) * -sqrt(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[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 7.4e-242], N[((-N[Sqrt[N[(2.0 * N[(F * N[(t$95$0 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[B, 5.8e-123], N[((-N[Sqrt[N[(2.0 * N[(F * N[(N[(2.0 * A), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[B, 1.85e+89], (-N[(N[Sqrt[N[(2.0 * N[(N[(F * t$95$1), $MachinePrecision] * N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]), N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[B], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + \left(C \cdot A\right) \cdot -4\\
t_1 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;B \leq 7.4 \cdot 10^{-242}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(t_0 \cdot \left(2 \cdot C\right)\right)\right)}}{t_1}\\
\mathbf{elif}\;B \leq 5.8 \cdot 10^{-123}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(\left(2 \cdot A\right) \cdot t_0\right)\right)}}{t_1}\\
\mathbf{elif}\;B \leq 1.85 \cdot 10^{+89}:\\
\;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(F \cdot t_1\right) \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{B} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < 7.39999999999999994e-242Initial program 16.0%
associate-*l*16.0%
unpow216.0%
+-commutative16.0%
unpow216.0%
associate-*l*16.0%
unpow216.0%
Simplified16.0%
*-un-lft-identity16.0%
associate-*l*16.0%
*-commutative16.0%
*-commutative16.0%
unpow216.0%
hypot-udef19.0%
+-commutative19.0%
associate-+r+20.1%
Applied egg-rr20.1%
*-lft-identity20.1%
associate-*r*20.1%
fma-neg20.1%
*-commutative20.1%
*-commutative20.1%
distribute-rgt-neg-in20.1%
*-commutative20.1%
metadata-eval20.1%
associate-*r*20.1%
associate-*r*20.1%
associate-*l*17.4%
Simplified16.6%
Taylor expanded in A around -inf 10.6%
*-commutative10.6%
Simplified10.6%
if 7.39999999999999994e-242 < B < 5.80000000000000007e-123Initial program 8.6%
associate-*l*8.6%
unpow28.6%
+-commutative8.6%
unpow28.6%
associate-*l*8.6%
unpow28.6%
Simplified8.6%
*-un-lft-identity8.6%
associate-*l*8.6%
*-commutative8.6%
*-commutative8.6%
unpow28.6%
hypot-udef12.2%
+-commutative12.2%
associate-+r+13.3%
Applied egg-rr13.3%
*-lft-identity13.3%
associate-*r*13.3%
fma-neg13.3%
*-commutative13.3%
*-commutative13.3%
distribute-rgt-neg-in13.3%
*-commutative13.3%
metadata-eval13.3%
associate-*r*13.3%
associate-*r*13.3%
associate-*l*13.3%
Simplified12.2%
Taylor expanded in A around inf 5.5%
associate-+r+23.8%
distribute-rgt1-in23.8%
metadata-eval23.8%
mul0-lft23.8%
Simplified23.8%
if 5.80000000000000007e-123 < B < 1.8499999999999999e89Initial program 36.1%
associate-*l*36.1%
unpow236.1%
+-commutative36.1%
unpow236.1%
associate-*l*36.1%
unpow236.1%
Simplified36.1%
distribute-frac-neg36.1%
Applied egg-rr48.7%
if 1.8499999999999999e89 < B Initial program 7.3%
Simplified7.4%
Taylor expanded in A around 0 17.0%
mul-1-neg17.0%
distribute-rgt-neg-in17.0%
*-commutative17.0%
unpow217.0%
unpow217.0%
hypot-def53.6%
Simplified53.6%
sqrt-prod72.5%
Applied egg-rr72.5%
Taylor expanded in C around 0 67.6%
Final simplification28.5%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* (* C A) -4.0))) (t_1 (- (* B B) (* 4.0 (* C A)))))
(if (<= B 9e-242)
(/ (- (sqrt (* 2.0 (* F (* t_0 (* 2.0 C)))))) t_1)
(if (<= B 1e-123)
(/ (- (sqrt (* 2.0 (* F (* (* 2.0 A) t_0))))) t_1)
(if (<= B 1.12e+88)
(- (/ (sqrt (* 2.0 (* (* F t_1) (+ C (+ A (hypot B (- A C))))))) t_1))
(* (/ (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) + ((C * A) * -4.0);
double t_1 = (B * B) - (4.0 * (C * A));
double tmp;
if (B <= 9e-242) {
tmp = -sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1;
} else if (B <= 1e-123) {
tmp = -sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / t_1;
} else if (B <= 1.12e+88) {
tmp = -(sqrt((2.0 * ((F * t_1) * (C + (A + hypot(B, (A - C))))))) / t_1);
} 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) + ((C * A) * -4.0);
double t_1 = (B * B) - (4.0 * (C * A));
double tmp;
if (B <= 9e-242) {
tmp = -Math.sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1;
} else if (B <= 1e-123) {
tmp = -Math.sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / t_1;
} else if (B <= 1.12e+88) {
tmp = -(Math.sqrt((2.0 * ((F * t_1) * (C + (A + Math.hypot(B, (A - C))))))) / t_1);
} 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) + ((C * A) * -4.0) t_1 = (B * B) - (4.0 * (C * A)) tmp = 0 if B <= 9e-242: tmp = -math.sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1 elif B <= 1e-123: tmp = -math.sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / t_1 elif B <= 1.12e+88: tmp = -(math.sqrt((2.0 * ((F * t_1) * (C + (A + math.hypot(B, (A - C))))))) / t_1) 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(Float64(C * A) * -4.0)) t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (B <= 9e-242) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(t_0 * Float64(2.0 * C)))))) / t_1); elseif (B <= 1e-123) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(Float64(2.0 * A) * t_0))))) / t_1); elseif (B <= 1.12e+88) tmp = Float64(-Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_1) * Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / t_1)); 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) + ((C * A) * -4.0); t_1 = (B * B) - (4.0 * (C * A)); tmp = 0.0; if (B <= 9e-242) tmp = -sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1; elseif (B <= 1e-123) tmp = -sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / t_1; elseif (B <= 1.12e+88) tmp = -(sqrt((2.0 * ((F * t_1) * (C + (A + hypot(B, (A - C))))))) / t_1); 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[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 9e-242], N[((-N[Sqrt[N[(2.0 * N[(F * N[(t$95$0 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[B, 1e-123], N[((-N[Sqrt[N[(2.0 * N[(F * N[(N[(2.0 * A), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[B, 1.12e+88], (-N[(N[Sqrt[N[(2.0 * N[(N[(F * t$95$1), $MachinePrecision] * N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $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 + \left(C \cdot A\right) \cdot -4\\
t_1 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;B \leq 9 \cdot 10^{-242}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(t_0 \cdot \left(2 \cdot C\right)\right)\right)}}{t_1}\\
\mathbf{elif}\;B \leq 10^{-123}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(\left(2 \cdot A\right) \cdot t_0\right)\right)}}{t_1}\\
\mathbf{elif}\;B \leq 1.12 \cdot 10^{+88}:\\
\;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(F \cdot t_1\right) \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\
\end{array}
\end{array}
if B < 8.9999999999999997e-242Initial program 16.0%
associate-*l*16.0%
unpow216.0%
+-commutative16.0%
unpow216.0%
associate-*l*16.0%
unpow216.0%
Simplified16.0%
*-un-lft-identity16.0%
associate-*l*16.0%
*-commutative16.0%
*-commutative16.0%
unpow216.0%
hypot-udef19.0%
+-commutative19.0%
associate-+r+20.1%
Applied egg-rr20.1%
*-lft-identity20.1%
associate-*r*20.1%
fma-neg20.1%
*-commutative20.1%
*-commutative20.1%
distribute-rgt-neg-in20.1%
*-commutative20.1%
metadata-eval20.1%
associate-*r*20.1%
associate-*r*20.1%
associate-*l*17.4%
Simplified16.6%
Taylor expanded in A around -inf 10.6%
*-commutative10.6%
Simplified10.6%
if 8.9999999999999997e-242 < B < 1.0000000000000001e-123Initial program 8.6%
associate-*l*8.6%
unpow28.6%
+-commutative8.6%
unpow28.6%
associate-*l*8.6%
unpow28.6%
Simplified8.6%
*-un-lft-identity8.6%
associate-*l*8.6%
*-commutative8.6%
*-commutative8.6%
unpow28.6%
hypot-udef12.2%
+-commutative12.2%
associate-+r+13.3%
Applied egg-rr13.3%
*-lft-identity13.3%
associate-*r*13.3%
fma-neg13.3%
*-commutative13.3%
*-commutative13.3%
distribute-rgt-neg-in13.3%
*-commutative13.3%
metadata-eval13.3%
associate-*r*13.3%
associate-*r*13.3%
associate-*l*13.3%
Simplified12.2%
Taylor expanded in A around inf 5.5%
associate-+r+23.8%
distribute-rgt1-in23.8%
metadata-eval23.8%
mul0-lft23.8%
Simplified23.8%
if 1.0000000000000001e-123 < B < 1.12000000000000006e88Initial program 36.1%
associate-*l*36.1%
unpow236.1%
+-commutative36.1%
unpow236.1%
associate-*l*36.1%
unpow236.1%
Simplified36.1%
distribute-frac-neg36.1%
Applied egg-rr48.7%
if 1.12000000000000006e88 < B Initial program 7.3%
Simplified7.4%
Taylor expanded in A around 0 17.0%
mul-1-neg17.0%
distribute-rgt-neg-in17.0%
*-commutative17.0%
unpow217.0%
unpow217.0%
hypot-def53.6%
Simplified53.6%
Taylor expanded in C around 0 50.7%
Final simplification25.5%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= F 3.5e-303)
(/
(- (sqrt (* 2.0 (* (+ C (+ A (hypot B (- A C)))) (* F (* C (* A -4.0)))))))
(- (* B B) (* 4.0 (* C A))))
(if (<= F 1.85e+29)
(* (/ (sqrt 2.0) B) (- (sqrt (* B F))))
(- (* (sqrt 2.0) (sqrt (/ F B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= 3.5e-303) {
tmp = -sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * (C * (A * -4.0)))))) / ((B * B) - (4.0 * (C * A)));
} else if (F <= 1.85e+29) {
tmp = (sqrt(2.0) / B) * -sqrt((B * F));
} else {
tmp = -(sqrt(2.0) * sqrt((F / B)));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (F <= 3.5e-303) {
tmp = -Math.sqrt((2.0 * ((C + (A + Math.hypot(B, (A - C)))) * (F * (C * (A * -4.0)))))) / ((B * B) - (4.0 * (C * A)));
} else if (F <= 1.85e+29) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((B * F));
} else {
tmp = -(Math.sqrt(2.0) * Math.sqrt((F / B)));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if F <= 3.5e-303: tmp = -math.sqrt((2.0 * ((C + (A + math.hypot(B, (A - C)))) * (F * (C * (A * -4.0)))))) / ((B * B) - (4.0 * (C * A))) elif F <= 1.85e+29: tmp = (math.sqrt(2.0) / B) * -math.sqrt((B * F)) else: tmp = -(math.sqrt(2.0) * math.sqrt((F / B))) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= 3.5e-303) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(C + Float64(A + hypot(B, Float64(A - C)))) * Float64(F * Float64(C * Float64(A * -4.0))))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(C * A)))); elseif (F <= 1.85e+29) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(B * F)))); else tmp = Float64(-Float64(sqrt(2.0) * sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (F <= 3.5e-303) tmp = -sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * (C * (A * -4.0)))))) / ((B * B) - (4.0 * (C * A))); elseif (F <= 1.85e+29) tmp = (sqrt(2.0) / B) * -sqrt((B * F)); else tmp = -(sqrt(2.0) * sqrt((F / B))); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[F, 3.5e-303], N[((-N[Sqrt[N[(2.0 * N[(N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.85e+29], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], (-N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision])]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.5 \cdot 10^{-303}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot \left(C \cdot \left(A \cdot -4\right)\right)\right)\right)}}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\
\mathbf{elif}\;F \leq 1.85 \cdot 10^{+29}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{2} \cdot \sqrt{\frac{F}{B}}\\
\end{array}
\end{array}
if F < 3.5e-303Initial program 22.8%
associate-*l*22.8%
unpow222.8%
+-commutative22.8%
unpow222.8%
associate-*l*22.8%
unpow222.8%
Simplified22.8%
distribute-frac-neg22.8%
Applied egg-rr32.8%
Taylor expanded in B around 0 32.8%
associate-*r*32.8%
*-commutative32.8%
*-commutative32.8%
Simplified32.8%
if 3.5e-303 < F < 1.84999999999999987e29Initial program 18.6%
Simplified23.3%
Taylor expanded in A around 0 9.0%
mul-1-neg9.0%
distribute-rgt-neg-in9.0%
*-commutative9.0%
unpow29.0%
unpow29.0%
hypot-def22.0%
Simplified22.0%
Taylor expanded in C around 0 19.9%
if 1.84999999999999987e29 < F Initial program 12.5%
Simplified15.5%
Taylor expanded in B around inf 4.2%
Taylor expanded in C around 0 18.2%
associate-*r*18.2%
mul-1-neg18.2%
Simplified18.2%
Final simplification21.1%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* (* C A) -4.0)))
(t_1 (- (* B B) (* 4.0 (* C A))))
(t_2 (/ (- (sqrt (* 2.0 (* F (* t_0 (* 2.0 C)))))) t_1)))
(if (<= B 6.8e-242)
t_2
(if (<= B 3.3e-78)
(/ (- (sqrt (* 2.0 (* F (* (* 2.0 A) t_0))))) t_1)
(if (<= B 8.6e-48)
t_2
(if (<= B 3.2e-24)
(/ (- (sqrt (* (* F C) (* -16.0 (* A A))))) t_1)
(- (* (sqrt 2.0) (sqrt (/ F B))))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + ((C * A) * -4.0);
double t_1 = (B * B) - (4.0 * (C * A));
double t_2 = -sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1;
double tmp;
if (B <= 6.8e-242) {
tmp = t_2;
} else if (B <= 3.3e-78) {
tmp = -sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / t_1;
} else if (B <= 8.6e-48) {
tmp = t_2;
} else if (B <= 3.2e-24) {
tmp = -sqrt(((F * C) * (-16.0 * (A * A)))) / t_1;
} else {
tmp = -(sqrt(2.0) * sqrt((F / B)));
}
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) + ((c * a) * (-4.0d0))
t_1 = (b * b) - (4.0d0 * (c * a))
t_2 = -sqrt((2.0d0 * (f * (t_0 * (2.0d0 * c))))) / t_1
if (b <= 6.8d-242) then
tmp = t_2
else if (b <= 3.3d-78) then
tmp = -sqrt((2.0d0 * (f * ((2.0d0 * a) * t_0)))) / t_1
else if (b <= 8.6d-48) then
tmp = t_2
else if (b <= 3.2d-24) then
tmp = -sqrt(((f * c) * ((-16.0d0) * (a * a)))) / t_1
else
tmp = -(sqrt(2.0d0) * sqrt((f / b)))
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) + ((C * A) * -4.0);
double t_1 = (B * B) - (4.0 * (C * A));
double t_2 = -Math.sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1;
double tmp;
if (B <= 6.8e-242) {
tmp = t_2;
} else if (B <= 3.3e-78) {
tmp = -Math.sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / t_1;
} else if (B <= 8.6e-48) {
tmp = t_2;
} else if (B <= 3.2e-24) {
tmp = -Math.sqrt(((F * C) * (-16.0 * (A * A)))) / t_1;
} else {
tmp = -(Math.sqrt(2.0) * Math.sqrt((F / B)));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + ((C * A) * -4.0) t_1 = (B * B) - (4.0 * (C * A)) t_2 = -math.sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1 tmp = 0 if B <= 6.8e-242: tmp = t_2 elif B <= 3.3e-78: tmp = -math.sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / t_1 elif B <= 8.6e-48: tmp = t_2 elif B <= 3.2e-24: tmp = -math.sqrt(((F * C) * (-16.0 * (A * A)))) / t_1 else: tmp = -(math.sqrt(2.0) * math.sqrt((F / B))) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(Float64(C * A) * -4.0)) t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) t_2 = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(t_0 * Float64(2.0 * C)))))) / t_1) tmp = 0.0 if (B <= 6.8e-242) tmp = t_2; elseif (B <= 3.3e-78) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(Float64(2.0 * A) * t_0))))) / t_1); elseif (B <= 8.6e-48) tmp = t_2; elseif (B <= 3.2e-24) tmp = Float64(Float64(-sqrt(Float64(Float64(F * C) * Float64(-16.0 * Float64(A * A))))) / t_1); else tmp = Float64(-Float64(sqrt(2.0) * sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + ((C * A) * -4.0); t_1 = (B * B) - (4.0 * (C * A)); t_2 = -sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1; tmp = 0.0; if (B <= 6.8e-242) tmp = t_2; elseif (B <= 3.3e-78) tmp = -sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / t_1; elseif (B <= 8.6e-48) tmp = t_2; elseif (B <= 3.2e-24) tmp = -sqrt(((F * C) * (-16.0 * (A * A)))) / t_1; else tmp = -(sqrt(2.0) * sqrt((F / 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[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[Sqrt[N[(2.0 * N[(F * N[(t$95$0 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]}, If[LessEqual[B, 6.8e-242], t$95$2, If[LessEqual[B, 3.3e-78], N[((-N[Sqrt[N[(2.0 * N[(F * N[(N[(2.0 * A), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[B, 8.6e-48], t$95$2, If[LessEqual[B, 3.2e-24], N[((-N[Sqrt[N[(N[(F * C), $MachinePrecision] * N[(-16.0 * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], (-N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision])]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + \left(C \cdot A\right) \cdot -4\\
t_1 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
t_2 := \frac{-\sqrt{2 \cdot \left(F \cdot \left(t_0 \cdot \left(2 \cdot C\right)\right)\right)}}{t_1}\\
\mathbf{if}\;B \leq 6.8 \cdot 10^{-242}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;B \leq 3.3 \cdot 10^{-78}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(\left(2 \cdot A\right) \cdot t_0\right)\right)}}{t_1}\\
\mathbf{elif}\;B \leq 8.6 \cdot 10^{-48}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;B \leq 3.2 \cdot 10^{-24}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot C\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{t_1}\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{2} \cdot \sqrt{\frac{F}{B}}\\
\end{array}
\end{array}
if B < 6.8000000000000001e-242 or 3.29999999999999982e-78 < B < 8.6e-48Initial program 17.1%
associate-*l*17.1%
unpow217.1%
+-commutative17.1%
unpow217.1%
associate-*l*17.1%
unpow217.1%
Simplified17.1%
*-un-lft-identity17.1%
associate-*l*17.1%
*-commutative17.1%
*-commutative17.1%
unpow217.1%
hypot-udef21.1%
+-commutative21.1%
associate-+r+22.3%
Applied egg-rr22.3%
*-lft-identity22.3%
associate-*r*22.3%
fma-neg22.3%
*-commutative22.3%
*-commutative22.3%
distribute-rgt-neg-in22.3%
*-commutative22.3%
metadata-eval22.3%
associate-*r*22.3%
associate-*r*22.3%
associate-*l*19.8%
Simplified18.9%
Taylor expanded in A around -inf 13.9%
*-commutative13.9%
Simplified13.9%
if 6.8000000000000001e-242 < B < 3.29999999999999982e-78Initial program 12.9%
associate-*l*12.9%
unpow212.9%
+-commutative12.9%
unpow212.9%
associate-*l*12.9%
unpow212.9%
Simplified12.9%
*-un-lft-identity12.9%
associate-*l*12.9%
*-commutative12.9%
*-commutative12.9%
unpow212.9%
hypot-udef18.3%
+-commutative18.3%
associate-+r+19.2%
Applied egg-rr19.2%
*-lft-identity19.2%
associate-*r*19.2%
fma-neg19.2%
*-commutative19.2%
*-commutative19.2%
distribute-rgt-neg-in19.2%
*-commutative19.2%
metadata-eval19.2%
associate-*r*19.2%
associate-*r*19.2%
associate-*l*16.7%
Simplified15.8%
Taylor expanded in A around inf 7.5%
associate-+r+22.5%
distribute-rgt1-in22.5%
metadata-eval22.5%
mul0-lft22.5%
Simplified22.5%
if 8.6e-48 < B < 3.20000000000000012e-24Initial program 4.0%
associate-*l*4.0%
unpow24.0%
+-commutative4.0%
unpow24.0%
associate-*l*4.0%
unpow24.0%
Simplified4.0%
Taylor expanded in A around inf 2.2%
Taylor expanded in A around inf 4.0%
associate-*r*4.0%
unpow24.0%
*-commutative4.0%
Simplified4.0%
if 3.20000000000000012e-24 < B Initial program 18.7%
Simplified21.8%
Taylor expanded in B around inf 14.9%
Taylor expanded in C around 0 41.4%
associate-*r*41.4%
mul-1-neg41.4%
Simplified41.4%
Final simplification22.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= F 3.2e-303)
(/
(- (sqrt (* 2.0 (* F (* (+ (* B B) (* (* C A) -4.0)) (* 2.0 C))))))
(- (* B B) (* 4.0 (* C A))))
(if (<= F 2.25e+29)
(* (/ (sqrt 2.0) B) (- (sqrt (* B F))))
(- (* (sqrt 2.0) (sqrt (/ F B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= 3.2e-303) {
tmp = -sqrt((2.0 * (F * (((B * B) + ((C * A) * -4.0)) * (2.0 * C))))) / ((B * B) - (4.0 * (C * A)));
} else if (F <= 2.25e+29) {
tmp = (sqrt(2.0) / B) * -sqrt((B * F));
} else {
tmp = -(sqrt(2.0) * sqrt((F / B)));
}
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) :: tmp
if (f <= 3.2d-303) then
tmp = -sqrt((2.0d0 * (f * (((b * b) + ((c * a) * (-4.0d0))) * (2.0d0 * c))))) / ((b * b) - (4.0d0 * (c * a)))
else if (f <= 2.25d+29) then
tmp = (sqrt(2.0d0) / b) * -sqrt((b * f))
else
tmp = -(sqrt(2.0d0) * sqrt((f / b)))
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (F <= 3.2e-303) {
tmp = -Math.sqrt((2.0 * (F * (((B * B) + ((C * A) * -4.0)) * (2.0 * C))))) / ((B * B) - (4.0 * (C * A)));
} else if (F <= 2.25e+29) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((B * F));
} else {
tmp = -(Math.sqrt(2.0) * Math.sqrt((F / B)));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if F <= 3.2e-303: tmp = -math.sqrt((2.0 * (F * (((B * B) + ((C * A) * -4.0)) * (2.0 * C))))) / ((B * B) - (4.0 * (C * A))) elif F <= 2.25e+29: tmp = (math.sqrt(2.0) / B) * -math.sqrt((B * F)) else: tmp = -(math.sqrt(2.0) * math.sqrt((F / B))) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= 3.2e-303) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(Float64(Float64(B * B) + Float64(Float64(C * A) * -4.0)) * Float64(2.0 * C)))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(C * A)))); elseif (F <= 2.25e+29) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(B * F)))); else tmp = Float64(-Float64(sqrt(2.0) * sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (F <= 3.2e-303) tmp = -sqrt((2.0 * (F * (((B * B) + ((C * A) * -4.0)) * (2.0 * C))))) / ((B * B) - (4.0 * (C * A))); elseif (F <= 2.25e+29) tmp = (sqrt(2.0) / B) * -sqrt((B * F)); else tmp = -(sqrt(2.0) * sqrt((F / B))); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[F, 3.2e-303], N[((-N[Sqrt[N[(2.0 * N[(F * N[(N[(N[(B * B), $MachinePrecision] + N[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.25e+29], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], (-N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision])]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.2 \cdot 10^{-303}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(\left(B \cdot B + \left(C \cdot A\right) \cdot -4\right) \cdot \left(2 \cdot C\right)\right)\right)}}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\
\mathbf{elif}\;F \leq 2.25 \cdot 10^{+29}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{2} \cdot \sqrt{\frac{F}{B}}\\
\end{array}
\end{array}
if F < 3.19999999999999991e-303Initial program 22.8%
associate-*l*22.8%
unpow222.8%
+-commutative22.8%
unpow222.8%
associate-*l*22.8%
unpow222.8%
Simplified22.8%
*-un-lft-identity22.8%
associate-*l*22.8%
*-commutative22.8%
*-commutative22.8%
unpow222.8%
hypot-udef32.8%
+-commutative32.8%
associate-+r+32.8%
Applied egg-rr32.8%
*-lft-identity32.8%
associate-*r*32.8%
fma-neg32.8%
*-commutative32.8%
*-commutative32.8%
distribute-rgt-neg-in32.8%
*-commutative32.8%
metadata-eval32.8%
associate-*r*32.8%
associate-*r*32.8%
associate-*l*30.4%
Simplified30.4%
Taylor expanded in A around -inf 20.6%
*-commutative20.6%
Simplified20.6%
if 3.19999999999999991e-303 < F < 2.2500000000000001e29Initial program 18.6%
Simplified23.3%
Taylor expanded in A around 0 9.0%
mul-1-neg9.0%
distribute-rgt-neg-in9.0%
*-commutative9.0%
unpow29.0%
unpow29.0%
hypot-def22.0%
Simplified22.0%
Taylor expanded in C around 0 19.9%
if 2.2500000000000001e29 < F Initial program 12.5%
Simplified15.5%
Taylor expanded in B around inf 4.2%
Taylor expanded in C around 0 18.2%
associate-*r*18.2%
mul-1-neg18.2%
Simplified18.2%
Final simplification19.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* (* C A) -4.0))) (t_1 (- (* B B) (* 4.0 (* C A)))))
(if (<= A -2.5e-121)
(/ (- (sqrt (* 2.0 (* F (* t_0 (* 2.0 C)))))) t_1)
(if (<= A 1.15e-110)
(/ (- (sqrt (* 2.0 (* F (* t_0 (+ A (+ B C))))))) t_1)
(/ (- (sqrt (* 2.0 (* F (* (* 2.0 A) t_0))))) t_1)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + ((C * A) * -4.0);
double t_1 = (B * B) - (4.0 * (C * A));
double tmp;
if (A <= -2.5e-121) {
tmp = -sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1;
} else if (A <= 1.15e-110) {
tmp = -sqrt((2.0 * (F * (t_0 * (A + (B + C)))))) / t_1;
} else {
tmp = -sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / 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) :: tmp
t_0 = (b * b) + ((c * a) * (-4.0d0))
t_1 = (b * b) - (4.0d0 * (c * a))
if (a <= (-2.5d-121)) then
tmp = -sqrt((2.0d0 * (f * (t_0 * (2.0d0 * c))))) / t_1
else if (a <= 1.15d-110) then
tmp = -sqrt((2.0d0 * (f * (t_0 * (a + (b + c)))))) / t_1
else
tmp = -sqrt((2.0d0 * (f * ((2.0d0 * a) * t_0)))) / 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) + ((C * A) * -4.0);
double t_1 = (B * B) - (4.0 * (C * A));
double tmp;
if (A <= -2.5e-121) {
tmp = -Math.sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1;
} else if (A <= 1.15e-110) {
tmp = -Math.sqrt((2.0 * (F * (t_0 * (A + (B + C)))))) / t_1;
} else {
tmp = -Math.sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / t_1;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + ((C * A) * -4.0) t_1 = (B * B) - (4.0 * (C * A)) tmp = 0 if A <= -2.5e-121: tmp = -math.sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1 elif A <= 1.15e-110: tmp = -math.sqrt((2.0 * (F * (t_0 * (A + (B + C)))))) / t_1 else: tmp = -math.sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / t_1 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(Float64(C * A) * -4.0)) t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (A <= -2.5e-121) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(t_0 * Float64(2.0 * C)))))) / t_1); elseif (A <= 1.15e-110) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(t_0 * Float64(A + Float64(B + C))))))) / t_1); else tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(Float64(2.0 * A) * t_0))))) / t_1); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + ((C * A) * -4.0); t_1 = (B * B) - (4.0 * (C * A)); tmp = 0.0; if (A <= -2.5e-121) tmp = -sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1; elseif (A <= 1.15e-110) tmp = -sqrt((2.0 * (F * (t_0 * (A + (B + C)))))) / t_1; else tmp = -sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / 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[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -2.5e-121], N[((-N[Sqrt[N[(2.0 * N[(F * N[(t$95$0 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[A, 1.15e-110], N[((-N[Sqrt[N[(2.0 * N[(F * N[(t$95$0 * N[(A + N[(B + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(F * N[(N[(2.0 * A), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + \left(C \cdot A\right) \cdot -4\\
t_1 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;A \leq -2.5 \cdot 10^{-121}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(t_0 \cdot \left(2 \cdot C\right)\right)\right)}}{t_1}\\
\mathbf{elif}\;A \leq 1.15 \cdot 10^{-110}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(t_0 \cdot \left(A + \left(B + C\right)\right)\right)\right)}}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(\left(2 \cdot A\right) \cdot t_0\right)\right)}}{t_1}\\
\end{array}
\end{array}
if A < -2.49999999999999995e-121Initial program 11.0%
associate-*l*11.0%
unpow211.0%
+-commutative11.0%
unpow211.0%
associate-*l*11.0%
unpow211.0%
Simplified11.0%
*-un-lft-identity11.0%
associate-*l*11.0%
*-commutative11.0%
*-commutative11.0%
unpow211.0%
hypot-udef12.3%
+-commutative12.3%
associate-+r+15.0%
Applied egg-rr15.0%
*-lft-identity15.0%
associate-*r*15.0%
fma-neg15.0%
*-commutative15.0%
*-commutative15.0%
distribute-rgt-neg-in15.0%
*-commutative15.0%
metadata-eval15.0%
associate-*r*15.0%
associate-*r*15.0%
associate-*l*13.4%
Simplified11.4%
Taylor expanded in A around -inf 21.6%
*-commutative21.6%
Simplified21.6%
if -2.49999999999999995e-121 < A < 1.1500000000000001e-110Initial program 19.3%
associate-*l*19.3%
unpow219.3%
+-commutative19.3%
unpow219.3%
associate-*l*19.3%
unpow219.3%
Simplified19.3%
*-un-lft-identity19.3%
associate-*l*19.3%
*-commutative19.3%
*-commutative19.3%
unpow219.3%
hypot-udef23.2%
+-commutative23.2%
associate-+r+23.2%
Applied egg-rr23.2%
*-lft-identity23.2%
associate-*r*23.2%
fma-neg23.2%
*-commutative23.2%
*-commutative23.2%
distribute-rgt-neg-in23.2%
*-commutative23.2%
metadata-eval23.2%
associate-*r*23.2%
associate-*r*23.2%
associate-*l*20.8%
Simplified20.8%
Taylor expanded in B around inf 9.9%
if 1.1500000000000001e-110 < A Initial program 19.7%
associate-*l*19.7%
unpow219.7%
+-commutative19.7%
unpow219.7%
associate-*l*19.7%
unpow219.7%
Simplified19.7%
*-un-lft-identity19.7%
associate-*l*19.7%
*-commutative19.7%
*-commutative19.7%
unpow219.7%
hypot-udef25.8%
+-commutative25.8%
associate-+r+25.8%
Applied egg-rr25.8%
*-lft-identity25.8%
associate-*r*25.8%
fma-neg25.8%
*-commutative25.8%
*-commutative25.8%
distribute-rgt-neg-in25.8%
*-commutative25.8%
metadata-eval25.8%
associate-*r*25.8%
associate-*r*25.8%
associate-*l*21.3%
Simplified21.3%
Taylor expanded in A around inf 14.6%
associate-+r+22.7%
distribute-rgt1-in22.7%
metadata-eval22.7%
mul0-lft22.7%
Simplified22.7%
Final simplification18.5%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* (* C A) -4.0))) (t_1 (- (* B B) (* 4.0 (* C A)))))
(if (<= C -6.6e-128)
(/ (- (sqrt (* 2.0 (* -8.0 (* F (* C (* A A))))))) t_1)
(if (<= C 2.12e-50)
(/ (- (sqrt (* 2.0 (* F (* B t_0))))) t_1)
(/ (- (sqrt (* 2.0 (* F (* t_0 (* 2.0 C)))))) t_1)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + ((C * A) * -4.0);
double t_1 = (B * B) - (4.0 * (C * A));
double tmp;
if (C <= -6.6e-128) {
tmp = -sqrt((2.0 * (-8.0 * (F * (C * (A * A)))))) / t_1;
} else if (C <= 2.12e-50) {
tmp = -sqrt((2.0 * (F * (B * t_0)))) / t_1;
} else {
tmp = -sqrt((2.0 * (F * (t_0 * (2.0 * 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) :: tmp
t_0 = (b * b) + ((c * a) * (-4.0d0))
t_1 = (b * b) - (4.0d0 * (c * a))
if (c <= (-6.6d-128)) then
tmp = -sqrt((2.0d0 * ((-8.0d0) * (f * (c * (a * a)))))) / t_1
else if (c <= 2.12d-50) then
tmp = -sqrt((2.0d0 * (f * (b * t_0)))) / t_1
else
tmp = -sqrt((2.0d0 * (f * (t_0 * (2.0d0 * 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) + ((C * A) * -4.0);
double t_1 = (B * B) - (4.0 * (C * A));
double tmp;
if (C <= -6.6e-128) {
tmp = -Math.sqrt((2.0 * (-8.0 * (F * (C * (A * A)))))) / t_1;
} else if (C <= 2.12e-50) {
tmp = -Math.sqrt((2.0 * (F * (B * t_0)))) / t_1;
} else {
tmp = -Math.sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + ((C * A) * -4.0) t_1 = (B * B) - (4.0 * (C * A)) tmp = 0 if C <= -6.6e-128: tmp = -math.sqrt((2.0 * (-8.0 * (F * (C * (A * A)))))) / t_1 elif C <= 2.12e-50: tmp = -math.sqrt((2.0 * (F * (B * t_0)))) / t_1 else: tmp = -math.sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(Float64(C * A) * -4.0)) t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (C <= -6.6e-128) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(-8.0 * Float64(F * Float64(C * Float64(A * A))))))) / t_1); elseif (C <= 2.12e-50) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(B * t_0))))) / t_1); else tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(t_0 * Float64(2.0 * C)))))) / t_1); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + ((C * A) * -4.0); t_1 = (B * B) - (4.0 * (C * A)); tmp = 0.0; if (C <= -6.6e-128) tmp = -sqrt((2.0 * (-8.0 * (F * (C * (A * A)))))) / t_1; elseif (C <= 2.12e-50) tmp = -sqrt((2.0 * (F * (B * t_0)))) / t_1; else tmp = -sqrt((2.0 * (F * (t_0 * (2.0 * 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[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -6.6e-128], N[((-N[Sqrt[N[(2.0 * N[(-8.0 * N[(F * N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[C, 2.12e-50], N[((-N[Sqrt[N[(2.0 * N[(F * N[(B * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(F * N[(t$95$0 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + \left(C \cdot A\right) \cdot -4\\
t_1 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;C \leq -6.6 \cdot 10^{-128}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(-8 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)\right)}}{t_1}\\
\mathbf{elif}\;C \leq 2.12 \cdot 10^{-50}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot t_0\right)\right)}}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(t_0 \cdot \left(2 \cdot C\right)\right)\right)}}{t_1}\\
\end{array}
\end{array}
if C < -6.6e-128Initial program 7.1%
associate-*l*7.1%
unpow27.1%
+-commutative7.1%
unpow27.1%
associate-*l*7.1%
unpow27.1%
Simplified7.1%
*-un-lft-identity7.1%
associate-*l*7.1%
*-commutative7.1%
*-commutative7.1%
unpow27.1%
hypot-udef8.7%
+-commutative8.7%
associate-+r+9.7%
Applied egg-rr9.7%
*-lft-identity9.7%
associate-*r*9.7%
fma-neg9.7%
*-commutative9.7%
*-commutative9.7%
distribute-rgt-neg-in9.7%
*-commutative9.7%
metadata-eval9.7%
associate-*r*9.7%
associate-*r*9.7%
associate-*l*8.7%
Simplified7.8%
Taylor expanded in B around 0 18.6%
associate-*r*20.8%
unpow220.8%
Simplified20.8%
if -6.6e-128 < C < 2.1199999999999999e-50Initial program 25.6%
associate-*l*25.6%
unpow225.6%
+-commutative25.6%
unpow225.6%
associate-*l*25.6%
unpow225.6%
Simplified25.6%
*-un-lft-identity25.6%
associate-*l*25.6%
*-commutative25.6%
*-commutative25.6%
unpow225.6%
hypot-udef31.0%
+-commutative31.0%
associate-+r+31.8%
Applied egg-rr31.8%
*-lft-identity31.8%
associate-*r*31.8%
fma-neg31.8%
*-commutative31.8%
*-commutative31.8%
distribute-rgt-neg-in31.8%
*-commutative31.8%
metadata-eval31.8%
associate-*r*31.8%
associate-*r*31.8%
associate-*l*25.6%
Simplified25.1%
Taylor expanded in B around inf 8.0%
if 2.1199999999999999e-50 < C Initial program 17.8%
associate-*l*17.8%
unpow217.8%
+-commutative17.8%
unpow217.8%
associate-*l*17.8%
unpow217.8%
Simplified17.8%
*-un-lft-identity17.8%
associate-*l*17.8%
*-commutative17.8%
*-commutative17.8%
unpow217.8%
hypot-udef22.6%
+-commutative22.6%
associate-+r+23.4%
Applied egg-rr23.4%
*-lft-identity23.4%
associate-*r*23.4%
fma-neg23.4%
*-commutative23.4%
*-commutative23.4%
distribute-rgt-neg-in23.4%
*-commutative23.4%
metadata-eval23.4%
associate-*r*23.4%
associate-*r*23.4%
associate-*l*22.0%
Simplified21.4%
Taylor expanded in A around -inf 22.7%
*-commutative22.7%
Simplified22.7%
Final simplification17.0%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* (* C A) -4.0))) (t_1 (- (* B B) (* 4.0 (* C A)))))
(if (<= A -1.6e-146)
(/ (- (sqrt (* 2.0 (* F (* t_0 (* 2.0 C)))))) t_1)
(if (<= A 1.4e-108)
(/ (- (sqrt (* 2.0 (* F (* B t_0))))) t_1)
(/ (- (sqrt (* 2.0 (* F (* (* 2.0 A) t_0))))) t_1)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + ((C * A) * -4.0);
double t_1 = (B * B) - (4.0 * (C * A));
double tmp;
if (A <= -1.6e-146) {
tmp = -sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1;
} else if (A <= 1.4e-108) {
tmp = -sqrt((2.0 * (F * (B * t_0)))) / t_1;
} else {
tmp = -sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / 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) :: tmp
t_0 = (b * b) + ((c * a) * (-4.0d0))
t_1 = (b * b) - (4.0d0 * (c * a))
if (a <= (-1.6d-146)) then
tmp = -sqrt((2.0d0 * (f * (t_0 * (2.0d0 * c))))) / t_1
else if (a <= 1.4d-108) then
tmp = -sqrt((2.0d0 * (f * (b * t_0)))) / t_1
else
tmp = -sqrt((2.0d0 * (f * ((2.0d0 * a) * t_0)))) / 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) + ((C * A) * -4.0);
double t_1 = (B * B) - (4.0 * (C * A));
double tmp;
if (A <= -1.6e-146) {
tmp = -Math.sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1;
} else if (A <= 1.4e-108) {
tmp = -Math.sqrt((2.0 * (F * (B * t_0)))) / t_1;
} else {
tmp = -Math.sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / t_1;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + ((C * A) * -4.0) t_1 = (B * B) - (4.0 * (C * A)) tmp = 0 if A <= -1.6e-146: tmp = -math.sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1 elif A <= 1.4e-108: tmp = -math.sqrt((2.0 * (F * (B * t_0)))) / t_1 else: tmp = -math.sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / t_1 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(Float64(C * A) * -4.0)) t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (A <= -1.6e-146) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(t_0 * Float64(2.0 * C)))))) / t_1); elseif (A <= 1.4e-108) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(B * t_0))))) / t_1); else tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(Float64(2.0 * A) * t_0))))) / t_1); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + ((C * A) * -4.0); t_1 = (B * B) - (4.0 * (C * A)); tmp = 0.0; if (A <= -1.6e-146) tmp = -sqrt((2.0 * (F * (t_0 * (2.0 * C))))) / t_1; elseif (A <= 1.4e-108) tmp = -sqrt((2.0 * (F * (B * t_0)))) / t_1; else tmp = -sqrt((2.0 * (F * ((2.0 * A) * t_0)))) / 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[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -1.6e-146], N[((-N[Sqrt[N[(2.0 * N[(F * N[(t$95$0 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[A, 1.4e-108], N[((-N[Sqrt[N[(2.0 * N[(F * N[(B * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(F * N[(N[(2.0 * A), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + \left(C \cdot A\right) \cdot -4\\
t_1 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;A \leq -1.6 \cdot 10^{-146}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(t_0 \cdot \left(2 \cdot C\right)\right)\right)}}{t_1}\\
\mathbf{elif}\;A \leq 1.4 \cdot 10^{-108}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot t_0\right)\right)}}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(\left(2 \cdot A\right) \cdot t_0\right)\right)}}{t_1}\\
\end{array}
\end{array}
if A < -1.6e-146Initial program 10.8%
associate-*l*10.8%
unpow210.8%
+-commutative10.8%
unpow210.8%
associate-*l*10.8%
unpow210.8%
Simplified10.8%
*-un-lft-identity10.8%
associate-*l*10.8%
*-commutative10.8%
*-commutative10.8%
unpow210.8%
hypot-udef12.1%
+-commutative12.1%
associate-+r+14.7%
Applied egg-rr14.7%
*-lft-identity14.7%
associate-*r*14.7%
fma-neg14.7%
*-commutative14.7%
*-commutative14.7%
distribute-rgt-neg-in14.7%
*-commutative14.7%
metadata-eval14.7%
associate-*r*14.7%
associate-*r*14.7%
associate-*l*13.1%
Simplified11.1%
Taylor expanded in A around -inf 21.1%
*-commutative21.1%
Simplified21.1%
if -1.6e-146 < A < 1.4e-108Initial program 19.8%
associate-*l*19.8%
unpow219.8%
+-commutative19.8%
unpow219.8%
associate-*l*19.8%
unpow219.8%
Simplified19.8%
*-un-lft-identity19.8%
associate-*l*19.8%
*-commutative19.8%
*-commutative19.8%
unpow219.8%
hypot-udef23.8%
+-commutative23.8%
associate-+r+23.8%
Applied egg-rr23.8%
*-lft-identity23.8%
associate-*r*23.8%
fma-neg23.8%
*-commutative23.8%
*-commutative23.8%
distribute-rgt-neg-in23.8%
*-commutative23.8%
metadata-eval23.8%
associate-*r*23.8%
associate-*r*23.8%
associate-*l*21.3%
Simplified21.3%
Taylor expanded in B around inf 9.4%
if 1.4e-108 < A Initial program 19.7%
associate-*l*19.7%
unpow219.7%
+-commutative19.7%
unpow219.7%
associate-*l*19.7%
unpow219.7%
Simplified19.7%
*-un-lft-identity19.7%
associate-*l*19.7%
*-commutative19.7%
*-commutative19.7%
unpow219.7%
hypot-udef25.8%
+-commutative25.8%
associate-+r+25.8%
Applied egg-rr25.8%
*-lft-identity25.8%
associate-*r*25.8%
fma-neg25.8%
*-commutative25.8%
*-commutative25.8%
distribute-rgt-neg-in25.8%
*-commutative25.8%
metadata-eval25.8%
associate-*r*25.8%
associate-*r*25.8%
associate-*l*21.3%
Simplified21.3%
Taylor expanded in A around inf 14.6%
associate-+r+22.7%
distribute-rgt1-in22.7%
metadata-eval22.7%
mul0-lft22.7%
Simplified22.7%
Final simplification18.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= A -2.2e-114)
(/ (- (sqrt (* 2.0 (* -8.0 (* F (* A (* C C))))))) t_0)
(if (<= A 2.6e-111)
(/ (- (sqrt (* 2.0 (* F (* B (+ (* B B) (* (* C A) -4.0))))))) t_0)
(if (<= A 1.7e+126)
(/ (- (sqrt (* 2.0 (* -8.0 (* F (* C (* A A))))))) t_0)
(/ (- (sqrt (* -8.0 (* A (* (* F C) (+ C (* 2.0 A))))))) t_0))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (A <= -2.2e-114) {
tmp = -sqrt((2.0 * (-8.0 * (F * (A * (C * C)))))) / t_0;
} else if (A <= 2.6e-111) {
tmp = -sqrt((2.0 * (F * (B * ((B * B) + ((C * A) * -4.0)))))) / t_0;
} else if (A <= 1.7e+126) {
tmp = -sqrt((2.0 * (-8.0 * (F * (C * (A * A)))))) / t_0;
} else {
tmp = -sqrt((-8.0 * (A * ((F * C) * (C + (2.0 * A)))))) / 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 * (c * a))
if (a <= (-2.2d-114)) then
tmp = -sqrt((2.0d0 * ((-8.0d0) * (f * (a * (c * c)))))) / t_0
else if (a <= 2.6d-111) then
tmp = -sqrt((2.0d0 * (f * (b * ((b * b) + ((c * a) * (-4.0d0))))))) / t_0
else if (a <= 1.7d+126) then
tmp = -sqrt((2.0d0 * ((-8.0d0) * (f * (c * (a * a)))))) / t_0
else
tmp = -sqrt(((-8.0d0) * (a * ((f * c) * (c + (2.0d0 * a)))))) / 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 * (C * A));
double tmp;
if (A <= -2.2e-114) {
tmp = -Math.sqrt((2.0 * (-8.0 * (F * (A * (C * C)))))) / t_0;
} else if (A <= 2.6e-111) {
tmp = -Math.sqrt((2.0 * (F * (B * ((B * B) + ((C * A) * -4.0)))))) / t_0;
} else if (A <= 1.7e+126) {
tmp = -Math.sqrt((2.0 * (-8.0 * (F * (C * (A * A)))))) / t_0;
} else {
tmp = -Math.sqrt((-8.0 * (A * ((F * C) * (C + (2.0 * A)))))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if A <= -2.2e-114: tmp = -math.sqrt((2.0 * (-8.0 * (F * (A * (C * C)))))) / t_0 elif A <= 2.6e-111: tmp = -math.sqrt((2.0 * (F * (B * ((B * B) + ((C * A) * -4.0)))))) / t_0 elif A <= 1.7e+126: tmp = -math.sqrt((2.0 * (-8.0 * (F * (C * (A * A)))))) / t_0 else: tmp = -math.sqrt((-8.0 * (A * ((F * C) * (C + (2.0 * A)))))) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (A <= -2.2e-114) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(-8.0 * Float64(F * Float64(A * Float64(C * C))))))) / t_0); elseif (A <= 2.6e-111) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(B * Float64(Float64(B * B) + Float64(Float64(C * A) * -4.0))))))) / t_0); elseif (A <= 1.7e+126) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(-8.0 * Float64(F * Float64(C * Float64(A * A))))))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(-8.0 * Float64(A * Float64(Float64(F * C) * Float64(C + Float64(2.0 * A))))))) / t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (C * A)); tmp = 0.0; if (A <= -2.2e-114) tmp = -sqrt((2.0 * (-8.0 * (F * (A * (C * C)))))) / t_0; elseif (A <= 2.6e-111) tmp = -sqrt((2.0 * (F * (B * ((B * B) + ((C * A) * -4.0)))))) / t_0; elseif (A <= 1.7e+126) tmp = -sqrt((2.0 * (-8.0 * (F * (C * (A * A)))))) / t_0; else tmp = -sqrt((-8.0 * (A * ((F * C) * (C + (2.0 * A)))))) / 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[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -2.2e-114], N[((-N[Sqrt[N[(2.0 * N[(-8.0 * N[(F * N[(A * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, 2.6e-111], N[((-N[Sqrt[N[(2.0 * N[(F * N[(B * N[(N[(B * B), $MachinePrecision] + N[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, 1.7e+126], N[((-N[Sqrt[N[(2.0 * N[(-8.0 * N[(F * N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(-8.0 * N[(A * N[(N[(F * C), $MachinePrecision] * N[(C + N[(2.0 * A), $MachinePrecision]), $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(C \cdot A\right)\\
\mathbf{if}\;A \leq -2.2 \cdot 10^{-114}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(-8 \cdot \left(F \cdot \left(A \cdot \left(C \cdot C\right)\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;A \leq 2.6 \cdot 10^{-111}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot \left(B \cdot B + \left(C \cdot A\right) \cdot -4\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;A \leq 1.7 \cdot 10^{+126}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(-8 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{-8 \cdot \left(A \cdot \left(\left(F \cdot C\right) \cdot \left(C + 2 \cdot A\right)\right)\right)}}{t_0}\\
\end{array}
\end{array}
if A < -2.20000000000000011e-114Initial program 8.9%
associate-*l*8.9%
unpow28.9%
+-commutative8.9%
unpow28.9%
associate-*l*8.9%
unpow28.9%
Simplified8.9%
*-un-lft-identity8.9%
associate-*l*8.9%
*-commutative8.9%
*-commutative8.9%
unpow28.9%
hypot-udef9.0%
+-commutative9.0%
associate-+r+11.8%
Applied egg-rr11.8%
*-lft-identity11.8%
associate-*r*11.8%
fma-neg11.8%
*-commutative11.8%
*-commutative11.8%
distribute-rgt-neg-in11.8%
*-commutative11.8%
metadata-eval11.8%
associate-*r*11.8%
associate-*r*11.8%
associate-*l*10.2%
Simplified8.0%
Taylor expanded in A around -inf 17.6%
associate-*r*17.6%
unpow217.6%
Simplified17.6%
if -2.20000000000000011e-114 < A < 2.59999999999999982e-111Initial program 21.0%
associate-*l*21.0%
unpow221.0%
+-commutative21.0%
unpow221.0%
associate-*l*21.0%
unpow221.0%
Simplified21.0%
*-un-lft-identity21.0%
associate-*l*21.0%
*-commutative21.0%
*-commutative21.0%
unpow221.0%
hypot-udef26.1%
+-commutative26.1%
associate-+r+26.1%
Applied egg-rr26.1%
*-lft-identity26.1%
associate-*r*26.1%
fma-neg26.1%
*-commutative26.1%
*-commutative26.1%
distribute-rgt-neg-in26.1%
*-commutative26.1%
metadata-eval26.1%
associate-*r*26.1%
associate-*r*26.1%
associate-*l*23.7%
Simplified23.7%
Taylor expanded in B around inf 9.1%
if 2.59999999999999982e-111 < A < 1.69999999999999995e126Initial program 28.7%
associate-*l*28.7%
unpow228.7%
+-commutative28.7%
unpow228.7%
associate-*l*28.7%
unpow228.7%
Simplified28.7%
*-un-lft-identity28.7%
associate-*l*28.7%
*-commutative28.7%
*-commutative28.7%
unpow228.7%
hypot-udef29.1%
+-commutative29.1%
associate-+r+29.1%
Applied egg-rr29.1%
*-lft-identity29.1%
associate-*r*29.1%
fma-neg29.1%
*-commutative29.1%
*-commutative29.1%
distribute-rgt-neg-in29.1%
*-commutative29.1%
metadata-eval29.1%
associate-*r*29.1%
associate-*r*29.1%
associate-*l*28.2%
Simplified28.2%
Taylor expanded in B around 0 25.7%
associate-*r*26.9%
unpow226.9%
Simplified26.9%
if 1.69999999999999995e126 < A Initial program 4.6%
associate-*l*4.6%
unpow24.6%
+-commutative4.6%
unpow24.6%
associate-*l*4.6%
unpow24.6%
Simplified4.6%
Taylor expanded in A around inf 20.4%
Taylor expanded in B around 0 15.2%
Final simplification16.7%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= C -7.8e-221)
(/ (- (sqrt (* (* F C) (* -16.0 (* A A))))) t_0)
(if (<= C 1.02e-144)
(* -2.0 (/ (pow (* F A) 0.5) B))
(if (<= C 6.2e-8)
(* -2.0 (/ (sqrt (* F C)) B))
(/ (- (sqrt (* 2.0 (* -8.0 (* F (* A (* C C))))))) t_0))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (C <= -7.8e-221) {
tmp = -sqrt(((F * C) * (-16.0 * (A * A)))) / t_0;
} else if (C <= 1.02e-144) {
tmp = -2.0 * (pow((F * A), 0.5) / B);
} else if (C <= 6.2e-8) {
tmp = -2.0 * (sqrt((F * C)) / B);
} else {
tmp = -sqrt((2.0 * (-8.0 * (F * (A * (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) :: tmp
t_0 = (b * b) - (4.0d0 * (c * a))
if (c <= (-7.8d-221)) then
tmp = -sqrt(((f * c) * ((-16.0d0) * (a * a)))) / t_0
else if (c <= 1.02d-144) then
tmp = (-2.0d0) * (((f * a) ** 0.5d0) / b)
else if (c <= 6.2d-8) then
tmp = (-2.0d0) * (sqrt((f * c)) / b)
else
tmp = -sqrt((2.0d0 * ((-8.0d0) * (f * (a * (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 * (C * A));
double tmp;
if (C <= -7.8e-221) {
tmp = -Math.sqrt(((F * C) * (-16.0 * (A * A)))) / t_0;
} else if (C <= 1.02e-144) {
tmp = -2.0 * (Math.pow((F * A), 0.5) / B);
} else if (C <= 6.2e-8) {
tmp = -2.0 * (Math.sqrt((F * C)) / B);
} else {
tmp = -Math.sqrt((2.0 * (-8.0 * (F * (A * (C * C)))))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if C <= -7.8e-221: tmp = -math.sqrt(((F * C) * (-16.0 * (A * A)))) / t_0 elif C <= 1.02e-144: tmp = -2.0 * (math.pow((F * A), 0.5) / B) elif C <= 6.2e-8: tmp = -2.0 * (math.sqrt((F * C)) / B) else: tmp = -math.sqrt((2.0 * (-8.0 * (F * (A * (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(C * A))) tmp = 0.0 if (C <= -7.8e-221) tmp = Float64(Float64(-sqrt(Float64(Float64(F * C) * Float64(-16.0 * Float64(A * A))))) / t_0); elseif (C <= 1.02e-144) tmp = Float64(-2.0 * Float64((Float64(F * A) ^ 0.5) / B)); elseif (C <= 6.2e-8) tmp = Float64(-2.0 * Float64(sqrt(Float64(F * C)) / B)); else tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(-8.0 * Float64(F * Float64(A * 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 * (C * A)); tmp = 0.0; if (C <= -7.8e-221) tmp = -sqrt(((F * C) * (-16.0 * (A * A)))) / t_0; elseif (C <= 1.02e-144) tmp = -2.0 * (((F * A) ^ 0.5) / B); elseif (C <= 6.2e-8) tmp = -2.0 * (sqrt((F * C)) / B); else tmp = -sqrt((2.0 * (-8.0 * (F * (A * (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[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -7.8e-221], N[((-N[Sqrt[N[(N[(F * C), $MachinePrecision] * N[(-16.0 * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[C, 1.02e-144], N[(-2.0 * N[(N[Power[N[(F * A), $MachinePrecision], 0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 6.2e-8], N[(-2.0 * N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(-8.0 * N[(F * N[(A * N[(C * C), $MachinePrecision]), $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(C \cdot A\right)\\
\mathbf{if}\;C \leq -7.8 \cdot 10^{-221}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot C\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;C \leq 1.02 \cdot 10^{-144}:\\
\;\;\;\;-2 \cdot \frac{{\left(F \cdot A\right)}^{0.5}}{B}\\
\mathbf{elif}\;C \leq 6.2 \cdot 10^{-8}:\\
\;\;\;\;-2 \cdot \frac{\sqrt{F \cdot C}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(-8 \cdot \left(F \cdot \left(A \cdot \left(C \cdot C\right)\right)\right)\right)}}{t_0}\\
\end{array}
\end{array}
if C < -7.7999999999999997e-221Initial program 8.1%
associate-*l*8.1%
unpow28.1%
+-commutative8.1%
unpow28.1%
associate-*l*8.1%
unpow28.1%
Simplified8.1%
Taylor expanded in A around inf 4.1%
Taylor expanded in A around inf 16.3%
associate-*r*16.3%
unpow216.3%
*-commutative16.3%
Simplified16.3%
if -7.7999999999999997e-221 < C < 1.01999999999999997e-144Initial program 24.9%
associate-*l*24.9%
unpow224.9%
+-commutative24.9%
unpow224.9%
associate-*l*24.9%
unpow224.9%
Simplified24.9%
Taylor expanded in A around inf 17.0%
Taylor expanded in C around 0 10.7%
associate-*r*10.7%
mul-1-neg10.7%
unpow210.7%
rem-square-sqrt10.8%
*-commutative10.8%
Simplified10.8%
Taylor expanded in B around 0 10.8%
associate-*r/10.8%
*-commutative10.8%
*-rgt-identity10.8%
Simplified10.8%
pow1/211.1%
Applied egg-rr11.1%
if 1.01999999999999997e-144 < C < 6.2e-8Initial program 31.1%
associate-*l*31.1%
unpow231.1%
+-commutative31.1%
unpow231.1%
associate-*l*31.1%
unpow231.1%
Simplified31.1%
*-un-lft-identity31.1%
associate-*l*31.1%
*-commutative31.1%
*-commutative31.1%
unpow231.1%
hypot-udef33.7%
+-commutative33.7%
associate-+r+34.2%
Applied egg-rr34.2%
*-lft-identity34.2%
associate-*r*34.2%
fma-neg34.2%
*-commutative34.2%
*-commutative34.2%
distribute-rgt-neg-in34.2%
*-commutative34.2%
metadata-eval34.2%
associate-*r*34.2%
associate-*r*34.2%
associate-*l*29.0%
Simplified28.6%
Taylor expanded in C around inf 8.1%
mul-1-neg8.1%
unsub-neg8.1%
*-commutative8.1%
Simplified8.1%
Taylor expanded in B around inf 5.7%
associate-*r/5.7%
*-rgt-identity5.7%
*-commutative5.7%
Simplified5.7%
if 6.2e-8 < C Initial program 16.5%
associate-*l*16.5%
unpow216.5%
+-commutative16.5%
unpow216.5%
associate-*l*16.5%
unpow216.5%
Simplified16.5%
*-un-lft-identity16.5%
associate-*l*16.5%
*-commutative16.5%
*-commutative16.5%
unpow216.5%
hypot-udef22.2%
+-commutative22.2%
associate-+r+23.2%
Applied egg-rr23.2%
*-lft-identity23.2%
associate-*r*23.2%
fma-neg23.2%
*-commutative23.2%
*-commutative23.2%
distribute-rgt-neg-in23.2%
*-commutative23.2%
metadata-eval23.2%
associate-*r*23.2%
associate-*r*23.2%
associate-*l*21.5%
Simplified20.8%
Taylor expanded in A around -inf 19.5%
associate-*r*18.0%
unpow218.0%
Simplified18.0%
Final simplification14.2%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= C -4.15e-35)
(/ (- (sqrt (* 2.0 (* -8.0 (* F (* C (* A A))))))) t_0)
(if (<= C 1.25e-66)
(/ (- (sqrt (* -8.0 (* A (* (* F C) (+ C (* 2.0 A))))))) t_0)
(/ (- (sqrt (* 2.0 (* -8.0 (* F (* A (* C C))))))) t_0)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (C <= -4.15e-35) {
tmp = -sqrt((2.0 * (-8.0 * (F * (C * (A * A)))))) / t_0;
} else if (C <= 1.25e-66) {
tmp = -sqrt((-8.0 * (A * ((F * C) * (C + (2.0 * A)))))) / t_0;
} else {
tmp = -sqrt((2.0 * (-8.0 * (F * (A * (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) :: tmp
t_0 = (b * b) - (4.0d0 * (c * a))
if (c <= (-4.15d-35)) then
tmp = -sqrt((2.0d0 * ((-8.0d0) * (f * (c * (a * a)))))) / t_0
else if (c <= 1.25d-66) then
tmp = -sqrt(((-8.0d0) * (a * ((f * c) * (c + (2.0d0 * a)))))) / t_0
else
tmp = -sqrt((2.0d0 * ((-8.0d0) * (f * (a * (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 * (C * A));
double tmp;
if (C <= -4.15e-35) {
tmp = -Math.sqrt((2.0 * (-8.0 * (F * (C * (A * A)))))) / t_0;
} else if (C <= 1.25e-66) {
tmp = -Math.sqrt((-8.0 * (A * ((F * C) * (C + (2.0 * A)))))) / t_0;
} else {
tmp = -Math.sqrt((2.0 * (-8.0 * (F * (A * (C * C)))))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if C <= -4.15e-35: tmp = -math.sqrt((2.0 * (-8.0 * (F * (C * (A * A)))))) / t_0 elif C <= 1.25e-66: tmp = -math.sqrt((-8.0 * (A * ((F * C) * (C + (2.0 * A)))))) / t_0 else: tmp = -math.sqrt((2.0 * (-8.0 * (F * (A * (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(C * A))) tmp = 0.0 if (C <= -4.15e-35) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(-8.0 * Float64(F * Float64(C * Float64(A * A))))))) / t_0); elseif (C <= 1.25e-66) tmp = Float64(Float64(-sqrt(Float64(-8.0 * Float64(A * Float64(Float64(F * C) * Float64(C + Float64(2.0 * A))))))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(-8.0 * Float64(F * Float64(A * 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 * (C * A)); tmp = 0.0; if (C <= -4.15e-35) tmp = -sqrt((2.0 * (-8.0 * (F * (C * (A * A)))))) / t_0; elseif (C <= 1.25e-66) tmp = -sqrt((-8.0 * (A * ((F * C) * (C + (2.0 * A)))))) / t_0; else tmp = -sqrt((2.0 * (-8.0 * (F * (A * (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[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -4.15e-35], N[((-N[Sqrt[N[(2.0 * N[(-8.0 * N[(F * N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[C, 1.25e-66], N[((-N[Sqrt[N[(-8.0 * N[(A * N[(N[(F * C), $MachinePrecision] * N[(C + N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(-8.0 * N[(F * N[(A * N[(C * C), $MachinePrecision]), $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(C \cdot A\right)\\
\mathbf{if}\;C \leq -4.15 \cdot 10^{-35}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(-8 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;C \leq 1.25 \cdot 10^{-66}:\\
\;\;\;\;\frac{-\sqrt{-8 \cdot \left(A \cdot \left(\left(F \cdot C\right) \cdot \left(C + 2 \cdot A\right)\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(-8 \cdot \left(F \cdot \left(A \cdot \left(C \cdot C\right)\right)\right)\right)}}{t_0}\\
\end{array}
\end{array}
if C < -4.1499999999999998e-35Initial program 4.2%
associate-*l*4.2%
unpow24.2%
+-commutative4.2%
unpow24.2%
associate-*l*4.2%
unpow24.2%
Simplified4.2%
*-un-lft-identity4.2%
associate-*l*4.2%
*-commutative4.2%
*-commutative4.2%
unpow24.2%
hypot-udef4.9%
+-commutative4.9%
associate-+r+5.2%
Applied egg-rr5.2%
*-lft-identity5.2%
associate-*r*5.2%
fma-neg5.2%
*-commutative5.2%
*-commutative5.2%
distribute-rgt-neg-in5.2%
*-commutative5.2%
metadata-eval5.2%
associate-*r*5.2%
associate-*r*5.2%
associate-*l*5.2%
Simplified5.1%
Taylor expanded in B around 0 19.5%
associate-*r*22.4%
unpow222.4%
Simplified22.4%
if -4.1499999999999998e-35 < C < 1.2499999999999999e-66Initial program 24.0%
associate-*l*24.0%
unpow224.0%
+-commutative24.0%
unpow224.0%
associate-*l*24.0%
unpow224.0%
Simplified24.0%
Taylor expanded in A around inf 15.9%
Taylor expanded in B around 0 12.9%
if 1.2499999999999999e-66 < C Initial program 18.4%
associate-*l*18.4%
unpow218.4%
+-commutative18.4%
unpow218.4%
associate-*l*18.4%
unpow218.4%
Simplified18.4%
*-un-lft-identity18.4%
associate-*l*18.4%
*-commutative18.4%
*-commutative18.4%
unpow218.4%
hypot-udef23.0%
+-commutative23.0%
associate-+r+23.8%
Applied egg-rr23.8%
*-lft-identity23.8%
associate-*r*23.8%
fma-neg23.8%
*-commutative23.8%
*-commutative23.8%
distribute-rgt-neg-in23.8%
*-commutative23.8%
metadata-eval23.8%
associate-*r*23.8%
associate-*r*23.8%
associate-*l*22.4%
Simplified21.9%
Taylor expanded in A around -inf 16.4%
associate-*r*15.2%
unpow215.2%
Simplified15.2%
Final simplification16.2%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= C -3.4e-297)
(/ (- (sqrt (* 2.0 (* -8.0 (* F (* C (* A A))))))) t_0)
(if (<= C 1.2e-142)
(* -2.0 (/ (pow (* F A) 0.5) B))
(/ (- (sqrt (* 2.0 (* -8.0 (* F (* A (* C C))))))) t_0)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (C <= -3.4e-297) {
tmp = -sqrt((2.0 * (-8.0 * (F * (C * (A * A)))))) / t_0;
} else if (C <= 1.2e-142) {
tmp = -2.0 * (pow((F * A), 0.5) / B);
} else {
tmp = -sqrt((2.0 * (-8.0 * (F * (A * (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) :: tmp
t_0 = (b * b) - (4.0d0 * (c * a))
if (c <= (-3.4d-297)) then
tmp = -sqrt((2.0d0 * ((-8.0d0) * (f * (c * (a * a)))))) / t_0
else if (c <= 1.2d-142) then
tmp = (-2.0d0) * (((f * a) ** 0.5d0) / b)
else
tmp = -sqrt((2.0d0 * ((-8.0d0) * (f * (a * (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 * (C * A));
double tmp;
if (C <= -3.4e-297) {
tmp = -Math.sqrt((2.0 * (-8.0 * (F * (C * (A * A)))))) / t_0;
} else if (C <= 1.2e-142) {
tmp = -2.0 * (Math.pow((F * A), 0.5) / B);
} else {
tmp = -Math.sqrt((2.0 * (-8.0 * (F * (A * (C * C)))))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if C <= -3.4e-297: tmp = -math.sqrt((2.0 * (-8.0 * (F * (C * (A * A)))))) / t_0 elif C <= 1.2e-142: tmp = -2.0 * (math.pow((F * A), 0.5) / B) else: tmp = -math.sqrt((2.0 * (-8.0 * (F * (A * (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(C * A))) tmp = 0.0 if (C <= -3.4e-297) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(-8.0 * Float64(F * Float64(C * Float64(A * A))))))) / t_0); elseif (C <= 1.2e-142) tmp = Float64(-2.0 * Float64((Float64(F * A) ^ 0.5) / B)); else tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(-8.0 * Float64(F * Float64(A * 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 * (C * A)); tmp = 0.0; if (C <= -3.4e-297) tmp = -sqrt((2.0 * (-8.0 * (F * (C * (A * A)))))) / t_0; elseif (C <= 1.2e-142) tmp = -2.0 * (((F * A) ^ 0.5) / B); else tmp = -sqrt((2.0 * (-8.0 * (F * (A * (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[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -3.4e-297], N[((-N[Sqrt[N[(2.0 * N[(-8.0 * N[(F * N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[C, 1.2e-142], N[(-2.0 * N[(N[Power[N[(F * A), $MachinePrecision], 0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(-8.0 * N[(F * N[(A * N[(C * C), $MachinePrecision]), $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(C \cdot A\right)\\
\mathbf{if}\;C \leq -3.4 \cdot 10^{-297}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(-8 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;C \leq 1.2 \cdot 10^{-142}:\\
\;\;\;\;-2 \cdot \frac{{\left(F \cdot A\right)}^{0.5}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(-8 \cdot \left(F \cdot \left(A \cdot \left(C \cdot C\right)\right)\right)\right)}}{t_0}\\
\end{array}
\end{array}
if C < -3.39999999999999983e-297Initial program 9.6%
associate-*l*9.6%
unpow29.6%
+-commutative9.6%
unpow29.6%
associate-*l*9.6%
unpow29.6%
Simplified9.6%
*-un-lft-identity9.6%
associate-*l*9.6%
*-commutative9.6%
*-commutative9.6%
unpow29.6%
hypot-udef12.5%
+-commutative12.5%
associate-+r+13.5%
Applied egg-rr13.5%
*-lft-identity13.5%
associate-*r*13.5%
fma-neg13.5%
*-commutative13.5%
*-commutative13.5%
distribute-rgt-neg-in13.5%
*-commutative13.5%
metadata-eval13.5%
associate-*r*13.5%
associate-*r*13.5%
associate-*l*12.5%
Simplified11.8%
Taylor expanded in B around 0 14.6%
associate-*r*16.9%
unpow216.9%
Simplified16.9%
if -3.39999999999999983e-297 < C < 1.19999999999999994e-142Initial program 26.0%
associate-*l*26.0%
unpow226.0%
+-commutative26.0%
unpow226.0%
associate-*l*26.0%
unpow226.0%
Simplified26.0%
Taylor expanded in A around inf 17.3%
Taylor expanded in C around 0 13.7%
associate-*r*13.7%
mul-1-neg13.7%
unpow213.7%
rem-square-sqrt13.9%
*-commutative13.9%
Simplified13.9%
Taylor expanded in B around 0 13.9%
associate-*r/13.9%
*-commutative13.9%
*-rgt-identity13.9%
Simplified13.9%
pow1/214.2%
Applied egg-rr14.2%
if 1.19999999999999994e-142 < C Initial program 22.1%
associate-*l*22.1%
unpow222.1%
+-commutative22.1%
unpow222.1%
associate-*l*22.1%
unpow222.1%
Simplified22.1%
*-un-lft-identity22.1%
associate-*l*22.1%
*-commutative22.1%
*-commutative22.1%
unpow222.1%
hypot-udef26.8%
+-commutative26.8%
associate-+r+27.6%
Applied egg-rr27.6%
*-lft-identity27.6%
associate-*r*27.6%
fma-neg27.6%
*-commutative27.6%
*-commutative27.6%
distribute-rgt-neg-in27.6%
*-commutative27.6%
metadata-eval27.6%
associate-*r*27.6%
associate-*r*27.6%
associate-*l*24.6%
Simplified24.0%
Taylor expanded in A around -inf 15.0%
associate-*r*14.0%
unpow214.0%
Simplified14.0%
Final simplification15.4%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= C -1.4e-217)
(/ (- (sqrt (* (* F C) (* -16.0 (* A A))))) (- (* B B) (* 4.0 (* C A))))
(if (<= C 1.25e-144)
(* -2.0 (/ (pow (* F A) 0.5) B))
(* -2.0 (/ (sqrt (* F C)) B)))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (C <= -1.4e-217) {
tmp = -sqrt(((F * C) * (-16.0 * (A * A)))) / ((B * B) - (4.0 * (C * A)));
} else if (C <= 1.25e-144) {
tmp = -2.0 * (pow((F * A), 0.5) / B);
} else {
tmp = -2.0 * (sqrt((F * C)) / B);
}
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) :: tmp
if (c <= (-1.4d-217)) then
tmp = -sqrt(((f * c) * ((-16.0d0) * (a * a)))) / ((b * b) - (4.0d0 * (c * a)))
else if (c <= 1.25d-144) then
tmp = (-2.0d0) * (((f * a) ** 0.5d0) / b)
else
tmp = (-2.0d0) * (sqrt((f * c)) / b)
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (C <= -1.4e-217) {
tmp = -Math.sqrt(((F * C) * (-16.0 * (A * A)))) / ((B * B) - (4.0 * (C * A)));
} else if (C <= 1.25e-144) {
tmp = -2.0 * (Math.pow((F * A), 0.5) / B);
} else {
tmp = -2.0 * (Math.sqrt((F * C)) / B);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if C <= -1.4e-217: tmp = -math.sqrt(((F * C) * (-16.0 * (A * A)))) / ((B * B) - (4.0 * (C * A))) elif C <= 1.25e-144: tmp = -2.0 * (math.pow((F * A), 0.5) / B) else: tmp = -2.0 * (math.sqrt((F * C)) / B) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (C <= -1.4e-217) tmp = Float64(Float64(-sqrt(Float64(Float64(F * C) * Float64(-16.0 * Float64(A * A))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(C * A)))); elseif (C <= 1.25e-144) tmp = Float64(-2.0 * Float64((Float64(F * A) ^ 0.5) / B)); else tmp = Float64(-2.0 * Float64(sqrt(Float64(F * C)) / B)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (C <= -1.4e-217) tmp = -sqrt(((F * C) * (-16.0 * (A * A)))) / ((B * B) - (4.0 * (C * A))); elseif (C <= 1.25e-144) tmp = -2.0 * (((F * A) ^ 0.5) / B); else tmp = -2.0 * (sqrt((F * C)) / B); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[C, -1.4e-217], N[((-N[Sqrt[N[(N[(F * C), $MachinePrecision] * N[(-16.0 * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.25e-144], N[(-2.0 * N[(N[Power[N[(F * A), $MachinePrecision], 0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq -1.4 \cdot 10^{-217}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot C\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\
\mathbf{elif}\;C \leq 1.25 \cdot 10^{-144}:\\
\;\;\;\;-2 \cdot \frac{{\left(F \cdot A\right)}^{0.5}}{B}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\sqrt{F \cdot C}}{B}\\
\end{array}
\end{array}
if C < -1.4e-217Initial program 8.1%
associate-*l*8.1%
unpow28.1%
+-commutative8.1%
unpow28.1%
associate-*l*8.1%
unpow28.1%
Simplified8.1%
Taylor expanded in A around inf 4.1%
Taylor expanded in A around inf 16.3%
associate-*r*16.3%
unpow216.3%
*-commutative16.3%
Simplified16.3%
if -1.4e-217 < C < 1.2499999999999999e-144Initial program 24.9%
associate-*l*24.9%
unpow224.9%
+-commutative24.9%
unpow224.9%
associate-*l*24.9%
unpow224.9%
Simplified24.9%
Taylor expanded in A around inf 17.0%
Taylor expanded in C around 0 10.7%
associate-*r*10.7%
mul-1-neg10.7%
unpow210.7%
rem-square-sqrt10.8%
*-commutative10.8%
Simplified10.8%
Taylor expanded in B around 0 10.8%
associate-*r/10.8%
*-commutative10.8%
*-rgt-identity10.8%
Simplified10.8%
pow1/211.1%
Applied egg-rr11.1%
if 1.2499999999999999e-144 < C Initial program 21.7%
associate-*l*21.7%
unpow221.7%
+-commutative21.7%
unpow221.7%
associate-*l*21.7%
unpow221.7%
Simplified21.7%
*-un-lft-identity21.7%
associate-*l*21.7%
*-commutative21.7%
*-commutative21.7%
unpow221.7%
hypot-udef26.3%
+-commutative26.3%
associate-+r+27.1%
Applied egg-rr27.1%
*-lft-identity27.1%
associate-*r*27.1%
fma-neg27.1%
*-commutative27.1%
*-commutative27.1%
distribute-rgt-neg-in27.1%
*-commutative27.1%
metadata-eval27.1%
associate-*r*27.1%
associate-*r*27.1%
associate-*l*24.2%
Simplified23.5%
Taylor expanded in C around inf 15.4%
mul-1-neg15.4%
unsub-neg15.4%
*-commutative15.4%
Simplified15.4%
Taylor expanded in B around inf 6.2%
associate-*r/6.2%
*-rgt-identity6.2%
*-commutative6.2%
Simplified6.2%
Final simplification11.2%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= A 3e-305) (* -2.0 (/ (sqrt (* F C)) B)) (* -2.0 (/ (pow (* F A) 0.5) B))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (A <= 3e-305) {
tmp = -2.0 * (sqrt((F * C)) / B);
} else {
tmp = -2.0 * (pow((F * A), 0.5) / B);
}
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) :: tmp
if (a <= 3d-305) then
tmp = (-2.0d0) * (sqrt((f * c)) / b)
else
tmp = (-2.0d0) * (((f * a) ** 0.5d0) / b)
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (A <= 3e-305) {
tmp = -2.0 * (Math.sqrt((F * C)) / B);
} else {
tmp = -2.0 * (Math.pow((F * A), 0.5) / B);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if A <= 3e-305: tmp = -2.0 * (math.sqrt((F * C)) / B) else: tmp = -2.0 * (math.pow((F * A), 0.5) / B) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (A <= 3e-305) tmp = Float64(-2.0 * Float64(sqrt(Float64(F * C)) / B)); else tmp = Float64(-2.0 * Float64((Float64(F * A) ^ 0.5) / B)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (A <= 3e-305) tmp = -2.0 * (sqrt((F * C)) / B); else tmp = -2.0 * (((F * A) ^ 0.5) / B); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[A, 3e-305], N[(-2.0 * N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Power[N[(F * A), $MachinePrecision], 0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq 3 \cdot 10^{-305}:\\
\;\;\;\;-2 \cdot \frac{\sqrt{F \cdot C}}{B}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{{\left(F \cdot A\right)}^{0.5}}{B}\\
\end{array}
\end{array}
if A < 3.0000000000000001e-305Initial program 13.4%
associate-*l*13.4%
unpow213.4%
+-commutative13.4%
unpow213.4%
associate-*l*13.4%
unpow213.4%
Simplified13.4%
*-un-lft-identity13.4%
associate-*l*13.4%
*-commutative13.4%
*-commutative13.4%
unpow213.4%
hypot-udef16.0%
+-commutative16.0%
associate-+r+17.9%
Applied egg-rr17.9%
*-lft-identity17.9%
associate-*r*17.9%
fma-neg17.9%
*-commutative17.9%
*-commutative17.9%
distribute-rgt-neg-in17.9%
*-commutative17.9%
metadata-eval17.9%
associate-*r*17.9%
associate-*r*17.9%
associate-*l*15.9%
Simplified14.5%
Taylor expanded in C around inf 8.6%
mul-1-neg8.6%
unsub-neg8.6%
*-commutative8.6%
Simplified8.6%
Taylor expanded in B around inf 5.3%
associate-*r/5.4%
*-rgt-identity5.4%
*-commutative5.4%
Simplified5.4%
if 3.0000000000000001e-305 < A Initial program 19.7%
associate-*l*19.7%
unpow219.7%
+-commutative19.7%
unpow219.7%
associate-*l*19.7%
unpow219.7%
Simplified19.7%
Taylor expanded in A around inf 12.8%
Taylor expanded in C around 0 5.7%
associate-*r*5.7%
mul-1-neg5.7%
unpow25.7%
rem-square-sqrt5.8%
*-commutative5.8%
Simplified5.8%
Taylor expanded in B around 0 5.8%
associate-*r/5.8%
*-commutative5.8%
*-rgt-identity5.8%
Simplified5.8%
pow1/25.9%
Applied egg-rr5.9%
Final simplification5.6%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= A 7.5e-307) (* -2.0 (/ (sqrt (* F C)) B)) (* -2.0 (/ (sqrt (* F A)) B))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (A <= 7.5e-307) {
tmp = -2.0 * (sqrt((F * C)) / B);
} else {
tmp = -2.0 * (sqrt((F * A)) / B);
}
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) :: tmp
if (a <= 7.5d-307) then
tmp = (-2.0d0) * (sqrt((f * c)) / b)
else
tmp = (-2.0d0) * (sqrt((f * a)) / b)
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (A <= 7.5e-307) {
tmp = -2.0 * (Math.sqrt((F * C)) / B);
} else {
tmp = -2.0 * (Math.sqrt((F * A)) / B);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if A <= 7.5e-307: tmp = -2.0 * (math.sqrt((F * C)) / B) else: tmp = -2.0 * (math.sqrt((F * A)) / B) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (A <= 7.5e-307) tmp = Float64(-2.0 * Float64(sqrt(Float64(F * C)) / B)); else tmp = Float64(-2.0 * Float64(sqrt(Float64(F * A)) / B)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (A <= 7.5e-307) tmp = -2.0 * (sqrt((F * C)) / B); else tmp = -2.0 * (sqrt((F * A)) / B); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[A, 7.5e-307], N[(-2.0 * N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Sqrt[N[(F * A), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq 7.5 \cdot 10^{-307}:\\
\;\;\;\;-2 \cdot \frac{\sqrt{F \cdot C}}{B}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\sqrt{F \cdot A}}{B}\\
\end{array}
\end{array}
if A < 7.5000000000000006e-307Initial program 13.4%
associate-*l*13.4%
unpow213.4%
+-commutative13.4%
unpow213.4%
associate-*l*13.4%
unpow213.4%
Simplified13.4%
*-un-lft-identity13.4%
associate-*l*13.4%
*-commutative13.4%
*-commutative13.4%
unpow213.4%
hypot-udef16.0%
+-commutative16.0%
associate-+r+17.9%
Applied egg-rr17.9%
*-lft-identity17.9%
associate-*r*17.9%
fma-neg17.9%
*-commutative17.9%
*-commutative17.9%
distribute-rgt-neg-in17.9%
*-commutative17.9%
metadata-eval17.9%
associate-*r*17.9%
associate-*r*17.9%
associate-*l*15.9%
Simplified14.5%
Taylor expanded in C around inf 8.6%
mul-1-neg8.6%
unsub-neg8.6%
*-commutative8.6%
Simplified8.6%
Taylor expanded in B around inf 5.3%
associate-*r/5.4%
*-rgt-identity5.4%
*-commutative5.4%
Simplified5.4%
if 7.5000000000000006e-307 < A Initial program 19.7%
associate-*l*19.7%
unpow219.7%
+-commutative19.7%
unpow219.7%
associate-*l*19.7%
unpow219.7%
Simplified19.7%
Taylor expanded in A around inf 12.8%
Taylor expanded in C around 0 5.7%
associate-*r*5.7%
mul-1-neg5.7%
unpow25.7%
rem-square-sqrt5.8%
*-commutative5.8%
Simplified5.8%
Taylor expanded in B around 0 5.8%
associate-*r/5.8%
*-commutative5.8%
*-rgt-identity5.8%
Simplified5.8%
Final simplification5.6%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* -2.0 (/ (sqrt (* F A)) B)))
B = abs(B);
double code(double A, double B, double C, double F) {
return -2.0 * (sqrt((F * A)) / 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 * a)) / 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 * A)) / B);
}
B = abs(B) def code(A, B, C, F): return -2.0 * (math.sqrt((F * A)) / B)
B = abs(B) function code(A, B, C, F) return Float64(-2.0 * Float64(sqrt(Float64(F * A)) / B)) end
B = abs(B) function tmp = code(A, B, C, F) tmp = -2.0 * (sqrt((F * A)) / B); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(-2.0 * N[(N[Sqrt[N[(F * A), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
-2 \cdot \frac{\sqrt{F \cdot A}}{B}
\end{array}
Initial program 16.8%
associate-*l*16.8%
unpow216.8%
+-commutative16.8%
unpow216.8%
associate-*l*16.8%
unpow216.8%
Simplified16.8%
Taylor expanded in A around inf 8.3%
Taylor expanded in C around 0 3.4%
associate-*r*3.4%
mul-1-neg3.4%
unpow23.4%
rem-square-sqrt3.5%
*-commutative3.5%
Simplified3.5%
Taylor expanded in B around 0 3.5%
associate-*r/3.5%
*-commutative3.5%
*-rgt-identity3.5%
Simplified3.5%
Final simplification3.5%
herbie shell --seed 2023240
(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))))