| Alternative 1 | |
|---|---|
| Error | 43.6 |
| Cost | 27984 |
(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 (fma B B (* A (* C -4.0))))
(t_2 (- (pow B 2.0) (* (* 4.0 A) C)))
(t_3
(-
(/
(sqrt
(*
(* 2.0 (* t_2 F))
(- (+ A C) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0))))))
t_2))))
(if (<= t_3 -2e-187)
(/ (* (sqrt (* F (- A (- t_0 C)))) (- (sqrt (* 2.0 t_1)))) t_1)
(if (<= t_3 1e-164)
(/
(-
(sqrt
(*
t_1
(*
(+ A (- A (* (/ (- (- (pow (- A) 2.0) (* A A)) (* B B)) C) -0.5)))
(* 2.0 F)))))
t_1)
(if (<= t_3 INFINITY)
(sqrt (/ (+ C (- A t_0)) (/ (fma B B (* C (* A -4.0))) (* 2.0 F))))
(*
(sqrt (* F (- C (fma 0.5 (* C (/ C B)) B))))
(/ (- (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 = hypot(B, (A - C));
double t_1 = fma(B, B, (A * (C * -4.0)));
double t_2 = pow(B, 2.0) - ((4.0 * A) * C);
double t_3 = -(sqrt(((2.0 * (t_2 * F)) * ((A + C) - sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_2);
double tmp;
if (t_3 <= -2e-187) {
tmp = (sqrt((F * (A - (t_0 - C)))) * -sqrt((2.0 * t_1))) / t_1;
} else if (t_3 <= 1e-164) {
tmp = -sqrt((t_1 * ((A + (A - ((((pow(-A, 2.0) - (A * A)) - (B * B)) / C) * -0.5))) * (2.0 * F)))) / t_1;
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt(((C + (A - t_0)) / (fma(B, B, (C * (A * -4.0))) / (2.0 * F))));
} else {
tmp = sqrt((F * (C - fma(0.5, (C * (C / B)), B)))) * (-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 = hypot(B, Float64(A - C)) t_1 = fma(B, B, Float64(A * Float64(C * -4.0))) t_2 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) t_3 = Float64(-Float64(sqrt(Float64(Float64(2.0 * Float64(t_2 * F)) * Float64(Float64(A + C) - sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / t_2)) tmp = 0.0 if (t_3 <= -2e-187) tmp = Float64(Float64(sqrt(Float64(F * Float64(A - Float64(t_0 - C)))) * Float64(-sqrt(Float64(2.0 * t_1)))) / t_1); elseif (t_3 <= 1e-164) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(Float64(A + Float64(A - Float64(Float64(Float64(Float64((Float64(-A) ^ 2.0) - Float64(A * A)) - Float64(B * B)) / C) * -0.5))) * Float64(2.0 * F))))) / t_1); elseif (t_3 <= Inf) tmp = sqrt(Float64(Float64(C + Float64(A - t_0)) / Float64(fma(B, B, Float64(C * Float64(A * -4.0))) / Float64(2.0 * F)))); else tmp = Float64(sqrt(Float64(F * Float64(C - fma(0.5, Float64(C * Float64(C / B)), B)))) * 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[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$1 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = (-N[(N[Sqrt[N[(N[(2.0 * N[(t$95$2 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision])}, If[LessEqual[t$95$3, -2e-187], N[(N[(N[Sqrt[N[(F * N[(A - N[(t$95$0 - C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * t$95$1), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, 1e-164], N[((-N[Sqrt[N[(t$95$1 * N[(N[(A + N[(A - N[(N[(N[(N[(N[Power[(-A), 2.0], $MachinePrecision] - N[(A * A), $MachinePrecision]), $MachinePrecision] - N[(B * B), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(N[(C + N[(A - t$95$0), $MachinePrecision]), $MachinePrecision] / N[(N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(F * N[(C - N[(0.5 * N[(C * N[(C / B), $MachinePrecision]), $MachinePrecision] + B), $MachinePrecision]), $MachinePrecision]), $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{hypot}\left(B, A - C\right)\\
t_1 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
t_2 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
t_3 := -\frac{\sqrt{\left(2 \cdot \left(t_2 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_2}\\
\mathbf{if}\;t_3 \leq -2 \cdot 10^{-187}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(A - \left(t_0 - C\right)\right)} \cdot \left(-\sqrt{2 \cdot t_1}\right)}{t_1}\\
\mathbf{elif}\;t_3 \leq 10^{-164}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(\left(A + \left(A - \frac{\left({\left(-A\right)}^{2} - A \cdot A\right) - B \cdot B}{C} \cdot -0.5\right)\right) \cdot \left(2 \cdot F\right)\right)}}{t_1}\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\sqrt{\frac{C + \left(A - t_0\right)}{\frac{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}{2 \cdot F}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{F \cdot \left(C - \mathsf{fma}\left(0.5, C \cdot \frac{C}{B}, B\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -2e-187Initial program 37.9
Simplified32.6
[Start]37.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-rr22.2
Simplified22.2
[Start]22.2 | \[ \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 [=>]22.2 | \[ \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 [=>]22.2 | \[ \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)}
\] |
if -2e-187 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < 9.99999999999999962e-165Initial program 59.4
Simplified55.8
[Start]59.4 | \[ \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 45.2
Simplified45.2
[Start]45.2 | \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(\left(A + -0.5 \cdot \frac{\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}}{C}\right) - -1 \cdot A\right) \cdot \left(2 \cdot F\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
associate--l+ [=>]45.2 | \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\color{blue}{\left(A + \left(-0.5 \cdot \frac{\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}}{C} - -1 \cdot A\right)\right)} \cdot \left(2 \cdot F\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
associate--l+ [=>]45.2 | \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(A + \left(-0.5 \cdot \frac{\color{blue}{{B}^{2} + \left({A}^{2} - {\left(-1 \cdot A\right)}^{2}\right)}}{C} - -1 \cdot A\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
unpow2 [=>]45.2 | \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(A + \left(-0.5 \cdot \frac{\color{blue}{B \cdot B} + \left({A}^{2} - {\left(-1 \cdot A\right)}^{2}\right)}{C} - -1 \cdot A\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
unpow2 [=>]45.2 | \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(A + \left(-0.5 \cdot \frac{B \cdot B + \left(\color{blue}{A \cdot A} - {\left(-1 \cdot A\right)}^{2}\right)}{C} - -1 \cdot A\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
mul-1-neg [=>]45.2 | \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(A + \left(-0.5 \cdot \frac{B \cdot B + \left(A \cdot A - {\color{blue}{\left(-A\right)}}^{2}\right)}{C} - -1 \cdot A\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
mul-1-neg [=>]45.2 | \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(A + \left(-0.5 \cdot \frac{B \cdot B + \left(A \cdot A - {\left(-A\right)}^{2}\right)}{C} - \color{blue}{\left(-A\right)}\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
if 9.99999999999999962e-165 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < +inf.0Initial program 41.4
Simplified27.8
[Start]41.4 | \[ \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.0
Simplified64.0
[Start]64.0 | \[ \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(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}
\] |
|---|---|
*-inverses [=>]64.0 | \[ \color{blue}{1} \cdot \frac{\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}
\] |
associate-*r* [=>]64.0 | \[ 1 \cdot \frac{\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{hypot}\left(B, \sqrt{\color{blue}{\left(A \cdot C\right) \cdot -4}}\right)}
\] |
Applied egg-rr40.6
Simplified21.8
[Start]40.6 | \[ 1 \cdot \left(e^{\mathsf{log1p}\left(\sqrt{\frac{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}\right)} - 1\right)
\] |
|---|---|
expm1-def [=>]23.6 | \[ 1 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}\right)\right)}
\] |
expm1-log1p [=>]22.2 | \[ 1 \cdot \color{blue}{\sqrt{\frac{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}}
\] |
associate-/l* [=>]21.8 | \[ 1 \cdot \sqrt{\color{blue}{\frac{\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)}{\frac{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}{2 \cdot F}}}}
\] |
+-commutative [=>]21.8 | \[ 1 \cdot \sqrt{\frac{\color{blue}{\left(C + A\right)} - \mathsf{hypot}\left(B, A - C\right)}{\frac{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}{2 \cdot F}}}
\] |
associate-+r- [<=]21.8 | \[ 1 \cdot \sqrt{\frac{\color{blue}{C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)}}{\frac{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}{2 \cdot F}}}
\] |
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) Initial program 64.0
Simplified64.0
[Start]64.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 B around inf 64.0
Taylor expanded in A around 0 56.4
Simplified55.0
[Start]56.4 | \[ -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \left(0.5 \cdot \frac{{C}^{2}}{B} + B\right)\right)}\right)
\] |
|---|---|
mul-1-neg [=>]56.4 | \[ \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \left(0.5 \cdot \frac{{C}^{2}}{B} + B\right)\right)}}
\] |
distribute-rgt-neg-in [=>]56.4 | \[ \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C - \left(0.5 \cdot \frac{{C}^{2}}{B} + B\right)\right)}\right)}
\] |
fma-def [=>]56.4 | \[ \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C - \color{blue}{\mathsf{fma}\left(0.5, \frac{{C}^{2}}{B}, B\right)}\right)}\right)
\] |
unpow2 [=>]56.4 | \[ \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C - \mathsf{fma}\left(0.5, \frac{\color{blue}{C \cdot C}}{B}, B\right)\right)}\right)
\] |
associate-/l* [=>]55.0 | \[ \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C - \mathsf{fma}\left(0.5, \color{blue}{\frac{C}{\frac{B}{C}}}, B\right)\right)}\right)
\] |
associate-/r/ [=>]55.0 | \[ \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C - \mathsf{fma}\left(0.5, \color{blue}{\frac{C}{B} \cdot C}, B\right)\right)}\right)
\] |
Final simplification39.6
| Alternative 1 | |
|---|---|
| Error | 43.6 |
| Cost | 27984 |
| Alternative 2 | |
|---|---|
| Error | 45.9 |
| Cost | 27468 |
| Alternative 3 | |
|---|---|
| Error | 45.0 |
| Cost | 27468 |
| Alternative 4 | |
|---|---|
| Error | 46.3 |
| Cost | 21964 |
| Alternative 5 | |
|---|---|
| Error | 48.0 |
| Cost | 21140 |
| Alternative 6 | |
|---|---|
| Error | 47.0 |
| Cost | 21000 |
| Alternative 7 | |
|---|---|
| Error | 48.3 |
| Cost | 20488 |
| Alternative 8 | |
|---|---|
| Error | 48.3 |
| Cost | 20488 |
| Alternative 9 | |
|---|---|
| Error | 47.2 |
| Cost | 20488 |
| Alternative 10 | |
|---|---|
| Error | 49.3 |
| Cost | 15368 |
| Alternative 11 | |
|---|---|
| Error | 47.8 |
| Cost | 15368 |
| Alternative 12 | |
|---|---|
| Error | 51.0 |
| Cost | 14344 |
| Alternative 13 | |
|---|---|
| Error | 51.5 |
| Cost | 8716 |
| Alternative 14 | |
|---|---|
| Error | 51.2 |
| Cost | 8716 |
| Alternative 15 | |
|---|---|
| Error | 51.3 |
| Cost | 8716 |
| Alternative 16 | |
|---|---|
| Error | 54.0 |
| Cost | 8452 |
| Alternative 17 | |
|---|---|
| Error | 55.3 |
| Cost | 7680 |
| Alternative 18 | |
|---|---|
| Error | 55.7 |
| Cost | 7616 |
| Alternative 19 | |
|---|---|
| Error | 62.8 |
| Cost | 7488 |
| Alternative 20 | |
|---|---|
| Error | 63.0 |
| Cost | 7424 |
| Alternative 21 | |
|---|---|
| Error | 62.9 |
| Cost | 7296 |
herbie shell --seed 2023039
(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))))