
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) - sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t\_0}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) - sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t\_0}
\end{array}
\end{array}
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 (* (* 4.0 A) C))
(t_1 (* 2.0 (* (- (pow B_m 2.0) t_0) F)))
(t_2 (- t_0 (pow B_m 2.0)))
(t_3
(/
(sqrt (* t_1 (- (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
t_2))
(t_4 (fma C (* A -4.0) (pow B_m 2.0))))
(if (<= t_3 -1e-210)
(/
(* (sqrt (* F (+ A (- C (hypot B_m (- A C)))))) (sqrt (* 2.0 t_4)))
(- t_4))
(if (<= t_3 2e+187)
(/ (sqrt (* t_1 (+ A (+ A (* -0.5 (/ (pow B_m 2.0) C)))))) t_2)
(if (<= t_3 INFINITY)
(/
(pow
(*
(exp (* 0.25 (+ (log (* -8.0 (* C F))) (* -2.0 (log (/ -1.0 A))))))
(sqrt (sqrt 2.0)))
2.0)
(- (fma B_m B_m (* A (* C -4.0)))))
(/
-1.0
(* (/ B_m (sqrt 2.0)) (sqrt (/ (/ 1.0 F) (- A (hypot A 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 = (4.0 * A) * C;
double t_1 = 2.0 * ((pow(B_m, 2.0) - t_0) * F);
double t_2 = t_0 - pow(B_m, 2.0);
double t_3 = sqrt((t_1 * ((A + C) - sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / t_2;
double t_4 = fma(C, (A * -4.0), pow(B_m, 2.0));
double tmp;
if (t_3 <= -1e-210) {
tmp = (sqrt((F * (A + (C - hypot(B_m, (A - C)))))) * sqrt((2.0 * t_4))) / -t_4;
} else if (t_3 <= 2e+187) {
tmp = sqrt((t_1 * (A + (A + (-0.5 * (pow(B_m, 2.0) / C)))))) / t_2;
} else if (t_3 <= ((double) INFINITY)) {
tmp = pow((exp((0.25 * (log((-8.0 * (C * F))) + (-2.0 * log((-1.0 / A)))))) * sqrt(sqrt(2.0))), 2.0) / -fma(B_m, B_m, (A * (C * -4.0)));
} else {
tmp = -1.0 / ((B_m / sqrt(2.0)) * sqrt(((1.0 / F) / (A - hypot(A, 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(4.0 * A) * C) t_1 = Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) t_2 = Float64(t_0 - (B_m ^ 2.0)) t_3 = Float64(sqrt(Float64(t_1 * Float64(Float64(A + C) - sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / t_2) t_4 = fma(C, Float64(A * -4.0), (B_m ^ 2.0)) tmp = 0.0 if (t_3 <= -1e-210) tmp = Float64(Float64(sqrt(Float64(F * Float64(A + Float64(C - hypot(B_m, Float64(A - C)))))) * sqrt(Float64(2.0 * t_4))) / Float64(-t_4)); elseif (t_3 <= 2e+187) tmp = Float64(sqrt(Float64(t_1 * Float64(A + Float64(A + Float64(-0.5 * Float64((B_m ^ 2.0) / C)))))) / t_2); elseif (t_3 <= Inf) tmp = Float64((Float64(exp(Float64(0.25 * Float64(log(Float64(-8.0 * Float64(C * F))) + Float64(-2.0 * log(Float64(-1.0 / A)))))) * sqrt(sqrt(2.0))) ^ 2.0) / Float64(-fma(B_m, B_m, Float64(A * Float64(C * -4.0))))); else tmp = Float64(-1.0 / Float64(Float64(B_m / sqrt(2.0)) * sqrt(Float64(Float64(1.0 / F) / Float64(A - hypot(A, B_m)))))); end return 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[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(t$95$1 * 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] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(C * N[(A * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e-210], N[(N[(N[Sqrt[N[(F * N[(A + N[(C - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * t$95$4), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / (-t$95$4)), $MachinePrecision], If[LessEqual[t$95$3, 2e+187], N[(N[Sqrt[N[(t$95$1 * N[(A + N[(A + N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[Power[N[(N[Exp[N[(0.25 * N[(N[Log[N[(-8.0 * N[(C * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(-2.0 * N[Log[N[(-1.0 / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Sqrt[2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / (-N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], N[(-1.0 / N[(N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / F), $MachinePrecision] / N[(A - N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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 := \left(4 \cdot A\right) \cdot C\\
t_1 := 2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\\
t_2 := t\_0 - {B\_m}^{2}\\
t_3 := \frac{\sqrt{t\_1 \cdot \left(\left(A + C\right) - \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_2}\\
t_4 := \mathsf{fma}\left(C, A \cdot -4, {B\_m}^{2}\right)\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{-210}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)} \cdot \sqrt{2 \cdot t\_4}}{-t\_4}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+187}:\\
\;\;\;\;\frac{\sqrt{t\_1 \cdot \left(A + \left(A + -0.5 \cdot \frac{{B\_m}^{2}}{C}\right)\right)}}{t\_2}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\frac{{\left(e^{0.25 \cdot \left(\log \left(-8 \cdot \left(C \cdot F\right)\right) + -2 \cdot \log \left(\frac{-1}{A}\right)\right)} \cdot \sqrt{\sqrt{2}}\right)}^{2}}{-\mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{B\_m}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{A - \mathsf{hypot}\left(A, B\_m\right)}}}\\
\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))) < -1e-210Initial program 42.5%
Simplified38.8%
pow1/238.8%
associate-*r*49.0%
unpow-prod-down63.7%
associate-+r-62.7%
hypot-undefine50.1%
unpow250.1%
unpow250.1%
+-commutative50.1%
unpow250.1%
unpow250.1%
hypot-define62.7%
pow1/262.7%
Applied egg-rr62.7%
unpow1/262.7%
sub-neg62.7%
associate-+l+63.7%
sub-neg63.7%
hypot-undefine50.1%
unpow250.1%
unpow250.1%
+-commutative50.1%
unpow250.1%
unpow250.1%
hypot-undefine63.7%
Simplified63.7%
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))) < 1.99999999999999981e187Initial program 11.0%
Taylor expanded in C around inf 25.9%
mul-1-neg25.9%
associate--l+25.9%
Simplified25.9%
if 1.99999999999999981e187 < (/.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 4.7%
Simplified27.0%
add-sqr-sqrt26.8%
pow226.8%
Applied egg-rr26.8%
Taylor expanded in A around -inf 57.3%
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 C around 0 1.6%
mul-1-neg1.6%
+-commutative1.6%
Simplified1.6%
add-cbrt-cube1.6%
pow1/31.6%
Applied egg-rr8.6%
associate-*l/8.6%
pow-pow13.4%
metadata-eval13.4%
pow1/213.4%
sqrt-prod13.4%
distribute-frac-neg213.4%
clear-num13.4%
associate-*r*13.4%
Applied egg-rr13.4%
Taylor expanded in F around 0 1.5%
mul-1-neg1.5%
distribute-rgt-neg-in1.5%
associate-/r*1.5%
unpow21.5%
unpow21.5%
hypot-define12.2%
Simplified12.2%
Final simplification35.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
(let* ((t_0 (* (* 4.0 A) C)))
(if (<= B_m 3.1e-174)
(/
(pow
(*
(exp (* 0.25 (+ (log (* -8.0 (* C F))) (* -2.0 (log (/ -1.0 A))))))
(sqrt (sqrt 2.0)))
2.0)
(- (fma B_m B_m (* A (* C -4.0)))))
(if (<= B_m 2.45e+20)
(/
(sqrt
(*
(* 2.0 (* (- (pow B_m 2.0) t_0) F))
(+ A (+ A (* -0.5 (/ (pow B_m 2.0) C))))))
(- t_0 (pow B_m 2.0)))
(/
-1.0
(* (/ B_m (sqrt 2.0)) (sqrt (/ (/ 1.0 F) (- A (hypot A 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 = (4.0 * A) * C;
double tmp;
if (B_m <= 3.1e-174) {
tmp = pow((exp((0.25 * (log((-8.0 * (C * F))) + (-2.0 * log((-1.0 / A)))))) * sqrt(sqrt(2.0))), 2.0) / -fma(B_m, B_m, (A * (C * -4.0)));
} else if (B_m <= 2.45e+20) {
tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (A + (A + (-0.5 * (pow(B_m, 2.0) / C)))))) / (t_0 - pow(B_m, 2.0));
} else {
tmp = -1.0 / ((B_m / sqrt(2.0)) * sqrt(((1.0 / F) / (A - hypot(A, 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(4.0 * A) * C) tmp = 0.0 if (B_m <= 3.1e-174) tmp = Float64((Float64(exp(Float64(0.25 * Float64(log(Float64(-8.0 * Float64(C * F))) + Float64(-2.0 * log(Float64(-1.0 / A)))))) * sqrt(sqrt(2.0))) ^ 2.0) / Float64(-fma(B_m, B_m, Float64(A * Float64(C * -4.0))))); elseif (B_m <= 2.45e+20) tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(A + Float64(A + Float64(-0.5 * Float64((B_m ^ 2.0) / C)))))) / Float64(t_0 - (B_m ^ 2.0))); else tmp = Float64(-1.0 / Float64(Float64(B_m / sqrt(2.0)) * sqrt(Float64(Float64(1.0 / F) / Float64(A - hypot(A, B_m)))))); end return 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[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[B$95$m, 3.1e-174], N[(N[Power[N[(N[Exp[N[(0.25 * N[(N[Log[N[(-8.0 * N[(C * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(-2.0 * N[Log[N[(-1.0 / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Sqrt[2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / (-N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[B$95$m, 2.45e+20], N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(A + N[(A + N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / F), $MachinePrecision] / N[(A - N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;B\_m \leq 3.1 \cdot 10^{-174}:\\
\;\;\;\;\frac{{\left(e^{0.25 \cdot \left(\log \left(-8 \cdot \left(C \cdot F\right)\right) + -2 \cdot \log \left(\frac{-1}{A}\right)\right)} \cdot \sqrt{\sqrt{2}}\right)}^{2}}{-\mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)}\\
\mathbf{elif}\;B\_m \leq 2.45 \cdot 10^{+20}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(A + \left(A + -0.5 \cdot \frac{{B\_m}^{2}}{C}\right)\right)}}{t\_0 - {B\_m}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{B\_m}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{A - \mathsf{hypot}\left(A, B\_m\right)}}}\\
\end{array}
\end{array}
if B < 3.0999999999999999e-174Initial program 16.4%
Simplified21.8%
add-sqr-sqrt21.7%
pow221.7%
Applied egg-rr20.5%
Taylor expanded in A around -inf 14.4%
if 3.0999999999999999e-174 < B < 2.45e20Initial program 25.5%
Taylor expanded in C around inf 21.3%
mul-1-neg21.3%
associate--l+21.3%
Simplified21.3%
if 2.45e20 < B Initial program 16.2%
Taylor expanded in C around 0 23.4%
mul-1-neg23.4%
+-commutative23.4%
Simplified23.4%
add-cbrt-cube19.0%
pow1/317.9%
Applied egg-rr29.1%
associate-*l/29.1%
pow-pow42.4%
metadata-eval42.4%
pow1/242.4%
sqrt-prod42.6%
distribute-frac-neg242.6%
clear-num42.6%
associate-*r*42.6%
Applied egg-rr42.6%
Taylor expanded in F around 0 23.4%
mul-1-neg23.4%
distribute-rgt-neg-in23.4%
associate-/r*23.4%
unpow223.4%
unpow223.4%
hypot-define41.9%
Simplified41.9%
Final simplification22.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
(let* ((t_0 (* (* 4.0 A) C)))
(if (<= (pow B_m 2.0) 1e+41)
(/
(sqrt
(*
(* 2.0 (* (- (pow B_m 2.0) t_0) F))
(+ A (+ A (* -0.5 (/ (pow B_m 2.0) C))))))
(- t_0 (pow B_m 2.0)))
(/
-1.0
(* (/ B_m (sqrt 2.0)) (sqrt (/ (/ 1.0 F) (- A (hypot A 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 = (4.0 * A) * C;
double tmp;
if (pow(B_m, 2.0) <= 1e+41) {
tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (A + (A + (-0.5 * (pow(B_m, 2.0) / C)))))) / (t_0 - pow(B_m, 2.0));
} else {
tmp = -1.0 / ((B_m / sqrt(2.0)) * sqrt(((1.0 / F) / (A - hypot(A, 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 = (4.0 * A) * C;
double tmp;
if (Math.pow(B_m, 2.0) <= 1e+41) {
tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (A + (A + (-0.5 * (Math.pow(B_m, 2.0) / C)))))) / (t_0 - Math.pow(B_m, 2.0));
} else {
tmp = -1.0 / ((B_m / Math.sqrt(2.0)) * Math.sqrt(((1.0 / F) / (A - Math.hypot(A, 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 = (4.0 * A) * C tmp = 0 if math.pow(B_m, 2.0) <= 1e+41: tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (A + (A + (-0.5 * (math.pow(B_m, 2.0) / C)))))) / (t_0 - math.pow(B_m, 2.0)) else: tmp = -1.0 / ((B_m / math.sqrt(2.0)) * math.sqrt(((1.0 / F) / (A - math.hypot(A, 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(4.0 * A) * C) tmp = 0.0 if ((B_m ^ 2.0) <= 1e+41) tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(A + Float64(A + Float64(-0.5 * Float64((B_m ^ 2.0) / C)))))) / Float64(t_0 - (B_m ^ 2.0))); else tmp = Float64(-1.0 / Float64(Float64(B_m / sqrt(2.0)) * sqrt(Float64(Float64(1.0 / F) / Float64(A - hypot(A, 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 = (4.0 * A) * C;
tmp = 0.0;
if ((B_m ^ 2.0) <= 1e+41)
tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (A + (A + (-0.5 * ((B_m ^ 2.0) / C)))))) / (t_0 - (B_m ^ 2.0));
else
tmp = -1.0 / ((B_m / sqrt(2.0)) * sqrt(((1.0 / F) / (A - hypot(A, 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[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+41], N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(A + N[(A + N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / F), $MachinePrecision] / N[(A - N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;{B\_m}^{2} \leq 10^{+41}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(A + \left(A + -0.5 \cdot \frac{{B\_m}^{2}}{C}\right)\right)}}{t\_0 - {B\_m}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{B\_m}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{A - \mathsf{hypot}\left(A, B\_m\right)}}}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 1.00000000000000001e41Initial program 19.8%
Taylor expanded in C around inf 23.4%
mul-1-neg23.4%
associate--l+23.4%
Simplified23.4%
if 1.00000000000000001e41 < (pow.f64 B #s(literal 2 binary64)) Initial program 15.8%
Taylor expanded in C around 0 12.8%
mul-1-neg12.8%
+-commutative12.8%
Simplified12.8%
add-cbrt-cube10.5%
pow1/39.9%
Applied egg-rr16.3%
associate-*l/16.3%
pow-pow23.4%
metadata-eval23.4%
pow1/223.4%
sqrt-prod23.4%
distribute-frac-neg223.4%
clear-num23.5%
associate-*r*23.5%
Applied egg-rr23.5%
Taylor expanded in F around 0 12.8%
mul-1-neg12.8%
distribute-rgt-neg-in12.8%
associate-/r*12.8%
unpow212.8%
unpow212.8%
hypot-define22.7%
Simplified22.7%
Final simplification23.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 (* (* 4.0 A) C)))
(if (<= (pow B_m 2.0) 1e+41)
(/
(sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_0) F)) (* 2.0 A)))
(- t_0 (pow B_m 2.0)))
(/
-1.0
(* (/ B_m (sqrt 2.0)) (sqrt (/ (/ 1.0 F) (- A (hypot A 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 = (4.0 * A) * C;
double tmp;
if (pow(B_m, 2.0) <= 1e+41) {
tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / (t_0 - pow(B_m, 2.0));
} else {
tmp = -1.0 / ((B_m / sqrt(2.0)) * sqrt(((1.0 / F) / (A - hypot(A, 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 = (4.0 * A) * C;
double tmp;
if (Math.pow(B_m, 2.0) <= 1e+41) {
tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / (t_0 - Math.pow(B_m, 2.0));
} else {
tmp = -1.0 / ((B_m / Math.sqrt(2.0)) * Math.sqrt(((1.0 / F) / (A - Math.hypot(A, 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 = (4.0 * A) * C tmp = 0 if math.pow(B_m, 2.0) <= 1e+41: tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / (t_0 - math.pow(B_m, 2.0)) else: tmp = -1.0 / ((B_m / math.sqrt(2.0)) * math.sqrt(((1.0 / F) / (A - math.hypot(A, 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(4.0 * A) * C) tmp = 0.0 if ((B_m ^ 2.0) <= 1e+41) tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(2.0 * A))) / Float64(t_0 - (B_m ^ 2.0))); else tmp = Float64(-1.0 / Float64(Float64(B_m / sqrt(2.0)) * sqrt(Float64(Float64(1.0 / F) / Float64(A - hypot(A, 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 = (4.0 * A) * C;
tmp = 0.0;
if ((B_m ^ 2.0) <= 1e+41)
tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (2.0 * A))) / (t_0 - (B_m ^ 2.0));
else
tmp = -1.0 / ((B_m / sqrt(2.0)) * sqrt(((1.0 / F) / (A - hypot(A, 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[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+41], N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / F), $MachinePrecision] / N[(A - N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;{B\_m}^{2} \leq 10^{+41}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot A\right)}}{t\_0 - {B\_m}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{B\_m}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{A - \mathsf{hypot}\left(A, B\_m\right)}}}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 1.00000000000000001e41Initial program 19.8%
Taylor expanded in A around -inf 22.1%
if 1.00000000000000001e41 < (pow.f64 B #s(literal 2 binary64)) Initial program 15.8%
Taylor expanded in C around 0 12.8%
mul-1-neg12.8%
+-commutative12.8%
Simplified12.8%
add-cbrt-cube10.5%
pow1/39.9%
Applied egg-rr16.3%
associate-*l/16.3%
pow-pow23.4%
metadata-eval23.4%
pow1/223.4%
sqrt-prod23.4%
distribute-frac-neg223.4%
clear-num23.5%
associate-*r*23.5%
Applied egg-rr23.5%
Taylor expanded in F around 0 12.8%
mul-1-neg12.8%
distribute-rgt-neg-in12.8%
associate-/r*12.8%
unpow212.8%
unpow212.8%
hypot-define22.7%
Simplified22.7%
Final simplification22.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
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
(if (<= (pow B_m 2.0) 1e+41)
(/ (sqrt (* (* 4.0 A) (* F t_0))) (- t_0))
(/
-1.0
(* (/ B_m (sqrt 2.0)) (sqrt (/ (/ 1.0 F) (- A (hypot A 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 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (pow(B_m, 2.0) <= 1e+41) {
tmp = sqrt(((4.0 * A) * (F * t_0))) / -t_0;
} else {
tmp = -1.0 / ((B_m / sqrt(2.0)) * sqrt(((1.0 / F) / (A - hypot(A, 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 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 1e+41) tmp = Float64(sqrt(Float64(Float64(4.0 * A) * Float64(F * t_0))) / Float64(-t_0)); else tmp = Float64(-1.0 / Float64(Float64(B_m / sqrt(2.0)) * sqrt(Float64(Float64(1.0 / F) / Float64(A - hypot(A, B_m)))))); end return 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[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+41], N[(N[Sqrt[N[(N[(4.0 * A), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$0)), $MachinePrecision], N[(-1.0 / N[(N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / F), $MachinePrecision] / N[(A - N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 10^{+41}:\\
\;\;\;\;\frac{\sqrt{\left(4 \cdot A\right) \cdot \left(F \cdot t\_0\right)}}{-t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{B\_m}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{A - \mathsf{hypot}\left(A, B\_m\right)}}}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 1.00000000000000001e41Initial program 19.8%
Simplified27.8%
Taylor expanded in A around -inf 22.1%
if 1.00000000000000001e41 < (pow.f64 B #s(literal 2 binary64)) Initial program 15.8%
Taylor expanded in C around 0 12.8%
mul-1-neg12.8%
+-commutative12.8%
Simplified12.8%
add-cbrt-cube10.5%
pow1/39.9%
Applied egg-rr16.3%
associate-*l/16.3%
pow-pow23.4%
metadata-eval23.4%
pow1/223.4%
sqrt-prod23.4%
distribute-frac-neg223.4%
clear-num23.5%
associate-*r*23.5%
Applied egg-rr23.5%
Taylor expanded in F around 0 12.8%
mul-1-neg12.8%
distribute-rgt-neg-in12.8%
associate-/r*12.8%
unpow212.8%
unpow212.8%
hypot-define22.7%
Simplified22.7%
Final simplification22.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 (<= (pow B_m 2.0) 2e-53)
(/
(sqrt (* (* A -8.0) (* C (* F (+ A A)))))
(- (fma C (* A -4.0) (pow B_m 2.0))))
(/ -1.0 (* (/ B_m (sqrt 2.0)) (sqrt (/ (/ 1.0 F) (- A (hypot A 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 (pow(B_m, 2.0) <= 2e-53) {
tmp = sqrt(((A * -8.0) * (C * (F * (A + A))))) / -fma(C, (A * -4.0), pow(B_m, 2.0));
} else {
tmp = -1.0 / ((B_m / sqrt(2.0)) * sqrt(((1.0 / F) / (A - hypot(A, 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 ^ 2.0) <= 2e-53) tmp = Float64(sqrt(Float64(Float64(A * -8.0) * Float64(C * Float64(F * Float64(A + A))))) / Float64(-fma(C, Float64(A * -4.0), (B_m ^ 2.0)))); else tmp = Float64(-1.0 / Float64(Float64(B_m / sqrt(2.0)) * sqrt(Float64(Float64(1.0 / F) / Float64(A - hypot(A, B_m)))))); end return 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[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-53], N[(N[Sqrt[N[(N[(A * -8.0), $MachinePrecision] * N[(C * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-N[(C * N[(A * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], N[(-1.0 / N[(N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / F), $MachinePrecision] / N[(A - N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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}^{2} \leq 2 \cdot 10^{-53}:\\
\;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(C \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{-\mathsf{fma}\left(C, A \cdot -4, {B\_m}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{B\_m}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{A - \mathsf{hypot}\left(A, B\_m\right)}}}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 2.00000000000000006e-53Initial program 19.6%
Simplified20.5%
Taylor expanded in C around inf 21.9%
associate-*r*21.9%
mul-1-neg21.9%
Simplified21.9%
if 2.00000000000000006e-53 < (pow.f64 B #s(literal 2 binary64)) Initial program 16.4%
Taylor expanded in C around 0 12.9%
mul-1-neg12.9%
+-commutative12.9%
Simplified12.9%
add-cbrt-cube10.3%
pow1/39.8%
Applied egg-rr15.5%
associate-*l/15.5%
pow-pow22.4%
metadata-eval22.4%
pow1/222.3%
sqrt-prod22.4%
distribute-frac-neg222.4%
clear-num22.4%
associate-*r*22.4%
Applied egg-rr22.4%
Taylor expanded in F around 0 12.4%
mul-1-neg12.4%
distribute-rgt-neg-in12.4%
associate-/r*12.4%
unpow212.4%
unpow212.4%
hypot-define21.6%
Simplified21.6%
Final simplification21.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 (/ -1.0 (* B_m (pow (* (* 2.0 F) (- A (hypot B_m A))) -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 -1.0 / (B_m * pow(((2.0 * F) * (A - hypot(B_m, A))), -0.5));
}
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 -1.0 / (B_m * Math.pow(((2.0 * F) * (A - Math.hypot(B_m, A))), -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 -1.0 / (B_m * math.pow(((2.0 * F) * (A - math.hypot(B_m, A))), -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(-1.0 / Float64(B_m * (Float64(Float64(2.0 * F) * Float64(A - hypot(B_m, A))) ^ -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 = -1.0 / (B_m * (((2.0 * F) * (A - hypot(B_m, A))) ^ -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[(-1.0 / N[(B$95$m * N[Power[N[(N[(2.0 * F), $MachinePrecision] * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\frac{-1}{B\_m \cdot {\left(\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)\right)}^{-0.5}}
\end{array}
Initial program 17.8%
Taylor expanded in C around 0 9.1%
mul-1-neg9.1%
+-commutative9.1%
Simplified9.1%
add-cbrt-cube7.3%
pow1/36.9%
Applied egg-rr10.5%
associate-*l/10.5%
pow-pow14.7%
metadata-eval14.7%
pow1/214.6%
sqrt-prod14.7%
distribute-frac-neg214.7%
clear-num14.7%
associate-*r*14.7%
Applied egg-rr14.7%
add-sqr-sqrt1.2%
sqrt-unprod2.2%
sqr-neg2.2%
sqrt-prod1.3%
add-sqr-sqrt15.4%
remove-double-neg15.4%
distribute-frac-neg15.4%
div-inv15.3%
distribute-rgt-neg-in15.3%
add-sqr-sqrt14.0%
sqrt-unprod15.8%
sqr-neg15.8%
sqrt-prod13.4%
add-sqr-sqrt14.7%
pow1/214.7%
pow-flip14.8%
associate-*l*14.7%
metadata-eval14.7%
Applied egg-rr14.7%
associate-*r*14.8%
*-commutative14.8%
Simplified14.8%
Final simplification14.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 (/ -1.0 (/ B_m (sqrt (* (* 2.0 F) (- A (hypot B_m A)))))))
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 -1.0 / (B_m / sqrt(((2.0 * F) * (A - hypot(B_m, A)))));
}
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 -1.0 / (B_m / Math.sqrt(((2.0 * F) * (A - Math.hypot(B_m, A)))));
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): return -1.0 / (B_m / math.sqrt(((2.0 * F) * (A - math.hypot(B_m, A)))))
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return Float64(-1.0 / Float64(B_m / sqrt(Float64(Float64(2.0 * F) * Float64(A - hypot(B_m, A)))))) 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 = -1.0 / (B_m / sqrt(((2.0 * F) * (A - hypot(B_m, A)))));
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[(-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]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\frac{-1}{\frac{B\_m}{\sqrt{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)}}}
\end{array}
Initial program 17.8%
Taylor expanded in C around 0 9.1%
mul-1-neg9.1%
+-commutative9.1%
Simplified9.1%
add-cbrt-cube7.3%
pow1/36.9%
Applied egg-rr10.5%
associate-*l/10.5%
pow-pow14.7%
metadata-eval14.7%
pow1/214.6%
sqrt-prod14.7%
distribute-frac-neg214.7%
clear-num14.7%
associate-*r*14.7%
Applied egg-rr14.7%
Final simplification14.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 (* (sqrt (* (* 2.0 F) (- A (hypot B_m A)))) (/ -1.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 sqrt(((2.0 * F) * (A - hypot(B_m, A)))) * (-1.0 / B_m);
}
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 Math.sqrt(((2.0 * F) * (A - Math.hypot(B_m, A)))) * (-1.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 math.sqrt(((2.0 * F) * (A - math.hypot(B_m, A)))) * (-1.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(sqrt(Float64(Float64(2.0 * F) * Float64(A - hypot(B_m, A)))) * Float64(-1.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 = sqrt(((2.0 * F) * (A - hypot(B_m, A)))) * (-1.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[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.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])\\
\\
\sqrt{\left(2 \cdot F\right) \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)} \cdot \frac{-1}{B\_m}
\end{array}
Initial program 17.8%
Taylor expanded in C around 0 9.1%
mul-1-neg9.1%
+-commutative9.1%
unpow29.1%
unpow29.1%
hypot-define14.6%
Simplified14.6%
neg-sub014.6%
associate-*l/14.6%
pow1/214.6%
pow1/214.7%
hypot-undefine9.2%
unpow29.2%
unpow29.2%
pow-prod-down9.2%
unpow29.2%
unpow29.2%
hypot-undefine14.7%
Applied egg-rr14.7%
neg-sub014.7%
distribute-neg-frac214.7%
unpow1/214.7%
Simplified14.7%
clear-num14.7%
inv-pow14.7%
associate-*r*14.7%
Applied egg-rr14.7%
unpow-114.7%
associate-/r/14.7%
Simplified14.7%
Final simplification14.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 (/ (sqrt (* 2.0 (* F (- A (hypot B_m A))))) (- 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 sqrt((2.0 * (F * (A - hypot(B_m, A))))) / -B_m;
}
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 Math.sqrt((2.0 * (F * (A - Math.hypot(B_m, A))))) / -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 math.sqrt((2.0 * (F * (A - math.hypot(B_m, A))))) / -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(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(B_m, A))))) / Float64(-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 = sqrt((2.0 * (F * (A - hypot(B_m, A))))) / -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[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)\right)}}{-B\_m}
\end{array}
Initial program 17.8%
Taylor expanded in C around 0 9.1%
mul-1-neg9.1%
+-commutative9.1%
unpow29.1%
unpow29.1%
hypot-define14.6%
Simplified14.6%
neg-sub014.6%
associate-*l/14.6%
pow1/214.6%
pow1/214.7%
hypot-undefine9.2%
unpow29.2%
unpow29.2%
pow-prod-down9.2%
unpow29.2%
unpow29.2%
hypot-undefine14.7%
Applied egg-rr14.7%
neg-sub014.7%
distribute-neg-frac214.7%
unpow1/214.7%
Simplified14.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 (/ -1.0 (/ B_m (sqrt (* B_m (+ (* F -2.0) (* 2.0 (/ (* A 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 -1.0 / (B_m / sqrt((B_m * ((F * -2.0) + (2.0 * ((A * 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 = (-1.0d0) / (b_m / sqrt((b_m * ((f * (-2.0d0)) + (2.0d0 * ((a * 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 -1.0 / (B_m / Math.sqrt((B_m * ((F * -2.0) + (2.0 * ((A * 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 -1.0 / (B_m / math.sqrt((B_m * ((F * -2.0) + (2.0 * ((A * 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(-1.0 / Float64(B_m / sqrt(Float64(B_m * Float64(Float64(F * -2.0) + Float64(2.0 * Float64(Float64(A * 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 = -1.0 / (B_m / sqrt((B_m * ((F * -2.0) + (2.0 * ((A * 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[(-1.0 / N[(B$95$m / N[Sqrt[N[(B$95$m * N[(N[(F * -2.0), $MachinePrecision] + N[(2.0 * N[(N[(A * F), $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\frac{-1}{\frac{B\_m}{\sqrt{B\_m \cdot \left(F \cdot -2 + 2 \cdot \frac{A \cdot F}{B\_m}\right)}}}
\end{array}
Initial program 17.8%
Taylor expanded in C around 0 9.1%
mul-1-neg9.1%
+-commutative9.1%
Simplified9.1%
add-cbrt-cube7.3%
pow1/36.9%
Applied egg-rr10.5%
associate-*l/10.5%
pow-pow14.7%
metadata-eval14.7%
pow1/214.6%
sqrt-prod14.7%
distribute-frac-neg214.7%
clear-num14.7%
associate-*r*14.7%
Applied egg-rr14.7%
Taylor expanded in B around inf 12.7%
Final simplification12.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 (/ -1.0 (/ B_m (sqrt (+ (* -2.0 (* B_m F)) (* 2.0 (* A F)))))))
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 -1.0 / (B_m / sqrt(((-2.0 * (B_m * F)) + (2.0 * (A * F)))));
}
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 = (-1.0d0) / (b_m / sqrt((((-2.0d0) * (b_m * f)) + (2.0d0 * (a * f)))))
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 -1.0 / (B_m / Math.sqrt(((-2.0 * (B_m * F)) + (2.0 * (A * F)))));
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): return -1.0 / (B_m / math.sqrt(((-2.0 * (B_m * F)) + (2.0 * (A * F)))))
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return Float64(-1.0 / Float64(B_m / sqrt(Float64(Float64(-2.0 * Float64(B_m * F)) + Float64(2.0 * Float64(A * F)))))) 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 = -1.0 / (B_m / sqrt(((-2.0 * (B_m * F)) + (2.0 * (A * F)))));
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[(-1.0 / N[(B$95$m / N[Sqrt[N[(N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(A * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\frac{-1}{\frac{B\_m}{\sqrt{-2 \cdot \left(B\_m \cdot F\right) + 2 \cdot \left(A \cdot F\right)}}}
\end{array}
Initial program 17.8%
Taylor expanded in C around 0 9.1%
mul-1-neg9.1%
+-commutative9.1%
Simplified9.1%
add-cbrt-cube7.3%
pow1/36.9%
Applied egg-rr10.5%
associate-*l/10.5%
pow-pow14.7%
metadata-eval14.7%
pow1/214.6%
sqrt-prod14.7%
distribute-frac-neg214.7%
clear-num14.7%
associate-*r*14.7%
Applied egg-rr14.7%
Taylor expanded in A around 0 12.6%
Final simplification12.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 (/ (sqrt (+ (* -2.0 (* B_m F)) (* 2.0 (* A 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 sqrt(((-2.0 * (B_m * F)) + (2.0 * (A * 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 = sqrt((((-2.0d0) * (b_m * f)) + (2.0d0 * (a * 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 Math.sqrt(((-2.0 * (B_m * F)) + (2.0 * (A * 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 math.sqrt(((-2.0 * (B_m * F)) + (2.0 * (A * 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(sqrt(Float64(Float64(-2.0 * Float64(B_m * F)) + Float64(2.0 * Float64(A * F)))) / Float64(-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 = sqrt(((-2.0 * (B_m * F)) + (2.0 * (A * 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[(N[Sqrt[N[(N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(A * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\frac{\sqrt{-2 \cdot \left(B\_m \cdot F\right) + 2 \cdot \left(A \cdot F\right)}}{-B\_m}
\end{array}
Initial program 17.8%
Taylor expanded in C around 0 9.1%
mul-1-neg9.1%
+-commutative9.1%
unpow29.1%
unpow29.1%
hypot-define14.6%
Simplified14.6%
neg-sub014.6%
associate-*l/14.6%
pow1/214.6%
pow1/214.7%
hypot-undefine9.2%
unpow29.2%
unpow29.2%
pow-prod-down9.2%
unpow29.2%
unpow29.2%
hypot-undefine14.7%
Applied egg-rr14.7%
neg-sub014.7%
distribute-neg-frac214.7%
unpow1/214.7%
Simplified14.7%
Taylor expanded in A around 0 12.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 (/ (sqrt (* F (* B_m -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 sqrt((F * (B_m * -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 = sqrt((f * (b_m * (-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 Math.sqrt((F * (B_m * -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 math.sqrt((F * (B_m * -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(sqrt(Float64(F * Float64(B_m * -2.0))) / Float64(-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 = sqrt((F * (B_m * -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[(N[Sqrt[N[(F * N[(B$95$m * -2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\frac{\sqrt{F \cdot \left(B\_m \cdot -2\right)}}{-B\_m}
\end{array}
Initial program 17.8%
Taylor expanded in C around 0 9.1%
mul-1-neg9.1%
+-commutative9.1%
unpow29.1%
unpow29.1%
hypot-define14.6%
Simplified14.6%
neg-sub014.6%
associate-*l/14.6%
pow1/214.6%
pow1/214.7%
hypot-undefine9.2%
unpow29.2%
unpow29.2%
pow-prod-down9.2%
unpow29.2%
unpow29.2%
hypot-undefine14.7%
Applied egg-rr14.7%
neg-sub014.7%
distribute-neg-frac214.7%
unpow1/214.7%
Simplified14.7%
Taylor expanded in A around 0 13.4%
associate-*r*13.4%
Simplified13.4%
Final simplification13.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 (/ (sqrt (* -2.0 (* B_m 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 sqrt((-2.0 * (B_m * 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 = sqrt(((-2.0d0) * (b_m * 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 Math.sqrt((-2.0 * (B_m * 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 math.sqrt((-2.0 * (B_m * 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(sqrt(Float64(-2.0 * Float64(B_m * F))) / Float64(-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 = sqrt((-2.0 * (B_m * 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[(N[Sqrt[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\frac{\sqrt{-2 \cdot \left(B\_m \cdot F\right)}}{-B\_m}
\end{array}
Initial program 17.8%
Taylor expanded in C around 0 9.1%
mul-1-neg9.1%
+-commutative9.1%
unpow29.1%
unpow29.1%
hypot-define14.6%
Simplified14.6%
neg-sub014.6%
associate-*l/14.6%
pow1/214.6%
pow1/214.7%
hypot-undefine9.2%
unpow29.2%
unpow29.2%
pow-prod-down9.2%
unpow29.2%
unpow29.2%
hypot-undefine14.7%
Applied egg-rr14.7%
neg-sub014.7%
distribute-neg-frac214.7%
unpow1/214.7%
Simplified14.7%
Taylor expanded in A around 0 13.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 (/ 1.0 (sqrt (/ B_m (* F -2.0)))))
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 1.0 / sqrt((B_m / (F * -2.0)));
}
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 = 1.0d0 / sqrt((b_m / (f * (-2.0d0))))
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 1.0 / Math.sqrt((B_m / (F * -2.0)));
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): return 1.0 / math.sqrt((B_m / (F * -2.0)))
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return Float64(1.0 / sqrt(Float64(B_m / Float64(F * -2.0)))) 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 = 1.0 / sqrt((B_m / (F * -2.0)));
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[(1.0 / N[Sqrt[N[(B$95$m / N[(F * -2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\frac{1}{\sqrt{\frac{B\_m}{F \cdot -2}}}
\end{array}
Initial program 17.8%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt1.8%
Simplified1.8%
Taylor expanded in F around 0 1.8%
*-commutative1.8%
pow1/21.8%
metadata-eval1.8%
pow1/21.9%
metadata-eval1.9%
pow-prod-down1.9%
metadata-eval1.9%
Applied egg-rr1.9%
unpow1/21.8%
associate-*r/1.8%
Simplified1.8%
clear-num1.9%
sqrt-div1.6%
metadata-eval1.6%
frac-2neg1.6%
add-sqr-sqrt1.2%
sqrt-unprod2.6%
sqr-neg2.6%
sqrt-prod1.3%
add-sqr-sqrt1.9%
*-commutative1.9%
distribute-rgt-neg-in1.9%
metadata-eval1.9%
Applied egg-rr1.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 (sqrt (/ 1.0 (/ (/ B_m F) -2.0))))
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 sqrt((1.0 / ((B_m / F) / -2.0)));
}
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 = sqrt((1.0d0 / ((b_m / f) / (-2.0d0))))
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 Math.sqrt((1.0 / ((B_m / F) / -2.0)));
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): return math.sqrt((1.0 / ((B_m / F) / -2.0)))
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return sqrt(Float64(1.0 / Float64(Float64(B_m / F) / -2.0))) 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 = sqrt((1.0 / ((B_m / F) / -2.0)));
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[Sqrt[N[(1.0 / N[(N[(B$95$m / F), $MachinePrecision] / -2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\sqrt{\frac{1}{\frac{\frac{B\_m}{F}}{-2}}}
\end{array}
Initial program 17.8%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt1.8%
Simplified1.8%
Taylor expanded in F around 0 1.8%
*-commutative1.8%
pow1/21.8%
metadata-eval1.8%
pow1/21.9%
metadata-eval1.9%
pow-prod-down1.9%
metadata-eval1.9%
Applied egg-rr1.9%
unpow1/21.8%
associate-*r/1.8%
Simplified1.8%
clear-num1.9%
inv-pow1.9%
frac-2neg1.9%
add-sqr-sqrt1.2%
sqrt-unprod2.5%
sqr-neg2.5%
sqrt-prod1.3%
add-sqr-sqrt2.1%
*-commutative2.1%
distribute-rgt-neg-in2.1%
metadata-eval2.1%
Applied egg-rr2.1%
unpow-12.1%
associate-/r*2.1%
Simplified2.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 (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 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 = 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 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 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 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 = 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[Sqrt[N[(F * N[(-2.0 / 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])\\
\\
\sqrt{F \cdot \frac{-2}{B\_m}}
\end{array}
Initial program 17.8%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt1.8%
Simplified1.8%
Taylor expanded in F around 0 1.8%
*-commutative1.8%
pow1/21.8%
metadata-eval1.8%
pow1/21.9%
metadata-eval1.9%
pow-prod-down1.9%
metadata-eval1.9%
Applied egg-rr1.9%
unpow1/21.8%
associate-*r/1.8%
Simplified1.8%
associate-/l*1.8%
sqrt-prod1.8%
pow11.8%
metadata-eval1.8%
sqrt-pow13.2%
*-commutative3.2%
*-un-lft-identity3.2%
*-commutative3.2%
sqrt-pow11.8%
metadata-eval1.8%
pow11.8%
sqrt-prod1.8%
associate-/l*1.8%
frac-2neg1.8%
*-commutative1.8%
distribute-rgt-neg-in1.8%
metadata-eval1.8%
add-sqr-sqrt1.2%
sqrt-unprod2.5%
sqr-neg2.5%
sqrt-prod1.3%
add-sqr-sqrt2.1%
Applied egg-rr2.1%
*-lft-identity2.1%
associate-/l*2.1%
Simplified2.1%
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))))