| Alternative 1 | |
|---|---|
| Error | 38.6 |
| 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 (fma B B (* A (* C -4.0))))
(t_2 (fma A (* C -4.0) (* B B)))
(t_3 (- (+ C A) t_0))
(t_4 (sqrt (* F t_3)))
(t_5 (+ A (- C t_0))))
(if (<= B -9e+44)
(* t_4 (/ (sqrt 2.0) B))
(if (<= B -2.65e-30)
(/ (* (sqrt (* F t_5)) (- (sqrt (* 2.0 t_1)))) t_1)
(if (<= B 3.35e-298)
(- (/ (sqrt (* 2.0 (* -4.0 (* (* C A) (* F (+ C C)))))) t_1))
(if (<= B 3.8e-222)
(/ (* (sqrt (* 2.0 (* F (* C A)))) (- (sqrt (* A -8.0)))) t_1)
(if (<= B 18.0)
(/
(- (sqrt (* (* t_5 (* F 2.0)) (+ (* -4.0 (* C A)) (* B B)))))
t_2)
(if (<= B 2.9e+48)
(- (/ (* (sqrt t_1) (sqrt (* t_3 (* F 2.0)))) t_2))
(* t_4 (/ (- (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 = fma(B, B, (A * (C * -4.0)));
double t_2 = fma(A, (C * -4.0), (B * B));
double t_3 = (C + A) - t_0;
double t_4 = sqrt((F * t_3));
double t_5 = A + (C - t_0);
double tmp;
if (B <= -9e+44) {
tmp = t_4 * (sqrt(2.0) / B);
} else if (B <= -2.65e-30) {
tmp = (sqrt((F * t_5)) * -sqrt((2.0 * t_1))) / t_1;
} else if (B <= 3.35e-298) {
tmp = -(sqrt((2.0 * (-4.0 * ((C * A) * (F * (C + C)))))) / t_1);
} else if (B <= 3.8e-222) {
tmp = (sqrt((2.0 * (F * (C * A)))) * -sqrt((A * -8.0))) / t_1;
} else if (B <= 18.0) {
tmp = -sqrt(((t_5 * (F * 2.0)) * ((-4.0 * (C * A)) + (B * B)))) / t_2;
} else if (B <= 2.9e+48) {
tmp = -((sqrt(t_1) * sqrt((t_3 * (F * 2.0)))) / t_2);
} else {
tmp = t_4 * (-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 = fma(B, B, Float64(A * Float64(C * -4.0))) t_2 = fma(A, Float64(C * -4.0), Float64(B * B)) t_3 = Float64(Float64(C + A) - t_0) t_4 = sqrt(Float64(F * t_3)) t_5 = Float64(A + Float64(C - t_0)) tmp = 0.0 if (B <= -9e+44) tmp = Float64(t_4 * Float64(sqrt(2.0) / B)); elseif (B <= -2.65e-30) tmp = Float64(Float64(sqrt(Float64(F * t_5)) * Float64(-sqrt(Float64(2.0 * t_1)))) / t_1); elseif (B <= 3.35e-298) tmp = Float64(-Float64(sqrt(Float64(2.0 * Float64(-4.0 * Float64(Float64(C * A) * Float64(F * Float64(C + C)))))) / t_1)); elseif (B <= 3.8e-222) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(C * A)))) * Float64(-sqrt(Float64(A * -8.0)))) / t_1); elseif (B <= 18.0) tmp = Float64(Float64(-sqrt(Float64(Float64(t_5 * Float64(F * 2.0)) * Float64(Float64(-4.0 * Float64(C * A)) + Float64(B * B))))) / t_2); elseif (B <= 2.9e+48) tmp = Float64(-Float64(Float64(sqrt(t_1) * sqrt(Float64(t_3 * Float64(F * 2.0)))) / t_2)); else tmp = Float64(t_4 * 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[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(A * N[(C * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(C + A), $MachinePrecision] - t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(F * t$95$3), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(A + N[(C - t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -9e+44], N[(t$95$4 * N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -2.65e-30], N[(N[(N[Sqrt[N[(F * t$95$5), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * t$95$1), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B, 3.35e-298], (-N[(N[Sqrt[N[(2.0 * N[(-4.0 * N[(N[(C * A), $MachinePrecision] * N[(F * N[(C + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]), If[LessEqual[B, 3.8e-222], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A * -8.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B, 18.0], N[((-N[Sqrt[N[(N[(t$95$5 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(-4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], If[LessEqual[B, 2.9e+48], (-N[(N[(N[Sqrt[t$95$1], $MachinePrecision] * N[Sqrt[N[(t$95$3 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), N[(t$95$4 * 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 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
t_2 := \mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)\\
t_3 := \left(C + A\right) - t_0\\
t_4 := \sqrt{F \cdot t_3}\\
t_5 := A + \left(C - t_0\right)\\
\mathbf{if}\;B \leq -9 \cdot 10^{+44}:\\
\;\;\;\;t_4 \cdot \frac{\sqrt{2}}{B}\\
\mathbf{elif}\;B \leq -2.65 \cdot 10^{-30}:\\
\;\;\;\;\frac{\sqrt{F \cdot t_5} \cdot \left(-\sqrt{2 \cdot t_1}\right)}{t_1}\\
\mathbf{elif}\;B \leq 3.35 \cdot 10^{-298}:\\
\;\;\;\;-\frac{\sqrt{2 \cdot \left(-4 \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(C + C\right)\right)\right)\right)}}{t_1}\\
\mathbf{elif}\;B \leq 3.8 \cdot 10^{-222}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C \cdot A\right)\right)} \cdot \left(-\sqrt{A \cdot -8}\right)}{t_1}\\
\mathbf{elif}\;B \leq 18:\\
\;\;\;\;\frac{-\sqrt{\left(t_5 \cdot \left(F \cdot 2\right)\right) \cdot \left(-4 \cdot \left(C \cdot A\right) + B \cdot B\right)}}{t_2}\\
\mathbf{elif}\;B \leq 2.9 \cdot 10^{+48}:\\
\;\;\;\;-\frac{\sqrt{t_1} \cdot \sqrt{t_3 \cdot \left(F \cdot 2\right)}}{t_2}\\
\mathbf{else}:\\
\;\;\;\;t_4 \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
if B < -9e44Initial program 57.9
Simplified56.3
[Start]57.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-rr51.1
Simplified51.1
[Start]51.1 | \[ \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 [=>]51.1 | \[ \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 [=>]51.1 | \[ \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-rr51.2
Simplified51.1
[Start]51.2 | \[ \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, -4 \cdot \left(A \cdot C\right)\right)}\right) \cdot \frac{1}{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}\right)
\] |
|---|---|
distribute-lft-neg-out [=>]51.2 | \[ \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, -4 \cdot \left(A \cdot C\right)\right)} \cdot \frac{1}{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}\right)}
\] |
associate-*r/ [=>]51.1 | \[ \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, -4 \cdot \left(A \cdot C\right)\right)} \cdot 1}{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}}\right)
\] |
*-rgt-identity [=>]51.1 | \[ \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, -4 \cdot \left(A \cdot C\right)\right)}}}{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}\right)
\] |
distribute-frac-neg [<=]51.1 | \[ \sqrt{F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \color{blue}{\frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}}
\] |
+-commutative [=>]51.1 | \[ \sqrt{F \cdot \left(\color{blue}{\left(C + A\right)} - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}
\] |
Taylor expanded in B around -inf 31.3
if -9e44 < B < -2.64999999999999987e-30Initial program 40.7
Simplified35.8
[Start]40.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-rr35.9
Simplified35.9
[Start]35.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 [=>]35.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 [=>]35.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)}
\] |
if -2.64999999999999987e-30 < B < 3.34999999999999989e-298Initial program 50.9
Simplified45.2
[Start]50.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}
\] |
|---|
Taylor expanded in A around inf 51.6
Simplified48.8
[Start]51.6 | \[ \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot \left(\left(C - -1 \cdot C\right) \cdot F\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
|---|---|
associate-*r* [=>]48.8 | \[ \frac{-\sqrt{2 \cdot \left(-4 \cdot \color{blue}{\left(\left(A \cdot C\right) \cdot \left(\left(C - -1 \cdot C\right) \cdot F\right)\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [=>]48.8 | \[ \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot \color{blue}{\left(F \cdot \left(C - -1 \cdot C\right)\right)}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
mul-1-neg [=>]48.8 | \[ \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(C - \color{blue}{\left(-C\right)}\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
if 3.34999999999999989e-298 < B < 3.79999999999999997e-222Initial program 52.6
Simplified47.0
[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}
\] |
|---|
Taylor expanded in C around inf 51.2
Simplified51.2
[Start]51.2 | \[ \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* [=>]51.2 | \[ \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 [=>]51.2 | \[ \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 [=>]51.2 | \[ \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 [=>]51.2 | \[ \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-rr49.6
Simplified49.6
[Start]49.6 | \[ \frac{-\sqrt{-8 \cdot A} \cdot \sqrt{F \cdot \left(C \cdot \left(A + A\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
|---|---|
*-commutative [=>]49.6 | \[ \frac{-\color{blue}{\sqrt{F \cdot \left(C \cdot \left(A + A\right)\right)} \cdot \sqrt{-8 \cdot A}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
associate-*r* [=>]51.0 | \[ \frac{-\sqrt{\color{blue}{\left(F \cdot C\right) \cdot \left(A + A\right)}} \cdot \sqrt{-8 \cdot A}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
distribute-rgt-out [<=]51.0 | \[ \frac{-\sqrt{\color{blue}{A \cdot \left(F \cdot C\right) + A \cdot \left(F \cdot C\right)}} \cdot \sqrt{-8 \cdot A}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
count-2 [=>]51.0 | \[ \frac{-\sqrt{\color{blue}{2 \cdot \left(A \cdot \left(F \cdot C\right)\right)}} \cdot \sqrt{-8 \cdot A}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [=>]51.0 | \[ \frac{-\sqrt{2 \cdot \color{blue}{\left(\left(F \cdot C\right) \cdot A\right)}} \cdot \sqrt{-8 \cdot A}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
associate-*l* [=>]49.6 | \[ \frac{-\sqrt{2 \cdot \color{blue}{\left(F \cdot \left(C \cdot A\right)\right)}} \cdot \sqrt{-8 \cdot A}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [<=]49.6 | \[ \frac{-\sqrt{2 \cdot \left(F \cdot \color{blue}{\left(A \cdot C\right)}\right)} \cdot \sqrt{-8 \cdot A}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [=>]49.6 | \[ \frac{-\sqrt{2 \cdot \left(F \cdot \left(A \cdot C\right)\right)} \cdot \sqrt{\color{blue}{A \cdot -8}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
if 3.79999999999999997e-222 < B < 18Initial program 47.8
Simplified41.9
[Start]47.8 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
|---|
Applied egg-rr41.9
if 18 < B < 2.8999999999999999e48Initial program 42.7
Simplified37.6
[Start]42.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-rr36.0
Simplified36.0
[Start]36.0 | \[ \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)} \cdot \sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}
\] |
|---|---|
unpow2 [<=]36.0 | \[ \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, \color{blue}{{B}^{2}}\right)} \cdot \sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}
\] |
fma-udef [=>]36.0 | \[ \frac{-\sqrt{\color{blue}{A \cdot \left(C \cdot -4\right) + {B}^{2}}} \cdot \sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}
\] |
associate-*l* [<=]36.0 | \[ \frac{-\sqrt{\color{blue}{\left(A \cdot C\right) \cdot -4} + {B}^{2}} \cdot \sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}
\] |
+-commutative [<=]36.0 | \[ \frac{-\sqrt{\color{blue}{{B}^{2} + \left(A \cdot C\right) \cdot -4}} \cdot \sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}
\] |
unpow2 [=>]36.0 | \[ \frac{-\sqrt{\color{blue}{B \cdot B} + \left(A \cdot C\right) \cdot -4} \cdot \sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}
\] |
fma-def [=>]36.0 | \[ \frac{-\sqrt{\color{blue}{\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)}} \cdot \sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}
\] |
associate-*l* [=>]36.0 | \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, \color{blue}{A \cdot \left(C \cdot -4\right)}\right)} \cdot \sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}
\] |
+-commutative [=>]36.0 | \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \sqrt{\left(\color{blue}{\left(C + A\right)} - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}
\] |
if 2.8999999999999999e48 < B Initial program 58.1
Simplified56.7
[Start]58.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-rr51.0
Simplified51.0
[Start]51.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 [=>]51.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 [=>]51.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-rr51.1
Simplified51.1
[Start]51.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, -4 \cdot \left(A \cdot C\right)\right)}\right) \cdot \frac{1}{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}\right)
\] |
|---|---|
distribute-lft-neg-out [=>]51.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, -4 \cdot \left(A \cdot C\right)\right)} \cdot \frac{1}{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}\right)}
\] |
associate-*r/ [=>]51.1 | \[ \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, -4 \cdot \left(A \cdot C\right)\right)} \cdot 1}{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}}\right)
\] |
*-rgt-identity [=>]51.1 | \[ \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, -4 \cdot \left(A \cdot C\right)\right)}}}{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}\right)
\] |
distribute-frac-neg [<=]51.1 | \[ \sqrt{F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \color{blue}{\frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}}
\] |
+-commutative [=>]51.1 | \[ \sqrt{F \cdot \left(\color{blue}{\left(C + A\right)} - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}
\] |
Taylor expanded in B around inf 30.6
Simplified30.6
[Start]30.6 | \[ \sqrt{F \cdot \left(\left(C + A\right) - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-1 \cdot \frac{\sqrt{2}}{B}\right)
\] |
|---|---|
associate-*r/ [=>]30.6 | \[ \sqrt{F \cdot \left(\left(C + A\right) - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}}
\] |
mul-1-neg [=>]30.6 | \[ \sqrt{F \cdot \left(\left(C + A\right) - \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \frac{\color{blue}{-\sqrt{2}}}{B}
\] |
Final simplification38.7
| Alternative 1 | |
|---|---|
| Error | 38.6 |
| Cost | 34648 |
| Alternative 2 | |
|---|---|
| Error | 38.7 |
| Cost | 34648 |
| Alternative 3 | |
|---|---|
| Error | 40.6 |
| Cost | 20876 |
| Alternative 4 | |
|---|---|
| Error | 40.1 |
| Cost | 20424 |
| Alternative 5 | |
|---|---|
| Error | 41.9 |
| Cost | 20228 |
| Alternative 6 | |
|---|---|
| Error | 48.1 |
| Cost | 15236 |
| Alternative 7 | |
|---|---|
| Error | 49.5 |
| Cost | 14608 |
| Alternative 8 | |
|---|---|
| Error | 49.3 |
| Cost | 14608 |
| Alternative 9 | |
|---|---|
| Error | 48.3 |
| Cost | 14472 |
| Alternative 10 | |
|---|---|
| Error | 50.1 |
| Cost | 14348 |
| Alternative 11 | |
|---|---|
| Error | 51.0 |
| Cost | 14216 |
| Alternative 12 | |
|---|---|
| Error | 50.8 |
| Cost | 13704 |
| Alternative 13 | |
|---|---|
| Error | 55.2 |
| Cost | 8848 |
| Alternative 14 | |
|---|---|
| Error | 55.7 |
| Cost | 8848 |
| Alternative 15 | |
|---|---|
| Error | 56.7 |
| Cost | 8584 |
| Alternative 16 | |
|---|---|
| Error | 56.5 |
| Cost | 8584 |
| Alternative 17 | |
|---|---|
| Error | 58.7 |
| Cost | 8452 |
| Alternative 18 | |
|---|---|
| Error | 60.4 |
| Cost | 8072 |
| Alternative 19 | |
|---|---|
| Error | 60.2 |
| Cost | 8072 |
| Alternative 20 | |
|---|---|
| Error | 61.2 |
| Cost | 6976 |
| Alternative 21 | |
|---|---|
| Error | 62.0 |
| Cost | 6848 |
herbie shell --seed 2023067
(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))))