
(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 15 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 (fma B_m B_m (* A (* -4.0 C)))))
(if (<= B_m 1.85e-262)
(* 0.25 (* (sqrt (/ (* F -4.0) A)) (pow (sqrt 2.0) 2.0)))
(if (<= B_m 3.3e-97)
(/ (sqrt (* (* F t_0) (* C 4.0))) (- t_0))
(if (<= B_m 3.2e+38)
(*
(sqrt
(*
F
(/
(+ (+ A C) (hypot B_m (- A C)))
(fma -4.0 (* A C) (pow B_m 2.0)))))
(- (sqrt 2.0)))
(*
(* (sqrt (+ C (hypot C B_m))) (sqrt F))
(/ (exp (* (log 2.0) 0.5)) (- 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 = fma(B_m, B_m, (A * (-4.0 * C)));
double tmp;
if (B_m <= 1.85e-262) {
tmp = 0.25 * (sqrt(((F * -4.0) / A)) * pow(sqrt(2.0), 2.0));
} else if (B_m <= 3.3e-97) {
tmp = sqrt(((F * t_0) * (C * 4.0))) / -t_0;
} else if (B_m <= 3.2e+38) {
tmp = sqrt((F * (((A + C) + hypot(B_m, (A - C))) / fma(-4.0, (A * C), pow(B_m, 2.0))))) * -sqrt(2.0);
} else {
tmp = (sqrt((C + hypot(C, B_m))) * sqrt(F)) * (exp((log(2.0) * 0.5)) / -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 = fma(B_m, B_m, Float64(A * Float64(-4.0 * C))) tmp = 0.0 if (B_m <= 1.85e-262) tmp = Float64(0.25 * Float64(sqrt(Float64(Float64(F * -4.0) / A)) * (sqrt(2.0) ^ 2.0))); elseif (B_m <= 3.3e-97) tmp = Float64(sqrt(Float64(Float64(F * t_0) * Float64(C * 4.0))) / Float64(-t_0)); elseif (B_m <= 3.2e+38) tmp = Float64(sqrt(Float64(F * Float64(Float64(Float64(A + C) + hypot(B_m, Float64(A - C))) / fma(-4.0, Float64(A * C), (B_m ^ 2.0))))) * Float64(-sqrt(2.0))); else tmp = Float64(Float64(sqrt(Float64(C + hypot(C, B_m))) * sqrt(F)) * Float64(exp(Float64(log(2.0) * 0.5)) / Float64(-B_m))); end return 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[(B$95$m * B$95$m + N[(A * N[(-4.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.85e-262], N[(0.25 * N[(N[Sqrt[N[(N[(F * -4.0), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[2.0], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 3.3e-97], N[(N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(C * 4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$0)), $MachinePrecision], If[LessEqual[B$95$m, 3.2e+38], N[(N[Sqrt[N[(F * N[(N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / N[(-4.0 * N[(A * C), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(N[Log[2.0], $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $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 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(-4 \cdot C\right)\right)\\
\mathbf{if}\;B\_m \leq 1.85 \cdot 10^{-262}:\\
\;\;\;\;0.25 \cdot \left(\sqrt{\frac{F \cdot -4}{A}} \cdot {\left(\sqrt{2}\right)}^{2}\right)\\
\mathbf{elif}\;B\_m \leq 3.3 \cdot 10^{-97}:\\
\;\;\;\;\frac{\sqrt{\left(F \cdot t\_0\right) \cdot \left(C \cdot 4\right)}}{-t\_0}\\
\mathbf{elif}\;B\_m \leq 3.2 \cdot 10^{+38}:\\
\;\;\;\;\sqrt{F \cdot \frac{\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)}{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}} \cdot \left(-\sqrt{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(C, B\_m\right)} \cdot \sqrt{F}\right) \cdot \frac{e^{\log 2 \cdot 0.5}}{-B\_m}\\
\end{array}
\end{array}
if B < 1.85e-262Initial program 17.1%
Simplified23.3%
add-cube-cbrt23.2%
pow323.2%
Applied egg-rr23.2%
Taylor expanded in C around inf 13.6%
rem-cube-cbrt13.7%
Simplified13.7%
if 1.85e-262 < B < 3.3000000000000001e-97Initial program 23.5%
Simplified28.1%
Taylor expanded in A around -inf 23.1%
*-commutative23.1%
Simplified23.1%
if 3.3000000000000001e-97 < B < 3.19999999999999985e38Initial program 16.5%
Taylor expanded in F around 0 12.3%
Simplified25.9%
if 3.19999999999999985e38 < B Initial program 14.0%
Taylor expanded in A around 0 24.5%
mul-1-neg24.5%
*-commutative24.5%
*-commutative24.5%
+-commutative24.5%
unpow224.5%
unpow224.5%
hypot-define56.2%
Simplified56.2%
sqrt-prod76.4%
Applied egg-rr76.4%
pow1/276.4%
pow-to-exp76.6%
Applied egg-rr76.6%
Final simplification31.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
(let* ((t_0 (fma B_m B_m (* A (* -4.0 C)))))
(if (<= B_m 1.35e-262)
(* 0.25 (* (sqrt (/ (* F -4.0) A)) (pow (sqrt 2.0) 2.0)))
(if (<= B_m 8.2e-26)
(/ (sqrt (* (* F t_0) (* C 4.0))) (- t_0))
(*
(* (sqrt (+ C (hypot C B_m))) (sqrt F))
(/ (exp (* (log 2.0) 0.5)) (- 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 = fma(B_m, B_m, (A * (-4.0 * C)));
double tmp;
if (B_m <= 1.35e-262) {
tmp = 0.25 * (sqrt(((F * -4.0) / A)) * pow(sqrt(2.0), 2.0));
} else if (B_m <= 8.2e-26) {
tmp = sqrt(((F * t_0) * (C * 4.0))) / -t_0;
} else {
tmp = (sqrt((C + hypot(C, B_m))) * sqrt(F)) * (exp((log(2.0) * 0.5)) / -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 = fma(B_m, B_m, Float64(A * Float64(-4.0 * C))) tmp = 0.0 if (B_m <= 1.35e-262) tmp = Float64(0.25 * Float64(sqrt(Float64(Float64(F * -4.0) / A)) * (sqrt(2.0) ^ 2.0))); elseif (B_m <= 8.2e-26) tmp = Float64(sqrt(Float64(Float64(F * t_0) * Float64(C * 4.0))) / Float64(-t_0)); else tmp = Float64(Float64(sqrt(Float64(C + hypot(C, B_m))) * sqrt(F)) * Float64(exp(Float64(log(2.0) * 0.5)) / Float64(-B_m))); end return 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[(B$95$m * B$95$m + N[(A * N[(-4.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.35e-262], N[(0.25 * N[(N[Sqrt[N[(N[(F * -4.0), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[2.0], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 8.2e-26], N[(N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(C * 4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$0)), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(N[Log[2.0], $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $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 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(-4 \cdot C\right)\right)\\
\mathbf{if}\;B\_m \leq 1.35 \cdot 10^{-262}:\\
\;\;\;\;0.25 \cdot \left(\sqrt{\frac{F \cdot -4}{A}} \cdot {\left(\sqrt{2}\right)}^{2}\right)\\
\mathbf{elif}\;B\_m \leq 8.2 \cdot 10^{-26}:\\
\;\;\;\;\frac{\sqrt{\left(F \cdot t\_0\right) \cdot \left(C \cdot 4\right)}}{-t\_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(C, B\_m\right)} \cdot \sqrt{F}\right) \cdot \frac{e^{\log 2 \cdot 0.5}}{-B\_m}\\
\end{array}
\end{array}
if B < 1.3500000000000001e-262Initial program 17.1%
Simplified23.3%
add-cube-cbrt23.2%
pow323.2%
Applied egg-rr23.2%
Taylor expanded in C around inf 13.6%
rem-cube-cbrt13.7%
Simplified13.7%
if 1.3500000000000001e-262 < B < 8.1999999999999997e-26Initial program 24.6%
Simplified29.0%
Taylor expanded in A around -inf 22.0%
*-commutative22.0%
Simplified22.0%
if 8.1999999999999997e-26 < B Initial program 12.4%
Taylor expanded in A around 0 21.7%
mul-1-neg21.7%
*-commutative21.7%
*-commutative21.7%
+-commutative21.7%
unpow221.7%
unpow221.7%
hypot-define49.2%
Simplified49.2%
sqrt-prod66.6%
Applied egg-rr66.6%
pow1/266.6%
pow-to-exp66.7%
Applied egg-rr66.7%
Final simplification30.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 (fma B_m B_m (* A (* -4.0 C)))))
(if (<= B_m 1.85e-262)
(* 0.25 (* (sqrt (/ (* F -4.0) A)) (pow (sqrt 2.0) 2.0)))
(if (<= B_m 2e-25)
(/ (sqrt (* (* F t_0) (* C 4.0))) (- t_0))
(* (* (sqrt (+ C (hypot C B_m))) (sqrt F)) (/ (- (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 = fma(B_m, B_m, (A * (-4.0 * C)));
double tmp;
if (B_m <= 1.85e-262) {
tmp = 0.25 * (sqrt(((F * -4.0) / A)) * pow(sqrt(2.0), 2.0));
} else if (B_m <= 2e-25) {
tmp = sqrt(((F * t_0) * (C * 4.0))) / -t_0;
} else {
tmp = (sqrt((C + hypot(C, B_m))) * sqrt(F)) * (-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 = fma(B_m, B_m, Float64(A * Float64(-4.0 * C))) tmp = 0.0 if (B_m <= 1.85e-262) tmp = Float64(0.25 * Float64(sqrt(Float64(Float64(F * -4.0) / A)) * (sqrt(2.0) ^ 2.0))); elseif (B_m <= 2e-25) tmp = Float64(sqrt(Float64(Float64(F * t_0) * Float64(C * 4.0))) / Float64(-t_0)); else tmp = Float64(Float64(sqrt(Float64(C + hypot(C, B_m))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / B_m)); end return 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[(B$95$m * B$95$m + N[(A * N[(-4.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.85e-262], N[(0.25 * N[(N[Sqrt[N[(N[(F * -4.0), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[2.0], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 2e-25], N[(N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(C * 4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$0)), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 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|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(-4 \cdot C\right)\right)\\
\mathbf{if}\;B\_m \leq 1.85 \cdot 10^{-262}:\\
\;\;\;\;0.25 \cdot \left(\sqrt{\frac{F \cdot -4}{A}} \cdot {\left(\sqrt{2}\right)}^{2}\right)\\
\mathbf{elif}\;B\_m \leq 2 \cdot 10^{-25}:\\
\;\;\;\;\frac{\sqrt{\left(F \cdot t\_0\right) \cdot \left(C \cdot 4\right)}}{-t\_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(C, B\_m\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B\_m}\\
\end{array}
\end{array}
if B < 1.85e-262Initial program 17.1%
Simplified23.3%
add-cube-cbrt23.2%
pow323.2%
Applied egg-rr23.2%
Taylor expanded in C around inf 13.6%
rem-cube-cbrt13.7%
Simplified13.7%
if 1.85e-262 < B < 2.00000000000000008e-25Initial program 24.6%
Simplified29.0%
Taylor expanded in A around -inf 22.0%
*-commutative22.0%
Simplified22.0%
if 2.00000000000000008e-25 < B Initial program 12.4%
Taylor expanded in A around 0 21.7%
mul-1-neg21.7%
*-commutative21.7%
*-commutative21.7%
+-commutative21.7%
unpow221.7%
unpow221.7%
hypot-define49.2%
Simplified49.2%
sqrt-prod66.6%
Applied egg-rr66.6%
Final simplification30.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 (fma B_m B_m (* A (* -4.0 C)))))
(if (<= B_m 1.85e-262)
(* 0.25 (* (sqrt (/ (* F -4.0) A)) (pow (sqrt 2.0) 2.0)))
(if (<= B_m 8e-24)
(/ (sqrt (* (* F t_0) (* C 4.0))) (- t_0))
(* (/ (sqrt F) (sqrt B_m)) (- (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 = fma(B_m, B_m, (A * (-4.0 * C)));
double tmp;
if (B_m <= 1.85e-262) {
tmp = 0.25 * (sqrt(((F * -4.0) / A)) * pow(sqrt(2.0), 2.0));
} else if (B_m <= 8e-24) {
tmp = sqrt(((F * t_0) * (C * 4.0))) / -t_0;
} else {
tmp = (sqrt(F) / sqrt(B_m)) * -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 = fma(B_m, B_m, Float64(A * Float64(-4.0 * C))) tmp = 0.0 if (B_m <= 1.85e-262) tmp = Float64(0.25 * Float64(sqrt(Float64(Float64(F * -4.0) / A)) * (sqrt(2.0) ^ 2.0))); elseif (B_m <= 8e-24) tmp = Float64(sqrt(Float64(Float64(F * t_0) * Float64(C * 4.0))) / Float64(-t_0)); else tmp = Float64(Float64(sqrt(F) / sqrt(B_m)) * Float64(-sqrt(2.0))); end return 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[(B$95$m * B$95$m + N[(A * N[(-4.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.85e-262], N[(0.25 * N[(N[Sqrt[N[(N[(F * -4.0), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[2.0], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 8e-24], N[(N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(C * 4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$0)), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] / N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision] * (-N[Sqrt[2.0], $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 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(-4 \cdot C\right)\right)\\
\mathbf{if}\;B\_m \leq 1.85 \cdot 10^{-262}:\\
\;\;\;\;0.25 \cdot \left(\sqrt{\frac{F \cdot -4}{A}} \cdot {\left(\sqrt{2}\right)}^{2}\right)\\
\mathbf{elif}\;B\_m \leq 8 \cdot 10^{-24}:\\
\;\;\;\;\frac{\sqrt{\left(F \cdot t\_0\right) \cdot \left(C \cdot 4\right)}}{-t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{F}}{\sqrt{B\_m}} \cdot \left(-\sqrt{2}\right)\\
\end{array}
\end{array}
if B < 1.85e-262Initial program 17.1%
Simplified23.3%
add-cube-cbrt23.2%
pow323.2%
Applied egg-rr23.2%
Taylor expanded in C around inf 13.6%
rem-cube-cbrt13.7%
Simplified13.7%
if 1.85e-262 < B < 7.99999999999999939e-24Initial program 24.6%
Simplified29.0%
Taylor expanded in A around -inf 22.0%
*-commutative22.0%
Simplified22.0%
if 7.99999999999999939e-24 < B Initial program 12.4%
Taylor expanded in B around inf 40.6%
mul-1-neg40.6%
*-commutative40.6%
Simplified40.6%
sqrt-div58.3%
Applied egg-rr58.3%
Final simplification28.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 1.8e-97) (* 0.25 (* (sqrt (/ (* F -4.0) A)) (pow (sqrt 2.0) 2.0))) (* (/ (sqrt F) (sqrt B_m)) (- (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.8e-97) {
tmp = 0.25 * (sqrt(((F * -4.0) / A)) * pow(sqrt(2.0), 2.0));
} else {
tmp = (sqrt(F) / sqrt(B_m)) * -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.8d-97) then
tmp = 0.25d0 * (sqrt(((f * (-4.0d0)) / a)) * (sqrt(2.0d0) ** 2.0d0))
else
tmp = (sqrt(f) / sqrt(b_m)) * -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.8e-97) {
tmp = 0.25 * (Math.sqrt(((F * -4.0) / A)) * Math.pow(Math.sqrt(2.0), 2.0));
} else {
tmp = (Math.sqrt(F) / Math.sqrt(B_m)) * -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.8e-97: tmp = 0.25 * (math.sqrt(((F * -4.0) / A)) * math.pow(math.sqrt(2.0), 2.0)) else: tmp = (math.sqrt(F) / math.sqrt(B_m)) * -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.8e-97) tmp = Float64(0.25 * Float64(sqrt(Float64(Float64(F * -4.0) / A)) * (sqrt(2.0) ^ 2.0))); else tmp = Float64(Float64(sqrt(F) / sqrt(B_m)) * Float64(-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.8e-97)
tmp = 0.25 * (sqrt(((F * -4.0) / A)) * (sqrt(2.0) ^ 2.0));
else
tmp = (sqrt(F) / sqrt(B_m)) * -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.8e-97], N[(0.25 * N[(N[Sqrt[N[(N[(F * -4.0), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[2.0], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] / N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision] * (-N[Sqrt[2.0], $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.8 \cdot 10^{-97}:\\
\;\;\;\;0.25 \cdot \left(\sqrt{\frac{F \cdot -4}{A}} \cdot {\left(\sqrt{2}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{F}}{\sqrt{B\_m}} \cdot \left(-\sqrt{2}\right)\\
\end{array}
\end{array}
if B < 1.79999999999999999e-97Initial program 18.6%
Simplified24.5%
add-cube-cbrt24.3%
pow324.3%
Applied egg-rr24.3%
Taylor expanded in C around inf 13.6%
rem-cube-cbrt13.7%
Simplified13.7%
if 1.79999999999999999e-97 < B Initial program 14.6%
Taylor expanded in B around inf 35.9%
mul-1-neg35.9%
*-commutative35.9%
Simplified35.9%
sqrt-div52.4%
Applied egg-rr52.4%
Final simplification26.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 (<= F 5.8e+66) (/ (sqrt (* (+ C (hypot B_m C)) (* F 2.0))) (- B_m)) (* (/ (sqrt F) (sqrt B_m)) (- (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 (F <= 5.8e+66) {
tmp = sqrt(((C + hypot(B_m, C)) * (F * 2.0))) / -B_m;
} else {
tmp = (sqrt(F) / sqrt(B_m)) * -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 (F <= 5.8e+66) {
tmp = Math.sqrt(((C + Math.hypot(B_m, C)) * (F * 2.0))) / -B_m;
} else {
tmp = (Math.sqrt(F) / Math.sqrt(B_m)) * -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 F <= 5.8e+66: tmp = math.sqrt(((C + math.hypot(B_m, C)) * (F * 2.0))) / -B_m else: tmp = (math.sqrt(F) / math.sqrt(B_m)) * -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 (F <= 5.8e+66) tmp = Float64(sqrt(Float64(Float64(C + hypot(B_m, C)) * Float64(F * 2.0))) / Float64(-B_m)); else tmp = Float64(Float64(sqrt(F) / sqrt(B_m)) * Float64(-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 (F <= 5.8e+66)
tmp = sqrt(((C + hypot(B_m, C)) * (F * 2.0))) / -B_m;
else
tmp = (sqrt(F) / sqrt(B_m)) * -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[F, 5.8e+66], N[(N[Sqrt[N[(N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] * N[(F * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] / N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision] * (-N[Sqrt[2.0], $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}\;F \leq 5.8 \cdot 10^{+66}:\\
\;\;\;\;\frac{\sqrt{\left(C + \mathsf{hypot}\left(B\_m, C\right)\right) \cdot \left(F \cdot 2\right)}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{F}}{\sqrt{B\_m}} \cdot \left(-\sqrt{2}\right)\\
\end{array}
\end{array}
if F < 5.79999999999999972e66Initial program 22.2%
Taylor expanded in A around 0 12.1%
mul-1-neg12.1%
*-commutative12.1%
*-commutative12.1%
+-commutative12.1%
unpow212.1%
unpow212.1%
hypot-define26.5%
Simplified26.5%
sqrt-prod26.5%
Applied egg-rr26.5%
neg-sub026.5%
associate-*r/26.5%
Applied egg-rr26.6%
neg-sub026.6%
distribute-neg-frac226.6%
*-commutative26.6%
*-commutative26.6%
associate-*l*26.6%
hypot-undefine12.1%
unpow212.1%
unpow212.1%
+-commutative12.1%
unpow212.1%
unpow212.1%
hypot-undefine26.6%
Simplified26.6%
if 5.79999999999999972e66 < F Initial program 10.6%
Taylor expanded in B around inf 12.8%
mul-1-neg12.8%
*-commutative12.8%
Simplified12.8%
sqrt-div14.9%
Applied egg-rr14.9%
Final simplification21.7%
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 (<= F 2.1e+56) (/ (sqrt (* (+ C (hypot B_m C)) (* F 2.0))) (- B_m)) (- (pow (* 2.0 (/ F B_m)) 0.5))))
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 (F <= 2.1e+56) {
tmp = sqrt(((C + hypot(B_m, C)) * (F * 2.0))) / -B_m;
} else {
tmp = -pow((2.0 * (F / B_m)), 0.5);
}
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 (F <= 2.1e+56) {
tmp = Math.sqrt(((C + Math.hypot(B_m, C)) * (F * 2.0))) / -B_m;
} else {
tmp = -Math.pow((2.0 * (F / B_m)), 0.5);
}
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 F <= 2.1e+56: tmp = math.sqrt(((C + math.hypot(B_m, C)) * (F * 2.0))) / -B_m else: tmp = -math.pow((2.0 * (F / B_m)), 0.5) 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 (F <= 2.1e+56) tmp = Float64(sqrt(Float64(Float64(C + hypot(B_m, C)) * Float64(F * 2.0))) / Float64(-B_m)); else tmp = Float64(-(Float64(2.0 * Float64(F / B_m)) ^ 0.5)); 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 (F <= 2.1e+56)
tmp = sqrt(((C + hypot(B_m, C)) * (F * 2.0))) / -B_m;
else
tmp = -((2.0 * (F / B_m)) ^ 0.5);
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[F, 2.1e+56], N[(N[Sqrt[N[(N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] * N[(F * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], (-N[Power[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision], 0.5], $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}\;F \leq 2.1 \cdot 10^{+56}:\\
\;\;\;\;\frac{\sqrt{\left(C + \mathsf{hypot}\left(B\_m, C\right)\right) \cdot \left(F \cdot 2\right)}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;-{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5}\\
\end{array}
\end{array}
if F < 2.10000000000000017e56Initial program 22.8%
Taylor expanded in A around 0 11.8%
mul-1-neg11.8%
*-commutative11.8%
*-commutative11.8%
+-commutative11.8%
unpow211.8%
unpow211.8%
hypot-define26.7%
Simplified26.7%
sqrt-prod26.7%
Applied egg-rr26.7%
neg-sub026.7%
associate-*r/26.7%
Applied egg-rr26.7%
neg-sub026.7%
distribute-neg-frac226.7%
*-commutative26.7%
*-commutative26.7%
associate-*l*26.8%
hypot-undefine11.8%
unpow211.8%
unpow211.8%
+-commutative11.8%
unpow211.8%
unpow211.8%
hypot-undefine26.8%
Simplified26.8%
if 2.10000000000000017e56 < F Initial program 10.3%
Taylor expanded in B around inf 13.2%
mul-1-neg13.2%
*-commutative13.2%
Simplified13.2%
*-commutative13.2%
pow1/213.5%
pow1/213.5%
pow-prod-down13.6%
Applied egg-rr13.6%
Final simplification21.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 (<= F 1.9e+56) (/ (sqrt (* 2.0 (* F (+ C (hypot C B_m))))) (- B_m)) (- (pow (* 2.0 (/ F B_m)) 0.5))))
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 (F <= 1.9e+56) {
tmp = sqrt((2.0 * (F * (C + hypot(C, B_m))))) / -B_m;
} else {
tmp = -pow((2.0 * (F / B_m)), 0.5);
}
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 (F <= 1.9e+56) {
tmp = Math.sqrt((2.0 * (F * (C + Math.hypot(C, B_m))))) / -B_m;
} else {
tmp = -Math.pow((2.0 * (F / B_m)), 0.5);
}
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 F <= 1.9e+56: tmp = math.sqrt((2.0 * (F * (C + math.hypot(C, B_m))))) / -B_m else: tmp = -math.pow((2.0 * (F / B_m)), 0.5) 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 (F <= 1.9e+56) tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C + hypot(C, B_m))))) / Float64(-B_m)); else tmp = Float64(-(Float64(2.0 * Float64(F / B_m)) ^ 0.5)); 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 (F <= 1.9e+56)
tmp = sqrt((2.0 * (F * (C + hypot(C, B_m))))) / -B_m;
else
tmp = -((2.0 * (F / B_m)) ^ 0.5);
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[F, 1.9e+56], N[(N[Sqrt[N[(2.0 * N[(F * N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], (-N[Power[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision], 0.5], $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}\;F \leq 1.9 \cdot 10^{+56}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;-{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5}\\
\end{array}
\end{array}
if F < 1.89999999999999998e56Initial program 22.8%
Taylor expanded in A around 0 11.8%
mul-1-neg11.8%
*-commutative11.8%
*-commutative11.8%
+-commutative11.8%
unpow211.8%
unpow211.8%
hypot-define26.7%
Simplified26.7%
neg-sub026.7%
associate-*r/26.7%
pow1/226.7%
pow1/226.7%
pow-prod-down26.8%
Applied egg-rr26.8%
neg-sub026.8%
distribute-neg-frac226.8%
unpow1/226.7%
Simplified26.7%
if 1.89999999999999998e56 < F Initial program 10.3%
Taylor expanded in B around inf 13.2%
mul-1-neg13.2%
*-commutative13.2%
Simplified13.2%
*-commutative13.2%
pow1/213.5%
pow1/213.5%
pow-prod-down13.6%
Applied egg-rr13.6%
Final simplification21.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 (<= F 2.1e+56) (* (sqrt (* F (+ B_m C))) (/ (- (sqrt 2.0)) B_m)) (- (pow (* 2.0 (/ F B_m)) 0.5))))
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 (F <= 2.1e+56) {
tmp = sqrt((F * (B_m + C))) * (-sqrt(2.0) / B_m);
} else {
tmp = -pow((2.0 * (F / B_m)), 0.5);
}
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 (f <= 2.1d+56) then
tmp = sqrt((f * (b_m + c))) * (-sqrt(2.0d0) / b_m)
else
tmp = -((2.0d0 * (f / b_m)) ** 0.5d0)
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 (F <= 2.1e+56) {
tmp = Math.sqrt((F * (B_m + C))) * (-Math.sqrt(2.0) / B_m);
} else {
tmp = -Math.pow((2.0 * (F / B_m)), 0.5);
}
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 F <= 2.1e+56: tmp = math.sqrt((F * (B_m + C))) * (-math.sqrt(2.0) / B_m) else: tmp = -math.pow((2.0 * (F / B_m)), 0.5) 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 (F <= 2.1e+56) tmp = Float64(sqrt(Float64(F * Float64(B_m + C))) * Float64(Float64(-sqrt(2.0)) / B_m)); else tmp = Float64(-(Float64(2.0 * Float64(F / B_m)) ^ 0.5)); 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 (F <= 2.1e+56)
tmp = sqrt((F * (B_m + C))) * (-sqrt(2.0) / B_m);
else
tmp = -((2.0 * (F / B_m)) ^ 0.5);
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[F, 2.1e+56], N[(N[Sqrt[N[(F * N[(B$95$m + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision]), $MachinePrecision], (-N[Power[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision], 0.5], $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}\;F \leq 2.1 \cdot 10^{+56}:\\
\;\;\;\;\sqrt{F \cdot \left(B\_m + C\right)} \cdot \frac{-\sqrt{2}}{B\_m}\\
\mathbf{else}:\\
\;\;\;\;-{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5}\\
\end{array}
\end{array}
if F < 2.10000000000000017e56Initial program 22.8%
Taylor expanded in A around 0 11.8%
mul-1-neg11.8%
*-commutative11.8%
*-commutative11.8%
+-commutative11.8%
unpow211.8%
unpow211.8%
hypot-define26.7%
Simplified26.7%
Taylor expanded in F around 0 11.8%
mul-1-neg11.8%
Simplified11.8%
Taylor expanded in B around inf 23.0%
if 2.10000000000000017e56 < F Initial program 10.3%
Taylor expanded in B around inf 13.2%
mul-1-neg13.2%
*-commutative13.2%
Simplified13.2%
*-commutative13.2%
pow1/213.5%
pow1/213.5%
pow-prod-down13.6%
Applied egg-rr13.6%
Final simplification18.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 (if (<= F 3.4e-15) (* (/ (sqrt 2.0) B_m) (- (sqrt (* B_m F)))) (- (sqrt (/ (* F 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 tmp;
if (F <= 3.4e-15) {
tmp = (sqrt(2.0) / B_m) * -sqrt((B_m * F));
} else {
tmp = -sqrt(((F * 2.0) / 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 (f <= 3.4d-15) then
tmp = (sqrt(2.0d0) / b_m) * -sqrt((b_m * f))
else
tmp = -sqrt(((f * 2.0d0) / 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 (F <= 3.4e-15) {
tmp = (Math.sqrt(2.0) / B_m) * -Math.sqrt((B_m * F));
} else {
tmp = -Math.sqrt(((F * 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): tmp = 0 if F <= 3.4e-15: tmp = (math.sqrt(2.0) / B_m) * -math.sqrt((B_m * F)) else: tmp = -math.sqrt(((F * 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) tmp = 0.0 if (F <= 3.4e-15) tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-sqrt(Float64(B_m * F)))); else tmp = Float64(-sqrt(Float64(Float64(F * 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)
tmp = 0.0;
if (F <= 3.4e-15)
tmp = (sqrt(2.0) / B_m) * -sqrt((B_m * F));
else
tmp = -sqrt(((F * 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_] := If[LessEqual[F, 3.4e-15], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], (-N[Sqrt[N[(N[(F * 2.0), $MachinePrecision] / B$95$m), $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}\;F \leq 3.4 \cdot 10^{-15}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(-\sqrt{B\_m \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{F \cdot 2}{B\_m}}\\
\end{array}
\end{array}
if F < 3.4e-15Initial program 23.0%
Taylor expanded in A around 0 9.4%
mul-1-neg9.4%
*-commutative9.4%
*-commutative9.4%
+-commutative9.4%
unpow29.4%
unpow29.4%
hypot-define24.1%
Simplified24.1%
Taylor expanded in C around 0 22.2%
if 3.4e-15 < F Initial program 12.4%
Taylor expanded in B around inf 16.2%
mul-1-neg16.2%
*-commutative16.2%
Simplified16.2%
*-commutative16.2%
pow1/216.5%
pow1/216.5%
pow-prod-down16.6%
Applied egg-rr16.6%
unpow1/216.3%
Simplified16.3%
associate-*l/16.3%
Applied egg-rr16.3%
Final simplification19.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 (<= C 9e+163) (- (sqrt (* 2.0 (fabs (/ F B_m))))) (* (sqrt (* F C)) (/ -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 tmp;
if (C <= 9e+163) {
tmp = -sqrt((2.0 * fabs((F / B_m))));
} else {
tmp = sqrt((F * C)) * (-2.0 / 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 <= 9d+163) then
tmp = -sqrt((2.0d0 * abs((f / b_m))))
else
tmp = sqrt((f * c)) * ((-2.0d0) / 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 <= 9e+163) {
tmp = -Math.sqrt((2.0 * Math.abs((F / B_m))));
} else {
tmp = Math.sqrt((F * C)) * (-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): tmp = 0 if C <= 9e+163: tmp = -math.sqrt((2.0 * math.fabs((F / B_m)))) else: tmp = math.sqrt((F * C)) * (-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) tmp = 0.0 if (C <= 9e+163) tmp = Float64(-sqrt(Float64(2.0 * abs(Float64(F / B_m))))); else tmp = Float64(sqrt(Float64(F * C)) * Float64(-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)
tmp = 0.0;
if (C <= 9e+163)
tmp = -sqrt((2.0 * abs((F / B_m))));
else
tmp = sqrt((F * C)) * (-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_] := If[LessEqual[C, 9e+163], (-N[Sqrt[N[(2.0 * N[Abs[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] * N[(-2.0 / B$95$m), $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 9 \cdot 10^{+163}:\\
\;\;\;\;-\sqrt{2 \cdot \left|\frac{F}{B\_m}\right|}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{F \cdot C} \cdot \frac{-2}{B\_m}\\
\end{array}
\end{array}
if C < 8.99999999999999976e163Initial program 19.0%
Taylor expanded in B around inf 14.7%
mul-1-neg14.7%
*-commutative14.7%
Simplified14.7%
*-commutative14.7%
pow1/214.9%
pow1/214.9%
pow-prod-down15.0%
Applied egg-rr15.0%
unpow1/214.8%
Simplified14.8%
add-sqr-sqrt14.8%
sqrt-unprod20.0%
pow220.0%
Applied egg-rr20.0%
unpow220.0%
rem-sqrt-square32.0%
Simplified32.0%
if 8.99999999999999976e163 < C Initial program 1.8%
Taylor expanded in A around 0 1.9%
mul-1-neg1.9%
*-commutative1.9%
*-commutative1.9%
+-commutative1.9%
unpow21.9%
unpow21.9%
hypot-define21.5%
Simplified21.5%
sqrt-prod33.1%
Applied egg-rr33.1%
Taylor expanded in C around inf 14.5%
mul-1-neg14.5%
*-commutative14.5%
distribute-rgt-neg-in14.5%
*-commutative14.5%
unpow214.5%
rem-square-sqrt14.7%
distribute-neg-frac14.7%
metadata-eval14.7%
Simplified14.7%
Final simplification30.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 (<= C 5.8e+164) (- (sqrt (/ (* F 2.0) B_m))) (* (sqrt (* F C)) (/ -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 tmp;
if (C <= 5.8e+164) {
tmp = -sqrt(((F * 2.0) / B_m));
} else {
tmp = sqrt((F * C)) * (-2.0 / 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 <= 5.8d+164) then
tmp = -sqrt(((f * 2.0d0) / b_m))
else
tmp = sqrt((f * c)) * ((-2.0d0) / 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 <= 5.8e+164) {
tmp = -Math.sqrt(((F * 2.0) / B_m));
} else {
tmp = Math.sqrt((F * C)) * (-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): tmp = 0 if C <= 5.8e+164: tmp = -math.sqrt(((F * 2.0) / B_m)) else: tmp = math.sqrt((F * C)) * (-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) tmp = 0.0 if (C <= 5.8e+164) tmp = Float64(-sqrt(Float64(Float64(F * 2.0) / B_m))); else tmp = Float64(sqrt(Float64(F * C)) * Float64(-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)
tmp = 0.0;
if (C <= 5.8e+164)
tmp = -sqrt(((F * 2.0) / B_m));
else
tmp = sqrt((F * C)) * (-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_] := If[LessEqual[C, 5.8e+164], (-N[Sqrt[N[(N[(F * 2.0), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision]), N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] * N[(-2.0 / B$95$m), $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 5.8 \cdot 10^{+164}:\\
\;\;\;\;-\sqrt{\frac{F \cdot 2}{B\_m}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{F \cdot C} \cdot \frac{-2}{B\_m}\\
\end{array}
\end{array}
if C < 5.7999999999999997e164Initial program 19.0%
Taylor expanded in B around inf 14.7%
mul-1-neg14.7%
*-commutative14.7%
Simplified14.7%
*-commutative14.7%
pow1/214.9%
pow1/214.9%
pow-prod-down15.0%
Applied egg-rr15.0%
unpow1/214.8%
Simplified14.8%
associate-*l/14.8%
Applied egg-rr14.8%
if 5.7999999999999997e164 < C Initial program 1.8%
Taylor expanded in A around 0 1.9%
mul-1-neg1.9%
*-commutative1.9%
*-commutative1.9%
+-commutative1.9%
unpow21.9%
unpow21.9%
hypot-define21.5%
Simplified21.5%
sqrt-prod33.1%
Applied egg-rr33.1%
Taylor expanded in C around inf 14.5%
mul-1-neg14.5%
*-commutative14.5%
distribute-rgt-neg-in14.5%
*-commutative14.5%
unpow214.5%
rem-square-sqrt14.7%
distribute-neg-frac14.7%
metadata-eval14.7%
Simplified14.7%
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 (/ (* F 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) {
return -sqrt(((F * 2.0) / 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(((f * 2.0d0) / 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(((F * 2.0) / 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(((F * 2.0) / 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(Float64(F * 2.0) / 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(((F * 2.0) / 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[Sqrt[N[(N[(F * 2.0), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision])
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
-\sqrt{\frac{F \cdot 2}{B\_m}}
\end{array}
Initial program 17.3%
Taylor expanded in B around inf 13.8%
mul-1-neg13.8%
*-commutative13.8%
Simplified13.8%
*-commutative13.8%
pow1/214.0%
pow1/214.0%
pow-prod-down14.0%
Applied egg-rr14.0%
unpow1/213.9%
Simplified13.9%
associate-*l/13.9%
Applied egg-rr13.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 (- (sqrt (* 2.0 (/ F 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((2.0 * (F / 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((2.0d0 * (f / 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((2.0 * (F / 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((2.0 * (F / 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(2.0 * Float64(F / 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((2.0 * (F / 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[Sqrt[N[(2.0 * N[(F / 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])\\
\\
-\sqrt{2 \cdot \frac{F}{B\_m}}
\end{array}
Initial program 17.3%
Taylor expanded in B around inf 13.8%
mul-1-neg13.8%
*-commutative13.8%
Simplified13.8%
*-commutative13.8%
pow1/214.0%
pow1/214.0%
pow-prod-down14.0%
Applied egg-rr14.0%
unpow1/213.9%
Simplified13.9%
Final simplification13.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 (sqrt (* 2.0 (/ F 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((2.0 * (F / 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((2.0d0 * (f / 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((2.0 * (F / 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((2.0 * (F / 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 sqrt(Float64(2.0 * Float64(F / 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((2.0 * (F / 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[Sqrt[N[(2.0 * N[(F / 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])\\
\\
\sqrt{2 \cdot \frac{F}{B\_m}}
\end{array}
Initial program 17.3%
Taylor expanded in B around inf 13.8%
mul-1-neg13.8%
*-commutative13.8%
Simplified13.8%
*-commutative13.8%
pow1/214.0%
pow1/214.0%
pow-prod-down14.0%
Applied egg-rr14.0%
unpow1/213.9%
Simplified13.9%
*-commutative13.9%
add-sqr-sqrt0.6%
sqrt-unprod1.7%
sqr-neg1.7%
add-sqr-sqrt1.7%
*-un-lft-identity1.7%
Applied egg-rr1.7%
*-lft-identity1.7%
*-commutative1.7%
Simplified1.7%
Final simplification1.7%
herbie shell --seed 2024163
(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))))