
(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 14 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 (- t_0 (pow B_m 2.0)))
(t_2
(/
(sqrt
(*
(* 2.0 (* (- (pow B_m 2.0) t_0) F))
(+ (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
t_1)))
(if (<= t_2 -1e-173)
(*
(*
(sqrt F)
(sqrt
(/ (+ (+ A C) (hypot B_m (- A C))) (fma -4.0 (* A C) (pow B_m 2.0)))))
(- (sqrt 2.0)))
(if (<= t_2 INFINITY)
(/
(*
(sqrt (fma 2.0 C (* -0.5 (/ (pow B_m 2.0) A))))
(sqrt (* 2.0 (* F (- (pow B_m 2.0) (* 4.0 (* A C)))))))
t_1)
(*
(* (sqrt F) (sqrt (+ C (hypot B_m C))))
(/ -1.0 (* B_m (pow 2.0 -0.5))))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = t_0 - pow(B_m, 2.0);
double t_2 = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * ((A + C) + sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / t_1;
double tmp;
if (t_2 <= -1e-173) {
tmp = (sqrt(F) * sqrt((((A + C) + hypot(B_m, (A - C))) / fma(-4.0, (A * C), pow(B_m, 2.0))))) * -sqrt(2.0);
} else if (t_2 <= ((double) INFINITY)) {
tmp = (sqrt(fma(2.0, C, (-0.5 * (pow(B_m, 2.0) / A)))) * sqrt((2.0 * (F * (pow(B_m, 2.0) - (4.0 * (A * C))))))) / t_1;
} else {
tmp = (sqrt(F) * sqrt((C + hypot(B_m, C)))) * (-1.0 / (B_m * pow(2.0, -0.5)));
}
return tmp;
}
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) t_1 = Float64(t_0 - (B_m ^ 2.0)) t_2 = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(Float64(A + C) + sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / t_1) tmp = 0.0 if (t_2 <= -1e-173) tmp = Float64(Float64(sqrt(F) * sqrt(Float64(Float64(Float64(A + C) + hypot(B_m, Float64(A - C))) / fma(-4.0, Float64(A * C), (B_m ^ 2.0))))) * Float64(-sqrt(2.0))); elseif (t_2 <= Inf) tmp = Float64(Float64(sqrt(fma(2.0, C, Float64(-0.5 * Float64((B_m ^ 2.0) / A)))) * sqrt(Float64(2.0 * Float64(F * Float64((B_m ^ 2.0) - Float64(4.0 * Float64(A * C))))))) / t_1); else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(C + hypot(B_m, C)))) * Float64(-1.0 / Float64(B_m * (2.0 ^ -0.5)))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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[(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$1), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-173], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / N[(-4.0 * N[(A * C), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(N[Sqrt[N[(2.0 * C + N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(F * N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[(B$95$m * N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := t\_0 - {B\_m}^{2}\\
t_2 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_1}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-173}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{\frac{\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)}{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}}\right) \cdot \left(-\sqrt{2}\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(2, C, -0.5 \cdot \frac{{B\_m}^{2}}{A}\right)} \cdot \sqrt{2 \cdot \left(F \cdot \left({B\_m}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)}}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B\_m, C\right)}\right) \cdot \frac{-1}{B\_m \cdot {2}^{-0.5}}\\
\end{array}
\end{array}
if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -1e-173Initial program 43.4%
Taylor expanded in F around 0 48.5%
mul-1-neg48.5%
unpow248.5%
unpow248.5%
hypot-undefine61.6%
cancel-sign-sub-inv61.6%
metadata-eval61.6%
Simplified61.6%
pow1/261.6%
associate-/l*67.3%
unpow-prod-down80.1%
pow1/280.1%
associate-+r+79.2%
+-commutative79.2%
fma-define79.2%
Applied egg-rr79.2%
unpow1/279.2%
Simplified79.2%
if -1e-173 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < +inf.0Initial program 12.7%
Taylor expanded in A around -inf 33.9%
pow1/233.9%
*-commutative33.9%
unpow-prod-down28.7%
pow1/228.6%
+-commutative28.6%
fma-define28.6%
pow1/228.6%
associate-*l*28.6%
Applied egg-rr28.6%
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) Initial program 0.0%
Taylor expanded in A around 0 2.1%
mul-1-neg2.1%
Simplified2.1%
pow1/22.2%
*-commutative2.2%
unpow-prod-down2.1%
pow1/22.1%
unpow22.1%
unpow22.1%
hypot-define26.3%
pow1/226.3%
Applied egg-rr26.3%
clear-num26.3%
inv-pow26.3%
Applied egg-rr26.3%
unpow-126.3%
Simplified26.3%
div-inv26.2%
pow1/226.2%
metadata-eval26.2%
metadata-eval26.2%
sqrt-pow226.2%
pow-flip26.2%
sqrt-pow226.3%
metadata-eval26.3%
metadata-eval26.3%
metadata-eval26.3%
Applied egg-rr26.3%
Final simplification43.9%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* (* 4.0 A) C))
(t_1 (- t_0 (pow B_m 2.0)))
(t_2 (* 2.0 (* (- (pow B_m 2.0) t_0) F))))
(if (<= B_m 3.6e-227)
(/ (sqrt (* t_2 (* 2.0 C))) t_1)
(if (<= B_m 4.2e-142)
(* (sqrt 2.0) (- (sqrt (* -0.5 (/ F A)))))
(if (<= B_m 2.7e-39)
(/ (sqrt (* t_2 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))) t_1)
(if (<= B_m 4.2e+151)
(*
(*
(sqrt F)
(sqrt
(/
(+ (+ A C) (hypot B_m (- A C)))
(fma -4.0 (* A C) (pow B_m 2.0)))))
(- (sqrt 2.0)))
(*
(* (sqrt F) (sqrt (+ C (hypot B_m C))))
(/ -1.0 (* B_m (pow 2.0 -0.5))))))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = t_0 - pow(B_m, 2.0);
double t_2 = 2.0 * ((pow(B_m, 2.0) - t_0) * F);
double tmp;
if (B_m <= 3.6e-227) {
tmp = sqrt((t_2 * (2.0 * C))) / t_1;
} else if (B_m <= 4.2e-142) {
tmp = sqrt(2.0) * -sqrt((-0.5 * (F / A)));
} else if (B_m <= 2.7e-39) {
tmp = sqrt((t_2 * ((-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C)))) / t_1;
} else if (B_m <= 4.2e+151) {
tmp = (sqrt(F) * sqrt((((A + C) + hypot(B_m, (A - C))) / fma(-4.0, (A * C), pow(B_m, 2.0))))) * -sqrt(2.0);
} else {
tmp = (sqrt(F) * sqrt((C + hypot(B_m, C)))) * (-1.0 / (B_m * pow(2.0, -0.5)));
}
return tmp;
}
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) t_1 = Float64(t_0 - (B_m ^ 2.0)) t_2 = Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) tmp = 0.0 if (B_m <= 3.6e-227) tmp = Float64(sqrt(Float64(t_2 * Float64(2.0 * C))) / t_1); elseif (B_m <= 4.2e-142) tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(-0.5 * Float64(F / A))))); elseif (B_m <= 2.7e-39) tmp = Float64(sqrt(Float64(t_2 * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C)))) / t_1); elseif (B_m <= 4.2e+151) tmp = Float64(Float64(sqrt(F) * sqrt(Float64(Float64(Float64(A + C) + hypot(B_m, Float64(A - C))) / fma(-4.0, Float64(A * C), (B_m ^ 2.0))))) * Float64(-sqrt(2.0))); else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(C + hypot(B_m, C)))) * Float64(-1.0 / Float64(B_m * (2.0 ^ -0.5)))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 3.6e-227], N[(N[Sqrt[N[(t$95$2 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B$95$m, 4.2e-142], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[B$95$m, 2.7e-39], N[(N[Sqrt[N[(t$95$2 * N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B$95$m, 4.2e+151], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / N[(-4.0 * N[(A * C), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[(B$95$m * N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := t\_0 - {B\_m}^{2}\\
t_2 := 2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\\
\mathbf{if}\;B\_m \leq 3.6 \cdot 10^{-227}:\\
\;\;\;\;\frac{\sqrt{t\_2 \cdot \left(2 \cdot C\right)}}{t\_1}\\
\mathbf{elif}\;B\_m \leq 4.2 \cdot 10^{-142}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{-0.5 \cdot \frac{F}{A}}\right)\\
\mathbf{elif}\;B\_m \leq 2.7 \cdot 10^{-39}:\\
\;\;\;\;\frac{\sqrt{t\_2 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)}}{t\_1}\\
\mathbf{elif}\;B\_m \leq 4.2 \cdot 10^{+151}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{\frac{\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)}{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}}\right) \cdot \left(-\sqrt{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B\_m, C\right)}\right) \cdot \frac{-1}{B\_m \cdot {2}^{-0.5}}\\
\end{array}
\end{array}
if B < 3.5999999999999999e-227Initial program 17.7%
Taylor expanded in A around -inf 16.9%
if 3.5999999999999999e-227 < B < 4.1999999999999999e-142Initial program 12.1%
Taylor expanded in F around 0 18.5%
mul-1-neg18.5%
unpow218.5%
unpow218.5%
hypot-undefine19.7%
cancel-sign-sub-inv19.7%
metadata-eval19.7%
Simplified19.7%
Taylor expanded in A around -inf 21.0%
if 4.1999999999999999e-142 < B < 2.7000000000000001e-39Initial program 26.8%
Taylor expanded in A around -inf 32.3%
if 2.7000000000000001e-39 < B < 4.2000000000000001e151Initial program 35.7%
Taylor expanded in F around 0 36.2%
mul-1-neg36.2%
unpow236.2%
unpow236.2%
hypot-undefine48.7%
cancel-sign-sub-inv48.7%
metadata-eval48.7%
Simplified48.7%
pow1/248.7%
associate-/l*52.5%
unpow-prod-down60.1%
pow1/260.1%
associate-+r+59.5%
+-commutative59.5%
fma-define59.5%
Applied egg-rr59.5%
unpow1/259.5%
Simplified59.5%
if 4.2000000000000001e151 < B Initial program 0.0%
Taylor expanded in A around 0 2.6%
mul-1-neg2.6%
Simplified2.6%
pow1/22.7%
*-commutative2.7%
unpow-prod-down2.6%
pow1/22.6%
unpow22.6%
unpow22.6%
hypot-define65.3%
pow1/265.3%
Applied egg-rr65.3%
clear-num65.1%
inv-pow65.1%
Applied egg-rr65.1%
unpow-165.1%
Simplified65.1%
div-inv64.9%
pow1/264.9%
metadata-eval64.9%
metadata-eval64.9%
sqrt-pow264.9%
pow-flip64.9%
sqrt-pow265.3%
metadata-eval65.3%
metadata-eval65.3%
metadata-eval65.3%
Applied egg-rr65.3%
Final simplification29.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 (- t_0 (pow B_m 2.0)))
(t_2 (* 2.0 (* (- (pow B_m 2.0) t_0) F))))
(if (<= B_m 1e-226)
(/ (sqrt (* t_2 (* 2.0 C))) t_1)
(if (<= B_m 1.08e-144)
(* (sqrt 2.0) (- (sqrt (* -0.5 (/ F A)))))
(if (<= B_m 9.2e+23)
(/ (sqrt (* t_2 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))) t_1)
(*
(* (sqrt F) (sqrt (+ C (hypot B_m C))))
(/ (sqrt 2.0) (- B_m))))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = t_0 - pow(B_m, 2.0);
double t_2 = 2.0 * ((pow(B_m, 2.0) - t_0) * F);
double tmp;
if (B_m <= 1e-226) {
tmp = sqrt((t_2 * (2.0 * C))) / t_1;
} else if (B_m <= 1.08e-144) {
tmp = sqrt(2.0) * -sqrt((-0.5 * (F / A)));
} else if (B_m <= 9.2e+23) {
tmp = sqrt((t_2 * ((-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C)))) / t_1;
} else {
tmp = (sqrt(F) * sqrt((C + hypot(B_m, C)))) * (sqrt(2.0) / -B_m);
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = t_0 - Math.pow(B_m, 2.0);
double t_2 = 2.0 * ((Math.pow(B_m, 2.0) - t_0) * F);
double tmp;
if (B_m <= 1e-226) {
tmp = Math.sqrt((t_2 * (2.0 * C))) / t_1;
} else if (B_m <= 1.08e-144) {
tmp = Math.sqrt(2.0) * -Math.sqrt((-0.5 * (F / A)));
} else if (B_m <= 9.2e+23) {
tmp = Math.sqrt((t_2 * ((-0.5 * (Math.pow(B_m, 2.0) / A)) + (2.0 * C)))) / t_1;
} else {
tmp = (Math.sqrt(F) * Math.sqrt((C + Math.hypot(B_m, C)))) * (Math.sqrt(2.0) / -B_m);
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (4.0 * A) * C t_1 = t_0 - math.pow(B_m, 2.0) t_2 = 2.0 * ((math.pow(B_m, 2.0) - t_0) * F) tmp = 0 if B_m <= 1e-226: tmp = math.sqrt((t_2 * (2.0 * C))) / t_1 elif B_m <= 1.08e-144: tmp = math.sqrt(2.0) * -math.sqrt((-0.5 * (F / A))) elif B_m <= 9.2e+23: tmp = math.sqrt((t_2 * ((-0.5 * (math.pow(B_m, 2.0) / A)) + (2.0 * C)))) / t_1 else: tmp = (math.sqrt(F) * math.sqrt((C + math.hypot(B_m, C)))) * (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(4.0 * A) * C) t_1 = Float64(t_0 - (B_m ^ 2.0)) t_2 = Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) tmp = 0.0 if (B_m <= 1e-226) tmp = Float64(sqrt(Float64(t_2 * Float64(2.0 * C))) / t_1); elseif (B_m <= 1.08e-144) tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(-0.5 * Float64(F / A))))); elseif (B_m <= 9.2e+23) tmp = Float64(sqrt(Float64(t_2 * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C)))) / t_1); else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(C + hypot(B_m, C)))) * Float64(sqrt(2.0) / Float64(-B_m))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (4.0 * A) * C;
t_1 = t_0 - (B_m ^ 2.0);
t_2 = 2.0 * (((B_m ^ 2.0) - t_0) * F);
tmp = 0.0;
if (B_m <= 1e-226)
tmp = sqrt((t_2 * (2.0 * C))) / t_1;
elseif (B_m <= 1.08e-144)
tmp = sqrt(2.0) * -sqrt((-0.5 * (F / A)));
elseif (B_m <= 9.2e+23)
tmp = sqrt((t_2 * ((-0.5 * ((B_m ^ 2.0) / A)) + (2.0 * C)))) / t_1;
else
tmp = (sqrt(F) * sqrt((C + hypot(B_m, C)))) * (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[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1e-226], N[(N[Sqrt[N[(t$95$2 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B$95$m, 1.08e-144], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[B$95$m, 9.2e+23], N[(N[Sqrt[N[(t$95$2 * N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := t\_0 - {B\_m}^{2}\\
t_2 := 2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\\
\mathbf{if}\;B\_m \leq 10^{-226}:\\
\;\;\;\;\frac{\sqrt{t\_2 \cdot \left(2 \cdot C\right)}}{t\_1}\\
\mathbf{elif}\;B\_m \leq 1.08 \cdot 10^{-144}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{-0.5 \cdot \frac{F}{A}}\right)\\
\mathbf{elif}\;B\_m \leq 9.2 \cdot 10^{+23}:\\
\;\;\;\;\frac{\sqrt{t\_2 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)}}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B\_m, C\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\
\end{array}
\end{array}
if B < 9.99999999999999921e-227Initial program 17.7%
Taylor expanded in A around -inf 16.9%
if 9.99999999999999921e-227 < B < 1.08e-144Initial program 12.1%
Taylor expanded in F around 0 18.5%
mul-1-neg18.5%
unpow218.5%
unpow218.5%
hypot-undefine19.7%
cancel-sign-sub-inv19.7%
metadata-eval19.7%
Simplified19.7%
Taylor expanded in A around -inf 21.0%
if 1.08e-144 < B < 9.2000000000000002e23Initial program 32.1%
Taylor expanded in A around -inf 31.1%
if 9.2000000000000002e23 < B Initial program 10.0%
Taylor expanded in A around 0 15.7%
mul-1-neg15.7%
Simplified15.7%
pow1/215.7%
*-commutative15.7%
unpow-prod-down15.6%
pow1/215.6%
unpow215.6%
unpow215.6%
hypot-define58.1%
pow1/258.1%
Applied egg-rr58.1%
Final simplification27.3%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* (* 4.0 A) C))
(t_1
(/
(sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_0) F)) (* 2.0 C)))
(- t_0 (pow B_m 2.0)))))
(if (<= B_m 4.05e-227)
t_1
(if (<= B_m 2.2e-142)
(* (sqrt 2.0) (- (sqrt (* -0.5 (/ F A)))))
(if (<= B_m 1.4e-26)
t_1
(if (<= B_m 5.5e+142)
(-
(sqrt
(*
2.0
(*
F
(/
(+ (+ A C) (hypot B_m (- A C)))
(fma -4.0 (* A C) (pow B_m 2.0)))))))
(*
(* (sqrt F) (sqrt (+ C (hypot B_m C))))
(/ -1.0 (* B_m (pow 2.0 -0.5))))))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - pow(B_m, 2.0));
double tmp;
if (B_m <= 4.05e-227) {
tmp = t_1;
} else if (B_m <= 2.2e-142) {
tmp = sqrt(2.0) * -sqrt((-0.5 * (F / A)));
} else if (B_m <= 1.4e-26) {
tmp = t_1;
} else if (B_m <= 5.5e+142) {
tmp = -sqrt((2.0 * (F * (((A + C) + hypot(B_m, (A - C))) / fma(-4.0, (A * C), pow(B_m, 2.0))))));
} else {
tmp = (sqrt(F) * sqrt((C + hypot(B_m, C)))) * (-1.0 / (B_m * pow(2.0, -0.5)));
}
return tmp;
}
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) t_1 = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(2.0 * C))) / Float64(t_0 - (B_m ^ 2.0))) tmp = 0.0 if (B_m <= 4.05e-227) tmp = t_1; elseif (B_m <= 2.2e-142) tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(-0.5 * Float64(F / A))))); elseif (B_m <= 1.4e-26) tmp = t_1; elseif (B_m <= 5.5e+142) tmp = Float64(-sqrt(Float64(2.0 * Float64(F * Float64(Float64(Float64(A + C) + hypot(B_m, Float64(A - C))) / fma(-4.0, Float64(A * C), (B_m ^ 2.0))))))); else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(C + hypot(B_m, C)))) * Float64(-1.0 / Float64(B_m * (2.0 ^ -0.5)))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 4.05e-227], t$95$1, If[LessEqual[B$95$m, 2.2e-142], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[B$95$m, 1.4e-26], t$95$1, If[LessEqual[B$95$m, 5.5e+142], (-N[Sqrt[N[(2.0 * N[(F * N[(N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / N[(-4.0 * N[(A * C), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[(B$95$m * N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0 - {B\_m}^{2}}\\
\mathbf{if}\;B\_m \leq 4.05 \cdot 10^{-227}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;B\_m \leq 2.2 \cdot 10^{-142}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{-0.5 \cdot \frac{F}{A}}\right)\\
\mathbf{elif}\;B\_m \leq 1.4 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;B\_m \leq 5.5 \cdot 10^{+142}:\\
\;\;\;\;-\sqrt{2 \cdot \left(F \cdot \frac{\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)}{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B\_m, C\right)}\right) \cdot \frac{-1}{B\_m \cdot {2}^{-0.5}}\\
\end{array}
\end{array}
if B < 4.04999999999999993e-227 or 2.20000000000000016e-142 < B < 1.4000000000000001e-26Initial program 19.1%
Taylor expanded in A around -inf 19.0%
if 4.04999999999999993e-227 < B < 2.20000000000000016e-142Initial program 12.1%
Taylor expanded in F around 0 18.5%
mul-1-neg18.5%
unpow218.5%
unpow218.5%
hypot-undefine19.7%
cancel-sign-sub-inv19.7%
metadata-eval19.7%
Simplified19.7%
Taylor expanded in A around -inf 21.0%
if 1.4000000000000001e-26 < B < 5.50000000000000035e142Initial program 35.7%
Taylor expanded in F around 0 40.4%
mul-1-neg40.4%
unpow240.4%
unpow240.4%
hypot-undefine56.8%
cancel-sign-sub-inv56.8%
metadata-eval56.8%
Simplified56.8%
pow156.8%
sqrt-unprod56.5%
associate-/l*61.8%
associate-+r+61.8%
+-commutative61.8%
fma-define61.8%
Applied egg-rr61.8%
unpow161.8%
Simplified61.8%
if 5.50000000000000035e142 < B Initial program 2.8%
Taylor expanded in A around 0 7.8%
mul-1-neg7.8%
Simplified7.8%
pow1/27.8%
*-commutative7.8%
unpow-prod-down7.8%
pow1/27.8%
unpow27.8%
unpow27.8%
hypot-define65.6%
pow1/265.6%
Applied egg-rr65.6%
clear-num65.4%
inv-pow65.4%
Applied egg-rr65.4%
unpow-165.4%
Simplified65.4%
div-inv65.2%
pow1/265.2%
metadata-eval65.2%
metadata-eval65.2%
sqrt-pow265.2%
pow-flip65.2%
sqrt-pow265.5%
metadata-eval65.5%
metadata-eval65.5%
metadata-eval65.5%
Applied egg-rr65.5%
Final simplification29.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
(/
(sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_0) F)) (* 2.0 C)))
(- t_0 (pow B_m 2.0)))))
(if (<= B_m 4.6e-227)
t_1
(if (<= B_m 2.2e-140)
(* (sqrt 2.0) (- (sqrt (* -0.5 (/ F A)))))
(if (<= B_m 3.8e-51)
t_1
(*
(* (sqrt F) (sqrt (+ C (hypot B_m C))))
(/ (sqrt 2.0) (- B_m))))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - pow(B_m, 2.0));
double tmp;
if (B_m <= 4.6e-227) {
tmp = t_1;
} else if (B_m <= 2.2e-140) {
tmp = sqrt(2.0) * -sqrt((-0.5 * (F / A)));
} else if (B_m <= 3.8e-51) {
tmp = t_1;
} else {
tmp = (sqrt(F) * sqrt((C + hypot(B_m, C)))) * (sqrt(2.0) / -B_m);
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - Math.pow(B_m, 2.0));
double tmp;
if (B_m <= 4.6e-227) {
tmp = t_1;
} else if (B_m <= 2.2e-140) {
tmp = Math.sqrt(2.0) * -Math.sqrt((-0.5 * (F / A)));
} else if (B_m <= 3.8e-51) {
tmp = t_1;
} else {
tmp = (Math.sqrt(F) * Math.sqrt((C + Math.hypot(B_m, C)))) * (Math.sqrt(2.0) / -B_m);
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (4.0 * A) * C t_1 = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - math.pow(B_m, 2.0)) tmp = 0 if B_m <= 4.6e-227: tmp = t_1 elif B_m <= 2.2e-140: tmp = math.sqrt(2.0) * -math.sqrt((-0.5 * (F / A))) elif B_m <= 3.8e-51: tmp = t_1 else: tmp = (math.sqrt(F) * math.sqrt((C + math.hypot(B_m, C)))) * (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(4.0 * A) * C) t_1 = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(2.0 * C))) / Float64(t_0 - (B_m ^ 2.0))) tmp = 0.0 if (B_m <= 4.6e-227) tmp = t_1; elseif (B_m <= 2.2e-140) tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(-0.5 * Float64(F / A))))); elseif (B_m <= 3.8e-51) tmp = t_1; else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(C + hypot(B_m, C)))) * Float64(sqrt(2.0) / Float64(-B_m))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (4.0 * A) * C;
t_1 = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - (B_m ^ 2.0));
tmp = 0.0;
if (B_m <= 4.6e-227)
tmp = t_1;
elseif (B_m <= 2.2e-140)
tmp = sqrt(2.0) * -sqrt((-0.5 * (F / A)));
elseif (B_m <= 3.8e-51)
tmp = t_1;
else
tmp = (sqrt(F) * sqrt((C + hypot(B_m, C)))) * (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[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 4.6e-227], t$95$1, If[LessEqual[B$95$m, 2.2e-140], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[B$95$m, 3.8e-51], t$95$1, N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0 - {B\_m}^{2}}\\
\mathbf{if}\;B\_m \leq 4.6 \cdot 10^{-227}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;B\_m \leq 2.2 \cdot 10^{-140}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{-0.5 \cdot \frac{F}{A}}\right)\\
\mathbf{elif}\;B\_m \leq 3.8 \cdot 10^{-51}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B\_m, C\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\
\end{array}
\end{array}
if B < 4.60000000000000024e-227 or 2.1999999999999999e-140 < B < 3.80000000000000003e-51Initial program 18.7%
Taylor expanded in A around -inf 18.6%
if 4.60000000000000024e-227 < B < 2.1999999999999999e-140Initial program 12.1%
Taylor expanded in F around 0 18.5%
mul-1-neg18.5%
unpow218.5%
unpow218.5%
hypot-undefine19.7%
cancel-sign-sub-inv19.7%
metadata-eval19.7%
Simplified19.7%
Taylor expanded in A around -inf 21.0%
if 3.80000000000000003e-51 < B Initial program 15.6%
Taylor expanded in A around 0 19.6%
mul-1-neg19.6%
Simplified19.6%
pow1/219.6%
*-commutative19.6%
unpow-prod-down19.5%
pow1/219.5%
unpow219.5%
unpow219.5%
hypot-define54.0%
pow1/254.0%
Applied egg-rr54.0%
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
(/
(sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_0) F)) (* 2.0 C)))
(- t_0 (pow B_m 2.0)))))
(if (<= B_m 9e-227)
t_1
(if (<= B_m 6e-142)
(* (sqrt 2.0) (- (sqrt (* -0.5 (/ F A)))))
(if (<= B_m 2.15e-26) t_1 (* (sqrt (* 2.0 F)) (- (pow B_m -0.5))))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - pow(B_m, 2.0));
double tmp;
if (B_m <= 9e-227) {
tmp = t_1;
} else if (B_m <= 6e-142) {
tmp = sqrt(2.0) * -sqrt((-0.5 * (F / A)));
} else if (B_m <= 2.15e-26) {
tmp = t_1;
} else {
tmp = sqrt((2.0 * F)) * -pow(B_m, -0.5);
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (4.0d0 * a) * c
t_1 = sqrt(((2.0d0 * (((b_m ** 2.0d0) - t_0) * f)) * (2.0d0 * c))) / (t_0 - (b_m ** 2.0d0))
if (b_m <= 9d-227) then
tmp = t_1
else if (b_m <= 6d-142) then
tmp = sqrt(2.0d0) * -sqrt(((-0.5d0) * (f / a)))
else if (b_m <= 2.15d-26) then
tmp = t_1
else
tmp = sqrt((2.0d0 * f)) * -(b_m ** (-0.5d0))
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - Math.pow(B_m, 2.0));
double tmp;
if (B_m <= 9e-227) {
tmp = t_1;
} else if (B_m <= 6e-142) {
tmp = Math.sqrt(2.0) * -Math.sqrt((-0.5 * (F / A)));
} else if (B_m <= 2.15e-26) {
tmp = t_1;
} else {
tmp = Math.sqrt((2.0 * F)) * -Math.pow(B_m, -0.5);
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (4.0 * A) * C t_1 = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - math.pow(B_m, 2.0)) tmp = 0 if B_m <= 9e-227: tmp = t_1 elif B_m <= 6e-142: tmp = math.sqrt(2.0) * -math.sqrt((-0.5 * (F / A))) elif B_m <= 2.15e-26: tmp = t_1 else: tmp = math.sqrt((2.0 * F)) * -math.pow(B_m, -0.5) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) t_1 = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(2.0 * C))) / Float64(t_0 - (B_m ^ 2.0))) tmp = 0.0 if (B_m <= 9e-227) tmp = t_1; elseif (B_m <= 6e-142) tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(-0.5 * Float64(F / A))))); elseif (B_m <= 2.15e-26) tmp = t_1; else tmp = Float64(sqrt(Float64(2.0 * F)) * Float64(-(B_m ^ -0.5))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (4.0 * A) * C;
t_1 = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - (B_m ^ 2.0));
tmp = 0.0;
if (B_m <= 9e-227)
tmp = t_1;
elseif (B_m <= 6e-142)
tmp = sqrt(2.0) * -sqrt((-0.5 * (F / A)));
elseif (B_m <= 2.15e-26)
tmp = t_1;
else
tmp = sqrt((2.0 * F)) * -(B_m ^ -0.5);
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 9e-227], t$95$1, If[LessEqual[B$95$m, 6e-142], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[B$95$m, 2.15e-26], t$95$1, N[(N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision] * (-N[Power[B$95$m, -0.5], $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 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0 - {B\_m}^{2}}\\
\mathbf{if}\;B\_m \leq 9 \cdot 10^{-227}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;B\_m \leq 6 \cdot 10^{-142}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{-0.5 \cdot \frac{F}{A}}\right)\\
\mathbf{elif}\;B\_m \leq 2.15 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot F} \cdot \left(-{B\_m}^{-0.5}\right)\\
\end{array}
\end{array}
if B < 8.99999999999999986e-227 or 6.0000000000000002e-142 < B < 2.14999999999999994e-26Initial program 19.1%
Taylor expanded in A around -inf 19.0%
if 8.99999999999999986e-227 < B < 6.0000000000000002e-142Initial program 12.1%
Taylor expanded in F around 0 18.5%
mul-1-neg18.5%
unpow218.5%
unpow218.5%
hypot-undefine19.7%
cancel-sign-sub-inv19.7%
metadata-eval19.7%
Simplified19.7%
Taylor expanded in A around -inf 21.0%
if 2.14999999999999994e-26 < B Initial program 13.7%
Taylor expanded in B around inf 46.9%
mul-1-neg46.9%
Simplified46.9%
pow146.9%
sqrt-unprod47.1%
Applied egg-rr47.1%
unpow147.1%
Simplified47.1%
*-un-lft-identity47.1%
associate-*l/47.2%
Applied egg-rr47.2%
*-lft-identity47.2%
Simplified47.2%
div-inv47.1%
sqrt-prod56.8%
inv-pow56.8%
sqrt-pow156.8%
metadata-eval56.8%
Applied egg-rr56.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 (if (<= B_m 2.5e+25) (* (sqrt 2.0) (- (sqrt (* -0.5 (/ F A))))) (* (sqrt (* 2.0 F)) (- (pow B_m -0.5)))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 2.5e+25) {
tmp = sqrt(2.0) * -sqrt((-0.5 * (F / A)));
} else {
tmp = sqrt((2.0 * F)) * -pow(B_m, -0.5);
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (b_m <= 2.5d+25) then
tmp = sqrt(2.0d0) * -sqrt(((-0.5d0) * (f / a)))
else
tmp = sqrt((2.0d0 * f)) * -(b_m ** (-0.5d0))
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 2.5e+25) {
tmp = Math.sqrt(2.0) * -Math.sqrt((-0.5 * (F / A)));
} else {
tmp = Math.sqrt((2.0 * F)) * -Math.pow(B_m, -0.5);
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if B_m <= 2.5e+25: tmp = math.sqrt(2.0) * -math.sqrt((-0.5 * (F / A))) else: tmp = math.sqrt((2.0 * F)) * -math.pow(B_m, -0.5) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 2.5e+25) tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(-0.5 * Float64(F / A))))); else tmp = Float64(sqrt(Float64(2.0 * F)) * Float64(-(B_m ^ -0.5))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (B_m <= 2.5e+25)
tmp = sqrt(2.0) * -sqrt((-0.5 * (F / A)));
else
tmp = sqrt((2.0 * F)) * -(B_m ^ -0.5);
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 2.5e+25], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision] * (-N[Power[B$95$m, -0.5], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 2.5 \cdot 10^{+25}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{-0.5 \cdot \frac{F}{A}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot F} \cdot \left(-{B\_m}^{-0.5}\right)\\
\end{array}
\end{array}
if B < 2.50000000000000012e25Initial program 19.3%
Taylor expanded in F around 0 21.3%
mul-1-neg21.3%
unpow221.3%
unpow221.3%
hypot-undefine25.9%
cancel-sign-sub-inv25.9%
metadata-eval25.9%
Simplified25.9%
Taylor expanded in A around -inf 17.4%
if 2.50000000000000012e25 < B Initial program 10.0%
Taylor expanded in B around inf 47.1%
mul-1-neg47.1%
Simplified47.1%
pow147.1%
sqrt-unprod47.3%
Applied egg-rr47.3%
unpow147.3%
Simplified47.3%
*-un-lft-identity47.3%
associate-*l/47.4%
Applied egg-rr47.4%
*-lft-identity47.4%
Simplified47.4%
div-inv47.3%
sqrt-prod57.9%
inv-pow57.9%
sqrt-pow158.0%
metadata-eval58.0%
Applied egg-rr58.0%
Final simplification25.7%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (* (sqrt (* 2.0 F)) (- (pow B_m -0.5))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
return sqrt((2.0 * F)) * -pow(B_m, -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 = sqrt((2.0d0 * f)) * -(b_m ** (-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.sqrt((2.0 * F)) * -Math.pow(B_m, -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.sqrt((2.0 * F)) * -math.pow(B_m, -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(sqrt(Float64(2.0 * F)) * Float64(-(B_m ^ -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 = sqrt((2.0 * F)) * -(B_m ^ -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[(N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision] * (-N[Power[B$95$m, -0.5], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\sqrt{2 \cdot F} \cdot \left(-{B\_m}^{-0.5}\right)
\end{array}
Initial program 17.4%
Taylor expanded in B around inf 12.5%
mul-1-neg12.5%
Simplified12.5%
pow112.5%
sqrt-unprod12.5%
Applied egg-rr12.5%
unpow112.5%
Simplified12.5%
*-un-lft-identity12.5%
associate-*l/12.6%
Applied egg-rr12.6%
*-lft-identity12.6%
Simplified12.6%
div-inv12.5%
sqrt-prod15.1%
inv-pow15.1%
sqrt-pow115.1%
metadata-eval15.1%
Applied egg-rr15.1%
Final simplification15.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 (/ 2.0 B_m)) (- (sqrt 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)) * -sqrt(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)) * -sqrt(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)) * -Math.sqrt(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)) * -math.sqrt(F)
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return Float64(sqrt(Float64(2.0 / B_m)) * Float64(-sqrt(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)) * -sqrt(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[(N[Sqrt[N[(2.0 / B$95$m), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $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}{B\_m}} \cdot \left(-\sqrt{F}\right)
\end{array}
Initial program 17.4%
Taylor expanded in B around inf 12.5%
mul-1-neg12.5%
Simplified12.5%
pow112.5%
sqrt-unprod12.5%
Applied egg-rr12.5%
unpow112.5%
Simplified12.5%
*-un-lft-identity12.5%
associate-*l/12.6%
Applied egg-rr12.6%
*-lft-identity12.6%
Simplified12.6%
metadata-eval12.6%
metadata-eval12.6%
sqrt-pow212.5%
associate-/l*12.4%
sqrt-prod15.0%
sqrt-pow215.1%
metadata-eval15.1%
metadata-eval15.1%
Applied egg-rr15.1%
Final simplification15.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 (* 2.0 F)) (- (sqrt B_m))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
return sqrt((2.0 * F)) / -sqrt(B_m);
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
code = sqrt((2.0d0 * f)) / -sqrt(b_m)
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
return Math.sqrt((2.0 * F)) / -Math.sqrt(B_m);
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): return math.sqrt((2.0 * F)) / -math.sqrt(B_m)
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return Float64(sqrt(Float64(2.0 * F)) / Float64(-sqrt(B_m))) end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp = code(A, B_m, C, F)
tmp = sqrt((2.0 * F)) / -sqrt(B_m);
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := N[(N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision] / (-N[Sqrt[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])\\
\\
\frac{\sqrt{2 \cdot F}}{-\sqrt{B\_m}}
\end{array}
Initial program 17.4%
Taylor expanded in B around inf 12.5%
mul-1-neg12.5%
Simplified12.5%
pow112.5%
sqrt-unprod12.5%
Applied egg-rr12.5%
unpow112.5%
Simplified12.5%
*-un-lft-identity12.5%
associate-*l/12.6%
Applied egg-rr12.6%
*-lft-identity12.6%
Simplified12.6%
sqrt-div15.1%
Applied egg-rr15.1%
Final simplification15.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 (- (pow (/ (* 2.0 F) B_m) 0.5)))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
return -pow(((2.0 * F) / B_m), 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 * f) / b_m) ** 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 * F) / B_m), 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 * F) / B_m), 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(-(Float64(Float64(2.0 * F) / B_m) ^ 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 * F) / B_m) ^ 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[(N[(2.0 * F), $MachinePrecision] / B$95$m), $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 \cdot F}{B\_m}\right)}^{0.5}
\end{array}
Initial program 17.4%
Taylor expanded in B around inf 12.5%
mul-1-neg12.5%
Simplified12.5%
pow112.5%
sqrt-unprod12.5%
Applied egg-rr12.5%
unpow112.5%
Simplified12.5%
pow1/212.7%
associate-*l/12.8%
Applied egg-rr12.8%
Final simplification12.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 (- (sqrt (* F (/ 2.0 B_m)))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
return -sqrt((F * (2.0 / B_m)));
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
code = -sqrt((f * (2.0d0 / b_m)))
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
return -Math.sqrt((F * (2.0 / B_m)));
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): return -math.sqrt((F * (2.0 / B_m)))
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return Float64(-sqrt(Float64(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 17.4%
Taylor expanded in B around inf 12.5%
mul-1-neg12.5%
Simplified12.5%
pow112.5%
sqrt-unprod12.5%
Applied egg-rr12.5%
unpow112.5%
Simplified12.5%
*-un-lft-identity12.5%
associate-*l/12.6%
Applied egg-rr12.6%
*-lft-identity12.6%
Simplified12.6%
*-un-lft-identity12.6%
metadata-eval12.6%
metadata-eval12.6%
sqrt-pow212.5%
associate-/l*12.4%
sqrt-pow212.5%
metadata-eval12.5%
metadata-eval12.5%
Applied egg-rr12.5%
*-lft-identity12.5%
Simplified12.5%
Final simplification12.5%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (- (sqrt (* 2.0 (/ F B_m)))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
return -sqrt((2.0 * (F / B_m)));
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
code = -sqrt((2.0d0 * (f / b_m)))
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
return -Math.sqrt((2.0 * (F / B_m)));
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): return -math.sqrt((2.0 * (F / B_m)))
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return Float64(-sqrt(Float64(2.0 * Float64(F / B_m)))) end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp = code(A, B_m, C, F)
tmp = -sqrt((2.0 * (F / B_m)));
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := (-N[Sqrt[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
-\sqrt{2 \cdot \frac{F}{B\_m}}
\end{array}
Initial program 17.4%
Taylor expanded in B around inf 12.5%
mul-1-neg12.5%
Simplified12.5%
pow112.5%
sqrt-unprod12.5%
Applied egg-rr12.5%
unpow112.5%
Simplified12.5%
Final simplification12.5%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (- (sqrt (/ (* 2.0 F) B_m))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
return -sqrt(((2.0 * F) / B_m));
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
code = -sqrt(((2.0d0 * f) / b_m))
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
return -Math.sqrt(((2.0 * F) / B_m));
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): return -math.sqrt(((2.0 * F) / B_m))
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return Float64(-sqrt(Float64(Float64(2.0 * F) / B_m))) end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp = code(A, B_m, C, F)
tmp = -sqrt(((2.0 * F) / B_m));
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := (-N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision])
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
-\sqrt{\frac{2 \cdot F}{B\_m}}
\end{array}
Initial program 17.4%
Taylor expanded in B around inf 12.5%
mul-1-neg12.5%
Simplified12.5%
pow112.5%
sqrt-unprod12.5%
Applied egg-rr12.5%
unpow112.5%
Simplified12.5%
*-un-lft-identity12.5%
associate-*l/12.6%
Applied egg-rr12.6%
*-lft-identity12.6%
Simplified12.6%
Final simplification12.6%
herbie shell --seed 2024055
(FPCore (A B C F)
:name "ABCF->ab-angle a"
:precision binary64
(/ (- (sqrt (* (* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F)) (+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))) (- (pow B 2.0) (* (* 4.0 A) C))))