
(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 21 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}
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (+ (* B_m B_m) (* A (* C -4.0))))
(t_1 (* (* 4.0 A) C))
(t_2
(/
(sqrt
(*
(* 2.0 (* (- (pow B_m 2.0) t_1) F))
(+ (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
(- t_1 (pow B_m 2.0))))
(t_3 (- t_1 (* B_m B_m)))
(t_4 (/ (sqrt (* 4.0 C)) (- (* 4.0 (* A C)) (* B_m B_m)))))
(if (<= t_2 (- INFINITY))
(* t_4 (* (sqrt t_0) (sqrt F)))
(if (<= t_2 -5e-197)
(/ (sqrt (* 2.0 (* t_0 (* F (+ (+ A C) (hypot B_m (- A C))))))) t_3)
(if (<= t_2 0.0)
(/
(*
(sqrt F)
(sqrt
(*
(+ (* 2.0 (* B_m B_m)) (* (* A C) -8.0))
(+ (* 2.0 C) (/ (* (* B_m B_m) -0.5) A)))))
t_3)
(if (<= t_2 INFINITY)
(* t_4 (sqrt (* F (+ (* B_m B_m) (* (* A C) -4.0)))))
(* (sqrt (/ F B_m)) (- 0.0 (sqrt 2.0)))))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (B_m * B_m) + (A * (C * -4.0));
double t_1 = (4.0 * A) * C;
double t_2 = sqrt(((2.0 * ((pow(B_m, 2.0) - t_1) * F)) * ((A + C) + sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / (t_1 - pow(B_m, 2.0));
double t_3 = t_1 - (B_m * B_m);
double t_4 = sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_4 * (sqrt(t_0) * sqrt(F));
} else if (t_2 <= -5e-197) {
tmp = sqrt((2.0 * (t_0 * (F * ((A + C) + hypot(B_m, (A - C))))))) / t_3;
} else if (t_2 <= 0.0) {
tmp = (sqrt(F) * sqrt((((2.0 * (B_m * B_m)) + ((A * C) * -8.0)) * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_3;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_4 * sqrt((F * ((B_m * B_m) + ((A * C) * -4.0))));
} else {
tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (B_m * B_m) + (A * (C * -4.0));
double t_1 = (4.0 * A) * C;
double t_2 = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_1) * F)) * ((A + C) + Math.sqrt((Math.pow(B_m, 2.0) + Math.pow((A - C), 2.0)))))) / (t_1 - Math.pow(B_m, 2.0));
double t_3 = t_1 - (B_m * B_m);
double t_4 = Math.sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_4 * (Math.sqrt(t_0) * Math.sqrt(F));
} else if (t_2 <= -5e-197) {
tmp = Math.sqrt((2.0 * (t_0 * (F * ((A + C) + Math.hypot(B_m, (A - C))))))) / t_3;
} else if (t_2 <= 0.0) {
tmp = (Math.sqrt(F) * Math.sqrt((((2.0 * (B_m * B_m)) + ((A * C) * -8.0)) * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_3;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_4 * Math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0))));
} else {
tmp = Math.sqrt((F / B_m)) * (0.0 - Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (B_m * B_m) + (A * (C * -4.0)) t_1 = (4.0 * A) * C t_2 = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_1) * F)) * ((A + C) + math.sqrt((math.pow(B_m, 2.0) + math.pow((A - C), 2.0)))))) / (t_1 - math.pow(B_m, 2.0)) t_3 = t_1 - (B_m * B_m) t_4 = math.sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m)) tmp = 0 if t_2 <= -math.inf: tmp = t_4 * (math.sqrt(t_0) * math.sqrt(F)) elif t_2 <= -5e-197: tmp = math.sqrt((2.0 * (t_0 * (F * ((A + C) + math.hypot(B_m, (A - C))))))) / t_3 elif t_2 <= 0.0: tmp = (math.sqrt(F) * math.sqrt((((2.0 * (B_m * B_m)) + ((A * C) * -8.0)) * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_3 elif t_2 <= math.inf: tmp = t_4 * math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) else: tmp = math.sqrt((F / B_m)) * (0.0 - math.sqrt(2.0)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) t_1 = Float64(Float64(4.0 * A) * C) t_2 = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_1) * F)) * Float64(Float64(A + C) + sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / Float64(t_1 - (B_m ^ 2.0))) t_3 = Float64(t_1 - Float64(B_m * B_m)) t_4 = Float64(sqrt(Float64(4.0 * C)) / Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(t_4 * Float64(sqrt(t_0) * sqrt(F))); elseif (t_2 <= -5e-197) tmp = Float64(sqrt(Float64(2.0 * Float64(t_0 * Float64(F * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))))) / t_3); elseif (t_2 <= 0.0) tmp = Float64(Float64(sqrt(F) * sqrt(Float64(Float64(Float64(2.0 * Float64(B_m * B_m)) + Float64(Float64(A * C) * -8.0)) * Float64(Float64(2.0 * C) + Float64(Float64(Float64(B_m * B_m) * -0.5) / A))))) / t_3); elseif (t_2 <= Inf) tmp = Float64(t_4 * sqrt(Float64(F * Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0))))); else tmp = Float64(sqrt(Float64(F / B_m)) * Float64(0.0 - sqrt(2.0))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (B_m * B_m) + (A * (C * -4.0));
t_1 = (4.0 * A) * C;
t_2 = sqrt(((2.0 * (((B_m ^ 2.0) - t_1) * F)) * ((A + C) + sqrt(((B_m ^ 2.0) + ((A - C) ^ 2.0)))))) / (t_1 - (B_m ^ 2.0));
t_3 = t_1 - (B_m * B_m);
t_4 = sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m));
tmp = 0.0;
if (t_2 <= -Inf)
tmp = t_4 * (sqrt(t_0) * sqrt(F));
elseif (t_2 <= -5e-197)
tmp = sqrt((2.0 * (t_0 * (F * ((A + C) + hypot(B_m, (A - C))))))) / t_3;
elseif (t_2 <= 0.0)
tmp = (sqrt(F) * sqrt((((2.0 * (B_m * B_m)) + ((A * C) * -8.0)) * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_3;
elseif (t_2 <= Inf)
tmp = t_4 * sqrt((F * ((B_m * B_m) + ((A * C) * -4.0))));
else
tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$1), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$1 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(4.0 * C), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(t$95$4 * N[(N[Sqrt[t$95$0], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -5e-197], N[(N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(N[(N[(2.0 * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -8.0), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * C), $MachinePrecision] + N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(t$95$4 * N[Sqrt[N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\\
t_1 := \left(4 \cdot A\right) \cdot C\\
t_2 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_1\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_1 - {B\_m}^{2}}\\
t_3 := t\_1 - B\_m \cdot B\_m\\
t_4 := \frac{\sqrt{4 \cdot C}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_4 \cdot \left(\sqrt{t\_0} \cdot \sqrt{F}\right)\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-197}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(t\_0 \cdot \left(F \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_3}\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\sqrt{F} \cdot \sqrt{\left(2 \cdot \left(B\_m \cdot B\_m\right) + \left(A \cdot C\right) \cdot -8\right) \cdot \left(2 \cdot C + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{A}\right)}}{t\_3}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_4 \cdot \sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(0 - \sqrt{2}\right)\\
\end{array}
\end{array}
if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -inf.0Initial program 3.2%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified15.6%
Applied egg-rr36.3%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr35.5%
sqrt-prodN/A
pow1/2N/A
*-lowering-*.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6460.4%
Applied egg-rr60.4%
Taylor expanded in A around -inf
*-lowering-*.f6434.0%
Simplified34.0%
if -inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -5.0000000000000002e-197Initial program 95.8%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified96.7%
if -5.0000000000000002e-197 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -0.0Initial program 3.7%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified3.7%
Taylor expanded in A around -inf
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6426.6%
Simplified26.6%
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
sqrt-prodN/A
*-lowering-*.f64N/A
Applied egg-rr45.5%
if -0.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < +inf.0Initial program 48.8%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified70.2%
Applied egg-rr88.0%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr88.0%
Taylor expanded in A around -inf
*-lowering-*.f6443.8%
Simplified43.8%
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) Initial program 0.0%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified0.8%
Applied egg-rr0.1%
Taylor expanded in B around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6413.2%
Simplified13.2%
Final simplification41.2%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(if (<= B_m 1.6e-19)
(/
(*
(sqrt (* F (+ (* B_m B_m) (* (* A C) -4.0))))
(sqrt (* 2.0 (+ (* 2.0 C) (/ (* (* B_m B_m) -0.5) A)))))
(- (* (* 4.0 A) C) (* B_m B_m)))
(if (<= B_m 3.1e+147)
(*
(/
(sqrt (* 2.0 (+ (+ A C) (hypot B_m (- A C)))))
(- (* 4.0 (* A C)) (* B_m B_m)))
(* B_m (sqrt F)))
(* (sqrt (/ F B_m)) (- 0.0 (sqrt 2.0))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 1.6e-19) {
tmp = (sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / (((4.0 * A) * C) - (B_m * B_m));
} else if (B_m <= 3.1e+147) {
tmp = (sqrt((2.0 * ((A + C) + hypot(B_m, (A - C))))) / ((4.0 * (A * C)) - (B_m * B_m))) * (B_m * sqrt(F));
} else {
tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 1.6e-19) {
tmp = (Math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * Math.sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / (((4.0 * A) * C) - (B_m * B_m));
} else if (B_m <= 3.1e+147) {
tmp = (Math.sqrt((2.0 * ((A + C) + Math.hypot(B_m, (A - C))))) / ((4.0 * (A * C)) - (B_m * B_m))) * (B_m * Math.sqrt(F));
} else {
tmp = Math.sqrt((F / B_m)) * (0.0 - Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if B_m <= 1.6e-19: tmp = (math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * math.sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / (((4.0 * A) * C) - (B_m * B_m)) elif B_m <= 3.1e+147: tmp = (math.sqrt((2.0 * ((A + C) + math.hypot(B_m, (A - C))))) / ((4.0 * (A * C)) - (B_m * B_m))) * (B_m * math.sqrt(F)) else: tmp = math.sqrt((F / B_m)) * (0.0 - math.sqrt(2.0)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 1.6e-19) tmp = Float64(Float64(sqrt(Float64(F * Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)))) * sqrt(Float64(2.0 * Float64(Float64(2.0 * C) + Float64(Float64(Float64(B_m * B_m) * -0.5) / A))))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))); elseif (B_m <= 3.1e+147) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))) / Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m))) * Float64(B_m * sqrt(F))); else tmp = Float64(sqrt(Float64(F / B_m)) * Float64(0.0 - sqrt(2.0))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (B_m <= 1.6e-19)
tmp = (sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / (((4.0 * A) * C) - (B_m * B_m));
elseif (B_m <= 3.1e+147)
tmp = (sqrt((2.0 * ((A + C) + hypot(B_m, (A - C))))) / ((4.0 * (A * C)) - (B_m * B_m))) * (B_m * sqrt(F));
else
tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 1.6e-19], N[(N[(N[Sqrt[N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(N[(2.0 * C), $MachinePrecision] + N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 3.1e+147], N[(N[(N[Sqrt[N[(2.0 * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B$95$m * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 1.6 \cdot 10^{-19}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)} \cdot \sqrt{2 \cdot \left(2 \cdot C + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{A}\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\
\mathbf{elif}\;B\_m \leq 3.1 \cdot 10^{+147}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m} \cdot \left(B\_m \cdot \sqrt{F}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(0 - \sqrt{2}\right)\\
\end{array}
\end{array}
if B < 1.59999999999999991e-19Initial program 24.8%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified30.9%
Taylor expanded in A around -inf
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6418.7%
Simplified18.7%
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
sqrt-prodN/A
*-lowering-*.f64N/A
Applied egg-rr19.8%
if 1.59999999999999991e-19 < B < 3.1e147Initial program 38.0%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified45.8%
Applied egg-rr53.4%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr53.2%
Taylor expanded in B around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6457.6%
Simplified57.6%
if 3.1e147 < B Initial program 0.2%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified0.4%
Applied egg-rr0.5%
Taylor expanded in B around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6449.4%
Simplified49.4%
Final simplification29.0%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (+ (* B_m B_m) (* (* A C) -4.0))))
(if (<= A -7.2e+49)
(/
(*
(sqrt F)
(sqrt
(*
(+ (* 2.0 (* B_m B_m)) (* (* A C) -8.0))
(+ (* 2.0 C) (/ (* (* B_m B_m) -0.5) A)))))
(- (* (* 4.0 A) C) (* B_m B_m)))
(if (<= A 7.4e-305)
(*
(sqrt (/ (* F (+ A (+ C (hypot B_m (- A C))))) t_0))
(- 0.0 (sqrt 2.0)))
(*
(/ (sqrt (* 4.0 C)) (- (* 4.0 (* A C)) (* B_m B_m)))
(sqrt (* F t_0)))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (B_m * B_m) + ((A * C) * -4.0);
double tmp;
if (A <= -7.2e+49) {
tmp = (sqrt(F) * sqrt((((2.0 * (B_m * B_m)) + ((A * C) * -8.0)) * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / (((4.0 * A) * C) - (B_m * B_m));
} else if (A <= 7.4e-305) {
tmp = sqrt(((F * (A + (C + hypot(B_m, (A - C))))) / t_0)) * (0.0 - sqrt(2.0));
} else {
tmp = (sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m))) * sqrt((F * t_0));
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (B_m * B_m) + ((A * C) * -4.0);
double tmp;
if (A <= -7.2e+49) {
tmp = (Math.sqrt(F) * Math.sqrt((((2.0 * (B_m * B_m)) + ((A * C) * -8.0)) * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / (((4.0 * A) * C) - (B_m * B_m));
} else if (A <= 7.4e-305) {
tmp = Math.sqrt(((F * (A + (C + Math.hypot(B_m, (A - C))))) / t_0)) * (0.0 - Math.sqrt(2.0));
} else {
tmp = (Math.sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m))) * Math.sqrt((F * t_0));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (B_m * B_m) + ((A * C) * -4.0) tmp = 0 if A <= -7.2e+49: tmp = (math.sqrt(F) * math.sqrt((((2.0 * (B_m * B_m)) + ((A * C) * -8.0)) * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / (((4.0 * A) * C) - (B_m * B_m)) elif A <= 7.4e-305: tmp = math.sqrt(((F * (A + (C + math.hypot(B_m, (A - C))))) / t_0)) * (0.0 - math.sqrt(2.0)) else: tmp = (math.sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m))) * math.sqrt((F * t_0)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)) tmp = 0.0 if (A <= -7.2e+49) tmp = Float64(Float64(sqrt(F) * sqrt(Float64(Float64(Float64(2.0 * Float64(B_m * B_m)) + Float64(Float64(A * C) * -8.0)) * Float64(Float64(2.0 * C) + Float64(Float64(Float64(B_m * B_m) * -0.5) / A))))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))); elseif (A <= 7.4e-305) tmp = Float64(sqrt(Float64(Float64(F * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))) / t_0)) * Float64(0.0 - sqrt(2.0))); else tmp = Float64(Float64(sqrt(Float64(4.0 * C)) / Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m))) * sqrt(Float64(F * t_0))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (B_m * B_m) + ((A * C) * -4.0);
tmp = 0.0;
if (A <= -7.2e+49)
tmp = (sqrt(F) * sqrt((((2.0 * (B_m * B_m)) + ((A * C) * -8.0)) * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / (((4.0 * A) * C) - (B_m * B_m));
elseif (A <= 7.4e-305)
tmp = sqrt(((F * (A + (C + hypot(B_m, (A - C))))) / t_0)) * (0.0 - sqrt(2.0));
else
tmp = (sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m))) * sqrt((F * t_0));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -7.2e+49], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(N[(N[(2.0 * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -8.0), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * C), $MachinePrecision] + N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 7.4e-305], N[(N[Sqrt[N[(N[(F * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(4.0 * C), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(F * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\\
\mathbf{if}\;A \leq -7.2 \cdot 10^{+49}:\\
\;\;\;\;\frac{\sqrt{F} \cdot \sqrt{\left(2 \cdot \left(B\_m \cdot B\_m\right) + \left(A \cdot C\right) \cdot -8\right) \cdot \left(2 \cdot C + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{A}\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\
\mathbf{elif}\;A \leq 7.4 \cdot 10^{-305}:\\
\;\;\;\;\sqrt{\frac{F \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)}{t\_0}} \cdot \left(0 - \sqrt{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{4 \cdot C}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m} \cdot \sqrt{F \cdot t\_0}\\
\end{array}
\end{array}
if A < -7.19999999999999993e49Initial program 5.0%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified6.1%
Taylor expanded in A around -inf
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6432.2%
Simplified32.2%
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
sqrt-prodN/A
*-lowering-*.f64N/A
Applied egg-rr37.9%
if -7.19999999999999993e49 < A < 7.39999999999999954e-305Initial program 32.1%
Taylor expanded in F around 0
mul-1-negN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
Simplified42.7%
if 7.39999999999999954e-305 < A Initial program 31.3%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified41.5%
Applied egg-rr54.0%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr53.4%
Taylor expanded in A around -inf
*-lowering-*.f6413.8%
Simplified13.8%
Final simplification26.9%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))))
(if (<= B_m 3.5e-21)
(/
(*
(sqrt (* F (+ (* B_m B_m) (* (* A C) -4.0))))
(sqrt (* 2.0 (+ (* 2.0 C) (/ (* (* B_m B_m) -0.5) A)))))
t_0)
(if (<= B_m 1.1e+28)
(/
(sqrt
(*
2.0
(*
(+ (* B_m B_m) (* A (* C -4.0)))
(* F (+ (+ A C) (hypot B_m (- A C)))))))
t_0)
(* (sqrt (* F (+ C (hypot B_m C)))) (- 0.0 (/ (sqrt 2.0) B_m)))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = ((4.0 * A) * C) - (B_m * B_m);
double tmp;
if (B_m <= 3.5e-21) {
tmp = (sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_0;
} else if (B_m <= 1.1e+28) {
tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + hypot(B_m, (A - C))))))) / t_0;
} else {
tmp = sqrt((F * (C + hypot(B_m, C)))) * (0.0 - (sqrt(2.0) / B_m));
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = ((4.0 * A) * C) - (B_m * B_m);
double tmp;
if (B_m <= 3.5e-21) {
tmp = (Math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * Math.sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_0;
} else if (B_m <= 1.1e+28) {
tmp = Math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + Math.hypot(B_m, (A - C))))))) / t_0;
} else {
tmp = Math.sqrt((F * (C + Math.hypot(B_m, C)))) * (0.0 - (Math.sqrt(2.0) / B_m));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = ((4.0 * A) * C) - (B_m * B_m) tmp = 0 if B_m <= 3.5e-21: tmp = (math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * math.sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_0 elif B_m <= 1.1e+28: tmp = math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + math.hypot(B_m, (A - C))))))) / t_0 else: tmp = math.sqrt((F * (C + math.hypot(B_m, C)))) * (0.0 - (math.sqrt(2.0) / B_m)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)) tmp = 0.0 if (B_m <= 3.5e-21) tmp = Float64(Float64(sqrt(Float64(F * Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)))) * sqrt(Float64(2.0 * Float64(Float64(2.0 * C) + Float64(Float64(Float64(B_m * B_m) * -0.5) / A))))) / t_0); elseif (B_m <= 1.1e+28) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) * Float64(F * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))))) / t_0); else tmp = Float64(sqrt(Float64(F * Float64(C + hypot(B_m, C)))) * Float64(0.0 - Float64(sqrt(2.0) / B_m))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = ((4.0 * A) * C) - (B_m * B_m);
tmp = 0.0;
if (B_m <= 3.5e-21)
tmp = (sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_0;
elseif (B_m <= 1.1e+28)
tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + hypot(B_m, (A - C))))))) / t_0;
else
tmp = sqrt((F * (C + hypot(B_m, C)))) * (0.0 - (sqrt(2.0) / B_m));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 3.5e-21], N[(N[(N[Sqrt[N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(N[(2.0 * C), $MachinePrecision] + N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 1.1e+28], N[(N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
\mathbf{if}\;B\_m \leq 3.5 \cdot 10^{-21}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)} \cdot \sqrt{2 \cdot \left(2 \cdot C + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{A}\right)}}{t\_0}\\
\mathbf{elif}\;B\_m \leq 1.1 \cdot 10^{+28}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)} \cdot \left(0 - \frac{\sqrt{2}}{B\_m}\right)\\
\end{array}
\end{array}
if B < 3.5000000000000003e-21Initial program 24.9%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified31.1%
Taylor expanded in A around -inf
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6418.8%
Simplified18.8%
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
sqrt-prodN/A
*-lowering-*.f64N/A
Applied egg-rr19.9%
if 3.5000000000000003e-21 < B < 1.09999999999999993e28Initial program 53.4%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified56.1%
if 1.09999999999999993e28 < B Initial program 13.6%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified19.9%
Applied egg-rr24.2%
Taylor expanded in A around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f6441.6%
Simplified41.6%
Final simplification26.8%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))))
(if (<= B_m 2.4e-22)
(/
(*
(sqrt (* F (+ (* B_m B_m) (* (* A C) -4.0))))
(sqrt (* 2.0 (+ (* 2.0 C) (/ (* (* B_m B_m) -0.5) A)))))
t_0)
(if (<= B_m 1.5e+127)
(/
(sqrt
(*
2.0
(*
(+ (* B_m B_m) (* A (* C -4.0)))
(* F (+ (+ A C) (hypot B_m (- A C)))))))
t_0)
(* (sqrt (/ F B_m)) (- 0.0 (sqrt 2.0)))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = ((4.0 * A) * C) - (B_m * B_m);
double tmp;
if (B_m <= 2.4e-22) {
tmp = (sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_0;
} else if (B_m <= 1.5e+127) {
tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + hypot(B_m, (A - C))))))) / t_0;
} else {
tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = ((4.0 * A) * C) - (B_m * B_m);
double tmp;
if (B_m <= 2.4e-22) {
tmp = (Math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * Math.sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_0;
} else if (B_m <= 1.5e+127) {
tmp = Math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + Math.hypot(B_m, (A - C))))))) / t_0;
} else {
tmp = Math.sqrt((F / B_m)) * (0.0 - Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = ((4.0 * A) * C) - (B_m * B_m) tmp = 0 if B_m <= 2.4e-22: tmp = (math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * math.sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_0 elif B_m <= 1.5e+127: tmp = math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + math.hypot(B_m, (A - C))))))) / t_0 else: tmp = math.sqrt((F / B_m)) * (0.0 - math.sqrt(2.0)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)) tmp = 0.0 if (B_m <= 2.4e-22) tmp = Float64(Float64(sqrt(Float64(F * Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)))) * sqrt(Float64(2.0 * Float64(Float64(2.0 * C) + Float64(Float64(Float64(B_m * B_m) * -0.5) / A))))) / t_0); elseif (B_m <= 1.5e+127) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) * Float64(F * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))))) / t_0); else tmp = Float64(sqrt(Float64(F / B_m)) * Float64(0.0 - sqrt(2.0))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = ((4.0 * A) * C) - (B_m * B_m);
tmp = 0.0;
if (B_m <= 2.4e-22)
tmp = (sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_0;
elseif (B_m <= 1.5e+127)
tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + hypot(B_m, (A - C))))))) / t_0;
else
tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 2.4e-22], N[(N[(N[Sqrt[N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(N[(2.0 * C), $MachinePrecision] + N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 1.5e+127], N[(N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
\mathbf{if}\;B\_m \leq 2.4 \cdot 10^{-22}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)} \cdot \sqrt{2 \cdot \left(2 \cdot C + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{A}\right)}}{t\_0}\\
\mathbf{elif}\;B\_m \leq 1.5 \cdot 10^{+127}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(0 - \sqrt{2}\right)\\
\end{array}
\end{array}
if B < 2.40000000000000002e-22Initial program 24.9%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified31.1%
Taylor expanded in A around -inf
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6418.8%
Simplified18.8%
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
sqrt-prodN/A
*-lowering-*.f64N/A
Applied egg-rr19.9%
if 2.40000000000000002e-22 < B < 1.5000000000000001e127Initial program 41.5%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified47.7%
if 1.5000000000000001e127 < B Initial program 0.7%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified4.5%
Applied egg-rr8.2%
Taylor expanded in B around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6448.4%
Simplified48.4%
Final simplification27.3%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(if (<= B_m 2e-22)
(*
(sqrt (* F (+ (* B_m B_m) (* (* A C) -4.0))))
(/ (sqrt (- (* 4.0 C) (/ (* B_m B_m) A))) (- (* 4.0 (* A C)) (* B_m B_m))))
(if (<= B_m 1.78e+127)
(/
(sqrt
(*
2.0
(*
(+ (* B_m B_m) (* A (* C -4.0)))
(* F (+ (+ A C) (hypot B_m (- A C)))))))
(- (* (* 4.0 A) C) (* B_m B_m)))
(* (sqrt (/ F B_m)) (- 0.0 (sqrt 2.0))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 2e-22) {
tmp = sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * (sqrt(((4.0 * C) - ((B_m * B_m) / A))) / ((4.0 * (A * C)) - (B_m * B_m)));
} else if (B_m <= 1.78e+127) {
tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + hypot(B_m, (A - C))))))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 2e-22) {
tmp = Math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * (Math.sqrt(((4.0 * C) - ((B_m * B_m) / A))) / ((4.0 * (A * C)) - (B_m * B_m)));
} else if (B_m <= 1.78e+127) {
tmp = Math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + Math.hypot(B_m, (A - C))))))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = Math.sqrt((F / B_m)) * (0.0 - Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if B_m <= 2e-22: tmp = math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * (math.sqrt(((4.0 * C) - ((B_m * B_m) / A))) / ((4.0 * (A * C)) - (B_m * B_m))) elif B_m <= 1.78e+127: tmp = math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + math.hypot(B_m, (A - C))))))) / (((4.0 * A) * C) - (B_m * B_m)) else: tmp = math.sqrt((F / B_m)) * (0.0 - math.sqrt(2.0)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 2e-22) tmp = Float64(sqrt(Float64(F * Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)))) * Float64(sqrt(Float64(Float64(4.0 * C) - Float64(Float64(B_m * B_m) / A))) / Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m)))); elseif (B_m <= 1.78e+127) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) * Float64(F * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))); else tmp = Float64(sqrt(Float64(F / B_m)) * Float64(0.0 - sqrt(2.0))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (B_m <= 2e-22)
tmp = sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * (sqrt(((4.0 * C) - ((B_m * B_m) / A))) / ((4.0 * (A * C)) - (B_m * B_m)));
elseif (B_m <= 1.78e+127)
tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + hypot(B_m, (A - C))))))) / (((4.0 * A) * C) - (B_m * B_m));
else
tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 2e-22], N[(N[Sqrt[N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(N[(4.0 * C), $MachinePrecision] - N[(N[(B$95$m * B$95$m), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 1.78e+127], N[(N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 2 \cdot 10^{-22}:\\
\;\;\;\;\sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)} \cdot \frac{\sqrt{4 \cdot C - \frac{B\_m \cdot B\_m}{A}}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m}\\
\mathbf{elif}\;B\_m \leq 1.78 \cdot 10^{+127}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(0 - \sqrt{2}\right)\\
\end{array}
\end{array}
if B < 2.0000000000000001e-22Initial program 24.9%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified31.1%
Applied egg-rr39.4%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr39.0%
Taylor expanded in A around -inf
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f6419.9%
Simplified19.9%
if 2.0000000000000001e-22 < B < 1.78e127Initial program 41.5%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified47.7%
if 1.78e127 < B Initial program 0.7%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified4.5%
Applied egg-rr8.2%
Taylor expanded in B around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6448.4%
Simplified48.4%
Final simplification27.3%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(if (<= B_m 2.6e-21)
(/
(sqrt (* F (+ (* B_m B_m) (* (* A C) -4.0))))
(/ (- (* 4.0 (* A C)) (* B_m B_m)) (sqrt (- (* 4.0 C) (/ (* B_m B_m) A)))))
(if (<= B_m 1.6e+127)
(/
(sqrt
(*
2.0
(*
(+ (* B_m B_m) (* A (* C -4.0)))
(* F (+ (+ A C) (hypot B_m (- A C)))))))
(- (* (* 4.0 A) C) (* B_m B_m)))
(* (sqrt (/ F B_m)) (- 0.0 (sqrt 2.0))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 2.6e-21) {
tmp = sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) / (((4.0 * (A * C)) - (B_m * B_m)) / sqrt(((4.0 * C) - ((B_m * B_m) / A))));
} else if (B_m <= 1.6e+127) {
tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + hypot(B_m, (A - C))))))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 2.6e-21) {
tmp = Math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) / (((4.0 * (A * C)) - (B_m * B_m)) / Math.sqrt(((4.0 * C) - ((B_m * B_m) / A))));
} else if (B_m <= 1.6e+127) {
tmp = Math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + Math.hypot(B_m, (A - C))))))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = Math.sqrt((F / B_m)) * (0.0 - Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if B_m <= 2.6e-21: tmp = math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) / (((4.0 * (A * C)) - (B_m * B_m)) / math.sqrt(((4.0 * C) - ((B_m * B_m) / A)))) elif B_m <= 1.6e+127: tmp = math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + math.hypot(B_m, (A - C))))))) / (((4.0 * A) * C) - (B_m * B_m)) else: tmp = math.sqrt((F / B_m)) * (0.0 - math.sqrt(2.0)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 2.6e-21) tmp = Float64(sqrt(Float64(F * Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)))) / Float64(Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m)) / sqrt(Float64(Float64(4.0 * C) - Float64(Float64(B_m * B_m) / A))))); elseif (B_m <= 1.6e+127) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) * Float64(F * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))); else tmp = Float64(sqrt(Float64(F / B_m)) * Float64(0.0 - sqrt(2.0))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (B_m <= 2.6e-21)
tmp = sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) / (((4.0 * (A * C)) - (B_m * B_m)) / sqrt(((4.0 * C) - ((B_m * B_m) / A))));
elseif (B_m <= 1.6e+127)
tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + hypot(B_m, (A - C))))))) / (((4.0 * A) * C) - (B_m * B_m));
else
tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 2.6e-21], N[(N[Sqrt[N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[(4.0 * C), $MachinePrecision] - N[(N[(B$95$m * B$95$m), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 1.6e+127], N[(N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 2.6 \cdot 10^{-21}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)}}{\frac{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m}{\sqrt{4 \cdot C - \frac{B\_m \cdot B\_m}{A}}}}\\
\mathbf{elif}\;B\_m \leq 1.6 \cdot 10^{+127}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(0 - \sqrt{2}\right)\\
\end{array}
\end{array}
if B < 2.60000000000000017e-21Initial program 24.9%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified31.1%
Applied egg-rr39.4%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr39.0%
Taylor expanded in A around -inf
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f6419.9%
Simplified19.9%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
Applied egg-rr19.8%
if 2.60000000000000017e-21 < B < 1.59999999999999988e127Initial program 41.5%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified47.7%
if 1.59999999999999988e127 < B Initial program 0.7%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified4.5%
Applied egg-rr8.2%
Taylor expanded in B around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6448.4%
Simplified48.4%
Final simplification27.3%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))))
(if (<= B_m 1.06e-48)
(/
(*
(sqrt (* F (+ (* B_m B_m) (* (* A C) -4.0))))
(sqrt (* 2.0 (* 2.0 C))))
t_0)
(if (<= B_m 1.5e+127)
(/
(sqrt
(*
2.0
(*
(+ (* B_m B_m) (* A (* C -4.0)))
(* F (+ (+ A C) (hypot B_m (- A C)))))))
t_0)
(* (sqrt (/ F B_m)) (- 0.0 (sqrt 2.0)))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = ((4.0 * A) * C) - (B_m * B_m);
double tmp;
if (B_m <= 1.06e-48) {
tmp = (sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * sqrt((2.0 * (2.0 * C)))) / t_0;
} else if (B_m <= 1.5e+127) {
tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + hypot(B_m, (A - C))))))) / t_0;
} else {
tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = ((4.0 * A) * C) - (B_m * B_m);
double tmp;
if (B_m <= 1.06e-48) {
tmp = (Math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * Math.sqrt((2.0 * (2.0 * C)))) / t_0;
} else if (B_m <= 1.5e+127) {
tmp = Math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + Math.hypot(B_m, (A - C))))))) / t_0;
} else {
tmp = Math.sqrt((F / B_m)) * (0.0 - Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = ((4.0 * A) * C) - (B_m * B_m) tmp = 0 if B_m <= 1.06e-48: tmp = (math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * math.sqrt((2.0 * (2.0 * C)))) / t_0 elif B_m <= 1.5e+127: tmp = math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + math.hypot(B_m, (A - C))))))) / t_0 else: tmp = math.sqrt((F / B_m)) * (0.0 - math.sqrt(2.0)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)) tmp = 0.0 if (B_m <= 1.06e-48) tmp = Float64(Float64(sqrt(Float64(F * Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)))) * sqrt(Float64(2.0 * Float64(2.0 * C)))) / t_0); elseif (B_m <= 1.5e+127) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) * Float64(F * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))))) / t_0); else tmp = Float64(sqrt(Float64(F / B_m)) * Float64(0.0 - sqrt(2.0))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = ((4.0 * A) * C) - (B_m * B_m);
tmp = 0.0;
if (B_m <= 1.06e-48)
tmp = (sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * sqrt((2.0 * (2.0 * C)))) / t_0;
elseif (B_m <= 1.5e+127)
tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + hypot(B_m, (A - C))))))) / t_0;
else
tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.06e-48], N[(N[(N[Sqrt[N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 1.5e+127], N[(N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
\mathbf{if}\;B\_m \leq 1.06 \cdot 10^{-48}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)} \cdot \sqrt{2 \cdot \left(2 \cdot C\right)}}{t\_0}\\
\mathbf{elif}\;B\_m \leq 1.5 \cdot 10^{+127}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(0 - \sqrt{2}\right)\\
\end{array}
\end{array}
if B < 1.0600000000000001e-48Initial program 24.3%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified30.7%
Applied egg-rr39.4%
Taylor expanded in A around -inf
*-lowering-*.f6418.6%
Simplified18.6%
if 1.0600000000000001e-48 < B < 1.5000000000000001e127Initial program 41.2%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified46.4%
if 1.5000000000000001e127 < B Initial program 0.7%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified4.5%
Applied egg-rr8.2%
Taylor expanded in B around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6448.4%
Simplified48.4%
Final simplification27.0%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(if (<= B_m 2.95)
(/
(* (sqrt (* F (+ (* B_m B_m) (* (* A C) -4.0)))) (sqrt (* 2.0 (* 2.0 C))))
(- (* (* 4.0 A) C) (* B_m B_m)))
(* (sqrt (/ F B_m)) (- 0.0 (sqrt 2.0)))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 2.95) {
tmp = (sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * sqrt((2.0 * (2.0 * C)))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (b_m <= 2.95d0) then
tmp = (sqrt((f * ((b_m * b_m) + ((a * c) * (-4.0d0))))) * sqrt((2.0d0 * (2.0d0 * c)))) / (((4.0d0 * a) * c) - (b_m * b_m))
else
tmp = sqrt((f / b_m)) * (0.0d0 - sqrt(2.0d0))
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 2.95) {
tmp = (Math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * Math.sqrt((2.0 * (2.0 * C)))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = Math.sqrt((F / B_m)) * (0.0 - Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if B_m <= 2.95: tmp = (math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * math.sqrt((2.0 * (2.0 * C)))) / (((4.0 * A) * C) - (B_m * B_m)) else: tmp = math.sqrt((F / B_m)) * (0.0 - math.sqrt(2.0)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 2.95) tmp = Float64(Float64(sqrt(Float64(F * Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)))) * sqrt(Float64(2.0 * Float64(2.0 * C)))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))); else tmp = Float64(sqrt(Float64(F / B_m)) * Float64(0.0 - sqrt(2.0))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (B_m <= 2.95)
tmp = (sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * sqrt((2.0 * (2.0 * C)))) / (((4.0 * A) * C) - (B_m * B_m));
else
tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 2.95], N[(N[(N[Sqrt[N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 2.95:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)} \cdot \sqrt{2 \cdot \left(2 \cdot C\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(0 - \sqrt{2}\right)\\
\end{array}
\end{array}
if B < 2.9500000000000002Initial program 26.4%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified32.3%
Applied egg-rr40.7%
Taylor expanded in A around -inf
*-lowering-*.f6418.0%
Simplified18.0%
if 2.9500000000000002 < B Initial program 19.8%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified25.5%
Applied egg-rr29.4%
Taylor expanded in B around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6444.1%
Simplified44.1%
Final simplification23.4%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(if (<= B_m 3.8)
(*
(/ (sqrt (* 4.0 C)) (- (* 4.0 (* A C)) (* B_m B_m)))
(sqrt (* F (+ (* B_m B_m) (* (* A C) -4.0)))))
(* (sqrt (/ F B_m)) (- 0.0 (sqrt 2.0)))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 3.8) {
tmp = (sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m))) * sqrt((F * ((B_m * B_m) + ((A * C) * -4.0))));
} else {
tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (b_m <= 3.8d0) then
tmp = (sqrt((4.0d0 * c)) / ((4.0d0 * (a * c)) - (b_m * b_m))) * sqrt((f * ((b_m * b_m) + ((a * c) * (-4.0d0)))))
else
tmp = sqrt((f / b_m)) * (0.0d0 - sqrt(2.0d0))
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 3.8) {
tmp = (Math.sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m))) * Math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0))));
} else {
tmp = Math.sqrt((F / B_m)) * (0.0 - Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if B_m <= 3.8: tmp = (math.sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m))) * math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) else: tmp = math.sqrt((F / B_m)) * (0.0 - math.sqrt(2.0)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 3.8) tmp = Float64(Float64(sqrt(Float64(4.0 * C)) / Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m))) * sqrt(Float64(F * Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0))))); else tmp = Float64(sqrt(Float64(F / B_m)) * Float64(0.0 - sqrt(2.0))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (B_m <= 3.8)
tmp = (sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m))) * sqrt((F * ((B_m * B_m) + ((A * C) * -4.0))));
else
tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 3.8], N[(N[(N[Sqrt[N[(4.0 * C), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 3.8:\\
\;\;\;\;\frac{\sqrt{4 \cdot C}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m} \cdot \sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(0 - \sqrt{2}\right)\\
\end{array}
\end{array}
if B < 3.7999999999999998Initial program 26.4%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified32.3%
Applied egg-rr40.7%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr40.4%
Taylor expanded in A around -inf
*-lowering-*.f6418.1%
Simplified18.1%
if 3.7999999999999998 < B Initial program 19.8%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified25.5%
Applied egg-rr29.4%
Taylor expanded in B around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6444.1%
Simplified44.1%
Final simplification23.5%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(if (<= B_m 1.46)
(/
(sqrt (* 2.0 (* (+ (* B_m B_m) (* A (* C -4.0))) (* F (* 2.0 C)))))
(- (* (* 4.0 A) C) (* B_m B_m)))
(* (sqrt (/ F B_m)) (- 0.0 (sqrt 2.0)))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 1.46) {
tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * (2.0 * C))))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (b_m <= 1.46d0) then
tmp = sqrt((2.0d0 * (((b_m * b_m) + (a * (c * (-4.0d0)))) * (f * (2.0d0 * c))))) / (((4.0d0 * a) * c) - (b_m * b_m))
else
tmp = sqrt((f / b_m)) * (0.0d0 - sqrt(2.0d0))
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 1.46) {
tmp = Math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * (2.0 * C))))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = Math.sqrt((F / B_m)) * (0.0 - Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if B_m <= 1.46: tmp = math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * (2.0 * C))))) / (((4.0 * A) * C) - (B_m * B_m)) else: tmp = math.sqrt((F / B_m)) * (0.0 - math.sqrt(2.0)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 1.46) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) * Float64(F * Float64(2.0 * C))))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))); else tmp = Float64(sqrt(Float64(F / B_m)) * Float64(0.0 - sqrt(2.0))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (B_m <= 1.46)
tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * (2.0 * C))))) / (((4.0 * A) * C) - (B_m * B_m));
else
tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 1.46], N[(N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 1.46:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(0 - \sqrt{2}\right)\\
\end{array}
\end{array}
if B < 1.46Initial program 26.4%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified32.3%
Taylor expanded in C around inf
distribute-lft1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
*-lowering-*.f6417.8%
Simplified17.8%
if 1.46 < B Initial program 19.8%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified25.5%
Applied egg-rr29.4%
Taylor expanded in B around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6444.1%
Simplified44.1%
Final simplification23.3%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m)))
(t_1 (+ (* B_m B_m) (* A (* C -4.0)))))
(if (<= C 1e-122)
(/
(sqrt (* 2.0 (* t_1 (* F (+ (* 2.0 C) (/ (* (* B_m B_m) -0.5) A))))))
t_0)
(/ (sqrt (* 2.0 (* t_1 (* F (* 2.0 C))))) t_0))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = ((4.0 * A) * C) - (B_m * B_m);
double t_1 = (B_m * B_m) + (A * (C * -4.0));
double tmp;
if (C <= 1e-122) {
tmp = sqrt((2.0 * (t_1 * (F * ((2.0 * C) + (((B_m * B_m) * -0.5) / A)))))) / t_0;
} else {
tmp = sqrt((2.0 * (t_1 * (F * (2.0 * C))))) / t_0;
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((4.0d0 * a) * c) - (b_m * b_m)
t_1 = (b_m * b_m) + (a * (c * (-4.0d0)))
if (c <= 1d-122) then
tmp = sqrt((2.0d0 * (t_1 * (f * ((2.0d0 * c) + (((b_m * b_m) * (-0.5d0)) / a)))))) / t_0
else
tmp = sqrt((2.0d0 * (t_1 * (f * (2.0d0 * c))))) / t_0
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = ((4.0 * A) * C) - (B_m * B_m);
double t_1 = (B_m * B_m) + (A * (C * -4.0));
double tmp;
if (C <= 1e-122) {
tmp = Math.sqrt((2.0 * (t_1 * (F * ((2.0 * C) + (((B_m * B_m) * -0.5) / A)))))) / t_0;
} else {
tmp = Math.sqrt((2.0 * (t_1 * (F * (2.0 * C))))) / t_0;
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = ((4.0 * A) * C) - (B_m * B_m) t_1 = (B_m * B_m) + (A * (C * -4.0)) tmp = 0 if C <= 1e-122: tmp = math.sqrt((2.0 * (t_1 * (F * ((2.0 * C) + (((B_m * B_m) * -0.5) / A)))))) / t_0 else: tmp = math.sqrt((2.0 * (t_1 * (F * (2.0 * C))))) / t_0 return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)) t_1 = Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) tmp = 0.0 if (C <= 1e-122) tmp = Float64(sqrt(Float64(2.0 * Float64(t_1 * Float64(F * Float64(Float64(2.0 * C) + Float64(Float64(Float64(B_m * B_m) * -0.5) / A)))))) / t_0); else tmp = Float64(sqrt(Float64(2.0 * Float64(t_1 * Float64(F * Float64(2.0 * C))))) / t_0); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = ((4.0 * A) * C) - (B_m * B_m);
t_1 = (B_m * B_m) + (A * (C * -4.0));
tmp = 0.0;
if (C <= 1e-122)
tmp = sqrt((2.0 * (t_1 * (F * ((2.0 * C) + (((B_m * B_m) * -0.5) / A)))))) / t_0;
else
tmp = sqrt((2.0 * (t_1 * (F * (2.0 * C))))) / t_0;
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, 1e-122], N[(N[Sqrt[N[(2.0 * N[(t$95$1 * N[(F * N[(N[(2.0 * C), $MachinePrecision] + N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(t$95$1 * N[(F * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
t_1 := B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\\
\mathbf{if}\;C \leq 10^{-122}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(t\_1 \cdot \left(F \cdot \left(2 \cdot C + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{A}\right)\right)\right)}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(t\_1 \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right)}}{t\_0}\\
\end{array}
\end{array}
if C < 1.00000000000000006e-122Initial program 24.3%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified29.8%
Taylor expanded in A around -inf
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6410.7%
Simplified10.7%
if 1.00000000000000006e-122 < C Initial program 26.2%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified32.8%
Taylor expanded in C around inf
distribute-lft1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
*-lowering-*.f6426.7%
Simplified26.7%
Final simplification16.8%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(if (<= C 7e-134)
(/
(sqrt
(*
(* F (+ (* B_m B_m) (* (* A C) -4.0)))
(- (* 4.0 C) (/ (* B_m B_m) A))))
(- (* 4.0 (* A C)) (* B_m B_m)))
(/
(sqrt (* 2.0 (* (+ (* B_m B_m) (* A (* C -4.0))) (* F (* 2.0 C)))))
(- (* (* 4.0 A) C) (* B_m B_m)))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (C <= 7e-134) {
tmp = sqrt(((F * ((B_m * B_m) + ((A * C) * -4.0))) * ((4.0 * C) - ((B_m * B_m) / A)))) / ((4.0 * (A * C)) - (B_m * B_m));
} else {
tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * (2.0 * C))))) / (((4.0 * A) * C) - (B_m * B_m));
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (c <= 7d-134) then
tmp = sqrt(((f * ((b_m * b_m) + ((a * c) * (-4.0d0)))) * ((4.0d0 * c) - ((b_m * b_m) / a)))) / ((4.0d0 * (a * c)) - (b_m * b_m))
else
tmp = sqrt((2.0d0 * (((b_m * b_m) + (a * (c * (-4.0d0)))) * (f * (2.0d0 * c))))) / (((4.0d0 * a) * c) - (b_m * b_m))
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (C <= 7e-134) {
tmp = Math.sqrt(((F * ((B_m * B_m) + ((A * C) * -4.0))) * ((4.0 * C) - ((B_m * B_m) / A)))) / ((4.0 * (A * C)) - (B_m * B_m));
} else {
tmp = Math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * (2.0 * C))))) / (((4.0 * A) * C) - (B_m * B_m));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if C <= 7e-134: tmp = math.sqrt(((F * ((B_m * B_m) + ((A * C) * -4.0))) * ((4.0 * C) - ((B_m * B_m) / A)))) / ((4.0 * (A * C)) - (B_m * B_m)) else: tmp = math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * (2.0 * C))))) / (((4.0 * A) * C) - (B_m * B_m)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (C <= 7e-134) tmp = Float64(sqrt(Float64(Float64(F * Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0))) * Float64(Float64(4.0 * C) - Float64(Float64(B_m * B_m) / A)))) / Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m))); else tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) * Float64(F * Float64(2.0 * C))))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (C <= 7e-134)
tmp = sqrt(((F * ((B_m * B_m) + ((A * C) * -4.0))) * ((4.0 * C) - ((B_m * B_m) / A)))) / ((4.0 * (A * C)) - (B_m * B_m));
else
tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * (2.0 * C))))) / (((4.0 * A) * C) - (B_m * B_m));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[C, 7e-134], N[(N[Sqrt[N[(N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(4.0 * C), $MachinePrecision] - N[(N[(B$95$m * B$95$m), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq 7 \cdot 10^{-134}:\\
\;\;\;\;\frac{\sqrt{\left(F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)\right) \cdot \left(4 \cdot C - \frac{B\_m \cdot B\_m}{A}\right)}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\
\end{array}
\end{array}
if C < 6.9999999999999997e-134Initial program 24.3%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified29.8%
Applied egg-rr36.2%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr35.7%
Taylor expanded in A around -inf
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f648.9%
Simplified8.9%
associate-*l/N/A
*-commutativeN/A
associate-*l*N/A
/-lowering-/.f64N/A
Applied egg-rr10.0%
if 6.9999999999999997e-134 < C Initial program 26.2%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified32.8%
Taylor expanded in C around inf
distribute-lft1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
*-lowering-*.f6426.7%
Simplified26.7%
Final simplification16.4%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* (* 4.0 A) C)))
(if (<= B_m 3.1)
(/
(sqrt (* 2.0 (* (+ (* B_m B_m) (* A (* C -4.0))) (* F (* 2.0 C)))))
(- t_0 (* B_m B_m)))
(*
(/ -1.0 (- (* B_m B_m) t_0))
(sqrt (* 2.0 (* (+ (* B_m B_m) (* (* A C) -4.0)) (* B_m F))))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double tmp;
if (B_m <= 3.1) {
tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * (2.0 * C))))) / (t_0 - (B_m * B_m));
} else {
tmp = (-1.0 / ((B_m * B_m) - t_0)) * sqrt((2.0 * (((B_m * B_m) + ((A * C) * -4.0)) * (B_m * F))));
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (4.0d0 * a) * c
if (b_m <= 3.1d0) then
tmp = sqrt((2.0d0 * (((b_m * b_m) + (a * (c * (-4.0d0)))) * (f * (2.0d0 * c))))) / (t_0 - (b_m * b_m))
else
tmp = ((-1.0d0) / ((b_m * b_m) - t_0)) * sqrt((2.0d0 * (((b_m * b_m) + ((a * c) * (-4.0d0))) * (b_m * f))))
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double tmp;
if (B_m <= 3.1) {
tmp = Math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * (2.0 * C))))) / (t_0 - (B_m * B_m));
} else {
tmp = (-1.0 / ((B_m * B_m) - t_0)) * Math.sqrt((2.0 * (((B_m * B_m) + ((A * C) * -4.0)) * (B_m * F))));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (4.0 * A) * C tmp = 0 if B_m <= 3.1: tmp = math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * (2.0 * C))))) / (t_0 - (B_m * B_m)) else: tmp = (-1.0 / ((B_m * B_m) - t_0)) * math.sqrt((2.0 * (((B_m * B_m) + ((A * C) * -4.0)) * (B_m * F)))) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) tmp = 0.0 if (B_m <= 3.1) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) * Float64(F * Float64(2.0 * C))))) / Float64(t_0 - Float64(B_m * B_m))); else tmp = Float64(Float64(-1.0 / Float64(Float64(B_m * B_m) - t_0)) * sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)) * Float64(B_m * F))))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (4.0 * A) * C;
tmp = 0.0;
if (B_m <= 3.1)
tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * (2.0 * C))))) / (t_0 - (B_m * B_m));
else
tmp = (-1.0 / ((B_m * B_m) - t_0)) * sqrt((2.0 * (((B_m * B_m) + ((A * C) * -4.0)) * (B_m * F))));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[B$95$m, 3.1], N[(N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[(N[(B$95$m * B$95$m), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;B\_m \leq 3.1:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right)}}{t\_0 - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B\_m \cdot B\_m - t\_0} \cdot \sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right) \cdot \left(B\_m \cdot F\right)\right)}\\
\end{array}
\end{array}
if B < 3.10000000000000009Initial program 26.4%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified32.3%
Taylor expanded in C around inf
distribute-lft1-inN/A
metadata-evalN/A
mul0-lftN/A
metadata-evalN/A
*-lowering-*.f6417.8%
Simplified17.8%
if 3.10000000000000009 < B Initial program 19.8%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified25.5%
Applied egg-rr25.8%
Taylor expanded in B around inf
Simplified15.9%
Final simplification17.4%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* (* 4.0 A) C)))
(if (<= B_m 9.5e-6)
(/ (sqrt (* -16.0 (* (* A C) (* C F)))) (- t_0 (* B_m B_m)))
(*
(/ -1.0 (- (* B_m B_m) t_0))
(sqrt (* 2.0 (* (+ (* B_m B_m) (* (* A C) -4.0)) (* B_m F))))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double tmp;
if (B_m <= 9.5e-6) {
tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / (t_0 - (B_m * B_m));
} else {
tmp = (-1.0 / ((B_m * B_m) - t_0)) * sqrt((2.0 * (((B_m * B_m) + ((A * C) * -4.0)) * (B_m * F))));
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (4.0d0 * a) * c
if (b_m <= 9.5d-6) then
tmp = sqrt(((-16.0d0) * ((a * c) * (c * f)))) / (t_0 - (b_m * b_m))
else
tmp = ((-1.0d0) / ((b_m * b_m) - t_0)) * sqrt((2.0d0 * (((b_m * b_m) + ((a * c) * (-4.0d0))) * (b_m * f))))
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double tmp;
if (B_m <= 9.5e-6) {
tmp = Math.sqrt((-16.0 * ((A * C) * (C * F)))) / (t_0 - (B_m * B_m));
} else {
tmp = (-1.0 / ((B_m * B_m) - t_0)) * Math.sqrt((2.0 * (((B_m * B_m) + ((A * C) * -4.0)) * (B_m * F))));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (4.0 * A) * C tmp = 0 if B_m <= 9.5e-6: tmp = math.sqrt((-16.0 * ((A * C) * (C * F)))) / (t_0 - (B_m * B_m)) else: tmp = (-1.0 / ((B_m * B_m) - t_0)) * math.sqrt((2.0 * (((B_m * B_m) + ((A * C) * -4.0)) * (B_m * F)))) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) tmp = 0.0 if (B_m <= 9.5e-6) tmp = Float64(sqrt(Float64(-16.0 * Float64(Float64(A * C) * Float64(C * F)))) / Float64(t_0 - Float64(B_m * B_m))); else tmp = Float64(Float64(-1.0 / Float64(Float64(B_m * B_m) - t_0)) * sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)) * Float64(B_m * F))))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (4.0 * A) * C;
tmp = 0.0;
if (B_m <= 9.5e-6)
tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / (t_0 - (B_m * B_m));
else
tmp = (-1.0 / ((B_m * B_m) - t_0)) * sqrt((2.0 * (((B_m * B_m) + ((A * C) * -4.0)) * (B_m * F))));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[B$95$m, 9.5e-6], N[(N[Sqrt[N[(-16.0 * N[(N[(A * C), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[(N[(B$95$m * B$95$m), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;B\_m \leq 9.5 \cdot 10^{-6}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(A \cdot C\right) \cdot \left(C \cdot F\right)\right)}}{t\_0 - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B\_m \cdot B\_m - t\_0} \cdot \sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right) \cdot \left(B\_m \cdot F\right)\right)}\\
\end{array}
\end{array}
if B < 9.5000000000000005e-6Initial program 25.4%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified31.5%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.1%
Simplified12.1%
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6415.9%
Applied egg-rr15.9%
if 9.5000000000000005e-6 < B Initial program 23.6%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified29.0%
Applied egg-rr29.2%
Taylor expanded in B around inf
Simplified16.9%
Final simplification16.1%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))))
(if (<= B_m 6.2e-6)
(/ (sqrt (* -16.0 (* (* A C) (* C F)))) t_0)
(/ (sqrt (* 2.0 (* (+ (* B_m B_m) (* A (* C -4.0))) (* B_m F)))) t_0))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = ((4.0 * A) * C) - (B_m * B_m);
double tmp;
if (B_m <= 6.2e-6) {
tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / t_0;
} else {
tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (B_m * F)))) / t_0;
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = ((4.0d0 * a) * c) - (b_m * b_m)
if (b_m <= 6.2d-6) then
tmp = sqrt(((-16.0d0) * ((a * c) * (c * f)))) / t_0
else
tmp = sqrt((2.0d0 * (((b_m * b_m) + (a * (c * (-4.0d0)))) * (b_m * f)))) / t_0
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = ((4.0 * A) * C) - (B_m * B_m);
double tmp;
if (B_m <= 6.2e-6) {
tmp = Math.sqrt((-16.0 * ((A * C) * (C * F)))) / t_0;
} else {
tmp = Math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (B_m * F)))) / t_0;
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = ((4.0 * A) * C) - (B_m * B_m) tmp = 0 if B_m <= 6.2e-6: tmp = math.sqrt((-16.0 * ((A * C) * (C * F)))) / t_0 else: tmp = math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (B_m * F)))) / t_0 return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)) tmp = 0.0 if (B_m <= 6.2e-6) tmp = Float64(sqrt(Float64(-16.0 * Float64(Float64(A * C) * Float64(C * F)))) / t_0); else tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) * Float64(B_m * F)))) / t_0); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = ((4.0 * A) * C) - (B_m * B_m);
tmp = 0.0;
if (B_m <= 6.2e-6)
tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / t_0;
else
tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (B_m * F)))) / t_0;
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 6.2e-6], N[(N[Sqrt[N[(-16.0 * N[(N[(A * C), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
\mathbf{if}\;B\_m \leq 6.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(A \cdot C\right) \cdot \left(C \cdot F\right)\right)}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(B\_m \cdot F\right)\right)}}{t\_0}\\
\end{array}
\end{array}
if B < 6.1999999999999999e-6Initial program 25.4%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified31.5%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.1%
Simplified12.1%
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6415.9%
Applied egg-rr15.9%
if 6.1999999999999999e-6 < B Initial program 23.6%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified29.0%
Taylor expanded in B around inf
Simplified16.9%
Final simplification16.1%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(if (<= B_m 4.8e-6)
(/ (sqrt (* -16.0 (* (* A C) (* C F)))) (- (* (* 4.0 A) C) (* B_m B_m)))
(/
-1.0
(/
(- (* B_m B_m) (* A (* 4.0 C)))
(sqrt (* 2.0 (* F (* B_m (* B_m B_m)))))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 4.8e-6) {
tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = -1.0 / (((B_m * B_m) - (A * (4.0 * C))) / sqrt((2.0 * (F * (B_m * (B_m * B_m))))));
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (b_m <= 4.8d-6) then
tmp = sqrt(((-16.0d0) * ((a * c) * (c * f)))) / (((4.0d0 * a) * c) - (b_m * b_m))
else
tmp = (-1.0d0) / (((b_m * b_m) - (a * (4.0d0 * c))) / sqrt((2.0d0 * (f * (b_m * (b_m * b_m))))))
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 4.8e-6) {
tmp = Math.sqrt((-16.0 * ((A * C) * (C * F)))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = -1.0 / (((B_m * B_m) - (A * (4.0 * C))) / Math.sqrt((2.0 * (F * (B_m * (B_m * B_m))))));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if B_m <= 4.8e-6: tmp = math.sqrt((-16.0 * ((A * C) * (C * F)))) / (((4.0 * A) * C) - (B_m * B_m)) else: tmp = -1.0 / (((B_m * B_m) - (A * (4.0 * C))) / math.sqrt((2.0 * (F * (B_m * (B_m * B_m)))))) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 4.8e-6) tmp = Float64(sqrt(Float64(-16.0 * Float64(Float64(A * C) * Float64(C * F)))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))); else tmp = Float64(-1.0 / Float64(Float64(Float64(B_m * B_m) - Float64(A * Float64(4.0 * C))) / sqrt(Float64(2.0 * Float64(F * Float64(B_m * Float64(B_m * B_m))))))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (B_m <= 4.8e-6)
tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / (((4.0 * A) * C) - (B_m * B_m));
else
tmp = -1.0 / (((B_m * B_m) - (A * (4.0 * C))) / sqrt((2.0 * (F * (B_m * (B_m * B_m))))));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 4.8e-6], N[(N[Sqrt[N[(-16.0 * N[(N[(A * C), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] - N[(A * N[(4.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(2.0 * N[(F * N[(B$95$m * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 4.8 \cdot 10^{-6}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(A \cdot C\right) \cdot \left(C \cdot F\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{B\_m \cdot B\_m - A \cdot \left(4 \cdot C\right)}{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}}\\
\end{array}
\end{array}
if B < 4.7999999999999998e-6Initial program 25.4%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified31.5%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.1%
Simplified12.1%
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6415.9%
Applied egg-rr15.9%
if 4.7999999999999998e-6 < B Initial program 23.6%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified29.0%
Applied egg-rr25.6%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6421.3%
Simplified21.3%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate-*l*N/A
*-commutativeN/A
--lowering--.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6414.6%
Applied egg-rr14.6%
Final simplification15.6%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* (* 4.0 A) C)))
(if (<= B_m 1.16e-5)
(/ (sqrt (* -16.0 (* (* A C) (* C F)))) (- t_0 (* B_m B_m)))
(*
(/ -1.0 (- (* B_m B_m) t_0))
(sqrt (* 2.0 (* F (* B_m (* B_m B_m)))))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double tmp;
if (B_m <= 1.16e-5) {
tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / (t_0 - (B_m * B_m));
} else {
tmp = (-1.0 / ((B_m * B_m) - t_0)) * sqrt((2.0 * (F * (B_m * (B_m * B_m)))));
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (4.0d0 * a) * c
if (b_m <= 1.16d-5) then
tmp = sqrt(((-16.0d0) * ((a * c) * (c * f)))) / (t_0 - (b_m * b_m))
else
tmp = ((-1.0d0) / ((b_m * b_m) - t_0)) * sqrt((2.0d0 * (f * (b_m * (b_m * b_m)))))
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double tmp;
if (B_m <= 1.16e-5) {
tmp = Math.sqrt((-16.0 * ((A * C) * (C * F)))) / (t_0 - (B_m * B_m));
} else {
tmp = (-1.0 / ((B_m * B_m) - t_0)) * Math.sqrt((2.0 * (F * (B_m * (B_m * B_m)))));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (4.0 * A) * C tmp = 0 if B_m <= 1.16e-5: tmp = math.sqrt((-16.0 * ((A * C) * (C * F)))) / (t_0 - (B_m * B_m)) else: tmp = (-1.0 / ((B_m * B_m) - t_0)) * math.sqrt((2.0 * (F * (B_m * (B_m * B_m))))) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) tmp = 0.0 if (B_m <= 1.16e-5) tmp = Float64(sqrt(Float64(-16.0 * Float64(Float64(A * C) * Float64(C * F)))) / Float64(t_0 - Float64(B_m * B_m))); else tmp = Float64(Float64(-1.0 / Float64(Float64(B_m * B_m) - t_0)) * sqrt(Float64(2.0 * Float64(F * Float64(B_m * Float64(B_m * B_m)))))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (4.0 * A) * C;
tmp = 0.0;
if (B_m <= 1.16e-5)
tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / (t_0 - (B_m * B_m));
else
tmp = (-1.0 / ((B_m * B_m) - t_0)) * sqrt((2.0 * (F * (B_m * (B_m * B_m)))));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[B$95$m, 1.16e-5], N[(N[Sqrt[N[(-16.0 * N[(N[(A * C), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[(N[(B$95$m * B$95$m), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(F * N[(B$95$m * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;B\_m \leq 1.16 \cdot 10^{-5}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(A \cdot C\right) \cdot \left(C \cdot F\right)\right)}}{t\_0 - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B\_m \cdot B\_m - t\_0} \cdot \sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}\\
\end{array}
\end{array}
if B < 1.1600000000000001e-5Initial program 25.4%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified31.5%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.1%
Simplified12.1%
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6415.9%
Applied egg-rr15.9%
if 1.1600000000000001e-5 < B Initial program 23.6%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified29.0%
Applied egg-rr29.2%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6414.6%
Simplified14.6%
Final simplification15.6%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))))
(if (<= B_m 8e-6)
(/ (sqrt (* -16.0 (* (* A C) (* C F)))) t_0)
(/ (sqrt (* 2.0 (* F (* B_m (* B_m B_m))))) t_0))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = ((4.0 * A) * C) - (B_m * B_m);
double tmp;
if (B_m <= 8e-6) {
tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / t_0;
} else {
tmp = sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_0;
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = ((4.0d0 * a) * c) - (b_m * b_m)
if (b_m <= 8d-6) then
tmp = sqrt(((-16.0d0) * ((a * c) * (c * f)))) / t_0
else
tmp = sqrt((2.0d0 * (f * (b_m * (b_m * b_m))))) / t_0
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = ((4.0 * A) * C) - (B_m * B_m);
double tmp;
if (B_m <= 8e-6) {
tmp = Math.sqrt((-16.0 * ((A * C) * (C * F)))) / t_0;
} else {
tmp = Math.sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_0;
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = ((4.0 * A) * C) - (B_m * B_m) tmp = 0 if B_m <= 8e-6: tmp = math.sqrt((-16.0 * ((A * C) * (C * F)))) / t_0 else: tmp = math.sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_0 return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)) tmp = 0.0 if (B_m <= 8e-6) tmp = Float64(sqrt(Float64(-16.0 * Float64(Float64(A * C) * Float64(C * F)))) / t_0); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(B_m * Float64(B_m * B_m))))) / t_0); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = ((4.0 * A) * C) - (B_m * B_m);
tmp = 0.0;
if (B_m <= 8e-6)
tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / t_0;
else
tmp = sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_0;
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 8e-6], N[(N[Sqrt[N[(-16.0 * N[(N[(A * C), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(B$95$m * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
\mathbf{if}\;B\_m \leq 8 \cdot 10^{-6}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(A \cdot C\right) \cdot \left(C \cdot F\right)\right)}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{t\_0}\\
\end{array}
\end{array}
if B < 7.99999999999999964e-6Initial program 25.4%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified31.5%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.1%
Simplified12.1%
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6415.9%
Applied egg-rr15.9%
if 7.99999999999999964e-6 < B Initial program 23.6%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified29.0%
Taylor expanded in B around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6414.6%
Simplified14.6%
Final simplification15.6%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (/ (sqrt (* -16.0 (* (* A C) (* C F)))) (- (* (* 4.0 A) C) (* B_m B_m))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
return sqrt((-16.0 * ((A * C) * (C * F)))) / (((4.0 * A) * C) - (B_m * B_m));
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
code = sqrt(((-16.0d0) * ((a * c) * (c * f)))) / (((4.0d0 * a) * c) - (b_m * b_m))
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
return Math.sqrt((-16.0 * ((A * C) * (C * F)))) / (((4.0 * A) * C) - (B_m * B_m));
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): return math.sqrt((-16.0 * ((A * C) * (C * F)))) / (((4.0 * A) * C) - (B_m * B_m))
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return Float64(sqrt(Float64(-16.0 * Float64(Float64(A * C) * Float64(C * F)))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))) end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp = code(A, B_m, C, F)
tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / (((4.0 * A) * C) - (B_m * B_m));
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := N[(N[Sqrt[N[(-16.0 * N[(N[(A * C), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\frac{\sqrt{-16 \cdot \left(\left(A \cdot C\right) \cdot \left(C \cdot F\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}
\end{array}
Initial program 25.0%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified30.9%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6410.4%
Simplified10.4%
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6413.3%
Applied egg-rr13.3%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (/ (sqrt (* -16.0 (* A (* F (* C C))))) (- (* (* 4.0 A) C) (* B_m B_m))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
return sqrt((-16.0 * (A * (F * (C * C))))) / (((4.0 * A) * C) - (B_m * B_m));
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
code = sqrt(((-16.0d0) * (a * (f * (c * c))))) / (((4.0d0 * a) * c) - (b_m * b_m))
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
return Math.sqrt((-16.0 * (A * (F * (C * C))))) / (((4.0 * A) * C) - (B_m * B_m));
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): return math.sqrt((-16.0 * (A * (F * (C * C))))) / (((4.0 * A) * C) - (B_m * B_m))
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return Float64(sqrt(Float64(-16.0 * Float64(A * Float64(F * Float64(C * C))))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))) end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp = code(A, B_m, C, F)
tmp = sqrt((-16.0 * (A * (F * (C * C))))) / (((4.0 * A) * C) - (B_m * B_m));
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := N[(N[Sqrt[N[(-16.0 * N[(A * N[(F * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\frac{\sqrt{-16 \cdot \left(A \cdot \left(F \cdot \left(C \cdot C\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}
\end{array}
Initial program 25.0%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified30.9%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6410.4%
Simplified10.4%
Final simplification10.4%
herbie shell --seed 2024192
(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))))