
(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: 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 (* F t_0))) (- (sqrt (+ C (+ A (hypot B (- A C)))))))
t_0)))
(if (<= B 1.05e-212)
t_1
(if (<= B 6.6e-126)
(/ (- (sqrt (* (* 2.0 (* -4.0 (* F (* C A)))) (* 2.0 C)))) t_0)
(if (<= B 7e+59)
t_1
(* (/ (sqrt 2.0) B) (* (sqrt F) (- (sqrt (+ C (hypot B C)))))))))))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 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0;
double tmp;
if (B <= 1.05e-212) {
tmp = t_1;
} else if (B <= 6.6e-126) {
tmp = -sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0;
} else if (B <= 7e+59) {
tmp = t_1;
} else {
tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((C + hypot(B, C))));
}
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 * (F * t_0))) * -Math.sqrt((C + (A + Math.hypot(B, (A - C)))))) / t_0;
double tmp;
if (B <= 1.05e-212) {
tmp = t_1;
} else if (B <= 6.6e-126) {
tmp = -Math.sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0;
} else if (B <= 7e+59) {
tmp = t_1;
} else {
tmp = (Math.sqrt(2.0) / B) * (Math.sqrt(F) * -Math.sqrt((C + Math.hypot(B, C))));
}
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 * (F * t_0))) * -math.sqrt((C + (A + math.hypot(B, (A - C)))))) / t_0 tmp = 0 if B <= 1.05e-212: tmp = t_1 elif B <= 6.6e-126: tmp = -math.sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0 elif B <= 7e+59: tmp = t_1 else: tmp = (math.sqrt(2.0) / B) * (math.sqrt(F) * -math.sqrt((C + math.hypot(B, C)))) 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(Float64(sqrt(Float64(2.0 * Float64(F * t_0))) * Float64(-sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / t_0) tmp = 0.0 if (B <= 1.05e-212) tmp = t_1; elseif (B <= 6.6e-126) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(-4.0 * Float64(F * Float64(C * A)))) * Float64(2.0 * C)))) / t_0); elseif (B <= 7e+59) tmp = t_1; else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(F) * Float64(-sqrt(Float64(C + hypot(B, C)))))); 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 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0; tmp = 0.0; if (B <= 1.05e-212) tmp = t_1; elseif (B <= 6.6e-126) tmp = -sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0; elseif (B <= 7e+59) tmp = t_1; else tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((C + hypot(B, C)))); 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[(N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[B, 1.05e-212], t$95$1, If[LessEqual[B, 6.6e-126], N[((-N[Sqrt[N[(N[(2.0 * N[(-4.0 * N[(F * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 7e+59], t$95$1, N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $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 \cdot \left(F \cdot t_0\right)} \cdot \left(-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{t_0}\\
\mathbf{if}\;B \leq 1.05 \cdot 10^{-212}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;B \leq 6.6 \cdot 10^{-126}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(-4 \cdot \left(F \cdot \left(C \cdot A\right)\right)\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{elif}\;B \leq 7 \cdot 10^{+59}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{C + \mathsf{hypot}\left(B, C\right)}\right)\right)\\
\end{array}
\end{array}
if B < 1.05e-212 or 6.6000000000000001e-126 < B < 7e59Initial program 16.6%
associate-*l*16.6%
unpow216.6%
+-commutative16.6%
unpow216.6%
associate-*l*16.6%
unpow216.6%
Simplified16.6%
sqrt-prod17.1%
*-commutative17.1%
*-commutative17.1%
associate-+l+17.5%
unpow217.5%
hypot-udef27.9%
associate-+r+27.2%
+-commutative27.2%
associate-+r+28.0%
Applied egg-rr28.0%
if 1.05e-212 < B < 6.6000000000000001e-126Initial program 18.9%
associate-*l*18.9%
unpow218.9%
+-commutative18.9%
unpow218.9%
associate-*l*18.9%
unpow218.9%
Simplified18.9%
Taylor expanded in A around -inf 7.3%
associate-+r+7.3%
mul-1-neg7.3%
unsub-neg7.3%
distribute-lft-out7.3%
*-commutative7.3%
unpow27.3%
times-frac13.4%
unpow213.4%
unpow213.4%
Simplified13.4%
Taylor expanded in B around 0 13.6%
associate-*r*13.4%
Simplified13.4%
Taylor expanded in A around inf 30.7%
if 7e59 < B Initial program 14.6%
Simplified16.6%
Taylor expanded in A around 0 21.1%
mul-1-neg21.1%
*-commutative21.1%
unpow221.1%
unpow221.1%
Simplified21.1%
sqrt-prod26.1%
hypot-def74.0%
Applied egg-rr74.0%
Final simplification38.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 (<= (pow B 2.0) 1e+32)
(/
(* (sqrt (* 2.0 (* F t_0))) (- (sqrt (+ C (+ A (hypot B (- A C)))))))
t_0)
(* (/ (sqrt 2.0) B) (* (sqrt (+ A (hypot B A))) (- (sqrt F)))))))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) <= 1e+32) {
tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * (sqrt((A + hypot(B, A))) * -sqrt(F));
}
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) <= 1e+32) {
tmp = (Math.sqrt((2.0 * (F * t_0))) * -Math.sqrt((C + (A + Math.hypot(B, (A - C)))))) / t_0;
} else {
tmp = (Math.sqrt(2.0) / B) * (Math.sqrt((A + Math.hypot(B, A))) * -Math.sqrt(F));
}
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) <= 1e+32: tmp = (math.sqrt((2.0 * (F * t_0))) * -math.sqrt((C + (A + math.hypot(B, (A - C)))))) / t_0 else: tmp = (math.sqrt(2.0) / B) * (math.sqrt((A + math.hypot(B, A))) * -math.sqrt(F)) 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) <= 1e+32) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * t_0))) * Float64(-sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(Float64(A + hypot(B, A))) * Float64(-sqrt(F)))); 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) <= 1e+32) tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0; else tmp = (sqrt(2.0) / B) * (sqrt((A + hypot(B, A))) * -sqrt(F)); 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], 1e+32], N[(N[(N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $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}\;{B}^{2} \leq 10^{+32}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot t_0\right)} \cdot \left(-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 1.00000000000000005e32Initial program 20.3%
associate-*l*20.3%
unpow220.3%
+-commutative20.3%
unpow220.3%
associate-*l*20.3%
unpow220.3%
Simplified20.3%
sqrt-prod20.1%
*-commutative20.1%
*-commutative20.1%
associate-+l+20.9%
unpow220.9%
hypot-udef33.7%
associate-+r+32.4%
+-commutative32.4%
associate-+r+33.7%
Applied egg-rr33.7%
if 1.00000000000000005e32 < (pow.f64 B 2) Initial program 12.0%
Simplified14.6%
Taylor expanded in C around 0 12.2%
mul-1-neg12.2%
distribute-rgt-neg-in12.2%
unpow212.2%
unpow212.2%
hypot-def31.3%
Simplified31.3%
sqrt-prod40.0%
Applied egg-rr40.0%
Final simplification36.7%
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 (* F t_0))) (- (sqrt (+ C (+ A (hypot B (- A C)))))))
t_0)))
(if (<= B 3.5e-210)
t_1
(if (<= B 5.3e-126)
(/ (- (sqrt (* (* 2.0 (* -4.0 (* F (* C A)))) (* 2.0 C)))) t_0)
(if (<= B 6.8e+59)
t_1
(* (/ (sqrt 2.0) B) (* (sqrt F) (- (sqrt (+ 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 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0;
double tmp;
if (B <= 3.5e-210) {
tmp = t_1;
} else if (B <= 5.3e-126) {
tmp = -sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0;
} else if (B <= 6.8e+59) {
tmp = t_1;
} else {
tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((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 * (F * t_0))) * -Math.sqrt((C + (A + Math.hypot(B, (A - C)))))) / t_0;
double tmp;
if (B <= 3.5e-210) {
tmp = t_1;
} else if (B <= 5.3e-126) {
tmp = -Math.sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0;
} else if (B <= 6.8e+59) {
tmp = t_1;
} else {
tmp = (Math.sqrt(2.0) / B) * (Math.sqrt(F) * -Math.sqrt((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 * (F * t_0))) * -math.sqrt((C + (A + math.hypot(B, (A - C)))))) / t_0 tmp = 0 if B <= 3.5e-210: tmp = t_1 elif B <= 5.3e-126: tmp = -math.sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0 elif B <= 6.8e+59: tmp = t_1 else: tmp = (math.sqrt(2.0) / B) * (math.sqrt(F) * -math.sqrt((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(Float64(sqrt(Float64(2.0 * Float64(F * t_0))) * Float64(-sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / t_0) tmp = 0.0 if (B <= 3.5e-210) tmp = t_1; elseif (B <= 5.3e-126) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(-4.0 * Float64(F * Float64(C * A)))) * Float64(2.0 * C)))) / t_0); elseif (B <= 6.8e+59) tmp = t_1; else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(F) * Float64(-sqrt(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 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0; tmp = 0.0; if (B <= 3.5e-210) tmp = t_1; elseif (B <= 5.3e-126) tmp = -sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0; elseif (B <= 6.8e+59) tmp = t_1; else tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((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[(N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[B, 3.5e-210], t$95$1, If[LessEqual[B, 5.3e-126], N[((-N[Sqrt[N[(N[(2.0 * N[(-4.0 * N[(F * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 6.8e+59], t$95$1, N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[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 \cdot \left(F \cdot t_0\right)} \cdot \left(-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{t_0}\\
\mathbf{if}\;B \leq 3.5 \cdot 10^{-210}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;B \leq 5.3 \cdot 10^{-126}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(-4 \cdot \left(F \cdot \left(C \cdot A\right)\right)\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{elif}\;B \leq 6.8 \cdot 10^{+59}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B + A}\right)\right)\\
\end{array}
\end{array}
if B < 3.50000000000000015e-210 or 5.29999999999999995e-126 < B < 6.80000000000000012e59Initial program 16.6%
associate-*l*16.6%
unpow216.6%
+-commutative16.6%
unpow216.6%
associate-*l*16.6%
unpow216.6%
Simplified16.6%
sqrt-prod17.1%
*-commutative17.1%
*-commutative17.1%
associate-+l+17.5%
unpow217.5%
hypot-udef27.9%
associate-+r+27.2%
+-commutative27.2%
associate-+r+28.0%
Applied egg-rr28.0%
if 3.50000000000000015e-210 < B < 5.29999999999999995e-126Initial program 18.9%
associate-*l*18.9%
unpow218.9%
+-commutative18.9%
unpow218.9%
associate-*l*18.9%
unpow218.9%
Simplified18.9%
Taylor expanded in A around -inf 7.3%
associate-+r+7.3%
mul-1-neg7.3%
unsub-neg7.3%
distribute-lft-out7.3%
*-commutative7.3%
unpow27.3%
times-frac13.4%
unpow213.4%
unpow213.4%
Simplified13.4%
Taylor expanded in B around 0 13.6%
associate-*r*13.4%
Simplified13.4%
Taylor expanded in A around inf 30.7%
if 6.80000000000000012e59 < B Initial program 14.6%
Simplified16.6%
Taylor expanded in C around 0 21.2%
mul-1-neg21.2%
distribute-rgt-neg-in21.2%
unpow221.2%
unpow221.2%
hypot-def59.3%
Simplified59.3%
sqrt-prod77.7%
Applied egg-rr77.7%
Taylor expanded in A around 0 72.4%
+-commutative72.4%
Simplified72.4%
Final simplification38.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 (<= B 3.2e-224)
(/
(- (sqrt (* 2.0 (* F (* (* C (* A A)) -8.0)))))
(fma B B (* C (* A -4.0))))
(if (<= B 1.85e-47)
(/ (- (sqrt (* (* 2.0 (* -4.0 (* F (* C A)))) (* 2.0 C)))) t_0)
(if (<= B 3.4e+57)
(*
(sqrt (* 2.0 (* (* F t_0) (+ C (+ A (hypot B (- A C)))))))
(/ -1.0 t_0))
(* (/ (sqrt 2.0) B) (* (sqrt F) (- (sqrt (+ 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 tmp;
if (B <= 3.2e-224) {
tmp = -sqrt((2.0 * (F * ((C * (A * A)) * -8.0)))) / fma(B, B, (C * (A * -4.0)));
} else if (B <= 1.85e-47) {
tmp = -sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0;
} else if (B <= 3.4e+57) {
tmp = sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) * (-1.0 / t_0);
} else {
tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((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))) tmp = 0.0 if (B <= 3.2e-224) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(Float64(C * Float64(A * A)) * -8.0))))) / fma(B, B, Float64(C * Float64(A * -4.0)))); elseif (B <= 1.85e-47) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(-4.0 * Float64(F * Float64(C * A)))) * Float64(2.0 * C)))) / t_0); elseif (B <= 3.4e+57) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(C + Float64(A + hypot(B, Float64(A - C))))))) * Float64(-1.0 / t_0)); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(F) * Float64(-sqrt(Float64(B + A))))); 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]}, If[LessEqual[B, 3.2e-224], N[((-N[Sqrt[N[(2.0 * N[(F * N[(N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision] * -8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.85e-47], N[((-N[Sqrt[N[(N[(2.0 * N[(-4.0 * N[(F * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 3.4e+57], 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] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[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)\\
\mathbf{if}\;B \leq 3.2 \cdot 10^{-224}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(\left(C \cdot \left(A \cdot A\right)\right) \cdot -8\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\
\mathbf{elif}\;B \leq 1.85 \cdot 10^{-47}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(-4 \cdot \left(F \cdot \left(C \cdot A\right)\right)\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{elif}\;B \leq 3.4 \cdot 10^{+57}:\\
\;\;\;\;\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)} \cdot \frac{-1}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B + A}\right)\right)\\
\end{array}
\end{array}
if B < 3.1999999999999999e-224Initial program 16.0%
Simplified21.3%
Taylor expanded in C around -inf 15.8%
unpow215.8%
Simplified15.8%
*-un-lft-identity15.8%
associate-*l*15.8%
*-commutative15.8%
associate-/l*15.8%
Applied egg-rr15.8%
*-lft-identity15.8%
associate-*l*14.5%
associate-/r/14.5%
Simplified14.5%
Taylor expanded in B around 0 13.4%
*-commutative13.4%
unpow213.4%
Simplified13.4%
if 3.1999999999999999e-224 < B < 1.85e-47Initial program 13.1%
associate-*l*13.1%
unpow213.1%
+-commutative13.1%
unpow213.1%
associate-*l*13.1%
unpow213.1%
Simplified13.1%
Taylor expanded in A around -inf 7.6%
associate-+r+7.6%
mul-1-neg7.6%
unsub-neg7.6%
distribute-lft-out7.6%
*-commutative7.6%
unpow27.6%
times-frac10.4%
unpow210.4%
unpow210.4%
Simplified10.4%
Taylor expanded in B around 0 10.5%
associate-*r*10.4%
Simplified10.4%
Taylor expanded in A around inf 21.9%
if 1.85e-47 < B < 3.39999999999999992e57Initial program 27.9%
associate-*l*27.9%
unpow227.9%
+-commutative27.9%
unpow227.9%
associate-*l*27.9%
unpow227.9%
Simplified27.9%
div-inv28.0%
Applied egg-rr40.8%
if 3.39999999999999992e57 < B Initial program 16.1%
Simplified18.0%
Taylor expanded in C around 0 22.6%
mul-1-neg22.6%
distribute-rgt-neg-in22.6%
unpow222.6%
unpow222.6%
hypot-def60.0%
Simplified60.0%
sqrt-prod78.1%
Applied egg-rr78.1%
Taylor expanded in A around 0 72.9%
+-commutative72.9%
Simplified72.9%
Final simplification29.6%
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 (<= F -4.2e-268)
(- (/ (sqrt (* 2.0 (* (* F t_0) (+ C (+ A (hypot B (- A C))))))) t_0))
(if (<= F 155000000.0)
(* t_1 (- (sqrt (* F (+ A (hypot B A))))))
(* t_1 (* (sqrt B) (- (sqrt F))))))))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 (F <= -4.2e-268) {
tmp = -(sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0);
} else if (F <= 155000000.0) {
tmp = t_1 * -sqrt((F * (A + hypot(B, A))));
} else {
tmp = t_1 * (sqrt(B) * -sqrt(F));
}
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 (F <= -4.2e-268) {
tmp = -(Math.sqrt((2.0 * ((F * t_0) * (C + (A + Math.hypot(B, (A - C))))))) / t_0);
} else if (F <= 155000000.0) {
tmp = t_1 * -Math.sqrt((F * (A + Math.hypot(B, A))));
} else {
tmp = t_1 * (Math.sqrt(B) * -Math.sqrt(F));
}
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 F <= -4.2e-268: tmp = -(math.sqrt((2.0 * ((F * t_0) * (C + (A + math.hypot(B, (A - C))))))) / t_0) elif F <= 155000000.0: tmp = t_1 * -math.sqrt((F * (A + math.hypot(B, A)))) else: tmp = t_1 * (math.sqrt(B) * -math.sqrt(F)) 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 (F <= -4.2e-268) tmp = Float64(-Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / t_0)); elseif (F <= 155000000.0) tmp = Float64(t_1 * Float64(-sqrt(Float64(F * Float64(A + hypot(B, A)))))); else tmp = Float64(t_1 * Float64(sqrt(B) * Float64(-sqrt(F)))); 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 (F <= -4.2e-268) tmp = -(sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0); elseif (F <= 155000000.0) tmp = t_1 * -sqrt((F * (A + hypot(B, A)))); else tmp = t_1 * (sqrt(B) * -sqrt(F)); 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[F, -4.2e-268], (-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[F, 155000000.0], N[(t$95$1 * (-N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(t$95$1 * N[(N[Sqrt[B], $MachinePrecision] * (-N[Sqrt[F], $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}\;F \leq -4.2 \cdot 10^{-268}:\\
\;\;\;\;-\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}\;F \leq 155000000:\\
\;\;\;\;t_1 \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(\sqrt{B} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if F < -4.19999999999999996e-268Initial program 38.7%
associate-*l*38.7%
unpow238.7%
+-commutative38.7%
unpow238.7%
associate-*l*38.7%
unpow238.7%
Simplified38.7%
distribute-frac-neg38.7%
Applied egg-rr47.7%
if -4.19999999999999996e-268 < F < 1.55e8Initial program 15.4%
Simplified21.9%
Taylor expanded in C around 0 13.1%
mul-1-neg13.1%
distribute-rgt-neg-in13.1%
unpow213.1%
unpow213.1%
hypot-def29.8%
Simplified29.8%
if 1.55e8 < F Initial program 10.3%
Simplified11.5%
Taylor expanded in C around 0 7.1%
mul-1-neg7.1%
distribute-rgt-neg-in7.1%
unpow27.1%
unpow27.1%
hypot-def11.2%
Simplified11.2%
sqrt-prod22.2%
Applied egg-rr22.2%
Taylor expanded in A around 0 19.7%
Final simplification28.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 (<= F -4.2e-268)
(- (/ (sqrt (* 2.0 (* (* F t_0) (+ C (+ A (hypot B (- A C))))))) t_0))
(if (<= F 38000000.0)
(/ (* (sqrt 2.0) (- (sqrt (* F (+ A (hypot B A)))))) B)
(* (/ (sqrt 2.0) B) (* (sqrt B) (- (sqrt F))))))))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 <= -4.2e-268) {
tmp = -(sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0);
} else if (F <= 38000000.0) {
tmp = (sqrt(2.0) * -sqrt((F * (A + hypot(B, A))))) / B;
} else {
tmp = (sqrt(2.0) / B) * (sqrt(B) * -sqrt(F));
}
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 (F <= -4.2e-268) {
tmp = -(Math.sqrt((2.0 * ((F * t_0) * (C + (A + Math.hypot(B, (A - C))))))) / t_0);
} else if (F <= 38000000.0) {
tmp = (Math.sqrt(2.0) * -Math.sqrt((F * (A + Math.hypot(B, A))))) / B;
} else {
tmp = (Math.sqrt(2.0) / B) * (Math.sqrt(B) * -Math.sqrt(F));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if F <= -4.2e-268: tmp = -(math.sqrt((2.0 * ((F * t_0) * (C + (A + math.hypot(B, (A - C))))))) / t_0) elif F <= 38000000.0: tmp = (math.sqrt(2.0) * -math.sqrt((F * (A + math.hypot(B, A))))) / B else: tmp = (math.sqrt(2.0) / B) * (math.sqrt(B) * -math.sqrt(F)) 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 <= -4.2e-268) tmp = Float64(-Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / t_0)); elseif (F <= 38000000.0) tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(F * Float64(A + hypot(B, A)))))) / B); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(B) * Float64(-sqrt(F)))); 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 <= -4.2e-268) tmp = -(sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0); elseif (F <= 38000000.0) tmp = (sqrt(2.0) * -sqrt((F * (A + hypot(B, A))))) / B; else tmp = (sqrt(2.0) / B) * (sqrt(B) * -sqrt(F)); 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, -4.2e-268], (-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[F, 38000000.0], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[B], $MachinePrecision] * (-N[Sqrt[F], $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 -4.2 \cdot 10^{-268}:\\
\;\;\;\;-\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}\;F \leq 38000000:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{B} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if F < -4.19999999999999996e-268Initial program 38.7%
associate-*l*38.7%
unpow238.7%
+-commutative38.7%
unpow238.7%
associate-*l*38.7%
unpow238.7%
Simplified38.7%
distribute-frac-neg38.7%
Applied egg-rr47.7%
if -4.19999999999999996e-268 < F < 3.8e7Initial program 15.4%
Simplified21.9%
Taylor expanded in C around 0 13.1%
mul-1-neg13.1%
distribute-rgt-neg-in13.1%
unpow213.1%
unpow213.1%
hypot-def29.8%
Simplified29.8%
associate-*l/29.9%
Applied egg-rr29.9%
if 3.8e7 < F Initial program 10.3%
Simplified11.5%
Taylor expanded in C around 0 7.1%
mul-1-neg7.1%
distribute-rgt-neg-in7.1%
unpow27.1%
unpow27.1%
hypot-def11.2%
Simplified11.2%
sqrt-prod22.2%
Applied egg-rr22.2%
Taylor expanded in A around 0 19.7%
Final simplification28.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 (<= B 7.2e-223)
(/
(- (sqrt (* 2.0 (* F (* (* C (* A A)) -8.0)))))
(fma B B (* C (* A -4.0))))
(if (<= B 2.2e-46)
(/ (- (sqrt (* (* 2.0 (* -4.0 (* F (* C A)))) (* 2.0 C)))) t_0)
(if (<= B 1.8e+57)
(*
(sqrt (* 2.0 (* (* F t_0) (+ C (+ A (hypot B (- A C)))))))
(/ -1.0 t_0))
(* (/ (sqrt 2.0) B) (* (sqrt B) (- (sqrt F)))))))))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 (B <= 7.2e-223) {
tmp = -sqrt((2.0 * (F * ((C * (A * A)) * -8.0)))) / fma(B, B, (C * (A * -4.0)));
} else if (B <= 2.2e-46) {
tmp = -sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0;
} else if (B <= 1.8e+57) {
tmp = sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) * (-1.0 / t_0);
} else {
tmp = (sqrt(2.0) / B) * (sqrt(B) * -sqrt(F));
}
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 <= 7.2e-223) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(Float64(C * Float64(A * A)) * -8.0))))) / fma(B, B, Float64(C * Float64(A * -4.0)))); elseif (B <= 2.2e-46) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(-4.0 * Float64(F * Float64(C * A)))) * Float64(2.0 * C)))) / t_0); elseif (B <= 1.8e+57) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(C + Float64(A + hypot(B, Float64(A - C))))))) * Float64(-1.0 / t_0)); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(B) * Float64(-sqrt(F)))); 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]}, If[LessEqual[B, 7.2e-223], N[((-N[Sqrt[N[(2.0 * N[(F * N[(N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision] * -8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.2e-46], N[((-N[Sqrt[N[(N[(2.0 * N[(-4.0 * N[(F * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 1.8e+57], 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] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[B], $MachinePrecision] * (-N[Sqrt[F], $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}\;B \leq 7.2 \cdot 10^{-223}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(\left(C \cdot \left(A \cdot A\right)\right) \cdot -8\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\
\mathbf{elif}\;B \leq 2.2 \cdot 10^{-46}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(-4 \cdot \left(F \cdot \left(C \cdot A\right)\right)\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{elif}\;B \leq 1.8 \cdot 10^{+57}:\\
\;\;\;\;\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)} \cdot \frac{-1}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{B} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < 7.2000000000000007e-223Initial program 16.0%
Simplified21.3%
Taylor expanded in C around -inf 15.8%
unpow215.8%
Simplified15.8%
*-un-lft-identity15.8%
associate-*l*15.8%
*-commutative15.8%
associate-/l*15.8%
Applied egg-rr15.8%
*-lft-identity15.8%
associate-*l*14.5%
associate-/r/14.5%
Simplified14.5%
Taylor expanded in B around 0 13.4%
*-commutative13.4%
unpow213.4%
Simplified13.4%
if 7.2000000000000007e-223 < B < 2.2000000000000001e-46Initial program 13.1%
associate-*l*13.1%
unpow213.1%
+-commutative13.1%
unpow213.1%
associate-*l*13.1%
unpow213.1%
Simplified13.1%
Taylor expanded in A around -inf 7.6%
associate-+r+7.6%
mul-1-neg7.6%
unsub-neg7.6%
distribute-lft-out7.6%
*-commutative7.6%
unpow27.6%
times-frac10.4%
unpow210.4%
unpow210.4%
Simplified10.4%
Taylor expanded in B around 0 10.5%
associate-*r*10.4%
Simplified10.4%
Taylor expanded in A around inf 21.9%
if 2.2000000000000001e-46 < B < 1.8000000000000001e57Initial program 27.9%
associate-*l*27.9%
unpow227.9%
+-commutative27.9%
unpow227.9%
associate-*l*27.9%
unpow227.9%
Simplified27.9%
div-inv28.0%
Applied egg-rr40.8%
if 1.8000000000000001e57 < B Initial program 16.1%
Simplified18.0%
Taylor expanded in C around 0 22.6%
mul-1-neg22.6%
distribute-rgt-neg-in22.6%
unpow222.6%
unpow222.6%
hypot-def60.0%
Simplified60.0%
sqrt-prod78.1%
Applied egg-rr78.1%
Taylor expanded in A around 0 71.7%
Final simplification29.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 (<= F -4e-310)
(- (/ (sqrt (* 2.0 (* (* F t_0) (+ C (+ A (hypot B (- A C))))))) t_0))
(if (<= F 2.8e+24)
(* (/ (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 <= -4e-310) {
tmp = -(sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0);
} else if (F <= 2.8e+24) {
tmp = (sqrt(2.0) / B) * -sqrt((B * F));
} 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 t_0 = (B * B) - (4.0 * (C * A));
double tmp;
if (F <= -4e-310) {
tmp = -(Math.sqrt((2.0 * ((F * t_0) * (C + (A + Math.hypot(B, (A - C))))))) / t_0);
} else if (F <= 2.8e+24) {
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 <= -4e-310: tmp = -(math.sqrt((2.0 * ((F * t_0) * (C + (A + math.hypot(B, (A - C))))))) / t_0) elif F <= 2.8e+24: 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 <= -4e-310) tmp = Float64(-Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / t_0)); elseif (F <= 2.8e+24) 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 <= -4e-310) tmp = -(sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0); elseif (F <= 2.8e+24) 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, -4e-310], (-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[F, 2.8e+24], 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 -4 \cdot 10^{-310}:\\
\;\;\;\;-\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}\;F \leq 2.8 \cdot 10^{+24}:\\
\;\;\;\;\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.999999999999988e-310Initial program 37.6%
associate-*l*37.6%
unpow237.6%
+-commutative37.6%
unpow237.6%
associate-*l*37.6%
unpow237.6%
Simplified37.6%
distribute-frac-neg37.6%
Applied egg-rr46.4%
if -3.999999999999988e-310 < F < 2.8000000000000002e24Initial program 15.6%
Simplified21.8%
Taylor expanded in C around 0 12.6%
mul-1-neg12.6%
distribute-rgt-neg-in12.6%
unpow212.6%
unpow212.6%
hypot-def29.5%
Simplified29.5%
Taylor expanded in A around 0 23.1%
if 2.8000000000000002e24 < F Initial program 9.8%
Simplified11.1%
Taylor expanded in C around 0 7.4%
mul-1-neg7.4%
distribute-rgt-neg-in7.4%
unpow27.4%
unpow27.4%
hypot-def10.8%
Simplified10.8%
Taylor expanded in A around 0 18.8%
mul-1-neg18.8%
*-commutative18.8%
Simplified18.8%
Final simplification24.6%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= F -4e-310)
(/
(*
(sqrt (* 2.0 (* F (- (* B B) (* C (* 4.0 A))))))
(- (sqrt (+ A (+ C A)))))
(- (* B B) (* 4.0 (* C A))))
(if (<= F 4.2e+24)
(* (/ (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 tmp;
if (F <= -4e-310) {
tmp = (sqrt((2.0 * (F * ((B * B) - (C * (4.0 * A)))))) * -sqrt((A + (C + A)))) / ((B * B) - (4.0 * (C * A)));
} else if (F <= 4.2e+24) {
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) :: tmp
if (f <= (-4d-310)) then
tmp = (sqrt((2.0d0 * (f * ((b * b) - (c * (4.0d0 * a)))))) * -sqrt((a + (c + a)))) / ((b * b) - (4.0d0 * (c * a)))
else if (f <= 4.2d+24) 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 tmp;
if (F <= -4e-310) {
tmp = (Math.sqrt((2.0 * (F * ((B * B) - (C * (4.0 * A)))))) * -Math.sqrt((A + (C + A)))) / ((B * B) - (4.0 * (C * A)));
} else if (F <= 4.2e+24) {
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): tmp = 0 if F <= -4e-310: tmp = (math.sqrt((2.0 * (F * ((B * B) - (C * (4.0 * A)))))) * -math.sqrt((A + (C + A)))) / ((B * B) - (4.0 * (C * A))) elif F <= 4.2e+24: 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) tmp = 0.0 if (F <= -4e-310) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) - Float64(C * Float64(4.0 * A)))))) * Float64(-sqrt(Float64(A + Float64(C + A))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(C * A)))); elseif (F <= 4.2e+24) 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) tmp = 0.0; if (F <= -4e-310) tmp = (sqrt((2.0 * (F * ((B * B) - (C * (4.0 * A)))))) * -sqrt((A + (C + A)))) / ((B * B) - (4.0 * (C * A))); elseif (F <= 4.2e+24) 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_] := If[LessEqual[F, -4e-310], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] - N[(C * N[(4.0 * A), $MachinePrecision]), $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, 4.2e+24], 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}
\mathbf{if}\;F \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B - C \cdot \left(4 \cdot A\right)\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 4.2 \cdot 10^{+24}:\\
\;\;\;\;\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.999999999999988e-310Initial program 37.6%
associate-*l*37.6%
unpow237.6%
+-commutative37.6%
unpow237.6%
associate-*l*37.6%
unpow237.6%
Simplified37.6%
Taylor expanded in A around inf 30.3%
sqrt-prod35.6%
*-commutative35.6%
associate-*r*35.6%
+-commutative35.6%
Applied egg-rr35.6%
if -3.999999999999988e-310 < F < 4.2000000000000003e24Initial program 15.6%
Simplified21.8%
Taylor expanded in C around 0 12.6%
mul-1-neg12.6%
distribute-rgt-neg-in12.6%
unpow212.6%
unpow212.6%
hypot-def29.5%
Simplified29.5%
Taylor expanded in A around 0 23.1%
if 4.2000000000000003e24 < F Initial program 9.8%
Simplified11.1%
Taylor expanded in C around 0 7.4%
mul-1-neg7.4%
distribute-rgt-neg-in7.4%
unpow27.4%
unpow27.4%
hypot-def10.8%
Simplified10.8%
Taylor expanded in A around 0 18.8%
mul-1-neg18.8%
*-commutative18.8%
Simplified18.8%
Final simplification23.2%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= F -4.2e-268)
(/
(- (* (sqrt (+ A (+ C A))) (sqrt (* 2.0 (* (* A -4.0) (* F C))))))
(- (* B B) (* 4.0 (* C A))))
(if (<= F 2.8e+24)
(* (/ (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 tmp;
if (F <= -4.2e-268) {
tmp = -(sqrt((A + (C + A))) * sqrt((2.0 * ((A * -4.0) * (F * C))))) / ((B * B) - (4.0 * (C * A)));
} else if (F <= 2.8e+24) {
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) :: tmp
if (f <= (-4.2d-268)) then
tmp = -(sqrt((a + (c + a))) * sqrt((2.0d0 * ((a * (-4.0d0)) * (f * c))))) / ((b * b) - (4.0d0 * (c * a)))
else if (f <= 2.8d+24) 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 tmp;
if (F <= -4.2e-268) {
tmp = -(Math.sqrt((A + (C + A))) * Math.sqrt((2.0 * ((A * -4.0) * (F * C))))) / ((B * B) - (4.0 * (C * A)));
} else if (F <= 2.8e+24) {
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): tmp = 0 if F <= -4.2e-268: tmp = -(math.sqrt((A + (C + A))) * math.sqrt((2.0 * ((A * -4.0) * (F * C))))) / ((B * B) - (4.0 * (C * A))) elif F <= 2.8e+24: 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) tmp = 0.0 if (F <= -4.2e-268) tmp = Float64(Float64(-Float64(sqrt(Float64(A + Float64(C + A))) * sqrt(Float64(2.0 * Float64(Float64(A * -4.0) * Float64(F * C)))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(C * A)))); elseif (F <= 2.8e+24) 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) tmp = 0.0; if (F <= -4.2e-268) tmp = -(sqrt((A + (C + A))) * sqrt((2.0 * ((A * -4.0) * (F * C))))) / ((B * B) - (4.0 * (C * A))); elseif (F <= 2.8e+24) 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_] := If[LessEqual[F, -4.2e-268], N[((-N[(N[Sqrt[N[(A + N[(C + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(N[(A * -4.0), $MachinePrecision] * N[(F * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.8e+24], 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}
\mathbf{if}\;F \leq -4.2 \cdot 10^{-268}:\\
\;\;\;\;\frac{-\sqrt{A + \left(C + A\right)} \cdot \sqrt{2 \cdot \left(\left(A \cdot -4\right) \cdot \left(F \cdot C\right)\right)}}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{+24}:\\
\;\;\;\;\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 < -4.19999999999999996e-268Initial program 38.7%
associate-*l*38.7%
unpow238.7%
+-commutative38.7%
unpow238.7%
associate-*l*38.7%
unpow238.7%
Simplified38.7%
Taylor expanded in A around inf 31.1%
sqrt-prod36.6%
*-commutative36.6%
associate-*r*36.6%
+-commutative36.6%
Applied egg-rr36.6%
Taylor expanded in B around 0 32.8%
associate-*r*32.8%
*-commutative32.8%
*-commutative32.8%
Simplified32.8%
if -4.19999999999999996e-268 < F < 2.8000000000000002e24Initial program 15.5%
Simplified21.7%
Taylor expanded in C around 0 12.5%
mul-1-neg12.5%
distribute-rgt-neg-in12.5%
unpow212.5%
unpow212.5%
hypot-def29.3%
Simplified29.3%
Taylor expanded in A around 0 23.0%
if 2.8000000000000002e24 < F Initial program 9.8%
Simplified11.1%
Taylor expanded in C around 0 7.4%
mul-1-neg7.4%
distribute-rgt-neg-in7.4%
unpow27.4%
unpow27.4%
hypot-def10.8%
Simplified10.8%
Taylor expanded in A around 0 18.8%
mul-1-neg18.8%
*-commutative18.8%
Simplified18.8%
Final simplification22.7%
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 -8e-268)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ (- A C) (+ C A))))) t_0)
(if (<= F 2.7e+24)
(* (/ (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 <= -8e-268) {
tmp = -sqrt(((2.0 * (F * t_0)) * ((A - C) + (C + A)))) / t_0;
} else if (F <= 2.7e+24) {
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 <= (-8d-268)) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * ((a - c) + (c + a)))) / t_0
else if (f <= 2.7d+24) 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 <= -8e-268) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * ((A - C) + (C + A)))) / t_0;
} else if (F <= 2.7e+24) {
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 <= -8e-268: tmp = -math.sqrt(((2.0 * (F * t_0)) * ((A - C) + (C + A)))) / t_0 elif F <= 2.7e+24: 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 <= -8e-268) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(Float64(A - C) + Float64(C + A))))) / t_0); elseif (F <= 2.7e+24) 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 <= -8e-268) tmp = -sqrt(((2.0 * (F * t_0)) * ((A - C) + (C + A)))) / t_0; elseif (F <= 2.7e+24) 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, -8e-268], 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], If[LessEqual[F, 2.7e+24], 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 -8 \cdot 10^{-268}:\\
\;\;\;\;\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}\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{+24}:\\
\;\;\;\;\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 < -7.99999999999999966e-268Initial program 38.7%
associate-*l*38.7%
unpow238.7%
+-commutative38.7%
unpow238.7%
associate-*l*38.7%
unpow238.7%
Simplified38.7%
Taylor expanded in B around 0 32.6%
if -7.99999999999999966e-268 < F < 2.7e24Initial program 15.5%
Simplified21.7%
Taylor expanded in C around 0 12.5%
mul-1-neg12.5%
distribute-rgt-neg-in12.5%
unpow212.5%
unpow212.5%
hypot-def29.3%
Simplified29.3%
Taylor expanded in A around 0 23.0%
if 2.7e24 < F Initial program 9.8%
Simplified11.1%
Taylor expanded in C around 0 7.4%
mul-1-neg7.4%
distribute-rgt-neg-in7.4%
unpow27.4%
unpow27.4%
hypot-def10.8%
Simplified10.8%
Taylor expanded in A around 0 18.8%
mul-1-neg18.8%
*-commutative18.8%
Simplified18.8%
Final simplification22.7%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= B 1.4e-46)
(/
(- (sqrt (* (* 2.0 (* -4.0 (* F (* C A)))) (* 2.0 C))))
(- (* B B) (* 4.0 (* C A))))
(* (sqrt 2.0) (- (sqrt (/ F B))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (B <= 1.4e-46) {
tmp = -sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / ((B * B) - (4.0 * (C * 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 (b <= 1.4d-46) then
tmp = -sqrt(((2.0d0 * ((-4.0d0) * (f * (c * a)))) * (2.0d0 * c))) / ((b * b) - (4.0d0 * (c * 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 (B <= 1.4e-46) {
tmp = -Math.sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / ((B * B) - (4.0 * (C * 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 B <= 1.4e-46: tmp = -math.sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / ((B * B) - (4.0 * (C * 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 (B <= 1.4e-46) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(-4.0 * Float64(F * Float64(C * A)))) * Float64(2.0 * C)))) / Float64(Float64(B * B) - Float64(4.0 * Float64(C * 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 (B <= 1.4e-46) tmp = -sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / ((B * B) - (4.0 * (C * 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[B, 1.4e-46], N[((-N[Sqrt[N[(N[(2.0 * N[(-4.0 * N[(F * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * 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}\;B \leq 1.4 \cdot 10^{-46}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(-4 \cdot \left(F \cdot \left(C \cdot A\right)\right)\right)\right) \cdot \left(2 \cdot C\right)}}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if B < 1.3999999999999999e-46Initial program 15.5%
associate-*l*15.5%
unpow215.5%
+-commutative15.5%
unpow215.5%
associate-*l*15.5%
unpow215.5%
Simplified15.5%
Taylor expanded in A around -inf 4.8%
associate-+r+4.8%
mul-1-neg4.8%
unsub-neg4.8%
distribute-lft-out4.8%
*-commutative4.8%
unpow24.8%
times-frac4.9%
unpow24.9%
unpow24.9%
Simplified4.9%
Taylor expanded in B around 0 5.0%
associate-*r*4.9%
Simplified4.9%
Taylor expanded in A around inf 15.8%
if 1.3999999999999999e-46 < B Initial program 18.5%
Simplified22.7%
Taylor expanded in C around 0 24.1%
mul-1-neg24.1%
distribute-rgt-neg-in24.1%
unpow224.1%
unpow224.1%
hypot-def55.3%
Simplified55.3%
Taylor expanded in A around 0 40.1%
mul-1-neg40.1%
*-commutative40.1%
Simplified40.1%
Final simplification22.7%
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 (<= A 5.5e-121)
(/ (- (sqrt (* (* 2.0 (* -4.0 (* F (* C A)))) (* 2.0 C)))) t_0)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ (- A C) (+ 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 (A <= 5.5e-121) {
tmp = -sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0;
} else {
tmp = -sqrt(((2.0 * (F * t_0)) * ((A - C) + (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 (a <= 5.5d-121) then
tmp = -sqrt(((2.0d0 * ((-4.0d0) * (f * (c * a)))) * (2.0d0 * c))) / t_0
else
tmp = -sqrt(((2.0d0 * (f * t_0)) * ((a - c) + (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 (A <= 5.5e-121) {
tmp = -Math.sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0;
} else {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * ((A - C) + (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 A <= 5.5e-121: tmp = -math.sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0 else: tmp = -math.sqrt(((2.0 * (F * t_0)) * ((A - C) + (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 (A <= 5.5e-121) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(-4.0 * Float64(F * Float64(C * A)))) * Float64(2.0 * C)))) / 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
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (C * A)); tmp = 0.0; if (A <= 5.5e-121) tmp = -sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0; else tmp = -sqrt(((2.0 * (F * t_0)) * ((A - C) + (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[A, 5.5e-121], N[((-N[Sqrt[N[(N[(2.0 * N[(-4.0 * N[(F * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $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}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;A \leq 5.5 \cdot 10^{-121}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(-4 \cdot \left(F \cdot \left(C \cdot A\right)\right)\right)\right) \cdot \left(2 \cdot C\right)}}{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 A < 5.50000000000000031e-121Initial program 14.6%
associate-*l*14.6%
unpow214.6%
+-commutative14.6%
unpow214.6%
associate-*l*14.6%
unpow214.6%
Simplified14.6%
Taylor expanded in A around -inf 3.1%
associate-+r+3.1%
mul-1-neg3.1%
unsub-neg3.1%
distribute-lft-out3.1%
*-commutative3.1%
unpow23.1%
times-frac3.3%
unpow23.3%
unpow23.3%
Simplified3.3%
Taylor expanded in B around 0 3.2%
associate-*r*3.2%
Simplified3.2%
Taylor expanded in A around inf 16.7%
if 5.50000000000000031e-121 < A Initial program 19.5%
associate-*l*19.5%
unpow219.5%
+-commutative19.5%
unpow219.5%
associate-*l*19.5%
unpow219.5%
Simplified19.5%
Taylor expanded in B around 0 20.6%
Final simplification18.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 (<= A 6e-54)
(/ (- (sqrt (* (* 2.0 (* -4.0 (* F (* C A)))) (* 2.0 C)))) t_0)
(/
(- (pow (* 2.0 (* (* F (- (* B B) (* C (* 4.0 A)))) (+ A (+ C A)))) 0.5))
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 (A <= 6e-54) {
tmp = -sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0;
} else {
tmp = -pow((2.0 * ((F * ((B * B) - (C * (4.0 * A)))) * (A + (C + A)))), 0.5) / 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 (a <= 6d-54) then
tmp = -sqrt(((2.0d0 * ((-4.0d0) * (f * (c * a)))) * (2.0d0 * c))) / t_0
else
tmp = -((2.0d0 * ((f * ((b * b) - (c * (4.0d0 * a)))) * (a + (c + a)))) ** 0.5d0) / 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 (A <= 6e-54) {
tmp = -Math.sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0;
} else {
tmp = -Math.pow((2.0 * ((F * ((B * B) - (C * (4.0 * A)))) * (A + (C + A)))), 0.5) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if A <= 6e-54: tmp = -math.sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0 else: tmp = -math.pow((2.0 * ((F * ((B * B) - (C * (4.0 * A)))) * (A + (C + A)))), 0.5) / 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 (A <= 6e-54) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(-4.0 * Float64(F * Float64(C * A)))) * Float64(2.0 * C)))) / t_0); else tmp = Float64(Float64(-(Float64(2.0 * Float64(Float64(F * Float64(Float64(B * B) - Float64(C * Float64(4.0 * A)))) * Float64(A + Float64(C + A)))) ^ 0.5)) / 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 (A <= 6e-54) tmp = -sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0; else tmp = -((2.0 * ((F * ((B * B) - (C * (4.0 * A)))) * (A + (C + A)))) ^ 0.5) / 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[A, 6e-54], N[((-N[Sqrt[N[(N[(2.0 * N[(-4.0 * N[(F * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Power[N[(2.0 * N[(N[(F * N[(N[(B * B), $MachinePrecision] - N[(C * N[(4.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(A + N[(C + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $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}\;A \leq 6 \cdot 10^{-54}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(-4 \cdot \left(F \cdot \left(C \cdot A\right)\right)\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-{\left(2 \cdot \left(\left(F \cdot \left(B \cdot B - C \cdot \left(4 \cdot A\right)\right)\right) \cdot \left(A + \left(C + A\right)\right)\right)\right)}^{0.5}}{t_0}\\
\end{array}
\end{array}
if A < 6.00000000000000018e-54Initial program 13.7%
associate-*l*13.7%
unpow213.7%
+-commutative13.7%
unpow213.7%
associate-*l*13.7%
unpow213.7%
Simplified13.7%
Taylor expanded in A around -inf 2.9%
associate-+r+2.9%
mul-1-neg2.9%
unsub-neg2.9%
distribute-lft-out2.9%
*-commutative2.9%
unpow22.9%
times-frac3.0%
unpow23.0%
unpow23.0%
Simplified3.0%
Taylor expanded in B around 0 3.0%
associate-*r*3.0%
Simplified3.0%
Taylor expanded in A around inf 15.6%
if 6.00000000000000018e-54 < A Initial 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 22.4%
pow1/222.5%
associate-*l*22.5%
*-commutative22.5%
associate-*r*22.5%
+-commutative22.5%
Applied egg-rr22.5%
Final simplification17.7%
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 (<= A 6.2e-54)
(/ (- (sqrt (* (* 2.0 (* -4.0 (* F (* C A)))) (* 2.0 C)))) t_0)
(/ (- (sqrt (* (+ A (+ C A)) (* 2.0 (* F t_0))))) 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 (A <= 6.2e-54) {
tmp = -sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0;
} else {
tmp = -sqrt(((A + (C + A)) * (2.0 * (F * t_0)))) / 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 (a <= 6.2d-54) then
tmp = -sqrt(((2.0d0 * ((-4.0d0) * (f * (c * a)))) * (2.0d0 * c))) / t_0
else
tmp = -sqrt(((a + (c + a)) * (2.0d0 * (f * t_0)))) / 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 (A <= 6.2e-54) {
tmp = -Math.sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0;
} else {
tmp = -Math.sqrt(((A + (C + A)) * (2.0 * (F * t_0)))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if A <= 6.2e-54: tmp = -math.sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0 else: tmp = -math.sqrt(((A + (C + A)) * (2.0 * (F * t_0)))) / 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 (A <= 6.2e-54) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(-4.0 * Float64(F * Float64(C * A)))) * Float64(2.0 * C)))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(Float64(A + Float64(C + A)) * Float64(2.0 * Float64(F * t_0))))) / 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 (A <= 6.2e-54) tmp = -sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / t_0; else tmp = -sqrt(((A + (C + A)) * (2.0 * (F * t_0)))) / 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[A, 6.2e-54], N[((-N[Sqrt[N[(N[(2.0 * N[(-4.0 * N[(F * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(N[(A + N[(C + A), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(F * t$95$0), $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}\;A \leq 6.2 \cdot 10^{-54}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(-4 \cdot \left(F \cdot \left(C \cdot A\right)\right)\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{\left(A + \left(C + A\right)\right) \cdot \left(2 \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\
\end{array}
\end{array}
if A < 6.20000000000000008e-54Initial program 13.7%
associate-*l*13.7%
unpow213.7%
+-commutative13.7%
unpow213.7%
associate-*l*13.7%
unpow213.7%
Simplified13.7%
Taylor expanded in A around -inf 2.9%
associate-+r+2.9%
mul-1-neg2.9%
unsub-neg2.9%
distribute-lft-out2.9%
*-commutative2.9%
unpow22.9%
times-frac3.0%
unpow23.0%
unpow23.0%
Simplified3.0%
Taylor expanded in B around 0 3.0%
associate-*r*3.0%
Simplified3.0%
Taylor expanded in A around inf 15.6%
if 6.20000000000000008e-54 < A Initial 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 22.4%
Final simplification17.7%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= A 38.0)
(/
(- (sqrt (* (* 2.0 (* -4.0 (* F (* C A)))) (* 2.0 C))))
(- (* B B) (* 4.0 (* C A))))
(* (pow (* F A) 0.5) (/ (- 2.0) B))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (A <= 38.0) {
tmp = -sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / ((B * B) - (4.0 * (C * A)));
} else {
tmp = pow((F * A), 0.5) * (-2.0 / 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 (a <= 38.0d0) then
tmp = -sqrt(((2.0d0 * ((-4.0d0) * (f * (c * a)))) * (2.0d0 * c))) / ((b * b) - (4.0d0 * (c * a)))
else
tmp = ((f * a) ** 0.5d0) * (-2.0d0 / 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 (A <= 38.0) {
tmp = -Math.sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / ((B * B) - (4.0 * (C * A)));
} else {
tmp = Math.pow((F * A), 0.5) * (-2.0 / B);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if A <= 38.0: tmp = -math.sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / ((B * B) - (4.0 * (C * A))) else: tmp = math.pow((F * A), 0.5) * (-2.0 / B) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (A <= 38.0) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(-4.0 * Float64(F * Float64(C * A)))) * Float64(2.0 * C)))) / Float64(Float64(B * B) - Float64(4.0 * Float64(C * A)))); else tmp = Float64((Float64(F * A) ^ 0.5) * Float64(Float64(-2.0) / B)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (A <= 38.0) tmp = -sqrt(((2.0 * (-4.0 * (F * (C * A)))) * (2.0 * C))) / ((B * B) - (4.0 * (C * A))); else tmp = ((F * A) ^ 0.5) * (-2.0 / B); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[A, 38.0], N[((-N[Sqrt[N[(N[(2.0 * N[(-4.0 * N[(F * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(F * A), $MachinePrecision], 0.5], $MachinePrecision] * N[((-2.0) / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq 38:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(-4 \cdot \left(F \cdot \left(C \cdot A\right)\right)\right)\right) \cdot \left(2 \cdot C\right)}}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(F \cdot A\right)}^{0.5} \cdot \frac{-2}{B}\\
\end{array}
\end{array}
if A < 38Initial program 16.6%
associate-*l*16.6%
unpow216.6%
+-commutative16.6%
unpow216.6%
associate-*l*16.6%
unpow216.6%
Simplified16.6%
Taylor expanded in A around -inf 4.4%
associate-+r+4.4%
mul-1-neg4.4%
unsub-neg4.4%
distribute-lft-out4.4%
*-commutative4.4%
unpow24.4%
times-frac4.4%
unpow24.4%
unpow24.4%
Simplified4.4%
Taylor expanded in B around 0 4.4%
associate-*r*4.4%
Simplified4.4%
Taylor expanded in A around inf 16.0%
if 38 < A Initial program 15.3%
Simplified23.0%
Taylor expanded in C around 0 7.5%
mul-1-neg7.5%
distribute-rgt-neg-in7.5%
unpow27.5%
unpow27.5%
hypot-def23.8%
Simplified23.8%
Taylor expanded in B around 0 13.7%
mul-1-neg13.7%
*-commutative13.7%
*-commutative13.7%
unpow213.7%
rem-square-sqrt13.9%
Simplified13.9%
pow1/214.1%
*-commutative14.1%
Applied egg-rr14.1%
Final simplification15.5%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= A 9000.0) (/ (- (sqrt (* (* A -16.0) (* F (* C C))))) (- (* B B) (* 4.0 (* C A)))) (* (pow (* F A) 0.5) (/ (- 2.0) B))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (A <= 9000.0) {
tmp = -sqrt(((A * -16.0) * (F * (C * C)))) / ((B * B) - (4.0 * (C * A)));
} else {
tmp = pow((F * A), 0.5) * (-2.0 / 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 (a <= 9000.0d0) then
tmp = -sqrt(((a * (-16.0d0)) * (f * (c * c)))) / ((b * b) - (4.0d0 * (c * a)))
else
tmp = ((f * a) ** 0.5d0) * (-2.0d0 / 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 (A <= 9000.0) {
tmp = -Math.sqrt(((A * -16.0) * (F * (C * C)))) / ((B * B) - (4.0 * (C * A)));
} else {
tmp = Math.pow((F * A), 0.5) * (-2.0 / B);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if A <= 9000.0: tmp = -math.sqrt(((A * -16.0) * (F * (C * C)))) / ((B * B) - (4.0 * (C * A))) else: tmp = math.pow((F * A), 0.5) * (-2.0 / B) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (A <= 9000.0) tmp = Float64(Float64(-sqrt(Float64(Float64(A * -16.0) * Float64(F * Float64(C * C))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(C * A)))); else tmp = Float64((Float64(F * A) ^ 0.5) * Float64(Float64(-2.0) / B)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (A <= 9000.0) tmp = -sqrt(((A * -16.0) * (F * (C * C)))) / ((B * B) - (4.0 * (C * A))); else tmp = ((F * A) ^ 0.5) * (-2.0 / B); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[A, 9000.0], N[((-N[Sqrt[N[(N[(A * -16.0), $MachinePrecision] * N[(F * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(F * A), $MachinePrecision], 0.5], $MachinePrecision] * N[((-2.0) / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq 9000:\\
\;\;\;\;\frac{-\sqrt{\left(A \cdot -16\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(F \cdot A\right)}^{0.5} \cdot \frac{-2}{B}\\
\end{array}
\end{array}
if A < 9e3Initial program 16.6%
associate-*l*16.6%
unpow216.6%
+-commutative16.6%
unpow216.6%
associate-*l*16.6%
unpow216.6%
Simplified16.6%
Taylor expanded in A around -inf 4.4%
associate-+r+4.4%
mul-1-neg4.4%
unsub-neg4.4%
distribute-lft-out4.4%
*-commutative4.4%
unpow24.4%
times-frac4.4%
unpow24.4%
unpow24.4%
Simplified4.4%
Taylor expanded in B around 0 4.4%
associate-*r*4.4%
Simplified4.4%
Taylor expanded in A around inf 10.5%
associate-*r*10.5%
*-commutative10.5%
unpow210.5%
Simplified10.5%
if 9e3 < A Initial program 15.3%
Simplified23.0%
Taylor expanded in C around 0 7.5%
mul-1-neg7.5%
distribute-rgt-neg-in7.5%
unpow27.5%
unpow27.5%
hypot-def23.8%
Simplified23.8%
Taylor expanded in B around 0 13.7%
mul-1-neg13.7%
*-commutative13.7%
*-commutative13.7%
unpow213.7%
rem-square-sqrt13.9%
Simplified13.9%
pow1/214.1%
*-commutative14.1%
Applied egg-rr14.1%
Final simplification11.3%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* (pow (* F A) 0.5) (/ (- 2.0) B)))
B = abs(B);
double code(double A, double B, double C, double F) {
return pow((F * A), 0.5) * (-2.0 / 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 = ((f * a) ** 0.5d0) * (-2.0d0 / b)
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return Math.pow((F * A), 0.5) * (-2.0 / B);
}
B = abs(B) def code(A, B, C, F): return math.pow((F * A), 0.5) * (-2.0 / B)
B = abs(B) function code(A, B, C, F) return Float64((Float64(F * A) ^ 0.5) * Float64(Float64(-2.0) / B)) end
B = abs(B) function tmp = code(A, B, C, F) tmp = ((F * A) ^ 0.5) * (-2.0 / B); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(N[Power[N[(F * A), $MachinePrecision], 0.5], $MachinePrecision] * N[((-2.0) / B), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
{\left(F \cdot A\right)}^{0.5} \cdot \frac{-2}{B}
\end{array}
Initial program 16.3%
Simplified21.1%
Taylor expanded in C around 0 9.1%
mul-1-neg9.1%
distribute-rgt-neg-in9.1%
unpow29.1%
unpow29.1%
hypot-def19.0%
Simplified19.0%
Taylor expanded in B around 0 4.7%
mul-1-neg4.7%
*-commutative4.7%
*-commutative4.7%
unpow24.7%
rem-square-sqrt4.8%
Simplified4.8%
pow1/25.0%
*-commutative5.0%
Applied egg-rr5.0%
Final simplification5.0%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* (/ 2.0 B) (- (sqrt (* F A)))))
B = abs(B);
double code(double A, double B, double C, double F) {
return (2.0 / B) * -sqrt((F * 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 * 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 * A));
}
B = abs(B) def code(A, B, C, F): return (2.0 / B) * -math.sqrt((F * A))
B = abs(B) function code(A, B, C, F) return Float64(Float64(2.0 / B) * Float64(-sqrt(Float64(F * A)))) end
B = abs(B) function tmp = code(A, B, C, F) tmp = (2.0 / B) * -sqrt((F * A)); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(N[(2.0 / B), $MachinePrecision] * (-N[Sqrt[N[(F * A), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\frac{2}{B} \cdot \left(-\sqrt{F \cdot A}\right)
\end{array}
Initial program 16.3%
Simplified21.1%
Taylor expanded in C around 0 9.1%
mul-1-neg9.1%
distribute-rgt-neg-in9.1%
unpow29.1%
unpow29.1%
hypot-def19.0%
Simplified19.0%
Taylor expanded in B around 0 4.7%
mul-1-neg4.7%
*-commutative4.7%
*-commutative4.7%
unpow24.7%
rem-square-sqrt4.8%
Simplified4.8%
Final simplification4.8%
herbie shell --seed 2023218
(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))))