| Alternative 1 | |
|---|---|
| Error | 43.0 |
| Cost | 135308 |
(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 (- C (* -1.0 C)))
(t_1 (- (+ (pow B 2.0) (pow C 2.0)) (pow (* -1.0 C) 2.0)))
(t_2 (sqrt (+ (pow B 2.0) (pow (- A C) 2.0))))
(t_3 (- (pow B 2.0) (* (* 4.0 A) C)))
(t_4 (* F (pow B 2.0))))
(if (<= C -1.18e-201)
(* -0.25 (* (/ 1.0 A) (sqrt (* (* A F) -16.0))))
(if (<= C 5.6e-290)
(/
(-
(sqrt
(* (* 2.0 (* F (- (pow B 2.0) (* (* A C) 4.0)))) (+ (- A t_2) C))))
t_3)
(if (<= C 4e-229)
(- (* (/ (sqrt 2.0) B) (sqrt (* F (- B)))))
(if (<= C 5.8e-158)
(/
(-
(sqrt
(+
(*
2.0
(/
(+ (* -0.5 (* t_1 t_4)) (* 2.0 (* t_1 (* (pow C 2.0) F))))
A))
(+
(* -8.0 (* A (* t_0 (* C F))))
(* 2.0 (+ (* 2.0 (* t_1 (* C F))) (* t_0 t_4)))))))
t_3)
(if (<= C 4.5e-89)
(/ (- (sqrt (* t_3 (* (+ A (- C t_2)) (* 2.0 F))))) t_3)
(* -0.25 (* (sqrt (* (* C F) -16.0)) (/ 1.0 C))))))))))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 = C - (-1.0 * C);
double t_1 = (pow(B, 2.0) + pow(C, 2.0)) - pow((-1.0 * C), 2.0);
double t_2 = sqrt((pow(B, 2.0) + pow((A - C), 2.0)));
double t_3 = pow(B, 2.0) - ((4.0 * A) * C);
double t_4 = F * pow(B, 2.0);
double tmp;
if (C <= -1.18e-201) {
tmp = -0.25 * ((1.0 / A) * sqrt(((A * F) * -16.0)));
} else if (C <= 5.6e-290) {
tmp = -sqrt(((2.0 * (F * (pow(B, 2.0) - ((A * C) * 4.0)))) * ((A - t_2) + C))) / t_3;
} else if (C <= 4e-229) {
tmp = -((sqrt(2.0) / B) * sqrt((F * -B)));
} else if (C <= 5.8e-158) {
tmp = -sqrt(((2.0 * (((-0.5 * (t_1 * t_4)) + (2.0 * (t_1 * (pow(C, 2.0) * F)))) / A)) + ((-8.0 * (A * (t_0 * (C * F)))) + (2.0 * ((2.0 * (t_1 * (C * F))) + (t_0 * t_4)))))) / t_3;
} else if (C <= 4.5e-89) {
tmp = -sqrt((t_3 * ((A + (C - t_2)) * (2.0 * F)))) / t_3;
} else {
tmp = -0.25 * (sqrt(((C * F) * -16.0)) * (1.0 / C));
}
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) :: tmp
t_0 = c - ((-1.0d0) * c)
t_1 = ((b ** 2.0d0) + (c ** 2.0d0)) - (((-1.0d0) * c) ** 2.0d0)
t_2 = sqrt(((b ** 2.0d0) + ((a - c) ** 2.0d0)))
t_3 = (b ** 2.0d0) - ((4.0d0 * a) * c)
t_4 = f * (b ** 2.0d0)
if (c <= (-1.18d-201)) then
tmp = (-0.25d0) * ((1.0d0 / a) * sqrt(((a * f) * (-16.0d0))))
else if (c <= 5.6d-290) then
tmp = -sqrt(((2.0d0 * (f * ((b ** 2.0d0) - ((a * c) * 4.0d0)))) * ((a - t_2) + c))) / t_3
else if (c <= 4d-229) then
tmp = -((sqrt(2.0d0) / b) * sqrt((f * -b)))
else if (c <= 5.8d-158) then
tmp = -sqrt(((2.0d0 * ((((-0.5d0) * (t_1 * t_4)) + (2.0d0 * (t_1 * ((c ** 2.0d0) * f)))) / a)) + (((-8.0d0) * (a * (t_0 * (c * f)))) + (2.0d0 * ((2.0d0 * (t_1 * (c * f))) + (t_0 * t_4)))))) / t_3
else if (c <= 4.5d-89) then
tmp = -sqrt((t_3 * ((a + (c - t_2)) * (2.0d0 * f)))) / t_3
else
tmp = (-0.25d0) * (sqrt(((c * f) * (-16.0d0))) * (1.0d0 / c))
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 = C - (-1.0 * C);
double t_1 = (Math.pow(B, 2.0) + Math.pow(C, 2.0)) - Math.pow((-1.0 * C), 2.0);
double t_2 = Math.sqrt((Math.pow(B, 2.0) + Math.pow((A - C), 2.0)));
double t_3 = Math.pow(B, 2.0) - ((4.0 * A) * C);
double t_4 = F * Math.pow(B, 2.0);
double tmp;
if (C <= -1.18e-201) {
tmp = -0.25 * ((1.0 / A) * Math.sqrt(((A * F) * -16.0)));
} else if (C <= 5.6e-290) {
tmp = -Math.sqrt(((2.0 * (F * (Math.pow(B, 2.0) - ((A * C) * 4.0)))) * ((A - t_2) + C))) / t_3;
} else if (C <= 4e-229) {
tmp = -((Math.sqrt(2.0) / B) * Math.sqrt((F * -B)));
} else if (C <= 5.8e-158) {
tmp = -Math.sqrt(((2.0 * (((-0.5 * (t_1 * t_4)) + (2.0 * (t_1 * (Math.pow(C, 2.0) * F)))) / A)) + ((-8.0 * (A * (t_0 * (C * F)))) + (2.0 * ((2.0 * (t_1 * (C * F))) + (t_0 * t_4)))))) / t_3;
} else if (C <= 4.5e-89) {
tmp = -Math.sqrt((t_3 * ((A + (C - t_2)) * (2.0 * F)))) / t_3;
} else {
tmp = -0.25 * (Math.sqrt(((C * F) * -16.0)) * (1.0 / C));
}
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 = C - (-1.0 * C) t_1 = (math.pow(B, 2.0) + math.pow(C, 2.0)) - math.pow((-1.0 * C), 2.0) t_2 = math.sqrt((math.pow(B, 2.0) + math.pow((A - C), 2.0))) t_3 = math.pow(B, 2.0) - ((4.0 * A) * C) t_4 = F * math.pow(B, 2.0) tmp = 0 if C <= -1.18e-201: tmp = -0.25 * ((1.0 / A) * math.sqrt(((A * F) * -16.0))) elif C <= 5.6e-290: tmp = -math.sqrt(((2.0 * (F * (math.pow(B, 2.0) - ((A * C) * 4.0)))) * ((A - t_2) + C))) / t_3 elif C <= 4e-229: tmp = -((math.sqrt(2.0) / B) * math.sqrt((F * -B))) elif C <= 5.8e-158: tmp = -math.sqrt(((2.0 * (((-0.5 * (t_1 * t_4)) + (2.0 * (t_1 * (math.pow(C, 2.0) * F)))) / A)) + ((-8.0 * (A * (t_0 * (C * F)))) + (2.0 * ((2.0 * (t_1 * (C * F))) + (t_0 * t_4)))))) / t_3 elif C <= 4.5e-89: tmp = -math.sqrt((t_3 * ((A + (C - t_2)) * (2.0 * F)))) / t_3 else: tmp = -0.25 * (math.sqrt(((C * F) * -16.0)) * (1.0 / C)) 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(C - Float64(-1.0 * C)) t_1 = Float64(Float64((B ^ 2.0) + (C ^ 2.0)) - (Float64(-1.0 * C) ^ 2.0)) t_2 = sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))) t_3 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) t_4 = Float64(F * (B ^ 2.0)) tmp = 0.0 if (C <= -1.18e-201) tmp = Float64(-0.25 * Float64(Float64(1.0 / A) * sqrt(Float64(Float64(A * F) * -16.0)))); elseif (C <= 5.6e-290) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * Float64((B ^ 2.0) - Float64(Float64(A * C) * 4.0)))) * Float64(Float64(A - t_2) + C)))) / t_3); elseif (C <= 4e-229) tmp = Float64(-Float64(Float64(sqrt(2.0) / B) * sqrt(Float64(F * Float64(-B))))); elseif (C <= 5.8e-158) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(Float64(Float64(-0.5 * Float64(t_1 * t_4)) + Float64(2.0 * Float64(t_1 * Float64((C ^ 2.0) * F)))) / A)) + Float64(Float64(-8.0 * Float64(A * Float64(t_0 * Float64(C * F)))) + Float64(2.0 * Float64(Float64(2.0 * Float64(t_1 * Float64(C * F))) + Float64(t_0 * t_4))))))) / t_3); elseif (C <= 4.5e-89) tmp = Float64(Float64(-sqrt(Float64(t_3 * Float64(Float64(A + Float64(C - t_2)) * Float64(2.0 * F))))) / t_3); else tmp = Float64(-0.25 * Float64(sqrt(Float64(Float64(C * F) * -16.0)) * Float64(1.0 / C))); 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 = C - (-1.0 * C); t_1 = ((B ^ 2.0) + (C ^ 2.0)) - ((-1.0 * C) ^ 2.0); t_2 = sqrt(((B ^ 2.0) + ((A - C) ^ 2.0))); t_3 = (B ^ 2.0) - ((4.0 * A) * C); t_4 = F * (B ^ 2.0); tmp = 0.0; if (C <= -1.18e-201) tmp = -0.25 * ((1.0 / A) * sqrt(((A * F) * -16.0))); elseif (C <= 5.6e-290) tmp = -sqrt(((2.0 * (F * ((B ^ 2.0) - ((A * C) * 4.0)))) * ((A - t_2) + C))) / t_3; elseif (C <= 4e-229) tmp = -((sqrt(2.0) / B) * sqrt((F * -B))); elseif (C <= 5.8e-158) tmp = -sqrt(((2.0 * (((-0.5 * (t_1 * t_4)) + (2.0 * (t_1 * ((C ^ 2.0) * F)))) / A)) + ((-8.0 * (A * (t_0 * (C * F)))) + (2.0 * ((2.0 * (t_1 * (C * F))) + (t_0 * t_4)))))) / t_3; elseif (C <= 4.5e-89) tmp = -sqrt((t_3 * ((A + (C - t_2)) * (2.0 * F)))) / t_3; else tmp = -0.25 * (sqrt(((C * F) * -16.0)) * (1.0 / C)); 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[(C - N[(-1.0 * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[C, 2.0], $MachinePrecision]), $MachinePrecision] - N[Power[N[(-1.0 * C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(F * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -1.18e-201], N[(-0.25 * N[(N[(1.0 / A), $MachinePrecision] * N[Sqrt[N[(N[(A * F), $MachinePrecision] * -16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 5.6e-290], N[((-N[Sqrt[N[(N[(2.0 * N[(F * N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(A - t$95$2), $MachinePrecision] + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$3), $MachinePrecision], If[LessEqual[C, 4e-229], (-N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[Sqrt[N[(F * (-B)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), If[LessEqual[C, 5.8e-158], N[((-N[Sqrt[N[(N[(2.0 * N[(N[(N[(-0.5 * N[(t$95$1 * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$1 * N[(N[Power[C, 2.0], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(N[(-8.0 * N[(A * N[(t$95$0 * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[(2.0 * N[(t$95$1 * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$3), $MachinePrecision], If[LessEqual[C, 4.5e-89], N[((-N[Sqrt[N[(t$95$3 * N[(N[(A + N[(C - t$95$2), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$3), $MachinePrecision], N[(-0.25 * N[(N[Sqrt[N[(N[(C * F), $MachinePrecision] * -16.0), $MachinePrecision]], $MachinePrecision] * N[(1.0 / C), $MachinePrecision]), $MachinePrecision]), $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 := C - -1 \cdot C\\
t_1 := \left({B}^{2} + {C}^{2}\right) - {\left(-1 \cdot C\right)}^{2}\\
t_2 := \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\\
t_3 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
t_4 := F \cdot {B}^{2}\\
\mathbf{if}\;C \leq -1.18 \cdot 10^{-201}:\\
\;\;\;\;-0.25 \cdot \left(\frac{1}{A} \cdot \sqrt{\left(A \cdot F\right) \cdot -16}\right)\\
\mathbf{elif}\;C \leq 5.6 \cdot 10^{-290}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot \left({B}^{2} - \left(A \cdot C\right) \cdot 4\right)\right)\right) \cdot \left(\left(A - t_2\right) + C\right)}}{t_3}\\
\mathbf{elif}\;C \leq 4 \cdot 10^{-229}:\\
\;\;\;\;-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(-B\right)}\\
\mathbf{elif}\;C \leq 5.8 \cdot 10^{-158}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \frac{-0.5 \cdot \left(t_1 \cdot t_4\right) + 2 \cdot \left(t_1 \cdot \left({C}^{2} \cdot F\right)\right)}{A} + \left(-8 \cdot \left(A \cdot \left(t_0 \cdot \left(C \cdot F\right)\right)\right) + 2 \cdot \left(2 \cdot \left(t_1 \cdot \left(C \cdot F\right)\right) + t_0 \cdot t_4\right)\right)}}{t_3}\\
\mathbf{elif}\;C \leq 4.5 \cdot 10^{-89}:\\
\;\;\;\;\frac{-\sqrt{t_3 \cdot \left(\left(A + \left(C - t_2\right)\right) \cdot \left(2 \cdot F\right)\right)}}{t_3}\\
\mathbf{else}:\\
\;\;\;\;-0.25 \cdot \left(\sqrt{\left(C \cdot F\right) \cdot -16} \cdot \frac{1}{C}\right)\\
\end{array}
Results
if C < -1.18e-201Initial program 49.7
Simplified49.7
[Start]49.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}
\] |
|---|
Applied egg-rr49.8
Simplified49.8
[Start]49.8 | \[ \frac{-\sqrt{\left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(2 \cdot \left(F \cdot \left(A + C\right)\right)\right) - \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(\sqrt{{B}^{2} + {\left(A - C\right)}^{2}} \cdot \left(F + F\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
|---|---|
rational_best_45_simplify-1 [=>]49.8 | \[ \frac{-\sqrt{\left({B}^{2} - \color{blue}{A \cdot \left(4 \cdot C\right)}\right) \cdot \left(2 \cdot \left(F \cdot \left(A + C\right)\right)\right) - \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(\sqrt{{B}^{2} + {\left(A - C\right)}^{2}} \cdot \left(F + F\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
rational_best_45_simplify-1 [=>]49.8 | \[ \frac{-\sqrt{\left({B}^{2} - A \cdot \left(4 \cdot C\right)\right) \cdot \left(2 \cdot \left(F \cdot \left(A + C\right)\right)\right) - \left({B}^{2} - \color{blue}{A \cdot \left(4 \cdot C\right)}\right) \cdot \left(\sqrt{{B}^{2} + {\left(A - C\right)}^{2}} \cdot \left(F + F\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
Taylor expanded in C around -inf 40.5
Simplified40.5
[Start]40.5 | \[ -0.25 \cdot \left(\frac{1}{A} \cdot \sqrt{-8 \cdot \left(A \cdot F\right) - 8 \cdot \left(A \cdot F\right)}\right)
\] |
|---|---|
rational_best_45_simplify-18 [=>]40.5 | \[ -0.25 \cdot \left(\frac{1}{A} \cdot \sqrt{-8 \cdot \left(A \cdot F\right) - \color{blue}{\left(A \cdot F\right) \cdot 8}}\right)
\] |
rational_best_45_simplify-12 [=>]40.5 | \[ -0.25 \cdot \left(\frac{1}{A} \cdot \sqrt{\color{blue}{\left(A \cdot F\right) \cdot \left(-8 - 8\right)}}\right)
\] |
metadata-eval [=>]40.5 | \[ -0.25 \cdot \left(\frac{1}{A} \cdot \sqrt{\left(A \cdot F\right) \cdot \color{blue}{-16}}\right)
\] |
if -1.18e-201 < C < 5.59999999999999993e-290Initial program 49.1
Simplified49.0
[Start]49.1 | \[ \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 F around 0 51.0
Simplified48.8
[Start]51.0 | \[ \frac{-\sqrt{2 \cdot \left(F \cdot \left(\left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
|---|---|
rational_best_45_simplify-1 [=>]49.0 | \[ \frac{-\sqrt{2 \cdot \color{blue}{\left(\left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
rational_best_45_simplify-20 [=>]49.0 | \[ \frac{-\sqrt{2 \cdot \left(\left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(\left(A + C\right) - \sqrt{\color{blue}{{B}^{2} + {\left(A - C\right)}^{2}}}\right)\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
rational_best_45_simplify-20 [=>]49.0 | \[ \frac{-\sqrt{2 \cdot \left(\left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(\color{blue}{\left(C + A\right)} - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
rational_best_45_simplify-109 [<=]49.0 | \[ \frac{-\sqrt{2 \cdot \left(\left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \color{blue}{\left(A + \left(C - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)}\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
rational_best_45_simplify-18 [<=]49.0 | \[ \frac{-\sqrt{2 \cdot \left(\left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot \color{blue}{\left(\left(A + \left(C - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right) \cdot F\right)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
rational_best_45_simplify-1 [=>]49.1 | \[ \frac{-\sqrt{2 \cdot \color{blue}{\left(\left(A + \left(C - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right) \cdot \left(\left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
rational_best_45_simplify-1 [<=]49.1 | \[ \frac{-\sqrt{\color{blue}{\left(A + \left(C - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right) \cdot \left(2 \cdot \left(\left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
rational_best_45_simplify-18 [=>]49.1 | \[ \frac{-\sqrt{\color{blue}{\left(2 \cdot \left(\left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(A + \left(C - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
rational_best_45_simplify-109 [=>]49.1 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \color{blue}{\left(\left(C + A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
if 5.59999999999999993e-290 < C < 4.00000000000000028e-229Initial program 48.0
Simplified48.0
[Start]48.0 | \[ \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 A around 0 57.1
Simplified57.1
[Start]57.1 | \[ -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}\right)
\] |
|---|---|
rational_best_45_simplify-18 [=>]57.1 | \[ \color{blue}{\left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}\right) \cdot -1}
\] |
rational_best_45_simplify-63 [=>]57.1 | \[ \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}}
\] |
rational_best_45_simplify-18 [=>]57.1 | \[ -\frac{\sqrt{2}}{B} \cdot \sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}
\] |
Taylor expanded in C around 0 53.6
Simplified53.6
[Start]53.6 | \[ -\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(-1 \cdot B\right)}
\] |
|---|---|
rational_best_45_simplify-18 [=>]53.6 | \[ -\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \color{blue}{\left(B \cdot -1\right)}}
\] |
rational_best_45_simplify-63 [=>]53.6 | \[ -\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \color{blue}{\left(-B\right)}}
\] |
if 4.00000000000000028e-229 < C < 5.79999999999999961e-158Initial program 47.7
Simplified47.8
[Start]47.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}
\] |
|---|
Taylor expanded in A around inf 56.1
if 5.79999999999999961e-158 < C < 4.4999999999999999e-89Initial program 46.7
Simplified46.8
[Start]46.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 4.4999999999999999e-89 < C Initial program 58.4
Simplified57.4
[Start]58.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.4
Simplified58.4
[Start]58.4 | \[ \frac{-\sqrt{\left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(2 \cdot \left(F \cdot \left(A + C\right)\right)\right) - \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(\sqrt{{B}^{2} + {\left(A - C\right)}^{2}} \cdot \left(F + F\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
|---|---|
rational_best_45_simplify-1 [=>]58.4 | \[ \frac{-\sqrt{\left({B}^{2} - \color{blue}{A \cdot \left(4 \cdot C\right)}\right) \cdot \left(2 \cdot \left(F \cdot \left(A + C\right)\right)\right) - \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(\sqrt{{B}^{2} + {\left(A - C\right)}^{2}} \cdot \left(F + F\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
rational_best_45_simplify-1 [=>]58.4 | \[ \frac{-\sqrt{\left({B}^{2} - A \cdot \left(4 \cdot C\right)\right) \cdot \left(2 \cdot \left(F \cdot \left(A + C\right)\right)\right) - \left({B}^{2} - \color{blue}{A \cdot \left(4 \cdot C\right)}\right) \cdot \left(\sqrt{{B}^{2} + {\left(A - C\right)}^{2}} \cdot \left(F + F\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
Taylor expanded in A around -inf 42.1
Simplified42.1
[Start]42.1 | \[ -0.25 \cdot \left(\sqrt{-8 \cdot \left(C \cdot F\right) - 8 \cdot \left(C \cdot F\right)} \cdot \frac{1}{C}\right)
\] |
|---|---|
rational_best_45_simplify-18 [=>]42.1 | \[ -0.25 \cdot \left(\sqrt{-8 \cdot \left(C \cdot F\right) - \color{blue}{\left(C \cdot F\right) \cdot 8}} \cdot \frac{1}{C}\right)
\] |
rational_best_45_simplify-12 [=>]42.1 | \[ -0.25 \cdot \left(\sqrt{\color{blue}{\left(C \cdot F\right) \cdot \left(-8 - 8\right)}} \cdot \frac{1}{C}\right)
\] |
metadata-eval [=>]42.1 | \[ -0.25 \cdot \left(\sqrt{\left(C \cdot F\right) \cdot \color{blue}{-16}} \cdot \frac{1}{C}\right)
\] |
Final simplification43.8
| Alternative 1 | |
|---|---|
| Error | 43.0 |
| Cost | 135308 |
| Alternative 2 | |
|---|---|
| Error | 45.5 |
| Cost | 40840 |
| Alternative 3 | |
|---|---|
| Error | 45.6 |
| Cost | 40840 |
| Alternative 4 | |
|---|---|
| Error | 44.1 |
| Cost | 40200 |
| Alternative 5 | |
|---|---|
| Error | 46.3 |
| Cost | 21320 |
| Alternative 6 | |
|---|---|
| Error | 46.3 |
| Cost | 21256 |
| Alternative 7 | |
|---|---|
| Error | 46.4 |
| Cost | 20936 |
| Alternative 8 | |
|---|---|
| Error | 46.4 |
| Cost | 20744 |
| Alternative 9 | |
|---|---|
| Error | 46.4 |
| Cost | 20744 |
| Alternative 10 | |
|---|---|
| Error | 46.4 |
| Cost | 20488 |
| Alternative 11 | |
|---|---|
| Error | 44.2 |
| Cost | 13640 |
| Alternative 12 | |
|---|---|
| Error | 44.4 |
| Cost | 7236 |
| Alternative 13 | |
|---|---|
| Error | 51.7 |
| Cost | 7104 |
| Alternative 14 | |
|---|---|
| Error | 62.0 |
| Cost | 6976 |
herbie shell --seed 2023102
(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))))