
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) - sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t\_0}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) - sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t\_0}
\end{array}
\end{array}
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (+ (* B_m B_m) (* (* A C) -4.0)))
(t_1 (- (* 4.0 (* A C)) (* B_m B_m)))
(t_2 (* (* 4.0 A) C))
(t_3
(/
(sqrt
(*
(* 2.0 (* (- (pow B_m 2.0) t_2) F))
(- (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
(- t_2 (pow B_m 2.0)))))
(if (<= t_3 (- INFINITY))
(* (/ (sqrt (* F -0.5)) (sqrt C)) (- 0.0 (sqrt 2.0)))
(if (<= t_3 -2e-200)
(/ (sqrt (* (+ A (- C (hypot B_m (- A C)))) (* t_0 (* 2.0 F)))) t_1)
(if (<= t_3 INFINITY)
(/
(sqrt (* t_0 (* (* 2.0 F) (+ A (+ A (/ (* -0.5 (* B_m B_m)) C))))))
t_1)
(- 0.0 (/ (sqrt (* F -2.0)) (sqrt B_m))))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (B_m * B_m) + ((A * C) * -4.0);
double t_1 = (4.0 * (A * C)) - (B_m * B_m);
double t_2 = (4.0 * A) * C;
double t_3 = sqrt(((2.0 * ((pow(B_m, 2.0) - t_2) * F)) * ((A + C) - sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / (t_2 - pow(B_m, 2.0));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = (sqrt((F * -0.5)) / sqrt(C)) * (0.0 - sqrt(2.0));
} else if (t_3 <= -2e-200) {
tmp = sqrt(((A + (C - hypot(B_m, (A - C)))) * (t_0 * (2.0 * F)))) / t_1;
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((t_0 * ((2.0 * F) * (A + (A + ((-0.5 * (B_m * B_m)) / C)))))) / t_1;
} else {
tmp = 0.0 - (sqrt((F * -2.0)) / sqrt(B_m));
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (B_m * B_m) + ((A * C) * -4.0);
double t_1 = (4.0 * (A * C)) - (B_m * B_m);
double t_2 = (4.0 * A) * C;
double t_3 = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_2) * F)) * ((A + C) - Math.sqrt((Math.pow(B_m, 2.0) + Math.pow((A - C), 2.0)))))) / (t_2 - Math.pow(B_m, 2.0));
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = (Math.sqrt((F * -0.5)) / Math.sqrt(C)) * (0.0 - Math.sqrt(2.0));
} else if (t_3 <= -2e-200) {
tmp = Math.sqrt(((A + (C - Math.hypot(B_m, (A - C)))) * (t_0 * (2.0 * F)))) / t_1;
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((t_0 * ((2.0 * F) * (A + (A + ((-0.5 * (B_m * B_m)) / C)))))) / t_1;
} else {
tmp = 0.0 - (Math.sqrt((F * -2.0)) / Math.sqrt(B_m));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (B_m * B_m) + ((A * C) * -4.0) t_1 = (4.0 * (A * C)) - (B_m * B_m) t_2 = (4.0 * A) * C t_3 = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_2) * F)) * ((A + C) - math.sqrt((math.pow(B_m, 2.0) + math.pow((A - C), 2.0)))))) / (t_2 - math.pow(B_m, 2.0)) tmp = 0 if t_3 <= -math.inf: tmp = (math.sqrt((F * -0.5)) / math.sqrt(C)) * (0.0 - math.sqrt(2.0)) elif t_3 <= -2e-200: tmp = math.sqrt(((A + (C - math.hypot(B_m, (A - C)))) * (t_0 * (2.0 * F)))) / t_1 elif t_3 <= math.inf: tmp = math.sqrt((t_0 * ((2.0 * F) * (A + (A + ((-0.5 * (B_m * B_m)) / C)))))) / t_1 else: tmp = 0.0 - (math.sqrt((F * -2.0)) / math.sqrt(B_m)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)) t_1 = Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m)) t_2 = Float64(Float64(4.0 * A) * C) t_3 = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_2) * F)) * Float64(Float64(A + C) - sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / Float64(t_2 - (B_m ^ 2.0))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(Float64(sqrt(Float64(F * -0.5)) / sqrt(C)) * Float64(0.0 - sqrt(2.0))); elseif (t_3 <= -2e-200) tmp = Float64(sqrt(Float64(Float64(A + Float64(C - hypot(B_m, Float64(A - C)))) * Float64(t_0 * Float64(2.0 * F)))) / t_1); elseif (t_3 <= Inf) tmp = Float64(sqrt(Float64(t_0 * Float64(Float64(2.0 * F) * Float64(A + Float64(A + Float64(Float64(-0.5 * Float64(B_m * B_m)) / C)))))) / t_1); else tmp = Float64(0.0 - Float64(sqrt(Float64(F * -2.0)) / sqrt(B_m))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (B_m * B_m) + ((A * C) * -4.0);
t_1 = (4.0 * (A * C)) - (B_m * B_m);
t_2 = (4.0 * A) * C;
t_3 = sqrt(((2.0 * (((B_m ^ 2.0) - t_2) * F)) * ((A + C) - sqrt(((B_m ^ 2.0) + ((A - C) ^ 2.0)))))) / (t_2 - (B_m ^ 2.0));
tmp = 0.0;
if (t_3 <= -Inf)
tmp = (sqrt((F * -0.5)) / sqrt(C)) * (0.0 - sqrt(2.0));
elseif (t_3 <= -2e-200)
tmp = sqrt(((A + (C - hypot(B_m, (A - C)))) * (t_0 * (2.0 * F)))) / t_1;
elseif (t_3 <= Inf)
tmp = sqrt((t_0 * ((2.0 * F) * (A + (A + ((-0.5 * (B_m * B_m)) / C)))))) / t_1;
else
tmp = 0.0 - (sqrt((F * -2.0)) / sqrt(B_m));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$2), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$2 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(N[Sqrt[N[(F * -0.5), $MachinePrecision]], $MachinePrecision] / N[Sqrt[C], $MachinePrecision]), $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -2e-200], N[(N[Sqrt[N[(N[(A + N[(C - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[Sqrt[N[(t$95$0 * N[(N[(2.0 * F), $MachinePrecision] * N[(A + N[(A + N[(N[(-0.5 * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], N[(0.0 - N[(N[Sqrt[N[(F * -2.0), $MachinePrecision]], $MachinePrecision] / N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\\
t_1 := 4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m\\
t_2 := \left(4 \cdot A\right) \cdot C\\
t_3 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_2\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_2 - {B\_m}^{2}}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\frac{\sqrt{F \cdot -0.5}}{\sqrt{C}} \cdot \left(0 - \sqrt{2}\right)\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-200}:\\
\;\;\;\;\frac{\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right) \cdot \left(t\_0 \cdot \left(2 \cdot F\right)\right)}}{t\_1}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\frac{\sqrt{t\_0 \cdot \left(\left(2 \cdot F\right) \cdot \left(A + \left(A + \frac{-0.5 \cdot \left(B\_m \cdot B\_m\right)}{C}\right)\right)\right)}}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;0 - \frac{\sqrt{F \cdot -2}}{\sqrt{B\_m}}\\
\end{array}
\end{array}
if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -inf.0Initial program 3.3%
Taylor expanded in F around 0
mul-1-negN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
Simplified36.6%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
/-lowering-/.f6420.4%
Simplified20.4%
associate-*r/N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6431.5%
Applied egg-rr31.5%
if -inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -2e-200Initial program 97.9%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified97.8%
*-commutativeN/A
*-commutativeN/A
metadata-evalN/A
cancel-sign-sub-invN/A
pow2N/A
associate-*r*N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr97.9%
if -2e-200 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < +inf.0Initial program 23.2%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified35.4%
Taylor expanded in C around inf
associate--l+N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6420.8%
Simplified20.8%
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) Initial program 0.0%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified0.6%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f640.2%
Simplified0.2%
Taylor expanded in C around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6412.6%
Simplified12.6%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6421.1%
Applied egg-rr21.1%
Taylor expanded in B around inf
*-commutativeN/A
*-lowering-*.f6424.4%
Simplified24.4%
Final simplification39.1%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (+ (* B_m B_m) (* (* A C) -4.0))))
(if (<= B_m 1.3e-40)
(/ (sqrt (* t_0 (* 4.0 (* A F)))) (- (* 4.0 (* A C)) (* B_m B_m)))
(if (<= B_m 1.4e+153)
(- 0.0 (sqrt (* 2.0 (* F (/ (+ C (- A (hypot B_m (- A C)))) t_0)))))
(- 0.0 (/ (sqrt (* F -2.0)) (sqrt B_m)))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = (B_m * B_m) + ((A * C) * -4.0);
double tmp;
if (B_m <= 1.3e-40) {
tmp = sqrt((t_0 * (4.0 * (A * F)))) / ((4.0 * (A * C)) - (B_m * B_m));
} else if (B_m <= 1.4e+153) {
tmp = 0.0 - sqrt((2.0 * (F * ((C + (A - hypot(B_m, (A - C)))) / t_0))));
} else {
tmp = 0.0 - (sqrt((F * -2.0)) / sqrt(B_m));
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = (B_m * B_m) + ((A * C) * -4.0);
double tmp;
if (B_m <= 1.3e-40) {
tmp = Math.sqrt((t_0 * (4.0 * (A * F)))) / ((4.0 * (A * C)) - (B_m * B_m));
} else if (B_m <= 1.4e+153) {
tmp = 0.0 - Math.sqrt((2.0 * (F * ((C + (A - Math.hypot(B_m, (A - C)))) / t_0))));
} else {
tmp = 0.0 - (Math.sqrt((F * -2.0)) / Math.sqrt(B_m));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = (B_m * B_m) + ((A * C) * -4.0) tmp = 0 if B_m <= 1.3e-40: tmp = math.sqrt((t_0 * (4.0 * (A * F)))) / ((4.0 * (A * C)) - (B_m * B_m)) elif B_m <= 1.4e+153: tmp = 0.0 - math.sqrt((2.0 * (F * ((C + (A - math.hypot(B_m, (A - C)))) / t_0)))) else: tmp = 0.0 - (math.sqrt((F * -2.0)) / math.sqrt(B_m)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)) tmp = 0.0 if (B_m <= 1.3e-40) tmp = Float64(sqrt(Float64(t_0 * Float64(4.0 * Float64(A * F)))) / Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m))); elseif (B_m <= 1.4e+153) tmp = Float64(0.0 - sqrt(Float64(2.0 * Float64(F * Float64(Float64(C + Float64(A - hypot(B_m, Float64(A - C)))) / t_0))))); else tmp = Float64(0.0 - Float64(sqrt(Float64(F * -2.0)) / sqrt(B_m))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = (B_m * B_m) + ((A * C) * -4.0);
tmp = 0.0;
if (B_m <= 1.3e-40)
tmp = sqrt((t_0 * (4.0 * (A * F)))) / ((4.0 * (A * C)) - (B_m * B_m));
elseif (B_m <= 1.4e+153)
tmp = 0.0 - sqrt((2.0 * (F * ((C + (A - hypot(B_m, (A - C)))) / t_0))));
else
tmp = 0.0 - (sqrt((F * -2.0)) / sqrt(B_m));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.3e-40], N[(N[Sqrt[N[(t$95$0 * N[(4.0 * N[(A * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 1.4e+153], N[(0.0 - N[Sqrt[N[(2.0 * N[(F * N[(N[(C + N[(A - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.0 - N[(N[Sqrt[N[(F * -2.0), $MachinePrecision]], $MachinePrecision] / N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\\
\mathbf{if}\;B\_m \leq 1.3 \cdot 10^{-40}:\\
\;\;\;\;\frac{\sqrt{t\_0 \cdot \left(4 \cdot \left(A \cdot F\right)\right)}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m}\\
\mathbf{elif}\;B\_m \leq 1.4 \cdot 10^{+153}:\\
\;\;\;\;0 - \sqrt{2 \cdot \left(F \cdot \frac{C + \left(A - \mathsf{hypot}\left(B\_m, A - C\right)\right)}{t\_0}\right)}\\
\mathbf{else}:\\
\;\;\;\;0 - \frac{\sqrt{F \cdot -2}}{\sqrt{B\_m}}\\
\end{array}
\end{array}
if B < 1.3000000000000001e-40Initial program 26.8%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified32.7%
Taylor expanded in C around inf
associate--l+N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6416.1%
Simplified16.1%
Taylor expanded in A around inf
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6419.0%
Simplified19.0%
if 1.3000000000000001e-40 < B < 1.39999999999999993e153Initial program 29.2%
Taylor expanded in F around 0
mul-1-negN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
Simplified46.6%
distribute-rgt-neg-outN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
Applied egg-rr55.6%
if 1.39999999999999993e153 < B Initial program 3.3%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified3.3%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f640.1%
Simplified0.1%
Taylor expanded in C around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6439.2%
Simplified39.2%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6474.1%
Applied egg-rr74.1%
Taylor expanded in B around inf
*-commutativeN/A
*-lowering-*.f6484.1%
Simplified84.1%
Final simplification31.8%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(if (<= B_m 4.4e-41)
(/
(sqrt (* (+ (* B_m B_m) (* (* A C) -4.0)) (* 4.0 (* A F))))
(- (* 4.0 (* A C)) (* B_m B_m)))
(if (<= B_m 8e+110)
(/ (sqrt (* 2.0 (* F (- A (hypot B_m A))))) (- 0.0 B_m))
(- 0.0 (/ (sqrt (* F -2.0)) (sqrt B_m))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 4.4e-41) {
tmp = sqrt((((B_m * B_m) + ((A * C) * -4.0)) * (4.0 * (A * F)))) / ((4.0 * (A * C)) - (B_m * B_m));
} else if (B_m <= 8e+110) {
tmp = sqrt((2.0 * (F * (A - hypot(B_m, A))))) / (0.0 - B_m);
} else {
tmp = 0.0 - (sqrt((F * -2.0)) / sqrt(B_m));
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 4.4e-41) {
tmp = Math.sqrt((((B_m * B_m) + ((A * C) * -4.0)) * (4.0 * (A * F)))) / ((4.0 * (A * C)) - (B_m * B_m));
} else if (B_m <= 8e+110) {
tmp = Math.sqrt((2.0 * (F * (A - Math.hypot(B_m, A))))) / (0.0 - B_m);
} else {
tmp = 0.0 - (Math.sqrt((F * -2.0)) / Math.sqrt(B_m));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if B_m <= 4.4e-41: tmp = math.sqrt((((B_m * B_m) + ((A * C) * -4.0)) * (4.0 * (A * F)))) / ((4.0 * (A * C)) - (B_m * B_m)) elif B_m <= 8e+110: tmp = math.sqrt((2.0 * (F * (A - math.hypot(B_m, A))))) / (0.0 - B_m) else: tmp = 0.0 - (math.sqrt((F * -2.0)) / math.sqrt(B_m)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 4.4e-41) tmp = Float64(sqrt(Float64(Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)) * Float64(4.0 * Float64(A * F)))) / Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m))); elseif (B_m <= 8e+110) tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(B_m, A))))) / Float64(0.0 - B_m)); else tmp = Float64(0.0 - Float64(sqrt(Float64(F * -2.0)) / sqrt(B_m))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (B_m <= 4.4e-41)
tmp = sqrt((((B_m * B_m) + ((A * C) * -4.0)) * (4.0 * (A * F)))) / ((4.0 * (A * C)) - (B_m * B_m));
elseif (B_m <= 8e+110)
tmp = sqrt((2.0 * (F * (A - hypot(B_m, A))))) / (0.0 - B_m);
else
tmp = 0.0 - (sqrt((F * -2.0)) / sqrt(B_m));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 4.4e-41], N[(N[Sqrt[N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] * N[(4.0 * N[(A * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 8e+110], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[(N[Sqrt[N[(F * -2.0), $MachinePrecision]], $MachinePrecision] / N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 4.4 \cdot 10^{-41}:\\
\;\;\;\;\frac{\sqrt{\left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right) \cdot \left(4 \cdot \left(A \cdot F\right)\right)}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m}\\
\mathbf{elif}\;B\_m \leq 8 \cdot 10^{+110}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)\right)}}{0 - B\_m}\\
\mathbf{else}:\\
\;\;\;\;0 - \frac{\sqrt{F \cdot -2}}{\sqrt{B\_m}}\\
\end{array}
\end{array}
if B < 4.4e-41Initial program 26.8%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified32.7%
Taylor expanded in C around inf
associate--l+N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6416.1%
Simplified16.1%
Taylor expanded in A around inf
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6419.0%
Simplified19.0%
if 4.4e-41 < B < 8.0000000000000002e110Initial program 40.3%
Taylor expanded in C around 0
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f6442.2%
Simplified42.2%
associate-*l*N/A
mul-1-negN/A
neg-lowering-neg.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
accelerator-lowering-hypot.f6442.5%
Applied egg-rr42.5%
if 8.0000000000000002e110 < B Initial program 5.2%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified5.3%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f640.6%
Simplified0.6%
Taylor expanded in C around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6436.6%
Simplified36.6%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6463.1%
Applied egg-rr63.1%
Taylor expanded in B around inf
*-commutativeN/A
*-lowering-*.f6471.0%
Simplified71.0%
Final simplification29.8%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(if (<= B_m 470.0)
(/
(sqrt (* (+ (* B_m B_m) (* (* A C) -4.0)) (* 4.0 (* A F))))
(- (* 4.0 (* A C)) (* B_m B_m)))
(- 0.0 (/ (sqrt (* F -2.0)) (sqrt B_m)))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 470.0) {
tmp = sqrt((((B_m * B_m) + ((A * C) * -4.0)) * (4.0 * (A * F)))) / ((4.0 * (A * C)) - (B_m * B_m));
} else {
tmp = 0.0 - (sqrt((F * -2.0)) / sqrt(B_m));
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (b_m <= 470.0d0) then
tmp = sqrt((((b_m * b_m) + ((a * c) * (-4.0d0))) * (4.0d0 * (a * f)))) / ((4.0d0 * (a * c)) - (b_m * b_m))
else
tmp = 0.0d0 - (sqrt((f * (-2.0d0))) / sqrt(b_m))
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 470.0) {
tmp = Math.sqrt((((B_m * B_m) + ((A * C) * -4.0)) * (4.0 * (A * F)))) / ((4.0 * (A * C)) - (B_m * B_m));
} else {
tmp = 0.0 - (Math.sqrt((F * -2.0)) / Math.sqrt(B_m));
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if B_m <= 470.0: tmp = math.sqrt((((B_m * B_m) + ((A * C) * -4.0)) * (4.0 * (A * F)))) / ((4.0 * (A * C)) - (B_m * B_m)) else: tmp = 0.0 - (math.sqrt((F * -2.0)) / math.sqrt(B_m)) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 470.0) tmp = Float64(sqrt(Float64(Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)) * Float64(4.0 * Float64(A * F)))) / Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m))); else tmp = Float64(0.0 - Float64(sqrt(Float64(F * -2.0)) / sqrt(B_m))); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (B_m <= 470.0)
tmp = sqrt((((B_m * B_m) + ((A * C) * -4.0)) * (4.0 * (A * F)))) / ((4.0 * (A * C)) - (B_m * B_m));
else
tmp = 0.0 - (sqrt((F * -2.0)) / sqrt(B_m));
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 470.0], N[(N[Sqrt[N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] * N[(4.0 * N[(A * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[(N[Sqrt[N[(F * -2.0), $MachinePrecision]], $MachinePrecision] / N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 470:\\
\;\;\;\;\frac{\sqrt{\left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right) \cdot \left(4 \cdot \left(A \cdot F\right)\right)}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;0 - \frac{\sqrt{F \cdot -2}}{\sqrt{B\_m}}\\
\end{array}
\end{array}
if B < 470Initial program 27.0%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified33.2%
Taylor expanded in C around inf
associate--l+N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6416.0%
Simplified16.0%
Taylor expanded in A around inf
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6418.6%
Simplified18.6%
if 470 < B Initial program 15.0%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified15.2%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f649.9%
Simplified9.9%
Taylor expanded in C around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6436.6%
Simplified36.6%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6458.2%
Applied egg-rr58.2%
Taylor expanded in B around inf
*-commutativeN/A
*-lowering-*.f6464.4%
Simplified64.4%
Final simplification28.6%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(if (<= B_m 1200.0)
(/
(sqrt (* (+ (* B_m B_m) (* (* A C) -4.0)) (* 4.0 (* A F))))
(- (* 4.0 (* A C)) (* B_m B_m)))
(/ (sqrt (* 2.0 (- (* A F) (* B_m F)))) (- 0.0 B_m))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 1200.0) {
tmp = sqrt((((B_m * B_m) + ((A * C) * -4.0)) * (4.0 * (A * F)))) / ((4.0 * (A * C)) - (B_m * B_m));
} else {
tmp = sqrt((2.0 * ((A * F) - (B_m * F)))) / (0.0 - B_m);
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (b_m <= 1200.0d0) then
tmp = sqrt((((b_m * b_m) + ((a * c) * (-4.0d0))) * (4.0d0 * (a * f)))) / ((4.0d0 * (a * c)) - (b_m * b_m))
else
tmp = sqrt((2.0d0 * ((a * f) - (b_m * f)))) / (0.0d0 - b_m)
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 1200.0) {
tmp = Math.sqrt((((B_m * B_m) + ((A * C) * -4.0)) * (4.0 * (A * F)))) / ((4.0 * (A * C)) - (B_m * B_m));
} else {
tmp = Math.sqrt((2.0 * ((A * F) - (B_m * F)))) / (0.0 - B_m);
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if B_m <= 1200.0: tmp = math.sqrt((((B_m * B_m) + ((A * C) * -4.0)) * (4.0 * (A * F)))) / ((4.0 * (A * C)) - (B_m * B_m)) else: tmp = math.sqrt((2.0 * ((A * F) - (B_m * F)))) / (0.0 - B_m) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 1200.0) tmp = Float64(sqrt(Float64(Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)) * Float64(4.0 * Float64(A * F)))) / Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m))); else tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(A * F) - Float64(B_m * F)))) / Float64(0.0 - B_m)); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (B_m <= 1200.0)
tmp = sqrt((((B_m * B_m) + ((A * C) * -4.0)) * (4.0 * (A * F)))) / ((4.0 * (A * C)) - (B_m * B_m));
else
tmp = sqrt((2.0 * ((A * F) - (B_m * F)))) / (0.0 - B_m);
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 1200.0], N[(N[Sqrt[N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] * N[(4.0 * N[(A * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(N[(A * F), $MachinePrecision] - N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 1200:\\
\;\;\;\;\frac{\sqrt{\left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right) \cdot \left(4 \cdot \left(A \cdot F\right)\right)}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(A \cdot F - B\_m \cdot F\right)}}{0 - B\_m}\\
\end{array}
\end{array}
if B < 1200Initial program 27.0%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified33.2%
Taylor expanded in C around inf
associate--l+N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6416.0%
Simplified16.0%
Taylor expanded in A around inf
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6418.6%
Simplified18.6%
if 1200 < B Initial program 15.0%
Taylor expanded in C around 0
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f6454.7%
Simplified54.7%
associate-*l*N/A
mul-1-negN/A
neg-lowering-neg.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
accelerator-lowering-hypot.f6454.8%
Applied egg-rr54.8%
Taylor expanded in A around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6451.3%
Simplified51.3%
Final simplification25.7%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- 0.0 (sqrt (* 2.0 (/ -0.5 (/ C F)))))))
(if (<= B_m 1.1e-255)
t_0
(if (<= B_m 6.2e-125)
(/ (sqrt (* -16.0 (* F (* C (* A A))))) (* 4.0 (* A C)))
(if (<= B_m 1050.0)
t_0
(/ (sqrt (* 2.0 (- (* A F) (* B_m F)))) (- 0.0 B_m)))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = 0.0 - sqrt((2.0 * (-0.5 / (C / F))));
double tmp;
if (B_m <= 1.1e-255) {
tmp = t_0;
} else if (B_m <= 6.2e-125) {
tmp = sqrt((-16.0 * (F * (C * (A * A))))) / (4.0 * (A * C));
} else if (B_m <= 1050.0) {
tmp = t_0;
} else {
tmp = sqrt((2.0 * ((A * F) - (B_m * F)))) / (0.0 - B_m);
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
real(8) :: tmp
t_0 = 0.0d0 - sqrt((2.0d0 * ((-0.5d0) / (c / f))))
if (b_m <= 1.1d-255) then
tmp = t_0
else if (b_m <= 6.2d-125) then
tmp = sqrt(((-16.0d0) * (f * (c * (a * a))))) / (4.0d0 * (a * c))
else if (b_m <= 1050.0d0) then
tmp = t_0
else
tmp = sqrt((2.0d0 * ((a * f) - (b_m * f)))) / (0.0d0 - b_m)
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double t_0 = 0.0 - Math.sqrt((2.0 * (-0.5 / (C / F))));
double tmp;
if (B_m <= 1.1e-255) {
tmp = t_0;
} else if (B_m <= 6.2e-125) {
tmp = Math.sqrt((-16.0 * (F * (C * (A * A))))) / (4.0 * (A * C));
} else if (B_m <= 1050.0) {
tmp = t_0;
} else {
tmp = Math.sqrt((2.0 * ((A * F) - (B_m * F)))) / (0.0 - B_m);
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): t_0 = 0.0 - math.sqrt((2.0 * (-0.5 / (C / F)))) tmp = 0 if B_m <= 1.1e-255: tmp = t_0 elif B_m <= 6.2e-125: tmp = math.sqrt((-16.0 * (F * (C * (A * A))))) / (4.0 * (A * C)) elif B_m <= 1050.0: tmp = t_0 else: tmp = math.sqrt((2.0 * ((A * F) - (B_m * F)))) / (0.0 - B_m) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(0.0 - sqrt(Float64(2.0 * Float64(-0.5 / Float64(C / F))))) tmp = 0.0 if (B_m <= 1.1e-255) tmp = t_0; elseif (B_m <= 6.2e-125) tmp = Float64(sqrt(Float64(-16.0 * Float64(F * Float64(C * Float64(A * A))))) / Float64(4.0 * Float64(A * C))); elseif (B_m <= 1050.0) tmp = t_0; else tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(A * F) - Float64(B_m * F)))) / Float64(0.0 - B_m)); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
t_0 = 0.0 - sqrt((2.0 * (-0.5 / (C / F))));
tmp = 0.0;
if (B_m <= 1.1e-255)
tmp = t_0;
elseif (B_m <= 6.2e-125)
tmp = sqrt((-16.0 * (F * (C * (A * A))))) / (4.0 * (A * C));
elseif (B_m <= 1050.0)
tmp = t_0;
else
tmp = sqrt((2.0 * ((A * F) - (B_m * F)))) / (0.0 - B_m);
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(0.0 - N[Sqrt[N[(2.0 * N[(-0.5 / N[(C / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.1e-255], t$95$0, If[LessEqual[B$95$m, 6.2e-125], N[(N[Sqrt[N[(-16.0 * N[(F * N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 1050.0], t$95$0, N[(N[Sqrt[N[(2.0 * N[(N[(A * F), $MachinePrecision] - N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := 0 - \sqrt{2 \cdot \frac{-0.5}{\frac{C}{F}}}\\
\mathbf{if}\;B\_m \leq 1.1 \cdot 10^{-255}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;B\_m \leq 6.2 \cdot 10^{-125}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{4 \cdot \left(A \cdot C\right)}\\
\mathbf{elif}\;B\_m \leq 1050:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(A \cdot F - B\_m \cdot F\right)}}{0 - B\_m}\\
\end{array}
\end{array}
if B < 1.1e-255 or 6.20000000000000026e-125 < B < 1050Initial program 27.6%
Taylor expanded in F around 0
mul-1-negN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
Simplified25.7%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
/-lowering-/.f6416.3%
Simplified16.3%
distribute-rgt-neg-outN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6416.5%
Applied egg-rr16.5%
if 1.1e-255 < B < 6.20000000000000026e-125Initial program 20.8%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified26.9%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6414.4%
Simplified14.4%
Taylor expanded in A around inf
*-lowering-*.f64N/A
*-lowering-*.f6414.1%
Simplified14.1%
if 1050 < B Initial program 15.0%
Taylor expanded in C around 0
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f6454.7%
Simplified54.7%
associate-*l*N/A
mul-1-negN/A
neg-lowering-neg.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
accelerator-lowering-hypot.f6454.8%
Applied egg-rr54.8%
Taylor expanded in A around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6451.3%
Simplified51.3%
Final simplification23.9%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (if (<= B_m 5.2e-21) (/ (sqrt (* -16.0 (* A (* F (* A C))))) (- (* 4.0 (* A C)) (* B_m B_m))) (/ (sqrt (* 2.0 (- (* A F) (* B_m F)))) (- 0.0 B_m))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 5.2e-21) {
tmp = sqrt((-16.0 * (A * (F * (A * C))))) / ((4.0 * (A * C)) - (B_m * B_m));
} else {
tmp = sqrt((2.0 * ((A * F) - (B_m * F)))) / (0.0 - B_m);
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (b_m <= 5.2d-21) then
tmp = sqrt(((-16.0d0) * (a * (f * (a * c))))) / ((4.0d0 * (a * c)) - (b_m * b_m))
else
tmp = sqrt((2.0d0 * ((a * f) - (b_m * f)))) / (0.0d0 - b_m)
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 5.2e-21) {
tmp = Math.sqrt((-16.0 * (A * (F * (A * C))))) / ((4.0 * (A * C)) - (B_m * B_m));
} else {
tmp = Math.sqrt((2.0 * ((A * F) - (B_m * F)))) / (0.0 - B_m);
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if B_m <= 5.2e-21: tmp = math.sqrt((-16.0 * (A * (F * (A * C))))) / ((4.0 * (A * C)) - (B_m * B_m)) else: tmp = math.sqrt((2.0 * ((A * F) - (B_m * F)))) / (0.0 - B_m) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 5.2e-21) tmp = Float64(sqrt(Float64(-16.0 * Float64(A * Float64(F * Float64(A * C))))) / Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m))); else tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(A * F) - Float64(B_m * F)))) / Float64(0.0 - B_m)); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (B_m <= 5.2e-21)
tmp = sqrt((-16.0 * (A * (F * (A * C))))) / ((4.0 * (A * C)) - (B_m * B_m));
else
tmp = sqrt((2.0 * ((A * F) - (B_m * F)))) / (0.0 - B_m);
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 5.2e-21], N[(N[Sqrt[N[(-16.0 * N[(A * N[(F * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(N[(A * F), $MachinePrecision] - N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 5.2 \cdot 10^{-21}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(A \cdot \left(F \cdot \left(A \cdot C\right)\right)\right)}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(A \cdot F - B\_m \cdot F\right)}}{0 - B\_m}\\
\end{array}
\end{array}
if B < 5.20000000000000035e-21Initial program 26.3%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified32.2%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6410.9%
Simplified10.9%
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6417.6%
Applied egg-rr17.6%
if 5.20000000000000035e-21 < B Initial program 18.4%
Taylor expanded in C around 0
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f6453.0%
Simplified53.0%
associate-*l*N/A
mul-1-negN/A
neg-lowering-neg.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
accelerator-lowering-hypot.f6453.2%
Applied egg-rr53.2%
Taylor expanded in A around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6449.9%
Simplified49.9%
Final simplification25.4%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (if (<= B_m 1050.0) (- 0.0 (sqrt (* 2.0 (/ -0.5 (/ C F))))) (/ (sqrt (* 2.0 (- (* A F) (* B_m F)))) (- 0.0 B_m))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 1050.0) {
tmp = 0.0 - sqrt((2.0 * (-0.5 / (C / F))));
} else {
tmp = sqrt((2.0 * ((A * F) - (B_m * F)))) / (0.0 - B_m);
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (b_m <= 1050.0d0) then
tmp = 0.0d0 - sqrt((2.0d0 * ((-0.5d0) / (c / f))))
else
tmp = sqrt((2.0d0 * ((a * f) - (b_m * f)))) / (0.0d0 - b_m)
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 1050.0) {
tmp = 0.0 - Math.sqrt((2.0 * (-0.5 / (C / F))));
} else {
tmp = Math.sqrt((2.0 * ((A * F) - (B_m * F)))) / (0.0 - B_m);
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if B_m <= 1050.0: tmp = 0.0 - math.sqrt((2.0 * (-0.5 / (C / F)))) else: tmp = math.sqrt((2.0 * ((A * F) - (B_m * F)))) / (0.0 - B_m) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 1050.0) tmp = Float64(0.0 - sqrt(Float64(2.0 * Float64(-0.5 / Float64(C / F))))); else tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(A * F) - Float64(B_m * F)))) / Float64(0.0 - B_m)); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (B_m <= 1050.0)
tmp = 0.0 - sqrt((2.0 * (-0.5 / (C / F))));
else
tmp = sqrt((2.0 * ((A * F) - (B_m * F)))) / (0.0 - B_m);
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 1050.0], N[(0.0 - N[Sqrt[N[(2.0 * N[(-0.5 / N[(C / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(N[(A * F), $MachinePrecision] - N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 1050:\\
\;\;\;\;0 - \sqrt{2 \cdot \frac{-0.5}{\frac{C}{F}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(A \cdot F - B\_m \cdot F\right)}}{0 - B\_m}\\
\end{array}
\end{array}
if B < 1050Initial program 27.0%
Taylor expanded in F around 0
mul-1-negN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
Simplified24.6%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
/-lowering-/.f6416.4%
Simplified16.4%
distribute-rgt-neg-outN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6416.5%
Applied egg-rr16.5%
if 1050 < B Initial program 15.0%
Taylor expanded in C around 0
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f6454.7%
Simplified54.7%
associate-*l*N/A
mul-1-negN/A
neg-lowering-neg.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
accelerator-lowering-hypot.f6454.8%
Applied egg-rr54.8%
Taylor expanded in A around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6451.3%
Simplified51.3%
Final simplification24.1%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (if (<= B_m 780.0) (- 0.0 (sqrt (* 2.0 (/ -0.5 (/ C F))))) (/ (sqrt (* -2.0 (* B_m F))) (- 0.0 B_m))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 780.0) {
tmp = 0.0 - sqrt((2.0 * (-0.5 / (C / F))));
} else {
tmp = sqrt((-2.0 * (B_m * F))) / (0.0 - B_m);
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (b_m <= 780.0d0) then
tmp = 0.0d0 - sqrt((2.0d0 * ((-0.5d0) / (c / f))))
else
tmp = sqrt(((-2.0d0) * (b_m * f))) / (0.0d0 - b_m)
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 780.0) {
tmp = 0.0 - Math.sqrt((2.0 * (-0.5 / (C / F))));
} else {
tmp = Math.sqrt((-2.0 * (B_m * F))) / (0.0 - B_m);
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if B_m <= 780.0: tmp = 0.0 - math.sqrt((2.0 * (-0.5 / (C / F)))) else: tmp = math.sqrt((-2.0 * (B_m * F))) / (0.0 - B_m) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 780.0) tmp = Float64(0.0 - sqrt(Float64(2.0 * Float64(-0.5 / Float64(C / F))))); else tmp = Float64(sqrt(Float64(-2.0 * Float64(B_m * F))) / Float64(0.0 - B_m)); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (B_m <= 780.0)
tmp = 0.0 - sqrt((2.0 * (-0.5 / (C / F))));
else
tmp = sqrt((-2.0 * (B_m * F))) / (0.0 - B_m);
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 780.0], N[(0.0 - N[Sqrt[N[(2.0 * N[(-0.5 / N[(C / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 780:\\
\;\;\;\;0 - \sqrt{2 \cdot \frac{-0.5}{\frac{C}{F}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-2 \cdot \left(B\_m \cdot F\right)}}{0 - B\_m}\\
\end{array}
\end{array}
if B < 780Initial program 27.0%
Taylor expanded in F around 0
mul-1-negN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
Simplified24.6%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
/-lowering-/.f6416.4%
Simplified16.4%
distribute-rgt-neg-outN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6416.5%
Applied egg-rr16.5%
if 780 < B Initial program 15.0%
Taylor expanded in C around 0
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f6454.7%
Simplified54.7%
associate-*l*N/A
mul-1-negN/A
neg-lowering-neg.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
accelerator-lowering-hypot.f6454.8%
Applied egg-rr54.8%
Taylor expanded in A around 0
*-lowering-*.f64N/A
*-lowering-*.f6452.0%
Simplified52.0%
Final simplification24.3%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (if (<= B_m 1200.0) (- 0.0 (sqrt (* 2.0 (/ -0.5 (/ C F))))) (- 0.0 (pow (/ (* F -2.0) B_m) 0.5))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 1200.0) {
tmp = 0.0 - sqrt((2.0 * (-0.5 / (C / F))));
} else {
tmp = 0.0 - pow(((F * -2.0) / B_m), 0.5);
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (b_m <= 1200.0d0) then
tmp = 0.0d0 - sqrt((2.0d0 * ((-0.5d0) / (c / f))))
else
tmp = 0.0d0 - (((f * (-2.0d0)) / b_m) ** 0.5d0)
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 1200.0) {
tmp = 0.0 - Math.sqrt((2.0 * (-0.5 / (C / F))));
} else {
tmp = 0.0 - Math.pow(((F * -2.0) / B_m), 0.5);
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if B_m <= 1200.0: tmp = 0.0 - math.sqrt((2.0 * (-0.5 / (C / F)))) else: tmp = 0.0 - math.pow(((F * -2.0) / B_m), 0.5) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 1200.0) tmp = Float64(0.0 - sqrt(Float64(2.0 * Float64(-0.5 / Float64(C / F))))); else tmp = Float64(0.0 - (Float64(Float64(F * -2.0) / B_m) ^ 0.5)); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (B_m <= 1200.0)
tmp = 0.0 - sqrt((2.0 * (-0.5 / (C / F))));
else
tmp = 0.0 - (((F * -2.0) / B_m) ^ 0.5);
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 1200.0], N[(0.0 - N[Sqrt[N[(2.0 * N[(-0.5 / N[(C / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.0 - N[Power[N[(N[(F * -2.0), $MachinePrecision] / B$95$m), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 1200:\\
\;\;\;\;0 - \sqrt{2 \cdot \frac{-0.5}{\frac{C}{F}}}\\
\mathbf{else}:\\
\;\;\;\;0 - {\left(\frac{F \cdot -2}{B\_m}\right)}^{0.5}\\
\end{array}
\end{array}
if B < 1200Initial program 27.0%
Taylor expanded in F around 0
mul-1-negN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
Simplified24.6%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
/-lowering-/.f6416.4%
Simplified16.4%
distribute-rgt-neg-outN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6416.5%
Applied egg-rr16.5%
if 1200 < B Initial program 15.0%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified15.2%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f649.9%
Simplified9.9%
Taylor expanded in C around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6436.6%
Simplified36.6%
Taylor expanded in A around 0
*-commutativeN/A
*-lowering-*.f6443.0%
Simplified43.0%
pow1/2N/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6443.0%
Applied egg-rr43.0%
Final simplification22.3%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (- 0.0 (pow (/ (* F -2.0) B_m) 0.5)))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
return 0.0 - pow(((F * -2.0) / B_m), 0.5);
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
code = 0.0d0 - (((f * (-2.0d0)) / b_m) ** 0.5d0)
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
return 0.0 - Math.pow(((F * -2.0) / B_m), 0.5);
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): return 0.0 - math.pow(((F * -2.0) / B_m), 0.5)
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return Float64(0.0 - (Float64(Float64(F * -2.0) / B_m) ^ 0.5)) end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp = code(A, B_m, C, F)
tmp = 0.0 - (((F * -2.0) / B_m) ^ 0.5);
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := N[(0.0 - N[Power[N[(N[(F * -2.0), $MachinePrecision] / B$95$m), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
0 - {\left(\frac{F \cdot -2}{B\_m}\right)}^{0.5}
\end{array}
Initial program 24.4%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified29.2%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f645.2%
Simplified5.2%
Taylor expanded in C around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6412.1%
Simplified12.1%
Taylor expanded in A around 0
*-commutativeN/A
*-lowering-*.f6413.0%
Simplified13.0%
pow1/2N/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6413.2%
Applied egg-rr13.2%
Final simplification13.2%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (- 0.0 (sqrt (* F (/ -2.0 B_m)))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
return 0.0 - sqrt((F * (-2.0 / B_m)));
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
code = 0.0d0 - sqrt((f * ((-2.0d0) / b_m)))
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
return 0.0 - Math.sqrt((F * (-2.0 / B_m)));
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): return 0.0 - math.sqrt((F * (-2.0 / B_m)))
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return Float64(0.0 - sqrt(Float64(F * Float64(-2.0 / B_m)))) end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp = code(A, B_m, C, F)
tmp = 0.0 - sqrt((F * (-2.0 / B_m)));
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := N[(0.0 - N[Sqrt[N[(F * N[(-2.0 / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
0 - \sqrt{F \cdot \frac{-2}{B\_m}}
\end{array}
Initial program 24.4%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified29.2%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f645.2%
Simplified5.2%
Taylor expanded in C around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6412.1%
Simplified12.1%
Taylor expanded in A around 0
*-commutativeN/A
*-lowering-*.f6413.0%
Simplified13.0%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6413.0%
Applied egg-rr13.0%
Final simplification13.0%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (- 0.0 (sqrt (* -2.0 (/ F B_m)))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
return 0.0 - sqrt((-2.0 * (F / B_m)));
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
code = 0.0d0 - sqrt(((-2.0d0) * (f / b_m)))
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
return 0.0 - Math.sqrt((-2.0 * (F / B_m)));
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): return 0.0 - math.sqrt((-2.0 * (F / B_m)))
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return Float64(0.0 - sqrt(Float64(-2.0 * Float64(F / B_m)))) end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp = code(A, B_m, C, F)
tmp = 0.0 - sqrt((-2.0 * (F / B_m)));
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := N[(0.0 - N[Sqrt[N[(-2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
0 - \sqrt{-2 \cdot \frac{F}{B\_m}}
\end{array}
Initial program 24.4%
distribute-frac-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
Simplified29.2%
Taylor expanded in B around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f645.2%
Simplified5.2%
Taylor expanded in C around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6412.1%
Simplified12.1%
Taylor expanded in A around 0
*-commutativeN/A
*-lowering-*.f6413.0%
Simplified13.0%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6412.9%
Applied egg-rr12.9%
Final simplification12.9%
herbie shell --seed 2024192
(FPCore (A B C F)
:name "ABCF->ab-angle b"
: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))))