| Alternative 1 | |
|---|---|
| Accuracy | 49.4% |
| Cost | 149516 |
(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 (+ A (+ C t_0)))
(t_2 (* F t_1))
(t_3 (fma -4.0 (* A C) (* B B)))
(t_4 (/ (- (sqrt 2.0)) B))
(t_5 (* t_4 (/ B (/ (sqrt (* C -2.0)) (sqrt F)))))
(t_6 (fma B B (* C (* A -4.0))))
(t_7 (/ (- (sqrt (* 2.0 (* t_6 t_2)))) t_6)))
(if (<= B -1.2e-28)
(-
(/ (sqrt t_2) (- (/ (* 2.0 A) (/ (sqrt 2.0) (/ C B))) (/ B (sqrt 2.0)))))
(if (<= B -3e-76)
t_5
(if (<= B -5.4e-129)
t_7
(if (<= B -2.85e-179)
(-
(/
(* (sqrt t_1) (sqrt (* 2.0 (* -4.0 (* F (* A C))))))
(+ (* B B) (* -4.0 (* A C)))))
(if (<= B -9e-181)
(/ (* (sqrt (* -16.0 (* C (* A A)))) (- (sqrt F))) t_3)
(if (<= B -2.3e-251)
(/ (- (sqrt (* 2.0 (* t_6 (* F (* 2.0 C)))))) t_6)
(if (<= B -3.5e-286)
t_5
(if (<= B 8e-108)
(/
(*
(sqrt (* 2.0 (+ C (+ A t_0))))
(- (sqrt (* F (* A (* C -4.0))))))
t_3)
(if (<= B 1.75e+46)
t_7
(* t_4 (* (sqrt F) (sqrt (+ C (hypot C 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 = A + (C + t_0);
double t_2 = F * t_1;
double t_3 = fma(-4.0, (A * C), (B * B));
double t_4 = -sqrt(2.0) / B;
double t_5 = t_4 * (B / (sqrt((C * -2.0)) / sqrt(F)));
double t_6 = fma(B, B, (C * (A * -4.0)));
double t_7 = -sqrt((2.0 * (t_6 * t_2))) / t_6;
double tmp;
if (B <= -1.2e-28) {
tmp = -(sqrt(t_2) / (((2.0 * A) / (sqrt(2.0) / (C / B))) - (B / sqrt(2.0))));
} else if (B <= -3e-76) {
tmp = t_5;
} else if (B <= -5.4e-129) {
tmp = t_7;
} else if (B <= -2.85e-179) {
tmp = -((sqrt(t_1) * sqrt((2.0 * (-4.0 * (F * (A * C)))))) / ((B * B) + (-4.0 * (A * C))));
} else if (B <= -9e-181) {
tmp = (sqrt((-16.0 * (C * (A * A)))) * -sqrt(F)) / t_3;
} else if (B <= -2.3e-251) {
tmp = -sqrt((2.0 * (t_6 * (F * (2.0 * C))))) / t_6;
} else if (B <= -3.5e-286) {
tmp = t_5;
} else if (B <= 8e-108) {
tmp = (sqrt((2.0 * (C + (A + t_0)))) * -sqrt((F * (A * (C * -4.0))))) / t_3;
} else if (B <= 1.75e+46) {
tmp = t_7;
} else {
tmp = t_4 * (sqrt(F) * sqrt((C + hypot(C, 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 = Float64(A + Float64(C + t_0)) t_2 = Float64(F * t_1) t_3 = fma(-4.0, Float64(A * C), Float64(B * B)) t_4 = Float64(Float64(-sqrt(2.0)) / B) t_5 = Float64(t_4 * Float64(B / Float64(sqrt(Float64(C * -2.0)) / sqrt(F)))) t_6 = fma(B, B, Float64(C * Float64(A * -4.0))) t_7 = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_6 * t_2)))) / t_6) tmp = 0.0 if (B <= -1.2e-28) tmp = Float64(-Float64(sqrt(t_2) / Float64(Float64(Float64(2.0 * A) / Float64(sqrt(2.0) / Float64(C / B))) - Float64(B / sqrt(2.0))))); elseif (B <= -3e-76) tmp = t_5; elseif (B <= -5.4e-129) tmp = t_7; elseif (B <= -2.85e-179) tmp = Float64(-Float64(Float64(sqrt(t_1) * sqrt(Float64(2.0 * Float64(-4.0 * Float64(F * Float64(A * C)))))) / Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))))); elseif (B <= -9e-181) tmp = Float64(Float64(sqrt(Float64(-16.0 * Float64(C * Float64(A * A)))) * Float64(-sqrt(F))) / t_3); elseif (B <= -2.3e-251) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_6 * Float64(F * Float64(2.0 * C)))))) / t_6); elseif (B <= -3.5e-286) tmp = t_5; elseif (B <= 8e-108) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(C + Float64(A + t_0)))) * Float64(-sqrt(Float64(F * Float64(A * Float64(C * -4.0)))))) / t_3); elseif (B <= 1.75e+46) tmp = t_7; else tmp = Float64(t_4 * Float64(sqrt(F) * sqrt(Float64(C + hypot(C, 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[(A + N[(C + t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(F * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(-4.0 * N[(A * C), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 * N[(B / N[(N[Sqrt[N[(C * -2.0), $MachinePrecision]], $MachinePrecision] / N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[((-N[Sqrt[N[(2.0 * N[(t$95$6 * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$6), $MachinePrecision]}, If[LessEqual[B, -1.2e-28], (-N[(N[Sqrt[t$95$2], $MachinePrecision] / N[(N[(N[(2.0 * A), $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] / N[(C / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(B / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[B, -3e-76], t$95$5, If[LessEqual[B, -5.4e-129], t$95$7, If[LessEqual[B, -2.85e-179], (-N[(N[(N[Sqrt[t$95$1], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(-4.0 * N[(F * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[B, -9e-181], N[(N[(N[Sqrt[N[(-16.0 * N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[B, -2.3e-251], N[((-N[Sqrt[N[(2.0 * N[(t$95$6 * N[(F * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$6), $MachinePrecision], If[LessEqual[B, -3.5e-286], t$95$5, If[LessEqual[B, 8e-108], 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] / t$95$3), $MachinePrecision], If[LessEqual[B, 1.75e+46], t$95$7, N[(t$95$4 * N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]], $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 := A + \left(C + t_0\right)\\
t_2 := F \cdot t_1\\
t_3 := \mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)\\
t_4 := \frac{-\sqrt{2}}{B}\\
t_5 := t_4 \cdot \frac{B}{\frac{\sqrt{C \cdot -2}}{\sqrt{F}}}\\
t_6 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
t_7 := \frac{-\sqrt{2 \cdot \left(t_6 \cdot t_2\right)}}{t_6}\\
\mathbf{if}\;B \leq -1.2 \cdot 10^{-28}:\\
\;\;\;\;-\frac{\sqrt{t_2}}{\frac{2 \cdot A}{\frac{\sqrt{2}}{\frac{C}{B}}} - \frac{B}{\sqrt{2}}}\\
\mathbf{elif}\;B \leq -3 \cdot 10^{-76}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;B \leq -5.4 \cdot 10^{-129}:\\
\;\;\;\;t_7\\
\mathbf{elif}\;B \leq -2.85 \cdot 10^{-179}:\\
\;\;\;\;-\frac{\sqrt{t_1} \cdot \sqrt{2 \cdot \left(-4 \cdot \left(F \cdot \left(A \cdot C\right)\right)\right)}}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\
\mathbf{elif}\;B \leq -9 \cdot 10^{-181}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot A\right)\right)} \cdot \left(-\sqrt{F}\right)}{t_3}\\
\mathbf{elif}\;B \leq -2.3 \cdot 10^{-251}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_6 \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right)}}{t_6}\\
\mathbf{elif}\;B \leq -3.5 \cdot 10^{-286}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;B \leq 8 \cdot 10^{-108}:\\
\;\;\;\;\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)}{t_3}\\
\mathbf{elif}\;B \leq 1.75 \cdot 10^{+46}:\\
\;\;\;\;t_7\\
\mathbf{else}:\\
\;\;\;\;t_4 \cdot \left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(C, B\right)}\right)\\
\end{array}
if B < -1.2000000000000001e-28Initial program 15.7%
Simplified19.7%
[Start]15.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-rr25.7%
Simplified25.9%
[Start]25.7 | \[ \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 [=>]25.7 | \[ \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+ [=>]26.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 [<=]26.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+ [=>]25.9 | \[ \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-rr29.7%
Simplified29.9%
[Start]29.7 | \[ \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)}
\] |
|---|---|
+-commutative [=>]29.7 | \[ \frac{-\left(\sqrt{\color{blue}{\left(C + A\right) + \mathsf{hypot}\left(B, A - 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)}
\] |
associate-+l+ [=>]29.9 | \[ \frac{-\left(\sqrt{\color{blue}{C + \left(A + \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)}
\] |
Applied egg-rr26.0%
Simplified26.0%
[Start]26.0 | \[ \frac{-\sqrt{\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot F}}{1} \cdot \frac{\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/ [=>]26.0 | \[ \color{blue}{\frac{\frac{-\sqrt{\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot F}}{1} \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)}}
\] |
/-rgt-identity [=>]26.0 | \[ \frac{\color{blue}{\left(-\sqrt{\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot 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-/l* [=>]26.0 | \[ \color{blue}{\frac{-\sqrt{\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot F}}{\frac{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}{\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}}}
\] |
*-commutative [=>]26.0 | \[ \frac{-\sqrt{\color{blue}{F \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}}{\frac{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}{\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}}
\] |
*-commutative [=>]26.0 | \[ \frac{-\sqrt{F \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\frac{\mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot -4\right) \cdot C}\right)}{\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}}
\] |
associate-*l* [=>]26.0 | \[ \frac{-\sqrt{F \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\frac{\mathsf{fma}\left(B, B, \color{blue}{A \cdot \left(-4 \cdot C\right)}\right)}{\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}}
\] |
*-commutative [=>]26.0 | \[ \frac{-\sqrt{F \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\frac{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}{\sqrt{2 \cdot \mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot -4\right) \cdot C}\right)}}}
\] |
associate-*l* [=>]26.0 | \[ \frac{-\sqrt{F \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\frac{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}{\sqrt{2 \cdot \mathsf{fma}\left(B, B, \color{blue}{A \cdot \left(-4 \cdot C\right)}\right)}}}
\] |
Taylor expanded in B around -inf 45.9%
Simplified47.4%
[Start]45.9 | \[ \frac{-\sqrt{F \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{2 \cdot \frac{A \cdot C}{\sqrt{2} \cdot B} + -1 \cdot \frac{B}{\sqrt{2}}}
\] |
|---|---|
mul-1-neg [=>]45.9 | \[ \frac{-\sqrt{F \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{2 \cdot \frac{A \cdot C}{\sqrt{2} \cdot B} + \color{blue}{\left(-\frac{B}{\sqrt{2}}\right)}}
\] |
unsub-neg [=>]45.9 | \[ \frac{-\sqrt{F \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\color{blue}{2 \cdot \frac{A \cdot C}{\sqrt{2} \cdot B} - \frac{B}{\sqrt{2}}}}
\] |
*-commutative [=>]45.9 | \[ \frac{-\sqrt{F \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\color{blue}{\frac{A \cdot C}{\sqrt{2} \cdot B} \cdot 2} - \frac{B}{\sqrt{2}}}
\] |
associate-/l* [=>]47.4 | \[ \frac{-\sqrt{F \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\color{blue}{\frac{A}{\frac{\sqrt{2} \cdot B}{C}}} \cdot 2 - \frac{B}{\sqrt{2}}}
\] |
associate-*l/ [=>]47.4 | \[ \frac{-\sqrt{F \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\color{blue}{\frac{A \cdot 2}{\frac{\sqrt{2} \cdot B}{C}}} - \frac{B}{\sqrt{2}}}
\] |
associate-/l* [=>]47.4 | \[ \frac{-\sqrt{F \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\frac{A \cdot 2}{\color{blue}{\frac{\sqrt{2}}{\frac{C}{B}}}} - \frac{B}{\sqrt{2}}}
\] |
if -1.2000000000000001e-28 < B < -3.00000000000000024e-76 or -2.30000000000000017e-251 < B < -3.49999999999999988e-286Initial program 26.2%
Simplified34.2%
[Start]26.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}
\] |
|---|
Taylor expanded in A around 0 1.4%
Simplified1.4%
[Start]1.4 | \[ -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}\right)
\] |
|---|---|
associate-*r* [=>]1.4 | \[ \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}}
\] |
associate-*r/ [=>]1.4 | \[ \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}} \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}
\] |
mul-1-neg [=>]1.4 | \[ \frac{\color{blue}{-\sqrt{2}}}{B} \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}
\] |
*-commutative [=>]1.4 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{\color{blue}{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}}
\] |
+-commutative [=>]1.4 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \sqrt{\color{blue}{{C}^{2} + {B}^{2}}}\right)}
\] |
unpow2 [=>]1.4 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \sqrt{\color{blue}{C \cdot C} + {B}^{2}}\right)}
\] |
unpow2 [=>]1.4 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \sqrt{C \cdot C + \color{blue}{B \cdot B}}\right)}
\] |
Taylor expanded in C around -inf 6.2%
Simplified6.2%
[Start]6.2 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(-0.5 \cdot \frac{{B}^{2}}{C}\right)}
\] |
|---|---|
associate-*r/ [=>]6.2 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \color{blue}{\frac{-0.5 \cdot {B}^{2}}{C}}}
\] |
*-commutative [=>]6.2 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \frac{\color{blue}{{B}^{2} \cdot -0.5}}{C}}
\] |
unpow2 [=>]6.2 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \frac{\color{blue}{\left(B \cdot B\right)} \cdot -0.5}{C}}
\] |
Applied egg-rr2.0%
Simplified17.4%
[Start]2.0 | \[ \frac{-\sqrt{2}}{B} \cdot \left(e^{\mathsf{log1p}\left(\frac{\sqrt{F} \cdot B}{\sqrt{C \cdot -2}}\right)} - 1\right)
\] |
|---|---|
expm1-def [=>]13.5 | \[ \frac{-\sqrt{2}}{B} \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\sqrt{F} \cdot B}{\sqrt{C \cdot -2}}\right)\right)}
\] |
expm1-log1p [=>]17.0 | \[ \frac{-\sqrt{2}}{B} \cdot \color{blue}{\frac{\sqrt{F} \cdot B}{\sqrt{C \cdot -2}}}
\] |
*-commutative [=>]17.0 | \[ \frac{-\sqrt{2}}{B} \cdot \frac{\color{blue}{B \cdot \sqrt{F}}}{\sqrt{C \cdot -2}}
\] |
associate-/l* [=>]17.4 | \[ \frac{-\sqrt{2}}{B} \cdot \color{blue}{\frac{B}{\frac{\sqrt{C \cdot -2}}{\sqrt{F}}}}
\] |
if -3.00000000000000024e-76 < B < -5.39999999999999998e-129 or 8.00000000000000032e-108 < B < 1.74999999999999992e46Initial program 28.7%
Simplified38.2%
[Start]28.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}
\] |
|---|
if -5.39999999999999998e-129 < B < -2.85e-179Initial program 16.1%
Simplified16.1%
[Start]16.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-rr34.5%
Simplified34.5%
[Start]34.5 | \[ \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 [=>]34.5 | \[ \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 [=>]34.5 | \[ \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 0 23.6%
Simplified29.1%
[Start]23.6 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
|---|---|
associate-*r* [=>]29.1 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(-4 \cdot \color{blue}{\left(\left(A \cdot C\right) \cdot F\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
*-commutative [=>]29.1 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(-4 \cdot \left(\color{blue}{\left(C \cdot A\right)} \cdot F\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
if -2.85e-179 < B < -8.9999999999999998e-181Initial program 10.6%
Simplified23.3%
[Start]10.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 A around inf 21.3%
Simplified23.3%
[Start]21.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* [=>]23.3 | \[ \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* [<=]23.3 | \[ \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 [<=]23.3 | \[ \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 [=>]23.3 | \[ \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-rr15.8%
Taylor expanded in A around inf 1.7%
Simplified1.7%
[Start]1.7 | \[ \frac{-\sqrt{F} \cdot \sqrt{-16 \cdot \left({A}^{2} \cdot C\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
|---|---|
*-commutative [=>]1.7 | \[ \frac{-\sqrt{F} \cdot \sqrt{-16 \cdot \color{blue}{\left(C \cdot {A}^{2}\right)}}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
unpow2 [=>]1.7 | \[ \frac{-\sqrt{F} \cdot \sqrt{-16 \cdot \left(C \cdot \color{blue}{\left(A \cdot A\right)}\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
if -8.9999999999999998e-181 < B < -2.30000000000000017e-251Initial program 18.0%
Simplified23.9%
[Start]18.0 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
|---|
Taylor expanded in A around -inf 24.0%
if -3.49999999999999988e-286 < B < 8.00000000000000032e-108Initial program 18.2%
Simplified26.6%
[Start]18.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}
\] |
|---|
Taylor expanded in A around inf 22.5%
Simplified25.2%
[Start]22.5 | \[ \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* [=>]25.2 | \[ \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* [<=]25.2 | \[ \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 [<=]25.2 | \[ \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 [=>]25.2 | \[ \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-rr30.9%
if 1.74999999999999992e46 < B Initial program 11.3%
Simplified12.8%
[Start]11.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 16.4%
Simplified16.4%
[Start]16.4 | \[ -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}\right)
\] |
|---|---|
associate-*r* [=>]16.4 | \[ \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}}
\] |
associate-*r/ [=>]16.4 | \[ \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}} \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}
\] |
mul-1-neg [=>]16.4 | \[ \frac{\color{blue}{-\sqrt{2}}}{B} \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}
\] |
*-commutative [=>]16.4 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{\color{blue}{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}}
\] |
+-commutative [=>]16.4 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \sqrt{\color{blue}{{C}^{2} + {B}^{2}}}\right)}
\] |
unpow2 [=>]16.4 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \sqrt{\color{blue}{C \cdot C} + {B}^{2}}\right)}
\] |
unpow2 [=>]16.4 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \sqrt{C \cdot C + \color{blue}{B \cdot B}}\right)}
\] |
Applied egg-rr70.9%
Final simplification43.7%
| Alternative 1 | |
|---|---|
| Accuracy | 49.4% |
| Cost | 149516 |
| Alternative 2 | |
|---|---|
| Accuracy | 42.0% |
| Cost | 28120 |
| Alternative 3 | |
|---|---|
| Accuracy | 47.1% |
| Cost | 28112 |
| Alternative 4 | |
|---|---|
| Accuracy | 42.1% |
| Cost | 27332 |
| Alternative 5 | |
|---|---|
| Accuracy | 41.9% |
| Cost | 27096 |
| Alternative 6 | |
|---|---|
| Accuracy | 37.7% |
| Cost | 21848 |
| Alternative 7 | |
|---|---|
| Accuracy | 35.0% |
| Cost | 21792 |
| Alternative 8 | |
|---|---|
| Accuracy | 35.3% |
| Cost | 21792 |
| Alternative 9 | |
|---|---|
| Accuracy | 35.7% |
| Cost | 21528 |
| Alternative 10 | |
|---|---|
| Accuracy | 35.8% |
| Cost | 21264 |
| Alternative 11 | |
|---|---|
| Accuracy | 34.2% |
| Cost | 21084 |
| Alternative 12 | |
|---|---|
| Accuracy | 34.0% |
| Cost | 21084 |
| Alternative 13 | |
|---|---|
| Accuracy | 24.7% |
| Cost | 20952 |
| Alternative 14 | |
|---|---|
| Accuracy | 19.7% |
| Cost | 20168 |
| Alternative 15 | |
|---|---|
| Accuracy | 26.4% |
| Cost | 20168 |
| Alternative 16 | |
|---|---|
| Accuracy | 26.8% |
| Cost | 20168 |
| Alternative 17 | |
|---|---|
| Accuracy | 18.8% |
| Cost | 14480 |
| Alternative 18 | |
|---|---|
| Accuracy | 18.3% |
| Cost | 14480 |
| Alternative 19 | |
|---|---|
| Accuracy | 18.8% |
| Cost | 13840 |
| Alternative 20 | |
|---|---|
| Accuracy | 13.2% |
| Cost | 8716 |
| Alternative 21 | |
|---|---|
| Accuracy | 16.7% |
| Cost | 8712 |
| Alternative 22 | |
|---|---|
| Accuracy | 16.7% |
| Cost | 8584 |
| Alternative 23 | |
|---|---|
| Accuracy | 12.2% |
| Cost | 8452 |
| Alternative 24 | |
|---|---|
| Accuracy | 10.7% |
| Cost | 8196 |
| Alternative 25 | |
|---|---|
| Accuracy | 11.4% |
| Cost | 8196 |
| Alternative 26 | |
|---|---|
| Accuracy | 8.6% |
| Cost | 7808 |
| Alternative 27 | |
|---|---|
| Accuracy | 8.6% |
| Cost | 7808 |
| Alternative 28 | |
|---|---|
| Accuracy | 2.0% |
| Cost | 7680 |
herbie shell --seed 2023122
(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))))