
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) + sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0}
\end{array}
\end{array}
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* C (* A -4.0))))
(t_1 (sqrt (+ C (+ A (hypot B (- A C))))))
(t_2 (fma C (* A -4.0) (* B B)))
(t_3 (- (pow B 2.0) (* (* 4.0 A) C)))
(t_4
(/
(-
(sqrt
(*
(* 2.0 (* t_3 F))
(+ (+ A C) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))))))
t_3)))
(if (<= t_4 -2e-200)
(/
(* (* (sqrt 2.0) (* (sqrt F) (sqrt t_0))) (- t_1))
(- (* B B) (* 4.0 (* A C))))
(if (<= t_4 2e-152)
(/
(- (sqrt (* 2.0 (* (* F t_2) (+ C (+ C (* -0.5 (/ (* B B) A))))))))
t_2)
(if (<= t_4 INFINITY)
(/ (- (sqrt (* 2.0 (* F t_0)))) (/ t_0 t_1))
(* (/ (sqrt 2.0) B) (* (sqrt F) (- (sqrt (+ A (hypot B A)))))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (C * (A * -4.0)));
double t_1 = sqrt((C + (A + hypot(B, (A - C)))));
double t_2 = fma(C, (A * -4.0), (B * B));
double t_3 = pow(B, 2.0) - ((4.0 * A) * C);
double t_4 = -sqrt(((2.0 * (t_3 * F)) * ((A + C) + sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_3;
double tmp;
if (t_4 <= -2e-200) {
tmp = ((sqrt(2.0) * (sqrt(F) * sqrt(t_0))) * -t_1) / ((B * B) - (4.0 * (A * C)));
} else if (t_4 <= 2e-152) {
tmp = -sqrt((2.0 * ((F * t_2) * (C + (C + (-0.5 * ((B * B) / A))))))) / t_2;
} else if (t_4 <= ((double) INFINITY)) {
tmp = -sqrt((2.0 * (F * t_0))) / (t_0 / t_1);
} else {
tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((A + hypot(B, A))));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(B, B, Float64(C * Float64(A * -4.0))) t_1 = sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) t_2 = fma(C, Float64(A * -4.0), Float64(B * B)) t_3 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) t_4 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_3 * F)) * Float64(Float64(A + C) + sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_3) tmp = 0.0 if (t_4 <= -2e-200) tmp = Float64(Float64(Float64(sqrt(2.0) * Float64(sqrt(F) * sqrt(t_0))) * Float64(-t_1)) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))); elseif (t_4 <= 2e-152) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_2) * Float64(C + Float64(C + Float64(-0.5 * Float64(Float64(B * B) / A)))))))) / t_2); elseif (t_4 <= Inf) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * t_0)))) / Float64(t_0 / t_1)); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(F) * Float64(-sqrt(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[(B * B + N[(C * N[(A * -4.0), $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]}, Block[{t$95$2 = N[(C * N[(A * -4.0), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$3 * 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$3), $MachinePrecision]}, If[LessEqual[t$95$4, -2e-200], N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-t$95$1)), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 2e-152], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$2), $MachinePrecision] * N[(C + N[(C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[((-N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(t$95$0 / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
t_1 := \sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\\
t_2 := \mathsf{fma}\left(C, A \cdot -4, B \cdot B\right)\\
t_3 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
t_4 := \frac{-\sqrt{\left(2 \cdot \left(t_3 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_3}\\
\mathbf{if}\;t_4 \leq -2 \cdot 10^{-200}:\\
\;\;\;\;\frac{\left(\sqrt{2} \cdot \left(\sqrt{F} \cdot \sqrt{t_0}\right)\right) \cdot \left(-t_1\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
\mathbf{elif}\;t_4 \leq 2 \cdot 10^{-152}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_2\right) \cdot \left(C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\right)\right)\right)}}{t_2}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot t_0\right)}}{\frac{t_0}{t_1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{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))) < -2e-200Initial program 45.6%
associate-*l*45.6%
unpow245.6%
+-commutative45.6%
unpow245.6%
associate-*l*45.6%
unpow245.6%
Simplified45.6%
sqrt-prod48.5%
*-commutative48.5%
*-commutative48.5%
associate-+l+48.5%
unpow248.5%
hypot-udef66.4%
associate-+r+65.7%
+-commutative65.7%
associate-+r+66.9%
Applied egg-rr66.9%
sqrt-prod66.7%
cancel-sign-sub-inv66.7%
metadata-eval66.7%
Applied egg-rr66.7%
sqrt-prod76.3%
fma-def76.3%
*-commutative76.3%
Applied egg-rr76.3%
associate-*r*76.3%
*-commutative76.3%
Simplified76.3%
if -2e-200 < (/.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))) < 2.00000000000000013e-152Initial program 5.9%
Simplified10.0%
Taylor expanded in A around -inf 33.2%
unpow233.2%
Simplified33.2%
if 2.00000000000000013e-152 < (/.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 37.4%
associate-*l*37.4%
unpow237.4%
+-commutative37.4%
unpow237.4%
associate-*l*37.4%
unpow237.4%
Simplified37.4%
sqrt-prod33.4%
*-commutative33.4%
*-commutative33.4%
associate-+l+33.4%
unpow233.4%
hypot-udef73.6%
associate-+r+73.6%
+-commutative73.6%
associate-+r+73.6%
Applied egg-rr73.6%
sqrt-prod73.6%
cancel-sign-sub-inv73.6%
metadata-eval73.6%
Applied egg-rr73.6%
div-inv73.3%
distribute-rgt-neg-in73.3%
sqrt-unprod73.4%
fma-def73.4%
*-commutative73.4%
cancel-sign-sub-inv73.4%
metadata-eval73.4%
*-commutative73.4%
fma-def73.4%
*-commutative73.4%
Applied egg-rr73.4%
associate-*r/73.6%
*-rgt-identity73.6%
distribute-rgt-neg-out73.6%
distribute-neg-frac73.6%
associate-/l*73.7%
distribute-neg-frac73.7%
Simplified73.7%
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.6%
Taylor expanded in C around 0 2.1%
mul-1-neg2.1%
distribute-rgt-neg-in2.1%
unpow22.1%
unpow22.1%
hypot-def17.2%
Simplified17.2%
sqrt-prod31.5%
Applied egg-rr31.5%
Final simplification52.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 (sqrt (+ C (+ A (hypot B (- A C)))))))
(if (<= B 4.5e+49)
(/ (* t_1 (- (sqrt (* 2.0 (* F t_0))))) t_0)
(if (<= B 1.32e+154)
(/ (* (sqrt F) (* B (sqrt 2.0))) (/ (fma B B (* -4.0 (* A C))) (- t_1)))
(* (/ (sqrt 2.0) B) (* (sqrt F) (- (sqrt (+ 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 = sqrt((C + (A + hypot(B, (A - C)))));
double tmp;
if (B <= 4.5e+49) {
tmp = (t_1 * -sqrt((2.0 * (F * t_0)))) / t_0;
} else if (B <= 1.32e+154) {
tmp = (sqrt(F) * (B * sqrt(2.0))) / (fma(B, B, (-4.0 * (A * C))) / -t_1);
} else {
tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((A + 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 = sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) tmp = 0.0 if (B <= 4.5e+49) tmp = Float64(Float64(t_1 * Float64(-sqrt(Float64(2.0 * Float64(F * t_0))))) / t_0); elseif (B <= 1.32e+154) tmp = Float64(Float64(sqrt(F) * Float64(B * sqrt(2.0))) / Float64(fma(B, B, Float64(-4.0 * Float64(A * C))) / Float64(-t_1))); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(F) * Float64(-sqrt(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[(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, 4.5e+49], 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.32e+154], N[(N[(N[Sqrt[F], $MachinePrecision] * N[(B * N[Sqrt[2.0], $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[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[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 := \sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\\
\mathbf{if}\;B \leq 4.5 \cdot 10^{+49}:\\
\;\;\;\;\frac{t_1 \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_0\right)}\right)}{t_0}\\
\mathbf{elif}\;B \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;\frac{\sqrt{F} \cdot \left(B \cdot \sqrt{2}\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(-\sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)\right)\\
\end{array}
\end{array}
if B < 4.49999999999999982e49Initial program 23.7%
associate-*l*23.7%
unpow223.7%
+-commutative23.7%
unpow223.7%
associate-*l*23.7%
unpow223.7%
Simplified23.7%
sqrt-prod23.4%
*-commutative23.4%
*-commutative23.4%
associate-+l+23.9%
unpow223.9%
hypot-udef36.5%
associate-+r+35.8%
+-commutative35.8%
associate-+r+36.7%
Applied egg-rr36.7%
if 4.49999999999999982e49 < B < 1.31999999999999998e154Initial program 44.8%
associate-*l*44.8%
unpow244.8%
+-commutative44.8%
unpow244.8%
associate-*l*44.8%
unpow244.8%
Simplified44.8%
sqrt-prod56.6%
*-commutative56.6%
*-commutative56.6%
associate-+l+56.6%
unpow256.6%
hypot-udef59.1%
associate-+r+57.1%
+-commutative57.1%
associate-+r+57.9%
Applied egg-rr57.9%
Taylor expanded in B around inf 57.5%
*-un-lft-identity57.5%
distribute-rgt-neg-in57.5%
*-commutative57.5%
cancel-sign-sub-inv57.5%
metadata-eval57.5%
Applied egg-rr57.5%
*-lft-identity57.5%
associate-/l*63.7%
*-commutative63.7%
fma-def63.7%
Simplified63.7%
if 1.31999999999999998e154 < B Initial program 0.0%
Simplified0.0%
Taylor expanded in C around 0 2.3%
mul-1-neg2.3%
distribute-rgt-neg-in2.3%
unpow22.3%
unpow22.3%
hypot-def43.6%
Simplified43.6%
sqrt-prod81.0%
Applied egg-rr81.0%
Final simplification44.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 (* F t_0))
(t_2 (+ C (+ A (hypot B (- A C))))))
(if (<= B 3.3e+50)
(/ (* (sqrt t_2) (- (sqrt (* 2.0 t_1)))) t_0)
(if (<= B 2.2e+104)
(/ (- (* (* (sqrt F) (* B (sqrt 2.0))) (sqrt (+ C (hypot B C))))) t_0)
(if (<= B 1.6e+130)
(- (/ (sqrt (* 2.0 (* t_2 t_1))) t_0))
(* (/ (sqrt 2.0) B) (* (sqrt F) (- (sqrt (+ 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 <= 3.3e+50) {
tmp = (sqrt(t_2) * -sqrt((2.0 * t_1))) / t_0;
} else if (B <= 2.2e+104) {
tmp = -((sqrt(F) * (B * sqrt(2.0))) * sqrt((C + hypot(B, C)))) / t_0;
} else if (B <= 1.6e+130) {
tmp = -(sqrt((2.0 * (t_2 * t_1))) / t_0);
} else {
tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((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 <= 3.3e+50) {
tmp = (Math.sqrt(t_2) * -Math.sqrt((2.0 * t_1))) / t_0;
} else if (B <= 2.2e+104) {
tmp = -((Math.sqrt(F) * (B * Math.sqrt(2.0))) * Math.sqrt((C + Math.hypot(B, C)))) / t_0;
} else if (B <= 1.6e+130) {
tmp = -(Math.sqrt((2.0 * (t_2 * t_1))) / t_0);
} else {
tmp = (Math.sqrt(2.0) / B) * (Math.sqrt(F) * -Math.sqrt((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 <= 3.3e+50: tmp = (math.sqrt(t_2) * -math.sqrt((2.0 * t_1))) / t_0 elif B <= 2.2e+104: tmp = -((math.sqrt(F) * (B * math.sqrt(2.0))) * math.sqrt((C + math.hypot(B, C)))) / t_0 elif B <= 1.6e+130: tmp = -(math.sqrt((2.0 * (t_2 * t_1))) / t_0) else: tmp = (math.sqrt(2.0) / B) * (math.sqrt(F) * -math.sqrt((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 <= 3.3e+50) tmp = Float64(Float64(sqrt(t_2) * Float64(-sqrt(Float64(2.0 * t_1)))) / t_0); elseif (B <= 2.2e+104) tmp = Float64(Float64(-Float64(Float64(sqrt(F) * Float64(B * sqrt(2.0))) * sqrt(Float64(C + hypot(B, C))))) / t_0); elseif (B <= 1.6e+130) tmp = Float64(-Float64(sqrt(Float64(2.0 * Float64(t_2 * t_1))) / t_0)); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(F) * Float64(-sqrt(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 <= 3.3e+50) tmp = (sqrt(t_2) * -sqrt((2.0 * t_1))) / t_0; elseif (B <= 2.2e+104) tmp = -((sqrt(F) * (B * sqrt(2.0))) * sqrt((C + hypot(B, C)))) / t_0; elseif (B <= 1.6e+130) tmp = -(sqrt((2.0 * (t_2 * t_1))) / t_0); else tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((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, 3.3e+50], N[(N[(N[Sqrt[t$95$2], $MachinePrecision] * (-N[Sqrt[N[(2.0 * t$95$1), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B, 2.2e+104], N[((-N[(N[(N[Sqrt[F], $MachinePrecision] * N[(B * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 1.6e+130], (-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[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[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 3.3 \cdot 10^{+50}:\\
\;\;\;\;\frac{\sqrt{t_2} \cdot \left(-\sqrt{2 \cdot t_1}\right)}{t_0}\\
\mathbf{elif}\;B \leq 2.2 \cdot 10^{+104}:\\
\;\;\;\;\frac{-\left(\sqrt{F} \cdot \left(B \cdot \sqrt{2}\right)\right) \cdot \sqrt{C + \mathsf{hypot}\left(B, C\right)}}{t_0}\\
\mathbf{elif}\;B \leq 1.6 \cdot 10^{+130}:\\
\;\;\;\;-\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(-\sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)\right)\\
\end{array}
\end{array}
if B < 3.3e50Initial program 23.7%
associate-*l*23.7%
unpow223.7%
+-commutative23.7%
unpow223.7%
associate-*l*23.7%
unpow223.7%
Simplified23.7%
sqrt-prod23.4%
*-commutative23.4%
*-commutative23.4%
associate-+l+23.9%
unpow223.9%
hypot-udef36.5%
associate-+r+35.8%
+-commutative35.8%
associate-+r+36.7%
Applied egg-rr36.7%
if 3.3e50 < B < 2.2e104Initial program 23.8%
associate-*l*23.8%
unpow223.8%
+-commutative23.8%
unpow223.8%
associate-*l*23.8%
unpow223.8%
Simplified23.8%
sqrt-prod45.0%
*-commutative45.0%
*-commutative45.0%
associate-+l+45.0%
unpow245.0%
hypot-udef47.4%
associate-+r+45.7%
+-commutative45.7%
associate-+r+47.1%
Applied egg-rr47.1%
Taylor expanded in B around inf 46.3%
Taylor expanded in A around 0 48.3%
unpow248.3%
unpow248.3%
hypot-def48.5%
Simplified48.5%
if 2.2e104 < B < 1.6e130Initial program 80.2%
associate-*l*80.2%
unpow280.2%
+-commutative80.2%
unpow280.2%
associate-*l*80.2%
unpow280.2%
Simplified80.2%
distribute-frac-neg80.2%
Applied egg-rr80.5%
if 1.6e130 < B Initial program 2.7%
Simplified2.7%
Taylor expanded in C around 0 5.0%
mul-1-neg5.0%
distribute-rgt-neg-in5.0%
unpow25.0%
unpow25.0%
hypot-def44.1%
Simplified44.1%
sqrt-prod79.5%
Applied egg-rr79.5%
Final simplification44.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 1.6e+130)
(/
(* (sqrt (+ C (+ A (hypot B (- A C))))) (- (sqrt (* 2.0 (* F t_0)))))
t_0)
(* (/ (sqrt 2.0) B) (* (sqrt F) (- (sqrt (+ 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.6e+130) {
tmp = (sqrt((C + (A + hypot(B, (A - C))))) * -sqrt((2.0 * (F * t_0)))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((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.6e+130) {
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) * -Math.sqrt((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.6e+130: 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) * -math.sqrt((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.6e+130) 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(F) * Float64(-sqrt(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.6e+130) tmp = (sqrt((C + (A + hypot(B, (A - C))))) * -sqrt((2.0 * (F * t_0)))) / t_0; else tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((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.6e+130], 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[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[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.6 \cdot 10^{+130}:\\
\;\;\;\;\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(-\sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)\right)\\
\end{array}
\end{array}
if B < 1.6e130Initial program 25.0%
associate-*l*25.0%
unpow225.0%
+-commutative25.0%
unpow225.0%
associate-*l*25.0%
unpow225.0%
Simplified25.0%
sqrt-prod25.6%
*-commutative25.6%
*-commutative25.6%
associate-+l+26.0%
unpow226.0%
hypot-udef38.0%
associate-+r+37.3%
+-commutative37.3%
associate-+r+38.1%
Applied egg-rr38.1%
if 1.6e130 < B Initial program 2.7%
Simplified2.7%
Taylor expanded in C around 0 5.0%
mul-1-neg5.0%
distribute-rgt-neg-in5.0%
unpow25.0%
unpow25.0%
hypot-def44.1%
Simplified44.1%
sqrt-prod79.5%
Applied egg-rr79.5%
Final simplification44.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 6.6e+150)
(/
(* (sqrt (+ C (+ A (hypot B (- A C))))) (- (sqrt (* 2.0 (* F t_0)))))
t_0)
(* (sqrt 2.0) (- (sqrt (/ F B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (B <= 6.6e+150) {
tmp = (sqrt((C + (A + hypot(B, (A - C))))) * -sqrt((2.0 * (F * t_0)))) / t_0;
} 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 (B <= 6.6e+150) {
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) * -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 B <= 6.6e+150: 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) * -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 (B <= 6.6e+150) 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(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 (B <= 6.6e+150) tmp = (sqrt((C + (A + hypot(B, (A - C))))) * -sqrt((2.0 * (F * t_0)))) / t_0; else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 6.6e+150], 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[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}\;B \leq 6.6 \cdot 10^{+150}:\\
\;\;\;\;\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}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if B < 6.59999999999999962e150Initial program 25.3%
associate-*l*25.3%
unpow225.3%
+-commutative25.3%
unpow225.3%
associate-*l*25.3%
unpow225.3%
Simplified25.3%
sqrt-prod25.9%
*-commutative25.9%
*-commutative25.9%
associate-+l+26.3%
unpow226.3%
hypot-udef38.3%
associate-+r+37.5%
+-commutative37.5%
associate-+r+38.4%
Applied egg-rr38.4%
if 6.59999999999999962e150 < B Initial program 0.1%
Simplified0.1%
Taylor expanded in C around 0 2.5%
mul-1-neg2.5%
distribute-rgt-neg-in2.5%
unpow22.5%
unpow22.5%
hypot-def42.6%
Simplified42.6%
Taylor expanded in A around 0 56.8%
associate-*r*56.8%
mul-1-neg56.8%
Simplified56.8%
Final simplification41.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 (+ C (+ A (hypot B (- A C))))))
(if (<= B 3.4e-126)
(/
(* (sqrt t_1) (- (sqrt (* 2.0 (* F (- (* B B) (* 4.0 (* A C))))))))
(* C (* A -4.0)))
(if (<= B 6.3e+150)
(/ (- (sqrt (* t_1 (* 2.0 (* F t_0))))) t_0)
(* (sqrt 2.0) (- (sqrt (/ F B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double t_1 = C + (A + hypot(B, (A - C)));
double tmp;
if (B <= 3.4e-126) {
tmp = (sqrt(t_1) * -sqrt((2.0 * (F * ((B * B) - (4.0 * (A * C))))))) / (C * (A * -4.0));
} else if (B <= 6.3e+150) {
tmp = -sqrt((t_1 * (2.0 * (F * t_0)))) / t_0;
} 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 t_1 = C + (A + Math.hypot(B, (A - C)));
double tmp;
if (B <= 3.4e-126) {
tmp = (Math.sqrt(t_1) * -Math.sqrt((2.0 * (F * ((B * B) - (4.0 * (A * C))))))) / (C * (A * -4.0));
} else if (B <= 6.3e+150) {
tmp = -Math.sqrt((t_1 * (2.0 * (F * t_0)))) / t_0;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) t_1 = C + (A + math.hypot(B, (A - C))) tmp = 0 if B <= 3.4e-126: tmp = (math.sqrt(t_1) * -math.sqrt((2.0 * (F * ((B * B) - (4.0 * (A * C))))))) / (C * (A * -4.0)) elif B <= 6.3e+150: tmp = -math.sqrt((t_1 * (2.0 * (F * t_0)))) / t_0 else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) t_1 = Float64(C + Float64(A + hypot(B, Float64(A - C)))) tmp = 0.0 if (B <= 3.4e-126) tmp = Float64(Float64(sqrt(t_1) * Float64(-sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))))))) / Float64(C * Float64(A * -4.0))); elseif (B <= 6.3e+150) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * Float64(F * t_0))))) / t_0); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); t_1 = C + (A + hypot(B, (A - C))); tmp = 0.0; if (B <= 3.4e-126) tmp = (sqrt(t_1) * -sqrt((2.0 * (F * ((B * B) - (4.0 * (A * C))))))) / (C * (A * -4.0)); elseif (B <= 6.3e+150) tmp = -sqrt((t_1 * (2.0 * (F * t_0)))) / t_0; else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 3.4e-126], N[(N[(N[Sqrt[t$95$1], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 6.3e+150], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $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)\\
t_1 := C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\\
\mathbf{if}\;B \leq 3.4 \cdot 10^{-126}:\\
\;\;\;\;\frac{\sqrt{t_1} \cdot \left(-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right)}\right)}{C \cdot \left(A \cdot -4\right)}\\
\mathbf{elif}\;B \leq 6.3 \cdot 10^{+150}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(2 \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if B < 3.4e-126Initial program 19.9%
associate-*l*19.9%
unpow219.9%
+-commutative19.9%
unpow219.9%
associate-*l*19.9%
unpow219.9%
Simplified19.9%
sqrt-prod19.5%
*-commutative19.5%
*-commutative19.5%
associate-+l+20.0%
unpow220.0%
hypot-udef33.9%
associate-+r+33.2%
+-commutative33.2%
associate-+r+34.0%
Applied egg-rr34.0%
Taylor expanded in B around 0 23.1%
associate-*r*10.8%
*-commutative10.8%
*-commutative10.8%
Simplified23.1%
if 3.4e-126 < B < 6.3000000000000003e150Initial program 45.1%
associate-*l*45.1%
unpow245.1%
+-commutative45.1%
unpow245.1%
associate-*l*45.1%
unpow245.1%
Simplified45.1%
sqrt-prod49.4%
*-commutative49.4%
*-commutative49.4%
associate-+l+49.4%
unpow249.4%
hypot-udef54.3%
associate-+r+53.6%
+-commutative53.6%
associate-+r+54.5%
Applied egg-rr54.5%
distribute-frac-neg54.5%
sqrt-unprod48.6%
cancel-sign-sub-inv48.6%
metadata-eval48.6%
cancel-sign-sub-inv48.6%
*-commutative48.6%
metadata-eval48.6%
Applied egg-rr48.6%
if 6.3000000000000003e150 < B Initial program 0.1%
Simplified0.1%
Taylor expanded in C around 0 2.5%
mul-1-neg2.5%
distribute-rgt-neg-in2.5%
unpow22.5%
unpow22.5%
hypot-def42.6%
Simplified42.6%
Taylor expanded in A around 0 56.8%
associate-*r*56.8%
mul-1-neg56.8%
Simplified56.8%
Final simplification32.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.2e+150)
(- (/ (sqrt (* 2.0 (* (+ C (+ A (hypot B (- A C)))) (* F t_0)))) t_0))
(* (sqrt 2.0) (- (sqrt (/ F B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (B <= 5.2e+150) {
tmp = -(sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * t_0)))) / t_0);
} 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 (B <= 5.2e+150) {
tmp = -(Math.sqrt((2.0 * ((C + (A + Math.hypot(B, (A - C)))) * (F * t_0)))) / t_0);
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if B <= 5.2e+150: tmp = -(math.sqrt((2.0 * ((C + (A + math.hypot(B, (A - C)))) * (F * t_0)))) / t_0) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) tmp = 0.0 if (B <= 5.2e+150) 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(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 (B <= 5.2e+150) tmp = -(sqrt((2.0 * ((C + (A + hypot(B, (A - C)))) * (F * t_0)))) / t_0); else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 5.2e+150], (-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[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}\;B \leq 5.2 \cdot 10^{+150}:\\
\;\;\;\;-\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}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if B < 5.20000000000000012e150Initial program 25.3%
associate-*l*25.3%
unpow225.3%
+-commutative25.3%
unpow225.3%
associate-*l*25.3%
unpow225.3%
Simplified25.3%
distribute-frac-neg25.3%
Applied egg-rr33.4%
if 5.20000000000000012e150 < B Initial program 0.1%
Simplified0.1%
Taylor expanded in C around 0 2.5%
mul-1-neg2.5%
distribute-rgt-neg-in2.5%
unpow22.5%
unpow22.5%
hypot-def42.6%
Simplified42.6%
Taylor expanded in A around 0 56.8%
associate-*r*56.8%
mul-1-neg56.8%
Simplified56.8%
Final simplification36.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+150)
(/ (- (sqrt (* (+ C (+ A (hypot B (- A C)))) (* 2.0 (* F t_0))))) t_0)
(* (sqrt 2.0) (- (sqrt (/ F B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) + (-4.0 * (A * C));
double tmp;
if (B <= 5.2e+150) {
tmp = -sqrt(((C + (A + hypot(B, (A - C)))) * (2.0 * (F * t_0)))) / t_0;
} 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 (B <= 5.2e+150) {
tmp = -Math.sqrt(((C + (A + Math.hypot(B, (A - C)))) * (2.0 * (F * t_0)))) / t_0;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) + (-4.0 * (A * C)) tmp = 0 if B <= 5.2e+150: tmp = -math.sqrt(((C + (A + math.hypot(B, (A - C)))) * (2.0 * (F * t_0)))) / t_0 else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) tmp = 0.0 if (B <= 5.2e+150) tmp = Float64(Float64(-sqrt(Float64(Float64(C + Float64(A + hypot(B, Float64(A - C)))) * Float64(2.0 * Float64(F * t_0))))) / t_0); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) + (-4.0 * (A * C)); tmp = 0.0; if (B <= 5.2e+150) tmp = -sqrt(((C + (A + hypot(B, (A - C)))) * (2.0 * (F * t_0)))) / t_0; else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 5.2e+150], N[((-N[Sqrt[N[(N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $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}\;B \leq 5.2 \cdot 10^{+150}:\\
\;\;\;\;\frac{-\sqrt{\left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if B < 5.20000000000000012e150Initial program 25.3%
associate-*l*25.3%
unpow225.3%
+-commutative25.3%
unpow225.3%
associate-*l*25.3%
unpow225.3%
Simplified25.3%
sqrt-prod25.9%
*-commutative25.9%
*-commutative25.9%
associate-+l+26.3%
unpow226.3%
hypot-udef38.3%
associate-+r+37.5%
+-commutative37.5%
associate-+r+38.4%
Applied egg-rr38.4%
distribute-frac-neg38.4%
sqrt-unprod33.4%
cancel-sign-sub-inv33.4%
metadata-eval33.4%
cancel-sign-sub-inv33.4%
*-commutative33.4%
metadata-eval33.4%
Applied egg-rr33.4%
if 5.20000000000000012e150 < B Initial program 0.1%
Simplified0.1%
Taylor expanded in C around 0 2.5%
mul-1-neg2.5%
distribute-rgt-neg-in2.5%
unpow22.5%
unpow22.5%
hypot-def42.6%
Simplified42.6%
Taylor expanded in A around 0 56.8%
associate-*r*56.8%
mul-1-neg56.8%
Simplified56.8%
Final simplification36.8%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= F 1.7e-302)
(/
(*
(sqrt (* 2.0 (* F (+ (* B B) (* -4.0 (* A C))))))
(- (sqrt (+ A (+ A C)))))
(- (* B B) (* 4.0 (* A C))))
(if (<= F 5e-30)
(* (/ (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 tmp;
if (F <= 1.7e-302) {
tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (A + C)))) / ((B * B) - (4.0 * (A * C)));
} else if (F <= 5e-30) {
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) :: tmp
if (f <= 1.7d-302) then
tmp = (sqrt((2.0d0 * (f * ((b * b) + ((-4.0d0) * (a * c)))))) * -sqrt((a + (a + c)))) / ((b * b) - (4.0d0 * (a * c)))
else if (f <= 5d-30) 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 tmp;
if (F <= 1.7e-302) {
tmp = (Math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -Math.sqrt((A + (A + C)))) / ((B * B) - (4.0 * (A * C)));
} else if (F <= 5e-30) {
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): tmp = 0 if F <= 1.7e-302: tmp = (math.sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -math.sqrt((A + (A + C)))) / ((B * B) - (4.0 * (A * C))) elif F <= 5e-30: 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) tmp = 0.0 if (F <= 1.7e-302) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))))) * Float64(-sqrt(Float64(A + Float64(A + C))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))); elseif (F <= 5e-30) 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) tmp = 0.0; if (F <= 1.7e-302) tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (A + C)))) / ((B * B) - (4.0 * (A * C))); elseif (F <= 5e-30) 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_] := If[LessEqual[F, 1.7e-302], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e-30], 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}
\mathbf{if}\;F \leq 1.7 \cdot 10^{-302}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(A + C\right)}\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{-30}:\\
\;\;\;\;\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 < 1.7e-302Initial program 25.5%
associate-*l*25.5%
unpow225.5%
+-commutative25.5%
unpow225.5%
associate-*l*25.5%
unpow225.5%
Simplified25.5%
Taylor expanded in A around inf 31.8%
sqrt-prod41.3%
*-commutative41.3%
cancel-sign-sub-inv41.3%
*-commutative41.3%
metadata-eval41.3%
associate-+l+41.3%
Applied egg-rr41.3%
if 1.7e-302 < F < 4.99999999999999972e-30Initial program 26.4%
Simplified37.2%
Taylor expanded in C around 0 11.0%
mul-1-neg11.0%
distribute-rgt-neg-in11.0%
unpow211.0%
unpow211.0%
hypot-def21.8%
Simplified21.8%
Taylor expanded in A around 0 20.4%
if 4.99999999999999972e-30 < F Initial program 17.3%
Simplified19.6%
Taylor expanded in C around 0 9.0%
mul-1-neg9.0%
distribute-rgt-neg-in9.0%
unpow29.0%
unpow29.0%
hypot-def14.0%
Simplified14.0%
Taylor expanded in A around 0 20.7%
associate-*r*20.7%
mul-1-neg20.7%
Simplified20.7%
Final simplification22.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 1.7e-302)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ A (+ A C))))) t_0)
(if (<= F 8.5e-30)
(* (/ (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 <= 1.7e-302) {
tmp = -sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0;
} else if (F <= 8.5e-30) {
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 <= 1.7d-302) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * (a + (a + c)))) / t_0
else if (f <= 8.5d-30) 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 <= 1.7e-302) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0;
} else if (F <= 8.5e-30) {
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 <= 1.7e-302: tmp = -math.sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0 elif F <= 8.5e-30: 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 <= 1.7e-302) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(A + Float64(A + C))))) / t_0); elseif (F <= 8.5e-30) 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 <= 1.7e-302) tmp = -sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0; elseif (F <= 8.5e-30) 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, 1.7e-302], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[F, 8.5e-30], 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 1.7 \cdot 10^{-302}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{t_0}\\
\mathbf{elif}\;F \leq 8.5 \cdot 10^{-30}:\\
\;\;\;\;\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 < 1.7e-302Initial program 25.5%
associate-*l*25.5%
unpow225.5%
+-commutative25.5%
unpow225.5%
associate-*l*25.5%
unpow225.5%
Simplified25.5%
Taylor expanded in A around inf 31.8%
if 1.7e-302 < F < 8.49999999999999931e-30Initial program 26.4%
Simplified37.2%
Taylor expanded in C around 0 11.0%
mul-1-neg11.0%
distribute-rgt-neg-in11.0%
unpow211.0%
unpow211.0%
hypot-def21.8%
Simplified21.8%
Taylor expanded in A around 0 20.4%
if 8.49999999999999931e-30 < F Initial program 17.3%
Simplified19.6%
Taylor expanded in C around 0 9.0%
mul-1-neg9.0%
distribute-rgt-neg-in9.0%
unpow29.0%
unpow29.0%
hypot-def14.0%
Simplified14.0%
Taylor expanded in A around 0 20.7%
associate-*r*20.7%
mul-1-neg20.7%
Simplified20.7%
Final simplification21.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 3.4e-210)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ A (+ A C))))) t_0)
(* (sqrt 2.0) (- (sqrt (/ F B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (F <= 3.4e-210) {
tmp = -sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0;
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = (b * b) - (4.0d0 * (a * c))
if (f <= 3.4d-210) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * (a + (a + c)))) / t_0
else
tmp = sqrt(2.0d0) * -sqrt((f / b))
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = (B * B) - (4.0 * (A * C));
double tmp;
if (F <= 3.4e-210) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = (B * B) - (4.0 * (A * C)) tmp = 0 if F <= 3.4e-210: tmp = -math.sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0 else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))) tmp = 0.0 if (F <= 3.4e-210) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(A + Float64(A + C))))) / t_0); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B * B) - (4.0 * (A * C)); tmp = 0.0; if (F <= 3.4e-210) tmp = -sqrt(((2.0 * (F * t_0)) * (A + (A + C)))) / t_0; else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, 3.4e-210], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[Sqrt[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.4 \cdot 10^{-210}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 3.39999999999999974e-210Initial program 25.1%
associate-*l*25.1%
unpow225.1%
+-commutative25.1%
unpow225.1%
associate-*l*25.1%
unpow225.1%
Simplified25.1%
Taylor expanded in A around inf 25.0%
if 3.39999999999999974e-210 < F Initial program 20.6%
Simplified23.8%
Taylor expanded in C around 0 9.7%
mul-1-neg9.7%
distribute-rgt-neg-in9.7%
unpow29.7%
unpow29.7%
hypot-def15.9%
Simplified15.9%
Taylor expanded in A around 0 18.5%
associate-*r*18.5%
mul-1-neg18.5%
Simplified18.5%
Final simplification20.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 4.3e-99)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (+ (+ A C) (- C A))))) t_0)
(/
(-
(pow (* 2.0 (* (* F (+ (* B B) (* -4.0 (* A C)))) (+ A (+ A C)))) 0.5))
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.3e-99) {
tmp = -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
} else {
tmp = -pow((2.0 * ((F * ((B * B) + (-4.0 * (A * C)))) * (A + (A + C)))), 0.5) / 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.3d-99) then
tmp = -sqrt(((2.0d0 * (f * t_0)) * ((a + c) + (c - a)))) / t_0
else
tmp = -((2.0d0 * ((f * ((b * b) + ((-4.0d0) * (a * c)))) * (a + (a + c)))) ** 0.5d0) / 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.3e-99) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0;
} else {
tmp = -Math.pow((2.0 * ((F * ((B * B) + (-4.0 * (A * C)))) * (A + (A + C)))), 0.5) / 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.3e-99: tmp = -math.sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0 else: tmp = -math.pow((2.0 * ((F * ((B * B) + (-4.0 * (A * C)))) * (A + (A + C)))), 0.5) / 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.3e-99) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(Float64(A + C) + Float64(C - A))))) / t_0); else tmp = Float64(Float64(-(Float64(2.0 * Float64(Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))) * Float64(A + Float64(A + C)))) ^ 0.5)) / 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.3e-99) tmp = -sqrt(((2.0 * (F * t_0)) * ((A + C) + (C - A)))) / t_0; else tmp = -((2.0 * ((F * ((B * B) + (-4.0 * (A * C)))) * (A + (A + C)))) ^ 0.5) / 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.3e-99], 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], N[((-N[Power[N[(2.0 * N[(N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $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.3 \cdot 10^{-99}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;\frac{-{\left(2 \cdot \left(\left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A + \left(A + C\right)\right)\right)\right)}^{0.5}}{t_0}\\
\end{array}
\end{array}
if A < 4.2999999999999999e-99Initial program 22.2%
associate-*l*22.2%
unpow222.2%
+-commutative22.2%
unpow222.2%
associate-*l*22.2%
unpow222.2%
Simplified22.2%
Taylor expanded in A around -inf 13.3%
mul-1-neg13.3%
sub-neg13.3%
Simplified13.3%
if 4.2999999999999999e-99 < A 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 22.0%
pow1/222.3%
associate-*l*22.3%
*-commutative22.3%
cancel-sign-sub-inv22.3%
*-commutative22.3%
metadata-eval22.3%
associate-+l+22.3%
Applied egg-rr22.3%
Final simplification16.0%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= A 2.8e-94)
(* -2.0 (/ (sqrt (* C F)) B))
(/
(- (pow (* 2.0 (* (* F (+ (* B B) (* -4.0 (* A C)))) (+ A (+ A C)))) 0.5))
(- (* B B) (* 4.0 (* A C))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (A <= 2.8e-94) {
tmp = -2.0 * (sqrt((C * F)) / B);
} else {
tmp = -pow((2.0 * ((F * ((B * B) + (-4.0 * (A * C)))) * (A + (A + C)))), 0.5) / ((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 (a <= 2.8d-94) then
tmp = (-2.0d0) * (sqrt((c * f)) / b)
else
tmp = -((2.0d0 * ((f * ((b * b) + ((-4.0d0) * (a * c)))) * (a + (a + c)))) ** 0.5d0) / ((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 (A <= 2.8e-94) {
tmp = -2.0 * (Math.sqrt((C * F)) / B);
} else {
tmp = -Math.pow((2.0 * ((F * ((B * B) + (-4.0 * (A * C)))) * (A + (A + C)))), 0.5) / ((B * B) - (4.0 * (A * C)));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if A <= 2.8e-94: tmp = -2.0 * (math.sqrt((C * F)) / B) else: tmp = -math.pow((2.0 * ((F * ((B * B) + (-4.0 * (A * C)))) * (A + (A + C)))), 0.5) / ((B * B) - (4.0 * (A * C))) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (A <= 2.8e-94) tmp = Float64(-2.0 * Float64(sqrt(Float64(C * F)) / B)); else tmp = Float64(Float64(-(Float64(2.0 * Float64(Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))) * Float64(A + Float64(A + C)))) ^ 0.5)) / 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 (A <= 2.8e-94) tmp = -2.0 * (sqrt((C * F)) / B); else tmp = -((2.0 * ((F * ((B * B) + (-4.0 * (A * C)))) * (A + (A + C)))) ^ 0.5) / ((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[A, 2.8e-94], N[(-2.0 * N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[((-N[Power[N[(2.0 * N[(N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $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}\;A \leq 2.8 \cdot 10^{-94}:\\
\;\;\;\;-2 \cdot \frac{\sqrt{C \cdot F}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-{\left(2 \cdot \left(\left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A + \left(A + C\right)\right)\right)\right)}^{0.5}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
\end{array}
\end{array}
if A < 2.7999999999999998e-94Initial program 22.1%
Simplified27.6%
Taylor expanded in A around -inf 20.4%
Taylor expanded in A around 0 4.3%
associate-*r/4.3%
*-commutative4.3%
*-rgt-identity4.3%
Simplified4.3%
if 2.7999999999999998e-94 < A Initial program 20.8%
associate-*l*20.8%
unpow220.8%
+-commutative20.8%
unpow220.8%
associate-*l*20.8%
unpow220.8%
Simplified20.8%
Taylor expanded in A around inf 22.3%
pow1/222.6%
associate-*l*22.6%
*-commutative22.6%
cancel-sign-sub-inv22.6%
*-commutative22.6%
metadata-eval22.6%
associate-+l+22.6%
Applied egg-rr22.6%
Final simplification9.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 (<= A 4.7e-94)
(* -2.0 (/ (sqrt (* C F)) B))
(/ (- (sqrt (* (* 2.0 (* F t_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.7e-94) {
tmp = -2.0 * (sqrt((C * F)) / B);
} else {
tmp = -sqrt(((2.0 * (F * t_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.7d-94) then
tmp = (-2.0d0) * (sqrt((c * f)) / b)
else
tmp = -sqrt(((2.0d0 * (f * t_0)) * (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.7e-94) {
tmp = -2.0 * (Math.sqrt((C * F)) / B);
} else {
tmp = -Math.sqrt(((2.0 * (F * t_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.7e-94: tmp = -2.0 * (math.sqrt((C * F)) / B) else: tmp = -math.sqrt(((2.0 * (F * t_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.7e-94) tmp = Float64(-2.0 * Float64(sqrt(Float64(C * F)) / B)); else tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_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.7e-94) tmp = -2.0 * (sqrt((C * F)) / B); else tmp = -sqrt(((2.0 * (F * t_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.7e-94], N[(-2.0 * N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]
\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.7 \cdot 10^{-94}:\\
\;\;\;\;-2 \cdot \frac{\sqrt{C \cdot F}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{t_0}\\
\end{array}
\end{array}
if A < 4.70000000000000003e-94Initial program 22.1%
Simplified27.6%
Taylor expanded in A around -inf 20.4%
Taylor expanded in A around 0 4.3%
associate-*r/4.3%
*-commutative4.3%
*-rgt-identity4.3%
Simplified4.3%
if 4.70000000000000003e-94 < A Initial program 20.8%
associate-*l*20.8%
unpow220.8%
+-commutative20.8%
unpow220.8%
associate-*l*20.8%
unpow220.8%
Simplified20.8%
Taylor expanded in A around inf 22.3%
Final simplification9.7%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= B 7.9e-50)
(/
(- (sqrt (* (+ A (+ A C)) (* 2.0 (* F (* C (* A -4.0)))))))
(- (* B B) (* 4.0 (* A C))))
(* -2.0 (/ (sqrt (* C F)) B))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (B <= 7.9e-50) {
tmp = -sqrt(((A + (A + C)) * (2.0 * (F * (C * (A * -4.0)))))) / ((B * B) - (4.0 * (A * C)));
} else {
tmp = -2.0 * (sqrt((C * 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) :: tmp
if (b <= 7.9d-50) then
tmp = -sqrt(((a + (a + c)) * (2.0d0 * (f * (c * (a * (-4.0d0))))))) / ((b * b) - (4.0d0 * (a * c)))
else
tmp = (-2.0d0) * (sqrt((c * 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 tmp;
if (B <= 7.9e-50) {
tmp = -Math.sqrt(((A + (A + C)) * (2.0 * (F * (C * (A * -4.0)))))) / ((B * B) - (4.0 * (A * C)));
} else {
tmp = -2.0 * (Math.sqrt((C * F)) / B);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if B <= 7.9e-50: tmp = -math.sqrt(((A + (A + C)) * (2.0 * (F * (C * (A * -4.0)))))) / ((B * B) - (4.0 * (A * C))) else: tmp = -2.0 * (math.sqrt((C * F)) / B) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (B <= 7.9e-50) tmp = Float64(Float64(-sqrt(Float64(Float64(A + Float64(A + C)) * Float64(2.0 * Float64(F * Float64(C * Float64(A * -4.0))))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))); else tmp = Float64(-2.0 * Float64(sqrt(Float64(C * F)) / B)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (B <= 7.9e-50) tmp = -sqrt(((A + (A + C)) * (2.0 * (F * (C * (A * -4.0)))))) / ((B * B) - (4.0 * (A * C))); else tmp = -2.0 * (sqrt((C * F)) / B); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[B, 7.9e-50], N[((-N[Sqrt[N[(N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(F * N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 7.9 \cdot 10^{-50}:\\
\;\;\;\;\frac{-\sqrt{\left(A + \left(A + C\right)\right) \cdot \left(2 \cdot \left(F \cdot \left(C \cdot \left(A \cdot -4\right)\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\sqrt{C \cdot F}}{B}\\
\end{array}
\end{array}
if B < 7.9000000000000002e-50Initial program 22.4%
associate-*l*22.4%
unpow222.4%
+-commutative22.4%
unpow222.4%
associate-*l*22.4%
unpow222.4%
Simplified22.4%
Taylor expanded in A around inf 11.4%
Taylor expanded in B around 0 10.5%
associate-*r*10.5%
*-commutative10.5%
*-commutative10.5%
Simplified10.5%
if 7.9000000000000002e-50 < B Initial program 19.8%
Simplified22.0%
Taylor expanded in A around -inf 9.9%
Taylor expanded in A around 0 9.3%
associate-*r/9.4%
*-commutative9.4%
*-rgt-identity9.4%
Simplified9.4%
Final simplification10.2%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= C 3.6e-286) (* -2.0 (/ (pow (* A F) 0.5) B)) (* -2.0 (/ (sqrt (* C F)) B))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (C <= 3.6e-286) {
tmp = -2.0 * (pow((A * F), 0.5) / B);
} else {
tmp = -2.0 * (sqrt((C * 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) :: tmp
if (c <= 3.6d-286) then
tmp = (-2.0d0) * (((a * f) ** 0.5d0) / b)
else
tmp = (-2.0d0) * (sqrt((c * 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 tmp;
if (C <= 3.6e-286) {
tmp = -2.0 * (Math.pow((A * F), 0.5) / B);
} else {
tmp = -2.0 * (Math.sqrt((C * F)) / B);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if C <= 3.6e-286: tmp = -2.0 * (math.pow((A * F), 0.5) / B) else: tmp = -2.0 * (math.sqrt((C * F)) / B) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (C <= 3.6e-286) tmp = Float64(-2.0 * Float64((Float64(A * F) ^ 0.5) / B)); else tmp = Float64(-2.0 * Float64(sqrt(Float64(C * F)) / B)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (C <= 3.6e-286) tmp = -2.0 * (((A * F) ^ 0.5) / B); else tmp = -2.0 * (sqrt((C * F)) / B); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[C, 3.6e-286], N[(-2.0 * N[(N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq 3.6 \cdot 10^{-286}:\\
\;\;\;\;-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\sqrt{C \cdot F}}{B}\\
\end{array}
\end{array}
if C < 3.60000000000000013e-286Initial program 17.8%
associate-*l*17.8%
unpow217.8%
+-commutative17.8%
unpow217.8%
associate-*l*17.8%
unpow217.8%
Simplified17.8%
Taylor expanded in A around inf 8.5%
Taylor expanded in C around 0 2.2%
associate-*r*2.2%
mul-1-neg2.2%
unpow22.2%
rem-square-sqrt2.2%
*-commutative2.2%
Simplified2.2%
Taylor expanded in B around 0 2.2%
associate-*r/2.2%
*-rgt-identity2.2%
*-commutative2.2%
Simplified2.2%
pow1/22.4%
*-commutative2.4%
Applied egg-rr2.4%
if 3.60000000000000013e-286 < C Initial program 24.9%
Simplified33.3%
Taylor expanded in A around -inf 23.4%
Taylor expanded in A around 0 7.0%
associate-*r/7.0%
*-commutative7.0%
*-rgt-identity7.0%
Simplified7.0%
Final simplification4.9%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= C 6.8e-288) (* -2.0 (/ (sqrt (* A F)) B)) (* -2.0 (/ (sqrt (* C F)) B))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (C <= 6.8e-288) {
tmp = -2.0 * (sqrt((A * F)) / B);
} else {
tmp = -2.0 * (sqrt((C * 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) :: tmp
if (c <= 6.8d-288) then
tmp = (-2.0d0) * (sqrt((a * f)) / b)
else
tmp = (-2.0d0) * (sqrt((c * 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 tmp;
if (C <= 6.8e-288) {
tmp = -2.0 * (Math.sqrt((A * F)) / B);
} else {
tmp = -2.0 * (Math.sqrt((C * F)) / B);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if C <= 6.8e-288: tmp = -2.0 * (math.sqrt((A * F)) / B) else: tmp = -2.0 * (math.sqrt((C * F)) / B) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (C <= 6.8e-288) tmp = Float64(-2.0 * Float64(sqrt(Float64(A * F)) / B)); else tmp = Float64(-2.0 * Float64(sqrt(Float64(C * F)) / B)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (C <= 6.8e-288) tmp = -2.0 * (sqrt((A * F)) / B); else tmp = -2.0 * (sqrt((C * F)) / B); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[C, 6.8e-288], N[(-2.0 * N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq 6.8 \cdot 10^{-288}:\\
\;\;\;\;-2 \cdot \frac{\sqrt{A \cdot F}}{B}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\sqrt{C \cdot F}}{B}\\
\end{array}
\end{array}
if C < 6.79999999999999944e-288Initial program 17.8%
associate-*l*17.8%
unpow217.8%
+-commutative17.8%
unpow217.8%
associate-*l*17.8%
unpow217.8%
Simplified17.8%
Taylor expanded in A around inf 8.5%
Taylor expanded in C around 0 2.2%
associate-*r*2.2%
mul-1-neg2.2%
unpow22.2%
rem-square-sqrt2.2%
*-commutative2.2%
Simplified2.2%
Taylor expanded in B around 0 2.2%
associate-*r/2.2%
*-rgt-identity2.2%
*-commutative2.2%
Simplified2.2%
if 6.79999999999999944e-288 < C Initial program 24.9%
Simplified33.3%
Taylor expanded in A around -inf 23.4%
Taylor expanded in A around 0 7.0%
associate-*r/7.0%
*-commutative7.0%
*-rgt-identity7.0%
Simplified7.0%
Final simplification4.8%
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 21.7%
associate-*l*21.7%
unpow221.7%
+-commutative21.7%
unpow221.7%
associate-*l*21.7%
unpow221.7%
Simplified21.7%
Taylor expanded in A around inf 9.3%
Taylor expanded in C around 0 2.3%
associate-*r*2.3%
mul-1-neg2.3%
unpow22.3%
rem-square-sqrt2.3%
*-commutative2.3%
Simplified2.3%
Taylor expanded in B around 0 2.3%
associate-*r/2.3%
*-rgt-identity2.3%
*-commutative2.3%
Simplified2.3%
Final simplification2.3%
herbie shell --seed 2023199
(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))))