
(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 18 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)
(FPCore (A B_m C F)
:precision binary64
(if (<= (pow B_m 2.0) 5e+99)
(/
(*
(sqrt (+ A (+ C (hypot (- A C) B_m))))
(- (sqrt (* 2.0 (* F (fma B_m B_m (* A (* C -4.0))))))))
(- (pow B_m 2.0) (* C (* A 4.0))))
(* (* (sqrt (+ C (hypot B_m C))) (sqrt F)) (/ (- (sqrt 2.0)) B_m))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (pow(B_m, 2.0) <= 5e+99) {
tmp = (sqrt((A + (C + hypot((A - C), B_m)))) * -sqrt((2.0 * (F * fma(B_m, B_m, (A * (C * -4.0))))))) / (pow(B_m, 2.0) - (C * (A * 4.0)));
} else {
tmp = (sqrt((C + hypot(B_m, C))) * sqrt(F)) * (-sqrt(2.0) / B_m);
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if ((B_m ^ 2.0) <= 5e+99) tmp = Float64(Float64(sqrt(Float64(A + Float64(C + hypot(Float64(A - C), B_m)))) * Float64(-sqrt(Float64(2.0 * Float64(F * fma(B_m, B_m, Float64(A * Float64(C * -4.0)))))))) / Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0)))); else tmp = Float64(Float64(sqrt(Float64(C + hypot(B_m, C))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / B_m)); end return tmp end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+99], N[(N[(N[Sqrt[N[(A + N[(C + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(F * N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;{B_m}^{2} \leq 5 \cdot 10^{+99}:\\
\;\;\;\;\frac{\sqrt{A + \left(C + \mathsf{hypot}\left(A - C, B_m\right)\right)} \cdot \left(-\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\right)}\right)}{{B_m}^{2} - C \cdot \left(A \cdot 4\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(B_m, C\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 5.00000000000000008e99Initial program 25.6%
sqrt-prod27.4%
associate-*r*27.4%
associate-*l*27.4%
associate-+l+28.1%
unpow228.1%
unpow228.1%
hypot-def37.5%
Applied egg-rr37.5%
*-commutative37.5%
associate-*l*37.5%
*-commutative37.5%
unpow237.5%
fma-neg37.5%
distribute-lft-neg-in37.5%
metadata-eval37.5%
*-commutative37.5%
associate-*l*37.5%
Simplified37.5%
if 5.00000000000000008e99 < (pow.f64 B 2) Initial program 6.2%
Taylor expanded in A around 0 9.7%
mul-1-neg9.7%
*-commutative9.7%
distribute-rgt-neg-in9.7%
unpow29.7%
unpow29.7%
hypot-def25.5%
Simplified25.5%
pow1/225.5%
*-commutative25.5%
unpow-prod-down41.4%
pow1/241.4%
pow1/241.4%
Applied egg-rr41.4%
Final simplification38.9%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (pow B_m 2.0) (* C (* A 4.0))))
(t_1 (/ (- (sqrt (* (* 2.0 (* F t_0)) (* 2.0 C)))) t_0)))
(if (<= (pow B_m 2.0) 5e-322)
(sqrt (- (/ F C)))
(if (<= (pow B_m 2.0) 2e-175)
t_1
(if (<= (pow B_m 2.0) 1e-100)
(/ (* (sqrt 2.0) (- (sqrt (* F (+ A (hypot B_m A)))))) B_m)
(if (<= (pow B_m 2.0) 5e-21)
t_1
(* (/ (sqrt 2.0) B_m) (* (sqrt (+ B_m C)) (- (sqrt F))))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = pow(B_m, 2.0) - (C * (A * 4.0));
double t_1 = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
double tmp;
if (pow(B_m, 2.0) <= 5e-322) {
tmp = sqrt(-(F / C));
} else if (pow(B_m, 2.0) <= 2e-175) {
tmp = t_1;
} else if (pow(B_m, 2.0) <= 1e-100) {
tmp = (sqrt(2.0) * -sqrt((F * (A + hypot(B_m, A))))) / B_m;
} else if (pow(B_m, 2.0) <= 5e-21) {
tmp = t_1;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((B_m + C)) * -sqrt(F));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = Math.pow(B_m, 2.0) - (C * (A * 4.0));
double t_1 = -Math.sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
double tmp;
if (Math.pow(B_m, 2.0) <= 5e-322) {
tmp = Math.sqrt(-(F / C));
} else if (Math.pow(B_m, 2.0) <= 2e-175) {
tmp = t_1;
} else if (Math.pow(B_m, 2.0) <= 1e-100) {
tmp = (Math.sqrt(2.0) * -Math.sqrt((F * (A + Math.hypot(B_m, A))))) / B_m;
} else if (Math.pow(B_m, 2.0) <= 5e-21) {
tmp = t_1;
} else {
tmp = (Math.sqrt(2.0) / B_m) * (Math.sqrt((B_m + C)) * -Math.sqrt(F));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = math.pow(B_m, 2.0) - (C * (A * 4.0)) t_1 = -math.sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0 tmp = 0 if math.pow(B_m, 2.0) <= 5e-322: tmp = math.sqrt(-(F / C)) elif math.pow(B_m, 2.0) <= 2e-175: tmp = t_1 elif math.pow(B_m, 2.0) <= 1e-100: tmp = (math.sqrt(2.0) * -math.sqrt((F * (A + math.hypot(B_m, A))))) / B_m elif math.pow(B_m, 2.0) <= 5e-21: tmp = t_1 else: tmp = (math.sqrt(2.0) / B_m) * (math.sqrt((B_m + C)) * -math.sqrt(F)) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0))) t_1 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(2.0 * C)))) / t_0) tmp = 0.0 if ((B_m ^ 2.0) <= 5e-322) tmp = sqrt(Float64(-Float64(F / C))); elseif ((B_m ^ 2.0) <= 2e-175) tmp = t_1; elseif ((B_m ^ 2.0) <= 1e-100) tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(F * Float64(A + hypot(B_m, A)))))) / B_m); elseif ((B_m ^ 2.0) <= 5e-21) tmp = t_1; else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(B_m + C)) * Float64(-sqrt(F)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = (B_m ^ 2.0) - (C * (A * 4.0)); t_1 = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0; tmp = 0.0; if ((B_m ^ 2.0) <= 5e-322) tmp = sqrt(-(F / C)); elseif ((B_m ^ 2.0) <= 2e-175) tmp = t_1; elseif ((B_m ^ 2.0) <= 1e-100) tmp = (sqrt(2.0) * -sqrt((F * (A + hypot(B_m, A))))) / B_m; elseif ((B_m ^ 2.0) <= 5e-21) tmp = t_1; else tmp = (sqrt(2.0) / B_m) * (sqrt((B_m + C)) * -sqrt(F)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-322], N[Sqrt[(-N[(F / C), $MachinePrecision])], $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-175], t$95$1, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-100], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B$95$m), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-21], t$95$1, N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\
t_1 := \frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{if}\;{B_m}^{2} \leq 5 \cdot 10^{-322}:\\
\;\;\;\;\sqrt{-\frac{F}{C}}\\
\mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{-175}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;{B_m}^{2} \leq 10^{-100}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B_m, A\right)\right)}\right)}{B_m}\\
\mathbf{elif}\;{B_m}^{2} \leq 5 \cdot 10^{-21}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(\sqrt{B_m + C} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 4.99006e-322Initial program 17.2%
Simplified29.2%
add-sqr-sqrt12.2%
sqrt-unprod9.1%
frac-times8.9%
Applied egg-rr8.9%
Taylor expanded in A around inf 27.3%
mul-1-neg27.3%
Simplified27.3%
if 4.99006e-322 < (pow.f64 B 2) < 2e-175 or 1e-100 < (pow.f64 B 2) < 4.99999999999999973e-21Initial program 29.7%
Taylor expanded in A around -inf 30.6%
if 2e-175 < (pow.f64 B 2) < 1e-100Initial program 38.2%
Taylor expanded in C around 0 19.6%
mul-1-neg19.6%
*-commutative19.6%
distribute-rgt-neg-in19.6%
+-commutative19.6%
unpow219.6%
unpow219.6%
hypot-def20.0%
Simplified20.0%
pow1/220.0%
*-commutative20.0%
unpow-prod-down20.1%
pow1/220.1%
pow1/220.1%
Applied egg-rr20.1%
distribute-neg-frac20.1%
associate-*r/20.2%
*-commutative20.2%
sqrt-unprod20.2%
Applied egg-rr20.2%
if 4.99999999999999973e-21 < (pow.f64 B 2) Initial program 10.9%
Taylor expanded in A around 0 10.7%
mul-1-neg10.7%
*-commutative10.7%
distribute-rgt-neg-in10.7%
unpow210.7%
unpow210.7%
hypot-def23.0%
Simplified23.0%
pow1/223.0%
*-commutative23.0%
unpow-prod-down36.9%
pow1/236.9%
pow1/236.9%
Applied egg-rr36.9%
Taylor expanded in C around 0 31.2%
Final simplification29.5%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* -4.0 (* A C))))
(t_1 (- (pow B_m 2.0) (* C (* A 4.0)))))
(if (<= (pow B_m 2.0) 5e-322)
(sqrt (- (/ F C)))
(if (<= (pow B_m 2.0) 2e-175)
(/ (- (sqrt (* (* 2.0 (* F t_1)) (* 2.0 C)))) t_1)
(if (<= (pow B_m 2.0) 4e-58)
(/ (- (sqrt (* (* 2.0 t_0) (* F (+ A (hypot B_m A)))))) t_0)
(*
(* (sqrt (+ C (hypot B_m C))) (sqrt F))
(/ (- (sqrt 2.0)) B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (-4.0 * (A * C)));
double t_1 = pow(B_m, 2.0) - (C * (A * 4.0));
double tmp;
if (pow(B_m, 2.0) <= 5e-322) {
tmp = sqrt(-(F / C));
} else if (pow(B_m, 2.0) <= 2e-175) {
tmp = -sqrt(((2.0 * (F * t_1)) * (2.0 * C))) / t_1;
} else if (pow(B_m, 2.0) <= 4e-58) {
tmp = -sqrt(((2.0 * t_0) * (F * (A + hypot(B_m, A))))) / t_0;
} else {
tmp = (sqrt((C + hypot(B_m, C))) * sqrt(F)) * (-sqrt(2.0) / B_m);
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(-4.0 * Float64(A * C))) t_1 = Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 5e-322) tmp = sqrt(Float64(-Float64(F / C))); elseif ((B_m ^ 2.0) <= 2e-175) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_1)) * Float64(2.0 * C)))) / t_1); elseif ((B_m ^ 2.0) <= 4e-58) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * t_0) * Float64(F * Float64(A + hypot(B_m, A)))))) / t_0); else tmp = Float64(Float64(sqrt(Float64(C + hypot(B_m, C))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / B_m)); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-322], N[Sqrt[(-N[(F / C), $MachinePrecision])], $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-175], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e-58], N[((-N[Sqrt[N[(N[(2.0 * t$95$0), $MachinePrecision] * N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B_m, B_m, -4 \cdot \left(A \cdot C\right)\right)\\
t_1 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\
\mathbf{if}\;{B_m}^{2} \leq 5 \cdot 10^{-322}:\\
\;\;\;\;\sqrt{-\frac{F}{C}}\\
\mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{-175}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_1\right)\right) \cdot \left(2 \cdot C\right)}}{t_1}\\
\mathbf{elif}\;{B_m}^{2} \leq 4 \cdot 10^{-58}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot t_0\right) \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B_m, A\right)\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(B_m, C\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 4.99006e-322Initial program 17.2%
Simplified29.2%
add-sqr-sqrt12.2%
sqrt-unprod9.1%
frac-times8.9%
Applied egg-rr8.9%
Taylor expanded in A around inf 27.3%
mul-1-neg27.3%
Simplified27.3%
if 4.99006e-322 < (pow.f64 B 2) < 2e-175Initial program 26.9%
Taylor expanded in A around -inf 29.5%
if 2e-175 < (pow.f64 B 2) < 4.0000000000000001e-58Initial program 35.4%
neg-sub035.4%
div-sub35.4%
associate-*l*35.4%
Applied egg-rr44.4%
div044.4%
neg-sub044.4%
distribute-neg-frac44.4%
Simplified42.7%
Taylor expanded in C around 0 32.5%
+-commutative32.5%
unpow232.5%
unpow232.5%
hypot-def36.5%
Simplified36.5%
if 4.0000000000000001e-58 < (pow.f64 B 2) Initial program 13.3%
Taylor expanded in A around 0 10.7%
mul-1-neg10.7%
*-commutative10.7%
distribute-rgt-neg-in10.7%
unpow210.7%
unpow210.7%
hypot-def21.8%
Simplified21.8%
pow1/221.8%
*-commutative21.8%
unpow-prod-down34.3%
pow1/234.3%
pow1/234.3%
Applied egg-rr34.3%
Final simplification32.3%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0))))
(t_1 (- (pow B_m 2.0) (* C (* A 4.0)))))
(if (<= (pow B_m 2.0) 5e-322)
(sqrt (- (/ F C)))
(if (<= (pow B_m 2.0) 2e-175)
(/ (- (sqrt (* (* 2.0 (* F t_1)) (* 2.0 C)))) t_1)
(if (<= (pow B_m 2.0) 5e-75)
(/ (- (sqrt (* (* t_0 (* 2.0 F)) (+ A A)))) t_0)
(*
(* (sqrt (+ C (hypot B_m C))) (sqrt F))
(/ (- (sqrt 2.0)) B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double t_1 = pow(B_m, 2.0) - (C * (A * 4.0));
double tmp;
if (pow(B_m, 2.0) <= 5e-322) {
tmp = sqrt(-(F / C));
} else if (pow(B_m, 2.0) <= 2e-175) {
tmp = -sqrt(((2.0 * (F * t_1)) * (2.0 * C))) / t_1;
} else if (pow(B_m, 2.0) <= 5e-75) {
tmp = -sqrt(((t_0 * (2.0 * F)) * (A + A))) / t_0;
} else {
tmp = (sqrt((C + hypot(B_m, C))) * sqrt(F)) * (-sqrt(2.0) / B_m);
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_1 = Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 5e-322) tmp = sqrt(Float64(-Float64(F / C))); elseif ((B_m ^ 2.0) <= 2e-175) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_1)) * Float64(2.0 * C)))) / t_1); elseif ((B_m ^ 2.0) <= 5e-75) tmp = Float64(Float64(-sqrt(Float64(Float64(t_0 * Float64(2.0 * F)) * Float64(A + A)))) / t_0); else tmp = Float64(Float64(sqrt(Float64(C + hypot(B_m, C))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / B_m)); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-322], N[Sqrt[(-N[(F / C), $MachinePrecision])], $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-175], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-75], N[((-N[Sqrt[N[(N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\
\mathbf{if}\;{B_m}^{2} \leq 5 \cdot 10^{-322}:\\
\;\;\;\;\sqrt{-\frac{F}{C}}\\
\mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{-175}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_1\right)\right) \cdot \left(2 \cdot C\right)}}{t_1}\\
\mathbf{elif}\;{B_m}^{2} \leq 5 \cdot 10^{-75}:\\
\;\;\;\;\frac{-\sqrt{\left(t_0 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(B_m, C\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 4.99006e-322Initial program 17.2%
Simplified29.2%
add-sqr-sqrt12.2%
sqrt-unprod9.1%
frac-times8.9%
Applied egg-rr8.9%
Taylor expanded in A around inf 27.3%
mul-1-neg27.3%
Simplified27.3%
if 4.99006e-322 < (pow.f64 B 2) < 2e-175Initial program 26.9%
Taylor expanded in A around -inf 29.5%
if 2e-175 < (pow.f64 B 2) < 4.99999999999999979e-75Initial program 28.2%
Simplified35.4%
Taylor expanded in A around inf 33.1%
distribute-rgt1-in33.1%
metadata-eval33.1%
mul0-lft33.1%
Simplified33.1%
if 4.99999999999999979e-75 < (pow.f64 B 2) Initial program 15.6%
Taylor expanded in A around 0 10.3%
mul-1-neg10.3%
*-commutative10.3%
distribute-rgt-neg-in10.3%
unpow210.3%
unpow210.3%
hypot-def20.8%
Simplified20.8%
pow1/220.8%
*-commutative20.8%
unpow-prod-down32.7%
pow1/232.7%
pow1/232.7%
Applied egg-rr32.7%
Final simplification31.1%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0))))
(t_1 (- (pow B_m 2.0) (* C (* A 4.0)))))
(if (<= (pow B_m 2.0) 5e-322)
(sqrt (- (/ F C)))
(if (<= (pow B_m 2.0) 2e-175)
(/ (- (sqrt (* (* 2.0 (* F t_1)) (* 2.0 C)))) t_1)
(if (<= (pow B_m 2.0) 5e-75)
(/ (- (sqrt (* (* t_0 (* 2.0 F)) (+ A A)))) t_0)
(* (/ (sqrt 2.0) B_m) (* (sqrt (+ B_m C)) (- (sqrt F)))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double t_1 = pow(B_m, 2.0) - (C * (A * 4.0));
double tmp;
if (pow(B_m, 2.0) <= 5e-322) {
tmp = sqrt(-(F / C));
} else if (pow(B_m, 2.0) <= 2e-175) {
tmp = -sqrt(((2.0 * (F * t_1)) * (2.0 * C))) / t_1;
} else if (pow(B_m, 2.0) <= 5e-75) {
tmp = -sqrt(((t_0 * (2.0 * F)) * (A + A))) / t_0;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((B_m + C)) * -sqrt(F));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_1 = Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 5e-322) tmp = sqrt(Float64(-Float64(F / C))); elseif ((B_m ^ 2.0) <= 2e-175) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_1)) * Float64(2.0 * C)))) / t_1); elseif ((B_m ^ 2.0) <= 5e-75) tmp = Float64(Float64(-sqrt(Float64(Float64(t_0 * Float64(2.0 * F)) * Float64(A + A)))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(B_m + C)) * Float64(-sqrt(F)))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-322], N[Sqrt[(-N[(F / C), $MachinePrecision])], $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-175], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-75], N[((-N[Sqrt[N[(N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\
\mathbf{if}\;{B_m}^{2} \leq 5 \cdot 10^{-322}:\\
\;\;\;\;\sqrt{-\frac{F}{C}}\\
\mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{-175}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_1\right)\right) \cdot \left(2 \cdot C\right)}}{t_1}\\
\mathbf{elif}\;{B_m}^{2} \leq 5 \cdot 10^{-75}:\\
\;\;\;\;\frac{-\sqrt{\left(t_0 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(\sqrt{B_m + C} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 4.99006e-322Initial program 17.2%
Simplified29.2%
add-sqr-sqrt12.2%
sqrt-unprod9.1%
frac-times8.9%
Applied egg-rr8.9%
Taylor expanded in A around inf 27.3%
mul-1-neg27.3%
Simplified27.3%
if 4.99006e-322 < (pow.f64 B 2) < 2e-175Initial program 26.9%
Taylor expanded in A around -inf 29.5%
if 2e-175 < (pow.f64 B 2) < 4.99999999999999979e-75Initial program 28.2%
Simplified35.4%
Taylor expanded in A around inf 33.1%
distribute-rgt1-in33.1%
metadata-eval33.1%
mul0-lft33.1%
Simplified33.1%
if 4.99999999999999979e-75 < (pow.f64 B 2) Initial program 15.6%
Taylor expanded in A around 0 10.3%
mul-1-neg10.3%
*-commutative10.3%
distribute-rgt-neg-in10.3%
unpow210.3%
unpow210.3%
hypot-def20.8%
Simplified20.8%
pow1/220.8%
*-commutative20.8%
unpow-prod-down32.7%
pow1/232.7%
pow1/232.7%
Applied egg-rr32.7%
Taylor expanded in C around 0 27.7%
Final simplification28.3%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= (pow B_m 2.0) 5e+99)
(/
(*
(sqrt (+ (hypot (- A C) B_m) (+ A C)))
(- (sqrt (* (fma B_m B_m (* A (* C -4.0))) (* 2.0 F)))))
(fma B_m B_m (* -4.0 (* A C))))
(* (* (sqrt (+ C (hypot B_m C))) (sqrt F)) (/ (- (sqrt 2.0)) B_m))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (pow(B_m, 2.0) <= 5e+99) {
tmp = (sqrt((hypot((A - C), B_m) + (A + C))) * -sqrt((fma(B_m, B_m, (A * (C * -4.0))) * (2.0 * F)))) / fma(B_m, B_m, (-4.0 * (A * C)));
} else {
tmp = (sqrt((C + hypot(B_m, C))) * sqrt(F)) * (-sqrt(2.0) / B_m);
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if ((B_m ^ 2.0) <= 5e+99) tmp = Float64(Float64(sqrt(Float64(hypot(Float64(A - C), B_m) + Float64(A + C))) * Float64(-sqrt(Float64(fma(B_m, B_m, Float64(A * Float64(C * -4.0))) * Float64(2.0 * F))))) / fma(B_m, B_m, Float64(-4.0 * Float64(A * C)))); else tmp = Float64(Float64(sqrt(Float64(C + hypot(B_m, C))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / B_m)); end return tmp end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+99], N[(N[(N[Sqrt[N[(N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision] + N[(A + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(B$95$m * B$95$m + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;{B_m}^{2} \leq 5 \cdot 10^{+99}:\\
\;\;\;\;\frac{\sqrt{\mathsf{hypot}\left(A - C, B_m\right) + \left(A + C\right)} \cdot \left(-\sqrt{\mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)}\right)}{\mathsf{fma}\left(B_m, B_m, -4 \cdot \left(A \cdot C\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(B_m, C\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 5.00000000000000008e99Initial program 25.6%
neg-sub025.6%
div-sub25.6%
associate-*l*25.6%
Applied egg-rr33.6%
div033.6%
neg-sub033.6%
distribute-neg-frac33.6%
Simplified31.6%
pow1/231.6%
associate-*r*31.9%
*-commutative31.9%
*-commutative31.9%
associate-*r*31.9%
+-commutative31.9%
associate-+r+33.6%
*-commutative33.6%
unpow-prod-down37.5%
pow1/237.5%
associate-+r+36.3%
+-commutative36.3%
pow1/236.3%
Applied egg-rr36.3%
if 5.00000000000000008e99 < (pow.f64 B 2) Initial program 6.2%
Taylor expanded in A around 0 9.7%
mul-1-neg9.7%
*-commutative9.7%
distribute-rgt-neg-in9.7%
unpow29.7%
unpow29.7%
hypot-def25.5%
Simplified25.5%
pow1/225.5%
*-commutative25.5%
unpow-prod-down41.4%
pow1/241.4%
pow1/241.4%
Applied egg-rr41.4%
Final simplification38.1%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (pow B_m 2.0) (* C (* A 4.0)))) (t_1 (* 2.0 (* F t_0))))
(if (<= B_m 6.8e-161)
(sqrt (- (/ F C)))
(if (<= B_m 6.8e-84)
(/ (- (sqrt (* t_1 (* 2.0 C)))) t_0)
(if (<= B_m 2e-29)
(/ (- (sqrt (* t_1 (+ A (hypot B_m A))))) t_0)
(*
(* (sqrt (+ C (hypot B_m C))) (sqrt F))
(/ (- (sqrt 2.0)) B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = pow(B_m, 2.0) - (C * (A * 4.0));
double t_1 = 2.0 * (F * t_0);
double tmp;
if (B_m <= 6.8e-161) {
tmp = sqrt(-(F / C));
} else if (B_m <= 6.8e-84) {
tmp = -sqrt((t_1 * (2.0 * C))) / t_0;
} else if (B_m <= 2e-29) {
tmp = -sqrt((t_1 * (A + hypot(B_m, A)))) / t_0;
} else {
tmp = (sqrt((C + hypot(B_m, C))) * sqrt(F)) * (-sqrt(2.0) / B_m);
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = Math.pow(B_m, 2.0) - (C * (A * 4.0));
double t_1 = 2.0 * (F * t_0);
double tmp;
if (B_m <= 6.8e-161) {
tmp = Math.sqrt(-(F / C));
} else if (B_m <= 6.8e-84) {
tmp = -Math.sqrt((t_1 * (2.0 * C))) / t_0;
} else if (B_m <= 2e-29) {
tmp = -Math.sqrt((t_1 * (A + Math.hypot(B_m, A)))) / t_0;
} else {
tmp = (Math.sqrt((C + Math.hypot(B_m, C))) * Math.sqrt(F)) * (-Math.sqrt(2.0) / B_m);
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = math.pow(B_m, 2.0) - (C * (A * 4.0)) t_1 = 2.0 * (F * t_0) tmp = 0 if B_m <= 6.8e-161: tmp = math.sqrt(-(F / C)) elif B_m <= 6.8e-84: tmp = -math.sqrt((t_1 * (2.0 * C))) / t_0 elif B_m <= 2e-29: tmp = -math.sqrt((t_1 * (A + math.hypot(B_m, A)))) / t_0 else: tmp = (math.sqrt((C + math.hypot(B_m, C))) * math.sqrt(F)) * (-math.sqrt(2.0) / B_m) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0))) t_1 = Float64(2.0 * Float64(F * t_0)) tmp = 0.0 if (B_m <= 6.8e-161) tmp = sqrt(Float64(-Float64(F / C))); elseif (B_m <= 6.8e-84) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * C)))) / t_0); elseif (B_m <= 2e-29) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(A + hypot(B_m, A))))) / t_0); else tmp = Float64(Float64(sqrt(Float64(C + hypot(B_m, C))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / B_m)); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = (B_m ^ 2.0) - (C * (A * 4.0)); t_1 = 2.0 * (F * t_0); tmp = 0.0; if (B_m <= 6.8e-161) tmp = sqrt(-(F / C)); elseif (B_m <= 6.8e-84) tmp = -sqrt((t_1 * (2.0 * C))) / t_0; elseif (B_m <= 2e-29) tmp = -sqrt((t_1 * (A + hypot(B_m, A)))) / t_0; else tmp = (sqrt((C + hypot(B_m, C))) * sqrt(F)) * (-sqrt(2.0) / B_m); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 6.8e-161], N[Sqrt[(-N[(F / C), $MachinePrecision])], $MachinePrecision], If[LessEqual[B$95$m, 6.8e-84], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 2e-29], N[((-N[Sqrt[N[(t$95$1 * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\
t_1 := 2 \cdot \left(F \cdot t_0\right)\\
\mathbf{if}\;B_m \leq 6.8 \cdot 10^{-161}:\\
\;\;\;\;\sqrt{-\frac{F}{C}}\\
\mathbf{elif}\;B_m \leq 6.8 \cdot 10^{-84}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{elif}\;B_m \leq 2 \cdot 10^{-29}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(A + \mathsf{hypot}\left(B_m, A\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(B_m, C\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B_m}\\
\end{array}
\end{array}
if B < 6.79999999999999964e-161Initial program 18.7%
Simplified25.5%
add-sqr-sqrt6.0%
sqrt-unprod5.3%
frac-times5.0%
Applied egg-rr5.0%
Taylor expanded in A around inf 14.3%
mul-1-neg14.3%
Simplified14.3%
if 6.79999999999999964e-161 < B < 6.80000000000000042e-84Initial program 29.4%
Taylor expanded in A around -inf 35.0%
if 6.80000000000000042e-84 < B < 1.99999999999999989e-29Initial program 33.6%
Taylor expanded in C around 0 23.3%
+-commutative23.3%
unpow223.3%
unpow223.3%
hypot-def24.9%
Simplified24.9%
if 1.99999999999999989e-29 < B Initial program 13.9%
Taylor expanded in A around 0 19.9%
mul-1-neg19.9%
*-commutative19.9%
distribute-rgt-neg-in19.9%
unpow219.9%
unpow219.9%
hypot-def41.1%
Simplified41.1%
pow1/241.1%
*-commutative41.1%
unpow-prod-down65.8%
pow1/265.8%
pow1/265.8%
Applied egg-rr65.8%
Final simplification29.1%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* -4.0 (* A C)))))
(if (<= B_m 7.4e+28)
(/ (- (sqrt (* (* 2.0 t_0) (* F (+ (hypot (- A C) B_m) (+ A C)))))) t_0)
(* (* (sqrt (+ C (hypot B_m C))) (sqrt F)) (/ (- (sqrt 2.0)) B_m)))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (-4.0 * (A * C)));
double tmp;
if (B_m <= 7.4e+28) {
tmp = -sqrt(((2.0 * t_0) * (F * (hypot((A - C), B_m) + (A + C))))) / t_0;
} else {
tmp = (sqrt((C + hypot(B_m, C))) * sqrt(F)) * (-sqrt(2.0) / B_m);
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(-4.0 * Float64(A * C))) tmp = 0.0 if (B_m <= 7.4e+28) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * t_0) * Float64(F * Float64(hypot(Float64(A - C), B_m) + Float64(A + C)))))) / t_0); else tmp = Float64(Float64(sqrt(Float64(C + hypot(B_m, C))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / B_m)); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 7.4e+28], N[((-N[Sqrt[N[(N[(2.0 * t$95$0), $MachinePrecision] * N[(F * N[(N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision] + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B_m, B_m, -4 \cdot \left(A \cdot C\right)\right)\\
\mathbf{if}\;B_m \leq 7.4 \cdot 10^{+28}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot t_0\right) \cdot \left(F \cdot \left(\mathsf{hypot}\left(A - C, B_m\right) + \left(A + C\right)\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(B_m, C\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B_m}\\
\end{array}
\end{array}
if B < 7.3999999999999998e28Initial program 21.0%
neg-sub021.0%
div-sub21.0%
associate-*l*21.0%
Applied egg-rr27.4%
div027.4%
neg-sub027.4%
distribute-neg-frac27.4%
Simplified25.8%
if 7.3999999999999998e28 < B Initial program 8.9%
Taylor expanded in A around 0 19.0%
mul-1-neg19.0%
*-commutative19.0%
distribute-rgt-neg-in19.0%
unpow219.0%
unpow219.0%
hypot-def46.3%
Simplified46.3%
pow1/246.3%
*-commutative46.3%
unpow-prod-down78.3%
pow1/278.3%
pow1/278.3%
Applied egg-rr78.3%
Final simplification36.3%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
(if (<= B_m 7.8e+28)
(/ (- (sqrt (* (* t_0 (* 2.0 F)) (+ A (+ C (hypot B_m (- A C))))))) t_0)
(* (* (sqrt (+ C (hypot B_m C))) (sqrt F)) (/ (- (sqrt 2.0)) B_m)))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (B_m <= 7.8e+28) {
tmp = -sqrt(((t_0 * (2.0 * F)) * (A + (C + hypot(B_m, (A - C)))))) / t_0;
} else {
tmp = (sqrt((C + hypot(B_m, C))) * sqrt(F)) * (-sqrt(2.0) / B_m);
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (B_m <= 7.8e+28) tmp = Float64(Float64(-sqrt(Float64(Float64(t_0 * Float64(2.0 * F)) * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))))) / t_0); else tmp = Float64(Float64(sqrt(Float64(C + hypot(B_m, C))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / B_m)); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 7.8e+28], N[((-N[Sqrt[N[(N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B_m \leq 7.8 \cdot 10^{+28}:\\
\;\;\;\;\frac{-\sqrt{\left(t_0 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B_m, A - C\right)\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(B_m, C\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B_m}\\
\end{array}
\end{array}
if B < 7.7999999999999997e28Initial program 21.0%
Simplified27.4%
if 7.7999999999999997e28 < B Initial program 8.9%
Taylor expanded in A around 0 19.0%
mul-1-neg19.0%
*-commutative19.0%
distribute-rgt-neg-in19.0%
unpow219.0%
unpow219.0%
hypot-def46.3%
Simplified46.3%
pow1/246.3%
*-commutative46.3%
unpow-prod-down78.3%
pow1/278.3%
pow1/278.3%
Applied egg-rr78.3%
Final simplification37.6%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F -5e-311) (/ (sqrt (- F)) (sqrt A)) (* (/ (sqrt 2.0) B_m) (* (sqrt F) (- (sqrt (+ A (hypot B_m A))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5e-311) {
tmp = sqrt(-F) / sqrt(A);
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt((A + hypot(B_m, A))));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5e-311) {
tmp = Math.sqrt(-F) / Math.sqrt(A);
} else {
tmp = (Math.sqrt(2.0) / B_m) * (Math.sqrt(F) * -Math.sqrt((A + Math.hypot(B_m, A))));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= -5e-311: tmp = math.sqrt(-F) / math.sqrt(A) else: tmp = (math.sqrt(2.0) / B_m) * (math.sqrt(F) * -math.sqrt((A + math.hypot(B_m, A)))) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -5e-311) tmp = Float64(sqrt(Float64(-F)) / sqrt(A)); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(Float64(A + hypot(B_m, A)))))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= -5e-311) tmp = sqrt(-F) / sqrt(A); else tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt((A + hypot(B_m, A)))); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -5e-311], N[(N[Sqrt[(-F)], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\frac{\sqrt{-F}}{\sqrt{A}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{A + \mathsf{hypot}\left(B_m, A\right)}\right)\right)\\
\end{array}
\end{array}
if F < -5.00000000000023e-311Initial program 37.7%
Simplified45.8%
add-sqr-sqrt45.7%
sqrt-unprod38.1%
frac-times33.8%
Applied egg-rr33.8%
Taylor expanded in A around -inf 45.1%
mul-1-neg45.1%
Simplified45.1%
distribute-neg-frac45.1%
sqrt-div60.6%
Applied egg-rr60.6%
if -5.00000000000023e-311 < F Initial program 16.7%
Taylor expanded in C around 0 8.7%
mul-1-neg8.7%
*-commutative8.7%
distribute-rgt-neg-in8.7%
+-commutative8.7%
unpow28.7%
unpow28.7%
hypot-def15.4%
Simplified15.4%
pow1/215.4%
*-commutative15.4%
unpow-prod-down21.5%
pow1/221.5%
pow1/221.5%
Applied egg-rr21.5%
Final simplification25.2%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -5e-311)
(/ (sqrt (- F)) (sqrt A))
(if (<= F 6.5e+23)
(/ (- (sqrt (* F (* 2.0 (+ C (hypot B_m C)))))) B_m)
(* (/ (- (sqrt 2.0)) B_m) (* (sqrt F) (sqrt B_m))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5e-311) {
tmp = sqrt(-F) / sqrt(A);
} else if (F <= 6.5e+23) {
tmp = -sqrt((F * (2.0 * (C + hypot(B_m, C))))) / B_m;
} else {
tmp = (-sqrt(2.0) / B_m) * (sqrt(F) * sqrt(B_m));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5e-311) {
tmp = Math.sqrt(-F) / Math.sqrt(A);
} else if (F <= 6.5e+23) {
tmp = -Math.sqrt((F * (2.0 * (C + Math.hypot(B_m, C))))) / B_m;
} else {
tmp = (-Math.sqrt(2.0) / B_m) * (Math.sqrt(F) * Math.sqrt(B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= -5e-311: tmp = math.sqrt(-F) / math.sqrt(A) elif F <= 6.5e+23: tmp = -math.sqrt((F * (2.0 * (C + math.hypot(B_m, C))))) / B_m else: tmp = (-math.sqrt(2.0) / B_m) * (math.sqrt(F) * math.sqrt(B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -5e-311) tmp = Float64(sqrt(Float64(-F)) / sqrt(A)); elseif (F <= 6.5e+23) tmp = Float64(Float64(-sqrt(Float64(F * Float64(2.0 * Float64(C + hypot(B_m, C)))))) / B_m); else tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * Float64(sqrt(F) * sqrt(B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= -5e-311) tmp = sqrt(-F) / sqrt(A); elseif (F <= 6.5e+23) tmp = -sqrt((F * (2.0 * (C + hypot(B_m, C))))) / B_m; else tmp = (-sqrt(2.0) / B_m) * (sqrt(F) * sqrt(B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -5e-311], N[(N[Sqrt[(-F)], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.5e+23], N[((-N[Sqrt[N[(F * N[(2.0 * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B$95$m), $MachinePrecision], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\frac{\sqrt{-F}}{\sqrt{A}}\\
\mathbf{elif}\;F \leq 6.5 \cdot 10^{+23}:\\
\;\;\;\;\frac{-\sqrt{F \cdot \left(2 \cdot \left(C + \mathsf{hypot}\left(B_m, C\right)\right)\right)}}{B_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \left(\sqrt{F} \cdot \sqrt{B_m}\right)\\
\end{array}
\end{array}
if F < -5.00000000000023e-311Initial program 37.7%
Simplified45.8%
add-sqr-sqrt45.7%
sqrt-unprod38.1%
frac-times33.8%
Applied egg-rr33.8%
Taylor expanded in A around -inf 45.1%
mul-1-neg45.1%
Simplified45.1%
distribute-neg-frac45.1%
sqrt-div60.6%
Applied egg-rr60.6%
if -5.00000000000023e-311 < F < 6.4999999999999996e23Initial program 18.6%
Taylor expanded in A around 0 9.0%
mul-1-neg9.0%
*-commutative9.0%
distribute-rgt-neg-in9.0%
unpow29.0%
unpow29.0%
hypot-def20.3%
Simplified20.3%
pow1/220.3%
*-commutative20.3%
unpow-prod-down20.3%
pow1/220.3%
pow1/220.3%
Applied egg-rr20.3%
*-commutative20.3%
sqrt-prod20.3%
distribute-rgt-neg-out20.3%
*-commutative20.3%
neg-sub020.3%
associate-*l/20.2%
sqrt-unprod20.3%
*-commutative20.3%
Applied egg-rr20.3%
neg-sub020.3%
distribute-frac-neg20.3%
*-commutative20.3%
*-commutative20.3%
associate-*l*20.3%
Simplified20.3%
if 6.4999999999999996e23 < F Initial program 14.4%
Taylor expanded in A around 0 8.1%
mul-1-neg8.1%
*-commutative8.1%
distribute-rgt-neg-in8.1%
unpow28.1%
unpow28.1%
hypot-def9.3%
Simplified9.3%
pow1/29.3%
*-commutative9.3%
unpow-prod-down24.6%
pow1/224.6%
pow1/224.6%
Applied egg-rr24.6%
Taylor expanded in C around 0 20.0%
Final simplification24.0%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -5e-311)
(/ (sqrt (- F)) (sqrt A))
(if (<= F 4.2e+25)
(/ (- (sqrt (* F (* 2.0 (+ C (hypot B_m C)))))) B_m)
(* (- (sqrt 2.0)) (sqrt (/ F B_m))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5e-311) {
tmp = sqrt(-F) / sqrt(A);
} else if (F <= 4.2e+25) {
tmp = -sqrt((F * (2.0 * (C + hypot(B_m, C))))) / B_m;
} else {
tmp = -sqrt(2.0) * sqrt((F / B_m));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5e-311) {
tmp = Math.sqrt(-F) / Math.sqrt(A);
} else if (F <= 4.2e+25) {
tmp = -Math.sqrt((F * (2.0 * (C + Math.hypot(B_m, C))))) / B_m;
} else {
tmp = -Math.sqrt(2.0) * Math.sqrt((F / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= -5e-311: tmp = math.sqrt(-F) / math.sqrt(A) elif F <= 4.2e+25: tmp = -math.sqrt((F * (2.0 * (C + math.hypot(B_m, C))))) / B_m else: tmp = -math.sqrt(2.0) * math.sqrt((F / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -5e-311) tmp = Float64(sqrt(Float64(-F)) / sqrt(A)); elseif (F <= 4.2e+25) tmp = Float64(Float64(-sqrt(Float64(F * Float64(2.0 * Float64(C + hypot(B_m, C)))))) / B_m); else tmp = Float64(Float64(-sqrt(2.0)) * sqrt(Float64(F / B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= -5e-311) tmp = sqrt(-F) / sqrt(A); elseif (F <= 4.2e+25) tmp = -sqrt((F * (2.0 * (C + hypot(B_m, C))))) / B_m; else tmp = -sqrt(2.0) * sqrt((F / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -5e-311], N[(N[Sqrt[(-F)], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.2e+25], N[((-N[Sqrt[N[(F * N[(2.0 * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B$95$m), $MachinePrecision], N[((-N[Sqrt[2.0], $MachinePrecision]) * N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\frac{\sqrt{-F}}{\sqrt{A}}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{+25}:\\
\;\;\;\;\frac{-\sqrt{F \cdot \left(2 \cdot \left(C + \mathsf{hypot}\left(B_m, C\right)\right)\right)}}{B_m}\\
\mathbf{else}:\\
\;\;\;\;\left(-\sqrt{2}\right) \cdot \sqrt{\frac{F}{B_m}}\\
\end{array}
\end{array}
if F < -5.00000000000023e-311Initial program 37.7%
Simplified45.8%
add-sqr-sqrt45.7%
sqrt-unprod38.1%
frac-times33.8%
Applied egg-rr33.8%
Taylor expanded in A around -inf 45.1%
mul-1-neg45.1%
Simplified45.1%
distribute-neg-frac45.1%
sqrt-div60.6%
Applied egg-rr60.6%
if -5.00000000000023e-311 < F < 4.1999999999999998e25Initial program 18.5%
Taylor expanded in A around 0 8.9%
mul-1-neg8.9%
*-commutative8.9%
distribute-rgt-neg-in8.9%
unpow28.9%
unpow28.9%
hypot-def20.1%
Simplified20.1%
pow1/220.1%
*-commutative20.1%
unpow-prod-down20.1%
pow1/220.1%
pow1/220.1%
Applied egg-rr20.1%
*-commutative20.1%
sqrt-prod20.1%
distribute-rgt-neg-out20.1%
*-commutative20.1%
neg-sub020.1%
associate-*l/20.1%
sqrt-unprod20.2%
*-commutative20.2%
Applied egg-rr20.2%
neg-sub020.2%
distribute-frac-neg20.2%
*-commutative20.2%
*-commutative20.2%
associate-*l*20.2%
Simplified20.2%
if 4.1999999999999998e25 < F Initial program 14.5%
Taylor expanded in C around 0 8.5%
mul-1-neg8.5%
*-commutative8.5%
distribute-rgt-neg-in8.5%
+-commutative8.5%
unpow28.5%
unpow28.5%
hypot-def9.8%
Simplified9.8%
Taylor expanded in A around 0 19.2%
mul-1-neg19.2%
Simplified19.2%
Final simplification23.6%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (sqrt 2.0))))
(if (<= F -5e-311)
(/ (sqrt (- F)) (sqrt A))
(if (<= F 1e-8)
(* (/ t_0 B_m) (sqrt (* B_m F)))
(* t_0 (sqrt (/ F B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = -sqrt(2.0);
double tmp;
if (F <= -5e-311) {
tmp = sqrt(-F) / sqrt(A);
} else if (F <= 1e-8) {
tmp = (t_0 / B_m) * sqrt((B_m * F));
} else {
tmp = t_0 * sqrt((F / B_m));
}
return tmp;
}
B_m = abs(B)
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 = -sqrt(2.0d0)
if (f <= (-5d-311)) then
tmp = sqrt(-f) / sqrt(a)
else if (f <= 1d-8) then
tmp = (t_0 / b_m) * sqrt((b_m * f))
else
tmp = t_0 * sqrt((f / b_m))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = -Math.sqrt(2.0);
double tmp;
if (F <= -5e-311) {
tmp = Math.sqrt(-F) / Math.sqrt(A);
} else if (F <= 1e-8) {
tmp = (t_0 / B_m) * Math.sqrt((B_m * F));
} else {
tmp = t_0 * Math.sqrt((F / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = -math.sqrt(2.0) tmp = 0 if F <= -5e-311: tmp = math.sqrt(-F) / math.sqrt(A) elif F <= 1e-8: tmp = (t_0 / B_m) * math.sqrt((B_m * F)) else: tmp = t_0 * math.sqrt((F / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(-sqrt(2.0)) tmp = 0.0 if (F <= -5e-311) tmp = Float64(sqrt(Float64(-F)) / sqrt(A)); elseif (F <= 1e-8) tmp = Float64(Float64(t_0 / B_m) * sqrt(Float64(B_m * F))); else tmp = Float64(t_0 * sqrt(Float64(F / B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = -sqrt(2.0); tmp = 0.0; if (F <= -5e-311) tmp = sqrt(-F) / sqrt(A); elseif (F <= 1e-8) tmp = (t_0 / B_m) * sqrt((B_m * F)); else tmp = t_0 * sqrt((F / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = (-N[Sqrt[2.0], $MachinePrecision])}, If[LessEqual[F, -5e-311], N[(N[Sqrt[(-F)], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e-8], N[(N[(t$95$0 / B$95$m), $MachinePrecision] * N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := -\sqrt{2}\\
\mathbf{if}\;F \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\frac{\sqrt{-F}}{\sqrt{A}}\\
\mathbf{elif}\;F \leq 10^{-8}:\\
\;\;\;\;\frac{t_0}{B_m} \cdot \sqrt{B_m \cdot F}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \sqrt{\frac{F}{B_m}}\\
\end{array}
\end{array}
if F < -5.00000000000023e-311Initial program 37.7%
Simplified45.8%
add-sqr-sqrt45.7%
sqrt-unprod38.1%
frac-times33.8%
Applied egg-rr33.8%
Taylor expanded in A around -inf 45.1%
mul-1-neg45.1%
Simplified45.1%
distribute-neg-frac45.1%
sqrt-div60.6%
Applied egg-rr60.6%
if -5.00000000000023e-311 < F < 1e-8Initial program 19.8%
Taylor expanded in C around 0 9.6%
mul-1-neg9.6%
*-commutative9.6%
distribute-rgt-neg-in9.6%
+-commutative9.6%
unpow29.6%
unpow29.6%
hypot-def21.6%
Simplified21.6%
Taylor expanded in A around 0 18.5%
if 1e-8 < F Initial program 13.9%
Taylor expanded in C around 0 7.8%
mul-1-neg7.8%
*-commutative7.8%
distribute-rgt-neg-in7.8%
+-commutative7.8%
unpow27.8%
unpow27.8%
hypot-def9.9%
Simplified9.9%
Taylor expanded in A around 0 17.8%
mul-1-neg17.8%
Simplified17.8%
Final simplification22.1%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (sqrt (- (/ F C)))))
(if (<= C -9.5e+44)
t_0
(if (<= C 5.5e-85)
(sqrt (/ (- F) A))
(if (<= C 5e+25) t_0 (/ (sqrt (- F)) (sqrt A)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = sqrt(-(F / C));
double tmp;
if (C <= -9.5e+44) {
tmp = t_0;
} else if (C <= 5.5e-85) {
tmp = sqrt((-F / A));
} else if (C <= 5e+25) {
tmp = t_0;
} else {
tmp = sqrt(-F) / sqrt(A);
}
return tmp;
}
B_m = abs(B)
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 = sqrt(-(f / c))
if (c <= (-9.5d+44)) then
tmp = t_0
else if (c <= 5.5d-85) then
tmp = sqrt((-f / a))
else if (c <= 5d+25) then
tmp = t_0
else
tmp = sqrt(-f) / sqrt(a)
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = Math.sqrt(-(F / C));
double tmp;
if (C <= -9.5e+44) {
tmp = t_0;
} else if (C <= 5.5e-85) {
tmp = Math.sqrt((-F / A));
} else if (C <= 5e+25) {
tmp = t_0;
} else {
tmp = Math.sqrt(-F) / Math.sqrt(A);
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = math.sqrt(-(F / C)) tmp = 0 if C <= -9.5e+44: tmp = t_0 elif C <= 5.5e-85: tmp = math.sqrt((-F / A)) elif C <= 5e+25: tmp = t_0 else: tmp = math.sqrt(-F) / math.sqrt(A) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = sqrt(Float64(-Float64(F / C))) tmp = 0.0 if (C <= -9.5e+44) tmp = t_0; elseif (C <= 5.5e-85) tmp = sqrt(Float64(Float64(-F) / A)); elseif (C <= 5e+25) tmp = t_0; else tmp = Float64(sqrt(Float64(-F)) / sqrt(A)); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = sqrt(-(F / C)); tmp = 0.0; if (C <= -9.5e+44) tmp = t_0; elseif (C <= 5.5e-85) tmp = sqrt((-F / A)); elseif (C <= 5e+25) tmp = t_0; else tmp = sqrt(-F) / sqrt(A); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[Sqrt[(-N[(F / C), $MachinePrecision])], $MachinePrecision]}, If[LessEqual[C, -9.5e+44], t$95$0, If[LessEqual[C, 5.5e-85], N[Sqrt[N[((-F) / A), $MachinePrecision]], $MachinePrecision], If[LessEqual[C, 5e+25], t$95$0, N[(N[Sqrt[(-F)], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \sqrt{-\frac{F}{C}}\\
\mathbf{if}\;C \leq -9.5 \cdot 10^{+44}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;C \leq 5.5 \cdot 10^{-85}:\\
\;\;\;\;\sqrt{\frac{-F}{A}}\\
\mathbf{elif}\;C \leq 5 \cdot 10^{+25}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-F}}{\sqrt{A}}\\
\end{array}
\end{array}
if C < -9.5000000000000004e44 or 5.4999999999999997e-85 < C < 5.00000000000000024e25Initial program 10.5%
Simplified15.6%
add-sqr-sqrt9.2%
sqrt-unprod8.0%
frac-times6.7%
Applied egg-rr6.7%
Taylor expanded in A around inf 24.5%
mul-1-neg24.5%
Simplified24.5%
if -9.5000000000000004e44 < C < 5.4999999999999997e-85Initial program 24.4%
Simplified29.0%
add-sqr-sqrt2.5%
sqrt-unprod3.0%
frac-times2.8%
Applied egg-rr2.8%
Taylor expanded in A around -inf 15.2%
mul-1-neg15.2%
Simplified15.2%
if 5.00000000000000024e25 < C Initial program 19.5%
Simplified28.3%
add-sqr-sqrt7.2%
sqrt-unprod5.6%
frac-times5.5%
Applied egg-rr5.5%
Taylor expanded in A around -inf 17.5%
mul-1-neg17.5%
Simplified17.5%
distribute-neg-frac17.5%
sqrt-div22.7%
Applied egg-rr22.7%
Final simplification19.8%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F -5e-311) (/ (sqrt (- F)) (sqrt A)) (* (- (sqrt 2.0)) (sqrt (/ F B_m)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5e-311) {
tmp = sqrt(-F) / sqrt(A);
} else {
tmp = -sqrt(2.0) * sqrt((F / B_m));
}
return tmp;
}
B_m = abs(B)
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 (f <= (-5d-311)) then
tmp = sqrt(-f) / sqrt(a)
else
tmp = -sqrt(2.0d0) * sqrt((f / b_m))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5e-311) {
tmp = Math.sqrt(-F) / Math.sqrt(A);
} else {
tmp = -Math.sqrt(2.0) * Math.sqrt((F / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= -5e-311: tmp = math.sqrt(-F) / math.sqrt(A) else: tmp = -math.sqrt(2.0) * math.sqrt((F / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -5e-311) tmp = Float64(sqrt(Float64(-F)) / sqrt(A)); else tmp = Float64(Float64(-sqrt(2.0)) * sqrt(Float64(F / B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= -5e-311) tmp = sqrt(-F) / sqrt(A); else tmp = -sqrt(2.0) * sqrt((F / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -5e-311], N[(N[Sqrt[(-F)], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[2.0], $MachinePrecision]) * N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\frac{\sqrt{-F}}{\sqrt{A}}\\
\mathbf{else}:\\
\;\;\;\;\left(-\sqrt{2}\right) \cdot \sqrt{\frac{F}{B_m}}\\
\end{array}
\end{array}
if F < -5.00000000000023e-311Initial program 37.7%
Simplified45.8%
add-sqr-sqrt45.7%
sqrt-unprod38.1%
frac-times33.8%
Applied egg-rr33.8%
Taylor expanded in A around -inf 45.1%
mul-1-neg45.1%
Simplified45.1%
distribute-neg-frac45.1%
sqrt-div60.6%
Applied egg-rr60.6%
if -5.00000000000023e-311 < F Initial program 16.7%
Taylor expanded in C around 0 8.7%
mul-1-neg8.7%
*-commutative8.7%
distribute-rgt-neg-in8.7%
+-commutative8.7%
unpow28.7%
unpow28.7%
hypot-def15.4%
Simplified15.4%
Taylor expanded in A around 0 14.7%
mul-1-neg14.7%
Simplified14.7%
Final simplification19.0%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (or (<= C -3.1e+45) (and (not (<= C 2.9e-83)) (<= C 2.15e+26))) (sqrt (- (/ F C))) (sqrt (/ (- F) A))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if ((C <= -3.1e+45) || (!(C <= 2.9e-83) && (C <= 2.15e+26))) {
tmp = sqrt(-(F / C));
} else {
tmp = sqrt((-F / A));
}
return tmp;
}
B_m = abs(B)
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 <= (-3.1d+45)) .or. (.not. (c <= 2.9d-83)) .and. (c <= 2.15d+26)) then
tmp = sqrt(-(f / c))
else
tmp = sqrt((-f / a))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if ((C <= -3.1e+45) || (!(C <= 2.9e-83) && (C <= 2.15e+26))) {
tmp = Math.sqrt(-(F / C));
} else {
tmp = Math.sqrt((-F / A));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if (C <= -3.1e+45) or (not (C <= 2.9e-83) and (C <= 2.15e+26)): tmp = math.sqrt(-(F / C)) else: tmp = math.sqrt((-F / A)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if ((C <= -3.1e+45) || (!(C <= 2.9e-83) && (C <= 2.15e+26))) tmp = sqrt(Float64(-Float64(F / C))); else tmp = sqrt(Float64(Float64(-F) / A)); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if ((C <= -3.1e+45) || (~((C <= 2.9e-83)) && (C <= 2.15e+26))) tmp = sqrt(-(F / C)); else tmp = sqrt((-F / A)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[Or[LessEqual[C, -3.1e+45], And[N[Not[LessEqual[C, 2.9e-83]], $MachinePrecision], LessEqual[C, 2.15e+26]]], N[Sqrt[(-N[(F / C), $MachinePrecision])], $MachinePrecision], N[Sqrt[N[((-F) / A), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;C \leq -3.1 \cdot 10^{+45} \lor \neg \left(C \leq 2.9 \cdot 10^{-83}\right) \land C \leq 2.15 \cdot 10^{+26}:\\
\;\;\;\;\sqrt{-\frac{F}{C}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{-F}{A}}\\
\end{array}
\end{array}
if C < -3.09999999999999988e45 or 2.8999999999999999e-83 < C < 2.1499999999999999e26Initial program 10.5%
Simplified15.6%
add-sqr-sqrt9.2%
sqrt-unprod8.0%
frac-times6.7%
Applied egg-rr6.7%
Taylor expanded in A around inf 24.5%
mul-1-neg24.5%
Simplified24.5%
if -3.09999999999999988e45 < C < 2.8999999999999999e-83 or 2.1499999999999999e26 < C Initial program 23.1%
Simplified28.8%
add-sqr-sqrt3.7%
sqrt-unprod3.7%
frac-times3.5%
Applied egg-rr3.5%
Taylor expanded in A around -inf 15.8%
mul-1-neg15.8%
Simplified15.8%
Final simplification18.9%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (sqrt (/ (- F) A)))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
return sqrt((-F / A));
}
B_m = abs(B)
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((-f / a))
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
return Math.sqrt((-F / A));
}
B_m = math.fabs(B) def code(A, B_m, C, F): return math.sqrt((-F / A))
B_m = abs(B) function code(A, B_m, C, F) return sqrt(Float64(Float64(-F) / A)) end
B_m = abs(B); function tmp = code(A, B_m, C, F) tmp = sqrt((-F / A)); end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := N[Sqrt[N[((-F) / A), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
\sqrt{\frac{-F}{A}}
\end{array}
Initial program 18.6%
Simplified24.1%
add-sqr-sqrt5.7%
sqrt-unprod5.2%
frac-times4.6%
Applied egg-rr4.6%
Taylor expanded in A around -inf 12.7%
mul-1-neg12.7%
Simplified12.7%
Final simplification12.7%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (sqrt (/ F A)))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
return sqrt((F / A));
}
B_m = abs(B)
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((f / a))
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
return Math.sqrt((F / A));
}
B_m = math.fabs(B) def code(A, B_m, C, F): return math.sqrt((F / A))
B_m = abs(B) function code(A, B_m, C, F) return sqrt(Float64(F / A)) end
B_m = abs(B); function tmp = code(A, B_m, C, F) tmp = sqrt((F / A)); end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := N[Sqrt[N[(F / A), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
\sqrt{\frac{F}{A}}
\end{array}
Initial program 18.6%
Simplified24.1%
add-sqr-sqrt5.7%
sqrt-unprod5.2%
frac-times4.6%
Applied egg-rr4.6%
Taylor expanded in A around -inf 12.7%
mul-1-neg12.7%
Simplified12.7%
expm1-log1p-u12.4%
expm1-udef6.4%
add-sqr-sqrt6.4%
sqrt-unprod6.7%
sqr-neg6.7%
sqrt-unprod1.3%
add-sqr-sqrt1.3%
Applied egg-rr1.3%
expm1-def1.1%
expm1-log1p1.1%
Simplified1.1%
Final simplification1.1%
herbie shell --seed 2023318
(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))))