| Alternative 1 | |
|---|---|
| Accuracy | 42.9% |
| Cost | 40916 |

(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 (- (* B B) (* 4.0 (* C A))))
(t_1 (* 2.0 (* F t_0)))
(t_2 (hypot B (- A C)))
(t_3 (sqrt (+ A (+ C t_2))))
(t_4 (fma B B (* C (* A -4.0))))
(t_5 (sqrt t_4)))
(if (<= B -4e+28)
(* (/ B (/ t_5 (sqrt (* F 2.0)))) (/ t_3 t_5))
(if (<= B -1.06e-8)
(/ (- (sqrt (* t_1 (fma 2.0 C (* -0.5 (/ (* B B) A)))))) t_0)
(if (<= B -5.8e-112)
(/ (* (sqrt (* 2.0 (* F (fma B B (* -4.0 (* C A)))))) (- t_3)) t_0)
(if (<= B 6e-118)
(/ (- (sqrt (* t_1 (* C 2.0)))) t_0)
(if (<= B 1.25e+143)
(/
(*
(sqrt (+ t_2 (+ C A)))
(* (sqrt (* 2.0 (fma B B (* A (* C -4.0))))) (- (sqrt F))))
t_4)
(* (sqrt (* F (+ C (hypot B C)))) (/ (- (sqrt 2.0)) 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 = (B * B) - (4.0 * (C * A));
double t_1 = 2.0 * (F * t_0);
double t_2 = hypot(B, (A - C));
double t_3 = sqrt((A + (C + t_2)));
double t_4 = fma(B, B, (C * (A * -4.0)));
double t_5 = sqrt(t_4);
double tmp;
if (B <= -4e+28) {
tmp = (B / (t_5 / sqrt((F * 2.0)))) * (t_3 / t_5);
} else if (B <= -1.06e-8) {
tmp = -sqrt((t_1 * fma(2.0, C, (-0.5 * ((B * B) / A))))) / t_0;
} else if (B <= -5.8e-112) {
tmp = (sqrt((2.0 * (F * fma(B, B, (-4.0 * (C * A)))))) * -t_3) / t_0;
} else if (B <= 6e-118) {
tmp = -sqrt((t_1 * (C * 2.0))) / t_0;
} else if (B <= 1.25e+143) {
tmp = (sqrt((t_2 + (C + A))) * (sqrt((2.0 * fma(B, B, (A * (C * -4.0))))) * -sqrt(F))) / t_4;
} else {
tmp = sqrt((F * (C + hypot(B, C)))) * (-sqrt(2.0) / 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(Float64(B * B) - Float64(4.0 * Float64(C * A))) t_1 = Float64(2.0 * Float64(F * t_0)) t_2 = hypot(B, Float64(A - C)) t_3 = sqrt(Float64(A + Float64(C + t_2))) t_4 = fma(B, B, Float64(C * Float64(A * -4.0))) t_5 = sqrt(t_4) tmp = 0.0 if (B <= -4e+28) tmp = Float64(Float64(B / Float64(t_5 / sqrt(Float64(F * 2.0)))) * Float64(t_3 / t_5)); elseif (B <= -1.06e-8) tmp = Float64(Float64(-sqrt(Float64(t_1 * fma(2.0, C, Float64(-0.5 * Float64(Float64(B * B) / A)))))) / t_0); elseif (B <= -5.8e-112) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * fma(B, B, Float64(-4.0 * Float64(C * A)))))) * Float64(-t_3)) / t_0); elseif (B <= 6e-118) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(C * 2.0)))) / t_0); elseif (B <= 1.25e+143) tmp = Float64(Float64(sqrt(Float64(t_2 + Float64(C + A))) * Float64(sqrt(Float64(2.0 * fma(B, B, Float64(A * Float64(C * -4.0))))) * Float64(-sqrt(F)))) / t_4); else tmp = Float64(sqrt(Float64(F * Float64(C + hypot(B, C)))) * Float64(Float64(-sqrt(2.0)) / B)); 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[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(A + N[(C + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[t$95$4], $MachinePrecision]}, If[LessEqual[B, -4e+28], N[(N[(B / N[(t$95$5 / N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 / t$95$5), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.06e-8], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, -5.8e-112], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(B * B + N[(-4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-t$95$3)), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B, 6e-118], N[((-N[Sqrt[N[(t$95$1 * N[(C * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 1.25e+143], N[(N[(N[Sqrt[N[(t$95$2 + N[(C + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(2.0 * N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision], N[(N[Sqrt[N[(F * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $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 \cdot B - 4 \cdot \left(C \cdot A\right)\\
t_1 := 2 \cdot \left(F \cdot t_0\right)\\
t_2 := \mathsf{hypot}\left(B, A - C\right)\\
t_3 := \sqrt{A + \left(C + t_2\right)}\\
t_4 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
t_5 := \sqrt{t_4}\\
\mathbf{if}\;B \leq -4 \cdot 10^{+28}:\\
\;\;\;\;\frac{B}{\frac{t_5}{\sqrt{F \cdot 2}}} \cdot \frac{t_3}{t_5}\\
\mathbf{elif}\;B \leq -1.06 \cdot 10^{-8}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \mathsf{fma}\left(2, C, -0.5 \cdot \frac{B \cdot B}{A}\right)}}{t_0}\\
\mathbf{elif}\;B \leq -5.8 \cdot 10^{-112}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, -4 \cdot \left(C \cdot A\right)\right)\right)} \cdot \left(-t_3\right)}{t_0}\\
\mathbf{elif}\;B \leq 6 \cdot 10^{-118}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(C \cdot 2\right)}}{t_0}\\
\mathbf{elif}\;B \leq 1.25 \cdot 10^{+143}:\\
\;\;\;\;\frac{\sqrt{t_2 + \left(C + A\right)} \cdot \left(\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \left(-\sqrt{F}\right)\right)}{t_4}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
if B < -3.99999999999999983e28Initial program 8.0%
Simplified8.0%
[Start]8.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}
\] |
|---|---|
associate-*l* [=>]8.0 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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}
\] |
unpow2 [=>]8.0 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left(\color{blue}{B \cdot B} - 4 \cdot \left(A \cdot C\right)\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}
\] |
+-commutative [=>]8.0 | \[ \frac{-\sqrt{\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{\color{blue}{{B}^{2} + {\left(A - C\right)}^{2}}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
unpow2 [=>]8.0 | \[ \frac{-\sqrt{\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{\color{blue}{B \cdot B} + {\left(A - C\right)}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
associate-*l* [=>]8.0 | \[ \frac{-\sqrt{\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}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}}
\] |
unpow2 [=>]8.0 | \[ \frac{-\sqrt{\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)}}{\color{blue}{B \cdot B} - 4 \cdot \left(A \cdot C\right)}
\] |
Applied egg-rr7.9%
[Start]8.0 | \[ \frac{-\sqrt{\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)}
\] |
|---|---|
add-sqr-sqrt [=>]7.8 | \[ \frac{-\sqrt{\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) + \color{blue}{\sqrt{\sqrt{B \cdot B + {\left(A - C\right)}^{2}}} \cdot \sqrt{\sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
pow2 [=>]7.8 | \[ \frac{-\sqrt{\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) + \color{blue}{{\left(\sqrt{\sqrt{B \cdot B + {\left(A - C\right)}^{2}}}\right)}^{2}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
unpow2 [=>]7.8 | \[ \frac{-\sqrt{\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) + {\left(\sqrt{\sqrt{B \cdot B + \color{blue}{\left(A - C\right) \cdot \left(A - C\right)}}}\right)}^{2}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
hypot-def [=>]7.9 | \[ \frac{-\sqrt{\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) + {\left(\sqrt{\color{blue}{\mathsf{hypot}\left(B, A - C\right)}}\right)}^{2}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
Taylor expanded in B around inf 7.9%
Simplified7.9%
[Start]7.9 | \[ \frac{-\sqrt{\left(2 \cdot \left(F \cdot {B}^{2}\right)\right) \cdot \left(\left(A + C\right) + {\left(\sqrt{\mathsf{hypot}\left(B, A - C\right)}\right)}^{2}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
|---|---|
unpow2 [=>]7.9 | \[ \frac{-\sqrt{\left(2 \cdot \left(F \cdot \color{blue}{\left(B \cdot B\right)}\right)\right) \cdot \left(\left(A + C\right) + {\left(\sqrt{\mathsf{hypot}\left(B, A - C\right)}\right)}^{2}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
Applied egg-rr23.6%
[Start]7.9 | \[ \frac{-\sqrt{\left(2 \cdot \left(F \cdot \left(B \cdot B\right)\right)\right) \cdot \left(\left(A + C\right) + {\left(\sqrt{\mathsf{hypot}\left(B, A - C\right)}\right)}^{2}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
|---|---|
*-un-lft-identity [=>]7.9 | \[ \frac{\color{blue}{1 \cdot \left(-\sqrt{\left(2 \cdot \left(F \cdot \left(B \cdot B\right)\right)\right) \cdot \left(\left(A + C\right) + {\left(\sqrt{\mathsf{hypot}\left(B, A - C\right)}\right)}^{2}\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
add-sqr-sqrt [=>]7.9 | \[ \frac{1 \cdot \left(-\sqrt{\left(2 \cdot \left(F \cdot \left(B \cdot B\right)\right)\right) \cdot \left(\left(A + C\right) + {\left(\sqrt{\mathsf{hypot}\left(B, A - C\right)}\right)}^{2}\right)}\right)}{\color{blue}{\sqrt{B \cdot B - 4 \cdot \left(A \cdot C\right)} \cdot \sqrt{B \cdot B - 4 \cdot \left(A \cdot C\right)}}}
\] |
times-frac [=>]8.0 | \[ \color{blue}{\frac{1}{\sqrt{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \cdot \frac{-\sqrt{\left(2 \cdot \left(F \cdot \left(B \cdot B\right)\right)\right) \cdot \left(\left(A + C\right) + {\left(\sqrt{\mathsf{hypot}\left(B, A - C\right)}\right)}^{2}\right)}}{\sqrt{B \cdot B - 4 \cdot \left(A \cdot C\right)}}}
\] |
cancel-sign-sub-inv [=>]8.0 | \[ \frac{1}{\sqrt{\color{blue}{B \cdot B + \left(-4\right) \cdot \left(A \cdot C\right)}}} \cdot \frac{-\sqrt{\left(2 \cdot \left(F \cdot \left(B \cdot B\right)\right)\right) \cdot \left(\left(A + C\right) + {\left(\sqrt{\mathsf{hypot}\left(B, A - C\right)}\right)}^{2}\right)}}{\sqrt{B \cdot B - 4 \cdot \left(A \cdot C\right)}}
\] |
fma-def [=>]8.0 | \[ \frac{1}{\sqrt{\color{blue}{\mathsf{fma}\left(B, B, \left(-4\right) \cdot \left(A \cdot C\right)\right)}}} \cdot \frac{-\sqrt{\left(2 \cdot \left(F \cdot \left(B \cdot B\right)\right)\right) \cdot \left(\left(A + C\right) + {\left(\sqrt{\mathsf{hypot}\left(B, A - C\right)}\right)}^{2}\right)}}{\sqrt{B \cdot B - 4 \cdot \left(A \cdot C\right)}}
\] |
associate-*r* [=>]8.0 | \[ \frac{1}{\sqrt{\mathsf{fma}\left(B, B, \color{blue}{\left(\left(-4\right) \cdot A\right) \cdot C}\right)}} \cdot \frac{-\sqrt{\left(2 \cdot \left(F \cdot \left(B \cdot B\right)\right)\right) \cdot \left(\left(A + C\right) + {\left(\sqrt{\mathsf{hypot}\left(B, A - C\right)}\right)}^{2}\right)}}{\sqrt{B \cdot B - 4 \cdot \left(A \cdot C\right)}}
\] |
metadata-eval [=>]8.0 | \[ \frac{1}{\sqrt{\mathsf{fma}\left(B, B, \left(\color{blue}{-4} \cdot A\right) \cdot C\right)}} \cdot \frac{-\sqrt{\left(2 \cdot \left(F \cdot \left(B \cdot B\right)\right)\right) \cdot \left(\left(A + C\right) + {\left(\sqrt{\mathsf{hypot}\left(B, A - C\right)}\right)}^{2}\right)}}{\sqrt{B \cdot B - 4 \cdot \left(A \cdot C\right)}}
\] |
Simplified28.5%
[Start]23.6 | \[ \frac{1}{\sqrt{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}} \cdot \frac{\left(\sqrt{2 \cdot F} \cdot B\right) \cdot \sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}{\sqrt{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}}
\] |
|---|---|
associate-*l/ [=>]23.7 | \[ \color{blue}{\frac{1 \cdot \frac{\left(\sqrt{2 \cdot F} \cdot B\right) \cdot \sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}{\sqrt{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}}}{\sqrt{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}}}
\] |
*-lft-identity [=>]23.7 | \[ \frac{\color{blue}{\frac{\left(\sqrt{2 \cdot F} \cdot B\right) \cdot \sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}{\sqrt{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}}}}{\sqrt{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}}
\] |
associate-*r/ [<=]27.9 | \[ \frac{\color{blue}{\left(\sqrt{2 \cdot F} \cdot B\right) \cdot \frac{\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}{\sqrt{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}}}}{\sqrt{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}}
\] |
associate-*l/ [<=]27.9 | \[ \color{blue}{\frac{\sqrt{2 \cdot F} \cdot B}{\sqrt{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}} \cdot \frac{\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}{\sqrt{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}}}
\] |
if -3.99999999999999983e28 < B < -1.06000000000000006e-8Initial program 10.2%
Simplified10.2%
[Start]10.2 | \[ \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}
\] |
|---|---|
associate-*l* [=>]10.2 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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}
\] |
unpow2 [=>]10.2 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left(\color{blue}{B \cdot B} - 4 \cdot \left(A \cdot C\right)\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}
\] |
+-commutative [=>]10.2 | \[ \frac{-\sqrt{\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{\color{blue}{{B}^{2} + {\left(A - C\right)}^{2}}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
unpow2 [=>]10.2 | \[ \frac{-\sqrt{\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{\color{blue}{B \cdot B} + {\left(A - C\right)}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
associate-*l* [=>]10.2 | \[ \frac{-\sqrt{\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}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}}
\] |
unpow2 [=>]10.2 | \[ \frac{-\sqrt{\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)}}{\color{blue}{B \cdot B} - 4 \cdot \left(A \cdot C\right)}
\] |
Taylor expanded in A around -inf 34.5%
Simplified34.5%
[Start]34.5 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(2 \cdot C + -0.5 \cdot \frac{{B}^{2}}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
|---|---|
fma-def [=>]34.5 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \color{blue}{\mathsf{fma}\left(2, C, -0.5 \cdot \frac{{B}^{2}}{A}\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
unpow2 [=>]34.5 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \mathsf{fma}\left(2, C, -0.5 \cdot \frac{\color{blue}{B \cdot B}}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
if -1.06000000000000006e-8 < B < -5.79999999999999985e-112Initial program 28.5%
Simplified28.5%
[Start]28.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}
\] |
|---|---|
associate-*l* [=>]28.5 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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}
\] |
unpow2 [=>]28.5 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left(\color{blue}{B \cdot B} - 4 \cdot \left(A \cdot C\right)\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}
\] |
+-commutative [=>]28.5 | \[ \frac{-\sqrt{\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{\color{blue}{{B}^{2} + {\left(A - C\right)}^{2}}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
unpow2 [=>]28.5 | \[ \frac{-\sqrt{\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{\color{blue}{B \cdot B} + {\left(A - C\right)}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
associate-*l* [=>]28.5 | \[ \frac{-\sqrt{\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}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}}
\] |
unpow2 [=>]28.5 | \[ \frac{-\sqrt{\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)}}{\color{blue}{B \cdot B} - 4 \cdot \left(A \cdot C\right)}
\] |
Applied egg-rr45.6%
[Start]28.5 | \[ \frac{-\sqrt{\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)}
\] |
|---|---|
*-commutative [=>]28.5 | \[ \frac{-\sqrt{\color{blue}{\left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right) \cdot \left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
sqrt-prod [=>]32.8 | \[ \frac{-\color{blue}{\sqrt{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}} \cdot \sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
associate-+l+ [=>]32.7 | \[ \frac{-\sqrt{\color{blue}{A + \left(C + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)}} \cdot \sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
unpow2 [=>]32.7 | \[ \frac{-\sqrt{A + \left(C + \sqrt{B \cdot B + \color{blue}{\left(A - C\right) \cdot \left(A - C\right)}}\right)} \cdot \sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
hypot-def [=>]45.6 | \[ \frac{-\sqrt{A + \left(C + \color{blue}{\mathsf{hypot}\left(B, A - C\right)}\right)} \cdot \sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
if -5.79999999999999985e-112 < B < 6.00000000000000035e-118Initial program 14.6%
Simplified14.6%
[Start]14.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}
\] |
|---|---|
associate-*l* [=>]14.6 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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}
\] |
unpow2 [=>]14.6 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left(\color{blue}{B \cdot B} - 4 \cdot \left(A \cdot C\right)\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}
\] |
+-commutative [=>]14.6 | \[ \frac{-\sqrt{\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{\color{blue}{{B}^{2} + {\left(A - C\right)}^{2}}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
unpow2 [=>]14.6 | \[ \frac{-\sqrt{\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{\color{blue}{B \cdot B} + {\left(A - C\right)}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
associate-*l* [=>]14.6 | \[ \frac{-\sqrt{\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}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}}
\] |
unpow2 [=>]14.6 | \[ \frac{-\sqrt{\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)}}{\color{blue}{B \cdot B} - 4 \cdot \left(A \cdot C\right)}
\] |
Taylor expanded in A around -inf 29.7%
Simplified29.7%
[Start]29.7 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
|---|---|
*-commutative [=>]29.7 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \color{blue}{\left(C \cdot 2\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
if 6.00000000000000035e-118 < B < 1.25000000000000003e143Initial program 41.8%
Simplified47.8%
[Start]41.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-rr51.0%
[Start]47.8 | \[ \frac{-\sqrt{\left(2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot F\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
|---|---|
*-commutative [=>]47.8 | \[ \frac{-\sqrt{\color{blue}{\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot F\right)\right)}}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
sqrt-prod [=>]51.4 | \[ \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, C \cdot \left(A \cdot -4\right)\right) \cdot F\right)}}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
+-commutative [=>]51.4 | \[ \frac{-\sqrt{\color{blue}{\left(C + \mathsf{hypot}\left(B, A - C\right)\right) + A}} \cdot \sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot F\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
+-commutative [=>]51.4 | \[ \frac{-\sqrt{\color{blue}{\left(\mathsf{hypot}\left(B, A - C\right) + C\right)} + A} \cdot \sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot F\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
associate-+l+ [=>]51.0 | \[ \frac{-\sqrt{\color{blue}{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)}} \cdot \sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot F\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
Applied egg-rr66.1%
[Start]51.0 | \[ \frac{-\sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)} \cdot \sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot F\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
|---|---|
associate-*r* [=>]51.4 | \[ \frac{-\sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)} \cdot \sqrt{\color{blue}{\left(2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right) \cdot F}}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
sqrt-prod [=>]66.1 | \[ \frac{-\sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)} \cdot \color{blue}{\left(\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{F}\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
*-commutative [=>]66.1 | \[ \frac{-\sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)} \cdot \left(\sqrt{2 \cdot \mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot -4\right) \cdot C}\right)} \cdot \sqrt{F}\right)}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
associate-*l* [=>]66.1 | \[ \frac{-\sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)} \cdot \left(\sqrt{2 \cdot \mathsf{fma}\left(B, B, \color{blue}{A \cdot \left(-4 \cdot C\right)}\right)} \cdot \sqrt{F}\right)}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
if 1.25000000000000003e143 < B Initial program 0.1%
Simplified0.1%
[Start]0.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 A around 0 2.4%
Simplified57.1%
[Start]2.4 | \[ -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}\right)
\] |
|---|---|
mul-1-neg [=>]2.4 | \[ \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}}
\] |
distribute-rgt-neg-in [=>]2.4 | \[ \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}\right)}
\] |
*-commutative [=>]2.4 | \[ \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{\color{blue}{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)
\] |
unpow2 [=>]2.4 | \[ \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \sqrt{\color{blue}{B \cdot B} + {C}^{2}}\right)}\right)
\] |
unpow2 [=>]2.4 | \[ \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \sqrt{B \cdot B + \color{blue}{C \cdot C}}\right)}\right)
\] |
hypot-def [=>]57.1 | \[ \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \color{blue}{\mathsf{hypot}\left(B, C\right)}\right)}\right)
\] |
Final simplification43.7%
| Alternative 1 | |
|---|---|
| Accuracy | 42.9% |
| Cost | 40916 |
| Alternative 2 | |
|---|---|
| Accuracy | 43.1% |
| Cost | 27980 |
| Alternative 3 | |
|---|---|
| Accuracy | 41.3% |
| Cost | 27468 |
| Alternative 4 | |
|---|---|
| Accuracy | 41.1% |
| Cost | 27468 |
| Alternative 5 | |
|---|---|
| Accuracy | 40.9% |
| Cost | 27140 |
| Alternative 6 | |
|---|---|
| Accuracy | 40.2% |
| Cost | 21196 |
| Alternative 7 | |
|---|---|
| Accuracy | 36.4% |
| Cost | 21064 |
| Alternative 8 | |
|---|---|
| Accuracy | 36.8% |
| Cost | 20168 |
| Alternative 9 | |
|---|---|
| Accuracy | 35.8% |
| Cost | 15108 |
| Alternative 10 | |
|---|---|
| Accuracy | 36.0% |
| Cost | 14920 |
| Alternative 11 | |
|---|---|
| Accuracy | 35.7% |
| Cost | 13316 |
| Alternative 12 | |
|---|---|
| Accuracy | 27.3% |
| Cost | 8452 |
| Alternative 13 | |
|---|---|
| Accuracy | 26.2% |
| Cost | 8192 |
| Alternative 14 | |
|---|---|
| Accuracy | 6.6% |
| Cost | 8064 |
| Alternative 15 | |
|---|---|
| Accuracy | 6.7% |
| Cost | 7808 |
| Alternative 16 | |
|---|---|
| Accuracy | 3.1% |
| Cost | 7680 |
| Alternative 17 | |
|---|---|
| Accuracy | 2.3% |
| Cost | 7616 |
| Alternative 18 | |
|---|---|
| Accuracy | 2.4% |
| Cost | 7616 |
| Alternative 19 | |
|---|---|
| Accuracy | 2.3% |
| Cost | 7104 |
| Alternative 20 | |
|---|---|
| Accuracy | 1.1% |
| Cost | 6912 |
| Alternative 21 | |
|---|---|
| Accuracy | 0.8% |
| Cost | 6848 |
| Alternative 22 | |
|---|---|
| Accuracy | 0.8% |
| Cost | 6848 |
herbie shell --seed 2023159
(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))))