
(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 (* (* 4.0 A) C)))
(if (<= (pow B_m 2.0) 2e+17)
(/
(sqrt
(*
(* 2.0 (* (- (pow B_m 2.0) t_0) F))
(+ A (+ A (* -0.5 (/ (pow B_m 2.0) C))))))
(- t_0 (pow B_m 2.0)))
(/
-1.0
(* (/ B_m (sqrt 2.0)) (sqrt (/ (/ 1.0 F) (- A (hypot B_m A)))))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double tmp;
if (pow(B_m, 2.0) <= 2e+17) {
tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (A + (A + (-0.5 * (pow(B_m, 2.0) / C)))))) / (t_0 - pow(B_m, 2.0));
} else {
tmp = -1.0 / ((B_m / sqrt(2.0)) * sqrt(((1.0 / F) / (A - hypot(B_m, A)))));
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double tmp;
if (Math.pow(B_m, 2.0) <= 2e+17) {
tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (A + (A + (-0.5 * (Math.pow(B_m, 2.0) / C)))))) / (t_0 - Math.pow(B_m, 2.0));
} else {
tmp = -1.0 / ((B_m / Math.sqrt(2.0)) * Math.sqrt(((1.0 / F) / (A - Math.hypot(B_m, A)))));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (4.0 * A) * C tmp = 0 if math.pow(B_m, 2.0) <= 2e+17: tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (A + (A + (-0.5 * (math.pow(B_m, 2.0) / C)))))) / (t_0 - math.pow(B_m, 2.0)) else: tmp = -1.0 / ((B_m / math.sqrt(2.0)) * math.sqrt(((1.0 / F) / (A - math.hypot(B_m, A))))) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) tmp = 0.0 if ((B_m ^ 2.0) <= 2e+17) tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(A + Float64(A + Float64(-0.5 * Float64((B_m ^ 2.0) / C)))))) / Float64(t_0 - (B_m ^ 2.0))); else tmp = Float64(-1.0 / Float64(Float64(B_m / sqrt(2.0)) * sqrt(Float64(Float64(1.0 / F) / Float64(A - hypot(B_m, A)))))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (4.0 * A) * C;
tmp = 0.0;
if ((B_m ^ 2.0) <= 2e+17)
tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (A + (A + (-0.5 * ((B_m ^ 2.0) / C)))))) / (t_0 - (B_m ^ 2.0));
else
tmp = -1.0 / ((B_m / sqrt(2.0)) * sqrt(((1.0 / F) / (A - hypot(B_m, A)))));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+17], N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(A + N[(A + N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / F), $MachinePrecision] / N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{+17}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(A + \left(A + -0.5 \cdot \frac{{B\_m}^{2}}{C}\right)\right)}}{t\_0 - {B\_m}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{B\_m}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{A - \mathsf{hypot}\left(B\_m, A\right)}}}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 2e17Initial program 25.4%
Taylor expanded in C around inf 25.9%
mul-1-neg25.9%
associate--l+25.9%
Simplified25.9%
if 2e17 < (pow.f64 B #s(literal 2 binary64)) Initial program 15.4%
Taylor expanded in C around 0 13.9%
mul-1-neg13.9%
+-commutative13.9%
unpow213.9%
unpow213.9%
hypot-define28.1%
Simplified28.1%
add-exp-log24.9%
associate-*l/24.9%
pow1/224.9%
pow1/224.9%
pow-prod-down24.9%
Applied egg-rr24.9%
rem-exp-log28.2%
add-sqr-sqrt26.7%
sqrt-unprod25.0%
sqr-neg25.0%
sqrt-unprod24.5%
add-sqr-sqrt25.8%
clear-num25.8%
add-sqr-sqrt24.5%
sqrt-unprod25.0%
sqr-neg25.0%
sqrt-unprod26.7%
add-sqr-sqrt28.2%
pow1/228.2%
*-commutative28.2%
*-commutative28.2%
associate-*l*28.2%
Applied egg-rr28.2%
Taylor expanded in F around 0 13.8%
associate-/r*13.9%
+-commutative13.9%
unpow213.9%
unpow213.9%
hypot-undefine27.8%
Simplified27.8%
Final simplification26.8%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
(if (<= (pow B_m 2.0) 2e+17)
(/
(sqrt (* (* F t_0) (* 2.0 (+ A (+ A (* -0.5 (/ (pow B_m 2.0) C)))))))
(- t_0))
(/
-1.0
(* (/ B_m (sqrt 2.0)) (sqrt (/ (/ 1.0 F) (- A (hypot B_m A)))))))))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 * (C * -4.0)));
double tmp;
if (pow(B_m, 2.0) <= 2e+17) {
tmp = sqrt(((F * t_0) * (2.0 * (A + (A + (-0.5 * (pow(B_m, 2.0) / C))))))) / -t_0;
} else {
tmp = -1.0 / ((B_m / sqrt(2.0)) * sqrt(((1.0 / F) / (A - hypot(B_m, A)))));
}
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(C * -4.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 2e+17) tmp = Float64(sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + Float64(A + Float64(-0.5 * Float64((B_m ^ 2.0) / C))))))) / Float64(-t_0)); else tmp = Float64(-1.0 / Float64(Float64(B_m / sqrt(2.0)) * sqrt(Float64(Float64(1.0 / F) / Float64(A - hypot(B_m, A)))))); 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[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+17], N[(N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(A + N[(A + N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$0)), $MachinePrecision], N[(-1.0 / N[(N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / F), $MachinePrecision] / N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{+17}:\\
\;\;\;\;\frac{\sqrt{\left(F \cdot t\_0\right) \cdot \left(2 \cdot \left(A + \left(A + -0.5 \cdot \frac{{B\_m}^{2}}{C}\right)\right)\right)}}{-t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{B\_m}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{A - \mathsf{hypot}\left(B\_m, A\right)}}}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 2e17Initial program 25.4%
Simplified30.3%
Taylor expanded in C around inf 25.9%
mul-1-neg25.9%
Simplified25.9%
if 2e17 < (pow.f64 B #s(literal 2 binary64)) Initial program 15.4%
Taylor expanded in C around 0 13.9%
mul-1-neg13.9%
+-commutative13.9%
unpow213.9%
unpow213.9%
hypot-define28.1%
Simplified28.1%
add-exp-log24.9%
associate-*l/24.9%
pow1/224.9%
pow1/224.9%
pow-prod-down24.9%
Applied egg-rr24.9%
rem-exp-log28.2%
add-sqr-sqrt26.7%
sqrt-unprod25.0%
sqr-neg25.0%
sqrt-unprod24.5%
add-sqr-sqrt25.8%
clear-num25.8%
add-sqr-sqrt24.5%
sqrt-unprod25.0%
sqr-neg25.0%
sqrt-unprod26.7%
add-sqr-sqrt28.2%
pow1/228.2%
*-commutative28.2%
*-commutative28.2%
associate-*l*28.2%
Applied egg-rr28.2%
Taylor expanded in F around 0 13.8%
associate-/r*13.9%
+-commutative13.9%
unpow213.9%
unpow213.9%
hypot-undefine27.8%
Simplified27.8%
Final simplification26.8%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* (* 4.0 A) C)))
(if (<= (pow B_m 2.0) 5e-291)
(/ (sqrt (* A (* 2.0 (* (- (pow B_m 2.0) t_0) F)))) (- t_0 (* B_m B_m)))
(if (<= (pow B_m 2.0) 1e-126)
(* (sqrt (* -0.5 (/ (* (pow B_m 2.0) F) C))) (/ (sqrt 2.0) (- B_m)))
(/
-1.0
(* (/ B_m (sqrt 2.0)) (sqrt (/ (/ 1.0 F) (- A (hypot B_m A))))))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double tmp;
if (pow(B_m, 2.0) <= 5e-291) {
tmp = sqrt((A * (2.0 * ((pow(B_m, 2.0) - t_0) * F)))) / (t_0 - (B_m * B_m));
} else if (pow(B_m, 2.0) <= 1e-126) {
tmp = sqrt((-0.5 * ((pow(B_m, 2.0) * F) / C))) * (sqrt(2.0) / -B_m);
} else {
tmp = -1.0 / ((B_m / sqrt(2.0)) * sqrt(((1.0 / F) / (A - hypot(B_m, A)))));
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double tmp;
if (Math.pow(B_m, 2.0) <= 5e-291) {
tmp = Math.sqrt((A * (2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)))) / (t_0 - (B_m * B_m));
} else if (Math.pow(B_m, 2.0) <= 1e-126) {
tmp = Math.sqrt((-0.5 * ((Math.pow(B_m, 2.0) * F) / C))) * (Math.sqrt(2.0) / -B_m);
} else {
tmp = -1.0 / ((B_m / Math.sqrt(2.0)) * Math.sqrt(((1.0 / F) / (A - Math.hypot(B_m, A)))));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (4.0 * A) * C tmp = 0 if math.pow(B_m, 2.0) <= 5e-291: tmp = math.sqrt((A * (2.0 * ((math.pow(B_m, 2.0) - t_0) * F)))) / (t_0 - (B_m * B_m)) elif math.pow(B_m, 2.0) <= 1e-126: tmp = math.sqrt((-0.5 * ((math.pow(B_m, 2.0) * F) / C))) * (math.sqrt(2.0) / -B_m) else: tmp = -1.0 / ((B_m / math.sqrt(2.0)) * math.sqrt(((1.0 / F) / (A - math.hypot(B_m, A))))) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) tmp = 0.0 if ((B_m ^ 2.0) <= 5e-291) tmp = Float64(sqrt(Float64(A * Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)))) / Float64(t_0 - Float64(B_m * B_m))); elseif ((B_m ^ 2.0) <= 1e-126) tmp = Float64(sqrt(Float64(-0.5 * Float64(Float64((B_m ^ 2.0) * F) / C))) * Float64(sqrt(2.0) / Float64(-B_m))); else tmp = Float64(-1.0 / Float64(Float64(B_m / sqrt(2.0)) * sqrt(Float64(Float64(1.0 / F) / Float64(A - hypot(B_m, A)))))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (4.0 * A) * C;
tmp = 0.0;
if ((B_m ^ 2.0) <= 5e-291)
tmp = sqrt((A * (2.0 * (((B_m ^ 2.0) - t_0) * F)))) / (t_0 - (B_m * B_m));
elseif ((B_m ^ 2.0) <= 1e-126)
tmp = sqrt((-0.5 * (((B_m ^ 2.0) * F) / C))) * (sqrt(2.0) / -B_m);
else
tmp = -1.0 / ((B_m / sqrt(2.0)) * sqrt(((1.0 / F) / (A - hypot(B_m, A)))));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-291], N[(N[Sqrt[N[(A * N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-126], N[(N[Sqrt[N[(-0.5 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] * F), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / F), $MachinePrecision] / N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{-291}:\\
\;\;\;\;\frac{\sqrt{A \cdot \left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right)}}{t\_0 - B\_m \cdot B\_m}\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{-126}:\\
\;\;\;\;\sqrt{-0.5 \cdot \frac{{B\_m}^{2} \cdot F}{C}} \cdot \frac{\sqrt{2}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{B\_m}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{A - \mathsf{hypot}\left(B\_m, A\right)}}}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 5.0000000000000003e-291Initial program 27.1%
Taylor expanded in B around inf 8.3%
unpow28.3%
Applied egg-rr8.3%
Taylor expanded in A around inf 7.2%
if 5.0000000000000003e-291 < (pow.f64 B #s(literal 2 binary64)) < 9.9999999999999995e-127Initial program 13.8%
Taylor expanded in A around 0 5.3%
mul-1-neg5.3%
unpow25.3%
unpow25.3%
hypot-define5.7%
Simplified5.7%
Taylor expanded in C around inf 14.1%
if 9.9999999999999995e-127 < (pow.f64 B #s(literal 2 binary64)) Initial program 19.4%
Taylor expanded in C around 0 15.0%
mul-1-neg15.0%
+-commutative15.0%
unpow215.0%
unpow215.0%
hypot-define26.0%
Simplified26.0%
add-exp-log23.1%
associate-*l/23.1%
pow1/223.1%
pow1/223.1%
pow-prod-down23.1%
Applied egg-rr23.1%
rem-exp-log26.2%
add-sqr-sqrt24.7%
sqrt-unprod26.6%
sqr-neg26.6%
sqrt-unprod22.1%
add-sqr-sqrt23.5%
clear-num23.5%
add-sqr-sqrt22.1%
sqrt-unprod26.6%
sqr-neg26.6%
sqrt-unprod24.7%
add-sqr-sqrt26.1%
pow1/226.1%
*-commutative26.1%
*-commutative26.1%
associate-*l*26.1%
Applied egg-rr26.1%
Taylor expanded in F around 0 14.9%
associate-/r*14.9%
+-commutative14.9%
unpow214.9%
unpow214.9%
hypot-undefine25.6%
Simplified25.6%
Final simplification19.6%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* (* 4.0 A) C)))
(if (<= (pow B_m 2.0) 1e-11)
(/
(sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_0) F)) (* 2.0 A)))
(- t_0 (pow B_m 2.0)))
(/
-1.0
(* (/ B_m (sqrt 2.0)) (sqrt (/ (/ 1.0 F) (- A (hypot B_m A)))))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double tmp;
if (pow(B_m, 2.0) <= 1e-11) {
tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / (t_0 - pow(B_m, 2.0));
} else {
tmp = -1.0 / ((B_m / sqrt(2.0)) * sqrt(((1.0 / F) / (A - hypot(B_m, A)))));
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double tmp;
if (Math.pow(B_m, 2.0) <= 1e-11) {
tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / (t_0 - Math.pow(B_m, 2.0));
} else {
tmp = -1.0 / ((B_m / Math.sqrt(2.0)) * Math.sqrt(((1.0 / F) / (A - Math.hypot(B_m, A)))));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (4.0 * A) * C tmp = 0 if math.pow(B_m, 2.0) <= 1e-11: tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / (t_0 - math.pow(B_m, 2.0)) else: tmp = -1.0 / ((B_m / math.sqrt(2.0)) * math.sqrt(((1.0 / F) / (A - math.hypot(B_m, A))))) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) tmp = 0.0 if ((B_m ^ 2.0) <= 1e-11) tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(2.0 * A))) / Float64(t_0 - (B_m ^ 2.0))); else tmp = Float64(-1.0 / Float64(Float64(B_m / sqrt(2.0)) * sqrt(Float64(Float64(1.0 / F) / Float64(A - hypot(B_m, A)))))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (4.0 * A) * C;
tmp = 0.0;
if ((B_m ^ 2.0) <= 1e-11)
tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (2.0 * A))) / (t_0 - (B_m ^ 2.0));
else
tmp = -1.0 / ((B_m / sqrt(2.0)) * sqrt(((1.0 / F) / (A - hypot(B_m, A)))));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-11], N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / F), $MachinePrecision] / N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;{B\_m}^{2} \leq 10^{-11}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot A\right)}}{t\_0 - {B\_m}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{B\_m}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{A - \mathsf{hypot}\left(B\_m, A\right)}}}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 9.99999999999999939e-12Initial program 24.6%
Taylor expanded in A around -inf 25.0%
if 9.99999999999999939e-12 < (pow.f64 B #s(literal 2 binary64)) Initial program 16.8%
Taylor expanded in C around 0 14.6%
mul-1-neg14.6%
+-commutative14.6%
unpow214.6%
unpow214.6%
hypot-define27.9%
Simplified27.9%
add-exp-log24.8%
associate-*l/24.8%
pow1/224.8%
pow1/224.8%
pow-prod-down24.8%
Applied egg-rr24.8%
rem-exp-log28.0%
add-sqr-sqrt26.5%
sqrt-unprod25.8%
sqr-neg25.8%
sqrt-unprod23.7%
add-sqr-sqrt25.0%
clear-num25.0%
add-sqr-sqrt23.7%
sqrt-unprod25.8%
sqr-neg25.8%
sqrt-unprod26.5%
add-sqr-sqrt28.0%
pow1/228.0%
*-commutative28.0%
*-commutative28.0%
associate-*l*28.0%
Applied egg-rr28.0%
Taylor expanded in F around 0 14.6%
associate-/r*14.6%
+-commutative14.6%
unpow214.6%
unpow214.6%
hypot-undefine27.6%
Simplified27.6%
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 (<= (pow B_m 2.0) 1e-26)
(/
(sqrt (* -8.0 (* (* A C) (* F (+ A A)))))
(- (fma C (* A -4.0) (pow B_m 2.0))))
(/ -1.0 (* (/ B_m (sqrt 2.0)) (sqrt (/ (/ 1.0 F) (- A (hypot B_m A))))))))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 (pow(B_m, 2.0) <= 1e-26) {
tmp = sqrt((-8.0 * ((A * C) * (F * (A + A))))) / -fma(C, (A * -4.0), pow(B_m, 2.0));
} else {
tmp = -1.0 / ((B_m / sqrt(2.0)) * sqrt(((1.0 / F) / (A - hypot(B_m, A)))));
}
return tmp;
}
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if ((B_m ^ 2.0) <= 1e-26) tmp = Float64(sqrt(Float64(-8.0 * Float64(Float64(A * C) * Float64(F * Float64(A + A))))) / Float64(-fma(C, Float64(A * -4.0), (B_m ^ 2.0)))); else tmp = Float64(-1.0 / Float64(Float64(B_m / sqrt(2.0)) * sqrt(Float64(Float64(1.0 / F) / Float64(A - hypot(B_m, A)))))); 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_] := If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-26], N[(N[Sqrt[N[(-8.0 * N[(N[(A * C), $MachinePrecision] * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-N[(C * N[(A * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], N[(-1.0 / N[(N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / F), $MachinePrecision] / N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;{B\_m}^{2} \leq 10^{-26}:\\
\;\;\;\;\frac{\sqrt{-8 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{-\mathsf{fma}\left(C, A \cdot -4, {B\_m}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{B\_m}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{A - \mathsf{hypot}\left(B\_m, A\right)}}}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 1e-26Initial program 23.0%
Simplified23.5%
Taylor expanded in C around inf 23.4%
associate-*r*23.4%
mul-1-neg23.4%
Simplified23.4%
if 1e-26 < (pow.f64 B #s(literal 2 binary64)) Initial program 18.5%
Taylor expanded in C around 0 15.0%
mul-1-neg15.0%
+-commutative15.0%
unpow215.0%
unpow215.0%
hypot-define27.8%
Simplified27.8%
add-exp-log24.8%
associate-*l/24.8%
pow1/224.8%
pow1/224.8%
pow-prod-down24.8%
Applied egg-rr24.8%
rem-exp-log27.9%
add-sqr-sqrt26.5%
sqrt-unprod25.9%
sqr-neg25.9%
sqrt-unprod23.0%
add-sqr-sqrt24.4%
clear-num24.4%
add-sqr-sqrt23.0%
sqrt-unprod25.8%
sqr-neg25.8%
sqrt-unprod26.5%
add-sqr-sqrt27.9%
pow1/227.9%
*-commutative27.9%
*-commutative27.9%
associate-*l*27.9%
Applied egg-rr27.9%
Taylor expanded in F around 0 14.9%
associate-/r*15.0%
+-commutative15.0%
unpow215.0%
unpow215.0%
hypot-undefine27.5%
Simplified27.5%
Final simplification25.6%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* (* 4.0 A) C)))
(if (<= B_m 6.2e-146)
(/ (sqrt (* A (* 2.0 (* (- (pow B_m 2.0) t_0) F)))) (- t_0 (* B_m B_m)))
(if (<= B_m 1.05e-61)
(* (sqrt (* -0.5 (/ (* (pow B_m 2.0) F) C))) (/ (sqrt 2.0) (- B_m)))
(/ (sqrt (* 2.0 (* F (- A (hypot B_m A))))) (- B_m))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double tmp;
if (B_m <= 6.2e-146) {
tmp = sqrt((A * (2.0 * ((pow(B_m, 2.0) - t_0) * F)))) / (t_0 - (B_m * B_m));
} else if (B_m <= 1.05e-61) {
tmp = sqrt((-0.5 * ((pow(B_m, 2.0) * F) / C))) * (sqrt(2.0) / -B_m);
} else {
tmp = sqrt((2.0 * (F * (A - hypot(B_m, A))))) / -B_m;
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double tmp;
if (B_m <= 6.2e-146) {
tmp = Math.sqrt((A * (2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)))) / (t_0 - (B_m * B_m));
} else if (B_m <= 1.05e-61) {
tmp = Math.sqrt((-0.5 * ((Math.pow(B_m, 2.0) * F) / C))) * (Math.sqrt(2.0) / -B_m);
} else {
tmp = Math.sqrt((2.0 * (F * (A - Math.hypot(B_m, A))))) / -B_m;
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (4.0 * A) * C tmp = 0 if B_m <= 6.2e-146: tmp = math.sqrt((A * (2.0 * ((math.pow(B_m, 2.0) - t_0) * F)))) / (t_0 - (B_m * B_m)) elif B_m <= 1.05e-61: tmp = math.sqrt((-0.5 * ((math.pow(B_m, 2.0) * F) / C))) * (math.sqrt(2.0) / -B_m) else: tmp = math.sqrt((2.0 * (F * (A - math.hypot(B_m, A))))) / -B_m return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) tmp = 0.0 if (B_m <= 6.2e-146) tmp = Float64(sqrt(Float64(A * Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)))) / Float64(t_0 - Float64(B_m * B_m))); elseif (B_m <= 1.05e-61) tmp = Float64(sqrt(Float64(-0.5 * Float64(Float64((B_m ^ 2.0) * F) / C))) * Float64(sqrt(2.0) / Float64(-B_m))); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(B_m, A))))) / Float64(-B_m)); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (4.0 * A) * C;
tmp = 0.0;
if (B_m <= 6.2e-146)
tmp = sqrt((A * (2.0 * (((B_m ^ 2.0) - t_0) * F)))) / (t_0 - (B_m * B_m));
elseif (B_m <= 1.05e-61)
tmp = sqrt((-0.5 * (((B_m ^ 2.0) * F) / C))) * (sqrt(2.0) / -B_m);
else
tmp = sqrt((2.0 * (F * (A - hypot(B_m, A))))) / -B_m;
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[B$95$m, 6.2e-146], N[(N[Sqrt[N[(A * N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 1.05e-61], N[(N[Sqrt[N[(-0.5 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] * F), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;B\_m \leq 6.2 \cdot 10^{-146}:\\
\;\;\;\;\frac{\sqrt{A \cdot \left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right)}}{t\_0 - B\_m \cdot B\_m}\\
\mathbf{elif}\;B\_m \leq 1.05 \cdot 10^{-61}:\\
\;\;\;\;\sqrt{-0.5 \cdot \frac{{B\_m}^{2} \cdot F}{C}} \cdot \frac{\sqrt{2}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)\right)}}{-B\_m}\\
\end{array}
\end{array}
if B < 6.1999999999999997e-146Initial program 21.1%
Taylor expanded in B around inf 5.7%
unpow25.7%
Applied egg-rr5.7%
Taylor expanded in A around inf 4.8%
if 6.1999999999999997e-146 < B < 1.05e-61Initial program 9.6%
Taylor expanded in A around 0 10.1%
mul-1-neg10.1%
unpow210.1%
unpow210.1%
hypot-define10.8%
Simplified10.8%
Taylor expanded in C around inf 17.3%
if 1.05e-61 < B Initial program 21.5%
Taylor expanded in C around 0 29.0%
mul-1-neg29.0%
+-commutative29.0%
unpow229.0%
unpow229.0%
hypot-define50.5%
Simplified50.5%
neg-sub050.5%
associate-*l/50.6%
pow1/250.6%
pow1/250.6%
pow-prod-down50.8%
Applied egg-rr50.8%
neg-sub050.8%
distribute-neg-frac250.8%
unpow1/250.8%
Simplified50.8%
Final simplification19.5%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (if (<= C 8.6e+82) (/ (sqrt (* 2.0 (* F (- A (hypot B_m A))))) (- B_m)) (* (/ (sqrt 2.0) B_m) (- (sqrt (* -0.5 (* (pow B_m 2.0) (/ F C))))))))
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 <= 8.6e+82) {
tmp = sqrt((2.0 * (F * (A - hypot(B_m, A))))) / -B_m;
} else {
tmp = (sqrt(2.0) / B_m) * -sqrt((-0.5 * (pow(B_m, 2.0) * (F / C))));
}
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 (C <= 8.6e+82) {
tmp = Math.sqrt((2.0 * (F * (A - Math.hypot(B_m, A))))) / -B_m;
} else {
tmp = (Math.sqrt(2.0) / B_m) * -Math.sqrt((-0.5 * (Math.pow(B_m, 2.0) * (F / C))));
}
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 <= 8.6e+82: tmp = math.sqrt((2.0 * (F * (A - math.hypot(B_m, A))))) / -B_m else: tmp = (math.sqrt(2.0) / B_m) * -math.sqrt((-0.5 * (math.pow(B_m, 2.0) * (F / C)))) 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 <= 8.6e+82) tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(B_m, A))))) / Float64(-B_m)); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-sqrt(Float64(-0.5 * Float64((B_m ^ 2.0) * Float64(F / C)))))); 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 <= 8.6e+82)
tmp = sqrt((2.0 * (F * (A - hypot(B_m, A))))) / -B_m;
else
tmp = (sqrt(2.0) / B_m) * -sqrt((-0.5 * ((B_m ^ 2.0) * (F / C))));
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, 8.6e+82], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] * N[(F / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq 8.6 \cdot 10^{+82}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)\right)}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(-\sqrt{-0.5 \cdot \left({B\_m}^{2} \cdot \frac{F}{C}\right)}\right)\\
\end{array}
\end{array}
if C < 8.60000000000000029e82Initial program 24.2%
Taylor expanded in C around 0 12.3%
mul-1-neg12.3%
+-commutative12.3%
unpow212.3%
unpow212.3%
hypot-define20.9%
Simplified20.9%
neg-sub020.9%
associate-*l/20.9%
pow1/220.9%
pow1/220.9%
pow-prod-down21.0%
Applied egg-rr21.0%
neg-sub021.0%
distribute-neg-frac221.0%
unpow1/221.0%
Simplified21.0%
if 8.60000000000000029e82 < C Initial program 0.8%
Taylor expanded in A around 0 2.1%
mul-1-neg2.1%
unpow22.1%
unpow22.1%
hypot-define6.8%
Simplified6.8%
Taylor expanded in C around inf 15.8%
associate-/l*15.7%
Simplified15.7%
Final simplification20.2%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (/ (sqrt (* 2.0 (* F (- A (hypot B_m A))))) (- 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 * (A - hypot(B_m, A))))) / -B_m;
}
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 * (A - Math.hypot(B_m, A))))) / -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 * (A - math.hypot(B_m, A))))) / -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 * Float64(A - hypot(B_m, A))))) / Float64(-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 * (A - hypot(B_m, A))))) / -B_m;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)\right)}}{-B\_m}
\end{array}
Initial program 20.6%
Taylor expanded in C around 0 10.8%
mul-1-neg10.8%
+-commutative10.8%
unpow210.8%
unpow210.8%
hypot-define18.6%
Simplified18.6%
neg-sub018.6%
associate-*l/18.6%
pow1/218.6%
pow1/218.6%
pow-prod-down18.7%
Applied egg-rr18.7%
neg-sub018.7%
distribute-neg-frac218.7%
unpow1/218.7%
Simplified18.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 (<= A -2.55e+211) (/ (sqrt (* (* 4.0 A) F)) (- B_m)) (/ (sqrt (+ (* -2.0 (* B_m F)) (* 2.0 (* A 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) {
double tmp;
if (A <= -2.55e+211) {
tmp = sqrt(((4.0 * A) * F)) / -B_m;
} else {
tmp = sqrt(((-2.0 * (B_m * F)) + (2.0 * (A * F)))) / -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 (a <= (-2.55d+211)) then
tmp = sqrt(((4.0d0 * a) * f)) / -b_m
else
tmp = sqrt((((-2.0d0) * (b_m * f)) + (2.0d0 * (a * f)))) / -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 (A <= -2.55e+211) {
tmp = Math.sqrt(((4.0 * A) * F)) / -B_m;
} else {
tmp = Math.sqrt(((-2.0 * (B_m * F)) + (2.0 * (A * F)))) / -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 A <= -2.55e+211: tmp = math.sqrt(((4.0 * A) * F)) / -B_m else: tmp = math.sqrt(((-2.0 * (B_m * F)) + (2.0 * (A * F)))) / -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 (A <= -2.55e+211) tmp = Float64(sqrt(Float64(Float64(4.0 * A) * F)) / Float64(-B_m)); else tmp = Float64(sqrt(Float64(Float64(-2.0 * Float64(B_m * F)) + Float64(2.0 * Float64(A * F)))) / Float64(-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 (A <= -2.55e+211)
tmp = sqrt(((4.0 * A) * F)) / -B_m;
else
tmp = sqrt(((-2.0 * (B_m * F)) + (2.0 * (A * F)))) / -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[A, -2.55e+211], N[(N[Sqrt[N[(N[(4.0 * A), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[N[(N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(A * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $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}\;A \leq -2.55 \cdot 10^{+211}:\\
\;\;\;\;\frac{\sqrt{\left(4 \cdot A\right) \cdot F}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-2 \cdot \left(B\_m \cdot F\right) + 2 \cdot \left(A \cdot F\right)}}{-B\_m}\\
\end{array}
\end{array}
if A < -2.54999999999999981e211Initial program 1.6%
Taylor expanded in C around 0 0.9%
mul-1-neg0.9%
+-commutative0.9%
unpow20.9%
unpow20.9%
hypot-define10.5%
Simplified10.5%
neg-sub010.5%
associate-*l/10.5%
pow1/210.5%
pow1/210.7%
pow-prod-down10.7%
Applied egg-rr10.7%
neg-sub010.7%
distribute-neg-frac210.7%
unpow1/210.6%
Simplified10.6%
Taylor expanded in A around -inf 6.4%
associate-*r*6.4%
Simplified6.4%
if -2.54999999999999981e211 < A Initial program 22.3%
Taylor expanded in C around 0 11.7%
mul-1-neg11.7%
+-commutative11.7%
unpow211.7%
unpow211.7%
hypot-define19.3%
Simplified19.3%
neg-sub019.3%
associate-*l/19.3%
pow1/219.3%
pow1/219.3%
pow-prod-down19.4%
Applied egg-rr19.4%
neg-sub019.4%
distribute-neg-frac219.4%
unpow1/219.4%
Simplified19.4%
Taylor expanded in A around 0 17.2%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (if (<= A -2.6e+211) (/ (sqrt (* (* 4.0 A) F)) (- B_m)) (/ (sqrt (* F (* B_m -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 (A <= -2.6e+211) {
tmp = sqrt(((4.0 * A) * F)) / -B_m;
} else {
tmp = sqrt((F * (B_m * -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 (a <= (-2.6d+211)) then
tmp = sqrt(((4.0d0 * a) * f)) / -b_m
else
tmp = sqrt((f * (b_m * (-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 (A <= -2.6e+211) {
tmp = Math.sqrt(((4.0 * A) * F)) / -B_m;
} else {
tmp = Math.sqrt((F * (B_m * -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 A <= -2.6e+211: tmp = math.sqrt(((4.0 * A) * F)) / -B_m else: tmp = math.sqrt((F * (B_m * -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 (A <= -2.6e+211) tmp = Float64(sqrt(Float64(Float64(4.0 * A) * F)) / Float64(-B_m)); else tmp = Float64(sqrt(Float64(F * Float64(B_m * -2.0))) / Float64(-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 (A <= -2.6e+211)
tmp = sqrt(((4.0 * A) * F)) / -B_m;
else
tmp = sqrt((F * (B_m * -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[A, -2.6e+211], N[(N[Sqrt[N[(N[(4.0 * A), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[N[(F * N[(B$95$m * -2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $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}\;A \leq -2.6 \cdot 10^{+211}:\\
\;\;\;\;\frac{\sqrt{\left(4 \cdot A\right) \cdot F}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(B\_m \cdot -2\right)}}{-B\_m}\\
\end{array}
\end{array}
if A < -2.5999999999999998e211Initial program 1.6%
Taylor expanded in C around 0 0.9%
mul-1-neg0.9%
+-commutative0.9%
unpow20.9%
unpow20.9%
hypot-define10.5%
Simplified10.5%
neg-sub010.5%
associate-*l/10.5%
pow1/210.5%
pow1/210.7%
pow-prod-down10.7%
Applied egg-rr10.7%
neg-sub010.7%
distribute-neg-frac210.7%
unpow1/210.6%
Simplified10.6%
Taylor expanded in A around -inf 6.4%
associate-*r*6.4%
Simplified6.4%
if -2.5999999999999998e211 < A Initial program 22.3%
Taylor expanded in C around 0 11.7%
mul-1-neg11.7%
+-commutative11.7%
unpow211.7%
unpow211.7%
hypot-define19.3%
Simplified19.3%
neg-sub019.3%
associate-*l/19.3%
pow1/219.3%
pow1/219.3%
pow-prod-down19.4%
Applied egg-rr19.4%
neg-sub019.4%
distribute-neg-frac219.4%
unpow1/219.4%
Simplified19.4%
Taylor expanded in A around 0 18.1%
associate-*r*18.1%
Simplified18.1%
Final simplification17.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 (<= A -2.15e+212) (* (sqrt (* A F)) (/ -2.0 B_m)) (/ (sqrt (* F (* B_m -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 (A <= -2.15e+212) {
tmp = sqrt((A * F)) * (-2.0 / B_m);
} else {
tmp = sqrt((F * (B_m * -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 (a <= (-2.15d+212)) then
tmp = sqrt((a * f)) * ((-2.0d0) / b_m)
else
tmp = sqrt((f * (b_m * (-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 (A <= -2.15e+212) {
tmp = Math.sqrt((A * F)) * (-2.0 / B_m);
} else {
tmp = Math.sqrt((F * (B_m * -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 A <= -2.15e+212: tmp = math.sqrt((A * F)) * (-2.0 / B_m) else: tmp = math.sqrt((F * (B_m * -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 (A <= -2.15e+212) tmp = Float64(sqrt(Float64(A * F)) * Float64(-2.0 / B_m)); else tmp = Float64(sqrt(Float64(F * Float64(B_m * -2.0))) / Float64(-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 (A <= -2.15e+212)
tmp = sqrt((A * F)) * (-2.0 / B_m);
else
tmp = sqrt((F * (B_m * -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[A, -2.15e+212], N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * N[(-2.0 / B$95$m), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F * N[(B$95$m * -2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $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}\;A \leq -2.15 \cdot 10^{+212}:\\
\;\;\;\;\sqrt{A \cdot F} \cdot \frac{-2}{B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(B\_m \cdot -2\right)}}{-B\_m}\\
\end{array}
\end{array}
if A < -2.1499999999999998e212Initial program 1.6%
Taylor expanded in C around 0 0.9%
mul-1-neg0.9%
+-commutative0.9%
unpow20.9%
unpow20.9%
hypot-define10.5%
Simplified10.5%
add-exp-log8.8%
Applied egg-rr8.8%
Taylor expanded in A around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt6.2%
unpow26.2%
rem-square-sqrt6.4%
metadata-eval6.4%
Simplified6.4%
if -2.1499999999999998e212 < A Initial program 22.3%
Taylor expanded in C around 0 11.7%
mul-1-neg11.7%
+-commutative11.7%
unpow211.7%
unpow211.7%
hypot-define19.3%
Simplified19.3%
neg-sub019.3%
associate-*l/19.3%
pow1/219.3%
pow1/219.3%
pow-prod-down19.4%
Applied egg-rr19.4%
neg-sub019.4%
distribute-neg-frac219.4%
unpow1/219.4%
Simplified19.4%
Taylor expanded in A around 0 18.1%
associate-*r*18.1%
Simplified18.1%
Final simplification17.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 (* (sqrt (* A 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((A * 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((a * 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((A * 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((A * 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(A * F)) * Float64(-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((A * 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[(N[Sqrt[N[(A * F), $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])\\
\\
\sqrt{A \cdot F} \cdot \frac{-2}{B\_m}
\end{array}
Initial program 20.6%
Taylor expanded in C around 0 10.8%
mul-1-neg10.8%
+-commutative10.8%
unpow210.8%
unpow210.8%
hypot-define18.6%
Simplified18.6%
add-exp-log16.0%
Applied egg-rr16.0%
Taylor expanded in A around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt2.9%
unpow22.9%
rem-square-sqrt2.9%
metadata-eval2.9%
Simplified2.9%
Final simplification2.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 (/ (* 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 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 20.6%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt2.1%
Simplified2.1%
Taylor expanded in F around 0 2.1%
pow12.1%
*-commutative2.1%
sqrt-unprod2.1%
Applied egg-rr2.1%
unpow12.1%
Simplified2.1%
associate-*r/2.1%
*-commutative2.1%
frac-2neg2.1%
add-sqr-sqrt1.2%
sqrt-unprod2.6%
sqr-neg2.6%
sqrt-unprod1.1%
add-sqr-sqrt1.7%
Applied egg-rr1.7%
distribute-rgt-neg-in1.7%
metadata-eval1.7%
Simplified1.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 (/ 2.0 (/ B_m F))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
return sqrt((2.0 / (B_m / F)));
}
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 / (b_m / f)))
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 / (B_m / F)));
}
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 / (B_m / F)))
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(B_m / F))) 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 / (B_m / F)));
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[(B$95$m / F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\sqrt{\frac{2}{\frac{B\_m}{F}}}
\end{array}
Initial program 20.6%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt2.1%
Simplified2.1%
Taylor expanded in F around 0 2.1%
pow12.1%
*-commutative2.1%
sqrt-unprod2.1%
Applied egg-rr2.1%
unpow12.1%
Simplified2.1%
clear-num2.2%
un-div-inv2.2%
Applied egg-rr2.2%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (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 20.6%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt2.1%
Simplified2.1%
Taylor expanded in F around 0 2.1%
pow12.1%
*-commutative2.1%
sqrt-unprod2.1%
Applied egg-rr2.1%
unpow12.1%
Simplified2.1%
herbie shell --seed 2024114
(FPCore (A B C F)
:name "ABCF->ab-angle b"
: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))))