
(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 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) - sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t\_0}
\end{array}
\end{array}
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (hypot B_m (- A C)))
(t_1 (+ (* B_m B_m) (* A (* C -4.0))))
(t_2 (- (* 4.0 (* A C)) (* B_m B_m)))
(t_3 (* (* 4.0 A) C))
(t_4
(/
(sqrt
(*
(* 2.0 (* (- (pow B_m 2.0) t_3) F))
(- (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
(- t_3 (pow B_m 2.0)))))
(if (<= t_4 (- INFINITY))
(-
0.0
(sqrt
(* (/ (+ C (- A t_0)) (+ (* B_m B_m) (* -4.0 (* A C)))) (* 2.0 F))))
(if (<= t_4 -1e-210)
(*
(/ 1.0 (- (* A (* 4.0 C)) (* B_m B_m)))
(sqrt (* 2.0 (* (* F t_1) (+ A (- C t_0))))))
(if (<= t_4 2e+70)
(/
(sqrt
(*
(+ (* -0.5 (/ (* B_m B_m) (- A C))) (* 2.0 C))
(* t_1 (* 2.0 F))))
t_2)
(if (<= t_4 INFINITY)
(/ (* (pow (* A -16.0) 0.5) (sqrt (* A (* C F)))) t_2)
(/ (sqrt (* (* 2.0 F) (- A (hypot B_m A)))) (- 0.0 B_m))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = hypot(B_m, (A - C));
double t_1 = (B_m * B_m) + (A * (C * -4.0));
double t_2 = (4.0 * (A * C)) - (B_m * B_m);
double t_3 = (4.0 * A) * C;
double t_4 = sqrt(((2.0 * ((pow(B_m, 2.0) - t_3) * F)) * ((A + C) - sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / (t_3 - pow(B_m, 2.0));
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = 0.0 - sqrt((((C + (A - t_0)) / ((B_m * B_m) + (-4.0 * (A * C)))) * (2.0 * F)));
} else if (t_4 <= -1e-210) {
tmp = (1.0 / ((A * (4.0 * C)) - (B_m * B_m))) * sqrt((2.0 * ((F * t_1) * (A + (C - t_0)))));
} else if (t_4 <= 2e+70) {
tmp = sqrt((((-0.5 * ((B_m * B_m) / (A - C))) + (2.0 * C)) * (t_1 * (2.0 * F)))) / t_2;
} else if (t_4 <= ((double) INFINITY)) {
tmp = (pow((A * -16.0), 0.5) * sqrt((A * (C * F)))) / t_2;
} else {
tmp = sqrt(((2.0 * F) * (A - hypot(B_m, A)))) / (0.0 - B_m);
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = Math.hypot(B_m, (A - C));
double t_1 = (B_m * B_m) + (A * (C * -4.0));
double t_2 = (4.0 * (A * C)) - (B_m * B_m);
double t_3 = (4.0 * A) * C;
double t_4 = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_3) * F)) * ((A + C) - Math.sqrt((Math.pow(B_m, 2.0) + Math.pow((A - C), 2.0)))))) / (t_3 - Math.pow(B_m, 2.0));
double tmp;
if (t_4 <= -Double.POSITIVE_INFINITY) {
tmp = 0.0 - Math.sqrt((((C + (A - t_0)) / ((B_m * B_m) + (-4.0 * (A * C)))) * (2.0 * F)));
} else if (t_4 <= -1e-210) {
tmp = (1.0 / ((A * (4.0 * C)) - (B_m * B_m))) * Math.sqrt((2.0 * ((F * t_1) * (A + (C - t_0)))));
} else if (t_4 <= 2e+70) {
tmp = Math.sqrt((((-0.5 * ((B_m * B_m) / (A - C))) + (2.0 * C)) * (t_1 * (2.0 * F)))) / t_2;
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = (Math.pow((A * -16.0), 0.5) * Math.sqrt((A * (C * F)))) / t_2;
} else {
tmp = Math.sqrt(((2.0 * F) * (A - Math.hypot(B_m, A)))) / (0.0 - B_m);
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = math.hypot(B_m, (A - C)) t_1 = (B_m * B_m) + (A * (C * -4.0)) t_2 = (4.0 * (A * C)) - (B_m * B_m) t_3 = (4.0 * A) * C t_4 = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_3) * F)) * ((A + C) - math.sqrt((math.pow(B_m, 2.0) + math.pow((A - C), 2.0)))))) / (t_3 - math.pow(B_m, 2.0)) tmp = 0 if t_4 <= -math.inf: tmp = 0.0 - math.sqrt((((C + (A - t_0)) / ((B_m * B_m) + (-4.0 * (A * C)))) * (2.0 * F))) elif t_4 <= -1e-210: tmp = (1.0 / ((A * (4.0 * C)) - (B_m * B_m))) * math.sqrt((2.0 * ((F * t_1) * (A + (C - t_0))))) elif t_4 <= 2e+70: tmp = math.sqrt((((-0.5 * ((B_m * B_m) / (A - C))) + (2.0 * C)) * (t_1 * (2.0 * F)))) / t_2 elif t_4 <= math.inf: tmp = (math.pow((A * -16.0), 0.5) * math.sqrt((A * (C * F)))) / t_2 else: tmp = math.sqrt(((2.0 * F) * (A - math.hypot(B_m, A)))) / (0.0 - B_m) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = hypot(B_m, Float64(A - C)) t_1 = Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) t_2 = Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m)) t_3 = Float64(Float64(4.0 * A) * C) t_4 = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_3) * F)) * Float64(Float64(A + C) - sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / Float64(t_3 - (B_m ^ 2.0))) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = Float64(0.0 - sqrt(Float64(Float64(Float64(C + Float64(A - t_0)) / Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C)))) * Float64(2.0 * F)))); elseif (t_4 <= -1e-210) tmp = Float64(Float64(1.0 / Float64(Float64(A * Float64(4.0 * C)) - Float64(B_m * B_m))) * sqrt(Float64(2.0 * Float64(Float64(F * t_1) * Float64(A + Float64(C - t_0)))))); elseif (t_4 <= 2e+70) tmp = Float64(sqrt(Float64(Float64(Float64(-0.5 * Float64(Float64(B_m * B_m) / Float64(A - C))) + Float64(2.0 * C)) * Float64(t_1 * Float64(2.0 * F)))) / t_2); elseif (t_4 <= Inf) tmp = Float64(Float64((Float64(A * -16.0) ^ 0.5) * sqrt(Float64(A * Float64(C * F)))) / t_2); else tmp = Float64(sqrt(Float64(Float64(2.0 * F) * Float64(A - hypot(B_m, A)))) / Float64(0.0 - B_m)); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = hypot(B_m, (A - C)); t_1 = (B_m * B_m) + (A * (C * -4.0)); t_2 = (4.0 * (A * C)) - (B_m * B_m); t_3 = (4.0 * A) * C; t_4 = sqrt(((2.0 * (((B_m ^ 2.0) - t_3) * F)) * ((A + C) - sqrt(((B_m ^ 2.0) + ((A - C) ^ 2.0)))))) / (t_3 - (B_m ^ 2.0)); tmp = 0.0; if (t_4 <= -Inf) tmp = 0.0 - sqrt((((C + (A - t_0)) / ((B_m * B_m) + (-4.0 * (A * C)))) * (2.0 * F))); elseif (t_4 <= -1e-210) tmp = (1.0 / ((A * (4.0 * C)) - (B_m * B_m))) * sqrt((2.0 * ((F * t_1) * (A + (C - t_0))))); elseif (t_4 <= 2e+70) tmp = sqrt((((-0.5 * ((B_m * B_m) / (A - C))) + (2.0 * C)) * (t_1 * (2.0 * F)))) / t_2; elseif (t_4 <= Inf) tmp = (((A * -16.0) ^ 0.5) * sqrt((A * (C * F)))) / t_2; else tmp = sqrt(((2.0 * F) * (A - hypot(B_m, A)))) / (0.0 - B_m); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$1 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$3), $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$3 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], N[(0.0 - N[Sqrt[N[(N[(N[(C + N[(A - t$95$0), $MachinePrecision]), $MachinePrecision] / N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, -1e-210], N[(N[(1.0 / N[(N[(A * N[(4.0 * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(N[(F * t$95$1), $MachinePrecision] * N[(A + N[(C - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 2e+70], N[(N[Sqrt[N[(N[(N[(-0.5 * N[(N[(B$95$m * B$95$m), $MachinePrecision] / N[(A - C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(N[(N[Power[N[(A * -16.0), $MachinePrecision], 0.5], $MachinePrecision] * N[Sqrt[N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(B\_m, A - C\right)\\
t_1 := B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\\
t_2 := 4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m\\
t_3 := \left(4 \cdot A\right) \cdot C\\
t_4 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_3\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_3 - {B\_m}^{2}}\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;0 - \sqrt{\frac{C + \left(A - t\_0\right)}{B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)} \cdot \left(2 \cdot F\right)}\\
\mathbf{elif}\;t\_4 \leq -1 \cdot 10^{-210}:\\
\;\;\;\;\frac{1}{A \cdot \left(4 \cdot C\right) - B\_m \cdot B\_m} \cdot \sqrt{2 \cdot \left(\left(F \cdot t\_1\right) \cdot \left(A + \left(C - t\_0\right)\right)\right)}\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+70}:\\
\;\;\;\;\frac{\sqrt{\left(-0.5 \cdot \frac{B\_m \cdot B\_m}{A - C} + 2 \cdot C\right) \cdot \left(t\_1 \cdot \left(2 \cdot F\right)\right)}}{t\_2}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\frac{{\left(A \cdot -16\right)}^{0.5} \cdot \sqrt{A \cdot \left(C \cdot F\right)}}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)}}{0 - 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 2.9%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified50.1%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr50.4%
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))) < -1e-210Initial program 97.9%
Simplified95.5%
Applied egg-rr98.0%
if -1e-210 < (/.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))) < 2.00000000000000015e70Initial program 8.7%
Simplified10.9%
Applied egg-rr10.9%
Taylor expanded in B around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f6442.2%
Simplified42.2%
if 2.00000000000000015e70 < (/.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 11.4%
Simplified32.2%
Applied egg-rr32.1%
Taylor expanded in A around -inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f6411.1%
Simplified11.1%
pow1/2N/A
associate-*l*N/A
associate-*r*N/A
unpow-prod-downN/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6458.4%
Applied egg-rr58.4%
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) Initial program 0.0%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified4.2%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr4.0%
Taylor expanded in C around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f640.7%
Simplified0.7%
sqrt-divN/A
sqrt-prodN/A
rem-square-sqrtN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
hypot-defineN/A
hypot-lowering-hypot.f6413.4%
Applied egg-rr13.4%
Final simplification41.3%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= B_m 2.2e-273)
(- 0.0 (sqrt (/ F (- 0.0 A))))
(if (<= B_m 1.08e-178)
(- 0.0 (* (pow (- 0.0 F) 0.5) (sqrt (/ 1.0 C))))
(if (<= B_m 5.2e+116)
(-
0.0
(sqrt
(*
(/ (+ C (- A (hypot B_m (- A C)))) (+ (* B_m B_m) (* -4.0 (* A C))))
(* 2.0 F))))
(/ (sqrt (* (* 2.0 F) (- A (hypot B_m A)))) (- 0.0 B_m))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 2.2e-273) {
tmp = 0.0 - sqrt((F / (0.0 - A)));
} else if (B_m <= 1.08e-178) {
tmp = 0.0 - (pow((0.0 - F), 0.5) * sqrt((1.0 / C)));
} else if (B_m <= 5.2e+116) {
tmp = 0.0 - sqrt((((C + (A - hypot(B_m, (A - C)))) / ((B_m * B_m) + (-4.0 * (A * C)))) * (2.0 * F)));
} else {
tmp = sqrt(((2.0 * F) * (A - hypot(B_m, A)))) / (0.0 - B_m);
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 2.2e-273) {
tmp = 0.0 - Math.sqrt((F / (0.0 - A)));
} else if (B_m <= 1.08e-178) {
tmp = 0.0 - (Math.pow((0.0 - F), 0.5) * Math.sqrt((1.0 / C)));
} else if (B_m <= 5.2e+116) {
tmp = 0.0 - Math.sqrt((((C + (A - Math.hypot(B_m, (A - C)))) / ((B_m * B_m) + (-4.0 * (A * C)))) * (2.0 * F)));
} else {
tmp = Math.sqrt(((2.0 * F) * (A - Math.hypot(B_m, A)))) / (0.0 - B_m);
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if B_m <= 2.2e-273: tmp = 0.0 - math.sqrt((F / (0.0 - A))) elif B_m <= 1.08e-178: tmp = 0.0 - (math.pow((0.0 - F), 0.5) * math.sqrt((1.0 / C))) elif B_m <= 5.2e+116: tmp = 0.0 - math.sqrt((((C + (A - math.hypot(B_m, (A - C)))) / ((B_m * B_m) + (-4.0 * (A * C)))) * (2.0 * F))) else: tmp = math.sqrt(((2.0 * F) * (A - math.hypot(B_m, A)))) / (0.0 - B_m) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 2.2e-273) tmp = Float64(0.0 - sqrt(Float64(F / Float64(0.0 - A)))); elseif (B_m <= 1.08e-178) tmp = Float64(0.0 - Float64((Float64(0.0 - F) ^ 0.5) * sqrt(Float64(1.0 / C)))); elseif (B_m <= 5.2e+116) tmp = Float64(0.0 - sqrt(Float64(Float64(Float64(C + Float64(A - hypot(B_m, Float64(A - C)))) / Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C)))) * Float64(2.0 * F)))); else tmp = Float64(sqrt(Float64(Float64(2.0 * F) * Float64(A - hypot(B_m, A)))) / Float64(0.0 - B_m)); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (B_m <= 2.2e-273) tmp = 0.0 - sqrt((F / (0.0 - A))); elseif (B_m <= 1.08e-178) tmp = 0.0 - (((0.0 - F) ^ 0.5) * sqrt((1.0 / C))); elseif (B_m <= 5.2e+116) tmp = 0.0 - sqrt((((C + (A - hypot(B_m, (A - C)))) / ((B_m * B_m) + (-4.0 * (A * C)))) * (2.0 * F))); else tmp = sqrt(((2.0 * F) * (A - hypot(B_m, A)))) / (0.0 - B_m); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 2.2e-273], N[(0.0 - N[Sqrt[N[(F / N[(0.0 - A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 1.08e-178], N[(0.0 - N[(N[Power[N[(0.0 - F), $MachinePrecision], 0.5], $MachinePrecision] * N[Sqrt[N[(1.0 / C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 5.2e+116], N[(0.0 - N[Sqrt[N[(N[(N[(C + N[(A - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 2.2 \cdot 10^{-273}:\\
\;\;\;\;0 - \sqrt{\frac{F}{0 - A}}\\
\mathbf{elif}\;B\_m \leq 1.08 \cdot 10^{-178}:\\
\;\;\;\;0 - {\left(0 - F\right)}^{0.5} \cdot \sqrt{\frac{1}{C}}\\
\mathbf{elif}\;B\_m \leq 5.2 \cdot 10^{+116}:\\
\;\;\;\;0 - \sqrt{\frac{C + \left(A - \mathsf{hypot}\left(B\_m, A - C\right)\right)}{B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)} \cdot \left(2 \cdot F\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)}}{0 - B\_m}\\
\end{array}
\end{array}
if B < 2.1999999999999998e-273Initial program 17.6%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified26.5%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr26.6%
Taylor expanded in C around -inf
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-lowering-neg.f6417.5%
Simplified17.5%
if 2.1999999999999998e-273 < B < 1.07999999999999995e-178Initial program 7.1%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified9.6%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr9.9%
Taylor expanded in A around -inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6416.2%
Simplified16.2%
distribute-neg-fracN/A
div-invN/A
sqrt-prodN/A
pow1/2N/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6424.0%
Applied egg-rr24.0%
if 1.07999999999999995e-178 < B < 5.19999999999999973e116Initial program 23.6%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified40.9%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr41.3%
if 5.19999999999999973e116 < B Initial program 11.9%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified17.5%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr17.7%
Taylor expanded in C around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f649.7%
Simplified9.7%
sqrt-divN/A
sqrt-prodN/A
rem-square-sqrtN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
hypot-defineN/A
hypot-lowering-hypot.f6452.4%
Applied egg-rr52.4%
Final simplification29.5%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= C -9e+45)
(- 0.0 (sqrt (* (* 2.0 F) (/ (* 2.0 C) (+ (* B_m B_m) (* -4.0 (* A C)))))))
(if (<= C 0.00065)
(/ -1.0 (/ B_m (sqrt (* (* 2.0 F) (- A (hypot B_m A))))))
(/ (pow (- 0.0 F) 0.5) (- 0.0 (sqrt C))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (C <= -9e+45) {
tmp = 0.0 - sqrt(((2.0 * F) * ((2.0 * C) / ((B_m * B_m) + (-4.0 * (A * C))))));
} else if (C <= 0.00065) {
tmp = -1.0 / (B_m / sqrt(((2.0 * F) * (A - hypot(B_m, A)))));
} else {
tmp = pow((0.0 - F), 0.5) / (0.0 - sqrt(C));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (C <= -9e+45) {
tmp = 0.0 - Math.sqrt(((2.0 * F) * ((2.0 * C) / ((B_m * B_m) + (-4.0 * (A * C))))));
} else if (C <= 0.00065) {
tmp = -1.0 / (B_m / Math.sqrt(((2.0 * F) * (A - Math.hypot(B_m, A)))));
} else {
tmp = Math.pow((0.0 - F), 0.5) / (0.0 - Math.sqrt(C));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if C <= -9e+45: tmp = 0.0 - math.sqrt(((2.0 * F) * ((2.0 * C) / ((B_m * B_m) + (-4.0 * (A * C)))))) elif C <= 0.00065: tmp = -1.0 / (B_m / math.sqrt(((2.0 * F) * (A - math.hypot(B_m, A))))) else: tmp = math.pow((0.0 - F), 0.5) / (0.0 - math.sqrt(C)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (C <= -9e+45) tmp = Float64(0.0 - sqrt(Float64(Float64(2.0 * F) * Float64(Float64(2.0 * C) / Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))))))); elseif (C <= 0.00065) tmp = Float64(-1.0 / Float64(B_m / sqrt(Float64(Float64(2.0 * F) * Float64(A - hypot(B_m, A)))))); else tmp = Float64((Float64(0.0 - F) ^ 0.5) / Float64(0.0 - sqrt(C))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (C <= -9e+45) tmp = 0.0 - sqrt(((2.0 * F) * ((2.0 * C) / ((B_m * B_m) + (-4.0 * (A * C)))))); elseif (C <= 0.00065) tmp = -1.0 / (B_m / sqrt(((2.0 * F) * (A - hypot(B_m, A))))); else tmp = ((0.0 - F) ^ 0.5) / (0.0 - sqrt(C)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[C, -9e+45], N[(0.0 - N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(N[(2.0 * C), $MachinePrecision] / N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 0.00065], N[(-1.0 / N[(B$95$m / N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(0.0 - F), $MachinePrecision], 0.5], $MachinePrecision] / N[(0.0 - N[Sqrt[C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;C \leq -9 \cdot 10^{+45}:\\
\;\;\;\;0 - \sqrt{\left(2 \cdot F\right) \cdot \frac{2 \cdot C}{B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)}}\\
\mathbf{elif}\;C \leq 0.00065:\\
\;\;\;\;\frac{-1}{\frac{B\_m}{\sqrt{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(0 - F\right)}^{0.5}}{0 - \sqrt{C}}\\
\end{array}
\end{array}
if C < -8.9999999999999997e45Initial program 15.1%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified36.0%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr37.0%
Taylor expanded in C around -inf
*-lowering-*.f6438.6%
Simplified38.6%
if -8.9999999999999997e45 < C < 6.4999999999999997e-4Initial program 24.7%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified32.4%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr33.4%
Taylor expanded in C around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6419.0%
Simplified19.0%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-divN/A
sqrt-prodN/A
rem-square-sqrtN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
Applied egg-rr17.3%
if 6.4999999999999997e-4 < C Initial program 7.5%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified16.8%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr15.1%
Taylor expanded in A around -inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6442.2%
Simplified42.2%
distribute-neg-fracN/A
sqrt-divN/A
pow1/2N/A
pow1/2N/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
neg-sub0N/A
--lowering--.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f6451.0%
Applied egg-rr51.0%
Final simplification31.3%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= C -1e+48)
(- 0.0 (sqrt (* (* 2.0 F) (/ (* 2.0 C) (+ (* B_m B_m) (* -4.0 (* A C)))))))
(if (<= C 6.8)
(/ (sqrt (* (* 2.0 F) (- A (hypot B_m A)))) (- 0.0 B_m))
(/ (pow (- 0.0 F) 0.5) (- 0.0 (sqrt C))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (C <= -1e+48) {
tmp = 0.0 - sqrt(((2.0 * F) * ((2.0 * C) / ((B_m * B_m) + (-4.0 * (A * C))))));
} else if (C <= 6.8) {
tmp = sqrt(((2.0 * F) * (A - hypot(B_m, A)))) / (0.0 - B_m);
} else {
tmp = pow((0.0 - F), 0.5) / (0.0 - sqrt(C));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (C <= -1e+48) {
tmp = 0.0 - Math.sqrt(((2.0 * F) * ((2.0 * C) / ((B_m * B_m) + (-4.0 * (A * C))))));
} else if (C <= 6.8) {
tmp = Math.sqrt(((2.0 * F) * (A - Math.hypot(B_m, A)))) / (0.0 - B_m);
} else {
tmp = Math.pow((0.0 - F), 0.5) / (0.0 - Math.sqrt(C));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if C <= -1e+48: tmp = 0.0 - math.sqrt(((2.0 * F) * ((2.0 * C) / ((B_m * B_m) + (-4.0 * (A * C)))))) elif C <= 6.8: tmp = math.sqrt(((2.0 * F) * (A - math.hypot(B_m, A)))) / (0.0 - B_m) else: tmp = math.pow((0.0 - F), 0.5) / (0.0 - math.sqrt(C)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (C <= -1e+48) tmp = Float64(0.0 - sqrt(Float64(Float64(2.0 * F) * Float64(Float64(2.0 * C) / Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))))))); elseif (C <= 6.8) tmp = Float64(sqrt(Float64(Float64(2.0 * F) * Float64(A - hypot(B_m, A)))) / Float64(0.0 - B_m)); else tmp = Float64((Float64(0.0 - F) ^ 0.5) / Float64(0.0 - sqrt(C))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (C <= -1e+48) tmp = 0.0 - sqrt(((2.0 * F) * ((2.0 * C) / ((B_m * B_m) + (-4.0 * (A * C)))))); elseif (C <= 6.8) tmp = sqrt(((2.0 * F) * (A - hypot(B_m, A)))) / (0.0 - B_m); else tmp = ((0.0 - F) ^ 0.5) / (0.0 - sqrt(C)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[C, -1e+48], N[(0.0 - N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(N[(2.0 * C), $MachinePrecision] / N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 6.8], N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(0.0 - F), $MachinePrecision], 0.5], $MachinePrecision] / N[(0.0 - N[Sqrt[C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;C \leq -1 \cdot 10^{+48}:\\
\;\;\;\;0 - \sqrt{\left(2 \cdot F\right) \cdot \frac{2 \cdot C}{B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)}}\\
\mathbf{elif}\;C \leq 6.8:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)}}{0 - B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(0 - F\right)}^{0.5}}{0 - \sqrt{C}}\\
\end{array}
\end{array}
if C < -1.00000000000000004e48Initial program 15.1%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified36.0%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr37.0%
Taylor expanded in C around -inf
*-lowering-*.f6438.6%
Simplified38.6%
if -1.00000000000000004e48 < C < 6.79999999999999982Initial program 24.7%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified32.4%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr33.4%
Taylor expanded in C around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6419.0%
Simplified19.0%
sqrt-divN/A
sqrt-prodN/A
rem-square-sqrtN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
hypot-defineN/A
hypot-lowering-hypot.f6417.3%
Applied egg-rr17.3%
if 6.79999999999999982 < C Initial program 7.5%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified16.8%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr15.1%
Taylor expanded in A around -inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6442.2%
Simplified42.2%
distribute-neg-fracN/A
sqrt-divN/A
pow1/2N/A
pow1/2N/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
neg-sub0N/A
--lowering--.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f6451.0%
Applied egg-rr51.0%
Final simplification31.2%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= A -3.6e+58)
(/ (pow (- 0.0 F) 0.5) (- 0.0 (sqrt C)))
(if (<= A 1.12e+27)
(/ (sqrt (* 2.0 (* F (- C (hypot B_m C))))) (- 0.0 B_m))
(- 0.0 (sqrt (/ F (- 0.0 A)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (A <= -3.6e+58) {
tmp = pow((0.0 - F), 0.5) / (0.0 - sqrt(C));
} else if (A <= 1.12e+27) {
tmp = sqrt((2.0 * (F * (C - hypot(B_m, C))))) / (0.0 - B_m);
} else {
tmp = 0.0 - sqrt((F / (0.0 - A)));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (A <= -3.6e+58) {
tmp = Math.pow((0.0 - F), 0.5) / (0.0 - Math.sqrt(C));
} else if (A <= 1.12e+27) {
tmp = Math.sqrt((2.0 * (F * (C - Math.hypot(B_m, C))))) / (0.0 - B_m);
} else {
tmp = 0.0 - Math.sqrt((F / (0.0 - A)));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if A <= -3.6e+58: tmp = math.pow((0.0 - F), 0.5) / (0.0 - math.sqrt(C)) elif A <= 1.12e+27: tmp = math.sqrt((2.0 * (F * (C - math.hypot(B_m, C))))) / (0.0 - B_m) else: tmp = 0.0 - math.sqrt((F / (0.0 - A))) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (A <= -3.6e+58) tmp = Float64((Float64(0.0 - F) ^ 0.5) / Float64(0.0 - sqrt(C))); elseif (A <= 1.12e+27) tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C - hypot(B_m, C))))) / Float64(0.0 - B_m)); else tmp = Float64(0.0 - sqrt(Float64(F / Float64(0.0 - A)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (A <= -3.6e+58) tmp = ((0.0 - F) ^ 0.5) / (0.0 - sqrt(C)); elseif (A <= 1.12e+27) tmp = sqrt((2.0 * (F * (C - hypot(B_m, C))))) / (0.0 - B_m); else tmp = 0.0 - sqrt((F / (0.0 - A))); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[A, -3.6e+58], N[(N[Power[N[(0.0 - F), $MachinePrecision], 0.5], $MachinePrecision] / N[(0.0 - N[Sqrt[C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.12e+27], N[(N[Sqrt[N[(2.0 * N[(F * N[(C - N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[Sqrt[N[(F / N[(0.0 - A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;A \leq -3.6 \cdot 10^{+58}:\\
\;\;\;\;\frac{{\left(0 - F\right)}^{0.5}}{0 - \sqrt{C}}\\
\mathbf{elif}\;A \leq 1.12 \cdot 10^{+27}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B\_m, C\right)\right)\right)}}{0 - B\_m}\\
\mathbf{else}:\\
\;\;\;\;0 - \sqrt{\frac{F}{0 - A}}\\
\end{array}
\end{array}
if A < -3.59999999999999996e58Initial program 14.8%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified27.0%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr26.7%
Taylor expanded in A around -inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6437.2%
Simplified37.2%
distribute-neg-fracN/A
sqrt-divN/A
pow1/2N/A
pow1/2N/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
neg-sub0N/A
--lowering--.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f6440.9%
Applied egg-rr40.9%
if -3.59999999999999996e58 < A < 1.12e27Initial program 27.9%
Taylor expanded in A around 0
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6424.1%
Simplified24.1%
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
hypot-defineN/A
hypot-lowering-hypot.f6424.1%
Applied egg-rr24.1%
if 1.12e27 < A Initial program 1.4%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified8.1%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr10.2%
Taylor expanded in C around -inf
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-lowering-neg.f6436.6%
Simplified36.6%
Final simplification31.3%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= C -3.4e+43)
(- 0.0 (sqrt (* (* 2.0 F) (/ (* 2.0 C) (+ (* B_m B_m) (* -4.0 (* A C)))))))
(if (<= C 2.75e-8)
(- 0.0 (sqrt (/ (* F -2.0) B_m)))
(/ (pow (- 0.0 F) 0.5) (- 0.0 (sqrt C))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (C <= -3.4e+43) {
tmp = 0.0 - sqrt(((2.0 * F) * ((2.0 * C) / ((B_m * B_m) + (-4.0 * (A * C))))));
} else if (C <= 2.75e-8) {
tmp = 0.0 - sqrt(((F * -2.0) / B_m));
} else {
tmp = pow((0.0 - F), 0.5) / (0.0 - sqrt(C));
}
return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (c <= (-3.4d+43)) then
tmp = 0.0d0 - sqrt(((2.0d0 * f) * ((2.0d0 * c) / ((b_m * b_m) + ((-4.0d0) * (a * c))))))
else if (c <= 2.75d-8) then
tmp = 0.0d0 - sqrt(((f * (-2.0d0)) / b_m))
else
tmp = ((0.0d0 - f) ** 0.5d0) / (0.0d0 - sqrt(c))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (C <= -3.4e+43) {
tmp = 0.0 - Math.sqrt(((2.0 * F) * ((2.0 * C) / ((B_m * B_m) + (-4.0 * (A * C))))));
} else if (C <= 2.75e-8) {
tmp = 0.0 - Math.sqrt(((F * -2.0) / B_m));
} else {
tmp = Math.pow((0.0 - F), 0.5) / (0.0 - Math.sqrt(C));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if C <= -3.4e+43: tmp = 0.0 - math.sqrt(((2.0 * F) * ((2.0 * C) / ((B_m * B_m) + (-4.0 * (A * C)))))) elif C <= 2.75e-8: tmp = 0.0 - math.sqrt(((F * -2.0) / B_m)) else: tmp = math.pow((0.0 - F), 0.5) / (0.0 - math.sqrt(C)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (C <= -3.4e+43) tmp = Float64(0.0 - sqrt(Float64(Float64(2.0 * F) * Float64(Float64(2.0 * C) / Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))))))); elseif (C <= 2.75e-8) tmp = Float64(0.0 - sqrt(Float64(Float64(F * -2.0) / B_m))); else tmp = Float64((Float64(0.0 - F) ^ 0.5) / Float64(0.0 - sqrt(C))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (C <= -3.4e+43) tmp = 0.0 - sqrt(((2.0 * F) * ((2.0 * C) / ((B_m * B_m) + (-4.0 * (A * C)))))); elseif (C <= 2.75e-8) tmp = 0.0 - sqrt(((F * -2.0) / B_m)); else tmp = ((0.0 - F) ^ 0.5) / (0.0 - sqrt(C)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[C, -3.4e+43], N[(0.0 - N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(N[(2.0 * C), $MachinePrecision] / N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 2.75e-8], N[(0.0 - N[Sqrt[N[(N[(F * -2.0), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(0.0 - F), $MachinePrecision], 0.5], $MachinePrecision] / N[(0.0 - N[Sqrt[C], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;C \leq -3.4 \cdot 10^{+43}:\\
\;\;\;\;0 - \sqrt{\left(2 \cdot F\right) \cdot \frac{2 \cdot C}{B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)}}\\
\mathbf{elif}\;C \leq 2.75 \cdot 10^{-8}:\\
\;\;\;\;0 - \sqrt{\frac{F \cdot -2}{B\_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(0 - F\right)}^{0.5}}{0 - \sqrt{C}}\\
\end{array}
\end{array}
if C < -3.40000000000000012e43Initial program 15.1%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified36.0%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr37.0%
Taylor expanded in C around -inf
*-lowering-*.f6438.6%
Simplified38.6%
if -3.40000000000000012e43 < C < 2.7500000000000001e-8Initial program 24.8%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified32.6%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr33.6%
Taylor expanded in B around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f6417.2%
Simplified17.2%
if 2.7500000000000001e-8 < C Initial program 7.5%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified16.6%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr15.0%
Taylor expanded in A around -inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6441.7%
Simplified41.7%
distribute-neg-fracN/A
sqrt-divN/A
pow1/2N/A
pow1/2N/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
neg-sub0N/A
--lowering--.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f6450.4%
Applied egg-rr50.4%
Final simplification31.1%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= A -4e-56)
(- 0.0 (sqrt (/ F (- 0.0 C))))
(if (<= A 5.1e-79)
(- 0.0 (sqrt (/ (* F -2.0) B_m)))
(- 0.0 (sqrt (/ F (- 0.0 A)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (A <= -4e-56) {
tmp = 0.0 - sqrt((F / (0.0 - C)));
} else if (A <= 5.1e-79) {
tmp = 0.0 - sqrt(((F * -2.0) / B_m));
} else {
tmp = 0.0 - sqrt((F / (0.0 - A)));
}
return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (a <= (-4d-56)) then
tmp = 0.0d0 - sqrt((f / (0.0d0 - c)))
else if (a <= 5.1d-79) then
tmp = 0.0d0 - sqrt(((f * (-2.0d0)) / b_m))
else
tmp = 0.0d0 - sqrt((f / (0.0d0 - a)))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (A <= -4e-56) {
tmp = 0.0 - Math.sqrt((F / (0.0 - C)));
} else if (A <= 5.1e-79) {
tmp = 0.0 - Math.sqrt(((F * -2.0) / B_m));
} else {
tmp = 0.0 - Math.sqrt((F / (0.0 - A)));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if A <= -4e-56: tmp = 0.0 - math.sqrt((F / (0.0 - C))) elif A <= 5.1e-79: tmp = 0.0 - math.sqrt(((F * -2.0) / B_m)) else: tmp = 0.0 - math.sqrt((F / (0.0 - A))) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (A <= -4e-56) tmp = Float64(0.0 - sqrt(Float64(F / Float64(0.0 - C)))); elseif (A <= 5.1e-79) tmp = Float64(0.0 - sqrt(Float64(Float64(F * -2.0) / B_m))); else tmp = Float64(0.0 - sqrt(Float64(F / Float64(0.0 - A)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (A <= -4e-56) tmp = 0.0 - sqrt((F / (0.0 - C))); elseif (A <= 5.1e-79) tmp = 0.0 - sqrt(((F * -2.0) / B_m)); else tmp = 0.0 - sqrt((F / (0.0 - A))); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[A, -4e-56], N[(0.0 - N[Sqrt[N[(F / N[(0.0 - C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 5.1e-79], N[(0.0 - N[Sqrt[N[(N[(F * -2.0), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.0 - N[Sqrt[N[(F / N[(0.0 - A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-56}:\\
\;\;\;\;0 - \sqrt{\frac{F}{0 - C}}\\
\mathbf{elif}\;A \leq 5.1 \cdot 10^{-79}:\\
\;\;\;\;0 - \sqrt{\frac{F \cdot -2}{B\_m}}\\
\mathbf{else}:\\
\;\;\;\;0 - \sqrt{\frac{F}{0 - A}}\\
\end{array}
\end{array}
if A < -4.0000000000000002e-56Initial program 19.0%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified26.8%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr26.1%
Taylor expanded in A around -inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6435.9%
Simplified35.9%
if -4.0000000000000002e-56 < A < 5.0999999999999999e-79Initial program 27.6%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified37.4%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr36.2%
Taylor expanded in B around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f6418.7%
Simplified18.7%
if 5.0999999999999999e-79 < A Initial program 7.7%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified20.9%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr23.0%
Taylor expanded in C around -inf
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-lowering-neg.f6437.2%
Simplified37.2%
Final simplification30.4%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= C 4.8e-247) (- 0.0 (sqrt (/ F (- 0.0 A)))) (- 0.0 (sqrt (/ F (- 0.0 C))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (C <= 4.8e-247) {
tmp = 0.0 - sqrt((F / (0.0 - A)));
} else {
tmp = 0.0 - sqrt((F / (0.0 - C)));
}
return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (c <= 4.8d-247) then
tmp = 0.0d0 - sqrt((f / (0.0d0 - a)))
else
tmp = 0.0d0 - sqrt((f / (0.0d0 - c)))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (C <= 4.8e-247) {
tmp = 0.0 - Math.sqrt((F / (0.0 - A)));
} else {
tmp = 0.0 - Math.sqrt((F / (0.0 - C)));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if C <= 4.8e-247: tmp = 0.0 - math.sqrt((F / (0.0 - A))) else: tmp = 0.0 - math.sqrt((F / (0.0 - C))) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (C <= 4.8e-247) tmp = Float64(0.0 - sqrt(Float64(F / Float64(0.0 - A)))); else tmp = Float64(0.0 - sqrt(Float64(F / Float64(0.0 - C)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (C <= 4.8e-247) tmp = 0.0 - sqrt((F / (0.0 - A))); else tmp = 0.0 - sqrt((F / (0.0 - C))); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[C, 4.8e-247], N[(0.0 - N[Sqrt[N[(F / N[(0.0 - A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.0 - N[Sqrt[N[(F / N[(0.0 - C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;C \leq 4.8 \cdot 10^{-247}:\\
\;\;\;\;0 - \sqrt{\frac{F}{0 - A}}\\
\mathbf{else}:\\
\;\;\;\;0 - \sqrt{\frac{F}{0 - C}}\\
\end{array}
\end{array}
if C < 4.80000000000000022e-247Initial program 20.2%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified31.1%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr32.7%
Taylor expanded in C around -inf
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-lowering-neg.f6428.4%
Simplified28.4%
if 4.80000000000000022e-247 < C Initial program 15.4%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified25.3%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr24.0%
Taylor expanded in A around -inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6434.9%
Simplified34.9%
Final simplification31.6%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (- 0.0 (sqrt (/ F (- 0.0 C)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
return 0.0 - sqrt((F / (0.0 - C)));
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
code = 0.0d0 - sqrt((f / (0.0d0 - c)))
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
return 0.0 - Math.sqrt((F / (0.0 - C)));
}
B_m = math.fabs(B) def code(A, B_m, C, F): return 0.0 - math.sqrt((F / (0.0 - C)))
B_m = abs(B) function code(A, B_m, C, F) return Float64(0.0 - sqrt(Float64(F / Float64(0.0 - C)))) end
B_m = abs(B); function tmp = code(A, B_m, C, F) tmp = 0.0 - sqrt((F / (0.0 - C))); end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := N[(0.0 - N[Sqrt[N[(F / N[(0.0 - C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
0 - \sqrt{\frac{F}{0 - C}}
\end{array}
Initial program 17.8%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
Simplified28.3%
sub0-negN/A
neg-lowering-neg.f64N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied egg-rr28.5%
Taylor expanded in A around -inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6418.0%
Simplified18.0%
Final simplification18.0%
herbie shell --seed 2024163
(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))))