| Alternative 1 | |
|---|---|
| Error | 39.8 |
| Cost | 21516 |
(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 (- (sqrt (* 2.0 (* F (+ C (- A (hypot B (- A C)))))))))
(t_1 (fma A (* C -4.0) (* B B))))
(if (<= B -8.8e-85)
(/ t_0 (- B))
(if (<= B 1.2e-196)
(/
(- (sqrt (* t_1 (* (+ A (+ A (* -0.5 (/ (* B B) C)))) (* 2.0 F)))))
t_1)
(if (<= B 62000000000.0)
(/
(-
(pow
(pow
(* 2.0 (fma 2.0 (* C (* F (* B B))) (* -8.0 (* (* F C) (* C A)))))
0.25)
2.0))
(fma B B (* A (* C -4.0))))
(/ t_0 (fma -2.0 (/ C (/ B A)) 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 = -sqrt((2.0 * (F * (C + (A - hypot(B, (A - C)))))));
double t_1 = fma(A, (C * -4.0), (B * B));
double tmp;
if (B <= -8.8e-85) {
tmp = t_0 / -B;
} else if (B <= 1.2e-196) {
tmp = -sqrt((t_1 * ((A + (A + (-0.5 * ((B * B) / C)))) * (2.0 * F)))) / t_1;
} else if (B <= 62000000000.0) {
tmp = -pow(pow((2.0 * fma(2.0, (C * (F * (B * B))), (-8.0 * ((F * C) * (C * A))))), 0.25), 2.0) / fma(B, B, (A * (C * -4.0)));
} else {
tmp = t_0 / fma(-2.0, (C / (B / A)), 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 = Float64(-sqrt(Float64(2.0 * Float64(F * Float64(C + Float64(A - hypot(B, Float64(A - C)))))))) t_1 = fma(A, Float64(C * -4.0), Float64(B * B)) tmp = 0.0 if (B <= -8.8e-85) tmp = Float64(t_0 / Float64(-B)); elseif (B <= 1.2e-196) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(Float64(A + Float64(A + Float64(-0.5 * Float64(Float64(B * B) / C)))) * Float64(2.0 * F))))) / t_1); elseif (B <= 62000000000.0) tmp = Float64(Float64(-((Float64(2.0 * fma(2.0, Float64(C * Float64(F * Float64(B * B))), Float64(-8.0 * Float64(Float64(F * C) * Float64(C * A))))) ^ 0.25) ^ 2.0)) / fma(B, B, Float64(A * Float64(C * -4.0)))); else tmp = Float64(t_0 / fma(-2.0, Float64(C / Float64(B / A)), 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[N[(2.0 * N[(F * N[(C + N[(A - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])}, Block[{t$95$1 = N[(A * N[(C * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -8.8e-85], N[(t$95$0 / (-B)), $MachinePrecision], If[LessEqual[B, 1.2e-196], N[((-N[Sqrt[N[(t$95$1 * N[(N[(A + N[(A + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[B, 62000000000.0], N[((-N[Power[N[Power[N[(2.0 * N[(2.0 * N[(C * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-8.0 * N[(N[(F * C), $MachinePrecision] * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision], 2.0], $MachinePrecision]) / N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(-2.0 * N[(C / N[(B / A), $MachinePrecision]), $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 := -\sqrt{2 \cdot \left(F \cdot \left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}\\
t_1 := \mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)\\
\mathbf{if}\;B \leq -8.8 \cdot 10^{-85}:\\
\;\;\;\;\frac{t_0}{-B}\\
\mathbf{elif}\;B \leq 1.2 \cdot 10^{-196}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(\left(A + \left(A + -0.5 \cdot \frac{B \cdot B}{C}\right)\right) \cdot \left(2 \cdot F\right)\right)}}{t_1}\\
\mathbf{elif}\;B \leq 62000000000:\\
\;\;\;\;\frac{-{\left({\left(2 \cdot \mathsf{fma}\left(2, C \cdot \left(F \cdot \left(B \cdot B\right)\right), -8 \cdot \left(\left(F \cdot C\right) \cdot \left(C \cdot A\right)\right)\right)\right)}^{0.25}\right)}^{2}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{\mathsf{fma}\left(-2, \frac{C}{\frac{B}{A}}, B\right)}\\
\end{array}
if B < -8.8e-85Initial program 52.9
Simplified50.6
[Start]52.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-rr46.9
Simplified46.7
[Start]46.9 | \[ \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\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(A, C \cdot -4, B \cdot B\right)}
\] |
|---|---|
associate--l+ [=>]46.7 | \[ \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)} \cdot \sqrt{\color{blue}{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}
\] |
Applied egg-rr46.9
Simplified45.8
[Start]46.9 | \[ \frac{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}} \cdot \frac{-\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}
\] |
|---|---|
*-commutative [=>]46.9 | \[ \color{blue}{\frac{-\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}} \cdot \frac{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}}
\] |
*-inverses [=>]45.9 | \[ \frac{-\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}} \cdot \color{blue}{1}
\] |
associate-/r/ [<=]45.9 | \[ \color{blue}{\frac{-\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\frac{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}{1}}}
\] |
/-rgt-identity [=>]45.9 | \[ \frac{-\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\color{blue}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}}
\] |
*-commutative [=>]45.9 | \[ \frac{-\sqrt{\color{blue}{\left(2 \cdot F\right) \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)}}}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}
\] |
associate-*l* [=>]45.9 | \[ \frac{-\sqrt{\color{blue}{2 \cdot \left(F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}
\] |
+-commutative [=>]45.9 | \[ \frac{-\sqrt{2 \cdot \left(F \cdot \left(\color{blue}{\left(C + A\right)} - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}
\] |
associate--l+ [=>]45.8 | \[ \frac{-\sqrt{2 \cdot \left(F \cdot \color{blue}{\left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)}\right)}}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}
\] |
Taylor expanded in B around -inf 33.7
Simplified33.7
[Start]33.7 | \[ \frac{-\sqrt{2 \cdot \left(F \cdot \left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-1 \cdot B}
\] |
|---|---|
mul-1-neg [=>]33.7 | \[ \frac{-\sqrt{2 \cdot \left(F \cdot \left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\color{blue}{-B}}
\] |
if -8.8e-85 < B < 1.2000000000000001e-196Initial program 52.5
Simplified46.9
[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 C around inf 51.1
Simplified51.3
[Start]51.1 | \[ \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right) \cdot \left(\left(A + \left(A + -0.5 \cdot \frac{\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}}{C}\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}
\] |
|---|---|
associate--l+ [=>]51.3 | \[ \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right) \cdot \left(\left(A + \left(A + -0.5 \cdot \frac{\color{blue}{{B}^{2} + \left({A}^{2} - {\left(-1 \cdot A\right)}^{2}\right)}}{C}\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}
\] |
unpow2 [=>]51.3 | \[ \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right) \cdot \left(\left(A + \left(A + -0.5 \cdot \frac{\color{blue}{B \cdot B} + \left({A}^{2} - {\left(-1 \cdot A\right)}^{2}\right)}{C}\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}
\] |
unpow2 [=>]51.3 | \[ \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right) \cdot \left(\left(A + \left(A + -0.5 \cdot \frac{B \cdot B + \left(\color{blue}{A \cdot A} - {\left(-1 \cdot A\right)}^{2}\right)}{C}\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}
\] |
mul-1-neg [=>]51.3 | \[ \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right) \cdot \left(\left(A + \left(A + -0.5 \cdot \frac{B \cdot B + \left(A \cdot A - {\color{blue}{\left(-A\right)}}^{2}\right)}{C}\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}
\] |
Taylor expanded in B around 0 49.4
Simplified49.4
[Start]49.4 | \[ \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right) \cdot \left(\left(A + \left(A + -0.5 \cdot \frac{{B}^{2}}{C}\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}
\] |
|---|---|
unpow2 [=>]49.4 | \[ \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right) \cdot \left(\left(A + \left(A + -0.5 \cdot \frac{\color{blue}{B \cdot B}}{C}\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}
\] |
if 1.2000000000000001e-196 < B < 6.2e10Initial program 46.5
Simplified40.0
[Start]46.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 C around -inf 53.8
Simplified53.7
[Start]53.8 | \[ \frac{-\sqrt{2 \cdot \left(2 \cdot \left(C \cdot \left(F \cdot {B}^{2}\right)\right) + -8 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
|---|---|
fma-def [=>]53.8 | \[ \frac{-\sqrt{2 \cdot \color{blue}{\mathsf{fma}\left(2, C \cdot \left(F \cdot {B}^{2}\right), -8 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
associate-*r* [=>]53.7 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(2, \color{blue}{\left(C \cdot F\right) \cdot {B}^{2}}, -8 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [=>]53.7 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(2, \color{blue}{\left(F \cdot C\right)} \cdot {B}^{2}, -8 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
unpow2 [=>]53.7 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(2, \left(F \cdot C\right) \cdot \color{blue}{\left(B \cdot B\right)}, -8 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [=>]53.7 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(2, \left(F \cdot C\right) \cdot \left(B \cdot B\right), -8 \cdot \left(A \cdot \color{blue}{\left(F \cdot {C}^{2}\right)}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
unpow2 [=>]53.7 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(2, \left(F \cdot C\right) \cdot \left(B \cdot B\right), -8 \cdot \left(A \cdot \left(F \cdot \color{blue}{\left(C \cdot C\right)}\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
Applied egg-rr48.7
if 6.2e10 < B Initial program 55.5
Simplified53.8
[Start]55.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}
\] |
|---|
Applied egg-rr48.7
Simplified48.6
[Start]48.7 | \[ \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\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(A, C \cdot -4, B \cdot B\right)}
\] |
|---|---|
associate--l+ [=>]48.6 | \[ \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)} \cdot \sqrt{\color{blue}{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}
\] |
Applied egg-rr48.7
Simplified47.4
[Start]48.7 | \[ \frac{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}} \cdot \frac{-\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}
\] |
|---|---|
*-commutative [=>]48.7 | \[ \color{blue}{\frac{-\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}} \cdot \frac{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}}
\] |
*-inverses [=>]47.5 | \[ \frac{-\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}} \cdot \color{blue}{1}
\] |
associate-/r/ [<=]47.5 | \[ \color{blue}{\frac{-\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\frac{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}{1}}}
\] |
/-rgt-identity [=>]47.5 | \[ \frac{-\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\color{blue}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}}
\] |
*-commutative [=>]47.5 | \[ \frac{-\sqrt{\color{blue}{\left(2 \cdot F\right) \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)}}}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}
\] |
associate-*l* [=>]47.5 | \[ \frac{-\sqrt{\color{blue}{2 \cdot \left(F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}
\] |
+-commutative [=>]47.5 | \[ \frac{-\sqrt{2 \cdot \left(F \cdot \left(\color{blue}{\left(C + A\right)} - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}
\] |
associate--l+ [=>]47.4 | \[ \frac{-\sqrt{2 \cdot \left(F \cdot \color{blue}{\left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)}\right)}}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}}
\] |
Taylor expanded in A around 0 32.2
Simplified31.3
[Start]32.2 | \[ \frac{-\sqrt{2 \cdot \left(F \cdot \left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-2 \cdot \frac{A \cdot C}{B} + B}
\] |
|---|---|
fma-def [=>]32.2 | \[ \frac{-\sqrt{2 \cdot \left(F \cdot \left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\color{blue}{\mathsf{fma}\left(-2, \frac{A \cdot C}{B}, B\right)}}
\] |
*-commutative [=>]32.2 | \[ \frac{-\sqrt{2 \cdot \left(F \cdot \left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(-2, \frac{\color{blue}{C \cdot A}}{B}, B\right)}
\] |
associate-/l* [=>]31.3 | \[ \frac{-\sqrt{2 \cdot \left(F \cdot \left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(-2, \color{blue}{\frac{C}{\frac{B}{A}}}, B\right)}
\] |
Final simplification39.8
| Alternative 1 | |
|---|---|
| Error | 39.8 |
| Cost | 21516 |
| Alternative 2 | |
|---|---|
| Error | 40.2 |
| Cost | 21384 |
| Alternative 3 | |
|---|---|
| Error | 40.3 |
| Cost | 20808 |
| Alternative 4 | |
|---|---|
| Error | 40.3 |
| Cost | 14344 |
| Alternative 5 | |
|---|---|
| Error | 41.4 |
| Cost | 14216 |
| Alternative 6 | |
|---|---|
| Error | 42.7 |
| Cost | 14024 |
| Alternative 7 | |
|---|---|
| Error | 41.7 |
| Cost | 14024 |
| Alternative 8 | |
|---|---|
| Error | 49.2 |
| Cost | 13700 |
| Alternative 9 | |
|---|---|
| Error | 49.1 |
| Cost | 13700 |
| Alternative 10 | |
|---|---|
| Error | 50.0 |
| Cost | 8584 |
| Alternative 11 | |
|---|---|
| Error | 50.1 |
| Cost | 8584 |
| Alternative 12 | |
|---|---|
| Error | 54.2 |
| Cost | 8452 |
| Alternative 13 | |
|---|---|
| Error | 51.9 |
| Cost | 8452 |
| Alternative 14 | |
|---|---|
| Error | 54.4 |
| Cost | 7940 |
| Alternative 15 | |
|---|---|
| Error | 55.1 |
| Cost | 7236 |
| Alternative 16 | |
|---|---|
| Error | 55.2 |
| Cost | 6976 |
herbie shell --seed 2023088
(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))))