| Alternative 1 | |
|---|---|
| Error | 46.3 |
| Cost | 183632 |
(FPCore (A B C F)
: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))))(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (pow B 2.0) (pow A 2.0)))
(t_1 (pow (- A) 2.0))
(t_2 (- t_0 t_1))
(t_3 (sqrt (+ (pow B 2.0) (pow (- A C) 2.0))))
(t_4 (/ (sqrt 2.0) B))
(t_5 (- (pow B 2.0) (* A (* 4.0 C))))
(t_6 (- (pow B 2.0) (* 4.0 (* C A))))
(t_7 (- A (- A))))
(if (<= C -9e+149)
(- (* t_4 (sqrt (* (* (/ (pow B 2.0) A) -0.5) F))))
(if (<= C -5.5e-121)
(/ (- (sqrt (* 2.0 (* (* t_5 F) (+ C (- A t_3)))))) t_5)
(if (<= C -3.4e-211)
(- (* (sqrt (* F (- C B))) t_4))
(if (<= C 8e-46)
(/ (- (sqrt (* t_6 (* (+ A (- C t_3)) (* 2.0 F))))) t_6)
(/
(-
(sqrt
(+
(* -8.0 (* A (* (* F C) t_7)))
(*
2.0
(+
(* F (+ (* 2.0 (* A t_2)) (* (pow B 2.0) t_7)))
(/
(*
F
(+
(* (pow A 2.0) (* -2.0 (- t_1 t_0)))
(* -0.5 (* (pow B 2.0) t_2))))
C))))))
t_6)))))))double code(double A, double B, double C, double F) {
return -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));
}
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) + pow(A, 2.0);
double t_1 = pow(-A, 2.0);
double t_2 = t_0 - t_1;
double t_3 = sqrt((pow(B, 2.0) + pow((A - C), 2.0)));
double t_4 = sqrt(2.0) / B;
double t_5 = pow(B, 2.0) - (A * (4.0 * C));
double t_6 = pow(B, 2.0) - (4.0 * (C * A));
double t_7 = A - -A;
double tmp;
if (C <= -9e+149) {
tmp = -(t_4 * sqrt((((pow(B, 2.0) / A) * -0.5) * F)));
} else if (C <= -5.5e-121) {
tmp = -sqrt((2.0 * ((t_5 * F) * (C + (A - t_3))))) / t_5;
} else if (C <= -3.4e-211) {
tmp = -(sqrt((F * (C - B))) * t_4);
} else if (C <= 8e-46) {
tmp = -sqrt((t_6 * ((A + (C - t_3)) * (2.0 * F)))) / t_6;
} else {
tmp = -sqrt(((-8.0 * (A * ((F * C) * t_7))) + (2.0 * ((F * ((2.0 * (A * t_2)) + (pow(B, 2.0) * t_7))) + ((F * ((pow(A, 2.0) * (-2.0 * (t_1 - t_0))) + (-0.5 * (pow(B, 2.0) * t_2)))) / C))))) / t_6;
}
return tmp;
}
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
code = -sqrt(((2.0d0 * (((b ** 2.0d0) - ((4.0d0 * a) * c)) * f)) * ((a + c) - sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / ((b ** 2.0d0) - ((4.0d0 * a) * c))
end function
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
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_0 = (b ** 2.0d0) + (a ** 2.0d0)
t_1 = -a ** 2.0d0
t_2 = t_0 - t_1
t_3 = sqrt(((b ** 2.0d0) + ((a - c) ** 2.0d0)))
t_4 = sqrt(2.0d0) / b
t_5 = (b ** 2.0d0) - (a * (4.0d0 * c))
t_6 = (b ** 2.0d0) - (4.0d0 * (c * a))
t_7 = a - -a
if (c <= (-9d+149)) then
tmp = -(t_4 * sqrt(((((b ** 2.0d0) / a) * (-0.5d0)) * f)))
else if (c <= (-5.5d-121)) then
tmp = -sqrt((2.0d0 * ((t_5 * f) * (c + (a - t_3))))) / t_5
else if (c <= (-3.4d-211)) then
tmp = -(sqrt((f * (c - b))) * t_4)
else if (c <= 8d-46) then
tmp = -sqrt((t_6 * ((a + (c - t_3)) * (2.0d0 * f)))) / t_6
else
tmp = -sqrt((((-8.0d0) * (a * ((f * c) * t_7))) + (2.0d0 * ((f * ((2.0d0 * (a * t_2)) + ((b ** 2.0d0) * t_7))) + ((f * (((a ** 2.0d0) * ((-2.0d0) * (t_1 - t_0))) + ((-0.5d0) * ((b ** 2.0d0) * t_2)))) / c))))) / t_6
end if
code = tmp
end function
public static double code(double A, double B, double C, double F) {
return -Math.sqrt(((2.0 * ((Math.pow(B, 2.0) - ((4.0 * A) * C)) * F)) * ((A + C) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / (Math.pow(B, 2.0) - ((4.0 * A) * C));
}
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) + Math.pow(A, 2.0);
double t_1 = Math.pow(-A, 2.0);
double t_2 = t_0 - t_1;
double t_3 = Math.sqrt((Math.pow(B, 2.0) + Math.pow((A - C), 2.0)));
double t_4 = Math.sqrt(2.0) / B;
double t_5 = Math.pow(B, 2.0) - (A * (4.0 * C));
double t_6 = Math.pow(B, 2.0) - (4.0 * (C * A));
double t_7 = A - -A;
double tmp;
if (C <= -9e+149) {
tmp = -(t_4 * Math.sqrt((((Math.pow(B, 2.0) / A) * -0.5) * F)));
} else if (C <= -5.5e-121) {
tmp = -Math.sqrt((2.0 * ((t_5 * F) * (C + (A - t_3))))) / t_5;
} else if (C <= -3.4e-211) {
tmp = -(Math.sqrt((F * (C - B))) * t_4);
} else if (C <= 8e-46) {
tmp = -Math.sqrt((t_6 * ((A + (C - t_3)) * (2.0 * F)))) / t_6;
} else {
tmp = -Math.sqrt(((-8.0 * (A * ((F * C) * t_7))) + (2.0 * ((F * ((2.0 * (A * t_2)) + (Math.pow(B, 2.0) * t_7))) + ((F * ((Math.pow(A, 2.0) * (-2.0 * (t_1 - t_0))) + (-0.5 * (Math.pow(B, 2.0) * t_2)))) / C))))) / t_6;
}
return tmp;
}
def code(A, B, C, F): return -math.sqrt(((2.0 * ((math.pow(B, 2.0) - ((4.0 * A) * C)) * F)) * ((A + C) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / (math.pow(B, 2.0) - ((4.0 * A) * C))
def code(A, B, C, F): t_0 = math.pow(B, 2.0) + math.pow(A, 2.0) t_1 = math.pow(-A, 2.0) t_2 = t_0 - t_1 t_3 = math.sqrt((math.pow(B, 2.0) + math.pow((A - C), 2.0))) t_4 = math.sqrt(2.0) / B t_5 = math.pow(B, 2.0) - (A * (4.0 * C)) t_6 = math.pow(B, 2.0) - (4.0 * (C * A)) t_7 = A - -A tmp = 0 if C <= -9e+149: tmp = -(t_4 * math.sqrt((((math.pow(B, 2.0) / A) * -0.5) * F))) elif C <= -5.5e-121: tmp = -math.sqrt((2.0 * ((t_5 * F) * (C + (A - t_3))))) / t_5 elif C <= -3.4e-211: tmp = -(math.sqrt((F * (C - B))) * t_4) elif C <= 8e-46: tmp = -math.sqrt((t_6 * ((A + (C - t_3)) * (2.0 * F)))) / t_6 else: tmp = -math.sqrt(((-8.0 * (A * ((F * C) * t_7))) + (2.0 * ((F * ((2.0 * (A * t_2)) + (math.pow(B, 2.0) * t_7))) + ((F * ((math.pow(A, 2.0) * (-2.0 * (t_1 - t_0))) + (-0.5 * (math.pow(B, 2.0) * t_2)))) / C))))) / t_6 return tmp
function code(A, B, C, F) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))) end
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) + (A ^ 2.0)) t_1 = Float64(-A) ^ 2.0 t_2 = Float64(t_0 - t_1) t_3 = sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))) t_4 = Float64(sqrt(2.0) / B) t_5 = Float64((B ^ 2.0) - Float64(A * Float64(4.0 * C))) t_6 = Float64((B ^ 2.0) - Float64(4.0 * Float64(C * A))) t_7 = Float64(A - Float64(-A)) tmp = 0.0 if (C <= -9e+149) tmp = Float64(-Float64(t_4 * sqrt(Float64(Float64(Float64((B ^ 2.0) / A) * -0.5) * F)))); elseif (C <= -5.5e-121) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(t_5 * F) * Float64(C + Float64(A - t_3)))))) / t_5); elseif (C <= -3.4e-211) tmp = Float64(-Float64(sqrt(Float64(F * Float64(C - B))) * t_4)); elseif (C <= 8e-46) tmp = Float64(Float64(-sqrt(Float64(t_6 * Float64(Float64(A + Float64(C - t_3)) * Float64(2.0 * F))))) / t_6); else tmp = Float64(Float64(-sqrt(Float64(Float64(-8.0 * Float64(A * Float64(Float64(F * C) * t_7))) + Float64(2.0 * Float64(Float64(F * Float64(Float64(2.0 * Float64(A * t_2)) + Float64((B ^ 2.0) * t_7))) + Float64(Float64(F * Float64(Float64((A ^ 2.0) * Float64(-2.0 * Float64(t_1 - t_0))) + Float64(-0.5 * Float64((B ^ 2.0) * t_2)))) / C)))))) / t_6); end return tmp end
function tmp = code(A, B, C, F) tmp = -sqrt(((2.0 * (((B ^ 2.0) - ((4.0 * A) * C)) * F)) * ((A + C) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / ((B ^ 2.0) - ((4.0 * A) * C)); end
function tmp_2 = code(A, B, C, F) t_0 = (B ^ 2.0) + (A ^ 2.0); t_1 = -A ^ 2.0; t_2 = t_0 - t_1; t_3 = sqrt(((B ^ 2.0) + ((A - C) ^ 2.0))); t_4 = sqrt(2.0) / B; t_5 = (B ^ 2.0) - (A * (4.0 * C)); t_6 = (B ^ 2.0) - (4.0 * (C * A)); t_7 = A - -A; tmp = 0.0; if (C <= -9e+149) tmp = -(t_4 * sqrt(((((B ^ 2.0) / A) * -0.5) * F))); elseif (C <= -5.5e-121) tmp = -sqrt((2.0 * ((t_5 * F) * (C + (A - t_3))))) / t_5; elseif (C <= -3.4e-211) tmp = -(sqrt((F * (C - B))) * t_4); elseif (C <= 8e-46) tmp = -sqrt((t_6 * ((A + (C - t_3)) * (2.0 * F)))) / t_6; else tmp = -sqrt(((-8.0 * (A * ((F * C) * t_7))) + (2.0 * ((F * ((2.0 * (A * t_2)) + ((B ^ 2.0) * t_7))) + ((F * (((A ^ 2.0) * (-2.0 * (t_1 - t_0))) + (-0.5 * ((B ^ 2.0) * t_2)))) / C))))) / t_6; end tmp_2 = tmp; end
code[A_, B_, C_, F_] := N[((-N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision] * 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]) / N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[A, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[(-A), 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$5 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(A * N[(4.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(A - (-A)), $MachinePrecision]}, If[LessEqual[C, -9e+149], (-N[(t$95$4 * N[Sqrt[N[(N[(N[(N[Power[B, 2.0], $MachinePrecision] / A), $MachinePrecision] * -0.5), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), If[LessEqual[C, -5.5e-121], N[((-N[Sqrt[N[(2.0 * N[(N[(t$95$5 * F), $MachinePrecision] * N[(C + N[(A - t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$5), $MachinePrecision], If[LessEqual[C, -3.4e-211], (-N[(N[Sqrt[N[(F * N[(C - B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$4), $MachinePrecision]), If[LessEqual[C, 8e-46], N[((-N[Sqrt[N[(t$95$6 * N[(N[(A + N[(C - t$95$3), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$6), $MachinePrecision], N[((-N[Sqrt[N[(N[(-8.0 * N[(A * N[(N[(F * C), $MachinePrecision] * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[(F * N[(N[(2.0 * N[(A * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[Power[B, 2.0], $MachinePrecision] * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F * N[(N[(N[Power[A, 2.0], $MachinePrecision] * N[(-2.0 * N[(t$95$1 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * N[(N[Power[B, 2.0], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$6), $MachinePrecision]]]]]]]]]]]]]
\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\begin{array}{l}
t_0 := {B}^{2} + {A}^{2}\\
t_1 := {\left(-A\right)}^{2}\\
t_2 := t_0 - t_1\\
t_3 := \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\\
t_4 := \frac{\sqrt{2}}{B}\\
t_5 := {B}^{2} - A \cdot \left(4 \cdot C\right)\\
t_6 := {B}^{2} - 4 \cdot \left(C \cdot A\right)\\
t_7 := A - \left(-A\right)\\
\mathbf{if}\;C \leq -9 \cdot 10^{+149}:\\
\;\;\;\;-t_4 \cdot \sqrt{\left(\frac{{B}^{2}}{A} \cdot -0.5\right) \cdot F}\\
\mathbf{elif}\;C \leq -5.5 \cdot 10^{-121}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(t_5 \cdot F\right) \cdot \left(C + \left(A - t_3\right)\right)\right)}}{t_5}\\
\mathbf{elif}\;C \leq -3.4 \cdot 10^{-211}:\\
\;\;\;\;-\sqrt{F \cdot \left(C - B\right)} \cdot t_4\\
\mathbf{elif}\;C \leq 8 \cdot 10^{-46}:\\
\;\;\;\;\frac{-\sqrt{t_6 \cdot \left(\left(A + \left(C - t_3\right)\right) \cdot \left(2 \cdot F\right)\right)}}{t_6}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{-8 \cdot \left(A \cdot \left(\left(F \cdot C\right) \cdot t_7\right)\right) + 2 \cdot \left(F \cdot \left(2 \cdot \left(A \cdot t_2\right) + {B}^{2} \cdot t_7\right) + \frac{F \cdot \left({A}^{2} \cdot \left(-2 \cdot \left(t_1 - t_0\right)\right) + -0.5 \cdot \left({B}^{2} \cdot t_2\right)\right)}{C}\right)}}{t_6}\\
\end{array}
Results
if C < -8.99999999999999965e149Initial program 63.8
Simplified63.8
[Start]63.8 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
|---|
Applied egg-rr63.8
Taylor expanded in C around 0 63.2
Simplified63.2
[Start]63.2 | \[ -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}\right)
\] |
|---|---|
rational_best_oopsla_all_46_json_45_simplify-74 [=>]63.2 | \[ \color{blue}{\left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}\right) \cdot -1}
\] |
rational_best_oopsla_all_46_json_45_simplify-92 [=>]63.2 | \[ \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}}
\] |
Taylor expanded in A around inf 54.3
Simplified54.3
[Start]54.3 | \[ -\frac{\sqrt{2}}{B} \cdot \sqrt{\left(-0.5 \cdot \frac{{B}^{2}}{A}\right) \cdot F}
\] |
|---|---|
rational_best_oopsla_all_46_json_45_simplify-74 [=>]54.3 | \[ -\frac{\sqrt{2}}{B} \cdot \sqrt{\color{blue}{\left(\frac{{B}^{2}}{A} \cdot -0.5\right)} \cdot F}
\] |
if -8.99999999999999965e149 < C < -5.50000000000000031e-121Initial program 42.7
Simplified42.3
[Start]42.7 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
|---|
if -5.50000000000000031e-121 < C < -3.4000000000000001e-211Initial program 46.5
Simplified46.5
[Start]46.5 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
|---|
Taylor expanded in B around inf 57.3
Taylor expanded in A around 0 52.7
Simplified52.7
[Start]52.7 | \[ -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C - B\right) \cdot F}\right)
\] |
|---|---|
rational_best_oopsla_all_46_json_45_simplify-74 [=>]52.7 | \[ \color{blue}{\left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C - B\right) \cdot F}\right) \cdot -1}
\] |
rational_best_oopsla_all_46_json_45_simplify-92 [=>]52.7 | \[ \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C - B\right) \cdot F}}
\] |
rational_best_oopsla_all_46_json_45_simplify-74 [=>]52.7 | \[ -\color{blue}{\sqrt{\left(C - B\right) \cdot F} \cdot \frac{\sqrt{2}}{B}}
\] |
rational_best_oopsla_all_46_json_45_simplify-74 [<=]52.7 | \[ -\sqrt{\color{blue}{F \cdot \left(C - B\right)}} \cdot \frac{\sqrt{2}}{B}
\] |
if -3.4000000000000001e-211 < C < 8.00000000000000018e-46Initial program 48.8
Simplified48.8
[Start]48.8 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
|---|
if 8.00000000000000018e-46 < C Initial program 59.4
Simplified58.5
[Start]59.4 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
|---|
Applied egg-rr58.6
Taylor expanded in C around inf 50.0
Simplified50.0
[Start]50.0 | \[ \frac{-\sqrt{-8 \cdot \left(A \cdot \left(\left(A - -1 \cdot A\right) \cdot \left(C \cdot F\right)\right)\right) + \left(2 \cdot \left(\left(2 \cdot \left(A \cdot \left(\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}\right)\right) + \left(A - -1 \cdot A\right) \cdot {B}^{2}\right) \cdot F\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left({A}^{2} \cdot \left(\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}\right)\right) + -0.5 \cdot \left(\left(\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}\right) \cdot {B}^{2}\right)\right)}{C}\right)}}{{B}^{2} - 4 \cdot \left(C \cdot A\right)}
\] |
|---|---|
rational_best_oopsla_all_46_json_45_simplify-74 [=>]50.0 | \[ \frac{-\sqrt{-8 \cdot \left(A \cdot \color{blue}{\left(\left(C \cdot F\right) \cdot \left(A - -1 \cdot A\right)\right)}\right) + \left(2 \cdot \left(\left(2 \cdot \left(A \cdot \left(\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}\right)\right) + \left(A - -1 \cdot A\right) \cdot {B}^{2}\right) \cdot F\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left({A}^{2} \cdot \left(\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}\right)\right) + -0.5 \cdot \left(\left(\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}\right) \cdot {B}^{2}\right)\right)}{C}\right)}}{{B}^{2} - 4 \cdot \left(C \cdot A\right)}
\] |
rational_best_oopsla_all_46_json_45_simplify-74 [=>]50.0 | \[ \frac{-\sqrt{-8 \cdot \left(A \cdot \left(\color{blue}{\left(F \cdot C\right)} \cdot \left(A - -1 \cdot A\right)\right)\right) + \left(2 \cdot \left(\left(2 \cdot \left(A \cdot \left(\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}\right)\right) + \left(A - -1 \cdot A\right) \cdot {B}^{2}\right) \cdot F\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left({A}^{2} \cdot \left(\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}\right)\right) + -0.5 \cdot \left(\left(\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}\right) \cdot {B}^{2}\right)\right)}{C}\right)}}{{B}^{2} - 4 \cdot \left(C \cdot A\right)}
\] |
rational_best_oopsla_all_46_json_45_simplify-74 [=>]50.0 | \[ \frac{-\sqrt{-8 \cdot \left(A \cdot \left(\left(F \cdot C\right) \cdot \left(A - \color{blue}{A \cdot -1}\right)\right)\right) + \left(2 \cdot \left(\left(2 \cdot \left(A \cdot \left(\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}\right)\right) + \left(A - -1 \cdot A\right) \cdot {B}^{2}\right) \cdot F\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left({A}^{2} \cdot \left(\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}\right)\right) + -0.5 \cdot \left(\left(\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}\right) \cdot {B}^{2}\right)\right)}{C}\right)}}{{B}^{2} - 4 \cdot \left(C \cdot A\right)}
\] |
rational_best_oopsla_all_46_json_45_simplify-92 [=>]50.0 | \[ \frac{-\sqrt{-8 \cdot \left(A \cdot \left(\left(F \cdot C\right) \cdot \left(A - \color{blue}{\left(-A\right)}\right)\right)\right) + \left(2 \cdot \left(\left(2 \cdot \left(A \cdot \left(\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}\right)\right) + \left(A - -1 \cdot A\right) \cdot {B}^{2}\right) \cdot F\right) + 2 \cdot \frac{F \cdot \left(2 \cdot \left({A}^{2} \cdot \left(\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}\right)\right) + -0.5 \cdot \left(\left(\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}\right) \cdot {B}^{2}\right)\right)}{C}\right)}}{{B}^{2} - 4 \cdot \left(C \cdot A\right)}
\] |
rational_best_oopsla_all_46_json_45_simplify-74 [=>]50.0 | \[ \frac{-\sqrt{-8 \cdot \left(A \cdot \left(\left(F \cdot C\right) \cdot \left(A - \left(-A\right)\right)\right)\right) + \left(\color{blue}{\left(\left(2 \cdot \left(A \cdot \left(\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}\right)\right) + \left(A - -1 \cdot A\right) \cdot {B}^{2}\right) \cdot F\right) \cdot 2} + 2 \cdot \frac{F \cdot \left(2 \cdot \left({A}^{2} \cdot \left(\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}\right)\right) + -0.5 \cdot \left(\left(\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}\right) \cdot {B}^{2}\right)\right)}{C}\right)}}{{B}^{2} - 4 \cdot \left(C \cdot A\right)}
\] |
Final simplification48.7
| Alternative 1 | |
|---|---|
| Error | 46.3 |
| Cost | 183632 |
| Alternative 2 | |
|---|---|
| Error | 46.5 |
| Cost | 183632 |
| Alternative 3 | |
|---|---|
| Error | 46.5 |
| Cost | 183632 |
| Alternative 4 | |
|---|---|
| Error | 48.6 |
| Cost | 41104 |
| Alternative 5 | |
|---|---|
| Error | 51.5 |
| Cost | 21520 |
| Alternative 6 | |
|---|---|
| Error | 51.4 |
| Cost | 21388 |
| Alternative 7 | |
|---|---|
| Error | 51.3 |
| Cost | 20684 |
| Alternative 8 | |
|---|---|
| Error | 49.6 |
| Cost | 20616 |
| Alternative 9 | |
|---|---|
| Error | 51.3 |
| Cost | 20164 |
| Alternative 10 | |
|---|---|
| Error | 51.9 |
| Cost | 14472 |
| Alternative 11 | |
|---|---|
| Error | 50.7 |
| Cost | 13508 |
| Alternative 12 | |
|---|---|
| Error | 57.0 |
| Cost | 7680 |
| Alternative 13 | |
|---|---|
| Error | 62.1 |
| Cost | 6976 |
herbie shell --seed 2023090
(FPCore (A B C F)
:name "ABCF->ab-angle b"
:precision binary64
(/ (- (sqrt (* (* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F)) (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))) (- (pow B 2.0) (* (* 4.0 A) C))))