| Alternative 1 | |
|---|---|
| Accuracy | 37.9% |
| Cost | 28112 |
(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 (* A -4.0)))
(t_1 (fma -4.0 (* A C) (* B B)))
(t_2 (fma B B t_0))
(t_3 (hypot B (- A C)))
(t_4 (+ (pow B 2.0) t_0))
(t_5
(/
(-
(sqrt
(*
(* 2.0 (* t_4 F))
(+ (+ A C) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))))))
t_4)))
(if (<= t_5 -1e-204)
(/ (* (* (sqrt t_1) (sqrt F)) (- (sqrt (* 2.0 (+ (+ A C) t_3))))) t_1)
(if (<= t_5 0.0)
(/
(- (sqrt (* 2.0 (* t_2 (* F (+ A (+ A (/ (* (* B B) -0.5) C))))))))
t_2)
(if (<= t_5 INFINITY)
(/
(* (sqrt (+ A (+ C t_3))) (- (sqrt (* 2.0 (* -4.0 (* F (* A C)))))))
(- (* B B) (* 4.0 (* A C))))
(* (sqrt (/ F B)) (- (sqrt 2.0))))))))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 * (A * -4.0);
double t_1 = fma(-4.0, (A * C), (B * B));
double t_2 = fma(B, B, t_0);
double t_3 = hypot(B, (A - C));
double t_4 = pow(B, 2.0) + t_0;
double t_5 = -sqrt(((2.0 * (t_4 * F)) * ((A + C) + sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_4;
double tmp;
if (t_5 <= -1e-204) {
tmp = ((sqrt(t_1) * sqrt(F)) * -sqrt((2.0 * ((A + C) + t_3)))) / t_1;
} else if (t_5 <= 0.0) {
tmp = -sqrt((2.0 * (t_2 * (F * (A + (A + (((B * B) * -0.5) / C))))))) / t_2;
} else if (t_5 <= ((double) INFINITY)) {
tmp = (sqrt((A + (C + t_3))) * -sqrt((2.0 * (-4.0 * (F * (A * C)))))) / ((B * B) - (4.0 * (A * C)));
} else {
tmp = sqrt((F / B)) * -sqrt(2.0);
}
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(A * -4.0)) t_1 = fma(-4.0, Float64(A * C), Float64(B * B)) t_2 = fma(B, B, t_0) t_3 = hypot(B, Float64(A - C)) t_4 = Float64((B ^ 2.0) + t_0) t_5 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_4 * F)) * Float64(Float64(A + C) + sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_4) tmp = 0.0 if (t_5 <= -1e-204) tmp = Float64(Float64(Float64(sqrt(t_1) * sqrt(F)) * Float64(-sqrt(Float64(2.0 * Float64(Float64(A + C) + t_3))))) / t_1); elseif (t_5 <= 0.0) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_2 * Float64(F * Float64(A + Float64(A + Float64(Float64(Float64(B * B) * -0.5) / C)))))))) / t_2); elseif (t_5 <= Inf) tmp = Float64(Float64(sqrt(Float64(A + Float64(C + t_3))) * Float64(-sqrt(Float64(2.0 * Float64(-4.0 * Float64(F * Float64(A * C))))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))); else tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0))); end return 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[(A * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-4.0 * N[(A * C), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(B * B + t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$4 = N[(N[Power[B, 2.0], $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$4 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$4), $MachinePrecision]}, If[LessEqual[t$95$5, -1e-204], N[(N[(N[(N[Sqrt[t$95$1], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(N[(A + C), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$5, 0.0], N[((-N[Sqrt[N[(2.0 * N[(t$95$2 * N[(F * N[(A + N[(A + N[(N[(N[(B * B), $MachinePrecision] * -0.5), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[(N[(N[Sqrt[N[(A + N[(C + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(-4.0 * N[(F * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $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 \cdot \left(A \cdot -4\right)\\
t_1 := \mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)\\
t_2 := \mathsf{fma}\left(B, B, t_0\right)\\
t_3 := \mathsf{hypot}\left(B, A - C\right)\\
t_4 := {B}^{2} + t_0\\
t_5 := \frac{-\sqrt{\left(2 \cdot \left(t_4 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_4}\\
\mathbf{if}\;t_5 \leq -1 \cdot 10^{-204}:\\
\;\;\;\;\frac{\left(\sqrt{t_1} \cdot \sqrt{F}\right) \cdot \left(-\sqrt{2 \cdot \left(\left(A + C\right) + t_3\right)}\right)}{t_1}\\
\mathbf{elif}\;t_5 \leq 0:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_2 \cdot \left(F \cdot \left(A + \left(A + \frac{\left(B \cdot B\right) \cdot -0.5}{C}\right)\right)\right)\right)}}{t_2}\\
\mathbf{elif}\;t_5 \leq \infty:\\
\;\;\;\;\frac{\sqrt{A + \left(C + t_3\right)} \cdot \left(-\sqrt{2 \cdot \left(-4 \cdot \left(F \cdot \left(A \cdot C\right)\right)\right)}\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\
\end{array}
if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -1e-204Initial program 40.8%
Simplified49.8%
[Start]40.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-rr62.3%
[Start]49.8 | \[ \frac{-\sqrt{\left(\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
|---|---|
sqrt-prod [=>]63.0 | \[ \frac{-\color{blue}{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right) \cdot F} \cdot \sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
associate-+r+ [=>]62.3 | \[ \frac{-\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right) \cdot F} \cdot \sqrt{2 \cdot \color{blue}{\left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)\right)}}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
+-commutative [=>]62.3 | \[ \frac{-\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right) \cdot F} \cdot \sqrt{2 \cdot \color{blue}{\left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
Applied egg-rr73.2%
[Start]62.3 | \[ \frac{-\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right) \cdot F} \cdot \sqrt{2 \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
|---|---|
sqrt-prod [=>]73.2 | \[ \frac{-\color{blue}{\left(\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)} \cdot \sqrt{F}\right)} \cdot \sqrt{2 \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
if -1e-204 < (/.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 5.1%
Simplified10.2%
[Start]5.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 C around -inf 28.4%
Simplified28.4%
[Start]28.4 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot \left(F \cdot \left(A + \left(A + -0.5 \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
|---|---|
associate-*r/ [=>]28.4 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot \left(F \cdot \left(A + \left(A + \color{blue}{\frac{-0.5 \cdot {B}^{2}}{C}}\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
unpow2 [=>]28.4 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot \left(F \cdot \left(A + \left(A + \frac{-0.5 \cdot \color{blue}{\left(B \cdot B\right)}}{C}\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
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))) < +inf.0Initial program 37.6%
Simplified37.6%
[Start]37.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}
\] |
|---|
Applied egg-rr81.6%
[Start]37.6 | \[ \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
|---|---|
associate-*r* [=>]37.6 | \[ \frac{-\sqrt{\color{blue}{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
sqrt-prod [=>]41.5 | \[ \frac{-\color{blue}{\sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)} \cdot \sqrt{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
fma-neg [=>]41.5 | \[ \frac{-\sqrt{2 \cdot \left(\color{blue}{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)} \cdot F\right)} \cdot \sqrt{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
distribute-lft-neg-in [=>]41.5 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \color{blue}{\left(-4\right) \cdot \left(A \cdot C\right)}\right) \cdot F\right)} \cdot \sqrt{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
*-commutative [=>]41.5 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot C\right) \cdot \left(-4\right)}\right) \cdot F\right)} \cdot \sqrt{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
metadata-eval [=>]41.5 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot \color{blue}{-4}\right) \cdot F\right)} \cdot \sqrt{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
associate-+l+ [=>]41.5 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right) \cdot F\right)} \cdot \sqrt{\color{blue}{A + \left(C + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
unpow2 [=>]41.5 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right) \cdot F\right)} \cdot \sqrt{A + \left(C + \sqrt{B \cdot B + \color{blue}{\left(A - C\right) \cdot \left(A - C\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
hypot-def [=>]81.6 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right) \cdot F\right)} \cdot \sqrt{A + \left(C + \color{blue}{\mathsf{hypot}\left(B, A - C\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
Simplified81.6%
[Start]81.6 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right) \cdot F\right)} \cdot \sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
|---|---|
*-commutative [=>]81.6 | \[ \frac{-\color{blue}{\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right) \cdot F\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
*-commutative [=>]81.6 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \color{blue}{\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
Taylor expanded in B around 0 68.9%
Simplified80.9%
[Start]68.9 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
|---|---|
associate-*r* [=>]80.9 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(-4 \cdot \color{blue}{\left(\left(A \cdot C\right) \cdot F\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
*-commutative [=>]80.9 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(-4 \cdot \left(\color{blue}{\left(C \cdot A\right)} \cdot F\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) Initial program 0.0%
Simplified1.1%
[Start]0.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 inf 1.2%
Simplified1.2%
[Start]1.2 | \[ \frac{-\sqrt{2 \cdot \left(F \cdot {B}^{3}\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
|---|---|
associate-*r* [=>]1.2 | \[ \frac{-\sqrt{\color{blue}{\left(2 \cdot F\right) \cdot {B}^{3}}}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
Taylor expanded in A around 0 15.9%
Simplified15.9%
[Start]15.9 | \[ -1 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{B}}\right)
\] |
|---|---|
mul-1-neg [=>]15.9 | \[ \color{blue}{-\sqrt{2} \cdot \sqrt{\frac{F}{B}}}
\] |
*-commutative [=>]15.9 | \[ -\color{blue}{\sqrt{\frac{F}{B}} \cdot \sqrt{2}}
\] |
distribute-rgt-neg-in [=>]15.9 | \[ \color{blue}{\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)}
\] |
Final simplification43.4%
| Alternative 1 | |
|---|---|
| Accuracy | 37.9% |
| Cost | 28112 |
| Alternative 2 | |
|---|---|
| Accuracy | 33.7% |
| Cost | 27860 |
| Alternative 3 | |
|---|---|
| Accuracy | 34.8% |
| Cost | 27860 |
| Alternative 4 | |
|---|---|
| Accuracy | 34.4% |
| Cost | 27860 |
| Alternative 5 | |
|---|---|
| Accuracy | 32.2% |
| Cost | 27732 |
| Alternative 6 | |
|---|---|
| Accuracy | 33.8% |
| Cost | 27732 |
| Alternative 7 | |
|---|---|
| Accuracy | 31.3% |
| Cost | 21908 |
| Alternative 8 | |
|---|---|
| Accuracy | 31.1% |
| Cost | 21720 |
| Alternative 9 | |
|---|---|
| Accuracy | 30.3% |
| Cost | 21132 |
| Alternative 10 | |
|---|---|
| Accuracy | 29.9% |
| Cost | 21000 |
| Alternative 11 | |
|---|---|
| Accuracy | 30.0% |
| Cost | 15308 |
| Alternative 12 | |
|---|---|
| Accuracy | 24.6% |
| Cost | 14484 |
| Alternative 13 | |
|---|---|
| Accuracy | 24.4% |
| Cost | 14352 |
| Alternative 14 | |
|---|---|
| Accuracy | 24.4% |
| Cost | 14352 |
| Alternative 15 | |
|---|---|
| Accuracy | 23.4% |
| Cost | 13712 |
| Alternative 16 | |
|---|---|
| Accuracy | 18.1% |
| Cost | 13584 |
| Alternative 17 | |
|---|---|
| Accuracy | 17.7% |
| Cost | 8844 |
| Alternative 18 | |
|---|---|
| Accuracy | 15.7% |
| Cost | 8717 |
| Alternative 19 | |
|---|---|
| Accuracy | 17.8% |
| Cost | 8716 |
| Alternative 20 | |
|---|---|
| Accuracy | 17.4% |
| Cost | 8716 |
| Alternative 21 | |
|---|---|
| Accuracy | 17.6% |
| Cost | 8716 |
| Alternative 22 | |
|---|---|
| Accuracy | 12.9% |
| Cost | 7752 |
| Alternative 23 | |
|---|---|
| Accuracy | 13.2% |
| Cost | 7688 |
| Alternative 24 | |
|---|---|
| Accuracy | 11.3% |
| Cost | 6980 |
| Alternative 25 | |
|---|---|
| Accuracy | 11.1% |
| Cost | 6656 |
| Alternative 26 | |
|---|---|
| Accuracy | 1.2% |
| Cost | 6592 |
herbie shell --seed 2023137
(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))))