| Alternative 1 | |
|---|---|
| Error | 31.4 |
| Cost | 27848 |
(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 (* C (* A -4.0)))
(t_1 (fma B B t_0))
(t_2 (- (sqrt F)))
(t_3 (fma -4.0 (* A C) (* B B)))
(t_4 (+ (pow B 2.0) t_0))
(t_5
(-
(/
(sqrt
(*
(* 2.0 (* t_4 F))
(+ (+ A C) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0))))))
t_4)))
(t_6 (sqrt (* 2.0 (+ A (+ C (hypot B (- A C))))))))
(if (<= t_5 -5e-216)
(* t_6 (/ t_2 (sqrt t_3)))
(if (<= t_5 5e+25)
(/
(- (sqrt (* 2.0 (* t_1 (* F (fma 2.0 A (* -0.5 (/ (* B B) C))))))))
t_1)
(if (<= t_5 INFINITY)
(/ (* t_6 (- (sqrt (* F t_3)))) t_3)
(* t_6 (/ t_2 (fma -2.0 (/ A (/ B 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 = C * (A * -4.0);
double t_1 = fma(B, B, t_0);
double t_2 = -sqrt(F);
double t_3 = fma(-4.0, (A * C), (B * B));
double t_4 = pow(B, 2.0) + t_0;
double t_5 = -(sqrt(((2.0 * (t_4 * F)) * ((A + C) + sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_4);
double t_6 = sqrt((2.0 * (A + (C + hypot(B, (A - C))))));
double tmp;
if (t_5 <= -5e-216) {
tmp = t_6 * (t_2 / sqrt(t_3));
} else if (t_5 <= 5e+25) {
tmp = -sqrt((2.0 * (t_1 * (F * fma(2.0, A, (-0.5 * ((B * B) / C))))))) / t_1;
} else if (t_5 <= ((double) INFINITY)) {
tmp = (t_6 * -sqrt((F * t_3))) / t_3;
} else {
tmp = t_6 * (t_2 / fma(-2.0, (A / (B / 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 = Float64(C * Float64(A * -4.0)) t_1 = fma(B, B, t_0) t_2 = Float64(-sqrt(F)) t_3 = fma(-4.0, Float64(A * C), Float64(B * B)) t_4 = Float64((B ^ 2.0) + t_0) t_5 = Float64(-Float64(sqrt(Float64(Float64(2.0 * Float64(t_4 * F)) * Float64(Float64(A + C) + sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / t_4)) t_6 = sqrt(Float64(2.0 * Float64(A + Float64(C + hypot(B, Float64(A - C)))))) tmp = 0.0 if (t_5 <= -5e-216) tmp = Float64(t_6 * Float64(t_2 / sqrt(t_3))); elseif (t_5 <= 5e+25) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(F * fma(2.0, A, Float64(-0.5 * Float64(Float64(B * B) / C)))))))) / t_1); elseif (t_5 <= Inf) tmp = Float64(Float64(t_6 * Float64(-sqrt(Float64(F * t_3)))) / t_3); else tmp = Float64(t_6 * Float64(t_2 / fma(-2.0, Float64(A / Float64(B / 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[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B * B + t$95$0), $MachinePrecision]}, Block[{t$95$2 = (-N[Sqrt[F], $MachinePrecision])}, Block[{t$95$3 = N[(-4.0 * N[(A * C), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Power[B, 2.0], $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$5 = (-N[(N[Sqrt[N[(N[(2.0 * N[(t$95$4 * 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$4), $MachinePrecision])}, Block[{t$95$6 = N[Sqrt[N[(2.0 * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$5, -5e-216], N[(t$95$6 * N[(t$95$2 / N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 5e+25], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(F * N[(2.0 * A + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[(N[(t$95$6 * (-N[Sqrt[N[(F * t$95$3), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$3), $MachinePrecision], N[(t$95$6 * N[(t$95$2 / N[(-2.0 * N[(A / N[(B / C), $MachinePrecision]), $MachinePrecision] + B), $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 := C \cdot \left(A \cdot -4\right)\\
t_1 := \mathsf{fma}\left(B, B, t_0\right)\\
t_2 := -\sqrt{F}\\
t_3 := \mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)\\
t_4 := {B}^{2} + t_0\\
t_5 := -\frac{\sqrt{\left(2 \cdot \left(t_4 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_4}\\
t_6 := \sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}\\
\mathbf{if}\;t_5 \leq -5 \cdot 10^{-216}:\\
\;\;\;\;t_6 \cdot \frac{t_2}{\sqrt{t_3}}\\
\mathbf{elif}\;t_5 \leq 5 \cdot 10^{+25}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(F \cdot \mathsf{fma}\left(2, A, -0.5 \cdot \frac{B \cdot B}{C}\right)\right)\right)}}{t_1}\\
\mathbf{elif}\;t_5 \leq \infty:\\
\;\;\;\;\frac{t_6 \cdot \left(-\sqrt{F \cdot t_3}\right)}{t_3}\\
\mathbf{else}:\\
\;\;\;\;t_6 \cdot \frac{t_2}{\mathsf{fma}\left(-2, \frac{A}{\frac{B}{C}}, B\right)}\\
\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))) < -5.00000000000000021e-216Initial program 38.1
Simplified32.6
[Start]38.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-rr24.2
Simplified23.7
[Start]24.2 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)} \cdot \sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right) \cdot F}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
|---|---|
*-commutative [<=]24.2 | \[ \frac{-\color{blue}{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right) \cdot F} \cdot \sqrt{2 \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 [=>]24.2 | \[ \frac{-\sqrt{\color{blue}{F \cdot \mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}} \cdot \sqrt{2 \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 [=>]24.2 | \[ \frac{-\sqrt{F \cdot \mathsf{fma}\left(-4, \color{blue}{C \cdot A}, B \cdot B\right)} \cdot \sqrt{2 \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 [=>]24.2 | \[ \frac{-\sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{2 \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+ [<=]23.7 | \[ \frac{-\sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{2 \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)}
\] |
Applied egg-rr24.3
Simplified23.7
[Start]24.3 | \[ \sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \left(\left(-\sqrt{2 \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)\right)}\right) \cdot \frac{1}{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}\right)
\] |
|---|---|
associate-*r/ [=>]24.2 | \[ \sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \color{blue}{\frac{\left(-\sqrt{2 \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)\right)}\right) \cdot 1}{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}}
\] |
*-rgt-identity [=>]24.2 | \[ \sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \frac{\color{blue}{-\sqrt{2 \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)\right)}}}{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}
\] |
distribute-frac-neg [=>]24.2 | \[ \sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \color{blue}{\left(-\frac{\sqrt{2 \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)\right)}}{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}\right)}
\] |
distribute-rgt-neg-out [=>]24.2 | \[ \color{blue}{-\sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \frac{\sqrt{2 \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)\right)}}{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}}
\] |
associate-*r/ [=>]24.2 | \[ -\color{blue}{\frac{\sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{2 \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)\right)}}{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}}
\] |
Applied egg-rr13.1
Simplified13.1
[Start]13.1 | \[ -\sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \left(\frac{\sqrt{F}}{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}} \cdot \frac{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}}{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}}\right)
\] |
|---|---|
associate-*l/ [=>]13.1 | \[ -\sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \color{blue}{\frac{\sqrt{F} \cdot \frac{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}}{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}}}{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}}}
\] |
*-inverses [=>]13.1 | \[ -\sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{F} \cdot \color{blue}{1}}{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}}
\] |
if -5.00000000000000021e-216 < (/.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))) < 5.00000000000000024e25Initial program 54.9
Simplified51.7
[Start]54.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}
\] |
|---|
Taylor expanded in C around -inf 43.8
Simplified43.8
[Start]43.8 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot \left(F \cdot \left(2 \cdot A + -0.5 \cdot \frac{{B}^{2}}{C}\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
|---|---|
fma-def [=>]43.8 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot \left(F \cdot \color{blue}{\mathsf{fma}\left(2, A, -0.5 \cdot \frac{{B}^{2}}{C}\right)}\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
unpow2 [=>]43.8 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot \left(F \cdot \mathsf{fma}\left(2, A, -0.5 \cdot \frac{\color{blue}{B \cdot B}}{C}\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
if 5.00000000000000024e25 < (/.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 46.8
Simplified30.9
[Start]46.8 | \[ \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-rr14.8
Simplified14.8
[Start]14.8 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)} \cdot \sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right) \cdot F}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
|---|---|
*-commutative [<=]14.8 | \[ \frac{-\color{blue}{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right) \cdot F} \cdot \sqrt{2 \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 [=>]14.8 | \[ \frac{-\sqrt{\color{blue}{F \cdot \mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}} \cdot \sqrt{2 \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 [=>]14.8 | \[ \frac{-\sqrt{F \cdot \mathsf{fma}\left(-4, \color{blue}{C \cdot A}, B \cdot B\right)} \cdot \sqrt{2 \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 [=>]14.8 | \[ \frac{-\sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{2 \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+ [<=]14.8 | \[ \frac{-\sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{2 \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 +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
Simplified63.4
[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}
\] |
|---|
Applied egg-rr64.0
Simplified64.0
[Start]64.0 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(A + C\right)\right)} \cdot \sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right) \cdot F}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
|---|---|
*-commutative [<=]64.0 | \[ \frac{-\color{blue}{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right) \cdot F} \cdot \sqrt{2 \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 [=>]64.0 | \[ \frac{-\sqrt{\color{blue}{F \cdot \mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}} \cdot \sqrt{2 \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 [=>]64.0 | \[ \frac{-\sqrt{F \cdot \mathsf{fma}\left(-4, \color{blue}{C \cdot A}, B \cdot B\right)} \cdot \sqrt{2 \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 [=>]64.0 | \[ \frac{-\sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{2 \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+ [<=]64.0 | \[ \frac{-\sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{2 \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)}
\] |
Applied egg-rr64.0
Simplified64.0
[Start]64.0 | \[ \sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \left(\left(-\sqrt{2 \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)\right)}\right) \cdot \frac{1}{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}\right)
\] |
|---|---|
associate-*r/ [=>]64.0 | \[ \sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \color{blue}{\frac{\left(-\sqrt{2 \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)\right)}\right) \cdot 1}{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}}
\] |
*-rgt-identity [=>]64.0 | \[ \sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \frac{\color{blue}{-\sqrt{2 \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)\right)}}}{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}
\] |
distribute-frac-neg [=>]64.0 | \[ \sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \color{blue}{\left(-\frac{\sqrt{2 \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)\right)}}{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}\right)}
\] |
distribute-rgt-neg-out [=>]64.0 | \[ \color{blue}{-\sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \frac{\sqrt{2 \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)\right)}}{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}}
\] |
associate-*r/ [=>]64.0 | \[ -\color{blue}{\frac{\sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{2 \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)\right)}}{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}}
\] |
Applied egg-rr63.8
Simplified61.9
[Start]63.8 | \[ -\sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \left(\frac{\sqrt{F}}{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}} \cdot \frac{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}}{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}}\right)
\] |
|---|---|
associate-*l/ [=>]63.8 | \[ -\sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \color{blue}{\frac{\sqrt{F} \cdot \frac{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}}{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}}}{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}}}
\] |
*-inverses [=>]61.9 | \[ -\sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{F} \cdot \color{blue}{1}}{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}}
\] |
Taylor expanded in A around 0 51.0
Simplified49.9
[Start]51.0 | \[ -\sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{F} \cdot 1}{-2 \cdot \frac{A \cdot C}{B} + B}
\] |
|---|---|
fma-def [=>]51.0 | \[ -\sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{F} \cdot 1}{\color{blue}{\mathsf{fma}\left(-2, \frac{A \cdot C}{B}, B\right)}}
\] |
associate-/l* [=>]49.9 | \[ -\sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{F} \cdot 1}{\mathsf{fma}\left(-2, \color{blue}{\frac{A}{\frac{B}{C}}}, B\right)}
\] |
Final simplification33.6
| Alternative 1 | |
|---|---|
| Error | 31.4 |
| Cost | 27848 |
| Alternative 2 | |
|---|---|
| Error | 33.9 |
| Cost | 27592 |
| Alternative 3 | |
|---|---|
| Error | 34.6 |
| Cost | 27340 |
| Alternative 4 | |
|---|---|
| Error | 36.3 |
| Cost | 21640 |
| Alternative 5 | |
|---|---|
| Error | 36.3 |
| Cost | 21000 |
| Alternative 6 | |
|---|---|
| Error | 36.3 |
| Cost | 21000 |
| Alternative 7 | |
|---|---|
| Error | 34.7 |
| Cost | 20424 |
| Alternative 8 | |
|---|---|
| Error | 42.2 |
| Cost | 20356 |
| Alternative 9 | |
|---|---|
| Error | 42.2 |
| Cost | 20292 |
| Alternative 10 | |
|---|---|
| Error | 44.8 |
| Cost | 15044 |
| Alternative 11 | |
|---|---|
| Error | 50.0 |
| Cost | 13448 |
| Alternative 12 | |
|---|---|
| Error | 53.1 |
| Cost | 8584 |
| Alternative 13 | |
|---|---|
| Error | 55.8 |
| Cost | 8452 |
| Alternative 14 | |
|---|---|
| Error | 56.8 |
| Cost | 8196 |
| Alternative 15 | |
|---|---|
| Error | 56.5 |
| Cost | 8196 |
| Alternative 16 | |
|---|---|
| Error | 58.2 |
| Cost | 7808 |
| Alternative 17 | |
|---|---|
| Error | 62.6 |
| Cost | 7680 |
| Alternative 18 | |
|---|---|
| Error | 62.9 |
| Cost | 7552 |
| Alternative 19 | |
|---|---|
| Error | 62.9 |
| Cost | 7488 |
herbie shell --seed 2023034
(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))))