| Alternative 1 | |
|---|---|
| Error | 38.4 |
| Cost | 27720 |
(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 (+ (pow B 2.0) t_0))
(t_2 (sqrt (* F (+ A (- C (hypot B (- A C)))))))
(t_3 (fma B B (* A (* C -4.0))))
(t_4
(-
(/
(sqrt
(*
(* 2.0 (* t_1 F))
(- (+ A C) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0))))))
t_1)))
(t_5 (fma B B t_0)))
(if (<= t_4 -4e-201)
(* t_2 (/ (sqrt (* 2.0 t_5)) (- t_5)))
(if (<= t_4 2e+278)
(/
(-
(sqrt
(*
t_3
(*
(+ A (+ A (* (/ (- (pow (- A) 2.0) (+ (* B B) (* A A))) C) 0.5)))
(* 2.0 F)))))
t_3)
(if (<= t_4 INFINITY)
(/ (* (sqrt (* F (* C (+ A A)))) (- (sqrt (* A -8.0)))) t_3)
(* t_2 (/ (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 = C * (A * -4.0);
double t_1 = pow(B, 2.0) + t_0;
double t_2 = sqrt((F * (A + (C - hypot(B, (A - C))))));
double t_3 = fma(B, B, (A * (C * -4.0)));
double t_4 = -(sqrt(((2.0 * (t_1 * F)) * ((A + C) - sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_1);
double t_5 = fma(B, B, t_0);
double tmp;
if (t_4 <= -4e-201) {
tmp = t_2 * (sqrt((2.0 * t_5)) / -t_5);
} else if (t_4 <= 2e+278) {
tmp = -sqrt((t_3 * ((A + (A + (((pow(-A, 2.0) - ((B * B) + (A * A))) / C) * 0.5))) * (2.0 * F)))) / t_3;
} else if (t_4 <= ((double) INFINITY)) {
tmp = (sqrt((F * (C * (A + A)))) * -sqrt((A * -8.0))) / t_3;
} else {
tmp = t_2 * (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 = Float64(C * Float64(A * -4.0)) t_1 = Float64((B ^ 2.0) + t_0) t_2 = sqrt(Float64(F * Float64(A + Float64(C - hypot(B, Float64(A - C)))))) t_3 = fma(B, B, Float64(A * Float64(C * -4.0))) t_4 = Float64(-Float64(sqrt(Float64(Float64(2.0 * Float64(t_1 * F)) * Float64(Float64(A + C) - sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / t_1)) t_5 = fma(B, B, t_0) tmp = 0.0 if (t_4 <= -4e-201) tmp = Float64(t_2 * Float64(sqrt(Float64(2.0 * t_5)) / Float64(-t_5))); elseif (t_4 <= 2e+278) tmp = Float64(Float64(-sqrt(Float64(t_3 * Float64(Float64(A + Float64(A + Float64(Float64(Float64((Float64(-A) ^ 2.0) - Float64(Float64(B * B) + Float64(A * A))) / C) * 0.5))) * Float64(2.0 * F))))) / t_3); elseif (t_4 <= Inf) tmp = Float64(Float64(sqrt(Float64(F * Float64(C * Float64(A + A)))) * Float64(-sqrt(Float64(A * -8.0)))) / t_3); else tmp = Float64(t_2 * 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[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B, 2.0], $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(F * N[(A + N[(C - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = (-N[(N[Sqrt[N[(N[(2.0 * N[(t$95$1 * 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$1), $MachinePrecision])}, Block[{t$95$5 = N[(B * B + t$95$0), $MachinePrecision]}, If[LessEqual[t$95$4, -4e-201], N[(t$95$2 * N[(N[Sqrt[N[(2.0 * t$95$5), $MachinePrecision]], $MachinePrecision] / (-t$95$5)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 2e+278], N[((-N[Sqrt[N[(t$95$3 * N[(N[(A + N[(A + N[(N[(N[(N[Power[(-A), 2.0], $MachinePrecision] - N[(N[(B * B), $MachinePrecision] + N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$3), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(N[(N[Sqrt[N[(F * N[(C * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A * -8.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$3), $MachinePrecision], N[(t$95$2 * 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 := C \cdot \left(A \cdot -4\right)\\
t_1 := {B}^{2} + t_0\\
t_2 := \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}\\
t_3 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
t_4 := -\frac{\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_1}\\
t_5 := \mathsf{fma}\left(B, B, t_0\right)\\
\mathbf{if}\;t_4 \leq -4 \cdot 10^{-201}:\\
\;\;\;\;t_2 \cdot \frac{\sqrt{2 \cdot t_5}}{-t_5}\\
\mathbf{elif}\;t_4 \leq 2 \cdot 10^{+278}:\\
\;\;\;\;\frac{-\sqrt{t_3 \cdot \left(\left(A + \left(A + \frac{{\left(-A\right)}^{2} - \left(B \cdot B + A \cdot A\right)}{C} \cdot 0.5\right)\right) \cdot \left(2 \cdot F\right)\right)}}{t_3}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(C \cdot \left(A + A\right)\right)} \cdot \left(-\sqrt{A \cdot -8}\right)}{t_3}\\
\mathbf{else}:\\
\;\;\;\;t_2 \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))) < -3.99999999999999978e-201Initial program 37.6
Simplified31.5
[Start]37.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}
\] |
|---|
Applied egg-rr21.2
Simplified21.3
[Start]21.2 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \cdot \sqrt{F \cdot \left(C - \left(\mathsf{hypot}\left(B, A - C\right) - A\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
|---|---|
*-commutative [=>]21.2 | \[ \frac{-\color{blue}{\sqrt{F \cdot \left(C - \left(\mathsf{hypot}\left(B, A - C\right) - A\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)}
\] |
associate-+l- [<=]21.3 | \[ \frac{-\sqrt{F \cdot \color{blue}{\left(\left(C - \mathsf{hypot}\left(B, A - C\right)\right) + A\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 [<=]21.3 | \[ \frac{-\sqrt{F \cdot \color{blue}{\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 [=>]21.3 | \[ \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-rr21.4
Simplified21.3
[Start]21.4 | \[ \left(\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(C \cdot -4\right)\right)}\right) \cdot \frac{1}{-\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
|---|---|
associate-*l* [=>]21.4 | \[ \color{blue}{\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \left(\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \frac{1}{-\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}\right)}
\] |
associate-*r/ [=>]21.3 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \color{blue}{\frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot 1}{-\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}}
\] |
*-rgt-identity [=>]21.3 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\color{blue}{\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}}{-\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
associate-*r* [=>]21.3 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot C\right) \cdot -4}\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [=>]21.3 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, \color{blue}{\left(C \cdot A\right)} \cdot -4\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
associate-*l* [=>]21.3 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, \color{blue}{C \cdot \left(A \cdot -4\right)}\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [<=]21.3 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \color{blue}{\left(C \cdot -4\right)}\right)}
\] |
associate-*r* [=>]21.3 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}{-\mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot C\right) \cdot -4}\right)}
\] |
*-commutative [=>]21.3 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}{-\mathsf{fma}\left(B, B, \color{blue}{\left(C \cdot A\right)} \cdot -4\right)}
\] |
associate-*l* [=>]21.3 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}{-\mathsf{fma}\left(B, B, \color{blue}{C \cdot \left(A \cdot -4\right)}\right)}
\] |
if -3.99999999999999978e-201 < (/.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))) < 1.99999999999999993e278Initial program 49.5
Simplified47.2
[Start]49.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 43.6
Simplified43.6
[Start]43.6 | \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\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(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
unpow2 [=>]43.6 | \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(A + \left(A + -0.5 \cdot \frac{\left(\color{blue}{B \cdot B} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}}{C}\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
unpow2 [=>]43.6 | \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(A + \left(A + -0.5 \cdot \frac{\left(B \cdot B + \color{blue}{A \cdot A}\right) - {\left(-1 \cdot A\right)}^{2}}{C}\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 [=>]43.6 | \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(A + \left(A + -0.5 \cdot \frac{\left(B \cdot B + A \cdot A\right) - {\color{blue}{\left(-A\right)}}^{2}}{C}\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
if 1.99999999999999993e278 < (/.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 63.8
Simplified44.2
[Start]63.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}
\] |
|---|
Taylor expanded in C around inf 58.0
Simplified58.0
[Start]58.0 | \[ \frac{-\sqrt{-8 \cdot \left(A \cdot \left(\left(A - -1 \cdot A\right) \cdot \left(C \cdot F\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
associate-*r* [=>]58.0 | \[ \frac{-\sqrt{\color{blue}{\left(-8 \cdot A\right) \cdot \left(\left(A - -1 \cdot A\right) \cdot \left(C \cdot F\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
*-commutative [=>]58.0 | \[ \frac{-\sqrt{\left(-8 \cdot A\right) \cdot \color{blue}{\left(\left(C \cdot F\right) \cdot \left(A - -1 \cdot A\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
*-commutative [=>]58.0 | \[ \frac{-\sqrt{\left(-8 \cdot A\right) \cdot \left(\color{blue}{\left(F \cdot C\right)} \cdot \left(A - -1 \cdot A\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
mul-1-neg [=>]58.0 | \[ \frac{-\sqrt{\left(-8 \cdot A\right) \cdot \left(\left(F \cdot C\right) \cdot \left(A - \color{blue}{\left(-A\right)}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
Applied egg-rr45.4
Simplified41.5
[Start]45.4 | \[ \frac{-\sqrt{\left(F \cdot C\right) \cdot \left(A - \left(-A\right)\right)} \cdot \sqrt{-8 \cdot A}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
associate-*l* [=>]41.5 | \[ \frac{-\sqrt{\color{blue}{F \cdot \left(C \cdot \left(A - \left(-A\right)\right)\right)}} \cdot \sqrt{-8 \cdot A}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
*-commutative [=>]41.5 | \[ \frac{-\sqrt{F \cdot \left(C \cdot \left(A - \left(-A\right)\right)\right)} \cdot \sqrt{\color{blue}{A \cdot -8}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\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.2
[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-rr63.9
Simplified63.9
[Start]63.9 | \[ \frac{-\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \cdot \sqrt{F \cdot \left(C - \left(\mathsf{hypot}\left(B, A - C\right) - A\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
|---|---|
*-commutative [=>]63.9 | \[ \frac{-\color{blue}{\sqrt{F \cdot \left(C - \left(\mathsf{hypot}\left(B, A - C\right) - A\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)}
\] |
associate-+l- [<=]63.9 | \[ \frac{-\sqrt{F \cdot \color{blue}{\left(\left(C - \mathsf{hypot}\left(B, A - C\right)\right) + A\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 [<=]63.9 | \[ \frac{-\sqrt{F \cdot \color{blue}{\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 [=>]63.9 | \[ \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-rr63.9
Simplified63.9
[Start]63.9 | \[ \left(\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(C \cdot -4\right)\right)}\right) \cdot \frac{1}{-\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
|---|---|
associate-*l* [=>]63.9 | \[ \color{blue}{\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \left(\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \frac{1}{-\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}\right)}
\] |
associate-*r/ [=>]63.9 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \color{blue}{\frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot 1}{-\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}}
\] |
*-rgt-identity [=>]63.9 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\color{blue}{\sqrt{2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}}{-\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
associate-*r* [=>]63.9 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot C\right) \cdot -4}\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [=>]63.9 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, \color{blue}{\left(C \cdot A\right)} \cdot -4\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
associate-*l* [=>]63.9 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, \color{blue}{C \cdot \left(A \cdot -4\right)}\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}
\] |
*-commutative [<=]63.9 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \color{blue}{\left(C \cdot -4\right)}\right)}
\] |
associate-*r* [=>]63.9 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}{-\mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot C\right) \cdot -4}\right)}
\] |
*-commutative [=>]63.9 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}{-\mathsf{fma}\left(B, B, \color{blue}{\left(C \cdot A\right)} \cdot -4\right)}
\] |
associate-*l* [=>]63.9 | \[ \sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}}{-\mathsf{fma}\left(B, B, \color{blue}{C \cdot \left(A \cdot -4\right)}\right)}
\] |
Taylor expanded in B around -inf 53.1
Final simplification39.9
| Alternative 1 | |
|---|---|
| Error | 38.4 |
| Cost | 27720 |
| Alternative 2 | |
|---|---|
| Error | 38.4 |
| Cost | 27720 |
| Alternative 3 | |
|---|---|
| Error | 41.0 |
| Cost | 27540 |
| Alternative 4 | |
|---|---|
| Error | 40.9 |
| Cost | 27144 |
| Alternative 5 | |
|---|---|
| Error | 41.4 |
| Cost | 21832 |
| Alternative 6 | |
|---|---|
| Error | 41.1 |
| Cost | 21000 |
| Alternative 7 | |
|---|---|
| Error | 41.4 |
| Cost | 20228 |
| Alternative 8 | |
|---|---|
| Error | 42.9 |
| Cost | 20168 |
| Alternative 9 | |
|---|---|
| Error | 43.7 |
| Cost | 14472 |
| Alternative 10 | |
|---|---|
| Error | 44.8 |
| Cost | 14344 |
| Alternative 11 | |
|---|---|
| Error | 44.9 |
| Cost | 13640 |
| Alternative 12 | |
|---|---|
| Error | 49.6 |
| Cost | 13508 |
| Alternative 13 | |
|---|---|
| Error | 54.0 |
| Cost | 8716 |
| Alternative 14 | |
|---|---|
| Error | 54.5 |
| Cost | 8584 |
| Alternative 15 | |
|---|---|
| Error | 55.3 |
| Cost | 7684 |
| Alternative 16 | |
|---|---|
| Error | 60.8 |
| Cost | 6976 |
| Alternative 17 | |
|---|---|
| Error | 60.4 |
| Cost | 6976 |
| Alternative 18 | |
|---|---|
| Error | 62.0 |
| Cost | 6848 |
herbie shell --seed 2023031
(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))))