
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) + sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0}
\end{array}
\end{array}
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* A C))))
(t_1 (fma C (* A -4.0) (* B B)))
(t_2 (- (pow B 2.0) (* (* 4.0 A) C)))
(t_3
(/
(-
(sqrt
(*
(* 2.0 (* t_2 F))
(+ (+ A C) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))))))
t_2))
(t_4
(/
(* (sqrt (* 2.0 (* F t_0))) (- (sqrt (+ C (+ A (hypot B (- A C)))))))
t_0)))
(if (<= t_3 -5e-201)
t_4
(if (<= t_3 0.0)
(/
(- (sqrt (* 2.0 (* (* F t_1) (fma 2.0 A (* -0.5 (/ (* B B) C)))))))
t_1)
(if (<= t_3 INFINITY)
t_4
(* (/ (sqrt 2.0) B) (* (sqrt (+ A (hypot B A))) (- (sqrt F)))))))))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 = fma(C, (A * -4.0), (B * B));
double t_2 = pow(B, 2.0) - ((4.0 * A) * C);
double t_3 = -sqrt(((2.0 * (t_2 * F)) * ((A + C) + sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_2;
double t_4 = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0;
double tmp;
if (t_3 <= -5e-201) {
tmp = t_4;
} else if (t_3 <= 0.0) {
tmp = -sqrt((2.0 * ((F * t_1) * fma(2.0, A, (-0.5 * ((B * B) / C)))))) / t_1;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = (sqrt(2.0) / B) * (sqrt((A + hypot(B, A))) * -sqrt(F));
}
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 = fma(C, Float64(A * -4.0), Float64(B * B)) t_2 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) t_3 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_2 * F)) * Float64(Float64(A + C) + sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_2) t_4 = Float64(Float64(sqrt(Float64(2.0 * Float64(F * t_0))) * Float64(-sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / t_0) tmp = 0.0 if (t_3 <= -5e-201) tmp = t_4; elseif (t_3 <= 0.0) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_1) * fma(2.0, A, Float64(-0.5 * Float64(Float64(B * B) / C))))))) / t_1); elseif (t_3 <= Inf) tmp = t_4; else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(Float64(A + hypot(B, A))) * Float64(-sqrt(F)))); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$2 * 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$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-201], t$95$4, If[LessEqual[t$95$3, 0.0], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$1), $MachinePrecision] * N[(2.0 * A + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$4, N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_1 := \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\\
t_2 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
t_3 := \frac{-\sqrt{\left(2 \cdot \left(t_2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_2}\\
t_4 := \frac{\sqrt{2 \cdot \left(F \cdot t_0\right)} \cdot \left(-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{t_0}\\
\mathbf{if}\;t_3 \leq -5 \cdot 10^{-201}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t_3 \leq 0:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_1\right) \cdot \mathsf{fma}\left(2, A, -0.5 \cdot \frac{B \cdot B}{C}\right)\right)}}{t_1}\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \left(-\sqrt{F}\right)\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))) < -4.9999999999999999e-201 or -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 31.9%
associate-*l*31.9%
unpow231.9%
+-commutative31.9%
unpow231.9%
associate-*l*31.9%
unpow231.9%
Simplified31.9%
sqrt-prod38.9%
*-commutative38.9%
*-commutative38.9%
associate-+l+38.9%
unpow238.9%
hypot-udef69.9%
associate-+r+69.7%
+-commutative69.7%
associate-+r+70.3%
Applied egg-rr70.3%
if -4.9999999999999999e-201 < (/.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 3.4%
Simplified7.4%
Taylor expanded in C around -inf 36.1%
fma-def36.1%
unpow236.1%
Simplified36.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.7%
Taylor expanded in C around 0 1.8%
mul-1-neg1.8%
distribute-rgt-neg-in1.8%
unpow21.8%
unpow21.8%
hypot-def18.1%
Simplified18.1%
sqrt-prod24.5%
Applied egg-rr24.5%
Final simplification44.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 (<= B 2e+44)
(/
(* (sqrt (* 2.0 (* F t_0))) (- (sqrt (+ C (+ A (hypot B (- A C)))))))
t_0)
(* (/ (sqrt 2.0) B) (* (sqrt (+ A (hypot B A))) (- (sqrt F)))))))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 <= 2e+44) {
tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * (sqrt((A + hypot(B, A))) * -sqrt(F));
}
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 <= 2e+44) {
tmp = (Math.sqrt((2.0 * (F * t_0))) * -Math.sqrt((C + (A + Math.hypot(B, (A - C)))))) / t_0;
} else {
tmp = (Math.sqrt(2.0) / B) * (Math.sqrt((A + Math.hypot(B, A))) * -Math.sqrt(F));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if B <= 2e+44: tmp = (math.sqrt((2.0 * (F * t_0))) * -math.sqrt((C + (A + math.hypot(B, (A - C)))))) / t_0 else: tmp = (math.sqrt(2.0) / B) * (math.sqrt((A + math.hypot(B, A))) * -math.sqrt(F)) 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 <= 2e+44) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * t_0))) * Float64(-sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(Float64(A + hypot(B, A))) * Float64(-sqrt(F)))); 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 <= 2e+44) tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0; else tmp = (sqrt(2.0) / B) * (sqrt((A + hypot(B, A))) * -sqrt(F)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 2e+44], N[(N[(N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $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 2 \cdot 10^{+44}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot t_0\right)} \cdot \left(-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < 2.0000000000000002e44Initial program 13.9%
associate-*l*13.9%
unpow213.9%
+-commutative13.9%
unpow213.9%
associate-*l*13.9%
unpow213.9%
Simplified13.9%
sqrt-prod18.1%
*-commutative18.1%
*-commutative18.1%
associate-+l+18.6%
unpow218.6%
hypot-udef32.9%
associate-+r+32.3%
+-commutative32.3%
associate-+r+33.1%
Applied egg-rr33.1%
if 2.0000000000000002e44 < B Initial program 11.3%
Simplified13.5%
Taylor expanded in C around 0 19.5%
mul-1-neg19.5%
distribute-rgt-neg-in19.5%
unpow219.5%
unpow219.5%
hypot-def57.2%
Simplified57.2%
sqrt-prod77.6%
Applied egg-rr77.6%
Final simplification41.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* A C)))))
(if (<= B 2e+107)
(/
(* (sqrt (* 2.0 (* F t_0))) (- (sqrt (+ C (+ A (hypot B (- A C)))))))
t_0)
(if (<= B 6.2e+247)
(* (sqrt 2.0) (- (sqrt (/ F B))))
(/ (* (sqrt 2.0) (- (sqrt (* F (+ A (hypot B A)))))) 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 <= 2e+107) {
tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0;
} else if (B <= 6.2e+247) {
tmp = sqrt(2.0) * -sqrt((F / B));
} else {
tmp = (sqrt(2.0) * -sqrt((F * (A + hypot(B, A))))) / 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 <= 2e+107) {
tmp = (Math.sqrt((2.0 * (F * t_0))) * -Math.sqrt((C + (A + Math.hypot(B, (A - C)))))) / t_0;
} else if (B <= 6.2e+247) {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
} else {
tmp = (Math.sqrt(2.0) * -Math.sqrt((F * (A + Math.hypot(B, A))))) / B;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if B <= 2e+107: tmp = (math.sqrt((2.0 * (F * t_0))) * -math.sqrt((C + (A + math.hypot(B, (A - C)))))) / t_0 elif B <= 6.2e+247: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) else: tmp = (math.sqrt(2.0) * -math.sqrt((F * (A + math.hypot(B, A))))) / 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 <= 2e+107) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * t_0))) * Float64(-sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / t_0); elseif (B <= 6.2e+247) tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); else tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(F * Float64(A + hypot(B, A)))))) / 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 <= 2e+107) tmp = (sqrt((2.0 * (F * t_0))) * -sqrt((C + (A + hypot(B, (A - C)))))) / t_0; elseif (B <= 6.2e+247) tmp = sqrt(2.0) * -sqrt((F / B)); else tmp = (sqrt(2.0) * -sqrt((F * (A + hypot(B, A))))) / 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, 2e+107], N[(N[(N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B, 6.2e+247], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B), $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 2 \cdot 10^{+107}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot t_0\right)} \cdot \left(-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{t_0}\\
\mathbf{elif}\;B \leq 6.2 \cdot 10^{+247}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}\\
\end{array}
\end{array}
if B < 1.9999999999999999e107Initial program 14.6%
associate-*l*14.6%
unpow214.6%
+-commutative14.6%
unpow214.6%
associate-*l*14.6%
unpow214.6%
Simplified14.6%
sqrt-prod19.0%
*-commutative19.0%
*-commutative19.0%
associate-+l+19.4%
unpow219.4%
hypot-udef33.4%
associate-+r+32.9%
+-commutative32.9%
associate-+r+33.6%
Applied egg-rr33.6%
if 1.9999999999999999e107 < B < 6.1999999999999996e247Initial program 8.5%
Simplified12.5%
Taylor expanded in C around 0 11.0%
mul-1-neg11.0%
distribute-rgt-neg-in11.0%
unpow211.0%
unpow211.0%
hypot-def46.5%
Simplified46.5%
Taylor expanded in A around 0 54.7%
associate-*r*54.7%
mul-1-neg54.7%
Simplified54.7%
if 6.1999999999999996e247 < B Initial program 0.0%
Simplified0.0%
Taylor expanded in C around 0 2.0%
mul-1-neg2.0%
distribute-rgt-neg-in2.0%
unpow22.0%
unpow22.0%
hypot-def80.0%
Simplified80.0%
associate-*l/80.2%
Applied egg-rr80.2%
Final simplification37.5%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* A C)))))
(if (<= F 7e-285)
(/ (- (sqrt (* 2.0 (* (* F t_0) (+ C (+ A (hypot B (- A C)))))))) t_0)
(if (<= F 5.5e+34)
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ C (hypot B C))))))
(* (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 <= 7e-285) {
tmp = -sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0;
} else if (F <= 5.5e+34) {
tmp = (sqrt(2.0) / B) * -sqrt((F * (C + hypot(B, C))));
} 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 <= 7e-285) {
tmp = -Math.sqrt((2.0 * ((F * t_0) * (C + (A + Math.hypot(B, (A - C))))))) / t_0;
} else if (F <= 5.5e+34) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (C + Math.hypot(B, C))));
} 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 <= 7e-285: tmp = -math.sqrt((2.0 * ((F * t_0) * (C + (A + math.hypot(B, (A - C))))))) / t_0 elif F <= 5.5e+34: tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (C + math.hypot(B, C)))) 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 <= 7e-285) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(C + Float64(A + hypot(B, Float64(A - C)))))))) / t_0); elseif (F <= 5.5e+34) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(C + hypot(B, C)))))); 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 <= 7e-285) tmp = -sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0; elseif (F <= 5.5e+34) tmp = (sqrt(2.0) / B) * -sqrt((F * (C + hypot(B, C)))); 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, 7e-285], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[F, 5.5e+34], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], 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 7 \cdot 10^{-285}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;F \leq 5.5 \cdot 10^{+34}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 7.0000000000000007e-285Initial program 13.5%
associate-*l*13.5%
unpow213.5%
+-commutative13.5%
unpow213.5%
associate-*l*13.5%
unpow213.5%
Simplified13.5%
distribute-frac-neg13.5%
Applied egg-rr47.3%
if 7.0000000000000007e-285 < F < 5.4999999999999996e34Initial program 12.2%
Simplified18.5%
Taylor expanded in A around 0 8.3%
mul-1-neg8.3%
distribute-rgt-neg-in8.3%
*-commutative8.3%
unpow28.3%
unpow28.3%
hypot-def21.3%
Simplified21.3%
if 5.4999999999999996e34 < F Initial program 14.8%
Simplified17.9%
Taylor expanded in C around 0 9.8%
mul-1-neg9.8%
distribute-rgt-neg-in9.8%
unpow29.8%
unpow29.8%
hypot-def12.0%
Simplified12.0%
Taylor expanded in A around 0 18.2%
associate-*r*18.2%
mul-1-neg18.2%
Simplified18.2%
Final simplification23.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 3.1e-282)
(/ (- (sqrt (* 2.0 (* (* F t_0) (+ C (+ A (hypot B (- A C)))))))) t_0)
(if (<= F 8.5e+32)
(* (sqrt (* F (+ A (hypot B A)))) (/ (- (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 <= 3.1e-282) {
tmp = -sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0;
} else if (F <= 8.5e+32) {
tmp = sqrt((F * (A + hypot(B, A)))) * (-sqrt(2.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.1e-282) {
tmp = -Math.sqrt((2.0 * ((F * t_0) * (C + (A + Math.hypot(B, (A - C))))))) / t_0;
} else if (F <= 8.5e+32) {
tmp = Math.sqrt((F * (A + Math.hypot(B, A)))) * (-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 <= 3.1e-282: tmp = -math.sqrt((2.0 * ((F * t_0) * (C + (A + math.hypot(B, (A - C))))))) / t_0 elif F <= 8.5e+32: tmp = math.sqrt((F * (A + math.hypot(B, A)))) * (-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 <= 3.1e-282) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(C + Float64(A + hypot(B, Float64(A - C)))))))) / t_0); elseif (F <= 8.5e+32) tmp = Float64(sqrt(Float64(F * Float64(A + hypot(B, A)))) * Float64(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 <= 3.1e-282) tmp = -sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0; elseif (F <= 8.5e+32) tmp = sqrt((F * (A + hypot(B, A)))) * (-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, 3.1e-282], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[F, 8.5e+32], N[(N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / 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.1 \cdot 10^{-282}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;F \leq 8.5 \cdot 10^{+32}:\\
\;\;\;\;\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 3.10000000000000013e-282Initial program 12.9%
associate-*l*12.9%
unpow212.9%
+-commutative12.9%
unpow212.9%
associate-*l*12.9%
unpow212.9%
Simplified12.9%
distribute-frac-neg12.9%
Applied egg-rr47.6%
if 3.10000000000000013e-282 < F < 8.4999999999999998e32Initial program 12.5%
Simplified18.1%
Taylor expanded in C around 0 9.3%
mul-1-neg9.3%
distribute-rgt-neg-in9.3%
unpow29.3%
unpow29.3%
hypot-def23.2%
Simplified23.2%
if 8.4999999999999998e32 < F Initial program 14.6%
Simplified17.7%
Taylor expanded in C around 0 9.7%
mul-1-neg9.7%
distribute-rgt-neg-in9.7%
unpow29.7%
unpow29.7%
hypot-def11.9%
Simplified11.9%
Taylor expanded in A around 0 18.1%
associate-*r*18.1%
mul-1-neg18.1%
Simplified18.1%
Final simplification24.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.8e-282)
(/ (- (sqrt (* 2.0 (* (* F t_0) (+ C (+ A (hypot B (- A C)))))))) t_0)
(if (<= F 4e+33)
(/ (* (sqrt 2.0) (- (sqrt (* 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.8e-282) {
tmp = -sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0;
} else if (F <= 4e+33) {
tmp = (sqrt(2.0) * -sqrt((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.8e-282) {
tmp = -Math.sqrt((2.0 * ((F * t_0) * (C + (A + Math.hypot(B, (A - C))))))) / t_0;
} else if (F <= 4e+33) {
tmp = (Math.sqrt(2.0) * -Math.sqrt((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.8e-282: tmp = -math.sqrt((2.0 * ((F * t_0) * (C + (A + math.hypot(B, (A - C))))))) / t_0 elif F <= 4e+33: tmp = (math.sqrt(2.0) * -math.sqrt((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.8e-282) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(C + Float64(A + hypot(B, Float64(A - C)))))))) / t_0); elseif (F <= 4e+33) tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(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.8e-282) tmp = -sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0; elseif (F <= 4e+33) tmp = (sqrt(2.0) * -sqrt((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.8e-282], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[F, 4e+33], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[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.8 \cdot 10^{-282}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{+33}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{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.79999999999999994e-282Initial program 12.9%
associate-*l*12.9%
unpow212.9%
+-commutative12.9%
unpow212.9%
associate-*l*12.9%
unpow212.9%
Simplified12.9%
distribute-frac-neg12.9%
Applied egg-rr47.6%
if 4.79999999999999994e-282 < F < 3.9999999999999998e33Initial program 12.5%
Simplified18.1%
Taylor expanded in C around 0 9.3%
mul-1-neg9.3%
distribute-rgt-neg-in9.3%
unpow29.3%
unpow29.3%
hypot-def23.2%
Simplified23.2%
associate-*l/23.2%
Applied egg-rr23.2%
if 3.9999999999999998e33 < F Initial program 14.6%
Simplified17.7%
Taylor expanded in C around 0 9.7%
mul-1-neg9.7%
distribute-rgt-neg-in9.7%
unpow29.7%
unpow29.7%
hypot-def11.9%
Simplified11.9%
Taylor expanded in A around 0 18.1%
associate-*r*18.1%
mul-1-neg18.1%
Simplified18.1%
Final simplification24.7%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* A C)))))
(if (<= F 1.04e-218)
(/ (- (sqrt (* 2.0 (* (* F t_0) (+ C (+ A (hypot B (- A C)))))))) t_0)
(if (<= F 4.2e-20)
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ B A)))))
(* (sqrt 2.0) (- (sqrt (/ F B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (F <= 1.04e-218) {
tmp = -sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0;
} else if (F <= 4.2e-20) {
tmp = (sqrt(2.0) / B) * -sqrt((F * (B + A)));
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (F <= 1.04e-218) {
tmp = -Math.sqrt((2.0 * ((F * t_0) * (C + (A + Math.hypot(B, (A - C))))))) / t_0;
} else if (F <= 4.2e-20) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (B + A)));
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if F <= 1.04e-218: tmp = -math.sqrt((2.0 * ((F * t_0) * (C + (A + math.hypot(B, (A - C))))))) / t_0 elif F <= 4.2e-20: tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (B + A))) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) tmp = 0.0 if (F <= 1.04e-218) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(C + Float64(A + hypot(B, Float64(A - C)))))))) / t_0); elseif (F <= 4.2e-20) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(B + A))))); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (A * C)); tmp = 0.0; if (F <= 1.04e-218) tmp = -sqrt((2.0 * ((F * t_0) * (C + (A + hypot(B, (A - C))))))) / t_0; elseif (F <= 4.2e-20) tmp = (sqrt(2.0) / B) * -sqrt((F * (B + A))); else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, 1.04e-218], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[F, 4.2e-20], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(B + A), $MachinePrecision]), $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 1.04 \cdot 10^{-218}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{-20}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(B + A\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 1.04000000000000001e-218Initial program 16.3%
associate-*l*16.3%
unpow216.3%
+-commutative16.3%
unpow216.3%
associate-*l*16.3%
unpow216.3%
Simplified16.3%
distribute-frac-neg16.3%
Applied egg-rr45.0%
if 1.04000000000000001e-218 < F < 4.1999999999999998e-20Initial program 12.0%
Simplified15.8%
Taylor expanded in C around 0 6.6%
mul-1-neg6.6%
distribute-rgt-neg-in6.6%
unpow26.6%
unpow26.6%
hypot-def24.1%
Simplified24.1%
Taylor expanded in A around 0 19.7%
+-commutative19.7%
Simplified19.7%
if 4.1999999999999998e-20 < F Initial program 13.0%
Simplified15.8%
Taylor expanded in C around 0 9.1%
mul-1-neg9.1%
distribute-rgt-neg-in9.1%
unpow29.1%
unpow29.1%
hypot-def12.5%
Simplified12.5%
Taylor expanded in A around 0 17.3%
associate-*r*17.3%
mul-1-neg17.3%
Simplified17.3%
Final simplification24.0%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* A C)))))
(if (<= F 3.1e-282)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ (+ A C) (- C A))))) t_0)
(if (<= F 2.9e-19)
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ B A)))))
(* (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.1e-282) {
tmp = -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
} else if (F <= 2.9e-19) {
tmp = (sqrt(2.0) / B) * -sqrt((F * (B + A)));
} 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 <= 3.1d-282) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * ((a + c) + (c - a)))) / t_0
else if (f <= 2.9d-19) then
tmp = (sqrt(2.0d0) / b) * -sqrt((f * (b + a)))
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 <= 3.1e-282) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
} else if (F <= 2.9e-19) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (B + A)));
} 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.1e-282: tmp = -math.sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0 elif F <= 2.9e-19: tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (B + A))) 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.1e-282) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(Float64(A + C) + Float64(C - A))))) / t_0); elseif (F <= 2.9e-19) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(B + A))))); 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.1e-282) tmp = -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0; elseif (F <= 2.9e-19) tmp = (sqrt(2.0) / B) * -sqrt((F * (B + A))); 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.1e-282], 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], If[LessEqual[F, 2.9e-19], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(B + A), $MachinePrecision]), $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 3.1 \cdot 10^{-282}:\\
\;\;\;\;\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}\\
\mathbf{elif}\;F \leq 2.9 \cdot 10^{-19}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(B + A\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 3.10000000000000013e-282Initial program 12.9%
associate-*l*12.9%
unpow212.9%
+-commutative12.9%
unpow212.9%
associate-*l*12.9%
unpow212.9%
Simplified12.9%
Taylor expanded in A around -inf 32.2%
mul-1-neg32.2%
sub-neg32.2%
Simplified32.2%
if 3.10000000000000013e-282 < F < 2.9e-19Initial program 14.3%
Simplified20.9%
Taylor expanded in C around 0 10.0%
mul-1-neg10.0%
distribute-rgt-neg-in10.0%
unpow210.0%
unpow210.0%
hypot-def25.3%
Simplified25.3%
Taylor expanded in A around 0 21.3%
+-commutative21.3%
Simplified21.3%
if 2.9e-19 < F Initial program 13.0%
Simplified15.8%
Taylor expanded in C around 0 9.1%
mul-1-neg9.1%
distribute-rgt-neg-in9.1%
unpow29.1%
unpow29.1%
hypot-def12.5%
Simplified12.5%
Taylor expanded in A around 0 17.3%
associate-*r*17.3%
mul-1-neg17.3%
Simplified17.3%
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)))))
(if (<= F 3.1e-282)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ (+ A C) (- C A))))) t_0)
(if (<= F 62000000.0)
(* (/ (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 <= 3.1e-282) {
tmp = -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
} else if (F <= 62000000.0) {
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 <= 3.1d-282) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * ((a + c) + (c - a)))) / t_0
else if (f <= 62000000.0d0) 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 <= 3.1e-282) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
} else if (F <= 62000000.0) {
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 <= 3.1e-282: tmp = -math.sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0 elif F <= 62000000.0: 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 <= 3.1e-282) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(Float64(A + C) + Float64(C - A))))) / t_0); elseif (F <= 62000000.0) 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 <= 3.1e-282) tmp = -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0; elseif (F <= 62000000.0) 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, 3.1e-282], 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], If[LessEqual[F, 62000000.0], 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 3.1 \cdot 10^{-282}:\\
\;\;\;\;\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}\\
\mathbf{elif}\;F \leq 62000000:\\
\;\;\;\;\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 < 3.10000000000000013e-282Initial program 12.9%
associate-*l*12.9%
unpow212.9%
+-commutative12.9%
unpow212.9%
associate-*l*12.9%
unpow212.9%
Simplified12.9%
Taylor expanded in A around -inf 32.2%
mul-1-neg32.2%
sub-neg32.2%
Simplified32.2%
if 3.10000000000000013e-282 < F < 6.2e7Initial program 13.2%
Simplified19.2%
Taylor expanded in C around 0 9.3%
mul-1-neg9.3%
distribute-rgt-neg-in9.3%
unpow29.3%
unpow29.3%
hypot-def23.2%
Simplified23.2%
Taylor expanded in A around 0 19.8%
if 6.2e7 < F Initial program 13.8%
Simplified16.8%
Taylor expanded in C around 0 9.6%
mul-1-neg9.6%
distribute-rgt-neg-in9.6%
unpow29.6%
unpow29.6%
hypot-def13.3%
Simplified13.3%
Taylor expanded in A around 0 18.5%
associate-*r*18.5%
mul-1-neg18.5%
Simplified18.5%
Final simplification21.0%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* A C)))))
(if (<= C 5.2e+165)
(* (sqrt 2.0) (- (sqrt (/ F B))))
(/ (- (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 tmp;
if (C <= 5.2e+165) {
tmp = sqrt(2.0) * -sqrt((F / B));
} 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) :: tmp
t_0 = (b * b) - (4.0d0 * (a * c))
if (c <= 5.2d+165) then
tmp = sqrt(2.0d0) * -sqrt((f / b))
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 tmp;
if (C <= 5.2e+165) {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
} 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)) tmp = 0 if C <= 5.2e+165: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) 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))) tmp = 0.0 if (C <= 5.2e+165) tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); 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)); tmp = 0.0; if (C <= 5.2e+165) tmp = sqrt(2.0) * -sqrt((F / B)); 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]}, If[LessEqual[C, 5.2e+165], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $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)\\
\mathbf{if}\;C \leq 5.2 \cdot 10^{+165}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\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 < 5.2000000000000002e165Initial program 15.3%
Simplified19.3%
Taylor expanded in C around 0 9.4%
mul-1-neg9.4%
distribute-rgt-neg-in9.4%
unpow29.4%
unpow29.4%
hypot-def17.7%
Simplified17.7%
Taylor expanded in A around 0 14.3%
associate-*r*14.3%
mul-1-neg14.3%
Simplified14.3%
if 5.2000000000000002e165 < C Initial program 2.6%
associate-*l*2.6%
unpow22.6%
+-commutative2.6%
unpow22.6%
associate-*l*2.6%
unpow22.6%
Simplified2.6%
Taylor expanded in A around -inf 39.1%
mul-1-neg39.1%
sub-neg39.1%
Simplified39.1%
Final simplification17.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)))) (t_1 (* 2.0 (* F t_0))))
(if (<= A 4.2e-143)
(/ (- (sqrt (* t_1 (+ B C)))) t_0)
(/
(- (sqrt (* t_1 (+ (+ A C) (+ A (- (/ (* (* B B) 0.5) (- A C)) C))))))
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 = 2.0 * (F * t_0);
double tmp;
if (A <= 4.2e-143) {
tmp = -sqrt((t_1 * (B + C))) / t_0;
} else {
tmp = -sqrt((t_1 * ((A + C) + (A + ((((B * B) * 0.5) / (A - C)) - C))))) / 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 = 2.0d0 * (f * t_0)
if (a <= 4.2d-143) then
tmp = -sqrt((t_1 * (b + c))) / t_0
else
tmp = -sqrt((t_1 * ((a + c) + (a + ((((b * b) * 0.5d0) / (a - c)) - c))))) / 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 = 2.0 * (F * t_0);
double tmp;
if (A <= 4.2e-143) {
tmp = -Math.sqrt((t_1 * (B + C))) / t_0;
} else {
tmp = -Math.sqrt((t_1 * ((A + C) + (A + ((((B * B) * 0.5) / (A - C)) - C))))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) t_1 = 2.0 * (F * t_0) tmp = 0 if A <= 4.2e-143: tmp = -math.sqrt((t_1 * (B + C))) / t_0 else: tmp = -math.sqrt((t_1 * ((A + C) + (A + ((((B * B) * 0.5) / (A - C)) - C))))) / 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(2.0 * Float64(F * t_0)) tmp = 0.0 if (A <= 4.2e-143) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(B + C)))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(Float64(A + C) + Float64(A + Float64(Float64(Float64(Float64(B * B) * 0.5) / Float64(A - C)) - C)))))) / 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 = 2.0 * (F * t_0); tmp = 0.0; if (A <= 4.2e-143) tmp = -sqrt((t_1 * (B + C))) / t_0; else tmp = -sqrt((t_1 * ((A + C) + (A + ((((B * B) * 0.5) / (A - C)) - C))))) / 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[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, 4.2e-143], N[((-N[Sqrt[N[(t$95$1 * N[(B + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(t$95$1 * N[(N[(A + C), $MachinePrecision] + N[(A + N[(N[(N[(N[(B * B), $MachinePrecision] * 0.5), $MachinePrecision] / N[(A - C), $MachinePrecision]), $MachinePrecision] - C), $MachinePrecision]), $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 := 2 \cdot \left(F \cdot t_0\right)\\
\mathbf{if}\;A \leq 4.2 \cdot 10^{-143}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(B + C\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(\left(A + C\right) + \left(A + \left(\frac{\left(B \cdot B\right) \cdot 0.5}{A - C} - C\right)\right)\right)}}{t_0}\\
\end{array}
\end{array}
if A < 4.2000000000000002e-143Initial program 12.9%
associate-*l*12.9%
unpow212.9%
+-commutative12.9%
unpow212.9%
associate-*l*12.9%
unpow212.9%
Simplified12.9%
Taylor expanded in C around 0 12.2%
unpow212.2%
unpow212.2%
hypot-def12.3%
Simplified12.3%
Taylor expanded in A around 0 9.7%
if 4.2000000000000002e-143 < A Initial program 14.5%
associate-*l*14.5%
unpow214.5%
+-commutative14.5%
unpow214.5%
associate-*l*14.5%
unpow214.5%
Simplified14.5%
Taylor expanded in B around 0 20.5%
associate--l+20.5%
associate-*r/20.5%
*-commutative20.5%
unpow220.5%
Simplified20.5%
Final simplification13.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)))) (t_1 (* 2.0 (* F t_0))))
(if (<= A 4.2e-143)
(/ (- (sqrt (* t_1 (+ B C)))) t_0)
(/ (- (sqrt (* t_1 (+ (+ A C) (- A C))))) 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 = 2.0 * (F * t_0);
double tmp;
if (A <= 4.2e-143) {
tmp = -sqrt((t_1 * (B + C))) / t_0;
} else {
tmp = -sqrt((t_1 * ((A + C) + (A - C)))) / 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 = 2.0d0 * (f * t_0)
if (a <= 4.2d-143) then
tmp = -sqrt((t_1 * (b + c))) / t_0
else
tmp = -sqrt((t_1 * ((a + c) + (a - c)))) / 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 = 2.0 * (F * t_0);
double tmp;
if (A <= 4.2e-143) {
tmp = -Math.sqrt((t_1 * (B + C))) / t_0;
} else {
tmp = -Math.sqrt((t_1 * ((A + C) + (A - C)))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) t_1 = 2.0 * (F * t_0) tmp = 0 if A <= 4.2e-143: tmp = -math.sqrt((t_1 * (B + C))) / t_0 else: tmp = -math.sqrt((t_1 * ((A + C) + (A - C)))) / 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(2.0 * Float64(F * t_0)) tmp = 0.0 if (A <= 4.2e-143) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(B + C)))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(Float64(A + C) + Float64(A - C))))) / 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 = 2.0 * (F * t_0); tmp = 0.0; if (A <= 4.2e-143) tmp = -sqrt((t_1 * (B + C))) / t_0; else tmp = -sqrt((t_1 * ((A + C) + (A - C)))) / 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[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, 4.2e-143], N[((-N[Sqrt[N[(t$95$1 * N[(B + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(t$95$1 * N[(N[(A + C), $MachinePrecision] + N[(A - C), $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 := 2 \cdot \left(F \cdot t_0\right)\\
\mathbf{if}\;A \leq 4.2 \cdot 10^{-143}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(B + C\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(\left(A + C\right) + \left(A - C\right)\right)}}{t_0}\\
\end{array}
\end{array}
if A < 4.2000000000000002e-143Initial program 12.9%
associate-*l*12.9%
unpow212.9%
+-commutative12.9%
unpow212.9%
associate-*l*12.9%
unpow212.9%
Simplified12.9%
Taylor expanded in C around 0 12.2%
unpow212.2%
unpow212.2%
hypot-def12.3%
Simplified12.3%
Taylor expanded in A around 0 9.7%
if 4.2000000000000002e-143 < A Initial program 14.5%
associate-*l*14.5%
unpow214.5%
+-commutative14.5%
unpow214.5%
associate-*l*14.5%
unpow214.5%
Simplified14.5%
Taylor expanded in B around 0 20.3%
Final simplification13.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)))) (t_1 (* 2.0 (* F t_0))))
(if (<= A 1e-106)
(/ (- (sqrt (* t_1 (+ B C)))) t_0)
(/ (- (sqrt (* t_1 (+ A (+ A C))))) 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 = 2.0 * (F * t_0);
double tmp;
if (A <= 1e-106) {
tmp = -sqrt((t_1 * (B + C))) / t_0;
} else {
tmp = -sqrt((t_1 * (A + (A + C)))) / 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 = 2.0d0 * (f * t_0)
if (a <= 1d-106) then
tmp = -sqrt((t_1 * (b + c))) / t_0
else
tmp = -sqrt((t_1 * (a + (a + c)))) / 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 = 2.0 * (F * t_0);
double tmp;
if (A <= 1e-106) {
tmp = -Math.sqrt((t_1 * (B + C))) / t_0;
} else {
tmp = -Math.sqrt((t_1 * (A + (A + C)))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) t_1 = 2.0 * (F * t_0) tmp = 0 if A <= 1e-106: tmp = -math.sqrt((t_1 * (B + C))) / t_0 else: tmp = -math.sqrt((t_1 * (A + (A + C)))) / 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(2.0 * Float64(F * t_0)) tmp = 0.0 if (A <= 1e-106) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(B + C)))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(A + Float64(A + C))))) / 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 = 2.0 * (F * t_0); tmp = 0.0; if (A <= 1e-106) tmp = -sqrt((t_1 * (B + C))) / t_0; else tmp = -sqrt((t_1 * (A + (A + C)))) / 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[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, 1e-106], N[((-N[Sqrt[N[(t$95$1 * N[(B + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(t$95$1 * N[(A + N[(A + C), $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 := 2 \cdot \left(F \cdot t_0\right)\\
\mathbf{if}\;A \leq 10^{-106}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(B + C\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(A + \left(A + C\right)\right)}}{t_0}\\
\end{array}
\end{array}
if A < 9.99999999999999941e-107Initial program 12.5%
associate-*l*12.5%
unpow212.5%
+-commutative12.5%
unpow212.5%
associate-*l*12.5%
unpow212.5%
Simplified12.5%
Taylor expanded in C around 0 11.8%
unpow211.8%
unpow211.8%
hypot-def11.9%
Simplified11.9%
Taylor expanded in A around 0 9.3%
if 9.99999999999999941e-107 < A Initial program 15.5%
associate-*l*15.5%
unpow215.5%
+-commutative15.5%
unpow215.5%
associate-*l*15.5%
unpow215.5%
Simplified15.5%
Taylor expanded in A around inf 21.6%
Final simplification13.0%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* A C)))))
(if (<= A 2.05e-143)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ B C)))) t_0)
(* (/ 2.0 B) (- (sqrt (* A F)))))))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.05e-143) {
tmp = -sqrt(((2.0 * (F * t_0)) * (B + C))) / t_0;
} else {
tmp = (2.0 / B) * -sqrt((A * F));
}
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.05d-143) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * (b + c))) / t_0
else
tmp = (2.0d0 / b) * -sqrt((a * f))
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.05e-143) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (B + C))) / t_0;
} else {
tmp = (2.0 / B) * -Math.sqrt((A * F));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if A <= 2.05e-143: tmp = -math.sqrt(((2.0 * (F * t_0)) * (B + C))) / t_0 else: tmp = (2.0 / B) * -math.sqrt((A * F)) 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.05e-143) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(B + C)))) / t_0); else tmp = Float64(Float64(2.0 / B) * Float64(-sqrt(Float64(A * F)))); 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.05e-143) tmp = -sqrt(((2.0 * (F * t_0)) * (B + C))) / t_0; else tmp = (2.0 / B) * -sqrt((A * F)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, 2.05e-143], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(B + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(2.0 / B), $MachinePrecision] * (-N[Sqrt[N[(A * F), $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}\;A \leq 2.05 \cdot 10^{-143}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(B + C\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{B} \cdot \left(-\sqrt{A \cdot F}\right)\\
\end{array}
\end{array}
if A < 2.05e-143Initial program 12.9%
associate-*l*12.9%
unpow212.9%
+-commutative12.9%
unpow212.9%
associate-*l*12.9%
unpow212.9%
Simplified12.9%
Taylor expanded in C around 0 12.2%
unpow212.2%
unpow212.2%
hypot-def12.3%
Simplified12.3%
Taylor expanded in A around 0 9.7%
if 2.05e-143 < A Initial program 14.5%
Simplified26.1%
Taylor expanded in C around 0 4.2%
mul-1-neg4.2%
distribute-rgt-neg-in4.2%
unpow24.2%
unpow24.2%
hypot-def16.1%
Simplified16.1%
Taylor expanded in B around 0 5.1%
associate-*r*5.1%
mul-1-neg5.1%
unpow25.1%
rem-square-sqrt5.1%
*-commutative5.1%
Simplified5.1%
Final simplification8.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 (<= A 4.2e-244)
(/ (- (sqrt (* C (* 2.0 (* F t_0))))) t_0)
(* (/ 2.0 B) (- (sqrt (* A F)))))))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 <= 4.2e-244) {
tmp = -sqrt((C * (2.0 * (F * t_0)))) / t_0;
} else {
tmp = (2.0 / B) * -sqrt((A * F));
}
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 <= 4.2d-244) then
tmp = -sqrt((c * (2.0d0 * (f * t_0)))) / t_0
else
tmp = (2.0d0 / b) * -sqrt((a * f))
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 <= 4.2e-244) {
tmp = -Math.sqrt((C * (2.0 * (F * t_0)))) / t_0;
} else {
tmp = (2.0 / B) * -Math.sqrt((A * F));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if A <= 4.2e-244: tmp = -math.sqrt((C * (2.0 * (F * t_0)))) / t_0 else: tmp = (2.0 / B) * -math.sqrt((A * F)) 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 <= 4.2e-244) tmp = Float64(Float64(-sqrt(Float64(C * Float64(2.0 * Float64(F * t_0))))) / t_0); else tmp = Float64(Float64(2.0 / B) * Float64(-sqrt(Float64(A * F)))); 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 <= 4.2e-244) tmp = -sqrt((C * (2.0 * (F * t_0)))) / t_0; else tmp = (2.0 / B) * -sqrt((A * F)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, 4.2e-244], N[((-N[Sqrt[N[(C * N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(2.0 / B), $MachinePrecision] * (-N[Sqrt[N[(A * F), $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}\;A \leq 4.2 \cdot 10^{-244}:\\
\;\;\;\;\frac{-\sqrt{C \cdot \left(2 \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{B} \cdot \left(-\sqrt{A \cdot F}\right)\\
\end{array}
\end{array}
if A < 4.20000000000000003e-244Initial program 12.2%
associate-*l*12.2%
unpow212.2%
+-commutative12.2%
unpow212.2%
associate-*l*12.2%
unpow212.2%
Simplified12.2%
Taylor expanded in A around -inf 3.7%
mul-1-neg3.7%
Simplified3.7%
Taylor expanded in A around 0 5.3%
if 4.20000000000000003e-244 < A Initial program 15.2%
Simplified25.3%
Taylor expanded in C around 0 5.6%
mul-1-neg5.6%
distribute-rgt-neg-in5.6%
unpow25.6%
unpow25.6%
hypot-def16.0%
Simplified16.0%
Taylor expanded in B around 0 4.8%
associate-*r*4.8%
mul-1-neg4.8%
unpow24.8%
rem-square-sqrt4.9%
*-commutative4.9%
Simplified4.9%
Final simplification5.1%
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 13.4%
Simplified22.2%
Taylor expanded in C around 0 8.3%
mul-1-neg8.3%
distribute-rgt-neg-in8.3%
unpow28.3%
unpow28.3%
hypot-def15.8%
Simplified15.8%
Taylor expanded in B around 0 2.5%
associate-*r*2.5%
mul-1-neg2.5%
unpow22.5%
rem-square-sqrt2.5%
*-commutative2.5%
Simplified2.5%
Final simplification2.5%
herbie shell --seed 2023257
(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))))