
(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 20 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: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= (pow B 2.0) 5e+156)
(/
(* (sqrt (+ C (+ A (hypot B (- A C))))) (- (sqrt (* 2.0 (* F t_0)))))
t_0)
(* (* (sqrt (+ A (hypot B A))) (sqrt F)) (/ (- (sqrt 2.0)) B)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (pow(B, 2.0) <= 5e+156) {
tmp = (sqrt((C + (A + hypot(B, (A - C))))) * -sqrt((2.0 * (F * t_0)))) / t_0;
} else {
tmp = (sqrt((A + hypot(B, A))) * sqrt(F)) * (-sqrt(2.0) / B);
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (Math.pow(B, 2.0) <= 5e+156) {
tmp = (Math.sqrt((C + (A + Math.hypot(B, (A - C))))) * -Math.sqrt((2.0 * (F * t_0)))) / t_0;
} else {
tmp = (Math.sqrt((A + Math.hypot(B, A))) * Math.sqrt(F)) * (-Math.sqrt(2.0) / B);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if math.pow(B, 2.0) <= 5e+156: tmp = (math.sqrt((C + (A + math.hypot(B, (A - C))))) * -math.sqrt((2.0 * (F * t_0)))) / t_0 else: tmp = (math.sqrt((A + math.hypot(B, A))) * math.sqrt(F)) * (-math.sqrt(2.0) / B) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if ((B ^ 2.0) <= 5e+156) tmp = Float64(Float64(sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) * Float64(-sqrt(Float64(2.0 * Float64(F * t_0))))) / t_0); else tmp = Float64(Float64(sqrt(Float64(A + hypot(B, A))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / B)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (C * A)); tmp = 0.0; if ((B ^ 2.0) <= 5e+156) tmp = (sqrt((C + (A + hypot(B, (A - C))))) * -sqrt((2.0 * (F * t_0)))) / t_0; else tmp = (sqrt((A + hypot(B, A))) * sqrt(F)) * (-sqrt(2.0) / B); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5e+156], N[(N[(N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{+156}:\\
\;\;\;\;\frac{\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_0\right)}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 4.99999999999999992e156Initial program 27.2%
associate-*l*27.2%
unpow227.2%
+-commutative27.2%
unpow227.2%
associate-*l*27.2%
unpow227.2%
Simplified27.2%
sqrt-prod30.1%
*-commutative30.1%
*-commutative30.1%
associate-+l+30.5%
unpow230.5%
hypot-udef41.6%
associate-+r+40.5%
+-commutative40.5%
associate-+r+41.2%
Applied egg-rr41.2%
if 4.99999999999999992e156 < (pow.f64 B 2) Initial program 6.0%
Simplified7.3%
Taylor expanded in C around 0 10.0%
mul-1-neg10.0%
unpow210.0%
unpow210.0%
Simplified10.0%
sqrt-prod10.0%
hypot-def36.4%
Applied egg-rr36.4%
Final simplification39.4%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A))))
(t_1
(* (sqrt (+ C (+ A (hypot B (- A C))))) (- (sqrt (* 2.0 (* F t_0))))))
(t_2 (fma C (* A -4.0) (* B B))))
(if (<= B 9.6e-224)
(/ t_1 (* (* C A) -4.0))
(if (<= B 6.1e-176)
(/ (- (sqrt (* 2.0 (* (* F t_2) (* 2.0 A))))) t_2)
(if (<= B 2.6e+81)
(/ t_1 t_0)
(if (or (<= B 3.2e+217) (not (<= B 2.6e+268)))
(* (sqrt (* F (+ A (hypot B A)))) (/ (- (sqrt 2.0)) B))
(* (sqrt 2.0) (- (sqrt (/ F B))))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double t_1 = sqrt((C + (A + hypot(B, (A - C))))) * -sqrt((2.0 * (F * t_0)));
double t_2 = fma(C, (A * -4.0), (B * B));
double tmp;
if (B <= 9.6e-224) {
tmp = t_1 / ((C * A) * -4.0);
} else if (B <= 6.1e-176) {
tmp = -sqrt((2.0 * ((F * t_2) * (2.0 * A)))) / t_2;
} else if (B <= 2.6e+81) {
tmp = t_1 / t_0;
} else if ((B <= 3.2e+217) || !(B <= 2.6e+268)) {
tmp = sqrt((F * (A + hypot(B, A)))) * (-sqrt(2.0) / B);
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) t_1 = Float64(sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) * Float64(-sqrt(Float64(2.0 * Float64(F * t_0))))) t_2 = fma(C, Float64(A * -4.0), Float64(B * B)) tmp = 0.0 if (B <= 9.6e-224) tmp = Float64(t_1 / Float64(Float64(C * A) * -4.0)); elseif (B <= 6.1e-176) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_2) * Float64(2.0 * A))))) / t_2); elseif (B <= 2.6e+81) tmp = Float64(t_1 / t_0); elseif ((B <= 3.2e+217) || !(B <= 2.6e+268)) tmp = Float64(sqrt(Float64(F * Float64(A + hypot(B, A)))) * Float64(Float64(-sqrt(2.0)) / B)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]}, Block[{t$95$2 = N[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 9.6e-224], N[(t$95$1 / N[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 6.1e-176], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$2), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], If[LessEqual[B, 2.6e+81], N[(t$95$1 / t$95$0), $MachinePrecision], If[Or[LessEqual[B, 3.2e+217], N[Not[LessEqual[B, 2.6e+268]], $MachinePrecision]], N[(N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
t_1 := \sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_0\right)}\right)\\
t_2 := \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\\
\mathbf{if}\;B \leq 9.6 \cdot 10^{-224}:\\
\;\;\;\;\frac{t_1}{\left(C \cdot A\right) \cdot -4}\\
\mathbf{elif}\;B \leq 6.1 \cdot 10^{-176}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_2\right) \cdot \left(2 \cdot A\right)\right)}}{t_2}\\
\mathbf{elif}\;B \leq 2.6 \cdot 10^{+81}:\\
\;\;\;\;\frac{t_1}{t_0}\\
\mathbf{elif}\;B \leq 3.2 \cdot 10^{+217} \lor \neg \left(B \leq 2.6 \cdot 10^{+268}\right):\\
\;\;\;\;\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if B < 9.60000000000000057e-224Initial program 24.4%
associate-*l*24.4%
unpow224.4%
+-commutative24.4%
unpow224.4%
associate-*l*24.4%
unpow224.4%
Simplified24.4%
sqrt-prod26.4%
*-commutative26.4%
*-commutative26.4%
associate-+l+26.8%
unpow226.8%
hypot-udef34.1%
associate-+r+33.2%
+-commutative33.2%
associate-+r+33.5%
Applied egg-rr33.5%
Taylor expanded in B around 0 21.1%
if 9.60000000000000057e-224 < B < 6.1000000000000003e-176Initial program 14.5%
Simplified17.3%
Taylor expanded in C around -inf 38.2%
if 6.1000000000000003e-176 < B < 2.59999999999999992e81Initial program 17.6%
associate-*l*17.6%
unpow217.6%
+-commutative17.6%
unpow217.6%
associate-*l*17.6%
unpow217.6%
Simplified17.6%
sqrt-prod21.1%
*-commutative21.1%
*-commutative21.1%
associate-+l+21.1%
unpow221.1%
hypot-udef38.4%
associate-+r+38.2%
+-commutative38.2%
associate-+r+39.3%
Applied egg-rr39.3%
if 2.59999999999999992e81 < B < 3.2000000000000001e217 or 2.59999999999999993e268 < B Initial program 8.5%
Simplified9.0%
Taylor expanded in C around 0 21.9%
mul-1-neg21.9%
distribute-rgt-neg-in21.9%
unpow221.9%
unpow221.9%
hypot-def48.4%
Simplified48.4%
if 3.2000000000000001e217 < B < 2.59999999999999993e268Initial program 0.0%
Simplified0.0%
Taylor expanded in A around 0 0.0%
*-commutative0.0%
associate-*l*0.0%
*-commutative0.0%
unpow20.0%
unpow20.0%
hypot-def2.0%
Simplified2.0%
Taylor expanded in C around 0 53.9%
mul-1-neg53.9%
Simplified53.9%
Final simplification30.8%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= F -5e-310)
(-
(/
(*
(sqrt (+ C (+ A (hypot B (- A C)))))
(sqrt (* 2.0 (* -4.0 (* A (* F C))))))
(- (* B B) (* 4.0 (* C A)))))
(if (<= F 2e+44)
(* (sqrt (* F (+ A (hypot B A)))) (/ (- (sqrt 2.0)) B))
(* (sqrt 2.0) (- (sqrt (/ F B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= -5e-310) {
tmp = -((sqrt((C + (A + hypot(B, (A - C))))) * sqrt((2.0 * (-4.0 * (A * (F * C)))))) / ((B * B) - (4.0 * (C * A))));
} else if (F <= 2e+44) {
tmp = sqrt((F * (A + hypot(B, A)))) * (-sqrt(2.0) / B);
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (F <= -5e-310) {
tmp = -((Math.sqrt((C + (A + Math.hypot(B, (A - C))))) * Math.sqrt((2.0 * (-4.0 * (A * (F * C)))))) / ((B * B) - (4.0 * (C * A))));
} else if (F <= 2e+44) {
tmp = Math.sqrt((F * (A + Math.hypot(B, A)))) * (-Math.sqrt(2.0) / B);
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if F <= -5e-310: tmp = -((math.sqrt((C + (A + math.hypot(B, (A - C))))) * math.sqrt((2.0 * (-4.0 * (A * (F * C)))))) / ((B * B) - (4.0 * (C * A)))) elif F <= 2e+44: tmp = math.sqrt((F * (A + math.hypot(B, A)))) * (-math.sqrt(2.0) / B) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= -5e-310) tmp = Float64(-Float64(Float64(sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) * sqrt(Float64(2.0 * Float64(-4.0 * Float64(A * Float64(F * C)))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))))); elseif (F <= 2e+44) tmp = Float64(sqrt(Float64(F * Float64(A + hypot(B, A)))) * Float64(Float64(-sqrt(2.0)) / B)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (F <= -5e-310) tmp = -((sqrt((C + (A + hypot(B, (A - C))))) * sqrt((2.0 * (-4.0 * (A * (F * C)))))) / ((B * B) - (4.0 * (C * A)))); elseif (F <= 2e+44) tmp = sqrt((F * (A + hypot(B, A)))) * (-sqrt(2.0) / B); else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[F, -5e-310], (-N[(N[(N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(-4.0 * N[(A * N[(F * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 2e+44], N[(N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-\frac{\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(-4 \cdot \left(A \cdot \left(F \cdot C\right)\right)\right)}}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+44}:\\
\;\;\;\;\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < -4.999999999999985e-310Initial program 40.8%
associate-*l*40.8%
unpow240.8%
+-commutative40.8%
unpow240.8%
associate-*l*40.8%
unpow240.8%
Simplified40.8%
sqrt-prod45.3%
*-commutative45.3%
*-commutative45.3%
associate-+l+45.3%
unpow245.3%
hypot-udef59.8%
associate-+r+59.8%
+-commutative59.8%
associate-+r+59.8%
Applied egg-rr59.8%
Taylor expanded in B around 0 56.8%
if -4.999999999999985e-310 < F < 2.0000000000000002e44Initial program 17.4%
Simplified23.8%
Taylor expanded in C around 0 8.7%
mul-1-neg8.7%
distribute-rgt-neg-in8.7%
unpow28.7%
unpow28.7%
hypot-def20.6%
Simplified20.6%
if 2.0000000000000002e44 < F Initial program 14.6%
Simplified16.8%
Taylor expanded in A around 0 5.6%
*-commutative5.6%
associate-*l*5.6%
*-commutative5.6%
unpow25.6%
unpow25.6%
hypot-def6.1%
Simplified6.1%
Taylor expanded in C around 0 14.6%
mul-1-neg14.6%
Simplified14.6%
Final simplification22.9%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= F -5e-310)
(/
(*
(sqrt (+ C (+ A (hypot B (- A C)))))
(- (sqrt (* 2.0 (* F (- (* B B) (* 4.0 (* C A))))))))
(* (* C A) -4.0))
(if (<= F 2.5e+44)
(* (sqrt (* F (+ A (hypot B A)))) (/ (- (sqrt 2.0)) B))
(* (sqrt 2.0) (- (sqrt (/ F B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= -5e-310) {
tmp = (sqrt((C + (A + hypot(B, (A - C))))) * -sqrt((2.0 * (F * ((B * B) - (4.0 * (C * A))))))) / ((C * A) * -4.0);
} else if (F <= 2.5e+44) {
tmp = sqrt((F * (A + hypot(B, A)))) * (-sqrt(2.0) / B);
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (F <= -5e-310) {
tmp = (Math.sqrt((C + (A + Math.hypot(B, (A - C))))) * -Math.sqrt((2.0 * (F * ((B * B) - (4.0 * (C * A))))))) / ((C * A) * -4.0);
} else if (F <= 2.5e+44) {
tmp = Math.sqrt((F * (A + Math.hypot(B, A)))) * (-Math.sqrt(2.0) / B);
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if F <= -5e-310: tmp = (math.sqrt((C + (A + math.hypot(B, (A - C))))) * -math.sqrt((2.0 * (F * ((B * B) - (4.0 * (C * A))))))) / ((C * A) * -4.0) elif F <= 2.5e+44: tmp = math.sqrt((F * (A + math.hypot(B, A)))) * (-math.sqrt(2.0) / B) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= -5e-310) tmp = Float64(Float64(sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) * Float64(-sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) - Float64(4.0 * Float64(C * A)))))))) / Float64(Float64(C * A) * -4.0)); elseif (F <= 2.5e+44) tmp = Float64(sqrt(Float64(F * Float64(A + hypot(B, A)))) * Float64(Float64(-sqrt(2.0)) / B)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (F <= -5e-310) tmp = (sqrt((C + (A + hypot(B, (A - C))))) * -sqrt((2.0 * (F * ((B * B) - (4.0 * (C * A))))))) / ((C * A) * -4.0); elseif (F <= 2.5e+44) tmp = sqrt((F * (A + hypot(B, A)))) * (-sqrt(2.0) / B); else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[F, -5e-310], N[(N[(N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.5e+44], N[(N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B - 4 \cdot \left(C \cdot A\right)\right)\right)}\right)}{\left(C \cdot A\right) \cdot -4}\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{+44}:\\
\;\;\;\;\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < -4.999999999999985e-310Initial program 40.8%
associate-*l*40.8%
unpow240.8%
+-commutative40.8%
unpow240.8%
associate-*l*40.8%
unpow240.8%
Simplified40.8%
sqrt-prod45.3%
*-commutative45.3%
*-commutative45.3%
associate-+l+45.3%
unpow245.3%
hypot-udef59.8%
associate-+r+59.8%
+-commutative59.8%
associate-+r+59.8%
Applied egg-rr59.8%
Taylor expanded in B around 0 59.8%
if -4.999999999999985e-310 < F < 2.4999999999999998e44Initial program 17.4%
Simplified23.8%
Taylor expanded in C around 0 8.7%
mul-1-neg8.7%
distribute-rgt-neg-in8.7%
unpow28.7%
unpow28.7%
hypot-def20.6%
Simplified20.6%
if 2.4999999999999998e44 < F Initial program 14.6%
Simplified16.8%
Taylor expanded in A around 0 5.6%
*-commutative5.6%
associate-*l*5.6%
*-commutative5.6%
unpow25.6%
unpow25.6%
hypot-def6.1%
Simplified6.1%
Taylor expanded in C around 0 14.6%
mul-1-neg14.6%
Simplified14.6%
Final simplification23.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= F 4.8e-306)
(/
(-
(sqrt
(*
2.0
(* F (* (+ (* B B) (* (* C A) -4.0)) (+ (hypot B (- A C)) (+ C A)))))))
(- (* B B) (* 4.0 (* C A))))
(if (<= F 1.16e-45)
(/ (* (sqrt (* F (+ C (hypot C B)))) (- (sqrt 2.0))) B)
(* (sqrt 2.0) (- (sqrt (/ F B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= 4.8e-306) {
tmp = -sqrt((2.0 * (F * (((B * B) + ((C * A) * -4.0)) * (hypot(B, (A - C)) + (C + A)))))) / ((B * B) - (4.0 * (C * A)));
} else if (F <= 1.16e-45) {
tmp = (sqrt((F * (C + hypot(C, B)))) * -sqrt(2.0)) / B;
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (F <= 4.8e-306) {
tmp = -Math.sqrt((2.0 * (F * (((B * B) + ((C * A) * -4.0)) * (Math.hypot(B, (A - C)) + (C + A)))))) / ((B * B) - (4.0 * (C * A)));
} else if (F <= 1.16e-45) {
tmp = (Math.sqrt((F * (C + Math.hypot(C, B)))) * -Math.sqrt(2.0)) / B;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if F <= 4.8e-306: tmp = -math.sqrt((2.0 * (F * (((B * B) + ((C * A) * -4.0)) * (math.hypot(B, (A - C)) + (C + A)))))) / ((B * B) - (4.0 * (C * A))) elif F <= 1.16e-45: tmp = (math.sqrt((F * (C + math.hypot(C, B)))) * -math.sqrt(2.0)) / B else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= 4.8e-306) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(Float64(Float64(B * B) + Float64(Float64(C * A) * -4.0)) * Float64(hypot(B, Float64(A - C)) + Float64(C + A))))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(C * A)))); elseif (F <= 1.16e-45) tmp = Float64(Float64(sqrt(Float64(F * Float64(C + hypot(C, B)))) * Float64(-sqrt(2.0))) / B); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (F <= 4.8e-306) tmp = -sqrt((2.0 * (F * (((B * B) + ((C * A) * -4.0)) * (hypot(B, (A - C)) + (C + A)))))) / ((B * B) - (4.0 * (C * A))); elseif (F <= 1.16e-45) tmp = (sqrt((F * (C + hypot(C, B)))) * -sqrt(2.0)) / B; else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[F, 4.8e-306], N[((-N[Sqrt[N[(2.0 * N[(F * N[(N[(N[(B * B), $MachinePrecision] + N[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision] + N[(C + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.16e-45], N[(N[(N[Sqrt[N[(F * N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision] / B), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 4.8 \cdot 10^{-306}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(\left(B \cdot B + \left(C \cdot A\right) \cdot -4\right) \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)\right)\right)\right)}}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\
\mathbf{elif}\;F \leq 1.16 \cdot 10^{-45}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)} \cdot \left(-\sqrt{2}\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 4.7999999999999999e-306Initial program 39.8%
associate-*l*39.8%
unpow239.8%
+-commutative39.8%
unpow239.8%
associate-*l*39.8%
unpow239.8%
Simplified39.8%
*-un-lft-identity39.8%
associate-*l*39.8%
*-commutative39.8%
*-commutative39.8%
unpow239.8%
hypot-udef48.2%
+-commutative48.2%
associate-+r+48.2%
Applied egg-rr48.2%
*-lft-identity48.2%
associate-*r*48.2%
fma-neg48.2%
*-commutative48.2%
*-commutative48.2%
distribute-rgt-neg-in48.2%
*-commutative48.2%
metadata-eval48.2%
associate-*r*48.2%
associate-*r*48.2%
associate-*l*48.2%
Simplified48.2%
if 4.7999999999999999e-306 < F < 1.16000000000000002e-45Initial program 20.1%
associate-*l*20.1%
unpow220.1%
+-commutative20.1%
unpow220.1%
associate-*l*20.1%
unpow220.1%
Simplified20.1%
sqrt-prod21.7%
*-commutative21.7%
*-commutative21.7%
associate-+l+21.9%
unpow221.9%
hypot-udef30.3%
associate-+r+29.7%
+-commutative29.7%
associate-+r+30.1%
Applied egg-rr30.1%
Taylor expanded in A around 0 8.1%
mul-1-neg8.1%
associate-*l/8.1%
+-commutative8.1%
unpow28.1%
unpow28.1%
hypot-def21.8%
Simplified21.8%
if 1.16000000000000002e-45 < F Initial program 13.3%
Simplified16.1%
Taylor expanded in A around 0 7.1%
*-commutative7.1%
associate-*l*7.1%
*-commutative7.1%
unpow27.1%
unpow27.1%
hypot-def7.7%
Simplified7.7%
Taylor expanded in C around 0 15.2%
mul-1-neg15.2%
Simplified15.2%
Final simplification22.0%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= F 1.25e-302)
(/
(-
(sqrt
(*
2.0
(* F (* (+ (* B B) (* (* C A) -4.0)) (+ (hypot B (- A C)) (+ C A)))))))
(- (* B B) (* 4.0 (* C A))))
(if (<= F 2e+44)
(* (sqrt (* F (+ A (hypot B A)))) (/ (- (sqrt 2.0)) B))
(* (sqrt 2.0) (- (sqrt (/ F B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= 1.25e-302) {
tmp = -sqrt((2.0 * (F * (((B * B) + ((C * A) * -4.0)) * (hypot(B, (A - C)) + (C + A)))))) / ((B * B) - (4.0 * (C * A)));
} else if (F <= 2e+44) {
tmp = sqrt((F * (A + hypot(B, A)))) * (-sqrt(2.0) / B);
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (F <= 1.25e-302) {
tmp = -Math.sqrt((2.0 * (F * (((B * B) + ((C * A) * -4.0)) * (Math.hypot(B, (A - C)) + (C + A)))))) / ((B * B) - (4.0 * (C * A)));
} else if (F <= 2e+44) {
tmp = Math.sqrt((F * (A + Math.hypot(B, A)))) * (-Math.sqrt(2.0) / B);
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if F <= 1.25e-302: tmp = -math.sqrt((2.0 * (F * (((B * B) + ((C * A) * -4.0)) * (math.hypot(B, (A - C)) + (C + A)))))) / ((B * B) - (4.0 * (C * A))) elif F <= 2e+44: tmp = math.sqrt((F * (A + math.hypot(B, A)))) * (-math.sqrt(2.0) / B) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= 1.25e-302) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(Float64(Float64(B * B) + Float64(Float64(C * A) * -4.0)) * Float64(hypot(B, Float64(A - C)) + Float64(C + A))))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(C * A)))); elseif (F <= 2e+44) tmp = Float64(sqrt(Float64(F * Float64(A + hypot(B, A)))) * Float64(Float64(-sqrt(2.0)) / B)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (F <= 1.25e-302) tmp = -sqrt((2.0 * (F * (((B * B) + ((C * A) * -4.0)) * (hypot(B, (A - C)) + (C + A)))))) / ((B * B) - (4.0 * (C * A))); elseif (F <= 2e+44) tmp = sqrt((F * (A + hypot(B, A)))) * (-sqrt(2.0) / B); else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[F, 1.25e-302], N[((-N[Sqrt[N[(2.0 * N[(F * N[(N[(N[(B * B), $MachinePrecision] + N[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision] + N[(C + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e+44], N[(N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.25 \cdot 10^{-302}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(\left(B \cdot B + \left(C \cdot A\right) \cdot -4\right) \cdot \left(\mathsf{hypot}\left(B, A - C\right) + \left(C + A\right)\right)\right)\right)}}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+44}:\\
\;\;\;\;\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 1.25000000000000008e-302Initial program 37.7%
associate-*l*37.7%
unpow237.7%
+-commutative37.7%
unpow237.7%
associate-*l*37.7%
unpow237.7%
Simplified37.7%
*-un-lft-identity37.7%
associate-*l*37.7%
*-commutative37.7%
*-commutative37.7%
unpow237.7%
hypot-udef46.0%
+-commutative46.0%
associate-+r+46.0%
Applied egg-rr46.0%
*-lft-identity46.0%
associate-*r*46.0%
fma-neg46.0%
*-commutative46.0%
*-commutative46.0%
distribute-rgt-neg-in46.0%
*-commutative46.0%
metadata-eval46.0%
associate-*r*46.0%
associate-*r*46.0%
associate-*l*46.0%
Simplified46.0%
if 1.25000000000000008e-302 < F < 2.0000000000000002e44Initial program 17.8%
Simplified24.2%
Taylor expanded in C around 0 8.8%
mul-1-neg8.8%
distribute-rgt-neg-in8.8%
unpow28.8%
unpow28.8%
hypot-def20.9%
Simplified20.9%
if 2.0000000000000002e44 < F Initial program 14.6%
Simplified16.8%
Taylor expanded in A around 0 5.6%
*-commutative5.6%
associate-*l*5.6%
*-commutative5.6%
unpow25.6%
unpow25.6%
hypot-def6.1%
Simplified6.1%
Taylor expanded in C around 0 14.6%
mul-1-neg14.6%
Simplified14.6%
Final simplification22.0%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))) (t_1 (/ (sqrt 2.0) B)))
(if (<= B 9.4e+80)
(/ (- (sqrt (* 2.0 (* (* F t_0) (+ C (+ A (hypot B (- A C)))))))) t_0)
(if (<= B 1.7e+202)
(* t_1 (- (sqrt (* B F))))
(if (<= B 6e+268)
(* (sqrt 2.0) (- (sqrt (/ F B))))
(* t_1 (- (sqrt (* F (+ B A))))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double t_1 = sqrt(2.0) / B;
double tmp;
if (B <= 9.4e+80) {
tmp = -sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0;
} else if (B <= 1.7e+202) {
tmp = t_1 * -sqrt((B * F));
} else if (B <= 6e+268) {
tmp = sqrt(2.0) * -sqrt((F / B));
} else {
tmp = t_1 * -sqrt((F * (B + A)));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double t_1 = Math.sqrt(2.0) / B;
double tmp;
if (B <= 9.4e+80) {
tmp = -Math.sqrt((2.0 * ((F * t_0) * (C + (A + Math.hypot(B, (A - C))))))) / t_0;
} else if (B <= 1.7e+202) {
tmp = t_1 * -Math.sqrt((B * F));
} else if (B <= 6e+268) {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
} else {
tmp = t_1 * -Math.sqrt((F * (B + A)));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) t_1 = math.sqrt(2.0) / B tmp = 0 if B <= 9.4e+80: tmp = -math.sqrt((2.0 * ((F * t_0) * (C + (A + math.hypot(B, (A - C))))))) / t_0 elif B <= 1.7e+202: tmp = t_1 * -math.sqrt((B * F)) elif B <= 6e+268: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) else: tmp = t_1 * -math.sqrt((F * (B + A))) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) t_1 = Float64(sqrt(2.0) / B) tmp = 0.0 if (B <= 9.4e+80) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(C + Float64(A + hypot(B, Float64(A - C)))))))) / t_0); elseif (B <= 1.7e+202) tmp = Float64(t_1 * Float64(-sqrt(Float64(B * F)))); elseif (B <= 6e+268) tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); else tmp = Float64(t_1 * Float64(-sqrt(Float64(F * Float64(B + A))))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (C * A)); t_1 = sqrt(2.0) / B; tmp = 0.0; if (B <= 9.4e+80) tmp = -sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0; elseif (B <= 1.7e+202) tmp = t_1 * -sqrt((B * F)); elseif (B <= 6e+268) tmp = sqrt(2.0) * -sqrt((F / B)); else tmp = t_1 * -sqrt((F * (B + A))); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[B, 9.4e+80], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 1.7e+202], N[(t$95$1 * (-N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[B, 6e+268], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(t$95$1 * (-N[Sqrt[N[(F * N[(B + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
t_1 := \frac{\sqrt{2}}{B}\\
\mathbf{if}\;B \leq 9.4 \cdot 10^{+80}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 1.7 \cdot 10^{+202}:\\
\;\;\;\;t_1 \cdot \left(-\sqrt{B \cdot F}\right)\\
\mathbf{elif}\;B \leq 6 \cdot 10^{+268}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(-\sqrt{F \cdot \left(B + A\right)}\right)\\
\end{array}
\end{array}
if B < 9.40000000000000019e80Initial program 22.4%
associate-*l*22.4%
unpow222.4%
+-commutative22.4%
unpow222.4%
associate-*l*22.4%
unpow222.4%
Simplified22.4%
distribute-frac-neg22.4%
Applied egg-rr28.6%
if 9.40000000000000019e80 < B < 1.7e202Initial program 12.6%
Simplified13.4%
Taylor expanded in C around 0 31.4%
mul-1-neg31.4%
unpow231.4%
unpow231.4%
Simplified31.4%
Taylor expanded in A around 0 43.6%
if 1.7e202 < B < 5.99999999999999984e268Initial program 0.0%
Simplified0.0%
Taylor expanded in A around 0 0.0%
*-commutative0.0%
associate-*l*0.0%
*-commutative0.0%
unpow20.0%
unpow20.0%
hypot-def2.5%
Simplified2.5%
Taylor expanded in C around 0 50.3%
mul-1-neg50.3%
Simplified50.3%
if 5.99999999999999984e268 < B Initial program 0.0%
Simplified0.0%
Taylor expanded in C around 0 2.2%
mul-1-neg2.2%
unpow22.2%
unpow22.2%
Simplified2.2%
Taylor expanded in B around inf 63.2%
Final simplification32.5%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= F -5e-310)
(/
(*
(sqrt (* 2.0 (* F (+ (* B B) (* (* C A) -4.0)))))
(- (sqrt (+ A (+ C A)))))
(- (* B B) (* 4.0 (* C A))))
(if (<= F 2.25e-27)
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ B A)))))
(* (sqrt 2.0) (- (sqrt (/ F B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= -5e-310) {
tmp = (sqrt((2.0 * (F * ((B * B) + ((C * A) * -4.0))))) * -sqrt((A + (C + A)))) / ((B * B) - (4.0 * (C * A)));
} else if (F <= 2.25e-27) {
tmp = (sqrt(2.0) / B) * -sqrt((F * (B + A)));
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
NOTE: B should be positive 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) :: tmp
if (f <= (-5d-310)) then
tmp = (sqrt((2.0d0 * (f * ((b * b) + ((c * a) * (-4.0d0)))))) * -sqrt((a + (c + a)))) / ((b * b) - (4.0d0 * (c * a)))
else if (f <= 2.25d-27) then
tmp = (sqrt(2.0d0) / b) * -sqrt((f * (b + a)))
else
tmp = sqrt(2.0d0) * -sqrt((f / b))
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (F <= -5e-310) {
tmp = (Math.sqrt((2.0 * (F * ((B * B) + ((C * A) * -4.0))))) * -Math.sqrt((A + (C + A)))) / ((B * B) - (4.0 * (C * A)));
} else if (F <= 2.25e-27) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (B + A)));
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if F <= -5e-310: tmp = (math.sqrt((2.0 * (F * ((B * B) + ((C * A) * -4.0))))) * -math.sqrt((A + (C + A)))) / ((B * B) - (4.0 * (C * A))) elif F <= 2.25e-27: tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (B + A))) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= -5e-310) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(Float64(C * A) * -4.0))))) * Float64(-sqrt(Float64(A + Float64(C + A))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(C * A)))); elseif (F <= 2.25e-27) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(B + A))))); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (F <= -5e-310) tmp = (sqrt((2.0 * (F * ((B * B) + ((C * A) * -4.0))))) * -sqrt((A + (C + A)))) / ((B * B) - (4.0 * (C * A))); elseif (F <= 2.25e-27) tmp = (sqrt(2.0) / B) * -sqrt((F * (B + A))); else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[F, -5e-310], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + N[(C + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.25e-27], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(B + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + \left(C \cdot A\right) \cdot -4\right)\right)} \cdot \left(-\sqrt{A + \left(C + A\right)}\right)}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\
\mathbf{elif}\;F \leq 2.25 \cdot 10^{-27}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(B + A\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < -4.999999999999985e-310Initial program 40.8%
associate-*l*40.8%
unpow240.8%
+-commutative40.8%
unpow240.8%
associate-*l*40.8%
unpow240.8%
Simplified40.8%
Taylor expanded in A around inf 27.1%
sqrt-prod36.3%
*-commutative36.3%
cancel-sign-sub-inv36.3%
*-commutative36.3%
metadata-eval36.3%
associate-+l+36.3%
Applied egg-rr36.3%
if -4.999999999999985e-310 < F < 2.2500000000000001e-27Initial program 19.7%
Simplified26.9%
Taylor expanded in C around 0 9.0%
mul-1-neg9.0%
unpow29.0%
unpow29.0%
Simplified9.0%
Taylor expanded in B around inf 17.2%
if 2.2500000000000001e-27 < F Initial program 13.1%
Simplified15.3%
Taylor expanded in A around 0 5.8%
*-commutative5.8%
associate-*l*5.7%
*-commutative5.7%
unpow25.7%
unpow25.7%
hypot-def6.4%
Simplified6.4%
Taylor expanded in C around 0 14.2%
mul-1-neg14.2%
Simplified14.2%
Final simplification18.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= F -5e-310)
(- (/ (sqrt (* (* 2.0 (* F t_0)) (+ (+ C A) (- C A)))) t_0))
(if (<= F 2.1e-25)
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ B A)))))
(* (sqrt 2.0) (- (sqrt (/ F B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (F <= -5e-310) {
tmp = -(sqrt(((2.0 * (F * t_0)) * ((C + A) + (C - A)))) / t_0);
} else if (F <= 2.1e-25) {
tmp = (sqrt(2.0) / B) * -sqrt((F * (B + A)));
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
NOTE: B should be positive 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 * (c * a))
if (f <= (-5d-310)) then
tmp = -(sqrt(((2.0d0 * (f * t_0)) * ((c + a) + (c - a)))) / t_0)
else if (f <= 2.1d-25) then
tmp = (sqrt(2.0d0) / b) * -sqrt((f * (b + a)))
else
tmp = sqrt(2.0d0) * -sqrt((f / b))
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (F <= -5e-310) {
tmp = -(Math.sqrt(((2.0 * (F * t_0)) * ((C + A) + (C - A)))) / t_0);
} else if (F <= 2.1e-25) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (B + A)));
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if F <= -5e-310: tmp = -(math.sqrt(((2.0 * (F * t_0)) * ((C + A) + (C - A)))) / t_0) elif F <= 2.1e-25: tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (B + A))) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (F <= -5e-310) tmp = Float64(-Float64(sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(Float64(C + A) + Float64(C - A)))) / t_0)); elseif (F <= 2.1e-25) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(B + A))))); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (C * A)); tmp = 0.0; if (F <= -5e-310) tmp = -(sqrt(((2.0 * (F * t_0)) * ((C + A) + (C - A)))) / t_0); elseif (F <= 2.1e-25) tmp = (sqrt(2.0) / B) * -sqrt((F * (B + A))); else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5e-310], (-N[(N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(C + A), $MachinePrecision] + N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), If[LessEqual[F, 2.1e-25], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(B + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-\frac{\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(\left(C + A\right) + \left(C - A\right)\right)}}{t_0}\\
\mathbf{elif}\;F \leq 2.1 \cdot 10^{-25}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(B + A\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < -4.999999999999985e-310Initial program 40.8%
associate-*l*40.8%
unpow240.8%
+-commutative40.8%
unpow240.8%
associate-*l*40.8%
unpow240.8%
Simplified40.8%
Taylor expanded in A around -inf 28.7%
mul-1-neg28.7%
sub-neg28.7%
Simplified28.7%
if -4.999999999999985e-310 < F < 2.10000000000000002e-25Initial program 19.7%
Simplified26.9%
Taylor expanded in C around 0 9.0%
mul-1-neg9.0%
unpow29.0%
unpow29.0%
Simplified9.0%
Taylor expanded in B around inf 17.2%
if 2.10000000000000002e-25 < F Initial program 13.1%
Simplified15.3%
Taylor expanded in A around 0 5.8%
*-commutative5.8%
associate-*l*5.7%
*-commutative5.7%
unpow25.7%
unpow25.7%
hypot-def6.4%
Simplified6.4%
Taylor expanded in C around 0 14.2%
mul-1-neg14.2%
Simplified14.2%
Final simplification17.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= F -3.5e-291)
(- (/ (sqrt (* (* 2.0 (* F t_0)) (+ (+ C A) (- C A)))) t_0))
(if (<= F 40000000.0)
(* (/ (sqrt 2.0) B) (- (sqrt (* B F))))
(* (sqrt 2.0) (- (sqrt (/ F B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (F <= -3.5e-291) {
tmp = -(sqrt(((2.0 * (F * t_0)) * ((C + A) + (C - A)))) / t_0);
} else if (F <= 40000000.0) {
tmp = (sqrt(2.0) / B) * -sqrt((B * F));
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
NOTE: B should be positive 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 * (c * a))
if (f <= (-3.5d-291)) then
tmp = -(sqrt(((2.0d0 * (f * t_0)) * ((c + a) + (c - a)))) / t_0)
else if (f <= 40000000.0d0) then
tmp = (sqrt(2.0d0) / b) * -sqrt((b * f))
else
tmp = sqrt(2.0d0) * -sqrt((f / b))
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (F <= -3.5e-291) {
tmp = -(Math.sqrt(((2.0 * (F * t_0)) * ((C + A) + (C - A)))) / t_0);
} else if (F <= 40000000.0) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((B * F));
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if F <= -3.5e-291: tmp = -(math.sqrt(((2.0 * (F * t_0)) * ((C + A) + (C - A)))) / t_0) elif F <= 40000000.0: tmp = (math.sqrt(2.0) / B) * -math.sqrt((B * F)) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (F <= -3.5e-291) tmp = Float64(-Float64(sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(Float64(C + A) + Float64(C - A)))) / t_0)); elseif (F <= 40000000.0) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(B * F)))); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (C * A)); tmp = 0.0; if (F <= -3.5e-291) tmp = -(sqrt(((2.0 * (F * t_0)) * ((C + A) + (C - A)))) / t_0); elseif (F <= 40000000.0) tmp = (sqrt(2.0) / B) * -sqrt((B * F)); else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.5e-291], (-N[(N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(C + A), $MachinePrecision] + N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), If[LessEqual[F, 40000000.0], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;F \leq -3.5 \cdot 10^{-291}:\\
\;\;\;\;-\frac{\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(\left(C + A\right) + \left(C - A\right)\right)}}{t_0}\\
\mathbf{elif}\;F \leq 40000000:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < -3.49999999999999996e-291Initial program 41.4%
associate-*l*41.4%
unpow241.4%
+-commutative41.4%
unpow241.4%
associate-*l*41.4%
unpow241.4%
Simplified41.4%
Taylor expanded in A around -inf 31.2%
mul-1-neg31.2%
sub-neg31.2%
Simplified31.2%
if -3.49999999999999996e-291 < F < 4e7Initial program 18.6%
Simplified26.0%
Taylor expanded in C around 0 9.1%
mul-1-neg9.1%
unpow29.1%
unpow29.1%
Simplified9.1%
Taylor expanded in A around 0 17.7%
if 4e7 < F Initial program 14.1%
Simplified16.3%
Taylor expanded in A around 0 5.3%
*-commutative5.3%
associate-*l*5.3%
*-commutative5.3%
unpow25.3%
unpow25.3%
hypot-def5.8%
Simplified5.8%
Taylor expanded in C around 0 13.5%
mul-1-neg13.5%
Simplified13.5%
Final simplification17.4%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= C -1.6e+190)
(- (/ (sqrt (* -16.0 (* (* F C) (* A A)))) t_0))
(if (<= C 1.4e-48)
(* (sqrt 2.0) (- (sqrt (/ F B))))
(-
(/
(sqrt
(* (* 2.0 (* F t_0)) (+ (+ C A) (+ C (- (/ (* (* B B) 0.5) C) A)))))
t_0))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (C <= -1.6e+190) {
tmp = -(sqrt((-16.0 * ((F * C) * (A * A)))) / t_0);
} else if (C <= 1.4e-48) {
tmp = sqrt(2.0) * -sqrt((F / B));
} else {
tmp = -(sqrt(((2.0 * (F * t_0)) * ((C + A) + (C + ((((B * B) * 0.5) / C) - A))))) / t_0);
}
return tmp;
}
NOTE: B should be positive 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 * (c * a))
if (c <= (-1.6d+190)) then
tmp = -(sqrt(((-16.0d0) * ((f * c) * (a * a)))) / t_0)
else if (c <= 1.4d-48) then
tmp = sqrt(2.0d0) * -sqrt((f / b))
else
tmp = -(sqrt(((2.0d0 * (f * t_0)) * ((c + a) + (c + ((((b * b) * 0.5d0) / c) - a))))) / t_0)
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (C <= -1.6e+190) {
tmp = -(Math.sqrt((-16.0 * ((F * C) * (A * A)))) / t_0);
} else if (C <= 1.4e-48) {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
} else {
tmp = -(Math.sqrt(((2.0 * (F * t_0)) * ((C + A) + (C + ((((B * B) * 0.5) / C) - A))))) / t_0);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if C <= -1.6e+190: tmp = -(math.sqrt((-16.0 * ((F * C) * (A * A)))) / t_0) elif C <= 1.4e-48: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) else: tmp = -(math.sqrt(((2.0 * (F * t_0)) * ((C + A) + (C + ((((B * B) * 0.5) / C) - A))))) / t_0) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (C <= -1.6e+190) tmp = Float64(-Float64(sqrt(Float64(-16.0 * Float64(Float64(F * C) * Float64(A * A)))) / t_0)); elseif (C <= 1.4e-48) tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); else tmp = Float64(-Float64(sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(Float64(C + A) + Float64(C + Float64(Float64(Float64(Float64(B * B) * 0.5) / C) - A))))) / t_0)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (C * A)); tmp = 0.0; if (C <= -1.6e+190) tmp = -(sqrt((-16.0 * ((F * C) * (A * A)))) / t_0); elseif (C <= 1.4e-48) tmp = sqrt(2.0) * -sqrt((F / B)); else tmp = -(sqrt(((2.0 * (F * t_0)) * ((C + A) + (C + ((((B * B) * 0.5) / C) - A))))) / t_0); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -1.6e+190], (-N[(N[Sqrt[N[(-16.0 * N[(N[(F * C), $MachinePrecision] * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), If[LessEqual[C, 1.4e-48], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], (-N[(N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(C + A), $MachinePrecision] + N[(C + N[(N[(N[(N[(B * B), $MachinePrecision] * 0.5), $MachinePrecision] / C), $MachinePrecision] - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision])]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;C \leq -1.6 \cdot 10^{+190}:\\
\;\;\;\;-\frac{\sqrt{-16 \cdot \left(\left(F \cdot C\right) \cdot \left(A \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;C \leq 1.4 \cdot 10^{-48}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\mathbf{else}:\\
\;\;\;\;-\frac{\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(\left(C + A\right) + \left(C + \left(\frac{\left(B \cdot B\right) \cdot 0.5}{C} - A\right)\right)\right)}}{t_0}\\
\end{array}
\end{array}
if C < -1.6e190Initial program 0.8%
associate-*l*0.8%
unpow20.8%
+-commutative0.8%
unpow20.8%
associate-*l*0.8%
unpow20.8%
Simplified0.8%
Taylor expanded in A around inf 0.7%
Taylor expanded in A around inf 23.9%
unpow223.9%
Simplified23.9%
if -1.6e190 < C < 1.40000000000000002e-48Initial program 17.8%
Simplified20.8%
Taylor expanded in A around 0 6.8%
*-commutative6.8%
associate-*l*6.8%
*-commutative6.8%
unpow26.8%
unpow26.8%
hypot-def7.6%
Simplified7.6%
Taylor expanded in C around 0 12.9%
mul-1-neg12.9%
Simplified12.9%
if 1.40000000000000002e-48 < C Initial program 29.1%
associate-*l*29.1%
unpow229.1%
+-commutative29.1%
unpow229.1%
associate-*l*29.1%
unpow229.1%
Simplified29.1%
Taylor expanded in C around inf 32.3%
mul-1-neg32.3%
unsub-neg32.3%
Simplified32.7%
Final simplification20.5%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))) (t_1 (* 2.0 (* F t_0))))
(if (<= C -9.5e-243)
(- (/ (sqrt (* -16.0 (* (* F C) (* A A)))) t_0))
(if (<= C 2.5e-66)
(/ (- (sqrt (* t_1 (+ A (+ C A))))) t_0)
(-
(/
(sqrt (* t_1 (+ (+ C A) (+ C (- (/ (* (* B B) 0.5) C) A)))))
t_0))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double t_1 = 2.0 * (F * t_0);
double tmp;
if (C <= -9.5e-243) {
tmp = -(sqrt((-16.0 * ((F * C) * (A * A)))) / t_0);
} else if (C <= 2.5e-66) {
tmp = -sqrt((t_1 * (A + (C + A)))) / t_0;
} else {
tmp = -(sqrt((t_1 * ((C + A) + (C + ((((B * B) * 0.5) / C) - A))))) / t_0);
}
return tmp;
}
NOTE: B should be positive 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) :: t_1
real(8) :: tmp
t_0 = (b * b) - (4.0d0 * (c * a))
t_1 = 2.0d0 * (f * t_0)
if (c <= (-9.5d-243)) then
tmp = -(sqrt(((-16.0d0) * ((f * c) * (a * a)))) / t_0)
else if (c <= 2.5d-66) then
tmp = -sqrt((t_1 * (a + (c + a)))) / t_0
else
tmp = -(sqrt((t_1 * ((c + a) + (c + ((((b * b) * 0.5d0) / c) - a))))) / t_0)
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double t_1 = 2.0 * (F * t_0);
double tmp;
if (C <= -9.5e-243) {
tmp = -(Math.sqrt((-16.0 * ((F * C) * (A * A)))) / t_0);
} else if (C <= 2.5e-66) {
tmp = -Math.sqrt((t_1 * (A + (C + A)))) / t_0;
} else {
tmp = -(Math.sqrt((t_1 * ((C + A) + (C + ((((B * B) * 0.5) / C) - A))))) / t_0);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) t_1 = 2.0 * (F * t_0) tmp = 0 if C <= -9.5e-243: tmp = -(math.sqrt((-16.0 * ((F * C) * (A * A)))) / t_0) elif C <= 2.5e-66: tmp = -math.sqrt((t_1 * (A + (C + A)))) / t_0 else: tmp = -(math.sqrt((t_1 * ((C + A) + (C + ((((B * B) * 0.5) / C) - A))))) / t_0) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) t_1 = Float64(2.0 * Float64(F * t_0)) tmp = 0.0 if (C <= -9.5e-243) tmp = Float64(-Float64(sqrt(Float64(-16.0 * Float64(Float64(F * C) * Float64(A * A)))) / t_0)); elseif (C <= 2.5e-66) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(A + Float64(C + A))))) / t_0); else tmp = Float64(-Float64(sqrt(Float64(t_1 * Float64(Float64(C + A) + Float64(C + Float64(Float64(Float64(Float64(B * B) * 0.5) / C) - A))))) / t_0)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (C * A)); t_1 = 2.0 * (F * t_0); tmp = 0.0; if (C <= -9.5e-243) tmp = -(sqrt((-16.0 * ((F * C) * (A * A)))) / t_0); elseif (C <= 2.5e-66) tmp = -sqrt((t_1 * (A + (C + A)))) / t_0; else tmp = -(sqrt((t_1 * ((C + A) + (C + ((((B * B) * 0.5) / C) - A))))) / t_0); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -9.5e-243], (-N[(N[Sqrt[N[(-16.0 * N[(N[(F * C), $MachinePrecision] * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), If[LessEqual[C, 2.5e-66], N[((-N[Sqrt[N[(t$95$1 * N[(A + N[(C + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], (-N[(N[Sqrt[N[(t$95$1 * N[(N[(C + A), $MachinePrecision] + N[(C + N[(N[(N[(N[(B * B), $MachinePrecision] * 0.5), $MachinePrecision] / C), $MachinePrecision] - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision])]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
t_1 := 2 \cdot \left(F \cdot t_0\right)\\
\mathbf{if}\;C \leq -9.5 \cdot 10^{-243}:\\
\;\;\;\;-\frac{\sqrt{-16 \cdot \left(\left(F \cdot C\right) \cdot \left(A \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;C \leq 2.5 \cdot 10^{-66}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(A + \left(C + A\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;-\frac{\sqrt{t_1 \cdot \left(\left(C + A\right) + \left(C + \left(\frac{\left(B \cdot B\right) \cdot 0.5}{C} - A\right)\right)\right)}}{t_0}\\
\end{array}
\end{array}
if C < -9.5000000000000005e-243Initial program 10.6%
associate-*l*10.6%
unpow210.6%
+-commutative10.6%
unpow210.6%
associate-*l*10.6%
unpow210.6%
Simplified10.6%
Taylor expanded in A around inf 6.7%
Taylor expanded in A around inf 18.6%
unpow218.6%
Simplified18.6%
if -9.5000000000000005e-243 < C < 2.49999999999999981e-66Initial program 22.3%
associate-*l*22.3%
unpow222.3%
+-commutative22.3%
unpow222.3%
associate-*l*22.3%
unpow222.3%
Simplified22.3%
Taylor expanded in A around inf 15.5%
if 2.49999999999999981e-66 < C Initial program 28.9%
associate-*l*28.9%
unpow228.9%
+-commutative28.9%
unpow228.9%
associate-*l*28.9%
unpow228.9%
Simplified28.9%
Taylor expanded in C around inf 32.0%
mul-1-neg32.0%
unsub-neg32.0%
Simplified32.4%
Final simplification22.4%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))) (t_1 (* 2.0 (* F t_0))))
(if (<= C -1.2e-243)
(- (/ (sqrt (* -16.0 (* (* F C) (* A A)))) t_0))
(if (<= C 3e-66)
(/ (- (sqrt (* t_1 (+ A (+ C A))))) t_0)
(- (/ (sqrt (* t_1 (+ (+ C A) (- C A)))) t_0))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double t_1 = 2.0 * (F * t_0);
double tmp;
if (C <= -1.2e-243) {
tmp = -(sqrt((-16.0 * ((F * C) * (A * A)))) / t_0);
} else if (C <= 3e-66) {
tmp = -sqrt((t_1 * (A + (C + A)))) / t_0;
} else {
tmp = -(sqrt((t_1 * ((C + A) + (C - A)))) / t_0);
}
return tmp;
}
NOTE: B should be positive 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) :: t_1
real(8) :: tmp
t_0 = (b * b) - (4.0d0 * (c * a))
t_1 = 2.0d0 * (f * t_0)
if (c <= (-1.2d-243)) then
tmp = -(sqrt(((-16.0d0) * ((f * c) * (a * a)))) / t_0)
else if (c <= 3d-66) then
tmp = -sqrt((t_1 * (a + (c + a)))) / t_0
else
tmp = -(sqrt((t_1 * ((c + a) + (c - a)))) / t_0)
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double t_1 = 2.0 * (F * t_0);
double tmp;
if (C <= -1.2e-243) {
tmp = -(Math.sqrt((-16.0 * ((F * C) * (A * A)))) / t_0);
} else if (C <= 3e-66) {
tmp = -Math.sqrt((t_1 * (A + (C + A)))) / t_0;
} else {
tmp = -(Math.sqrt((t_1 * ((C + A) + (C - A)))) / t_0);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) t_1 = 2.0 * (F * t_0) tmp = 0 if C <= -1.2e-243: tmp = -(math.sqrt((-16.0 * ((F * C) * (A * A)))) / t_0) elif C <= 3e-66: tmp = -math.sqrt((t_1 * (A + (C + A)))) / t_0 else: tmp = -(math.sqrt((t_1 * ((C + A) + (C - A)))) / t_0) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) t_1 = Float64(2.0 * Float64(F * t_0)) tmp = 0.0 if (C <= -1.2e-243) tmp = Float64(-Float64(sqrt(Float64(-16.0 * Float64(Float64(F * C) * Float64(A * A)))) / t_0)); elseif (C <= 3e-66) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(A + Float64(C + A))))) / t_0); else tmp = Float64(-Float64(sqrt(Float64(t_1 * Float64(Float64(C + A) + Float64(C - A)))) / t_0)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (C * A)); t_1 = 2.0 * (F * t_0); tmp = 0.0; if (C <= -1.2e-243) tmp = -(sqrt((-16.0 * ((F * C) * (A * A)))) / t_0); elseif (C <= 3e-66) tmp = -sqrt((t_1 * (A + (C + A)))) / t_0; else tmp = -(sqrt((t_1 * ((C + A) + (C - A)))) / t_0); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -1.2e-243], (-N[(N[Sqrt[N[(-16.0 * N[(N[(F * C), $MachinePrecision] * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), If[LessEqual[C, 3e-66], N[((-N[Sqrt[N[(t$95$1 * N[(A + N[(C + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], (-N[(N[Sqrt[N[(t$95$1 * N[(N[(C + A), $MachinePrecision] + N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision])]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
t_1 := 2 \cdot \left(F \cdot t_0\right)\\
\mathbf{if}\;C \leq -1.2 \cdot 10^{-243}:\\
\;\;\;\;-\frac{\sqrt{-16 \cdot \left(\left(F \cdot C\right) \cdot \left(A \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;C \leq 3 \cdot 10^{-66}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(A + \left(C + A\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;-\frac{\sqrt{t_1 \cdot \left(\left(C + A\right) + \left(C - A\right)\right)}}{t_0}\\
\end{array}
\end{array}
if C < -1.2e-243Initial program 10.6%
associate-*l*10.6%
unpow210.6%
+-commutative10.6%
unpow210.6%
associate-*l*10.6%
unpow210.6%
Simplified10.6%
Taylor expanded in A around inf 6.7%
Taylor expanded in A around inf 18.6%
unpow218.6%
Simplified18.6%
if -1.2e-243 < C < 3.0000000000000002e-66Initial program 22.3%
associate-*l*22.3%
unpow222.3%
+-commutative22.3%
unpow222.3%
associate-*l*22.3%
unpow222.3%
Simplified22.3%
Taylor expanded in A around inf 15.5%
if 3.0000000000000002e-66 < C Initial program 28.9%
associate-*l*28.9%
unpow228.9%
+-commutative28.9%
unpow228.9%
associate-*l*28.9%
unpow228.9%
Simplified28.9%
Taylor expanded in A around -inf 31.6%
mul-1-neg31.6%
sub-neg31.6%
Simplified31.6%
Final simplification22.2%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= C -1.1e-241)
(- (/ (sqrt (* -16.0 (* (* F C) (* A A)))) t_0))
(if (<= C 3.6e+25)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ A (+ C A))))) t_0)
(/ (* 2.0 (* B (- (sqrt (* F C))))) t_0)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (C <= -1.1e-241) {
tmp = -(sqrt((-16.0 * ((F * C) * (A * A)))) / t_0);
} else if (C <= 3.6e+25) {
tmp = -sqrt(((2.0 * (F * t_0)) * (A + (C + A)))) / t_0;
} else {
tmp = (2.0 * (B * -sqrt((F * C)))) / t_0;
}
return tmp;
}
NOTE: B should be positive 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 * (c * a))
if (c <= (-1.1d-241)) then
tmp = -(sqrt(((-16.0d0) * ((f * c) * (a * a)))) / t_0)
else if (c <= 3.6d+25) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * (a + (c + a)))) / t_0
else
tmp = (2.0d0 * (b * -sqrt((f * c)))) / t_0
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (C <= -1.1e-241) {
tmp = -(Math.sqrt((-16.0 * ((F * C) * (A * A)))) / t_0);
} else if (C <= 3.6e+25) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (A + (C + A)))) / t_0;
} else {
tmp = (2.0 * (B * -Math.sqrt((F * C)))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if C <= -1.1e-241: tmp = -(math.sqrt((-16.0 * ((F * C) * (A * A)))) / t_0) elif C <= 3.6e+25: tmp = -math.sqrt(((2.0 * (F * t_0)) * (A + (C + A)))) / t_0 else: tmp = (2.0 * (B * -math.sqrt((F * C)))) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (C <= -1.1e-241) tmp = Float64(-Float64(sqrt(Float64(-16.0 * Float64(Float64(F * C) * Float64(A * A)))) / t_0)); elseif (C <= 3.6e+25) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(A + Float64(C + A))))) / t_0); else tmp = Float64(Float64(2.0 * Float64(B * Float64(-sqrt(Float64(F * C))))) / t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (C * A)); tmp = 0.0; if (C <= -1.1e-241) tmp = -(sqrt((-16.0 * ((F * C) * (A * A)))) / t_0); elseif (C <= 3.6e+25) tmp = -sqrt(((2.0 * (F * t_0)) * (A + (C + A)))) / t_0; else tmp = (2.0 * (B * -sqrt((F * C)))) / t_0; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -1.1e-241], (-N[(N[Sqrt[N[(-16.0 * N[(N[(F * C), $MachinePrecision] * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), If[LessEqual[C, 3.6e+25], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(A + N[(C + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(2.0 * N[(B * (-N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;C \leq -1.1 \cdot 10^{-241}:\\
\;\;\;\;-\frac{\sqrt{-16 \cdot \left(\left(F \cdot C\right) \cdot \left(A \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;C \leq 3.6 \cdot 10^{+25}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(A + \left(C + A\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \left(B \cdot \left(-\sqrt{F \cdot C}\right)\right)}{t_0}\\
\end{array}
\end{array}
if C < -1.1e-241Initial program 10.6%
associate-*l*10.6%
unpow210.6%
+-commutative10.6%
unpow210.6%
associate-*l*10.6%
unpow210.6%
Simplified10.6%
Taylor expanded in A around inf 6.7%
Taylor expanded in A around inf 18.6%
unpow218.6%
Simplified18.6%
if -1.1e-241 < C < 3.60000000000000015e25Initial program 28.8%
associate-*l*28.8%
unpow228.8%
+-commutative28.8%
unpow228.8%
associate-*l*28.8%
unpow228.8%
Simplified28.8%
Taylor expanded in A around inf 16.0%
if 3.60000000000000015e25 < C Initial program 22.4%
associate-*l*22.4%
unpow222.4%
+-commutative22.4%
unpow222.4%
associate-*l*22.4%
unpow222.4%
Simplified22.4%
sqrt-prod23.9%
*-commutative23.9%
*-commutative23.9%
associate-+l+23.9%
unpow223.9%
hypot-udef39.0%
associate-+r+39.0%
+-commutative39.0%
associate-+r+39.0%
Applied egg-rr39.0%
Taylor expanded in B around inf 16.0%
associate-*l*16.0%
Simplified16.0%
Taylor expanded in A around -inf 10.1%
associate-*l*10.1%
unpow210.1%
rem-square-sqrt10.2%
Simplified10.2%
Final simplification15.9%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= C 3.65e+25)
(- (/ (sqrt (* -16.0 (* (* F C) (* A A)))) t_0))
(/ (* 2.0 (* B (- (sqrt (* F C))))) t_0))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (C <= 3.65e+25) {
tmp = -(sqrt((-16.0 * ((F * C) * (A * A)))) / t_0);
} else {
tmp = (2.0 * (B * -sqrt((F * C)))) / t_0;
}
return tmp;
}
NOTE: B should be positive 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 * (c * a))
if (c <= 3.65d+25) then
tmp = -(sqrt(((-16.0d0) * ((f * c) * (a * a)))) / t_0)
else
tmp = (2.0d0 * (b * -sqrt((f * c)))) / t_0
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (C <= 3.65e+25) {
tmp = -(Math.sqrt((-16.0 * ((F * C) * (A * A)))) / t_0);
} else {
tmp = (2.0 * (B * -Math.sqrt((F * C)))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if C <= 3.65e+25: tmp = -(math.sqrt((-16.0 * ((F * C) * (A * A)))) / t_0) else: tmp = (2.0 * (B * -math.sqrt((F * C)))) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (C <= 3.65e+25) tmp = Float64(-Float64(sqrt(Float64(-16.0 * Float64(Float64(F * C) * Float64(A * A)))) / t_0)); else tmp = Float64(Float64(2.0 * Float64(B * Float64(-sqrt(Float64(F * C))))) / t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (C * A)); tmp = 0.0; if (C <= 3.65e+25) tmp = -(sqrt((-16.0 * ((F * C) * (A * A)))) / t_0); else tmp = (2.0 * (B * -sqrt((F * C)))) / t_0; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, 3.65e+25], (-N[(N[Sqrt[N[(-16.0 * N[(N[(F * C), $MachinePrecision] * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), N[(N[(2.0 * N[(B * (-N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;C \leq 3.65 \cdot 10^{+25}:\\
\;\;\;\;-\frac{\sqrt{-16 \cdot \left(\left(F \cdot C\right) \cdot \left(A \cdot A\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \left(B \cdot \left(-\sqrt{F \cdot C}\right)\right)}{t_0}\\
\end{array}
\end{array}
if C < 3.6499999999999998e25Initial program 18.5%
associate-*l*18.5%
unpow218.5%
+-commutative18.5%
unpow218.5%
associate-*l*18.5%
unpow218.5%
Simplified18.5%
Taylor expanded in A around inf 10.7%
Taylor expanded in A around inf 13.9%
unpow213.9%
Simplified13.9%
if 3.6499999999999998e25 < C Initial program 22.4%
associate-*l*22.4%
unpow222.4%
+-commutative22.4%
unpow222.4%
associate-*l*22.4%
unpow222.4%
Simplified22.4%
sqrt-prod23.9%
*-commutative23.9%
*-commutative23.9%
associate-+l+23.9%
unpow223.9%
hypot-udef39.0%
associate-+r+39.0%
+-commutative39.0%
associate-+r+39.0%
Applied egg-rr39.0%
Taylor expanded in B around inf 16.0%
associate-*l*16.0%
Simplified16.0%
Taylor expanded in A around -inf 10.1%
associate-*l*10.1%
unpow210.1%
rem-square-sqrt10.2%
Simplified10.2%
Final simplification13.1%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* C A)))))
(if (<= C 1.3e-32)
(/ (* (sqrt (* F A)) (* B (- 2.0))) t_0)
(/ (* 2.0 (* B (- (sqrt (* F C))))) t_0))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (C <= 1.3e-32) {
tmp = (sqrt((F * A)) * (B * -2.0)) / t_0;
} else {
tmp = (2.0 * (B * -sqrt((F * C)))) / t_0;
}
return tmp;
}
NOTE: B should be positive 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 * (c * a))
if (c <= 1.3d-32) then
tmp = (sqrt((f * a)) * (b * -2.0d0)) / t_0
else
tmp = (2.0d0 * (b * -sqrt((f * c)))) / t_0
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (C <= 1.3e-32) {
tmp = (Math.sqrt((F * A)) * (B * -2.0)) / t_0;
} else {
tmp = (2.0 * (B * -Math.sqrt((F * C)))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if C <= 1.3e-32: tmp = (math.sqrt((F * A)) * (B * -2.0)) / t_0 else: tmp = (2.0 * (B * -math.sqrt((F * C)))) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) tmp = 0.0 if (C <= 1.3e-32) tmp = Float64(Float64(sqrt(Float64(F * A)) * Float64(B * Float64(-2.0))) / t_0); else tmp = Float64(Float64(2.0 * Float64(B * Float64(-sqrt(Float64(F * C))))) / t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (C * A)); tmp = 0.0; if (C <= 1.3e-32) tmp = (sqrt((F * A)) * (B * -2.0)) / t_0; else tmp = (2.0 * (B * -sqrt((F * C)))) / t_0; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, 1.3e-32], N[(N[(N[Sqrt[N[(F * A), $MachinePrecision]], $MachinePrecision] * N[(B * (-2.0)), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(2.0 * N[(B * (-N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;C \leq 1.3 \cdot 10^{-32}:\\
\;\;\;\;\frac{\sqrt{F \cdot A} \cdot \left(B \cdot \left(-2\right)\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \left(B \cdot \left(-\sqrt{F \cdot C}\right)\right)}{t_0}\\
\end{array}
\end{array}
if C < 1.2999999999999999e-32Initial program 15.5%
associate-*l*15.5%
unpow215.5%
+-commutative15.5%
unpow215.5%
associate-*l*15.5%
unpow215.5%
Simplified15.5%
sqrt-prod18.5%
*-commutative18.5%
*-commutative18.5%
associate-+l+18.9%
unpow218.9%
hypot-udef24.7%
associate-+r+23.7%
+-commutative23.7%
associate-+r+24.1%
Applied egg-rr24.1%
Taylor expanded in B around inf 7.3%
associate-*l*7.3%
Simplified7.3%
Taylor expanded in B around 0 2.6%
unpow22.6%
rem-square-sqrt2.6%
Simplified2.6%
if 1.2999999999999999e-32 < C Initial program 28.3%
associate-*l*28.3%
unpow228.3%
+-commutative28.3%
unpow228.3%
associate-*l*28.3%
unpow228.3%
Simplified28.3%
sqrt-prod31.2%
*-commutative31.2%
*-commutative31.2%
associate-+l+31.2%
unpow231.2%
hypot-udef43.8%
associate-+r+43.8%
+-commutative43.8%
associate-+r+44.3%
Applied egg-rr44.3%
Taylor expanded in B around inf 12.7%
associate-*l*12.7%
Simplified12.7%
Taylor expanded in A around -inf 8.3%
associate-*l*8.3%
unpow28.3%
rem-square-sqrt8.4%
Simplified8.4%
Final simplification4.3%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (/ (* 2.0 (* B (- (sqrt (* F C))))) (- (* B B) (* 4.0 (* C A)))))
B = abs(B);
double code(double A, double B, double C, double F) {
return (2.0 * (B * -sqrt((F * C)))) / ((B * B) - (4.0 * (C * A)));
}
NOTE: B should be positive 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((f * c)))) / ((b * b) - (4.0d0 * (c * a)))
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return (2.0 * (B * -Math.sqrt((F * C)))) / ((B * B) - (4.0 * (C * A)));
}
B = abs(B) def code(A, B, C, F): return (2.0 * (B * -math.sqrt((F * C)))) / ((B * B) - (4.0 * (C * A)))
B = abs(B) function code(A, B, C, F) return Float64(Float64(2.0 * Float64(B * Float64(-sqrt(Float64(F * C))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(C * A)))) end
B = abs(B) function tmp = code(A, B, C, F) tmp = (2.0 * (B * -sqrt((F * C)))) / ((B * B) - (4.0 * (C * A))); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(N[(2.0 * N[(B * (-N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\frac{2 \cdot \left(B \cdot \left(-\sqrt{F \cdot C}\right)\right)}{B \cdot B - 4 \cdot \left(C \cdot A\right)}
\end{array}
Initial program 19.3%
associate-*l*19.3%
unpow219.3%
+-commutative19.3%
unpow219.3%
associate-*l*19.3%
unpow219.3%
Simplified19.3%
sqrt-prod22.3%
*-commutative22.3%
*-commutative22.3%
associate-+l+22.5%
unpow222.5%
hypot-udef30.4%
associate-+r+29.6%
+-commutative29.6%
associate-+r+30.1%
Applied egg-rr30.1%
Taylor expanded in B around inf 8.9%
associate-*l*8.9%
Simplified8.9%
Taylor expanded in A around -inf 3.3%
associate-*l*3.3%
unpow23.3%
rem-square-sqrt3.4%
Simplified3.4%
Final simplification3.4%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (- (sqrt (* F (+ (/ C (* A A)) (/ 1.0 A))))))
B = abs(B);
double code(double A, double B, double C, double F) {
return -sqrt((F * ((C / (A * A)) + (1.0 / A))));
}
NOTE: B should be positive 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((f * ((c / (a * a)) + (1.0d0 / a))))
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return -Math.sqrt((F * ((C / (A * A)) + (1.0 / A))));
}
B = abs(B) def code(A, B, C, F): return -math.sqrt((F * ((C / (A * A)) + (1.0 / A))))
B = abs(B) function code(A, B, C, F) return Float64(-sqrt(Float64(F * Float64(Float64(C / Float64(A * A)) + Float64(1.0 / A))))) end
B = abs(B) function tmp = code(A, B, C, F) tmp = -sqrt((F * ((C / (A * A)) + (1.0 / A)))); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := (-N[Sqrt[N[(F * N[(N[(C / N[(A * A), $MachinePrecision]), $MachinePrecision] + N[(1.0 / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])
\begin{array}{l}
B = |B|\\
\\
-\sqrt{F \cdot \left(\frac{C}{A \cdot A} + \frac{1}{A}\right)}
\end{array}
Initial program 19.3%
associate-*l*19.3%
unpow219.3%
+-commutative19.3%
unpow219.3%
associate-*l*19.3%
unpow219.3%
Simplified19.3%
Taylor expanded in A around inf 7.8%
+-commutative7.8%
mul-1-neg7.8%
unsub-neg7.8%
Simplified8.2%
Taylor expanded in B around inf 2.5%
mul-1-neg2.5%
unpow22.5%
Simplified2.5%
sqrt-unprod2.5%
metadata-eval2.5%
metadata-eval2.5%
Applied egg-rr2.5%
Final simplification2.5%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* 0.25 (* (sqrt (/ F A)) (/ 2.0 (/ C B)))))
B = abs(B);
double code(double A, double B, double C, double F) {
return 0.25 * (sqrt((F / A)) * (2.0 / (C / B)));
}
NOTE: B should be positive 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 = 0.25d0 * (sqrt((f / a)) * (2.0d0 / (c / b)))
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return 0.25 * (Math.sqrt((F / A)) * (2.0 / (C / B)));
}
B = abs(B) def code(A, B, C, F): return 0.25 * (math.sqrt((F / A)) * (2.0 / (C / B)))
B = abs(B) function code(A, B, C, F) return Float64(0.25 * Float64(sqrt(Float64(F / A)) * Float64(2.0 / Float64(C / B)))) end
B = abs(B) function tmp = code(A, B, C, F) tmp = 0.25 * (sqrt((F / A)) * (2.0 / (C / B))); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(0.25 * N[(N[Sqrt[N[(F / A), $MachinePrecision]], $MachinePrecision] * N[(2.0 / N[(C / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
0.25 \cdot \left(\sqrt{\frac{F}{A}} \cdot \frac{2}{\frac{C}{B}}\right)
\end{array}
Initial program 19.3%
associate-*l*19.3%
unpow219.3%
+-commutative19.3%
unpow219.3%
associate-*l*19.3%
unpow219.3%
Simplified19.3%
sqrt-prod22.3%
*-commutative22.3%
*-commutative22.3%
associate-+l+22.5%
unpow222.5%
hypot-udef30.4%
associate-+r+29.6%
+-commutative29.6%
associate-+r+30.1%
Applied egg-rr30.1%
Taylor expanded in B around inf 8.9%
associate-*l*8.9%
Simplified8.9%
Taylor expanded in B around 0 1.6%
associate-/l*1.6%
unpow21.6%
rem-square-sqrt1.6%
Simplified1.6%
Final simplification1.6%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* (* 0.25 (/ (* B 2.0) A)) (sqrt (/ F C))))
B = abs(B);
double code(double A, double B, double C, double F) {
return (0.25 * ((B * 2.0) / A)) * sqrt((F / C));
}
NOTE: B should be positive 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 = (0.25d0 * ((b * 2.0d0) / a)) * sqrt((f / c))
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return (0.25 * ((B * 2.0) / A)) * Math.sqrt((F / C));
}
B = abs(B) def code(A, B, C, F): return (0.25 * ((B * 2.0) / A)) * math.sqrt((F / C))
B = abs(B) function code(A, B, C, F) return Float64(Float64(0.25 * Float64(Float64(B * 2.0) / A)) * sqrt(Float64(F / C))) end
B = abs(B) function tmp = code(A, B, C, F) tmp = (0.25 * ((B * 2.0) / A)) * sqrt((F / C)); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(N[(0.25 * N[(N[(B * 2.0), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(F / C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\left(0.25 \cdot \frac{B \cdot 2}{A}\right) \cdot \sqrt{\frac{F}{C}}
\end{array}
Initial program 19.3%
associate-*l*19.3%
unpow219.3%
+-commutative19.3%
unpow219.3%
associate-*l*19.3%
unpow219.3%
Simplified19.3%
sqrt-prod22.3%
*-commutative22.3%
*-commutative22.3%
associate-+l+22.5%
unpow222.5%
hypot-udef30.4%
associate-+r+29.6%
+-commutative29.6%
associate-+r+30.1%
Applied egg-rr30.1%
Taylor expanded in B around inf 8.9%
associate-*l*8.9%
Simplified8.9%
Taylor expanded in A around -inf 2.0%
associate-*r*2.0%
unpow22.0%
rem-square-sqrt2.0%
Simplified2.0%
Final simplification2.0%
herbie shell --seed 2023229
(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))))