| Alternative 1 | |
|---|---|
| Error | 64.4% |
| Cost | 27652 |
(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 -4.0 (* A C) (* B B)))
(t_1 (hypot B (- A C)))
(t_2 (sqrt (+ C (+ A t_1))))
(t_3 (- (sqrt 2.0)))
(t_4 (fma B B (* C (* -4.0 A))))
(t_5 (* -4.0 (* A C))))
(if (<= F 3.15e-229)
(/ (* (* (sqrt (* F (fma B B t_5))) t_2) t_3) t_4)
(if (<= F 80000000.0)
(/ (* (sqrt t_0) (- (sqrt (* (* F 2.0) (+ A (+ C t_1)))))) t_0)
(if (<= F 1.95e+275)
(/ (* (sqrt 2.0) (* t_2 (* (hypot B (sqrt t_5)) (- (sqrt F))))) t_4)
(if (<= F 4.1e+304)
(* t_2 (* (/ B t_4) (* (sqrt F) t_3)))
(/ (* (sqrt F) (- (sqrt (* -16.0 (* A (* C C)))))) t_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 = fma(-4.0, (A * C), (B * B));
double t_1 = hypot(B, (A - C));
double t_2 = sqrt((C + (A + t_1)));
double t_3 = -sqrt(2.0);
double t_4 = fma(B, B, (C * (-4.0 * A)));
double t_5 = -4.0 * (A * C);
double tmp;
if (F <= 3.15e-229) {
tmp = ((sqrt((F * fma(B, B, t_5))) * t_2) * t_3) / t_4;
} else if (F <= 80000000.0) {
tmp = (sqrt(t_0) * -sqrt(((F * 2.0) * (A + (C + t_1))))) / t_0;
} else if (F <= 1.95e+275) {
tmp = (sqrt(2.0) * (t_2 * (hypot(B, sqrt(t_5)) * -sqrt(F)))) / t_4;
} else if (F <= 4.1e+304) {
tmp = t_2 * ((B / t_4) * (sqrt(F) * t_3));
} else {
tmp = (sqrt(F) * -sqrt((-16.0 * (A * (C * C))))) / t_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 = fma(-4.0, Float64(A * C), Float64(B * B)) t_1 = hypot(B, Float64(A - C)) t_2 = sqrt(Float64(C + Float64(A + t_1))) t_3 = Float64(-sqrt(2.0)) t_4 = fma(B, B, Float64(C * Float64(-4.0 * A))) t_5 = Float64(-4.0 * Float64(A * C)) tmp = 0.0 if (F <= 3.15e-229) tmp = Float64(Float64(Float64(sqrt(Float64(F * fma(B, B, t_5))) * t_2) * t_3) / t_4); elseif (F <= 80000000.0) tmp = Float64(Float64(sqrt(t_0) * Float64(-sqrt(Float64(Float64(F * 2.0) * Float64(A + Float64(C + t_1)))))) / t_0); elseif (F <= 1.95e+275) tmp = Float64(Float64(sqrt(2.0) * Float64(t_2 * Float64(hypot(B, sqrt(t_5)) * Float64(-sqrt(F))))) / t_4); elseif (F <= 4.1e+304) tmp = Float64(t_2 * Float64(Float64(B / t_4) * Float64(sqrt(F) * t_3))); else tmp = Float64(Float64(sqrt(F) * Float64(-sqrt(Float64(-16.0 * Float64(A * Float64(C * C)))))) / t_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[(-4.0 * N[(A * C), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(C + N[(A + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = (-N[Sqrt[2.0], $MachinePrecision])}, Block[{t$95$4 = N[(B * B + N[(C * N[(-4.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, 3.15e-229], N[(N[(N[(N[Sqrt[N[(F * N[(B * B + t$95$5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$3), $MachinePrecision] / t$95$4), $MachinePrecision], If[LessEqual[F, 80000000.0], N[(N[(N[Sqrt[t$95$0], $MachinePrecision] * (-N[Sqrt[N[(N[(F * 2.0), $MachinePrecision] * N[(A + N[(C + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[F, 1.95e+275], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$2 * N[(N[Sqrt[B ^ 2 + N[Sqrt[t$95$5], $MachinePrecision] ^ 2], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision], If[LessEqual[F, 4.1e+304], N[(t$95$2 * N[(N[(B / t$95$4), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(-16.0 * N[(A * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $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(-4, A \cdot C, B \cdot B\right)\\
t_1 := \mathsf{hypot}\left(B, A - C\right)\\
t_2 := \sqrt{C + \left(A + t_1\right)}\\
t_3 := -\sqrt{2}\\
t_4 := \mathsf{fma}\left(B, B, C \cdot \left(-4 \cdot A\right)\right)\\
t_5 := -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;F \leq 3.15 \cdot 10^{-229}:\\
\;\;\;\;\frac{\left(\sqrt{F \cdot \mathsf{fma}\left(B, B, t_5\right)} \cdot t_2\right) \cdot t_3}{t_4}\\
\mathbf{elif}\;F \leq 80000000:\\
\;\;\;\;\frac{\sqrt{t_0} \cdot \left(-\sqrt{\left(F \cdot 2\right) \cdot \left(A + \left(C + t_1\right)\right)}\right)}{t_0}\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{+275}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(t_2 \cdot \left(\mathsf{hypot}\left(B, \sqrt{t_5}\right) \cdot \left(-\sqrt{F}\right)\right)\right)}{t_4}\\
\mathbf{elif}\;F \leq 4.1 \cdot 10^{+304}:\\
\;\;\;\;t_2 \cdot \left(\frac{B}{t_4} \cdot \left(\sqrt{F} \cdot t_3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{F} \cdot \left(-\sqrt{-16 \cdot \left(A \cdot \left(C \cdot C\right)\right)}\right)}{t_0}\\
\end{array}
if F < 3.14999999999999993e-229Initial program 76.91
Simplified64.94
[Start]76.91 | \[ \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.89
Applied egg-rr56.61
Simplified56.43
[Start]56.61 | \[ \frac{-\left(\sqrt{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot F} \cdot \sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)}\right) \cdot \sqrt{2}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
|---|---|
*-commutative [=>]56.61 | \[ \frac{-\left(\sqrt{\color{blue}{F \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}} \cdot \sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)}\right) \cdot \sqrt{2}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
associate-*r* [=>]56.62 | \[ \frac{-\left(\sqrt{F \cdot \mathsf{fma}\left(B, B, \color{blue}{\left(C \cdot A\right) \cdot -4}\right)} \cdot \sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)}\right) \cdot \sqrt{2}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
*-commutative [<=]56.62 | \[ \frac{-\left(\sqrt{F \cdot \mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot C\right)} \cdot -4\right)} \cdot \sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)}\right) \cdot \sqrt{2}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
*-commutative [<=]56.62 | \[ \frac{-\left(\sqrt{F \cdot \mathsf{fma}\left(B, B, \color{blue}{-4 \cdot \left(A \cdot C\right)}\right)} \cdot \sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)}\right) \cdot \sqrt{2}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
+-commutative [=>]56.62 | \[ \frac{-\left(\sqrt{F \cdot \mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)} \cdot \sqrt{\color{blue}{\left(C + A\right) + \mathsf{hypot}\left(B, A - C\right)}}\right) \cdot \sqrt{2}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
associate-+r+ [<=]56.43 | \[ \frac{-\left(\sqrt{F \cdot \mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)} \cdot \sqrt{\color{blue}{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}}\right) \cdot \sqrt{2}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
if 3.14999999999999993e-229 < F < 8e7Initial program 78.88
Simplified72.61
[Start]78.88 | \[ \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-rr66.78
Simplified66.14
[Start]66.78 | \[ \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 [=>]66.78 | \[ \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 [=>]66.78 | \[ \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 [=>]66.78 | \[ \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+ [<=]66.14 | \[ \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 8e7 < F < 1.95e275Initial program 85.9
Simplified85.31
[Start]85.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-rr83.98
Applied egg-rr78.71
Simplified78.01
[Start]78.71 | \[ \frac{-\left(\sqrt{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot F} \cdot \sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)}\right) \cdot \sqrt{2}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
|---|---|
*-commutative [=>]78.71 | \[ \frac{-\left(\sqrt{\color{blue}{F \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}} \cdot \sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)}\right) \cdot \sqrt{2}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
associate-*r* [=>]78.71 | \[ \frac{-\left(\sqrt{F \cdot \mathsf{fma}\left(B, B, \color{blue}{\left(C \cdot A\right) \cdot -4}\right)} \cdot \sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)}\right) \cdot \sqrt{2}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
*-commutative [<=]78.71 | \[ \frac{-\left(\sqrt{F \cdot \mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot C\right)} \cdot -4\right)} \cdot \sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)}\right) \cdot \sqrt{2}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
*-commutative [<=]78.71 | \[ \frac{-\left(\sqrt{F \cdot \mathsf{fma}\left(B, B, \color{blue}{-4 \cdot \left(A \cdot C\right)}\right)} \cdot \sqrt{\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)}\right) \cdot \sqrt{2}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
+-commutative [=>]78.71 | \[ \frac{-\left(\sqrt{F \cdot \mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)} \cdot \sqrt{\color{blue}{\left(C + A\right) + \mathsf{hypot}\left(B, A - C\right)}}\right) \cdot \sqrt{2}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
associate-+r+ [<=]78.01 | \[ \frac{-\left(\sqrt{F \cdot \mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)} \cdot \sqrt{\color{blue}{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}}\right) \cdot \sqrt{2}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
Applied egg-rr76.94
if 1.95e275 < F < 4.09999999999999985e304Initial program 91.63
Simplified91.63
[Start]91.63 | \[ \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-rr89.48
Simplified89.48
[Start]89.48 | \[ \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 [=>]89.48 | \[ \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 [=>]89.48 | \[ \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 93.22
Applied egg-rr85.79
Simplified85
[Start]85.79 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}{1} \cdot \frac{B \cdot \left(\sqrt{2} \cdot \sqrt{F}\right)}{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}
\] |
|---|---|
/-rgt-identity [=>]85.79 | \[ \color{blue}{\left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)} \cdot \frac{B \cdot \left(\sqrt{2} \cdot \sqrt{F}\right)}{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}
\] |
associate-+r+ [=>]85.63 | \[ \left(-\sqrt{\color{blue}{\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)}}\right) \cdot \frac{B \cdot \left(\sqrt{2} \cdot \sqrt{F}\right)}{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}
\] |
+-commutative [=>]85.63 | \[ \left(-\sqrt{\color{blue}{\left(C + A\right)} + \mathsf{hypot}\left(B, A - C\right)}\right) \cdot \frac{B \cdot \left(\sqrt{2} \cdot \sqrt{F}\right)}{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}
\] |
associate-+l+ [=>]85.79 | \[ \left(-\sqrt{\color{blue}{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}}\right) \cdot \frac{B \cdot \left(\sqrt{2} \cdot \sqrt{F}\right)}{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}
\] |
associate-/l* [=>]86.98 | \[ \left(-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\right) \cdot \color{blue}{\frac{B}{\frac{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)}{\sqrt{2} \cdot \sqrt{F}}}}
\] |
associate-/r/ [=>]85 | \[ \left(-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\right) \cdot \color{blue}{\left(\frac{B}{\mathsf{fma}\left(B, B, \left(-4 \cdot A\right) \cdot C\right)} \cdot \left(\sqrt{2} \cdot \sqrt{F}\right)\right)}
\] |
*-commutative [=>]85 | \[ \left(-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\right) \cdot \left(\frac{B}{\mathsf{fma}\left(B, B, \color{blue}{C \cdot \left(-4 \cdot A\right)}\right)} \cdot \left(\sqrt{2} \cdot \sqrt{F}\right)\right)
\] |
*-commutative [=>]85 | \[ \left(-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\right) \cdot \left(\frac{B}{\mathsf{fma}\left(B, B, C \cdot \color{blue}{\left(A \cdot -4\right)}\right)} \cdot \left(\sqrt{2} \cdot \sqrt{F}\right)\right)
\] |
if 4.09999999999999985e304 < F Initial program 93.68
Simplified93.68
[Start]93.68 | \[ \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 96.04
Taylor expanded in A around -inf 99.32
Simplified99.23
[Start]99.32 | \[ \frac{-\sqrt{-16 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
|---|---|
associate-*r* [=>]99.23 | \[ \frac{-\sqrt{-16 \cdot \color{blue}{\left(\left(A \cdot {C}^{2}\right) \cdot F\right)}}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
unpow2 [=>]99.23 | \[ \frac{-\sqrt{-16 \cdot \left(\left(A \cdot \color{blue}{\left(C \cdot C\right)}\right) \cdot F\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
Applied egg-rr93.03
Final simplification68.68
| Alternative 1 | |
|---|---|
| Error | 64.4% |
| Cost | 27652 |
| Alternative 2 | |
|---|---|
| Error | 71.75% |
| Cost | 21520 |
| Alternative 3 | |
|---|---|
| Error | 66.97% |
| Cost | 21444 |
| Alternative 4 | |
|---|---|
| Error | 73.83% |
| Cost | 21133 |
| Alternative 5 | |
|---|---|
| Error | 73.15% |
| Cost | 20484 |
| Alternative 6 | |
|---|---|
| Error | 78.65% |
| Cost | 15056 |
| Alternative 7 | |
|---|---|
| Error | 73.25% |
| Cost | 15044 |
| Alternative 8 | |
|---|---|
| Error | 83.28% |
| Cost | 14084 |
| Alternative 9 | |
|---|---|
| Error | 82.22% |
| Cost | 14084 |
| Alternative 10 | |
|---|---|
| Error | 81.41% |
| Cost | 14084 |
| Alternative 11 | |
|---|---|
| Error | 86.51% |
| Cost | 8716 |
| Alternative 12 | |
|---|---|
| Error | 86.63% |
| Cost | 8716 |
| Alternative 13 | |
|---|---|
| Error | 87.33% |
| Cost | 8584 |
| Alternative 14 | |
|---|---|
| Error | 83.4% |
| Cost | 8584 |
| Alternative 15 | |
|---|---|
| Error | 86.86% |
| Cost | 8452 |
| Alternative 16 | |
|---|---|
| Error | 89.18% |
| Cost | 8196 |
| Alternative 17 | |
|---|---|
| Error | 88.27% |
| Cost | 8196 |
| Alternative 18 | |
|---|---|
| Error | 89.02% |
| Cost | 7940 |
| Alternative 19 | |
|---|---|
| Error | 95.53% |
| Cost | 6976 |
| Alternative 20 | |
|---|---|
| Error | 97.02% |
| Cost | 6848 |
herbie shell --seed 2023089
(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))))