| Alternative 1 | |
|---|---|
| Error | 34.1 |
| Cost | 34132 |
(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 (sqrt (+ A (+ C t_0))))
(t_2 (- (sqrt F)))
(t_3 (/ (sqrt 2.0) B))
(t_4 (fma B B (* C (* A -4.0))))
(t_5 (* -4.0 (* A C)))
(t_6 (+ A (hypot B A))))
(if (<= B -1.45e+112)
(* t_3 (* (sqrt t_6) (sqrt F)))
(if (<= B -6e-88)
(/ (* (sqrt (* 2.0 t_4)) (* t_1 t_2)) t_4)
(if (<= B -1.65e-190)
(sqrt (/ (- F) C))
(if (<= B -1.05e-291)
(/
(*
(sqrt (* 2.0 (+ C (+ A t_0))))
(- (sqrt (* F (* A (* C -4.0))))))
(fma -4.0 (* A C) (* B B)))
(if (<= B 4e-206)
(sqrt (- (/ F A)))
(if (<= B 2.3e+32)
(/
(- (* t_1 (sqrt (* 2.0 (* F (fma B B t_5))))))
(+ (* B B) t_5))
(if (<= B 3.6e+157)
(* (sqrt (+ t_0 (+ A C))) (/ B (/ t_4 (* (sqrt 2.0) t_2))))
(* t_3 (- (sqrt (* t_6 F)))))))))))))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 = sqrt((A + (C + t_0)));
double t_2 = -sqrt(F);
double t_3 = sqrt(2.0) / B;
double t_4 = fma(B, B, (C * (A * -4.0)));
double t_5 = -4.0 * (A * C);
double t_6 = A + hypot(B, A);
double tmp;
if (B <= -1.45e+112) {
tmp = t_3 * (sqrt(t_6) * sqrt(F));
} else if (B <= -6e-88) {
tmp = (sqrt((2.0 * t_4)) * (t_1 * t_2)) / t_4;
} else if (B <= -1.65e-190) {
tmp = sqrt((-F / C));
} else if (B <= -1.05e-291) {
tmp = (sqrt((2.0 * (C + (A + t_0)))) * -sqrt((F * (A * (C * -4.0))))) / fma(-4.0, (A * C), (B * B));
} else if (B <= 4e-206) {
tmp = sqrt(-(F / A));
} else if (B <= 2.3e+32) {
tmp = -(t_1 * sqrt((2.0 * (F * fma(B, B, t_5))))) / ((B * B) + t_5);
} else if (B <= 3.6e+157) {
tmp = sqrt((t_0 + (A + C))) * (B / (t_4 / (sqrt(2.0) * t_2)));
} else {
tmp = t_3 * -sqrt((t_6 * F));
}
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 = sqrt(Float64(A + Float64(C + t_0))) t_2 = Float64(-sqrt(F)) t_3 = Float64(sqrt(2.0) / B) t_4 = fma(B, B, Float64(C * Float64(A * -4.0))) t_5 = Float64(-4.0 * Float64(A * C)) t_6 = Float64(A + hypot(B, A)) tmp = 0.0 if (B <= -1.45e+112) tmp = Float64(t_3 * Float64(sqrt(t_6) * sqrt(F))); elseif (B <= -6e-88) tmp = Float64(Float64(sqrt(Float64(2.0 * t_4)) * Float64(t_1 * t_2)) / t_4); elseif (B <= -1.65e-190) tmp = sqrt(Float64(Float64(-F) / C)); elseif (B <= -1.05e-291) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(C + Float64(A + t_0)))) * Float64(-sqrt(Float64(F * Float64(A * Float64(C * -4.0)))))) / fma(-4.0, Float64(A * C), Float64(B * B))); elseif (B <= 4e-206) tmp = sqrt(Float64(-Float64(F / A))); elseif (B <= 2.3e+32) tmp = Float64(Float64(-Float64(t_1 * sqrt(Float64(2.0 * Float64(F * fma(B, B, t_5)))))) / Float64(Float64(B * B) + t_5)); elseif (B <= 3.6e+157) tmp = Float64(sqrt(Float64(t_0 + Float64(A + C))) * Float64(B / Float64(t_4 / Float64(sqrt(2.0) * t_2)))); else tmp = Float64(t_3 * Float64(-sqrt(Float64(t_6 * F)))); 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[Sqrt[N[(A + N[(C + t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = (-N[Sqrt[F], $MachinePrecision])}, Block[{t$95$3 = N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$4 = N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -1.45e+112], N[(t$95$3 * N[(N[Sqrt[t$95$6], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -6e-88], N[(N[(N[Sqrt[N[(2.0 * t$95$4), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision], If[LessEqual[B, -1.65e-190], N[Sqrt[N[((-F) / C), $MachinePrecision]], $MachinePrecision], If[LessEqual[B, -1.05e-291], N[(N[(N[Sqrt[N[(2.0 * N[(C + N[(A + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(F * N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(-4.0 * N[(A * C), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4e-206], N[Sqrt[(-N[(F / A), $MachinePrecision])], $MachinePrecision], If[LessEqual[B, 2.3e+32], N[((-N[(t$95$1 * N[Sqrt[N[(2.0 * N[(F * N[(B * B + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3.6e+157], N[(N[Sqrt[N[(t$95$0 + N[(A + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(B / N[(t$95$4 / N[(N[Sqrt[2.0], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * (-N[Sqrt[N[(t$95$6 * F), $MachinePrecision]], $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 := \sqrt{A + \left(C + t_0\right)}\\
t_2 := -\sqrt{F}\\
t_3 := \frac{\sqrt{2}}{B}\\
t_4 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
t_5 := -4 \cdot \left(A \cdot C\right)\\
t_6 := A + \mathsf{hypot}\left(B, A\right)\\
\mathbf{if}\;B \leq -1.45 \cdot 10^{+112}:\\
\;\;\;\;t_3 \cdot \left(\sqrt{t_6} \cdot \sqrt{F}\right)\\
\mathbf{elif}\;B \leq -6 \cdot 10^{-88}:\\
\;\;\;\;\frac{\sqrt{2 \cdot t_4} \cdot \left(t_1 \cdot t_2\right)}{t_4}\\
\mathbf{elif}\;B \leq -1.65 \cdot 10^{-190}:\\
\;\;\;\;\sqrt{\frac{-F}{C}}\\
\mathbf{elif}\;B \leq -1.05 \cdot 10^{-291}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(C + \left(A + t_0\right)\right)} \cdot \left(-\sqrt{F \cdot \left(A \cdot \left(C \cdot -4\right)\right)}\right)}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}\\
\mathbf{elif}\;B \leq 4 \cdot 10^{-206}:\\
\;\;\;\;\sqrt{-\frac{F}{A}}\\
\mathbf{elif}\;B \leq 2.3 \cdot 10^{+32}:\\
\;\;\;\;\frac{-t_1 \cdot \sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, t_5\right)\right)}}{B \cdot B + t_5}\\
\mathbf{elif}\;B \leq 3.6 \cdot 10^{+157}:\\
\;\;\;\;\sqrt{t_0 + \left(A + C\right)} \cdot \frac{B}{\frac{t_4}{\sqrt{2} \cdot t_2}}\\
\mathbf{else}:\\
\;\;\;\;t_3 \cdot \left(-\sqrt{t_6 \cdot F}\right)\\
\end{array}
if B < -1.4500000000000001e112Initial program 61.4
Simplified61.0
[Start]61.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}
\] |
|---|
Applied egg-rr63.8
Simplified63.6
[Start]63.8 | \[ \sqrt{\frac{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right) \cdot \left(\left(F \cdot 2\right) \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)\right)}{{\left(\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)\right)}^{2}}}
\] |
|---|---|
associate-/l* [=>]63.6 | \[ \sqrt{\color{blue}{\frac{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}{\frac{{\left(\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)\right)}^{2}}{\left(F \cdot 2\right) \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}}}
\] |
*-commutative [=>]63.6 | \[ \sqrt{\frac{\mathsf{fma}\left(-4, \color{blue}{C \cdot A}, B \cdot B\right)}{\frac{{\left(\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)\right)}^{2}}{\left(F \cdot 2\right) \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}}
\] |
*-commutative [=>]63.6 | \[ \sqrt{\frac{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}{\frac{{\left(\mathsf{fma}\left(-4, \color{blue}{C \cdot A}, B \cdot B\right)\right)}^{2}}{\left(F \cdot 2\right) \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}}
\] |
*-commutative [=>]63.6 | \[ \sqrt{\frac{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}{\frac{{\left(\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}^{2}}{\color{blue}{\left(2 \cdot F\right)} \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}}
\] |
+-commutative [=>]63.6 | \[ \sqrt{\frac{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}{\frac{{\left(\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}^{2}}{\left(2 \cdot F\right) \cdot \color{blue}{\left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)\right)}}}}
\] |
+-commutative [=>]63.6 | \[ \sqrt{\frac{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}{\frac{{\left(\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}^{2}}{\left(2 \cdot F\right) \cdot \left(\color{blue}{\left(C + A\right)} + \mathsf{hypot}\left(B, A - C\right)\right)}}}
\] |
Taylor expanded in C around 0 58.8
Simplified58.8
[Start]58.8 | \[ \frac{\sqrt{2}}{B} \cdot \sqrt{\left(A + \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}
\] |
|---|---|
unpow2 [=>]58.8 | \[ \frac{\sqrt{2}}{B} \cdot \sqrt{\left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right) \cdot F}
\] |
unpow2 [=>]58.8 | \[ \frac{\sqrt{2}}{B} \cdot \sqrt{\left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right) \cdot F}
\] |
Applied egg-rr13.8
if -1.4500000000000001e112 < B < -5.9999999999999999e-88Initial program 44.8
Simplified40.6
[Start]44.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-rr37.3
Simplified37.0
[Start]37.3 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{F \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
|---|---|
*-commutative [=>]37.3 | \[ \frac{-\color{blue}{\sqrt{F \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(C + A\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+ [=>]37.0 | \[ \frac{-\sqrt{F \cdot \color{blue}{\left(\left(\mathsf{hypot}\left(B, A - C\right) + C\right) + A\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 [<=]37.0 | \[ \frac{-\sqrt{F \cdot \left(\color{blue}{\left(C + \mathsf{hypot}\left(B, A - C\right)\right)} + A\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+ [=>]37.0 | \[ \frac{-\sqrt{F \cdot \color{blue}{\left(C + \left(\mathsf{hypot}\left(B, A - C\right) + A\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-rr32.9
Simplified32.5
[Start]32.9 | \[ \frac{-\left(\sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)} \cdot \sqrt{F}\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+ [=>]32.5 | \[ \frac{-\left(\sqrt{\color{blue}{\left(\mathsf{hypot}\left(B, A - C\right) + C\right) + A}} \cdot \sqrt{F}\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 [=>]32.5 | \[ \frac{-\left(\sqrt{\color{blue}{A + \left(\mathsf{hypot}\left(B, A - C\right) + C\right)}} \cdot \sqrt{F}\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 [=>]32.5 | \[ \frac{-\left(\sqrt{A + \color{blue}{\left(C + \mathsf{hypot}\left(B, A - C\right)\right)}} \cdot \sqrt{F}\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 -5.9999999999999999e-88 < B < -1.65000000000000009e-190Initial program 50.2
Simplified44.4
[Start]50.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-rr58.9
Simplified58.8
[Start]58.9 | \[ \sqrt{\frac{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right) \cdot \left(\left(F \cdot 2\right) \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)\right)}{{\left(\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)\right)}^{2}}}
\] |
|---|---|
associate-/l* [=>]58.8 | \[ \sqrt{\color{blue}{\frac{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}{\frac{{\left(\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)\right)}^{2}}{\left(F \cdot 2\right) \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}}}
\] |
*-commutative [=>]58.8 | \[ \sqrt{\frac{\mathsf{fma}\left(-4, \color{blue}{C \cdot A}, B \cdot B\right)}{\frac{{\left(\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)\right)}^{2}}{\left(F \cdot 2\right) \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}}
\] |
*-commutative [=>]58.8 | \[ \sqrt{\frac{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}{\frac{{\left(\mathsf{fma}\left(-4, \color{blue}{C \cdot A}, B \cdot B\right)\right)}^{2}}{\left(F \cdot 2\right) \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}}
\] |
*-commutative [=>]58.8 | \[ \sqrt{\frac{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}{\frac{{\left(\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}^{2}}{\color{blue}{\left(2 \cdot F\right)} \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}}
\] |
+-commutative [=>]58.8 | \[ \sqrt{\frac{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}{\frac{{\left(\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}^{2}}{\left(2 \cdot F\right) \cdot \color{blue}{\left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)\right)}}}}
\] |
+-commutative [=>]58.8 | \[ \sqrt{\frac{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}{\frac{{\left(\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}^{2}}{\left(2 \cdot F\right) \cdot \left(\color{blue}{\left(C + A\right)} + \mathsf{hypot}\left(B, A - C\right)\right)}}}
\] |
Taylor expanded in C around -inf 53.5
Simplified53.5
[Start]53.5 | \[ \sqrt{-1 \cdot \frac{F}{C}}
\] |
|---|---|
mul-1-neg [=>]53.5 | \[ \sqrt{\color{blue}{-\frac{F}{C}}}
\] |
if -1.65000000000000009e-190 < B < -1.05e-291Initial program 50.7
Simplified45.5
[Start]50.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}
\] |
|---|
Taylor expanded in A around inf 47.3
Simplified45.5
[Start]47.3 | \[ \frac{-\sqrt{\left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
|---|---|
associate-*r* [=>]45.5 | \[ \frac{-\sqrt{\left(-4 \cdot \color{blue}{\left(\left(A \cdot C\right) \cdot F\right)}\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
associate-*l* [<=]45.5 | \[ \frac{-\sqrt{\color{blue}{\left(\left(-4 \cdot \left(A \cdot C\right)\right) \cdot F\right)} \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
*-commutative [<=]45.5 | \[ \frac{-\sqrt{\color{blue}{\left(F \cdot \left(-4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
*-commutative [=>]45.5 | \[ \frac{-\sqrt{\left(F \cdot \left(-4 \cdot \color{blue}{\left(C \cdot A\right)}\right)\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
Applied egg-rr42.3
if -1.05e-291 < B < 4.00000000000000011e-206Initial 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.1
Simplified58.0
[Start]58.1 | \[ \sqrt{\frac{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right) \cdot \left(\left(F \cdot 2\right) \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)\right)}{{\left(\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)\right)}^{2}}}
\] |
|---|---|
associate-/l* [=>]58.0 | \[ \sqrt{\color{blue}{\frac{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}{\frac{{\left(\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)\right)}^{2}}{\left(F \cdot 2\right) \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}}}
\] |
*-commutative [=>]58.0 | \[ \sqrt{\frac{\mathsf{fma}\left(-4, \color{blue}{C \cdot A}, B \cdot B\right)}{\frac{{\left(\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)\right)}^{2}}{\left(F \cdot 2\right) \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}}
\] |
*-commutative [=>]58.0 | \[ \sqrt{\frac{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}{\frac{{\left(\mathsf{fma}\left(-4, \color{blue}{C \cdot A}, B \cdot B\right)\right)}^{2}}{\left(F \cdot 2\right) \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}}
\] |
*-commutative [=>]58.0 | \[ \sqrt{\frac{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}{\frac{{\left(\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}^{2}}{\color{blue}{\left(2 \cdot F\right)} \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)}}}
\] |
+-commutative [=>]58.0 | \[ \sqrt{\frac{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}{\frac{{\left(\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}^{2}}{\left(2 \cdot F\right) \cdot \color{blue}{\left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)\right)}}}}
\] |
+-commutative [=>]58.0 | \[ \sqrt{\frac{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}{\frac{{\left(\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}^{2}}{\left(2 \cdot F\right) \cdot \left(\color{blue}{\left(C + A\right)} + \mathsf{hypot}\left(B, A - C\right)\right)}}}
\] |
Taylor expanded in C around inf 49.3
Simplified49.3
[Start]49.3 | \[ \sqrt{-1 \cdot \frac{F}{A}}
\] |
|---|---|
mul-1-neg [=>]49.3 | \[ \sqrt{\color{blue}{-\frac{F}{A}}}
\] |
if 4.00000000000000011e-206 < B < 2.3e32Initial program 47.9
Simplified47.9
[Start]47.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-rr37.9
Simplified37.9
[Start]37.9 | \[ \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 [=>]37.9 | \[ \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 [=>]37.9 | \[ \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)}
\] |
if 2.3e32 < B < 3.60000000000000024e157Initial program 49.0
Simplified49.0
[Start]49.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-rr35.8
Simplified35.8
[Start]35.8 | \[ \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 [=>]35.8 | \[ \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 [=>]35.8 | \[ \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 B around inf 29.3
Applied egg-rr26.3
Simplified33.1
[Start]26.3 | \[ \frac{\sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)}}{1} \cdot \frac{\left(B \cdot \sqrt{2}\right) \cdot \left(-\sqrt{F}\right)}{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}
\] |
|---|---|
/-rgt-identity [=>]26.3 | \[ \color{blue}{\sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)}} \cdot \frac{\left(B \cdot \sqrt{2}\right) \cdot \left(-\sqrt{F}\right)}{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}
\] |
+-commutative [=>]26.3 | \[ \sqrt{\mathsf{hypot}\left(B, A - C\right) + \color{blue}{\left(C + A\right)}} \cdot \frac{\left(B \cdot \sqrt{2}\right) \cdot \left(-\sqrt{F}\right)}{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}
\] |
associate-*l* [=>]26.4 | \[ \sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)} \cdot \frac{\color{blue}{B \cdot \left(\sqrt{2} \cdot \left(-\sqrt{F}\right)\right)}}{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}
\] |
associate-/l* [=>]33.1 | \[ \sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)} \cdot \color{blue}{\frac{B}{\frac{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}{\sqrt{2} \cdot \left(-\sqrt{F}\right)}}}
\] |
*-commutative [=>]33.1 | \[ \sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)} \cdot \frac{B}{\frac{\mathsf{fma}\left(B, B, \color{blue}{C \cdot \left(-4 \cdot A\right)}\right)}{\sqrt{2} \cdot \left(-\sqrt{F}\right)}}
\] |
*-commutative [=>]33.1 | \[ \sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)} \cdot \frac{B}{\frac{\mathsf{fma}\left(B, B, C \cdot \color{blue}{\left(A \cdot -4\right)}\right)}{\sqrt{2} \cdot \left(-\sqrt{F}\right)}}
\] |
if 3.60000000000000024e157 < 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}
\] |
|---|
Applied egg-rr64.0
Simplified64.0
[Start]64.0 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{F \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
|---|---|
*-commutative [=>]64.0 | \[ \frac{-\color{blue}{\sqrt{F \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(C + A\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+ [=>]64.0 | \[ \frac{-\sqrt{F \cdot \color{blue}{\left(\left(\mathsf{hypot}\left(B, A - C\right) + C\right) + A\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 [<=]64.0 | \[ \frac{-\sqrt{F \cdot \left(\color{blue}{\left(C + \mathsf{hypot}\left(B, A - C\right)\right)} + A\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+ [=>]64.0 | \[ \frac{-\sqrt{F \cdot \color{blue}{\left(C + \left(\mathsf{hypot}\left(B, A - C\right) + A\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-rr64.0
Simplified64.0
[Start]64.0 | \[ \frac{-\left(\sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)} \cdot \sqrt{F}\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+ [=>]64.0 | \[ \frac{-\left(\sqrt{\color{blue}{\left(\mathsf{hypot}\left(B, A - C\right) + C\right) + A}} \cdot \sqrt{F}\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 [=>]64.0 | \[ \frac{-\left(\sqrt{\color{blue}{A + \left(\mathsf{hypot}\left(B, A - C\right) + C\right)}} \cdot \sqrt{F}\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 [=>]64.0 | \[ \frac{-\left(\sqrt{A + \color{blue}{\left(C + \mathsf{hypot}\left(B, A - C\right)\right)}} \cdot \sqrt{F}\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)}
\] |
Taylor expanded in C around 0 64.0
Simplified33.0
[Start]64.0 | \[ -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A + \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}\right)
\] |
|---|---|
mul-1-neg [=>]64.0 | \[ \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A + \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}}
\] |
distribute-rgt-neg-in [=>]64.0 | \[ \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{\left(A + \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}\right)}
\] |
*-commutative [=>]64.0 | \[ \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{\color{blue}{F \cdot \left(A + \sqrt{{B}^{2} + {A}^{2}}\right)}}\right)
\] |
unpow2 [=>]64.0 | \[ \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right)
\] |
unpow2 [=>]64.0 | \[ \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right)
\] |
hypot-def [=>]33.0 | \[ \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right)
\] |
Final simplification35.0
| Alternative 1 | |
|---|---|
| Error | 34.1 |
| Cost | 34132 |
| Alternative 2 | |
|---|---|
| Error | 34.1 |
| Cost | 28112 |
| Alternative 3 | |
|---|---|
| Error | 38.6 |
| Cost | 27728 |
| Alternative 4 | |
|---|---|
| Error | 40.1 |
| Cost | 26372 |
| Alternative 5 | |
|---|---|
| Error | 40.2 |
| Cost | 21192 |
| Alternative 6 | |
|---|---|
| Error | 39.9 |
| Cost | 20564 |
| Alternative 7 | |
|---|---|
| Error | 43.1 |
| Cost | 20236 |
| Alternative 8 | |
|---|---|
| Error | 45.1 |
| Cost | 19908 |
| Alternative 9 | |
|---|---|
| Error | 43.8 |
| Cost | 19908 |
| Alternative 10 | |
|---|---|
| Error | 46.5 |
| Cost | 15440 |
| Alternative 11 | |
|---|---|
| Error | 48.7 |
| Cost | 15056 |
| Alternative 12 | |
|---|---|
| Error | 49.7 |
| Cost | 13444 |
| Alternative 13 | |
|---|---|
| Error | 49.8 |
| Cost | 8716 |
| Alternative 14 | |
|---|---|
| Error | 51.1 |
| Cost | 7108 |
| Alternative 15 | |
|---|---|
| Error | 54.2 |
| Cost | 7053 |
| Alternative 16 | |
|---|---|
| Error | 56.9 |
| Cost | 6656 |
| Alternative 17 | |
|---|---|
| Error | 63.3 |
| Cost | 6592 |
herbie shell --seed 2023016
(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))))