
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) + sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t\_0}
\end{array}
\end{array}
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0))))
(t_1 (- t_0))
(t_2 (- (pow B_m 2.0) (* (* 4.0 A) C)))
(t_3
(/
(-
(sqrt
(*
(* 2.0 (* t_2 F))
(+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B_m 2.0)))))))
t_2)))
(if (<= t_3 (- INFINITY))
(*
-1.0
(*
(*
(sqrt F)
(sqrt
(/
(fma -0.5 (/ (pow B_m 2.0) A) (* 2.0 C))
(fma A (* C -4.0) (pow B_m 2.0)))))
(sqrt 2.0)))
(if (<= t_3 -1e-197)
(/ (sqrt (* (* t_0 F) (* 2.0 (+ A (+ C (hypot B_m (- A C))))))) t_1)
(if (<= t_3 0.0)
(/ (* (fabs (* (sqrt (* -8.0 A)) (* C (sqrt F)))) (sqrt 2.0)) t_1)
(if (<= t_3 INFINITY)
(* (sqrt (* F (* t_0 2.0))) (/ (sqrt (* 2.0 C)) t_1))
(* -1.0 (* (sqrt (* F 2.0)) (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 = fma(B_m, B_m, (A * (C * -4.0)));
double t_1 = -t_0;
double t_2 = pow(B_m, 2.0) - ((4.0 * A) * C);
double t_3 = -sqrt(((2.0 * (t_2 * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B_m, 2.0)))))) / t_2;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = -1.0 * ((sqrt(F) * sqrt((fma(-0.5, (pow(B_m, 2.0) / A), (2.0 * C)) / fma(A, (C * -4.0), pow(B_m, 2.0))))) * sqrt(2.0));
} else if (t_3 <= -1e-197) {
tmp = sqrt(((t_0 * F) * (2.0 * (A + (C + hypot(B_m, (A - C))))))) / t_1;
} else if (t_3 <= 0.0) {
tmp = (fabs((sqrt((-8.0 * A)) * (C * sqrt(F)))) * sqrt(2.0)) / t_1;
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((F * (t_0 * 2.0))) * (sqrt((2.0 * C)) / t_1);
} else {
tmp = -1.0 * (sqrt((F * 2.0)) * 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 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_1 = Float64(-t_0) t_2 = Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C)) t_3 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_2 * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B_m ^ 2.0))))))) / t_2) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(-1.0 * Float64(Float64(sqrt(F) * sqrt(Float64(fma(-0.5, Float64((B_m ^ 2.0) / A), Float64(2.0 * C)) / fma(A, Float64(C * -4.0), (B_m ^ 2.0))))) * sqrt(2.0))); elseif (t_3 <= -1e-197) tmp = Float64(sqrt(Float64(Float64(t_0 * F) * Float64(2.0 * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))))) / t_1); elseif (t_3 <= 0.0) tmp = Float64(Float64(abs(Float64(sqrt(Float64(-8.0 * A)) * Float64(C * sqrt(F)))) * sqrt(2.0)) / t_1); elseif (t_3 <= Inf) tmp = Float64(sqrt(Float64(F * Float64(t_0 * 2.0))) * Float64(sqrt(Float64(2.0 * C)) / t_1)); else tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -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[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-t$95$0)}, Block[{t$95$2 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$2 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(-1.0 * N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision] / N[(A * N[(C * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -1e-197], N[(N[Sqrt[N[(N[(t$95$0 * F), $MachinePrecision] * N[(2.0 * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, 0.0], N[(N[(N[Abs[N[(N[Sqrt[N[(-8.0 * A), $MachinePrecision]], $MachinePrecision] * N[(C * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[Sqrt[N[(F * N[(t$95$0 * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := -t\_0\\
t_2 := {B\_m}^{2} - \left(4 \cdot A\right) \cdot C\\
t_3 := \frac{-\sqrt{\left(2 \cdot \left(t\_2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B\_m}^{2}}\right)}}{t\_2}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;-1 \cdot \left(\left(\sqrt{F} \cdot \sqrt{\frac{\mathsf{fma}\left(-0.5, \frac{{B\_m}^{2}}{A}, 2 \cdot C\right)}{\mathsf{fma}\left(A, C \cdot -4, {B\_m}^{2}\right)}}\right) \cdot \sqrt{2}\right)\\
\mathbf{elif}\;t\_3 \leq -1 \cdot 10^{-197}:\\
\;\;\;\;\frac{\sqrt{\left(t\_0 \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_1}\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{\left|\sqrt{-8 \cdot A} \cdot \left(C \cdot \sqrt{F}\right)\right| \cdot \sqrt{2}}{t\_1}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{F \cdot \left(t\_0 \cdot 2\right)} \cdot \frac{\sqrt{2 \cdot C}}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\right)\\
\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))) < -inf.0Initial program 3.0%
Simplified17.0%
Taylor expanded in A around -inf 18.6%
Taylor expanded in F around 0 27.5%
associate-/l*29.2%
sqrt-prod35.3%
fma-define35.3%
*-commutative35.3%
associate-*r*35.4%
fma-define35.4%
Applied egg-rr35.4%
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))) < -9.9999999999999999e-198Initial program 98.2%
Simplified98.2%
if -9.9999999999999999e-198 < (/.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))) < -0.0Initial program 3.6%
Simplified5.4%
Taylor expanded in A around -inf 37.9%
Taylor expanded in F around 0 35.2%
Taylor expanded in A around inf 27.3%
add-sqr-sqrt27.3%
rem-sqrt-square27.3%
associate-*r*27.3%
sqrt-prod29.8%
sqrt-prod32.5%
sqrt-pow146.1%
metadata-eval46.1%
pow146.1%
Applied egg-rr46.1%
if -0.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))) < +inf.0Initial program 58.4%
Simplified85.7%
associate-*r*85.7%
associate-+r+85.7%
hypot-undefine58.4%
unpow258.4%
unpow258.4%
+-commutative58.4%
sqrt-prod65.0%
*-commutative65.0%
associate-*r*65.0%
associate-+l+65.0%
Applied egg-rr99.1%
associate-/l*99.3%
associate-*l*99.3%
associate-*r*99.3%
associate-+r+99.3%
Applied egg-rr99.3%
Taylor expanded in A around -inf 38.5%
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 B around inf 14.0%
pow1/214.0%
div-inv14.1%
unpow-prod-down21.9%
pow1/221.9%
Applied egg-rr21.9%
unpow1/221.9%
sqrt-prod14.0%
div-inv14.0%
sqrt-prod14.1%
associate-*l/14.1%
sqrt-div22.0%
Applied egg-rr22.0%
div-inv21.9%
pow1/221.9%
pow-flip22.0%
metadata-eval22.0%
Applied egg-rr22.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 (fma B_m B_m (* A (* C -4.0))))
(t_1 (* t_0 F))
(t_2 (- t_0))
(t_3 (- (pow B_m 2.0) (* (* 4.0 A) C)))
(t_4
(/
(-
(sqrt
(*
(* 2.0 (* t_3 F))
(+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B_m 2.0)))))))
t_3)))
(if (<= t_4 (- INFINITY))
(/
(* (sqrt t_1) (sqrt (* 2.0 (fma C 2.0 (* -0.5 (/ (pow B_m 2.0) A))))))
t_2)
(if (<= t_4 -1e-197)
(/ (sqrt (* t_1 (* 2.0 (+ A (+ C (hypot B_m (- A C))))))) t_2)
(if (<= t_4 0.0)
(/ (* (fabs (* (sqrt (* -8.0 A)) (* C (sqrt F)))) (sqrt 2.0)) t_2)
(if (<= t_4 INFINITY)
(* (sqrt (* F (* t_0 2.0))) (/ (sqrt (* 2.0 C)) t_2))
(* -1.0 (* (sqrt (* F 2.0)) (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 = fma(B_m, B_m, (A * (C * -4.0)));
double t_1 = t_0 * F;
double t_2 = -t_0;
double t_3 = pow(B_m, 2.0) - ((4.0 * A) * C);
double t_4 = -sqrt(((2.0 * (t_3 * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B_m, 2.0)))))) / t_3;
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = (sqrt(t_1) * sqrt((2.0 * fma(C, 2.0, (-0.5 * (pow(B_m, 2.0) / A)))))) / t_2;
} else if (t_4 <= -1e-197) {
tmp = sqrt((t_1 * (2.0 * (A + (C + hypot(B_m, (A - C))))))) / t_2;
} else if (t_4 <= 0.0) {
tmp = (fabs((sqrt((-8.0 * A)) * (C * sqrt(F)))) * sqrt(2.0)) / t_2;
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((F * (t_0 * 2.0))) * (sqrt((2.0 * C)) / t_2);
} else {
tmp = -1.0 * (sqrt((F * 2.0)) * 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 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_1 = Float64(t_0 * F) t_2 = Float64(-t_0) t_3 = Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C)) t_4 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_3 * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B_m ^ 2.0))))))) / t_3) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = Float64(Float64(sqrt(t_1) * sqrt(Float64(2.0 * fma(C, 2.0, Float64(-0.5 * Float64((B_m ^ 2.0) / A)))))) / t_2); elseif (t_4 <= -1e-197) tmp = Float64(sqrt(Float64(t_1 * Float64(2.0 * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))))) / t_2); elseif (t_4 <= 0.0) tmp = Float64(Float64(abs(Float64(sqrt(Float64(-8.0 * A)) * Float64(C * sqrt(F)))) * sqrt(2.0)) / t_2); elseif (t_4 <= Inf) tmp = Float64(sqrt(Float64(F * Float64(t_0 * 2.0))) * Float64(sqrt(Float64(2.0 * C)) / t_2)); else tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -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[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * F), $MachinePrecision]}, Block[{t$95$2 = (-t$95$0)}, Block[{t$95$3 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$3 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$3), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], N[(N[(N[Sqrt[t$95$1], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(C * 2.0 + N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$4, -1e-197], N[(N[Sqrt[N[(t$95$1 * N[(2.0 * N[(A + N[(C + 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$4, 0.0], N[(N[(N[Abs[N[(N[Sqrt[N[(-8.0 * A), $MachinePrecision]], $MachinePrecision] * N[(C * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(N[Sqrt[N[(F * N[(t$95$0 * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := t\_0 \cdot F\\
t_2 := -t\_0\\
t_3 := {B\_m}^{2} - \left(4 \cdot A\right) \cdot C\\
t_4 := \frac{-\sqrt{\left(2 \cdot \left(t\_3 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B\_m}^{2}}\right)}}{t\_3}\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;\frac{\sqrt{t\_1} \cdot \sqrt{2 \cdot \mathsf{fma}\left(C, 2, -0.5 \cdot \frac{{B\_m}^{2}}{A}\right)}}{t\_2}\\
\mathbf{elif}\;t\_4 \leq -1 \cdot 10^{-197}:\\
\;\;\;\;\frac{\sqrt{t\_1 \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_2}\\
\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;\frac{\left|\sqrt{-8 \cdot A} \cdot \left(C \cdot \sqrt{F}\right)\right| \cdot \sqrt{2}}{t\_2}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{F \cdot \left(t\_0 \cdot 2\right)} \cdot \frac{\sqrt{2 \cdot C}}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\right)\\
\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))) < -inf.0Initial program 3.0%
Simplified17.0%
Taylor expanded in A around -inf 18.6%
sqrt-prod28.8%
+-commutative28.8%
*-commutative28.8%
fma-define28.8%
Applied egg-rr28.8%
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))) < -9.9999999999999999e-198Initial program 98.2%
Simplified98.2%
if -9.9999999999999999e-198 < (/.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))) < -0.0Initial program 3.6%
Simplified5.4%
Taylor expanded in A around -inf 37.9%
Taylor expanded in F around 0 35.2%
Taylor expanded in A around inf 27.3%
add-sqr-sqrt27.3%
rem-sqrt-square27.3%
associate-*r*27.3%
sqrt-prod29.8%
sqrt-prod32.5%
sqrt-pow146.1%
metadata-eval46.1%
pow146.1%
Applied egg-rr46.1%
if -0.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))) < +inf.0Initial program 58.4%
Simplified85.7%
associate-*r*85.7%
associate-+r+85.7%
hypot-undefine58.4%
unpow258.4%
unpow258.4%
+-commutative58.4%
sqrt-prod65.0%
*-commutative65.0%
associate-*r*65.0%
associate-+l+65.0%
Applied egg-rr99.1%
associate-/l*99.3%
associate-*l*99.3%
associate-*r*99.3%
associate-+r+99.3%
Applied egg-rr99.3%
Taylor expanded in A around -inf 38.5%
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 B around inf 14.0%
pow1/214.0%
div-inv14.1%
unpow-prod-down21.9%
pow1/221.9%
Applied egg-rr21.9%
unpow1/221.9%
sqrt-prod14.0%
div-inv14.0%
sqrt-prod14.1%
associate-*l/14.1%
sqrt-div22.0%
Applied egg-rr22.0%
div-inv21.9%
pow1/221.9%
pow-flip22.0%
metadata-eval22.0%
Applied egg-rr22.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 (* -1.0 (* (sqrt (* -0.5 (/ F A))) (sqrt 2.0))))
(t_1 (fma B_m B_m (* A (* C -4.0))))
(t_2 (- t_1))
(t_3 (* t_1 F))
(t_4 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))
(t_5 (* 2.0 t_4))
(t_6 (/ (sqrt (* t_3 t_5)) t_2))
(t_7 (* (sqrt (* F (* t_1 2.0))) (/ (sqrt (* 2.0 C)) t_2))))
(if (<= (pow B_m 2.0) 2e-303)
(/ (* (fabs (* (sqrt (* -8.0 A)) (* C (sqrt F)))) (sqrt 2.0)) t_2)
(if (<= (pow B_m 2.0) 2e-205)
t_7
(if (<= (pow B_m 2.0) 1e-100)
t_6
(if (<= (pow B_m 2.0) 1e-72)
t_0
(if (<= (pow B_m 2.0) 5000000.0)
t_7
(if (<= (pow B_m 2.0) 5e+24)
(*
-1.0
(*
(sqrt (/ (* F t_4) (+ (* -4.0 (* A C)) (pow B_m 2.0))))
(sqrt 2.0)))
(if (<= (pow B_m 2.0) 5e+139)
(/ (sqrt (* t_3 (* 2.0 (+ A (+ C (hypot B_m (- A C))))))) t_2)
(if (<= (pow B_m 2.0) 2e+195)
t_0
(if (<= (pow B_m 2.0) 4e+220)
t_6
(if (<= (pow B_m 2.0) 2e+235)
(*
-1.0
(*
(/ (sqrt 2.0) B_m)
(sqrt
(* F (+ C (sqrt (+ (pow B_m 2.0) (pow C 2.0))))))))
(if (<= (pow B_m 2.0) 2e+261)
(/
(sqrt
(*
(+ (* -4.0 (* A (* C F))) (* (pow B_m 2.0) F))
t_5))
t_2)
(*
-1.0
(* (sqrt (* F 2.0)) (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 = -1.0 * (sqrt((-0.5 * (F / A))) * sqrt(2.0));
double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
double t_2 = -t_1;
double t_3 = t_1 * F;
double t_4 = (-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C);
double t_5 = 2.0 * t_4;
double t_6 = sqrt((t_3 * t_5)) / t_2;
double t_7 = sqrt((F * (t_1 * 2.0))) * (sqrt((2.0 * C)) / t_2);
double tmp;
if (pow(B_m, 2.0) <= 2e-303) {
tmp = (fabs((sqrt((-8.0 * A)) * (C * sqrt(F)))) * sqrt(2.0)) / t_2;
} else if (pow(B_m, 2.0) <= 2e-205) {
tmp = t_7;
} else if (pow(B_m, 2.0) <= 1e-100) {
tmp = t_6;
} else if (pow(B_m, 2.0) <= 1e-72) {
tmp = t_0;
} else if (pow(B_m, 2.0) <= 5000000.0) {
tmp = t_7;
} else if (pow(B_m, 2.0) <= 5e+24) {
tmp = -1.0 * (sqrt(((F * t_4) / ((-4.0 * (A * C)) + pow(B_m, 2.0)))) * sqrt(2.0));
} else if (pow(B_m, 2.0) <= 5e+139) {
tmp = sqrt((t_3 * (2.0 * (A + (C + hypot(B_m, (A - C))))))) / t_2;
} else if (pow(B_m, 2.0) <= 2e+195) {
tmp = t_0;
} else if (pow(B_m, 2.0) <= 4e+220) {
tmp = t_6;
} else if (pow(B_m, 2.0) <= 2e+235) {
tmp = -1.0 * ((sqrt(2.0) / B_m) * sqrt((F * (C + sqrt((pow(B_m, 2.0) + pow(C, 2.0)))))));
} else if (pow(B_m, 2.0) <= 2e+261) {
tmp = sqrt((((-4.0 * (A * (C * F))) + (pow(B_m, 2.0) * F)) * t_5)) / t_2;
} else {
tmp = -1.0 * (sqrt((F * 2.0)) * 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(-1.0 * Float64(sqrt(Float64(-0.5 * Float64(F / A))) * sqrt(2.0))) t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_2 = Float64(-t_1) t_3 = Float64(t_1 * F) t_4 = Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C)) t_5 = Float64(2.0 * t_4) t_6 = Float64(sqrt(Float64(t_3 * t_5)) / t_2) t_7 = Float64(sqrt(Float64(F * Float64(t_1 * 2.0))) * Float64(sqrt(Float64(2.0 * C)) / t_2)) tmp = 0.0 if ((B_m ^ 2.0) <= 2e-303) tmp = Float64(Float64(abs(Float64(sqrt(Float64(-8.0 * A)) * Float64(C * sqrt(F)))) * sqrt(2.0)) / t_2); elseif ((B_m ^ 2.0) <= 2e-205) tmp = t_7; elseif ((B_m ^ 2.0) <= 1e-100) tmp = t_6; elseif ((B_m ^ 2.0) <= 1e-72) tmp = t_0; elseif ((B_m ^ 2.0) <= 5000000.0) tmp = t_7; elseif ((B_m ^ 2.0) <= 5e+24) tmp = Float64(-1.0 * Float64(sqrt(Float64(Float64(F * t_4) / Float64(Float64(-4.0 * Float64(A * C)) + (B_m ^ 2.0)))) * sqrt(2.0))); elseif ((B_m ^ 2.0) <= 5e+139) tmp = Float64(sqrt(Float64(t_3 * Float64(2.0 * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))))) / t_2); elseif ((B_m ^ 2.0) <= 2e+195) tmp = t_0; elseif ((B_m ^ 2.0) <= 4e+220) tmp = t_6; elseif ((B_m ^ 2.0) <= 2e+235) tmp = Float64(-1.0 * Float64(Float64(sqrt(2.0) / B_m) * sqrt(Float64(F * Float64(C + sqrt(Float64((B_m ^ 2.0) + (C ^ 2.0)))))))); elseif ((B_m ^ 2.0) <= 2e+261) tmp = Float64(sqrt(Float64(Float64(Float64(-4.0 * Float64(A * Float64(C * F))) + Float64((B_m ^ 2.0) * F)) * t_5)) / t_2); else tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -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[(-1.0 * N[(N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = (-t$95$1)}, Block[{t$95$3 = N[(t$95$1 * F), $MachinePrecision]}, Block[{t$95$4 = N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(2.0 * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[Sqrt[N[(t$95$3 * t$95$5), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$7 = N[(N[Sqrt[N[(F * N[(t$95$1 * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-303], N[(N[(N[Abs[N[(N[Sqrt[N[(-8.0 * A), $MachinePrecision]], $MachinePrecision] * N[(C * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-205], t$95$7, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-100], t$95$6, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-72], t$95$0, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5000000.0], t$95$7, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+24], N[(-1.0 * N[(N[Sqrt[N[(N[(F * t$95$4), $MachinePrecision] / N[(N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+139], N[(N[Sqrt[N[(t$95$3 * N[(2.0 * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+195], t$95$0, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e+220], t$95$6, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+235], N[(-1.0 * N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(C + N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[Power[C, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+261], N[(N[Sqrt[N[(N[(N[(-4.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[B$95$m, 2.0], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * t$95$5), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $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 := -1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\
t_1 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_2 := -t\_1\\
t_3 := t\_1 \cdot F\\
t_4 := -0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\\
t_5 := 2 \cdot t\_4\\
t_6 := \frac{\sqrt{t\_3 \cdot t\_5}}{t\_2}\\
t_7 := \sqrt{F \cdot \left(t\_1 \cdot 2\right)} \cdot \frac{\sqrt{2 \cdot C}}{t\_2}\\
\mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{-303}:\\
\;\;\;\;\frac{\left|\sqrt{-8 \cdot A} \cdot \left(C \cdot \sqrt{F}\right)\right| \cdot \sqrt{2}}{t\_2}\\
\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{-205}:\\
\;\;\;\;t\_7\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{-100}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{-72}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;{B\_m}^{2} \leq 5000000:\\
\;\;\;\;t\_7\\
\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+24}:\\
\;\;\;\;-1 \cdot \left(\sqrt{\frac{F \cdot t\_4}{-4 \cdot \left(A \cdot C\right) + {B\_m}^{2}}} \cdot \sqrt{2}\right)\\
\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+139}:\\
\;\;\;\;\frac{\sqrt{t\_3 \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_2}\\
\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+195}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;{B\_m}^{2} \leq 4 \cdot 10^{+220}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+235}:\\
\;\;\;\;-1 \cdot \left(\frac{\sqrt{2}}{B\_m} \cdot \sqrt{F \cdot \left(C + \sqrt{{B\_m}^{2} + {C}^{2}}\right)}\right)\\
\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+261}:\\
\;\;\;\;\frac{\sqrt{\left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right) + {B\_m}^{2} \cdot F\right) \cdot t\_5}}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\right)\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 1.99999999999999986e-303Initial program 13.0%
Simplified23.5%
Taylor expanded in A around -inf 25.7%
Taylor expanded in F around 0 22.5%
Taylor expanded in A around inf 16.2%
add-sqr-sqrt16.2%
rem-sqrt-square16.2%
associate-*r*16.2%
sqrt-prod17.3%
sqrt-prod20.4%
sqrt-pow134.4%
metadata-eval34.4%
pow134.4%
Applied egg-rr34.4%
if 1.99999999999999986e-303 < (pow.f64 B #s(literal 2 binary64)) < 2e-205 or 9.9999999999999997e-73 < (pow.f64 B #s(literal 2 binary64)) < 5e6Initial program 37.4%
Simplified45.9%
associate-*r*45.9%
associate-+r+45.0%
hypot-undefine37.4%
unpow237.4%
unpow237.4%
+-commutative37.4%
sqrt-prod42.1%
*-commutative42.1%
associate-*r*42.1%
associate-+l+42.9%
Applied egg-rr65.5%
associate-/l*65.6%
associate-*l*65.6%
associate-*r*65.6%
associate-+r+64.4%
Applied egg-rr64.4%
Taylor expanded in A around -inf 24.5%
if 2e-205 < (pow.f64 B #s(literal 2 binary64)) < 1e-100 or 1.99999999999999995e195 < (pow.f64 B #s(literal 2 binary64)) < 4e220Initial program 42.5%
Simplified46.5%
Taylor expanded in A around -inf 36.3%
if 1e-100 < (pow.f64 B #s(literal 2 binary64)) < 9.9999999999999997e-73 or 5.0000000000000003e139 < (pow.f64 B #s(literal 2 binary64)) < 1.99999999999999995e195Initial program 19.7%
Simplified24.0%
Taylor expanded in A around -inf 18.1%
Taylor expanded in F around 0 23.0%
Taylor expanded in B around 0 31.3%
if 5e6 < (pow.f64 B #s(literal 2 binary64)) < 5.00000000000000045e24Initial program 3.3%
Simplified0.0%
Taylor expanded in A around -inf 3.9%
Taylor expanded in F around 0 36.1%
if 5.00000000000000045e24 < (pow.f64 B #s(literal 2 binary64)) < 5.0000000000000003e139Initial program 43.7%
Simplified50.3%
if 4e220 < (pow.f64 B #s(literal 2 binary64)) < 2.0000000000000001e235Initial program 27.0%
Taylor expanded in A around 0 36.4%
if 2.0000000000000001e235 < (pow.f64 B #s(literal 2 binary64)) < 1.9999999999999999e261Initial program 0.8%
Simplified4.0%
Taylor expanded in A around -inf 20.1%
Taylor expanded in B around 0 21.4%
if 1.9999999999999999e261 < (pow.f64 B #s(literal 2 binary64)) Initial program 3.1%
Taylor expanded in B around inf 25.9%
pow1/225.9%
div-inv25.9%
unpow-prod-down39.9%
pow1/239.9%
Applied egg-rr39.9%
unpow1/239.9%
sqrt-prod25.9%
div-inv25.9%
sqrt-prod26.1%
associate-*l/26.1%
sqrt-div40.1%
Applied egg-rr40.1%
div-inv39.9%
pow1/239.9%
pow-flip40.2%
metadata-eval40.2%
Applied egg-rr40.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 (fma B_m B_m (* A (* C -4.0))))
(t_1 (- t_0))
(t_2 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))
(t_3 (* (sqrt (* F (* t_0 2.0))) (/ (sqrt (* 2.0 C)) t_1))))
(if (<= (pow B_m 2.0) 2e-303)
(/ (* (fabs (* (sqrt (* -8.0 A)) (* C (sqrt F)))) (sqrt 2.0)) t_1)
(if (<= (pow B_m 2.0) 2e-205)
t_3
(if (<= (pow B_m 2.0) 1e-100)
(/ (sqrt (* (* t_0 F) (* 2.0 t_2))) t_1)
(if (<= (pow B_m 2.0) 1e-72)
(* -1.0 (* (sqrt (* -0.5 (/ F A))) (sqrt 2.0)))
(if (<= (pow B_m 2.0) 5000000.0)
t_3
(if (<= (pow B_m 2.0) 5e+24)
(*
-1.0
(*
(sqrt (/ (* F t_2) (+ (* -4.0 (* A C)) (pow B_m 2.0))))
(sqrt 2.0)))
(if (<= (pow B_m 2.0) 5e+234)
(*
(* (* B_m (sqrt 2.0)) (sqrt F))
(/ (sqrt (+ (+ A C) (hypot (- A C) B_m))) t_1))
(* -1.0 (* (sqrt (* F 2.0)) (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 = fma(B_m, B_m, (A * (C * -4.0)));
double t_1 = -t_0;
double t_2 = (-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C);
double t_3 = sqrt((F * (t_0 * 2.0))) * (sqrt((2.0 * C)) / t_1);
double tmp;
if (pow(B_m, 2.0) <= 2e-303) {
tmp = (fabs((sqrt((-8.0 * A)) * (C * sqrt(F)))) * sqrt(2.0)) / t_1;
} else if (pow(B_m, 2.0) <= 2e-205) {
tmp = t_3;
} else if (pow(B_m, 2.0) <= 1e-100) {
tmp = sqrt(((t_0 * F) * (2.0 * t_2))) / t_1;
} else if (pow(B_m, 2.0) <= 1e-72) {
tmp = -1.0 * (sqrt((-0.5 * (F / A))) * sqrt(2.0));
} else if (pow(B_m, 2.0) <= 5000000.0) {
tmp = t_3;
} else if (pow(B_m, 2.0) <= 5e+24) {
tmp = -1.0 * (sqrt(((F * t_2) / ((-4.0 * (A * C)) + pow(B_m, 2.0)))) * sqrt(2.0));
} else if (pow(B_m, 2.0) <= 5e+234) {
tmp = ((B_m * sqrt(2.0)) * sqrt(F)) * (sqrt(((A + C) + hypot((A - C), B_m))) / t_1);
} else {
tmp = -1.0 * (sqrt((F * 2.0)) * 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 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_1 = Float64(-t_0) t_2 = Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C)) t_3 = Float64(sqrt(Float64(F * Float64(t_0 * 2.0))) * Float64(sqrt(Float64(2.0 * C)) / t_1)) tmp = 0.0 if ((B_m ^ 2.0) <= 2e-303) tmp = Float64(Float64(abs(Float64(sqrt(Float64(-8.0 * A)) * Float64(C * sqrt(F)))) * sqrt(2.0)) / t_1); elseif ((B_m ^ 2.0) <= 2e-205) tmp = t_3; elseif ((B_m ^ 2.0) <= 1e-100) tmp = Float64(sqrt(Float64(Float64(t_0 * F) * Float64(2.0 * t_2))) / t_1); elseif ((B_m ^ 2.0) <= 1e-72) tmp = Float64(-1.0 * Float64(sqrt(Float64(-0.5 * Float64(F / A))) * sqrt(2.0))); elseif ((B_m ^ 2.0) <= 5000000.0) tmp = t_3; elseif ((B_m ^ 2.0) <= 5e+24) tmp = Float64(-1.0 * Float64(sqrt(Float64(Float64(F * t_2) / Float64(Float64(-4.0 * Float64(A * C)) + (B_m ^ 2.0)))) * sqrt(2.0))); elseif ((B_m ^ 2.0) <= 5e+234) tmp = Float64(Float64(Float64(B_m * sqrt(2.0)) * sqrt(F)) * Float64(sqrt(Float64(Float64(A + C) + hypot(Float64(A - C), B_m))) / t_1)); else tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -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[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-t$95$0)}, Block[{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]}, Block[{t$95$3 = N[(N[Sqrt[N[(F * N[(t$95$0 * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-303], N[(N[(N[Abs[N[(N[Sqrt[N[(-8.0 * A), $MachinePrecision]], $MachinePrecision] * N[(C * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-205], t$95$3, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-100], N[(N[Sqrt[N[(N[(t$95$0 * F), $MachinePrecision] * N[(2.0 * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-72], N[(-1.0 * N[(N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5000000.0], t$95$3, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+24], N[(-1.0 * N[(N[Sqrt[N[(N[(F * t$95$2), $MachinePrecision] / N[(N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+234], N[(N[(N[(B$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := -t\_0\\
t_2 := -0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\\
t_3 := \sqrt{F \cdot \left(t\_0 \cdot 2\right)} \cdot \frac{\sqrt{2 \cdot C}}{t\_1}\\
\mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{-303}:\\
\;\;\;\;\frac{\left|\sqrt{-8 \cdot A} \cdot \left(C \cdot \sqrt{F}\right)\right| \cdot \sqrt{2}}{t\_1}\\
\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{-205}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{-100}:\\
\;\;\;\;\frac{\sqrt{\left(t\_0 \cdot F\right) \cdot \left(2 \cdot t\_2\right)}}{t\_1}\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{-72}:\\
\;\;\;\;-1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\
\mathbf{elif}\;{B\_m}^{2} \leq 5000000:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+24}:\\
\;\;\;\;-1 \cdot \left(\sqrt{\frac{F \cdot t\_2}{-4 \cdot \left(A \cdot C\right) + {B\_m}^{2}}} \cdot \sqrt{2}\right)\\
\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+234}:\\
\;\;\;\;\left(\left(B\_m \cdot \sqrt{2}\right) \cdot \sqrt{F}\right) \cdot \frac{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\_m\right)}}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\right)\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 1.99999999999999986e-303Initial program 13.0%
Simplified23.5%
Taylor expanded in A around -inf 25.7%
Taylor expanded in F around 0 22.5%
Taylor expanded in A around inf 16.2%
add-sqr-sqrt16.2%
rem-sqrt-square16.2%
associate-*r*16.2%
sqrt-prod17.3%
sqrt-prod20.4%
sqrt-pow134.4%
metadata-eval34.4%
pow134.4%
Applied egg-rr34.4%
if 1.99999999999999986e-303 < (pow.f64 B #s(literal 2 binary64)) < 2e-205 or 9.9999999999999997e-73 < (pow.f64 B #s(literal 2 binary64)) < 5e6Initial program 37.4%
Simplified45.9%
associate-*r*45.9%
associate-+r+45.0%
hypot-undefine37.4%
unpow237.4%
unpow237.4%
+-commutative37.4%
sqrt-prod42.1%
*-commutative42.1%
associate-*r*42.1%
associate-+l+42.9%
Applied egg-rr65.5%
associate-/l*65.6%
associate-*l*65.6%
associate-*r*65.6%
associate-+r+64.4%
Applied egg-rr64.4%
Taylor expanded in A around -inf 24.5%
if 2e-205 < (pow.f64 B #s(literal 2 binary64)) < 1e-100Initial program 47.0%
Simplified50.3%
Taylor expanded in A around -inf 38.9%
if 1e-100 < (pow.f64 B #s(literal 2 binary64)) < 9.9999999999999997e-73Initial program 35.1%
Simplified35.9%
Taylor expanded in A around -inf 17.2%
Taylor expanded in F around 0 17.4%
Taylor expanded in B around 0 33.8%
if 5e6 < (pow.f64 B #s(literal 2 binary64)) < 5.00000000000000045e24Initial program 3.3%
Simplified0.0%
Taylor expanded in A around -inf 3.9%
Taylor expanded in F around 0 36.1%
if 5.00000000000000045e24 < (pow.f64 B #s(literal 2 binary64)) < 5.0000000000000003e234Initial program 33.6%
Simplified39.7%
associate-*r*39.7%
associate-+r+38.8%
hypot-undefine33.6%
unpow233.6%
unpow233.6%
+-commutative33.6%
sqrt-prod36.8%
*-commutative36.8%
associate-*r*36.8%
associate-+l+36.9%
Applied egg-rr45.4%
associate-/l*45.6%
associate-*l*45.6%
associate-*r*45.6%
associate-+r+45.3%
Applied egg-rr45.3%
Taylor expanded in B around inf 27.6%
if 5.0000000000000003e234 < (pow.f64 B #s(literal 2 binary64)) Initial program 2.9%
Taylor expanded in B around inf 24.0%
pow1/224.0%
div-inv24.1%
unpow-prod-down36.9%
pow1/236.9%
Applied egg-rr36.9%
unpow1/236.9%
sqrt-prod24.1%
div-inv24.0%
sqrt-prod24.2%
associate-*l/24.2%
sqrt-div37.0%
Applied egg-rr37.0%
div-inv36.9%
pow1/236.9%
pow-flip37.1%
metadata-eval37.1%
Applied egg-rr37.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 (- (pow B_m 2.0) (* (* 4.0 A) C)))
(t_1 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))
(t_2 (fma B_m B_m (* A (* C -4.0))))
(t_3 (- t_2))
(t_4 (hypot (- A C) B_m)))
(if (<= (pow B_m 2.0) 2e-303)
(/ (* (fabs (* (sqrt (* -8.0 A)) (* C (sqrt F)))) (sqrt 2.0)) t_3)
(if (<= (pow B_m 2.0) 2e-170)
(* (sqrt (* F (* t_2 2.0))) (/ (sqrt t_1) t_3))
(if (<= (pow B_m 2.0) 5000000.0)
(/
(*
(sqrt (* (* F (fma B_m B_m (* (* A C) -4.0))) 2.0))
(sqrt (+ A (+ C t_4))))
t_3)
(if (<= (pow B_m 2.0) 5e+46)
(/ (- (sqrt (* (* 2.0 (* t_0 F)) t_1))) t_0)
(if (<= (pow B_m 2.0) 4e+189)
(* (* (* B_m (sqrt 2.0)) (sqrt F)) (/ (sqrt (+ (+ A C) t_4)) t_3))
(* -1.0 (* (sqrt (* F 2.0)) (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 = pow(B_m, 2.0) - ((4.0 * A) * C);
double t_1 = (-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C);
double t_2 = fma(B_m, B_m, (A * (C * -4.0)));
double t_3 = -t_2;
double t_4 = hypot((A - C), B_m);
double tmp;
if (pow(B_m, 2.0) <= 2e-303) {
tmp = (fabs((sqrt((-8.0 * A)) * (C * sqrt(F)))) * sqrt(2.0)) / t_3;
} else if (pow(B_m, 2.0) <= 2e-170) {
tmp = sqrt((F * (t_2 * 2.0))) * (sqrt(t_1) / t_3);
} else if (pow(B_m, 2.0) <= 5000000.0) {
tmp = (sqrt(((F * fma(B_m, B_m, ((A * C) * -4.0))) * 2.0)) * sqrt((A + (C + t_4)))) / t_3;
} else if (pow(B_m, 2.0) <= 5e+46) {
tmp = -sqrt(((2.0 * (t_0 * F)) * t_1)) / t_0;
} else if (pow(B_m, 2.0) <= 4e+189) {
tmp = ((B_m * sqrt(2.0)) * sqrt(F)) * (sqrt(((A + C) + t_4)) / t_3);
} else {
tmp = -1.0 * (sqrt((F * 2.0)) * 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((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C)) t_1 = Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C)) t_2 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_3 = Float64(-t_2) t_4 = hypot(Float64(A - C), B_m) tmp = 0.0 if ((B_m ^ 2.0) <= 2e-303) tmp = Float64(Float64(abs(Float64(sqrt(Float64(-8.0 * A)) * Float64(C * sqrt(F)))) * sqrt(2.0)) / t_3); elseif ((B_m ^ 2.0) <= 2e-170) tmp = Float64(sqrt(Float64(F * Float64(t_2 * 2.0))) * Float64(sqrt(t_1) / t_3)); elseif ((B_m ^ 2.0) <= 5000000.0) tmp = Float64(Float64(sqrt(Float64(Float64(F * fma(B_m, B_m, Float64(Float64(A * C) * -4.0))) * 2.0)) * sqrt(Float64(A + Float64(C + t_4)))) / t_3); elseif ((B_m ^ 2.0) <= 5e+46) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * t_1))) / t_0); elseif ((B_m ^ 2.0) <= 4e+189) tmp = Float64(Float64(Float64(B_m * sqrt(2.0)) * sqrt(F)) * Float64(sqrt(Float64(Float64(A + C) + t_4)) / t_3)); else tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -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[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = (-t$95$2)}, Block[{t$95$4 = N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-303], N[(N[(N[Abs[N[(N[Sqrt[N[(-8.0 * A), $MachinePrecision]], $MachinePrecision] * N[(C * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-170], N[(N[Sqrt[N[(F * N[(t$95$2 * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[t$95$1], $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5000000.0], N[(N[(N[Sqrt[N[(N[(F * N[(B$95$m * B$95$m + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(A + N[(C + t$95$4), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+46], N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e+189], N[(N[(N[(B$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + t$95$4), $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $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}^{2} - \left(4 \cdot A\right) \cdot C\\
t_1 := -0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\\
t_2 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_3 := -t\_2\\
t_4 := \mathsf{hypot}\left(A - C, B\_m\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{-303}:\\
\;\;\;\;\frac{\left|\sqrt{-8 \cdot A} \cdot \left(C \cdot \sqrt{F}\right)\right| \cdot \sqrt{2}}{t\_3}\\
\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{-170}:\\
\;\;\;\;\sqrt{F \cdot \left(t\_2 \cdot 2\right)} \cdot \frac{\sqrt{t\_1}}{t\_3}\\
\mathbf{elif}\;{B\_m}^{2} \leq 5000000:\\
\;\;\;\;\frac{\sqrt{\left(F \cdot \mathsf{fma}\left(B\_m, B\_m, \left(A \cdot C\right) \cdot -4\right)\right) \cdot 2} \cdot \sqrt{A + \left(C + t\_4\right)}}{t\_3}\\
\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+46}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot t\_1}}{t\_0}\\
\mathbf{elif}\;{B\_m}^{2} \leq 4 \cdot 10^{+189}:\\
\;\;\;\;\left(\left(B\_m \cdot \sqrt{2}\right) \cdot \sqrt{F}\right) \cdot \frac{\sqrt{\left(A + C\right) + t\_4}}{t\_3}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\right)\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 1.99999999999999986e-303Initial program 13.0%
Simplified23.5%
Taylor expanded in A around -inf 25.7%
Taylor expanded in F around 0 22.5%
Taylor expanded in A around inf 16.2%
add-sqr-sqrt16.2%
rem-sqrt-square16.2%
associate-*r*16.2%
sqrt-prod17.3%
sqrt-prod20.4%
sqrt-pow134.4%
metadata-eval34.4%
pow134.4%
Applied egg-rr34.4%
if 1.99999999999999986e-303 < (pow.f64 B #s(literal 2 binary64)) < 1.99999999999999997e-170Initial program 37.5%
Simplified49.1%
associate-*r*49.1%
associate-+r+47.9%
hypot-undefine37.5%
unpow237.5%
unpow237.5%
+-commutative37.5%
sqrt-prod40.6%
*-commutative40.6%
associate-*r*40.6%
associate-+l+42.0%
Applied egg-rr55.9%
associate-/l*56.2%
associate-*l*56.2%
associate-*r*56.2%
associate-+r+54.2%
Applied egg-rr54.2%
Taylor expanded in A around -inf 25.1%
if 1.99999999999999997e-170 < (pow.f64 B #s(literal 2 binary64)) < 5e6Initial program 41.4%
Simplified42.9%
associate-*r*42.9%
associate-+r+41.7%
hypot-undefine41.4%
unpow241.4%
unpow241.4%
+-commutative41.4%
sqrt-prod44.3%
*-commutative44.3%
associate-*r*44.3%
associate-+l+44.5%
Applied egg-rr61.0%
if 5e6 < (pow.f64 B #s(literal 2 binary64)) < 5.0000000000000002e46Initial program 29.8%
Taylor expanded in A around -inf 23.8%
if 5.0000000000000002e46 < (pow.f64 B #s(literal 2 binary64)) < 4.0000000000000001e189Initial program 34.9%
Simplified42.4%
associate-*r*42.4%
associate-+r+42.1%
hypot-undefine34.9%
unpow234.9%
unpow234.9%
+-commutative34.9%
sqrt-prod39.7%
*-commutative39.7%
associate-*r*39.7%
associate-+l+39.8%
Applied egg-rr52.1%
associate-/l*52.2%
associate-*l*52.2%
associate-*r*52.2%
associate-+r+52.1%
Applied egg-rr52.1%
Taylor expanded in B around inf 29.8%
if 4.0000000000000001e189 < (pow.f64 B #s(literal 2 binary64)) Initial program 5.3%
Taylor expanded in B around inf 23.5%
pow1/223.5%
div-inv23.5%
unpow-prod-down34.9%
pow1/234.9%
Applied egg-rr34.9%
unpow1/234.9%
sqrt-prod23.5%
div-inv23.5%
sqrt-prod23.6%
associate-*l/23.6%
sqrt-div35.0%
Applied egg-rr35.0%
div-inv34.9%
pow1/234.9%
pow-flip35.1%
metadata-eval35.1%
Applied egg-rr35.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 (* -1.0 (* (sqrt (* -0.5 (/ F A))) (sqrt 2.0))))
(t_1 (fma B_m B_m (* A (* C -4.0))))
(t_2 (- t_1)))
(if (<= (pow B_m 2.0) 1e-100)
(/ (sqrt (* (* t_1 F) (* 2.0 (* 2.0 C)))) t_2)
(if (<= (pow B_m 2.0) 5e+24)
t_0
(if (<= (pow B_m 2.0) 5e+139)
(-
(/
(sqrt
(* (pow B_m 2.0) (* F (* 2.0 (+ (+ A C) (hypot B_m (- A C)))))))
t_1))
(if (<= (pow B_m 2.0) 2e+195)
t_0
(if (<= (pow B_m 2.0) 4e+220)
(/
(sqrt
(*
(* (pow B_m 2.0) F)
(* 2.0 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))))
t_2)
(* -1.0 (* (sqrt (* F 2.0)) (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 = -1.0 * (sqrt((-0.5 * (F / A))) * sqrt(2.0));
double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
double t_2 = -t_1;
double tmp;
if (pow(B_m, 2.0) <= 1e-100) {
tmp = sqrt(((t_1 * F) * (2.0 * (2.0 * C)))) / t_2;
} else if (pow(B_m, 2.0) <= 5e+24) {
tmp = t_0;
} else if (pow(B_m, 2.0) <= 5e+139) {
tmp = -(sqrt((pow(B_m, 2.0) * (F * (2.0 * ((A + C) + hypot(B_m, (A - C))))))) / t_1);
} else if (pow(B_m, 2.0) <= 2e+195) {
tmp = t_0;
} else if (pow(B_m, 2.0) <= 4e+220) {
tmp = sqrt(((pow(B_m, 2.0) * F) * (2.0 * ((-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C))))) / t_2;
} else {
tmp = -1.0 * (sqrt((F * 2.0)) * 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(-1.0 * Float64(sqrt(Float64(-0.5 * Float64(F / A))) * sqrt(2.0))) t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_2 = Float64(-t_1) tmp = 0.0 if ((B_m ^ 2.0) <= 1e-100) tmp = Float64(sqrt(Float64(Float64(t_1 * F) * Float64(2.0 * Float64(2.0 * C)))) / t_2); elseif ((B_m ^ 2.0) <= 5e+24) tmp = t_0; elseif ((B_m ^ 2.0) <= 5e+139) tmp = Float64(-Float64(sqrt(Float64((B_m ^ 2.0) * Float64(F * Float64(2.0 * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))))) / t_1)); elseif ((B_m ^ 2.0) <= 2e+195) tmp = t_0; elseif ((B_m ^ 2.0) <= 4e+220) tmp = Float64(sqrt(Float64(Float64((B_m ^ 2.0) * F) * Float64(2.0 * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C))))) / t_2); else tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -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[(-1.0 * N[(N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = (-t$95$1)}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-100], N[(N[Sqrt[N[(N[(t$95$1 * F), $MachinePrecision] * N[(2.0 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+24], t$95$0, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+139], (-N[(N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] * N[(F * N[(2.0 * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]), If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+195], t$95$0, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e+220], N[(N[Sqrt[N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] * F), $MachinePrecision] * N[(2.0 * N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $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 := -1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\
t_1 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_2 := -t\_1\\
\mathbf{if}\;{B\_m}^{2} \leq 10^{-100}:\\
\;\;\;\;\frac{\sqrt{\left(t\_1 \cdot F\right) \cdot \left(2 \cdot \left(2 \cdot C\right)\right)}}{t\_2}\\
\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+24}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+139}:\\
\;\;\;\;-\frac{\sqrt{{B\_m}^{2} \cdot \left(F \cdot \left(2 \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_1}\\
\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+195}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;{B\_m}^{2} \leq 4 \cdot 10^{+220}:\\
\;\;\;\;\frac{\sqrt{\left({B\_m}^{2} \cdot F\right) \cdot \left(2 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)\right)}}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\right)\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 1e-100Initial program 23.7%
Simplified33.9%
Taylor expanded in A around -inf 25.3%
if 1e-100 < (pow.f64 B #s(literal 2 binary64)) < 5.00000000000000045e24 or 5.0000000000000003e139 < (pow.f64 B #s(literal 2 binary64)) < 1.99999999999999995e195Initial program 24.8%
Simplified27.0%
Taylor expanded in A around -inf 13.9%
Taylor expanded in F around 0 21.5%
Taylor expanded in B around 0 28.6%
if 5.00000000000000045e24 < (pow.f64 B #s(literal 2 binary64)) < 5.0000000000000003e139Initial program 43.7%
Simplified50.3%
Taylor expanded in B around inf 47.3%
distribute-frac-neg247.3%
associate-*l*47.0%
associate-+r+47.4%
Applied egg-rr47.4%
if 1.99999999999999995e195 < (pow.f64 B #s(literal 2 binary64)) < 4e220Initial program 26.7%
Simplified33.4%
Taylor expanded in A around -inf 27.4%
Taylor expanded in B around inf 26.9%
if 4e220 < (pow.f64 B #s(literal 2 binary64)) Initial program 4.2%
Taylor expanded in B around inf 25.0%
pow1/225.0%
div-inv25.0%
unpow-prod-down37.3%
pow1/237.3%
Applied egg-rr37.3%
unpow1/237.3%
sqrt-prod25.0%
div-inv25.0%
sqrt-prod25.1%
associate-*l/25.1%
sqrt-div37.4%
Applied egg-rr37.4%
div-inv37.3%
pow1/237.3%
pow-flip37.5%
metadata-eval37.5%
Applied egg-rr37.5%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0))))
(t_1 (sqrt (* F (* t_0 2.0))))
(t_2 (- t_0)))
(if (<= (pow B_m 2.0) 2e-303)
(/ (* (fabs (* (sqrt (* -8.0 A)) (* C (sqrt F)))) (sqrt 2.0)) t_2)
(if (<= (pow B_m 2.0) 1e-272)
(* t_1 (* 0.25 (* (/ (sqrt 2.0) A) (sqrt (/ 1.0 C)))))
(if (<= (pow B_m 2.0) 2e-245)
(* -1.0 (* (sqrt (* -0.5 (/ F A))) (sqrt 2.0)))
(if (<= (pow B_m 2.0) 4e+82)
(* t_1 (/ (sqrt (+ (+ A C) (hypot (- A C) B_m))) t_2))
(* -1.0 (* (sqrt (* F 2.0)) (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 = fma(B_m, B_m, (A * (C * -4.0)));
double t_1 = sqrt((F * (t_0 * 2.0)));
double t_2 = -t_0;
double tmp;
if (pow(B_m, 2.0) <= 2e-303) {
tmp = (fabs((sqrt((-8.0 * A)) * (C * sqrt(F)))) * sqrt(2.0)) / t_2;
} else if (pow(B_m, 2.0) <= 1e-272) {
tmp = t_1 * (0.25 * ((sqrt(2.0) / A) * sqrt((1.0 / C))));
} else if (pow(B_m, 2.0) <= 2e-245) {
tmp = -1.0 * (sqrt((-0.5 * (F / A))) * sqrt(2.0));
} else if (pow(B_m, 2.0) <= 4e+82) {
tmp = t_1 * (sqrt(((A + C) + hypot((A - C), B_m))) / t_2);
} else {
tmp = -1.0 * (sqrt((F * 2.0)) * 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 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_1 = sqrt(Float64(F * Float64(t_0 * 2.0))) t_2 = Float64(-t_0) tmp = 0.0 if ((B_m ^ 2.0) <= 2e-303) tmp = Float64(Float64(abs(Float64(sqrt(Float64(-8.0 * A)) * Float64(C * sqrt(F)))) * sqrt(2.0)) / t_2); elseif ((B_m ^ 2.0) <= 1e-272) tmp = Float64(t_1 * Float64(0.25 * Float64(Float64(sqrt(2.0) / A) * sqrt(Float64(1.0 / C))))); elseif ((B_m ^ 2.0) <= 2e-245) tmp = Float64(-1.0 * Float64(sqrt(Float64(-0.5 * Float64(F / A))) * sqrt(2.0))); elseif ((B_m ^ 2.0) <= 4e+82) tmp = Float64(t_1 * Float64(sqrt(Float64(Float64(A + C) + hypot(Float64(A - C), B_m))) / t_2)); else tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -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[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(F * N[(t$95$0 * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = (-t$95$0)}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-303], N[(N[(N[Abs[N[(N[Sqrt[N[(-8.0 * A), $MachinePrecision]], $MachinePrecision] * N[(C * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-272], N[(t$95$1 * N[(0.25 * N[(N[(N[Sqrt[2.0], $MachinePrecision] / A), $MachinePrecision] * N[Sqrt[N[(1.0 / C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-245], N[(-1.0 * N[(N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e+82], N[(t$95$1 * N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := \sqrt{F \cdot \left(t\_0 \cdot 2\right)}\\
t_2 := -t\_0\\
\mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{-303}:\\
\;\;\;\;\frac{\left|\sqrt{-8 \cdot A} \cdot \left(C \cdot \sqrt{F}\right)\right| \cdot \sqrt{2}}{t\_2}\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{-272}:\\
\;\;\;\;t\_1 \cdot \left(0.25 \cdot \left(\frac{\sqrt{2}}{A} \cdot \sqrt{\frac{1}{C}}\right)\right)\\
\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{-245}:\\
\;\;\;\;-1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\
\mathbf{elif}\;{B\_m}^{2} \leq 4 \cdot 10^{+82}:\\
\;\;\;\;t\_1 \cdot \frac{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\_m\right)}}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\right)\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 1.99999999999999986e-303Initial program 13.0%
Simplified23.5%
Taylor expanded in A around -inf 25.7%
Taylor expanded in F around 0 22.5%
Taylor expanded in A around inf 16.2%
add-sqr-sqrt16.2%
rem-sqrt-square16.2%
associate-*r*16.2%
sqrt-prod17.3%
sqrt-prod20.4%
sqrt-pow134.4%
metadata-eval34.4%
pow134.4%
Applied egg-rr34.4%
if 1.99999999999999986e-303 < (pow.f64 B #s(literal 2 binary64)) < 9.9999999999999993e-273Initial program 34.9%
Simplified53.3%
associate-*r*53.3%
associate-+r+52.0%
hypot-undefine34.9%
unpow234.9%
unpow234.9%
+-commutative34.9%
sqrt-prod42.6%
*-commutative42.6%
associate-*r*42.6%
associate-+l+44.0%
Applied egg-rr69.7%
associate-/l*70.0%
associate-*l*70.0%
associate-*r*70.0%
associate-+r+67.2%
Applied egg-rr67.2%
Taylor expanded in A around -inf 17.9%
if 9.9999999999999993e-273 < (pow.f64 B #s(literal 2 binary64)) < 1.9999999999999999e-245Initial program 1.9%
Simplified5.9%
Taylor expanded in A around -inf 24.6%
Taylor expanded in F around 0 29.2%
Taylor expanded in B around 0 52.7%
if 1.9999999999999999e-245 < (pow.f64 B #s(literal 2 binary64)) < 3.9999999999999999e82Initial program 41.9%
Simplified47.1%
associate-*r*47.1%
associate-+r+46.3%
hypot-undefine41.9%
unpow241.9%
unpow241.9%
+-commutative41.9%
sqrt-prod43.1%
*-commutative43.1%
associate-*r*43.1%
associate-+l+43.2%
Applied egg-rr57.3%
associate-/l*57.4%
associate-*l*57.4%
associate-*r*57.4%
associate-+r+57.0%
Applied egg-rr57.0%
if 3.9999999999999999e82 < (pow.f64 B #s(literal 2 binary64)) Initial program 10.9%
Taylor expanded in B around inf 23.5%
pow1/223.5%
div-inv23.6%
unpow-prod-down32.2%
pow1/232.2%
Applied egg-rr32.2%
unpow1/232.2%
sqrt-prod23.6%
div-inv23.5%
sqrt-prod23.7%
associate-*l/23.7%
sqrt-div32.3%
Applied egg-rr32.3%
div-inv32.2%
pow1/232.2%
pow-flip32.4%
metadata-eval32.4%
Applied egg-rr32.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 (fma B_m B_m (* A (* C -4.0)))) (t_1 (- t_0)) (t_2 (* t_0 F)))
(if (<= (pow B_m 2.0) 1e-100)
(/ (sqrt (* t_2 (* 2.0 (* 2.0 C)))) t_1)
(if (<= (pow B_m 2.0) 5e+24)
(* -1.0 (* (sqrt (* -0.5 (/ F A))) (sqrt 2.0)))
(if (<= (pow B_m 2.0) 5e+139)
(/ (sqrt (* t_2 (* 2.0 (+ A (+ C (hypot B_m (- A C))))))) t_1)
(if (<= (pow B_m 2.0) 5e+171)
(*
-1.0
(*
(sqrt
(/
(* F (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))
(+ (* -4.0 (* A C)) (pow B_m 2.0))))
(sqrt 2.0)))
(* -1.0 (* (sqrt (* F 2.0)) (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 = fma(B_m, B_m, (A * (C * -4.0)));
double t_1 = -t_0;
double t_2 = t_0 * F;
double tmp;
if (pow(B_m, 2.0) <= 1e-100) {
tmp = sqrt((t_2 * (2.0 * (2.0 * C)))) / t_1;
} else if (pow(B_m, 2.0) <= 5e+24) {
tmp = -1.0 * (sqrt((-0.5 * (F / A))) * sqrt(2.0));
} else if (pow(B_m, 2.0) <= 5e+139) {
tmp = sqrt((t_2 * (2.0 * (A + (C + hypot(B_m, (A - C))))))) / t_1;
} else if (pow(B_m, 2.0) <= 5e+171) {
tmp = -1.0 * (sqrt(((F * ((-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C))) / ((-4.0 * (A * C)) + pow(B_m, 2.0)))) * sqrt(2.0));
} else {
tmp = -1.0 * (sqrt((F * 2.0)) * 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 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_1 = Float64(-t_0) t_2 = Float64(t_0 * F) tmp = 0.0 if ((B_m ^ 2.0) <= 1e-100) tmp = Float64(sqrt(Float64(t_2 * Float64(2.0 * Float64(2.0 * C)))) / t_1); elseif ((B_m ^ 2.0) <= 5e+24) tmp = Float64(-1.0 * Float64(sqrt(Float64(-0.5 * Float64(F / A))) * sqrt(2.0))); elseif ((B_m ^ 2.0) <= 5e+139) tmp = Float64(sqrt(Float64(t_2 * Float64(2.0 * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))))) / t_1); elseif ((B_m ^ 2.0) <= 5e+171) tmp = Float64(-1.0 * Float64(sqrt(Float64(Float64(F * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C))) / Float64(Float64(-4.0 * Float64(A * C)) + (B_m ^ 2.0)))) * sqrt(2.0))); else tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -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[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-t$95$0)}, Block[{t$95$2 = N[(t$95$0 * F), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-100], N[(N[Sqrt[N[(t$95$2 * N[(2.0 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+24], N[(-1.0 * N[(N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+139], N[(N[Sqrt[N[(t$95$2 * N[(2.0 * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+171], N[(-1.0 * N[(N[Sqrt[N[(N[(F * N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := -t\_0\\
t_2 := t\_0 \cdot F\\
\mathbf{if}\;{B\_m}^{2} \leq 10^{-100}:\\
\;\;\;\;\frac{\sqrt{t\_2 \cdot \left(2 \cdot \left(2 \cdot C\right)\right)}}{t\_1}\\
\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+24}:\\
\;\;\;\;-1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\
\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+139}:\\
\;\;\;\;\frac{\sqrt{t\_2 \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_1}\\
\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+171}:\\
\;\;\;\;-1 \cdot \left(\sqrt{\frac{F \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)}{-4 \cdot \left(A \cdot C\right) + {B\_m}^{2}}} \cdot \sqrt{2}\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\right)\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 1e-100Initial program 23.7%
Simplified33.9%
Taylor expanded in A around -inf 25.3%
if 1e-100 < (pow.f64 B #s(literal 2 binary64)) < 5.00000000000000045e24Initial program 32.5%
Simplified32.3%
Taylor expanded in A around -inf 10.6%
Taylor expanded in F around 0 19.0%
Taylor expanded in B around 0 27.3%
if 5.00000000000000045e24 < (pow.f64 B #s(literal 2 binary64)) < 5.0000000000000003e139Initial program 43.7%
Simplified50.3%
if 5.0000000000000003e139 < (pow.f64 B #s(literal 2 binary64)) < 5.0000000000000004e171Initial program 3.6%
Simplified3.2%
Taylor expanded in A around -inf 29.3%
Taylor expanded in F around 0 43.9%
if 5.0000000000000004e171 < (pow.f64 B #s(literal 2 binary64)) Initial program 7.2%
Taylor expanded in B around inf 23.9%
pow1/223.9%
div-inv23.9%
unpow-prod-down34.2%
pow1/234.2%
Applied egg-rr34.2%
unpow1/234.2%
sqrt-prod23.9%
div-inv23.9%
sqrt-prod24.0%
associate-*l/24.0%
sqrt-div34.4%
Applied egg-rr34.4%
div-inv34.3%
pow1/234.3%
pow-flip34.4%
metadata-eval34.4%
Applied egg-rr34.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 (fma B_m B_m (* A (* C -4.0)))))
(if (<= (pow B_m 2.0) 1e-100)
(/
(sqrt (* (* t_0 F) (* 2.0 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))))
(- t_0))
(if (<= (pow B_m 2.0) 1e+49)
(* -1.0 (* (sqrt (* -0.5 (/ F A))) (sqrt 2.0)))
(* -1.0 (* (sqrt (* F 2.0)) (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 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (pow(B_m, 2.0) <= 1e-100) {
tmp = sqrt(((t_0 * F) * (2.0 * ((-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C))))) / -t_0;
} else if (pow(B_m, 2.0) <= 1e+49) {
tmp = -1.0 * (sqrt((-0.5 * (F / A))) * sqrt(2.0));
} else {
tmp = -1.0 * (sqrt((F * 2.0)) * 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 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 1e-100) tmp = Float64(sqrt(Float64(Float64(t_0 * F) * Float64(2.0 * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C))))) / Float64(-t_0)); elseif ((B_m ^ 2.0) <= 1e+49) tmp = Float64(-1.0 * Float64(sqrt(Float64(-0.5 * Float64(F / A))) * sqrt(2.0))); else tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -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[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-100], N[(N[Sqrt[N[(N[(t$95$0 * F), $MachinePrecision] * N[(2.0 * N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$0)), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+49], N[(-1.0 * N[(N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 10^{-100}:\\
\;\;\;\;\frac{\sqrt{\left(t\_0 \cdot F\right) \cdot \left(2 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)\right)}}{-t\_0}\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{+49}:\\
\;\;\;\;-1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\right)\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 1e-100Initial program 23.7%
Simplified33.9%
Taylor expanded in A around -inf 25.6%
if 1e-100 < (pow.f64 B #s(literal 2 binary64)) < 9.99999999999999946e48Initial program 34.9%
Simplified35.8%
Taylor expanded in A around -inf 18.6%
Taylor expanded in F around 0 21.2%
Taylor expanded in B around 0 26.6%
if 9.99999999999999946e48 < (pow.f64 B #s(literal 2 binary64)) Initial program 14.2%
Taylor expanded in B around inf 21.8%
pow1/221.8%
div-inv21.8%
unpow-prod-down30.2%
pow1/230.2%
Applied egg-rr30.2%
unpow1/230.2%
sqrt-prod21.8%
div-inv21.8%
sqrt-prod21.9%
associate-*l/21.9%
sqrt-div30.3%
Applied egg-rr30.3%
div-inv30.2%
pow1/230.2%
pow-flip30.3%
metadata-eval30.3%
Applied egg-rr30.3%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
(if (<= (pow B_m 2.0) 1e-100)
(/ (sqrt (* (* t_0 F) (* 2.0 (* 2.0 C)))) (- t_0))
(if (<= (pow B_m 2.0) 1e+49)
(* -1.0 (* (sqrt (* -0.5 (/ F A))) (sqrt 2.0)))
(* -1.0 (* (sqrt (* F 2.0)) (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 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (pow(B_m, 2.0) <= 1e-100) {
tmp = sqrt(((t_0 * F) * (2.0 * (2.0 * C)))) / -t_0;
} else if (pow(B_m, 2.0) <= 1e+49) {
tmp = -1.0 * (sqrt((-0.5 * (F / A))) * sqrt(2.0));
} else {
tmp = -1.0 * (sqrt((F * 2.0)) * 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 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 1e-100) tmp = Float64(sqrt(Float64(Float64(t_0 * F) * Float64(2.0 * Float64(2.0 * C)))) / Float64(-t_0)); elseif ((B_m ^ 2.0) <= 1e+49) tmp = Float64(-1.0 * Float64(sqrt(Float64(-0.5 * Float64(F / A))) * sqrt(2.0))); else tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -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[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-100], N[(N[Sqrt[N[(N[(t$95$0 * F), $MachinePrecision] * N[(2.0 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$0)), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+49], N[(-1.0 * N[(N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 10^{-100}:\\
\;\;\;\;\frac{\sqrt{\left(t\_0 \cdot F\right) \cdot \left(2 \cdot \left(2 \cdot C\right)\right)}}{-t\_0}\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{+49}:\\
\;\;\;\;-1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\right)\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 1e-100Initial program 23.7%
Simplified33.9%
Taylor expanded in A around -inf 25.3%
if 1e-100 < (pow.f64 B #s(literal 2 binary64)) < 9.99999999999999946e48Initial program 34.9%
Simplified35.8%
Taylor expanded in A around -inf 18.6%
Taylor expanded in F around 0 21.2%
Taylor expanded in B around 0 26.6%
if 9.99999999999999946e48 < (pow.f64 B #s(literal 2 binary64)) Initial program 14.2%
Taylor expanded in B around inf 21.8%
pow1/221.8%
div-inv21.8%
unpow-prod-down30.2%
pow1/230.2%
Applied egg-rr30.2%
unpow1/230.2%
sqrt-prod21.8%
div-inv21.8%
sqrt-prod21.9%
associate-*l/21.9%
sqrt-div30.3%
Applied egg-rr30.3%
div-inv30.2%
pow1/230.2%
pow-flip30.3%
metadata-eval30.3%
Applied egg-rr30.3%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (if (<= (pow B_m 2.0) 1e+49) (* -1.0 (* (sqrt (* -0.5 (/ F A))) (sqrt 2.0))) (* -1.0 (* (sqrt (* F 2.0)) (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 (pow(B_m, 2.0) <= 1e+49) {
tmp = -1.0 * (sqrt((-0.5 * (F / A))) * sqrt(2.0));
} else {
tmp = -1.0 * (sqrt((F * 2.0)) * 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.0d0) <= 1d+49) then
tmp = (-1.0d0) * (sqrt(((-0.5d0) * (f / a))) * sqrt(2.0d0))
else
tmp = (-1.0d0) * (sqrt((f * 2.0d0)) * (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 (Math.pow(B_m, 2.0) <= 1e+49) {
tmp = -1.0 * (Math.sqrt((-0.5 * (F / A))) * Math.sqrt(2.0));
} else {
tmp = -1.0 * (Math.sqrt((F * 2.0)) * 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 math.pow(B_m, 2.0) <= 1e+49: tmp = -1.0 * (math.sqrt((-0.5 * (F / A))) * math.sqrt(2.0)) else: tmp = -1.0 * (math.sqrt((F * 2.0)) * 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.0) <= 1e+49) tmp = Float64(-1.0 * Float64(sqrt(Float64(-0.5 * Float64(F / A))) * sqrt(2.0))); else tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (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.0) <= 1e+49)
tmp = -1.0 * (sqrt((-0.5 * (F / A))) * sqrt(2.0));
else
tmp = -1.0 * (sqrt((F * 2.0)) * (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[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+49], N[(-1.0 * N[(N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;{B\_m}^{2} \leq 10^{+49}:\\
\;\;\;\;-1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\right)\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 9.99999999999999946e48Initial program 26.7%
Simplified34.4%
Taylor expanded in A around -inf 23.7%
Taylor expanded in F around 0 16.5%
Taylor expanded in B around 0 22.9%
if 9.99999999999999946e48 < (pow.f64 B #s(literal 2 binary64)) Initial program 14.2%
Taylor expanded in B around inf 21.8%
pow1/221.8%
div-inv21.8%
unpow-prod-down30.2%
pow1/230.2%
Applied egg-rr30.2%
unpow1/230.2%
sqrt-prod21.8%
div-inv21.8%
sqrt-prod21.9%
associate-*l/21.9%
sqrt-div30.3%
Applied egg-rr30.3%
div-inv30.2%
pow1/230.2%
pow-flip30.3%
metadata-eval30.3%
Applied egg-rr30.3%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (if (<= C 9.6e+202) (* -1.0 (* (sqrt (* F 2.0)) (pow B_m -0.5))) (* -2.0 (* (/ 1.0 B_m) (sqrt (* C 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 tmp;
if (C <= 9.6e+202) {
tmp = -1.0 * (sqrt((F * 2.0)) * pow(B_m, -0.5));
} else {
tmp = -2.0 * ((1.0 / B_m) * sqrt((C * 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) :: tmp
if (c <= 9.6d+202) then
tmp = (-1.0d0) * (sqrt((f * 2.0d0)) * (b_m ** (-0.5d0)))
else
tmp = (-2.0d0) * ((1.0d0 / b_m) * sqrt((c * 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 tmp;
if (C <= 9.6e+202) {
tmp = -1.0 * (Math.sqrt((F * 2.0)) * Math.pow(B_m, -0.5));
} else {
tmp = -2.0 * ((1.0 / B_m) * Math.sqrt((C * 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): tmp = 0 if C <= 9.6e+202: tmp = -1.0 * (math.sqrt((F * 2.0)) * math.pow(B_m, -0.5)) else: tmp = -2.0 * ((1.0 / B_m) * math.sqrt((C * 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) tmp = 0.0 if (C <= 9.6e+202) tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -0.5))); else tmp = Float64(-2.0 * Float64(Float64(1.0 / B_m) * sqrt(Float64(C * 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)
tmp = 0.0;
if (C <= 9.6e+202)
tmp = -1.0 * (sqrt((F * 2.0)) * (B_m ^ -0.5));
else
tmp = -2.0 * ((1.0 / B_m) * sqrt((C * 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_] := If[LessEqual[C, 9.6e+202], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(1.0 / B$95$m), $MachinePrecision] * N[Sqrt[N[(C * 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}
\mathbf{if}\;C \leq 9.6 \cdot 10^{+202}:\\
\;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(\frac{1}{B\_m} \cdot \sqrt{C \cdot F}\right)\\
\end{array}
\end{array}
if C < 9.6000000000000008e202Initial program 22.8%
Taylor expanded in B around inf 13.2%
pow1/213.4%
div-inv13.4%
unpow-prod-down18.2%
pow1/218.2%
Applied egg-rr18.2%
unpow1/218.2%
sqrt-prod13.3%
div-inv13.2%
sqrt-prod13.3%
associate-*l/13.3%
sqrt-div18.2%
Applied egg-rr18.2%
div-inv18.2%
pow1/218.2%
pow-flip18.2%
metadata-eval18.2%
Applied egg-rr18.2%
if 9.6000000000000008e202 < C Initial program 1.3%
Simplified13.9%
Taylor expanded in B around inf 6.1%
Taylor expanded in A around -inf 6.1%
Taylor expanded in B around inf 14.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 (if (<= C 1.16e+203) (* -1.0 (/ (sqrt (* F 2.0)) (sqrt B_m))) (* -2.0 (* (/ 1.0 B_m) (sqrt (* C 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 tmp;
if (C <= 1.16e+203) {
tmp = -1.0 * (sqrt((F * 2.0)) / sqrt(B_m));
} else {
tmp = -2.0 * ((1.0 / B_m) * sqrt((C * 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) :: tmp
if (c <= 1.16d+203) then
tmp = (-1.0d0) * (sqrt((f * 2.0d0)) / sqrt(b_m))
else
tmp = (-2.0d0) * ((1.0d0 / b_m) * sqrt((c * 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 tmp;
if (C <= 1.16e+203) {
tmp = -1.0 * (Math.sqrt((F * 2.0)) / Math.sqrt(B_m));
} else {
tmp = -2.0 * ((1.0 / B_m) * Math.sqrt((C * 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): tmp = 0 if C <= 1.16e+203: tmp = -1.0 * (math.sqrt((F * 2.0)) / math.sqrt(B_m)) else: tmp = -2.0 * ((1.0 / B_m) * math.sqrt((C * 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) tmp = 0.0 if (C <= 1.16e+203) tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) / sqrt(B_m))); else tmp = Float64(-2.0 * Float64(Float64(1.0 / B_m) * sqrt(Float64(C * 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)
tmp = 0.0;
if (C <= 1.16e+203)
tmp = -1.0 * (sqrt((F * 2.0)) / sqrt(B_m));
else
tmp = -2.0 * ((1.0 / B_m) * sqrt((C * 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_] := If[LessEqual[C, 1.16e+203], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] / N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(1.0 / B$95$m), $MachinePrecision] * N[Sqrt[N[(C * 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}
\mathbf{if}\;C \leq 1.16 \cdot 10^{+203}:\\
\;\;\;\;-1 \cdot \frac{\sqrt{F \cdot 2}}{\sqrt{B\_m}}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(\frac{1}{B\_m} \cdot \sqrt{C \cdot F}\right)\\
\end{array}
\end{array}
if C < 1.16e203Initial program 22.8%
Taylor expanded in B around inf 13.2%
pow1/213.4%
div-inv13.4%
unpow-prod-down18.2%
pow1/218.2%
Applied egg-rr18.2%
unpow1/218.2%
sqrt-prod13.3%
div-inv13.2%
sqrt-prod13.3%
associate-*l/13.3%
sqrt-div18.2%
Applied egg-rr18.2%
if 1.16e203 < C Initial program 1.3%
Simplified13.9%
Taylor expanded in B around inf 6.1%
Taylor expanded in A around -inf 6.1%
Taylor expanded in B around inf 14.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 (if (<= C 3.75e+202) (* -1.0 (pow (* (/ F B_m) 2.0) 0.5)) (* -2.0 (* (/ 1.0 B_m) (sqrt (* C 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 tmp;
if (C <= 3.75e+202) {
tmp = -1.0 * pow(((F / B_m) * 2.0), 0.5);
} else {
tmp = -2.0 * ((1.0 / B_m) * sqrt((C * 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) :: tmp
if (c <= 3.75d+202) then
tmp = (-1.0d0) * (((f / b_m) * 2.0d0) ** 0.5d0)
else
tmp = (-2.0d0) * ((1.0d0 / b_m) * sqrt((c * 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 tmp;
if (C <= 3.75e+202) {
tmp = -1.0 * Math.pow(((F / B_m) * 2.0), 0.5);
} else {
tmp = -2.0 * ((1.0 / B_m) * Math.sqrt((C * 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): tmp = 0 if C <= 3.75e+202: tmp = -1.0 * math.pow(((F / B_m) * 2.0), 0.5) else: tmp = -2.0 * ((1.0 / B_m) * math.sqrt((C * 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) tmp = 0.0 if (C <= 3.75e+202) tmp = Float64(-1.0 * (Float64(Float64(F / B_m) * 2.0) ^ 0.5)); else tmp = Float64(-2.0 * Float64(Float64(1.0 / B_m) * sqrt(Float64(C * 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)
tmp = 0.0;
if (C <= 3.75e+202)
tmp = -1.0 * (((F / B_m) * 2.0) ^ 0.5);
else
tmp = -2.0 * ((1.0 / B_m) * sqrt((C * 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_] := If[LessEqual[C, 3.75e+202], N[(-1.0 * N[Power[N[(N[(F / B$95$m), $MachinePrecision] * 2.0), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(1.0 / B$95$m), $MachinePrecision] * N[Sqrt[N[(C * 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}
\mathbf{if}\;C \leq 3.75 \cdot 10^{+202}:\\
\;\;\;\;-1 \cdot {\left(\frac{F}{B\_m} \cdot 2\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(\frac{1}{B\_m} \cdot \sqrt{C \cdot F}\right)\\
\end{array}
\end{array}
if C < 3.75e202Initial program 22.8%
Taylor expanded in B around inf 13.2%
sqrt-unprod13.3%
pow1/213.5%
Applied egg-rr13.5%
if 3.75e202 < C Initial program 1.3%
Simplified13.9%
Taylor expanded in B around inf 6.1%
Taylor expanded in A around -inf 6.1%
Taylor expanded in B around inf 14.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 (* -1.0 (pow (* (/ F B_m) 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) {
return -1.0 * pow(((F / B_m) * 2.0), 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 = (-1.0d0) * (((f / b_m) * 2.0d0) ** 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 -1.0 * Math.pow(((F / B_m) * 2.0), 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 -1.0 * math.pow(((F / B_m) * 2.0), 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(-1.0 * (Float64(Float64(F / B_m) * 2.0) ^ 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 = -1.0 * (((F / B_m) * 2.0) ^ 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[(-1.0 * N[Power[N[(N[(F / B$95$m), $MachinePrecision] * 2.0), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
-1 \cdot {\left(\frac{F}{B\_m} \cdot 2\right)}^{0.5}
\end{array}
Initial program 20.9%
Taylor expanded in B around inf 12.3%
sqrt-unprod12.4%
pow1/212.5%
Applied egg-rr12.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 (* -1.0 (sqrt (* (/ F B_m) 2.0))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
return -1.0 * sqrt(((F / B_m) * 2.0));
}
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 = (-1.0d0) * sqrt(((f / b_m) * 2.0d0))
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 -1.0 * Math.sqrt(((F / B_m) * 2.0));
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): return -1.0 * math.sqrt(((F / B_m) * 2.0))
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return Float64(-1.0 * sqrt(Float64(Float64(F / B_m) * 2.0))) 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 = -1.0 * sqrt(((F / B_m) * 2.0));
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[(-1.0 * N[Sqrt[N[(N[(F / B$95$m), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
-1 \cdot \sqrt{\frac{F}{B\_m} \cdot 2}
\end{array}
Initial program 20.9%
Taylor expanded in B around inf 12.3%
sqrt-unprod12.4%
Applied egg-rr12.4%
herbie shell --seed 2024077 -o generate:simplify
(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))))