
(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 19 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 (sqrt (+ C (+ A (hypot B (- A C))))))
(t_1 (- (pow B 2.0) (* (* 4.0 A) C)))
(t_2
(/
(-
(sqrt
(*
(* 2.0 (* t_1 F))
(+ (+ A C) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))))))
t_1))
(t_3 (- (* B B) (* 4.0 (* A C)))))
(if (<= t_2 0.0)
(/
(* (* (sqrt 2.0) (* (sqrt F) (sqrt (fma B B (* -4.0 (* A C)))))) (- t_0))
t_3)
(if (<= t_2 INFINITY)
(/ (* t_0 (- (sqrt (* 2.0 (* F t_3))))) (* C (* A -4.0)))
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ A (hypot B A))))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = sqrt((C + (A + hypot(B, (A - C)))));
double t_1 = pow(B, 2.0) - ((4.0 * A) * C);
double t_2 = -sqrt(((2.0 * (t_1 * F)) * ((A + C) + sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_1;
double t_3 = (B * B) - (4.0 * (A * C));
double tmp;
if (t_2 <= 0.0) {
tmp = ((sqrt(2.0) * (sqrt(F) * sqrt(fma(B, B, (-4.0 * (A * C)))))) * -t_0) / t_3;
} else if (t_2 <= ((double) INFINITY)) {
tmp = (t_0 * -sqrt((2.0 * (F * t_3)))) / (C * (A * -4.0));
} else {
tmp = (sqrt(2.0) / B) * -sqrt((F * (A + hypot(B, A))));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) t_1 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) t_2 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_1 * F)) * Float64(Float64(A + C) + sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_1) t_3 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) tmp = 0.0 if (t_2 <= 0.0) tmp = Float64(Float64(Float64(sqrt(2.0) * Float64(sqrt(F) * sqrt(fma(B, B, Float64(-4.0 * Float64(A * C)))))) * Float64(-t_0)) / t_3); elseif (t_2 <= Inf) tmp = Float64(Float64(t_0 * Float64(-sqrt(Float64(2.0 * Float64(F * t_3))))) / Float64(C * Float64(A * -4.0))); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A + hypot(B, A)))))); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$1 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(B * B + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-t$95$0)), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(t$95$0 * (-N[Sqrt[N[(2.0 * N[(F * t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\\
t_1 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
t_2 := \frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_1}\\
t_3 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;t_2 \leq 0:\\
\;\;\;\;\frac{\left(\sqrt{2} \cdot \left(\sqrt{F} \cdot \sqrt{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}\right)\right) \cdot \left(-t_0\right)}{t_3}\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\frac{t_0 \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_3\right)}\right)}{C \cdot \left(A \cdot -4\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)\\
\end{array}
\end{array}
if (/.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 30.3%
associate-*l*30.3%
unpow230.3%
+-commutative30.3%
unpow230.3%
associate-*l*30.3%
unpow230.3%
Simplified30.3%
sqrt-prod36.2%
*-commutative36.2%
*-commutative36.2%
associate-+l+36.8%
unpow236.8%
hypot-udef44.7%
associate-+r+43.5%
+-commutative43.5%
associate-+r+44.5%
Applied egg-rr44.5%
sqrt-prod44.4%
cancel-sign-sub-inv44.4%
*-commutative44.4%
metadata-eval44.4%
*-commutative44.4%
Applied egg-rr44.4%
sqrt-prod53.4%
fma-def53.4%
Applied egg-rr53.4%
if -0.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < +inf.0Initial program 46.6%
associate-*l*46.6%
unpow246.6%
+-commutative46.6%
unpow246.6%
associate-*l*46.6%
unpow246.6%
Simplified46.6%
sqrt-prod45.2%
*-commutative45.2%
*-commutative45.2%
associate-+l+45.2%
unpow245.2%
hypot-udef84.4%
associate-+r+84.4%
+-commutative84.4%
associate-+r+84.4%
Applied egg-rr84.4%
Taylor expanded in B around 0 84.4%
associate-*r*84.4%
Simplified84.4%
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%
Simplified1.1%
Taylor expanded in C around 0 2.7%
mul-1-neg2.7%
distribute-rgt-neg-in2.7%
unpow22.7%
unpow22.7%
hypot-def13.3%
Simplified13.3%
Final simplification41.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))))
(t_1 (sqrt (+ C (+ A (hypot B (- A C)))))))
(if (<= B 8.9e+55)
(/ (* t_1 (- (sqrt (* 2.0 (* F t_0))))) t_0)
(if (<= B 1.35e+154)
(/ (- t_1) (/ (fma B B (* -4.0 (* A C))) (* (sqrt 2.0) (* B (sqrt F)))))
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ C (hypot B C))))))))))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 = sqrt((C + (A + hypot(B, (A - C)))));
double tmp;
if (B <= 8.9e+55) {
tmp = (t_1 * -sqrt((2.0 * (F * t_0)))) / t_0;
} else if (B <= 1.35e+154) {
tmp = -t_1 / (fma(B, B, (-4.0 * (A * C))) / (sqrt(2.0) * (B * sqrt(F))));
} else {
tmp = (sqrt(2.0) / B) * -sqrt((F * (C + hypot(B, C))));
}
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 = sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) tmp = 0.0 if (B <= 8.9e+55) tmp = Float64(Float64(t_1 * Float64(-sqrt(Float64(2.0 * Float64(F * t_0))))) / t_0); elseif (B <= 1.35e+154) tmp = Float64(Float64(-t_1) / Float64(fma(B, B, Float64(-4.0 * Float64(A * C))) / Float64(sqrt(2.0) * Float64(B * sqrt(F))))); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(C + hypot(B, C)))))); 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[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 8.9e+55], N[(N[(t$95$1 * (-N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B, 1.35e+154], N[((-t$95$1) / N[(N[(B * B + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[(B * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_1 := \sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\\
\mathbf{if}\;B \leq 8.9 \cdot 10^{+55}:\\
\;\;\;\;\frac{t_1 \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_0\right)}\right)}{t_0}\\
\mathbf{elif}\;B \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{-t_1}{\frac{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{\sqrt{2} \cdot \left(B \cdot \sqrt{F}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}\right)\\
\end{array}
\end{array}
if B < 8.9000000000000002e55Initial program 21.3%
associate-*l*21.3%
unpow221.3%
+-commutative21.3%
unpow221.3%
associate-*l*21.3%
unpow221.3%
Simplified21.3%
sqrt-prod22.3%
*-commutative22.3%
*-commutative22.3%
associate-+l+22.7%
unpow222.7%
hypot-udef32.7%
associate-+r+31.9%
+-commutative31.9%
associate-+r+32.6%
Applied egg-rr32.6%
if 8.9000000000000002e55 < B < 1.35000000000000003e154Initial program 31.7%
associate-*l*31.7%
unpow231.7%
+-commutative31.7%
unpow231.7%
associate-*l*31.7%
unpow231.7%
Simplified31.7%
sqrt-prod52.6%
*-commutative52.6%
*-commutative52.6%
associate-+l+52.6%
unpow252.6%
hypot-udef57.5%
associate-+r+57.4%
+-commutative57.4%
associate-+r+57.2%
Applied egg-rr57.2%
Taylor expanded in B around inf 57.7%
associate-*l*57.6%
Simplified57.6%
distribute-frac-neg57.6%
*-commutative57.6%
cancel-sign-sub-inv57.6%
metadata-eval57.6%
*-commutative57.6%
fma-def57.6%
Applied egg-rr57.6%
associate-/l*66.2%
Simplified66.2%
if 1.35000000000000003e154 < B Initial program 0.0%
Simplified0.0%
Taylor expanded in A around 0 2.5%
mul-1-neg2.5%
distribute-rgt-neg-in2.5%
*-commutative2.5%
unpow22.5%
unpow22.5%
hypot-def44.6%
Simplified44.6%
Final simplification36.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))))
(t_1 (sqrt (+ C (+ A (hypot B (- A C)))))))
(if (<= B 8.5e+55)
(/ (* t_1 (- (sqrt (* 2.0 (* F t_0))))) t_0)
(if (<= B 1.35e+154)
(/ (* (sqrt 2.0) (* B (sqrt F))) (/ (fma B B (* -4.0 (* A C))) (- t_1)))
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ C (hypot B C))))))))))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 = sqrt((C + (A + hypot(B, (A - C)))));
double tmp;
if (B <= 8.5e+55) {
tmp = (t_1 * -sqrt((2.0 * (F * t_0)))) / t_0;
} else if (B <= 1.35e+154) {
tmp = (sqrt(2.0) * (B * sqrt(F))) / (fma(B, B, (-4.0 * (A * C))) / -t_1);
} else {
tmp = (sqrt(2.0) / B) * -sqrt((F * (C + hypot(B, C))));
}
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 = sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) tmp = 0.0 if (B <= 8.5e+55) tmp = Float64(Float64(t_1 * Float64(-sqrt(Float64(2.0 * Float64(F * t_0))))) / t_0); elseif (B <= 1.35e+154) tmp = Float64(Float64(sqrt(2.0) * Float64(B * sqrt(F))) / Float64(fma(B, B, Float64(-4.0 * Float64(A * C))) / Float64(-t_1))); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(C + hypot(B, C)))))); 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[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 8.5e+55], N[(N[(t$95$1 * (-N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B, 1.35e+154], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(B * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(B * B + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-t$95$1)), $MachinePrecision]), $MachinePrecision], 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]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_1 := \sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\\
\mathbf{if}\;B \leq 8.5 \cdot 10^{+55}:\\
\;\;\;\;\frac{t_1 \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_0\right)}\right)}{t_0}\\
\mathbf{elif}\;B \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(B \cdot \sqrt{F}\right)}{\frac{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{-t_1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}\right)\\
\end{array}
\end{array}
if B < 8.50000000000000002e55Initial program 21.3%
associate-*l*21.3%
unpow221.3%
+-commutative21.3%
unpow221.3%
associate-*l*21.3%
unpow221.3%
Simplified21.3%
sqrt-prod22.3%
*-commutative22.3%
*-commutative22.3%
associate-+l+22.7%
unpow222.7%
hypot-udef32.7%
associate-+r+31.9%
+-commutative31.9%
associate-+r+32.6%
Applied egg-rr32.6%
if 8.50000000000000002e55 < B < 1.35000000000000003e154Initial program 31.7%
associate-*l*31.7%
unpow231.7%
+-commutative31.7%
unpow231.7%
associate-*l*31.7%
unpow231.7%
Simplified31.7%
sqrt-prod52.6%
*-commutative52.6%
*-commutative52.6%
associate-+l+52.6%
unpow252.6%
hypot-udef57.5%
associate-+r+57.4%
+-commutative57.4%
associate-+r+57.2%
Applied egg-rr57.2%
Taylor expanded in B around inf 57.7%
associate-*l*57.6%
Simplified57.6%
*-un-lft-identity57.6%
distribute-rgt-neg-in57.6%
cancel-sign-sub-inv57.6%
metadata-eval57.6%
*-commutative57.6%
fma-def57.6%
Applied egg-rr57.6%
*-lft-identity57.6%
associate-/l*66.2%
Simplified66.2%
if 1.35000000000000003e154 < B Initial program 0.0%
Simplified0.0%
Taylor expanded in A around 0 2.5%
mul-1-neg2.5%
distribute-rgt-neg-in2.5%
*-commutative2.5%
unpow22.5%
unpow22.5%
hypot-def44.6%
Simplified44.6%
Final simplification36.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 (<= B 5.6e+110)
(/
(* (sqrt (+ C (+ A (hypot B (- A C))))) (- (sqrt (* 2.0 (* F t_0)))))
t_0)
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ A (hypot B A)))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (B <= 5.6e+110) {
tmp = (sqrt((C + (A + hypot(B, (A - C))))) * -sqrt((2.0 * (F * t_0)))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * -sqrt((F * (A + hypot(B, A))));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (B <= 5.6e+110) {
tmp = (Math.sqrt((C + (A + Math.hypot(B, (A - C))))) * -Math.sqrt((2.0 * (F * t_0)))) / t_0;
} else {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (A + Math.hypot(B, A))));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if B <= 5.6e+110: tmp = (math.sqrt((C + (A + math.hypot(B, (A - C))))) * -math.sqrt((2.0 * (F * t_0)))) / t_0 else: tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (A + math.hypot(B, A)))) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) tmp = 0.0 if (B <= 5.6e+110) tmp = Float64(Float64(sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) * Float64(-sqrt(Float64(2.0 * Float64(F * t_0))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A + hypot(B, A)))))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (A * C)); tmp = 0.0; if (B <= 5.6e+110) tmp = (sqrt((C + (A + hypot(B, (A - C))))) * -sqrt((2.0 * (F * t_0)))) / t_0; else tmp = (sqrt(2.0) / B) * -sqrt((F * (A + hypot(B, A)))); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 5.6e+110], N[(N[(N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 5.6 \cdot 10^{+110}:\\
\;\;\;\;\frac{\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_0\right)}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)\\
\end{array}
\end{array}
if B < 5.59999999999999973e110Initial program 21.5%
associate-*l*21.5%
unpow221.5%
+-commutative21.5%
unpow221.5%
associate-*l*21.5%
unpow221.5%
Simplified21.5%
sqrt-prod22.9%
*-commutative22.9%
*-commutative22.9%
associate-+l+23.3%
unpow223.3%
hypot-udef32.9%
associate-+r+32.2%
+-commutative32.2%
associate-+r+32.8%
Applied egg-rr32.8%
if 5.59999999999999973e110 < B Initial program 14.5%
Simplified14.5%
Taylor expanded in C around 0 26.7%
mul-1-neg26.7%
distribute-rgt-neg-in26.7%
unpow226.7%
unpow226.7%
hypot-def54.3%
Simplified54.3%
Final simplification35.8%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* A C))))
(t_1 (* F t_0))
(t_2 (+ C (+ A (hypot B (- A C))))))
(if (<= B 1.15e-176)
(/ (* (sqrt t_2) (- (sqrt (* 2.0 t_1)))) (* C (* A -4.0)))
(if (<= B 4.9e+56)
(/ (- (sqrt (* 2.0 (* t_2 t_1)))) t_0)
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ A (hypot B A))))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double t_1 = F * t_0;
double t_2 = C + (A + hypot(B, (A - C)));
double tmp;
if (B <= 1.15e-176) {
tmp = (sqrt(t_2) * -sqrt((2.0 * t_1))) / (C * (A * -4.0));
} else if (B <= 4.9e+56) {
tmp = -sqrt((2.0 * (t_2 * t_1))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * -sqrt((F * (A + hypot(B, A))));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double t_1 = F * t_0;
double t_2 = C + (A + Math.hypot(B, (A - C)));
double tmp;
if (B <= 1.15e-176) {
tmp = (Math.sqrt(t_2) * -Math.sqrt((2.0 * t_1))) / (C * (A * -4.0));
} else if (B <= 4.9e+56) {
tmp = -Math.sqrt((2.0 * (t_2 * t_1))) / t_0;
} else {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (A + Math.hypot(B, A))));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) t_1 = F * t_0 t_2 = C + (A + math.hypot(B, (A - C))) tmp = 0 if B <= 1.15e-176: tmp = (math.sqrt(t_2) * -math.sqrt((2.0 * t_1))) / (C * (A * -4.0)) elif B <= 4.9e+56: tmp = -math.sqrt((2.0 * (t_2 * t_1))) / t_0 else: tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (A + math.hypot(B, A)))) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) t_1 = Float64(F * t_0) t_2 = Float64(C + Float64(A + hypot(B, Float64(A - C)))) tmp = 0.0 if (B <= 1.15e-176) tmp = Float64(Float64(sqrt(t_2) * Float64(-sqrt(Float64(2.0 * t_1)))) / Float64(C * Float64(A * -4.0))); elseif (B <= 4.9e+56) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_2 * t_1)))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A + hypot(B, A)))))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (A * C)); t_1 = F * t_0; t_2 = C + (A + hypot(B, (A - C))); tmp = 0.0; if (B <= 1.15e-176) tmp = (sqrt(t_2) * -sqrt((2.0 * t_1))) / (C * (A * -4.0)); elseif (B <= 4.9e+56) tmp = -sqrt((2.0 * (t_2 * t_1))) / t_0; else tmp = (sqrt(2.0) / B) * -sqrt((F * (A + hypot(B, A)))); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 1.15e-176], N[(N[(N[Sqrt[t$95$2], $MachinePrecision] * (-N[Sqrt[N[(2.0 * t$95$1), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.9e+56], N[((-N[Sqrt[N[(2.0 * N[(t$95$2 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_1 := F \cdot t_0\\
t_2 := C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\\
\mathbf{if}\;B \leq 1.15 \cdot 10^{-176}:\\
\;\;\;\;\frac{\sqrt{t_2} \cdot \left(-\sqrt{2 \cdot t_1}\right)}{C \cdot \left(A \cdot -4\right)}\\
\mathbf{elif}\;B \leq 4.9 \cdot 10^{+56}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_2 \cdot t_1\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)\\
\end{array}
\end{array}
if B < 1.1500000000000001e-176Initial program 20.5%
associate-*l*20.5%
unpow220.5%
+-commutative20.5%
unpow220.5%
associate-*l*20.5%
unpow220.5%
Simplified20.5%
sqrt-prod22.1%
*-commutative22.1%
*-commutative22.1%
associate-+l+22.5%
unpow222.5%
hypot-udef31.0%
associate-+r+30.3%
+-commutative30.3%
associate-+r+31.0%
Applied egg-rr31.0%
Taylor expanded in B around 0 21.8%
associate-*r*21.8%
Simplified21.8%
if 1.1500000000000001e-176 < B < 4.9000000000000003e56Initial program 24.3%
associate-*l*24.3%
unpow224.3%
+-commutative24.3%
unpow224.3%
associate-*l*24.3%
unpow224.3%
Simplified24.3%
distribute-frac-neg24.3%
Applied egg-rr32.1%
if 4.9000000000000003e56 < B Initial program 16.6%
Simplified16.8%
Taylor expanded in C around 0 29.0%
mul-1-neg29.0%
distribute-rgt-neg-in29.0%
unpow229.0%
unpow229.0%
hypot-def51.7%
Simplified51.7%
Final simplification28.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 (<= B 5.2e+54)
(/ (- (sqrt (* 2.0 (* (+ C (+ A (hypot B (- A C)))) (* F t_0))))) t_0)
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ C (hypot B C)))))))))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 <= 5.2e+54) {
tmp = -sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * t_0)))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * -sqrt((F * (C + hypot(B, C))));
}
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 <= 5.2e+54) {
tmp = -Math.sqrt((2.0 * ((C + (A + Math.hypot(B, (A - C)))) * (F * t_0)))) / t_0;
} else {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (C + Math.hypot(B, C))));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if B <= 5.2e+54: tmp = -math.sqrt((2.0 * ((C + (A + math.hypot(B, (A - C)))) * (F * t_0)))) / t_0 else: tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (C + math.hypot(B, C)))) 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 <= 5.2e+54) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(C + Float64(A + hypot(B, Float64(A - C)))) * Float64(F * t_0))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(C + hypot(B, C)))))); 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 <= 5.2e+54) tmp = -sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * t_0)))) / t_0; else tmp = (sqrt(2.0) / B) * -sqrt((F * (C + hypot(B, C)))); 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, 5.2e+54], N[((-N[Sqrt[N[(2.0 * N[(N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], 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]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 5.2 \cdot 10^{+54}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}\right)\\
\end{array}
\end{array}
if B < 5.20000000000000013e54Initial program 21.3%
associate-*l*21.3%
unpow221.3%
+-commutative21.3%
unpow221.3%
associate-*l*21.3%
unpow221.3%
Simplified21.3%
distribute-frac-neg21.3%
Applied egg-rr26.9%
if 5.20000000000000013e54 < B Initial program 16.6%
Simplified16.8%
Taylor expanded in A around 0 29.3%
mul-1-neg29.3%
distribute-rgt-neg-in29.3%
*-commutative29.3%
unpow229.3%
unpow229.3%
hypot-def49.8%
Simplified49.8%
Final simplification30.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 (<= B 1.02e+56)
(/ (- (sqrt (* 2.0 (* (+ C (+ A (hypot B (- A C)))) (* F t_0))))) t_0)
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ A (hypot B A)))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (B <= 1.02e+56) {
tmp = -sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * t_0)))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * -sqrt((F * (A + hypot(B, A))));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (B <= 1.02e+56) {
tmp = -Math.sqrt((2.0 * ((C + (A + Math.hypot(B, (A - C)))) * (F * t_0)))) / t_0;
} else {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (A + Math.hypot(B, A))));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if B <= 1.02e+56: tmp = -math.sqrt((2.0 * ((C + (A + math.hypot(B, (A - C)))) * (F * t_0)))) / t_0 else: tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (A + math.hypot(B, A)))) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) tmp = 0.0 if (B <= 1.02e+56) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(C + Float64(A + hypot(B, Float64(A - C)))) * Float64(F * t_0))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A + hypot(B, A)))))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (A * C)); tmp = 0.0; if (B <= 1.02e+56) tmp = -sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * t_0)))) / t_0; else tmp = (sqrt(2.0) / B) * -sqrt((F * (A + hypot(B, A)))); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 1.02e+56], N[((-N[Sqrt[N[(2.0 * N[(N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 1.02 \cdot 10^{+56}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)\\
\end{array}
\end{array}
if B < 1.02e56Initial program 21.3%
associate-*l*21.3%
unpow221.3%
+-commutative21.3%
unpow221.3%
associate-*l*21.3%
unpow221.3%
Simplified21.3%
distribute-frac-neg21.3%
Applied egg-rr26.9%
if 1.02e56 < B Initial program 16.6%
Simplified16.8%
Taylor expanded in C around 0 29.0%
mul-1-neg29.0%
distribute-rgt-neg-in29.0%
unpow229.0%
unpow229.0%
hypot-def51.7%
Simplified51.7%
Final simplification31.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 (<= B 4.45e+55)
(/ (- (sqrt (* 2.0 (* (+ C (+ A (hypot B (- A C)))) (* F t_0))))) t_0)
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ B C))))))))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 <= 4.45e+55) {
tmp = -sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * t_0)))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * -sqrt((F * (B + C)));
}
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 <= 4.45e+55) {
tmp = -Math.sqrt((2.0 * ((C + (A + Math.hypot(B, (A - C)))) * (F * t_0)))) / t_0;
} else {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (B + C)));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if B <= 4.45e+55: tmp = -math.sqrt((2.0 * ((C + (A + math.hypot(B, (A - C)))) * (F * t_0)))) / t_0 else: tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (B + C))) 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 <= 4.45e+55) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(C + Float64(A + hypot(B, Float64(A - C)))) * Float64(F * t_0))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(B + C))))); 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 <= 4.45e+55) tmp = -sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * t_0)))) / t_0; else tmp = (sqrt(2.0) / B) * -sqrt((F * (B + C))); 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, 4.45e+55], N[((-N[Sqrt[N[(2.0 * N[(N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(B + C), $MachinePrecision]), $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 4.45 \cdot 10^{+55}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(B + C\right)}\right)\\
\end{array}
\end{array}
if B < 4.4500000000000001e55Initial program 21.3%
associate-*l*21.3%
unpow221.3%
+-commutative21.3%
unpow221.3%
associate-*l*21.3%
unpow221.3%
Simplified21.3%
distribute-frac-neg21.3%
Applied egg-rr26.9%
if 4.4500000000000001e55 < B Initial program 16.6%
associate-*l*16.6%
unpow216.6%
+-commutative16.6%
unpow216.6%
associate-*l*16.6%
unpow216.6%
Simplified16.6%
Taylor expanded in C around 0 16.5%
unpow216.5%
unpow216.5%
hypot-def16.6%
Simplified16.6%
Taylor expanded in A around 0 49.2%
mul-1-neg49.2%
Simplified49.2%
Final simplification30.7%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= B 1.08e-63)
(-
(/
(sqrt (* 2.0 (* (* 2.0 A) (* F (+ (* B B) (* C (* A -4.0)))))))
(fma C (* A -4.0) (* B B))))
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ B C)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (B <= 1.08e-63) {
tmp = -(sqrt((2.0 * ((2.0 * A) * (F * ((B * B) + (C * (A * -4.0))))))) / fma(C, (A * -4.0), (B * B)));
} else {
tmp = (sqrt(2.0) / B) * -sqrt((F * (B + C)));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (B <= 1.08e-63) tmp = Float64(-Float64(sqrt(Float64(2.0 * Float64(Float64(2.0 * A) * Float64(F * Float64(Float64(B * B) + Float64(C * Float64(A * -4.0))))))) / fma(C, Float64(A * -4.0), Float64(B * B)))); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(B + C))))); end return tmp end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[B, 1.08e-63], (-N[(N[Sqrt[N[(2.0 * N[(N[(2.0 * A), $MachinePrecision] * N[(F * N[(N[(B * B), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(B + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.08 \cdot 10^{-63}:\\
\;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(2 \cdot A\right) \cdot \left(F \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)\right)\right)}}{\mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(B + C\right)}\right)\\
\end{array}
\end{array}
if B < 1.07999999999999994e-63Initial program 20.5%
Simplified26.6%
Taylor expanded in C around -inf 19.9%
Taylor expanded in F around 0 19.9%
associate-*r*19.9%
unpow219.9%
associate-*r*19.9%
Simplified19.9%
if 1.07999999999999994e-63 < B Initial program 20.5%
associate-*l*20.5%
unpow220.5%
+-commutative20.5%
unpow220.5%
associate-*l*20.5%
unpow220.5%
Simplified20.5%
Taylor expanded in C around 0 18.9%
unpow218.9%
unpow218.9%
hypot-def19.1%
Simplified19.1%
Taylor expanded in A around 0 40.4%
mul-1-neg40.4%
Simplified40.4%
Final simplification25.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= B 2.1e-64)
(/
(- (sqrt (* 2.0 (* (* -8.0 (* A A)) (* C F)))))
(fma C (* A -4.0) (* B B)))
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ B C)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (B <= 2.1e-64) {
tmp = -sqrt((2.0 * ((-8.0 * (A * A)) * (C * F)))) / fma(C, (A * -4.0), (B * B));
} else {
tmp = (sqrt(2.0) / B) * -sqrt((F * (B + C)));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (B <= 2.1e-64) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(-8.0 * Float64(A * A)) * Float64(C * F))))) / fma(C, Float64(A * -4.0), Float64(B * B))); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(B + C))))); end return tmp end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[B, 2.1e-64], N[((-N[Sqrt[N[(2.0 * N[(N[(-8.0 * N[(A * A), $MachinePrecision]), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(B + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.1 \cdot 10^{-64}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(-8 \cdot \left(A \cdot A\right)\right) \cdot \left(C \cdot F\right)\right)}}{\mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(B + C\right)}\right)\\
\end{array}
\end{array}
if B < 2.10000000000000011e-64Initial program 20.5%
Simplified26.6%
Taylor expanded in C around -inf 19.9%
Taylor expanded in C around inf 15.0%
associate-*r*15.0%
unpow215.0%
Simplified15.0%
if 2.10000000000000011e-64 < B Initial program 20.5%
associate-*l*20.5%
unpow220.5%
+-commutative20.5%
unpow220.5%
associate-*l*20.5%
unpow220.5%
Simplified20.5%
Taylor expanded in C around 0 18.9%
unpow218.9%
unpow218.9%
hypot-def19.1%
Simplified19.1%
Taylor expanded in A around 0 40.4%
mul-1-neg40.4%
Simplified40.4%
Final simplification21.6%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= B 2.25e-64) (/ (- (sqrt (* -16.0 (* (* A A) (* C F))))) (- (* B B) (* 4.0 (* A C)))) (* (/ (sqrt 2.0) B) (- (sqrt (* F (+ B C)))))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (B <= 2.25e-64) {
tmp = -sqrt((-16.0 * ((A * A) * (C * F)))) / ((B * B) - (4.0 * (A * C)));
} else {
tmp = (sqrt(2.0) / B) * -sqrt((F * (B + C)));
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (b <= 2.25d-64) then
tmp = -sqrt(((-16.0d0) * ((a * a) * (c * f)))) / ((b * b) - (4.0d0 * (a * c)))
else
tmp = (sqrt(2.0d0) / b) * -sqrt((f * (b + c)))
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (B <= 2.25e-64) {
tmp = -Math.sqrt((-16.0 * ((A * A) * (C * F)))) / ((B * B) - (4.0 * (A * C)));
} else {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (B + C)));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if B <= 2.25e-64: tmp = -math.sqrt((-16.0 * ((A * A) * (C * F)))) / ((B * B) - (4.0 * (A * C))) else: tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (B + C))) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (B <= 2.25e-64) tmp = Float64(Float64(-sqrt(Float64(-16.0 * Float64(Float64(A * A) * Float64(C * F))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(B + C))))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (B <= 2.25e-64) tmp = -sqrt((-16.0 * ((A * A) * (C * F)))) / ((B * B) - (4.0 * (A * C))); else tmp = (sqrt(2.0) / B) * -sqrt((F * (B + C))); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[B, 2.25e-64], N[((-N[Sqrt[N[(-16.0 * N[(N[(A * A), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(B + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.25 \cdot 10^{-64}:\\
\;\;\;\;\frac{-\sqrt{-16 \cdot \left(\left(A \cdot A\right) \cdot \left(C \cdot F\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(B + C\right)}\right)\\
\end{array}
\end{array}
if B < 2.25000000000000005e-64Initial program 20.5%
associate-*l*20.5%
unpow220.5%
+-commutative20.5%
unpow220.5%
associate-*l*20.5%
unpow220.5%
Simplified20.5%
Taylor expanded in A around inf 12.5%
Taylor expanded in A around inf 15.0%
unpow215.0%
Simplified15.0%
if 2.25000000000000005e-64 < B Initial program 20.5%
associate-*l*20.5%
unpow220.5%
+-commutative20.5%
unpow220.5%
associate-*l*20.5%
unpow220.5%
Simplified20.5%
Taylor expanded in C around 0 18.9%
unpow218.9%
unpow218.9%
hypot-def19.1%
Simplified19.1%
Taylor expanded in A around 0 40.4%
mul-1-neg40.4%
Simplified40.4%
Final simplification21.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)))) (t_1 (* 2.0 (* F t_0))))
(if (<= C -1.25e-36)
(/ (- (sqrt (* -16.0 (* (* A A) (* C F))))) t_0)
(if (<= C 6.5e-84)
(/ (- (sqrt (* t_1 (+ B (+ A C))))) t_0)
(/ (- (sqrt (* t_1 (+ 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 (C <= -1.25e-36) {
tmp = -sqrt((-16.0 * ((A * A) * (C * F)))) / t_0;
} else if (C <= 6.5e-84) {
tmp = -sqrt((t_1 * (B + (A + C)))) / t_0;
} else {
tmp = -sqrt((t_1 * (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 (c <= (-1.25d-36)) then
tmp = -sqrt(((-16.0d0) * ((a * a) * (c * f)))) / t_0
else if (c <= 6.5d-84) then
tmp = -sqrt((t_1 * (b + (a + c)))) / t_0
else
tmp = -sqrt((t_1 * (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 (C <= -1.25e-36) {
tmp = -Math.sqrt((-16.0 * ((A * A) * (C * F)))) / t_0;
} else if (C <= 6.5e-84) {
tmp = -Math.sqrt((t_1 * (B + (A + C)))) / t_0;
} else {
tmp = -Math.sqrt((t_1 * (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 C <= -1.25e-36: tmp = -math.sqrt((-16.0 * ((A * A) * (C * F)))) / t_0 elif C <= 6.5e-84: tmp = -math.sqrt((t_1 * (B + (A + C)))) / t_0 else: tmp = -math.sqrt((t_1 * (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 (C <= -1.25e-36) tmp = Float64(Float64(-sqrt(Float64(-16.0 * Float64(Float64(A * A) * Float64(C * F))))) / t_0); elseif (C <= 6.5e-84) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(B + Float64(A + C))))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(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 (C <= -1.25e-36) tmp = -sqrt((-16.0 * ((A * A) * (C * F)))) / t_0; elseif (C <= 6.5e-84) tmp = -sqrt((t_1 * (B + (A + C)))) / t_0; else tmp = -sqrt((t_1 * (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[C, -1.25e-36], N[((-N[Sqrt[N[(-16.0 * N[(N[(A * A), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[C, 6.5e-84], N[((-N[Sqrt[N[(t$95$1 * N[(B + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(t$95$1 * N[(C + 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}\;C \leq -1.25 \cdot 10^{-36}:\\
\;\;\;\;\frac{-\sqrt{-16 \cdot \left(\left(A \cdot A\right) \cdot \left(C \cdot F\right)\right)}}{t_0}\\
\mathbf{elif}\;C \leq 6.5 \cdot 10^{-84}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(B + \left(A + C\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(C + \left(A + C\right)\right)}}{t_0}\\
\end{array}
\end{array}
if C < -1.25000000000000001e-36Initial program 7.3%
associate-*l*7.3%
unpow27.3%
+-commutative7.3%
unpow27.3%
associate-*l*7.3%
unpow27.3%
Simplified7.3%
Taylor expanded in A around inf 3.2%
Taylor expanded in A around inf 21.8%
unpow221.8%
Simplified21.8%
if -1.25000000000000001e-36 < C < 6.50000000000000022e-84Initial program 30.3%
associate-*l*30.3%
unpow230.3%
+-commutative30.3%
unpow230.3%
associate-*l*30.3%
unpow230.3%
Simplified30.3%
add-cbrt-cube19.3%
add-sqr-sqrt19.3%
fma-def19.3%
unpow219.3%
hypot-udef19.3%
Applied egg-rr19.3%
Taylor expanded in B around inf 14.9%
if 6.50000000000000022e-84 < C Initial program 22.1%
associate-*l*22.1%
unpow222.1%
+-commutative22.1%
unpow222.1%
associate-*l*22.1%
unpow222.1%
Simplified22.1%
add-cbrt-cube15.9%
add-sqr-sqrt15.9%
fma-def15.9%
unpow215.9%
hypot-udef15.9%
Applied egg-rr15.9%
Taylor expanded in C around inf 22.4%
Final simplification19.4%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* A C)))))
(if (<= A 4.4e-139)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ B (+ A C))))) t_0)
(if (<= A 9.5e+139)
(/ (- (sqrt (* -16.0 (* (* A A) (* C F))))) t_0)
(/ (- (sqrt (* (* 2.0 (* F (* C (* A -4.0)))) (+ 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 tmp;
if (A <= 4.4e-139) {
tmp = -sqrt(((2.0 * (F * t_0)) * (B + (A + C)))) / t_0;
} else if (A <= 9.5e+139) {
tmp = -sqrt((-16.0 * ((A * A) * (C * F)))) / t_0;
} else {
tmp = -sqrt(((2.0 * (F * (C * (A * -4.0)))) * (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) :: tmp
t_0 = (b * b) - (4.0d0 * (a * c))
if (a <= 4.4d-139) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * (b + (a + c)))) / t_0
else if (a <= 9.5d+139) then
tmp = -sqrt(((-16.0d0) * ((a * a) * (c * f)))) / t_0
else
tmp = -sqrt(((2.0d0 * (f * (c * (a * (-4.0d0))))) * (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 tmp;
if (A <= 4.4e-139) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (B + (A + C)))) / t_0;
} else if (A <= 9.5e+139) {
tmp = -Math.sqrt((-16.0 * ((A * A) * (C * F)))) / t_0;
} else {
tmp = -Math.sqrt(((2.0 * (F * (C * (A * -4.0)))) * (A + (A + C)))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if A <= 4.4e-139: tmp = -math.sqrt(((2.0 * (F * t_0)) * (B + (A + C)))) / t_0 elif A <= 9.5e+139: tmp = -math.sqrt((-16.0 * ((A * A) * (C * F)))) / t_0 else: tmp = -math.sqrt(((2.0 * (F * (C * (A * -4.0)))) * (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))) tmp = 0.0 if (A <= 4.4e-139) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(B + Float64(A + C))))) / t_0); elseif (A <= 9.5e+139) tmp = Float64(Float64(-sqrt(Float64(-16.0 * Float64(Float64(A * A) * Float64(C * F))))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * Float64(C * Float64(A * -4.0)))) * 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)); tmp = 0.0; if (A <= 4.4e-139) tmp = -sqrt(((2.0 * (F * t_0)) * (B + (A + C)))) / t_0; elseif (A <= 9.5e+139) tmp = -sqrt((-16.0 * ((A * A) * (C * F)))) / t_0; else tmp = -sqrt(((2.0 * (F * (C * (A * -4.0)))) * (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]}, If[LessEqual[A, 4.4e-139], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(B + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, 9.5e+139], N[((-N[Sqrt[N[(-16.0 * N[(N[(A * A), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(N[(2.0 * N[(F * N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 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)\\
\mathbf{if}\;A \leq 4.4 \cdot 10^{-139}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(B + \left(A + C\right)\right)}}{t_0}\\
\mathbf{elif}\;A \leq 9.5 \cdot 10^{+139}:\\
\;\;\;\;\frac{-\sqrt{-16 \cdot \left(\left(A \cdot A\right) \cdot \left(C \cdot F\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot \left(C \cdot \left(A \cdot -4\right)\right)\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{t_0}\\
\end{array}
\end{array}
if A < 4.40000000000000021e-139Initial program 22.4%
associate-*l*22.4%
unpow222.4%
+-commutative22.4%
unpow222.4%
associate-*l*22.4%
unpow222.4%
Simplified22.4%
add-cbrt-cube15.0%
add-sqr-sqrt15.0%
fma-def15.0%
unpow215.0%
hypot-udef15.0%
Applied egg-rr15.0%
Taylor expanded in B around inf 10.4%
if 4.40000000000000021e-139 < A < 9.5000000000000002e139Initial program 24.0%
associate-*l*24.0%
unpow224.0%
+-commutative24.0%
unpow224.0%
associate-*l*24.0%
unpow224.0%
Simplified24.0%
Taylor expanded in A around inf 19.6%
Taylor expanded in A around inf 33.6%
unpow233.6%
Simplified33.6%
if 9.5000000000000002e139 < A Initial program 1.6%
associate-*l*1.6%
unpow21.6%
+-commutative1.6%
unpow21.6%
associate-*l*1.6%
unpow21.6%
Simplified1.6%
Taylor expanded in A around inf 22.3%
Taylor expanded in B around 0 22.5%
associate-*r*33.0%
Simplified22.5%
Final simplification17.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 (<= A 1.75e-165)
(/ (- (sqrt (* (* 2.0 (+ B C)) (* F (* B B))))) t_0)
(if (<= A 1e+139)
(/ (- (sqrt (* -16.0 (* (* A A) (* C F))))) t_0)
(/ (- (sqrt (* (* 2.0 (* F (* C (* A -4.0)))) (+ 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 tmp;
if (A <= 1.75e-165) {
tmp = -sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0;
} else if (A <= 1e+139) {
tmp = -sqrt((-16.0 * ((A * A) * (C * F)))) / t_0;
} else {
tmp = -sqrt(((2.0 * (F * (C * (A * -4.0)))) * (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) :: tmp
t_0 = (b * b) - (4.0d0 * (a * c))
if (a <= 1.75d-165) then
tmp = -sqrt(((2.0d0 * (b + c)) * (f * (b * b)))) / t_0
else if (a <= 1d+139) then
tmp = -sqrt(((-16.0d0) * ((a * a) * (c * f)))) / t_0
else
tmp = -sqrt(((2.0d0 * (f * (c * (a * (-4.0d0))))) * (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 tmp;
if (A <= 1.75e-165) {
tmp = -Math.sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0;
} else if (A <= 1e+139) {
tmp = -Math.sqrt((-16.0 * ((A * A) * (C * F)))) / t_0;
} else {
tmp = -Math.sqrt(((2.0 * (F * (C * (A * -4.0)))) * (A + (A + C)))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if A <= 1.75e-165: tmp = -math.sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0 elif A <= 1e+139: tmp = -math.sqrt((-16.0 * ((A * A) * (C * F)))) / t_0 else: tmp = -math.sqrt(((2.0 * (F * (C * (A * -4.0)))) * (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))) tmp = 0.0 if (A <= 1.75e-165) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(B + C)) * Float64(F * Float64(B * B))))) / t_0); elseif (A <= 1e+139) tmp = Float64(Float64(-sqrt(Float64(-16.0 * Float64(Float64(A * A) * Float64(C * F))))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * Float64(C * Float64(A * -4.0)))) * 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)); tmp = 0.0; if (A <= 1.75e-165) tmp = -sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0; elseif (A <= 1e+139) tmp = -sqrt((-16.0 * ((A * A) * (C * F)))) / t_0; else tmp = -sqrt(((2.0 * (F * (C * (A * -4.0)))) * (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]}, If[LessEqual[A, 1.75e-165], N[((-N[Sqrt[N[(N[(2.0 * N[(B + C), $MachinePrecision]), $MachinePrecision] * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, 1e+139], N[((-N[Sqrt[N[(-16.0 * N[(N[(A * A), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(N[(2.0 * N[(F * N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 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)\\
\mathbf{if}\;A \leq 1.75 \cdot 10^{-165}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(B + C\right)\right) \cdot \left(F \cdot \left(B \cdot B\right)\right)}}{t_0}\\
\mathbf{elif}\;A \leq 10^{+139}:\\
\;\;\;\;\frac{-\sqrt{-16 \cdot \left(\left(A \cdot A\right) \cdot \left(C \cdot F\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot \left(C \cdot \left(A \cdot -4\right)\right)\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{t_0}\\
\end{array}
\end{array}
if A < 1.7500000000000001e-165Initial program 21.0%
associate-*l*21.0%
unpow221.0%
+-commutative21.0%
unpow221.0%
associate-*l*21.0%
unpow221.0%
Simplified21.0%
Taylor expanded in C around 0 16.1%
unpow216.1%
unpow216.1%
hypot-def16.4%
Simplified16.4%
Taylor expanded in A around 0 9.5%
associate-*r*9.5%
unpow29.5%
Simplified9.5%
if 1.7500000000000001e-165 < A < 1.00000000000000003e139Initial program 27.0%
associate-*l*27.0%
unpow227.0%
+-commutative27.0%
unpow227.0%
associate-*l*27.0%
unpow227.0%
Simplified27.0%
Taylor expanded in A around inf 19.5%
Taylor expanded in A around inf 31.9%
unpow231.9%
Simplified31.9%
if 1.00000000000000003e139 < A Initial program 1.6%
associate-*l*1.6%
unpow21.6%
+-commutative1.6%
unpow21.6%
associate-*l*1.6%
unpow21.6%
Simplified1.6%
Taylor expanded in A around inf 22.3%
Taylor expanded in B around 0 22.5%
associate-*r*33.0%
Simplified22.5%
Final simplification17.1%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (* B B) (* 4.0 (* A C)))))
(if (<= B 1.05e-64)
(/ (- (sqrt (* -16.0 (* (* A A) (* C F))))) t_0)
(/ (- (sqrt (* (* 2.0 (+ B C)) (* F (* B B))))) t_0))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (B <= 1.05e-64) {
tmp = -sqrt((-16.0 * ((A * A) * (C * F)))) / t_0;
} else {
tmp = -sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0;
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (b * b) - (4.0d0 * (a * c))
if (b <= 1.05d-64) then
tmp = -sqrt(((-16.0d0) * ((a * a) * (c * f)))) / t_0
else
tmp = -sqrt(((2.0d0 * (b + c)) * (f * (b * b)))) / t_0
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (B <= 1.05e-64) {
tmp = -Math.sqrt((-16.0 * ((A * A) * (C * F)))) / t_0;
} else {
tmp = -Math.sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if B <= 1.05e-64: tmp = -math.sqrt((-16.0 * ((A * A) * (C * F)))) / t_0 else: tmp = -math.sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0 return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) tmp = 0.0 if (B <= 1.05e-64) tmp = Float64(Float64(-sqrt(Float64(-16.0 * Float64(Float64(A * A) * Float64(C * F))))) / t_0); else tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(B + C)) * Float64(F * Float64(B * B))))) / t_0); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (A * C)); tmp = 0.0; if (B <= 1.05e-64) tmp = -sqrt((-16.0 * ((A * A) * (C * F)))) / t_0; else tmp = -sqrt(((2.0 * (B + C)) * (F * (B * B)))) / t_0; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 1.05e-64], N[((-N[Sqrt[N[(-16.0 * N[(N[(A * A), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(N[(2.0 * N[(B + C), $MachinePrecision]), $MachinePrecision] * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 1.05 \cdot 10^{-64}:\\
\;\;\;\;\frac{-\sqrt{-16 \cdot \left(\left(A \cdot A\right) \cdot \left(C \cdot F\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(B + C\right)\right) \cdot \left(F \cdot \left(B \cdot B\right)\right)}}{t_0}\\
\end{array}
\end{array}
if B < 1.05000000000000006e-64Initial program 20.5%
associate-*l*20.5%
unpow220.5%
+-commutative20.5%
unpow220.5%
associate-*l*20.5%
unpow220.5%
Simplified20.5%
Taylor expanded in A around inf 12.5%
Taylor expanded in A around inf 15.0%
unpow215.0%
Simplified15.0%
if 1.05000000000000006e-64 < B Initial program 20.5%
associate-*l*20.5%
unpow220.5%
+-commutative20.5%
unpow220.5%
associate-*l*20.5%
unpow220.5%
Simplified20.5%
Taylor expanded in C around 0 18.9%
unpow218.9%
unpow218.9%
hypot-def19.1%
Simplified19.1%
Taylor expanded in A around 0 19.1%
associate-*r*19.1%
unpow219.1%
Simplified19.1%
Final simplification16.1%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= C 1.35e-229) (* -2.0 (/ (pow (* A F) 0.5) B)) (/ (* (sqrt (* C F)) (* 2.0 (- B))) (- (* B B) (* 4.0 (* A C))))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (C <= 1.35e-229) {
tmp = -2.0 * (pow((A * F), 0.5) / B);
} else {
tmp = (sqrt((C * F)) * (2.0 * -B)) / ((B * B) - (4.0 * (A * C)));
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (c <= 1.35d-229) then
tmp = (-2.0d0) * (((a * f) ** 0.5d0) / b)
else
tmp = (sqrt((c * f)) * (2.0d0 * -b)) / ((b * b) - (4.0d0 * (a * c)))
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (C <= 1.35e-229) {
tmp = -2.0 * (Math.pow((A * F), 0.5) / B);
} else {
tmp = (Math.sqrt((C * F)) * (2.0 * -B)) / ((B * B) - (4.0 * (A * C)));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if C <= 1.35e-229: tmp = -2.0 * (math.pow((A * F), 0.5) / B) else: tmp = (math.sqrt((C * F)) * (2.0 * -B)) / ((B * B) - (4.0 * (A * C))) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (C <= 1.35e-229) tmp = Float64(-2.0 * Float64((Float64(A * F) ^ 0.5) / B)); else tmp = Float64(Float64(sqrt(Float64(C * F)) * Float64(2.0 * Float64(-B))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (C <= 1.35e-229) tmp = -2.0 * (((A * F) ^ 0.5) / B); else tmp = (sqrt((C * F)) * (2.0 * -B)) / ((B * B) - (4.0 * (A * C))); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[C, 1.35e-229], N[(-2.0 * N[(N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] * N[(2.0 * (-B)), $MachinePrecision]), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq 1.35 \cdot 10^{-229}:\\
\;\;\;\;-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{C \cdot F} \cdot \left(2 \cdot \left(-B\right)\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
\end{array}
\end{array}
if C < 1.3499999999999999e-229Initial program 14.6%
Simplified17.9%
Taylor expanded in C around -inf 17.3%
Taylor expanded in C around 0 3.3%
un-div-inv3.3%
*-commutative3.3%
Applied egg-rr3.3%
pow1/23.4%
Applied egg-rr3.4%
if 1.3499999999999999e-229 < C Initial program 29.2%
associate-*l*29.2%
unpow229.2%
+-commutative29.2%
unpow229.2%
associate-*l*29.2%
unpow229.2%
Simplified29.2%
sqrt-prod31.9%
*-commutative31.9%
*-commutative31.9%
associate-+l+31.9%
unpow231.9%
hypot-udef47.6%
associate-+r+47.7%
+-commutative47.7%
associate-+r+48.8%
Applied egg-rr48.8%
Taylor expanded in B around inf 9.0%
associate-*l*8.9%
Simplified8.9%
Taylor expanded in A around -inf 3.9%
unpow23.9%
rem-square-sqrt3.9%
Simplified3.9%
Final simplification3.6%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (/ (- (sqrt (* -16.0 (* (* A A) (* C F))))) (- (* B B) (* 4.0 (* A C)))))
B = abs(B);
double code(double A, double B, double C, double F) {
return -sqrt((-16.0 * ((A * A) * (C * F)))) / ((B * B) - (4.0 * (A * C)));
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
code = -sqrt(((-16.0d0) * ((a * a) * (c * f)))) / ((b * b) - (4.0d0 * (a * c)))
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return -Math.sqrt((-16.0 * ((A * A) * (C * F)))) / ((B * B) - (4.0 * (A * C)));
}
B = abs(B) def code(A, B, C, F): return -math.sqrt((-16.0 * ((A * A) * (C * F)))) / ((B * B) - (4.0 * (A * C)))
B = abs(B) function code(A, B, C, F) return Float64(Float64(-sqrt(Float64(-16.0 * Float64(Float64(A * A) * Float64(C * F))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))) end
B = abs(B) function tmp = code(A, B, C, F) tmp = -sqrt((-16.0 * ((A * A) * (C * F)))) / ((B * B) - (4.0 * (A * C))); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[((-N[Sqrt[N[(-16.0 * N[(N[(A * A), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\frac{-\sqrt{-16 \cdot \left(\left(A \cdot A\right) \cdot \left(C \cdot F\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\end{array}
Initial program 20.5%
associate-*l*20.5%
unpow220.5%
+-commutative20.5%
unpow220.5%
associate-*l*20.5%
unpow220.5%
Simplified20.5%
Taylor expanded in A around inf 9.6%
Taylor expanded in A around inf 12.2%
unpow212.2%
Simplified12.2%
Final simplification12.2%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* -2.0 (/ (pow (* A F) 0.5) B)))
B = abs(B);
double code(double A, double B, double C, double F) {
return -2.0 * (pow((A * F), 0.5) / B);
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
code = (-2.0d0) * (((a * f) ** 0.5d0) / b)
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return -2.0 * (Math.pow((A * F), 0.5) / B);
}
B = abs(B) def code(A, B, C, F): return -2.0 * (math.pow((A * F), 0.5) / B)
B = abs(B) function code(A, B, C, F) return Float64(-2.0 * Float64((Float64(A * F) ^ 0.5) / B)) end
B = abs(B) function tmp = code(A, B, C, F) tmp = -2.0 * (((A * F) ^ 0.5) / B); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(-2.0 * N[(N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}
\end{array}
Initial program 20.5%
Simplified25.2%
Taylor expanded in C around -inf 15.6%
Taylor expanded in C around 0 2.4%
un-div-inv2.4%
*-commutative2.4%
Applied egg-rr2.4%
pow1/22.5%
Applied egg-rr2.5%
Final simplification2.5%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* -2.0 (/ (sqrt (* A F)) B)))
B = abs(B);
double code(double A, double B, double C, double F) {
return -2.0 * (sqrt((A * F)) / B);
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
code = (-2.0d0) * (sqrt((a * f)) / b)
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return -2.0 * (Math.sqrt((A * F)) / B);
}
B = abs(B) def code(A, B, C, F): return -2.0 * (math.sqrt((A * F)) / B)
B = abs(B) function code(A, B, C, F) return Float64(-2.0 * Float64(sqrt(Float64(A * F)) / B)) end
B = abs(B) function tmp = code(A, B, C, F) tmp = -2.0 * (sqrt((A * F)) / B); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(-2.0 * N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
-2 \cdot \frac{\sqrt{A \cdot F}}{B}
\end{array}
Initial program 20.5%
Simplified25.2%
Taylor expanded in C around -inf 15.6%
Taylor expanded in C around 0 2.4%
un-div-inv2.4%
*-commutative2.4%
Applied egg-rr2.4%
Final simplification2.4%
herbie shell --seed 2023230
(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))))