
(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 14 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) 2e+126)
(/
(* (sqrt (* 2.0 (* F t_0))) (- (sqrt (+ C (+ A (hypot B (- A C)))))))
t_0)
(* (* (sqrt F) (sqrt (+ C (hypot B C)))) (/ (- (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) <= 2e+126) {
tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0;
} else {
tmp = (sqrt(F) * sqrt((C + hypot(B, C)))) * (-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) <= 2e+126) {
tmp = (Math.sqrt((2.0 * (F * t_0))) * -Math.sqrt((C + (A + Math.hypot(B, (A - C)))))) / t_0;
} else {
tmp = (Math.sqrt(F) * Math.sqrt((C + Math.hypot(B, C)))) * (-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) <= 2e+126: tmp = (math.sqrt((2.0 * (F * t_0))) * -math.sqrt((C + (A + math.hypot(B, (A - C)))))) / t_0 else: tmp = (math.sqrt(F) * math.sqrt((C + math.hypot(B, C)))) * (-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) <= 2e+126) 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(F) * sqrt(Float64(C + hypot(B, C)))) * 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) <= 2e+126) tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0; else tmp = (sqrt(F) * sqrt((C + hypot(B, C)))) * (-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], 2e+126], 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[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $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 2 \cdot 10^{+126}:\\
\;\;\;\;\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}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B, C\right)}\right) \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 1.99999999999999985e126Initial program 26.6%
associate-*l*26.6%
unpow226.6%
+-commutative26.6%
unpow226.6%
associate-*l*26.6%
unpow226.6%
Simplified26.6%
sqrt-prod27.3%
*-commutative27.3%
*-commutative27.3%
associate-+l+28.6%
unpow228.6%
hypot-udef40.9%
associate-+r+39.2%
+-commutative39.2%
associate-+r+39.6%
Applied egg-rr39.6%
if 1.99999999999999985e126 < (pow.f64 B 2) Initial program 6.6%
Simplified6.7%
Taylor expanded in A around 0 6.3%
mul-1-neg6.3%
*-commutative6.3%
distribute-rgt-neg-in6.3%
*-commutative6.3%
unpow26.3%
unpow26.3%
hypot-def25.9%
Simplified25.9%
sqrt-prod43.9%
Applied egg-rr43.9%
Final simplification41.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 8e+63)
(/
(* (sqrt (* 2.0 (* F t_0))) (- (sqrt (+ C (+ A (hypot B (- A C)))))))
t_0)
(* (/ (- (sqrt 2.0)) B) (sqrt (* F (+ 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 tmp;
if (B <= 8e+63) {
tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0;
} else {
tmp = (-sqrt(2.0) / B) * sqrt((F * (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 tmp;
if (B <= 8e+63) {
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((F * (C + Math.hypot(B, C))));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if B <= 8e+63: 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((F * (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))) tmp = 0.0 if (B <= 8e+63) 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(Float64(-sqrt(2.0)) / B) * sqrt(Float64(F * 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)); tmp = 0.0; if (B <= 8e+63) tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0; else tmp = (-sqrt(2.0) / B) * sqrt((F * (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]}, If[LessEqual[B, 8e+63], 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[Sqrt[N[(F * 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)\\
\mathbf{if}\;B \leq 8 \cdot 10^{+63}:\\
\;\;\;\;\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 \sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}\\
\end{array}
\end{array}
if B < 8.00000000000000046e63Initial program 22.4%
associate-*l*22.4%
unpow222.4%
+-commutative22.4%
unpow222.4%
associate-*l*22.4%
unpow222.4%
Simplified22.4%
sqrt-prod23.8%
*-commutative23.8%
*-commutative23.8%
associate-+l+24.9%
unpow224.9%
hypot-udef36.0%
associate-+r+34.7%
+-commutative34.7%
associate-+r+35.1%
Applied egg-rr35.1%
if 8.00000000000000046e63 < B Initial program 7.3%
Simplified7.3%
Taylor expanded in A around 0 11.4%
mul-1-neg11.4%
*-commutative11.4%
distribute-rgt-neg-in11.4%
*-commutative11.4%
unpow211.4%
unpow211.4%
hypot-def48.6%
Simplified48.6%
Final simplification37.4%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (sqrt 2.0))) (t_1 (- (* B B) (* 4.0 (* C A)))) (t_2 (/ t_0 B)))
(if (<= F 1.35e-288)
(/ (- (sqrt (* 2.0 (* (* F t_1) (+ C (+ A (hypot B (- A C)))))))) t_1)
(if (<= F 1.5e+81)
(* t_2 (sqrt (+ (* F C) (* F (hypot B C)))))
(if (<= F 2.4e+109)
(* t_2 (sqrt (* -0.5 (/ (* (pow B 2.0) F) C))))
(* (sqrt (/ F B)) t_0))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = -sqrt(2.0);
double t_1 = (B * B) - (4.0 * (C * A));
double t_2 = t_0 / B;
double tmp;
if (F <= 1.35e-288) {
tmp = -sqrt((2.0 * ((F * t_1) * (C + (A + hypot(B, (A - C))))))) / t_1;
} else if (F <= 1.5e+81) {
tmp = t_2 * sqrt(((F * C) + (F * hypot(B, C))));
} else if (F <= 2.4e+109) {
tmp = t_2 * sqrt((-0.5 * ((pow(B, 2.0) * F) / C)));
} else {
tmp = sqrt((F / B)) * t_0;
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = -Math.sqrt(2.0);
double t_1 = (B * B) - (4.0 * (C * A));
double t_2 = t_0 / B;
double tmp;
if (F <= 1.35e-288) {
tmp = -Math.sqrt((2.0 * ((F * t_1) * (C + (A + Math.hypot(B, (A - C))))))) / t_1;
} else if (F <= 1.5e+81) {
tmp = t_2 * Math.sqrt(((F * C) + (F * Math.hypot(B, C))));
} else if (F <= 2.4e+109) {
tmp = t_2 * Math.sqrt((-0.5 * ((Math.pow(B, 2.0) * F) / C)));
} else {
tmp = Math.sqrt((F / B)) * t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = -math.sqrt(2.0) t_1 = (B * B) - (4.0 * (C * A)) t_2 = t_0 / B tmp = 0 if F <= 1.35e-288: tmp = -math.sqrt((2.0 * ((F * t_1) * (C + (A + math.hypot(B, (A - C))))))) / t_1 elif F <= 1.5e+81: tmp = t_2 * math.sqrt(((F * C) + (F * math.hypot(B, C)))) elif F <= 2.4e+109: tmp = t_2 * math.sqrt((-0.5 * ((math.pow(B, 2.0) * F) / C))) else: tmp = math.sqrt((F / B)) * t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(-sqrt(2.0)) t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(C * A))) t_2 = Float64(t_0 / B) tmp = 0.0 if (F <= 1.35e-288) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_1) * Float64(C + Float64(A + hypot(B, Float64(A - C)))))))) / t_1); elseif (F <= 1.5e+81) tmp = Float64(t_2 * sqrt(Float64(Float64(F * C) + Float64(F * hypot(B, C))))); elseif (F <= 2.4e+109) tmp = Float64(t_2 * sqrt(Float64(-0.5 * Float64(Float64((B ^ 2.0) * F) / C)))); else tmp = Float64(sqrt(Float64(F / B)) * t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = -sqrt(2.0); t_1 = (B * B) - (4.0 * (C * A)); t_2 = t_0 / B; tmp = 0.0; if (F <= 1.35e-288) tmp = -sqrt((2.0 * ((F * t_1) * (C + (A + hypot(B, (A - C))))))) / t_1; elseif (F <= 1.5e+81) tmp = t_2 * sqrt(((F * C) + (F * hypot(B, C)))); elseif (F <= 2.4e+109) tmp = t_2 * sqrt((-0.5 * (((B ^ 2.0) * F) / C))); else tmp = sqrt((F / B)) * 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[Sqrt[2.0], $MachinePrecision])}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 / B), $MachinePrecision]}, If[LessEqual[F, 1.35e-288], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$1), $MachinePrecision] * N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[F, 1.5e+81], N[(t$95$2 * N[Sqrt[N[(N[(F * C), $MachinePrecision] + N[(F * N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.4e+109], N[(t$95$2 * N[Sqrt[N[(-0.5 * N[(N[(N[Power[B, 2.0], $MachinePrecision] * F), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := -\sqrt{2}\\
t_1 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\
t_2 := \frac{t_0}{B}\\
\mathbf{if}\;F \leq 1.35 \cdot 10^{-288}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_1\right) \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_1}\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+81}:\\
\;\;\;\;t_2 \cdot \sqrt{F \cdot C + F \cdot \mathsf{hypot}\left(B, C\right)}\\
\mathbf{elif}\;F \leq 2.4 \cdot 10^{+109}:\\
\;\;\;\;t_2 \cdot \sqrt{-0.5 \cdot \frac{{B}^{2} \cdot F}{C}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot t_0\\
\end{array}
\end{array}
if F < 1.3500000000000001e-288Initial program 28.7%
associate-*l*28.7%
unpow228.7%
+-commutative28.7%
unpow228.7%
associate-*l*28.7%
unpow228.7%
Simplified28.7%
distribute-frac-neg28.7%
Applied egg-rr43.0%
if 1.3500000000000001e-288 < F < 1.49999999999999999e81Initial program 19.7%
Simplified24.9%
Taylor expanded in A around 0 9.5%
mul-1-neg9.5%
*-commutative9.5%
distribute-rgt-neg-in9.5%
*-commutative9.5%
unpow29.5%
unpow29.5%
hypot-def22.6%
Simplified22.6%
distribute-lft-in22.6%
Applied egg-rr22.6%
if 1.49999999999999999e81 < F < 2.39999999999999987e109Initial program 2.1%
Simplified1.6%
Taylor expanded in A around 0 1.9%
mul-1-neg1.9%
*-commutative1.9%
distribute-rgt-neg-in1.9%
*-commutative1.9%
unpow21.9%
unpow21.9%
hypot-def3.1%
Simplified3.1%
Taylor expanded in C around -inf 41.2%
if 2.39999999999999987e109 < F Initial program 16.7%
Simplified17.5%
Taylor expanded in A around 0 8.5%
mul-1-neg8.5%
*-commutative8.5%
distribute-rgt-neg-in8.5%
*-commutative8.5%
unpow28.5%
unpow28.5%
hypot-def9.9%
Simplified9.9%
Taylor expanded in C around 0 25.1%
mul-1-neg25.1%
Simplified25.1%
Final simplification27.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 7e+26)
(/ (- (sqrt (* 2.0 (* (* F t_0) (+ C (+ A (hypot B (- A C)))))))) t_0)
(* (/ (- (sqrt 2.0)) B) (sqrt (* F (+ 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 tmp;
if (B <= 7e+26) {
tmp = -sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0;
} else {
tmp = (-sqrt(2.0) / B) * sqrt((F * (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 tmp;
if (B <= 7e+26) {
tmp = -Math.sqrt((2.0 * ((F * t_0) * (C + (A + Math.hypot(B, (A - C))))))) / t_0;
} else {
tmp = (-Math.sqrt(2.0) / B) * Math.sqrt((F * (C + Math.hypot(B, C))));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if B <= 7e+26: tmp = -math.sqrt((2.0 * ((F * t_0) * (C + (A + math.hypot(B, (A - C))))))) / t_0 else: tmp = (-math.sqrt(2.0) / B) * math.sqrt((F * (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))) tmp = 0.0 if (B <= 7e+26) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(C + Float64(A + hypot(B, Float64(A - C)))))))) / t_0); else tmp = Float64(Float64(Float64(-sqrt(2.0)) / B) * sqrt(Float64(F * 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)); tmp = 0.0; if (B <= 7e+26) tmp = -sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0; else tmp = (-sqrt(2.0) / B) * sqrt((F * (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]}, If[LessEqual[B, 7e+26], 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], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision] * N[Sqrt[N[(F * 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)\\
\mathbf{if}\;B \leq 7 \cdot 10^{+26}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}\\
\end{array}
\end{array}
if B < 6.9999999999999998e26Initial program 22.1%
associate-*l*22.1%
unpow222.1%
+-commutative22.1%
unpow222.1%
associate-*l*22.1%
unpow222.1%
Simplified22.1%
distribute-frac-neg22.1%
Applied egg-rr28.4%
if 6.9999999999999998e26 < B Initial program 10.4%
Simplified10.8%
Taylor expanded in A around 0 14.2%
mul-1-neg14.2%
*-commutative14.2%
distribute-rgt-neg-in14.2%
*-commutative14.2%
unpow214.2%
unpow214.2%
hypot-def46.5%
Simplified46.5%
Final simplification32.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))))
(if (<= B 8.2e+62)
(/ (- (sqrt (* 2.0 (* (* F t_0) (+ C (+ A (hypot B (- A C)))))))) t_0)
(if (<= B 3.7e+195)
(* (sqrt (/ F B)) t_1)
(* (/ t_1 B) (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);
double tmp;
if (B <= 8.2e+62) {
tmp = -sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0;
} else if (B <= 3.7e+195) {
tmp = sqrt((F / B)) * t_1;
} else {
tmp = (t_1 / B) * 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);
double tmp;
if (B <= 8.2e+62) {
tmp = -Math.sqrt((2.0 * ((F * t_0) * (C + (A + Math.hypot(B, (A - C))))))) / t_0;
} else if (B <= 3.7e+195) {
tmp = Math.sqrt((F / B)) * t_1;
} else {
tmp = (t_1 / B) * 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) tmp = 0 if B <= 8.2e+62: tmp = -math.sqrt((2.0 * ((F * t_0) * (C + (A + math.hypot(B, (A - C))))))) / t_0 elif B <= 3.7e+195: tmp = math.sqrt((F / B)) * t_1 else: tmp = (t_1 / B) * 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)) tmp = 0.0 if (B <= 8.2e+62) 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 <= 3.7e+195) tmp = Float64(sqrt(Float64(F / B)) * t_1); else tmp = Float64(Float64(t_1 / B) * 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); tmp = 0.0; if (B <= 8.2e+62) tmp = -sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0; elseif (B <= 3.7e+195) tmp = sqrt((F / B)) * t_1; else tmp = (t_1 / B) * 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[Sqrt[2.0], $MachinePrecision])}, If[LessEqual[B, 8.2e+62], 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, 3.7e+195], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(t$95$1 / B), $MachinePrecision] * 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 := -\sqrt{2}\\
\mathbf{if}\;B \leq 8.2 \cdot 10^{+62}:\\
\;\;\;\;\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 3.7 \cdot 10^{+195}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{B} \cdot \sqrt{F \cdot \left(B + A\right)}\\
\end{array}
\end{array}
if B < 8.19999999999999967e62Initial 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.5%
if 8.19999999999999967e62 < B < 3.70000000000000001e195Initial program 16.0%
Simplified16.1%
Taylor expanded in A around 0 22.1%
mul-1-neg22.1%
*-commutative22.1%
distribute-rgt-neg-in22.1%
*-commutative22.1%
unpow222.1%
unpow222.1%
hypot-def49.9%
Simplified49.9%
Taylor expanded in C around 0 50.4%
mul-1-neg50.4%
Simplified50.4%
if 3.70000000000000001e195 < B Initial program 0.0%
associate-*l*0.0%
unpow20.0%
+-commutative0.0%
unpow20.0%
associate-*l*0.0%
unpow20.0%
Simplified0.0%
Taylor expanded in A around 0 0.0%
unpow20.0%
unpow20.0%
hypot-def0.0%
Simplified0.0%
Taylor expanded in C around 0 46.8%
associate-*r*46.8%
neg-mul-146.8%
distribute-neg-frac46.8%
+-commutative46.8%
Simplified46.8%
Final simplification31.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 (<= F 3.8e-308)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ A (+ C A))))) t_0)
(if (<= F 1.06e-42)
(* (/ (sqrt 2.0) B) (- (sqrt (* B F))))
(* (sqrt (/ F B)) (- (sqrt 2.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 (F <= 3.8e-308) {
tmp = -sqrt(((2.0 * (F * t_0)) * (A + (C + A)))) / t_0;
} else if (F <= 1.06e-42) {
tmp = (sqrt(2.0) / B) * -sqrt((B * F));
} else {
tmp = sqrt((F / B)) * -sqrt(2.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 (f <= 3.8d-308) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * (a + (c + a)))) / t_0
else if (f <= 1.06d-42) then
tmp = (sqrt(2.0d0) / b) * -sqrt((b * f))
else
tmp = sqrt((f / b)) * -sqrt(2.0d0)
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.8e-308) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (A + (C + A)))) / t_0;
} else if (F <= 1.06e-42) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((B * F));
} else {
tmp = Math.sqrt((F / B)) * -Math.sqrt(2.0);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if F <= 3.8e-308: tmp = -math.sqrt(((2.0 * (F * t_0)) * (A + (C + A)))) / t_0 elif F <= 1.06e-42: tmp = (math.sqrt(2.0) / B) * -math.sqrt((B * F)) else: tmp = math.sqrt((F / B)) * -math.sqrt(2.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 (F <= 3.8e-308) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(A + Float64(C + A))))) / t_0); elseif (F <= 1.06e-42) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(B * F)))); else tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.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 (F <= 3.8e-308) tmp = -sqrt(((2.0 * (F * t_0)) * (A + (C + A)))) / t_0; elseif (F <= 1.06e-42) tmp = (sqrt(2.0) / B) * -sqrt((B * F)); else tmp = sqrt((F / B)) * -sqrt(2.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[F, 3.8e-308], 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], If[LessEqual[F, 1.06e-42], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $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.8 \cdot 10^{-308}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(A + \left(C + A\right)\right)}}{t_0}\\
\mathbf{elif}\;F \leq 1.06 \cdot 10^{-42}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\
\end{array}
\end{array}
if F < 3.79999999999999975e-308Initial program 29.2%
associate-*l*29.2%
unpow229.2%
+-commutative29.2%
unpow229.2%
associate-*l*29.2%
unpow229.2%
Simplified29.2%
Taylor expanded in A around inf 34.8%
if 3.79999999999999975e-308 < F < 1.0600000000000001e-42Initial program 18.2%
Simplified23.6%
Taylor expanded in A around 0 7.8%
mul-1-neg7.8%
*-commutative7.8%
distribute-rgt-neg-in7.8%
*-commutative7.8%
unpow27.8%
unpow27.8%
hypot-def24.1%
Simplified24.1%
Taylor expanded in C around 0 22.0%
if 1.0600000000000001e-42 < F Initial program 18.6%
Simplified20.0%
Taylor expanded in A around 0 9.5%
mul-1-neg9.5%
*-commutative9.5%
distribute-rgt-neg-in9.5%
*-commutative9.5%
unpow29.5%
unpow29.5%
hypot-def11.4%
Simplified11.4%
Taylor expanded in C around 0 21.4%
mul-1-neg21.4%
Simplified21.4%
Final simplification23.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 (<= B 3.38e-45)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (* 2.0 A)))) t_0)
(* (sqrt (/ F B)) (- (sqrt 2.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 (B <= 3.38e-45) {
tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * A))) / t_0;
} else {
tmp = sqrt((F / B)) * -sqrt(2.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 (b <= 3.38d-45) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * (2.0d0 * a))) / t_0
else
tmp = sqrt((f / b)) * -sqrt(2.0d0)
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 (B <= 3.38e-45) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (2.0 * A))) / t_0;
} else {
tmp = Math.sqrt((F / B)) * -Math.sqrt(2.0);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (C * A)) tmp = 0 if B <= 3.38e-45: tmp = -math.sqrt(((2.0 * (F * t_0)) * (2.0 * A))) / t_0 else: tmp = math.sqrt((F / B)) * -math.sqrt(2.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 (B <= 3.38e-45) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(2.0 * A)))) / t_0); else tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.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 (B <= 3.38e-45) tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * A))) / t_0; else tmp = sqrt((F / B)) * -sqrt(2.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[B, 3.38e-45], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $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.38 \cdot 10^{-45}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot A\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\
\end{array}
\end{array}
if B < 3.37999999999999992e-45Initial program 19.9%
associate-*l*19.9%
unpow219.9%
+-commutative19.9%
unpow219.9%
associate-*l*19.9%
unpow219.9%
Simplified19.9%
unpow219.9%
hypot-udef25.3%
add-sqr-sqrt25.0%
Applied egg-rr25.0%
Taylor expanded in A around inf 20.5%
if 3.37999999999999992e-45 < B Initial program 19.4%
Simplified21.5%
Taylor expanded in A around 0 19.8%
mul-1-neg19.8%
*-commutative19.8%
distribute-rgt-neg-in19.8%
*-commutative19.8%
unpow219.8%
unpow219.8%
hypot-def45.5%
Simplified45.5%
Taylor expanded in C around 0 44.7%
mul-1-neg44.7%
Simplified44.7%
Final simplification26.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 (* 2.0 (* F t_0))))
(if (<= A -5.5e-44)
(/ (- (sqrt (* -16.0 (* A (* F (* C C)))))) t_0)
(if (<= A 2.8e-163)
(/ (- (sqrt (* (+ B A) t_1))) t_0)
(/ (- (sqrt (* t_1 (* 2.0 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 (A <= -5.5e-44) {
tmp = -sqrt((-16.0 * (A * (F * (C * C))))) / t_0;
} else if (A <= 2.8e-163) {
tmp = -sqrt(((B + A) * t_1)) / t_0;
} else {
tmp = -sqrt((t_1 * (2.0 * 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 (a <= (-5.5d-44)) then
tmp = -sqrt(((-16.0d0) * (a * (f * (c * c))))) / t_0
else if (a <= 2.8d-163) then
tmp = -sqrt(((b + a) * t_1)) / t_0
else
tmp = -sqrt((t_1 * (2.0d0 * 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 (A <= -5.5e-44) {
tmp = -Math.sqrt((-16.0 * (A * (F * (C * C))))) / t_0;
} else if (A <= 2.8e-163) {
tmp = -Math.sqrt(((B + A) * t_1)) / t_0;
} else {
tmp = -Math.sqrt((t_1 * (2.0 * 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 A <= -5.5e-44: tmp = -math.sqrt((-16.0 * (A * (F * (C * C))))) / t_0 elif A <= 2.8e-163: tmp = -math.sqrt(((B + A) * t_1)) / t_0 else: tmp = -math.sqrt((t_1 * (2.0 * 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 (A <= -5.5e-44) tmp = Float64(Float64(-sqrt(Float64(-16.0 * Float64(A * Float64(F * Float64(C * C)))))) / t_0); elseif (A <= 2.8e-163) tmp = Float64(Float64(-sqrt(Float64(Float64(B + A) * t_1))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * 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 (A <= -5.5e-44) tmp = -sqrt((-16.0 * (A * (F * (C * C))))) / t_0; elseif (A <= 2.8e-163) tmp = -sqrt(((B + A) * t_1)) / t_0; else tmp = -sqrt((t_1 * (2.0 * 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[A, -5.5e-44], N[((-N[Sqrt[N[(-16.0 * N[(A * N[(F * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, 2.8e-163], N[((-N[Sqrt[N[(N[(B + A), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * A), $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}\;A \leq -5.5 \cdot 10^{-44}:\\
\;\;\;\;\frac{-\sqrt{-16 \cdot \left(A \cdot \left(F \cdot \left(C \cdot C\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;A \leq 2.8 \cdot 10^{-163}:\\
\;\;\;\;\frac{-\sqrt{\left(B + A\right) \cdot t_1}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(2 \cdot A\right)}}{t_0}\\
\end{array}
\end{array}
if A < -5.49999999999999993e-44Initial program 8.0%
associate-*l*8.0%
unpow28.0%
+-commutative8.0%
unpow28.0%
associate-*l*8.0%
unpow28.0%
Simplified8.0%
Taylor expanded in C around inf 5.2%
Taylor expanded in C around inf 21.8%
unpow221.8%
Simplified21.8%
if -5.49999999999999993e-44 < A < 2.8e-163Initial program 22.9%
associate-*l*22.9%
unpow222.9%
+-commutative22.9%
unpow222.9%
associate-*l*22.9%
unpow222.9%
Simplified22.9%
Taylor expanded in A around 0 23.0%
unpow223.0%
unpow223.0%
hypot-def27.3%
Simplified27.3%
Taylor expanded in C around 0 14.8%
+-commutative14.8%
Simplified14.8%
if 2.8e-163 < A Initial program 23.6%
associate-*l*23.6%
unpow223.6%
+-commutative23.6%
unpow223.6%
associate-*l*23.6%
unpow223.6%
Simplified23.6%
unpow223.6%
hypot-udef29.1%
add-sqr-sqrt29.1%
Applied egg-rr29.1%
Taylor expanded in A around inf 28.2%
Final simplification22.8%
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 (<= A -1.02e-44)
(/ (- (sqrt (* t_1 (+ C C)))) t_0)
(if (<= A 2.2e-162)
(/ (- (sqrt (* (+ B A) t_1))) t_0)
(/ (- (sqrt (* t_1 (* 2.0 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 (A <= -1.02e-44) {
tmp = -sqrt((t_1 * (C + C))) / t_0;
} else if (A <= 2.2e-162) {
tmp = -sqrt(((B + A) * t_1)) / t_0;
} else {
tmp = -sqrt((t_1 * (2.0 * 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 (a <= (-1.02d-44)) then
tmp = -sqrt((t_1 * (c + c))) / t_0
else if (a <= 2.2d-162) then
tmp = -sqrt(((b + a) * t_1)) / t_0
else
tmp = -sqrt((t_1 * (2.0d0 * 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 (A <= -1.02e-44) {
tmp = -Math.sqrt((t_1 * (C + C))) / t_0;
} else if (A <= 2.2e-162) {
tmp = -Math.sqrt(((B + A) * t_1)) / t_0;
} else {
tmp = -Math.sqrt((t_1 * (2.0 * 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 A <= -1.02e-44: tmp = -math.sqrt((t_1 * (C + C))) / t_0 elif A <= 2.2e-162: tmp = -math.sqrt(((B + A) * t_1)) / t_0 else: tmp = -math.sqrt((t_1 * (2.0 * 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 (A <= -1.02e-44) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(C + C)))) / t_0); elseif (A <= 2.2e-162) tmp = Float64(Float64(-sqrt(Float64(Float64(B + A) * t_1))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * 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 (A <= -1.02e-44) tmp = -sqrt((t_1 * (C + C))) / t_0; elseif (A <= 2.2e-162) tmp = -sqrt(((B + A) * t_1)) / t_0; else tmp = -sqrt((t_1 * (2.0 * 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[A, -1.02e-44], N[((-N[Sqrt[N[(t$95$1 * N[(C + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, 2.2e-162], N[((-N[Sqrt[N[(N[(B + A), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * A), $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}\;A \leq -1.02 \cdot 10^{-44}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(C + C\right)}}{t_0}\\
\mathbf{elif}\;A \leq 2.2 \cdot 10^{-162}:\\
\;\;\;\;\frac{-\sqrt{\left(B + A\right) \cdot t_1}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(2 \cdot A\right)}}{t_0}\\
\end{array}
\end{array}
if A < -1.0199999999999999e-44Initial program 8.0%
associate-*l*8.0%
unpow28.0%
+-commutative8.0%
unpow28.0%
associate-*l*8.0%
unpow28.0%
Simplified8.0%
Taylor expanded in C around inf 7.8%
mul-1-neg7.8%
unsub-neg7.8%
Simplified8.5%
Taylor expanded in C around inf 23.9%
count-223.9%
Simplified23.9%
if -1.0199999999999999e-44 < A < 2.1999999999999999e-162Initial program 22.9%
associate-*l*22.9%
unpow222.9%
+-commutative22.9%
unpow222.9%
associate-*l*22.9%
unpow222.9%
Simplified22.9%
Taylor expanded in A around 0 23.0%
unpow223.0%
unpow223.0%
hypot-def27.3%
Simplified27.3%
Taylor expanded in C around 0 14.8%
+-commutative14.8%
Simplified14.8%
if 2.1999999999999999e-162 < A Initial program 23.6%
associate-*l*23.6%
unpow223.6%
+-commutative23.6%
unpow223.6%
associate-*l*23.6%
unpow223.6%
Simplified23.6%
unpow223.6%
hypot-udef29.1%
add-sqr-sqrt29.1%
Applied egg-rr29.1%
Taylor expanded in A around inf 28.2%
Final simplification23.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 (<= A -2.1e-147)
(/ (- (sqrt (* -16.0 (* A (* F (* C C)))))) t_0)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (* 2.0 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 <= -2.1e-147) {
tmp = -sqrt((-16.0 * (A * (F * (C * C))))) / t_0;
} else {
tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * 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 <= (-2.1d-147)) then
tmp = -sqrt(((-16.0d0) * (a * (f * (c * c))))) / t_0
else
tmp = -sqrt(((2.0d0 * (f * t_0)) * (2.0d0 * 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 <= -2.1e-147) {
tmp = -Math.sqrt((-16.0 * (A * (F * (C * C))))) / t_0;
} else {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (2.0 * 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 <= -2.1e-147: tmp = -math.sqrt((-16.0 * (A * (F * (C * C))))) / t_0 else: tmp = -math.sqrt(((2.0 * (F * t_0)) * (2.0 * 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 <= -2.1e-147) tmp = Float64(Float64(-sqrt(Float64(-16.0 * Float64(A * Float64(F * Float64(C * C)))))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(2.0 * 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 <= -2.1e-147) tmp = -sqrt((-16.0 * (A * (F * (C * C))))) / t_0; else tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * 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, -2.1e-147], N[((-N[Sqrt[N[(-16.0 * N[(A * N[(F * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * A), $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 -2.1 \cdot 10^{-147}:\\
\;\;\;\;\frac{-\sqrt{-16 \cdot \left(A \cdot \left(F \cdot \left(C \cdot C\right)\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot A\right)}}{t_0}\\
\end{array}
\end{array}
if A < -2.1e-147Initial program 12.6%
associate-*l*12.6%
unpow212.6%
+-commutative12.6%
unpow212.6%
associate-*l*12.6%
unpow212.6%
Simplified12.6%
Taylor expanded in C around inf 5.9%
Taylor expanded in C around inf 19.4%
unpow219.4%
Simplified19.4%
if -2.1e-147 < A Initial program 23.1%
associate-*l*23.1%
unpow223.1%
+-commutative23.1%
unpow223.1%
associate-*l*23.1%
unpow223.1%
Simplified23.1%
unpow223.1%
hypot-udef28.7%
add-sqr-sqrt28.5%
Applied egg-rr28.5%
Taylor expanded in A around inf 23.6%
Final simplification22.3%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= B 1e+28) (/ (- (sqrt (* -16.0 (* A (* F (* C C)))))) (- (* B B) (* 4.0 (* C A)))) (* -2.0 (* (pow (* F C) 0.5) (/ 1.0 B)))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (B <= 1e+28) {
tmp = -sqrt((-16.0 * (A * (F * (C * C))))) / ((B * B) - (4.0 * (C * A)));
} else {
tmp = -2.0 * (pow((F * C), 0.5) * (1.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 (b <= 1d+28) then
tmp = -sqrt(((-16.0d0) * (a * (f * (c * c))))) / ((b * b) - (4.0d0 * (c * a)))
else
tmp = (-2.0d0) * (((f * c) ** 0.5d0) * (1.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 (B <= 1e+28) {
tmp = -Math.sqrt((-16.0 * (A * (F * (C * C))))) / ((B * B) - (4.0 * (C * A)));
} else {
tmp = -2.0 * (Math.pow((F * C), 0.5) * (1.0 / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if B <= 1e+28: tmp = -math.sqrt((-16.0 * (A * (F * (C * C))))) / ((B * B) - (4.0 * (C * A))) else: tmp = -2.0 * (math.pow((F * C), 0.5) * (1.0 / B)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (B <= 1e+28) tmp = Float64(Float64(-sqrt(Float64(-16.0 * Float64(A * Float64(F * Float64(C * C)))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(C * A)))); else tmp = Float64(-2.0 * Float64((Float64(F * C) ^ 0.5) * Float64(1.0 / B))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (B <= 1e+28) tmp = -sqrt((-16.0 * (A * (F * (C * C))))) / ((B * B) - (4.0 * (C * A))); else tmp = -2.0 * (((F * C) ^ 0.5) * (1.0 / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[B, 1e+28], N[((-N[Sqrt[N[(-16.0 * N[(A * N[(F * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Power[N[(F * C), $MachinePrecision], 0.5], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 10^{+28}:\\
\;\;\;\;\frac{-\sqrt{-16 \cdot \left(A \cdot \left(F \cdot \left(C \cdot C\right)\right)\right)}}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left({\left(F \cdot C\right)}^{0.5} \cdot \frac{1}{B}\right)\\
\end{array}
\end{array}
if B < 9.99999999999999958e27Initial program 21.9%
associate-*l*21.9%
unpow221.9%
+-commutative21.9%
unpow221.9%
associate-*l*21.9%
unpow221.9%
Simplified21.9%
Taylor expanded in C around inf 9.0%
Taylor expanded in C around inf 9.5%
unpow29.5%
Simplified9.5%
if 9.99999999999999958e27 < B Initial program 10.8%
Simplified10.9%
Taylor expanded in C around inf 0.5%
Taylor expanded in A around 0 5.9%
pow1/26.0%
*-commutative6.0%
Applied egg-rr6.0%
Final simplification8.8%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* -2.0 (* (pow (* F C) 0.5) (/ 1.0 B))))
B = abs(B);
double code(double A, double B, double C, double F) {
return -2.0 * (pow((F * C), 0.5) * (1.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 = (-2.0d0) * (((f * c) ** 0.5d0) * (1.0d0 / b))
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return -2.0 * (Math.pow((F * C), 0.5) * (1.0 / B));
}
B = abs(B) def code(A, B, C, F): return -2.0 * (math.pow((F * C), 0.5) * (1.0 / B))
B = abs(B) function code(A, B, C, F) return Float64(-2.0 * Float64((Float64(F * C) ^ 0.5) * Float64(1.0 / B))) end
B = abs(B) function tmp = code(A, B, C, F) tmp = -2.0 * (((F * C) ^ 0.5) * (1.0 / B)); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(-2.0 * N[(N[Power[N[(F * C), $MachinePrecision], 0.5], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
-2 \cdot \left({\left(F \cdot C\right)}^{0.5} \cdot \frac{1}{B}\right)
\end{array}
Initial program 19.8%
Simplified24.9%
Taylor expanded in C around inf 10.3%
Taylor expanded in A around 0 2.3%
pow1/22.5%
*-commutative2.5%
Applied egg-rr2.5%
Final simplification2.5%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* (/ 2.0 B) (- (sqrt (* F C)))))
B = abs(B);
double code(double A, double B, double C, double F) {
return (2.0 / B) * -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 = (2.0d0 / b) * -sqrt((f * c))
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 = abs(B) def code(A, B, C, F): return (2.0 / B) * -math.sqrt((F * C))
B = abs(B) function code(A, B, C, F) return Float64(Float64(2.0 / B) * Float64(-sqrt(Float64(F * C)))) end
B = abs(B) function tmp = code(A, B, C, F) tmp = (2.0 / B) * -sqrt((F * C)); 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 * C), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\frac{2}{B} \cdot \left(-\sqrt{F \cdot C}\right)
\end{array}
Initial program 19.8%
Simplified24.9%
Taylor expanded in A around 0 7.7%
mul-1-neg7.7%
*-commutative7.7%
distribute-rgt-neg-in7.7%
*-commutative7.7%
unpow27.7%
unpow27.7%
hypot-def15.0%
Simplified15.0%
sqrt-prod21.8%
Applied egg-rr21.8%
Taylor expanded in B around 0 2.2%
mul-1-neg2.2%
unpow22.2%
rem-square-sqrt2.3%
*-commutative2.3%
Simplified2.3%
Final simplification2.3%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* -2.0 (/ (sqrt (* F C)) B)))
B = abs(B);
double code(double A, double B, double C, double F) {
return -2.0 * (sqrt((F * 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 = (-2.0d0) * (sqrt((f * c)) / b)
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return -2.0 * (Math.sqrt((F * C)) / B);
}
B = abs(B) def code(A, B, C, F): return -2.0 * (math.sqrt((F * C)) / B)
B = abs(B) function code(A, B, C, F) return Float64(-2.0 * Float64(sqrt(Float64(F * C)) / B)) end
B = abs(B) function tmp = code(A, B, C, F) tmp = -2.0 * (sqrt((F * C)) / B); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(-2.0 * N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
-2 \cdot \frac{\sqrt{F \cdot C}}{B}
\end{array}
Initial program 19.8%
Simplified24.9%
Taylor expanded in C around inf 10.3%
Taylor expanded in A around 0 2.3%
un-div-inv2.2%
*-commutative2.2%
Applied egg-rr2.2%
Final simplification2.2%
herbie shell --seed 2023258
(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))))