
(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: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))) (t_1 (+ C (hypot C B))))
(if (<= B -1.8e+50)
(/ (* (sqrt (* F t_1)) (sqrt 2.0)) B)
(if (<= B 4.7e-50)
(/
(*
(sqrt (* 2.0 (* F t_0)))
(- (sqrt (+ C (+ C (* -0.5 (/ (* B B) A)))))))
t_0)
(* (/ (sqrt 2.0) B) (* (sqrt t_1) (- (sqrt F))))))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double t_1 = C + hypot(C, B);
double tmp;
if (B <= -1.8e+50) {
tmp = (sqrt((F * t_1)) * sqrt(2.0)) / B;
} else if (B <= 4.7e-50) {
tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * (sqrt(t_1) * -sqrt(F));
}
return tmp;
}
assert A < C;
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double t_1 = C + Math.hypot(C, B);
double tmp;
if (B <= -1.8e+50) {
tmp = (Math.sqrt((F * t_1)) * Math.sqrt(2.0)) / B;
} else if (B <= 4.7e-50) {
tmp = (Math.sqrt((2.0 * (F * t_0))) * -Math.sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
} else {
tmp = (Math.sqrt(2.0) / B) * (Math.sqrt(t_1) * -Math.sqrt(F));
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) t_1 = C + math.hypot(C, B) tmp = 0 if B <= -1.8e+50: tmp = (math.sqrt((F * t_1)) * math.sqrt(2.0)) / B elif B <= 4.7e-50: tmp = (math.sqrt((2.0 * (F * t_0))) * -math.sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0 else: tmp = (math.sqrt(2.0) / B) * (math.sqrt(t_1) * -math.sqrt(F)) return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) t_1 = Float64(C + hypot(C, B)) tmp = 0.0 if (B <= -1.8e+50) tmp = Float64(Float64(sqrt(Float64(F * t_1)) * sqrt(2.0)) / B); elseif (B <= 4.7e-50) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * t_0))) * Float64(-sqrt(Float64(C + Float64(C + Float64(-0.5 * Float64(Float64(B * B) / A))))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(t_1) * Float64(-sqrt(F)))); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = (B * B) - (4.0 * (C * A));
t_1 = C + hypot(C, B);
tmp = 0.0;
if (B <= -1.8e+50)
tmp = (sqrt((F * t_1)) * sqrt(2.0)) / B;
elseif (B <= 4.7e-50)
tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
else
tmp = (sqrt(2.0) / B) * (sqrt(t_1) * -sqrt(F));
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order 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]}, Block[{t$95$1 = N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -1.8e+50], N[(N[(N[Sqrt[N[(F * t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 4.7e-50], N[(N[(N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C + N[(C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[t$95$1], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
t_1 := C + \mathsf{hypot}\left(C, B\right)\\
\mathbf{if}\;B \leq -1.8 \cdot 10^{+50}:\\
\;\;\;\;\frac{\sqrt{F \cdot t_1} \cdot \sqrt{2}}{B}\\
\mathbf{elif}\;B \leq 4.7 \cdot 10^{-50}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot t_0\right)} \cdot \left(-\sqrt{C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\right)}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{t_1} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < -1.79999999999999993e50Initial program 12.4%
Simplified12.3%
sqrt-prod20.5%
*-commutative20.5%
associate-+r+20.5%
+-commutative20.5%
associate-+r+20.5%
Applied egg-rr20.5%
Taylor expanded in B around -inf 27.0%
associate-*r*27.0%
*-commutative27.0%
neg-mul-127.0%
distribute-rgt-neg-in27.0%
Simplified27.0%
Taylor expanded in A around 0 19.1%
associate-*r/19.2%
*-commutative19.2%
+-commutative19.2%
unpow219.2%
unpow219.2%
hypot-def49.0%
Simplified49.0%
if -1.79999999999999993e50 < B < 4.7000000000000002e-50Initial program 20.4%
associate-*l*20.4%
unpow220.4%
+-commutative20.4%
unpow220.4%
associate-*l*20.4%
unpow220.4%
Simplified20.4%
sqrt-prod23.2%
*-commutative23.2%
*-commutative23.2%
associate-+l+24.1%
unpow224.1%
hypot-udef41.2%
associate-+r+39.3%
+-commutative39.3%
associate-+r+40.9%
Applied egg-rr40.9%
Taylor expanded in A around -inf 32.3%
unpow232.3%
Simplified32.3%
if 4.7000000000000002e-50 < B Initial program 17.6%
Simplified20.3%
Taylor expanded in A around 0 25.1%
mul-1-neg25.1%
*-commutative25.1%
unpow225.1%
unpow225.1%
Simplified25.1%
sqrt-prod29.2%
hypot-udef62.2%
Applied egg-rr62.2%
hypot-def29.2%
unpow229.2%
unpow229.2%
+-commutative29.2%
unpow229.2%
unpow229.2%
hypot-def62.2%
Simplified62.2%
Final simplification44.5%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= B -2.3e+50)
(/ (* (sqrt (* F (+ C (hypot C B)))) (sqrt 2.0)) B)
(if (<= B 3.65e-50)
(/
(*
(sqrt (* 2.0 (* F t_0)))
(- (sqrt (+ C (+ C (* -0.5 (/ (* B B) A)))))))
t_0)
(if (<= B 2.85e+113)
(/ (* (sqrt 2.0) (- (sqrt (* F (+ C (hypot B C)))))) B)
(* (/ (sqrt 2.0) B) (* (sqrt B) (- (sqrt F)))))))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (B <= -2.3e+50) {
tmp = (sqrt((F * (C + hypot(C, B)))) * sqrt(2.0)) / B;
} else if (B <= 3.65e-50) {
tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
} else if (B <= 2.85e+113) {
tmp = (sqrt(2.0) * -sqrt((F * (C + hypot(B, C))))) / B;
} else {
tmp = (sqrt(2.0) / B) * (sqrt(B) * -sqrt(F));
}
return tmp;
}
assert A < C;
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.3e+50) {
tmp = (Math.sqrt((F * (C + Math.hypot(C, B)))) * Math.sqrt(2.0)) / B;
} else if (B <= 3.65e-50) {
tmp = (Math.sqrt((2.0 * (F * t_0))) * -Math.sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
} else if (B <= 2.85e+113) {
tmp = (Math.sqrt(2.0) * -Math.sqrt((F * (C + Math.hypot(B, C))))) / B;
} else {
tmp = (Math.sqrt(2.0) / B) * (Math.sqrt(B) * -Math.sqrt(F));
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if B <= -2.3e+50: tmp = (math.sqrt((F * (C + math.hypot(C, B)))) * math.sqrt(2.0)) / B elif B <= 3.65e-50: tmp = (math.sqrt((2.0 * (F * t_0))) * -math.sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0 elif B <= 2.85e+113: tmp = (math.sqrt(2.0) * -math.sqrt((F * (C + math.hypot(B, C))))) / B else: tmp = (math.sqrt(2.0) / B) * (math.sqrt(B) * -math.sqrt(F)) return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (B <= -2.3e+50) tmp = Float64(Float64(sqrt(Float64(F * Float64(C + hypot(C, B)))) * sqrt(2.0)) / B); elseif (B <= 3.65e-50) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * t_0))) * Float64(-sqrt(Float64(C + Float64(C + Float64(-0.5 * Float64(Float64(B * B) / A))))))) / t_0); elseif (B <= 2.85e+113) tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(F * Float64(C + hypot(B, C)))))) / B); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(B) * Float64(-sqrt(F)))); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = (B * B) - (4.0 * (C * A));
tmp = 0.0;
if (B <= -2.3e+50)
tmp = (sqrt((F * (C + hypot(C, B)))) * sqrt(2.0)) / B;
elseif (B <= 3.65e-50)
tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
elseif (B <= 2.85e+113)
tmp = (sqrt(2.0) * -sqrt((F * (C + hypot(B, C))))) / B;
else
tmp = (sqrt(2.0) / B) * (sqrt(B) * -sqrt(F));
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order 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.3e+50], N[(N[(N[Sqrt[N[(F * N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 3.65e-50], N[(N[(N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C + N[(C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B, 2.85e+113], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[B], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;B \leq -2.3 \cdot 10^{+50}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)} \cdot \sqrt{2}}{B}\\
\mathbf{elif}\;B \leq 3.65 \cdot 10^{-50}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot t_0\right)} \cdot \left(-\sqrt{C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\right)}\right)}{t_0}\\
\mathbf{elif}\;B \leq 2.85 \cdot 10^{+113}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{B} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < -2.29999999999999997e50Initial program 12.4%
Simplified12.3%
sqrt-prod20.5%
*-commutative20.5%
associate-+r+20.5%
+-commutative20.5%
associate-+r+20.5%
Applied egg-rr20.5%
Taylor expanded in B around -inf 27.0%
associate-*r*27.0%
*-commutative27.0%
neg-mul-127.0%
distribute-rgt-neg-in27.0%
Simplified27.0%
Taylor expanded in A around 0 19.1%
associate-*r/19.2%
*-commutative19.2%
+-commutative19.2%
unpow219.2%
unpow219.2%
hypot-def49.0%
Simplified49.0%
if -2.29999999999999997e50 < B < 3.65000000000000018e-50Initial program 20.4%
associate-*l*20.4%
unpow220.4%
+-commutative20.4%
unpow220.4%
associate-*l*20.4%
unpow220.4%
Simplified20.4%
sqrt-prod23.2%
*-commutative23.2%
*-commutative23.2%
associate-+l+24.1%
unpow224.1%
hypot-udef41.2%
associate-+r+39.3%
+-commutative39.3%
associate-+r+40.9%
Applied egg-rr40.9%
Taylor expanded in A around -inf 32.3%
unpow232.3%
Simplified32.3%
if 3.65000000000000018e-50 < B < 2.8499999999999999e113Initial program 33.3%
Simplified36.1%
Taylor expanded in A around 0 38.1%
mul-1-neg38.1%
*-commutative38.1%
unpow238.1%
unpow238.1%
Simplified38.1%
associate-*l/38.1%
hypot-udef38.5%
Applied egg-rr38.5%
if 2.8499999999999999e113 < B Initial program 3.2%
Simplified5.8%
Taylor expanded in A around 0 13.1%
mul-1-neg13.1%
*-commutative13.1%
unpow213.1%
unpow213.1%
Simplified13.1%
Taylor expanded in C around 0 40.8%
sqrt-prod75.1%
Applied egg-rr75.1%
Final simplification43.2%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))) (t_1 (/ (sqrt 2.0) B)))
(if (<= B -1.15e+50)
(/ (* (sqrt (* F (+ C (hypot C B)))) (sqrt 2.0)) B)
(if (<= B 5e-50)
(/
(*
(sqrt (* 2.0 (* F t_0)))
(- (sqrt (+ C (+ C (* -0.5 (/ (* B B) A)))))))
t_0)
(if (<= B 8.2e+111)
(* t_1 (- (sqrt (* F (+ C (hypot B C))))))
(* t_1 (* (sqrt B) (- (sqrt F)))))))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double t_1 = sqrt(2.0) / B;
double tmp;
if (B <= -1.15e+50) {
tmp = (sqrt((F * (C + hypot(C, B)))) * sqrt(2.0)) / B;
} else if (B <= 5e-50) {
tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
} else if (B <= 8.2e+111) {
tmp = t_1 * -sqrt((F * (C + hypot(B, C))));
} else {
tmp = t_1 * (sqrt(B) * -sqrt(F));
}
return tmp;
}
assert A < C;
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double t_1 = Math.sqrt(2.0) / B;
double tmp;
if (B <= -1.15e+50) {
tmp = (Math.sqrt((F * (C + Math.hypot(C, B)))) * Math.sqrt(2.0)) / B;
} else if (B <= 5e-50) {
tmp = (Math.sqrt((2.0 * (F * t_0))) * -Math.sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
} else if (B <= 8.2e+111) {
tmp = t_1 * -Math.sqrt((F * (C + Math.hypot(B, C))));
} else {
tmp = t_1 * (Math.sqrt(B) * -Math.sqrt(F));
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) t_1 = math.sqrt(2.0) / B tmp = 0 if B <= -1.15e+50: tmp = (math.sqrt((F * (C + math.hypot(C, B)))) * math.sqrt(2.0)) / B elif B <= 5e-50: tmp = (math.sqrt((2.0 * (F * t_0))) * -math.sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0 elif B <= 8.2e+111: tmp = t_1 * -math.sqrt((F * (C + math.hypot(B, C)))) else: tmp = t_1 * (math.sqrt(B) * -math.sqrt(F)) return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) t_1 = Float64(sqrt(2.0) / B) tmp = 0.0 if (B <= -1.15e+50) tmp = Float64(Float64(sqrt(Float64(F * Float64(C + hypot(C, B)))) * sqrt(2.0)) / B); elseif (B <= 5e-50) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * t_0))) * Float64(-sqrt(Float64(C + Float64(C + Float64(-0.5 * Float64(Float64(B * B) / A))))))) / t_0); elseif (B <= 8.2e+111) tmp = Float64(t_1 * Float64(-sqrt(Float64(F * Float64(C + hypot(B, C)))))); else tmp = Float64(t_1 * Float64(sqrt(B) * Float64(-sqrt(F)))); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = (B * B) - (4.0 * (C * A));
t_1 = sqrt(2.0) / B;
tmp = 0.0;
if (B <= -1.15e+50)
tmp = (sqrt((F * (C + hypot(C, B)))) * sqrt(2.0)) / B;
elseif (B <= 5e-50)
tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
elseif (B <= 8.2e+111)
tmp = t_1 * -sqrt((F * (C + hypot(B, C))));
else
tmp = t_1 * (sqrt(B) * -sqrt(F));
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order 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]}, Block[{t$95$1 = N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[B, -1.15e+50], N[(N[(N[Sqrt[N[(F * N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 5e-50], N[(N[(N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C + N[(C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B, 8.2e+111], N[(t$95$1 * (-N[Sqrt[N[(F * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(t$95$1 * N[(N[Sqrt[B], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
t_1 := \frac{\sqrt{2}}{B}\\
\mathbf{if}\;B \leq -1.15 \cdot 10^{+50}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)} \cdot \sqrt{2}}{B}\\
\mathbf{elif}\;B \leq 5 \cdot 10^{-50}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot t_0\right)} \cdot \left(-\sqrt{C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\right)}\right)}{t_0}\\
\mathbf{elif}\;B \leq 8.2 \cdot 10^{+111}:\\
\;\;\;\;t_1 \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(\sqrt{B} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < -1.14999999999999998e50Initial program 12.4%
Simplified12.3%
sqrt-prod20.5%
*-commutative20.5%
associate-+r+20.5%
+-commutative20.5%
associate-+r+20.5%
Applied egg-rr20.5%
Taylor expanded in B around -inf 27.0%
associate-*r*27.0%
*-commutative27.0%
neg-mul-127.0%
distribute-rgt-neg-in27.0%
Simplified27.0%
Taylor expanded in A around 0 19.1%
associate-*r/19.2%
*-commutative19.2%
+-commutative19.2%
unpow219.2%
unpow219.2%
hypot-def49.0%
Simplified49.0%
if -1.14999999999999998e50 < B < 4.99999999999999968e-50Initial program 20.4%
associate-*l*20.4%
unpow220.4%
+-commutative20.4%
unpow220.4%
associate-*l*20.4%
unpow220.4%
Simplified20.4%
sqrt-prod23.2%
*-commutative23.2%
*-commutative23.2%
associate-+l+24.1%
unpow224.1%
hypot-udef41.2%
associate-+r+39.3%
+-commutative39.3%
associate-+r+40.9%
Applied egg-rr40.9%
Taylor expanded in A around -inf 32.3%
unpow232.3%
Simplified32.3%
if 4.99999999999999968e-50 < B < 8.19999999999999973e111Initial program 33.3%
Simplified36.1%
Taylor expanded in A around 0 38.1%
mul-1-neg38.1%
*-commutative38.1%
distribute-rgt-neg-in38.1%
*-commutative38.1%
unpow238.1%
unpow238.1%
hypot-def38.5%
Simplified38.5%
if 8.19999999999999973e111 < B Initial program 3.2%
Simplified5.8%
Taylor expanded in A around 0 13.1%
mul-1-neg13.1%
*-commutative13.1%
unpow213.1%
unpow213.1%
Simplified13.1%
Taylor expanded in C around 0 40.8%
sqrt-prod75.1%
Applied egg-rr75.1%
Final simplification43.2%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))) (t_1 (sqrt (* 2.0 (* F t_0)))))
(if (<= B -2e+152)
(* 2.0 (/ (sqrt (* F C)) B))
(if (<= B -1.2e+50)
(/ (* t_1 (- (sqrt (- C B)))) t_0)
(if (<= B 5e-50)
(/ (* t_1 (- (sqrt (+ C (+ C (* -0.5 (/ (* B B) A))))))) t_0)
(* (/ (sqrt 2.0) B) (* (sqrt B) (- (sqrt F)))))))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double t_1 = sqrt((2.0 * (F * t_0)));
double tmp;
if (B <= -2e+152) {
tmp = 2.0 * (sqrt((F * C)) / B);
} else if (B <= -1.2e+50) {
tmp = (t_1 * -sqrt((C - B))) / t_0;
} else if (B <= 5e-50) {
tmp = (t_1 * -sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * (sqrt(B) * -sqrt(F));
}
return tmp;
}
NOTE: A and C should be sorted in increasing order before calling this function.
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (b * b) - (4.0d0 * (c * a))
t_1 = sqrt((2.0d0 * (f * t_0)))
if (b <= (-2d+152)) then
tmp = 2.0d0 * (sqrt((f * c)) / b)
else if (b <= (-1.2d+50)) then
tmp = (t_1 * -sqrt((c - b))) / t_0
else if (b <= 5d-50) then
tmp = (t_1 * -sqrt((c + (c + ((-0.5d0) * ((b * b) / a)))))) / t_0
else
tmp = (sqrt(2.0d0) / b) * (sqrt(b) * -sqrt(f))
end if
code = tmp
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double t_1 = Math.sqrt((2.0 * (F * t_0)));
double tmp;
if (B <= -2e+152) {
tmp = 2.0 * (Math.sqrt((F * C)) / B);
} else if (B <= -1.2e+50) {
tmp = (t_1 * -Math.sqrt((C - B))) / t_0;
} else if (B <= 5e-50) {
tmp = (t_1 * -Math.sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
} else {
tmp = (Math.sqrt(2.0) / B) * (Math.sqrt(B) * -Math.sqrt(F));
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) t_1 = math.sqrt((2.0 * (F * t_0))) tmp = 0 if B <= -2e+152: tmp = 2.0 * (math.sqrt((F * C)) / B) elif B <= -1.2e+50: tmp = (t_1 * -math.sqrt((C - B))) / t_0 elif B <= 5e-50: tmp = (t_1 * -math.sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0 else: tmp = (math.sqrt(2.0) / B) * (math.sqrt(B) * -math.sqrt(F)) return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) t_1 = sqrt(Float64(2.0 * Float64(F * t_0))) tmp = 0.0 if (B <= -2e+152) tmp = Float64(2.0 * Float64(sqrt(Float64(F * C)) / B)); elseif (B <= -1.2e+50) tmp = Float64(Float64(t_1 * Float64(-sqrt(Float64(C - B)))) / t_0); elseif (B <= 5e-50) tmp = Float64(Float64(t_1 * Float64(-sqrt(Float64(C + Float64(C + Float64(-0.5 * Float64(Float64(B * B) / A))))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(B) * Float64(-sqrt(F)))); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = (B * B) - (4.0 * (C * A));
t_1 = sqrt((2.0 * (F * t_0)));
tmp = 0.0;
if (B <= -2e+152)
tmp = 2.0 * (sqrt((F * C)) / B);
elseif (B <= -1.2e+50)
tmp = (t_1 * -sqrt((C - B))) / t_0;
elseif (B <= 5e-50)
tmp = (t_1 * -sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
else
tmp = (sqrt(2.0) / B) * (sqrt(B) * -sqrt(F));
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order 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]}, Block[{t$95$1 = N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, -2e+152], N[(2.0 * N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.2e+50], N[(N[(t$95$1 * (-N[Sqrt[N[(C - B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B, 5e-50], N[(N[(t$95$1 * (-N[Sqrt[N[(C + N[(C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $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}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
t_1 := \sqrt{2 \cdot \left(F \cdot t_0\right)}\\
\mathbf{if}\;B \leq -2 \cdot 10^{+152}:\\
\;\;\;\;2 \cdot \frac{\sqrt{F \cdot C}}{B}\\
\mathbf{elif}\;B \leq -1.2 \cdot 10^{+50}:\\
\;\;\;\;\frac{t_1 \cdot \left(-\sqrt{C - B}\right)}{t_0}\\
\mathbf{elif}\;B \leq 5 \cdot 10^{-50}:\\
\;\;\;\;\frac{t_1 \cdot \left(-\sqrt{C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\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 < -2.0000000000000001e152Initial program 0.0%
associate-*l*0.0%
unpow20.0%
+-commutative0.0%
unpow20.0%
associate-*l*0.0%
unpow20.0%
Simplified0.0%
Taylor expanded in A around -inf 0.0%
Taylor expanded in B around -inf 6.2%
associate-*r/6.2%
*-rgt-identity6.2%
*-commutative6.2%
Simplified6.2%
if -2.0000000000000001e152 < B < -1.2000000000000001e50Initial program 33.2%
associate-*l*33.2%
unpow233.2%
+-commutative33.2%
unpow233.2%
associate-*l*33.2%
unpow233.2%
Simplified33.2%
sqrt-prod50.7%
*-commutative50.7%
*-commutative50.7%
associate-+l+50.7%
unpow250.7%
hypot-udef54.9%
associate-+r+54.9%
+-commutative54.9%
associate-+r+54.9%
Applied egg-rr54.9%
Taylor expanded in B around -inf 43.3%
mul-1-neg43.3%
Simplified43.3%
if -1.2000000000000001e50 < B < 4.99999999999999968e-50Initial program 20.4%
associate-*l*20.4%
unpow220.4%
+-commutative20.4%
unpow220.4%
associate-*l*20.4%
unpow220.4%
Simplified20.4%
sqrt-prod23.2%
*-commutative23.2%
*-commutative23.2%
associate-+l+24.1%
unpow224.1%
hypot-udef41.2%
associate-+r+39.3%
+-commutative39.3%
associate-+r+40.9%
Applied egg-rr40.9%
Taylor expanded in A around -inf 32.3%
unpow232.3%
Simplified32.3%
if 4.99999999999999968e-50 < B Initial program 17.6%
Simplified20.3%
Taylor expanded in A around 0 25.1%
mul-1-neg25.1%
*-commutative25.1%
unpow225.1%
unpow225.1%
Simplified25.1%
Taylor expanded in C around 0 36.1%
sqrt-prod55.4%
Applied egg-rr55.4%
Final simplification35.9%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (/ (sqrt 2.0) B)) (t_1 (- (* B B) (* 4.0 (* C A)))))
(if (<= B -3.1e+50)
(* t_0 (sqrt (* F (+ A (hypot A B)))))
(if (<= B 6.1e-50)
(/
(*
(sqrt (* 2.0 (* F t_1)))
(- (sqrt (+ C (+ C (* -0.5 (/ (* B B) A)))))))
t_1)
(* t_0 (* (sqrt B) (- (sqrt F))))))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = sqrt(2.0) / B;
double t_1 = (B * B) - (4.0 * (C * A));
double tmp;
if (B <= -3.1e+50) {
tmp = t_0 * sqrt((F * (A + hypot(A, B))));
} else if (B <= 6.1e-50) {
tmp = (sqrt((2.0 * (F * t_1))) * -sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_1;
} else {
tmp = t_0 * (sqrt(B) * -sqrt(F));
}
return tmp;
}
assert A < C;
public static double code(double A, double B, double C, double F) {
double t_0 = Math.sqrt(2.0) / B;
double t_1 = (B * B) - (4.0 * (C * A));
double tmp;
if (B <= -3.1e+50) {
tmp = t_0 * Math.sqrt((F * (A + Math.hypot(A, B))));
} else if (B <= 6.1e-50) {
tmp = (Math.sqrt((2.0 * (F * t_1))) * -Math.sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_1;
} else {
tmp = t_0 * (Math.sqrt(B) * -Math.sqrt(F));
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = math.sqrt(2.0) / B t_1 = (B * B) - (4.0 * (C * A)) tmp = 0 if B <= -3.1e+50: tmp = t_0 * math.sqrt((F * (A + math.hypot(A, B)))) elif B <= 6.1e-50: tmp = (math.sqrt((2.0 * (F * t_1))) * -math.sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_1 else: tmp = t_0 * (math.sqrt(B) * -math.sqrt(F)) return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(sqrt(2.0) / B) t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (B <= -3.1e+50) tmp = Float64(t_0 * sqrt(Float64(F * Float64(A + hypot(A, B))))); elseif (B <= 6.1e-50) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * t_1))) * Float64(-sqrt(Float64(C + Float64(C + Float64(-0.5 * Float64(Float64(B * B) / A))))))) / t_1); else tmp = Float64(t_0 * Float64(sqrt(B) * Float64(-sqrt(F)))); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = sqrt(2.0) / B;
t_1 = (B * B) - (4.0 * (C * A));
tmp = 0.0;
if (B <= -3.1e+50)
tmp = t_0 * sqrt((F * (A + hypot(A, B))));
elseif (B <= 6.1e-50)
tmp = (sqrt((2.0 * (F * t_1))) * -sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_1;
else
tmp = t_0 * (sqrt(B) * -sqrt(F));
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -3.1e+50], N[(t$95$0 * N[Sqrt[N[(F * N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 6.1e-50], N[(N[(N[Sqrt[N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C + N[(C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision], N[(t$95$0 * N[(N[Sqrt[B], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \frac{\sqrt{2}}{B}\\
t_1 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;B \leq -3.1 \cdot 10^{+50}:\\
\;\;\;\;t_0 \cdot \sqrt{F \cdot \left(A + \mathsf{hypot}\left(A, B\right)\right)}\\
\mathbf{elif}\;B \leq 6.1 \cdot 10^{-50}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot t_1\right)} \cdot \left(-\sqrt{C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\right)}\right)}{t_1}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(\sqrt{B} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < -3.10000000000000003e50Initial program 12.4%
Simplified12.3%
sqrt-prod20.5%
*-commutative20.5%
associate-+r+20.5%
+-commutative20.5%
associate-+r+20.5%
Applied egg-rr20.5%
Taylor expanded in B around -inf 27.0%
associate-*r*27.0%
*-commutative27.0%
neg-mul-127.0%
distribute-rgt-neg-in27.0%
Simplified27.0%
Taylor expanded in C around 0 22.1%
*-commutative22.1%
+-commutative22.1%
unpow222.1%
unpow222.1%
hypot-def53.6%
Simplified53.6%
if -3.10000000000000003e50 < B < 6.0999999999999996e-50Initial program 20.4%
associate-*l*20.4%
unpow220.4%
+-commutative20.4%
unpow220.4%
associate-*l*20.4%
unpow220.4%
Simplified20.4%
sqrt-prod23.2%
*-commutative23.2%
*-commutative23.2%
associate-+l+24.1%
unpow224.1%
hypot-udef41.2%
associate-+r+39.3%
+-commutative39.3%
associate-+r+40.9%
Applied egg-rr40.9%
Taylor expanded in A around -inf 32.3%
unpow232.3%
Simplified32.3%
if 6.0999999999999996e-50 < B Initial program 17.6%
Simplified20.3%
Taylor expanded in A around 0 25.1%
mul-1-neg25.1%
*-commutative25.1%
unpow225.1%
unpow225.1%
Simplified25.1%
Taylor expanded in C around 0 36.1%
sqrt-prod55.4%
Applied egg-rr55.4%
Final simplification43.6%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= B -1.2e+50)
(/ (* (sqrt (* F (+ C (hypot C B)))) (sqrt 2.0)) B)
(if (<= B 4.7e-50)
(/
(*
(sqrt (* 2.0 (* F t_0)))
(- (sqrt (+ C (+ C (* -0.5 (/ (* B B) A)))))))
t_0)
(* (/ (sqrt 2.0) B) (* (sqrt B) (- (sqrt F))))))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (B <= -1.2e+50) {
tmp = (sqrt((F * (C + hypot(C, B)))) * sqrt(2.0)) / B;
} else if (B <= 4.7e-50) {
tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * (sqrt(B) * -sqrt(F));
}
return tmp;
}
assert A < C;
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 <= -1.2e+50) {
tmp = (Math.sqrt((F * (C + Math.hypot(C, B)))) * Math.sqrt(2.0)) / B;
} else if (B <= 4.7e-50) {
tmp = (Math.sqrt((2.0 * (F * t_0))) * -Math.sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
} else {
tmp = (Math.sqrt(2.0) / B) * (Math.sqrt(B) * -Math.sqrt(F));
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if B <= -1.2e+50: tmp = (math.sqrt((F * (C + math.hypot(C, B)))) * math.sqrt(2.0)) / B elif B <= 4.7e-50: tmp = (math.sqrt((2.0 * (F * t_0))) * -math.sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0 else: tmp = (math.sqrt(2.0) / B) * (math.sqrt(B) * -math.sqrt(F)) return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (B <= -1.2e+50) tmp = Float64(Float64(sqrt(Float64(F * Float64(C + hypot(C, B)))) * sqrt(2.0)) / B); elseif (B <= 4.7e-50) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * t_0))) * Float64(-sqrt(Float64(C + Float64(C + Float64(-0.5 * Float64(Float64(B * B) / A))))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(B) * Float64(-sqrt(F)))); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = (B * B) - (4.0 * (C * A));
tmp = 0.0;
if (B <= -1.2e+50)
tmp = (sqrt((F * (C + hypot(C, B)))) * sqrt(2.0)) / B;
elseif (B <= 4.7e-50)
tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
else
tmp = (sqrt(2.0) / B) * (sqrt(B) * -sqrt(F));
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order 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, -1.2e+50], N[(N[(N[Sqrt[N[(F * N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 4.7e-50], N[(N[(N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C + N[(C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $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}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;B \leq -1.2 \cdot 10^{+50}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)} \cdot \sqrt{2}}{B}\\
\mathbf{elif}\;B \leq 4.7 \cdot 10^{-50}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot t_0\right)} \cdot \left(-\sqrt{C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\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 < -1.2000000000000001e50Initial program 12.4%
Simplified12.3%
sqrt-prod20.5%
*-commutative20.5%
associate-+r+20.5%
+-commutative20.5%
associate-+r+20.5%
Applied egg-rr20.5%
Taylor expanded in B around -inf 27.0%
associate-*r*27.0%
*-commutative27.0%
neg-mul-127.0%
distribute-rgt-neg-in27.0%
Simplified27.0%
Taylor expanded in A around 0 19.1%
associate-*r/19.2%
*-commutative19.2%
+-commutative19.2%
unpow219.2%
unpow219.2%
hypot-def49.0%
Simplified49.0%
if -1.2000000000000001e50 < B < 4.7000000000000002e-50Initial program 20.4%
associate-*l*20.4%
unpow220.4%
+-commutative20.4%
unpow220.4%
associate-*l*20.4%
unpow220.4%
Simplified20.4%
sqrt-prod23.2%
*-commutative23.2%
*-commutative23.2%
associate-+l+24.1%
unpow224.1%
hypot-udef41.2%
associate-+r+39.3%
+-commutative39.3%
associate-+r+40.9%
Applied egg-rr40.9%
Taylor expanded in A around -inf 32.3%
unpow232.3%
Simplified32.3%
if 4.7000000000000002e-50 < B Initial program 17.6%
Simplified20.3%
Taylor expanded in A around 0 25.1%
mul-1-neg25.1%
*-commutative25.1%
unpow225.1%
unpow225.1%
Simplified25.1%
Taylor expanded in C around 0 36.1%
sqrt-prod55.4%
Applied egg-rr55.4%
Final simplification42.6%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))) (t_1 (sqrt (* 2.0 (* F t_0)))))
(if (<= B -3.7e+152)
(* 2.0 (/ (sqrt (* F C)) B))
(if (<= B -1.2e+50)
(/ (* t_1 (- (sqrt (- C B)))) t_0)
(if (<= B 6.1e-50)
(/ (* t_1 (- (sqrt (+ C (+ C (* -0.5 (/ (* B B) A))))))) t_0)
(* (sqrt (/ F B)) (- (sqrt 2.0))))))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double t_1 = sqrt((2.0 * (F * t_0)));
double tmp;
if (B <= -3.7e+152) {
tmp = 2.0 * (sqrt((F * C)) / B);
} else if (B <= -1.2e+50) {
tmp = (t_1 * -sqrt((C - B))) / t_0;
} else if (B <= 6.1e-50) {
tmp = (t_1 * -sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
} else {
tmp = sqrt((F / B)) * -sqrt(2.0);
}
return tmp;
}
NOTE: A and C should be sorted in increasing order before calling this function.
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (b * b) - (4.0d0 * (c * a))
t_1 = sqrt((2.0d0 * (f * t_0)))
if (b <= (-3.7d+152)) then
tmp = 2.0d0 * (sqrt((f * c)) / b)
else if (b <= (-1.2d+50)) then
tmp = (t_1 * -sqrt((c - b))) / t_0
else if (b <= 6.1d-50) then
tmp = (t_1 * -sqrt((c + (c + ((-0.5d0) * ((b * b) / a)))))) / t_0
else
tmp = sqrt((f / b)) * -sqrt(2.0d0)
end if
code = tmp
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double t_1 = Math.sqrt((2.0 * (F * t_0)));
double tmp;
if (B <= -3.7e+152) {
tmp = 2.0 * (Math.sqrt((F * C)) / B);
} else if (B <= -1.2e+50) {
tmp = (t_1 * -Math.sqrt((C - B))) / t_0;
} else if (B <= 6.1e-50) {
tmp = (t_1 * -Math.sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
} else {
tmp = Math.sqrt((F / B)) * -Math.sqrt(2.0);
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) t_1 = math.sqrt((2.0 * (F * t_0))) tmp = 0 if B <= -3.7e+152: tmp = 2.0 * (math.sqrt((F * C)) / B) elif B <= -1.2e+50: tmp = (t_1 * -math.sqrt((C - B))) / t_0 elif B <= 6.1e-50: tmp = (t_1 * -math.sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0 else: tmp = math.sqrt((F / B)) * -math.sqrt(2.0) return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) t_1 = sqrt(Float64(2.0 * Float64(F * t_0))) tmp = 0.0 if (B <= -3.7e+152) tmp = Float64(2.0 * Float64(sqrt(Float64(F * C)) / B)); elseif (B <= -1.2e+50) tmp = Float64(Float64(t_1 * Float64(-sqrt(Float64(C - B)))) / t_0); elseif (B <= 6.1e-50) tmp = Float64(Float64(t_1 * Float64(-sqrt(Float64(C + Float64(C + Float64(-0.5 * Float64(Float64(B * B) / A))))))) / t_0); else tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0))); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = (B * B) - (4.0 * (C * A));
t_1 = sqrt((2.0 * (F * t_0)));
tmp = 0.0;
if (B <= -3.7e+152)
tmp = 2.0 * (sqrt((F * C)) / B);
elseif (B <= -1.2e+50)
tmp = (t_1 * -sqrt((C - B))) / t_0;
elseif (B <= 6.1e-50)
tmp = (t_1 * -sqrt((C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
else
tmp = sqrt((F / B)) * -sqrt(2.0);
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order 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]}, Block[{t$95$1 = N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, -3.7e+152], N[(2.0 * N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.2e+50], N[(N[(t$95$1 * (-N[Sqrt[N[(C - B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B, 6.1e-50], N[(N[(t$95$1 * (-N[Sqrt[N[(C + N[(C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
t_1 := \sqrt{2 \cdot \left(F \cdot t_0\right)}\\
\mathbf{if}\;B \leq -3.7 \cdot 10^{+152}:\\
\;\;\;\;2 \cdot \frac{\sqrt{F \cdot C}}{B}\\
\mathbf{elif}\;B \leq -1.2 \cdot 10^{+50}:\\
\;\;\;\;\frac{t_1 \cdot \left(-\sqrt{C - B}\right)}{t_0}\\
\mathbf{elif}\;B \leq 6.1 \cdot 10^{-50}:\\
\;\;\;\;\frac{t_1 \cdot \left(-\sqrt{C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\right)}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\
\end{array}
\end{array}
if B < -3.69999999999999996e152Initial program 0.0%
associate-*l*0.0%
unpow20.0%
+-commutative0.0%
unpow20.0%
associate-*l*0.0%
unpow20.0%
Simplified0.0%
Taylor expanded in A around -inf 0.0%
Taylor expanded in B around -inf 6.2%
associate-*r/6.2%
*-rgt-identity6.2%
*-commutative6.2%
Simplified6.2%
if -3.69999999999999996e152 < B < -1.2000000000000001e50Initial program 33.2%
associate-*l*33.2%
unpow233.2%
+-commutative33.2%
unpow233.2%
associate-*l*33.2%
unpow233.2%
Simplified33.2%
sqrt-prod50.7%
*-commutative50.7%
*-commutative50.7%
associate-+l+50.7%
unpow250.7%
hypot-udef54.9%
associate-+r+54.9%
+-commutative54.9%
associate-+r+54.9%
Applied egg-rr54.9%
Taylor expanded in B around -inf 43.3%
mul-1-neg43.3%
Simplified43.3%
if -1.2000000000000001e50 < B < 6.0999999999999996e-50Initial program 20.4%
associate-*l*20.4%
unpow220.4%
+-commutative20.4%
unpow220.4%
associate-*l*20.4%
unpow220.4%
Simplified20.4%
sqrt-prod23.2%
*-commutative23.2%
*-commutative23.2%
associate-+l+24.1%
unpow224.1%
hypot-udef41.2%
associate-+r+39.3%
+-commutative39.3%
associate-+r+40.9%
Applied egg-rr40.9%
Taylor expanded in A around -inf 32.3%
unpow232.3%
Simplified32.3%
if 6.0999999999999996e-50 < B Initial program 17.6%
Simplified20.3%
Taylor expanded in A around 0 23.9%
*-commutative23.9%
unpow223.9%
unpow223.9%
hypot-def26.0%
Simplified26.0%
Taylor expanded in C around 0 47.9%
mul-1-neg47.9%
*-commutative47.9%
distribute-rgt-neg-in47.9%
Simplified47.9%
Final simplification33.8%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))) (t_1 (* 2.0 (* F t_0))))
(if (<= B -3.7e+152)
(* 2.0 (/ (sqrt (* F C)) B))
(if (<= B -2e+50)
(/ (* (sqrt t_1) (- (sqrt (- C B)))) t_0)
(if (<= B -4e-42)
(/ (- (sqrt (* t_1 (fma 2.0 C (* -0.5 (/ (* B B) A)))))) t_0)
(if (<= B 8.8e+21)
(/
(*
(sqrt (* 2.0 (* F (+ (* B B) (* (* C A) -4.0)))))
(- (sqrt (* C 2.0))))
t_0)
(* (sqrt (/ F B)) (- (sqrt 2.0)))))))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double t_1 = 2.0 * (F * t_0);
double tmp;
if (B <= -3.7e+152) {
tmp = 2.0 * (sqrt((F * C)) / B);
} else if (B <= -2e+50) {
tmp = (sqrt(t_1) * -sqrt((C - B))) / t_0;
} else if (B <= -4e-42) {
tmp = -sqrt((t_1 * fma(2.0, C, (-0.5 * ((B * B) / A))))) / t_0;
} else if (B <= 8.8e+21) {
tmp = (sqrt((2.0 * (F * ((B * B) + ((C * A) * -4.0))))) * -sqrt((C * 2.0))) / t_0;
} else {
tmp = sqrt((F / B)) * -sqrt(2.0);
}
return tmp;
}
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) t_1 = Float64(2.0 * Float64(F * t_0)) tmp = 0.0 if (B <= -3.7e+152) tmp = Float64(2.0 * Float64(sqrt(Float64(F * C)) / B)); elseif (B <= -2e+50) tmp = Float64(Float64(sqrt(t_1) * Float64(-sqrt(Float64(C - B)))) / t_0); elseif (B <= -4e-42) tmp = Float64(Float64(-sqrt(Float64(t_1 * fma(2.0, C, Float64(-0.5 * Float64(Float64(B * B) / A)))))) / t_0); elseif (B <= 8.8e+21) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(Float64(C * A) * -4.0))))) * Float64(-sqrt(Float64(C * 2.0)))) / t_0); else tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0))); end return tmp end
NOTE: A and C should be sorted in increasing order 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]}, Block[{t$95$1 = N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -3.7e+152], N[(2.0 * N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -2e+50], N[(N[(N[Sqrt[t$95$1], $MachinePrecision] * (-N[Sqrt[N[(C - B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B, -4e-42], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 8.8e+21], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C * 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
t_1 := 2 \cdot \left(F \cdot t_0\right)\\
\mathbf{if}\;B \leq -3.7 \cdot 10^{+152}:\\
\;\;\;\;2 \cdot \frac{\sqrt{F \cdot C}}{B}\\
\mathbf{elif}\;B \leq -2 \cdot 10^{+50}:\\
\;\;\;\;\frac{\sqrt{t_1} \cdot \left(-\sqrt{C - B}\right)}{t_0}\\
\mathbf{elif}\;B \leq -4 \cdot 10^{-42}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \mathsf{fma}\left(2, C, -0.5 \cdot \frac{B \cdot B}{A}\right)}}{t_0}\\
\mathbf{elif}\;B \leq 8.8 \cdot 10^{+21}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + \left(C \cdot A\right) \cdot -4\right)\right)} \cdot \left(-\sqrt{C \cdot 2}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\
\end{array}
\end{array}
if B < -3.69999999999999996e152Initial program 0.0%
associate-*l*0.0%
unpow20.0%
+-commutative0.0%
unpow20.0%
associate-*l*0.0%
unpow20.0%
Simplified0.0%
Taylor expanded in A around -inf 0.0%
Taylor expanded in B around -inf 6.2%
associate-*r/6.2%
*-rgt-identity6.2%
*-commutative6.2%
Simplified6.2%
if -3.69999999999999996e152 < B < -2.0000000000000002e50Initial program 33.2%
associate-*l*33.2%
unpow233.2%
+-commutative33.2%
unpow233.2%
associate-*l*33.2%
unpow233.2%
Simplified33.2%
sqrt-prod50.7%
*-commutative50.7%
*-commutative50.7%
associate-+l+50.7%
unpow250.7%
hypot-udef54.9%
associate-+r+54.9%
+-commutative54.9%
associate-+r+54.9%
Applied egg-rr54.9%
Taylor expanded in B around -inf 43.3%
mul-1-neg43.3%
Simplified43.3%
if -2.0000000000000002e50 < B < -4.00000000000000015e-42Initial program 26.3%
associate-*l*26.3%
unpow226.3%
+-commutative26.3%
unpow226.3%
associate-*l*26.3%
unpow226.3%
Simplified26.3%
Taylor expanded in A around -inf 34.3%
fma-def34.3%
unpow234.3%
Simplified34.3%
if -4.00000000000000015e-42 < B < 8.8e21Initial program 20.6%
associate-*l*20.6%
unpow220.6%
+-commutative20.6%
unpow220.6%
associate-*l*20.6%
unpow220.6%
Simplified20.6%
Taylor expanded in A around -inf 25.4%
sqrt-prod31.9%
*-commutative31.9%
cancel-sign-sub-inv31.9%
metadata-eval31.9%
*-commutative31.9%
Applied egg-rr31.9%
if 8.8e21 < B Initial program 14.7%
Simplified16.3%
Taylor expanded in A around 0 21.8%
*-commutative21.8%
unpow221.8%
unpow221.8%
hypot-def24.3%
Simplified24.3%
Taylor expanded in C around 0 54.0%
mul-1-neg54.0%
*-commutative54.0%
distribute-rgt-neg-in54.0%
Simplified54.0%
Final simplification34.3%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= B -3.1e+144)
(* 2.0 (/ (sqrt (* F C)) B))
(if (<= B -8.2e-30)
(/ (- (sqrt (* (+ C (hypot B C)) (* 2.0 (* F t_0))))) t_0)
(if (<= B 7.2e+21)
(/
(*
(sqrt (* 2.0 (* F (+ (* B B) (* (* C A) -4.0)))))
(- (sqrt (* C 2.0))))
t_0)
(* (sqrt (/ F B)) (- (sqrt 2.0))))))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (B <= -3.1e+144) {
tmp = 2.0 * (sqrt((F * C)) / B);
} else if (B <= -8.2e-30) {
tmp = -sqrt(((C + hypot(B, C)) * (2.0 * (F * t_0)))) / t_0;
} else if (B <= 7.2e+21) {
tmp = (sqrt((2.0 * (F * ((B * B) + ((C * A) * -4.0))))) * -sqrt((C * 2.0))) / t_0;
} else {
tmp = sqrt((F / B)) * -sqrt(2.0);
}
return tmp;
}
assert A < C;
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 <= -3.1e+144) {
tmp = 2.0 * (Math.sqrt((F * C)) / B);
} else if (B <= -8.2e-30) {
tmp = -Math.sqrt(((C + Math.hypot(B, C)) * (2.0 * (F * t_0)))) / t_0;
} else if (B <= 7.2e+21) {
tmp = (Math.sqrt((2.0 * (F * ((B * B) + ((C * A) * -4.0))))) * -Math.sqrt((C * 2.0))) / t_0;
} else {
tmp = Math.sqrt((F / B)) * -Math.sqrt(2.0);
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if B <= -3.1e+144: tmp = 2.0 * (math.sqrt((F * C)) / B) elif B <= -8.2e-30: tmp = -math.sqrt(((C + math.hypot(B, C)) * (2.0 * (F * t_0)))) / t_0 elif B <= 7.2e+21: tmp = (math.sqrt((2.0 * (F * ((B * B) + ((C * A) * -4.0))))) * -math.sqrt((C * 2.0))) / t_0 else: tmp = math.sqrt((F / B)) * -math.sqrt(2.0) return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (B <= -3.1e+144) tmp = Float64(2.0 * Float64(sqrt(Float64(F * C)) / B)); elseif (B <= -8.2e-30) tmp = Float64(Float64(-sqrt(Float64(Float64(C + hypot(B, C)) * Float64(2.0 * Float64(F * t_0))))) / t_0); elseif (B <= 7.2e+21) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(Float64(C * A) * -4.0))))) * Float64(-sqrt(Float64(C * 2.0)))) / t_0); else tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0))); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = (B * B) - (4.0 * (C * A));
tmp = 0.0;
if (B <= -3.1e+144)
tmp = 2.0 * (sqrt((F * C)) / B);
elseif (B <= -8.2e-30)
tmp = -sqrt(((C + hypot(B, C)) * (2.0 * (F * t_0)))) / t_0;
elseif (B <= 7.2e+21)
tmp = (sqrt((2.0 * (F * ((B * B) + ((C * A) * -4.0))))) * -sqrt((C * 2.0))) / t_0;
else
tmp = sqrt((F / B)) * -sqrt(2.0);
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order 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, -3.1e+144], N[(2.0 * N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -8.2e-30], N[((-N[Sqrt[N[(N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 7.2e+21], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C * 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;B \leq -3.1 \cdot 10^{+144}:\\
\;\;\;\;2 \cdot \frac{\sqrt{F \cdot C}}{B}\\
\mathbf{elif}\;B \leq -8.2 \cdot 10^{-30}:\\
\;\;\;\;\frac{-\sqrt{\left(C + \mathsf{hypot}\left(B, C\right)\right) \cdot \left(2 \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 7.2 \cdot 10^{+21}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + \left(C \cdot A\right) \cdot -4\right)\right)} \cdot \left(-\sqrt{C \cdot 2}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\
\end{array}
\end{array}
if B < -3.1000000000000002e144Initial program 0.0%
associate-*l*0.0%
unpow20.0%
+-commutative0.0%
unpow20.0%
associate-*l*0.0%
unpow20.0%
Simplified0.0%
Taylor expanded in A around -inf 0.0%
Taylor expanded in B around -inf 6.2%
associate-*r/6.2%
*-rgt-identity6.2%
*-commutative6.2%
Simplified6.2%
if -3.1000000000000002e144 < B < -8.2000000000000007e-30Initial program 33.2%
associate-*l*33.2%
unpow233.2%
+-commutative33.2%
unpow233.2%
associate-*l*33.2%
unpow233.2%
Simplified33.2%
Taylor expanded in A around 0 27.9%
unpow227.9%
unpow227.9%
hypot-def28.0%
Simplified28.0%
if -8.2000000000000007e-30 < B < 7.2e21Initial program 20.0%
associate-*l*20.0%
unpow220.0%
+-commutative20.0%
unpow220.0%
associate-*l*20.0%
unpow220.0%
Simplified20.0%
Taylor expanded in A around -inf 26.1%
sqrt-prod31.7%
*-commutative31.7%
cancel-sign-sub-inv31.7%
metadata-eval31.7%
*-commutative31.7%
Applied egg-rr31.7%
if 7.2e21 < B Initial program 14.7%
Simplified16.3%
Taylor expanded in A around 0 21.8%
*-commutative21.8%
unpow221.8%
unpow221.8%
hypot-def24.3%
Simplified24.3%
Taylor expanded in C around 0 54.0%
mul-1-neg54.0%
*-commutative54.0%
distribute-rgt-neg-in54.0%
Simplified54.0%
Final simplification32.5%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= B -3.7e+152)
(* 2.0 (/ (sqrt (* F C)) B))
(if (<= B -3e-28)
(/ (* (sqrt (* 2.0 (* F t_0))) (- (sqrt (- C B)))) t_0)
(if (<= B 7.5e+21)
(/
(*
(sqrt (* 2.0 (* F (+ (* B B) (* (* C A) -4.0)))))
(- (sqrt (* C 2.0))))
t_0)
(* (sqrt (/ F B)) (- (sqrt 2.0))))))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (B <= -3.7e+152) {
tmp = 2.0 * (sqrt((F * C)) / B);
} else if (B <= -3e-28) {
tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C - B))) / t_0;
} else if (B <= 7.5e+21) {
tmp = (sqrt((2.0 * (F * ((B * B) + ((C * A) * -4.0))))) * -sqrt((C * 2.0))) / t_0;
} else {
tmp = sqrt((F / B)) * -sqrt(2.0);
}
return tmp;
}
NOTE: A and C should be sorted in increasing order 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 (b <= (-3.7d+152)) then
tmp = 2.0d0 * (sqrt((f * c)) / b)
else if (b <= (-3d-28)) then
tmp = (sqrt((2.0d0 * (f * t_0))) * -sqrt((c - b))) / t_0
else if (b <= 7.5d+21) then
tmp = (sqrt((2.0d0 * (f * ((b * b) + ((c * a) * (-4.0d0)))))) * -sqrt((c * 2.0d0))) / t_0
else
tmp = sqrt((f / b)) * -sqrt(2.0d0)
end if
code = tmp
end function
assert A < C;
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 <= -3.7e+152) {
tmp = 2.0 * (Math.sqrt((F * C)) / B);
} else if (B <= -3e-28) {
tmp = (Math.sqrt((2.0 * (F * t_0))) * -Math.sqrt((C - B))) / t_0;
} else if (B <= 7.5e+21) {
tmp = (Math.sqrt((2.0 * (F * ((B * B) + ((C * A) * -4.0))))) * -Math.sqrt((C * 2.0))) / t_0;
} else {
tmp = Math.sqrt((F / B)) * -Math.sqrt(2.0);
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if B <= -3.7e+152: tmp = 2.0 * (math.sqrt((F * C)) / B) elif B <= -3e-28: tmp = (math.sqrt((2.0 * (F * t_0))) * -math.sqrt((C - B))) / t_0 elif B <= 7.5e+21: tmp = (math.sqrt((2.0 * (F * ((B * B) + ((C * A) * -4.0))))) * -math.sqrt((C * 2.0))) / t_0 else: tmp = math.sqrt((F / B)) * -math.sqrt(2.0) return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (B <= -3.7e+152) tmp = Float64(2.0 * Float64(sqrt(Float64(F * C)) / B)); elseif (B <= -3e-28) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * t_0))) * Float64(-sqrt(Float64(C - B)))) / t_0); elseif (B <= 7.5e+21) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(Float64(C * A) * -4.0))))) * Float64(-sqrt(Float64(C * 2.0)))) / t_0); else tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0))); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = (B * B) - (4.0 * (C * A));
tmp = 0.0;
if (B <= -3.7e+152)
tmp = 2.0 * (sqrt((F * C)) / B);
elseif (B <= -3e-28)
tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C - B))) / t_0;
elseif (B <= 7.5e+21)
tmp = (sqrt((2.0 * (F * ((B * B) + ((C * A) * -4.0))))) * -sqrt((C * 2.0))) / t_0;
else
tmp = sqrt((F / B)) * -sqrt(2.0);
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order 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, -3.7e+152], N[(2.0 * N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -3e-28], N[(N[(N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C - B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B, 7.5e+21], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C * 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;B \leq -3.7 \cdot 10^{+152}:\\
\;\;\;\;2 \cdot \frac{\sqrt{F \cdot C}}{B}\\
\mathbf{elif}\;B \leq -3 \cdot 10^{-28}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot t_0\right)} \cdot \left(-\sqrt{C - B}\right)}{t_0}\\
\mathbf{elif}\;B \leq 7.5 \cdot 10^{+21}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + \left(C \cdot A\right) \cdot -4\right)\right)} \cdot \left(-\sqrt{C \cdot 2}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\
\end{array}
\end{array}
if B < -3.69999999999999996e152Initial program 0.0%
associate-*l*0.0%
unpow20.0%
+-commutative0.0%
unpow20.0%
associate-*l*0.0%
unpow20.0%
Simplified0.0%
Taylor expanded in A around -inf 0.0%
Taylor expanded in B around -inf 6.2%
associate-*r/6.2%
*-rgt-identity6.2%
*-commutative6.2%
Simplified6.2%
if -3.69999999999999996e152 < B < -3.00000000000000003e-28Initial program 33.2%
associate-*l*33.2%
unpow233.2%
+-commutative33.2%
unpow233.2%
associate-*l*33.2%
unpow233.2%
Simplified33.2%
sqrt-prod43.9%
*-commutative43.9%
*-commutative43.9%
associate-+l+44.3%
unpow244.3%
hypot-udef50.0%
associate-+r+49.2%
+-commutative49.2%
associate-+r+49.3%
Applied egg-rr49.3%
Taylor expanded in B around -inf 38.8%
mul-1-neg38.8%
Simplified38.8%
if -3.00000000000000003e-28 < B < 7.5e21Initial program 20.0%
associate-*l*20.0%
unpow220.0%
+-commutative20.0%
unpow220.0%
associate-*l*20.0%
unpow220.0%
Simplified20.0%
Taylor expanded in A around -inf 26.1%
sqrt-prod31.7%
*-commutative31.7%
cancel-sign-sub-inv31.7%
metadata-eval31.7%
*-commutative31.7%
Applied egg-rr31.7%
if 7.5e21 < B Initial program 14.7%
Simplified16.3%
Taylor expanded in A around 0 21.8%
*-commutative21.8%
unpow221.8%
unpow221.8%
hypot-def24.3%
Simplified24.3%
Taylor expanded in C around 0 54.0%
mul-1-neg54.0%
*-commutative54.0%
distribute-rgt-neg-in54.0%
Simplified54.0%
Final simplification34.1%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(if (<= B -2.2e+60)
(* 2.0 (/ (pow (* F C) 0.5) B))
(if (<= B 7.3e+21)
(/
(*
(sqrt (* 2.0 (* F (+ (* B B) (* (* C A) -4.0)))))
(- (sqrt (* C 2.0))))
(- (* B B) (* 4.0 (* C A))))
(* (sqrt (/ F B)) (- (sqrt 2.0))))))assert(A < C);
double code(double A, double B, double C, double F) {
double tmp;
if (B <= -2.2e+60) {
tmp = 2.0 * (pow((F * C), 0.5) / B);
} else if (B <= 7.3e+21) {
tmp = (sqrt((2.0 * (F * ((B * B) + ((C * A) * -4.0))))) * -sqrt((C * 2.0))) / ((B * B) - (4.0 * (C * A)));
} else {
tmp = sqrt((F / B)) * -sqrt(2.0);
}
return tmp;
}
NOTE: A and C should be sorted in increasing order 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 (b <= (-2.2d+60)) then
tmp = 2.0d0 * (((f * c) ** 0.5d0) / b)
else if (b <= 7.3d+21) then
tmp = (sqrt((2.0d0 * (f * ((b * b) + ((c * a) * (-4.0d0)))))) * -sqrt((c * 2.0d0))) / ((b * b) - (4.0d0 * (c * a)))
else
tmp = sqrt((f / b)) * -sqrt(2.0d0)
end if
code = tmp
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
double tmp;
if (B <= -2.2e+60) {
tmp = 2.0 * (Math.pow((F * C), 0.5) / B);
} else if (B <= 7.3e+21) {
tmp = (Math.sqrt((2.0 * (F * ((B * B) + ((C * A) * -4.0))))) * -Math.sqrt((C * 2.0))) / ((B * B) - (4.0 * (C * A)));
} else {
tmp = Math.sqrt((F / B)) * -Math.sqrt(2.0);
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): tmp = 0 if B <= -2.2e+60: tmp = 2.0 * (math.pow((F * C), 0.5) / B) elif B <= 7.3e+21: tmp = (math.sqrt((2.0 * (F * ((B * B) + ((C * A) * -4.0))))) * -math.sqrt((C * 2.0))) / ((B * B) - (4.0 * (C * A))) else: tmp = math.sqrt((F / B)) * -math.sqrt(2.0) return tmp
A, C = sort([A, C]) function code(A, B, C, F) tmp = 0.0 if (B <= -2.2e+60) tmp = Float64(2.0 * Float64((Float64(F * C) ^ 0.5) / B)); elseif (B <= 7.3e+21) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(Float64(C * A) * -4.0))))) * Float64(-sqrt(Float64(C * 2.0)))) / Float64(Float64(B * B) - Float64(4.0 * Float64(C * A)))); else tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0))); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
tmp = 0.0;
if (B <= -2.2e+60)
tmp = 2.0 * (((F * C) ^ 0.5) / B);
elseif (B <= 7.3e+21)
tmp = (sqrt((2.0 * (F * ((B * B) + ((C * A) * -4.0))))) * -sqrt((C * 2.0))) / ((B * B) - (4.0 * (C * A)));
else
tmp = sqrt((F / B)) * -sqrt(2.0);
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order before calling this function. code[A_, B_, C_, F_] := If[LessEqual[B, -2.2e+60], N[(2.0 * N[(N[Power[N[(F * C), $MachinePrecision], 0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 7.3e+21], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C * 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.2 \cdot 10^{+60}:\\
\;\;\;\;2 \cdot \frac{{\left(F \cdot C\right)}^{0.5}}{B}\\
\mathbf{elif}\;B \leq 7.3 \cdot 10^{+21}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + \left(C \cdot A\right) \cdot -4\right)\right)} \cdot \left(-\sqrt{C \cdot 2}\right)}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\
\end{array}
\end{array}
if B < -2.19999999999999996e60Initial program 11.1%
associate-*l*11.1%
unpow211.1%
+-commutative11.1%
unpow211.1%
associate-*l*11.1%
unpow211.1%
Simplified11.1%
Taylor expanded in A around -inf 0.4%
Taylor expanded in B around -inf 4.8%
associate-*r/4.8%
*-rgt-identity4.8%
*-commutative4.8%
Simplified4.8%
pow1/22.0%
Applied egg-rr5.0%
if -2.19999999999999996e60 < B < 7.3e21Initial program 21.6%
associate-*l*21.6%
unpow221.6%
+-commutative21.6%
unpow221.6%
associate-*l*21.6%
unpow221.6%
Simplified21.6%
Taylor expanded in A around -inf 23.3%
sqrt-prod28.8%
*-commutative28.8%
cancel-sign-sub-inv28.8%
metadata-eval28.8%
*-commutative28.8%
Applied egg-rr28.8%
if 7.3e21 < B Initial program 14.7%
Simplified16.3%
Taylor expanded in A around 0 21.8%
*-commutative21.8%
unpow221.8%
unpow221.8%
hypot-def24.3%
Simplified24.3%
Taylor expanded in C around 0 54.0%
mul-1-neg54.0%
*-commutative54.0%
distribute-rgt-neg-in54.0%
Simplified54.0%
Final simplification29.3%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= B -9.8e+88)
(* 2.0 (/ (sqrt (* F C)) B))
(if (<= B 9.6e+21)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (* C 2.0)))) t_0)
(* (sqrt (/ F B)) (- (sqrt 2.0)))))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (B <= -9.8e+88) {
tmp = 2.0 * (sqrt((F * C)) / B);
} else if (B <= 9.6e+21) {
tmp = -sqrt(((2.0 * (F * t_0)) * (C * 2.0))) / t_0;
} else {
tmp = sqrt((F / B)) * -sqrt(2.0);
}
return tmp;
}
NOTE: A and C should be sorted in increasing order 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 (b <= (-9.8d+88)) then
tmp = 2.0d0 * (sqrt((f * c)) / b)
else if (b <= 9.6d+21) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * (c * 2.0d0))) / t_0
else
tmp = sqrt((f / b)) * -sqrt(2.0d0)
end if
code = tmp
end function
assert A < C;
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 <= -9.8e+88) {
tmp = 2.0 * (Math.sqrt((F * C)) / B);
} else if (B <= 9.6e+21) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (C * 2.0))) / t_0;
} else {
tmp = Math.sqrt((F / B)) * -Math.sqrt(2.0);
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if B <= -9.8e+88: tmp = 2.0 * (math.sqrt((F * C)) / B) elif B <= 9.6e+21: tmp = -math.sqrt(((2.0 * (F * t_0)) * (C * 2.0))) / t_0 else: tmp = math.sqrt((F / B)) * -math.sqrt(2.0) return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (B <= -9.8e+88) tmp = Float64(2.0 * Float64(sqrt(Float64(F * C)) / B)); elseif (B <= 9.6e+21) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(C * 2.0)))) / t_0); else tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0))); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = (B * B) - (4.0 * (C * A));
tmp = 0.0;
if (B <= -9.8e+88)
tmp = 2.0 * (sqrt((F * C)) / B);
elseif (B <= 9.6e+21)
tmp = -sqrt(((2.0 * (F * t_0)) * (C * 2.0))) / t_0;
else
tmp = sqrt((F / B)) * -sqrt(2.0);
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order 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, -9.8e+88], N[(2.0 * N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 9.6e+21], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(C * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;B \leq -9.8 \cdot 10^{+88}:\\
\;\;\;\;2 \cdot \frac{\sqrt{F \cdot C}}{B}\\
\mathbf{elif}\;B \leq 9.6 \cdot 10^{+21}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(C \cdot 2\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\
\end{array}
\end{array}
if B < -9.8000000000000005e88Initial program 6.5%
associate-*l*6.5%
unpow26.5%
+-commutative6.5%
unpow26.5%
associate-*l*6.5%
unpow26.5%
Simplified6.5%
Taylor expanded in A around -inf 0.3%
Taylor expanded in B around -inf 5.2%
associate-*r/5.2%
*-rgt-identity5.2%
*-commutative5.2%
Simplified5.2%
if -9.8000000000000005e88 < B < 9.6e21Initial program 22.7%
associate-*l*22.7%
unpow222.7%
+-commutative22.7%
unpow222.7%
associate-*l*22.7%
unpow222.7%
Simplified22.7%
Taylor expanded in A around -inf 22.3%
if 9.6e21 < B Initial program 14.7%
Simplified16.3%
Taylor expanded in A around 0 21.8%
*-commutative21.8%
unpow221.8%
unpow221.8%
hypot-def24.3%
Simplified24.3%
Taylor expanded in C around 0 54.0%
mul-1-neg54.0%
*-commutative54.0%
distribute-rgt-neg-in54.0%
Simplified54.0%
Final simplification26.2%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= B -1.9e+52)
(* 2.0 (/ (* (sqrt F) (sqrt C)) B))
(if (<= B 7.8e+21)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (* C 2.0)))) t_0)
(* (sqrt (/ F B)) (- (sqrt 2.0)))))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (B <= -1.9e+52) {
tmp = 2.0 * ((sqrt(F) * sqrt(C)) / B);
} else if (B <= 7.8e+21) {
tmp = -sqrt(((2.0 * (F * t_0)) * (C * 2.0))) / t_0;
} else {
tmp = sqrt((F / B)) * -sqrt(2.0);
}
return tmp;
}
NOTE: A and C should be sorted in increasing order 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 (b <= (-1.9d+52)) then
tmp = 2.0d0 * ((sqrt(f) * sqrt(c)) / b)
else if (b <= 7.8d+21) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * (c * 2.0d0))) / t_0
else
tmp = sqrt((f / b)) * -sqrt(2.0d0)
end if
code = tmp
end function
assert A < C;
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 <= -1.9e+52) {
tmp = 2.0 * ((Math.sqrt(F) * Math.sqrt(C)) / B);
} else if (B <= 7.8e+21) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (C * 2.0))) / t_0;
} else {
tmp = Math.sqrt((F / B)) * -Math.sqrt(2.0);
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if B <= -1.9e+52: tmp = 2.0 * ((math.sqrt(F) * math.sqrt(C)) / B) elif B <= 7.8e+21: tmp = -math.sqrt(((2.0 * (F * t_0)) * (C * 2.0))) / t_0 else: tmp = math.sqrt((F / B)) * -math.sqrt(2.0) return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (B <= -1.9e+52) tmp = Float64(2.0 * Float64(Float64(sqrt(F) * sqrt(C)) / B)); elseif (B <= 7.8e+21) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(C * 2.0)))) / t_0); else tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0))); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = (B * B) - (4.0 * (C * A));
tmp = 0.0;
if (B <= -1.9e+52)
tmp = 2.0 * ((sqrt(F) * sqrt(C)) / B);
elseif (B <= 7.8e+21)
tmp = -sqrt(((2.0 * (F * t_0)) * (C * 2.0))) / t_0;
else
tmp = sqrt((F / B)) * -sqrt(2.0);
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order 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, -1.9e+52], N[(2.0 * N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[C], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 7.8e+21], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(C * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;B \leq -1.9 \cdot 10^{+52}:\\
\;\;\;\;2 \cdot \frac{\sqrt{F} \cdot \sqrt{C}}{B}\\
\mathbf{elif}\;B \leq 7.8 \cdot 10^{+21}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(C \cdot 2\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\
\end{array}
\end{array}
if B < -1.9e52Initial program 10.9%
associate-*l*10.9%
unpow210.9%
+-commutative10.9%
unpow210.9%
associate-*l*10.9%
unpow210.9%
Simplified10.9%
Taylor expanded in A around -inf 0.5%
Taylor expanded in B around -inf 4.7%
associate-*r/4.7%
*-rgt-identity4.7%
*-commutative4.7%
Simplified4.7%
sqrt-prod6.3%
Applied egg-rr6.3%
if -1.9e52 < B < 7.8e21Initial program 21.9%
associate-*l*21.9%
unpow221.9%
+-commutative21.9%
unpow221.9%
associate-*l*21.9%
unpow221.9%
Simplified21.9%
Taylor expanded in A around -inf 23.6%
if 7.8e21 < B Initial program 14.7%
Simplified16.3%
Taylor expanded in A around 0 21.8%
*-commutative21.8%
unpow221.8%
unpow221.8%
hypot-def24.3%
Simplified24.3%
Taylor expanded in C around 0 54.0%
mul-1-neg54.0%
*-commutative54.0%
distribute-rgt-neg-in54.0%
Simplified54.0%
Final simplification26.6%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (/ (sqrt (* F C)) B)))
(if (<= B -9.8e+88)
(* 2.0 t_0)
(if (<= B 1.3e+81)
(/
(- (pow (* 2.0 (* (* F (+ (* B B) (* (* C A) -4.0))) (* C 2.0))) 0.5))
(- (* B B) (* 4.0 (* C A))))
(* t_0 -2.0)))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = sqrt((F * C)) / B;
double tmp;
if (B <= -9.8e+88) {
tmp = 2.0 * t_0;
} else if (B <= 1.3e+81) {
tmp = -pow((2.0 * ((F * ((B * B) + ((C * A) * -4.0))) * (C * 2.0))), 0.5) / ((B * B) - (4.0 * (C * A)));
} else {
tmp = t_0 * -2.0;
}
return tmp;
}
NOTE: A and C should be sorted in increasing order 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 = sqrt((f * c)) / b
if (b <= (-9.8d+88)) then
tmp = 2.0d0 * t_0
else if (b <= 1.3d+81) then
tmp = -((2.0d0 * ((f * ((b * b) + ((c * a) * (-4.0d0)))) * (c * 2.0d0))) ** 0.5d0) / ((b * b) - (4.0d0 * (c * a)))
else
tmp = t_0 * (-2.0d0)
end if
code = tmp
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
double t_0 = Math.sqrt((F * C)) / B;
double tmp;
if (B <= -9.8e+88) {
tmp = 2.0 * t_0;
} else if (B <= 1.3e+81) {
tmp = -Math.pow((2.0 * ((F * ((B * B) + ((C * A) * -4.0))) * (C * 2.0))), 0.5) / ((B * B) - (4.0 * (C * A)));
} else {
tmp = t_0 * -2.0;
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = math.sqrt((F * C)) / B tmp = 0 if B <= -9.8e+88: tmp = 2.0 * t_0 elif B <= 1.3e+81: tmp = -math.pow((2.0 * ((F * ((B * B) + ((C * A) * -4.0))) * (C * 2.0))), 0.5) / ((B * B) - (4.0 * (C * A))) else: tmp = t_0 * -2.0 return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(sqrt(Float64(F * C)) / B) tmp = 0.0 if (B <= -9.8e+88) tmp = Float64(2.0 * t_0); elseif (B <= 1.3e+81) tmp = Float64(Float64(-(Float64(2.0 * Float64(Float64(F * Float64(Float64(B * B) + Float64(Float64(C * A) * -4.0))) * Float64(C * 2.0))) ^ 0.5)) / Float64(Float64(B * B) - Float64(4.0 * Float64(C * A)))); else tmp = Float64(t_0 * -2.0); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = sqrt((F * C)) / B;
tmp = 0.0;
if (B <= -9.8e+88)
tmp = 2.0 * t_0;
elseif (B <= 1.3e+81)
tmp = -((2.0 * ((F * ((B * B) + ((C * A) * -4.0))) * (C * 2.0))) ^ 0.5) / ((B * B) - (4.0 * (C * A)));
else
tmp = t_0 * -2.0;
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[B, -9.8e+88], N[(2.0 * t$95$0), $MachinePrecision], If[LessEqual[B, 1.3e+81], N[((-N[Power[N[(2.0 * N[(N[(F * N[(N[(B * B), $MachinePrecision] + N[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(C * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * -2.0), $MachinePrecision]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \frac{\sqrt{F \cdot C}}{B}\\
\mathbf{if}\;B \leq -9.8 \cdot 10^{+88}:\\
\;\;\;\;2 \cdot t_0\\
\mathbf{elif}\;B \leq 1.3 \cdot 10^{+81}:\\
\;\;\;\;\frac{-{\left(2 \cdot \left(\left(F \cdot \left(B \cdot B + \left(C \cdot A\right) \cdot -4\right)\right) \cdot \left(C \cdot 2\right)\right)\right)}^{0.5}}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot -2\\
\end{array}
\end{array}
if B < -9.8000000000000005e88Initial program 6.5%
associate-*l*6.5%
unpow26.5%
+-commutative6.5%
unpow26.5%
associate-*l*6.5%
unpow26.5%
Simplified6.5%
Taylor expanded in A around -inf 0.3%
Taylor expanded in B around -inf 5.2%
associate-*r/5.2%
*-rgt-identity5.2%
*-commutative5.2%
Simplified5.2%
if -9.8000000000000005e88 < B < 1.29999999999999996e81Initial program 24.4%
associate-*l*24.4%
unpow224.4%
+-commutative24.4%
unpow224.4%
associate-*l*24.4%
unpow224.4%
Simplified24.4%
Taylor expanded in A around -inf 20.5%
pow1/220.8%
associate-*l*20.8%
*-commutative20.8%
cancel-sign-sub-inv20.8%
metadata-eval20.8%
*-commutative20.8%
Applied egg-rr20.8%
if 1.29999999999999996e81 < B Initial program 5.4%
associate-*l*5.4%
unpow25.4%
+-commutative5.4%
unpow25.4%
associate-*l*5.4%
unpow25.4%
Simplified5.4%
Taylor expanded in A around -inf 5.2%
Taylor expanded in B around inf 7.4%
associate-*r/7.4%
*-rgt-identity7.4%
*-commutative7.4%
Simplified7.4%
Final simplification15.6%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* (* C A) -4.0))) (t_1 (/ (sqrt (* F C)) B)))
(if (<= B -4.6e+89)
(* 2.0 t_1)
(if (<= B 2e+79)
(/ (- (sqrt (* 2.0 (* (* F t_0) (* C 2.0))))) t_0)
(* t_1 -2.0)))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + ((C * A) * -4.0);
double t_1 = sqrt((F * C)) / B;
double tmp;
if (B <= -4.6e+89) {
tmp = 2.0 * t_1;
} else if (B <= 2e+79) {
tmp = -sqrt((2.0 * ((F * t_0) * (C * 2.0)))) / t_0;
} else {
tmp = t_1 * -2.0;
}
return tmp;
}
NOTE: A and C should be sorted in increasing order 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 = sqrt((f * c)) / b
if (b <= (-4.6d+89)) then
tmp = 2.0d0 * t_1
else if (b <= 2d+79) then
tmp = -sqrt((2.0d0 * ((f * t_0) * (c * 2.0d0)))) / t_0
else
tmp = t_1 * (-2.0d0)
end if
code = tmp
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + ((C * A) * -4.0);
double t_1 = Math.sqrt((F * C)) / B;
double tmp;
if (B <= -4.6e+89) {
tmp = 2.0 * t_1;
} else if (B <= 2e+79) {
tmp = -Math.sqrt((2.0 * ((F * t_0) * (C * 2.0)))) / t_0;
} else {
tmp = t_1 * -2.0;
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = (B * B) + ((C * A) * -4.0) t_1 = math.sqrt((F * C)) / B tmp = 0 if B <= -4.6e+89: tmp = 2.0 * t_1 elif B <= 2e+79: tmp = -math.sqrt((2.0 * ((F * t_0) * (C * 2.0)))) / t_0 else: tmp = t_1 * -2.0 return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(Float64(C * A) * -4.0)) t_1 = Float64(sqrt(Float64(F * C)) / B) tmp = 0.0 if (B <= -4.6e+89) tmp = Float64(2.0 * t_1); elseif (B <= 2e+79) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(C * 2.0))))) / t_0); else tmp = Float64(t_1 * -2.0); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = (B * B) + ((C * A) * -4.0);
t_1 = sqrt((F * C)) / B;
tmp = 0.0;
if (B <= -4.6e+89)
tmp = 2.0 * t_1;
elseif (B <= 2e+79)
tmp = -sqrt((2.0 * ((F * t_0) * (C * 2.0)))) / t_0;
else
tmp = t_1 * -2.0;
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order 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[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[B, -4.6e+89], N[(2.0 * t$95$1), $MachinePrecision], If[LessEqual[B, 2e+79], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(C * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(t$95$1 * -2.0), $MachinePrecision]]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B + \left(C \cdot A\right) \cdot -4\\
t_1 := \frac{\sqrt{F \cdot C}}{B}\\
\mathbf{if}\;B \leq -4.6 \cdot 10^{+89}:\\
\;\;\;\;2 \cdot t_1\\
\mathbf{elif}\;B \leq 2 \cdot 10^{+79}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(C \cdot 2\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot -2\\
\end{array}
\end{array}
if B < -4.5999999999999998e89Initial program 6.5%
associate-*l*6.5%
unpow26.5%
+-commutative6.5%
unpow26.5%
associate-*l*6.5%
unpow26.5%
Simplified6.5%
Taylor expanded in A around -inf 0.3%
Taylor expanded in B around -inf 5.2%
associate-*r/5.2%
*-rgt-identity5.2%
*-commutative5.2%
Simplified5.2%
if -4.5999999999999998e89 < B < 1.99999999999999993e79Initial program 24.5%
associate-*l*24.5%
unpow224.5%
+-commutative24.5%
unpow224.5%
associate-*l*24.5%
unpow224.5%
Simplified24.5%
Taylor expanded in A around -inf 20.6%
distribute-frac-neg20.6%
associate-*l*20.6%
*-commutative20.6%
cancel-sign-sub-inv20.6%
metadata-eval20.6%
*-commutative20.6%
cancel-sign-sub-inv20.6%
metadata-eval20.6%
*-commutative20.6%
Applied egg-rr20.6%
if 1.99999999999999993e79 < B Initial program 5.3%
associate-*l*5.3%
unpow25.3%
+-commutative5.3%
unpow25.3%
associate-*l*5.3%
unpow25.3%
Simplified5.3%
Taylor expanded in A around -inf 5.2%
Taylor expanded in B around inf 7.3%
associate-*r/7.3%
*-rgt-identity7.3%
*-commutative7.3%
Simplified7.3%
Final simplification15.4%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))) (t_1 (/ (sqrt (* F C)) B)))
(if (<= B -1.24e+88)
(* 2.0 t_1)
(if (<= B 2.65e+84)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (* C 2.0)))) t_0)
(* t_1 -2.0)))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double t_1 = sqrt((F * C)) / B;
double tmp;
if (B <= -1.24e+88) {
tmp = 2.0 * t_1;
} else if (B <= 2.65e+84) {
tmp = -sqrt(((2.0 * (F * t_0)) * (C * 2.0))) / t_0;
} else {
tmp = t_1 * -2.0;
}
return tmp;
}
NOTE: A and C should be sorted in increasing order before calling this function.
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (b * b) - (4.0d0 * (c * a))
t_1 = sqrt((f * c)) / b
if (b <= (-1.24d+88)) then
tmp = 2.0d0 * t_1
else if (b <= 2.65d+84) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * (c * 2.0d0))) / t_0
else
tmp = t_1 * (-2.0d0)
end if
code = tmp
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double t_1 = Math.sqrt((F * C)) / B;
double tmp;
if (B <= -1.24e+88) {
tmp = 2.0 * t_1;
} else if (B <= 2.65e+84) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (C * 2.0))) / t_0;
} else {
tmp = t_1 * -2.0;
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) t_1 = math.sqrt((F * C)) / B tmp = 0 if B <= -1.24e+88: tmp = 2.0 * t_1 elif B <= 2.65e+84: tmp = -math.sqrt(((2.0 * (F * t_0)) * (C * 2.0))) / t_0 else: tmp = t_1 * -2.0 return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) t_1 = Float64(sqrt(Float64(F * C)) / B) tmp = 0.0 if (B <= -1.24e+88) tmp = Float64(2.0 * t_1); elseif (B <= 2.65e+84) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(C * 2.0)))) / t_0); else tmp = Float64(t_1 * -2.0); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = (B * B) - (4.0 * (C * A));
t_1 = sqrt((F * C)) / B;
tmp = 0.0;
if (B <= -1.24e+88)
tmp = 2.0 * t_1;
elseif (B <= 2.65e+84)
tmp = -sqrt(((2.0 * (F * t_0)) * (C * 2.0))) / t_0;
else
tmp = t_1 * -2.0;
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order 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]}, Block[{t$95$1 = N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[B, -1.24e+88], N[(2.0 * t$95$1), $MachinePrecision], If[LessEqual[B, 2.65e+84], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(C * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(t$95$1 * -2.0), $MachinePrecision]]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
t_1 := \frac{\sqrt{F \cdot C}}{B}\\
\mathbf{if}\;B \leq -1.24 \cdot 10^{+88}:\\
\;\;\;\;2 \cdot t_1\\
\mathbf{elif}\;B \leq 2.65 \cdot 10^{+84}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(C \cdot 2\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot -2\\
\end{array}
\end{array}
if B < -1.24e88Initial program 6.5%
associate-*l*6.5%
unpow26.5%
+-commutative6.5%
unpow26.5%
associate-*l*6.5%
unpow26.5%
Simplified6.5%
Taylor expanded in A around -inf 0.3%
Taylor expanded in B around -inf 5.2%
associate-*r/5.2%
*-rgt-identity5.2%
*-commutative5.2%
Simplified5.2%
if -1.24e88 < B < 2.6500000000000001e84Initial program 24.4%
associate-*l*24.4%
unpow224.4%
+-commutative24.4%
unpow224.4%
associate-*l*24.4%
unpow224.4%
Simplified24.4%
Taylor expanded in A around -inf 20.5%
if 2.6500000000000001e84 < B Initial program 5.4%
associate-*l*5.4%
unpow25.4%
+-commutative5.4%
unpow25.4%
associate-*l*5.4%
unpow25.4%
Simplified5.4%
Taylor expanded in A around -inf 5.2%
Taylor expanded in B around inf 7.4%
associate-*r/7.4%
*-rgt-identity7.4%
*-commutative7.4%
Simplified7.4%
Final simplification15.4%
NOTE: A and C should be sorted in increasing order before calling this function. (FPCore (A B C F) :precision binary64 (if (<= B -1.2e-274) (* 2.0 (/ (sqrt (* F C)) B)) (* (/ (pow (* F C) 0.5) B) -2.0)))
assert(A < C);
double code(double A, double B, double C, double F) {
double tmp;
if (B <= -1.2e-274) {
tmp = 2.0 * (sqrt((F * C)) / B);
} else {
tmp = (pow((F * C), 0.5) / B) * -2.0;
}
return tmp;
}
NOTE: A and C should be sorted in increasing order 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 (b <= (-1.2d-274)) then
tmp = 2.0d0 * (sqrt((f * c)) / b)
else
tmp = (((f * c) ** 0.5d0) / b) * (-2.0d0)
end if
code = tmp
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
double tmp;
if (B <= -1.2e-274) {
tmp = 2.0 * (Math.sqrt((F * C)) / B);
} else {
tmp = (Math.pow((F * C), 0.5) / B) * -2.0;
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): tmp = 0 if B <= -1.2e-274: tmp = 2.0 * (math.sqrt((F * C)) / B) else: tmp = (math.pow((F * C), 0.5) / B) * -2.0 return tmp
A, C = sort([A, C]) function code(A, B, C, F) tmp = 0.0 if (B <= -1.2e-274) tmp = Float64(2.0 * Float64(sqrt(Float64(F * C)) / B)); else tmp = Float64(Float64((Float64(F * C) ^ 0.5) / B) * -2.0); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
tmp = 0.0;
if (B <= -1.2e-274)
tmp = 2.0 * (sqrt((F * C)) / B);
else
tmp = (((F * C) ^ 0.5) / B) * -2.0;
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order before calling this function. code[A_, B_, C_, F_] := If[LessEqual[B, -1.2e-274], N[(2.0 * N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(F * C), $MachinePrecision], 0.5], $MachinePrecision] / B), $MachinePrecision] * -2.0), $MachinePrecision]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.2 \cdot 10^{-274}:\\
\;\;\;\;2 \cdot \frac{\sqrt{F \cdot C}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(F \cdot C\right)}^{0.5}}{B} \cdot -2\\
\end{array}
\end{array}
if B < -1.2e-274Initial program 17.9%
associate-*l*17.9%
unpow217.9%
+-commutative17.9%
unpow217.9%
associate-*l*17.9%
unpow217.9%
Simplified17.9%
Taylor expanded in A around -inf 13.0%
Taylor expanded in B around -inf 4.2%
associate-*r/4.2%
*-rgt-identity4.2%
*-commutative4.2%
Simplified4.2%
if -1.2e-274 < B Initial program 17.7%
associate-*l*17.7%
unpow217.7%
+-commutative17.7%
unpow217.7%
associate-*l*17.7%
unpow217.7%
Simplified17.7%
Taylor expanded in A around -inf 15.2%
Taylor expanded in B around inf 5.1%
associate-*r/5.1%
*-rgt-identity5.1%
*-commutative5.1%
Simplified5.1%
pow1/25.5%
Applied egg-rr5.5%
Final simplification4.8%
NOTE: A and C should be sorted in increasing order before calling this function. (FPCore (A B C F) :precision binary64 (let* ((t_0 (/ (pow (* F C) 0.5) B))) (if (<= B -1.2e-274) (* 2.0 t_0) (* t_0 -2.0))))
assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = pow((F * C), 0.5) / B;
double tmp;
if (B <= -1.2e-274) {
tmp = 2.0 * t_0;
} else {
tmp = t_0 * -2.0;
}
return tmp;
}
NOTE: A and C should be sorted in increasing order 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 = ((f * c) ** 0.5d0) / b
if (b <= (-1.2d-274)) then
tmp = 2.0d0 * t_0
else
tmp = t_0 * (-2.0d0)
end if
code = tmp
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow((F * C), 0.5) / B;
double tmp;
if (B <= -1.2e-274) {
tmp = 2.0 * t_0;
} else {
tmp = t_0 * -2.0;
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = math.pow((F * C), 0.5) / B tmp = 0 if B <= -1.2e-274: tmp = 2.0 * t_0 else: tmp = t_0 * -2.0 return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64((Float64(F * C) ^ 0.5) / B) tmp = 0.0 if (B <= -1.2e-274) tmp = Float64(2.0 * t_0); else tmp = Float64(t_0 * -2.0); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = ((F * C) ^ 0.5) / B;
tmp = 0.0;
if (B <= -1.2e-274)
tmp = 2.0 * t_0;
else
tmp = t_0 * -2.0;
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[N[(F * C), $MachinePrecision], 0.5], $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[B, -1.2e-274], N[(2.0 * t$95$0), $MachinePrecision], N[(t$95$0 * -2.0), $MachinePrecision]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \frac{{\left(F \cdot C\right)}^{0.5}}{B}\\
\mathbf{if}\;B \leq -1.2 \cdot 10^{-274}:\\
\;\;\;\;2 \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot -2\\
\end{array}
\end{array}
if B < -1.2e-274Initial program 17.9%
associate-*l*17.9%
unpow217.9%
+-commutative17.9%
unpow217.9%
associate-*l*17.9%
unpow217.9%
Simplified17.9%
Taylor expanded in A around -inf 13.0%
Taylor expanded in B around -inf 4.2%
associate-*r/4.2%
*-rgt-identity4.2%
*-commutative4.2%
Simplified4.2%
pow1/21.3%
Applied egg-rr4.3%
if -1.2e-274 < B Initial program 17.7%
associate-*l*17.7%
unpow217.7%
+-commutative17.7%
unpow217.7%
associate-*l*17.7%
unpow217.7%
Simplified17.7%
Taylor expanded in A around -inf 15.2%
Taylor expanded in B around inf 5.1%
associate-*r/5.1%
*-rgt-identity5.1%
*-commutative5.1%
Simplified5.1%
pow1/25.5%
Applied egg-rr5.5%
Final simplification4.9%
NOTE: A and C should be sorted in increasing order before calling this function. (FPCore (A B C F) :precision binary64 (let* ((t_0 (/ (sqrt (* F C)) B))) (if (<= B -2e-310) (* 2.0 t_0) (* t_0 -2.0))))
assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = sqrt((F * C)) / B;
double tmp;
if (B <= -2e-310) {
tmp = 2.0 * t_0;
} else {
tmp = t_0 * -2.0;
}
return tmp;
}
NOTE: A and C should be sorted in increasing order 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 = sqrt((f * c)) / b
if (b <= (-2d-310)) then
tmp = 2.0d0 * t_0
else
tmp = t_0 * (-2.0d0)
end if
code = tmp
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
double t_0 = Math.sqrt((F * C)) / B;
double tmp;
if (B <= -2e-310) {
tmp = 2.0 * t_0;
} else {
tmp = t_0 * -2.0;
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = math.sqrt((F * C)) / B tmp = 0 if B <= -2e-310: tmp = 2.0 * t_0 else: tmp = t_0 * -2.0 return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(sqrt(Float64(F * C)) / B) tmp = 0.0 if (B <= -2e-310) tmp = Float64(2.0 * t_0); else tmp = Float64(t_0 * -2.0); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = sqrt((F * C)) / B;
tmp = 0.0;
if (B <= -2e-310)
tmp = 2.0 * t_0;
else
tmp = t_0 * -2.0;
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[B, -2e-310], N[(2.0 * t$95$0), $MachinePrecision], N[(t$95$0 * -2.0), $MachinePrecision]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \frac{\sqrt{F \cdot C}}{B}\\
\mathbf{if}\;B \leq -2 \cdot 10^{-310}:\\
\;\;\;\;2 \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot -2\\
\end{array}
\end{array}
if B < -1.999999999999994e-310Initial program 17.3%
associate-*l*17.3%
unpow217.3%
+-commutative17.3%
unpow217.3%
associate-*l*17.3%
unpow217.3%
Simplified17.3%
Taylor expanded in A around -inf 13.3%
Taylor expanded in B around -inf 4.0%
associate-*r/4.0%
*-rgt-identity4.0%
*-commutative4.0%
Simplified4.0%
if -1.999999999999994e-310 < B Initial program 18.3%
associate-*l*18.3%
unpow218.3%
+-commutative18.3%
unpow218.3%
associate-*l*18.3%
unpow218.3%
Simplified18.3%
Taylor expanded in A around -inf 15.0%
Taylor expanded in B around inf 5.3%
associate-*r/5.3%
*-rgt-identity5.3%
*-commutative5.3%
Simplified5.3%
Final simplification4.6%
NOTE: A and C should be sorted in increasing order before calling this function. (FPCore (A B C F) :precision binary64 (* (/ (sqrt (* F C)) B) -2.0))
assert(A < C);
double code(double A, double B, double C, double F) {
return (sqrt((F * C)) / B) * -2.0;
}
NOTE: A and C should be sorted in increasing order before calling this function.
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
code = (sqrt((f * c)) / b) * (-2.0d0)
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
return (Math.sqrt((F * C)) / B) * -2.0;
}
[A, C] = sort([A, C]) def code(A, B, C, F): return (math.sqrt((F * C)) / B) * -2.0
A, C = sort([A, C]) function code(A, B, C, F) return Float64(Float64(sqrt(Float64(F * C)) / B) * -2.0) end
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
tmp = (sqrt((F * C)) / B) * -2.0;
end
NOTE: A and C should be sorted in increasing order before calling this function. code[A_, B_, C_, F_] := N[(N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision] * -2.0), $MachinePrecision]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\frac{\sqrt{F \cdot C}}{B} \cdot -2
\end{array}
Initial program 17.8%
associate-*l*17.8%
unpow217.8%
+-commutative17.8%
unpow217.8%
associate-*l*17.8%
unpow217.8%
Simplified17.8%
Taylor expanded in A around -inf 14.1%
Taylor expanded in B around inf 3.1%
associate-*r/3.1%
*-rgt-identity3.1%
*-commutative3.1%
Simplified3.1%
Final simplification3.1%
herbie shell --seed 2023182
(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))))