
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) - sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t\_0}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) - sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t\_0}
\end{array}
\end{array}
B_m = (fabs.f64 B)
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))
(t_1 (* 2.0 (* (- (pow B_m 2.0) t_0) F)))
(t_2 (- t_0 (pow B_m 2.0)))
(t_3
(/
(sqrt (* t_1 (- (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
t_2)))
(if (<= t_3 -5e-203)
(/
(*
(sqrt (+ (* B_m B_m) (* A (* C -4.0))))
(sqrt (* 2.0 (* F (- (+ A C) (hypot B_m (- A C)))))))
t_2)
(if (<= t_3 INFINITY)
(/ (sqrt (* t_1 (+ A (+ A (/ (* (* B_m B_m) -0.5) C))))) t_2)
(*
(* (sqrt B_m) (sqrt (- 0.0 F)))
(/ (pow (pow 2.0 0.25) 2.0) (- 0.0 B_m)))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = 2.0 * ((pow(B_m, 2.0) - t_0) * F);
double t_2 = t_0 - pow(B_m, 2.0);
double t_3 = sqrt((t_1 * ((A + C) - sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / t_2;
double tmp;
if (t_3 <= -5e-203) {
tmp = (sqrt(((B_m * B_m) + (A * (C * -4.0)))) * sqrt((2.0 * (F * ((A + C) - hypot(B_m, (A - C))))))) / t_2;
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((t_1 * (A + (A + (((B_m * B_m) * -0.5) / C))))) / t_2;
} else {
tmp = (sqrt(B_m) * sqrt((0.0 - F))) * (pow(pow(2.0, 0.25), 2.0) / (0.0 - B_m));
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = 2.0 * ((Math.pow(B_m, 2.0) - t_0) * F);
double t_2 = t_0 - Math.pow(B_m, 2.0);
double t_3 = Math.sqrt((t_1 * ((A + C) - Math.sqrt((Math.pow(B_m, 2.0) + Math.pow((A - C), 2.0)))))) / t_2;
double tmp;
if (t_3 <= -5e-203) {
tmp = (Math.sqrt(((B_m * B_m) + (A * (C * -4.0)))) * Math.sqrt((2.0 * (F * ((A + C) - Math.hypot(B_m, (A - C))))))) / t_2;
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((t_1 * (A + (A + (((B_m * B_m) * -0.5) / C))))) / t_2;
} else {
tmp = (Math.sqrt(B_m) * Math.sqrt((0.0 - F))) * (Math.pow(Math.pow(2.0, 0.25), 2.0) / (0.0 - B_m));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (4.0 * A) * C t_1 = 2.0 * ((math.pow(B_m, 2.0) - t_0) * F) t_2 = t_0 - math.pow(B_m, 2.0) t_3 = math.sqrt((t_1 * ((A + C) - math.sqrt((math.pow(B_m, 2.0) + math.pow((A - C), 2.0)))))) / t_2 tmp = 0 if t_3 <= -5e-203: tmp = (math.sqrt(((B_m * B_m) + (A * (C * -4.0)))) * math.sqrt((2.0 * (F * ((A + C) - math.hypot(B_m, (A - C))))))) / t_2 elif t_3 <= math.inf: tmp = math.sqrt((t_1 * (A + (A + (((B_m * B_m) * -0.5) / C))))) / t_2 else: tmp = (math.sqrt(B_m) * math.sqrt((0.0 - F))) * (math.pow(math.pow(2.0, 0.25), 2.0) / (0.0 - B_m)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) t_1 = Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) t_2 = Float64(t_0 - (B_m ^ 2.0)) t_3 = Float64(sqrt(Float64(t_1 * Float64(Float64(A + C) - sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / t_2) tmp = 0.0 if (t_3 <= -5e-203) tmp = Float64(Float64(sqrt(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0)))) * sqrt(Float64(2.0 * Float64(F * Float64(Float64(A + C) - hypot(B_m, Float64(A - C))))))) / t_2); elseif (t_3 <= Inf) tmp = Float64(sqrt(Float64(t_1 * Float64(A + Float64(A + Float64(Float64(Float64(B_m * B_m) * -0.5) / C))))) / t_2); else tmp = Float64(Float64(sqrt(B_m) * sqrt(Float64(0.0 - F))) * Float64(((2.0 ^ 0.25) ^ 2.0) / Float64(0.0 - B_m))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (4.0 * A) * C;
t_1 = 2.0 * (((B_m ^ 2.0) - t_0) * F);
t_2 = t_0 - (B_m ^ 2.0);
t_3 = sqrt((t_1 * ((A + C) - sqrt(((B_m ^ 2.0) + ((A - C) ^ 2.0)))))) / t_2;
tmp = 0.0;
if (t_3 <= -5e-203)
tmp = (sqrt(((B_m * B_m) + (A * (C * -4.0)))) * sqrt((2.0 * (F * ((A + C) - hypot(B_m, (A - C))))))) / t_2;
elseif (t_3 <= Inf)
tmp = sqrt((t_1 * (A + (A + (((B_m * B_m) * -0.5) / C))))) / t_2;
else
tmp = (sqrt(B_m) * sqrt((0.0 - F))) * (((2.0 ^ 0.25) ^ 2.0) / (0.0 - B_m));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(t$95$1 * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-203], N[(N[(N[Sqrt[N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(F * N[(N[(A + C), $MachinePrecision] - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[Sqrt[N[(t$95$1 * N[(A + N[(A + N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[(N[Sqrt[B$95$m], $MachinePrecision] * N[Sqrt[N[(0.0 - F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Power[2.0, 0.25], $MachinePrecision], 2.0], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := 2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\\
t_2 := t\_0 - {B\_m}^{2}\\
t_3 := \frac{\sqrt{t\_1 \cdot \left(\left(A + C\right) - \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_2}\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{-203}:\\
\;\;\;\;\frac{\sqrt{B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)} \cdot \sqrt{2 \cdot \left(F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)}}{t\_2}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\frac{\sqrt{t\_1 \cdot \left(A + \left(A + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{C}\right)\right)}}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{B\_m} \cdot \sqrt{0 - F}\right) \cdot \frac{{\left({2}^{0.25}\right)}^{2}}{0 - B\_m}\\
\end{array}
\end{array}
if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -5.0000000000000002e-203Initial program 49.7%
Taylor expanded in F around 0
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
Simplified44.3%
Applied egg-rr77.2%
if -5.0000000000000002e-203 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < +inf.0Initial program 14.7%
Taylor expanded in C around inf
associate--l+N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6429.9%
Simplified29.9%
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) Initial program 0.0%
Taylor expanded in C around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
*-lowering-*.f64N/A
Simplified11.5%
pow1/2N/A
sqr-powN/A
pow2N/A
pow-lowering-pow.f64N/A
pow-lowering-pow.f64N/A
metadata-eval11.5%
Applied egg-rr11.5%
Taylor expanded in A around 0
*-lowering-*.f64N/A
*-lowering-*.f649.7%
Simplified9.7%
*-commutativeN/A
associate-*l*N/A
sqrt-prodN/A
pow1/2N/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6418.3%
Applied egg-rr18.3%
Final simplification41.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)) (t_1 (- t_0 (pow B_m 2.0))))
(if (<= (pow B_m 2.0) 1e-181)
(/
(sqrt
(*
(* 2.0 (* (- (pow B_m 2.0) t_0) F))
(+ A (+ A (/ (* (* B_m B_m) -0.5) C)))))
t_1)
(if (<= (pow B_m 2.0) 1e+227)
(/
(*
(sqrt (* 2.0 (+ (* B_m B_m) (* C (* A -4.0)))))
(sqrt (* F (+ C (- A (hypot B_m (- A C)))))))
t_1)
(*
(* (sqrt B_m) (sqrt (- 0.0 F)))
(/ (pow (pow 2.0 0.25) 2.0) (- 0.0 B_m)))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = t_0 - pow(B_m, 2.0);
double tmp;
if (pow(B_m, 2.0) <= 1e-181) {
tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / t_1;
} else if (pow(B_m, 2.0) <= 1e+227) {
tmp = (sqrt((2.0 * ((B_m * B_m) + (C * (A * -4.0))))) * sqrt((F * (C + (A - hypot(B_m, (A - C))))))) / t_1;
} else {
tmp = (sqrt(B_m) * sqrt((0.0 - F))) * (pow(pow(2.0, 0.25), 2.0) / (0.0 - B_m));
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = t_0 - Math.pow(B_m, 2.0);
double tmp;
if (Math.pow(B_m, 2.0) <= 1e-181) {
tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / t_1;
} else if (Math.pow(B_m, 2.0) <= 1e+227) {
tmp = (Math.sqrt((2.0 * ((B_m * B_m) + (C * (A * -4.0))))) * Math.sqrt((F * (C + (A - Math.hypot(B_m, (A - C))))))) / t_1;
} else {
tmp = (Math.sqrt(B_m) * Math.sqrt((0.0 - F))) * (Math.pow(Math.pow(2.0, 0.25), 2.0) / (0.0 - B_m));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (4.0 * A) * C t_1 = t_0 - math.pow(B_m, 2.0) tmp = 0 if math.pow(B_m, 2.0) <= 1e-181: tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / t_1 elif math.pow(B_m, 2.0) <= 1e+227: tmp = (math.sqrt((2.0 * ((B_m * B_m) + (C * (A * -4.0))))) * math.sqrt((F * (C + (A - math.hypot(B_m, (A - C))))))) / t_1 else: tmp = (math.sqrt(B_m) * math.sqrt((0.0 - F))) * (math.pow(math.pow(2.0, 0.25), 2.0) / (0.0 - B_m)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) t_1 = Float64(t_0 - (B_m ^ 2.0)) tmp = 0.0 if ((B_m ^ 2.0) <= 1e-181) tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(A + Float64(A + Float64(Float64(Float64(B_m * B_m) * -0.5) / C))))) / t_1); elseif ((B_m ^ 2.0) <= 1e+227) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(Float64(B_m * B_m) + Float64(C * Float64(A * -4.0))))) * sqrt(Float64(F * Float64(C + Float64(A - hypot(B_m, Float64(A - C))))))) / t_1); else tmp = Float64(Float64(sqrt(B_m) * sqrt(Float64(0.0 - F))) * Float64(((2.0 ^ 0.25) ^ 2.0) / Float64(0.0 - B_m))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (4.0 * A) * C;
t_1 = t_0 - (B_m ^ 2.0);
tmp = 0.0;
if ((B_m ^ 2.0) <= 1e-181)
tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / t_1;
elseif ((B_m ^ 2.0) <= 1e+227)
tmp = (sqrt((2.0 * ((B_m * B_m) + (C * (A * -4.0))))) * sqrt((F * (C + (A - hypot(B_m, (A - C))))))) / t_1;
else
tmp = (sqrt(B_m) * sqrt((0.0 - F))) * (((2.0 ^ 0.25) ^ 2.0) / (0.0 - B_m));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-181], 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[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+227], N[(N[(N[Sqrt[N[(2.0 * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(F * N[(C + N[(A - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[B$95$m], $MachinePrecision] * N[Sqrt[N[(0.0 - F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Power[2.0, 0.25], $MachinePrecision], 2.0], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := t\_0 - {B\_m}^{2}\\
\mathbf{if}\;{B\_m}^{2} \leq 10^{-181}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(A + \left(A + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{C}\right)\right)}}{t\_1}\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{+227}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{F \cdot \left(C + \left(A - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)}}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{B\_m} \cdot \sqrt{0 - F}\right) \cdot \frac{{\left({2}^{0.25}\right)}^{2}}{0 - B\_m}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 1.00000000000000005e-181Initial program 20.2%
Taylor expanded in C around inf
associate--l+N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.7%
Simplified27.7%
if 1.00000000000000005e-181 < (pow.f64 B #s(literal 2 binary64)) < 1.0000000000000001e227Initial program 38.0%
associate-*r*N/A
associate-*l*N/A
sqrt-prodN/A
pow1/2N/A
*-lowering-*.f64N/A
Applied egg-rr54.3%
if 1.0000000000000001e227 < (pow.f64 B #s(literal 2 binary64)) Initial program 4.8%
Taylor expanded in C around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
*-lowering-*.f64N/A
Simplified15.5%
pow1/2N/A
sqr-powN/A
pow2N/A
pow-lowering-pow.f64N/A
pow-lowering-pow.f64N/A
metadata-eval15.5%
Applied egg-rr15.5%
Taylor expanded in A around 0
*-lowering-*.f64N/A
*-lowering-*.f6413.3%
Simplified13.3%
*-commutativeN/A
associate-*l*N/A
sqrt-prodN/A
pow1/2N/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6427.0%
Applied egg-rr27.0%
Final simplification36.0%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* (* 4.0 A) C)))
(if (<= (pow B_m 2.0) 1e-181)
(/
(sqrt
(*
(* 2.0 (* (- (pow B_m 2.0) t_0) F))
(+ A (+ A (/ (* (* B_m B_m) -0.5) C)))))
(- t_0 (pow B_m 2.0)))
(if (<= (pow B_m 2.0) 1e+195)
(-
0.0
(*
(sqrt
(/
(* F (- A (- (hypot B_m (- A C)) C)))
(+ (* B_m B_m) (* -4.0 (* A C)))))
(sqrt 2.0)))
(*
(* (sqrt B_m) (sqrt (- 0.0 F)))
(/ (pow (pow 2.0 0.25) 2.0) (- 0.0 B_m)))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double tmp;
if (pow(B_m, 2.0) <= 1e-181) {
tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / (t_0 - pow(B_m, 2.0));
} else if (pow(B_m, 2.0) <= 1e+195) {
tmp = 0.0 - (sqrt(((F * (A - (hypot(B_m, (A - C)) - C))) / ((B_m * B_m) + (-4.0 * (A * C))))) * sqrt(2.0));
} else {
tmp = (sqrt(B_m) * sqrt((0.0 - F))) * (pow(pow(2.0, 0.25), 2.0) / (0.0 - B_m));
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double tmp;
if (Math.pow(B_m, 2.0) <= 1e-181) {
tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / (t_0 - Math.pow(B_m, 2.0));
} else if (Math.pow(B_m, 2.0) <= 1e+195) {
tmp = 0.0 - (Math.sqrt(((F * (A - (Math.hypot(B_m, (A - C)) - C))) / ((B_m * B_m) + (-4.0 * (A * C))))) * Math.sqrt(2.0));
} else {
tmp = (Math.sqrt(B_m) * Math.sqrt((0.0 - F))) * (Math.pow(Math.pow(2.0, 0.25), 2.0) / (0.0 - B_m));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (4.0 * A) * C tmp = 0 if math.pow(B_m, 2.0) <= 1e-181: tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / (t_0 - math.pow(B_m, 2.0)) elif math.pow(B_m, 2.0) <= 1e+195: tmp = 0.0 - (math.sqrt(((F * (A - (math.hypot(B_m, (A - C)) - C))) / ((B_m * B_m) + (-4.0 * (A * C))))) * math.sqrt(2.0)) else: tmp = (math.sqrt(B_m) * math.sqrt((0.0 - F))) * (math.pow(math.pow(2.0, 0.25), 2.0) / (0.0 - B_m)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) tmp = 0.0 if ((B_m ^ 2.0) <= 1e-181) tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(A + Float64(A + Float64(Float64(Float64(B_m * B_m) * -0.5) / C))))) / Float64(t_0 - (B_m ^ 2.0))); elseif ((B_m ^ 2.0) <= 1e+195) tmp = Float64(0.0 - Float64(sqrt(Float64(Float64(F * Float64(A - Float64(hypot(B_m, Float64(A - C)) - C))) / Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))))) * sqrt(2.0))); else tmp = Float64(Float64(sqrt(B_m) * sqrt(Float64(0.0 - F))) * Float64(((2.0 ^ 0.25) ^ 2.0) / Float64(0.0 - B_m))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (4.0 * A) * C;
tmp = 0.0;
if ((B_m ^ 2.0) <= 1e-181)
tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / (t_0 - (B_m ^ 2.0));
elseif ((B_m ^ 2.0) <= 1e+195)
tmp = 0.0 - (sqrt(((F * (A - (hypot(B_m, (A - C)) - C))) / ((B_m * B_m) + (-4.0 * (A * C))))) * sqrt(2.0));
else
tmp = (sqrt(B_m) * sqrt((0.0 - F))) * (((2.0 ^ 0.25) ^ 2.0) / (0.0 - B_m));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-181], 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[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+195], N[(0.0 - N[(N[Sqrt[N[(N[(F * N[(A - N[(N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision] - C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[B$95$m], $MachinePrecision] * N[Sqrt[N[(0.0 - F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Power[2.0, 0.25], $MachinePrecision], 2.0], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;{B\_m}^{2} \leq 10^{-181}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(A + \left(A + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{C}\right)\right)}}{t\_0 - {B\_m}^{2}}\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{+195}:\\
\;\;\;\;0 - \sqrt{\frac{F \cdot \left(A - \left(\mathsf{hypot}\left(B\_m, A - C\right) - C\right)\right)}{B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)}} \cdot \sqrt{2}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{B\_m} \cdot \sqrt{0 - F}\right) \cdot \frac{{\left({2}^{0.25}\right)}^{2}}{0 - B\_m}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 1.00000000000000005e-181Initial program 20.2%
Taylor expanded in C around inf
associate--l+N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.7%
Simplified27.7%
if 1.00000000000000005e-181 < (pow.f64 B #s(literal 2 binary64)) < 9.99999999999999977e194Initial program 37.1%
Taylor expanded in F around 0
mul-1-negN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
Simplified51.8%
if 9.99999999999999977e194 < (pow.f64 B #s(literal 2 binary64)) Initial program 8.5%
Taylor expanded in C around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
*-lowering-*.f64N/A
Simplified17.3%
pow1/2N/A
sqr-powN/A
pow2N/A
pow-lowering-pow.f64N/A
pow-lowering-pow.f64N/A
metadata-eval17.3%
Applied egg-rr17.3%
Taylor expanded in A around 0
*-lowering-*.f64N/A
*-lowering-*.f6415.2%
Simplified15.2%
*-commutativeN/A
associate-*l*N/A
sqrt-prodN/A
pow1/2N/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6427.7%
Applied egg-rr27.7%
Final simplification34.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
(let* ((t_0 (* (* 4.0 A) C)) (t_1 (* A (* C -4.0))))
(if (<= (pow B_m 2.0) 4e-191)
(/
(sqrt
(*
(* 2.0 (* (- (pow B_m 2.0) t_0) F))
(+ A (+ A (/ (* (* B_m B_m) -0.5) C)))))
(- t_0 (pow B_m 2.0)))
(if (<= (pow B_m 2.0) 1e+78)
(/
(sqrt
(* 2.0 (* (+ (* B_m B_m) t_1) (* F (- (+ A C) (hypot B_m (- A C)))))))
(- (* B_m (- 0.0 B_m)) t_1))
(/ (sqrt (* 2.0 (* F (- A (hypot A B_m))))) (- 0.0 B_m))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = A * (C * -4.0);
double tmp;
if (pow(B_m, 2.0) <= 4e-191) {
tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / (t_0 - pow(B_m, 2.0));
} else if (pow(B_m, 2.0) <= 1e+78) {
tmp = sqrt((2.0 * (((B_m * B_m) + t_1) * (F * ((A + C) - hypot(B_m, (A - C))))))) / ((B_m * (0.0 - B_m)) - t_1);
} else {
tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) / (0.0 - B_m);
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = A * (C * -4.0);
double tmp;
if (Math.pow(B_m, 2.0) <= 4e-191) {
tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / (t_0 - Math.pow(B_m, 2.0));
} else if (Math.pow(B_m, 2.0) <= 1e+78) {
tmp = Math.sqrt((2.0 * (((B_m * B_m) + t_1) * (F * ((A + C) - Math.hypot(B_m, (A - C))))))) / ((B_m * (0.0 - B_m)) - t_1);
} else {
tmp = Math.sqrt((2.0 * (F * (A - Math.hypot(A, B_m))))) / (0.0 - B_m);
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (4.0 * A) * C t_1 = A * (C * -4.0) tmp = 0 if math.pow(B_m, 2.0) <= 4e-191: tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / (t_0 - math.pow(B_m, 2.0)) elif math.pow(B_m, 2.0) <= 1e+78: tmp = math.sqrt((2.0 * (((B_m * B_m) + t_1) * (F * ((A + C) - math.hypot(B_m, (A - C))))))) / ((B_m * (0.0 - B_m)) - t_1) else: tmp = math.sqrt((2.0 * (F * (A - math.hypot(A, B_m))))) / (0.0 - B_m) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) t_1 = Float64(A * Float64(C * -4.0)) tmp = 0.0 if ((B_m ^ 2.0) <= 4e-191) tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(A + Float64(A + Float64(Float64(Float64(B_m * B_m) * -0.5) / C))))) / Float64(t_0 - (B_m ^ 2.0))); elseif ((B_m ^ 2.0) <= 1e+78) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + t_1) * Float64(F * Float64(Float64(A + C) - hypot(B_m, Float64(A - C))))))) / Float64(Float64(B_m * Float64(0.0 - B_m)) - t_1)); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(A, B_m))))) / Float64(0.0 - B_m)); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (4.0 * A) * C;
t_1 = A * (C * -4.0);
tmp = 0.0;
if ((B_m ^ 2.0) <= 4e-191)
tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / (t_0 - (B_m ^ 2.0));
elseif ((B_m ^ 2.0) <= 1e+78)
tmp = sqrt((2.0 * (((B_m * B_m) + t_1) * (F * ((A + C) - hypot(B_m, (A - C))))))) / ((B_m * (0.0 - B_m)) - t_1);
else
tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) / (0.0 - B_m);
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e-191], 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[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+78], N[(N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + t$95$1), $MachinePrecision] * N[(F * N[(N[(A + C), $MachinePrecision] - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(B$95$m * N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.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}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := A \cdot \left(C \cdot -4\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 4 \cdot 10^{-191}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(A + \left(A + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{C}\right)\right)}}{t\_0 - {B\_m}^{2}}\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{+78}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + t\_1\right) \cdot \left(F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{B\_m \cdot \left(0 - B\_m\right) - t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(A, B\_m\right)\right)\right)}}{0 - B\_m}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 4.0000000000000001e-191Initial program 20.6%
Taylor expanded in C around inf
associate--l+N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.1%
Simplified27.1%
if 4.0000000000000001e-191 < (pow.f64 B #s(literal 2 binary64)) < 1.00000000000000001e78Initial program 38.6%
neg-sub0N/A
div-subN/A
frac-subN/A
/-lowering-/.f64N/A
Applied egg-rr42.6%
Applied egg-rr44.7%
if 1.00000000000000001e78 < (pow.f64 B #s(literal 2 binary64)) Initial program 12.9%
Taylor expanded in C around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
*-lowering-*.f64N/A
Simplified20.8%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
frac-2negN/A
metadata-evalN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
metadata-evalN/A
frac-2negN/A
/-lowering-/.f6420.8%
Applied egg-rr20.8%
associate-*r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
accelerator-lowering-hypot.f6420.8%
Applied egg-rr20.8%
Final simplification27.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)) (t_1 (* A (* C -4.0))))
(if (<= (pow B_m 2.0) 4e-191)
(/
(sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_0) F)) (+ A A)))
(- t_0 (pow B_m 2.0)))
(if (<= (pow B_m 2.0) 1e+78)
(/
(sqrt
(* 2.0 (* (+ (* B_m B_m) t_1) (* F (- (+ A C) (hypot B_m (- A C)))))))
(- (* B_m (- 0.0 B_m)) t_1))
(/ (sqrt (* 2.0 (* F (- A (hypot A B_m))))) (- 0.0 B_m))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = A * (C * -4.0);
double tmp;
if (pow(B_m, 2.0) <= 4e-191) {
tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (A + A))) / (t_0 - pow(B_m, 2.0));
} else if (pow(B_m, 2.0) <= 1e+78) {
tmp = sqrt((2.0 * (((B_m * B_m) + t_1) * (F * ((A + C) - hypot(B_m, (A - C))))))) / ((B_m * (0.0 - B_m)) - t_1);
} else {
tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) / (0.0 - B_m);
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = A * (C * -4.0);
double tmp;
if (Math.pow(B_m, 2.0) <= 4e-191) {
tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (A + A))) / (t_0 - Math.pow(B_m, 2.0));
} else if (Math.pow(B_m, 2.0) <= 1e+78) {
tmp = Math.sqrt((2.0 * (((B_m * B_m) + t_1) * (F * ((A + C) - Math.hypot(B_m, (A - C))))))) / ((B_m * (0.0 - B_m)) - t_1);
} else {
tmp = Math.sqrt((2.0 * (F * (A - Math.hypot(A, B_m))))) / (0.0 - B_m);
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (4.0 * A) * C t_1 = A * (C * -4.0) tmp = 0 if math.pow(B_m, 2.0) <= 4e-191: tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (A + A))) / (t_0 - math.pow(B_m, 2.0)) elif math.pow(B_m, 2.0) <= 1e+78: tmp = math.sqrt((2.0 * (((B_m * B_m) + t_1) * (F * ((A + C) - math.hypot(B_m, (A - C))))))) / ((B_m * (0.0 - B_m)) - t_1) else: tmp = math.sqrt((2.0 * (F * (A - math.hypot(A, B_m))))) / (0.0 - B_m) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) t_1 = Float64(A * Float64(C * -4.0)) tmp = 0.0 if ((B_m ^ 2.0) <= 4e-191) tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(A + A))) / Float64(t_0 - (B_m ^ 2.0))); elseif ((B_m ^ 2.0) <= 1e+78) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + t_1) * Float64(F * Float64(Float64(A + C) - hypot(B_m, Float64(A - C))))))) / Float64(Float64(B_m * Float64(0.0 - B_m)) - t_1)); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(A, B_m))))) / Float64(0.0 - B_m)); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (4.0 * A) * C;
t_1 = A * (C * -4.0);
tmp = 0.0;
if ((B_m ^ 2.0) <= 4e-191)
tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (A + A))) / (t_0 - (B_m ^ 2.0));
elseif ((B_m ^ 2.0) <= 1e+78)
tmp = sqrt((2.0 * (((B_m * B_m) + t_1) * (F * ((A + C) - hypot(B_m, (A - C))))))) / ((B_m * (0.0 - B_m)) - t_1);
else
tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) / (0.0 - B_m);
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e-191], 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 + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+78], N[(N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + t$95$1), $MachinePrecision] * N[(F * N[(N[(A + C), $MachinePrecision] - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(B$95$m * N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.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}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := A \cdot \left(C \cdot -4\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 4 \cdot 10^{-191}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(A + A\right)}}{t\_0 - {B\_m}^{2}}\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{+78}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + t\_1\right) \cdot \left(F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{B\_m \cdot \left(0 - B\_m\right) - t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(A, B\_m\right)\right)\right)}}{0 - B\_m}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 4.0000000000000001e-191Initial program 20.6%
Taylor expanded in C around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f6426.9%
Simplified26.9%
if 4.0000000000000001e-191 < (pow.f64 B #s(literal 2 binary64)) < 1.00000000000000001e78Initial program 38.6%
neg-sub0N/A
div-subN/A
frac-subN/A
/-lowering-/.f64N/A
Applied egg-rr42.6%
Applied egg-rr44.7%
if 1.00000000000000001e78 < (pow.f64 B #s(literal 2 binary64)) Initial program 12.9%
Taylor expanded in C around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
*-lowering-*.f64N/A
Simplified20.8%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
frac-2negN/A
metadata-evalN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
metadata-evalN/A
frac-2negN/A
/-lowering-/.f6420.8%
Applied egg-rr20.8%
associate-*r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
accelerator-lowering-hypot.f6420.8%
Applied egg-rr20.8%
Final simplification27.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 (* C (* A -4.0))))
(if (<= B_m 8.5e+41)
(/
(sqrt
(* 2.0 (* (+ C (- A (hypot B_m (- A C)))) (* F (+ (* B_m B_m) t_0)))))
(- (* B_m (- 0.0 B_m)) t_0))
(/ (sqrt (* 2.0 (* F (- A (hypot A B_m))))) (- 0.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 = C * (A * -4.0);
double tmp;
if (B_m <= 8.5e+41) {
tmp = sqrt((2.0 * ((C + (A - hypot(B_m, (A - C)))) * (F * ((B_m * B_m) + t_0))))) / ((B_m * (0.0 - B_m)) - t_0);
} else {
tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) / (0.0 - B_m);
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = C * (A * -4.0);
double tmp;
if (B_m <= 8.5e+41) {
tmp = Math.sqrt((2.0 * ((C + (A - Math.hypot(B_m, (A - C)))) * (F * ((B_m * B_m) + t_0))))) / ((B_m * (0.0 - B_m)) - t_0);
} else {
tmp = Math.sqrt((2.0 * (F * (A - Math.hypot(A, B_m))))) / (0.0 - B_m);
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = C * (A * -4.0) tmp = 0 if B_m <= 8.5e+41: tmp = math.sqrt((2.0 * ((C + (A - math.hypot(B_m, (A - C)))) * (F * ((B_m * B_m) + t_0))))) / ((B_m * (0.0 - B_m)) - t_0) else: tmp = math.sqrt((2.0 * (F * (A - math.hypot(A, B_m))))) / (0.0 - B_m) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(C * Float64(A * -4.0)) tmp = 0.0 if (B_m <= 8.5e+41) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(C + Float64(A - hypot(B_m, Float64(A - C)))) * Float64(F * Float64(Float64(B_m * B_m) + t_0))))) / Float64(Float64(B_m * Float64(0.0 - B_m)) - t_0)); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(A, B_m))))) / Float64(0.0 - B_m)); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = C * (A * -4.0);
tmp = 0.0;
if (B_m <= 8.5e+41)
tmp = sqrt((2.0 * ((C + (A - hypot(B_m, (A - C)))) * (F * ((B_m * B_m) + t_0))))) / ((B_m * (0.0 - B_m)) - t_0);
else
tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) / (0.0 - B_m);
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 8.5e+41], N[(N[Sqrt[N[(2.0 * N[(N[(C + N[(A - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(B$95$m * N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.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}
t_0 := C \cdot \left(A \cdot -4\right)\\
\mathbf{if}\;B\_m \leq 8.5 \cdot 10^{+41}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\left(C + \left(A - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right) \cdot \left(F \cdot \left(B\_m \cdot B\_m + t\_0\right)\right)\right)}}{B\_m \cdot \left(0 - B\_m\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(A, B\_m\right)\right)\right)}}{0 - B\_m}\\
\end{array}
\end{array}
if B < 8.49999999999999938e41Initial program 22.6%
distribute-frac-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
Applied egg-rr27.6%
if 8.49999999999999938e41 < B Initial program 13.3%
Taylor expanded in C around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
*-lowering-*.f64N/A
Simplified43.3%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
frac-2negN/A
metadata-evalN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
metadata-evalN/A
frac-2negN/A
/-lowering-/.f6443.2%
Applied egg-rr43.2%
associate-*r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
accelerator-lowering-hypot.f6443.4%
Applied egg-rr43.4%
Final simplification31.1%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (+ (* B_m B_m) (* C (* A -4.0)))))
(if (<= B_m 1.3e-102)
(/
(- (* t_0 0.0) (* t_0 (sqrt (* -16.0 (* F (* C (* A A)))))))
(* t_0 t_0))
(/ (sqrt (* 2.0 (* F (- A (hypot A B_m))))) (- 0.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 = (B_m * B_m) + (C * (A * -4.0));
double tmp;
if (B_m <= 1.3e-102) {
tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
} else {
tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) / (0.0 - B_m);
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (B_m * B_m) + (C * (A * -4.0));
double tmp;
if (B_m <= 1.3e-102) {
tmp = ((t_0 * 0.0) - (t_0 * Math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
} else {
tmp = Math.sqrt((2.0 * (F * (A - Math.hypot(A, B_m))))) / (0.0 - B_m);
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (B_m * B_m) + (C * (A * -4.0)) tmp = 0 if B_m <= 1.3e-102: tmp = ((t_0 * 0.0) - (t_0 * math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0) else: tmp = math.sqrt((2.0 * (F * (A - math.hypot(A, B_m))))) / (0.0 - B_m) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(B_m * B_m) + Float64(C * Float64(A * -4.0))) tmp = 0.0 if (B_m <= 1.3e-102) tmp = Float64(Float64(Float64(t_0 * 0.0) - Float64(t_0 * sqrt(Float64(-16.0 * Float64(F * Float64(C * Float64(A * A))))))) / Float64(t_0 * t_0)); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(A, B_m))))) / Float64(0.0 - B_m)); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (B_m * B_m) + (C * (A * -4.0));
tmp = 0.0;
if (B_m <= 1.3e-102)
tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
else
tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) / (0.0 - B_m);
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.3e-102], N[(N[(N[(t$95$0 * 0.0), $MachinePrecision] - N[(t$95$0 * N[Sqrt[N[(-16.0 * N[(F * N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.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}
t_0 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\
\mathbf{if}\;B\_m \leq 1.3 \cdot 10^{-102}:\\
\;\;\;\;\frac{t\_0 \cdot 0 - t\_0 \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{t\_0 \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(A, B\_m\right)\right)\right)}}{0 - B\_m}\\
\end{array}
\end{array}
if B < 1.29999999999999993e-102Initial program 21.3%
neg-sub0N/A
div-subN/A
frac-subN/A
/-lowering-/.f64N/A
Applied egg-rr16.4%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f648.0%
Simplified8.0%
if 1.29999999999999993e-102 < B Initial program 19.0%
Taylor expanded in C around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
*-lowering-*.f64N/A
Simplified38.2%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
frac-2negN/A
metadata-evalN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
metadata-evalN/A
frac-2negN/A
/-lowering-/.f6438.2%
Applied egg-rr38.2%
associate-*r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
accelerator-lowering-hypot.f6438.3%
Applied egg-rr38.3%
Final simplification18.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 (+ (* B_m B_m) (* C (* A -4.0)))))
(if (<= B_m 4.3e-103)
(/
(- (* t_0 0.0) (* t_0 (sqrt (* -16.0 (* F (* C (* A A)))))))
(* t_0 t_0))
(* (sqrt (* 2.0 (* F (- A (hypot A B_m))))) (/ -1.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 = (B_m * B_m) + (C * (A * -4.0));
double tmp;
if (B_m <= 4.3e-103) {
tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
} else {
tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) * (-1.0 / B_m);
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (B_m * B_m) + (C * (A * -4.0));
double tmp;
if (B_m <= 4.3e-103) {
tmp = ((t_0 * 0.0) - (t_0 * Math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
} else {
tmp = Math.sqrt((2.0 * (F * (A - Math.hypot(A, B_m))))) * (-1.0 / B_m);
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (B_m * B_m) + (C * (A * -4.0)) tmp = 0 if B_m <= 4.3e-103: tmp = ((t_0 * 0.0) - (t_0 * math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0) else: tmp = math.sqrt((2.0 * (F * (A - math.hypot(A, B_m))))) * (-1.0 / B_m) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(B_m * B_m) + Float64(C * Float64(A * -4.0))) tmp = 0.0 if (B_m <= 4.3e-103) tmp = Float64(Float64(Float64(t_0 * 0.0) - Float64(t_0 * sqrt(Float64(-16.0 * Float64(F * Float64(C * Float64(A * A))))))) / Float64(t_0 * t_0)); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(A, B_m))))) * Float64(-1.0 / B_m)); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (B_m * B_m) + (C * (A * -4.0));
tmp = 0.0;
if (B_m <= 4.3e-103)
tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
else
tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) * (-1.0 / B_m);
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 4.3e-103], N[(N[(N[(t$95$0 * 0.0), $MachinePrecision] - N[(t$95$0 * N[Sqrt[N[(-16.0 * N[(F * N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.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}
t_0 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\
\mathbf{if}\;B\_m \leq 4.3 \cdot 10^{-103}:\\
\;\;\;\;\frac{t\_0 \cdot 0 - t\_0 \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{t\_0 \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(A, B\_m\right)\right)\right)} \cdot \frac{-1}{B\_m}\\
\end{array}
\end{array}
if B < 4.30000000000000023e-103Initial program 21.3%
neg-sub0N/A
div-subN/A
frac-subN/A
/-lowering-/.f64N/A
Applied egg-rr16.4%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f648.0%
Simplified8.0%
if 4.30000000000000023e-103 < B Initial program 19.0%
Taylor expanded in C around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
*-lowering-*.f64N/A
Simplified38.2%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
frac-2negN/A
metadata-evalN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
metadata-evalN/A
frac-2negN/A
/-lowering-/.f6438.2%
Applied egg-rr38.2%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
accelerator-lowering-hypot.f6438.3%
Applied egg-rr38.3%
Final simplification18.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 (+ (* B_m B_m) (* C (* A -4.0)))))
(if (<= B_m 1.46e-102)
(/
(- (* t_0 0.0) (* t_0 (sqrt (* -16.0 (* F (* C (* A A)))))))
(* t_0 t_0))
(* (sqrt (* F (- A B_m))) (* (sqrt 2.0) (/ -1.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 = (B_m * B_m) + (C * (A * -4.0));
double tmp;
if (B_m <= 1.46e-102) {
tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
} else {
tmp = sqrt((F * (A - B_m))) * (sqrt(2.0) * (-1.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) :: t_0
real(8) :: tmp
t_0 = (b_m * b_m) + (c * (a * (-4.0d0)))
if (b_m <= 1.46d-102) then
tmp = ((t_0 * 0.0d0) - (t_0 * sqrt(((-16.0d0) * (f * (c * (a * a))))))) / (t_0 * t_0)
else
tmp = sqrt((f * (a - b_m))) * (sqrt(2.0d0) * ((-1.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 t_0 = (B_m * B_m) + (C * (A * -4.0));
double tmp;
if (B_m <= 1.46e-102) {
tmp = ((t_0 * 0.0) - (t_0 * Math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
} else {
tmp = Math.sqrt((F * (A - B_m))) * (Math.sqrt(2.0) * (-1.0 / B_m));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (B_m * B_m) + (C * (A * -4.0)) tmp = 0 if B_m <= 1.46e-102: tmp = ((t_0 * 0.0) - (t_0 * math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0) else: tmp = math.sqrt((F * (A - B_m))) * (math.sqrt(2.0) * (-1.0 / B_m)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(B_m * B_m) + Float64(C * Float64(A * -4.0))) tmp = 0.0 if (B_m <= 1.46e-102) tmp = Float64(Float64(Float64(t_0 * 0.0) - Float64(t_0 * sqrt(Float64(-16.0 * Float64(F * Float64(C * Float64(A * A))))))) / Float64(t_0 * t_0)); else tmp = Float64(sqrt(Float64(F * Float64(A - B_m))) * Float64(sqrt(2.0) * Float64(-1.0 / B_m))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (B_m * B_m) + (C * (A * -4.0));
tmp = 0.0;
if (B_m <= 1.46e-102)
tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
else
tmp = sqrt((F * (A - B_m))) * (sqrt(2.0) * (-1.0 / B_m));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.46e-102], N[(N[(N[(t$95$0 * 0.0), $MachinePrecision] - N[(t$95$0 * N[Sqrt[N[(-16.0 * N[(F * N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F * N[(A - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\
\mathbf{if}\;B\_m \leq 1.46 \cdot 10^{-102}:\\
\;\;\;\;\frac{t\_0 \cdot 0 - t\_0 \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{t\_0 \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{F \cdot \left(A - B\_m\right)} \cdot \left(\sqrt{2} \cdot \frac{-1}{B\_m}\right)\\
\end{array}
\end{array}
if B < 1.4599999999999999e-102Initial program 21.3%
neg-sub0N/A
div-subN/A
frac-subN/A
/-lowering-/.f64N/A
Applied egg-rr16.4%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f648.0%
Simplified8.0%
if 1.4599999999999999e-102 < B Initial program 19.0%
Taylor expanded in C around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
*-lowering-*.f64N/A
Simplified38.2%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
frac-2negN/A
metadata-evalN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
metadata-evalN/A
frac-2negN/A
/-lowering-/.f6438.2%
Applied egg-rr38.2%
Taylor expanded in A around 0
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
distribute-rgt-outN/A
sub-negN/A
*-lowering-*.f64N/A
--lowering--.f6433.8%
Simplified33.8%
Final simplification17.0%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (+ (* B_m B_m) (* C (* A -4.0)))))
(if (<= B_m 1.95e-102)
(/
(- (* t_0 0.0) (* t_0 (sqrt (* -16.0 (* F (* C (* A A)))))))
(* t_0 t_0))
(* (sqrt (* F (- A B_m))) (/ (- 0.0 (sqrt 2.0)) B_m)))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (B_m * B_m) + (C * (A * -4.0));
double tmp;
if (B_m <= 1.95e-102) {
tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
} else {
tmp = sqrt((F * (A - B_m))) * ((0.0 - sqrt(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) :: t_0
real(8) :: tmp
t_0 = (b_m * b_m) + (c * (a * (-4.0d0)))
if (b_m <= 1.95d-102) then
tmp = ((t_0 * 0.0d0) - (t_0 * sqrt(((-16.0d0) * (f * (c * (a * a))))))) / (t_0 * t_0)
else
tmp = sqrt((f * (a - b_m))) * ((0.0d0 - sqrt(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 t_0 = (B_m * B_m) + (C * (A * -4.0));
double tmp;
if (B_m <= 1.95e-102) {
tmp = ((t_0 * 0.0) - (t_0 * Math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
} else {
tmp = Math.sqrt((F * (A - B_m))) * ((0.0 - Math.sqrt(2.0)) / B_m);
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (B_m * B_m) + (C * (A * -4.0)) tmp = 0 if B_m <= 1.95e-102: tmp = ((t_0 * 0.0) - (t_0 * math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0) else: tmp = math.sqrt((F * (A - B_m))) * ((0.0 - math.sqrt(2.0)) / B_m) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(B_m * B_m) + Float64(C * Float64(A * -4.0))) tmp = 0.0 if (B_m <= 1.95e-102) tmp = Float64(Float64(Float64(t_0 * 0.0) - Float64(t_0 * sqrt(Float64(-16.0 * Float64(F * Float64(C * Float64(A * A))))))) / Float64(t_0 * t_0)); else tmp = Float64(sqrt(Float64(F * Float64(A - B_m))) * Float64(Float64(0.0 - sqrt(2.0)) / B_m)); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (B_m * B_m) + (C * (A * -4.0));
tmp = 0.0;
if (B_m <= 1.95e-102)
tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
else
tmp = sqrt((F * (A - B_m))) * ((0.0 - sqrt(2.0)) / B_m);
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.95e-102], N[(N[(N[(t$95$0 * 0.0), $MachinePrecision] - N[(t$95$0 * N[Sqrt[N[(-16.0 * N[(F * N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F * N[(A - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(0.0 - N[Sqrt[2.0], $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 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\
\mathbf{if}\;B\_m \leq 1.95 \cdot 10^{-102}:\\
\;\;\;\;\frac{t\_0 \cdot 0 - t\_0 \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{t\_0 \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{F \cdot \left(A - B\_m\right)} \cdot \frac{0 - \sqrt{2}}{B\_m}\\
\end{array}
\end{array}
if B < 1.95e-102Initial program 21.3%
neg-sub0N/A
div-subN/A
frac-subN/A
/-lowering-/.f64N/A
Applied egg-rr16.4%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f648.0%
Simplified8.0%
if 1.95e-102 < B Initial program 19.0%
Taylor expanded in C around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
*-lowering-*.f64N/A
Simplified38.2%
Taylor expanded in A around 0
--lowering--.f6433.8%
Simplified33.8%
Final simplification17.0%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (+ (* B_m B_m) (* C (* A -4.0)))))
(if (<= B_m 4e-102)
(/
(- (* t_0 0.0) (* t_0 (sqrt (* -16.0 (* F (* C (* A A)))))))
(* t_0 t_0))
(* (/ (- 0.0 (sqrt 2.0)) B_m) (sqrt (* B_m (- 0.0 F)))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (B_m * B_m) + (C * (A * -4.0));
double tmp;
if (B_m <= 4e-102) {
tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
} else {
tmp = ((0.0 - sqrt(2.0)) / B_m) * sqrt((B_m * (0.0 - F)));
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (b_m * b_m) + (c * (a * (-4.0d0)))
if (b_m <= 4d-102) then
tmp = ((t_0 * 0.0d0) - (t_0 * sqrt(((-16.0d0) * (f * (c * (a * a))))))) / (t_0 * t_0)
else
tmp = ((0.0d0 - sqrt(2.0d0)) / b_m) * sqrt((b_m * (0.0d0 - f)))
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (B_m * B_m) + (C * (A * -4.0));
double tmp;
if (B_m <= 4e-102) {
tmp = ((t_0 * 0.0) - (t_0 * Math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
} else {
tmp = ((0.0 - Math.sqrt(2.0)) / B_m) * Math.sqrt((B_m * (0.0 - F)));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (B_m * B_m) + (C * (A * -4.0)) tmp = 0 if B_m <= 4e-102: tmp = ((t_0 * 0.0) - (t_0 * math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0) else: tmp = ((0.0 - math.sqrt(2.0)) / B_m) * math.sqrt((B_m * (0.0 - F))) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(B_m * B_m) + Float64(C * Float64(A * -4.0))) tmp = 0.0 if (B_m <= 4e-102) tmp = Float64(Float64(Float64(t_0 * 0.0) - Float64(t_0 * sqrt(Float64(-16.0 * Float64(F * Float64(C * Float64(A * A))))))) / Float64(t_0 * t_0)); else tmp = Float64(Float64(Float64(0.0 - sqrt(2.0)) / B_m) * sqrt(Float64(B_m * Float64(0.0 - F)))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (B_m * B_m) + (C * (A * -4.0));
tmp = 0.0;
if (B_m <= 4e-102)
tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
else
tmp = ((0.0 - sqrt(2.0)) / B_m) * sqrt((B_m * (0.0 - F)));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 4e-102], N[(N[(N[(t$95$0 * 0.0), $MachinePrecision] - N[(t$95$0 * N[Sqrt[N[(-16.0 * N[(F * N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / B$95$m), $MachinePrecision] * N[Sqrt[N[(B$95$m * N[(0.0 - F), $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 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\
\mathbf{if}\;B\_m \leq 4 \cdot 10^{-102}:\\
\;\;\;\;\frac{t\_0 \cdot 0 - t\_0 \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{t\_0 \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{0 - \sqrt{2}}{B\_m} \cdot \sqrt{B\_m \cdot \left(0 - F\right)}\\
\end{array}
\end{array}
if B < 3.99999999999999973e-102Initial program 21.3%
neg-sub0N/A
div-subN/A
frac-subN/A
/-lowering-/.f64N/A
Applied egg-rr16.4%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f648.0%
Simplified8.0%
if 3.99999999999999973e-102 < B Initial program 19.0%
Taylor expanded in C around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
*-lowering-*.f64N/A
Simplified38.2%
Taylor expanded in A around 0
mul-1-negN/A
neg-lowering-neg.f6434.6%
Simplified34.6%
Final simplification17.3%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* -4.0 (* A C)))
(t_1 (+ (* B_m B_m) t_0))
(t_2 (+ (* B_m B_m) (* C (* A -4.0)))))
(if (<= B_m 4.2e-91)
(/
(- (* t_2 0.0) (* t_2 (sqrt (* (* A -8.0) (* (+ A A) (* C F))))))
(* t_2 t_2))
(if (<= B_m 2.9e+102)
(*
(/ t_1 t_1)
(/
(sqrt (* F (* -2.0 (* B_m (* B_m B_m)))))
(- (* B_m (- 0.0 B_m)) t_0)))
(* (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) {
double t_0 = -4.0 * (A * C);
double t_1 = (B_m * B_m) + t_0;
double t_2 = (B_m * B_m) + (C * (A * -4.0));
double tmp;
if (B_m <= 4.2e-91) {
tmp = ((t_2 * 0.0) - (t_2 * sqrt(((A * -8.0) * ((A + A) * (C * F)))))) / (t_2 * t_2);
} else if (B_m <= 2.9e+102) {
tmp = (t_1 / t_1) * (sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0));
} else {
tmp = sqrt((A * 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) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (-4.0d0) * (a * c)
t_1 = (b_m * b_m) + t_0
t_2 = (b_m * b_m) + (c * (a * (-4.0d0)))
if (b_m <= 4.2d-91) then
tmp = ((t_2 * 0.0d0) - (t_2 * sqrt(((a * (-8.0d0)) * ((a + a) * (c * f)))))) / (t_2 * t_2)
else if (b_m <= 2.9d+102) then
tmp = (t_1 / t_1) * (sqrt((f * ((-2.0d0) * (b_m * (b_m * b_m))))) / ((b_m * (0.0d0 - b_m)) - t_0))
else
tmp = sqrt((a * 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 t_0 = -4.0 * (A * C);
double t_1 = (B_m * B_m) + t_0;
double t_2 = (B_m * B_m) + (C * (A * -4.0));
double tmp;
if (B_m <= 4.2e-91) {
tmp = ((t_2 * 0.0) - (t_2 * Math.sqrt(((A * -8.0) * ((A + A) * (C * F)))))) / (t_2 * t_2);
} else if (B_m <= 2.9e+102) {
tmp = (t_1 / t_1) * (Math.sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0));
} else {
tmp = Math.sqrt((A * 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): t_0 = -4.0 * (A * C) t_1 = (B_m * B_m) + t_0 t_2 = (B_m * B_m) + (C * (A * -4.0)) tmp = 0 if B_m <= 4.2e-91: tmp = ((t_2 * 0.0) - (t_2 * math.sqrt(((A * -8.0) * ((A + A) * (C * F)))))) / (t_2 * t_2) elif B_m <= 2.9e+102: tmp = (t_1 / t_1) * (math.sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0)) else: tmp = math.sqrt((A * 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) t_0 = Float64(-4.0 * Float64(A * C)) t_1 = Float64(Float64(B_m * B_m) + t_0) t_2 = Float64(Float64(B_m * B_m) + Float64(C * Float64(A * -4.0))) tmp = 0.0 if (B_m <= 4.2e-91) tmp = Float64(Float64(Float64(t_2 * 0.0) - Float64(t_2 * sqrt(Float64(Float64(A * -8.0) * Float64(Float64(A + A) * Float64(C * F)))))) / Float64(t_2 * t_2)); elseif (B_m <= 2.9e+102) tmp = Float64(Float64(t_1 / t_1) * Float64(sqrt(Float64(F * Float64(-2.0 * Float64(B_m * Float64(B_m * B_m))))) / Float64(Float64(B_m * Float64(0.0 - B_m)) - t_0))); else tmp = Float64(sqrt(Float64(A * F)) * 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)
t_0 = -4.0 * (A * C);
t_1 = (B_m * B_m) + t_0;
t_2 = (B_m * B_m) + (C * (A * -4.0));
tmp = 0.0;
if (B_m <= 4.2e-91)
tmp = ((t_2 * 0.0) - (t_2 * sqrt(((A * -8.0) * ((A + A) * (C * F)))))) / (t_2 * t_2);
elseif (B_m <= 2.9e+102)
tmp = (t_1 / t_1) * (sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0));
else
tmp = sqrt((A * 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_] := Block[{t$95$0 = N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 4.2e-91], N[(N[(N[(t$95$2 * 0.0), $MachinePrecision] - N[(t$95$2 * N[Sqrt[N[(N[(A * -8.0), $MachinePrecision] * N[(N[(A + A), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$2 * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 2.9e+102], N[(N[(t$95$1 / t$95$1), $MachinePrecision] * N[(N[Sqrt[N[(F * N[(-2.0 * N[(B$95$m * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(B$95$m * N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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])\\
\\
\begin{array}{l}
t_0 := -4 \cdot \left(A \cdot C\right)\\
t_1 := B\_m \cdot B\_m + t\_0\\
t_2 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\
\mathbf{if}\;B\_m \leq 4.2 \cdot 10^{-91}:\\
\;\;\;\;\frac{t\_2 \cdot 0 - t\_2 \cdot \sqrt{\left(A \cdot -8\right) \cdot \left(\left(A + A\right) \cdot \left(C \cdot F\right)\right)}}{t\_2 \cdot t\_2}\\
\mathbf{elif}\;B\_m \leq 2.9 \cdot 10^{+102}:\\
\;\;\;\;\frac{t\_1}{t\_1} \cdot \frac{\sqrt{F \cdot \left(-2 \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{B\_m \cdot \left(0 - B\_m\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot F} \cdot \frac{-2}{B\_m}\\
\end{array}
\end{array}
if B < 4.1999999999999998e-91Initial program 21.4%
neg-sub0N/A
div-subN/A
frac-subN/A
/-lowering-/.f64N/A
Applied egg-rr16.5%
Taylor expanded in C around inf
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cancel-sign-sub-invN/A
+-lowering-+.f64N/A
metadata-evalN/A
*-lowering-*.f649.6%
Simplified9.6%
if 4.1999999999999998e-91 < B < 2.9000000000000002e102Initial program 31.0%
neg-sub0N/A
div-subN/A
frac-subN/A
/-lowering-/.f64N/A
Applied egg-rr28.7%
Taylor expanded in B around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6418.0%
Simplified18.0%
mul0-lftN/A
neg-sub0N/A
distribute-rgt-neg-inN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr25.4%
if 2.9000000000000002e102 < B Initial program 5.4%
Taylor expanded in C around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
*-lowering-*.f64N/A
Simplified37.2%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
frac-2negN/A
metadata-evalN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
metadata-evalN/A
frac-2negN/A
/-lowering-/.f6437.2%
Applied egg-rr37.2%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
unpow2N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
metadata-evalN/A
/-lowering-/.f642.1%
Simplified2.1%
Final simplification11.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
(let* ((t_0 (* -4.0 (* A C)))
(t_1 (+ (* B_m B_m) t_0))
(t_2 (+ (* B_m B_m) (* C (* A -4.0)))))
(if (<= B_m 4.2e-103)
(/
(- (* t_2 0.0) (* t_2 (sqrt (* -16.0 (* F (* C (* A A)))))))
(* t_2 t_2))
(if (<= B_m 4.2e+102)
(*
(/ t_1 t_1)
(/
(sqrt (* F (* -2.0 (* B_m (* B_m B_m)))))
(- (* B_m (- 0.0 B_m)) t_0)))
(* (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) {
double t_0 = -4.0 * (A * C);
double t_1 = (B_m * B_m) + t_0;
double t_2 = (B_m * B_m) + (C * (A * -4.0));
double tmp;
if (B_m <= 4.2e-103) {
tmp = ((t_2 * 0.0) - (t_2 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_2 * t_2);
} else if (B_m <= 4.2e+102) {
tmp = (t_1 / t_1) * (sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0));
} else {
tmp = sqrt((A * 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) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (-4.0d0) * (a * c)
t_1 = (b_m * b_m) + t_0
t_2 = (b_m * b_m) + (c * (a * (-4.0d0)))
if (b_m <= 4.2d-103) then
tmp = ((t_2 * 0.0d0) - (t_2 * sqrt(((-16.0d0) * (f * (c * (a * a))))))) / (t_2 * t_2)
else if (b_m <= 4.2d+102) then
tmp = (t_1 / t_1) * (sqrt((f * ((-2.0d0) * (b_m * (b_m * b_m))))) / ((b_m * (0.0d0 - b_m)) - t_0))
else
tmp = sqrt((a * 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 t_0 = -4.0 * (A * C);
double t_1 = (B_m * B_m) + t_0;
double t_2 = (B_m * B_m) + (C * (A * -4.0));
double tmp;
if (B_m <= 4.2e-103) {
tmp = ((t_2 * 0.0) - (t_2 * Math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_2 * t_2);
} else if (B_m <= 4.2e+102) {
tmp = (t_1 / t_1) * (Math.sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0));
} else {
tmp = Math.sqrt((A * 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): t_0 = -4.0 * (A * C) t_1 = (B_m * B_m) + t_0 t_2 = (B_m * B_m) + (C * (A * -4.0)) tmp = 0 if B_m <= 4.2e-103: tmp = ((t_2 * 0.0) - (t_2 * math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_2 * t_2) elif B_m <= 4.2e+102: tmp = (t_1 / t_1) * (math.sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0)) else: tmp = math.sqrt((A * 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) t_0 = Float64(-4.0 * Float64(A * C)) t_1 = Float64(Float64(B_m * B_m) + t_0) t_2 = Float64(Float64(B_m * B_m) + Float64(C * Float64(A * -4.0))) tmp = 0.0 if (B_m <= 4.2e-103) tmp = Float64(Float64(Float64(t_2 * 0.0) - Float64(t_2 * sqrt(Float64(-16.0 * Float64(F * Float64(C * Float64(A * A))))))) / Float64(t_2 * t_2)); elseif (B_m <= 4.2e+102) tmp = Float64(Float64(t_1 / t_1) * Float64(sqrt(Float64(F * Float64(-2.0 * Float64(B_m * Float64(B_m * B_m))))) / Float64(Float64(B_m * Float64(0.0 - B_m)) - t_0))); else tmp = Float64(sqrt(Float64(A * F)) * 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)
t_0 = -4.0 * (A * C);
t_1 = (B_m * B_m) + t_0;
t_2 = (B_m * B_m) + (C * (A * -4.0));
tmp = 0.0;
if (B_m <= 4.2e-103)
tmp = ((t_2 * 0.0) - (t_2 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_2 * t_2);
elseif (B_m <= 4.2e+102)
tmp = (t_1 / t_1) * (sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0));
else
tmp = sqrt((A * 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_] := Block[{t$95$0 = N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 4.2e-103], N[(N[(N[(t$95$2 * 0.0), $MachinePrecision] - N[(t$95$2 * N[Sqrt[N[(-16.0 * N[(F * N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$2 * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 4.2e+102], N[(N[(t$95$1 / t$95$1), $MachinePrecision] * N[(N[Sqrt[N[(F * N[(-2.0 * N[(B$95$m * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(B$95$m * N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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])\\
\\
\begin{array}{l}
t_0 := -4 \cdot \left(A \cdot C\right)\\
t_1 := B\_m \cdot B\_m + t\_0\\
t_2 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\
\mathbf{if}\;B\_m \leq 4.2 \cdot 10^{-103}:\\
\;\;\;\;\frac{t\_2 \cdot 0 - t\_2 \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{t\_2 \cdot t\_2}\\
\mathbf{elif}\;B\_m \leq 4.2 \cdot 10^{+102}:\\
\;\;\;\;\frac{t\_1}{t\_1} \cdot \frac{\sqrt{F \cdot \left(-2 \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{B\_m \cdot \left(0 - B\_m\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot F} \cdot \frac{-2}{B\_m}\\
\end{array}
\end{array}
if B < 4.20000000000000009e-103Initial program 21.3%
neg-sub0N/A
div-subN/A
frac-subN/A
/-lowering-/.f64N/A
Applied egg-rr16.4%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f648.0%
Simplified8.0%
if 4.20000000000000009e-103 < B < 4.20000000000000003e102Initial program 30.1%
neg-sub0N/A
div-subN/A
frac-subN/A
/-lowering-/.f64N/A
Applied egg-rr27.8%
Taylor expanded in B around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6416.1%
Simplified16.1%
mul0-lftN/A
neg-sub0N/A
distribute-rgt-neg-inN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr25.1%
if 4.20000000000000003e102 < B Initial program 5.4%
Taylor expanded in C around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
*-lowering-*.f64N/A
Simplified37.2%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
frac-2negN/A
metadata-evalN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
metadata-evalN/A
frac-2negN/A
/-lowering-/.f6437.2%
Applied egg-rr37.2%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
unpow2N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
metadata-evalN/A
/-lowering-/.f642.1%
Simplified2.1%
Final simplification10.4%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* -4.0 (* A C))) (t_1 (+ (* B_m B_m) t_0)))
(if (<= A -3.9e+33)
(* (sqrt (* A F)) (/ -2.0 B_m))
(*
(/ t_1 t_1)
(/
(sqrt (* F (* -2.0 (* B_m (* B_m B_m)))))
(- (* B_m (- 0.0 B_m)) t_0))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = -4.0 * (A * C);
double t_1 = (B_m * B_m) + t_0;
double tmp;
if (A <= -3.9e+33) {
tmp = sqrt((A * F)) * (-2.0 / B_m);
} else {
tmp = (t_1 / t_1) * (sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0));
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-4.0d0) * (a * c)
t_1 = (b_m * b_m) + t_0
if (a <= (-3.9d+33)) then
tmp = sqrt((a * f)) * ((-2.0d0) / b_m)
else
tmp = (t_1 / t_1) * (sqrt((f * ((-2.0d0) * (b_m * (b_m * b_m))))) / ((b_m * (0.0d0 - b_m)) - t_0))
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = -4.0 * (A * C);
double t_1 = (B_m * B_m) + t_0;
double tmp;
if (A <= -3.9e+33) {
tmp = Math.sqrt((A * F)) * (-2.0 / B_m);
} else {
tmp = (t_1 / t_1) * (Math.sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = -4.0 * (A * C) t_1 = (B_m * B_m) + t_0 tmp = 0 if A <= -3.9e+33: tmp = math.sqrt((A * F)) * (-2.0 / B_m) else: tmp = (t_1 / t_1) * (math.sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(-4.0 * Float64(A * C)) t_1 = Float64(Float64(B_m * B_m) + t_0) tmp = 0.0 if (A <= -3.9e+33) tmp = Float64(sqrt(Float64(A * F)) * Float64(-2.0 / B_m)); else tmp = Float64(Float64(t_1 / t_1) * Float64(sqrt(Float64(F * Float64(-2.0 * Float64(B_m * Float64(B_m * B_m))))) / Float64(Float64(B_m * Float64(0.0 - B_m)) - t_0))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = -4.0 * (A * C);
t_1 = (B_m * B_m) + t_0;
tmp = 0.0;
if (A <= -3.9e+33)
tmp = sqrt((A * F)) * (-2.0 / B_m);
else
tmp = (t_1 / t_1) * (sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + t$95$0), $MachinePrecision]}, If[LessEqual[A, -3.9e+33], N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * N[(-2.0 / B$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 / t$95$1), $MachinePrecision] * N[(N[Sqrt[N[(F * N[(-2.0 * N[(B$95$m * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(B$95$m * N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := -4 \cdot \left(A \cdot C\right)\\
t_1 := B\_m \cdot B\_m + t\_0\\
\mathbf{if}\;A \leq -3.9 \cdot 10^{+33}:\\
\;\;\;\;\sqrt{A \cdot F} \cdot \frac{-2}{B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{t\_1} \cdot \frac{\sqrt{F \cdot \left(-2 \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{B\_m \cdot \left(0 - B\_m\right) - t\_0}\\
\end{array}
\end{array}
if A < -3.9000000000000002e33Initial program 17.5%
Taylor expanded in C around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
*-lowering-*.f64N/A
Simplified8.2%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
frac-2negN/A
metadata-evalN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
metadata-evalN/A
frac-2negN/A
/-lowering-/.f648.2%
Applied egg-rr8.2%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
unpow2N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
metadata-evalN/A
/-lowering-/.f648.4%
Simplified8.4%
if -3.9000000000000002e33 < A Initial program 21.2%
neg-sub0N/A
div-subN/A
frac-subN/A
/-lowering-/.f64N/A
Applied egg-rr14.5%
Taylor expanded in B around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f644.5%
Simplified4.5%
mul0-lftN/A
neg-sub0N/A
distribute-rgt-neg-inN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr6.8%
Final simplification7.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.5%
Taylor expanded in C around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
*-lowering-*.f64N/A
Simplified15.2%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
frac-2negN/A
metadata-evalN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
metadata-evalN/A
frac-2negN/A
/-lowering-/.f6415.2%
Applied egg-rr15.2%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
unpow2N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
metadata-evalN/A
/-lowering-/.f642.8%
Simplified2.8%
Final simplification2.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 (pow (/ 2.0 (/ B_m F)) 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) {
return pow((2.0 / (B_m / F)), 0.5);
}
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 = (2.0d0 / (b_m / f)) ** 0.5d0
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.pow((2.0 / (B_m / F)), 0.5);
}
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.pow((2.0 / (B_m / F)), 0.5)
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return Float64(2.0 / Float64(B_m / F)) ^ 0.5 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 = (2.0 / (B_m / F)) ^ 0.5;
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[Power[N[(2.0 / N[(B$95$m / F), $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])\\
\\
{\left(\frac{2}{\frac{B\_m}{F}}\right)}^{0.5}
\end{array}
Initial program 20.5%
Taylor expanded in B around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
unpow2N/A
rem-square-sqrtN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f641.9%
Simplified1.9%
*-commutativeN/A
mul-1-negN/A
cancel-sign-subN/A
+-lowering-+.f64N/A
sqrt-unprodN/A
rem-square-sqrtN/A
sqr-negN/A
mul-1-negN/A
mul-1-negN/A
rem-square-sqrtN/A
swap-sqrN/A
*-commutativeN/A
*-commutativeN/A
+-lft-identityN/A
+-commutativeN/A
distribute-rgt-outN/A
Applied egg-rr1.9%
+-lft-identityN/A
pow1/2N/A
metadata-evalN/A
pow-lowering-pow.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval2.0%
Applied egg-rr2.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 (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.5%
Taylor expanded in B around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
unpow2N/A
rem-square-sqrtN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f641.9%
Simplified1.9%
*-commutativeN/A
mul-1-negN/A
cancel-sign-subN/A
+-lowering-+.f64N/A
sqrt-unprodN/A
rem-square-sqrtN/A
sqr-negN/A
mul-1-negN/A
mul-1-negN/A
rem-square-sqrtN/A
swap-sqrN/A
*-commutativeN/A
*-commutativeN/A
+-lft-identityN/A
+-commutativeN/A
distribute-rgt-outN/A
Applied egg-rr1.9%
+-lft-identityN/A
sqrt-lowering-sqrt.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f641.9%
Applied egg-rr1.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(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((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[(F * N[(2.0 / 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{F \cdot \frac{2}{B\_m}}
\end{array}
Initial program 20.5%
Taylor expanded in B around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
unpow2N/A
rem-square-sqrtN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f641.9%
Simplified1.9%
*-commutativeN/A
mul-1-negN/A
cancel-sign-subN/A
+-lowering-+.f64N/A
sqrt-unprodN/A
rem-square-sqrtN/A
sqr-negN/A
mul-1-negN/A
mul-1-negN/A
rem-square-sqrtN/A
swap-sqrN/A
*-commutativeN/A
*-commutativeN/A
+-lft-identityN/A
+-commutativeN/A
distribute-rgt-outN/A
Applied egg-rr1.9%
+-lft-identityN/A
sqrt-lowering-sqrt.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f641.9%
Applied egg-rr1.9%
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f641.9%
Applied egg-rr1.9%
Final simplification1.9%
herbie shell --seed 2024185
(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))))