| Alternative 1 | |
|---|---|
| Error | 67.07% |
| Cost | 34648 |
(FPCore (A B C F)
:precision binary64
(/
(-
(sqrt
(*
(* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F))
(- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
(- (pow B 2.0) (* (* 4.0 A) C))))(FPCore (A B C F)
:precision binary64
(let* ((t_0 (hypot B (- A C)))
(t_1 (* F (+ C (- A t_0))))
(t_2 (- C t_0))
(t_3 (fma B B (* A (* C -4.0))))
(t_4 (hypot B (sqrt (* -4.0 (* C A)))))
(t_5 (- (sqrt 2.0)))
(t_6 (cbrt t_2)))
(if (<= B -6.8e+101)
(/ (- (sqrt (* B (* 2.0 F)))) t_4)
(if (<= B -1.68e-90)
(/ (- (sqrt (* 2.0 (* t_3 t_1)))) t_3)
(if (<= B -4.2e-241)
(/ (* (sqrt (* F (- C (hypot C B)))) t_5) t_4)
(if (<= B 1.2e-267)
(/ (- (sqrt (* t_3 (* (* 2.0 F) (+ A t_2))))) t_3)
(if (<= B 1.4e-154)
(/ (- (sqrt (* 2.0 t_1))) (hypot B (sqrt (* C (* A -4.0)))))
(if (<= B 2.5e+136)
(/
(*
(sqrt (* F (fma (pow t_6 2.0) t_6 A)))
(- (sqrt (* 2.0 t_3))))
t_3)
(* (/ t_5 B) (sqrt (* F (- 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 = F * (C + (A - t_0));
double t_2 = C - t_0;
double t_3 = fma(B, B, (A * (C * -4.0)));
double t_4 = hypot(B, sqrt((-4.0 * (C * A))));
double t_5 = -sqrt(2.0);
double t_6 = cbrt(t_2);
double tmp;
if (B <= -6.8e+101) {
tmp = -sqrt((B * (2.0 * F))) / t_4;
} else if (B <= -1.68e-90) {
tmp = -sqrt((2.0 * (t_3 * t_1))) / t_3;
} else if (B <= -4.2e-241) {
tmp = (sqrt((F * (C - hypot(C, B)))) * t_5) / t_4;
} else if (B <= 1.2e-267) {
tmp = -sqrt((t_3 * ((2.0 * F) * (A + t_2)))) / t_3;
} else if (B <= 1.4e-154) {
tmp = -sqrt((2.0 * t_1)) / hypot(B, sqrt((C * (A * -4.0))));
} else if (B <= 2.5e+136) {
tmp = (sqrt((F * fma(pow(t_6, 2.0), t_6, A))) * -sqrt((2.0 * t_3))) / t_3;
} else {
tmp = (t_5 / B) * sqrt((F * (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(F * Float64(C + Float64(A - t_0))) t_2 = Float64(C - t_0) t_3 = fma(B, B, Float64(A * Float64(C * -4.0))) t_4 = hypot(B, sqrt(Float64(-4.0 * Float64(C * A)))) t_5 = Float64(-sqrt(2.0)) t_6 = cbrt(t_2) tmp = 0.0 if (B <= -6.8e+101) tmp = Float64(Float64(-sqrt(Float64(B * Float64(2.0 * F)))) / t_4); elseif (B <= -1.68e-90) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_3 * t_1)))) / t_3); elseif (B <= -4.2e-241) tmp = Float64(Float64(sqrt(Float64(F * Float64(C - hypot(C, B)))) * t_5) / t_4); elseif (B <= 1.2e-267) tmp = Float64(Float64(-sqrt(Float64(t_3 * Float64(Float64(2.0 * F) * Float64(A + t_2))))) / t_3); elseif (B <= 1.4e-154) tmp = Float64(Float64(-sqrt(Float64(2.0 * t_1))) / hypot(B, sqrt(Float64(C * Float64(A * -4.0))))); elseif (B <= 2.5e+136) tmp = Float64(Float64(sqrt(Float64(F * fma((t_6 ^ 2.0), t_6, A))) * Float64(-sqrt(Float64(2.0 * t_3)))) / t_3); else tmp = Float64(Float64(t_5 / B) * sqrt(Float64(F * Float64(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[(F * N[(C + N[(A - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(C - t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[B ^ 2 + N[Sqrt[N[(-4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$5 = (-N[Sqrt[2.0], $MachinePrecision])}, Block[{t$95$6 = N[Power[t$95$2, 1/3], $MachinePrecision]}, If[LessEqual[B, -6.8e+101], N[((-N[Sqrt[N[(B * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$4), $MachinePrecision], If[LessEqual[B, -1.68e-90], N[((-N[Sqrt[N[(2.0 * N[(t$95$3 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$3), $MachinePrecision], If[LessEqual[B, -4.2e-241], N[(N[(N[Sqrt[N[(F * N[(C - N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$5), $MachinePrecision] / t$95$4), $MachinePrecision], If[LessEqual[B, 1.2e-267], N[((-N[Sqrt[N[(t$95$3 * N[(N[(2.0 * F), $MachinePrecision] * N[(A + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$3), $MachinePrecision], If[LessEqual[B, 1.4e-154], N[((-N[Sqrt[N[(2.0 * t$95$1), $MachinePrecision]], $MachinePrecision]) / N[Sqrt[B ^ 2 + N[Sqrt[N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.5e+136], N[(N[(N[Sqrt[N[(F * N[(N[Power[t$95$6, 2.0], $MachinePrecision] * t$95$6 + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * t$95$3), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$3), $MachinePrecision], N[(N[(t$95$5 / B), $MachinePrecision] * N[Sqrt[N[(F * N[(C - B), $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 := F \cdot \left(C + \left(A - t_0\right)\right)\\
t_2 := C - t_0\\
t_3 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
t_4 := \mathsf{hypot}\left(B, \sqrt{-4 \cdot \left(C \cdot A\right)}\right)\\
t_5 := -\sqrt{2}\\
t_6 := \sqrt[3]{t_2}\\
\mathbf{if}\;B \leq -6.8 \cdot 10^{+101}:\\
\;\;\;\;\frac{-\sqrt{B \cdot \left(2 \cdot F\right)}}{t_4}\\
\mathbf{elif}\;B \leq -1.68 \cdot 10^{-90}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_3 \cdot t_1\right)}}{t_3}\\
\mathbf{elif}\;B \leq -4.2 \cdot 10^{-241}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(C - \mathsf{hypot}\left(C, B\right)\right)} \cdot t_5}{t_4}\\
\mathbf{elif}\;B \leq 1.2 \cdot 10^{-267}:\\
\;\;\;\;\frac{-\sqrt{t_3 \cdot \left(\left(2 \cdot F\right) \cdot \left(A + t_2\right)\right)}}{t_3}\\
\mathbf{elif}\;B \leq 1.4 \cdot 10^{-154}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot t_1}}{\mathsf{hypot}\left(B, \sqrt{C \cdot \left(A \cdot -4\right)}\right)}\\
\mathbf{elif}\;B \leq 2.5 \cdot 10^{+136}:\\
\;\;\;\;\frac{\sqrt{F \cdot \mathsf{fma}\left({t_6}^{2}, t_6, A\right)} \cdot \left(-\sqrt{2 \cdot t_3}\right)}{t_3}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_5}{B} \cdot \sqrt{F \cdot \left(C - B\right)}\\
\end{array}
if B < -6.80000000000000034e101Initial program 94.73
Simplified93.92
[Start]94.73 | \[ \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-rr91.25
Simplified91.25
[Start]91.25 | \[ \frac{-\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right) \cdot \sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
associate-*r* [=>]91.25 | \[ \frac{-\mathsf{hypot}\left(B, \sqrt{\color{blue}{\left(A \cdot C\right) \cdot -4}}\right) \cdot \sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
Applied egg-rr69.93
Simplified69.65
[Start]69.93 | \[ \frac{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)} \cdot \frac{-\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}
\] |
|---|---|
*-inverses [=>]69.65 | \[ \color{blue}{1} \cdot \frac{-\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}
\] |
associate-*r* [=>]69.65 | \[ 1 \cdot \frac{-\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{hypot}\left(B, \sqrt{\color{blue}{\left(A \cdot C\right) \cdot -4}}\right)}
\] |
*-commutative [=>]69.65 | \[ 1 \cdot \frac{-\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{hypot}\left(B, \sqrt{\color{blue}{\left(C \cdot A\right)} \cdot -4}\right)}
\] |
Taylor expanded in B around -inf 73.57
if -6.80000000000000034e101 < B < -1.6799999999999999e-90Initial program 65.51
Simplified57.44
[Start]65.51 | \[ \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 -1.6799999999999999e-90 < B < -4.1999999999999999e-241Initial program 80.04
Simplified70.18
[Start]80.04 | \[ \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-rr79.27
Simplified79.28
[Start]79.27 | \[ \frac{-\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right) \cdot \sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
associate-*r* [=>]79.28 | \[ \frac{-\mathsf{hypot}\left(B, \sqrt{\color{blue}{\left(A \cdot C\right) \cdot -4}}\right) \cdot \sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
Applied egg-rr76.42
Simplified76.22
[Start]76.42 | \[ \frac{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)} \cdot \frac{-\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}
\] |
|---|---|
*-inverses [=>]76.22 | \[ \color{blue}{1} \cdot \frac{-\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}
\] |
associate-*r* [=>]76.22 | \[ 1 \cdot \frac{-\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{hypot}\left(B, \sqrt{\color{blue}{\left(A \cdot C\right) \cdot -4}}\right)}
\] |
*-commutative [=>]76.22 | \[ 1 \cdot \frac{-\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{hypot}\left(B, \sqrt{\color{blue}{\left(C \cdot A\right)} \cdot -4}\right)}
\] |
Taylor expanded in A around 0 86.57
Simplified82.21
[Start]86.57 | \[ 1 \cdot \frac{-\sqrt{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F} \cdot \sqrt{2}}{\mathsf{hypot}\left(B, \sqrt{\left(C \cdot A\right) \cdot -4}\right)}
\] |
|---|---|
+-commutative [=>]86.57 | \[ 1 \cdot \frac{-\sqrt{\left(C - \sqrt{\color{blue}{{C}^{2} + {B}^{2}}}\right) \cdot F} \cdot \sqrt{2}}{\mathsf{hypot}\left(B, \sqrt{\left(C \cdot A\right) \cdot -4}\right)}
\] |
unpow2 [=>]86.57 | \[ 1 \cdot \frac{-\sqrt{\left(C - \sqrt{\color{blue}{C \cdot C} + {B}^{2}}\right) \cdot F} \cdot \sqrt{2}}{\mathsf{hypot}\left(B, \sqrt{\left(C \cdot A\right) \cdot -4}\right)}
\] |
unpow2 [=>]86.57 | \[ 1 \cdot \frac{-\sqrt{\left(C - \sqrt{C \cdot C + \color{blue}{B \cdot B}}\right) \cdot F} \cdot \sqrt{2}}{\mathsf{hypot}\left(B, \sqrt{\left(C \cdot A\right) \cdot -4}\right)}
\] |
hypot-def [=>]82.21 | \[ 1 \cdot \frac{-\sqrt{\left(C - \color{blue}{\mathsf{hypot}\left(C, B\right)}\right) \cdot F} \cdot \sqrt{2}}{\mathsf{hypot}\left(B, \sqrt{\left(C \cdot A\right) \cdot -4}\right)}
\] |
if -4.1999999999999999e-241 < B < 1.1999999999999999e-267Initial program 82.6
Simplified72.22
[Start]82.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}
\] |
|---|
if 1.1999999999999999e-267 < B < 1.40000000000000006e-154Initial program 85.05
Simplified76.76
[Start]85.05 | \[ \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-rr84.99
Simplified84.99
[Start]84.99 | \[ \frac{-\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right) \cdot \sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
associate-*r* [=>]84.99 | \[ \frac{-\mathsf{hypot}\left(B, \sqrt{\color{blue}{\left(A \cdot C\right) \cdot -4}}\right) \cdot \sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
Applied egg-rr80.84
Simplified80.43
[Start]80.84 | \[ \frac{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)} \cdot \frac{-\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}
\] |
|---|---|
*-commutative [=>]80.84 | \[ \color{blue}{\frac{-\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)} \cdot \frac{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}}
\] |
*-inverses [=>]80.65 | \[ \frac{-\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)} \cdot \color{blue}{1}
\] |
associate-/r/ [<=]80.65 | \[ \color{blue}{\frac{-\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\frac{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}{1}}}
\] |
/-rgt-identity [=>]80.65 | \[ \frac{-\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\color{blue}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}}
\] |
distribute-frac-neg [=>]80.65 | \[ \color{blue}{-\frac{\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}}
\] |
if 1.40000000000000006e-154 < B < 2.5000000000000001e136Initial program 71.22
Simplified64.15
[Start]71.22 | \[ \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-rr59.17
Simplified59.17
[Start]59.17 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \cdot \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
|---|---|
*-commutative [=>]59.17 | \[ \frac{-\color{blue}{\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [=>]59.17 | \[ \frac{-\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \color{blue}{\left(C \cdot -4\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
Applied egg-rr59.56
if 2.5000000000000001e136 < B Initial program 98.41
Simplified98.41
[Start]98.41 | \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\] |
|---|
Taylor expanded in C around 0 98.38
Simplified98.38
[Start]98.38 | \[ \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \left(C - \sqrt{{B}^{2} + {A}^{2}}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
|---|---|
unpow2 [=>]98.38 | \[ \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \left(C - \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
unpow2 [=>]98.38 | \[ \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \left(C - \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
Taylor expanded in A around 0 56.67
Simplified56.67
[Start]56.67 | \[ -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C - B\right) \cdot F}\right)
\] |
|---|---|
associate-*r* [=>]56.67 | \[ \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{\left(C - B\right) \cdot F}}
\] |
associate-*r/ [=>]56.67 | \[ \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}} \cdot \sqrt{\left(C - B\right) \cdot F}
\] |
mul-1-neg [=>]56.67 | \[ \frac{\color{blue}{-\sqrt{2}}}{B} \cdot \sqrt{\left(C - B\right) \cdot F}
\] |
*-commutative [<=]56.67 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{\color{blue}{F \cdot \left(C - B\right)}}
\] |
Final simplification66.86
| Alternative 1 | |
|---|---|
| Error | 67.07% |
| Cost | 34648 |
| Alternative 2 | |
|---|---|
| Error | 66.78% |
| Cost | 34648 |
| Alternative 3 | |
|---|---|
| Error | 67.64% |
| Cost | 33420 |
| Alternative 4 | |
|---|---|
| Error | 67.15% |
| Cost | 27984 |
| Alternative 5 | |
|---|---|
| Error | 66.9% |
| Cost | 27984 |
| Alternative 6 | |
|---|---|
| Error | 67.29% |
| Cost | 27864 |
| Alternative 7 | |
|---|---|
| Error | 68.6% |
| Cost | 27540 |
| Alternative 8 | |
|---|---|
| Error | 68.6% |
| Cost | 27540 |
| Alternative 9 | |
|---|---|
| Error | 68.64% |
| Cost | 27540 |
| Alternative 10 | |
|---|---|
| Error | 71.02% |
| Cost | 27020 |
| Alternative 11 | |
|---|---|
| Error | 70.79% |
| Cost | 27016 |
| Alternative 12 | |
|---|---|
| Error | 71.39% |
| Cost | 22096 |
| Alternative 13 | |
|---|---|
| Error | 72.2% |
| Cost | 21524 |
| Alternative 14 | |
|---|---|
| Error | 71.16% |
| Cost | 21200 |
| Alternative 15 | |
|---|---|
| Error | 72.13% |
| Cost | 21200 |
| Alternative 16 | |
|---|---|
| Error | 71.27% |
| Cost | 20940 |
| Alternative 17 | |
|---|---|
| Error | 73.69% |
| Cost | 20428 |
| Alternative 18 | |
|---|---|
| Error | 73.47% |
| Cost | 20364 |
| Alternative 19 | |
|---|---|
| Error | 76.32% |
| Cost | 15236 |
| Alternative 20 | |
|---|---|
| Error | 76.54% |
| Cost | 14852 |
| Alternative 21 | |
|---|---|
| Error | 76.92% |
| Cost | 14472 |
| Alternative 22 | |
|---|---|
| Error | 76.86% |
| Cost | 14472 |
| Alternative 23 | |
|---|---|
| Error | 78.12% |
| Cost | 14344 |
| Alternative 24 | |
|---|---|
| Error | 77.96% |
| Cost | 14216 |
| Alternative 25 | |
|---|---|
| Error | 79.21% |
| Cost | 14216 |
| Alternative 26 | |
|---|---|
| Error | 79.1% |
| Cost | 13704 |
| Alternative 27 | |
|---|---|
| Error | 88.37% |
| Cost | 8716 |
| Alternative 28 | |
|---|---|
| Error | 85.79% |
| Cost | 8716 |
| Alternative 29 | |
|---|---|
| Error | 82.53% |
| Cost | 8584 |
| Alternative 30 | |
|---|---|
| Error | 82.51% |
| Cost | 8584 |
| Alternative 31 | |
|---|---|
| Error | 88.36% |
| Cost | 8452 |
| Alternative 32 | |
|---|---|
| Error | 90.8% |
| Cost | 7556 |
| Alternative 33 | |
|---|---|
| Error | 96.87% |
| Cost | 6848 |
| Alternative 34 | |
|---|---|
| Error | 96.91% |
| Cost | 6848 |
herbie shell --seed 2023102
(FPCore (A B C F)
:name "ABCF->ab-angle b"
:precision binary64
(/ (- (sqrt (* (* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F)) (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))) (- (pow B 2.0) (* (* 4.0 A) C))))