| Alternative 1 | |
|---|---|
| Error | 43.0 |
| Cost | 34648 |
(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 (- (* B B) (* (* C A) 4.0)))
(t_2 (fma B B (* C (* -4.0 A))))
(t_3 (+ A (+ C t_0)))
(t_4 (fma -4.0 (* C A) (* B B)))
(t_5 (- (sqrt t_4)))
(t_6 (/ (* (sqrt (* (* 2.0 F) t_3)) t_5) t_4))
(t_7 (/ (* (* (sqrt (+ C (+ A t_0))) (sqrt (* 2.0 F))) t_5) t_4)))
(if (<= B -1.65e-178)
t_7
(if (<= B 1.25e-278)
(*
(sqrt (* (fma 2.0 C (* -0.5 (* B (/ B A)))) (* 2.0 (* F t_2))))
(/ 1.0 (- t_2)))
(if (<= B 2.2e-254)
t_6
(if (<= B 4.8e-220)
(sqrt (/ (- F) A))
(if (<= B 5.2e-127)
(/ (- (sqrt (* 2.0 (* t_2 (* F t_3))))) t_2)
(if (<= B 8.8e-95)
t_6
(if (<= B 8.5e-20)
(/ (* (sqrt t_3) (- (sqrt (* 2.0 (* F t_1))))) t_1)
(if (<= B 1.15e+16)
(/
(-
(sqrt
(*
2.0
(* t_2 (* F (fma 2.0 A (* -0.5 (/ (* B B) C))))))))
t_2)
(if (<= B 9.5e+153)
t_7
(* (sqrt (/ F B)) (- (sqrt 2.0))))))))))))))double code(double A, double B, double C, double F) {
return -sqrt(((2.0 * ((pow(B, 2.0) - ((4.0 * A) * C)) * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / (pow(B, 2.0) - ((4.0 * A) * C));
}
double code(double A, double B, double C, double F) {
double t_0 = hypot(B, (A - C));
double t_1 = (B * B) - ((C * A) * 4.0);
double t_2 = fma(B, B, (C * (-4.0 * A)));
double t_3 = A + (C + t_0);
double t_4 = fma(-4.0, (C * A), (B * B));
double t_5 = -sqrt(t_4);
double t_6 = (sqrt(((2.0 * F) * t_3)) * t_5) / t_4;
double t_7 = ((sqrt((C + (A + t_0))) * sqrt((2.0 * F))) * t_5) / t_4;
double tmp;
if (B <= -1.65e-178) {
tmp = t_7;
} else if (B <= 1.25e-278) {
tmp = sqrt((fma(2.0, C, (-0.5 * (B * (B / A)))) * (2.0 * (F * t_2)))) * (1.0 / -t_2);
} else if (B <= 2.2e-254) {
tmp = t_6;
} else if (B <= 4.8e-220) {
tmp = sqrt((-F / A));
} else if (B <= 5.2e-127) {
tmp = -sqrt((2.0 * (t_2 * (F * t_3)))) / t_2;
} else if (B <= 8.8e-95) {
tmp = t_6;
} else if (B <= 8.5e-20) {
tmp = (sqrt(t_3) * -sqrt((2.0 * (F * t_1)))) / t_1;
} else if (B <= 1.15e+16) {
tmp = -sqrt((2.0 * (t_2 * (F * fma(2.0, A, (-0.5 * ((B * B) / C))))))) / t_2;
} else if (B <= 9.5e+153) {
tmp = t_7;
} else {
tmp = sqrt((F / B)) * -sqrt(2.0);
}
return tmp;
}
function code(A, B, C, F) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))) end
function code(A, B, C, F) t_0 = hypot(B, Float64(A - C)) t_1 = Float64(Float64(B * B) - Float64(Float64(C * A) * 4.0)) t_2 = fma(B, B, Float64(C * Float64(-4.0 * A))) t_3 = Float64(A + Float64(C + t_0)) t_4 = fma(-4.0, Float64(C * A), Float64(B * B)) t_5 = Float64(-sqrt(t_4)) t_6 = Float64(Float64(sqrt(Float64(Float64(2.0 * F) * t_3)) * t_5) / t_4) t_7 = Float64(Float64(Float64(sqrt(Float64(C + Float64(A + t_0))) * sqrt(Float64(2.0 * F))) * t_5) / t_4) tmp = 0.0 if (B <= -1.65e-178) tmp = t_7; elseif (B <= 1.25e-278) tmp = Float64(sqrt(Float64(fma(2.0, C, Float64(-0.5 * Float64(B * Float64(B / A)))) * Float64(2.0 * Float64(F * t_2)))) * Float64(1.0 / Float64(-t_2))); elseif (B <= 2.2e-254) tmp = t_6; elseif (B <= 4.8e-220) tmp = sqrt(Float64(Float64(-F) / A)); elseif (B <= 5.2e-127) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_2 * Float64(F * t_3))))) / t_2); elseif (B <= 8.8e-95) tmp = t_6; elseif (B <= 8.5e-20) tmp = Float64(Float64(sqrt(t_3) * Float64(-sqrt(Float64(2.0 * Float64(F * t_1))))) / t_1); elseif (B <= 1.15e+16) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_2 * Float64(F * fma(2.0, A, Float64(-0.5 * Float64(Float64(B * B) / C)))))))) / t_2); elseif (B <= 9.5e+153) tmp = t_7; else tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0))); end return tmp end
code[A_, B_, C_, F_] := N[((-N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[A_, B_, C_, F_] := Block[{t$95$0 = N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(B * B + N[(C * N[(-4.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(A + N[(C + t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(-4.0 * N[(C * A), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = (-N[Sqrt[t$95$4], $MachinePrecision])}, Block[{t$95$6 = N[(N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * t$95$3), $MachinePrecision]], $MachinePrecision] * t$95$5), $MachinePrecision] / t$95$4), $MachinePrecision]}, Block[{t$95$7 = N[(N[(N[(N[Sqrt[N[(C + N[(A + t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$5), $MachinePrecision] / t$95$4), $MachinePrecision]}, If[LessEqual[B, -1.65e-178], t$95$7, If[LessEqual[B, 1.25e-278], N[(N[Sqrt[N[(N[(2.0 * C + N[(-0.5 * N[(B * N[(B / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(F * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / (-t$95$2)), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.2e-254], t$95$6, If[LessEqual[B, 4.8e-220], N[Sqrt[N[((-F) / A), $MachinePrecision]], $MachinePrecision], If[LessEqual[B, 5.2e-127], N[((-N[Sqrt[N[(2.0 * N[(t$95$2 * N[(F * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], If[LessEqual[B, 8.8e-95], t$95$6, If[LessEqual[B, 8.5e-20], N[(N[(N[Sqrt[t$95$3], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B, 1.15e+16], N[((-N[Sqrt[N[(2.0 * N[(t$95$2 * N[(F * N[(2.0 * A + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], If[LessEqual[B, 9.5e+153], t$95$7, N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]]]]]]]]]]]]]]]]
\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\begin{array}{l}
t_0 := \mathsf{hypot}\left(B, A - C\right)\\
t_1 := B \cdot B - \left(C \cdot A\right) \cdot 4\\
t_2 := \mathsf{fma}\left(B, B, C \cdot \left(-4 \cdot A\right)\right)\\
t_3 := A + \left(C + t_0\right)\\
t_4 := \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\\
t_5 := -\sqrt{t_4}\\
t_6 := \frac{\sqrt{\left(2 \cdot F\right) \cdot t_3} \cdot t_5}{t_4}\\
t_7 := \frac{\left(\sqrt{C + \left(A + t_0\right)} \cdot \sqrt{2 \cdot F}\right) \cdot t_5}{t_4}\\
\mathbf{if}\;B \leq -1.65 \cdot 10^{-178}:\\
\;\;\;\;t_7\\
\mathbf{elif}\;B \leq 1.25 \cdot 10^{-278}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(2, C, -0.5 \cdot \left(B \cdot \frac{B}{A}\right)\right) \cdot \left(2 \cdot \left(F \cdot t_2\right)\right)} \cdot \frac{1}{-t_2}\\
\mathbf{elif}\;B \leq 2.2 \cdot 10^{-254}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;B \leq 4.8 \cdot 10^{-220}:\\
\;\;\;\;\sqrt{\frac{-F}{A}}\\
\mathbf{elif}\;B \leq 5.2 \cdot 10^{-127}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_2 \cdot \left(F \cdot t_3\right)\right)}}{t_2}\\
\mathbf{elif}\;B \leq 8.8 \cdot 10^{-95}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;B \leq 8.5 \cdot 10^{-20}:\\
\;\;\;\;\frac{\sqrt{t_3} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_1\right)}\right)}{t_1}\\
\mathbf{elif}\;B \leq 1.15 \cdot 10^{+16}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_2 \cdot \left(F \cdot \mathsf{fma}\left(2, A, -0.5 \cdot \frac{B \cdot B}{C}\right)\right)\right)}}{t_2}\\
\mathbf{elif}\;B \leq 9.5 \cdot 10^{+153}:\\
\;\;\;\;t_7\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\
\end{array}
if B < -1.6500000000000001e-178 or 1.15e16 < B < 9.4999999999999995e153Initial program 52.0
Simplified48.4
[Start]52.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-rr44.7
Simplified44.4
[Start]44.7 | \[ \frac{-\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)} \cdot \sqrt{\left(F \cdot 2\right) \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
|---|---|
*-commutative [=>]44.7 | \[ \frac{-\sqrt{\mathsf{fma}\left(-4, \color{blue}{C \cdot A}, B \cdot B\right)} \cdot \sqrt{\left(F \cdot 2\right) \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
*-commutative [=>]44.7 | \[ \frac{-\sqrt{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{\color{blue}{\left(2 \cdot F\right)} \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
+-commutative [=>]44.7 | \[ \frac{-\sqrt{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{\left(2 \cdot F\right) \cdot \color{blue}{\left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)\right)}}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
associate-+r+ [<=]44.4 | \[ \frac{-\sqrt{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{\left(2 \cdot F\right) \cdot \color{blue}{\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
Applied egg-rr41.5
if -1.6500000000000001e-178 < B < 1.24999999999999996e-278Initial program 53.6
Simplified53.6
[Start]53.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-rr44.7
Simplified44.7
[Start]44.7 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right) \cdot F\right)} \cdot \sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
|---|---|
*-commutative [=>]44.7 | \[ \frac{-\color{blue}{\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right) \cdot F\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
*-commutative [=>]44.7 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \color{blue}{\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
Taylor expanded in F around 0 44.7
Simplified44.7
[Start]44.7 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(\left({B}^{2} + -4 \cdot \left(A \cdot C\right)\right) \cdot F\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
|---|---|
*-commutative [=>]44.7 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \color{blue}{\left(F \cdot \left({B}^{2} + -4 \cdot \left(A \cdot C\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
unpow2 [=>]44.7 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(F \cdot \left(\color{blue}{B \cdot B} + -4 \cdot \left(A \cdot C\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
*-commutative [=>]44.7 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \color{blue}{\left(C \cdot A\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
Taylor expanded in A around -inf 49.5
Simplified49.5
[Start]49.5 | \[ \frac{-\sqrt{2 \cdot C + -0.5 \cdot \frac{{B}^{2}}{A}} \cdot \sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(C \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
|---|---|
fma-def [=>]49.5 | \[ \frac{-\sqrt{\color{blue}{\mathsf{fma}\left(2, C, -0.5 \cdot \frac{{B}^{2}}{A}\right)}} \cdot \sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(C \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
unpow2 [=>]49.5 | \[ \frac{-\sqrt{\mathsf{fma}\left(2, C, -0.5 \cdot \frac{\color{blue}{B \cdot B}}{A}\right)} \cdot \sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(C \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
associate-/l* [=>]49.5 | \[ \frac{-\sqrt{\mathsf{fma}\left(2, C, -0.5 \cdot \color{blue}{\frac{B}{\frac{A}{B}}}\right)} \cdot \sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(C \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
Applied egg-rr49.0
if 1.24999999999999996e-278 < B < 2.2000000000000001e-254 or 5.19999999999999982e-127 < B < 8.7999999999999995e-95Initial program 51.1
Simplified43.7
[Start]51.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-rr49.1
Simplified48.3
[Start]49.1 | \[ \frac{-\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)} \cdot \sqrt{\left(F \cdot 2\right) \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
|---|---|
*-commutative [=>]49.1 | \[ \frac{-\sqrt{\mathsf{fma}\left(-4, \color{blue}{C \cdot A}, B \cdot B\right)} \cdot \sqrt{\left(F \cdot 2\right) \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
*-commutative [=>]49.1 | \[ \frac{-\sqrt{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{\color{blue}{\left(2 \cdot F\right)} \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
+-commutative [=>]49.1 | \[ \frac{-\sqrt{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{\left(2 \cdot F\right) \cdot \color{blue}{\left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)\right)}}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
associate-+r+ [<=]48.3 | \[ \frac{-\sqrt{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{\left(2 \cdot F\right) \cdot \color{blue}{\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
if 2.2000000000000001e-254 < B < 4.8000000000000003e-220Initial program 52.6
Simplified46.7
[Start]52.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-rr58.0
Simplified57.1
[Start]58.0 | \[ \sqrt{\frac{2 \cdot \left(\left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot F\right)\right)}{{\left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right)}^{2}}}
\] |
|---|---|
associate-*r* [=>]58.0 | \[ \sqrt{\frac{\color{blue}{\left(2 \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right) \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot F\right)}}{{\left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right)}^{2}}}
\] |
associate-/l* [=>]57.1 | \[ \sqrt{\color{blue}{\frac{2 \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)}{\frac{{\left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right)}^{2}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot F}}}}
\] |
*-commutative [=>]57.1 | \[ \sqrt{\frac{2 \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)}{\frac{{\left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right)}^{2}}{\color{blue}{F \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}}}
\] |
Taylor expanded in C around inf 50.7
Simplified50.7
[Start]50.7 | \[ \sqrt{-1 \cdot \frac{F}{A}}
\] |
|---|---|
associate-*r/ [=>]50.7 | \[ \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}}
\] |
neg-mul-1 [<=]50.7 | \[ \sqrt{\frac{\color{blue}{-F}}{A}}
\] |
if 4.8000000000000003e-220 < B < 5.19999999999999982e-127Initial program 51.5
Simplified45.5
[Start]51.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}
\] |
|---|
if 8.7999999999999995e-95 < B < 8.5000000000000005e-20Initial program 47.2
Simplified47.2
[Start]47.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-rr36.6
Simplified36.6
[Start]36.6 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right) \cdot F\right)} \cdot \sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
|---|---|
*-commutative [=>]36.6 | \[ \frac{-\color{blue}{\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right) \cdot F\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
*-commutative [=>]36.6 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \color{blue}{\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
Taylor expanded in F around 0 36.6
Simplified36.6
[Start]36.6 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(\left({B}^{2} + -4 \cdot \left(A \cdot C\right)\right) \cdot F\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
|---|---|
*-commutative [=>]36.6 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \color{blue}{\left(F \cdot \left({B}^{2} + -4 \cdot \left(A \cdot C\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
unpow2 [=>]36.6 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(F \cdot \left(\color{blue}{B \cdot B} + -4 \cdot \left(A \cdot C\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
*-commutative [=>]36.6 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \color{blue}{\left(C \cdot A\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
if 8.5000000000000005e-20 < B < 1.15e16Initial program 37.8
Simplified32.8
[Start]37.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}
\] |
|---|
Taylor expanded in C around -inf 52.9
Simplified52.9
[Start]52.9 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot \left(F \cdot \left(2 \cdot A + -0.5 \cdot \frac{{B}^{2}}{C}\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
|---|---|
fma-def [=>]52.9 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot \left(F \cdot \color{blue}{\mathsf{fma}\left(2, A, -0.5 \cdot \frac{{B}^{2}}{C}\right)}\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
unpow2 [=>]52.9 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot \left(F \cdot \mathsf{fma}\left(2, A, -0.5 \cdot \frac{\color{blue}{B \cdot B}}{C}\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
if 9.4999999999999995e153 < B Initial program 64.0
Simplified64.0
[Start]64.0 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
|---|
Taylor expanded in B around inf 64.0
Simplified64.0
[Start]64.0 | \[ \frac{-\sqrt{2 \cdot \left(F \cdot {B}^{3}\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
|---|---|
associate-*r* [=>]64.0 | \[ \frac{-\sqrt{\color{blue}{\left(2 \cdot F\right) \cdot {B}^{3}}}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
Taylor expanded in A around 0 30.6
Simplified30.6
[Start]30.6 | \[ -1 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{B}}\right)
\] |
|---|---|
mul-1-neg [=>]30.6 | \[ \color{blue}{-\sqrt{2} \cdot \sqrt{\frac{F}{B}}}
\] |
*-commutative [=>]30.6 | \[ -\color{blue}{\sqrt{\frac{F}{B}} \cdot \sqrt{2}}
\] |
distribute-rgt-neg-in [=>]30.6 | \[ \color{blue}{\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)}
\] |
Final simplification42.0
| Alternative 1 | |
|---|---|
| Error | 43.0 |
| Cost | 34648 |
| Alternative 2 | |
|---|---|
| Error | 42.0 |
| Cost | 28180 |
| Alternative 3 | |
|---|---|
| Error | 44.1 |
| Cost | 27736 |
| Alternative 4 | |
|---|---|
| Error | 42.0 |
| Cost | 27472 |
| Alternative 5 | |
|---|---|
| Error | 43.5 |
| Cost | 21841 |
| Alternative 6 | |
|---|---|
| Error | 43.4 |
| Cost | 21709 |
| Alternative 7 | |
|---|---|
| Error | 45.1 |
| Cost | 21516 |
| Alternative 8 | |
|---|---|
| Error | 46.1 |
| Cost | 21332 |
| Alternative 9 | |
|---|---|
| Error | 45.8 |
| Cost | 21200 |
| Alternative 10 | |
|---|---|
| Error | 47.3 |
| Cost | 21004 |
| Alternative 11 | |
|---|---|
| Error | 48.9 |
| Cost | 15384 |
| Alternative 12 | |
|---|---|
| Error | 47.6 |
| Cost | 15308 |
| Alternative 13 | |
|---|---|
| Error | 48.4 |
| Cost | 15120 |
| Alternative 14 | |
|---|---|
| Error | 50.9 |
| Cost | 13976 |
| Alternative 15 | |
|---|---|
| Error | 51.5 |
| Cost | 13188 |
| Alternative 16 | |
|---|---|
| Error | 52.6 |
| Cost | 9240 |
| Alternative 17 | |
|---|---|
| Error | 52.5 |
| Cost | 9112 |
| Alternative 18 | |
|---|---|
| Error | 52.6 |
| Cost | 9112 |
| Alternative 19 | |
|---|---|
| Error | 52.7 |
| Cost | 8848 |
| Alternative 20 | |
|---|---|
| Error | 52.7 |
| Cost | 8336 |
| Alternative 21 | |
|---|---|
| Error | 54.1 |
| Cost | 7053 |
| Alternative 22 | |
|---|---|
| Error | 56.7 |
| Cost | 6656 |
| Alternative 23 | |
|---|---|
| Error | 63.2 |
| Cost | 6592 |
herbie shell --seed 2023066
(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))))