
(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 29 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 (fma C (* A -4.0) (* B B)))
(t_1 (hypot B (- A C)))
(t_2 (fma B B (* -4.0 (* A C))))
(t_3 (/ (sqrt (* 2.0 (* F t_2))) (/ t_2 (- (sqrt (+ C (+ A t_1))))))))
(if (<= B 1.22e-272)
t_3
(if (<= B 4.9e-220)
(/ (- (sqrt (* 2.0 (* (* F t_0) (* 2.0 A))))) t_0)
(if (<= B 1.4e+54)
t_3
(if (<= B 1.35e+154)
(*
(* (sqrt 2.0) (* B (sqrt F)))
(* (sqrt (+ (+ A C) t_1)) (/ -1.0 t_2)))
(*
(* (sqrt F) (sqrt (+ A (hypot B A))))
(* (sqrt 2.0) (/ -1.0 B)))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(C, (A * -4.0), (B * B));
double t_1 = hypot(B, (A - C));
double t_2 = fma(B, B, (-4.0 * (A * C)));
double t_3 = sqrt((2.0 * (F * t_2))) / (t_2 / -sqrt((C + (A + t_1))));
double tmp;
if (B <= 1.22e-272) {
tmp = t_3;
} else if (B <= 4.9e-220) {
tmp = -sqrt((2.0 * ((F * t_0) * (2.0 * A)))) / t_0;
} else if (B <= 1.4e+54) {
tmp = t_3;
} else if (B <= 1.35e+154) {
tmp = (sqrt(2.0) * (B * sqrt(F))) * (sqrt(((A + C) + t_1)) * (-1.0 / t_2));
} else {
tmp = (sqrt(F) * sqrt((A + hypot(B, A)))) * (sqrt(2.0) * (-1.0 / B));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(C, Float64(A * -4.0), Float64(B * B)) t_1 = hypot(B, Float64(A - C)) t_2 = fma(B, B, Float64(-4.0 * Float64(A * C))) t_3 = Float64(sqrt(Float64(2.0 * Float64(F * t_2))) / Float64(t_2 / Float64(-sqrt(Float64(C + Float64(A + t_1)))))) tmp = 0.0 if (B <= 1.22e-272) tmp = t_3; elseif (B <= 4.9e-220) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(2.0 * A))))) / t_0); elseif (B <= 1.4e+54) tmp = t_3; elseif (B <= 1.35e+154) tmp = Float64(Float64(sqrt(2.0) * Float64(B * sqrt(F))) * Float64(sqrt(Float64(Float64(A + C) + t_1)) * Float64(-1.0 / t_2))); else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B, A)))) * Float64(sqrt(2.0) * Float64(-1.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[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$2 = N[(B * B + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(2.0 * N[(F * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$2 / (-N[Sqrt[N[(C + N[(A + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 1.22e-272], t$95$3, If[LessEqual[B, 4.9e-220], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 1.4e+54], t$95$3, If[LessEqual[B, 1.35e+154], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(B * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\\
t_1 := \mathsf{hypot}\left(B, A - C\right)\\
t_2 := \mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)\\
t_3 := \frac{\sqrt{2 \cdot \left(F \cdot t_2\right)}}{\frac{t_2}{-\sqrt{C + \left(A + t_1\right)}}}\\
\mathbf{if}\;B \leq 1.22 \cdot 10^{-272}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;B \leq 4.9 \cdot 10^{-220}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 1.4 \cdot 10^{+54}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;B \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\left(\sqrt{2} \cdot \left(B \cdot \sqrt{F}\right)\right) \cdot \left(\sqrt{\left(A + C\right) + t_1} \cdot \frac{-1}{t_2}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right) \cdot \left(\sqrt{2} \cdot \frac{-1}{B}\right)\\
\end{array}
\end{array}
if B < 1.21999999999999995e-272 or 4.9000000000000002e-220 < B < 1.40000000000000008e54Initial program 26.3%
associate-*l*26.3%
unpow226.3%
+-commutative26.3%
unpow226.3%
associate-*l*26.3%
unpow226.3%
Simplified26.3%
sqrt-prod28.5%
*-commutative28.5%
*-commutative28.5%
associate-+l+29.1%
unpow229.1%
hypot-udef36.1%
associate-+r+35.0%
+-commutative35.0%
associate-+r+35.7%
Applied egg-rr35.7%
sqrt-prod35.7%
cancel-sign-sub-inv35.7%
*-commutative35.7%
metadata-eval35.7%
*-commutative35.7%
Applied egg-rr35.7%
*-un-lft-identity35.7%
distribute-rgt-neg-in35.7%
sqrt-unprod35.7%
fma-def35.7%
*-commutative35.7%
cancel-sign-sub-inv35.7%
metadata-eval35.7%
*-commutative35.7%
Applied egg-rr35.7%
*-lft-identity35.7%
associate-/l*35.8%
Simplified35.8%
if 1.21999999999999995e-272 < B < 4.9000000000000002e-220Initial program 21.2%
Simplified43.2%
Taylor expanded in C around -inf 61.0%
if 1.40000000000000008e54 < B < 1.35000000000000003e154Initial program 38.4%
associate-*l*38.4%
unpow238.4%
+-commutative38.4%
unpow238.4%
associate-*l*38.4%
unpow238.4%
Simplified38.4%
sqrt-prod53.7%
*-commutative53.7%
*-commutative53.7%
associate-+l+53.7%
unpow253.7%
hypot-udef68.9%
associate-+r+68.9%
+-commutative68.9%
associate-+r+68.9%
Applied egg-rr68.9%
Taylor expanded in B around inf 79.0%
associate-*l*79.0%
Simplified79.0%
div-inv79.0%
distribute-rgt-neg-in79.0%
cancel-sign-sub-inv79.0%
metadata-eval79.0%
*-commutative79.0%
fma-def79.0%
*-commutative79.0%
Applied egg-rr79.0%
associate-*l*84.1%
associate-+r+84.3%
+-commutative84.3%
Simplified84.3%
if 1.35000000000000003e154 < B Initial program 0.0%
Simplified0.0%
Taylor expanded in C around 0 2.4%
mul-1-neg2.4%
unpow22.4%
unpow22.4%
Simplified2.4%
sqrt-prod2.4%
hypot-udef87.0%
Applied egg-rr87.0%
div-inv87.0%
Applied egg-rr87.0%
Final simplification46.8%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* -4.0 (* A C))))
(t_1 (- (pow B 2.0) (* (* 4.0 A) C)))
(t_2
(/
(-
(sqrt
(*
(* 2.0 (* t_1 F))
(+ (+ A C) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))))))
t_1))
(t_3 (sqrt (+ C (+ A (hypot B (- A C)))))))
(if (<= t_2 0.0)
(/
(* t_3 (* (sqrt 2.0) (* (sqrt F) (- (sqrt t_0)))))
(- (* B B) (* 4.0 (* A C))))
(if (<= t_2 INFINITY)
(/ (sqrt (* 2.0 (* F t_0))) (/ t_0 (- t_3)))
(* (* (sqrt F) (sqrt (+ A (hypot B A)))) (* (sqrt 2.0) (/ -1.0 B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (-4.0 * (A * C)));
double t_1 = pow(B, 2.0) - ((4.0 * A) * C);
double t_2 = -sqrt(((2.0 * (t_1 * F)) * ((A + C) + sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_1;
double t_3 = sqrt((C + (A + hypot(B, (A - C)))));
double tmp;
if (t_2 <= 0.0) {
tmp = (t_3 * (sqrt(2.0) * (sqrt(F) * -sqrt(t_0)))) / ((B * B) - (4.0 * (A * C)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt((2.0 * (F * t_0))) / (t_0 / -t_3);
} else {
tmp = (sqrt(F) * sqrt((A + hypot(B, A)))) * (sqrt(2.0) * (-1.0 / B));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(B, B, Float64(-4.0 * Float64(A * C))) t_1 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) t_2 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_1 * F)) * Float64(Float64(A + C) + sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_1) t_3 = sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) tmp = 0.0 if (t_2 <= 0.0) tmp = Float64(Float64(t_3 * Float64(sqrt(2.0) * Float64(sqrt(F) * Float64(-sqrt(t_0))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))); elseif (t_2 <= Inf) tmp = Float64(sqrt(Float64(2.0 * Float64(F * t_0))) / Float64(t_0 / Float64(-t_3))); else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B, A)))) * Float64(sqrt(2.0) * Float64(-1.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[(B * B + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$1 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[(N[(t$95$3 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[t$95$0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 / (-t$95$3)), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)\\
t_1 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
t_2 := \frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_1}\\
t_3 := \sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\\
\mathbf{if}\;t_2 \leq 0:\\
\;\;\;\;\frac{t_3 \cdot \left(\sqrt{2} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{t_0}\right)\right)\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot t_0\right)}}{\frac{t_0}{-t_3}}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right) \cdot \left(\sqrt{2} \cdot \frac{-1}{B}\right)\\
\end{array}
\end{array}
if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -0.0Initial program 33.5%
associate-*l*33.5%
unpow233.5%
+-commutative33.5%
unpow233.5%
associate-*l*33.5%
unpow233.5%
Simplified33.5%
sqrt-prod38.7%
*-commutative38.7%
*-commutative38.7%
associate-+l+39.6%
unpow239.6%
hypot-udef49.7%
associate-+r+48.0%
+-commutative48.0%
associate-+r+49.2%
Applied egg-rr49.2%
sqrt-prod49.1%
cancel-sign-sub-inv49.1%
*-commutative49.1%
metadata-eval49.1%
*-commutative49.1%
Applied egg-rr49.1%
sqrt-prod63.2%
fma-def63.2%
*-commutative63.2%
Applied egg-rr63.2%
if -0.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < +inf.0Initial program 61.9%
associate-*l*61.9%
unpow261.9%
+-commutative61.9%
unpow261.9%
associate-*l*61.9%
unpow261.9%
Simplified61.9%
sqrt-prod63.7%
*-commutative63.7%
*-commutative63.7%
associate-+l+63.7%
unpow263.7%
hypot-udef86.1%
associate-+r+86.1%
+-commutative86.1%
associate-+r+86.1%
Applied egg-rr86.1%
sqrt-prod85.9%
cancel-sign-sub-inv85.9%
*-commutative85.9%
metadata-eval85.9%
*-commutative85.9%
Applied egg-rr85.9%
*-un-lft-identity85.9%
distribute-rgt-neg-in85.9%
sqrt-unprod86.1%
fma-def86.1%
*-commutative86.1%
cancel-sign-sub-inv86.1%
metadata-eval86.1%
*-commutative86.1%
Applied egg-rr86.1%
*-lft-identity86.1%
associate-/l*86.1%
Simplified86.1%
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) Initial program 0.0%
Simplified0.5%
Taylor expanded in C around 0 1.7%
mul-1-neg1.7%
unpow21.7%
unpow21.7%
Simplified1.7%
sqrt-prod1.7%
hypot-udef29.9%
Applied egg-rr29.9%
div-inv29.9%
Applied egg-rr29.9%
Final simplification52.9%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma C (* A -4.0) (* B B)))
(t_1 (- (* B B) (* 4.0 (* A C))))
(t_2 (hypot B (- A C)))
(t_3 (sqrt (+ C (+ A t_2))))
(t_4 (* -4.0 (* A C))))
(if (<= B 6.8e-273)
(/ (* t_3 (* (sqrt 2.0) (- (sqrt (* F (+ (* B B) t_4)))))) t_1)
(if (<= B 1.05e-220)
(/ (- (sqrt (* 2.0 (* (* F t_0) (* 2.0 A))))) t_0)
(if (<= B 3.2e+49)
(/ (* t_3 (- (sqrt (* 2.0 (* F t_1))))) t_1)
(if (<= B 1.35e+154)
(*
(* (sqrt 2.0) (* B (sqrt F)))
(* (sqrt (+ (+ A C) t_2)) (/ -1.0 (fma B B t_4))))
(*
(* (sqrt F) (sqrt (+ A (hypot B A))))
(* (sqrt 2.0) (/ -1.0 B)))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(C, (A * -4.0), (B * B));
double t_1 = (B * B) - (4.0 * (A * C));
double t_2 = hypot(B, (A - C));
double t_3 = sqrt((C + (A + t_2)));
double t_4 = -4.0 * (A * C);
double tmp;
if (B <= 6.8e-273) {
tmp = (t_3 * (sqrt(2.0) * -sqrt((F * ((B * B) + t_4))))) / t_1;
} else if (B <= 1.05e-220) {
tmp = -sqrt((2.0 * ((F * t_0) * (2.0 * A)))) / t_0;
} else if (B <= 3.2e+49) {
tmp = (t_3 * -sqrt((2.0 * (F * t_1)))) / t_1;
} else if (B <= 1.35e+154) {
tmp = (sqrt(2.0) * (B * sqrt(F))) * (sqrt(((A + C) + t_2)) * (-1.0 / fma(B, B, t_4)));
} else {
tmp = (sqrt(F) * sqrt((A + hypot(B, A)))) * (sqrt(2.0) * (-1.0 / B));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(C, Float64(A * -4.0), Float64(B * B)) t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) t_2 = hypot(B, Float64(A - C)) t_3 = sqrt(Float64(C + Float64(A + t_2))) t_4 = Float64(-4.0 * Float64(A * C)) tmp = 0.0 if (B <= 6.8e-273) tmp = Float64(Float64(t_3 * Float64(sqrt(2.0) * Float64(-sqrt(Float64(F * Float64(Float64(B * B) + t_4)))))) / t_1); elseif (B <= 1.05e-220) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(2.0 * A))))) / t_0); elseif (B <= 3.2e+49) tmp = Float64(Float64(t_3 * Float64(-sqrt(Float64(2.0 * Float64(F * t_1))))) / t_1); elseif (B <= 1.35e+154) tmp = Float64(Float64(sqrt(2.0) * Float64(B * sqrt(F))) * Float64(sqrt(Float64(Float64(A + C) + t_2)) * Float64(-1.0 / fma(B, B, t_4)))); else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B, A)))) * Float64(sqrt(2.0) * Float64(-1.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[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(C + N[(A + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 6.8e-273], N[(N[(t$95$3 * N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F * N[(N[(B * B), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B, 1.05e-220], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 3.2e+49], N[(N[(t$95$3 * (-N[Sqrt[N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B, 1.35e+154], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(B * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / N[(B * B + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\\
t_1 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_2 := \mathsf{hypot}\left(B, A - C\right)\\
t_3 := \sqrt{C + \left(A + t_2\right)}\\
t_4 := -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 6.8 \cdot 10^{-273}:\\
\;\;\;\;\frac{t_3 \cdot \left(\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(B \cdot B + t_4\right)}\right)\right)}{t_1}\\
\mathbf{elif}\;B \leq 1.05 \cdot 10^{-220}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 3.2 \cdot 10^{+49}:\\
\;\;\;\;\frac{t_3 \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_1\right)}\right)}{t_1}\\
\mathbf{elif}\;B \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\left(\sqrt{2} \cdot \left(B \cdot \sqrt{F}\right)\right) \cdot \left(\sqrt{\left(A + C\right) + t_2} \cdot \frac{-1}{\mathsf{fma}\left(B, B, t_4\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right) \cdot \left(\sqrt{2} \cdot \frac{-1}{B}\right)\\
\end{array}
\end{array}
if B < 6.79999999999999982e-273Initial program 20.4%
associate-*l*20.4%
unpow220.4%
+-commutative20.4%
unpow220.4%
associate-*l*20.4%
unpow220.4%
Simplified20.4%
sqrt-prod22.9%
*-commutative22.9%
*-commutative22.9%
associate-+l+23.7%
unpow223.7%
hypot-udef29.6%
associate-+r+28.4%
+-commutative28.4%
associate-+r+28.8%
Applied egg-rr28.8%
sqrt-prod28.8%
cancel-sign-sub-inv28.8%
*-commutative28.8%
metadata-eval28.8%
*-commutative28.8%
Applied egg-rr28.8%
if 6.79999999999999982e-273 < B < 1.04999999999999996e-220Initial program 21.2%
Simplified43.2%
Taylor expanded in C around -inf 61.0%
if 1.04999999999999996e-220 < B < 3.20000000000000014e49Initial program 40.3%
associate-*l*40.3%
unpow240.3%
+-commutative40.3%
unpow240.3%
associate-*l*40.3%
unpow240.3%
Simplified40.3%
sqrt-prod41.7%
*-commutative41.7%
*-commutative41.7%
associate-+l+41.7%
unpow241.7%
hypot-udef52.1%
associate-+r+51.3%
+-commutative51.3%
associate-+r+53.0%
Applied egg-rr53.0%
if 3.20000000000000014e49 < B < 1.35000000000000003e154Initial program 44.2%
associate-*l*44.2%
unpow244.2%
+-commutative44.2%
unpow244.2%
associate-*l*44.2%
unpow244.2%
Simplified44.2%
sqrt-prod57.9%
*-commutative57.9%
*-commutative57.9%
associate-+l+57.9%
unpow257.9%
hypot-udef71.7%
associate-+r+71.7%
+-commutative71.7%
associate-+r+71.7%
Applied egg-rr71.7%
Taylor expanded in B around inf 80.9%
associate-*l*80.9%
Simplified80.9%
div-inv80.9%
distribute-rgt-neg-in80.9%
cancel-sign-sub-inv80.9%
metadata-eval80.9%
*-commutative80.9%
fma-def80.9%
*-commutative80.9%
Applied egg-rr80.9%
associate-*l*85.5%
associate-+r+85.6%
+-commutative85.6%
Simplified85.6%
if 1.35000000000000003e154 < B Initial program 0.0%
Simplified0.0%
Taylor expanded in C around 0 2.4%
mul-1-neg2.4%
unpow22.4%
unpow22.4%
Simplified2.4%
sqrt-prod2.4%
hypot-udef87.0%
Applied egg-rr87.0%
div-inv87.0%
Applied egg-rr87.0%
Final simplification46.7%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma C (* A -4.0) (* B B)))
(t_1 (- (* B B) (* 4.0 (* A C))))
(t_2 (sqrt (+ C (+ A (hypot B (- A C))))))
(t_3 (* -4.0 (* A C))))
(if (<= B 9.2e-273)
(/ (* t_2 (* (sqrt 2.0) (- (sqrt (* F (+ (* B B) t_3)))))) t_1)
(if (<= B 7.4e-221)
(/ (- (sqrt (* 2.0 (* (* F t_0) (* 2.0 A))))) t_0)
(if (<= B 3e+49)
(/ (* t_2 (- (sqrt (* 2.0 (* F t_1))))) t_1)
(if (<= B 1.35e+154)
(/ (* (sqrt 2.0) (* B (sqrt F))) (/ (fma B B t_3) (- t_2)))
(*
(* (sqrt F) (sqrt (+ A (hypot B A))))
(* (sqrt 2.0) (/ -1.0 B)))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(C, (A * -4.0), (B * B));
double t_1 = (B * B) - (4.0 * (A * C));
double t_2 = sqrt((C + (A + hypot(B, (A - C)))));
double t_3 = -4.0 * (A * C);
double tmp;
if (B <= 9.2e-273) {
tmp = (t_2 * (sqrt(2.0) * -sqrt((F * ((B * B) + t_3))))) / t_1;
} else if (B <= 7.4e-221) {
tmp = -sqrt((2.0 * ((F * t_0) * (2.0 * A)))) / t_0;
} else if (B <= 3e+49) {
tmp = (t_2 * -sqrt((2.0 * (F * t_1)))) / t_1;
} else if (B <= 1.35e+154) {
tmp = (sqrt(2.0) * (B * sqrt(F))) / (fma(B, B, t_3) / -t_2);
} else {
tmp = (sqrt(F) * sqrt((A + hypot(B, A)))) * (sqrt(2.0) * (-1.0 / B));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(C, Float64(A * -4.0), Float64(B * B)) t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) t_2 = sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) t_3 = Float64(-4.0 * Float64(A * C)) tmp = 0.0 if (B <= 9.2e-273) tmp = Float64(Float64(t_2 * Float64(sqrt(2.0) * Float64(-sqrt(Float64(F * Float64(Float64(B * B) + t_3)))))) / t_1); elseif (B <= 7.4e-221) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(2.0 * A))))) / t_0); elseif (B <= 3e+49) tmp = Float64(Float64(t_2 * Float64(-sqrt(Float64(2.0 * Float64(F * t_1))))) / t_1); elseif (B <= 1.35e+154) tmp = Float64(Float64(sqrt(2.0) * Float64(B * sqrt(F))) / Float64(fma(B, B, t_3) / Float64(-t_2))); else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B, A)))) * Float64(sqrt(2.0) * Float64(-1.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[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 9.2e-273], N[(N[(t$95$2 * N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F * N[(N[(B * B), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B, 7.4e-221], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 3e+49], N[(N[(t$95$2 * (-N[Sqrt[N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B, 1.35e+154], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(B * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(B * B + t$95$3), $MachinePrecision] / (-t$95$2)), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\\
t_1 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_2 := \sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\\
t_3 := -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 9.2 \cdot 10^{-273}:\\
\;\;\;\;\frac{t_2 \cdot \left(\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(B \cdot B + t_3\right)}\right)\right)}{t_1}\\
\mathbf{elif}\;B \leq 7.4 \cdot 10^{-221}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 3 \cdot 10^{+49}:\\
\;\;\;\;\frac{t_2 \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_1\right)}\right)}{t_1}\\
\mathbf{elif}\;B \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(B \cdot \sqrt{F}\right)}{\frac{\mathsf{fma}\left(B, B, t_3\right)}{-t_2}}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right) \cdot \left(\sqrt{2} \cdot \frac{-1}{B}\right)\\
\end{array}
\end{array}
if B < 9.19999999999999923e-273Initial program 20.4%
associate-*l*20.4%
unpow220.4%
+-commutative20.4%
unpow220.4%
associate-*l*20.4%
unpow220.4%
Simplified20.4%
sqrt-prod22.9%
*-commutative22.9%
*-commutative22.9%
associate-+l+23.7%
unpow223.7%
hypot-udef29.6%
associate-+r+28.4%
+-commutative28.4%
associate-+r+28.8%
Applied egg-rr28.8%
sqrt-prod28.8%
cancel-sign-sub-inv28.8%
*-commutative28.8%
metadata-eval28.8%
*-commutative28.8%
Applied egg-rr28.8%
if 9.19999999999999923e-273 < B < 7.39999999999999971e-221Initial program 21.2%
Simplified43.2%
Taylor expanded in C around -inf 61.0%
if 7.39999999999999971e-221 < B < 3.0000000000000002e49Initial program 40.3%
associate-*l*40.3%
unpow240.3%
+-commutative40.3%
unpow240.3%
associate-*l*40.3%
unpow240.3%
Simplified40.3%
sqrt-prod41.7%
*-commutative41.7%
*-commutative41.7%
associate-+l+41.7%
unpow241.7%
hypot-udef52.1%
associate-+r+51.3%
+-commutative51.3%
associate-+r+53.0%
Applied egg-rr53.0%
if 3.0000000000000002e49 < B < 1.35000000000000003e154Initial program 44.2%
associate-*l*44.2%
unpow244.2%
+-commutative44.2%
unpow244.2%
associate-*l*44.2%
unpow244.2%
Simplified44.2%
sqrt-prod57.9%
*-commutative57.9%
*-commutative57.9%
associate-+l+57.9%
unpow257.9%
hypot-udef71.7%
associate-+r+71.7%
+-commutative71.7%
associate-+r+71.7%
Applied egg-rr71.7%
Taylor expanded in B around inf 80.9%
associate-*l*80.9%
Simplified80.9%
div-inv80.9%
distribute-rgt-neg-in80.9%
cancel-sign-sub-inv80.9%
metadata-eval80.9%
*-commutative80.9%
fma-def80.9%
*-commutative80.9%
Applied egg-rr80.9%
associate-*r/80.9%
*-rgt-identity80.9%
associate-/l*85.4%
Simplified85.4%
if 1.35000000000000003e154 < B Initial program 0.0%
Simplified0.0%
Taylor expanded in C around 0 2.4%
mul-1-neg2.4%
unpow22.4%
unpow22.4%
Simplified2.4%
sqrt-prod2.4%
hypot-udef87.0%
Applied egg-rr87.0%
div-inv87.0%
Applied egg-rr87.0%
Final simplification46.7%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma C (* A -4.0) (* B B)))
(t_1 (sqrt (+ C (+ A (hypot B (- A C))))))
(t_2 (- (* B B) (* 4.0 (* A C)))))
(if (<= B 1.75e-272)
(/
(* t_1 (* (sqrt 2.0) (- (sqrt (* F (+ (* B B) (* -4.0 (* A C))))))))
t_2)
(if (<= B 3.5e-219)
(/ (- (sqrt (* 2.0 (* (* F t_0) (* 2.0 A))))) t_0)
(if (<= B 9e+61)
(/ (* t_1 (- (sqrt (* 2.0 (* F t_2))))) t_2)
(if (<= B 4.3e+144)
(/ (* t_1 (* (sqrt 2.0) (* B (- (sqrt F))))) t_2)
(*
(* (sqrt F) (sqrt (+ A (hypot B A))))
(* (sqrt 2.0) (/ -1.0 B)))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(C, (A * -4.0), (B * B));
double t_1 = sqrt((C + (A + hypot(B, (A - C)))));
double t_2 = (B * B) - (4.0 * (A * C));
double tmp;
if (B <= 1.75e-272) {
tmp = (t_1 * (sqrt(2.0) * -sqrt((F * ((B * B) + (-4.0 * (A * C))))))) / t_2;
} else if (B <= 3.5e-219) {
tmp = -sqrt((2.0 * ((F * t_0) * (2.0 * A)))) / t_0;
} else if (B <= 9e+61) {
tmp = (t_1 * -sqrt((2.0 * (F * t_2)))) / t_2;
} else if (B <= 4.3e+144) {
tmp = (t_1 * (sqrt(2.0) * (B * -sqrt(F)))) / t_2;
} else {
tmp = (sqrt(F) * sqrt((A + hypot(B, A)))) * (sqrt(2.0) * (-1.0 / B));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(C, Float64(A * -4.0), Float64(B * B)) t_1 = sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) t_2 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) tmp = 0.0 if (B <= 1.75e-272) tmp = Float64(Float64(t_1 * Float64(sqrt(2.0) * Float64(-sqrt(Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))))))) / t_2); elseif (B <= 3.5e-219) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(2.0 * A))))) / t_0); elseif (B <= 9e+61) tmp = Float64(Float64(t_1 * Float64(-sqrt(Float64(2.0 * Float64(F * t_2))))) / t_2); elseif (B <= 4.3e+144) tmp = Float64(Float64(t_1 * Float64(sqrt(2.0) * Float64(B * Float64(-sqrt(F))))) / t_2); else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B, A)))) * Float64(sqrt(2.0) * Float64(-1.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[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 1.75e-272], N[(N[(t$95$1 * N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[B, 3.5e-219], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 9e+61], N[(N[(t$95$1 * (-N[Sqrt[N[(2.0 * N[(F * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[B, 4.3e+144], N[(N[(t$95$1 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(B * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\\
t_1 := \sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\\
t_2 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 1.75 \cdot 10^{-272}:\\
\;\;\;\;\frac{t_1 \cdot \left(\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)}\right)\right)}{t_2}\\
\mathbf{elif}\;B \leq 3.5 \cdot 10^{-219}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 9 \cdot 10^{+61}:\\
\;\;\;\;\frac{t_1 \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_2\right)}\right)}{t_2}\\
\mathbf{elif}\;B \leq 4.3 \cdot 10^{+144}:\\
\;\;\;\;\frac{t_1 \cdot \left(\sqrt{2} \cdot \left(B \cdot \left(-\sqrt{F}\right)\right)\right)}{t_2}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right) \cdot \left(\sqrt{2} \cdot \frac{-1}{B}\right)\\
\end{array}
\end{array}
if B < 1.7499999999999998e-272Initial program 20.4%
associate-*l*20.4%
unpow220.4%
+-commutative20.4%
unpow220.4%
associate-*l*20.4%
unpow220.4%
Simplified20.4%
sqrt-prod22.9%
*-commutative22.9%
*-commutative22.9%
associate-+l+23.7%
unpow223.7%
hypot-udef29.6%
associate-+r+28.4%
+-commutative28.4%
associate-+r+28.8%
Applied egg-rr28.8%
sqrt-prod28.8%
cancel-sign-sub-inv28.8%
*-commutative28.8%
metadata-eval28.8%
*-commutative28.8%
Applied egg-rr28.8%
if 1.7499999999999998e-272 < B < 3.50000000000000011e-219Initial program 21.2%
Simplified43.2%
Taylor expanded in C around -inf 61.0%
if 3.50000000000000011e-219 < B < 9e61Initial program 42.9%
associate-*l*42.9%
unpow242.9%
+-commutative42.9%
unpow242.9%
associate-*l*42.9%
unpow242.9%
Simplified42.9%
sqrt-prod44.2%
*-commutative44.2%
*-commutative44.2%
associate-+l+44.2%
unpow244.2%
hypot-udef55.5%
associate-+r+54.9%
+-commutative54.9%
associate-+r+56.4%
Applied egg-rr56.4%
if 9e61 < B < 4.29999999999999984e144Initial program 37.3%
associate-*l*37.3%
unpow237.3%
+-commutative37.3%
unpow237.3%
associate-*l*37.3%
unpow237.3%
Simplified37.3%
sqrt-prod58.2%
*-commutative58.2%
*-commutative58.2%
associate-+l+58.2%
unpow258.2%
hypot-udef72.0%
associate-+r+72.0%
+-commutative72.0%
associate-+r+72.1%
Applied egg-rr72.1%
Taylor expanded in B around inf 85.4%
associate-*l*85.5%
Simplified85.5%
if 4.29999999999999984e144 < B Initial program 2.9%
Simplified2.9%
Taylor expanded in C around 0 5.2%
mul-1-neg5.2%
unpow25.2%
unpow25.2%
Simplified5.2%
sqrt-prod7.0%
hypot-udef84.5%
Applied egg-rr84.5%
div-inv84.5%
Applied egg-rr84.5%
Final simplification46.6%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma C (* A -4.0) (* B B)))
(t_1 (- (* B B) (* 4.0 (* A C))))
(t_2 (sqrt (+ C (+ A (hypot B (- A C))))))
(t_3 (/ (* t_2 (- (sqrt (* 2.0 (* F t_1))))) t_1)))
(if (<= B 1.75e-273)
t_3
(if (<= B 1.52e-220)
(/ (- (sqrt (* 2.0 (* (* F t_0) (* 2.0 A))))) t_0)
(if (<= B 6.2e+62)
t_3
(if (<= B 6.4e+144)
(/ (* t_2 (* (sqrt 2.0) (* B (- (sqrt F))))) t_1)
(*
(* (sqrt F) (sqrt (+ A (hypot B A))))
(* (sqrt 2.0) (/ -1.0 B)))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(C, (A * -4.0), (B * B));
double t_1 = (B * B) - (4.0 * (A * C));
double t_2 = sqrt((C + (A + hypot(B, (A - C)))));
double t_3 = (t_2 * -sqrt((2.0 * (F * t_1)))) / t_1;
double tmp;
if (B <= 1.75e-273) {
tmp = t_3;
} else if (B <= 1.52e-220) {
tmp = -sqrt((2.0 * ((F * t_0) * (2.0 * A)))) / t_0;
} else if (B <= 6.2e+62) {
tmp = t_3;
} else if (B <= 6.4e+144) {
tmp = (t_2 * (sqrt(2.0) * (B * -sqrt(F)))) / t_1;
} else {
tmp = (sqrt(F) * sqrt((A + hypot(B, A)))) * (sqrt(2.0) * (-1.0 / B));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(C, Float64(A * -4.0), Float64(B * B)) t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) t_2 = sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) t_3 = Float64(Float64(t_2 * Float64(-sqrt(Float64(2.0 * Float64(F * t_1))))) / t_1) tmp = 0.0 if (B <= 1.75e-273) tmp = t_3; elseif (B <= 1.52e-220) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(2.0 * A))))) / t_0); elseif (B <= 6.2e+62) tmp = t_3; elseif (B <= 6.4e+144) tmp = Float64(Float64(t_2 * Float64(sqrt(2.0) * Float64(B * Float64(-sqrt(F))))) / t_1); else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B, A)))) * Float64(sqrt(2.0) * Float64(-1.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[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 * (-N[Sqrt[N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[B, 1.75e-273], t$95$3, If[LessEqual[B, 1.52e-220], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 6.2e+62], t$95$3, If[LessEqual[B, 6.4e+144], N[(N[(t$95$2 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(B * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\\
t_1 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_2 := \sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\\
t_3 := \frac{t_2 \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_1\right)}\right)}{t_1}\\
\mathbf{if}\;B \leq 1.75 \cdot 10^{-273}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;B \leq 1.52 \cdot 10^{-220}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 6.2 \cdot 10^{+62}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;B \leq 6.4 \cdot 10^{+144}:\\
\;\;\;\;\frac{t_2 \cdot \left(\sqrt{2} \cdot \left(B \cdot \left(-\sqrt{F}\right)\right)\right)}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right) \cdot \left(\sqrt{2} \cdot \frac{-1}{B}\right)\\
\end{array}
\end{array}
if B < 1.74999999999999996e-273 or 1.52e-220 < B < 6.20000000000000029e62Initial program 26.6%
associate-*l*26.6%
unpow226.6%
+-commutative26.6%
unpow226.6%
associate-*l*26.6%
unpow226.6%
Simplified26.6%
sqrt-prod28.7%
*-commutative28.7%
*-commutative28.7%
associate-+l+29.3%
unpow229.3%
hypot-udef36.7%
associate-+r+35.7%
+-commutative35.7%
associate-+r+36.4%
Applied egg-rr36.4%
if 1.74999999999999996e-273 < B < 1.52e-220Initial program 21.2%
Simplified43.2%
Taylor expanded in C around -inf 61.0%
if 6.20000000000000029e62 < B < 6.4000000000000002e144Initial program 37.3%
associate-*l*37.3%
unpow237.3%
+-commutative37.3%
unpow237.3%
associate-*l*37.3%
unpow237.3%
Simplified37.3%
sqrt-prod58.2%
*-commutative58.2%
*-commutative58.2%
associate-+l+58.2%
unpow258.2%
hypot-udef72.0%
associate-+r+72.0%
+-commutative72.0%
associate-+r+72.1%
Applied egg-rr72.1%
Taylor expanded in B around inf 85.4%
associate-*l*85.5%
Simplified85.5%
if 6.4000000000000002e144 < B Initial program 2.9%
Simplified2.9%
Taylor expanded in C around 0 5.2%
mul-1-neg5.2%
unpow25.2%
unpow25.2%
Simplified5.2%
sqrt-prod7.0%
hypot-udef84.5%
Applied egg-rr84.5%
div-inv84.5%
Applied egg-rr84.5%
Final simplification46.6%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma C (* A -4.0) (* B B)))
(t_1 (- (* B B) (* 4.0 (* A C))))
(t_2
(/
(* (sqrt (+ C (+ A (hypot B (- A C))))) (- (sqrt (* 2.0 (* F t_1)))))
t_1)))
(if (<= B 3.8e-272)
t_2
(if (<= B 1.52e-220)
(/ (- (sqrt (* 2.0 (* (* F t_0) (* 2.0 A))))) t_0)
(if (<= B 5.5e+56)
t_2
(*
(* (sqrt F) (sqrt (+ A (hypot B A))))
(* (sqrt 2.0) (/ -1.0 B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(C, (A * -4.0), (B * B));
double t_1 = (B * B) - (4.0 * (A * C));
double t_2 = (sqrt((C + (A + hypot(B, (A - C))))) * -sqrt((2.0 * (F * t_1)))) / t_1;
double tmp;
if (B <= 3.8e-272) {
tmp = t_2;
} else if (B <= 1.52e-220) {
tmp = -sqrt((2.0 * ((F * t_0) * (2.0 * A)))) / t_0;
} else if (B <= 5.5e+56) {
tmp = t_2;
} else {
tmp = (sqrt(F) * sqrt((A + hypot(B, A)))) * (sqrt(2.0) * (-1.0 / B));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(C, Float64(A * -4.0), Float64(B * B)) t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) t_2 = Float64(Float64(sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) * Float64(-sqrt(Float64(2.0 * Float64(F * t_1))))) / t_1) tmp = 0.0 if (B <= 3.8e-272) tmp = t_2; elseif (B <= 1.52e-220) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(2.0 * A))))) / t_0); elseif (B <= 5.5e+56) tmp = t_2; else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B, A)))) * Float64(sqrt(2.0) * Float64(-1.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[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[B, 3.8e-272], t$95$2, If[LessEqual[B, 1.52e-220], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 5.5e+56], t$95$2, N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\\
t_1 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_2 := \frac{\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_1\right)}\right)}{t_1}\\
\mathbf{if}\;B \leq 3.8 \cdot 10^{-272}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;B \leq 1.52 \cdot 10^{-220}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 5.5 \cdot 10^{+56}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right) \cdot \left(\sqrt{2} \cdot \frac{-1}{B}\right)\\
\end{array}
\end{array}
if B < 3.7999999999999997e-272 or 1.52e-220 < B < 5.5000000000000002e56Initial program 26.2%
associate-*l*26.2%
unpow226.2%
+-commutative26.2%
unpow226.2%
associate-*l*26.2%
unpow226.2%
Simplified26.2%
sqrt-prod28.4%
*-commutative28.4%
*-commutative28.4%
associate-+l+29.0%
unpow229.0%
hypot-udef36.4%
associate-+r+35.4%
+-commutative35.4%
associate-+r+36.1%
Applied egg-rr36.1%
if 3.7999999999999997e-272 < B < 1.52e-220Initial program 21.2%
Simplified43.2%
Taylor expanded in C around -inf 61.0%
if 5.5000000000000002e56 < B Initial program 14.5%
Simplified14.5%
Taylor expanded in C around 0 22.2%
mul-1-neg22.2%
unpow222.2%
unpow222.2%
Simplified22.2%
sqrt-prod25.4%
hypot-udef79.7%
Applied egg-rr79.7%
div-inv79.7%
Applied egg-rr79.7%
Final simplification45.6%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma C (* A -4.0) (* B B)))
(t_1 (- (* B B) (* 4.0 (* A C))))
(t_2
(/
(* (sqrt (+ C (+ A (hypot B (- A C))))) (- (sqrt (* 2.0 (* F t_1)))))
t_1)))
(if (<= B 4.8e-272)
t_2
(if (<= B 8.5e-221)
(/ (- (sqrt (* 2.0 (* (* F t_0) (* 2.0 A))))) t_0)
(if (<= B 8e+56)
t_2
(* (* (sqrt F) (sqrt (+ A (hypot B A)))) (/ (- (sqrt 2.0)) B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(C, (A * -4.0), (B * B));
double t_1 = (B * B) - (4.0 * (A * C));
double t_2 = (sqrt((C + (A + hypot(B, (A - C))))) * -sqrt((2.0 * (F * t_1)))) / t_1;
double tmp;
if (B <= 4.8e-272) {
tmp = t_2;
} else if (B <= 8.5e-221) {
tmp = -sqrt((2.0 * ((F * t_0) * (2.0 * A)))) / t_0;
} else if (B <= 8e+56) {
tmp = t_2;
} else {
tmp = (sqrt(F) * sqrt((A + hypot(B, A)))) * (-sqrt(2.0) / B);
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(C, Float64(A * -4.0), Float64(B * B)) t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) t_2 = Float64(Float64(sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) * Float64(-sqrt(Float64(2.0 * Float64(F * t_1))))) / t_1) tmp = 0.0 if (B <= 4.8e-272) tmp = t_2; elseif (B <= 8.5e-221) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(2.0 * A))))) / t_0); elseif (B <= 8e+56) tmp = t_2; else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B, A)))) * 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[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[B, 4.8e-272], t$95$2, If[LessEqual[B, 8.5e-221], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 8e+56], t$95$2, N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\\
t_1 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_2 := \frac{\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_1\right)}\right)}{t_1}\\
\mathbf{if}\;B \leq 4.8 \cdot 10^{-272}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;B \leq 8.5 \cdot 10^{-221}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 8 \cdot 10^{+56}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right) \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
\end{array}
if B < 4.7999999999999998e-272 or 8.49999999999999984e-221 < B < 8.00000000000000074e56Initial program 26.2%
associate-*l*26.2%
unpow226.2%
+-commutative26.2%
unpow226.2%
associate-*l*26.2%
unpow226.2%
Simplified26.2%
sqrt-prod28.4%
*-commutative28.4%
*-commutative28.4%
associate-+l+29.0%
unpow229.0%
hypot-udef36.4%
associate-+r+35.4%
+-commutative35.4%
associate-+r+36.1%
Applied egg-rr36.1%
if 4.7999999999999998e-272 < B < 8.49999999999999984e-221Initial program 21.2%
Simplified43.2%
Taylor expanded in C around -inf 61.0%
if 8.00000000000000074e56 < B Initial program 14.5%
Simplified14.5%
Taylor expanded in C around 0 22.2%
mul-1-neg22.2%
unpow222.2%
unpow222.2%
Simplified22.2%
sqrt-prod25.4%
hypot-udef79.7%
Applied egg-rr79.7%
Final simplification45.6%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma C (* A -4.0) (* B B)))
(t_1 (- (* B B) (* 4.0 (* A C))))
(t_2
(/
(* (sqrt (+ C (+ A (hypot B (- A C))))) (- (sqrt (* 2.0 (* F t_1)))))
t_1)))
(if (<= B 5.6e-272)
t_2
(if (<= B 6.6e-221)
(/ (- (sqrt (* 2.0 (* (* F t_0) (* 2.0 A))))) t_0)
(if (<= B 7.2e+56)
t_2
(* (* (sqrt F) (sqrt B)) (* (sqrt 2.0) (/ -1.0 B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(C, (A * -4.0), (B * B));
double t_1 = (B * B) - (4.0 * (A * C));
double t_2 = (sqrt((C + (A + hypot(B, (A - C))))) * -sqrt((2.0 * (F * t_1)))) / t_1;
double tmp;
if (B <= 5.6e-272) {
tmp = t_2;
} else if (B <= 6.6e-221) {
tmp = -sqrt((2.0 * ((F * t_0) * (2.0 * A)))) / t_0;
} else if (B <= 7.2e+56) {
tmp = t_2;
} else {
tmp = (sqrt(F) * sqrt(B)) * (sqrt(2.0) * (-1.0 / B));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(C, Float64(A * -4.0), Float64(B * B)) t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) t_2 = Float64(Float64(sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) * Float64(-sqrt(Float64(2.0 * Float64(F * t_1))))) / t_1) tmp = 0.0 if (B <= 5.6e-272) tmp = t_2; elseif (B <= 6.6e-221) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(2.0 * A))))) / t_0); elseif (B <= 7.2e+56) tmp = t_2; else tmp = Float64(Float64(sqrt(F) * sqrt(B)) * Float64(sqrt(2.0) * Float64(-1.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[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[B, 5.6e-272], t$95$2, If[LessEqual[B, 6.6e-221], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 7.2e+56], t$95$2, N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[B], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\\
t_1 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_2 := \frac{\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_1\right)}\right)}{t_1}\\
\mathbf{if}\;B \leq 5.6 \cdot 10^{-272}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;B \leq 6.6 \cdot 10^{-221}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 7.2 \cdot 10^{+56}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{B}\right) \cdot \left(\sqrt{2} \cdot \frac{-1}{B}\right)\\
\end{array}
\end{array}
if B < 5.59999999999999987e-272 or 6.59999999999999979e-221 < B < 7.19999999999999996e56Initial program 26.2%
associate-*l*26.2%
unpow226.2%
+-commutative26.2%
unpow226.2%
associate-*l*26.2%
unpow226.2%
Simplified26.2%
sqrt-prod28.4%
*-commutative28.4%
*-commutative28.4%
associate-+l+29.0%
unpow229.0%
hypot-udef36.4%
associate-+r+35.4%
+-commutative35.4%
associate-+r+36.1%
Applied egg-rr36.1%
if 5.59999999999999987e-272 < B < 6.59999999999999979e-221Initial program 21.2%
Simplified43.2%
Taylor expanded in C around -inf 61.0%
if 7.19999999999999996e56 < B Initial program 14.5%
Simplified14.5%
Taylor expanded in C around 0 22.2%
mul-1-neg22.2%
unpow222.2%
unpow222.2%
Simplified22.2%
sqrt-prod25.4%
hypot-udef79.7%
Applied egg-rr79.7%
div-inv79.7%
Applied egg-rr79.7%
Taylor expanded in A around 0 78.0%
Final simplification45.2%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma C (* A -4.0) (* B B)))
(t_1 (- (* B B) (* 4.0 (* A C))))
(t_2 (+ C (+ A (hypot B (- A C))))))
(if (<= B 2.52e-272)
(/ (* (sqrt t_2) (- (sqrt (* 2.0 (* -4.0 (* A (* C F))))))) t_1)
(if (<= B 6.2e-220)
(/ (- (sqrt (* 2.0 (* (* F t_0) (* 2.0 A))))) t_0)
(if (<= B 6.2e+78)
(* (sqrt (* 2.0 (* t_2 (* F t_1)))) (/ -1.0 t_1))
(* (* (sqrt F) (sqrt B)) (* (sqrt 2.0) (/ -1.0 B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(C, (A * -4.0), (B * B));
double t_1 = (B * B) - (4.0 * (A * C));
double t_2 = C + (A + hypot(B, (A - C)));
double tmp;
if (B <= 2.52e-272) {
tmp = (sqrt(t_2) * -sqrt((2.0 * (-4.0 * (A * (C * F)))))) / t_1;
} else if (B <= 6.2e-220) {
tmp = -sqrt((2.0 * ((F * t_0) * (2.0 * A)))) / t_0;
} else if (B <= 6.2e+78) {
tmp = sqrt((2.0 * (t_2 * (F * t_1)))) * (-1.0 / t_1);
} else {
tmp = (sqrt(F) * sqrt(B)) * (sqrt(2.0) * (-1.0 / B));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(C, Float64(A * -4.0), Float64(B * B)) t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) t_2 = Float64(C + Float64(A + hypot(B, Float64(A - C)))) tmp = 0.0 if (B <= 2.52e-272) tmp = Float64(Float64(sqrt(t_2) * Float64(-sqrt(Float64(2.0 * Float64(-4.0 * Float64(A * Float64(C * F))))))) / t_1); elseif (B <= 6.2e-220) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(2.0 * A))))) / t_0); elseif (B <= 6.2e+78) tmp = Float64(sqrt(Float64(2.0 * Float64(t_2 * Float64(F * t_1)))) * Float64(-1.0 / t_1)); else tmp = Float64(Float64(sqrt(F) * sqrt(B)) * Float64(sqrt(2.0) * Float64(-1.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[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 2.52e-272], N[(N[(N[Sqrt[t$95$2], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(-4.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B, 6.2e-220], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 6.2e+78], N[(N[Sqrt[N[(2.0 * N[(t$95$2 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[B], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\\
t_1 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_2 := C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\\
\mathbf{if}\;B \leq 2.52 \cdot 10^{-272}:\\
\;\;\;\;\frac{\sqrt{t_2} \cdot \left(-\sqrt{2 \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}\right)}{t_1}\\
\mathbf{elif}\;B \leq 6.2 \cdot 10^{-220}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 6.2 \cdot 10^{+78}:\\
\;\;\;\;\sqrt{2 \cdot \left(t_2 \cdot \left(F \cdot t_1\right)\right)} \cdot \frac{-1}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{B}\right) \cdot \left(\sqrt{2} \cdot \frac{-1}{B}\right)\\
\end{array}
\end{array}
if B < 2.51999999999999991e-272Initial program 20.4%
associate-*l*20.4%
unpow220.4%
+-commutative20.4%
unpow220.4%
associate-*l*20.4%
unpow220.4%
Simplified20.4%
sqrt-prod22.9%
*-commutative22.9%
*-commutative22.9%
associate-+l+23.7%
unpow223.7%
hypot-udef29.6%
associate-+r+28.4%
+-commutative28.4%
associate-+r+28.8%
Applied egg-rr28.8%
Taylor expanded in B around 0 15.6%
if 2.51999999999999991e-272 < B < 6.20000000000000023e-220Initial program 21.2%
Simplified43.2%
Taylor expanded in C around -inf 61.0%
if 6.20000000000000023e-220 < B < 6.2e78Initial program 44.9%
associate-*l*44.9%
unpow244.9%
+-commutative44.9%
unpow244.9%
associate-*l*44.9%
unpow244.9%
Simplified44.9%
div-inv44.9%
Applied egg-rr53.9%
if 6.2e78 < B Initial program 9.1%
Simplified9.1%
Taylor expanded in C around 0 17.3%
mul-1-neg17.3%
unpow217.3%
unpow217.3%
Simplified17.3%
sqrt-prod20.6%
hypot-udef78.4%
Applied egg-rr78.4%
div-inv78.4%
Applied egg-rr78.4%
Taylor expanded in A around 0 76.7%
Final simplification37.0%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma C (* A -4.0) (* B B))) (t_1 (- (* B B) (* 4.0 (* A C)))))
(if (<= B 3.85e-274)
(/
(*
(* (sqrt 2.0) (sqrt (* F (+ (* B B) (* -4.0 (* A C))))))
(- (sqrt (* 2.0 C))))
t_1)
(if (<= B 1.1e-220)
(/ (- (sqrt (* 2.0 (* (* F t_0) (* 2.0 A))))) t_0)
(if (<= B 2.85e+79)
(*
(sqrt (* 2.0 (* (+ C (+ A (hypot B (- A C)))) (* F t_1))))
(/ -1.0 t_1))
(* (* (sqrt F) (sqrt B)) (* (sqrt 2.0) (/ -1.0 B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(C, (A * -4.0), (B * B));
double t_1 = (B * B) - (4.0 * (A * C));
double tmp;
if (B <= 3.85e-274) {
tmp = ((sqrt(2.0) * sqrt((F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((2.0 * C))) / t_1;
} else if (B <= 1.1e-220) {
tmp = -sqrt((2.0 * ((F * t_0) * (2.0 * A)))) / t_0;
} else if (B <= 2.85e+79) {
tmp = sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * t_1)))) * (-1.0 / t_1);
} else {
tmp = (sqrt(F) * sqrt(B)) * (sqrt(2.0) * (-1.0 / B));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(C, Float64(A * -4.0), Float64(B * B)) t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) tmp = 0.0 if (B <= 3.85e-274) tmp = Float64(Float64(Float64(sqrt(2.0) * sqrt(Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))))) * Float64(-sqrt(Float64(2.0 * C)))) / t_1); elseif (B <= 1.1e-220) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(2.0 * A))))) / t_0); elseif (B <= 2.85e+79) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(C + Float64(A + hypot(B, Float64(A - C)))) * Float64(F * t_1)))) * Float64(-1.0 / t_1)); else tmp = Float64(Float64(sqrt(F) * sqrt(B)) * Float64(sqrt(2.0) * Float64(-1.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[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 3.85e-274], N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * (-N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B, 1.1e-220], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 2.85e+79], N[(N[Sqrt[N[(2.0 * N[(N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[B], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\\
t_1 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 3.85 \cdot 10^{-274}:\\
\;\;\;\;\frac{\left(\sqrt{2} \cdot \sqrt{F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)}\right) \cdot \left(-\sqrt{2 \cdot C}\right)}{t_1}\\
\mathbf{elif}\;B \leq 1.1 \cdot 10^{-220}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 2.85 \cdot 10^{+79}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_1\right)\right)} \cdot \frac{-1}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{B}\right) \cdot \left(\sqrt{2} \cdot \frac{-1}{B}\right)\\
\end{array}
\end{array}
if B < 3.84999999999999985e-274Initial program 20.4%
associate-*l*20.4%
unpow220.4%
+-commutative20.4%
unpow220.4%
associate-*l*20.4%
unpow220.4%
Simplified20.4%
sqrt-prod22.9%
*-commutative22.9%
*-commutative22.9%
associate-+l+23.7%
unpow223.7%
hypot-udef29.6%
associate-+r+28.4%
+-commutative28.4%
associate-+r+28.8%
Applied egg-rr28.8%
sqrt-prod28.8%
cancel-sign-sub-inv28.8%
*-commutative28.8%
metadata-eval28.8%
*-commutative28.8%
Applied egg-rr28.8%
Taylor expanded in C around inf 11.1%
if 3.84999999999999985e-274 < B < 1.09999999999999993e-220Initial program 21.2%
Simplified43.2%
Taylor expanded in C around -inf 61.0%
if 1.09999999999999993e-220 < B < 2.8499999999999998e79Initial program 44.9%
associate-*l*44.9%
unpow244.9%
+-commutative44.9%
unpow244.9%
associate-*l*44.9%
unpow244.9%
Simplified44.9%
div-inv44.9%
Applied egg-rr53.9%
if 2.8499999999999998e79 < B Initial program 9.1%
Simplified9.1%
Taylor expanded in C around 0 17.3%
mul-1-neg17.3%
unpow217.3%
unpow217.3%
Simplified17.3%
sqrt-prod20.6%
hypot-udef78.4%
Applied egg-rr78.4%
div-inv78.4%
Applied egg-rr78.4%
Taylor expanded in A around 0 76.7%
Final simplification34.4%
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 (<= B 6.7e+80)
(*
(sqrt (* 2.0 (* (+ C (+ A (hypot B (- A C)))) (* F t_0))))
(/ -1.0 t_0))
(* (* (sqrt F) (sqrt B)) (* (sqrt 2.0) (/ -1.0 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 (B <= 6.7e+80) {
tmp = sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * t_0)))) * (-1.0 / t_0);
} else {
tmp = (sqrt(F) * sqrt(B)) * (sqrt(2.0) * (-1.0 / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (B <= 6.7e+80) {
tmp = Math.sqrt((2.0 * ((C + (A + Math.hypot(B, (A - C)))) * (F * t_0)))) * (-1.0 / t_0);
} else {
tmp = (Math.sqrt(F) * Math.sqrt(B)) * (Math.sqrt(2.0) * (-1.0 / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if B <= 6.7e+80: tmp = math.sqrt((2.0 * ((C + (A + math.hypot(B, (A - C)))) * (F * t_0)))) * (-1.0 / t_0) else: tmp = (math.sqrt(F) * math.sqrt(B)) * (math.sqrt(2.0) * (-1.0 / 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 (B <= 6.7e+80) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(C + Float64(A + hypot(B, Float64(A - C)))) * Float64(F * t_0)))) * Float64(-1.0 / t_0)); else tmp = Float64(Float64(sqrt(F) * sqrt(B)) * Float64(sqrt(2.0) * Float64(-1.0 / 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 (B <= 6.7e+80) tmp = sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * t_0)))) * (-1.0 / t_0); else tmp = (sqrt(F) * sqrt(B)) * (sqrt(2.0) * (-1.0 / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 6.7e+80], N[(N[Sqrt[N[(2.0 * N[(N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[B], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-1.0 / 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}\;B \leq 6.7 \cdot 10^{+80}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)} \cdot \frac{-1}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{B}\right) \cdot \left(\sqrt{2} \cdot \frac{-1}{B}\right)\\
\end{array}
\end{array}
if B < 6.69999999999999983e80Initial program 27.0%
associate-*l*27.0%
unpow227.0%
+-commutative27.0%
unpow227.0%
associate-*l*27.0%
unpow227.0%
Simplified27.0%
div-inv27.1%
Applied egg-rr32.2%
if 6.69999999999999983e80 < B Initial program 9.1%
Simplified9.1%
Taylor expanded in C around 0 17.3%
mul-1-neg17.3%
unpow217.3%
unpow217.3%
Simplified17.3%
sqrt-prod20.6%
hypot-udef78.4%
Applied egg-rr78.4%
div-inv78.4%
Applied egg-rr78.4%
Taylor expanded in A around 0 76.7%
Final simplification40.4%
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 (<= B 6.7e+78)
(*
(sqrt (* 2.0 (* (+ C (+ A (hypot B (- A C)))) (* F t_0))))
(/ -1.0 t_0))
(* (/ (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 (B <= 6.7e+78) {
tmp = sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * t_0)))) * (-1.0 / t_0);
} 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 (B <= 6.7e+78) {
tmp = Math.sqrt((2.0 * ((C + (A + Math.hypot(B, (A - C)))) * (F * t_0)))) * (-1.0 / t_0);
} 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 B <= 6.7e+78: tmp = math.sqrt((2.0 * ((C + (A + math.hypot(B, (A - C)))) * (F * t_0)))) * (-1.0 / t_0) 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 (B <= 6.7e+78) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(C + Float64(A + hypot(B, Float64(A - C)))) * Float64(F * t_0)))) * Float64(-1.0 / t_0)); 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 (B <= 6.7e+78) tmp = sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * t_0)))) * (-1.0 / t_0); 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[B, 6.7e+78], N[(N[Sqrt[N[(2.0 * N[(N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[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}\;B \leq 6.7 \cdot 10^{+78}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)} \cdot \frac{-1}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B}\right)\right)\\
\end{array}
\end{array}
if B < 6.69999999999999967e78Initial program 27.0%
associate-*l*27.0%
unpow227.0%
+-commutative27.0%
unpow227.0%
associate-*l*27.0%
unpow227.0%
Simplified27.0%
div-inv27.1%
Applied egg-rr32.2%
if 6.69999999999999967e78 < B Initial program 9.1%
Simplified9.1%
Taylor expanded in C around 0 17.3%
mul-1-neg17.3%
unpow217.3%
unpow217.3%
Simplified17.3%
sqrt-prod20.6%
hypot-udef78.4%
Applied egg-rr78.4%
Taylor expanded in A around 0 76.6%
Final simplification40.4%
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 6e-291)
(*
(sqrt (* 2.0 (* (+ C (+ A (hypot B (- A C)))) (* F t_0))))
(/ -1.0 t_0))
(if (<= F 0.15)
(* (sqrt (* 2.0 (* F (+ A (hypot B A))))) (/ -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) - (4.0 * (A * C));
double tmp;
if (F <= 6e-291) {
tmp = sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * t_0)))) * (-1.0 / t_0);
} else if (F <= 0.15) {
tmp = sqrt((2.0 * (F * (A + hypot(B, A))))) * (-1.0 / B);
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (F <= 6e-291) {
tmp = Math.sqrt((2.0 * ((C + (A + Math.hypot(B, (A - C)))) * (F * t_0)))) * (-1.0 / t_0);
} else if (F <= 0.15) {
tmp = Math.sqrt((2.0 * (F * (A + Math.hypot(B, A))))) * (-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) - (4.0 * (A * C)) tmp = 0 if F <= 6e-291: tmp = math.sqrt((2.0 * ((C + (A + math.hypot(B, (A - C)))) * (F * t_0)))) * (-1.0 / t_0) elif F <= 0.15: tmp = math.sqrt((2.0 * (F * (A + math.hypot(B, A))))) * (-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(4.0 * Float64(A * C))) tmp = 0.0 if (F <= 6e-291) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(C + Float64(A + hypot(B, Float64(A - C)))) * Float64(F * t_0)))) * Float64(-1.0 / t_0)); elseif (F <= 0.15) tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A + hypot(B, A))))) * 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) - (4.0 * (A * C)); tmp = 0.0; if (F <= 6e-291) tmp = sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * t_0)))) * (-1.0 / t_0); elseif (F <= 0.15) tmp = sqrt((2.0 * (F * (A + hypot(B, A))))) * (-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[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, 6e-291], N[(N[Sqrt[N[(2.0 * N[(N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.15], N[(N[Sqrt[N[(2.0 * N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;F \leq 6 \cdot 10^{-291}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)} \cdot \frac{-1}{t_0}\\
\mathbf{elif}\;F \leq 0.15:\\
\;\;\;\;\sqrt{2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right)} \cdot \frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 6.0000000000000001e-291Initial program 49.0%
associate-*l*49.0%
unpow249.0%
+-commutative49.0%
unpow249.0%
associate-*l*49.0%
unpow249.0%
Simplified49.0%
div-inv49.2%
Applied egg-rr58.8%
if 6.0000000000000001e-291 < F < 0.149999999999999994Initial program 23.4%
Simplified28.0%
Taylor expanded in C around 0 14.8%
mul-1-neg14.8%
unpow214.8%
unpow214.8%
Simplified14.8%
sqrt-prod14.8%
hypot-udef24.5%
Applied egg-rr24.5%
associate-*l/24.5%
sqrt-unprod24.5%
Applied egg-rr24.5%
div-inv24.5%
sqrt-unprod24.6%
Applied egg-rr24.6%
if 0.149999999999999994 < F Initial program 14.5%
Simplified16.3%
Taylor expanded in C around 0 7.8%
mul-1-neg7.8%
unpow27.8%
unpow27.8%
Simplified7.8%
sqrt-prod9.3%
hypot-udef27.0%
Applied egg-rr27.0%
Taylor expanded in A around 0 23.5%
Final simplification29.5%
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 3.15e-291)
(/ (- (sqrt (* 2.0 (* (+ C (+ A (hypot B (- A C)))) (* F t_0))))) t_0)
(if (<= F 0.125)
(* (sqrt (* 2.0 (* F (+ A (hypot B A))))) (/ -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) - (4.0 * (A * C));
double tmp;
if (F <= 3.15e-291) {
tmp = -sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * t_0)))) / t_0;
} else if (F <= 0.125) {
tmp = sqrt((2.0 * (F * (A + hypot(B, A))))) * (-1.0 / B);
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (F <= 3.15e-291) {
tmp = -Math.sqrt((2.0 * ((C + (A + Math.hypot(B, (A - C)))) * (F * t_0)))) / t_0;
} else if (F <= 0.125) {
tmp = Math.sqrt((2.0 * (F * (A + Math.hypot(B, A))))) * (-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) - (4.0 * (A * C)) tmp = 0 if F <= 3.15e-291: tmp = -math.sqrt((2.0 * ((C + (A + math.hypot(B, (A - C)))) * (F * t_0)))) / t_0 elif F <= 0.125: tmp = math.sqrt((2.0 * (F * (A + math.hypot(B, A))))) * (-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(4.0 * Float64(A * C))) tmp = 0.0 if (F <= 3.15e-291) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(C + Float64(A + hypot(B, Float64(A - C)))) * Float64(F * t_0))))) / t_0); elseif (F <= 0.125) tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A + hypot(B, A))))) * 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) - (4.0 * (A * C)); tmp = 0.0; if (F <= 3.15e-291) tmp = -sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * t_0)))) / t_0; elseif (F <= 0.125) tmp = sqrt((2.0 * (F * (A + hypot(B, A))))) * (-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[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, 3.15e-291], N[((-N[Sqrt[N[(2.0 * N[(N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[F, 0.125], N[(N[Sqrt[N[(2.0 * N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;F \leq 3.15 \cdot 10^{-291}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\
\mathbf{elif}\;F \leq 0.125:\\
\;\;\;\;\sqrt{2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right)} \cdot \frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 3.14999999999999996e-291Initial program 49.0%
associate-*l*49.0%
unpow249.0%
+-commutative49.0%
unpow249.0%
associate-*l*49.0%
unpow249.0%
Simplified49.0%
distribute-frac-neg49.0%
Applied egg-rr58.8%
if 3.14999999999999996e-291 < F < 0.125Initial program 23.4%
Simplified28.0%
Taylor expanded in C around 0 14.8%
mul-1-neg14.8%
unpow214.8%
unpow214.8%
Simplified14.8%
sqrt-prod14.8%
hypot-udef24.5%
Applied egg-rr24.5%
associate-*l/24.5%
sqrt-unprod24.5%
Applied egg-rr24.5%
div-inv24.5%
sqrt-unprod24.6%
Applied egg-rr24.6%
if 0.125 < F Initial program 14.5%
Simplified16.3%
Taylor expanded in C around 0 7.8%
mul-1-neg7.8%
unpow27.8%
unpow27.8%
Simplified7.8%
sqrt-prod9.3%
hypot-udef27.0%
Applied egg-rr27.0%
Taylor expanded in A around 0 23.5%
Final simplification29.5%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= F -4.4e-298)
(/
(*
(sqrt (* 2.0 (* F (+ (* B B) (* -4.0 (* A C))))))
(- (sqrt (+ A (+ A C)))))
(- (* B B) (* 4.0 (* A C))))
(if (<= F 0.14)
(* (sqrt (* 2.0 (* F (+ A (hypot B A))))) (/ -1.0 B))
(* (sqrt 2.0) (- (sqrt (/ F B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= -4.4e-298) {
tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (A + C)))) / ((B * B) - (4.0 * (A * C)));
} else if (F <= 0.14) {
tmp = sqrt((2.0 * (F * (A + hypot(B, A))))) * (-1.0 / B);
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (F <= -4.4e-298) {
tmp = (Math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -Math.sqrt((A + (A + C)))) / ((B * B) - (4.0 * (A * C)));
} else if (F <= 0.14) {
tmp = Math.sqrt((2.0 * (F * (A + Math.hypot(B, A))))) * (-1.0 / B);
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if F <= -4.4e-298: tmp = (math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -math.sqrt((A + (A + C)))) / ((B * B) - (4.0 * (A * C))) elif F <= 0.14: tmp = math.sqrt((2.0 * (F * (A + math.hypot(B, A))))) * (-1.0 / B) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= -4.4e-298) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))))) * Float64(-sqrt(Float64(A + Float64(A + C))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))); elseif (F <= 0.14) tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A + hypot(B, A))))) * 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) tmp = 0.0; if (F <= -4.4e-298) tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (A + C)))) / ((B * B) - (4.0 * (A * C))); elseif (F <= 0.14) tmp = sqrt((2.0 * (F * (A + hypot(B, A))))) * (-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_] := If[LessEqual[F, -4.4e-298], 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[(A + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.14], N[(N[Sqrt[N[(2.0 * N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.4 \cdot 10^{-298}:\\
\;\;\;\;\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(A + C\right)}\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
\mathbf{elif}\;F \leq 0.14:\\
\;\;\;\;\sqrt{2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right)} \cdot \frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < -4.4e-298Initial program 52.0%
associate-*l*52.0%
unpow252.0%
+-commutative52.0%
unpow252.0%
associate-*l*52.0%
unpow252.0%
Simplified52.0%
Taylor expanded in A around inf 44.8%
sqrt-prod46.5%
*-commutative46.5%
cancel-sign-sub-inv46.5%
metadata-eval46.5%
*-commutative46.5%
associate-+l+46.5%
Applied egg-rr46.5%
if -4.4e-298 < F < 0.14000000000000001Initial program 23.6%
Simplified28.1%
Taylor expanded in C around 0 14.7%
mul-1-neg14.7%
unpow214.7%
unpow214.7%
Simplified14.7%
sqrt-prod14.7%
hypot-udef23.9%
Applied egg-rr23.9%
associate-*l/24.0%
sqrt-unprod24.0%
Applied egg-rr24.0%
div-inv24.0%
sqrt-unprod24.0%
Applied egg-rr24.0%
if 0.14000000000000001 < F Initial program 14.5%
Simplified16.3%
Taylor expanded in C around 0 7.8%
mul-1-neg7.8%
unpow27.8%
unpow27.8%
Simplified7.8%
sqrt-prod9.3%
hypot-udef27.0%
Applied egg-rr27.0%
Taylor expanded in A around 0 23.5%
Final simplification26.9%
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 -4.4e-298)
(* (sqrt (* 2.0 (* (* F t_0) (+ A (+ A C))))) (/ -1.0 t_0))
(if (<= F 0.15)
(* (sqrt (* 2.0 (* F (+ A (hypot B A))))) (/ -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) + (-4.0 * (A * C));
double tmp;
if (F <= -4.4e-298) {
tmp = sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0);
} else if (F <= 0.15) {
tmp = sqrt((2.0 * (F * (A + hypot(B, A))))) * (-1.0 / B);
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double tmp;
if (F <= -4.4e-298) {
tmp = Math.sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0);
} else if (F <= 0.15) {
tmp = Math.sqrt((2.0 * (F * (A + Math.hypot(B, A))))) * (-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) + (-4.0 * (A * C)) tmp = 0 if F <= -4.4e-298: tmp = math.sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0) elif F <= 0.15: tmp = math.sqrt((2.0 * (F * (A + math.hypot(B, A))))) * (-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(-4.0 * Float64(A * C))) tmp = 0.0 if (F <= -4.4e-298) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(A + C))))) * Float64(-1.0 / t_0)); elseif (F <= 0.15) tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A + hypot(B, A))))) * 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) + (-4.0 * (A * C)); tmp = 0.0; if (F <= -4.4e-298) tmp = sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0); elseif (F <= 0.15) tmp = sqrt((2.0 * (F * (A + hypot(B, A))))) * (-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[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4.4e-298], N[(N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.15], N[(N[Sqrt[N[(2.0 * N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;F \leq -4.4 \cdot 10^{-298}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(A + C\right)\right)\right)} \cdot \frac{-1}{t_0}\\
\mathbf{elif}\;F \leq 0.15:\\
\;\;\;\;\sqrt{2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right)} \cdot \frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < -4.4e-298Initial program 52.0%
associate-*l*52.0%
unpow252.0%
+-commutative52.0%
unpow252.0%
associate-*l*52.0%
unpow252.0%
Simplified52.0%
Taylor expanded in A around inf 44.8%
div-inv44.9%
associate-*l*44.9%
*-commutative44.9%
cancel-sign-sub-inv44.9%
metadata-eval44.9%
*-commutative44.9%
associate-+l+44.9%
cancel-sign-sub-inv44.9%
metadata-eval44.9%
Applied egg-rr44.9%
if -4.4e-298 < F < 0.149999999999999994Initial program 23.6%
Simplified28.1%
Taylor expanded in C around 0 14.7%
mul-1-neg14.7%
unpow214.7%
unpow214.7%
Simplified14.7%
sqrt-prod14.7%
hypot-udef23.9%
Applied egg-rr23.9%
associate-*l/24.0%
sqrt-unprod24.0%
Applied egg-rr24.0%
div-inv24.0%
sqrt-unprod24.0%
Applied egg-rr24.0%
if 0.149999999999999994 < F Initial program 14.5%
Simplified16.3%
Taylor expanded in C around 0 7.8%
mul-1-neg7.8%
unpow27.8%
unpow27.8%
Simplified7.8%
sqrt-prod9.3%
hypot-udef27.0%
Applied egg-rr27.0%
Taylor expanded in A around 0 23.5%
Final simplification26.6%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
(if (<= F -4.4e-298)
(* (sqrt (* 2.0 (* (* F t_0) (+ A (+ A C))))) (/ -1.0 t_0))
(if (<= F 0.15)
(/ (- (sqrt (* 2.0 (* F (+ A (hypot B A)))))) 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 <= -4.4e-298) {
tmp = sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0);
} else if (F <= 0.15) {
tmp = -sqrt((2.0 * (F * (A + hypot(B, A))))) / 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 <= -4.4e-298) {
tmp = Math.sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0);
} else if (F <= 0.15) {
tmp = -Math.sqrt((2.0 * (F * (A + Math.hypot(B, A))))) / 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 <= -4.4e-298: tmp = math.sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0) elif F <= 0.15: tmp = -math.sqrt((2.0 * (F * (A + math.hypot(B, A))))) / 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 <= -4.4e-298) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(A + C))))) * Float64(-1.0 / t_0)); elseif (F <= 0.15) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(A + hypot(B, A)))))) / 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 <= -4.4e-298) tmp = sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0); elseif (F <= 0.15) tmp = -sqrt((2.0 * (F * (A + hypot(B, A))))) / 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, -4.4e-298], N[(N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.15], N[((-N[Sqrt[N[(2.0 * N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 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 -4.4 \cdot 10^{-298}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(A + C\right)\right)\right)} \cdot \frac{-1}{t_0}\\
\mathbf{elif}\;F \leq 0.15:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right)}}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < -4.4e-298Initial program 52.0%
associate-*l*52.0%
unpow252.0%
+-commutative52.0%
unpow252.0%
associate-*l*52.0%
unpow252.0%
Simplified52.0%
Taylor expanded in A around inf 44.8%
div-inv44.9%
associate-*l*44.9%
*-commutative44.9%
cancel-sign-sub-inv44.9%
metadata-eval44.9%
*-commutative44.9%
associate-+l+44.9%
cancel-sign-sub-inv44.9%
metadata-eval44.9%
Applied egg-rr44.9%
if -4.4e-298 < F < 0.149999999999999994Initial program 23.6%
Simplified28.1%
Taylor expanded in C around 0 14.7%
mul-1-neg14.7%
unpow214.7%
unpow214.7%
Simplified14.7%
sqrt-prod14.7%
hypot-udef23.9%
Applied egg-rr23.9%
associate-*l/24.0%
sqrt-unprod24.0%
Applied egg-rr24.0%
sqrt-unprod24.0%
Applied egg-rr24.0%
if 0.149999999999999994 < F Initial program 14.5%
Simplified16.3%
Taylor expanded in C around 0 7.8%
mul-1-neg7.8%
unpow27.8%
unpow27.8%
Simplified7.8%
sqrt-prod9.3%
hypot-udef27.0%
Applied egg-rr27.0%
Taylor expanded in A around 0 23.5%
Final simplification26.6%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
(if (<= F -4.4e-298)
(* (sqrt (* 2.0 (* (* F t_0) (+ A (+ A C))))) (/ -1.0 t_0))
(if (<= F 1.4e-22)
(* (/ (sqrt 2.0) B) (- (sqrt (* B F))))
(* (sqrt 2.0) (- (sqrt (/ F B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double tmp;
if (F <= -4.4e-298) {
tmp = sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0);
} else if (F <= 1.4e-22) {
tmp = (sqrt(2.0) / B) * -sqrt((B * F));
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (b * b) + ((-4.0d0) * (a * c))
if (f <= (-4.4d-298)) then
tmp = sqrt((2.0d0 * ((f * t_0) * (a + (a + c))))) * ((-1.0d0) / t_0)
else if (f <= 1.4d-22) then
tmp = (sqrt(2.0d0) / b) * -sqrt((b * f))
else
tmp = sqrt(2.0d0) * -sqrt((f / b))
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double tmp;
if (F <= -4.4e-298) {
tmp = Math.sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0);
} else if (F <= 1.4e-22) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((B * F));
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) tmp = 0 if F <= -4.4e-298: tmp = math.sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0) elif F <= 1.4e-22: tmp = (math.sqrt(2.0) / B) * -math.sqrt((B * F)) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) tmp = 0.0 if (F <= -4.4e-298) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(A + C))))) * Float64(-1.0 / t_0)); elseif (F <= 1.4e-22) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(B * F)))); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); tmp = 0.0; if (F <= -4.4e-298) tmp = sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0); elseif (F <= 1.4e-22) tmp = (sqrt(2.0) / B) * -sqrt((B * F)); else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4.4e-298], N[(N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4e-22], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;F \leq -4.4 \cdot 10^{-298}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(A + C\right)\right)\right)} \cdot \frac{-1}{t_0}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{-22}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < -4.4e-298Initial program 52.0%
associate-*l*52.0%
unpow252.0%
+-commutative52.0%
unpow252.0%
associate-*l*52.0%
unpow252.0%
Simplified52.0%
Taylor expanded in A around inf 44.8%
div-inv44.9%
associate-*l*44.9%
*-commutative44.9%
cancel-sign-sub-inv44.9%
metadata-eval44.9%
*-commutative44.9%
associate-+l+44.9%
cancel-sign-sub-inv44.9%
metadata-eval44.9%
Applied egg-rr44.9%
if -4.4e-298 < F < 1.39999999999999997e-22Initial program 24.2%
Simplified28.8%
Taylor expanded in C around 0 15.1%
mul-1-neg15.1%
unpow215.1%
unpow215.1%
Simplified15.1%
Taylor expanded in A around 0 22.7%
if 1.39999999999999997e-22 < F Initial program 14.9%
Simplified16.7%
Taylor expanded in C around 0 8.1%
mul-1-neg8.1%
unpow28.1%
unpow28.1%
Simplified8.1%
sqrt-prod9.5%
hypot-udef25.6%
Applied egg-rr25.6%
Taylor expanded in A around 0 21.5%
Final simplification25.2%
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 -4.4e-298)
(* (sqrt (* 2.0 (* (* F t_0) (+ A (+ A C))))) (/ -1.0 t_0))
(if (<= F 1.85e-23)
(/ (* (sqrt (* B F)) (- (sqrt 2.0))) B)
(* (sqrt 2.0) (- (sqrt (/ F B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double tmp;
if (F <= -4.4e-298) {
tmp = sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0);
} else if (F <= 1.85e-23) {
tmp = (sqrt((B * F)) * -sqrt(2.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) + ((-4.0d0) * (a * c))
if (f <= (-4.4d-298)) then
tmp = sqrt((2.0d0 * ((f * t_0) * (a + (a + c))))) * ((-1.0d0) / t_0)
else if (f <= 1.85d-23) then
tmp = (sqrt((b * f)) * -sqrt(2.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) + (-4.0 * (A * C));
double tmp;
if (F <= -4.4e-298) {
tmp = Math.sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0);
} else if (F <= 1.85e-23) {
tmp = (Math.sqrt((B * F)) * -Math.sqrt(2.0)) / B;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) tmp = 0 if F <= -4.4e-298: tmp = math.sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0) elif F <= 1.85e-23: tmp = (math.sqrt((B * F)) * -math.sqrt(2.0)) / B else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) tmp = 0.0 if (F <= -4.4e-298) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(A + C))))) * Float64(-1.0 / t_0)); elseif (F <= 1.85e-23) tmp = Float64(Float64(sqrt(Float64(B * F)) * Float64(-sqrt(2.0))) / B); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); tmp = 0.0; if (F <= -4.4e-298) tmp = sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0); elseif (F <= 1.85e-23) tmp = (sqrt((B * F)) * -sqrt(2.0)) / B; else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4.4e-298], N[(N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.85e-23], N[(N[(N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision] / B), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;F \leq -4.4 \cdot 10^{-298}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(A + C\right)\right)\right)} \cdot \frac{-1}{t_0}\\
\mathbf{elif}\;F \leq 1.85 \cdot 10^{-23}:\\
\;\;\;\;\frac{\sqrt{B \cdot F} \cdot \left(-\sqrt{2}\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < -4.4e-298Initial program 52.0%
associate-*l*52.0%
unpow252.0%
+-commutative52.0%
unpow252.0%
associate-*l*52.0%
unpow252.0%
Simplified52.0%
Taylor expanded in A around inf 44.8%
div-inv44.9%
associate-*l*44.9%
*-commutative44.9%
cancel-sign-sub-inv44.9%
metadata-eval44.9%
*-commutative44.9%
associate-+l+44.9%
cancel-sign-sub-inv44.9%
metadata-eval44.9%
Applied egg-rr44.9%
if -4.4e-298 < F < 1.8500000000000001e-23Initial program 24.2%
Simplified28.8%
Taylor expanded in C around 0 15.1%
mul-1-neg15.1%
unpow215.1%
unpow215.1%
Simplified15.1%
sqrt-prod15.1%
hypot-udef25.2%
Applied egg-rr25.2%
associate-*l/25.3%
sqrt-unprod25.3%
Applied egg-rr25.3%
Taylor expanded in A around 0 22.7%
if 1.8500000000000001e-23 < F Initial program 14.9%
Simplified16.7%
Taylor expanded in C around 0 8.1%
mul-1-neg8.1%
unpow28.1%
unpow28.1%
Simplified8.1%
sqrt-prod9.5%
hypot-udef25.6%
Applied egg-rr25.6%
Taylor expanded in A around 0 21.5%
Final simplification25.2%
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 -4.4e-298)
(* (sqrt (* 2.0 (* (* F t_0) (+ A (+ A C))))) (/ -1.0 t_0))
(* (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 <= -4.4e-298) {
tmp = sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0);
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (b * b) + ((-4.0d0) * (a * c))
if (f <= (-4.4d-298)) then
tmp = sqrt((2.0d0 * ((f * t_0) * (a + (a + c))))) * ((-1.0d0) / t_0)
else
tmp = sqrt(2.0d0) * -sqrt((f / b))
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double tmp;
if (F <= -4.4e-298) {
tmp = Math.sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0);
} 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 <= -4.4e-298: tmp = math.sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0) 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 <= -4.4e-298) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(A + C))))) * Float64(-1.0 / t_0)); 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 <= -4.4e-298) tmp = sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0); 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, -4.4e-298], N[(N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;F \leq -4.4 \cdot 10^{-298}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(A + C\right)\right)\right)} \cdot \frac{-1}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < -4.4e-298Initial program 52.0%
associate-*l*52.0%
unpow252.0%
+-commutative52.0%
unpow252.0%
associate-*l*52.0%
unpow252.0%
Simplified52.0%
Taylor expanded in A around inf 44.8%
div-inv44.9%
associate-*l*44.9%
*-commutative44.9%
cancel-sign-sub-inv44.9%
metadata-eval44.9%
*-commutative44.9%
associate-+l+44.9%
cancel-sign-sub-inv44.9%
metadata-eval44.9%
Applied egg-rr44.9%
if -4.4e-298 < F Initial program 19.2%
Simplified22.4%
Taylor expanded in C around 0 11.4%
mul-1-neg11.4%
unpow211.4%
unpow211.4%
Simplified11.4%
sqrt-prod12.1%
hypot-udef25.4%
Applied egg-rr25.4%
Taylor expanded in A around 0 17.0%
Final simplification20.8%
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)))) (t_1 (+ (* B B) (* -4.0 (* A C)))))
(if (<= C -3.5e+40)
(/ (- (sqrt (* (* C F) (* -16.0 (* A A))))) t_0)
(if (<= C 1.56e-161)
(/ (- (sqrt (* (* 2.0 (+ B C)) (* F (* B B))))) t_0)
(if (<= C 3.1e-16)
(* (sqrt (* 2.0 (* (* F t_1) (+ A (+ A C))))) (/ -1.0 t_1))
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ (+ A C) (- C A))))) t_0))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double t_1 = (B * B) + (-4.0 * (A * C));
double tmp;
if (C <= -3.5e+40) {
tmp = -sqrt(((C * F) * (-16.0 * (A * A)))) / t_0;
} else if (C <= 1.56e-161) {
tmp = -sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0;
} else if (C <= 3.1e-16) {
tmp = sqrt((2.0 * ((F * t_1) * (A + (A + C))))) * (-1.0 / t_1);
} else {
tmp = -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (b * b) - (4.0d0 * (a * c))
t_1 = (b * b) + ((-4.0d0) * (a * c))
if (c <= (-3.5d+40)) then
tmp = -sqrt(((c * f) * ((-16.0d0) * (a * a)))) / t_0
else if (c <= 1.56d-161) then
tmp = -sqrt(((2.0d0 * (b + c)) * (f * (b * b)))) / t_0
else if (c <= 3.1d-16) then
tmp = sqrt((2.0d0 * ((f * t_1) * (a + (a + c))))) * ((-1.0d0) / t_1)
else
tmp = -sqrt(((2.0d0 * (f * t_0)) * ((a + c) + (c - a)))) / t_0
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double t_1 = (B * B) + (-4.0 * (A * C));
double tmp;
if (C <= -3.5e+40) {
tmp = -Math.sqrt(((C * F) * (-16.0 * (A * A)))) / t_0;
} else if (C <= 1.56e-161) {
tmp = -Math.sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0;
} else if (C <= 3.1e-16) {
tmp = Math.sqrt((2.0 * ((F * t_1) * (A + (A + C))))) * (-1.0 / t_1);
} else {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) t_1 = (B * B) + (-4.0 * (A * C)) tmp = 0 if C <= -3.5e+40: tmp = -math.sqrt(((C * F) * (-16.0 * (A * A)))) / t_0 elif C <= 1.56e-161: tmp = -math.sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0 elif C <= 3.1e-16: tmp = math.sqrt((2.0 * ((F * t_1) * (A + (A + C))))) * (-1.0 / t_1) else: tmp = -math.sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) t_1 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) tmp = 0.0 if (C <= -3.5e+40) tmp = Float64(Float64(-sqrt(Float64(Float64(C * F) * Float64(-16.0 * Float64(A * A))))) / t_0); elseif (C <= 1.56e-161) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(B + C)) * Float64(F * Float64(B * B))))) / t_0); elseif (C <= 3.1e-16) tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_1) * Float64(A + Float64(A + C))))) * Float64(-1.0 / t_1)); else tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(Float64(A + C) + Float64(C - A))))) / t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (A * C)); t_1 = (B * B) + (-4.0 * (A * C)); tmp = 0.0; if (C <= -3.5e+40) tmp = -sqrt(((C * F) * (-16.0 * (A * A)))) / t_0; elseif (C <= 1.56e-161) tmp = -sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0; elseif (C <= 3.1e-16) tmp = sqrt((2.0 * ((F * t_1) * (A + (A + C))))) * (-1.0 / t_1); else tmp = -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -3.5e+40], N[((-N[Sqrt[N[(N[(C * F), $MachinePrecision] * N[(-16.0 * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[C, 1.56e-161], N[((-N[Sqrt[N[(N[(2.0 * N[(B + C), $MachinePrecision]), $MachinePrecision] * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[C, 3.1e-16], N[(N[Sqrt[N[(2.0 * N[(N[(F * t$95$1), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_1 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;C \leq -3.5 \cdot 10^{+40}:\\
\;\;\;\;\frac{-\sqrt{\left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;C \leq 1.56 \cdot 10^{-161}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(B + C\right)\right) \cdot \left(F \cdot \left(B \cdot B\right)\right)}}{t_0}\\
\mathbf{elif}\;C \leq 3.1 \cdot 10^{-16}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(F \cdot t_1\right) \cdot \left(A + \left(A + C\right)\right)\right)} \cdot \frac{-1}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(\left(A + C\right) + \left(C - A\right)\right)}}{t_0}\\
\end{array}
\end{array}
if C < -3.4999999999999999e40Initial program 7.0%
associate-*l*7.0%
unpow27.0%
+-commutative7.0%
unpow27.0%
associate-*l*7.0%
unpow27.0%
Simplified7.0%
Taylor expanded in A around inf 2.9%
Taylor expanded in A around inf 20.0%
associate-*r*20.0%
unpow220.0%
Simplified20.0%
if -3.4999999999999999e40 < C < 1.56e-161Initial program 29.6%
associate-*l*29.6%
unpow229.6%
+-commutative29.6%
unpow229.6%
associate-*l*29.6%
unpow229.6%
Simplified29.6%
Taylor expanded in C around 0 29.5%
unpow229.5%
unpow229.5%
hypot-def32.7%
Simplified32.7%
Taylor expanded in A around 0 10.5%
associate-*r*10.5%
unpow210.5%
Simplified10.5%
if 1.56e-161 < C < 3.1000000000000001e-16Initial program 47.4%
associate-*l*47.4%
unpow247.4%
+-commutative47.4%
unpow247.4%
associate-*l*47.4%
unpow247.4%
Simplified47.4%
Taylor expanded in A around inf 35.5%
div-inv35.5%
associate-*l*35.5%
*-commutative35.5%
cancel-sign-sub-inv35.5%
metadata-eval35.5%
*-commutative35.5%
associate-+l+35.5%
cancel-sign-sub-inv35.5%
metadata-eval35.5%
Applied egg-rr35.5%
if 3.1000000000000001e-16 < C Initial program 19.2%
associate-*l*19.2%
unpow219.2%
+-commutative19.2%
unpow219.2%
associate-*l*19.2%
unpow219.2%
Simplified19.2%
Taylor expanded in A around -inf 23.3%
mul-1-neg23.3%
sub-neg23.3%
Simplified23.3%
Final simplification19.1%
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 (<= A 2.4e-75)
(/
(- (sqrt (* (* 2.0 (+ B C)) (* F (* B B)))))
(- (* B B) (* 4.0 (* A C))))
(* (sqrt (* 2.0 (* (* F t_0) (+ A (+ A C))))) (/ -1.0 t_0)))))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 (A <= 2.4e-75) {
tmp = -sqrt(((2.0 * (B + C)) * (F * (B * B)))) / ((B * B) - (4.0 * (A * C)));
} else {
tmp = sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0);
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (b * b) + ((-4.0d0) * (a * c))
if (a <= 2.4d-75) then
tmp = -sqrt(((2.0d0 * (b + c)) * (f * (b * b)))) / ((b * b) - (4.0d0 * (a * c)))
else
tmp = sqrt((2.0d0 * ((f * t_0) * (a + (a + c))))) * ((-1.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) + (-4.0 * (A * C));
double tmp;
if (A <= 2.4e-75) {
tmp = -Math.sqrt(((2.0 * (B + C)) * (F * (B * B)))) / ((B * B) - (4.0 * (A * C)));
} else {
tmp = Math.sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) tmp = 0 if A <= 2.4e-75: tmp = -math.sqrt(((2.0 * (B + C)) * (F * (B * B)))) / ((B * B) - (4.0 * (A * C))) else: tmp = math.sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0) 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 (A <= 2.4e-75) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(B + C)) * Float64(F * Float64(B * B))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))); else tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(A + C))))) * Float64(-1.0 / t_0)); 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 (A <= 2.4e-75) tmp = -sqrt(((2.0 * (B + C)) * (F * (B * B)))) / ((B * B) - (4.0 * (A * C))); else tmp = sqrt((2.0 * ((F * t_0) * (A + (A + C))))) * (-1.0 / t_0); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, 2.4e-75], N[((-N[Sqrt[N[(N[(2.0 * N[(B + C), $MachinePrecision]), $MachinePrecision] * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;A \leq 2.4 \cdot 10^{-75}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(B + C\right)\right) \cdot \left(F \cdot \left(B \cdot B\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(A + C\right)\right)\right)} \cdot \frac{-1}{t_0}\\
\end{array}
\end{array}
if A < 2.40000000000000019e-75Initial program 20.8%
associate-*l*20.8%
unpow220.8%
+-commutative20.8%
unpow220.8%
associate-*l*20.8%
unpow220.8%
Simplified20.8%
Taylor expanded in C around 0 16.0%
unpow216.0%
unpow216.0%
hypot-def16.1%
Simplified16.1%
Taylor expanded in A around 0 8.9%
associate-*r*8.9%
unpow28.9%
Simplified8.9%
if 2.40000000000000019e-75 < A Initial program 29.3%
associate-*l*29.3%
unpow229.3%
+-commutative29.3%
unpow229.3%
associate-*l*29.3%
unpow229.3%
Simplified29.3%
Taylor expanded in A around inf 27.7%
div-inv27.7%
associate-*l*27.7%
*-commutative27.7%
cancel-sign-sub-inv27.7%
metadata-eval27.7%
*-commutative27.7%
associate-+l+27.7%
cancel-sign-sub-inv27.7%
metadata-eval27.7%
Applied egg-rr27.7%
Final simplification15.4%
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 (<= A 2.6e-75)
(/ (- (sqrt (* (* 2.0 (+ B C)) (* F (* B B))))) t_0)
(- (/ (sqrt (* (+ A (+ A C)) (* 2.0 (* F t_0)))) t_0)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (A <= 2.6e-75) {
tmp = -sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0;
} else {
tmp = -(sqrt(((A + (A + C)) * (2.0 * (F * t_0)))) / t_0);
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (b * b) - (4.0d0 * (a * c))
if (a <= 2.6d-75) then
tmp = -sqrt(((2.0d0 * (b + c)) * (f * (b * b)))) / t_0
else
tmp = -(sqrt(((a + (a + c)) * (2.0d0 * (f * t_0)))) / t_0)
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (A <= 2.6e-75) {
tmp = -Math.sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0;
} else {
tmp = -(Math.sqrt(((A + (A + C)) * (2.0 * (F * t_0)))) / t_0);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if A <= 2.6e-75: tmp = -math.sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0 else: tmp = -(math.sqrt(((A + (A + C)) * (2.0 * (F * t_0)))) / t_0) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) tmp = 0.0 if (A <= 2.6e-75) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(B + C)) * Float64(F * Float64(B * B))))) / t_0); else tmp = Float64(-Float64(sqrt(Float64(Float64(A + Float64(A + C)) * Float64(2.0 * Float64(F * t_0)))) / t_0)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (A * C)); tmp = 0.0; if (A <= 2.6e-75) tmp = -sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0; else tmp = -(sqrt(((A + (A + C)) * (2.0 * (F * t_0)))) / t_0); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, 2.6e-75], N[((-N[Sqrt[N[(N[(2.0 * N[(B + C), $MachinePrecision]), $MachinePrecision] * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], (-N[(N[Sqrt[N[(N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision])]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;A \leq 2.6 \cdot 10^{-75}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(B + C\right)\right) \cdot \left(F \cdot \left(B \cdot B\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;-\frac{\sqrt{\left(A + \left(A + C\right)\right) \cdot \left(2 \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\
\end{array}
\end{array}
if A < 2.6e-75Initial program 20.8%
associate-*l*20.8%
unpow220.8%
+-commutative20.8%
unpow220.8%
associate-*l*20.8%
unpow220.8%
Simplified20.8%
Taylor expanded in C around 0 16.0%
unpow216.0%
unpow216.0%
hypot-def16.1%
Simplified16.1%
Taylor expanded in A around 0 8.9%
associate-*r*8.9%
unpow28.9%
Simplified8.9%
if 2.6e-75 < A Initial program 29.3%
associate-*l*29.3%
unpow229.3%
+-commutative29.3%
unpow229.3%
associate-*l*29.3%
unpow229.3%
Simplified29.3%
Taylor expanded in A around inf 27.7%
Final simplification15.4%
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 (<= B 9.8e-33)
(/ (- (sqrt (* (* C F) (* -16.0 (* A A))))) t_0)
(/ (- (sqrt (* (* 2.0 (+ B C)) (* F (* B B))))) t_0))))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 (B <= 9.8e-33) {
tmp = -sqrt(((C * F) * (-16.0 * (A * A)))) / t_0;
} else {
tmp = -sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0;
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (b * b) - (4.0d0 * (a * c))
if (b <= 9.8d-33) then
tmp = -sqrt(((c * f) * ((-16.0d0) * (a * a)))) / t_0
else
tmp = -sqrt(((2.0d0 * (b + c)) * (f * (b * b)))) / t_0
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (B <= 9.8e-33) {
tmp = -Math.sqrt(((C * F) * (-16.0 * (A * A)))) / t_0;
} else {
tmp = -Math.sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if B <= 9.8e-33: tmp = -math.sqrt(((C * F) * (-16.0 * (A * A)))) / t_0 else: tmp = -math.sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0 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 (B <= 9.8e-33) tmp = Float64(Float64(-sqrt(Float64(Float64(C * F) * Float64(-16.0 * Float64(A * A))))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(B + C)) * Float64(F * Float64(B * B))))) / t_0); 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 (B <= 9.8e-33) tmp = -sqrt(((C * F) * (-16.0 * (A * A)))) / t_0; else tmp = -sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 9.8e-33], N[((-N[Sqrt[N[(N[(C * F), $MachinePrecision] * N[(-16.0 * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(N[(2.0 * N[(B + C), $MachinePrecision]), $MachinePrecision] * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 9.8 \cdot 10^{-33}:\\
\;\;\;\;\frac{-\sqrt{\left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(B + C\right)\right) \cdot \left(F \cdot \left(B \cdot B\right)\right)}}{t_0}\\
\end{array}
\end{array}
if B < 9.7999999999999996e-33Initial program 23.4%
associate-*l*23.4%
unpow223.4%
+-commutative23.4%
unpow223.4%
associate-*l*23.4%
unpow223.4%
Simplified23.4%
Taylor expanded in A around inf 14.2%
Taylor expanded in A around inf 13.6%
associate-*r*13.6%
unpow213.6%
Simplified13.6%
if 9.7999999999999996e-33 < B Initial program 24.6%
associate-*l*24.6%
unpow224.6%
+-commutative24.6%
unpow224.6%
associate-*l*24.6%
unpow224.6%
Simplified24.6%
Taylor expanded in C around 0 23.4%
unpow223.4%
unpow223.4%
hypot-def23.4%
Simplified23.4%
Taylor expanded in A around 0 22.0%
associate-*r*22.0%
unpow222.0%
Simplified22.0%
Final simplification15.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 (<= C 2.5e-16)
(/ (- (sqrt (* (* C F) (* -16.0 (* A A))))) t_0)
(/ (* 2.0 (* B (- (sqrt (* C F))))) t_0))))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 (C <= 2.5e-16) {
tmp = -sqrt(((C * F) * (-16.0 * (A * A)))) / t_0;
} else {
tmp = (2.0 * (B * -sqrt((C * F)))) / t_0;
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (b * b) - (4.0d0 * (a * c))
if (c <= 2.5d-16) then
tmp = -sqrt(((c * f) * ((-16.0d0) * (a * a)))) / t_0
else
tmp = (2.0d0 * (b * -sqrt((c * f)))) / t_0
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (C <= 2.5e-16) {
tmp = -Math.sqrt(((C * F) * (-16.0 * (A * A)))) / t_0;
} else {
tmp = (2.0 * (B * -Math.sqrt((C * F)))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if C <= 2.5e-16: tmp = -math.sqrt(((C * F) * (-16.0 * (A * A)))) / t_0 else: tmp = (2.0 * (B * -math.sqrt((C * F)))) / t_0 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 (C <= 2.5e-16) tmp = Float64(Float64(-sqrt(Float64(Float64(C * F) * Float64(-16.0 * Float64(A * A))))) / t_0); else tmp = Float64(Float64(2.0 * Float64(B * Float64(-sqrt(Float64(C * F))))) / t_0); 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 (C <= 2.5e-16) tmp = -sqrt(((C * F) * (-16.0 * (A * A)))) / t_0; else tmp = (2.0 * (B * -sqrt((C * F)))) / t_0; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, 2.5e-16], N[((-N[Sqrt[N[(N[(C * F), $MachinePrecision] * N[(-16.0 * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(2.0 * N[(B * (-N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;C \leq 2.5 \cdot 10^{-16}:\\
\;\;\;\;\frac{-\sqrt{\left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \left(B \cdot \left(-\sqrt{C \cdot F}\right)\right)}{t_0}\\
\end{array}
\end{array}
if C < 2.5000000000000002e-16Initial program 25.4%
associate-*l*25.4%
unpow225.4%
+-commutative25.4%
unpow225.4%
associate-*l*25.4%
unpow225.4%
Simplified25.4%
Taylor expanded in A around inf 13.8%
Taylor expanded in A around inf 14.4%
associate-*r*14.4%
unpow214.4%
Simplified14.4%
if 2.5000000000000002e-16 < C Initial program 19.2%
associate-*l*19.2%
unpow219.2%
+-commutative19.2%
unpow219.2%
associate-*l*19.2%
unpow219.2%
Simplified19.2%
sqrt-prod23.2%
*-commutative23.2%
*-commutative23.2%
associate-+l+23.2%
unpow223.2%
hypot-udef38.3%
associate-+r+38.3%
+-commutative38.3%
associate-+r+38.4%
Applied egg-rr38.4%
Taylor expanded in B around inf 11.6%
associate-*l*11.6%
Simplified11.6%
Taylor expanded in A around -inf 6.5%
associate-*l*6.5%
unpow26.5%
rem-square-sqrt6.5%
Simplified6.5%
Final simplification12.3%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= C -2.9e-293) (* (/ 2.0 B) (- (pow (* A F) 0.5))) (/ (* 2.0 (* B (- (sqrt (* C F))))) (- (* B B) (* 4.0 (* A C))))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (C <= -2.9e-293) {
tmp = (2.0 / B) * -pow((A * F), 0.5);
} else {
tmp = (2.0 * (B * -sqrt((C * F)))) / ((B * B) - (4.0 * (A * 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 <= (-2.9d-293)) then
tmp = (2.0d0 / b) * -((a * f) ** 0.5d0)
else
tmp = (2.0d0 * (b * -sqrt((c * f)))) / ((b * b) - (4.0d0 * (a * 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 <= -2.9e-293) {
tmp = (2.0 / B) * -Math.pow((A * F), 0.5);
} else {
tmp = (2.0 * (B * -Math.sqrt((C * F)))) / ((B * B) - (4.0 * (A * C)));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if C <= -2.9e-293: tmp = (2.0 / B) * -math.pow((A * F), 0.5) else: tmp = (2.0 * (B * -math.sqrt((C * F)))) / ((B * B) - (4.0 * (A * C))) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (C <= -2.9e-293) tmp = Float64(Float64(2.0 / B) * Float64(-(Float64(A * F) ^ 0.5))); else tmp = Float64(Float64(2.0 * Float64(B * Float64(-sqrt(Float64(C * F))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (C <= -2.9e-293) tmp = (2.0 / B) * -((A * F) ^ 0.5); else tmp = (2.0 * (B * -sqrt((C * F)))) / ((B * B) - (4.0 * (A * C))); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[C, -2.9e-293], N[(N[(2.0 / B), $MachinePrecision] * (-N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision])), $MachinePrecision], N[(N[(2.0 * N[(B * (-N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq -2.9 \cdot 10^{-293}:\\
\;\;\;\;\frac{2}{B} \cdot \left(-{\left(A \cdot F\right)}^{0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \left(B \cdot \left(-\sqrt{C \cdot F}\right)\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
\end{array}
\end{array}
if C < -2.8999999999999999e-293Initial program 17.3%
associate-*l*17.3%
unpow217.3%
+-commutative17.3%
unpow217.3%
associate-*l*17.3%
unpow217.3%
Simplified17.3%
Taylor expanded in A around inf 8.9%
Taylor expanded in C around 0 4.0%
mul-1-neg4.0%
unpow24.0%
rem-square-sqrt4.0%
Simplified4.0%
pow1/24.1%
Applied egg-rr4.1%
if -2.8999999999999999e-293 < C Initial program 29.4%
associate-*l*29.4%
unpow229.4%
+-commutative29.4%
unpow229.4%
associate-*l*29.4%
unpow229.4%
Simplified29.4%
sqrt-prod33.6%
*-commutative33.6%
*-commutative33.6%
associate-+l+33.6%
unpow233.6%
hypot-udef43.5%
associate-+r+43.5%
+-commutative43.5%
associate-+r+44.6%
Applied egg-rr44.6%
Taylor expanded in B around inf 12.6%
associate-*l*12.6%
Simplified12.6%
Taylor expanded in A around -inf 4.9%
associate-*l*4.9%
unpow24.9%
rem-square-sqrt5.0%
Simplified5.0%
Final simplification4.5%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* (/ 2.0 B) (- (pow (* A F) 0.5))))
B = abs(B);
double code(double A, double B, double C, double F) {
return (2.0 / B) * -pow((A * F), 0.5);
}
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) * -((a * f) ** 0.5d0)
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return (2.0 / B) * -Math.pow((A * F), 0.5);
}
B = abs(B) def code(A, B, C, F): return (2.0 / B) * -math.pow((A * F), 0.5)
B = abs(B) function code(A, B, C, F) return Float64(Float64(2.0 / B) * Float64(-(Float64(A * F) ^ 0.5))) end
B = abs(B) function tmp = code(A, B, C, F) tmp = (2.0 / B) * -((A * F) ^ 0.5); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(N[(2.0 / B), $MachinePrecision] * (-N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\frac{2}{B} \cdot \left(-{\left(A \cdot F\right)}^{0.5}\right)
\end{array}
Initial program 23.7%
associate-*l*23.7%
unpow223.7%
+-commutative23.7%
unpow223.7%
associate-*l*23.7%
unpow223.7%
Simplified23.7%
Taylor expanded in A around inf 11.6%
Taylor expanded in C around 0 2.5%
mul-1-neg2.5%
unpow22.5%
rem-square-sqrt2.5%
Simplified2.5%
pow1/22.6%
Applied egg-rr2.6%
Final simplification2.6%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* (/ 2.0 B) (- (sqrt (* A F)))))
B = abs(B);
double code(double A, double B, double C, double F) {
return (2.0 / B) * -sqrt((A * F));
}
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((a * f))
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return (2.0 / B) * -Math.sqrt((A * F));
}
B = abs(B) def code(A, B, C, F): return (2.0 / B) * -math.sqrt((A * F))
B = abs(B) function code(A, B, C, F) return Float64(Float64(2.0 / B) * Float64(-sqrt(Float64(A * F)))) end
B = abs(B) function tmp = code(A, B, C, F) tmp = (2.0 / B) * -sqrt((A * F)); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(N[(2.0 / B), $MachinePrecision] * (-N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\frac{2}{B} \cdot \left(-\sqrt{A \cdot F}\right)
\end{array}
Initial program 23.7%
associate-*l*23.7%
unpow223.7%
+-commutative23.7%
unpow223.7%
associate-*l*23.7%
unpow223.7%
Simplified23.7%
Taylor expanded in A around inf 11.6%
Taylor expanded in C around 0 2.5%
mul-1-neg2.5%
unpow22.5%
rem-square-sqrt2.5%
Simplified2.5%
Final simplification2.5%
herbie shell --seed 2023214
(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))))