| Alternative 1 | |
|---|---|
| Accuracy | 39.0% |
| Cost | 34384 |
(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 (hypot B (- A C)))
(t_1 (* F (- C (- t_0 A))))
(t_2 (fma B B (* C (* A -4.0))))
(t_3 (sqrt (* F (+ A (- C t_0)))))
(t_4 (fma B B (* A (* C -4.0)))))
(if (<= B -2.6e+20)
(* t_3 (/ (sqrt 2.0) B))
(if (<= B -9.8e-133)
(/ (- (sqrt (* 2.0 (* t_4 t_1)))) t_4)
(if (<= B 8.5e-160)
(/ (- (sqrt (* (* 2.0 (* F (* A C))) (* A -8.0)))) t_4)
(if (<= B 1.05e+50)
(/ (* (sqrt (* 2.0 t_2)) (- (sqrt t_1))) t_2)
(* t_3 (/ (- (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 = hypot(B, (A - C));
double t_1 = F * (C - (t_0 - A));
double t_2 = fma(B, B, (C * (A * -4.0)));
double t_3 = sqrt((F * (A + (C - t_0))));
double t_4 = fma(B, B, (A * (C * -4.0)));
double tmp;
if (B <= -2.6e+20) {
tmp = t_3 * (sqrt(2.0) / B);
} else if (B <= -9.8e-133) {
tmp = -sqrt((2.0 * (t_4 * t_1))) / t_4;
} else if (B <= 8.5e-160) {
tmp = -sqrt(((2.0 * (F * (A * C))) * (A * -8.0))) / t_4;
} else if (B <= 1.05e+50) {
tmp = (sqrt((2.0 * t_2)) * -sqrt(t_1)) / t_2;
} else {
tmp = t_3 * (-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 = hypot(B, Float64(A - C)) t_1 = Float64(F * Float64(C - Float64(t_0 - A))) t_2 = fma(B, B, Float64(C * Float64(A * -4.0))) t_3 = sqrt(Float64(F * Float64(A + Float64(C - t_0)))) t_4 = fma(B, B, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (B <= -2.6e+20) tmp = Float64(t_3 * Float64(sqrt(2.0) / B)); elseif (B <= -9.8e-133) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_4 * t_1)))) / t_4); elseif (B <= 8.5e-160) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * Float64(A * C))) * Float64(A * -8.0)))) / t_4); elseif (B <= 1.05e+50) tmp = Float64(Float64(sqrt(Float64(2.0 * t_2)) * Float64(-sqrt(t_1))) / t_2); else tmp = Float64(t_3 * 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[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$1 = N[(F * N[(C - N[(t$95$0 - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(F * N[(A + N[(C - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -2.6e+20], N[(t$95$3 * N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -9.8e-133], N[((-N[Sqrt[N[(2.0 * N[(t$95$4 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$4), $MachinePrecision], If[LessEqual[B, 8.5e-160], N[((-N[Sqrt[N[(N[(2.0 * N[(F * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(A * -8.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$4), $MachinePrecision], If[LessEqual[B, 1.05e+50], N[(N[(N[Sqrt[N[(2.0 * t$95$2), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[t$95$1], $MachinePrecision])), $MachinePrecision] / t$95$2), $MachinePrecision], N[(t$95$3 * 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 := \mathsf{hypot}\left(B, A - C\right)\\
t_1 := F \cdot \left(C - \left(t_0 - A\right)\right)\\
t_2 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
t_3 := \sqrt{F \cdot \left(A + \left(C - t_0\right)\right)}\\
t_4 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B \leq -2.6 \cdot 10^{+20}:\\
\;\;\;\;t_3 \cdot \frac{\sqrt{2}}{B}\\
\mathbf{elif}\;B \leq -9.8 \cdot 10^{-133}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_4 \cdot t_1\right)}}{t_4}\\
\mathbf{elif}\;B \leq 8.5 \cdot 10^{-160}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A \cdot -8\right)}}{t_4}\\
\mathbf{elif}\;B \leq 1.05 \cdot 10^{+50}:\\
\;\;\;\;\frac{\sqrt{2 \cdot t_2} \cdot \left(-\sqrt{t_1}\right)}{t_2}\\
\mathbf{else}:\\
\;\;\;\;t_3 \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
if B < -2.6e20Initial program 12.2%
Simplified14.6%
[Start]12.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}
\] |
|---|
Applied egg-rr22.5%
Simplified22.7%
[Start]22.5 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{F \cdot \left(\left(C + A\right) - \mathsf{hypot}\left(B, A - C\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
|---|---|
*-commutative [=>]22.5 | \[ \frac{-\color{blue}{\sqrt{F \cdot \left(\left(C + A\right) - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
+-commutative [<=]22.5 | \[ \frac{-\sqrt{F \cdot \left(\color{blue}{\left(A + C\right)} - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
associate-+r- [<=]22.7 | \[ \frac{-\sqrt{F \cdot \color{blue}{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
Applied egg-rr22.6%
Simplified22.7%
[Start]22.6 | \[ \sqrt{F \cdot \left(C - \left(\mathsf{hypot}\left(B, A - C\right) - A\right)\right)} \cdot \left(\left(-\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\right) \cdot \frac{1}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\right)
\] |
|---|---|
associate--r- [=>]22.7 | \[ \sqrt{F \cdot \color{blue}{\left(\left(C - \mathsf{hypot}\left(B, A - C\right)\right) + A\right)}} \cdot \left(\left(-\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\right) \cdot \frac{1}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\right)
\] |
+-commutative [=>]22.7 | \[ \sqrt{F \cdot \color{blue}{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}} \cdot \left(\left(-\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\right) \cdot \frac{1}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\right)
\] |
distribute-lft-neg-out [=>]22.7 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \color{blue}{\left(-\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \frac{1}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\right)}
\] |
associate-*r/ [=>]22.7 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \left(-\color{blue}{\frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot 1}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}\right)
\] |
*-rgt-identity [=>]22.7 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \left(-\frac{\color{blue}{\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\right)
\] |
distribute-frac-neg [<=]22.7 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \color{blue}{\frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}
\] |
*-commutative [=>]22.7 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot -4\right) \cdot C}\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
associate-*l* [=>]22.7 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, \color{blue}{A \cdot \left(-4 \cdot C\right)}\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
*-commutative [=>]22.7 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot -4\right) \cdot C}\right)}
\] |
associate-*l* [=>]22.7 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, \color{blue}{A \cdot \left(-4 \cdot C\right)}\right)}
\] |
Taylor expanded in B around -inf 49.4%
if -2.6e20 < B < -9.79999999999999992e-133Initial program 29.3%
Simplified37.9%
[Start]29.3 | \[ \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 -9.79999999999999992e-133 < B < 8.49999999999999959e-160Initial program 16.4%
Simplified25.7%
[Start]16.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}
\] |
|---|
Taylor expanded in C around inf 19.0%
Simplified19.1%
[Start]19.0 | \[ \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(A \cdot \left(\left(A - -1 \cdot A\right) \cdot \left(C \cdot F\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
|---|---|
associate-*r* [=>]19.1 | \[ \frac{-\sqrt{2 \cdot \color{blue}{\left(\left(-4 \cdot A\right) \cdot \left(\left(A - -1 \cdot A\right) \cdot \left(C \cdot F\right)\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [=>]19.1 | \[ \frac{-\sqrt{2 \cdot \left(\left(-4 \cdot A\right) \cdot \color{blue}{\left(\left(C \cdot F\right) \cdot \left(A - -1 \cdot A\right)\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [=>]19.1 | \[ \frac{-\sqrt{2 \cdot \left(\left(-4 \cdot A\right) \cdot \left(\color{blue}{\left(F \cdot C\right)} \cdot \left(A - -1 \cdot A\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
mul-1-neg [=>]19.1 | \[ \frac{-\sqrt{2 \cdot \left(\left(-4 \cdot A\right) \cdot \left(\left(F \cdot C\right) \cdot \left(A - \color{blue}{\left(-A\right)}\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
Applied egg-rr22.8%
Simplified22.8%
[Start]22.8 | \[ \frac{-\left(\sqrt{\left(F \cdot \left(C \cdot \left(A + A\right)\right)\right) \cdot \left(-8 \cdot A\right)} + 0\right)}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
|---|---|
+-rgt-identity [=>]22.8 | \[ \frac{-\color{blue}{\sqrt{\left(F \cdot \left(C \cdot \left(A + A\right)\right)\right) \cdot \left(-8 \cdot A\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
associate-*r* [=>]19.1 | \[ \frac{-\sqrt{\color{blue}{\left(\left(F \cdot C\right) \cdot \left(A + A\right)\right)} \cdot \left(-8 \cdot A\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
distribute-rgt-out [<=]19.1 | \[ \frac{-\sqrt{\color{blue}{\left(A \cdot \left(F \cdot C\right) + A \cdot \left(F \cdot C\right)\right)} \cdot \left(-8 \cdot A\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
count-2 [=>]19.1 | \[ \frac{-\sqrt{\color{blue}{\left(2 \cdot \left(A \cdot \left(F \cdot C\right)\right)\right)} \cdot \left(-8 \cdot A\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [=>]19.1 | \[ \frac{-\sqrt{\left(2 \cdot \color{blue}{\left(\left(F \cdot C\right) \cdot A\right)}\right) \cdot \left(-8 \cdot A\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
associate-*l* [=>]22.8 | \[ \frac{-\sqrt{\left(2 \cdot \color{blue}{\left(F \cdot \left(C \cdot A\right)\right)}\right) \cdot \left(-8 \cdot A\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [<=]22.8 | \[ \frac{-\sqrt{\left(2 \cdot \left(F \cdot \color{blue}{\left(A \cdot C\right)}\right)\right) \cdot \left(-8 \cdot A\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [=>]22.8 | \[ \frac{-\sqrt{\left(2 \cdot \left(F \cdot \left(A \cdot C\right)\right)\right) \cdot \color{blue}{\left(A \cdot -8\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
if 8.49999999999999959e-160 < B < 1.05e50Initial program 29.7%
Simplified38.9%
[Start]29.7 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
|---|
Applied egg-rr34.8%
Simplified35.7%
[Start]34.8 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{F \cdot \left(\left(C + A\right) - \mathsf{hypot}\left(B, A - C\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
|---|---|
*-commutative [=>]34.8 | \[ \frac{-\color{blue}{\sqrt{F \cdot \left(\left(C + A\right) - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
associate--l+ [=>]35.7 | \[ \frac{-\sqrt{F \cdot \color{blue}{\left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)}} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
if 1.05e50 < B Initial program 9.5%
Simplified12.1%
[Start]9.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-rr20.5%
Simplified20.6%
[Start]20.5 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{F \cdot \left(\left(C + A\right) - \mathsf{hypot}\left(B, A - C\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
|---|---|
*-commutative [=>]20.5 | \[ \frac{-\color{blue}{\sqrt{F \cdot \left(\left(C + A\right) - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
+-commutative [<=]20.5 | \[ \frac{-\sqrt{F \cdot \left(\color{blue}{\left(A + C\right)} - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
associate-+r- [<=]20.6 | \[ \frac{-\sqrt{F \cdot \color{blue}{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
Applied egg-rr20.5%
Simplified20.5%
[Start]20.5 | \[ \sqrt{F \cdot \left(C - \left(\mathsf{hypot}\left(B, A - C\right) - A\right)\right)} \cdot \left(\left(-\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\right) \cdot \frac{1}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\right)
\] |
|---|---|
associate--r- [=>]20.5 | \[ \sqrt{F \cdot \color{blue}{\left(\left(C - \mathsf{hypot}\left(B, A - C\right)\right) + A\right)}} \cdot \left(\left(-\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\right) \cdot \frac{1}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\right)
\] |
+-commutative [=>]20.5 | \[ \sqrt{F \cdot \color{blue}{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}} \cdot \left(\left(-\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\right) \cdot \frac{1}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\right)
\] |
distribute-lft-neg-out [=>]20.5 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \color{blue}{\left(-\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \frac{1}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\right)}
\] |
associate-*r/ [=>]20.5 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \left(-\color{blue}{\frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot 1}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}\right)
\] |
*-rgt-identity [=>]20.5 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \left(-\frac{\color{blue}{\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\right)
\] |
distribute-frac-neg [<=]20.5 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \color{blue}{\frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}
\] |
*-commutative [=>]20.5 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot -4\right) \cdot C}\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
associate-*l* [=>]20.5 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, \color{blue}{A \cdot \left(-4 \cdot C\right)}\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
*-commutative [=>]20.5 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot -4\right) \cdot C}\right)}
\] |
associate-*l* [=>]20.5 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, \color{blue}{A \cdot \left(-4 \cdot C\right)}\right)}
\] |
Taylor expanded in B around inf 51.5%
Simplified51.5%
[Start]51.5 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \left(-1 \cdot \frac{\sqrt{2}}{B}\right)
\] |
|---|---|
associate-*r/ [=>]51.5 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}}
\] |
mul-1-neg [=>]51.5 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\color{blue}{-\sqrt{2}}}{B}
\] |
Final simplification39.0%
| Alternative 1 | |
|---|---|
| Accuracy | 39.0% |
| Cost | 34384 |
| Alternative 2 | |
|---|---|
| Accuracy | 39.1% |
| Cost | 34384 |
| Alternative 3 | |
|---|---|
| Accuracy | 39.5% |
| Cost | 27984 |
| Alternative 4 | |
|---|---|
| Accuracy | 35.3% |
| Cost | 27664 |
| Alternative 5 | |
|---|---|
| Accuracy | 35.6% |
| Cost | 27664 |
| Alternative 6 | |
|---|---|
| Accuracy | 35.2% |
| Cost | 20876 |
| Alternative 7 | |
|---|---|
| Accuracy | 35.1% |
| Cost | 20688 |
| Alternative 8 | |
|---|---|
| Accuracy | 25.7% |
| Cost | 20432 |
| Alternative 9 | |
|---|---|
| Accuracy | 34.2% |
| Cost | 20432 |
| Alternative 10 | |
|---|---|
| Accuracy | 22.5% |
| Cost | 15764 |
| Alternative 11 | |
|---|---|
| Accuracy | 21.0% |
| Cost | 14480 |
| Alternative 12 | |
|---|---|
| Accuracy | 22.4% |
| Cost | 14480 |
| Alternative 13 | |
|---|---|
| Accuracy | 20.3% |
| Cost | 14348 |
| Alternative 14 | |
|---|---|
| Accuracy | 21.2% |
| Cost | 14348 |
| Alternative 15 | |
|---|---|
| Accuracy | 19.9% |
| Cost | 8584 |
| Alternative 16 | |
|---|---|
| Accuracy | 20.3% |
| Cost | 8584 |
| Alternative 17 | |
|---|---|
| Accuracy | 13.3% |
| Cost | 8452 |
| Alternative 18 | |
|---|---|
| Accuracy | 18.7% |
| Cost | 8452 |
| Alternative 19 | |
|---|---|
| Accuracy | 13.8% |
| Cost | 7680 |
| Alternative 20 | |
|---|---|
| Accuracy | 1.9% |
| Cost | 7360 |
| Alternative 21 | |
|---|---|
| Accuracy | 13.8% |
| Cost | 7360 |
| Alternative 22 | |
|---|---|
| Accuracy | 1.9% |
| Cost | 7296 |
| Alternative 23 | |
|---|---|
| Accuracy | 1.6% |
| Cost | 7232 |
herbie shell --seed 2023122
(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))))