| Alternative 1 | |
|---|---|
| Error | 42.1 |
| Cost | 217108 |
(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) (* 4.0 (* A C))))
(t_1 (pow (- A C) 2.0))
(t_2 (sqrt (+ (pow B 2.0) t_1)))
(t_3 (- (pow B 2.0) (* (* 4.0 A) C)))
(t_4
(/
(-
(sqrt (* (* 2.0 (* t_3 F)) (+ (+ A C) (sqrt (+ t_1 (pow B 2.0)))))))
t_3))
(t_5 (- (pow B 2.0) (* C (* A 4.0)))))
(if (<= t_4 (- INFINITY))
(- (sqrt (- (/ F C))))
(if (<= t_4 -5e-205)
(/ (- (sqrt (* (+ C (+ A t_2)) (* t_5 (* 2.0 F))))) t_5)
(if (<= t_4 0.0)
(- (sqrt (- (/ F A))))
(if (<= t_4 2e+176)
(/ (- (sqrt (* (* 2.0 (* t_0 F)) (+ A (+ C t_2))))) t_0)
(if (<= t_4 INFINITY)
(/ (- (* C (sqrt (* -16.0 (* A F))))) t_3)
(- (* (/ (sqrt 2.0) B) (sqrt (* F B)))))))))))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) - (4.0 * (A * C));
double t_1 = pow((A - C), 2.0);
double t_2 = sqrt((pow(B, 2.0) + t_1));
double t_3 = pow(B, 2.0) - ((4.0 * A) * C);
double t_4 = -sqrt(((2.0 * (t_3 * F)) * ((A + C) + sqrt((t_1 + pow(B, 2.0)))))) / t_3;
double t_5 = pow(B, 2.0) - (C * (A * 4.0));
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = -sqrt(-(F / C));
} else if (t_4 <= -5e-205) {
tmp = -sqrt(((C + (A + t_2)) * (t_5 * (2.0 * F)))) / t_5;
} else if (t_4 <= 0.0) {
tmp = -sqrt(-(F / A));
} else if (t_4 <= 2e+176) {
tmp = -sqrt(((2.0 * (t_0 * F)) * (A + (C + t_2)))) / t_0;
} else if (t_4 <= ((double) INFINITY)) {
tmp = -(C * sqrt((-16.0 * (A * F)))) / t_3;
} else {
tmp = -((sqrt(2.0) / B) * sqrt((F * B)));
}
return tmp;
}
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) - (4.0 * (A * C));
double t_1 = Math.pow((A - C), 2.0);
double t_2 = Math.sqrt((Math.pow(B, 2.0) + t_1));
double t_3 = Math.pow(B, 2.0) - ((4.0 * A) * C);
double t_4 = -Math.sqrt(((2.0 * (t_3 * F)) * ((A + C) + Math.sqrt((t_1 + Math.pow(B, 2.0)))))) / t_3;
double t_5 = Math.pow(B, 2.0) - (C * (A * 4.0));
double tmp;
if (t_4 <= -Double.POSITIVE_INFINITY) {
tmp = -Math.sqrt(-(F / C));
} else if (t_4 <= -5e-205) {
tmp = -Math.sqrt(((C + (A + t_2)) * (t_5 * (2.0 * F)))) / t_5;
} else if (t_4 <= 0.0) {
tmp = -Math.sqrt(-(F / A));
} else if (t_4 <= 2e+176) {
tmp = -Math.sqrt(((2.0 * (t_0 * F)) * (A + (C + t_2)))) / t_0;
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = -(C * Math.sqrt((-16.0 * (A * F)))) / t_3;
} else {
tmp = -((Math.sqrt(2.0) / B) * Math.sqrt((F * B)));
}
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) - (4.0 * (A * C)) t_1 = math.pow((A - C), 2.0) t_2 = math.sqrt((math.pow(B, 2.0) + t_1)) t_3 = math.pow(B, 2.0) - ((4.0 * A) * C) t_4 = -math.sqrt(((2.0 * (t_3 * F)) * ((A + C) + math.sqrt((t_1 + math.pow(B, 2.0)))))) / t_3 t_5 = math.pow(B, 2.0) - (C * (A * 4.0)) tmp = 0 if t_4 <= -math.inf: tmp = -math.sqrt(-(F / C)) elif t_4 <= -5e-205: tmp = -math.sqrt(((C + (A + t_2)) * (t_5 * (2.0 * F)))) / t_5 elif t_4 <= 0.0: tmp = -math.sqrt(-(F / A)) elif t_4 <= 2e+176: tmp = -math.sqrt(((2.0 * (t_0 * F)) * (A + (C + t_2)))) / t_0 elif t_4 <= math.inf: tmp = -(C * math.sqrt((-16.0 * (A * F)))) / t_3 else: tmp = -((math.sqrt(2.0) / B) * math.sqrt((F * B))) 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) - Float64(4.0 * Float64(A * C))) t_1 = Float64(A - C) ^ 2.0 t_2 = sqrt(Float64((B ^ 2.0) + t_1)) t_3 = Float64((B ^ 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(t_1 + (B ^ 2.0))))))) / t_3) t_5 = Float64((B ^ 2.0) - Float64(C * Float64(A * 4.0))) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = Float64(-sqrt(Float64(-Float64(F / C)))); elseif (t_4 <= -5e-205) tmp = Float64(Float64(-sqrt(Float64(Float64(C + Float64(A + t_2)) * Float64(t_5 * Float64(2.0 * F))))) / t_5); elseif (t_4 <= 0.0) tmp = Float64(-sqrt(Float64(-Float64(F / A)))); elseif (t_4 <= 2e+176) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(A + Float64(C + t_2))))) / t_0); elseif (t_4 <= Inf) tmp = Float64(Float64(-Float64(C * sqrt(Float64(-16.0 * Float64(A * F))))) / t_3); else tmp = Float64(-Float64(Float64(sqrt(2.0) / B) * sqrt(Float64(F * B)))); 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) - (4.0 * (A * C)); t_1 = (A - C) ^ 2.0; t_2 = sqrt(((B ^ 2.0) + t_1)); t_3 = (B ^ 2.0) - ((4.0 * A) * C); t_4 = -sqrt(((2.0 * (t_3 * F)) * ((A + C) + sqrt((t_1 + (B ^ 2.0)))))) / t_3; t_5 = (B ^ 2.0) - (C * (A * 4.0)); tmp = 0.0; if (t_4 <= -Inf) tmp = -sqrt(-(F / C)); elseif (t_4 <= -5e-205) tmp = -sqrt(((C + (A + t_2)) * (t_5 * (2.0 * F)))) / t_5; elseif (t_4 <= 0.0) tmp = -sqrt(-(F / A)); elseif (t_4 <= 2e+176) tmp = -sqrt(((2.0 * (t_0 * F)) * (A + (C + t_2)))) / t_0; elseif (t_4 <= Inf) tmp = -(C * sqrt((-16.0 * (A * F)))) / t_3; else tmp = -((sqrt(2.0) / B) * sqrt((F * B))); 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[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + t$95$1), $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[((-N[Sqrt[N[(N[(2.0 * N[(t$95$3 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(t$95$1 + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], (-N[Sqrt[(-N[(F / C), $MachinePrecision])], $MachinePrecision]), If[LessEqual[t$95$4, -5e-205], N[((-N[Sqrt[N[(N[(C + N[(A + t$95$2), $MachinePrecision]), $MachinePrecision] * N[(t$95$5 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$5), $MachinePrecision], If[LessEqual[t$95$4, 0.0], (-N[Sqrt[(-N[(F / A), $MachinePrecision])], $MachinePrecision]), If[LessEqual[t$95$4, 2e+176], N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + N[(C + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[((-N[(C * N[Sqrt[N[(-16.0 * N[(A * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]) / t$95$3), $MachinePrecision], (-N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[Sqrt[N[(F * B), $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 := {B}^{2} - 4 \cdot \left(A \cdot C\right)\\
t_1 := {\left(A - C\right)}^{2}\\
t_2 := \sqrt{{B}^{2} + t_1}\\
t_3 := {B}^{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{t_1 + {B}^{2}}\right)}}{t_3}\\
t_5 := {B}^{2} - C \cdot \left(A \cdot 4\right)\\
\mathbf{if}\;t_4 \leq -\infty:\\
\;\;\;\;-\sqrt{-\frac{F}{C}}\\
\mathbf{elif}\;t_4 \leq -5 \cdot 10^{-205}:\\
\;\;\;\;\frac{-\sqrt{\left(C + \left(A + t_2\right)\right) \cdot \left(t_5 \cdot \left(2 \cdot F\right)\right)}}{t_5}\\
\mathbf{elif}\;t_4 \leq 0:\\
\;\;\;\;-\sqrt{-\frac{F}{A}}\\
\mathbf{elif}\;t_4 \leq 2 \cdot 10^{+176}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(A + \left(C + t_2\right)\right)}}{t_0}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\frac{-C \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}}{t_3}\\
\mathbf{else}:\\
\;\;\;\;-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot B}\\
\end{array}
Results
if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -inf.0Initial program 64.0
Simplified64.0
[Start]64.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 B around 0 64.0
Simplified48.1
[Start]64.0 | \[ -1 \cdot \left(\left(\sqrt{2} \cdot \sqrt{-0.5}\right) \cdot \sqrt{\frac{F}{C}}\right)
\] |
|---|---|
rational_best-simplify-2 [=>]64.0 | \[ \color{blue}{\left(\left(\sqrt{2} \cdot \sqrt{-0.5}\right) \cdot \sqrt{\frac{F}{C}}\right) \cdot -1}
\] |
rational_best-simplify-12 [=>]64.0 | \[ \color{blue}{-\left(\sqrt{2} \cdot \sqrt{-0.5}\right) \cdot \sqrt{\frac{F}{C}}}
\] |
exponential-simplify-19 [=>]64.0 | \[ -\color{blue}{\sqrt{-0.5 \cdot 2}} \cdot \sqrt{\frac{F}{C}}
\] |
metadata-eval [=>]64.0 | \[ -\sqrt{\color{blue}{-1}} \cdot \sqrt{\frac{F}{C}}
\] |
exponential-simplify-19 [=>]48.1 | \[ -\color{blue}{\sqrt{\frac{F}{C} \cdot -1}}
\] |
rational_best-simplify-12 [=>]48.1 | \[ -\sqrt{\color{blue}{-\frac{F}{C}}}
\] |
if -inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -5.00000000000000001e-205Initial program 1.4
Simplified1.4
[Start]1.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-rr1.4
Simplified1.4
[Start]1.4 | \[ \frac{-\sqrt{2 \cdot \left(\left(\left({B}^{2} - A \cdot \left(C \cdot 4\right)\right) \cdot F\right) \cdot \left(A + \left(C + \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)}}{{B}^{2} - A \cdot \left(C \cdot 4\right)} + 0
\] |
|---|---|
rational_best-simplify-4 [=>]1.4 | \[ \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left({B}^{2} - A \cdot \left(C \cdot 4\right)\right) \cdot F\right) \cdot \left(A + \left(C + \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)}}{{B}^{2} - A \cdot \left(C \cdot 4\right)}}
\] |
if -5.00000000000000001e-205 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -0.0Initial program 60.9
Simplified58.7
[Start]60.9 | \[ \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 C around inf 64.0
Simplified47.8
[Start]64.0 | \[ -1 \cdot \left(\left(\sqrt{2} \cdot \sqrt{-0.5}\right) \cdot \sqrt{\frac{F}{A}}\right)
\] |
|---|---|
rational_best-simplify-2 [=>]64.0 | \[ \color{blue}{\left(\left(\sqrt{2} \cdot \sqrt{-0.5}\right) \cdot \sqrt{\frac{F}{A}}\right) \cdot -1}
\] |
rational_best-simplify-12 [=>]64.0 | \[ \color{blue}{-\left(\sqrt{2} \cdot \sqrt{-0.5}\right) \cdot \sqrt{\frac{F}{A}}}
\] |
exponential-simplify-19 [=>]64.0 | \[ -\color{blue}{\sqrt{-0.5 \cdot 2}} \cdot \sqrt{\frac{F}{A}}
\] |
metadata-eval [=>]64.0 | \[ -\sqrt{\color{blue}{-1}} \cdot \sqrt{\frac{F}{A}}
\] |
exponential-simplify-19 [=>]47.8 | \[ -\color{blue}{\sqrt{\frac{F}{A} \cdot -1}}
\] |
rational_best-simplify-12 [=>]47.8 | \[ -\sqrt{\color{blue}{-\frac{F}{A}}}
\] |
if -0.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < 2e176Initial program 1.6
Simplified1.6
[Start]1.6 | \[ \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 2e176 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < +inf.0Initial program 60.0
Taylor expanded in C around inf 64.0
Simplified39.0
[Start]64.0 | \[ \frac{-\sqrt{A \cdot F} \cdot \left(\sqrt{2} \cdot \left(C \cdot \sqrt{-8}\right)\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
|---|---|
rational_best-simplify-44 [=>]64.0 | \[ \frac{-\sqrt{A \cdot F} \cdot \color{blue}{\left(C \cdot \left(\sqrt{2} \cdot \sqrt{-8}\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
rational_best-simplify-44 [=>]64.0 | \[ \frac{-\color{blue}{C \cdot \left(\sqrt{A \cdot F} \cdot \left(\sqrt{2} \cdot \sqrt{-8}\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
exponential-simplify-19 [=>]64.0 | \[ \frac{-C \cdot \left(\sqrt{A \cdot F} \cdot \color{blue}{\sqrt{-8 \cdot 2}}\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
exponential-simplify-19 [=>]39.0 | \[ \frac{-C \cdot \color{blue}{\sqrt{\left(-8 \cdot 2\right) \cdot \left(A \cdot F\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
metadata-eval [=>]39.0 | \[ \frac{-C \cdot \sqrt{\color{blue}{-16} \cdot \left(A \cdot F\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) Initial program 64.0
Simplified64.0
[Start]64.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 63.6
Simplified63.6
[Start]63.6 | \[ -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}\right)
\] |
|---|---|
rational_best-simplify-2 [=>]63.6 | \[ \color{blue}{\left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}\right) \cdot -1}
\] |
rational_best-simplify-12 [=>]63.6 | \[ \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}}
\] |
rational_best-simplify-2 [=>]63.6 | \[ -\frac{\sqrt{2}}{B} \cdot \sqrt{\color{blue}{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}}
\] |
Taylor expanded in C around 0 54.5
Final simplification42.1
| Alternative 1 | |
|---|---|
| Error | 42.1 |
| Cost | 217108 |
| Alternative 2 | |
|---|---|
| Error | 45.6 |
| Cost | 41104 |
| Alternative 3 | |
|---|---|
| Error | 46.3 |
| Cost | 14680 |
| Alternative 4 | |
|---|---|
| Error | 47.4 |
| Cost | 14032 |
| Alternative 5 | |
|---|---|
| Error | 47.4 |
| Cost | 13840 |
| Alternative 6 | |
|---|---|
| Error | 47.4 |
| Cost | 6852 |
| Alternative 7 | |
|---|---|
| Error | 54.8 |
| Cost | 6720 |
herbie shell --seed 2023092
(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))))