
(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 17 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
(if (<= (pow B 2.0) 2e+119)
(/
(*
(sqrt (* 2.0 (* F (fma -4.0 (* C A) (* B B)))))
(- (sqrt (+ C (+ A (hypot B (- A C)))))))
(fma B B (* A (* -4.0 C))))
(* (/ (sqrt 2.0) B) (* (sqrt F) (- (sqrt (+ C (hypot C B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (pow(B, 2.0) <= 2e+119) {
tmp = (sqrt((2.0 * (F * fma(-4.0, (C * A), (B * B))))) * -sqrt((C + (A + hypot(B, (A - C)))))) / fma(B, B, (A * (-4.0 * C)));
} else {
tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((C + hypot(C, B))));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) tmp = 0.0 if ((B ^ 2.0) <= 2e+119) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * fma(-4.0, Float64(C * A), Float64(B * B))))) * Float64(-sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / fma(B, B, Float64(A * Float64(-4.0 * C)))); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(F) * Float64(-sqrt(Float64(C + hypot(C, B)))))); end return tmp end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e+119], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(-4.0 * N[(C * A), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(B * B + N[(A * N[(-4.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{+119}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)} \cdot \left(-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{C + \mathsf{hypot}\left(C, B\right)}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 1.99999999999999989e119Initial program 32.9%
Simplified38.5%
sqrt-prod45.3%
associate-+r+43.7%
+-commutative43.7%
associate-+r+44.3%
Applied egg-rr44.3%
*-commutative44.3%
associate-*r*44.3%
*-commutative44.3%
fma-def44.3%
unpow244.3%
+-commutative44.3%
fma-def44.3%
*-commutative44.3%
unpow244.3%
associate-+r+43.7%
+-commutative43.7%
associate-+r+45.3%
Simplified45.3%
if 1.99999999999999989e119 < (pow.f64 B 2) Initial program 10.1%
Simplified10.1%
Taylor expanded in A around 0 8.0%
mul-1-neg8.0%
distribute-rgt-neg-in8.0%
+-commutative8.0%
unpow28.0%
unpow28.0%
hypot-def31.4%
Simplified31.4%
sqrt-prod41.7%
Applied egg-rr41.7%
Final simplification44.1%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= B 2.4e+61)
(/
(*
(sqrt (* 2.0 (* F (+ (* B B) (* -4.0 (* C A))))))
(- (sqrt (+ A (+ C (hypot B (- A C)))))))
(- (* B B) (* (* C A) 4.0)))
(* (/ (sqrt 2.0) B) (* (sqrt F) (- (sqrt (+ C (hypot C B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (B <= 2.4e+61) {
tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (C * A)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((C * A) * 4.0));
} else {
tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((C + hypot(C, B))));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (B <= 2.4e+61) {
tmp = (Math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (C * A)))))) * -Math.sqrt((A + (C + Math.hypot(B, (A - C)))))) / ((B * B) - ((C * A) * 4.0));
} else {
tmp = (Math.sqrt(2.0) / B) * (Math.sqrt(F) * -Math.sqrt((C + Math.hypot(C, B))));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if B <= 2.4e+61: tmp = (math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (C * A)))))) * -math.sqrt((A + (C + math.hypot(B, (A - C)))))) / ((B * B) - ((C * A) * 4.0)) else: tmp = (math.sqrt(2.0) / B) * (math.sqrt(F) * -math.sqrt((C + math.hypot(C, B)))) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (B <= 2.4e+61) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(C * A)))))) * Float64(-sqrt(Float64(A + Float64(C + hypot(B, Float64(A - C))))))) / Float64(Float64(B * B) - Float64(Float64(C * A) * 4.0))); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(F) * Float64(-sqrt(Float64(C + hypot(C, B)))))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (B <= 2.4e+61) tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (C * A)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((C * A) * 4.0)); else tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((C + hypot(C, B)))); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[B, 2.4e+61], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.4 \cdot 10^{+61}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(C \cdot A\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(C \cdot A\right) \cdot 4}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{C + \mathsf{hypot}\left(C, B\right)}\right)\right)\\
\end{array}
\end{array}
if B < 2.3999999999999999e61Initial program 29.9%
Simplified29.9%
sqrt-prod33.1%
*-commutative33.1%
cancel-sign-sub-inv33.1%
metadata-eval33.1%
associate-+l+33.3%
unpow233.3%
hypot-udef39.6%
Applied egg-rr39.6%
if 2.3999999999999999e61 < B Initial program 5.2%
Simplified5.2%
Taylor expanded in A around 0 13.2%
mul-1-neg13.2%
distribute-rgt-neg-in13.2%
+-commutative13.2%
unpow213.2%
unpow213.2%
hypot-def54.3%
Simplified54.3%
sqrt-prod72.6%
Applied egg-rr72.6%
Final simplification45.8%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= B 4.7e+111)
(/
(*
(sqrt (* 2.0 (* F (+ (* B B) (* -4.0 (* C A))))))
(- (sqrt (+ A (+ C (hypot B (- A C)))))))
(- (* B B) (* (* C A) 4.0)))
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ A (hypot B A))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (B <= 4.7e+111) {
tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (C * A)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((C * A) * 4.0));
} else {
tmp = (sqrt(2.0) / B) * -sqrt((F * (A + hypot(B, A))));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (B <= 4.7e+111) {
tmp = (Math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (C * A)))))) * -Math.sqrt((A + (C + Math.hypot(B, (A - C)))))) / ((B * B) - ((C * A) * 4.0));
} else {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (A + Math.hypot(B, A))));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if B <= 4.7e+111: tmp = (math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (C * A)))))) * -math.sqrt((A + (C + math.hypot(B, (A - C)))))) / ((B * B) - ((C * A) * 4.0)) else: tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (A + math.hypot(B, A)))) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (B <= 4.7e+111) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(C * A)))))) * Float64(-sqrt(Float64(A + Float64(C + hypot(B, Float64(A - C))))))) / Float64(Float64(B * B) - Float64(Float64(C * A) * 4.0))); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A + hypot(B, A)))))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (B <= 4.7e+111) tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (C * A)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((C * A) * 4.0)); else tmp = (sqrt(2.0) / B) * -sqrt((F * (A + hypot(B, A)))); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[B, 4.7e+111], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 4.7 \cdot 10^{+111}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(C \cdot A\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(C \cdot A\right) \cdot 4}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)\\
\end{array}
\end{array}
if B < 4.70000000000000008e111Initial program 29.0%
Simplified29.0%
sqrt-prod32.5%
*-commutative32.5%
cancel-sign-sub-inv32.5%
metadata-eval32.5%
associate-+l+32.7%
unpow232.7%
hypot-udef40.9%
Applied egg-rr40.9%
if 4.70000000000000008e111 < B Initial program 3.1%
Simplified3.1%
Taylor expanded in C around 0 7.7%
mul-1-neg7.7%
*-commutative7.7%
distribute-rgt-neg-in7.7%
+-commutative7.7%
unpow27.7%
unpow27.7%
hypot-def60.7%
Simplified60.7%
Final simplification43.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 (<= B 1.5e+32)
(*
(sqrt (* 2.0 (* (* F t_0) (+ A (+ C (hypot B (- A C)))))))
(/ -1.0 t_0))
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ A (hypot 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 <= 1.5e+32) {
tmp = sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) * (-1.0 / t_0);
} else {
tmp = (sqrt(2.0) / B) * -sqrt((F * (A + hypot(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 tmp;
if (B <= 1.5e+32) {
tmp = Math.sqrt((2.0 * ((F * t_0) * (A + (C + Math.hypot(B, (A - C))))))) * (-1.0 / t_0);
} else {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (A + Math.hypot(B, A))));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (C * A)) tmp = 0 if B <= 1.5e+32: tmp = math.sqrt((2.0 * ((F * t_0) * (A + (C + math.hypot(B, (A - C))))))) * (-1.0 / t_0) else: tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (A + math.hypot(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 <= 1.5e+32) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(C + hypot(B, Float64(A - C))))))) * Float64(-1.0 / t_0)); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A + hypot(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)); tmp = 0.0; if (B <= 1.5e+32) tmp = sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) * (-1.0 / t_0); else tmp = (sqrt(2.0) / B) * -sqrt((F * (A + hypot(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]}, If[LessEqual[B, 1.5e+32], N[(N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(C + 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[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 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 1.5 \cdot 10^{+32}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C + \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(A + \mathsf{hypot}\left(B, A\right)\right)}\right)\\
\end{array}
\end{array}
if B < 1.5e32Initial program 29.9%
Simplified29.9%
div-inv29.8%
Applied egg-rr33.5%
if 1.5e32 < B Initial program 8.4%
Simplified8.4%
Taylor expanded in C around 0 17.1%
mul-1-neg17.1%
*-commutative17.1%
distribute-rgt-neg-in17.1%
+-commutative17.1%
unpow217.1%
unpow217.1%
hypot-def56.4%
Simplified56.4%
Final simplification38.5%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* (* C A) 4.0))) (t_1 (* 2.0 (* F t_0))))
(if (<= A -3.4e+91)
(/ (- (sqrt (* t_1 (* 2.0 C)))) t_0)
(if (<= A 1.72e-283)
(* (/ (sqrt 2.0) B) (- (sqrt (* B F))))
(if (<= A 5e-233)
(/ (- (sqrt (* (+ C (hypot C B)) t_1))) t_0)
(if (<= A 2.3e-69)
(* (sqrt 2.0) (- (sqrt (/ F B))))
(if (<= A 5.2e-38)
(/ (* (sqrt t_1) (- (sqrt (* 2.0 C)))) 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) - ((C * A) * 4.0);
double t_1 = 2.0 * (F * t_0);
double tmp;
if (A <= -3.4e+91) {
tmp = -sqrt((t_1 * (2.0 * C))) / t_0;
} else if (A <= 1.72e-283) {
tmp = (sqrt(2.0) / B) * -sqrt((B * F));
} else if (A <= 5e-233) {
tmp = -sqrt(((C + hypot(C, B)) * t_1)) / t_0;
} else if (A <= 2.3e-69) {
tmp = sqrt(2.0) * -sqrt((F / B));
} else if (A <= 5.2e-38) {
tmp = (sqrt(t_1) * -sqrt((2.0 * C))) / t_0;
} else {
tmp = -sqrt((t_1 * (2.0 * A))) / t_0;
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - ((C * A) * 4.0);
double t_1 = 2.0 * (F * t_0);
double tmp;
if (A <= -3.4e+91) {
tmp = -Math.sqrt((t_1 * (2.0 * C))) / t_0;
} else if (A <= 1.72e-283) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((B * F));
} else if (A <= 5e-233) {
tmp = -Math.sqrt(((C + Math.hypot(C, B)) * t_1)) / t_0;
} else if (A <= 2.3e-69) {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
} else if (A <= 5.2e-38) {
tmp = (Math.sqrt(t_1) * -Math.sqrt((2.0 * C))) / 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) - ((C * A) * 4.0) t_1 = 2.0 * (F * t_0) tmp = 0 if A <= -3.4e+91: tmp = -math.sqrt((t_1 * (2.0 * C))) / t_0 elif A <= 1.72e-283: tmp = (math.sqrt(2.0) / B) * -math.sqrt((B * F)) elif A <= 5e-233: tmp = -math.sqrt(((C + math.hypot(C, B)) * t_1)) / t_0 elif A <= 2.3e-69: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) elif A <= 5.2e-38: tmp = (math.sqrt(t_1) * -math.sqrt((2.0 * C))) / 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(Float64(C * A) * 4.0)) t_1 = Float64(2.0 * Float64(F * t_0)) tmp = 0.0 if (A <= -3.4e+91) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * C)))) / t_0); elseif (A <= 1.72e-283) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(B * F)))); elseif (A <= 5e-233) tmp = Float64(Float64(-sqrt(Float64(Float64(C + hypot(C, B)) * t_1))) / t_0); elseif (A <= 2.3e-69) tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); elseif (A <= 5.2e-38) tmp = Float64(Float64(sqrt(t_1) * Float64(-sqrt(Float64(2.0 * C)))) / 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) - ((C * A) * 4.0); t_1 = 2.0 * (F * t_0); tmp = 0.0; if (A <= -3.4e+91) tmp = -sqrt((t_1 * (2.0 * C))) / t_0; elseif (A <= 1.72e-283) tmp = (sqrt(2.0) / B) * -sqrt((B * F)); elseif (A <= 5e-233) tmp = -sqrt(((C + hypot(C, B)) * t_1)) / t_0; elseif (A <= 2.3e-69) tmp = sqrt(2.0) * -sqrt((F / B)); elseif (A <= 5.2e-38) tmp = (sqrt(t_1) * -sqrt((2.0 * C))) / 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[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -3.4e+91], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, 1.72e-283], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[A, 5e-233], N[((-N[Sqrt[N[(N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, 2.3e-69], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[A, 5.2e-38], N[(N[(N[Sqrt[t$95$1], $MachinePrecision] * (-N[Sqrt[N[(2.0 * C), $MachinePrecision]], $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 - \left(C \cdot A\right) \cdot 4\\
t_1 := 2 \cdot \left(F \cdot t_0\right)\\
\mathbf{if}\;A \leq -3.4 \cdot 10^{+91}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{elif}\;A \leq 1.72 \cdot 10^{-283}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\
\mathbf{elif}\;A \leq 5 \cdot 10^{-233}:\\
\;\;\;\;\frac{-\sqrt{\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot t_1}}{t_0}\\
\mathbf{elif}\;A \leq 2.3 \cdot 10^{-69}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\mathbf{elif}\;A \leq 5.2 \cdot 10^{-38}:\\
\;\;\;\;\frac{\sqrt{t_1} \cdot \left(-\sqrt{2 \cdot C}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(2 \cdot A\right)}}{t_0}\\
\end{array}
\end{array}
if A < -3.4000000000000001e91Initial program 1.2%
Simplified1.2%
Taylor expanded in A around -inf 37.7%
*-commutative37.7%
Simplified37.7%
if -3.4000000000000001e91 < A < 1.7200000000000001e-283Initial program 28.7%
Simplified28.7%
Taylor expanded in A around 0 14.2%
mul-1-neg14.2%
distribute-rgt-neg-in14.2%
+-commutative14.2%
unpow214.2%
unpow214.2%
hypot-def28.5%
Simplified28.5%
Taylor expanded in C around 0 24.6%
if 1.7200000000000001e-283 < A < 5.00000000000000012e-233Initial program 51.1%
Simplified51.1%
Taylor expanded in A around 0 51.1%
+-commutative51.1%
unpow251.1%
unpow251.1%
hypot-def56.8%
Simplified56.8%
if 5.00000000000000012e-233 < A < 2.3000000000000001e-69Initial program 29.5%
Simplified29.5%
Taylor expanded in A around 0 29.5%
+-commutative29.5%
unpow229.5%
unpow229.5%
hypot-def29.6%
Simplified29.6%
Taylor expanded in C around 0 16.0%
mul-1-neg16.0%
Simplified16.0%
if 2.3000000000000001e-69 < A < 5.20000000000000022e-38Initial program 27.6%
Simplified27.6%
Taylor expanded in A around -inf 52.0%
*-commutative52.0%
Simplified52.0%
sqrt-prod99.2%
*-commutative99.2%
*-commutative99.2%
*-commutative99.2%
Applied egg-rr99.2%
if 5.20000000000000022e-38 < A Initial program 29.5%
Simplified29.5%
Taylor expanded in A around inf 32.1%
associate-+r+34.5%
distribute-rgt1-in34.5%
metadata-eval34.5%
mul0-lft34.5%
Simplified34.5%
Final simplification32.8%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* (* C A) 4.0))) (t_1 (* 2.0 (* F t_0))))
(if (<= A -3.35e+31)
(/ (- (sqrt (* t_1 (fma -0.5 (/ (* B B) A) (* 2.0 C))))) t_0)
(if (<= A 6e-284)
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ B C)))))
(if (<= A 1.36e-233)
(/ (- (sqrt (* (+ C (hypot C B)) t_1))) t_0)
(if (<= A 5e-66)
(* (sqrt 2.0) (- (sqrt (/ F B))))
(if (<= A 4.8e-38)
(/ (* (sqrt t_1) (- (sqrt (* 2.0 C)))) 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) - ((C * A) * 4.0);
double t_1 = 2.0 * (F * t_0);
double tmp;
if (A <= -3.35e+31) {
tmp = -sqrt((t_1 * fma(-0.5, ((B * B) / A), (2.0 * C)))) / t_0;
} else if (A <= 6e-284) {
tmp = (sqrt(2.0) / B) * -sqrt((F * (B + C)));
} else if (A <= 1.36e-233) {
tmp = -sqrt(((C + hypot(C, B)) * t_1)) / t_0;
} else if (A <= 5e-66) {
tmp = sqrt(2.0) * -sqrt((F / B));
} else if (A <= 4.8e-38) {
tmp = (sqrt(t_1) * -sqrt((2.0 * C))) / t_0;
} else {
tmp = -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(Float64(C * A) * 4.0)) t_1 = Float64(2.0 * Float64(F * t_0)) tmp = 0.0 if (A <= -3.35e+31) tmp = Float64(Float64(-sqrt(Float64(t_1 * fma(-0.5, Float64(Float64(B * B) / A), Float64(2.0 * C))))) / t_0); elseif (A <= 6e-284) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(B + C))))); elseif (A <= 1.36e-233) tmp = Float64(Float64(-sqrt(Float64(Float64(C + hypot(C, B)) * t_1))) / t_0); elseif (A <= 5e-66) tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); elseif (A <= 4.8e-38) tmp = Float64(Float64(sqrt(t_1) * Float64(-sqrt(Float64(2.0 * C)))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * A)))) / t_0); 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[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -3.35e+31], N[((-N[Sqrt[N[(t$95$1 * N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, 6e-284], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(B + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[A, 1.36e-233], N[((-N[Sqrt[N[(N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, 5e-66], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[A, 4.8e-38], N[(N[(N[Sqrt[t$95$1], $MachinePrecision] * (-N[Sqrt[N[(2.0 * C), $MachinePrecision]], $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 - \left(C \cdot A\right) \cdot 4\\
t_1 := 2 \cdot \left(F \cdot t_0\right)\\
\mathbf{if}\;A \leq -3.35 \cdot 10^{+31}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \mathsf{fma}\left(-0.5, \frac{B \cdot B}{A}, 2 \cdot C\right)}}{t_0}\\
\mathbf{elif}\;A \leq 6 \cdot 10^{-284}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(B + C\right)}\right)\\
\mathbf{elif}\;A \leq 1.36 \cdot 10^{-233}:\\
\;\;\;\;\frac{-\sqrt{\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot t_1}}{t_0}\\
\mathbf{elif}\;A \leq 5 \cdot 10^{-66}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\mathbf{elif}\;A \leq 4.8 \cdot 10^{-38}:\\
\;\;\;\;\frac{\sqrt{t_1} \cdot \left(-\sqrt{2 \cdot C}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(2 \cdot A\right)}}{t_0}\\
\end{array}
\end{array}
if A < -3.35000000000000008e31Initial program 5.6%
Simplified5.6%
Taylor expanded in A around -inf 36.5%
fma-def36.5%
unpow236.5%
*-commutative36.5%
Simplified36.5%
if -3.35000000000000008e31 < A < 5.9999999999999999e-284Initial program 32.7%
Simplified32.7%
Taylor expanded in A around 0 16.3%
mul-1-neg16.3%
distribute-rgt-neg-in16.3%
+-commutative16.3%
unpow216.3%
unpow216.3%
hypot-def30.4%
Simplified30.4%
Taylor expanded in C around 0 25.3%
distribute-rgt-out25.3%
Simplified25.3%
if 5.9999999999999999e-284 < A < 1.35999999999999994e-233Initial program 51.1%
Simplified51.1%
Taylor expanded in A around 0 51.1%
+-commutative51.1%
unpow251.1%
unpow251.1%
hypot-def56.8%
Simplified56.8%
if 1.35999999999999994e-233 < A < 4.99999999999999962e-66Initial program 29.5%
Simplified29.5%
Taylor expanded in A around 0 29.5%
+-commutative29.5%
unpow229.5%
unpow229.5%
hypot-def29.6%
Simplified29.6%
Taylor expanded in C around 0 16.0%
mul-1-neg16.0%
Simplified16.0%
if 4.99999999999999962e-66 < A < 4.80000000000000044e-38Initial program 27.6%
Simplified27.6%
Taylor expanded in A around -inf 52.0%
*-commutative52.0%
Simplified52.0%
sqrt-prod99.2%
*-commutative99.2%
*-commutative99.2%
*-commutative99.2%
Applied egg-rr99.2%
if 4.80000000000000044e-38 < A Initial program 29.5%
Simplified29.5%
Taylor expanded in A around inf 32.1%
associate-+r+34.5%
distribute-rgt1-in34.5%
metadata-eval34.5%
mul0-lft34.5%
Simplified34.5%
Final simplification33.7%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (/ (sqrt 2.0) B)) (t_1 (+ (* B B) (* -4.0 (* C A)))))
(if (<= B 2.5e+61)
(*
(sqrt (* 2.0 (* (* F t_1) (+ A (+ C (hypot B (- A C)))))))
(/ -1.0 t_1))
(if (<= B 2.9e+247)
(* t_0 (- (sqrt (* F (+ B C)))))
(if (<= B 1.95e+292)
(* (sqrt 2.0) (- (sqrt (/ F B))))
(* t_0 (- (sqrt (* B F)))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = sqrt(2.0) / B;
double t_1 = (B * B) + (-4.0 * (C * A));
double tmp;
if (B <= 2.5e+61) {
tmp = sqrt((2.0 * ((F * t_1) * (A + (C + hypot(B, (A - C))))))) * (-1.0 / t_1);
} else if (B <= 2.9e+247) {
tmp = t_0 * -sqrt((F * (B + C)));
} else if (B <= 1.95e+292) {
tmp = sqrt(2.0) * -sqrt((F / B));
} else {
tmp = t_0 * -sqrt((B * F));
}
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) / B;
double t_1 = (B * B) + (-4.0 * (C * A));
double tmp;
if (B <= 2.5e+61) {
tmp = Math.sqrt((2.0 * ((F * t_1) * (A + (C + Math.hypot(B, (A - C))))))) * (-1.0 / t_1);
} else if (B <= 2.9e+247) {
tmp = t_0 * -Math.sqrt((F * (B + C)));
} else if (B <= 1.95e+292) {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
} else {
tmp = t_0 * -Math.sqrt((B * F));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = math.sqrt(2.0) / B t_1 = (B * B) + (-4.0 * (C * A)) tmp = 0 if B <= 2.5e+61: tmp = math.sqrt((2.0 * ((F * t_1) * (A + (C + math.hypot(B, (A - C))))))) * (-1.0 / t_1) elif B <= 2.9e+247: tmp = t_0 * -math.sqrt((F * (B + C))) elif B <= 1.95e+292: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) else: tmp = t_0 * -math.sqrt((B * F)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(sqrt(2.0) / B) t_1 = Float64(Float64(B * B) + Float64(-4.0 * Float64(C * A))) tmp = 0.0 if (B <= 2.5e+61) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_1) * Float64(A + Float64(C + hypot(B, Float64(A - C))))))) * Float64(-1.0 / t_1)); elseif (B <= 2.9e+247) tmp = Float64(t_0 * Float64(-sqrt(Float64(F * Float64(B + C))))); elseif (B <= 1.95e+292) tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); else tmp = Float64(t_0 * Float64(-sqrt(Float64(B * F)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = sqrt(2.0) / B; t_1 = (B * B) + (-4.0 * (C * A)); tmp = 0.0; if (B <= 2.5e+61) tmp = sqrt((2.0 * ((F * t_1) * (A + (C + hypot(B, (A - C))))))) * (-1.0 / t_1); elseif (B <= 2.9e+247) tmp = t_0 * -sqrt((F * (B + C))); elseif (B <= 1.95e+292) tmp = sqrt(2.0) * -sqrt((F / B)); else tmp = t_0 * -sqrt((B * 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[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 2.5e+61], N[(N[Sqrt[N[(2.0 * N[(N[(F * t$95$1), $MachinePrecision] * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.9e+247], N[(t$95$0 * (-N[Sqrt[N[(F * N[(B + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[B, 1.95e+292], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(t$95$0 * (-N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \frac{\sqrt{2}}{B}\\
t_1 := B \cdot B + -4 \cdot \left(C \cdot A\right)\\
\mathbf{if}\;B \leq 2.5 \cdot 10^{+61}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(F \cdot t_1\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)} \cdot \frac{-1}{t_1}\\
\mathbf{elif}\;B \leq 2.9 \cdot 10^{+247}:\\
\;\;\;\;t_0 \cdot \left(-\sqrt{F \cdot \left(B + C\right)}\right)\\
\mathbf{elif}\;B \leq 1.95 \cdot 10^{+292}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(-\sqrt{B \cdot F}\right)\\
\end{array}
\end{array}
if B < 2.50000000000000009e61Initial program 29.9%
Simplified29.9%
div-inv29.9%
Applied egg-rr33.4%
if 2.50000000000000009e61 < B < 2.9000000000000002e247Initial program 6.5%
Simplified6.5%
Taylor expanded in A around 0 16.1%
mul-1-neg16.1%
distribute-rgt-neg-in16.1%
+-commutative16.1%
unpow216.1%
unpow216.1%
hypot-def55.0%
Simplified55.0%
Taylor expanded in C around 0 48.4%
distribute-rgt-out48.5%
Simplified48.5%
if 2.9000000000000002e247 < B < 1.95e292Initial program 0.0%
Simplified0.0%
Taylor expanded in A around 0 0.0%
+-commutative0.0%
unpow20.0%
unpow20.0%
hypot-def0.0%
Simplified0.0%
Taylor expanded in C around 0 68.6%
mul-1-neg68.6%
Simplified68.6%
if 1.95e292 < B Initial program 0.0%
Simplified0.0%
Taylor expanded in A around 0 2.0%
mul-1-neg2.0%
distribute-rgt-neg-in2.0%
+-commutative2.0%
unpow22.0%
unpow22.0%
hypot-def99.2%
Simplified99.2%
Taylor expanded in C around 0 99.2%
Final simplification37.5%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* (* C A) 4.0)))
(t_1 (* (sqrt 2.0) (- (sqrt (/ F B)))))
(t_2 (* F t_0))
(t_3 (* 2.0 t_2)))
(if (<= A -1.3e+92)
(/ (- (sqrt (* t_3 (* 2.0 C)))) t_0)
(if (<= A -7.2e-85)
t_1
(if (<= A -9.2e-199)
(/ (- (pow (* 2.0 (* (* 2.0 C) t_2)) 0.5)) t_0)
(if (<= A 1.05e-130) t_1 (/ (- (sqrt (* t_3 (* 2.0 A)))) t_0)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - ((C * A) * 4.0);
double t_1 = sqrt(2.0) * -sqrt((F / B));
double t_2 = F * t_0;
double t_3 = 2.0 * t_2;
double tmp;
if (A <= -1.3e+92) {
tmp = -sqrt((t_3 * (2.0 * C))) / t_0;
} else if (A <= -7.2e-85) {
tmp = t_1;
} else if (A <= -9.2e-199) {
tmp = -pow((2.0 * ((2.0 * C) * t_2)), 0.5) / t_0;
} else if (A <= 1.05e-130) {
tmp = t_1;
} else {
tmp = -sqrt((t_3 * (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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (b * b) - ((c * a) * 4.0d0)
t_1 = sqrt(2.0d0) * -sqrt((f / b))
t_2 = f * t_0
t_3 = 2.0d0 * t_2
if (a <= (-1.3d+92)) then
tmp = -sqrt((t_3 * (2.0d0 * c))) / t_0
else if (a <= (-7.2d-85)) then
tmp = t_1
else if (a <= (-9.2d-199)) then
tmp = -((2.0d0 * ((2.0d0 * c) * t_2)) ** 0.5d0) / t_0
else if (a <= 1.05d-130) then
tmp = t_1
else
tmp = -sqrt((t_3 * (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) - ((C * A) * 4.0);
double t_1 = Math.sqrt(2.0) * -Math.sqrt((F / B));
double t_2 = F * t_0;
double t_3 = 2.0 * t_2;
double tmp;
if (A <= -1.3e+92) {
tmp = -Math.sqrt((t_3 * (2.0 * C))) / t_0;
} else if (A <= -7.2e-85) {
tmp = t_1;
} else if (A <= -9.2e-199) {
tmp = -Math.pow((2.0 * ((2.0 * C) * t_2)), 0.5) / t_0;
} else if (A <= 1.05e-130) {
tmp = t_1;
} else {
tmp = -Math.sqrt((t_3 * (2.0 * A))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - ((C * A) * 4.0) t_1 = math.sqrt(2.0) * -math.sqrt((F / B)) t_2 = F * t_0 t_3 = 2.0 * t_2 tmp = 0 if A <= -1.3e+92: tmp = -math.sqrt((t_3 * (2.0 * C))) / t_0 elif A <= -7.2e-85: tmp = t_1 elif A <= -9.2e-199: tmp = -math.pow((2.0 * ((2.0 * C) * t_2)), 0.5) / t_0 elif A <= 1.05e-130: tmp = t_1 else: tmp = -math.sqrt((t_3 * (2.0 * A))) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(Float64(C * A) * 4.0)) t_1 = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))) t_2 = Float64(F * t_0) t_3 = Float64(2.0 * t_2) tmp = 0.0 if (A <= -1.3e+92) tmp = Float64(Float64(-sqrt(Float64(t_3 * Float64(2.0 * C)))) / t_0); elseif (A <= -7.2e-85) tmp = t_1; elseif (A <= -9.2e-199) tmp = Float64(Float64(-(Float64(2.0 * Float64(Float64(2.0 * C) * t_2)) ^ 0.5)) / t_0); elseif (A <= 1.05e-130) tmp = t_1; else tmp = Float64(Float64(-sqrt(Float64(t_3 * 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) - ((C * A) * 4.0); t_1 = sqrt(2.0) * -sqrt((F / B)); t_2 = F * t_0; t_3 = 2.0 * t_2; tmp = 0.0; if (A <= -1.3e+92) tmp = -sqrt((t_3 * (2.0 * C))) / t_0; elseif (A <= -7.2e-85) tmp = t_1; elseif (A <= -9.2e-199) tmp = -((2.0 * ((2.0 * C) * t_2)) ^ 0.5) / t_0; elseif (A <= 1.05e-130) tmp = t_1; else tmp = -sqrt((t_3 * (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[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]}, Block[{t$95$2 = N[(F * t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * t$95$2), $MachinePrecision]}, If[LessEqual[A, -1.3e+92], N[((-N[Sqrt[N[(t$95$3 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, -7.2e-85], t$95$1, If[LessEqual[A, -9.2e-199], N[((-N[Power[N[(2.0 * N[(N[(2.0 * C), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, 1.05e-130], t$95$1, N[((-N[Sqrt[N[(t$95$3 * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - \left(C \cdot A\right) \cdot 4\\
t_1 := \sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
t_2 := F \cdot t_0\\
t_3 := 2 \cdot t_2\\
\mathbf{if}\;A \leq -1.3 \cdot 10^{+92}:\\
\;\;\;\;\frac{-\sqrt{t_3 \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{elif}\;A \leq -7.2 \cdot 10^{-85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;A \leq -9.2 \cdot 10^{-199}:\\
\;\;\;\;\frac{-{\left(2 \cdot \left(\left(2 \cdot C\right) \cdot t_2\right)\right)}^{0.5}}{t_0}\\
\mathbf{elif}\;A \leq 1.05 \cdot 10^{-130}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{t_3 \cdot \left(2 \cdot A\right)}}{t_0}\\
\end{array}
\end{array}
if A < -1.2999999999999999e92Initial program 1.2%
Simplified1.2%
Taylor expanded in A around -inf 37.7%
*-commutative37.7%
Simplified37.7%
if -1.2999999999999999e92 < A < -7.1999999999999996e-85 or -9.2000000000000005e-199 < A < 1.05000000000000001e-130Initial program 29.0%
Simplified29.0%
Taylor expanded in A around 0 27.8%
+-commutative27.8%
unpow227.8%
unpow227.8%
hypot-def29.9%
Simplified29.9%
Taylor expanded in C around 0 19.0%
mul-1-neg19.0%
Simplified19.0%
if -7.1999999999999996e-85 < A < -9.2000000000000005e-199Initial program 41.0%
Simplified41.0%
Taylor expanded in A around -inf 36.4%
*-commutative36.4%
Simplified36.4%
pow1/236.7%
associate-*l*36.7%
*-commutative36.7%
*-commutative36.7%
*-commutative36.7%
Applied egg-rr36.7%
if 1.05000000000000001e-130 < A Initial program 30.5%
Simplified30.5%
Taylor expanded in A around inf 28.8%
associate-+r+33.1%
distribute-rgt1-in33.1%
metadata-eval33.1%
mul0-lft33.1%
Simplified33.1%
Final simplification29.1%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* (* C A) 4.0))) (t_1 (* 2.0 (* F t_0))))
(if (<= A -3.1e+90)
(/ (- (sqrt (* t_1 (* 2.0 C)))) t_0)
(if (<= A 6.5e-20)
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ B C)))))
(/ (- (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) - ((C * A) * 4.0);
double t_1 = 2.0 * (F * t_0);
double tmp;
if (A <= -3.1e+90) {
tmp = -sqrt((t_1 * (2.0 * C))) / t_0;
} else if (A <= 6.5e-20) {
tmp = (sqrt(2.0) / B) * -sqrt((F * (B + C)));
} 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) - ((c * a) * 4.0d0)
t_1 = 2.0d0 * (f * t_0)
if (a <= (-3.1d+90)) then
tmp = -sqrt((t_1 * (2.0d0 * c))) / t_0
else if (a <= 6.5d-20) then
tmp = (sqrt(2.0d0) / b) * -sqrt((f * (b + c)))
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) - ((C * A) * 4.0);
double t_1 = 2.0 * (F * t_0);
double tmp;
if (A <= -3.1e+90) {
tmp = -Math.sqrt((t_1 * (2.0 * C))) / t_0;
} else if (A <= 6.5e-20) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (B + C)));
} 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) - ((C * A) * 4.0) t_1 = 2.0 * (F * t_0) tmp = 0 if A <= -3.1e+90: tmp = -math.sqrt((t_1 * (2.0 * C))) / t_0 elif A <= 6.5e-20: tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (B + C))) 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(Float64(C * A) * 4.0)) t_1 = Float64(2.0 * Float64(F * t_0)) tmp = 0.0 if (A <= -3.1e+90) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * C)))) / t_0); elseif (A <= 6.5e-20) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(B + C))))); 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) - ((C * A) * 4.0); t_1 = 2.0 * (F * t_0); tmp = 0.0; if (A <= -3.1e+90) tmp = -sqrt((t_1 * (2.0 * C))) / t_0; elseif (A <= 6.5e-20) tmp = (sqrt(2.0) / B) * -sqrt((F * (B + C))); 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[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -3.1e+90], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, 6.5e-20], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(B + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $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 - \left(C \cdot A\right) \cdot 4\\
t_1 := 2 \cdot \left(F \cdot t_0\right)\\
\mathbf{if}\;A \leq -3.1 \cdot 10^{+90}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{elif}\;A \leq 6.5 \cdot 10^{-20}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(B + C\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(2 \cdot A\right)}}{t_0}\\
\end{array}
\end{array}
if A < -3.09999999999999988e90Initial program 1.2%
Simplified1.2%
Taylor expanded in A around -inf 37.7%
*-commutative37.7%
Simplified37.7%
if -3.09999999999999988e90 < A < 6.50000000000000032e-20Initial program 31.5%
Simplified31.5%
Taylor expanded in A around 0 13.7%
mul-1-neg13.7%
distribute-rgt-neg-in13.7%
+-commutative13.7%
unpow213.7%
unpow213.7%
hypot-def24.6%
Simplified24.6%
Taylor expanded in C around 0 20.3%
distribute-rgt-out20.3%
Simplified20.3%
if 6.50000000000000032e-20 < A Initial program 29.7%
Simplified29.7%
Taylor expanded in A around inf 32.3%
associate-+r+34.8%
distribute-rgt1-in34.8%
metadata-eval34.8%
mul0-lft34.8%
Simplified34.8%
Final simplification28.1%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* (* C A) 4.0))) (t_1 (* 2.0 (* F t_0))))
(if (<= A -3.15e+91)
(/ (- (sqrt (* t_1 (* 2.0 C)))) t_0)
(if (<= A 1.25e-20)
(* (/ (sqrt 2.0) B) (- (sqrt (* B F))))
(/ (- (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) - ((C * A) * 4.0);
double t_1 = 2.0 * (F * t_0);
double tmp;
if (A <= -3.15e+91) {
tmp = -sqrt((t_1 * (2.0 * C))) / t_0;
} else if (A <= 1.25e-20) {
tmp = (sqrt(2.0) / B) * -sqrt((B * F));
} 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) - ((c * a) * 4.0d0)
t_1 = 2.0d0 * (f * t_0)
if (a <= (-3.15d+91)) then
tmp = -sqrt((t_1 * (2.0d0 * c))) / t_0
else if (a <= 1.25d-20) then
tmp = (sqrt(2.0d0) / b) * -sqrt((b * f))
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) - ((C * A) * 4.0);
double t_1 = 2.0 * (F * t_0);
double tmp;
if (A <= -3.15e+91) {
tmp = -Math.sqrt((t_1 * (2.0 * C))) / t_0;
} else if (A <= 1.25e-20) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((B * F));
} 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) - ((C * A) * 4.0) t_1 = 2.0 * (F * t_0) tmp = 0 if A <= -3.15e+91: tmp = -math.sqrt((t_1 * (2.0 * C))) / t_0 elif A <= 1.25e-20: tmp = (math.sqrt(2.0) / B) * -math.sqrt((B * F)) 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(Float64(C * A) * 4.0)) t_1 = Float64(2.0 * Float64(F * t_0)) tmp = 0.0 if (A <= -3.15e+91) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * C)))) / t_0); elseif (A <= 1.25e-20) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(B * F)))); 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) - ((C * A) * 4.0); t_1 = 2.0 * (F * t_0); tmp = 0.0; if (A <= -3.15e+91) tmp = -sqrt((t_1 * (2.0 * C))) / t_0; elseif (A <= 1.25e-20) tmp = (sqrt(2.0) / B) * -sqrt((B * F)); 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[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -3.15e+91], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, 1.25e-20], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision])), $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 - \left(C \cdot A\right) \cdot 4\\
t_1 := 2 \cdot \left(F \cdot t_0\right)\\
\mathbf{if}\;A \leq -3.15 \cdot 10^{+91}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{elif}\;A \leq 1.25 \cdot 10^{-20}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(2 \cdot A\right)}}{t_0}\\
\end{array}
\end{array}
if A < -3.15e91Initial program 1.2%
Simplified1.2%
Taylor expanded in A around -inf 37.7%
*-commutative37.7%
Simplified37.7%
if -3.15e91 < A < 1.25e-20Initial program 31.5%
Simplified31.5%
Taylor expanded in A around 0 13.7%
mul-1-neg13.7%
distribute-rgt-neg-in13.7%
+-commutative13.7%
unpow213.7%
unpow213.7%
hypot-def24.6%
Simplified24.6%
Taylor expanded in C around 0 20.7%
if 1.25e-20 < A Initial program 29.7%
Simplified29.7%
Taylor expanded in A around inf 32.3%
associate-+r+34.8%
distribute-rgt1-in34.8%
metadata-eval34.8%
mul0-lft34.8%
Simplified34.8%
Final simplification28.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* (* C A) 4.0))) (t_1 (* F t_0)) (t_2 (* 2.0 t_1)))
(if (<= A -1.02e+30)
(/ (- (sqrt (* t_2 (* 2.0 C)))) t_0)
(if (<= A -2.05e-92)
(/ (- (sqrt (* t_2 (+ A (+ B C))))) t_0)
(if (<= A 1.2e-155)
(/ (- (pow (* 2.0 (* (* 2.0 C) t_1)) 0.5)) t_0)
(/ (- (sqrt (* t_2 (* 2.0 A)))) t_0))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - ((C * A) * 4.0);
double t_1 = F * t_0;
double t_2 = 2.0 * t_1;
double tmp;
if (A <= -1.02e+30) {
tmp = -sqrt((t_2 * (2.0 * C))) / t_0;
} else if (A <= -2.05e-92) {
tmp = -sqrt((t_2 * (A + (B + C)))) / t_0;
} else if (A <= 1.2e-155) {
tmp = -pow((2.0 * ((2.0 * C) * t_1)), 0.5) / t_0;
} else {
tmp = -sqrt((t_2 * (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) :: t_2
real(8) :: tmp
t_0 = (b * b) - ((c * a) * 4.0d0)
t_1 = f * t_0
t_2 = 2.0d0 * t_1
if (a <= (-1.02d+30)) then
tmp = -sqrt((t_2 * (2.0d0 * c))) / t_0
else if (a <= (-2.05d-92)) then
tmp = -sqrt((t_2 * (a + (b + c)))) / t_0
else if (a <= 1.2d-155) then
tmp = -((2.0d0 * ((2.0d0 * c) * t_1)) ** 0.5d0) / t_0
else
tmp = -sqrt((t_2 * (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) - ((C * A) * 4.0);
double t_1 = F * t_0;
double t_2 = 2.0 * t_1;
double tmp;
if (A <= -1.02e+30) {
tmp = -Math.sqrt((t_2 * (2.0 * C))) / t_0;
} else if (A <= -2.05e-92) {
tmp = -Math.sqrt((t_2 * (A + (B + C)))) / t_0;
} else if (A <= 1.2e-155) {
tmp = -Math.pow((2.0 * ((2.0 * C) * t_1)), 0.5) / t_0;
} else {
tmp = -Math.sqrt((t_2 * (2.0 * A))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - ((C * A) * 4.0) t_1 = F * t_0 t_2 = 2.0 * t_1 tmp = 0 if A <= -1.02e+30: tmp = -math.sqrt((t_2 * (2.0 * C))) / t_0 elif A <= -2.05e-92: tmp = -math.sqrt((t_2 * (A + (B + C)))) / t_0 elif A <= 1.2e-155: tmp = -math.pow((2.0 * ((2.0 * C) * t_1)), 0.5) / t_0 else: tmp = -math.sqrt((t_2 * (2.0 * A))) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(Float64(C * A) * 4.0)) t_1 = Float64(F * t_0) t_2 = Float64(2.0 * t_1) tmp = 0.0 if (A <= -1.02e+30) tmp = Float64(Float64(-sqrt(Float64(t_2 * Float64(2.0 * C)))) / t_0); elseif (A <= -2.05e-92) tmp = Float64(Float64(-sqrt(Float64(t_2 * Float64(A + Float64(B + C))))) / t_0); elseif (A <= 1.2e-155) tmp = Float64(Float64(-(Float64(2.0 * Float64(Float64(2.0 * C) * t_1)) ^ 0.5)) / t_0); else tmp = Float64(Float64(-sqrt(Float64(t_2 * 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) - ((C * A) * 4.0); t_1 = F * t_0; t_2 = 2.0 * t_1; tmp = 0.0; if (A <= -1.02e+30) tmp = -sqrt((t_2 * (2.0 * C))) / t_0; elseif (A <= -2.05e-92) tmp = -sqrt((t_2 * (A + (B + C)))) / t_0; elseif (A <= 1.2e-155) tmp = -((2.0 * ((2.0 * C) * t_1)) ^ 0.5) / t_0; else tmp = -sqrt((t_2 * (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[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * t$95$1), $MachinePrecision]}, If[LessEqual[A, -1.02e+30], N[((-N[Sqrt[N[(t$95$2 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, -2.05e-92], N[((-N[Sqrt[N[(t$95$2 * N[(A + N[(B + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, 1.2e-155], N[((-N[Power[N[(2.0 * N[(N[(2.0 * C), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(t$95$2 * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - \left(C \cdot A\right) \cdot 4\\
t_1 := F \cdot t_0\\
t_2 := 2 \cdot t_1\\
\mathbf{if}\;A \leq -1.02 \cdot 10^{+30}:\\
\;\;\;\;\frac{-\sqrt{t_2 \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{elif}\;A \leq -2.05 \cdot 10^{-92}:\\
\;\;\;\;\frac{-\sqrt{t_2 \cdot \left(A + \left(B + C\right)\right)}}{t_0}\\
\mathbf{elif}\;A \leq 1.2 \cdot 10^{-155}:\\
\;\;\;\;\frac{-{\left(2 \cdot \left(\left(2 \cdot C\right) \cdot t_1\right)\right)}^{0.5}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{t_2 \cdot \left(2 \cdot A\right)}}{t_0}\\
\end{array}
\end{array}
if A < -1.02e30Initial program 5.6%
Simplified5.6%
Taylor expanded in A around -inf 31.6%
*-commutative31.6%
Simplified31.6%
if -1.02e30 < A < -2.0500000000000001e-92Initial program 41.8%
Simplified41.8%
Taylor expanded in B around inf 18.6%
+-commutative18.6%
Simplified18.6%
if -2.0500000000000001e-92 < A < 1.2e-155Initial program 34.5%
Simplified34.5%
Taylor expanded in A around -inf 26.1%
*-commutative26.1%
Simplified26.1%
pow1/226.3%
associate-*l*26.3%
*-commutative26.3%
*-commutative26.3%
*-commutative26.3%
Applied egg-rr26.3%
if 1.2e-155 < A Initial program 29.3%
Simplified29.3%
Taylor expanded in A around inf 27.7%
associate-+r+31.8%
distribute-rgt1-in31.8%
metadata-eval31.8%
mul0-lft31.8%
Simplified31.8%
Final simplification29.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* (* C A) 4.0))))
(if (<= A 2.45e-37)
(/ (- (pow (* 2.0 (* (* 2.0 C) (* F t_0))) 0.5)) t_0)
(/ (* (sqrt (* F A)) (* B (- 2.0))) t_0))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - ((C * A) * 4.0);
double tmp;
if (A <= 2.45e-37) {
tmp = -pow((2.0 * ((2.0 * C) * (F * t_0))), 0.5) / t_0;
} else {
tmp = (sqrt((F * A)) * (B * -2.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) - ((c * a) * 4.0d0)
if (a <= 2.45d-37) then
tmp = -((2.0d0 * ((2.0d0 * c) * (f * t_0))) ** 0.5d0) / t_0
else
tmp = (sqrt((f * a)) * (b * -2.0d0)) / 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) - ((C * A) * 4.0);
double tmp;
if (A <= 2.45e-37) {
tmp = -Math.pow((2.0 * ((2.0 * C) * (F * t_0))), 0.5) / t_0;
} else {
tmp = (Math.sqrt((F * A)) * (B * -2.0)) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - ((C * A) * 4.0) tmp = 0 if A <= 2.45e-37: tmp = -math.pow((2.0 * ((2.0 * C) * (F * t_0))), 0.5) / t_0 else: tmp = (math.sqrt((F * A)) * (B * -2.0)) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(Float64(C * A) * 4.0)) tmp = 0.0 if (A <= 2.45e-37) tmp = Float64(Float64(-(Float64(2.0 * Float64(Float64(2.0 * C) * Float64(F * t_0))) ^ 0.5)) / t_0); else tmp = Float64(Float64(sqrt(Float64(F * A)) * Float64(B * Float64(-2.0))) / t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - ((C * A) * 4.0); tmp = 0.0; if (A <= 2.45e-37) tmp = -((2.0 * ((2.0 * C) * (F * t_0))) ^ 0.5) / t_0; else tmp = (sqrt((F * A)) * (B * -2.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[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, 2.45e-37], N[((-N[Power[N[(2.0 * N[(N[(2.0 * C), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(F * A), $MachinePrecision]], $MachinePrecision] * N[(B * (-2.0)), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - \left(C \cdot A\right) \cdot 4\\
\mathbf{if}\;A \leq 2.45 \cdot 10^{-37}:\\
\;\;\;\;\frac{-{\left(2 \cdot \left(\left(2 \cdot C\right) \cdot \left(F \cdot t_0\right)\right)\right)}^{0.5}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{F \cdot A} \cdot \left(B \cdot \left(-2\right)\right)}{t_0}\\
\end{array}
\end{array}
if A < 2.45000000000000009e-37Initial program 23.2%
Simplified23.2%
Taylor expanded in A around -inf 25.0%
*-commutative25.0%
Simplified25.0%
pow1/225.1%
associate-*l*25.1%
*-commutative25.1%
*-commutative25.1%
*-commutative25.1%
Applied egg-rr25.1%
if 2.45000000000000009e-37 < A Initial program 29.5%
Simplified29.5%
Taylor expanded in A around 0 3.1%
+-commutative3.1%
unpow23.1%
unpow23.1%
hypot-def3.2%
Simplified3.2%
Taylor expanded in C around -inf 8.2%
unpow28.2%
rem-square-sqrt8.3%
Simplified8.3%
Final simplification19.5%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* (* C A) 4.0))) (t_1 (* F t_0)))
(if (<= A 3.8e-156)
(/ (- (pow (* 2.0 (* (* 2.0 C) t_1)) 0.5)) t_0)
(/ (- (sqrt (* (* 2.0 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) - ((C * A) * 4.0);
double t_1 = F * t_0;
double tmp;
if (A <= 3.8e-156) {
tmp = -pow((2.0 * ((2.0 * C) * t_1)), 0.5) / t_0;
} else {
tmp = -sqrt(((2.0 * 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) - ((c * a) * 4.0d0)
t_1 = f * t_0
if (a <= 3.8d-156) then
tmp = -((2.0d0 * ((2.0d0 * c) * t_1)) ** 0.5d0) / t_0
else
tmp = -sqrt(((2.0d0 * 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) - ((C * A) * 4.0);
double t_1 = F * t_0;
double tmp;
if (A <= 3.8e-156) {
tmp = -Math.pow((2.0 * ((2.0 * C) * t_1)), 0.5) / t_0;
} else {
tmp = -Math.sqrt(((2.0 * t_1) * (2.0 * A))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - ((C * A) * 4.0) t_1 = F * t_0 tmp = 0 if A <= 3.8e-156: tmp = -math.pow((2.0 * ((2.0 * C) * t_1)), 0.5) / t_0 else: tmp = -math.sqrt(((2.0 * 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(Float64(C * A) * 4.0)) t_1 = Float64(F * t_0) tmp = 0.0 if (A <= 3.8e-156) tmp = Float64(Float64(-(Float64(2.0 * Float64(Float64(2.0 * C) * t_1)) ^ 0.5)) / t_0); else tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * 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) - ((C * A) * 4.0); t_1 = F * t_0; tmp = 0.0; if (A <= 3.8e-156) tmp = -((2.0 * ((2.0 * C) * t_1)) ^ 0.5) / t_0; else tmp = -sqrt(((2.0 * 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[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F * t$95$0), $MachinePrecision]}, If[LessEqual[A, 3.8e-156], N[((-N[Power[N[(2.0 * N[(N[(2.0 * C), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(N[(2.0 * t$95$1), $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 - \left(C \cdot A\right) \cdot 4\\
t_1 := F \cdot t_0\\
\mathbf{if}\;A \leq 3.8 \cdot 10^{-156}:\\
\;\;\;\;\frac{-{\left(2 \cdot \left(\left(2 \cdot C\right) \cdot t_1\right)\right)}^{0.5}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot t_1\right) \cdot \left(2 \cdot A\right)}}{t_0}\\
\end{array}
\end{array}
if A < 3.80000000000000008e-156Initial program 22.7%
Simplified22.7%
Taylor expanded in A around -inf 26.0%
*-commutative26.0%
Simplified26.0%
pow1/226.0%
associate-*l*26.0%
*-commutative26.0%
*-commutative26.0%
*-commutative26.0%
Applied egg-rr26.0%
if 3.80000000000000008e-156 < A Initial program 29.3%
Simplified29.3%
Taylor expanded in A around inf 27.7%
associate-+r+31.8%
distribute-rgt1-in31.8%
metadata-eval31.8%
mul0-lft31.8%
Simplified31.8%
Final simplification28.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* (* C A) 4.0))))
(if (<= A 1.52e-37)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (* 2.0 C)))) t_0)
(/ (* (sqrt (* F A)) (* B (- 2.0))) t_0))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - ((C * A) * 4.0);
double tmp;
if (A <= 1.52e-37) {
tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
} else {
tmp = (sqrt((F * A)) * (B * -2.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) - ((c * a) * 4.0d0)
if (a <= 1.52d-37) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * (2.0d0 * c))) / t_0
else
tmp = (sqrt((f * a)) * (b * -2.0d0)) / 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) - ((C * A) * 4.0);
double tmp;
if (A <= 1.52e-37) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
} else {
tmp = (Math.sqrt((F * A)) * (B * -2.0)) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - ((C * A) * 4.0) tmp = 0 if A <= 1.52e-37: tmp = -math.sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0 else: tmp = (math.sqrt((F * A)) * (B * -2.0)) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(Float64(C * A) * 4.0)) tmp = 0.0 if (A <= 1.52e-37) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(2.0 * C)))) / t_0); else tmp = Float64(Float64(sqrt(Float64(F * A)) * Float64(B * Float64(-2.0))) / t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - ((C * A) * 4.0); tmp = 0.0; if (A <= 1.52e-37) tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0; else tmp = (sqrt((F * A)) * (B * -2.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[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, 1.52e-37], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(F * A), $MachinePrecision]], $MachinePrecision] * N[(B * (-2.0)), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - \left(C \cdot A\right) \cdot 4\\
\mathbf{if}\;A \leq 1.52 \cdot 10^{-37}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{F \cdot A} \cdot \left(B \cdot \left(-2\right)\right)}{t_0}\\
\end{array}
\end{array}
if A < 1.52e-37Initial program 23.2%
Simplified23.2%
Taylor expanded in A around -inf 25.0%
*-commutative25.0%
Simplified25.0%
if 1.52e-37 < A Initial program 29.5%
Simplified29.5%
Taylor expanded in A around 0 3.1%
+-commutative3.1%
unpow23.1%
unpow23.1%
hypot-def3.2%
Simplified3.2%
Taylor expanded in C around -inf 8.2%
unpow28.2%
rem-square-sqrt8.3%
Simplified8.3%
Final simplification19.5%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= C 9.6e+83) (/ (- (sqrt (* -16.0 (* A (* F (* C C)))))) (- (* B B) (* (* C A) 4.0))) (* (sqrt (* F C)) (/ -2.0 B))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (C <= 9.6e+83) {
tmp = -sqrt((-16.0 * (A * (F * (C * C))))) / ((B * B) - ((C * A) * 4.0));
} else {
tmp = sqrt((F * C)) * (-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 (c <= 9.6d+83) then
tmp = -sqrt(((-16.0d0) * (a * (f * (c * c))))) / ((b * b) - ((c * a) * 4.0d0))
else
tmp = sqrt((f * c)) * ((-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 (C <= 9.6e+83) {
tmp = -Math.sqrt((-16.0 * (A * (F * (C * C))))) / ((B * B) - ((C * A) * 4.0));
} else {
tmp = Math.sqrt((F * C)) * (-2.0 / B);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if C <= 9.6e+83: tmp = -math.sqrt((-16.0 * (A * (F * (C * C))))) / ((B * B) - ((C * A) * 4.0)) else: tmp = math.sqrt((F * C)) * (-2.0 / B) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (C <= 9.6e+83) tmp = Float64(Float64(-sqrt(Float64(-16.0 * Float64(A * Float64(F * Float64(C * C)))))) / Float64(Float64(B * B) - Float64(Float64(C * A) * 4.0))); else tmp = Float64(sqrt(Float64(F * C)) * Float64(-2.0 / B)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (C <= 9.6e+83) tmp = -sqrt((-16.0 * (A * (F * (C * C))))) / ((B * B) - ((C * A) * 4.0)); else tmp = sqrt((F * C)) * (-2.0 / B); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[C, 9.6e+83], N[((-N[Sqrt[N[(-16.0 * N[(A * N[(F * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] * N[(-2.0 / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq 9.6 \cdot 10^{+83}:\\
\;\;\;\;\frac{-\sqrt{-16 \cdot \left(A \cdot \left(F \cdot \left(C \cdot C\right)\right)\right)}}{B \cdot B - \left(C \cdot A\right) \cdot 4}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{F \cdot C} \cdot \frac{-2}{B}\\
\end{array}
\end{array}
if C < 9.59999999999999965e83Initial program 26.8%
Simplified26.8%
Taylor expanded in A around -inf 14.9%
*-commutative14.9%
Simplified14.9%
Taylor expanded in B around 0 12.3%
unpow212.3%
Simplified12.3%
if 9.59999999999999965e83 < C Initial program 18.3%
Simplified18.3%
Taylor expanded in A around 0 3.5%
mul-1-neg3.5%
distribute-rgt-neg-in3.5%
+-commutative3.5%
unpow23.5%
unpow23.5%
hypot-def16.2%
Simplified16.2%
sqrt-prod20.5%
Applied egg-rr20.5%
Taylor expanded in B around 0 10.2%
mul-1-neg10.2%
*-commutative10.2%
*-commutative10.2%
distribute-rgt-neg-in10.2%
*-commutative10.2%
mul-1-neg10.2%
unpow210.2%
rem-square-sqrt10.4%
associate-*r/10.4%
metadata-eval10.4%
Simplified10.4%
Final simplification12.0%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= A 4.9e-144) (* (sqrt (* F C)) (/ -2.0 B)) (/ (* (sqrt (* F A)) (* B (- 2.0))) (- (* B B) (* (* C A) 4.0)))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (A <= 4.9e-144) {
tmp = sqrt((F * C)) * (-2.0 / B);
} else {
tmp = (sqrt((F * A)) * (B * -2.0)) / ((B * B) - ((C * A) * 4.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) :: tmp
if (a <= 4.9d-144) then
tmp = sqrt((f * c)) * ((-2.0d0) / b)
else
tmp = (sqrt((f * a)) * (b * -2.0d0)) / ((b * b) - ((c * a) * 4.0d0))
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 <= 4.9e-144) {
tmp = Math.sqrt((F * C)) * (-2.0 / B);
} else {
tmp = (Math.sqrt((F * A)) * (B * -2.0)) / ((B * B) - ((C * A) * 4.0));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if A <= 4.9e-144: tmp = math.sqrt((F * C)) * (-2.0 / B) else: tmp = (math.sqrt((F * A)) * (B * -2.0)) / ((B * B) - ((C * A) * 4.0)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (A <= 4.9e-144) tmp = Float64(sqrt(Float64(F * C)) * Float64(-2.0 / B)); else tmp = Float64(Float64(sqrt(Float64(F * A)) * Float64(B * Float64(-2.0))) / Float64(Float64(B * B) - Float64(Float64(C * A) * 4.0))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (A <= 4.9e-144) tmp = sqrt((F * C)) * (-2.0 / B); else tmp = (sqrt((F * A)) * (B * -2.0)) / ((B * B) - ((C * A) * 4.0)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[A, 4.9e-144], N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] * N[(-2.0 / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(F * A), $MachinePrecision]], $MachinePrecision] * N[(B * (-2.0)), $MachinePrecision]), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq 4.9 \cdot 10^{-144}:\\
\;\;\;\;\sqrt{F \cdot C} \cdot \frac{-2}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{F \cdot A} \cdot \left(B \cdot \left(-2\right)\right)}{B \cdot B - \left(C \cdot A\right) \cdot 4}\\
\end{array}
\end{array}
if A < 4.9000000000000001e-144Initial program 22.5%
Simplified22.5%
Taylor expanded in A around 0 11.1%
mul-1-neg11.1%
distribute-rgt-neg-in11.1%
+-commutative11.1%
unpow211.1%
unpow211.1%
hypot-def21.2%
Simplified21.2%
sqrt-prod24.8%
Applied egg-rr24.8%
Taylor expanded in B around 0 5.3%
mul-1-neg5.3%
*-commutative5.3%
*-commutative5.3%
distribute-rgt-neg-in5.3%
*-commutative5.3%
mul-1-neg5.3%
unpow25.3%
rem-square-sqrt5.3%
associate-*r/5.3%
metadata-eval5.3%
Simplified5.3%
if 4.9000000000000001e-144 < A Initial program 29.8%
Simplified29.8%
Taylor expanded in A around 0 7.0%
+-commutative7.0%
unpow27.0%
unpow27.0%
hypot-def8.0%
Simplified8.0%
Taylor expanded in C around -inf 7.4%
unpow27.4%
rem-square-sqrt7.4%
Simplified7.4%
Final simplification6.1%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* (sqrt (* F C)) (/ -2.0 B)))
B = abs(B);
double code(double A, double B, double C, double F) {
return sqrt((F * C)) * (-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 = sqrt((f * c)) * ((-2.0d0) / b)
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return Math.sqrt((F * C)) * (-2.0 / B);
}
B = abs(B) def code(A, B, C, F): return math.sqrt((F * C)) * (-2.0 / B)
B = abs(B) function code(A, B, C, F) return Float64(sqrt(Float64(F * C)) * Float64(-2.0 / B)) end
B = abs(B) function tmp = code(A, B, C, F) tmp = sqrt((F * C)) * (-2.0 / B); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision] * N[(-2.0 / B), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\sqrt{F \cdot C} \cdot \frac{-2}{B}
\end{array}
Initial program 25.3%
Simplified25.3%
Taylor expanded in A around 0 8.0%
mul-1-neg8.0%
distribute-rgt-neg-in8.0%
+-commutative8.0%
unpow28.0%
unpow28.0%
hypot-def16.2%
Simplified16.2%
sqrt-prod19.6%
Applied egg-rr19.6%
Taylor expanded in B around 0 3.6%
mul-1-neg3.6%
*-commutative3.6%
*-commutative3.6%
distribute-rgt-neg-in3.6%
*-commutative3.6%
mul-1-neg3.6%
unpow23.6%
rem-square-sqrt3.6%
associate-*r/3.6%
metadata-eval3.6%
Simplified3.6%
Final simplification3.6%
herbie shell --seed 2023293
(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))))