| Alternative 1 | |
|---|---|
| Accuracy | 29.8% |
| Cost | 34316 |
(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
(/
(-
(sqrt
(*
(* -2.0 (* F (- (* (* 4.0 A) C) (pow B 2.0))))
(- (+ A C) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))))))
(+ (pow B 2.0) (* C (* A -4.0)))))
(t_1 (hypot B (- A C)))
(t_2 (fma B B (* A (* C -4.0))))
(t_3 (sqrt (* 2.0 t_2))))
(if (<= t_0 -5e-214)
(- (/ (* (sqrt (* F (+ A (- C t_1)))) t_3) t_2))
(if (<= t_0 0.0)
(/
(* t_3 (- (sqrt (* F (fma -0.5 (/ (* B B) (- A C)) (* 2.0 C))))))
t_2)
(if (<= t_0 INFINITY)
(- (/ (sqrt (* 2.0 (* t_2 (* F (+ C (- A t_1)))))) t_2))
(/ (* (sqrt (* (* C F) (* A -8.0))) (- (sqrt (+ A A)))) t_2))))))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 = -sqrt(((-2.0 * (F * (((4.0 * A) * C) - pow(B, 2.0)))) * ((A + C) - sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / (pow(B, 2.0) + (C * (A * -4.0)));
double t_1 = hypot(B, (A - C));
double t_2 = fma(B, B, (A * (C * -4.0)));
double t_3 = sqrt((2.0 * t_2));
double tmp;
if (t_0 <= -5e-214) {
tmp = -((sqrt((F * (A + (C - t_1)))) * t_3) / t_2);
} else if (t_0 <= 0.0) {
tmp = (t_3 * -sqrt((F * fma(-0.5, ((B * B) / (A - C)), (2.0 * C))))) / t_2;
} else if (t_0 <= ((double) INFINITY)) {
tmp = -(sqrt((2.0 * (t_2 * (F * (C + (A - t_1)))))) / t_2);
} else {
tmp = (sqrt(((C * F) * (A * -8.0))) * -sqrt((A + A))) / t_2;
}
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(-sqrt(Float64(Float64(-2.0 * Float64(F * Float64(Float64(Float64(4.0 * A) * C) - (B ^ 2.0)))) * Float64(Float64(A + C) - sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / Float64((B ^ 2.0) + Float64(C * Float64(A * -4.0)))) t_1 = hypot(B, Float64(A - C)) t_2 = fma(B, B, Float64(A * Float64(C * -4.0))) t_3 = sqrt(Float64(2.0 * t_2)) tmp = 0.0 if (t_0 <= -5e-214) tmp = Float64(-Float64(Float64(sqrt(Float64(F * Float64(A + Float64(C - t_1)))) * t_3) / t_2)); elseif (t_0 <= 0.0) tmp = Float64(Float64(t_3 * Float64(-sqrt(Float64(F * fma(-0.5, Float64(Float64(B * B) / Float64(A - C)), Float64(2.0 * C)))))) / t_2); elseif (t_0 <= Inf) tmp = Float64(-Float64(sqrt(Float64(2.0 * Float64(t_2 * Float64(F * Float64(C + Float64(A - t_1)))))) / t_2)); else tmp = Float64(Float64(sqrt(Float64(Float64(C * F) * Float64(A * -8.0))) * Float64(-sqrt(Float64(A + A)))) / t_2); 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[Sqrt[N[(N[(-2.0 * N[(F * N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $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]) / N[(N[Power[B, 2.0], $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$2 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(2.0 * t$95$2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -5e-214], (-N[(N[(N[Sqrt[N[(F * N[(A + N[(C - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision] / t$95$2), $MachinePrecision]), If[LessEqual[t$95$0, 0.0], N[(N[(t$95$3 * (-N[Sqrt[N[(F * N[(-0.5 * N[(N[(B * B), $MachinePrecision] / N[(A - C), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$0, Infinity], (-N[(N[Sqrt[N[(2.0 * N[(t$95$2 * N[(F * N[(C + N[(A - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision]), N[(N[(N[Sqrt[N[(N[(C * F), $MachinePrecision] * N[(A * -8.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + A), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$2), $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 := \frac{-\sqrt{\left(-2 \cdot \left(F \cdot \left(\left(4 \cdot A\right) \cdot C - {B}^{2}\right)\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{{B}^{2} + C \cdot \left(A \cdot -4\right)}\\
t_1 := \mathsf{hypot}\left(B, A - C\right)\\
t_2 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
t_3 := \sqrt{2 \cdot t_2}\\
\mathbf{if}\;t_0 \leq -5 \cdot 10^{-214}:\\
\;\;\;\;-\frac{\sqrt{F \cdot \left(A + \left(C - t_1\right)\right)} \cdot t_3}{t_2}\\
\mathbf{elif}\;t_0 \leq 0:\\
\;\;\;\;\frac{t_3 \cdot \left(-\sqrt{F \cdot \mathsf{fma}\left(-0.5, \frac{B \cdot B}{A - C}, 2 \cdot C\right)}\right)}{t_2}\\
\mathbf{elif}\;t_0 \leq \infty:\\
\;\;\;\;-\frac{\sqrt{2 \cdot \left(t_2 \cdot \left(F \cdot \left(C + \left(A - t_1\right)\right)\right)\right)}}{t_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\left(C \cdot F\right) \cdot \left(A \cdot -8\right)} \cdot \left(-\sqrt{A + A}\right)}{t_2}\\
\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))) < -4.9999999999999998e-214Initial program 41.0%
Simplified49.0%
[Start]41.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-rr65.2%
[Start]49.0 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right) \cdot \left(F \cdot \left(C - \left(\mathsf{hypot}\left(B, A - C\right) - A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
|---|---|
associate-*r* [=>]49.0 | \[ \frac{-\sqrt{\color{blue}{\left(2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)\right) \cdot \left(F \cdot \left(C - \left(\mathsf{hypot}\left(B, A - C\right) - A\right)\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
sqrt-prod [=>]65.2 | \[ \frac{-\color{blue}{\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \cdot \sqrt{F \cdot \left(C - \left(\mathsf{hypot}\left(B, A - C\right) - A\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
associate--r- [=>]65.2 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \cdot \sqrt{F \cdot \color{blue}{\left(\left(C - \mathsf{hypot}\left(B, A - C\right)\right) + A\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
+-commutative [=>]65.2 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \cdot \sqrt{F \cdot \color{blue}{\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)}
\] |
Simplified65.2%
[Start]65.2 | \[ \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 [=>]65.2 | \[ \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 [=>]65.2 | \[ \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)}
\] |
if -4.9999999999999998e-214 < (/.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 4.2%
Simplified8.6%
[Start]4.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-rr15.7%
[Start]8.6 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right) \cdot \left(F \cdot \left(C - \left(\mathsf{hypot}\left(B, A - C\right) - A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
|---|---|
associate-*r* [=>]8.6 | \[ \frac{-\sqrt{\color{blue}{\left(2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)\right) \cdot \left(F \cdot \left(C - \left(\mathsf{hypot}\left(B, A - C\right) - A\right)\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
sqrt-prod [=>]15.8 | \[ \frac{-\color{blue}{\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \cdot \sqrt{F \cdot \left(C - \left(\mathsf{hypot}\left(B, A - C\right) - A\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
associate--r- [=>]15.7 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \cdot \sqrt{F \cdot \color{blue}{\left(\left(C - \mathsf{hypot}\left(B, A - C\right)\right) + A\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
+-commutative [=>]15.7 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \cdot \sqrt{F \cdot \color{blue}{\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)}
\] |
Simplified15.7%
[Start]15.7 | \[ \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.7 | \[ \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.7 | \[ \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)}
\] |
Taylor expanded in B around 0 23.0%
Simplified23.0%
[Start]23.0 | \[ \frac{-\sqrt{F \cdot \left(-0.5 \cdot \frac{{B}^{2}}{A - C} + 2 \cdot C\right)} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
|---|---|
fma-def [=>]23.0 | \[ \frac{-\sqrt{F \cdot \color{blue}{\mathsf{fma}\left(-0.5, \frac{{B}^{2}}{A - C}, 2 \cdot C\right)}} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
unpow2 [=>]23.0 | \[ \frac{-\sqrt{F \cdot \mathsf{fma}\left(-0.5, \frac{\color{blue}{B \cdot B}}{A - C}, 2 \cdot C\right)} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\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 34.8%
Simplified55.9%
[Start]34.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}
\] |
|---|
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.4%
[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 C around inf 4.5%
Simplified4.6%
[Start]4.5 | \[ \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* [=>]4.6 | \[ \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 [=>]4.6 | \[ \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 [=>]4.6 | \[ \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 [=>]4.6 | \[ \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)}
\] |
Applied egg-rr4.7%
[Start]4.6 | \[ \frac{-\sqrt{\left(-8 \cdot A\right) \cdot \left(\left(F \cdot C\right) \cdot \left(A - \left(-A\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
associate-*r* [=>]4.6 | \[ \frac{-\sqrt{\color{blue}{\left(\left(-8 \cdot A\right) \cdot \left(F \cdot C\right)\right) \cdot \left(A - \left(-A\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
sqrt-prod [=>]4.7 | \[ \frac{-\color{blue}{\sqrt{\left(-8 \cdot A\right) \cdot \left(F \cdot C\right)} \cdot \sqrt{A - \left(-A\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
associate-*l* [=>]4.7 | \[ \frac{-\sqrt{\color{blue}{-8 \cdot \left(A \cdot \left(F \cdot C\right)\right)}} \cdot \sqrt{A - \left(-A\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
neg-mul-1 [=>]4.7 | \[ \frac{-\sqrt{-8 \cdot \left(A \cdot \left(F \cdot C\right)\right)} \cdot \sqrt{A - \color{blue}{-1 \cdot A}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
cancel-sign-sub-inv [=>]4.7 | \[ \frac{-\sqrt{-8 \cdot \left(A \cdot \left(F \cdot C\right)\right)} \cdot \sqrt{\color{blue}{A + \left(--1\right) \cdot A}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
metadata-eval [=>]4.7 | \[ \frac{-\sqrt{-8 \cdot \left(A \cdot \left(F \cdot C\right)\right)} \cdot \sqrt{A + \color{blue}{1} \cdot A}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
*-un-lft-identity [<=]4.7 | \[ \frac{-\sqrt{-8 \cdot \left(A \cdot \left(F \cdot C\right)\right)} \cdot \sqrt{A + \color{blue}{A}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
Simplified4.7%
[Start]4.7 | \[ \frac{-\sqrt{-8 \cdot \left(A \cdot \left(F \cdot C\right)\right)} \cdot \sqrt{A + A}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
*-commutative [=>]4.7 | \[ \frac{-\color{blue}{\sqrt{A + A} \cdot \sqrt{-8 \cdot \left(A \cdot \left(F \cdot C\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
associate-*r* [=>]4.7 | \[ \frac{-\sqrt{A + A} \cdot \sqrt{\color{blue}{\left(-8 \cdot A\right) \cdot \left(F \cdot C\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
*-commutative [=>]4.7 | \[ \frac{-\sqrt{A + A} \cdot \sqrt{\color{blue}{\left(A \cdot -8\right)} \cdot \left(F \cdot C\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
*-commutative [=>]4.7 | \[ \frac{-\sqrt{A + A} \cdot \sqrt{\left(A \cdot -8\right) \cdot \color{blue}{\left(C \cdot F\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
Final simplification32.5%
| Alternative 1 | |
|---|---|
| Accuracy | 29.8% |
| Cost | 34316 |
| Alternative 2 | |
|---|---|
| Accuracy | 30.4% |
| Cost | 34252 |
| Alternative 3 | |
|---|---|
| Accuracy | 28.6% |
| Cost | 34188 |
| Alternative 4 | |
|---|---|
| Accuracy | 26.1% |
| Cost | 27720 |
| Alternative 5 | |
|---|---|
| Accuracy | 26.0% |
| Cost | 27720 |
| Alternative 6 | |
|---|---|
| Accuracy | 21.2% |
| Cost | 27600 |
| Alternative 7 | |
|---|---|
| Accuracy | 22.9% |
| Cost | 27600 |
| Alternative 8 | |
|---|---|
| Accuracy | 19.6% |
| Cost | 27140 |
| Alternative 9 | |
|---|---|
| Accuracy | 26.0% |
| Cost | 21832 |
| Alternative 10 | |
|---|---|
| Accuracy | 18.0% |
| Cost | 21008 |
| Alternative 11 | |
|---|---|
| Accuracy | 17.5% |
| Cost | 21000 |
| Alternative 12 | |
|---|---|
| Accuracy | 17.4% |
| Cost | 20884 |
| Alternative 13 | |
|---|---|
| Accuracy | 23.4% |
| Cost | 15368 |
| Alternative 14 | |
|---|---|
| Accuracy | 13.1% |
| Cost | 14480 |
| Alternative 15 | |
|---|---|
| Accuracy | 14.1% |
| Cost | 14476 |
| Alternative 16 | |
|---|---|
| Accuracy | 14.0% |
| Cost | 14348 |
| Alternative 17 | |
|---|---|
| Accuracy | 17.6% |
| Cost | 14344 |
| Alternative 18 | |
|---|---|
| Accuracy | 13.2% |
| Cost | 8976 |
| Alternative 19 | |
|---|---|
| Accuracy | 13.1% |
| Cost | 8976 |
| Alternative 20 | |
|---|---|
| Accuracy | 11.9% |
| Cost | 8584 |
| Alternative 21 | |
|---|---|
| Accuracy | 12.7% |
| Cost | 8584 |
| Alternative 22 | |
|---|---|
| Accuracy | 8.6% |
| Cost | 8452 |
| Alternative 23 | |
|---|---|
| Accuracy | 2.8% |
| Cost | 7488 |
| Alternative 24 | |
|---|---|
| Accuracy | 3.8% |
| Cost | 6464 |
herbie shell --seed 2023138
(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))))