| Alternative 1 | |
|---|---|
| Error | 30.0 |
| Cost | 34384 |
(FPCore (A B C F)
:precision binary64
(/
(-
(sqrt
(*
(* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F))
(+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
(- (pow B 2.0) (* (* 4.0 A) C))))(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* C (* A -4.0))))
(t_1 (hypot B (- A C)))
(t_2 (+ C (+ A t_1)))
(t_3 (* -4.0 (* A C))))
(if (<= B -9.6e+55)
(/ (* (sqrt (+ A (+ C t_1))) (sqrt (* F 2.0))) B)
(if (<= B 8e-280)
(/
(sqrt t_2)
(/
(- (fma B B t_3))
(sqrt (+ (* (* F 2.0) (* B B)) (* (* F 2.0) t_3)))))
(if (<= B 3.1e-104)
(/ (- (pow (* (* A (* F (* A C))) -16.0) 0.5)) (+ t_3 (* B B)))
(if (<= B 1.75e+82)
(/ (* (sqrt (* F t_2)) (- (sqrt (* 2.0 t_0)))) t_0)
(* (* (sqrt (+ C (hypot C B))) (sqrt F)) (/ (- (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 = fma(B, B, (C * (A * -4.0)));
double t_1 = hypot(B, (A - C));
double t_2 = C + (A + t_1);
double t_3 = -4.0 * (A * C);
double tmp;
if (B <= -9.6e+55) {
tmp = (sqrt((A + (C + t_1))) * sqrt((F * 2.0))) / B;
} else if (B <= 8e-280) {
tmp = sqrt(t_2) / (-fma(B, B, t_3) / sqrt((((F * 2.0) * (B * B)) + ((F * 2.0) * t_3))));
} else if (B <= 3.1e-104) {
tmp = -pow(((A * (F * (A * C))) * -16.0), 0.5) / (t_3 + (B * B));
} else if (B <= 1.75e+82) {
tmp = (sqrt((F * t_2)) * -sqrt((2.0 * t_0))) / t_0;
} else {
tmp = (sqrt((C + hypot(C, B))) * sqrt(F)) * (-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 = fma(B, B, Float64(C * Float64(A * -4.0))) t_1 = hypot(B, Float64(A - C)) t_2 = Float64(C + Float64(A + t_1)) t_3 = Float64(-4.0 * Float64(A * C)) tmp = 0.0 if (B <= -9.6e+55) tmp = Float64(Float64(sqrt(Float64(A + Float64(C + t_1))) * sqrt(Float64(F * 2.0))) / B); elseif (B <= 8e-280) tmp = Float64(sqrt(t_2) / Float64(Float64(-fma(B, B, t_3)) / sqrt(Float64(Float64(Float64(F * 2.0) * Float64(B * B)) + Float64(Float64(F * 2.0) * t_3))))); elseif (B <= 3.1e-104) tmp = Float64(Float64(-(Float64(Float64(A * Float64(F * Float64(A * C))) * -16.0) ^ 0.5)) / Float64(t_3 + Float64(B * B))); elseif (B <= 1.75e+82) tmp = Float64(Float64(sqrt(Float64(F * t_2)) * Float64(-sqrt(Float64(2.0 * t_0)))) / t_0); else tmp = Float64(Float64(sqrt(Float64(C + hypot(C, B))) * sqrt(F)) * 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[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$2 = N[(C + N[(A + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -9.6e+55], N[(N[(N[Sqrt[N[(A + N[(C + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 8e-280], N[(N[Sqrt[t$95$2], $MachinePrecision] / N[((-N[(B * B + t$95$3), $MachinePrecision]) / N[Sqrt[N[(N[(N[(F * 2.0), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] + N[(N[(F * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3.1e-104], N[((-N[Power[N[(N[(A * N[(F * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -16.0), $MachinePrecision], 0.5], $MachinePrecision]) / N[(t$95$3 + N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.75e+82], N[(N[(N[Sqrt[N[(F * t$95$2), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * 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{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
t_1 := \mathsf{hypot}\left(B, A - C\right)\\
t_2 := C + \left(A + t_1\right)\\
t_3 := -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq -9.6 \cdot 10^{+55}:\\
\;\;\;\;\frac{\sqrt{A + \left(C + t_1\right)} \cdot \sqrt{F \cdot 2}}{B}\\
\mathbf{elif}\;B \leq 8 \cdot 10^{-280}:\\
\;\;\;\;\frac{\sqrt{t_2}}{\frac{-\mathsf{fma}\left(B, B, t_3\right)}{\sqrt{\left(F \cdot 2\right) \cdot \left(B \cdot B\right) + \left(F \cdot 2\right) \cdot t_3}}}\\
\mathbf{elif}\;B \leq 3.1 \cdot 10^{-104}:\\
\;\;\;\;\frac{-{\left(\left(A \cdot \left(F \cdot \left(A \cdot C\right)\right)\right) \cdot -16\right)}^{0.5}}{t_3 + B \cdot B}\\
\mathbf{elif}\;B \leq 1.75 \cdot 10^{+82}:\\
\;\;\;\;\frac{\sqrt{F \cdot t_2} \cdot \left(-\sqrt{2 \cdot t_0}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(C, B\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
if B < -9.5999999999999997e55Initial program 57.8
Simplified57.8
[Start]57.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-rr52.9
Simplified52.9
[Start]52.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 [=>]52.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)}
\] |
associate-*r* [=>]52.9 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{\color{blue}{\left(2 \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right) \cdot F}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
associate-*l* [=>]52.9 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{\left(2 \cdot \mathsf{fma}\left(B, B, \color{blue}{A \cdot \left(C \cdot -4\right)}\right)\right) \cdot F}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
Applied egg-rr52.9
Simplified52.9
[Start]52.9 | \[ \sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(\left(-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)}\right) \cdot \frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)
\] |
|---|---|
associate-*r* [=>]52.9 | \[ \color{blue}{\left(\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)}\right)\right) \cdot \frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}
\] |
distribute-rgt-neg-out [=>]52.9 | \[ \color{blue}{\left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)}\right)} \cdot \frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
distribute-lft-neg-out [<=]52.9 | \[ \color{blue}{\left(\left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right) \cdot \sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)}\right)} \cdot \frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
associate-*r* [<=]52.9 | \[ \color{blue}{\left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right) \cdot \left(\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)} \cdot \frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)}
\] |
+-commutative [=>]52.9 | \[ \left(-\sqrt{\color{blue}{\left(C + \mathsf{hypot}\left(B, A - C\right)\right) + A}}\right) \cdot \left(\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)} \cdot \frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)
\] |
associate-+l+ [=>]52.9 | \[ \left(-\sqrt{\color{blue}{C + \left(\mathsf{hypot}\left(B, A - C\right) + A\right)}}\right) \cdot \left(\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)} \cdot \frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)
\] |
associate-*r/ [=>]52.9 | \[ \left(-\sqrt{C + \left(\mathsf{hypot}\left(B, A - C\right) + A\right)}\right) \cdot \color{blue}{\frac{\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)} \cdot 1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}
\] |
Taylor expanded in B around -inf 23.0
Simplified23.0
[Start]23.0 | \[ \left(-\sqrt{C + \left(\mathsf{hypot}\left(B, A - C\right) + A\right)}\right) \cdot \left(-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F}\right)\right)
\] |
|---|---|
mul-1-neg [=>]23.0 | \[ \left(-\sqrt{C + \left(\mathsf{hypot}\left(B, A - C\right) + A\right)}\right) \cdot \color{blue}{\left(-\frac{\sqrt{2}}{B} \cdot \sqrt{F}\right)}
\] |
*-commutative [=>]23.0 | \[ \left(-\sqrt{C + \left(\mathsf{hypot}\left(B, A - C\right) + A\right)}\right) \cdot \left(-\color{blue}{\sqrt{F} \cdot \frac{\sqrt{2}}{B}}\right)
\] |
Applied egg-rr15.1
if -9.5999999999999997e55 < B < 7.9999999999999997e-280Initial 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-rr38.7
Simplified38.8
[Start]38.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 [=>]38.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)}
\] |
associate-*r* [=>]38.8 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{\color{blue}{\left(2 \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right) \cdot F}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
associate-*l* [=>]38.8 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{\left(2 \cdot \mathsf{fma}\left(B, B, \color{blue}{A \cdot \left(C \cdot -4\right)}\right)\right) \cdot F}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
Applied egg-rr38.9
Simplified38.7
[Start]38.9 | \[ \sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(\left(-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)}\right) \cdot \frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)
\] |
|---|---|
associate-*r* [=>]38.9 | \[ \color{blue}{\left(\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)}\right)\right) \cdot \frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}
\] |
distribute-rgt-neg-out [=>]38.9 | \[ \color{blue}{\left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)}\right)} \cdot \frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
distribute-lft-neg-out [<=]38.9 | \[ \color{blue}{\left(\left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right) \cdot \sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)}\right)} \cdot \frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
associate-*r* [<=]38.9 | \[ \color{blue}{\left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right) \cdot \left(\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)} \cdot \frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)}
\] |
+-commutative [=>]38.9 | \[ \left(-\sqrt{\color{blue}{\left(C + \mathsf{hypot}\left(B, A - C\right)\right) + A}}\right) \cdot \left(\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)} \cdot \frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)
\] |
associate-+l+ [=>]38.8 | \[ \left(-\sqrt{\color{blue}{C + \left(\mathsf{hypot}\left(B, A - C\right) + A\right)}}\right) \cdot \left(\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)} \cdot \frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)
\] |
associate-*r/ [=>]38.7 | \[ \left(-\sqrt{C + \left(\mathsf{hypot}\left(B, A - C\right) + A\right)}\right) \cdot \color{blue}{\frac{\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)} \cdot 1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}
\] |
Applied egg-rr38.8
Simplified38.7
[Start]38.8 | \[ \frac{\sqrt{F \cdot \left(\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right) \cdot 2\right)} \cdot \sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}{-\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}
\] |
|---|---|
*-commutative [=>]38.8 | \[ \frac{\color{blue}{\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{F \cdot \left(\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right) \cdot 2\right)}}}{-\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}
\] |
associate-/l* [=>]38.8 | \[ \color{blue}{\frac{\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}{\frac{-\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{\sqrt{F \cdot \left(\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right) \cdot 2\right)}}}}
\] |
+-commutative [=>]38.8 | \[ \frac{\sqrt{\color{blue}{\left(C + \mathsf{hypot}\left(B, A - C\right)\right) + A}}}{\frac{-\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{\sqrt{F \cdot \left(\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right) \cdot 2\right)}}}
\] |
associate-+l+ [=>]38.7 | \[ \frac{\sqrt{\color{blue}{C + \left(\mathsf{hypot}\left(B, A - C\right) + A\right)}}}{\frac{-\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{\sqrt{F \cdot \left(\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right) \cdot 2\right)}}}
\] |
*-commutative [=>]38.7 | \[ \frac{\sqrt{C + \left(\mathsf{hypot}\left(B, A - C\right) + A\right)}}{\frac{-\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{\sqrt{\color{blue}{\left(\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right) \cdot 2\right) \cdot F}}}}
\] |
associate-*l* [=>]38.7 | \[ \frac{\sqrt{C + \left(\mathsf{hypot}\left(B, A - C\right) + A\right)}}{\frac{-\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{\sqrt{\color{blue}{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right) \cdot \left(2 \cdot F\right)}}}}
\] |
*-commutative [=>]38.7 | \[ \frac{\sqrt{C + \left(\mathsf{hypot}\left(B, A - C\right) + A\right)}}{\frac{-\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{\sqrt{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right) \cdot \color{blue}{\left(F \cdot 2\right)}}}}
\] |
Applied egg-rr38.7
if 7.9999999999999997e-280 < B < 3.09999999999999976e-104Initial program 52.5
Simplified52.5
[Start]52.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}
\] |
|---|
Taylor expanded in B around 0 53.9
Simplified53.9
[Start]53.9 | \[ \frac{-\sqrt{2 \cdot \left(-8 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
|---|---|
associate-*r* [=>]53.9 | \[ \frac{-\sqrt{2 \cdot \left(-8 \cdot \color{blue}{\left(\left({A}^{2} \cdot C\right) \cdot F\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
unpow2 [=>]53.9 | \[ \frac{-\sqrt{2 \cdot \left(-8 \cdot \left(\left(\color{blue}{\left(A \cdot A\right)} \cdot C\right) \cdot F\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
Applied egg-rr48.8
if 3.09999999999999976e-104 < B < 1.75e82Initial program 43.0
Simplified37.7
[Start]43.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-rr37.7
Simplified37.7
[Start]37.7 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{F \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
|---|---|
*-commutative [=>]37.7 | \[ \frac{-\color{blue}{\sqrt{F \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
if 1.75e82 < B Initial program 60.3
Simplified59.3
[Start]60.3 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
|---|
Taylor expanded in A around 0 56.9
Simplified56.9
[Start]56.9 | \[ -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}\right)
\] |
|---|---|
associate-*r* [=>]56.9 | \[ \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}}
\] |
associate-*r/ [=>]56.9 | \[ \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}} \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}
\] |
mul-1-neg [=>]56.9 | \[ \frac{\color{blue}{-\sqrt{2}}}{B} \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}
\] |
*-commutative [=>]56.9 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{\color{blue}{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}}
\] |
+-commutative [=>]56.9 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \sqrt{\color{blue}{{C}^{2} + {B}^{2}}}\right)}
\] |
unpow2 [=>]56.9 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \sqrt{\color{blue}{C \cdot C} + {B}^{2}}\right)}
\] |
unpow2 [=>]56.9 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \sqrt{C \cdot C + \color{blue}{B \cdot B}}\right)}
\] |
Applied egg-rr17.0
Final simplification31.1
| Alternative 1 | |
|---|---|
| Error | 30.0 |
| Cost | 34384 |
| Alternative 2 | |
|---|---|
| Error | 29.9 |
| Cost | 28368 |
| Alternative 3 | |
|---|---|
| Error | 30.1 |
| Cost | 28112 |
| Alternative 4 | |
|---|---|
| Error | 32.3 |
| Cost | 27592 |
| Alternative 5 | |
|---|---|
| Error | 32.3 |
| Cost | 27592 |
| Alternative 6 | |
|---|---|
| Error | 32.3 |
| Cost | 27464 |
| Alternative 7 | |
|---|---|
| Error | 32.3 |
| Cost | 27088 |
| Alternative 8 | |
|---|---|
| Error | 32.4 |
| Cost | 26832 |
| Alternative 9 | |
|---|---|
| Error | 34.5 |
| Cost | 21192 |
| Alternative 10 | |
|---|---|
| Error | 33.7 |
| Cost | 21192 |
| Alternative 11 | |
|---|---|
| Error | 34.4 |
| Cost | 21000 |
| Alternative 12 | |
|---|---|
| Error | 42.6 |
| Cost | 20696 |
| Alternative 13 | |
|---|---|
| Error | 35.1 |
| Cost | 20424 |
| Alternative 14 | |
|---|---|
| Error | 39.6 |
| Cost | 20300 |
| Alternative 15 | |
|---|---|
| Error | 38.4 |
| Cost | 20300 |
| Alternative 16 | |
|---|---|
| Error | 42.9 |
| Cost | 19844 |
| Alternative 17 | |
|---|---|
| Error | 48.5 |
| Cost | 15188 |
| Alternative 18 | |
|---|---|
| Error | 51.8 |
| Cost | 15064 |
| Alternative 19 | |
|---|---|
| Error | 51.7 |
| Cost | 14344 |
| Alternative 20 | |
|---|---|
| Error | 52.0 |
| Cost | 14240 |
| Alternative 21 | |
|---|---|
| Error | 51.7 |
| Cost | 14240 |
| Alternative 22 | |
|---|---|
| Error | 53.8 |
| Cost | 8848 |
| Alternative 23 | |
|---|---|
| Error | 51.2 |
| Cost | 8848 |
| Alternative 24 | |
|---|---|
| Error | 51.1 |
| Cost | 8848 |
| Alternative 25 | |
|---|---|
| Error | 54.0 |
| Cost | 8336 |
| Alternative 26 | |
|---|---|
| Error | 53.7 |
| Cost | 7940 |
| Alternative 27 | |
|---|---|
| Error | 56.2 |
| Cost | 7876 |
| Alternative 28 | |
|---|---|
| Error | 57.5 |
| Cost | 7812 |
| Alternative 29 | |
|---|---|
| Error | 57.1 |
| Cost | 7812 |
| Alternative 30 | |
|---|---|
| Error | 62.3 |
| Cost | 7488 |
| Alternative 31 | |
|---|---|
| Error | 63.1 |
| Cost | 6976 |
| Alternative 32 | |
|---|---|
| Error | 63.1 |
| Cost | 6976 |
| Alternative 33 | |
|---|---|
| Error | 63.1 |
| Cost | 6976 |
herbie shell --seed 2023060
(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))))