
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) + sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) + sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0}
\end{array}
\end{array}
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (* A (* C -4.0)))
(t_1
(/
(*
(sqrt (* 2.0 (+ (* (* B B) F) (* F t_0))))
(- (sqrt (+ C (+ A (hypot B (- A C)))))))
(fma B B t_0))))
(if (<= B 1.15e-261)
t_1
(if (<= B 3e-249)
(*
-0.5
(* (sqrt (/ F (/ C (fma 0.5 (* (/ B C) (/ B C)) -2.0)))) (sqrt 2.0)))
(if (<= B 8.6e+92)
t_1
(*
(* (sqrt F) (sqrt (+ C (hypot C B))))
(- (pow (/ B (sqrt 2.0)) -1.0))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = A * (C * -4.0);
double t_1 = (sqrt((2.0 * (((B * B) * F) + (F * t_0)))) * -sqrt((C + (A + hypot(B, (A - C)))))) / fma(B, B, t_0);
double tmp;
if (B <= 1.15e-261) {
tmp = t_1;
} else if (B <= 3e-249) {
tmp = -0.5 * (sqrt((F / (C / fma(0.5, ((B / C) * (B / C)), -2.0)))) * sqrt(2.0));
} else if (B <= 8.6e+92) {
tmp = t_1;
} else {
tmp = (sqrt(F) * sqrt((C + hypot(C, B)))) * -pow((B / sqrt(2.0)), -1.0);
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = Float64(A * Float64(C * -4.0)) t_1 = Float64(Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B * B) * F) + Float64(F * t_0)))) * Float64(-sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / fma(B, B, t_0)) tmp = 0.0 if (B <= 1.15e-261) tmp = t_1; elseif (B <= 3e-249) tmp = Float64(-0.5 * Float64(sqrt(Float64(F / Float64(C / fma(0.5, Float64(Float64(B / C) * Float64(B / C)), -2.0)))) * sqrt(2.0))); elseif (B <= 8.6e+92) tmp = t_1; else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(C + hypot(C, B)))) * Float64(-(Float64(B / sqrt(2.0)) ^ -1.0))); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sqrt[N[(2.0 * N[(N[(N[(B * B), $MachinePrecision] * F), $MachinePrecision] + N[(F * t$95$0), $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 + t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 1.15e-261], t$95$1, If[LessEqual[B, 3e-249], N[(-0.5 * N[(N[Sqrt[N[(F / N[(C / N[(0.5 * N[(N[(B / C), $MachinePrecision] * N[(B / C), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 8.6e+92], t$95$1, N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * (-N[Power[N[(B / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision])), $MachinePrecision]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := A \cdot \left(C \cdot -4\right)\\
t_1 := \frac{\sqrt{2 \cdot \left(\left(B \cdot B\right) \cdot F + F \cdot t_0\right)} \cdot \left(-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{\mathsf{fma}\left(B, B, t_0\right)}\\
\mathbf{if}\;B \leq 1.15 \cdot 10^{-261}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;B \leq 3 \cdot 10^{-249}:\\
\;\;\;\;-0.5 \cdot \left(\sqrt{\frac{F}{\frac{C}{\mathsf{fma}\left(0.5, \frac{B}{C} \cdot \frac{B}{C}, -2\right)}}} \cdot \sqrt{2}\right)\\
\mathbf{elif}\;B \leq 8.6 \cdot 10^{+92}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(C, B\right)}\right) \cdot \left(-{\left(\frac{B}{\sqrt{2}}\right)}^{-1}\right)\\
\end{array}
\end{array}
if B < 1.15e-261 or 3.00000000000000004e-249 < B < 8.5999999999999996e92Initial program 17.3%
Simplified23.0%
sqrt-prod31.7%
associate-+r+30.8%
+-commutative30.8%
associate-+r+31.3%
Applied egg-rr31.3%
associate-*r*31.3%
*-commutative31.3%
fma-def31.3%
*-commutative31.3%
fma-def31.3%
*-commutative31.3%
associate-*r*31.3%
associate-+r+30.8%
+-commutative30.8%
associate-+r+31.7%
Simplified31.7%
fma-udef31.7%
associate-*r*31.7%
*-commutative31.7%
distribute-rgt-in31.7%
*-commutative31.7%
associate-*r*31.7%
Applied egg-rr31.7%
if 1.15e-261 < B < 3.00000000000000004e-249Initial program 1.5%
Simplified1.5%
Taylor expanded in C around -inf 2.8%
associate-+r+2.8%
mul-1-neg2.8%
sub-neg2.8%
distribute-lft-out2.8%
associate-/l*2.8%
unpow22.8%
unpow22.8%
unpow22.8%
Simplified2.8%
Taylor expanded in A around -inf 52.1%
associate-/l*52.1%
fma-neg52.1%
unpow252.1%
unpow252.1%
times-frac52.1%
metadata-eval52.1%
Simplified52.1%
if 8.5999999999999996e92 < B Initial program 6.0%
Simplified6.0%
Taylor expanded in A around 0 18.0%
mul-1-neg18.0%
distribute-rgt-neg-in18.0%
+-commutative18.0%
unpow218.0%
unpow218.0%
hypot-def44.5%
Simplified44.5%
sqrt-prod75.7%
Applied egg-rr75.7%
clear-num76.0%
inv-pow76.0%
Applied egg-rr76.0%
Final simplification38.4%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (* A (* C -4.0))))
(if (<= (pow B 2.0) 1e+186)
(/
(*
(sqrt (* 2.0 (+ (* (* B B) F) (* F t_0))))
(- (sqrt (+ C (+ A (hypot B (- A C)))))))
(fma B B t_0))
(*
(/ (sqrt (/ 2.0 B)) (sqrt B))
(* (sqrt F) (- (sqrt (+ C (hypot C B)))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = A * (C * -4.0);
double tmp;
if (pow(B, 2.0) <= 1e+186) {
tmp = (sqrt((2.0 * (((B * B) * F) + (F * t_0)))) * -sqrt((C + (A + hypot(B, (A - C)))))) / fma(B, B, t_0);
} else {
tmp = (sqrt((2.0 / B)) / sqrt(B)) * (sqrt(F) * -sqrt((C + hypot(C, B))));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = Float64(A * Float64(C * -4.0)) tmp = 0.0 if ((B ^ 2.0) <= 1e+186) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B * B) * F) + Float64(F * t_0)))) * Float64(-sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / fma(B, B, t_0)); else tmp = Float64(Float64(sqrt(Float64(2.0 / B)) / sqrt(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_] := Block[{t$95$0 = N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+186], N[(N[(N[Sqrt[N[(2.0 * N[(N[(N[(B * B), $MachinePrecision] * F), $MachinePrecision] + N[(F * t$95$0), $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 + t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(2.0 / B), $MachinePrecision]], $MachinePrecision] / N[Sqrt[B], $MachinePrecision]), $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}
t_0 := A \cdot \left(C \cdot -4\right)\\
\mathbf{if}\;{B}^{2} \leq 10^{+186}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B \cdot B\right) \cdot F + F \cdot t_0\right)} \cdot \left(-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{\mathsf{fma}\left(B, B, t_0\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\frac{2}{B}}}{\sqrt{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) < 9.9999999999999998e185Initial program 20.2%
Simplified27.3%
sqrt-prod37.0%
associate-+r+35.9%
+-commutative35.9%
associate-+r+36.6%
Applied egg-rr36.6%
associate-*r*36.6%
*-commutative36.6%
fma-def36.6%
*-commutative36.6%
fma-def36.6%
*-commutative36.6%
associate-*r*36.6%
associate-+r+35.9%
+-commutative35.9%
associate-+r+37.0%
Simplified37.0%
fma-udef37.0%
associate-*r*37.0%
*-commutative37.0%
distribute-rgt-in37.0%
*-commutative37.0%
associate-*r*37.0%
Applied egg-rr37.0%
if 9.9999999999999998e185 < (pow.f64 B 2) Initial program 5.5%
Simplified5.5%
Taylor expanded in A around 0 8.6%
mul-1-neg8.6%
distribute-rgt-neg-in8.6%
+-commutative8.6%
unpow28.6%
unpow28.6%
hypot-def21.3%
Simplified21.3%
sqrt-prod35.4%
Applied egg-rr35.4%
*-un-lft-identity35.4%
add-sqr-sqrt33.9%
times-frac33.8%
sqrt-div33.9%
Applied egg-rr33.9%
associate-*l/33.9%
*-lft-identity33.9%
Simplified33.9%
Final simplification36.0%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (* A (* C -4.0)))
(t_1
(/
(*
(sqrt (* 2.0 (+ (* (* B B) F) (* F t_0))))
(- (sqrt (+ C (+ A (hypot B (- A C)))))))
(fma B B t_0))))
(if (<= B 1.1e-261)
t_1
(if (<= B 4e-249)
(*
-0.5
(* (sqrt (/ F (/ C (fma 0.5 (* (/ B C) (/ B C)) -2.0)))) (sqrt 2.0)))
(if (<= B 1.55e+93)
t_1
(* (* (sqrt F) (sqrt (+ C (hypot C B)))) (/ (- (sqrt 2.0)) B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = A * (C * -4.0);
double t_1 = (sqrt((2.0 * (((B * B) * F) + (F * t_0)))) * -sqrt((C + (A + hypot(B, (A - C)))))) / fma(B, B, t_0);
double tmp;
if (B <= 1.1e-261) {
tmp = t_1;
} else if (B <= 4e-249) {
tmp = -0.5 * (sqrt((F / (C / fma(0.5, ((B / C) * (B / C)), -2.0)))) * sqrt(2.0));
} else if (B <= 1.55e+93) {
tmp = t_1;
} else {
tmp = (sqrt(F) * sqrt((C + hypot(C, B)))) * (-sqrt(2.0) / B);
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = Float64(A * Float64(C * -4.0)) t_1 = Float64(Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B * B) * F) + Float64(F * t_0)))) * Float64(-sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / fma(B, B, t_0)) tmp = 0.0 if (B <= 1.1e-261) tmp = t_1; elseif (B <= 4e-249) tmp = Float64(-0.5 * Float64(sqrt(Float64(F / Float64(C / fma(0.5, Float64(Float64(B / C) * Float64(B / C)), -2.0)))) * sqrt(2.0))); elseif (B <= 1.55e+93) tmp = t_1; else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(C + hypot(C, B)))) * Float64(Float64(-sqrt(2.0)) / B)); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sqrt[N[(2.0 * N[(N[(N[(B * B), $MachinePrecision] * F), $MachinePrecision] + N[(F * t$95$0), $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 + t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 1.1e-261], t$95$1, If[LessEqual[B, 4e-249], N[(-0.5 * N[(N[Sqrt[N[(F / N[(C / N[(0.5 * N[(N[(B / C), $MachinePrecision] * N[(B / C), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.55e+93], t$95$1, N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := A \cdot \left(C \cdot -4\right)\\
t_1 := \frac{\sqrt{2 \cdot \left(\left(B \cdot B\right) \cdot F + F \cdot t_0\right)} \cdot \left(-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{\mathsf{fma}\left(B, B, t_0\right)}\\
\mathbf{if}\;B \leq 1.1 \cdot 10^{-261}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;B \leq 4 \cdot 10^{-249}:\\
\;\;\;\;-0.5 \cdot \left(\sqrt{\frac{F}{\frac{C}{\mathsf{fma}\left(0.5, \frac{B}{C} \cdot \frac{B}{C}, -2\right)}}} \cdot \sqrt{2}\right)\\
\mathbf{elif}\;B \leq 1.55 \cdot 10^{+93}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(C, B\right)}\right) \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
\end{array}
if B < 1.1000000000000001e-261 or 4.00000000000000022e-249 < B < 1.5500000000000001e93Initial program 17.3%
Simplified23.0%
sqrt-prod31.7%
associate-+r+30.8%
+-commutative30.8%
associate-+r+31.3%
Applied egg-rr31.3%
associate-*r*31.3%
*-commutative31.3%
fma-def31.3%
*-commutative31.3%
fma-def31.3%
*-commutative31.3%
associate-*r*31.3%
associate-+r+30.8%
+-commutative30.8%
associate-+r+31.7%
Simplified31.7%
fma-udef31.7%
associate-*r*31.7%
*-commutative31.7%
distribute-rgt-in31.7%
*-commutative31.7%
associate-*r*31.7%
Applied egg-rr31.7%
if 1.1000000000000001e-261 < B < 4.00000000000000022e-249Initial program 1.5%
Simplified1.5%
Taylor expanded in C around -inf 2.8%
associate-+r+2.8%
mul-1-neg2.8%
sub-neg2.8%
distribute-lft-out2.8%
associate-/l*2.8%
unpow22.8%
unpow22.8%
unpow22.8%
Simplified2.8%
Taylor expanded in A around -inf 52.1%
associate-/l*52.1%
fma-neg52.1%
unpow252.1%
unpow252.1%
times-frac52.1%
metadata-eval52.1%
Simplified52.1%
if 1.5500000000000001e93 < B Initial program 6.0%
Simplified6.0%
Taylor expanded in A around 0 18.0%
mul-1-neg18.0%
distribute-rgt-neg-in18.0%
+-commutative18.0%
unpow218.0%
unpow218.0%
hypot-def44.5%
Simplified44.5%
sqrt-prod75.7%
Applied egg-rr75.7%
Final simplification38.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= B 3.1e+93)
(/
(*
(sqrt (* 2.0 (* F (+ (* B B) (* -4.0 (* A C))))))
(- (sqrt (+ A (+ C (hypot B (- A C)))))))
(- (* B B) (* (* A C) 4.0)))
(* (* (sqrt F) (sqrt (+ C (hypot C B)))) (/ (- (sqrt 2.0)) B))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (B <= 3.1e+93) {
tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
} else {
tmp = (sqrt(F) * sqrt((C + hypot(C, B)))) * (-sqrt(2.0) / B);
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (B <= 3.1e+93) {
tmp = (Math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -Math.sqrt((A + (C + Math.hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
} else {
tmp = (Math.sqrt(F) * Math.sqrt((C + Math.hypot(C, B)))) * (-Math.sqrt(2.0) / B);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if B <= 3.1e+93: tmp = (math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -math.sqrt((A + (C + math.hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0)) else: tmp = (math.sqrt(F) * math.sqrt((C + math.hypot(C, B)))) * (-math.sqrt(2.0) / B) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (B <= 3.1e+93) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))))) * Float64(-sqrt(Float64(A + Float64(C + hypot(B, Float64(A - C))))))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0))); else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(C + hypot(C, B)))) * Float64(Float64(-sqrt(2.0)) / B)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (B <= 3.1e+93) tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0)); else tmp = (sqrt(F) * sqrt((C + hypot(C, B)))) * (-sqrt(2.0) / B); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[B, 3.1e+93], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $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[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 3.1 \cdot 10^{+93}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(C, B\right)}\right) \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
\end{array}
if B < 3.10000000000000019e93Initial program 17.0%
Simplified17.0%
sqrt-prod20.1%
*-commutative20.1%
cancel-sign-sub-inv20.1%
metadata-eval20.1%
associate-+l+20.3%
unpow220.3%
hypot-udef30.8%
Applied egg-rr30.8%
if 3.10000000000000019e93 < B Initial program 6.0%
Simplified6.0%
Taylor expanded in A around 0 18.0%
mul-1-neg18.0%
distribute-rgt-neg-in18.0%
+-commutative18.0%
unpow218.0%
unpow218.0%
hypot-def44.5%
Simplified44.5%
sqrt-prod75.7%
Applied egg-rr75.7%
Final simplification37.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= B 9e+94)
(/
(*
(sqrt (* 2.0 (* F (+ (* B B) (* -4.0 (* A C))))))
(- (sqrt (+ A (+ C (hypot B (- A C)))))))
(- (* B B) (* (* A C) 4.0)))
(* (/ (sqrt 2.0) B) (- (* (sqrt F) (sqrt (+ B C)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (B <= 9e+94) {
tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
} else {
tmp = (sqrt(2.0) / B) * -(sqrt(F) * sqrt((B + C)));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (B <= 9e+94) {
tmp = (Math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -Math.sqrt((A + (C + Math.hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
} else {
tmp = (Math.sqrt(2.0) / B) * -(Math.sqrt(F) * Math.sqrt((B + C)));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if B <= 9e+94: tmp = (math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -math.sqrt((A + (C + math.hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0)) else: tmp = (math.sqrt(2.0) / B) * -(math.sqrt(F) * math.sqrt((B + C))) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (B <= 9e+94) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))))) * Float64(-sqrt(Float64(A + Float64(C + hypot(B, Float64(A - C))))))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0))); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-Float64(sqrt(F) * sqrt(Float64(B + C))))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (B <= 9e+94) tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0)); else tmp = (sqrt(2.0) / B) * -(sqrt(F) * sqrt((B + C))); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[B, 9e+94], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $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[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(B + C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 9 \cdot 10^{+94}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F} \cdot \sqrt{B + C}\right)\\
\end{array}
\end{array}
if B < 8.99999999999999944e94Initial program 17.0%
Simplified17.0%
sqrt-prod20.1%
*-commutative20.1%
cancel-sign-sub-inv20.1%
metadata-eval20.1%
associate-+l+20.3%
unpow220.3%
hypot-udef30.8%
Applied egg-rr30.8%
if 8.99999999999999944e94 < B Initial program 6.0%
Simplified6.0%
Taylor expanded in A around 0 18.0%
mul-1-neg18.0%
distribute-rgt-neg-in18.0%
+-commutative18.0%
unpow218.0%
unpow218.0%
hypot-def44.5%
Simplified44.5%
Taylor expanded in C around 0 44.0%
+-commutative44.0%
Simplified44.0%
*-commutative44.0%
sqrt-prod73.1%
+-commutative73.1%
Applied egg-rr73.1%
Final simplification36.9%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= F -1e-309)
(/
(*
(sqrt (* 2.0 (* F (fma B B (* A (* C -4.0))))))
(- (sqrt (+ C (+ A A)))))
(- (* B B) (* (* A C) 4.0)))
(if (<= F 4.6e-85)
(/ (- (sqrt (* F (* 2.0 (+ C (hypot B C)))))) B)
(* (/ (sqrt 2.0) B) (* (sqrt F) (- (sqrt B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= -1e-309) {
tmp = (sqrt((2.0 * (F * fma(B, B, (A * (C * -4.0)))))) * -sqrt((C + (A + A)))) / ((B * B) - ((A * C) * 4.0));
} else if (F <= 4.6e-85) {
tmp = -sqrt((F * (2.0 * (C + hypot(B, C))))) / B;
} else {
tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt(B));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= -1e-309) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * fma(B, B, Float64(A * Float64(C * -4.0)))))) * Float64(-sqrt(Float64(C + Float64(A + A))))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0))); elseif (F <= 4.6e-85) tmp = Float64(Float64(-sqrt(Float64(F * Float64(2.0 * Float64(C + hypot(B, C)))))) / B); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(F) * Float64(-sqrt(B)))); end return tmp end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[F, -1e-309], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C + N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.6e-85], N[((-N[Sqrt[N[(F * N[(2.0 * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)} \cdot \left(-\sqrt{C + \left(A + A\right)}\right)}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\
\mathbf{elif}\;F \leq 4.6 \cdot 10^{-85}:\\
\;\;\;\;\frac{-\sqrt{F \cdot \left(2 \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B}\right)\right)\\
\end{array}
\end{array}
if F < -1.000000000000002e-309Initial program 25.0%
Simplified25.0%
Taylor expanded in A around inf 31.2%
sqrt-prod43.9%
cancel-sign-sub-inv43.9%
metadata-eval43.9%
*-commutative43.9%
associate-*r*43.9%
fma-udef43.9%
*-commutative43.9%
+-commutative43.9%
Applied egg-rr43.9%
associate-+r+43.9%
Simplified43.9%
if -1.000000000000002e-309 < F < 4.6000000000000001e-85Initial program 19.8%
Simplified19.8%
Taylor expanded in A around 0 16.5%
mul-1-neg16.5%
distribute-rgt-neg-in16.5%
+-commutative16.5%
unpow216.5%
unpow216.5%
hypot-def27.5%
Simplified27.5%
sqrt-prod28.5%
Applied egg-rr28.5%
sqrt-prod27.5%
distribute-rgt-neg-in27.5%
neg-sub027.5%
add-sqr-sqrt26.4%
cancel-sign-sub-inv26.4%
associate-*l/26.4%
sqrt-unprod26.4%
Applied egg-rr26.4%
+-lft-identity26.4%
distribute-lft-neg-out26.4%
rem-square-sqrt27.7%
distribute-neg-frac27.7%
Simplified27.7%
if 4.6000000000000001e-85 < F Initial program 10.1%
Simplified10.1%
Taylor expanded in A around 0 7.8%
mul-1-neg7.8%
distribute-rgt-neg-in7.8%
+-commutative7.8%
unpow27.8%
unpow27.8%
hypot-def10.0%
Simplified10.0%
Taylor expanded in C around 0 9.2%
sqrt-prod17.1%
Applied egg-rr17.1%
Final simplification24.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
(if (<= F 2.6e-308)
(*
(sqrt (* 2.0 (* (* F t_0) (+ A (+ C (hypot B (- A C)))))))
(/ -1.0 t_0))
(if (<= F 3.1e-86)
(/ (- (sqrt (* F (* 2.0 (+ C (hypot B C)))))) B)
(* (/ (sqrt 2.0) B) (* (sqrt F) (- (sqrt B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double tmp;
if (F <= 2.6e-308) {
tmp = sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) * (-1.0 / t_0);
} else if (F <= 3.1e-86) {
tmp = -sqrt((F * (2.0 * (C + hypot(B, C))))) / B;
} else {
tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt(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 * (A * C));
double tmp;
if (F <= 2.6e-308) {
tmp = Math.sqrt((2.0 * ((F * t_0) * (A + (C + Math.hypot(B, (A - C))))))) * (-1.0 / t_0);
} else if (F <= 3.1e-86) {
tmp = -Math.sqrt((F * (2.0 * (C + Math.hypot(B, C))))) / B;
} else {
tmp = (Math.sqrt(2.0) / B) * (Math.sqrt(F) * -Math.sqrt(B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) tmp = 0 if F <= 2.6e-308: tmp = math.sqrt((2.0 * ((F * t_0) * (A + (C + math.hypot(B, (A - C))))))) * (-1.0 / t_0) elif F <= 3.1e-86: tmp = -math.sqrt((F * (2.0 * (C + math.hypot(B, C))))) / B else: tmp = (math.sqrt(2.0) / B) * (math.sqrt(F) * -math.sqrt(B)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) tmp = 0.0 if (F <= 2.6e-308) 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)); elseif (F <= 3.1e-86) tmp = Float64(Float64(-sqrt(Float64(F * Float64(2.0 * Float64(C + hypot(B, C)))))) / B); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(F) * Float64(-sqrt(B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); tmp = 0.0; if (F <= 2.6e-308) tmp = sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) * (-1.0 / t_0); elseif (F <= 3.1e-86) tmp = -sqrt((F * (2.0 * (C + hypot(B, C))))) / B; else tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt(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[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, 2.6e-308], 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], If[LessEqual[F, 3.1e-86], N[((-N[Sqrt[N[(F * N[(2.0 * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;F \leq 2.6 \cdot 10^{-308}:\\
\;\;\;\;\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{elif}\;F \leq 3.1 \cdot 10^{-86}:\\
\;\;\;\;\frac{-\sqrt{F \cdot \left(2 \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B}\right)\right)\\
\end{array}
\end{array}
if F < 2.6e-308Initial program 25.0%
Simplified25.0%
div-inv25.1%
Applied egg-rr41.6%
if 2.6e-308 < F < 3.09999999999999989e-86Initial program 19.8%
Simplified19.8%
Taylor expanded in A around 0 16.5%
mul-1-neg16.5%
distribute-rgt-neg-in16.5%
+-commutative16.5%
unpow216.5%
unpow216.5%
hypot-def27.5%
Simplified27.5%
sqrt-prod28.5%
Applied egg-rr28.5%
sqrt-prod27.5%
distribute-rgt-neg-in27.5%
neg-sub027.5%
add-sqr-sqrt26.4%
cancel-sign-sub-inv26.4%
associate-*l/26.4%
sqrt-unprod26.4%
Applied egg-rr26.4%
+-lft-identity26.4%
distribute-lft-neg-out26.4%
rem-square-sqrt27.7%
distribute-neg-frac27.7%
Simplified27.7%
if 3.09999999999999989e-86 < F Initial program 10.1%
Simplified10.1%
Taylor expanded in A around 0 7.8%
mul-1-neg7.8%
distribute-rgt-neg-in7.8%
+-commutative7.8%
unpow27.8%
unpow27.8%
hypot-def10.0%
Simplified10.0%
Taylor expanded in C around 0 9.2%
sqrt-prod17.1%
Applied egg-rr17.1%
Final simplification24.0%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
(if (<= F 1.8e-308)
(*
(sqrt (* 2.0 (* (* F t_0) (+ A (+ C (hypot B (- A C)))))))
(/ -1.0 t_0))
(if (<= F 3.5e-30)
(/ (- (sqrt (* F (* 2.0 (+ C (hypot B C)))))) B)
(* (sqrt 2.0) (- (sqrt (/ F B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double tmp;
if (F <= 1.8e-308) {
tmp = sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) * (-1.0 / t_0);
} else if (F <= 3.5e-30) {
tmp = -sqrt((F * (2.0 * (C + hypot(B, C))))) / B;
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double tmp;
if (F <= 1.8e-308) {
tmp = Math.sqrt((2.0 * ((F * t_0) * (A + (C + Math.hypot(B, (A - C))))))) * (-1.0 / t_0);
} else if (F <= 3.5e-30) {
tmp = -Math.sqrt((F * (2.0 * (C + Math.hypot(B, C))))) / B;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) tmp = 0 if F <= 1.8e-308: tmp = math.sqrt((2.0 * ((F * t_0) * (A + (C + math.hypot(B, (A - C))))))) * (-1.0 / t_0) elif F <= 3.5e-30: tmp = -math.sqrt((F * (2.0 * (C + math.hypot(B, C))))) / B else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) tmp = 0.0 if (F <= 1.8e-308) 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)); elseif (F <= 3.5e-30) tmp = Float64(Float64(-sqrt(Float64(F * Float64(2.0 * Float64(C + hypot(B, C)))))) / B); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); tmp = 0.0; if (F <= 1.8e-308) tmp = sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) * (-1.0 / t_0); elseif (F <= 3.5e-30) tmp = -sqrt((F * (2.0 * (C + hypot(B, C))))) / B; else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, 1.8e-308], 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], If[LessEqual[F, 3.5e-30], N[((-N[Sqrt[N[(F * N[(2.0 * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;F \leq 1.8 \cdot 10^{-308}:\\
\;\;\;\;\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{elif}\;F \leq 3.5 \cdot 10^{-30}:\\
\;\;\;\;\frac{-\sqrt{F \cdot \left(2 \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 1.7999999999999999e-308Initial program 25.0%
Simplified25.0%
div-inv25.1%
Applied egg-rr41.6%
if 1.7999999999999999e-308 < F < 3.5000000000000003e-30Initial program 19.1%
Simplified19.1%
Taylor expanded in A around 0 15.7%
mul-1-neg15.7%
distribute-rgt-neg-in15.7%
+-commutative15.7%
unpow215.7%
unpow215.7%
hypot-def25.7%
Simplified25.7%
sqrt-prod26.5%
Applied egg-rr26.5%
sqrt-prod25.7%
distribute-rgt-neg-in25.7%
neg-sub025.7%
add-sqr-sqrt24.7%
cancel-sign-sub-inv24.7%
associate-*l/24.7%
sqrt-unprod24.7%
Applied egg-rr24.7%
+-lft-identity24.7%
distribute-lft-neg-out24.7%
rem-square-sqrt25.9%
distribute-neg-frac25.9%
Simplified25.9%
if 3.5000000000000003e-30 < F Initial program 9.0%
Simplified9.0%
Taylor expanded in A around 0 7.0%
mul-1-neg7.0%
distribute-rgt-neg-in7.0%
+-commutative7.0%
unpow27.0%
unpow27.0%
hypot-def8.6%
Simplified8.6%
Taylor expanded in C around 0 16.1%
mul-1-neg16.1%
Simplified16.1%
Final simplification23.7%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
(if (<= F -1e-309)
(/ (- (sqrt (* 2.0 (* (* F t_0) (+ A (+ C (hypot B (- A C)))))))) t_0)
(if (<= F 3.5e-30)
(/ (- (sqrt (* F (* 2.0 (+ C (hypot B C)))))) B)
(* (sqrt 2.0) (- (sqrt (/ F B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double tmp;
if (F <= -1e-309) {
tmp = -sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) / t_0;
} else if (F <= 3.5e-30) {
tmp = -sqrt((F * (2.0 * (C + hypot(B, C))))) / B;
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double tmp;
if (F <= -1e-309) {
tmp = -Math.sqrt((2.0 * ((F * t_0) * (A + (C + Math.hypot(B, (A - C))))))) / t_0;
} else if (F <= 3.5e-30) {
tmp = -Math.sqrt((F * (2.0 * (C + Math.hypot(B, C))))) / B;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) tmp = 0 if F <= -1e-309: tmp = -math.sqrt((2.0 * ((F * t_0) * (A + (C + math.hypot(B, (A - C))))))) / t_0 elif F <= 3.5e-30: tmp = -math.sqrt((F * (2.0 * (C + math.hypot(B, C))))) / B else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) tmp = 0.0 if (F <= -1e-309) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(C + hypot(B, Float64(A - C)))))))) / t_0); elseif (F <= 3.5e-30) tmp = Float64(Float64(-sqrt(Float64(F * Float64(2.0 * Float64(C + hypot(B, C)))))) / B); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); tmp = 0.0; if (F <= -1e-309) tmp = -sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) / t_0; elseif (F <= 3.5e-30) tmp = -sqrt((F * (2.0 * (C + hypot(B, C))))) / B; else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e-309], 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]) / t$95$0), $MachinePrecision], If[LessEqual[F, 3.5e-30], N[((-N[Sqrt[N[(F * N[(2.0 * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;F \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{-\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)}}{t_0}\\
\mathbf{elif}\;F \leq 3.5 \cdot 10^{-30}:\\
\;\;\;\;\frac{-\sqrt{F \cdot \left(2 \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < -1.000000000000002e-309Initial program 25.0%
Simplified25.0%
distribute-frac-neg25.0%
Applied egg-rr41.6%
if -1.000000000000002e-309 < F < 3.5000000000000003e-30Initial program 19.1%
Simplified19.1%
Taylor expanded in A around 0 15.7%
mul-1-neg15.7%
distribute-rgt-neg-in15.7%
+-commutative15.7%
unpow215.7%
unpow215.7%
hypot-def25.7%
Simplified25.7%
sqrt-prod26.5%
Applied egg-rr26.5%
sqrt-prod25.7%
distribute-rgt-neg-in25.7%
neg-sub025.7%
add-sqr-sqrt24.7%
cancel-sign-sub-inv24.7%
associate-*l/24.7%
sqrt-unprod24.7%
Applied egg-rr24.7%
+-lft-identity24.7%
distribute-lft-neg-out24.7%
rem-square-sqrt25.9%
distribute-neg-frac25.9%
Simplified25.9%
if 3.5000000000000003e-30 < F Initial program 9.0%
Simplified9.0%
Taylor expanded in A around 0 7.0%
mul-1-neg7.0%
distribute-rgt-neg-in7.0%
+-commutative7.0%
unpow27.0%
unpow27.0%
hypot-def8.6%
Simplified8.6%
Taylor expanded in C around 0 16.1%
mul-1-neg16.1%
Simplified16.1%
Final simplification23.7%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* (* A C) 4.0))))
(if (<= F -1e-309)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ A (+ A C))))) t_0)
(if (<= F 3.5e-30)
(/ (- (sqrt (* F (* 2.0 (+ C (hypot B C)))))) B)
(* (sqrt 2.0) (- (sqrt (/ F B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - ((A * C) * 4.0);
double tmp;
if (F <= -1e-309) {
tmp = -sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0;
} else if (F <= 3.5e-30) {
tmp = -sqrt((F * (2.0 * (C + hypot(B, C))))) / B;
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - ((A * C) * 4.0);
double tmp;
if (F <= -1e-309) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0;
} else if (F <= 3.5e-30) {
tmp = -Math.sqrt((F * (2.0 * (C + Math.hypot(B, C))))) / B;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - ((A * C) * 4.0) tmp = 0 if F <= -1e-309: tmp = -math.sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0 elif F <= 3.5e-30: tmp = -math.sqrt((F * (2.0 * (C + math.hypot(B, C))))) / B else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0)) tmp = 0.0 if (F <= -1e-309) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(A + Float64(A + C))))) / t_0); elseif (F <= 3.5e-30) tmp = Float64(Float64(-sqrt(Float64(F * Float64(2.0 * Float64(C + hypot(B, C)))))) / B); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - ((A * C) * 4.0); tmp = 0.0; if (F <= -1e-309) tmp = -sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0; elseif (F <= 3.5e-30) tmp = -sqrt((F * (2.0 * (C + hypot(B, C))))) / B; else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e-309], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[F, 3.5e-30], N[((-N[Sqrt[N[(F * N[(2.0 * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - \left(A \cdot C\right) \cdot 4\\
\mathbf{if}\;F \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{t_0}\\
\mathbf{elif}\;F \leq 3.5 \cdot 10^{-30}:\\
\;\;\;\;\frac{-\sqrt{F \cdot \left(2 \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < -1.000000000000002e-309Initial program 25.0%
Simplified25.0%
Taylor expanded in A around inf 31.2%
if -1.000000000000002e-309 < F < 3.5000000000000003e-30Initial program 19.1%
Simplified19.1%
Taylor expanded in A around 0 15.7%
mul-1-neg15.7%
distribute-rgt-neg-in15.7%
+-commutative15.7%
unpow215.7%
unpow215.7%
hypot-def25.7%
Simplified25.7%
sqrt-prod26.5%
Applied egg-rr26.5%
sqrt-prod25.7%
distribute-rgt-neg-in25.7%
neg-sub025.7%
add-sqr-sqrt24.7%
cancel-sign-sub-inv24.7%
associate-*l/24.7%
sqrt-unprod24.7%
Applied egg-rr24.7%
+-lft-identity24.7%
distribute-lft-neg-out24.7%
rem-square-sqrt25.9%
distribute-neg-frac25.9%
Simplified25.9%
if 3.5000000000000003e-30 < F Initial program 9.0%
Simplified9.0%
Taylor expanded in A around 0 7.0%
mul-1-neg7.0%
distribute-rgt-neg-in7.0%
+-commutative7.0%
unpow27.0%
unpow27.0%
hypot-def8.6%
Simplified8.6%
Taylor expanded in C around 0 16.1%
mul-1-neg16.1%
Simplified16.1%
Final simplification22.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* (* A C) 4.0))))
(if (<= F -1e-309)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ A (+ A C))))) t_0)
(if (<= F 7.1e-31)
(* (sqrt (* B F)) (* (sqrt 2.0) (/ -1.0 B)))
(* (sqrt 2.0) (- (sqrt (/ F B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - ((A * C) * 4.0);
double tmp;
if (F <= -1e-309) {
tmp = -sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0;
} else if (F <= 7.1e-31) {
tmp = sqrt((B * F)) * (sqrt(2.0) * (-1.0 / B));
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (b * b) - ((a * c) * 4.0d0)
if (f <= (-1d-309)) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * (a + (a + c)))) / t_0
else if (f <= 7.1d-31) then
tmp = sqrt((b * f)) * (sqrt(2.0d0) * ((-1.0d0) / b))
else
tmp = sqrt(2.0d0) * -sqrt((f / b))
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - ((A * C) * 4.0);
double tmp;
if (F <= -1e-309) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0;
} else if (F <= 7.1e-31) {
tmp = Math.sqrt((B * F)) * (Math.sqrt(2.0) * (-1.0 / B));
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - ((A * C) * 4.0) tmp = 0 if F <= -1e-309: tmp = -math.sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0 elif F <= 7.1e-31: tmp = math.sqrt((B * F)) * (math.sqrt(2.0) * (-1.0 / B)) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0)) tmp = 0.0 if (F <= -1e-309) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(A + Float64(A + C))))) / t_0); elseif (F <= 7.1e-31) tmp = Float64(sqrt(Float64(B * F)) * Float64(sqrt(2.0) * Float64(-1.0 / B))); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - ((A * C) * 4.0); tmp = 0.0; if (F <= -1e-309) tmp = -sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0; elseif (F <= 7.1e-31) tmp = sqrt((B * F)) * (sqrt(2.0) * (-1.0 / B)); else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e-309], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[F, 7.1e-31], N[(N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - \left(A \cdot C\right) \cdot 4\\
\mathbf{if}\;F \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{t_0}\\
\mathbf{elif}\;F \leq 7.1 \cdot 10^{-31}:\\
\;\;\;\;\sqrt{B \cdot F} \cdot \left(\sqrt{2} \cdot \frac{-1}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < -1.000000000000002e-309Initial program 25.0%
Simplified25.0%
Taylor expanded in A around inf 31.2%
if -1.000000000000002e-309 < F < 7.0999999999999999e-31Initial program 19.1%
Simplified19.1%
Taylor expanded in A around 0 15.7%
mul-1-neg15.7%
distribute-rgt-neg-in15.7%
+-commutative15.7%
unpow215.7%
unpow215.7%
hypot-def25.7%
Simplified25.7%
Taylor expanded in C around 0 21.2%
div-inv21.4%
Applied egg-rr21.4%
if 7.0999999999999999e-31 < F Initial program 9.0%
Simplified9.0%
Taylor expanded in A around 0 7.0%
mul-1-neg7.0%
distribute-rgt-neg-in7.0%
+-commutative7.0%
unpow27.0%
unpow27.0%
hypot-def8.6%
Simplified8.6%
Taylor expanded in C around 0 16.1%
mul-1-neg16.1%
Simplified16.1%
Final simplification20.4%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* (* A C) 4.0))))
(if (<= F -1e-309)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ A (+ A C))))) t_0)
(if (<= F 3.2e-30)
(/ (* (sqrt 2.0) (- (sqrt (* B F)))) B)
(* (sqrt 2.0) (- (sqrt (/ F B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - ((A * C) * 4.0);
double tmp;
if (F <= -1e-309) {
tmp = -sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0;
} else if (F <= 3.2e-30) {
tmp = (sqrt(2.0) * -sqrt((B * F))) / B;
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (b * b) - ((a * c) * 4.0d0)
if (f <= (-1d-309)) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * (a + (a + c)))) / t_0
else if (f <= 3.2d-30) then
tmp = (sqrt(2.0d0) * -sqrt((b * f))) / b
else
tmp = sqrt(2.0d0) * -sqrt((f / b))
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - ((A * C) * 4.0);
double tmp;
if (F <= -1e-309) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0;
} else if (F <= 3.2e-30) {
tmp = (Math.sqrt(2.0) * -Math.sqrt((B * F))) / B;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - ((A * C) * 4.0) tmp = 0 if F <= -1e-309: tmp = -math.sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0 elif F <= 3.2e-30: tmp = (math.sqrt(2.0) * -math.sqrt((B * F))) / B else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0)) tmp = 0.0 if (F <= -1e-309) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(A + Float64(A + C))))) / t_0); elseif (F <= 3.2e-30) tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(B * F)))) / B); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - ((A * C) * 4.0); tmp = 0.0; if (F <= -1e-309) tmp = -sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0; elseif (F <= 3.2e-30) tmp = (sqrt(2.0) * -sqrt((B * F))) / B; else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e-309], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[F, 3.2e-30], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - \left(A \cdot C\right) \cdot 4\\
\mathbf{if}\;F \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{t_0}\\
\mathbf{elif}\;F \leq 3.2 \cdot 10^{-30}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{B \cdot F}\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < -1.000000000000002e-309Initial program 25.0%
Simplified25.0%
Taylor expanded in A around inf 31.2%
if -1.000000000000002e-309 < F < 3.2e-30Initial program 19.1%
Simplified19.1%
Taylor expanded in A around 0 15.7%
mul-1-neg15.7%
distribute-rgt-neg-in15.7%
+-commutative15.7%
unpow215.7%
unpow215.7%
hypot-def25.7%
Simplified25.7%
Taylor expanded in C around 0 21.2%
associate-*l/21.3%
*-commutative21.3%
Applied egg-rr21.3%
if 3.2e-30 < F Initial program 9.0%
Simplified9.0%
Taylor expanded in A around 0 7.0%
mul-1-neg7.0%
distribute-rgt-neg-in7.0%
+-commutative7.0%
unpow27.0%
unpow27.0%
hypot-def8.6%
Simplified8.6%
Taylor expanded in C around 0 16.1%
mul-1-neg16.1%
Simplified16.1%
Final simplification20.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* (* A C) 4.0))))
(if (<= F -1e-309)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ A (+ A C))))) t_0)
(if (<= F 3.4e-30)
(/ (- (sqrt (* F (* 2.0 (+ B C))))) B)
(* (sqrt 2.0) (- (sqrt (/ F B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - ((A * C) * 4.0);
double tmp;
if (F <= -1e-309) {
tmp = -sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0;
} else if (F <= 3.4e-30) {
tmp = -sqrt((F * (2.0 * (B + C)))) / B;
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (b * b) - ((a * c) * 4.0d0)
if (f <= (-1d-309)) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * (a + (a + c)))) / t_0
else if (f <= 3.4d-30) then
tmp = -sqrt((f * (2.0d0 * (b + c)))) / b
else
tmp = sqrt(2.0d0) * -sqrt((f / b))
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - ((A * C) * 4.0);
double tmp;
if (F <= -1e-309) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0;
} else if (F <= 3.4e-30) {
tmp = -Math.sqrt((F * (2.0 * (B + C)))) / B;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - ((A * C) * 4.0) tmp = 0 if F <= -1e-309: tmp = -math.sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0 elif F <= 3.4e-30: tmp = -math.sqrt((F * (2.0 * (B + C)))) / B else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0)) tmp = 0.0 if (F <= -1e-309) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(A + Float64(A + C))))) / t_0); elseif (F <= 3.4e-30) tmp = Float64(Float64(-sqrt(Float64(F * Float64(2.0 * Float64(B + C))))) / B); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - ((A * C) * 4.0); tmp = 0.0; if (F <= -1e-309) tmp = -sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0; elseif (F <= 3.4e-30) tmp = -sqrt((F * (2.0 * (B + C)))) / B; else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e-309], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[F, 3.4e-30], N[((-N[Sqrt[N[(F * N[(2.0 * N[(B + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - \left(A \cdot C\right) \cdot 4\\
\mathbf{if}\;F \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{t_0}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-30}:\\
\;\;\;\;\frac{-\sqrt{F \cdot \left(2 \cdot \left(B + C\right)\right)}}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < -1.000000000000002e-309Initial program 25.0%
Simplified25.0%
Taylor expanded in A around inf 31.2%
if -1.000000000000002e-309 < F < 3.4000000000000003e-30Initial program 19.1%
Simplified19.1%
Taylor expanded in A around 0 15.7%
mul-1-neg15.7%
distribute-rgt-neg-in15.7%
+-commutative15.7%
unpow215.7%
unpow215.7%
hypot-def25.7%
Simplified25.7%
Taylor expanded in C around 0 21.2%
+-commutative21.2%
Simplified21.2%
*-commutative21.2%
sqrt-prod21.9%
+-commutative21.9%
Applied egg-rr21.9%
expm1-log1p-u21.4%
expm1-udef2.0%
distribute-rgt-neg-out2.0%
*-commutative2.0%
sqrt-prod2.2%
associate-*l/2.2%
pow1/22.2%
pow1/22.2%
pow-prod-down2.2%
Applied egg-rr2.2%
expm1-def20.9%
expm1-log1p21.3%
distribute-neg-frac21.3%
unpow1/221.3%
*-commutative21.3%
associate-*r*21.3%
Simplified21.3%
if 3.4000000000000003e-30 < F Initial program 9.0%
Simplified9.0%
Taylor expanded in A around 0 7.0%
mul-1-neg7.0%
distribute-rgt-neg-in7.0%
+-commutative7.0%
unpow27.0%
unpow27.0%
hypot-def8.6%
Simplified8.6%
Taylor expanded in C around 0 16.1%
mul-1-neg16.1%
Simplified16.1%
Final simplification20.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* (* A C) 4.0))))
(if (<= F -1e-309)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ A (+ A C))))) t_0)
(/ (- (sqrt (* F (* 2.0 (+ B C))))) B))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - ((A * C) * 4.0);
double tmp;
if (F <= -1e-309) {
tmp = -sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0;
} else {
tmp = -sqrt((F * (2.0 * (B + C)))) / B;
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (b * b) - ((a * c) * 4.0d0)
if (f <= (-1d-309)) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * (a + (a + c)))) / t_0
else
tmp = -sqrt((f * (2.0d0 * (b + c)))) / b
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - ((A * C) * 4.0);
double tmp;
if (F <= -1e-309) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0;
} else {
tmp = -Math.sqrt((F * (2.0 * (B + C)))) / B;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - ((A * C) * 4.0) tmp = 0 if F <= -1e-309: tmp = -math.sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0 else: tmp = -math.sqrt((F * (2.0 * (B + C)))) / B return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0)) tmp = 0.0 if (F <= -1e-309) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(A + Float64(A + C))))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(F * Float64(2.0 * Float64(B + C))))) / B); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - ((A * C) * 4.0); tmp = 0.0; if (F <= -1e-309) tmp = -sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0; else tmp = -sqrt((F * (2.0 * (B + C)))) / 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[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e-309], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(F * N[(2.0 * N[(B + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - \left(A \cdot C\right) \cdot 4\\
\mathbf{if}\;F \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{F \cdot \left(2 \cdot \left(B + C\right)\right)}}{B}\\
\end{array}
\end{array}
if F < -1.000000000000002e-309Initial program 25.0%
Simplified25.0%
Taylor expanded in A around inf 31.2%
if -1.000000000000002e-309 < F Initial program 13.9%
Simplified13.9%
Taylor expanded in A around 0 11.2%
mul-1-neg11.2%
distribute-rgt-neg-in11.2%
+-commutative11.2%
unpow211.2%
unpow211.2%
hypot-def16.9%
Simplified16.9%
Taylor expanded in C around 0 14.0%
+-commutative14.0%
Simplified14.0%
*-commutative14.0%
sqrt-prod19.3%
+-commutative19.3%
Applied egg-rr19.3%
expm1-log1p-u14.1%
expm1-udef2.0%
distribute-rgt-neg-out2.0%
*-commutative2.0%
sqrt-prod1.2%
associate-*l/1.2%
pow1/21.2%
pow1/21.3%
pow-prod-down1.3%
Applied egg-rr1.3%
expm1-def10.8%
expm1-log1p14.2%
distribute-neg-frac14.2%
unpow1/214.1%
*-commutative14.1%
associate-*r*14.1%
Simplified14.1%
Final simplification16.4%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= C 1.35e-229) (* (/ 2.0 B) (- (pow (* F A) 0.5))) (* (pow (* F C) 0.5) (/ -2.0 B))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (C <= 1.35e-229) {
tmp = (2.0 / B) * -pow((F * A), 0.5);
} else {
tmp = pow((F * C), 0.5) * (-2.0 / B);
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (c <= 1.35d-229) then
tmp = (2.0d0 / b) * -((f * a) ** 0.5d0)
else
tmp = ((f * c) ** 0.5d0) * ((-2.0d0) / b)
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (C <= 1.35e-229) {
tmp = (2.0 / B) * -Math.pow((F * A), 0.5);
} else {
tmp = Math.pow((F * C), 0.5) * (-2.0 / B);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if C <= 1.35e-229: tmp = (2.0 / B) * -math.pow((F * A), 0.5) else: tmp = math.pow((F * C), 0.5) * (-2.0 / B) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (C <= 1.35e-229) tmp = Float64(Float64(2.0 / B) * Float64(-(Float64(F * A) ^ 0.5))); else tmp = Float64((Float64(F * C) ^ 0.5) * Float64(-2.0 / B)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (C <= 1.35e-229) tmp = (2.0 / B) * -((F * A) ^ 0.5); else tmp = ((F * C) ^ 0.5) * (-2.0 / B); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[C, 1.35e-229], N[(N[(2.0 / B), $MachinePrecision] * (-N[Power[N[(F * A), $MachinePrecision], 0.5], $MachinePrecision])), $MachinePrecision], N[(N[Power[N[(F * C), $MachinePrecision], 0.5], $MachinePrecision] * N[(-2.0 / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq 1.35 \cdot 10^{-229}:\\
\;\;\;\;\frac{2}{B} \cdot \left(-{\left(F \cdot A\right)}^{0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(F \cdot C\right)}^{0.5} \cdot \frac{-2}{B}\\
\end{array}
\end{array}
if C < 1.3499999999999999e-229Initial program 10.4%
Simplified10.4%
Taylor expanded in A around inf 3.2%
Taylor expanded in C around 0 2.7%
mul-1-neg2.7%
unpow22.7%
rem-square-sqrt2.7%
Simplified2.7%
pow1/22.8%
*-commutative2.8%
Applied egg-rr2.8%
if 1.3499999999999999e-229 < C Initial program 21.3%
Simplified21.3%
Taylor expanded in A around 0 14.2%
mul-1-neg14.2%
distribute-rgt-neg-in14.2%
+-commutative14.2%
unpow214.2%
unpow214.2%
hypot-def17.0%
Simplified17.0%
sqrt-prod22.7%
Applied egg-rr22.7%
Taylor expanded in B around 0 5.5%
mul-1-neg5.5%
*-commutative5.5%
distribute-rgt-neg-in5.5%
mul-1-neg5.5%
unpow25.5%
rem-square-sqrt5.5%
associate-*r/5.5%
metadata-eval5.5%
Simplified5.5%
pow1/25.6%
*-commutative5.6%
Applied egg-rr5.6%
Final simplification4.1%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= C 1.3e-230) (* (/ 2.0 B) (- (sqrt (* F A)))) (* (/ -2.0 B) (sqrt (* F C)))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (C <= 1.3e-230) {
tmp = (2.0 / B) * -sqrt((F * A));
} else {
tmp = (-2.0 / B) * sqrt((F * C));
}
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 <= 1.3d-230) then
tmp = (2.0d0 / b) * -sqrt((f * a))
else
tmp = ((-2.0d0) / b) * sqrt((f * c))
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 <= 1.3e-230) {
tmp = (2.0 / B) * -Math.sqrt((F * A));
} else {
tmp = (-2.0 / B) * Math.sqrt((F * C));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if C <= 1.3e-230: tmp = (2.0 / B) * -math.sqrt((F * A)) else: tmp = (-2.0 / B) * math.sqrt((F * C)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (C <= 1.3e-230) tmp = Float64(Float64(2.0 / B) * Float64(-sqrt(Float64(F * A)))); else tmp = Float64(Float64(-2.0 / B) * sqrt(Float64(F * C))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (C <= 1.3e-230) tmp = (2.0 / B) * -sqrt((F * A)); else tmp = (-2.0 / B) * sqrt((F * C)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[C, 1.3e-230], N[(N[(2.0 / B), $MachinePrecision] * (-N[Sqrt[N[(F * A), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[(-2.0 / B), $MachinePrecision] * N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq 1.3 \cdot 10^{-230}:\\
\;\;\;\;\frac{2}{B} \cdot \left(-\sqrt{F \cdot A}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-2}{B} \cdot \sqrt{F \cdot C}\\
\end{array}
\end{array}
if C < 1.3000000000000001e-230Initial program 10.4%
Simplified10.4%
Taylor expanded in A around inf 3.2%
Taylor expanded in C around 0 2.7%
mul-1-neg2.7%
unpow22.7%
rem-square-sqrt2.7%
Simplified2.7%
if 1.3000000000000001e-230 < C Initial program 21.3%
Simplified21.3%
Taylor expanded in A around 0 14.2%
mul-1-neg14.2%
distribute-rgt-neg-in14.2%
+-commutative14.2%
unpow214.2%
unpow214.2%
hypot-def17.0%
Simplified17.0%
sqrt-prod22.7%
Applied egg-rr22.7%
Taylor expanded in B around 0 5.5%
mul-1-neg5.5%
*-commutative5.5%
distribute-rgt-neg-in5.5%
mul-1-neg5.5%
unpow25.5%
rem-square-sqrt5.5%
associate-*r/5.5%
metadata-eval5.5%
Simplified5.5%
Final simplification4.0%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= C 3.3e-233) (/ (* (sqrt (* F A)) (- 2.0)) B) (* (/ -2.0 B) (sqrt (* F C)))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (C <= 3.3e-233) {
tmp = (sqrt((F * A)) * -2.0) / B;
} else {
tmp = (-2.0 / B) * sqrt((F * C));
}
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 <= 3.3d-233) then
tmp = (sqrt((f * a)) * -2.0d0) / b
else
tmp = ((-2.0d0) / b) * sqrt((f * c))
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 <= 3.3e-233) {
tmp = (Math.sqrt((F * A)) * -2.0) / B;
} else {
tmp = (-2.0 / B) * Math.sqrt((F * C));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if C <= 3.3e-233: tmp = (math.sqrt((F * A)) * -2.0) / B else: tmp = (-2.0 / B) * math.sqrt((F * C)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (C <= 3.3e-233) tmp = Float64(Float64(sqrt(Float64(F * A)) * Float64(-2.0)) / B); else tmp = Float64(Float64(-2.0 / B) * sqrt(Float64(F * C))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (C <= 3.3e-233) tmp = (sqrt((F * A)) * -2.0) / B; else tmp = (-2.0 / B) * sqrt((F * C)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[C, 3.3e-233], N[(N[(N[Sqrt[N[(F * A), $MachinePrecision]], $MachinePrecision] * (-2.0)), $MachinePrecision] / B), $MachinePrecision], N[(N[(-2.0 / B), $MachinePrecision] * N[Sqrt[N[(F * C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq 3.3 \cdot 10^{-233}:\\
\;\;\;\;\frac{\sqrt{F \cdot A} \cdot \left(-2\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-2}{B} \cdot \sqrt{F \cdot C}\\
\end{array}
\end{array}
if C < 3.3e-233Initial program 10.4%
Simplified10.4%
Taylor expanded in A around inf 3.2%
Taylor expanded in C around 0 2.7%
mul-1-neg2.7%
unpow22.7%
rem-square-sqrt2.7%
Simplified2.7%
associate-*r/2.7%
*-commutative2.7%
Applied egg-rr2.7%
if 3.3e-233 < C Initial program 21.3%
Simplified21.3%
Taylor expanded in A around 0 14.2%
mul-1-neg14.2%
distribute-rgt-neg-in14.2%
+-commutative14.2%
unpow214.2%
unpow214.2%
hypot-def17.0%
Simplified17.0%
sqrt-prod22.7%
Applied egg-rr22.7%
Taylor expanded in B around 0 5.5%
mul-1-neg5.5%
*-commutative5.5%
distribute-rgt-neg-in5.5%
mul-1-neg5.5%
unpow25.5%
rem-square-sqrt5.5%
associate-*r/5.5%
metadata-eval5.5%
Simplified5.5%
Final simplification4.0%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= C 8.4e-227) (/ (* (sqrt (* F A)) (- 2.0)) B) (* (pow (* F C) 0.5) (/ -2.0 B))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (C <= 8.4e-227) {
tmp = (sqrt((F * A)) * -2.0) / B;
} else {
tmp = pow((F * C), 0.5) * (-2.0 / B);
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (c <= 8.4d-227) then
tmp = (sqrt((f * a)) * -2.0d0) / b
else
tmp = ((f * c) ** 0.5d0) * ((-2.0d0) / b)
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (C <= 8.4e-227) {
tmp = (Math.sqrt((F * A)) * -2.0) / B;
} else {
tmp = Math.pow((F * C), 0.5) * (-2.0 / B);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if C <= 8.4e-227: tmp = (math.sqrt((F * A)) * -2.0) / B else: tmp = math.pow((F * C), 0.5) * (-2.0 / B) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (C <= 8.4e-227) tmp = Float64(Float64(sqrt(Float64(F * A)) * Float64(-2.0)) / B); else tmp = Float64((Float64(F * C) ^ 0.5) * Float64(-2.0 / B)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (C <= 8.4e-227) tmp = (sqrt((F * A)) * -2.0) / B; else tmp = ((F * C) ^ 0.5) * (-2.0 / B); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[C, 8.4e-227], N[(N[(N[Sqrt[N[(F * A), $MachinePrecision]], $MachinePrecision] * (-2.0)), $MachinePrecision] / B), $MachinePrecision], N[(N[Power[N[(F * C), $MachinePrecision], 0.5], $MachinePrecision] * N[(-2.0 / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq 8.4 \cdot 10^{-227}:\\
\;\;\;\;\frac{\sqrt{F \cdot A} \cdot \left(-2\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;{\left(F \cdot C\right)}^{0.5} \cdot \frac{-2}{B}\\
\end{array}
\end{array}
if C < 8.3999999999999999e-227Initial program 10.4%
Simplified10.4%
Taylor expanded in A around inf 3.2%
Taylor expanded in C around 0 2.7%
mul-1-neg2.7%
unpow22.7%
rem-square-sqrt2.7%
Simplified2.7%
associate-*r/2.7%
*-commutative2.7%
Applied egg-rr2.7%
if 8.3999999999999999e-227 < C Initial program 21.3%
Simplified21.3%
Taylor expanded in A around 0 14.2%
mul-1-neg14.2%
distribute-rgt-neg-in14.2%
+-commutative14.2%
unpow214.2%
unpow214.2%
hypot-def17.0%
Simplified17.0%
sqrt-prod22.7%
Applied egg-rr22.7%
Taylor expanded in B around 0 5.5%
mul-1-neg5.5%
*-commutative5.5%
distribute-rgt-neg-in5.5%
mul-1-neg5.5%
unpow25.5%
rem-square-sqrt5.5%
associate-*r/5.5%
metadata-eval5.5%
Simplified5.5%
pow1/25.6%
*-commutative5.6%
Applied egg-rr5.6%
Final simplification4.1%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (/ (- (sqrt (* F (* 2.0 (+ B C))))) B))
B = abs(B);
double code(double A, double B, double C, double F) {
return -sqrt((F * (2.0 * (B + 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 = -sqrt((f * (2.0d0 * (b + c)))) / b
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return -Math.sqrt((F * (2.0 * (B + C)))) / B;
}
B = abs(B) def code(A, B, C, F): return -math.sqrt((F * (2.0 * (B + C)))) / B
B = abs(B) function code(A, B, C, F) return Float64(Float64(-sqrt(Float64(F * Float64(2.0 * Float64(B + C))))) / B) end
B = abs(B) function tmp = code(A, B, C, F) tmp = -sqrt((F * (2.0 * (B + C)))) / B; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[((-N[Sqrt[N[(F * N[(2.0 * N[(B + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\frac{-\sqrt{F \cdot \left(2 \cdot \left(B + C\right)\right)}}{B}
\end{array}
Initial program 15.4%
Simplified15.4%
Taylor expanded in A around 0 9.7%
mul-1-neg9.7%
distribute-rgt-neg-in9.7%
+-commutative9.7%
unpow29.7%
unpow29.7%
hypot-def14.6%
Simplified14.6%
Taylor expanded in C around 0 12.2%
+-commutative12.2%
Simplified12.2%
*-commutative12.2%
sqrt-prod16.7%
+-commutative16.7%
Applied egg-rr16.7%
expm1-log1p-u12.2%
expm1-udef1.7%
distribute-rgt-neg-out1.7%
*-commutative1.7%
sqrt-prod1.1%
associate-*l/1.1%
pow1/21.1%
pow1/21.2%
pow-prod-down1.2%
Applied egg-rr1.2%
expm1-def9.4%
expm1-log1p12.4%
distribute-neg-frac12.4%
unpow1/212.2%
*-commutative12.2%
associate-*r*12.2%
Simplified12.2%
Final simplification12.2%
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) * 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 \sqrt{F \cdot C}
\end{array}
Initial program 15.4%
Simplified15.4%
Taylor expanded in A around 0 9.7%
mul-1-neg9.7%
distribute-rgt-neg-in9.7%
+-commutative9.7%
unpow29.7%
unpow29.7%
hypot-def14.6%
Simplified14.6%
sqrt-prod20.2%
Applied egg-rr20.2%
Taylor expanded in B around 0 2.9%
mul-1-neg2.9%
*-commutative2.9%
distribute-rgt-neg-in2.9%
mul-1-neg2.9%
unpow22.9%
rem-square-sqrt2.9%
associate-*r/2.9%
metadata-eval2.9%
Simplified2.9%
Final simplification2.9%
herbie shell --seed 2023275
(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))))