
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) + sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * 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]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) + sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * 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]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0}
\end{array}
\end{array}
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (* -4.0 (* A C)))
(t_1 (- (sqrt (+ (+ A C) (hypot B (- A C))))))
(t_2 (- (* B B) (* 4.0 (* A C))))
(t_3 (fma B B (* A (* C -4.0)))))
(if (<= A -0.0013)
(/
(- (sqrt (* 2.0 (* (* t_3 F) (fma 2.0 C (* -0.5 (/ (* B B) A)))))))
t_3)
(if (<= A 7.2e-299)
(/ (* (* (sqrt (* 2.0 F)) (sqrt (fma B B t_0))) t_1) t_2)
(/ (* (pow (* (* 2.0 F) (+ (* B B) t_0)) 0.5) t_1) t_2)))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = -4.0 * (A * C);
double t_1 = -sqrt(((A + C) + hypot(B, (A - C))));
double t_2 = (B * B) - (4.0 * (A * C));
double t_3 = fma(B, B, (A * (C * -4.0)));
double tmp;
if (A <= -0.0013) {
tmp = -sqrt((2.0 * ((t_3 * F) * fma(2.0, C, (-0.5 * ((B * B) / A)))))) / t_3;
} else if (A <= 7.2e-299) {
tmp = ((sqrt((2.0 * F)) * sqrt(fma(B, B, t_0))) * t_1) / t_2;
} else {
tmp = (pow(((2.0 * F) * ((B * B) + t_0)), 0.5) * t_1) / t_2;
}
return tmp;
}
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(-4.0 * Float64(A * C)) t_1 = Float64(-sqrt(Float64(Float64(A + C) + hypot(B, Float64(A - C))))) t_2 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) t_3 = fma(B, B, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (A <= -0.0013) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(t_3 * F) * fma(2.0, C, Float64(-0.5 * Float64(Float64(B * B) / A))))))) / t_3); elseif (A <= 7.2e-299) tmp = Float64(Float64(Float64(sqrt(Float64(2.0 * F)) * sqrt(fma(B, B, t_0))) * t_1) / t_2); else tmp = Float64(Float64((Float64(Float64(2.0 * F) * Float64(Float64(B * B) + t_0)) ^ 0.5) * t_1) / t_2); end return tmp end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])}, Block[{t$95$2 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -0.0013], N[((-N[Sqrt[N[(2.0 * N[(N[(t$95$3 * F), $MachinePrecision] * N[(2.0 * C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$3), $MachinePrecision], If[LessEqual[A, 7.2e-299], N[(N[(N[(N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(B * B + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[(N[Power[N[(N[(2.0 * F), $MachinePrecision] * N[(N[(B * B), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] * t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := -4 \cdot \left(A \cdot C\right)\\
t_1 := -\sqrt{\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)}\\
t_2 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_3 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;A \leq -0.0013:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(t_3 \cdot F\right) \cdot \mathsf{fma}\left(2, C, -0.5 \cdot \frac{B \cdot B}{A}\right)\right)}}{t_3}\\
\mathbf{elif}\;A \leq 7.2 \cdot 10^{-299}:\\
\;\;\;\;\frac{\left(\sqrt{2 \cdot F} \cdot \sqrt{\mathsf{fma}\left(B, B, t_0\right)}\right) \cdot t_1}{t_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\left(2 \cdot F\right) \cdot \left(B \cdot B + t_0\right)\right)}^{0.5} \cdot t_1}{t_2}\\
\end{array}
\end{array}
if A < -0.0012999999999999999Initial program 3.2%
Simplified5.0%
Taylor expanded in A around -inf 31.5%
fma-def31.5%
unpow231.5%
Simplified31.5%
if -0.0012999999999999999 < A < 7.2e-299Initial program 29.5%
associate-*l*29.5%
unpow229.5%
+-commutative29.5%
unpow229.5%
associate-*l*29.5%
unpow229.5%
Simplified29.5%
sqrt-prod28.4%
*-commutative28.4%
unpow228.4%
hypot-udef34.7%
Applied egg-rr34.7%
pow1/234.7%
associate-*r*34.7%
cancel-sign-sub-inv34.7%
metadata-eval34.7%
Applied egg-rr34.7%
pow1/234.7%
sqrt-prod42.5%
fma-def42.5%
Applied egg-rr42.5%
*-commutative42.5%
Simplified42.5%
if 7.2e-299 < A Initial program 24.3%
associate-*l*24.3%
unpow224.3%
+-commutative24.3%
unpow224.3%
associate-*l*24.3%
unpow224.3%
Simplified24.3%
sqrt-prod30.1%
*-commutative30.1%
unpow230.1%
hypot-udef41.8%
Applied egg-rr41.8%
pow1/241.8%
associate-*r*41.9%
cancel-sign-sub-inv41.9%
metadata-eval41.9%
Applied egg-rr41.9%
Final simplification39.1%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* A (* C -4.0)))))
(if (<= A -0.0014)
(/
(- (sqrt (* 2.0 (* (* t_0 F) (fma 2.0 C (* -0.5 (/ (* B B) A)))))))
t_0)
(/
(*
(pow (* (* 2.0 F) (+ (* B B) (* -4.0 (* A C)))) 0.5)
(- (sqrt (+ (+ A C) (hypot B (- A C))))))
(- (* B B) (* 4.0 (* A C)))))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (A * (C * -4.0)));
double tmp;
if (A <= -0.0014) {
tmp = -sqrt((2.0 * ((t_0 * F) * fma(2.0, C, (-0.5 * ((B * B) / A)))))) / t_0;
} else {
tmp = (pow(((2.0 * F) * ((B * B) + (-4.0 * (A * C)))), 0.5) * -sqrt(((A + C) + hypot(B, (A - C))))) / ((B * B) - (4.0 * (A * C)));
}
return tmp;
}
A, C = sort([A, C]) function code(A, B, C, F) t_0 = fma(B, B, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (A <= -0.0014) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(t_0 * F) * fma(2.0, C, Float64(-0.5 * Float64(Float64(B * B) / A))))))) / t_0); else tmp = Float64(Float64((Float64(Float64(2.0 * F) * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))) ^ 0.5) * Float64(-sqrt(Float64(Float64(A + C) + hypot(B, Float64(A - C)))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))); end return tmp end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -0.0014], N[((-N[Sqrt[N[(2.0 * N[(N[(t$95$0 * F), $MachinePrecision] * N[(2.0 * C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Power[N[(N[(2.0 * F), $MachinePrecision] * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] * (-N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;A \leq -0.0014:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(t_0 \cdot F\right) \cdot \mathsf{fma}\left(2, C, -0.5 \cdot \frac{B \cdot B}{A}\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\left(2 \cdot F\right) \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)}^{0.5} \cdot \left(-\sqrt{\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)}\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
\end{array}
\end{array}
if A < -0.00139999999999999999Initial program 3.2%
Simplified5.0%
Taylor expanded in A around -inf 31.5%
fma-def31.5%
unpow231.5%
Simplified31.5%
if -0.00139999999999999999 < A Initial program 26.0%
associate-*l*26.0%
unpow226.0%
+-commutative26.0%
unpow226.0%
associate-*l*26.0%
unpow226.0%
Simplified26.0%
sqrt-prod29.5%
*-commutative29.5%
unpow229.5%
hypot-udef39.5%
Applied egg-rr39.5%
pow1/239.5%
associate-*r*39.5%
cancel-sign-sub-inv39.5%
metadata-eval39.5%
Applied egg-rr39.5%
Final simplification37.2%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma C (* A -4.0) (* B B))))
(if (<= A -0.0058)
(/
(- (sqrt (* 2.0 (* (* F t_0) (+ C (+ C (* -0.5 (/ (* B B) A))))))))
t_0)
(/
(*
(pow (* (* 2.0 F) (+ (* B B) (* -4.0 (* A C)))) 0.5)
(- (sqrt (+ (+ A C) (hypot B (- A C))))))
(- (* B B) (* 4.0 (* A C)))))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = fma(C, (A * -4.0), (B * B));
double tmp;
if (A <= -0.0058) {
tmp = -sqrt((2.0 * ((F * t_0) * (C + (C + (-0.5 * ((B * B) / A))))))) / t_0;
} else {
tmp = (pow(((2.0 * F) * ((B * B) + (-4.0 * (A * C)))), 0.5) * -sqrt(((A + C) + hypot(B, (A - C))))) / ((B * B) - (4.0 * (A * C)));
}
return tmp;
}
A, C = sort([A, C]) function code(A, B, C, F) t_0 = fma(C, Float64(A * -4.0), Float64(B * B)) tmp = 0.0 if (A <= -0.0058) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(C + Float64(C + Float64(-0.5 * Float64(Float64(B * B) / A)))))))) / t_0); else tmp = Float64(Float64((Float64(Float64(2.0 * F) * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))) ^ 0.5) * Float64(-sqrt(Float64(Float64(A + C) + hypot(B, Float64(A - C)))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))); end return tmp end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -0.0058], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(C + N[(C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Power[N[(N[(2.0 * F), $MachinePrecision] * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] * (-N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\\
\mathbf{if}\;A \leq -0.0058:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\right)\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\left(2 \cdot F\right) \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)}^{0.5} \cdot \left(-\sqrt{\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)}\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
\end{array}
\end{array}
if A < -0.0058Initial program 3.2%
Simplified8.9%
Taylor expanded in A around -inf 31.5%
unpow231.5%
Simplified31.5%
if -0.0058 < A Initial program 26.0%
associate-*l*26.0%
unpow226.0%
+-commutative26.0%
unpow226.0%
associate-*l*26.0%
unpow226.0%
Simplified26.0%
sqrt-prod29.5%
*-commutative29.5%
unpow229.5%
hypot-udef39.5%
Applied egg-rr39.5%
pow1/239.5%
associate-*r*39.5%
cancel-sign-sub-inv39.5%
metadata-eval39.5%
Applied egg-rr39.5%
Final simplification37.2%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma C (* A -4.0) (* B B))) (t_1 (- (* B B) (* 4.0 (* A C)))))
(if (<= A -0.0024)
(/
(- (sqrt (* 2.0 (* (* F t_0) (+ C (+ C (* -0.5 (/ (* B B) A))))))))
t_0)
(/
(* (sqrt (+ (+ A C) (hypot B (- A C)))) (- (sqrt (* 2.0 (* F t_1)))))
t_1))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = fma(C, (A * -4.0), (B * B));
double t_1 = (B * B) - (4.0 * (A * C));
double tmp;
if (A <= -0.0024) {
tmp = -sqrt((2.0 * ((F * t_0) * (C + (C + (-0.5 * ((B * B) / A))))))) / t_0;
} else {
tmp = (sqrt(((A + C) + hypot(B, (A - C)))) * -sqrt((2.0 * (F * t_1)))) / t_1;
}
return tmp;
}
A, C = sort([A, C]) function code(A, B, C, F) t_0 = fma(C, Float64(A * -4.0), Float64(B * B)) t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) tmp = 0.0 if (A <= -0.0024) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(C + Float64(C + Float64(-0.5 * Float64(Float64(B * B) / A)))))))) / t_0); else tmp = Float64(Float64(sqrt(Float64(Float64(A + C) + hypot(B, Float64(A - C)))) * Float64(-sqrt(Float64(2.0 * Float64(F * t_1))))) / t_1); end return tmp end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -0.0024], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(C + N[(C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\\
t_1 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;A \leq -0.0024:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\right)\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_1\right)}\right)}{t_1}\\
\end{array}
\end{array}
if A < -0.00239999999999999979Initial program 3.2%
Simplified8.9%
Taylor expanded in A around -inf 31.5%
unpow231.5%
Simplified31.5%
if -0.00239999999999999979 < A Initial program 26.0%
associate-*l*26.0%
unpow226.0%
+-commutative26.0%
unpow226.0%
associate-*l*26.0%
unpow226.0%
Simplified26.0%
sqrt-prod29.5%
*-commutative29.5%
unpow229.5%
hypot-udef39.5%
Applied egg-rr39.5%
Final simplification37.2%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* A (* C -4.0)))))
(if (<= B -1.25e-13)
(/
(*
(pow (* F (* 2.0 (* B B))) 0.5)
(- (sqrt (+ (+ A C) (hypot B (- A C))))))
(- (* B B) (* 4.0 (* A C))))
(if (<= B 3700000000000.0)
(/ (- (sqrt (* 2.0 (* (* t_0 F) (* 2.0 C))))) t_0)
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ C (hypot C B))))))))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (A * (C * -4.0)));
double tmp;
if (B <= -1.25e-13) {
tmp = (pow((F * (2.0 * (B * B))), 0.5) * -sqrt(((A + C) + hypot(B, (A - C))))) / ((B * B) - (4.0 * (A * C)));
} else if (B <= 3700000000000.0) {
tmp = -sqrt((2.0 * ((t_0 * F) * (2.0 * C)))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * -sqrt((F * (C + hypot(C, B))));
}
return tmp;
}
A, C = sort([A, C]) function code(A, B, C, F) t_0 = fma(B, B, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (B <= -1.25e-13) tmp = Float64(Float64((Float64(F * Float64(2.0 * Float64(B * B))) ^ 0.5) * Float64(-sqrt(Float64(Float64(A + C) + hypot(B, Float64(A - C)))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))); elseif (B <= 3700000000000.0) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(t_0 * F) * Float64(2.0 * C))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(C + hypot(C, B)))))); end return tmp end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -1.25e-13], N[(N[(N[Power[N[(F * N[(2.0 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] * (-N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3700000000000.0], N[((-N[Sqrt[N[(2.0 * N[(N[(t$95$0 * F), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B \leq -1.25 \cdot 10^{-13}:\\
\;\;\;\;\frac{{\left(F \cdot \left(2 \cdot \left(B \cdot B\right)\right)\right)}^{0.5} \cdot \left(-\sqrt{\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)}\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
\mathbf{elif}\;B \leq 3700000000000:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(t_0 \cdot F\right) \cdot \left(2 \cdot C\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)}\right)\\
\end{array}
\end{array}
if B < -1.24999999999999997e-13Initial program 13.8%
associate-*l*13.8%
unpow213.8%
+-commutative13.8%
unpow213.8%
associate-*l*13.8%
unpow213.8%
Simplified13.8%
sqrt-prod19.0%
*-commutative19.0%
unpow219.0%
hypot-udef20.5%
Applied egg-rr20.5%
pow1/220.5%
associate-*r*20.5%
cancel-sign-sub-inv20.5%
metadata-eval20.5%
Applied egg-rr20.5%
Taylor expanded in B around inf 21.0%
associate-*r*21.1%
*-commutative21.1%
associate-*r*21.1%
unpow221.1%
Simplified21.1%
if -1.24999999999999997e-13 < B < 3.7e12Initial program 22.7%
Simplified29.8%
Taylor expanded in A around -inf 26.3%
if 3.7e12 < B Initial program 18.3%
Simplified22.1%
Taylor expanded in A around 0 25.0%
mul-1-neg25.0%
distribute-rgt-neg-in25.0%
*-commutative25.0%
+-commutative25.0%
unpow225.0%
unpow225.0%
hypot-def46.1%
Simplified46.1%
Final simplification28.9%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* A (* C -4.0)))))
(if (<= B -1.1e-15)
(/
(* (sqrt (* 2.0 (* F (* B B)))) (- (sqrt (+ (+ A C) (hypot B (- A C))))))
(- (* B B) (* 4.0 (* A C))))
(if (<= B 10000000000.0)
(/ (- (sqrt (* 2.0 (* (* t_0 F) (* 2.0 C))))) t_0)
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ C (hypot C B))))))))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (A * (C * -4.0)));
double tmp;
if (B <= -1.1e-15) {
tmp = (sqrt((2.0 * (F * (B * B)))) * -sqrt(((A + C) + hypot(B, (A - C))))) / ((B * B) - (4.0 * (A * C)));
} else if (B <= 10000000000.0) {
tmp = -sqrt((2.0 * ((t_0 * F) * (2.0 * C)))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * -sqrt((F * (C + hypot(C, B))));
}
return tmp;
}
A, C = sort([A, C]) function code(A, B, C, F) t_0 = fma(B, B, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (B <= -1.1e-15) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(B * B)))) * Float64(-sqrt(Float64(Float64(A + C) + hypot(B, Float64(A - C)))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))); elseif (B <= 10000000000.0) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(t_0 * F) * Float64(2.0 * C))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(C + hypot(C, B)))))); end return tmp end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -1.1e-15], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 10000000000.0], N[((-N[Sqrt[N[(2.0 * N[(N[(t$95$0 * F), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B \leq -1.1 \cdot 10^{-15}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B\right)\right)} \cdot \left(-\sqrt{\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)}\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
\mathbf{elif}\;B \leq 10000000000:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(t_0 \cdot F\right) \cdot \left(2 \cdot C\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)}\right)\\
\end{array}
\end{array}
if B < -1.09999999999999993e-15Initial program 13.8%
associate-*l*13.8%
unpow213.8%
+-commutative13.8%
unpow213.8%
associate-*l*13.8%
unpow213.8%
Simplified13.8%
sqrt-prod19.0%
*-commutative19.0%
unpow219.0%
hypot-udef20.5%
Applied egg-rr20.5%
Taylor expanded in B around inf 21.0%
unpow221.0%
Simplified21.0%
if -1.09999999999999993e-15 < B < 1e10Initial program 22.7%
Simplified29.8%
Taylor expanded in A around -inf 26.3%
if 1e10 < B Initial program 18.3%
Simplified22.1%
Taylor expanded in A around 0 25.0%
mul-1-neg25.0%
distribute-rgt-neg-in25.0%
*-commutative25.0%
+-commutative25.0%
unpow225.0%
unpow225.0%
hypot-def46.1%
Simplified46.1%
Final simplification28.9%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* A (* C -4.0)))) (t_1 (+ C (hypot C B))))
(if (<= B -4.4e-13)
(*
(sqrt (* 2.0 (* t_1 (* F (* B B)))))
(/ -1.0 (- (* B B) (* 4.0 (* A C)))))
(if (<= B 64000000000000.0)
(/ (- (sqrt (* 2.0 (* (* t_0 F) (* 2.0 C))))) t_0)
(* (/ (sqrt 2.0) B) (- (sqrt (* F t_1))))))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (A * (C * -4.0)));
double t_1 = C + hypot(C, B);
double tmp;
if (B <= -4.4e-13) {
tmp = sqrt((2.0 * (t_1 * (F * (B * B))))) * (-1.0 / ((B * B) - (4.0 * (A * C))));
} else if (B <= 64000000000000.0) {
tmp = -sqrt((2.0 * ((t_0 * F) * (2.0 * C)))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * -sqrt((F * t_1));
}
return tmp;
}
A, C = sort([A, C]) function code(A, B, C, F) t_0 = fma(B, B, Float64(A * Float64(C * -4.0))) t_1 = Float64(C + hypot(C, B)) tmp = 0.0 if (B <= -4.4e-13) tmp = Float64(sqrt(Float64(2.0 * Float64(t_1 * Float64(F * Float64(B * B))))) * Float64(-1.0 / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))))); elseif (B <= 64000000000000.0) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(t_0 * F) * Float64(2.0 * C))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * t_1)))); end return tmp end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -4.4e-13], N[(N[Sqrt[N[(2.0 * N[(t$95$1 * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 64000000000000.0], N[((-N[Sqrt[N[(2.0 * N[(N[(t$95$0 * F), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * t$95$1), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := C + \mathsf{hypot}\left(C, B\right)\\
\mathbf{if}\;B \leq -4.4 \cdot 10^{-13}:\\
\;\;\;\;\sqrt{2 \cdot \left(t_1 \cdot \left(F \cdot \left(B \cdot B\right)\right)\right)} \cdot \frac{-1}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
\mathbf{elif}\;B \leq 64000000000000:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(t_0 \cdot F\right) \cdot \left(2 \cdot C\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot t_1}\right)\\
\end{array}
\end{array}
if B < -4.39999999999999993e-13Initial program 13.8%
associate-*l*13.8%
unpow213.8%
+-commutative13.8%
unpow213.8%
associate-*l*13.8%
unpow213.8%
Simplified13.8%
div-inv13.8%
Applied egg-rr15.2%
Taylor expanded in A around 0 14.0%
+-commutative14.0%
unpow214.0%
unpow214.0%
hypot-def15.8%
unpow215.8%
Simplified15.8%
if -4.39999999999999993e-13 < B < 6.4e13Initial program 22.7%
Simplified29.8%
Taylor expanded in A around -inf 26.3%
if 6.4e13 < B Initial program 18.3%
Simplified22.1%
Taylor expanded in A around 0 25.0%
mul-1-neg25.0%
distribute-rgt-neg-in25.0%
*-commutative25.0%
+-commutative25.0%
unpow225.0%
unpow225.0%
hypot-def46.1%
Simplified46.1%
Final simplification27.6%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (+ A C) (hypot B (- A C))))
(t_1 (+ (* B B) (* -4.0 (* A C))))
(t_2 (- (* B B) (* 4.0 (* A C)))))
(if (<= B -1.85e-125)
(/ 1.0 (/ t_1 (- (sqrt (* t_0 (* (* 2.0 F) t_1))))))
(if (<= B 3e-136)
(*
(sqrt
(* 2.0 (fma -8.0 (* F (* A (* C C))) (* 4.0 (* (* B B) (* C F))))))
(/ -1.0 t_2))
(if (<= B 4.5e+92)
(/ (- (sqrt (* t_0 (* 2.0 (* F t_2))))) t_2)
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ A (hypot A B)))))))))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (A + C) + hypot(B, (A - C));
double t_1 = (B * B) + (-4.0 * (A * C));
double t_2 = (B * B) - (4.0 * (A * C));
double tmp;
if (B <= -1.85e-125) {
tmp = 1.0 / (t_1 / -sqrt((t_0 * ((2.0 * F) * t_1))));
} else if (B <= 3e-136) {
tmp = sqrt((2.0 * fma(-8.0, (F * (A * (C * C))), (4.0 * ((B * B) * (C * F)))))) * (-1.0 / t_2);
} else if (B <= 4.5e+92) {
tmp = -sqrt((t_0 * (2.0 * (F * t_2)))) / t_2;
} else {
tmp = (sqrt(2.0) / B) * -sqrt((F * (A + hypot(A, B))));
}
return tmp;
}
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(A + C) + hypot(B, Float64(A - C))) t_1 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) t_2 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) tmp = 0.0 if (B <= -1.85e-125) tmp = Float64(1.0 / Float64(t_1 / Float64(-sqrt(Float64(t_0 * Float64(Float64(2.0 * F) * t_1)))))); elseif (B <= 3e-136) tmp = Float64(sqrt(Float64(2.0 * fma(-8.0, Float64(F * Float64(A * Float64(C * C))), Float64(4.0 * Float64(Float64(B * B) * Float64(C * F)))))) * Float64(-1.0 / t_2)); elseif (B <= 4.5e+92) tmp = Float64(Float64(-sqrt(Float64(t_0 * Float64(2.0 * Float64(F * t_2))))) / t_2); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A + hypot(A, B)))))); end return tmp end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(A + C), $MachinePrecision] + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -1.85e-125], N[(1.0 / N[(t$95$1 / (-N[Sqrt[N[(t$95$0 * N[(N[(2.0 * F), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3e-136], N[(N[Sqrt[N[(2.0 * N[(-8.0 * N[(F * N[(A * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(N[(B * B), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.5e+92], N[((-N[Sqrt[N[(t$95$0 * N[(2.0 * N[(F * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)\\
t_1 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
t_2 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq -1.85 \cdot 10^{-125}:\\
\;\;\;\;\frac{1}{\frac{t_1}{-\sqrt{t_0 \cdot \left(\left(2 \cdot F\right) \cdot t_1\right)}}}\\
\mathbf{elif}\;B \leq 3 \cdot 10^{-136}:\\
\;\;\;\;\sqrt{2 \cdot \mathsf{fma}\left(-8, F \cdot \left(A \cdot \left(C \cdot C\right)\right), 4 \cdot \left(\left(B \cdot B\right) \cdot \left(C \cdot F\right)\right)\right)} \cdot \frac{-1}{t_2}\\
\mathbf{elif}\;B \leq 4.5 \cdot 10^{+92}:\\
\;\;\;\;\frac{-\sqrt{t_0 \cdot \left(2 \cdot \left(F \cdot t_2\right)\right)}}{t_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(A, B\right)\right)}\right)\\
\end{array}
\end{array}
if B < -1.85e-125Initial program 18.3%
associate-*l*18.3%
unpow218.3%
+-commutative18.3%
unpow218.3%
associate-*l*18.3%
unpow218.3%
Simplified18.3%
div-inv18.3%
Applied egg-rr21.7%
un-div-inv21.7%
Applied egg-rr21.8%
if -1.85e-125 < B < 2.9999999999999998e-136Initial program 17.9%
associate-*l*17.9%
unpow217.9%
+-commutative17.9%
unpow217.9%
associate-*l*17.9%
unpow217.9%
Simplified17.9%
div-inv17.9%
Applied egg-rr19.7%
Taylor expanded in A around -inf 22.7%
fma-def22.7%
associate-*r*24.1%
unpow224.1%
associate-*r*23.9%
unpow223.9%
Simplified23.9%
if 2.9999999999999998e-136 < B < 4.4999999999999999e92Initial program 29.9%
associate-*l*29.9%
unpow229.9%
+-commutative29.9%
unpow229.9%
associate-*l*29.9%
unpow229.9%
Simplified29.9%
unpow229.9%
hypot-udef44.3%
*-un-lft-identity44.3%
Applied egg-rr44.3%
*-lft-identity44.3%
Simplified44.3%
if 4.4999999999999999e92 < B Initial program 8.7%
Simplified8.7%
Taylor expanded in C around 0 18.1%
mul-1-neg18.1%
distribute-rgt-neg-in18.1%
*-commutative18.1%
+-commutative18.1%
unpow218.1%
unpow218.1%
hypot-def46.5%
Simplified46.5%
Final simplification31.3%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* A C)))))
(if (<= A -0.0155)
(*
(sqrt (* 2.0 (fma -8.0 (* F (* A (* C C))) (* 4.0 (* (* B B) (* C F))))))
(/ -1.0 t_0))
(/ (- (sqrt (* (+ (+ A C) (hypot B (- A C))) (* 2.0 (* F t_0))))) t_0))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (A <= -0.0155) {
tmp = sqrt((2.0 * fma(-8.0, (F * (A * (C * C))), (4.0 * ((B * B) * (C * F)))))) * (-1.0 / t_0);
} else {
tmp = -sqrt((((A + C) + hypot(B, (A - C))) * (2.0 * (F * t_0)))) / t_0;
}
return tmp;
}
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) tmp = 0.0 if (A <= -0.0155) tmp = Float64(sqrt(Float64(2.0 * fma(-8.0, Float64(F * Float64(A * Float64(C * C))), Float64(4.0 * Float64(Float64(B * B) * Float64(C * F)))))) * Float64(-1.0 / t_0)); else tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(A + C) + hypot(B, Float64(A - C))) * Float64(2.0 * Float64(F * t_0))))) / t_0); end return tmp end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -0.0155], N[(N[Sqrt[N[(2.0 * N[(-8.0 * N[(F * N[(A * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(N[(B * B), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(N[(N[(A + C), $MachinePrecision] + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;A \leq -0.0155:\\
\;\;\;\;\sqrt{2 \cdot \mathsf{fma}\left(-8, F \cdot \left(A \cdot \left(C \cdot C\right)\right), 4 \cdot \left(\left(B \cdot B\right) \cdot \left(C \cdot F\right)\right)\right)} \cdot \frac{-1}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{\left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\
\end{array}
\end{array}
if A < -0.0155Initial program 3.2%
associate-*l*3.2%
unpow23.2%
+-commutative3.2%
unpow23.2%
associate-*l*3.2%
unpow23.2%
Simplified3.2%
div-inv3.2%
Applied egg-rr5.0%
Taylor expanded in A around -inf 16.0%
fma-def16.0%
associate-*r*18.7%
unpow218.7%
associate-*r*18.6%
unpow218.6%
Simplified18.6%
if -0.0155 < A Initial program 25.9%
associate-*l*25.9%
unpow225.9%
+-commutative25.9%
unpow225.9%
associate-*l*25.9%
unpow225.9%
Simplified25.9%
unpow225.9%
hypot-udef32.2%
*-un-lft-identity32.2%
Applied egg-rr32.2%
*-lft-identity32.2%
Simplified32.2%
Final simplification28.4%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* A C)))) (t_1 (/ -1.0 t_0)))
(if (<= C -2.35e-131)
(*
(sqrt (* 2.0 (fma -8.0 (* F (* A (* C C))) (* 4.0 (* (* B B) (* C F))))))
t_1)
(if (<= C 1.8e-24)
(* (sqrt (* 2.0 (* (+ C (hypot C B)) (* F (* B B))))) t_1)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ (+ A C) (- C A))))) t_0)))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double t_1 = -1.0 / t_0;
double tmp;
if (C <= -2.35e-131) {
tmp = sqrt((2.0 * fma(-8.0, (F * (A * (C * C))), (4.0 * ((B * B) * (C * F)))))) * t_1;
} else if (C <= 1.8e-24) {
tmp = sqrt((2.0 * ((C + hypot(C, B)) * (F * (B * B))))) * t_1;
} else {
tmp = -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
}
return tmp;
}
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) t_1 = Float64(-1.0 / t_0) tmp = 0.0 if (C <= -2.35e-131) tmp = Float64(sqrt(Float64(2.0 * fma(-8.0, Float64(F * Float64(A * Float64(C * C))), Float64(4.0 * Float64(Float64(B * B) * Float64(C * F)))))) * t_1); elseif (C <= 1.8e-24) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(C + hypot(C, B)) * Float64(F * Float64(B * B))))) * t_1); else tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(Float64(A + C) + Float64(C - A))))) / t_0); end return tmp end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 / t$95$0), $MachinePrecision]}, If[LessEqual[C, -2.35e-131], N[(N[Sqrt[N[(2.0 * N[(-8.0 * N[(F * N[(A * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(N[(B * B), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[C, 1.8e-24], N[(N[Sqrt[N[(2.0 * N[(N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_1 := \frac{-1}{t_0}\\
\mathbf{if}\;C \leq -2.35 \cdot 10^{-131}:\\
\;\;\;\;\sqrt{2 \cdot \mathsf{fma}\left(-8, F \cdot \left(A \cdot \left(C \cdot C\right)\right), 4 \cdot \left(\left(B \cdot B\right) \cdot \left(C \cdot F\right)\right)\right)} \cdot t_1\\
\mathbf{elif}\;C \leq 1.8 \cdot 10^{-24}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot \left(B \cdot B\right)\right)\right)} \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(\left(A + C\right) + \left(C - A\right)\right)}}{t_0}\\
\end{array}
\end{array}
if C < -2.3499999999999998e-131Initial program 6.7%
associate-*l*6.7%
unpow26.7%
+-commutative6.7%
unpow26.7%
associate-*l*6.7%
unpow26.7%
Simplified6.7%
div-inv6.7%
Applied egg-rr7.9%
Taylor expanded in A around -inf 4.9%
fma-def4.9%
associate-*r*6.7%
unpow26.7%
associate-*r*6.6%
unpow26.6%
Simplified6.6%
if -2.3499999999999998e-131 < C < 1.8e-24Initial program 30.5%
associate-*l*30.5%
unpow230.5%
+-commutative30.5%
unpow230.5%
associate-*l*30.5%
unpow230.5%
Simplified30.5%
div-inv30.4%
Applied egg-rr35.9%
Taylor expanded in A around 0 22.1%
+-commutative22.1%
unpow222.1%
unpow222.1%
hypot-def22.1%
unpow222.1%
Simplified22.1%
if 1.8e-24 < C Initial program 25.4%
associate-*l*25.4%
unpow225.4%
+-commutative25.4%
unpow225.4%
associate-*l*25.4%
unpow225.4%
Simplified25.4%
Taylor expanded in A around -inf 33.3%
mul-1-neg33.3%
sub-neg33.3%
Simplified33.3%
Final simplification18.5%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* A C)))))
(if (<= C 6.8e-25)
(* (sqrt (* 2.0 (* (* B B) (* F (+ A (hypot A B)))))) (/ -1.0 t_0))
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ (+ A C) (- C A))))) t_0))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (C <= 6.8e-25) {
tmp = sqrt((2.0 * ((B * B) * (F * (A + hypot(A, B)))))) * (-1.0 / t_0);
} else {
tmp = -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
}
return tmp;
}
assert A < C;
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (C <= 6.8e-25) {
tmp = Math.sqrt((2.0 * ((B * B) * (F * (A + Math.hypot(A, B)))))) * (-1.0 / t_0);
} else {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if C <= 6.8e-25: tmp = math.sqrt((2.0 * ((B * B) * (F * (A + math.hypot(A, B)))))) * (-1.0 / t_0) else: tmp = -math.sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0 return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) tmp = 0.0 if (C <= 6.8e-25) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(B * B) * Float64(F * Float64(A + hypot(A, B)))))) * Float64(-1.0 / t_0)); else tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(Float64(A + C) + Float64(C - A))))) / t_0); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = (B * B) - (4.0 * (A * C));
tmp = 0.0;
if (C <= 6.8e-25)
tmp = sqrt((2.0 * ((B * B) * (F * (A + hypot(A, B)))))) * (-1.0 / t_0);
else
tmp = -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, 6.8e-25], N[(N[Sqrt[N[(2.0 * N[(N[(B * B), $MachinePrecision] * N[(F * N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;C \leq 6.8 \cdot 10^{-25}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(B \cdot B\right) \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(A, B\right)\right)\right)\right)} \cdot \frac{-1}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(\left(A + C\right) + \left(C - A\right)\right)}}{t_0}\\
\end{array}
\end{array}
if C < 6.80000000000000003e-25Initial program 17.3%
associate-*l*17.3%
unpow217.3%
+-commutative17.3%
unpow217.3%
associate-*l*17.3%
unpow217.3%
Simplified17.3%
div-inv17.3%
Applied egg-rr20.5%
Taylor expanded in C around 0 14.0%
associate-*r*14.7%
+-commutative14.7%
unpow214.7%
unpow214.7%
hypot-def16.2%
unpow216.2%
Simplified16.2%
if 6.80000000000000003e-25 < C Initial program 26.5%
associate-*l*26.5%
unpow226.5%
+-commutative26.5%
unpow226.5%
associate-*l*26.5%
unpow226.5%
Simplified26.5%
Taylor expanded in A around -inf 32.9%
mul-1-neg32.9%
sub-neg32.9%
Simplified32.9%
Final simplification20.3%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* A C)))))
(if (<= C 2.3e-23)
(* (sqrt (* 2.0 (* (+ C (hypot C B)) (* F (* B B))))) (/ -1.0 t_0))
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ (+ A C) (- C A))))) t_0))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (C <= 2.3e-23) {
tmp = sqrt((2.0 * ((C + hypot(C, B)) * (F * (B * B))))) * (-1.0 / t_0);
} else {
tmp = -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
}
return tmp;
}
assert A < C;
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (C <= 2.3e-23) {
tmp = Math.sqrt((2.0 * ((C + Math.hypot(C, B)) * (F * (B * B))))) * (-1.0 / t_0);
} else {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if C <= 2.3e-23: tmp = math.sqrt((2.0 * ((C + math.hypot(C, B)) * (F * (B * B))))) * (-1.0 / t_0) else: tmp = -math.sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0 return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) tmp = 0.0 if (C <= 2.3e-23) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(C + hypot(C, B)) * Float64(F * Float64(B * B))))) * Float64(-1.0 / t_0)); else tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(Float64(A + C) + Float64(C - A))))) / t_0); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = (B * B) - (4.0 * (A * C));
tmp = 0.0;
if (C <= 2.3e-23)
tmp = sqrt((2.0 * ((C + hypot(C, B)) * (F * (B * B))))) * (-1.0 / t_0);
else
tmp = -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, 2.3e-23], N[(N[Sqrt[N[(2.0 * N[(N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;C \leq 2.3 \cdot 10^{-23}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot \left(B \cdot B\right)\right)\right)} \cdot \frac{-1}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(\left(A + C\right) + \left(C - A\right)\right)}}{t_0}\\
\end{array}
\end{array}
if C < 2.3000000000000001e-23Initial program 17.7%
associate-*l*17.7%
unpow217.7%
+-commutative17.7%
unpow217.7%
associate-*l*17.7%
unpow217.7%
Simplified17.7%
div-inv17.7%
Applied egg-rr20.9%
Taylor expanded in A around 0 12.7%
+-commutative12.7%
unpow212.7%
unpow212.7%
hypot-def13.3%
unpow213.3%
Simplified13.3%
if 2.3000000000000001e-23 < C Initial program 25.4%
associate-*l*25.4%
unpow225.4%
+-commutative25.4%
unpow225.4%
associate-*l*25.4%
unpow225.4%
Simplified25.4%
Taylor expanded in A around -inf 33.3%
mul-1-neg33.3%
sub-neg33.3%
Simplified33.3%
Final simplification18.1%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* A C)))))
(if (<= C 7.5e-137)
(* (sqrt (* 2.0 (* (pow B 3.0) (- F)))) (/ -1.0 t_0))
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ (+ A C) (- C A))))) t_0))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (C <= 7.5e-137) {
tmp = sqrt((2.0 * (pow(B, 3.0) * -F))) * (-1.0 / t_0);
} else {
tmp = -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
}
return tmp;
}
NOTE: A and C should be sorted in increasing order before calling this function.
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (b * b) - (4.0d0 * (a * c))
if (c <= 7.5d-137) then
tmp = sqrt((2.0d0 * ((b ** 3.0d0) * -f))) * ((-1.0d0) / t_0)
else
tmp = -sqrt(((2.0d0 * (f * t_0)) * ((a + c) + (c - a)))) / t_0
end if
code = tmp
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (C <= 7.5e-137) {
tmp = Math.sqrt((2.0 * (Math.pow(B, 3.0) * -F))) * (-1.0 / t_0);
} else {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if C <= 7.5e-137: tmp = math.sqrt((2.0 * (math.pow(B, 3.0) * -F))) * (-1.0 / t_0) else: tmp = -math.sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0 return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) tmp = 0.0 if (C <= 7.5e-137) tmp = Float64(sqrt(Float64(2.0 * Float64((B ^ 3.0) * Float64(-F)))) * Float64(-1.0 / t_0)); else tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(Float64(A + C) + Float64(C - A))))) / t_0); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = (B * B) - (4.0 * (A * C));
tmp = 0.0;
if (C <= 7.5e-137)
tmp = sqrt((2.0 * ((B ^ 3.0) * -F))) * (-1.0 / t_0);
else
tmp = -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, 7.5e-137], N[(N[Sqrt[N[(2.0 * N[(N[Power[B, 3.0], $MachinePrecision] * (-F)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;C \leq 7.5 \cdot 10^{-137}:\\
\;\;\;\;\sqrt{2 \cdot \left({B}^{3} \cdot \left(-F\right)\right)} \cdot \frac{-1}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(\left(A + C\right) + \left(C - A\right)\right)}}{t_0}\\
\end{array}
\end{array}
if C < 7.4999999999999995e-137Initial program 15.8%
associate-*l*15.8%
unpow215.8%
+-commutative15.8%
unpow215.8%
associate-*l*15.8%
unpow215.8%
Simplified15.8%
div-inv15.8%
Applied egg-rr18.2%
Taylor expanded in B around -inf 6.8%
mul-1-neg6.8%
Simplified6.8%
if 7.4999999999999995e-137 < C Initial program 27.2%
associate-*l*27.2%
unpow227.2%
+-commutative27.2%
unpow227.2%
associate-*l*27.2%
unpow227.2%
Simplified27.2%
Taylor expanded in A around -inf 26.6%
mul-1-neg26.6%
sub-neg26.6%
Simplified26.6%
Final simplification13.4%
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* A C)))))
(if (<= C 1.85e-25)
(* (sqrt (* 2.0 (* F (pow B 3.0)))) (/ -1.0 t_0))
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ (+ A C) (- C A))))) t_0))))assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (C <= 1.85e-25) {
tmp = sqrt((2.0 * (F * pow(B, 3.0)))) * (-1.0 / t_0);
} else {
tmp = -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
}
return tmp;
}
NOTE: A and C should be sorted in increasing order before calling this function.
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (b * b) - (4.0d0 * (a * c))
if (c <= 1.85d-25) then
tmp = sqrt((2.0d0 * (f * (b ** 3.0d0)))) * ((-1.0d0) / t_0)
else
tmp = -sqrt(((2.0d0 * (f * t_0)) * ((a + c) + (c - a)))) / t_0
end if
code = tmp
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (C <= 1.85e-25) {
tmp = Math.sqrt((2.0 * (F * Math.pow(B, 3.0)))) * (-1.0 / t_0);
} else {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
}
return tmp;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if C <= 1.85e-25: tmp = math.sqrt((2.0 * (F * math.pow(B, 3.0)))) * (-1.0 / t_0) else: tmp = -math.sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0 return tmp
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) tmp = 0.0 if (C <= 1.85e-25) tmp = Float64(sqrt(Float64(2.0 * Float64(F * (B ^ 3.0)))) * Float64(-1.0 / t_0)); else tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(Float64(A + C) + Float64(C - A))))) / t_0); end return tmp end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
t_0 = (B * B) - (4.0 * (A * C));
tmp = 0.0;
if (C <= 1.85e-25)
tmp = sqrt((2.0 * (F * (B ^ 3.0)))) * (-1.0 / t_0);
else
tmp = -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
end
tmp_2 = tmp;
end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, 1.85e-25], N[(N[Sqrt[N[(2.0 * N[(F * N[Power[B, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;C \leq 1.85 \cdot 10^{-25}:\\
\;\;\;\;\sqrt{2 \cdot \left(F \cdot {B}^{3}\right)} \cdot \frac{-1}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(\left(A + C\right) + \left(C - A\right)\right)}}{t_0}\\
\end{array}
\end{array}
if C < 1.85000000000000004e-25Initial program 17.3%
associate-*l*17.3%
unpow217.3%
+-commutative17.3%
unpow217.3%
associate-*l*17.3%
unpow217.3%
Simplified17.3%
div-inv17.3%
Applied egg-rr20.5%
Taylor expanded in B around inf 6.2%
if 1.85000000000000004e-25 < C Initial program 26.5%
associate-*l*26.5%
unpow226.5%
+-commutative26.5%
unpow226.5%
associate-*l*26.5%
unpow226.5%
Simplified26.5%
Taylor expanded in A around -inf 32.9%
mul-1-neg32.9%
sub-neg32.9%
Simplified32.9%
Final simplification12.8%
NOTE: A and C should be sorted in increasing order before calling this function. (FPCore (A B C F) :precision binary64 (let* ((t_0 (- (* B B) (* 4.0 (* A C))))) (/ (- (sqrt (* (* 2.0 (* F t_0)) (+ (+ A C) (- C A))))) t_0)))
assert(A < C);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
return -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
}
NOTE: A and C should be sorted in increasing order before calling this function.
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b * b) - (4.0d0 * (a * c))
code = -sqrt(((2.0d0 * (f * t_0)) * ((a + c) + (c - a)))) / t_0
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
return -Math.sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
}
[A, C] = sort([A, C]) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) return -math.sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0
A, C = sort([A, C]) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(Float64(A + C) + Float64(C - A))))) / t_0) end
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
t_0 = (B * B) - (4.0 * (A * C));
tmp = -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(\left(A + C\right) + \left(C - A\right)\right)}}{t_0}
\end{array}
\end{array}
Initial program 19.6%
associate-*l*19.6%
unpow219.6%
+-commutative19.6%
unpow219.6%
associate-*l*19.6%
unpow219.6%
Simplified19.6%
Taylor expanded in A around -inf 9.9%
mul-1-neg9.9%
sub-neg9.9%
Simplified9.9%
Final simplification9.9%
NOTE: A and C should be sorted in increasing order before calling this function. (FPCore (A B C F) :precision binary64 (/ (- (sqrt (* -16.0 (* (* C F) (* A A))))) (- (* B B) (* 4.0 (* A C)))))
assert(A < C);
double code(double A, double B, double C, double F) {
return -sqrt((-16.0 * ((C * F) * (A * A)))) / ((B * B) - (4.0 * (A * C)));
}
NOTE: A and C should be sorted in increasing order before calling this function.
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
code = -sqrt(((-16.0d0) * ((c * f) * (a * a)))) / ((b * b) - (4.0d0 * (a * c)))
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
return -Math.sqrt((-16.0 * ((C * F) * (A * A)))) / ((B * B) - (4.0 * (A * C)));
}
[A, C] = sort([A, C]) def code(A, B, C, F): return -math.sqrt((-16.0 * ((C * F) * (A * A)))) / ((B * B) - (4.0 * (A * C)))
A, C = sort([A, C]) function code(A, B, C, F) return Float64(Float64(-sqrt(Float64(-16.0 * Float64(Float64(C * F) * Float64(A * A))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))) end
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
tmp = -sqrt((-16.0 * ((C * F) * (A * A)))) / ((B * B) - (4.0 * (A * C)));
end
NOTE: A and C should be sorted in increasing order before calling this function. code[A_, B_, C_, F_] := N[((-N[Sqrt[N[(-16.0 * N[(N[(C * F), $MachinePrecision] * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\frac{-\sqrt{-16 \cdot \left(\left(C \cdot F\right) \cdot \left(A \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\end{array}
Initial program 19.6%
associate-*l*19.6%
unpow219.6%
+-commutative19.6%
unpow219.6%
associate-*l*19.6%
unpow219.6%
Simplified19.6%
Taylor expanded in A around inf 9.7%
Taylor expanded in A around inf 8.1%
unpow28.1%
Simplified8.1%
Final simplification8.1%
NOTE: A and C should be sorted in increasing order before calling this function. (FPCore (A B C F) :precision binary64 (/ (- (sqrt (* -8.0 (* F (* A (* C C)))))) (- (* B B) (* 4.0 (* A C)))))
assert(A < C);
double code(double A, double B, double C, double F) {
return -sqrt((-8.0 * (F * (A * (C * C))))) / ((B * B) - (4.0 * (A * C)));
}
NOTE: A and C should be sorted in increasing order before calling this function.
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
code = -sqrt(((-8.0d0) * (f * (a * (c * c))))) / ((b * b) - (4.0d0 * (a * c)))
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
return -Math.sqrt((-8.0 * (F * (A * (C * C))))) / ((B * B) - (4.0 * (A * C)));
}
[A, C] = sort([A, C]) def code(A, B, C, F): return -math.sqrt((-8.0 * (F * (A * (C * C))))) / ((B * B) - (4.0 * (A * C)))
A, C = sort([A, C]) function code(A, B, C, F) return Float64(Float64(-sqrt(Float64(-8.0 * Float64(F * Float64(A * Float64(C * C)))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))) end
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
tmp = -sqrt((-8.0 * (F * (A * (C * C))))) / ((B * B) - (4.0 * (A * C)));
end
NOTE: A and C should be sorted in increasing order before calling this function. code[A_, B_, C_, F_] := N[((-N[Sqrt[N[(-8.0 * N[(F * N[(A * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\frac{-\sqrt{-8 \cdot \left(F \cdot \left(A \cdot \left(C \cdot C\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\end{array}
Initial program 19.6%
associate-*l*19.6%
unpow219.6%
+-commutative19.6%
unpow219.6%
associate-*l*19.6%
unpow219.6%
Simplified19.6%
Taylor expanded in A around inf 9.7%
Taylor expanded in C around inf 4.0%
associate-*r*4.2%
unpow24.2%
Simplified4.2%
Final simplification4.2%
NOTE: A and C should be sorted in increasing order before calling this function. (FPCore (A B C F) :precision binary64 (* (/ 2.0 B) (- (pow (* A F) 0.5))))
assert(A < C);
double code(double A, double B, double C, double F) {
return (2.0 / B) * -pow((A * F), 0.5);
}
NOTE: A and C should be sorted in increasing order before calling this function.
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
code = (2.0d0 / b) * -((a * f) ** 0.5d0)
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
return (2.0 / B) * -Math.pow((A * F), 0.5);
}
[A, C] = sort([A, C]) def code(A, B, C, F): return (2.0 / B) * -math.pow((A * F), 0.5)
A, C = sort([A, C]) function code(A, B, C, F) return Float64(Float64(2.0 / B) * Float64(-(Float64(A * F) ^ 0.5))) end
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
tmp = (2.0 / B) * -((A * F) ^ 0.5);
end
NOTE: A and C should be sorted in increasing order before calling this function. code[A_, B_, C_, F_] := N[(N[(2.0 / B), $MachinePrecision] * (-N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\frac{2}{B} \cdot \left(-{\left(A \cdot F\right)}^{0.5}\right)
\end{array}
Initial program 19.6%
associate-*l*19.6%
unpow219.6%
+-commutative19.6%
unpow219.6%
associate-*l*19.6%
unpow219.6%
Simplified19.6%
Taylor expanded in A around inf 9.7%
Taylor expanded in C around 0 3.0%
mul-1-neg3.0%
unpow23.0%
rem-square-sqrt3.0%
Simplified3.0%
pow1/23.2%
*-commutative3.2%
Applied egg-rr3.2%
Final simplification3.2%
NOTE: A and C should be sorted in increasing order before calling this function. (FPCore (A B C F) :precision binary64 (* (/ 2.0 B) (sqrt (* A F))))
assert(A < C);
double code(double A, double B, double C, double F) {
return (2.0 / B) * sqrt((A * F));
}
NOTE: A and C should be sorted in increasing order before calling this function.
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
code = (2.0d0 / b) * sqrt((a * f))
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
return (2.0 / B) * Math.sqrt((A * F));
}
[A, C] = sort([A, C]) def code(A, B, C, F): return (2.0 / B) * math.sqrt((A * F))
A, C = sort([A, C]) function code(A, B, C, F) return Float64(Float64(2.0 / B) * sqrt(Float64(A * F))) end
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
tmp = (2.0 / B) * sqrt((A * F));
end
NOTE: A and C should be sorted in increasing order before calling this function. code[A_, B_, C_, F_] := N[(N[(2.0 / B), $MachinePrecision] * N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\frac{2}{B} \cdot \sqrt{A \cdot F}
\end{array}
Initial program 19.6%
associate-*l*19.6%
unpow219.6%
+-commutative19.6%
unpow219.6%
associate-*l*19.6%
unpow219.6%
Simplified19.6%
Taylor expanded in A around inf 9.7%
Taylor expanded in B around -inf 3.3%
Taylor expanded in C around 0 3.4%
*-commutative3.4%
unpow23.4%
rem-square-sqrt3.4%
Simplified3.4%
Final simplification3.4%
herbie shell --seed 2023194
(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))))