| Alternative 1 | |
|---|---|
| Accuracy | 38.5% |
| Cost | 60048 |
(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 (fma B B (* A (* C -4.0))))
(t_2 (sqrt (- (/ F A)))))
(if (<= B -4.5e+35)
(/ (sqrt (* F (- C (hypot B C)))) (/ B (sqrt 2.0)))
(if (<= B -1.45e-63)
(*
(sqrt
(fma
-16.0
(* C (* C (* F A)))
(* 2.0 (* (* 2.0 (* F (* B B))) (+ C (/ C (/ (- A C) A)))))))
(/ 1.0 (- t_1)))
(if (<= B -4.3e-107)
(/
(-
(sqrt
(*
2.0
(* (* F t_0) (+ A (- C (sqrt (+ (* B B) (pow (- A C) 2.0)))))))))
t_0)
(if (<= B -9e-240)
(* (sqrt (* F (+ C C))) (/ (- (sqrt (* 2.0 t_1))) t_1))
(if (<= B -1.1e-292)
(* (sqrt (* F (* (* A -8.0) (* C (+ A A))))) (/ -1.0 t_1))
(if (<= B 1.15e-263)
t_2
(if (<= B 2.8e-191)
(/ (- (sqrt (* (* A -8.0) (* (+ A A) (* F C))))) t_1)
(if (<= B 1.55e-44)
t_2
(*
(sqrt (* F (- (+ C A) (hypot B (- A 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 = fma(B, B, (A * (C * -4.0)));
double t_2 = sqrt(-(F / A));
double tmp;
if (B <= -4.5e+35) {
tmp = sqrt((F * (C - hypot(B, C)))) / (B / sqrt(2.0));
} else if (B <= -1.45e-63) {
tmp = sqrt(fma(-16.0, (C * (C * (F * A))), (2.0 * ((2.0 * (F * (B * B))) * (C + (C / ((A - C) / A))))))) * (1.0 / -t_1);
} else if (B <= -4.3e-107) {
tmp = -sqrt((2.0 * ((F * t_0) * (A + (C - sqrt(((B * B) + pow((A - C), 2.0)))))))) / t_0;
} else if (B <= -9e-240) {
tmp = sqrt((F * (C + C))) * (-sqrt((2.0 * t_1)) / t_1);
} else if (B <= -1.1e-292) {
tmp = sqrt((F * ((A * -8.0) * (C * (A + A))))) * (-1.0 / t_1);
} else if (B <= 1.15e-263) {
tmp = t_2;
} else if (B <= 2.8e-191) {
tmp = -sqrt(((A * -8.0) * ((A + A) * (F * C)))) / t_1;
} else if (B <= 1.55e-44) {
tmp = t_2;
} else {
tmp = sqrt((F * ((C + A) - hypot(B, (A - 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 = fma(B, B, Float64(A * Float64(C * -4.0))) t_2 = sqrt(Float64(-Float64(F / A))) tmp = 0.0 if (B <= -4.5e+35) tmp = Float64(sqrt(Float64(F * Float64(C - hypot(B, C)))) / Float64(B / sqrt(2.0))); elseif (B <= -1.45e-63) tmp = Float64(sqrt(fma(-16.0, Float64(C * Float64(C * Float64(F * A))), Float64(2.0 * Float64(Float64(2.0 * Float64(F * Float64(B * B))) * Float64(C + Float64(C / Float64(Float64(A - C) / A))))))) * Float64(1.0 / Float64(-t_1))); elseif (B <= -4.3e-107) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(C - sqrt(Float64(Float64(B * B) + (Float64(A - C) ^ 2.0))))))))) / t_0); elseif (B <= -9e-240) tmp = Float64(sqrt(Float64(F * Float64(C + C))) * Float64(Float64(-sqrt(Float64(2.0 * t_1))) / t_1)); elseif (B <= -1.1e-292) tmp = Float64(sqrt(Float64(F * Float64(Float64(A * -8.0) * Float64(C * Float64(A + A))))) * Float64(-1.0 / t_1)); elseif (B <= 1.15e-263) tmp = t_2; elseif (B <= 2.8e-191) tmp = Float64(Float64(-sqrt(Float64(Float64(A * -8.0) * Float64(Float64(A + A) * Float64(F * C))))) / t_1); elseif (B <= 1.55e-44) tmp = t_2; else tmp = Float64(sqrt(Float64(F * Float64(Float64(C + A) - hypot(B, Float64(A - 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[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[(-N[(F / A), $MachinePrecision])], $MachinePrecision]}, If[LessEqual[B, -4.5e+35], N[(N[Sqrt[N[(F * N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(B / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.45e-63], N[(N[Sqrt[N[(-16.0 * N[(C * N[(C * N[(F * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[(2.0 * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(C + N[(C / N[(N[(A - C), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / (-t$95$1)), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -4.3e-107], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(C - N[Sqrt[N[(N[(B * B), $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, -9e-240], N[(N[Sqrt[N[(F * N[(C + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[N[(2.0 * t$95$1), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.1e-292], N[(N[Sqrt[N[(F * N[(N[(A * -8.0), $MachinePrecision] * N[(C * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.15e-263], t$95$2, If[LessEqual[B, 2.8e-191], N[((-N[Sqrt[N[(N[(A * -8.0), $MachinePrecision] * N[(N[(A + A), $MachinePrecision] * N[(F * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[B, 1.55e-44], t$95$2, N[(N[Sqrt[N[(F * N[(N[(C + A), $MachinePrecision] - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 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 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
t_2 := \sqrt{-\frac{F}{A}}\\
\mathbf{if}\;B \leq -4.5 \cdot 10^{+35}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)}}{\frac{B}{\sqrt{2}}}\\
\mathbf{elif}\;B \leq -1.45 \cdot 10^{-63}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(-16, C \cdot \left(C \cdot \left(F \cdot A\right)\right), 2 \cdot \left(\left(2 \cdot \left(F \cdot \left(B \cdot B\right)\right)\right) \cdot \left(C + \frac{C}{\frac{A - C}{A}}\right)\right)\right)} \cdot \frac{1}{-t_1}\\
\mathbf{elif}\;B \leq -4.3 \cdot 10^{-107}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq -9 \cdot 10^{-240}:\\
\;\;\;\;\sqrt{F \cdot \left(C + C\right)} \cdot \frac{-\sqrt{2 \cdot t_1}}{t_1}\\
\mathbf{elif}\;B \leq -1.1 \cdot 10^{-292}:\\
\;\;\;\;\sqrt{F \cdot \left(\left(A \cdot -8\right) \cdot \left(C \cdot \left(A + A\right)\right)\right)} \cdot \frac{-1}{t_1}\\
\mathbf{elif}\;B \leq 1.15 \cdot 10^{-263}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;B \leq 2.8 \cdot 10^{-191}:\\
\;\;\;\;\frac{-\sqrt{\left(A \cdot -8\right) \cdot \left(\left(A + A\right) \cdot \left(F \cdot C\right)\right)}}{t_1}\\
\mathbf{elif}\;B \leq 1.55 \cdot 10^{-44}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\sqrt{F \cdot \left(\left(C + A\right) - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
if B < -4.4999999999999997e35Initial program 11.5%
Simplified13.5%
[Start]11.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}
\] |
|---|
Applied egg-rr1.1%
Simplified1.4%
[Start]1.1 | \[ \sqrt{\frac{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)\right)}{{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}^{2}}}
\] |
|---|---|
associate-/l* [=>]1.4 | \[ \sqrt{\color{blue}{\frac{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}{\frac{{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}^{2}}{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}}}
\] |
associate-*r* [=>]1.4 | \[ \sqrt{\frac{\mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot C\right) \cdot -4}\right)}{\frac{{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}^{2}}{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}}
\] |
associate-*r* [=>]1.4 | \[ \sqrt{\frac{\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)}{\frac{{\left(\mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot C\right) \cdot -4}\right)\right)}^{2}}{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}}
\] |
Taylor expanded in A around 0 17.7%
Simplified17.7%
[Start]17.7 | \[ \sqrt{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F} \cdot \frac{\sqrt{2}}{B}
\] |
|---|---|
*-commutative [=>]17.7 | \[ \sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \cdot \frac{\sqrt{2}}{B}
\] |
unpow2 [=>]17.7 | \[ \sqrt{F \cdot \left(C - \sqrt{\color{blue}{B \cdot B} + {C}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}
\] |
unpow2 [=>]17.7 | \[ \sqrt{F \cdot \left(C - \sqrt{B \cdot B + \color{blue}{C \cdot C}}\right)} \cdot \frac{\sqrt{2}}{B}
\] |
Applied egg-rr48.2%
if -4.4999999999999997e35 < B < -1.44999999999999987e-63Initial program 34.6%
Simplified43.8%
[Start]34.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}
\] |
|---|
Taylor expanded in B around 0 10.4%
Simplified10.4%
[Start]10.4 | \[ \frac{-\sqrt{-16 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right) + 2 \cdot \left(F \cdot \left(\left(2 \cdot \frac{A \cdot C}{A - C} + 2 \cdot C\right) \cdot {B}^{2}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
fma-def [=>]10.4 | \[ \frac{-\sqrt{\color{blue}{\mathsf{fma}\left(-16, A \cdot \left({C}^{2} \cdot F\right), 2 \cdot \left(F \cdot \left(\left(2 \cdot \frac{A \cdot C}{A - C} + 2 \cdot C\right) \cdot {B}^{2}\right)\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
*-commutative [=>]10.4 | \[ \frac{-\sqrt{\mathsf{fma}\left(-16, A \cdot \color{blue}{\left(F \cdot {C}^{2}\right)}, 2 \cdot \left(F \cdot \left(\left(2 \cdot \frac{A \cdot C}{A - C} + 2 \cdot C\right) \cdot {B}^{2}\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
unpow2 [=>]10.4 | \[ \frac{-\sqrt{\mathsf{fma}\left(-16, A \cdot \left(F \cdot \color{blue}{\left(C \cdot C\right)}\right), 2 \cdot \left(F \cdot \left(\left(2 \cdot \frac{A \cdot C}{A - C} + 2 \cdot C\right) \cdot {B}^{2}\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
associate-*r* [=>]10.4 | \[ \frac{-\sqrt{\mathsf{fma}\left(-16, A \cdot \left(F \cdot \left(C \cdot C\right)\right), \color{blue}{\left(2 \cdot F\right) \cdot \left(\left(2 \cdot \frac{A \cdot C}{A - C} + 2 \cdot C\right) \cdot {B}^{2}\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
*-commutative [=>]10.4 | \[ \frac{-\sqrt{\mathsf{fma}\left(-16, A \cdot \left(F \cdot \left(C \cdot C\right)\right), \left(2 \cdot F\right) \cdot \color{blue}{\left({B}^{2} \cdot \left(2 \cdot \frac{A \cdot C}{A - C} + 2 \cdot C\right)\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
unpow2 [=>]10.4 | \[ \frac{-\sqrt{\mathsf{fma}\left(-16, A \cdot \left(F \cdot \left(C \cdot C\right)\right), \left(2 \cdot F\right) \cdot \left(\color{blue}{\left(B \cdot B\right)} \cdot \left(2 \cdot \frac{A \cdot C}{A - C} + 2 \cdot C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
distribute-lft-out [=>]10.4 | \[ \frac{-\sqrt{\mathsf{fma}\left(-16, A \cdot \left(F \cdot \left(C \cdot C\right)\right), \left(2 \cdot F\right) \cdot \left(\left(B \cdot B\right) \cdot \color{blue}{\left(2 \cdot \left(\frac{A \cdot C}{A - C} + C\right)\right)}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
Applied egg-rr14.1%
if -1.44999999999999987e-63 < B < -4.2999999999999997e-107Initial program 25.2%
Simplified26.1%
[Start]25.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}
\] |
|---|
if -4.2999999999999997e-107 < B < -9.0000000000000003e-240Initial program 18.0%
Simplified27.1%
[Start]18.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}
\] |
|---|
Applied egg-rr20.9%
Simplified20.9%
[Start]20.9 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \cdot \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
|---|---|
*-commutative [=>]20.9 | \[ \frac{-\color{blue}{\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [=>]20.9 | \[ \frac{-\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \color{blue}{\left(C \cdot -4\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
Applied egg-rr19.1%
Simplified19.7%
[Start]19.1 | \[ \sqrt{F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(\left(-\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right) \cdot \frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)
\] |
|---|---|
distribute-lft-neg-out [=>]19.1 | \[ \sqrt{F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \color{blue}{\left(-\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)}
\] |
associate-*r/ [=>]19.7 | \[ \sqrt{F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\color{blue}{\frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot 1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}\right)
\] |
*-rgt-identity [=>]19.7 | \[ \sqrt{F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\frac{\color{blue}{\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)
\] |
Taylor expanded in A around inf 14.9%
Simplified14.9%
[Start]14.9 | \[ \sqrt{\left(C - -1 \cdot C\right) \cdot F} \cdot \left(-\frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)
\] |
|---|---|
*-commutative [=>]14.9 | \[ \sqrt{\color{blue}{F \cdot \left(C - -1 \cdot C\right)}} \cdot \left(-\frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)
\] |
sub-neg [=>]14.9 | \[ \sqrt{F \cdot \color{blue}{\left(C + \left(--1 \cdot C\right)\right)}} \cdot \left(-\frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)
\] |
mul-1-neg [=>]14.9 | \[ \sqrt{F \cdot \left(C + \left(-\color{blue}{\left(-C\right)}\right)\right)} \cdot \left(-\frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)
\] |
remove-double-neg [=>]14.9 | \[ \sqrt{F \cdot \left(C + \color{blue}{C}\right)} \cdot \left(-\frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)
\] |
if -9.0000000000000003e-240 < B < -1.10000000000000006e-292Initial program 13.6%
Simplified26.1%
[Start]13.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-rr15.6%
Simplified15.6%
[Start]15.6 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \cdot \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
|---|---|
*-commutative [=>]15.6 | \[ \frac{-\color{blue}{\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [=>]15.6 | \[ \frac{-\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \color{blue}{\left(C \cdot -4\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
Applied egg-rr21.9%
Simplified23.3%
[Start]21.9 | \[ \sqrt{F \cdot \left(\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)\right)} \cdot \frac{1}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
associate-*r* [=>]21.9 | \[ \sqrt{F \cdot \color{blue}{\left(\left(\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot 2\right) \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}} \cdot \frac{1}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
associate--l+ [=>]23.3 | \[ \sqrt{F \cdot \left(\left(\color{blue}{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot 2\right) \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)} \cdot \frac{1}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
neg-mul-1 [=>]23.3 | \[ \sqrt{F \cdot \left(\left(\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot 2\right) \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)} \cdot \frac{1}{\color{blue}{-1 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}
\] |
associate-/r* [=>]23.3 | \[ \sqrt{F \cdot \left(\left(\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot 2\right) \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)} \cdot \color{blue}{\frac{\frac{1}{-1}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}
\] |
metadata-eval [=>]23.3 | \[ \sqrt{F \cdot \left(\left(\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot 2\right) \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)} \cdot \frac{\color{blue}{-1}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
Taylor expanded in C around inf 19.0%
Simplified19.0%
[Start]19.0 | \[ \sqrt{F \cdot \left(-8 \cdot \left(A \cdot \left(\left(A - -1 \cdot A\right) \cdot C\right)\right)\right)} \cdot \frac{-1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
associate-*r* [=>]19.0 | \[ \sqrt{F \cdot \color{blue}{\left(\left(-8 \cdot A\right) \cdot \left(\left(A - -1 \cdot A\right) \cdot C\right)\right)}} \cdot \frac{-1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
*-commutative [=>]19.0 | \[ \sqrt{F \cdot \left(\left(-8 \cdot A\right) \cdot \color{blue}{\left(C \cdot \left(A - -1 \cdot A\right)\right)}\right)} \cdot \frac{-1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
mul-1-neg [=>]19.0 | \[ \sqrt{F \cdot \left(\left(-8 \cdot A\right) \cdot \left(C \cdot \left(A - \color{blue}{\left(-A\right)}\right)\right)\right)} \cdot \frac{-1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
if -1.10000000000000006e-292 < B < 1.15000000000000001e-263 or 2.80000000000000012e-191 < B < 1.54999999999999992e-44Initial program 20.9%
Simplified28.9%
[Start]20.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}
\] |
|---|
Applied egg-rr8.3%
Simplified8.7%
[Start]8.3 | \[ \sqrt{\frac{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)\right)}{{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}^{2}}}
\] |
|---|---|
associate-/l* [=>]8.7 | \[ \sqrt{\color{blue}{\frac{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}{\frac{{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}^{2}}{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}}}
\] |
associate-*r* [=>]8.7 | \[ \sqrt{\frac{\mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot C\right) \cdot -4}\right)}{\frac{{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}^{2}}{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}}
\] |
associate-*r* [=>]8.7 | \[ \sqrt{\frac{\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)}{\frac{{\left(\mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot C\right) \cdot -4}\right)\right)}^{2}}{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}}
\] |
Taylor expanded in B around 0 19.3%
Simplified19.3%
[Start]19.3 | \[ \sqrt{-1 \cdot \frac{F}{A}}
\] |
|---|---|
mul-1-neg [=>]19.3 | \[ \sqrt{\color{blue}{-\frac{F}{A}}}
\] |
if 1.15000000000000001e-263 < B < 2.80000000000000012e-191Initial program 14.5%
Simplified24.9%
[Start]14.5 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
|---|
Taylor expanded in C around inf 17.7%
Simplified17.7%
[Start]17.7 | \[ \frac{-\sqrt{-8 \cdot \left(A \cdot \left(\left(A - -1 \cdot A\right) \cdot \left(C \cdot F\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
associate-*r* [=>]17.7 | \[ \frac{-\sqrt{\color{blue}{\left(-8 \cdot A\right) \cdot \left(\left(A - -1 \cdot A\right) \cdot \left(C \cdot F\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
*-commutative [=>]17.7 | \[ \frac{-\sqrt{\left(-8 \cdot A\right) \cdot \color{blue}{\left(\left(C \cdot F\right) \cdot \left(A - -1 \cdot A\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
*-commutative [=>]17.7 | \[ \frac{-\sqrt{\left(-8 \cdot A\right) \cdot \left(\color{blue}{\left(F \cdot C\right)} \cdot \left(A - -1 \cdot A\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
mul-1-neg [=>]17.7 | \[ \frac{-\sqrt{\left(-8 \cdot A\right) \cdot \left(\left(F \cdot C\right) \cdot \left(A - \color{blue}{\left(-A\right)}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
if 1.54999999999999992e-44 < B Initial program 16.1%
Simplified20.0%
[Start]16.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}
\] |
|---|
Applied egg-rr26.0%
Simplified26.0%
[Start]26.0 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \cdot \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
|---|---|
*-commutative [=>]26.0 | \[ \frac{-\color{blue}{\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [=>]26.0 | \[ \frac{-\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \color{blue}{\left(C \cdot -4\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
Applied egg-rr25.8%
Simplified25.8%
[Start]25.8 | \[ \sqrt{F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(\left(-\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right) \cdot \frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)
\] |
|---|---|
distribute-lft-neg-out [=>]25.8 | \[ \sqrt{F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \color{blue}{\left(-\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)}
\] |
associate-*r/ [=>]25.8 | \[ \sqrt{F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\color{blue}{\frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot 1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}\right)
\] |
*-rgt-identity [=>]25.8 | \[ \sqrt{F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\frac{\color{blue}{\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)
\] |
Taylor expanded in B around inf 48.1%
Final simplification33.6%
| Alternative 1 | |
|---|---|
| Accuracy | 38.5% |
| Cost | 60048 |
| Alternative 2 | |
|---|---|
| Accuracy | 38.5% |
| Cost | 34384 |
| Alternative 3 | |
|---|---|
| Accuracy | 38.2% |
| Cost | 27984 |
| Alternative 4 | |
|---|---|
| Accuracy | 38.1% |
| Cost | 27984 |
| Alternative 5 | |
|---|---|
| Accuracy | 34.7% |
| Cost | 21964 |
| Alternative 6 | |
|---|---|
| Accuracy | 34.5% |
| Cost | 21964 |
| Alternative 7 | |
|---|---|
| Accuracy | 34.1% |
| Cost | 21216 |
| Alternative 8 | |
|---|---|
| Accuracy | 35.3% |
| Cost | 20952 |
| Alternative 9 | |
|---|---|
| Accuracy | 24.8% |
| Cost | 14740 |
| Alternative 10 | |
|---|---|
| Accuracy | 25.4% |
| Cost | 14740 |
| Alternative 11 | |
|---|---|
| Accuracy | 25.5% |
| Cost | 14740 |
| Alternative 12 | |
|---|---|
| Accuracy | 25.7% |
| Cost | 14408 |
| Alternative 13 | |
|---|---|
| Accuracy | 22.1% |
| Cost | 13772 |
| Alternative 14 | |
|---|---|
| Accuracy | 24.6% |
| Cost | 13572 |
| Alternative 15 | |
|---|---|
| Accuracy | 19.1% |
| Cost | 13452 |
| Alternative 16 | |
|---|---|
| Accuracy | 17.6% |
| Cost | 8844 |
| Alternative 17 | |
|---|---|
| Accuracy | 17.8% |
| Cost | 8844 |
| Alternative 18 | |
|---|---|
| Accuracy | 15.7% |
| Cost | 8716 |
| Alternative 19 | |
|---|---|
| Accuracy | 17.5% |
| Cost | 8716 |
| Alternative 20 | |
|---|---|
| Accuracy | 15.2% |
| Cost | 8584 |
| Alternative 21 | |
|---|---|
| Accuracy | 14.0% |
| Cost | 8332 |
| Alternative 22 | |
|---|---|
| Accuracy | 14.0% |
| Cost | 8204 |
| Alternative 23 | |
|---|---|
| Accuracy | 10.8% |
| Cost | 8072 |
| Alternative 24 | |
|---|---|
| Accuracy | 14.2% |
| Cost | 7501 |
| Alternative 25 | |
|---|---|
| Accuracy | 14.6% |
| Cost | 7053 |
| Alternative 26 | |
|---|---|
| Accuracy | 11.2% |
| Cost | 6656 |
| Alternative 27 | |
|---|---|
| Accuracy | 1.2% |
| Cost | 6592 |
herbie shell --seed 2023129
(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))))