
(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 13 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}
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (hypot B_m (- A C)))
(t_1 (+ (* B_m B_m) (* -4.0 (* A C))))
(t_2 (* (* 4.0 A) C))
(t_3
(/
(sqrt
(*
(* 2.0 (* (- (pow B_m 2.0) t_2) F))
(+ (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
(- t_2 (pow B_m 2.0)))))
(if (<= t_3 (- INFINITY))
(* (sqrt (* F (/ (+ (+ A C) t_0) t_1))) (- 0.0 (sqrt 2.0)))
(if (<= t_3 INFINITY)
(/
(* (sqrt (* F t_1)) (sqrt (* 2.0 (+ A (+ C t_0)))))
(- t_2 (* B_m B_m)))
(*
(sqrt F)
(* (sqrt (+ C (hypot B_m C))) (/ -1.0 (/ B_m (sqrt 2.0)))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = hypot(B_m, (A - C));
double t_1 = (B_m * B_m) + (-4.0 * (A * C));
double t_2 = (4.0 * A) * C;
double t_3 = sqrt(((2.0 * ((pow(B_m, 2.0) - t_2) * F)) * ((A + C) + sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / (t_2 - pow(B_m, 2.0));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = sqrt((F * (((A + C) + t_0) / t_1))) * (0.0 - sqrt(2.0));
} else if (t_3 <= ((double) INFINITY)) {
tmp = (sqrt((F * t_1)) * sqrt((2.0 * (A + (C + t_0))))) / (t_2 - (B_m * B_m));
} else {
tmp = sqrt(F) * (sqrt((C + hypot(B_m, C))) * (-1.0 / (B_m / sqrt(2.0))));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = Math.hypot(B_m, (A - C));
double t_1 = (B_m * B_m) + (-4.0 * (A * C));
double t_2 = (4.0 * A) * C;
double t_3 = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_2) * F)) * ((A + C) + Math.sqrt((Math.pow(B_m, 2.0) + Math.pow((A - C), 2.0)))))) / (t_2 - Math.pow(B_m, 2.0));
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((F * (((A + C) + t_0) / t_1))) * (0.0 - Math.sqrt(2.0));
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = (Math.sqrt((F * t_1)) * Math.sqrt((2.0 * (A + (C + t_0))))) / (t_2 - (B_m * B_m));
} else {
tmp = Math.sqrt(F) * (Math.sqrt((C + Math.hypot(B_m, C))) * (-1.0 / (B_m / Math.sqrt(2.0))));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = math.hypot(B_m, (A - C)) t_1 = (B_m * B_m) + (-4.0 * (A * C)) t_2 = (4.0 * A) * C t_3 = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_2) * F)) * ((A + C) + math.sqrt((math.pow(B_m, 2.0) + math.pow((A - C), 2.0)))))) / (t_2 - math.pow(B_m, 2.0)) tmp = 0 if t_3 <= -math.inf: tmp = math.sqrt((F * (((A + C) + t_0) / t_1))) * (0.0 - math.sqrt(2.0)) elif t_3 <= math.inf: tmp = (math.sqrt((F * t_1)) * math.sqrt((2.0 * (A + (C + t_0))))) / (t_2 - (B_m * B_m)) else: tmp = math.sqrt(F) * (math.sqrt((C + math.hypot(B_m, C))) * (-1.0 / (B_m / math.sqrt(2.0)))) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = hypot(B_m, Float64(A - C)) t_1 = Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))) t_2 = Float64(Float64(4.0 * A) * C) t_3 = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_2) * F)) * Float64(Float64(A + C) + sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / Float64(t_2 - (B_m ^ 2.0))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(sqrt(Float64(F * Float64(Float64(Float64(A + C) + t_0) / t_1))) * Float64(0.0 - sqrt(2.0))); elseif (t_3 <= Inf) tmp = Float64(Float64(sqrt(Float64(F * t_1)) * sqrt(Float64(2.0 * Float64(A + Float64(C + t_0))))) / Float64(t_2 - Float64(B_m * B_m))); else tmp = Float64(sqrt(F) * Float64(sqrt(Float64(C + hypot(B_m, C))) * Float64(-1.0 / Float64(B_m / sqrt(2.0))))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = hypot(B_m, (A - C)); t_1 = (B_m * B_m) + (-4.0 * (A * C)); t_2 = (4.0 * A) * C; t_3 = sqrt(((2.0 * (((B_m ^ 2.0) - t_2) * F)) * ((A + C) + sqrt(((B_m ^ 2.0) + ((A - C) ^ 2.0)))))) / (t_2 - (B_m ^ 2.0)); tmp = 0.0; if (t_3 <= -Inf) tmp = sqrt((F * (((A + C) + t_0) / t_1))) * (0.0 - sqrt(2.0)); elseif (t_3 <= Inf) tmp = (sqrt((F * t_1)) * sqrt((2.0 * (A + (C + t_0))))) / (t_2 - (B_m * B_m)); else tmp = sqrt(F) * (sqrt((C + hypot(B_m, C))) * (-1.0 / (B_m / sqrt(2.0)))); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$1 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$2), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$2 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[Sqrt[N[(F * N[(N[(N[(A + C), $MachinePrecision] + t$95$0), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[(N[Sqrt[N[(F * t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(A + N[(C + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(t$95$2 - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[F], $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(B\_m, A - C\right)\\
t_1 := B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\\
t_2 := \left(4 \cdot A\right) \cdot C\\
t_3 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_2\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_2 - {B\_m}^{2}}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\sqrt{F \cdot \frac{\left(A + C\right) + t\_0}{t\_1}} \cdot \left(0 - \sqrt{2}\right)\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\frac{\sqrt{F \cdot t\_1} \cdot \sqrt{2 \cdot \left(A + \left(C + t\_0\right)\right)}}{t\_2 - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{F} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B\_m, C\right)} \cdot \frac{-1}{\frac{B\_m}{\sqrt{2}}}\right)\\
\end{array}
\end{array}
if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -inf.0Initial program 3.2%
Taylor expanded in F around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
Simplified64.2%
if -inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < +inf.0Initial program 56.6%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified60.5%
pow2N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
sqrt-prodN/A
pow1/2N/A
*-lowering-*.f64N/A
Applied egg-rr65.2%
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) Initial program 0.0%
Taylor expanded in A around 0
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6425.4%
Simplified25.4%
*-commutativeN/A
pow1/2N/A
unpow-prod-downN/A
associate-*l*N/A
*-lowering-*.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
Applied egg-rr32.1%
Final simplification51.5%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (hypot B_m (- A C))) (t_1 (+ (* B_m B_m) (* -4.0 (* A C)))))
(if (<= B_m 3.7e+20)
(/
(* (sqrt (* F t_1)) (sqrt (* 2.0 (+ A (+ C t_0)))))
(- (* (* 4.0 A) C) (* B_m B_m)))
(if (<= B_m 1.3e+132)
(* (sqrt (* F (/ (+ (+ A C) t_0) t_1))) (- 0.0 (sqrt 2.0)))
(* (/ (sqrt 2.0) B_m) (* (sqrt B_m) (- 0.0 (sqrt F))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = hypot(B_m, (A - C));
double t_1 = (B_m * B_m) + (-4.0 * (A * C));
double tmp;
if (B_m <= 3.7e+20) {
tmp = (sqrt((F * t_1)) * sqrt((2.0 * (A + (C + t_0))))) / (((4.0 * A) * C) - (B_m * B_m));
} else if (B_m <= 1.3e+132) {
tmp = sqrt((F * (((A + C) + t_0) / t_1))) * (0.0 - sqrt(2.0));
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt(B_m) * (0.0 - sqrt(F)));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = Math.hypot(B_m, (A - C));
double t_1 = (B_m * B_m) + (-4.0 * (A * C));
double tmp;
if (B_m <= 3.7e+20) {
tmp = (Math.sqrt((F * t_1)) * Math.sqrt((2.0 * (A + (C + t_0))))) / (((4.0 * A) * C) - (B_m * B_m));
} else if (B_m <= 1.3e+132) {
tmp = Math.sqrt((F * (((A + C) + t_0) / t_1))) * (0.0 - Math.sqrt(2.0));
} else {
tmp = (Math.sqrt(2.0) / B_m) * (Math.sqrt(B_m) * (0.0 - Math.sqrt(F)));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = math.hypot(B_m, (A - C)) t_1 = (B_m * B_m) + (-4.0 * (A * C)) tmp = 0 if B_m <= 3.7e+20: tmp = (math.sqrt((F * t_1)) * math.sqrt((2.0 * (A + (C + t_0))))) / (((4.0 * A) * C) - (B_m * B_m)) elif B_m <= 1.3e+132: tmp = math.sqrt((F * (((A + C) + t_0) / t_1))) * (0.0 - math.sqrt(2.0)) else: tmp = (math.sqrt(2.0) / B_m) * (math.sqrt(B_m) * (0.0 - math.sqrt(F))) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = hypot(B_m, Float64(A - C)) t_1 = Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))) tmp = 0.0 if (B_m <= 3.7e+20) tmp = Float64(Float64(sqrt(Float64(F * t_1)) * sqrt(Float64(2.0 * Float64(A + Float64(C + t_0))))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))); elseif (B_m <= 1.3e+132) tmp = Float64(sqrt(Float64(F * Float64(Float64(Float64(A + C) + t_0) / t_1))) * Float64(0.0 - sqrt(2.0))); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(B_m) * Float64(0.0 - sqrt(F)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = hypot(B_m, (A - C)); t_1 = (B_m * B_m) + (-4.0 * (A * C)); tmp = 0.0; if (B_m <= 3.7e+20) tmp = (sqrt((F * t_1)) * sqrt((2.0 * (A + (C + t_0))))) / (((4.0 * A) * C) - (B_m * B_m)); elseif (B_m <= 1.3e+132) tmp = sqrt((F * (((A + C) + t_0) / t_1))) * (0.0 - sqrt(2.0)); else tmp = (sqrt(2.0) / B_m) * (sqrt(B_m) * (0.0 - sqrt(F))); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$1 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 3.7e+20], N[(N[(N[Sqrt[N[(F * t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(A + N[(C + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 1.3e+132], N[(N[Sqrt[N[(F * N[(N[(N[(A + C), $MachinePrecision] + t$95$0), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[B$95$m], $MachinePrecision] * N[(0.0 - N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(B\_m, A - C\right)\\
t_1 := B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B\_m \leq 3.7 \cdot 10^{+20}:\\
\;\;\;\;\frac{\sqrt{F \cdot t\_1} \cdot \sqrt{2 \cdot \left(A + \left(C + t\_0\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\
\mathbf{elif}\;B\_m \leq 1.3 \cdot 10^{+132}:\\
\;\;\;\;\sqrt{F \cdot \frac{\left(A + C\right) + t\_0}{t\_1}} \cdot \left(0 - \sqrt{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{B\_m} \cdot \left(0 - \sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < 3.7e20Initial program 23.8%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified27.3%
pow2N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
sqrt-prodN/A
pow1/2N/A
*-lowering-*.f64N/A
Applied egg-rr38.0%
if 3.7e20 < B < 1.3e132Initial program 38.1%
Taylor expanded in F around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
Simplified67.3%
if 1.3e132 < B Initial program 7.1%
Taylor expanded in A around 0
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6466.7%
Simplified66.7%
pow1/2N/A
*-commutativeN/A
unpow-prod-downN/A
*-lowering-*.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f6483.9%
Applied egg-rr83.9%
Taylor expanded in C around 0
Simplified76.3%
Final simplification48.3%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (hypot B_m (- A C))) (t_1 (+ (* B_m B_m) (* -4.0 (* A C)))))
(if (<= B_m 5.2e+20)
(/
(sqrt (* t_1 (* (+ A (+ C t_0)) (* 2.0 F))))
(- (* (* 4.0 A) C) (* B_m B_m)))
(if (<= B_m 2.1e+131)
(* (sqrt (* F (/ (+ (+ A C) t_0) t_1))) (- 0.0 (sqrt 2.0)))
(* (/ (sqrt 2.0) B_m) (* (sqrt B_m) (- 0.0 (sqrt F))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = hypot(B_m, (A - C));
double t_1 = (B_m * B_m) + (-4.0 * (A * C));
double tmp;
if (B_m <= 5.2e+20) {
tmp = sqrt((t_1 * ((A + (C + t_0)) * (2.0 * F)))) / (((4.0 * A) * C) - (B_m * B_m));
} else if (B_m <= 2.1e+131) {
tmp = sqrt((F * (((A + C) + t_0) / t_1))) * (0.0 - sqrt(2.0));
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt(B_m) * (0.0 - sqrt(F)));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = Math.hypot(B_m, (A - C));
double t_1 = (B_m * B_m) + (-4.0 * (A * C));
double tmp;
if (B_m <= 5.2e+20) {
tmp = Math.sqrt((t_1 * ((A + (C + t_0)) * (2.0 * F)))) / (((4.0 * A) * C) - (B_m * B_m));
} else if (B_m <= 2.1e+131) {
tmp = Math.sqrt((F * (((A + C) + t_0) / t_1))) * (0.0 - Math.sqrt(2.0));
} else {
tmp = (Math.sqrt(2.0) / B_m) * (Math.sqrt(B_m) * (0.0 - Math.sqrt(F)));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = math.hypot(B_m, (A - C)) t_1 = (B_m * B_m) + (-4.0 * (A * C)) tmp = 0 if B_m <= 5.2e+20: tmp = math.sqrt((t_1 * ((A + (C + t_0)) * (2.0 * F)))) / (((4.0 * A) * C) - (B_m * B_m)) elif B_m <= 2.1e+131: tmp = math.sqrt((F * (((A + C) + t_0) / t_1))) * (0.0 - math.sqrt(2.0)) else: tmp = (math.sqrt(2.0) / B_m) * (math.sqrt(B_m) * (0.0 - math.sqrt(F))) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = hypot(B_m, Float64(A - C)) t_1 = Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))) tmp = 0.0 if (B_m <= 5.2e+20) tmp = Float64(sqrt(Float64(t_1 * Float64(Float64(A + Float64(C + t_0)) * Float64(2.0 * F)))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))); elseif (B_m <= 2.1e+131) tmp = Float64(sqrt(Float64(F * Float64(Float64(Float64(A + C) + t_0) / t_1))) * Float64(0.0 - sqrt(2.0))); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(B_m) * Float64(0.0 - sqrt(F)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = hypot(B_m, (A - C)); t_1 = (B_m * B_m) + (-4.0 * (A * C)); tmp = 0.0; if (B_m <= 5.2e+20) tmp = sqrt((t_1 * ((A + (C + t_0)) * (2.0 * F)))) / (((4.0 * A) * C) - (B_m * B_m)); elseif (B_m <= 2.1e+131) tmp = sqrt((F * (((A + C) + t_0) / t_1))) * (0.0 - sqrt(2.0)); else tmp = (sqrt(2.0) / B_m) * (sqrt(B_m) * (0.0 - sqrt(F))); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$1 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 5.2e+20], N[(N[Sqrt[N[(t$95$1 * N[(N[(A + N[(C + t$95$0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 2.1e+131], N[(N[Sqrt[N[(F * N[(N[(N[(A + C), $MachinePrecision] + t$95$0), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[B$95$m], $MachinePrecision] * N[(0.0 - N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(B\_m, A - C\right)\\
t_1 := B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B\_m \leq 5.2 \cdot 10^{+20}:\\
\;\;\;\;\frac{\sqrt{t\_1 \cdot \left(\left(A + \left(C + t\_0\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\
\mathbf{elif}\;B\_m \leq 2.1 \cdot 10^{+131}:\\
\;\;\;\;\sqrt{F \cdot \frac{\left(A + C\right) + t\_0}{t\_1}} \cdot \left(0 - \sqrt{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{B\_m} \cdot \left(0 - \sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < 5.2e20Initial program 23.7%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified27.2%
Applied egg-rr28.0%
if 5.2e20 < B < 2.09999999999999985e131Initial program 39.2%
Taylor expanded in F around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
Simplified69.3%
if 2.09999999999999985e131 < B Initial program 7.1%
Taylor expanded in A around 0
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6466.7%
Simplified66.7%
pow1/2N/A
*-commutativeN/A
unpow-prod-downN/A
*-lowering-*.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f6483.9%
Applied egg-rr83.9%
Taylor expanded in C around 0
Simplified76.3%
Final simplification41.5%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= B_m 5e+26)
(/
(sqrt
(*
(+ (* B_m B_m) (* -4.0 (* A C)))
(* (+ A (+ C (hypot B_m (- A C)))) (* 2.0 F))))
(- (* (* 4.0 A) C) (* B_m B_m)))
(* (/ (sqrt 2.0) B_m) (* (sqrt B_m) (- 0.0 (sqrt F))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 5e+26) {
tmp = sqrt((((B_m * B_m) + (-4.0 * (A * C))) * ((A + (C + hypot(B_m, (A - C)))) * (2.0 * F)))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt(B_m) * (0.0 - sqrt(F)));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 5e+26) {
tmp = Math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * ((A + (C + Math.hypot(B_m, (A - C)))) * (2.0 * F)))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = (Math.sqrt(2.0) / B_m) * (Math.sqrt(B_m) * (0.0 - Math.sqrt(F)));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if B_m <= 5e+26: tmp = math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * ((A + (C + math.hypot(B_m, (A - C)))) * (2.0 * F)))) / (((4.0 * A) * C) - (B_m * B_m)) else: tmp = (math.sqrt(2.0) / B_m) * (math.sqrt(B_m) * (0.0 - math.sqrt(F))) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 5e+26) tmp = Float64(sqrt(Float64(Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))) * Float64(Float64(A + Float64(C + hypot(B_m, Float64(A - C)))) * Float64(2.0 * F)))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(B_m) * Float64(0.0 - sqrt(F)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (B_m <= 5e+26) tmp = sqrt((((B_m * B_m) + (-4.0 * (A * C))) * ((A + (C + hypot(B_m, (A - C)))) * (2.0 * F)))) / (((4.0 * A) * C) - (B_m * B_m)); else tmp = (sqrt(2.0) / B_m) * (sqrt(B_m) * (0.0 - sqrt(F))); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 5e+26], N[(N[Sqrt[N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[B$95$m], $MachinePrecision] * N[(0.0 - N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 5 \cdot 10^{+26}:\\
\;\;\;\;\frac{\sqrt{\left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{B\_m} \cdot \left(0 - \sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < 5.0000000000000001e26Initial program 24.0%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified27.9%
Applied egg-rr28.8%
if 5.0000000000000001e26 < B Initial program 19.8%
Taylor expanded in A around 0
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6456.9%
Simplified56.9%
pow1/2N/A
*-commutativeN/A
unpow-prod-downN/A
*-lowering-*.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f6472.3%
Applied egg-rr72.3%
Taylor expanded in C around 0
Simplified65.8%
Final simplification39.5%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))))
(if (<= B_m 8.8e-200)
(/ (sqrt (* -16.0 (* (* A F) (* A C)))) t_0)
(if (<= B_m 1.22e+29)
(/
(sqrt
(*
(* 2.0 F)
(*
(+ (* B_m B_m) (* -4.0 (* A C)))
(+ A (+ C (hypot B_m (- A C)))))))
t_0)
(/
(sqrt (+ (* 2.0 (+ F (/ (* A F) B_m))) (/ (* F (* A (/ A B_m))) B_m)))
(- 0.0 (sqrt B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = ((4.0 * A) * C) - (B_m * B_m);
double tmp;
if (B_m <= 8.8e-200) {
tmp = sqrt((-16.0 * ((A * F) * (A * C)))) / t_0;
} else if (B_m <= 1.22e+29) {
tmp = sqrt(((2.0 * F) * (((B_m * B_m) + (-4.0 * (A * C))) * (A + (C + hypot(B_m, (A - C))))))) / t_0;
} else {
tmp = sqrt(((2.0 * (F + ((A * F) / B_m))) + ((F * (A * (A / B_m))) / B_m))) / (0.0 - sqrt(B_m));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = ((4.0 * A) * C) - (B_m * B_m);
double tmp;
if (B_m <= 8.8e-200) {
tmp = Math.sqrt((-16.0 * ((A * F) * (A * C)))) / t_0;
} else if (B_m <= 1.22e+29) {
tmp = Math.sqrt(((2.0 * F) * (((B_m * B_m) + (-4.0 * (A * C))) * (A + (C + Math.hypot(B_m, (A - C))))))) / t_0;
} else {
tmp = Math.sqrt(((2.0 * (F + ((A * F) / B_m))) + ((F * (A * (A / B_m))) / B_m))) / (0.0 - Math.sqrt(B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = ((4.0 * A) * C) - (B_m * B_m) tmp = 0 if B_m <= 8.8e-200: tmp = math.sqrt((-16.0 * ((A * F) * (A * C)))) / t_0 elif B_m <= 1.22e+29: tmp = math.sqrt(((2.0 * F) * (((B_m * B_m) + (-4.0 * (A * C))) * (A + (C + math.hypot(B_m, (A - C))))))) / t_0 else: tmp = math.sqrt(((2.0 * (F + ((A * F) / B_m))) + ((F * (A * (A / B_m))) / B_m))) / (0.0 - math.sqrt(B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)) tmp = 0.0 if (B_m <= 8.8e-200) tmp = Float64(sqrt(Float64(-16.0 * Float64(Float64(A * F) * Float64(A * C)))) / t_0); elseif (B_m <= 1.22e+29) tmp = Float64(sqrt(Float64(Float64(2.0 * F) * Float64(Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))) * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))))) / t_0); else tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(F + Float64(Float64(A * F) / B_m))) + Float64(Float64(F * Float64(A * Float64(A / B_m))) / B_m))) / Float64(0.0 - sqrt(B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = ((4.0 * A) * C) - (B_m * B_m); tmp = 0.0; if (B_m <= 8.8e-200) tmp = sqrt((-16.0 * ((A * F) * (A * C)))) / t_0; elseif (B_m <= 1.22e+29) tmp = sqrt(((2.0 * F) * (((B_m * B_m) + (-4.0 * (A * C))) * (A + (C + hypot(B_m, (A - C))))))) / t_0; else tmp = sqrt(((2.0 * (F + ((A * F) / B_m))) + ((F * (A * (A / B_m))) / B_m))) / (0.0 - sqrt(B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 8.8e-200], N[(N[Sqrt[N[(-16.0 * N[(N[(A * F), $MachinePrecision] * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 1.22e+29], N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(N[(2.0 * N[(F + N[(N[(A * F), $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F * N[(A * N[(A / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
\mathbf{if}\;B\_m \leq 8.8 \cdot 10^{-200}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(A \cdot F\right) \cdot \left(A \cdot C\right)\right)}}{t\_0}\\
\mathbf{elif}\;B\_m \leq 1.22 \cdot 10^{+29}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(\left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F + \frac{A \cdot F}{B\_m}\right) + \frac{F \cdot \left(A \cdot \frac{A}{B\_m}\right)}{B\_m}}}{0 - \sqrt{B\_m}}\\
\end{array}
\end{array}
if B < 8.80000000000000054e-200Initial program 24.0%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified27.4%
Taylor expanded in B around 0
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6415.3%
Simplified15.3%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6418.9%
Applied egg-rr18.9%
if 8.80000000000000054e-200 < B < 1.22e29Initial program 24.0%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified30.5%
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
Applied egg-rr17.4%
if 1.22e29 < B Initial program 19.8%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified19.8%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
Simplified14.5%
Taylor expanded in C around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
Simplified41.6%
sqrt-divN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Applied egg-rr65.4%
Final simplification32.2%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= B_m 2.2e+59)
(/
(sqrt
(*
(+ (* B_m B_m) (* -4.0 (* A C)))
(* (+ A (+ C (hypot B_m (- A C)))) (* 2.0 F))))
(- (* (* 4.0 A) C) (* B_m B_m)))
(/
(sqrt (+ (* 2.0 (+ F (/ (* A F) B_m))) (/ (* F (* A (/ A B_m))) B_m)))
(- 0.0 (sqrt B_m)))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 2.2e+59) {
tmp = sqrt((((B_m * B_m) + (-4.0 * (A * C))) * ((A + (C + hypot(B_m, (A - C)))) * (2.0 * F)))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = sqrt(((2.0 * (F + ((A * F) / B_m))) + ((F * (A * (A / B_m))) / B_m))) / (0.0 - sqrt(B_m));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 2.2e+59) {
tmp = Math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * ((A + (C + Math.hypot(B_m, (A - C)))) * (2.0 * F)))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = Math.sqrt(((2.0 * (F + ((A * F) / B_m))) + ((F * (A * (A / B_m))) / B_m))) / (0.0 - Math.sqrt(B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if B_m <= 2.2e+59: tmp = math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * ((A + (C + math.hypot(B_m, (A - C)))) * (2.0 * F)))) / (((4.0 * A) * C) - (B_m * B_m)) else: tmp = math.sqrt(((2.0 * (F + ((A * F) / B_m))) + ((F * (A * (A / B_m))) / B_m))) / (0.0 - math.sqrt(B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 2.2e+59) tmp = Float64(sqrt(Float64(Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))) * Float64(Float64(A + Float64(C + hypot(B_m, Float64(A - C)))) * Float64(2.0 * F)))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))); else tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(F + Float64(Float64(A * F) / B_m))) + Float64(Float64(F * Float64(A * Float64(A / B_m))) / B_m))) / Float64(0.0 - sqrt(B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (B_m <= 2.2e+59) tmp = sqrt((((B_m * B_m) + (-4.0 * (A * C))) * ((A + (C + hypot(B_m, (A - C)))) * (2.0 * F)))) / (((4.0 * A) * C) - (B_m * B_m)); else tmp = sqrt(((2.0 * (F + ((A * F) / B_m))) + ((F * (A * (A / B_m))) / B_m))) / (0.0 - sqrt(B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 2.2e+59], N[(N[Sqrt[N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(2.0 * N[(F + N[(N[(A * F), $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F * N[(A * N[(A / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 2.2 \cdot 10^{+59}:\\
\;\;\;\;\frac{\sqrt{\left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F + \frac{A \cdot F}{B\_m}\right) + \frac{F \cdot \left(A \cdot \frac{A}{B\_m}\right)}{B\_m}}}{0 - \sqrt{B\_m}}\\
\end{array}
\end{array}
if B < 2.2e59Initial program 24.7%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified28.5%
Applied egg-rr29.3%
if 2.2e59 < B Initial program 16.7%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified16.7%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
Simplified11.9%
Taylor expanded in C around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
Simplified43.6%
sqrt-divN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Applied egg-rr71.6%
Final simplification39.8%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* (* 4.0 A) C)))
(if (<= B_m 7.2e+30)
(/
(sqrt
(* (* (* 2.0 F) (- (* B_m B_m) t_0)) (+ (+ A C) (hypot B_m (- A C)))))
(- t_0 (* B_m B_m)))
(/
(sqrt (+ (* 2.0 (+ F (/ (* A F) B_m))) (/ (* F (* A (/ A B_m))) B_m)))
(- 0.0 (sqrt B_m))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double tmp;
if (B_m <= 7.2e+30) {
tmp = sqrt((((2.0 * F) * ((B_m * B_m) - t_0)) * ((A + C) + hypot(B_m, (A - C))))) / (t_0 - (B_m * B_m));
} else {
tmp = sqrt(((2.0 * (F + ((A * F) / B_m))) + ((F * (A * (A / B_m))) / B_m))) / (0.0 - sqrt(B_m));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double tmp;
if (B_m <= 7.2e+30) {
tmp = Math.sqrt((((2.0 * F) * ((B_m * B_m) - t_0)) * ((A + C) + Math.hypot(B_m, (A - C))))) / (t_0 - (B_m * B_m));
} else {
tmp = Math.sqrt(((2.0 * (F + ((A * F) / B_m))) + ((F * (A * (A / B_m))) / B_m))) / (0.0 - Math.sqrt(B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = (4.0 * A) * C tmp = 0 if B_m <= 7.2e+30: tmp = math.sqrt((((2.0 * F) * ((B_m * B_m) - t_0)) * ((A + C) + math.hypot(B_m, (A - C))))) / (t_0 - (B_m * B_m)) else: tmp = math.sqrt(((2.0 * (F + ((A * F) / B_m))) + ((F * (A * (A / B_m))) / B_m))) / (0.0 - math.sqrt(B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) tmp = 0.0 if (B_m <= 7.2e+30) tmp = Float64(sqrt(Float64(Float64(Float64(2.0 * F) * Float64(Float64(B_m * B_m) - t_0)) * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))) / Float64(t_0 - Float64(B_m * B_m))); else tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(F + Float64(Float64(A * F) / B_m))) + Float64(Float64(F * Float64(A * Float64(A / B_m))) / B_m))) / Float64(0.0 - sqrt(B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = (4.0 * A) * C; tmp = 0.0; if (B_m <= 7.2e+30) tmp = sqrt((((2.0 * F) * ((B_m * B_m) - t_0)) * ((A + C) + hypot(B_m, (A - C))))) / (t_0 - (B_m * B_m)); else tmp = sqrt(((2.0 * (F + ((A * F) / B_m))) + ((F * (A * (A / B_m))) / B_m))) / (0.0 - sqrt(B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[B$95$m, 7.2e+30], N[(N[Sqrt[N[(N[(N[(2.0 * F), $MachinePrecision] * N[(N[(B$95$m * B$95$m), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(2.0 * N[(F + N[(N[(A * F), $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F * N[(A * N[(A / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;B\_m \leq 7.2 \cdot 10^{+30}:\\
\;\;\;\;\frac{\sqrt{\left(\left(2 \cdot F\right) \cdot \left(B\_m \cdot B\_m - t\_0\right)\right) \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)}}{t\_0 - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F + \frac{A \cdot F}{B\_m}\right) + \frac{F \cdot \left(A \cdot \frac{A}{B\_m}\right)}{B\_m}}}{0 - \sqrt{B\_m}}\\
\end{array}
\end{array}
if B < 7.2000000000000004e30Initial program 24.0%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified27.9%
if 7.2000000000000004e30 < B Initial program 19.8%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified19.8%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
Simplified14.5%
Taylor expanded in C around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
Simplified41.6%
sqrt-divN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Applied egg-rr65.4%
Final simplification38.8%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= B_m 2.0)
(/ (sqrt (* -16.0 (* (* A F) (* A C)))) (- (* (* 4.0 A) C) (* B_m B_m)))
(/
(sqrt (+ (* 2.0 (+ F (/ (* A F) B_m))) (/ (* F (* A (/ A B_m))) B_m)))
(- 0.0 (sqrt B_m)))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 2.0) {
tmp = sqrt((-16.0 * ((A * F) * (A * C)))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = sqrt(((2.0 * (F + ((A * F) / B_m))) + ((F * (A * (A / B_m))) / B_m))) / (0.0 - sqrt(B_m));
}
return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (b_m <= 2.0d0) then
tmp = sqrt(((-16.0d0) * ((a * f) * (a * c)))) / (((4.0d0 * a) * c) - (b_m * b_m))
else
tmp = sqrt(((2.0d0 * (f + ((a * f) / b_m))) + ((f * (a * (a / b_m))) / b_m))) / (0.0d0 - sqrt(b_m))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 2.0) {
tmp = Math.sqrt((-16.0 * ((A * F) * (A * C)))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = Math.sqrt(((2.0 * (F + ((A * F) / B_m))) + ((F * (A * (A / B_m))) / B_m))) / (0.0 - Math.sqrt(B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if B_m <= 2.0: tmp = math.sqrt((-16.0 * ((A * F) * (A * C)))) / (((4.0 * A) * C) - (B_m * B_m)) else: tmp = math.sqrt(((2.0 * (F + ((A * F) / B_m))) + ((F * (A * (A / B_m))) / B_m))) / (0.0 - math.sqrt(B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 2.0) tmp = Float64(sqrt(Float64(-16.0 * Float64(Float64(A * F) * Float64(A * C)))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))); else tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(F + Float64(Float64(A * F) / B_m))) + Float64(Float64(F * Float64(A * Float64(A / B_m))) / B_m))) / Float64(0.0 - sqrt(B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (B_m <= 2.0) tmp = sqrt((-16.0 * ((A * F) * (A * C)))) / (((4.0 * A) * C) - (B_m * B_m)); else tmp = sqrt(((2.0 * (F + ((A * F) / B_m))) + ((F * (A * (A / B_m))) / B_m))) / (0.0 - sqrt(B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 2.0], N[(N[Sqrt[N[(-16.0 * N[(N[(A * F), $MachinePrecision] * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(2.0 * N[(F + N[(N[(A * F), $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F * N[(A * N[(A / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 2:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(A \cdot F\right) \cdot \left(A \cdot C\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F + \frac{A \cdot F}{B\_m}\right) + \frac{F \cdot \left(A \cdot \frac{A}{B\_m}\right)}{B\_m}}}{0 - \sqrt{B\_m}}\\
\end{array}
\end{array}
if B < 2Initial program 24.0%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified27.6%
Taylor expanded in B around 0
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6414.5%
Simplified14.5%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6417.6%
Applied egg-rr17.6%
if 2 < B Initial program 19.9%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified21.1%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
Simplified14.9%
Taylor expanded in C around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
Simplified40.3%
sqrt-divN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Applied egg-rr62.6%
Final simplification31.5%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -5e-310)
(/ (sqrt (* -16.0 (* A (* F (* A C))))) (- (* (* 4.0 A) C) (* B_m B_m)))
(if (<= F 1.85e+54)
(/ (sqrt (* 2.0 (* F (+ C (hypot B_m C))))) (- 0.0 B_m))
(- 0.0 (sqrt (/ (* 2.0 F) B_m))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5e-310) {
tmp = sqrt((-16.0 * (A * (F * (A * C))))) / (((4.0 * A) * C) - (B_m * B_m));
} else if (F <= 1.85e+54) {
tmp = sqrt((2.0 * (F * (C + hypot(B_m, C))))) / (0.0 - B_m);
} else {
tmp = 0.0 - sqrt(((2.0 * F) / B_m));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5e-310) {
tmp = Math.sqrt((-16.0 * (A * (F * (A * C))))) / (((4.0 * A) * C) - (B_m * B_m));
} else if (F <= 1.85e+54) {
tmp = Math.sqrt((2.0 * (F * (C + Math.hypot(B_m, C))))) / (0.0 - B_m);
} else {
tmp = 0.0 - Math.sqrt(((2.0 * F) / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= -5e-310: tmp = math.sqrt((-16.0 * (A * (F * (A * C))))) / (((4.0 * A) * C) - (B_m * B_m)) elif F <= 1.85e+54: tmp = math.sqrt((2.0 * (F * (C + math.hypot(B_m, C))))) / (0.0 - B_m) else: tmp = 0.0 - math.sqrt(((2.0 * F) / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -5e-310) tmp = Float64(sqrt(Float64(-16.0 * Float64(A * Float64(F * Float64(A * C))))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))); elseif (F <= 1.85e+54) tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C + hypot(B_m, C))))) / Float64(0.0 - B_m)); else tmp = Float64(0.0 - sqrt(Float64(Float64(2.0 * F) / B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= -5e-310) tmp = sqrt((-16.0 * (A * (F * (A * C))))) / (((4.0 * A) * C) - (B_m * B_m)); elseif (F <= 1.85e+54) tmp = sqrt((2.0 * (F * (C + hypot(B_m, C))))) / (0.0 - B_m); else tmp = 0.0 - sqrt(((2.0 * F) / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -5e-310], N[(N[Sqrt[N[(-16.0 * N[(A * N[(F * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.85e+54], N[(N[Sqrt[N[(2.0 * N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(A \cdot \left(F \cdot \left(A \cdot C\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\
\mathbf{elif}\;F \leq 1.85 \cdot 10^{+54}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)\right)}}{0 - B\_m}\\
\mathbf{else}:\\
\;\;\;\;0 - \sqrt{\frac{2 \cdot F}{B\_m}}\\
\end{array}
\end{array}
if F < -4.999999999999985e-310Initial program 30.5%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified43.1%
Taylor expanded in B around 0
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6422.3%
Simplified22.3%
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6434.1%
Applied egg-rr34.1%
if -4.999999999999985e-310 < F < 1.8500000000000001e54Initial program 25.4%
Taylor expanded in A around 0
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6431.1%
Simplified31.1%
associate-*l*N/A
mul-1-negN/A
neg-lowering-neg.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr31.4%
if 1.8500000000000001e54 < F Initial program 16.4%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified16.1%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
Simplified3.6%
Taylor expanded in C around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
Simplified17.6%
Taylor expanded in A around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f6419.5%
Simplified19.5%
Final simplification27.4%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -5e-310)
(/ (sqrt (* -16.0 (* A (* F (* A C))))) (- (* (* 4.0 A) C) (* B_m B_m)))
(if (<= F 9.5e-32)
(* (- 0.0 (/ (sqrt 2.0) B_m)) (sqrt (* B_m F)))
(- 0.0 (sqrt (/ (* 2.0 F) B_m))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5e-310) {
tmp = sqrt((-16.0 * (A * (F * (A * C))))) / (((4.0 * A) * C) - (B_m * B_m));
} else if (F <= 9.5e-32) {
tmp = (0.0 - (sqrt(2.0) / B_m)) * sqrt((B_m * F));
} else {
tmp = 0.0 - sqrt(((2.0 * F) / B_m));
}
return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (f <= (-5d-310)) then
tmp = sqrt(((-16.0d0) * (a * (f * (a * c))))) / (((4.0d0 * a) * c) - (b_m * b_m))
else if (f <= 9.5d-32) then
tmp = (0.0d0 - (sqrt(2.0d0) / b_m)) * sqrt((b_m * f))
else
tmp = 0.0d0 - sqrt(((2.0d0 * f) / b_m))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5e-310) {
tmp = Math.sqrt((-16.0 * (A * (F * (A * C))))) / (((4.0 * A) * C) - (B_m * B_m));
} else if (F <= 9.5e-32) {
tmp = (0.0 - (Math.sqrt(2.0) / B_m)) * Math.sqrt((B_m * F));
} else {
tmp = 0.0 - Math.sqrt(((2.0 * F) / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= -5e-310: tmp = math.sqrt((-16.0 * (A * (F * (A * C))))) / (((4.0 * A) * C) - (B_m * B_m)) elif F <= 9.5e-32: tmp = (0.0 - (math.sqrt(2.0) / B_m)) * math.sqrt((B_m * F)) else: tmp = 0.0 - math.sqrt(((2.0 * F) / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -5e-310) tmp = Float64(sqrt(Float64(-16.0 * Float64(A * Float64(F * Float64(A * C))))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))); elseif (F <= 9.5e-32) tmp = Float64(Float64(0.0 - Float64(sqrt(2.0) / B_m)) * sqrt(Float64(B_m * F))); else tmp = Float64(0.0 - sqrt(Float64(Float64(2.0 * F) / B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= -5e-310) tmp = sqrt((-16.0 * (A * (F * (A * C))))) / (((4.0 * A) * C) - (B_m * B_m)); elseif (F <= 9.5e-32) tmp = (0.0 - (sqrt(2.0) / B_m)) * sqrt((B_m * F)); else tmp = 0.0 - sqrt(((2.0 * F) / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -5e-310], N[(N[Sqrt[N[(-16.0 * N[(A * N[(F * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.5e-32], N[(N[(0.0 - N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.0 - N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(A \cdot \left(F \cdot \left(A \cdot C\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-32}:\\
\;\;\;\;\left(0 - \frac{\sqrt{2}}{B\_m}\right) \cdot \sqrt{B\_m \cdot F}\\
\mathbf{else}:\\
\;\;\;\;0 - \sqrt{\frac{2 \cdot F}{B\_m}}\\
\end{array}
\end{array}
if F < -4.999999999999985e-310Initial program 30.5%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified43.1%
Taylor expanded in B around 0
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6422.3%
Simplified22.3%
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6434.1%
Applied egg-rr34.1%
if -4.999999999999985e-310 < F < 9.4999999999999999e-32Initial program 22.8%
Taylor expanded in A around 0
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6431.0%
Simplified31.0%
Taylor expanded in C around 0
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6428.0%
Simplified28.0%
if 9.4999999999999999e-32 < F Initial program 20.8%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified20.6%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
Simplified4.7%
Taylor expanded in C around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
Simplified19.4%
Taylor expanded in A around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f6421.2%
Simplified21.2%
Final simplification25.5%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= B_m 1.35) (/ (sqrt (* -16.0 (* (* A F) (* A C)))) (- (* (* 4.0 A) C) (* B_m B_m))) (- 0.0 (sqrt (/ (* 2.0 F) B_m)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 1.35) {
tmp = sqrt((-16.0 * ((A * F) * (A * C)))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = 0.0 - sqrt(((2.0 * F) / B_m));
}
return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (b_m <= 1.35d0) then
tmp = sqrt(((-16.0d0) * ((a * f) * (a * c)))) / (((4.0d0 * a) * c) - (b_m * b_m))
else
tmp = 0.0d0 - sqrt(((2.0d0 * f) / b_m))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 1.35) {
tmp = Math.sqrt((-16.0 * ((A * F) * (A * C)))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = 0.0 - Math.sqrt(((2.0 * F) / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if B_m <= 1.35: tmp = math.sqrt((-16.0 * ((A * F) * (A * C)))) / (((4.0 * A) * C) - (B_m * B_m)) else: tmp = 0.0 - math.sqrt(((2.0 * F) / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 1.35) tmp = Float64(sqrt(Float64(-16.0 * Float64(Float64(A * F) * Float64(A * C)))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))); else tmp = Float64(0.0 - sqrt(Float64(Float64(2.0 * F) / B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (B_m <= 1.35) tmp = sqrt((-16.0 * ((A * F) * (A * C)))) / (((4.0 * A) * C) - (B_m * B_m)); else tmp = 0.0 - sqrt(((2.0 * F) / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 1.35], N[(N[Sqrt[N[(-16.0 * N[(N[(A * F), $MachinePrecision] * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 1.35:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(A \cdot F\right) \cdot \left(A \cdot C\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;0 - \sqrt{\frac{2 \cdot F}{B\_m}}\\
\end{array}
\end{array}
if B < 1.3500000000000001Initial program 24.0%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified27.6%
Taylor expanded in B around 0
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6414.5%
Simplified14.5%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6417.6%
Applied egg-rr17.6%
if 1.3500000000000001 < B Initial program 19.9%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified21.1%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
Simplified14.9%
Taylor expanded in C around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
Simplified40.3%
Taylor expanded in A around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f6441.9%
Simplified41.9%
Final simplification25.1%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= B_m 1.25) (/ (sqrt (* -16.0 (* A (* F (* A C))))) (- (* (* 4.0 A) C) (* B_m B_m))) (- 0.0 (sqrt (/ (* 2.0 F) B_m)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 1.25) {
tmp = sqrt((-16.0 * (A * (F * (A * C))))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = 0.0 - sqrt(((2.0 * F) / B_m));
}
return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (b_m <= 1.25d0) then
tmp = sqrt(((-16.0d0) * (a * (f * (a * c))))) / (((4.0d0 * a) * c) - (b_m * b_m))
else
tmp = 0.0d0 - sqrt(((2.0d0 * f) / b_m))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 1.25) {
tmp = Math.sqrt((-16.0 * (A * (F * (A * C))))) / (((4.0 * A) * C) - (B_m * B_m));
} else {
tmp = 0.0 - Math.sqrt(((2.0 * F) / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if B_m <= 1.25: tmp = math.sqrt((-16.0 * (A * (F * (A * C))))) / (((4.0 * A) * C) - (B_m * B_m)) else: tmp = 0.0 - math.sqrt(((2.0 * F) / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 1.25) tmp = Float64(sqrt(Float64(-16.0 * Float64(A * Float64(F * Float64(A * C))))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))); else tmp = Float64(0.0 - sqrt(Float64(Float64(2.0 * F) / B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (B_m <= 1.25) tmp = sqrt((-16.0 * (A * (F * (A * C))))) / (((4.0 * A) * C) - (B_m * B_m)); else tmp = 0.0 - sqrt(((2.0 * F) / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 1.25], N[(N[Sqrt[N[(-16.0 * N[(A * N[(F * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 1.25:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(A \cdot \left(F \cdot \left(A \cdot C\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;0 - \sqrt{\frac{2 \cdot F}{B\_m}}\\
\end{array}
\end{array}
if B < 1.25Initial program 24.0%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified27.6%
Taylor expanded in B around 0
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6414.5%
Simplified14.5%
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6417.1%
Applied egg-rr17.1%
if 1.25 < B Initial program 19.9%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified21.1%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
Simplified14.9%
Taylor expanded in C around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
Simplified40.3%
Taylor expanded in A around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f6441.9%
Simplified41.9%
Final simplification24.7%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (- 0.0 (sqrt (/ (* 2.0 F) B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
return 0.0 - sqrt(((2.0 * F) / B_m));
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
code = 0.0d0 - sqrt(((2.0d0 * f) / b_m))
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
return 0.0 - Math.sqrt(((2.0 * F) / B_m));
}
B_m = math.fabs(B) def code(A, B_m, C, F): return 0.0 - math.sqrt(((2.0 * F) / B_m))
B_m = abs(B) function code(A, B_m, C, F) return Float64(0.0 - sqrt(Float64(Float64(2.0 * F) / B_m))) end
B_m = abs(B); function tmp = code(A, B_m, C, F) tmp = 0.0 - sqrt(((2.0 * F) / B_m)); end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := N[(0.0 - N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
0 - \sqrt{\frac{2 \cdot F}{B\_m}}
\end{array}
Initial program 22.8%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified25.6%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
Simplified5.5%
Taylor expanded in C around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
Simplified14.0%
Taylor expanded in A around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f6415.2%
Simplified15.2%
Final simplification15.2%
herbie shell --seed 2024160
(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))))