
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= l 3.2e-256)
(*
(- 1.0 (/ (* 0.125 (* h (pow (/ D (/ d M)) 2.0))) l))
(* (sqrt (/ d h)) (sqrt (/ d l))))
(*
(/ (sqrt d) (sqrt h))
(*
(/ (sqrt d) (sqrt l))
(- 1.0 (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3.2e-256) {
tmp = (1.0 - ((0.125 * (h * pow((D / (d / M)), 2.0))) / l)) * (sqrt((d / h)) * sqrt((d / l)));
} else {
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * (1.0 - (0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 3.2d-256) then
tmp = (1.0d0 - ((0.125d0 * (h * ((d_1 / (d / m)) ** 2.0d0))) / l)) * (sqrt((d / h)) * sqrt((d / l)))
else
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * (1.0d0 - (0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l)))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3.2e-256) {
tmp = (1.0 - ((0.125 * (h * Math.pow((D / (d / M)), 2.0))) / l)) * (Math.sqrt((d / h)) * Math.sqrt((d / l)));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * ((Math.sqrt(d) / Math.sqrt(l)) * (1.0 - (0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if l <= 3.2e-256: tmp = (1.0 - ((0.125 * (h * math.pow((D / (d / M)), 2.0))) / l)) * (math.sqrt((d / h)) * math.sqrt((d / l))) else: tmp = (math.sqrt(d) / math.sqrt(h)) * ((math.sqrt(d) / math.sqrt(l)) * (1.0 - (0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= 3.2e-256) tmp = Float64(Float64(1.0 - Float64(Float64(0.125 * Float64(h * (Float64(D / Float64(d / M)) ^ 2.0))) / l)) * Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(Float64(sqrt(d) / sqrt(l)) * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l)))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= 3.2e-256)
tmp = (1.0 - ((0.125 * (h * ((D / (d / M)) ^ 2.0))) / l)) * (sqrt((d / h)) * sqrt((d / l)));
else
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * (1.0 - (0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l)))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, 3.2e-256], N[(N[(1.0 - N[(N[(0.125 * N[(h * N[Power[N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.2 \cdot 10^{-256}:\\
\;\;\;\;\left(1 - \frac{0.125 \cdot \left(h \cdot {\left(\frac{D}{\frac{d}{M}}\right)}^{2}\right)}{\ell}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\
\end{array}
\end{array}
if l < 3.1999999999999999e-256Initial program 67.0%
metadata-eval67.0%
unpow1/267.0%
metadata-eval67.0%
unpow1/267.0%
*-commutative67.0%
associate-*l*67.0%
times-frac68.3%
metadata-eval68.3%
Simplified68.3%
associate-*r*68.3%
frac-times67.0%
*-commutative67.0%
metadata-eval67.0%
associate-*r/71.8%
metadata-eval71.8%
*-commutative71.8%
frac-times72.4%
div-inv72.4%
metadata-eval72.4%
Applied egg-rr72.4%
metadata-eval72.4%
div-inv72.4%
frac-times71.8%
*-commutative71.8%
Applied egg-rr71.8%
times-frac72.4%
Simplified72.4%
Taylor expanded in M around 0 47.7%
associate-*r*47.0%
unpow247.0%
times-frac52.6%
associate-*r/56.6%
associate-*l/56.5%
*-commutative56.5%
unpow256.5%
unpow256.5%
unswap-sqr69.6%
associate-*l/71.8%
associate-*l/71.8%
associate-*r/71.8%
associate-*l/72.4%
unpow272.4%
*-commutative72.4%
*-commutative72.4%
associate-*r/71.8%
associate-/l*72.4%
Simplified72.4%
if 3.1999999999999999e-256 < l Initial program 59.4%
associate-*l*59.4%
metadata-eval59.4%
unpow1/259.4%
metadata-eval59.4%
unpow1/259.4%
associate-*l*59.4%
metadata-eval59.4%
times-frac59.3%
Simplified59.3%
sqrt-div71.6%
Applied egg-rr71.6%
sqrt-div76.6%
Applied egg-rr76.6%
Final simplification74.1%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= d 2e-309)
(*
(- 1.0 (/ (* 0.125 (* h (pow (/ D (/ d M)) 2.0))) l))
(* (sqrt (/ d h)) t_0))
(if (<= d 2.4e-235)
(*
(/ (sqrt d) (sqrt h))
(*
(/ (sqrt d) (sqrt l))
(* (* (/ (* D D) l) (* (/ (* M M) d) (/ h d))) -0.125)))
(/
(*
(sqrt d)
(* t_0 (+ 1.0 (* -0.5 (* (/ h l) (pow (* M (* 0.5 (/ D d))) 2.0))))))
(sqrt h))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (d <= 2e-309) {
tmp = (1.0 - ((0.125 * (h * pow((D / (d / M)), 2.0))) / l)) * (sqrt((d / h)) * t_0);
} else if (d <= 2.4e-235) {
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * ((((D * D) / l) * (((M * M) / d) * (h / d))) * -0.125));
} else {
tmp = (sqrt(d) * (t_0 * (1.0 + (-0.5 * ((h / l) * pow((M * (0.5 * (D / d))), 2.0)))))) / sqrt(h);
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((d / l))
if (d <= 2d-309) then
tmp = (1.0d0 - ((0.125d0 * (h * ((d_1 / (d / m)) ** 2.0d0))) / l)) * (sqrt((d / h)) * t_0)
else if (d <= 2.4d-235) then
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * ((((d_1 * d_1) / l) * (((m * m) / d) * (h / d))) * (-0.125d0)))
else
tmp = (sqrt(d) * (t_0 * (1.0d0 + ((-0.5d0) * ((h / l) * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0)))))) / sqrt(h)
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double tmp;
if (d <= 2e-309) {
tmp = (1.0 - ((0.125 * (h * Math.pow((D / (d / M)), 2.0))) / l)) * (Math.sqrt((d / h)) * t_0);
} else if (d <= 2.4e-235) {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * ((Math.sqrt(d) / Math.sqrt(l)) * ((((D * D) / l) * (((M * M) / d) * (h / d))) * -0.125));
} else {
tmp = (Math.sqrt(d) * (t_0 * (1.0 + (-0.5 * ((h / l) * Math.pow((M * (0.5 * (D / d))), 2.0)))))) / Math.sqrt(h);
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if d <= 2e-309: tmp = (1.0 - ((0.125 * (h * math.pow((D / (d / M)), 2.0))) / l)) * (math.sqrt((d / h)) * t_0) elif d <= 2.4e-235: tmp = (math.sqrt(d) / math.sqrt(h)) * ((math.sqrt(d) / math.sqrt(l)) * ((((D * D) / l) * (((M * M) / d) * (h / d))) * -0.125)) else: tmp = (math.sqrt(d) * (t_0 * (1.0 + (-0.5 * ((h / l) * math.pow((M * (0.5 * (D / d))), 2.0)))))) / math.sqrt(h) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (d <= 2e-309) tmp = Float64(Float64(1.0 - Float64(Float64(0.125 * Float64(h * (Float64(D / Float64(d / M)) ^ 2.0))) / l)) * Float64(sqrt(Float64(d / h)) * t_0)); elseif (d <= 2.4e-235) tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(Float64(sqrt(d) / sqrt(l)) * Float64(Float64(Float64(Float64(D * D) / l) * Float64(Float64(Float64(M * M) / d) * Float64(h / d))) * -0.125))); else tmp = Float64(Float64(sqrt(d) * Float64(t_0 * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0)))))) / sqrt(h)); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / l));
tmp = 0.0;
if (d <= 2e-309)
tmp = (1.0 - ((0.125 * (h * ((D / (d / M)) ^ 2.0))) / l)) * (sqrt((d / h)) * t_0);
elseif (d <= 2.4e-235)
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * ((((D * D) / l) * (((M * M) / d) * (h / d))) * -0.125));
else
tmp = (sqrt(d) * (t_0 * (1.0 + (-0.5 * ((h / l) * ((M * (0.5 * (D / d))) ^ 2.0)))))) / sqrt(h);
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, 2e-309], N[(N[(1.0 - N[(N[(0.125 * N[(h * N[Power[N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.4e-235], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(D * D), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] * N[(t$95$0 * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;d \leq 2 \cdot 10^{-309}:\\
\;\;\;\;\left(1 - \frac{0.125 \cdot \left(h \cdot {\left(\frac{D}{\frac{d}{M}}\right)}^{2}\right)}{\ell}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot t_0\right)\\
\mathbf{elif}\;d \leq 2.4 \cdot 10^{-235}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\left(\frac{D \cdot D}{\ell} \cdot \left(\frac{M \cdot M}{d} \cdot \frac{h}{d}\right)\right) \cdot -0.125\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d} \cdot \left(t_0 \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)\right)\right)}{\sqrt{h}}\\
\end{array}
\end{array}
if d < 1.9999999999999988e-309Initial program 66.6%
metadata-eval66.6%
unpow1/266.6%
metadata-eval66.6%
unpow1/266.6%
*-commutative66.6%
associate-*l*66.6%
times-frac67.9%
metadata-eval67.9%
Simplified67.9%
associate-*r*67.9%
frac-times66.6%
*-commutative66.6%
metadata-eval66.6%
associate-*r/71.1%
metadata-eval71.1%
*-commutative71.1%
frac-times71.7%
div-inv71.7%
metadata-eval71.7%
Applied egg-rr71.7%
metadata-eval71.7%
div-inv71.7%
frac-times71.1%
*-commutative71.1%
Applied egg-rr71.1%
times-frac71.7%
Simplified71.7%
Taylor expanded in M around 0 47.6%
associate-*r*46.9%
unpow246.9%
times-frac51.6%
associate-*r/56.0%
associate-*l/56.0%
*-commutative56.0%
unpow256.0%
unpow256.0%
unswap-sqr68.9%
associate-*l/71.1%
associate-*l/71.0%
associate-*r/71.0%
associate-*l/71.7%
unpow271.7%
*-commutative71.7%
*-commutative71.7%
associate-*r/71.1%
associate-/l*71.7%
Simplified71.7%
if 1.9999999999999988e-309 < d < 2.40000000000000011e-235Initial program 15.2%
associate-*l*15.2%
metadata-eval15.2%
unpow1/215.2%
metadata-eval15.2%
unpow1/215.2%
sub-neg15.2%
+-commutative15.2%
*-commutative15.2%
distribute-rgt-neg-in15.2%
fma-def15.2%
Simplified15.2%
Taylor expanded in h around inf 5.5%
*-commutative5.5%
times-frac5.7%
unpow25.7%
*-commutative5.7%
unpow25.7%
times-frac10.6%
unpow210.6%
Simplified10.6%
sqrt-div52.4%
Applied egg-rr25.9%
sqrt-div31.1%
Applied egg-rr46.6%
if 2.40000000000000011e-235 < d Initial program 70.1%
associate-*l*70.1%
metadata-eval70.1%
unpow1/270.1%
metadata-eval70.1%
unpow1/270.1%
associate-*l*70.1%
metadata-eval70.1%
times-frac70.1%
Simplified70.1%
sqrt-div80.9%
Applied egg-rr80.9%
associate-*l/81.0%
cancel-sign-sub-inv81.0%
metadata-eval81.0%
div-inv81.0%
metadata-eval81.0%
associate-*l*81.0%
Applied egg-rr81.0%
Final simplification73.3%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= l 3.2e-256)
(*
(- 1.0 (/ (* 0.125 (* h (pow (/ D (/ d M)) 2.0))) l))
(* (sqrt (/ d h)) t_0))
(*
(/ (sqrt d) (sqrt h))
(* t_0 (- 1.0 (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l)))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (l <= 3.2e-256) {
tmp = (1.0 - ((0.125 * (h * pow((D / (d / M)), 2.0))) / l)) * (sqrt((d / h)) * t_0);
} else {
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0 - (0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((d / l))
if (l <= 3.2d-256) then
tmp = (1.0d0 - ((0.125d0 * (h * ((d_1 / (d / m)) ** 2.0d0))) / l)) * (sqrt((d / h)) * t_0)
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0d0 - (0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l)))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double tmp;
if (l <= 3.2e-256) {
tmp = (1.0 - ((0.125 * (h * Math.pow((D / (d / M)), 2.0))) / l)) * (Math.sqrt((d / h)) * t_0);
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * (t_0 * (1.0 - (0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if l <= 3.2e-256: tmp = (1.0 - ((0.125 * (h * math.pow((D / (d / M)), 2.0))) / l)) * (math.sqrt((d / h)) * t_0) else: tmp = (math.sqrt(d) / math.sqrt(h)) * (t_0 * (1.0 - (0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= 3.2e-256) tmp = Float64(Float64(1.0 - Float64(Float64(0.125 * Float64(h * (Float64(D / Float64(d / M)) ^ 2.0))) / l)) * Float64(sqrt(Float64(d / h)) * t_0)); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l)))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / l));
tmp = 0.0;
if (l <= 3.2e-256)
tmp = (1.0 - ((0.125 * (h * ((D / (d / M)) ^ 2.0))) / l)) * (sqrt((d / h)) * t_0);
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0 - (0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l)))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, 3.2e-256], N[(N[(1.0 - N[(N[(0.125 * N[(h * N[Power[N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq 3.2 \cdot 10^{-256}:\\
\;\;\;\;\left(1 - \frac{0.125 \cdot \left(h \cdot {\left(\frac{D}{\frac{d}{M}}\right)}^{2}\right)}{\ell}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\
\end{array}
\end{array}
if l < 3.1999999999999999e-256Initial program 67.0%
metadata-eval67.0%
unpow1/267.0%
metadata-eval67.0%
unpow1/267.0%
*-commutative67.0%
associate-*l*67.0%
times-frac68.3%
metadata-eval68.3%
Simplified68.3%
associate-*r*68.3%
frac-times67.0%
*-commutative67.0%
metadata-eval67.0%
associate-*r/71.8%
metadata-eval71.8%
*-commutative71.8%
frac-times72.4%
div-inv72.4%
metadata-eval72.4%
Applied egg-rr72.4%
metadata-eval72.4%
div-inv72.4%
frac-times71.8%
*-commutative71.8%
Applied egg-rr71.8%
times-frac72.4%
Simplified72.4%
Taylor expanded in M around 0 47.7%
associate-*r*47.0%
unpow247.0%
times-frac52.6%
associate-*r/56.6%
associate-*l/56.5%
*-commutative56.5%
unpow256.5%
unpow256.5%
unswap-sqr69.6%
associate-*l/71.8%
associate-*l/71.8%
associate-*r/71.8%
associate-*l/72.4%
unpow272.4%
*-commutative72.4%
*-commutative72.4%
associate-*r/71.8%
associate-/l*72.4%
Simplified72.4%
if 3.1999999999999999e-256 < l Initial program 59.4%
associate-*l*59.4%
metadata-eval59.4%
unpow1/259.4%
metadata-eval59.4%
unpow1/259.4%
associate-*l*59.4%
metadata-eval59.4%
times-frac59.3%
Simplified59.3%
sqrt-div71.6%
Applied egg-rr71.6%
Final simplification72.1%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= l 3.2e-256)
(*
(- 1.0 (/ (* 0.125 (* h (pow (/ D (/ d M)) 2.0))) l))
(* (sqrt (/ d h)) t_0))
(/
(*
(sqrt d)
(* t_0 (+ 1.0 (* -0.5 (* (/ h l) (pow (* M (* 0.5 (/ D d))) 2.0))))))
(sqrt h)))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (l <= 3.2e-256) {
tmp = (1.0 - ((0.125 * (h * pow((D / (d / M)), 2.0))) / l)) * (sqrt((d / h)) * t_0);
} else {
tmp = (sqrt(d) * (t_0 * (1.0 + (-0.5 * ((h / l) * pow((M * (0.5 * (D / d))), 2.0)))))) / sqrt(h);
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((d / l))
if (l <= 3.2d-256) then
tmp = (1.0d0 - ((0.125d0 * (h * ((d_1 / (d / m)) ** 2.0d0))) / l)) * (sqrt((d / h)) * t_0)
else
tmp = (sqrt(d) * (t_0 * (1.0d0 + ((-0.5d0) * ((h / l) * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0)))))) / sqrt(h)
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double tmp;
if (l <= 3.2e-256) {
tmp = (1.0 - ((0.125 * (h * Math.pow((D / (d / M)), 2.0))) / l)) * (Math.sqrt((d / h)) * t_0);
} else {
tmp = (Math.sqrt(d) * (t_0 * (1.0 + (-0.5 * ((h / l) * Math.pow((M * (0.5 * (D / d))), 2.0)))))) / Math.sqrt(h);
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if l <= 3.2e-256: tmp = (1.0 - ((0.125 * (h * math.pow((D / (d / M)), 2.0))) / l)) * (math.sqrt((d / h)) * t_0) else: tmp = (math.sqrt(d) * (t_0 * (1.0 + (-0.5 * ((h / l) * math.pow((M * (0.5 * (D / d))), 2.0)))))) / math.sqrt(h) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= 3.2e-256) tmp = Float64(Float64(1.0 - Float64(Float64(0.125 * Float64(h * (Float64(D / Float64(d / M)) ^ 2.0))) / l)) * Float64(sqrt(Float64(d / h)) * t_0)); else tmp = Float64(Float64(sqrt(d) * Float64(t_0 * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0)))))) / sqrt(h)); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / l));
tmp = 0.0;
if (l <= 3.2e-256)
tmp = (1.0 - ((0.125 * (h * ((D / (d / M)) ^ 2.0))) / l)) * (sqrt((d / h)) * t_0);
else
tmp = (sqrt(d) * (t_0 * (1.0 + (-0.5 * ((h / l) * ((M * (0.5 * (D / d))) ^ 2.0)))))) / sqrt(h);
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, 3.2e-256], N[(N[(1.0 - N[(N[(0.125 * N[(h * N[Power[N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] * N[(t$95$0 * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq 3.2 \cdot 10^{-256}:\\
\;\;\;\;\left(1 - \frac{0.125 \cdot \left(h \cdot {\left(\frac{D}{\frac{d}{M}}\right)}^{2}\right)}{\ell}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d} \cdot \left(t_0 \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)\right)\right)}{\sqrt{h}}\\
\end{array}
\end{array}
if l < 3.1999999999999999e-256Initial program 67.0%
metadata-eval67.0%
unpow1/267.0%
metadata-eval67.0%
unpow1/267.0%
*-commutative67.0%
associate-*l*67.0%
times-frac68.3%
metadata-eval68.3%
Simplified68.3%
associate-*r*68.3%
frac-times67.0%
*-commutative67.0%
metadata-eval67.0%
associate-*r/71.8%
metadata-eval71.8%
*-commutative71.8%
frac-times72.4%
div-inv72.4%
metadata-eval72.4%
Applied egg-rr72.4%
metadata-eval72.4%
div-inv72.4%
frac-times71.8%
*-commutative71.8%
Applied egg-rr71.8%
times-frac72.4%
Simplified72.4%
Taylor expanded in M around 0 47.7%
associate-*r*47.0%
unpow247.0%
times-frac52.6%
associate-*r/56.6%
associate-*l/56.5%
*-commutative56.5%
unpow256.5%
unpow256.5%
unswap-sqr69.6%
associate-*l/71.8%
associate-*l/71.8%
associate-*r/71.8%
associate-*l/72.4%
unpow272.4%
*-commutative72.4%
*-commutative72.4%
associate-*r/71.8%
associate-/l*72.4%
Simplified72.4%
if 3.1999999999999999e-256 < l Initial program 59.4%
associate-*l*59.4%
metadata-eval59.4%
unpow1/259.4%
metadata-eval59.4%
unpow1/259.4%
associate-*l*59.4%
metadata-eval59.4%
times-frac59.3%
Simplified59.3%
sqrt-div71.6%
Applied egg-rr71.6%
associate-*l/71.7%
cancel-sign-sub-inv71.7%
metadata-eval71.7%
div-inv71.7%
metadata-eval71.7%
associate-*l*71.7%
Applied egg-rr71.7%
Final simplification72.1%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h)))
(t_1 (* h (pow (* D (/ M d)) 2.0)))
(t_2 (sqrt (/ d l))))
(if (<= M 1.65e-97)
(* t_0 t_2)
(if (<= M 4400.0)
(* (sqrt (* (/ d h) (/ d l))) (+ 1.0 (/ -0.125 (/ l t_1))))
(* t_0 (* t_2 (* -0.125 (/ t_1 l))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = h * pow((D * (M / d)), 2.0);
double t_2 = sqrt((d / l));
double tmp;
if (M <= 1.65e-97) {
tmp = t_0 * t_2;
} else if (M <= 4400.0) {
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (-0.125 / (l / t_1)));
} else {
tmp = t_0 * (t_2 * (-0.125 * (t_1 / l)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = sqrt((d / h))
t_1 = h * ((d_1 * (m / d)) ** 2.0d0)
t_2 = sqrt((d / l))
if (m <= 1.65d-97) then
tmp = t_0 * t_2
else if (m <= 4400.0d0) then
tmp = sqrt(((d / h) * (d / l))) * (1.0d0 + ((-0.125d0) / (l / t_1)))
else
tmp = t_0 * (t_2 * ((-0.125d0) * (t_1 / l)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h));
double t_1 = h * Math.pow((D * (M / d)), 2.0);
double t_2 = Math.sqrt((d / l));
double tmp;
if (M <= 1.65e-97) {
tmp = t_0 * t_2;
} else if (M <= 4400.0) {
tmp = Math.sqrt(((d / h) * (d / l))) * (1.0 + (-0.125 / (l / t_1)));
} else {
tmp = t_0 * (t_2 * (-0.125 * (t_1 / l)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) t_1 = h * math.pow((D * (M / d)), 2.0) t_2 = math.sqrt((d / l)) tmp = 0 if M <= 1.65e-97: tmp = t_0 * t_2 elif M <= 4400.0: tmp = math.sqrt(((d / h) * (d / l))) * (1.0 + (-0.125 / (l / t_1))) else: tmp = t_0 * (t_2 * (-0.125 * (t_1 / l))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = Float64(h * (Float64(D * Float64(M / d)) ^ 2.0)) t_2 = sqrt(Float64(d / l)) tmp = 0.0 if (M <= 1.65e-97) tmp = Float64(t_0 * t_2); elseif (M <= 4400.0) tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 + Float64(-0.125 / Float64(l / t_1)))); else tmp = Float64(t_0 * Float64(t_2 * Float64(-0.125 * Float64(t_1 / l)))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / h));
t_1 = h * ((D * (M / d)) ^ 2.0);
t_2 = sqrt((d / l));
tmp = 0.0;
if (M <= 1.65e-97)
tmp = t_0 * t_2;
elseif (M <= 4400.0)
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (-0.125 / (l / t_1)));
else
tmp = t_0 * (t_2 * (-0.125 * (t_1 / l)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(h * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M, 1.65e-97], N[(t$95$0 * t$95$2), $MachinePrecision], If[LessEqual[M, 4400.0], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.125 / N[(l / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(t$95$2 * N[(-0.125 * N[(t$95$1 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := h \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}\\
t_2 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;M \leq 1.65 \cdot 10^{-97}:\\
\;\;\;\;t_0 \cdot t_2\\
\mathbf{elif}\;M \leq 4400:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \frac{-0.125}{\frac{\ell}{t_1}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(t_2 \cdot \left(-0.125 \cdot \frac{t_1}{\ell}\right)\right)\\
\end{array}
\end{array}
if M < 1.6500000000000001e-97Initial program 64.8%
associate-*l*64.8%
metadata-eval64.8%
unpow1/264.8%
metadata-eval64.8%
unpow1/264.8%
sub-neg64.8%
+-commutative64.8%
*-commutative64.8%
distribute-rgt-neg-in64.8%
fma-def64.8%
Simplified65.9%
Taylor expanded in h around 0 44.9%
if 1.6500000000000001e-97 < M < 4400Initial program 60.5%
metadata-eval60.5%
unpow1/260.5%
metadata-eval60.5%
unpow1/260.5%
*-commutative60.5%
associate-*l*60.5%
times-frac60.5%
metadata-eval60.5%
Simplified60.5%
associate-*r*60.5%
frac-times60.5%
*-commutative60.5%
metadata-eval60.5%
associate-*r/65.9%
metadata-eval65.9%
*-commutative65.9%
frac-times65.9%
div-inv65.9%
metadata-eval65.9%
Applied egg-rr65.9%
metadata-eval65.9%
div-inv65.9%
frac-times65.9%
*-commutative65.9%
Applied egg-rr65.9%
times-frac65.9%
Simplified65.9%
Taylor expanded in M around 0 50.5%
associate-*r*50.4%
unpow250.4%
times-frac55.8%
associate-*r/56.0%
associate-*l/55.6%
*-commutative55.6%
unpow255.6%
unpow255.6%
unswap-sqr60.9%
associate-*l/65.9%
associate-*l/65.9%
associate-*r/65.9%
associate-*l/65.9%
unpow265.9%
*-commutative65.9%
*-commutative65.9%
associate-*r/65.9%
associate-/l*65.9%
Simplified65.9%
pow165.9%
sqrt-unprod61.5%
associate-/l*61.5%
associate-/r/61.5%
Applied egg-rr61.5%
unpow161.5%
sub-neg61.5%
distribute-neg-frac61.5%
metadata-eval61.5%
associate-/r/61.5%
*-rgt-identity61.5%
associate-*r/61.5%
associate-/r/61.5%
associate-*l/61.5%
*-lft-identity61.5%
Simplified61.5%
if 4400 < M Initial program 62.9%
associate-*l*61.7%
metadata-eval61.7%
unpow1/261.7%
metadata-eval61.7%
unpow1/261.7%
sub-neg61.7%
+-commutative61.7%
*-commutative61.7%
distribute-rgt-neg-in61.7%
fma-def61.7%
Simplified61.6%
Taylor expanded in h around inf 33.1%
*-commutative33.1%
times-frac34.4%
unpow234.4%
*-commutative34.4%
unpow234.4%
times-frac38.7%
unpow238.7%
Simplified38.7%
Taylor expanded in D around 0 33.1%
*-commutative33.1%
associate-*l*33.1%
*-commutative33.1%
*-commutative33.1%
times-frac33.0%
unpow233.0%
unpow233.0%
unswap-sqr33.4%
unpow233.4%
times-frac41.8%
*-commutative41.8%
associate-/l*41.8%
*-commutative41.8%
associate-/l*41.8%
Simplified41.8%
associate-*l/42.0%
pow242.0%
associate-/r/41.8%
Applied egg-rr41.8%
Final simplification45.3%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= h 2.6e+202)
(*
(- 1.0 (/ (* 0.125 (* h (pow (/ D (/ d M)) 2.0))) l))
(* (sqrt (/ d h)) (sqrt (/ d l))))
(* -0.125 (/ (* (* D M) (* D M)) (/ d (sqrt (/ h (pow l 3.0))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 2.6e+202) {
tmp = (1.0 - ((0.125 * (h * pow((D / (d / M)), 2.0))) / l)) * (sqrt((d / h)) * sqrt((d / l)));
} else {
tmp = -0.125 * (((D * M) * (D * M)) / (d / sqrt((h / pow(l, 3.0)))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= 2.6d+202) then
tmp = (1.0d0 - ((0.125d0 * (h * ((d_1 / (d / m)) ** 2.0d0))) / l)) * (sqrt((d / h)) * sqrt((d / l)))
else
tmp = (-0.125d0) * (((d_1 * m) * (d_1 * m)) / (d / sqrt((h / (l ** 3.0d0)))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 2.6e+202) {
tmp = (1.0 - ((0.125 * (h * Math.pow((D / (d / M)), 2.0))) / l)) * (Math.sqrt((d / h)) * Math.sqrt((d / l)));
} else {
tmp = -0.125 * (((D * M) * (D * M)) / (d / Math.sqrt((h / Math.pow(l, 3.0)))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if h <= 2.6e+202: tmp = (1.0 - ((0.125 * (h * math.pow((D / (d / M)), 2.0))) / l)) * (math.sqrt((d / h)) * math.sqrt((d / l))) else: tmp = -0.125 * (((D * M) * (D * M)) / (d / math.sqrt((h / math.pow(l, 3.0))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (h <= 2.6e+202) tmp = Float64(Float64(1.0 - Float64(Float64(0.125 * Float64(h * (Float64(D / Float64(d / M)) ^ 2.0))) / l)) * Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)))); else tmp = Float64(-0.125 * Float64(Float64(Float64(D * M) * Float64(D * M)) / Float64(d / sqrt(Float64(h / (l ^ 3.0)))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (h <= 2.6e+202)
tmp = (1.0 - ((0.125 * (h * ((D / (d / M)) ^ 2.0))) / l)) * (sqrt((d / h)) * sqrt((d / l)));
else
tmp = -0.125 * (((D * M) * (D * M)) / (d / sqrt((h / (l ^ 3.0)))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[h, 2.6e+202], N[(N[(1.0 - N[(N[(0.125 * N[(h * N[Power[N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.125 * N[(N[(N[(D * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision] / N[(d / N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq 2.6 \cdot 10^{+202}:\\
\;\;\;\;\left(1 - \frac{0.125 \cdot \left(h \cdot {\left(\frac{D}{\frac{d}{M}}\right)}^{2}\right)}{\ell}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{\frac{d}{\sqrt{\frac{h}{{\ell}^{3}}}}}\\
\end{array}
\end{array}
if h < 2.6000000000000002e202Initial program 67.6%
metadata-eval67.6%
unpow1/267.6%
metadata-eval67.6%
unpow1/267.6%
*-commutative67.6%
associate-*l*67.6%
times-frac68.4%
metadata-eval68.4%
Simplified68.4%
associate-*r*68.4%
frac-times67.6%
*-commutative67.6%
metadata-eval67.6%
associate-*r/71.1%
metadata-eval71.1%
*-commutative71.1%
frac-times71.5%
div-inv71.5%
metadata-eval71.5%
Applied egg-rr71.5%
metadata-eval71.5%
div-inv71.5%
frac-times71.1%
*-commutative71.1%
Applied egg-rr71.1%
times-frac71.5%
Simplified71.5%
Taylor expanded in M around 0 46.7%
associate-*r*45.9%
unpow245.9%
times-frac53.0%
associate-*r/56.8%
associate-*l/56.0%
*-commutative56.0%
unpow256.0%
unpow256.0%
unswap-sqr68.4%
associate-*l/70.3%
associate-*l/70.3%
associate-*r/71.1%
associate-*l/71.5%
unpow271.5%
*-commutative71.5%
*-commutative71.5%
associate-*r/71.1%
associate-/l*71.5%
Simplified71.5%
if 2.6000000000000002e202 < h Initial program 26.9%
metadata-eval26.9%
unpow1/226.9%
metadata-eval26.9%
unpow1/226.9%
*-commutative26.9%
associate-*l*26.9%
times-frac26.7%
metadata-eval26.7%
Simplified26.7%
associate-*r*26.7%
frac-times26.9%
*-commutative26.9%
metadata-eval26.9%
associate-*r/30.7%
metadata-eval30.7%
*-commutative30.7%
frac-times26.5%
div-inv26.5%
metadata-eval26.5%
Applied egg-rr26.5%
metadata-eval26.5%
div-inv26.5%
frac-times30.7%
*-commutative30.7%
Applied egg-rr30.7%
times-frac30.7%
Simplified30.7%
Taylor expanded in d around 0 40.4%
associate-*l/40.5%
associate-/l*40.5%
unpow240.5%
unpow240.5%
unswap-sqr49.3%
Simplified49.3%
Final simplification69.5%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ 1.0 (* l h))))
(if (<= d -6.5e-111)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= d 2.4e-294)
(* d (cbrt (* t_0 (sqrt t_0))))
(if (or (<= d 8500000000000.0)
(and (not (<= d 2.3e+204)) (<= d 2.4e+228)))
(* -0.125 (/ (* (* D M) (* D M)) (/ d (sqrt (/ h (pow l 3.0))))))
(* d (* (pow h -0.5) (pow l -0.5))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (l * h);
double tmp;
if (d <= -6.5e-111) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (d <= 2.4e-294) {
tmp = d * cbrt((t_0 * sqrt(t_0)));
} else if ((d <= 8500000000000.0) || (!(d <= 2.3e+204) && (d <= 2.4e+228))) {
tmp = -0.125 * (((D * M) * (D * M)) / (d / sqrt((h / pow(l, 3.0)))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (l * h);
double tmp;
if (d <= -6.5e-111) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (d <= 2.4e-294) {
tmp = d * Math.cbrt((t_0 * Math.sqrt(t_0)));
} else if ((d <= 8500000000000.0) || (!(d <= 2.3e+204) && (d <= 2.4e+228))) {
tmp = -0.125 * (((D * M) * (D * M)) / (d / Math.sqrt((h / Math.pow(l, 3.0)))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(1.0 / Float64(l * h)) tmp = 0.0 if (d <= -6.5e-111) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (d <= 2.4e-294) tmp = Float64(d * cbrt(Float64(t_0 * sqrt(t_0)))); elseif ((d <= 8500000000000.0) || (!(d <= 2.3e+204) && (d <= 2.4e+228))) tmp = Float64(-0.125 * Float64(Float64(Float64(D * M) * Float64(D * M)) / Float64(d / sqrt(Float64(h / (l ^ 3.0)))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -6.5e-111], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.4e-294], N[(d * N[Power[N[(t$95$0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[d, 8500000000000.0], And[N[Not[LessEqual[d, 2.3e+204]], $MachinePrecision], LessEqual[d, 2.4e+228]]], N[(-0.125 * N[(N[(N[(D * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision] / N[(d / N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{1}{\ell \cdot h}\\
\mathbf{if}\;d \leq -6.5 \cdot 10^{-111}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;d \leq 2.4 \cdot 10^{-294}:\\
\;\;\;\;d \cdot \sqrt[3]{t_0 \cdot \sqrt{t_0}}\\
\mathbf{elif}\;d \leq 8500000000000 \lor \neg \left(d \leq 2.3 \cdot 10^{+204}\right) \land d \leq 2.4 \cdot 10^{+228}:\\
\;\;\;\;-0.125 \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{\frac{d}{\sqrt{\frac{h}{{\ell}^{3}}}}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -6.49999999999999974e-111Initial program 75.4%
associate-*l*74.4%
metadata-eval74.4%
unpow1/274.4%
metadata-eval74.4%
unpow1/274.4%
sub-neg74.4%
+-commutative74.4%
*-commutative74.4%
distribute-rgt-neg-in74.4%
fma-def74.4%
Simplified76.5%
Taylor expanded in h around 0 59.6%
if -6.49999999999999974e-111 < d < 2.39999999999999997e-294Initial program 47.6%
metadata-eval47.6%
unpow1/247.6%
metadata-eval47.6%
unpow1/247.6%
*-commutative47.6%
associate-*l*47.6%
times-frac47.4%
metadata-eval47.4%
Simplified47.4%
Taylor expanded in d around inf 20.9%
add-cbrt-cube22.9%
add-sqr-sqrt22.9%
*-commutative22.9%
*-commutative22.9%
Applied egg-rr22.9%
if 2.39999999999999997e-294 < d < 8.5e12 or 2.2999999999999999e204 < d < 2.39999999999999989e228Initial program 57.5%
metadata-eval57.5%
unpow1/257.5%
metadata-eval57.5%
unpow1/257.5%
*-commutative57.5%
associate-*l*57.5%
times-frac57.5%
metadata-eval57.5%
Simplified57.5%
associate-*r*57.5%
frac-times57.5%
*-commutative57.5%
metadata-eval57.5%
associate-*r/59.9%
metadata-eval59.9%
*-commutative59.9%
frac-times59.9%
div-inv59.9%
metadata-eval59.9%
Applied egg-rr59.9%
metadata-eval59.9%
div-inv59.9%
frac-times59.9%
*-commutative59.9%
Applied egg-rr59.9%
times-frac59.9%
Simplified59.9%
Taylor expanded in d around 0 45.9%
associate-*l/46.0%
associate-/l*46.0%
unpow246.0%
unpow246.0%
unswap-sqr51.0%
Simplified51.0%
if 8.5e12 < d < 2.2999999999999999e204 or 2.39999999999999989e228 < d Initial program 71.2%
metadata-eval71.2%
unpow1/271.2%
metadata-eval71.2%
unpow1/271.2%
*-commutative71.2%
associate-*l*71.2%
times-frac71.0%
metadata-eval71.0%
Simplified71.0%
Taylor expanded in d around inf 61.9%
*-un-lft-identity61.9%
*-commutative61.9%
Applied egg-rr61.9%
*-lft-identity61.9%
unpow-161.9%
sqr-pow61.9%
rem-sqrt-square61.9%
metadata-eval61.9%
sqr-pow61.6%
fabs-sqr61.6%
sqr-pow61.9%
Simplified61.9%
unpow-prod-down77.0%
Applied egg-rr77.0%
Final simplification52.5%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ 1.0 (* l h))))
(if (<= d -3.15e-111)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= d 2.4e-294)
(* d (sqrt (cbrt (* t_0 (* t_0 t_0)))))
(if (or (<= d 6200000000000.0)
(and (not (<= d 2.3e+204)) (<= d 2.4e+228)))
(* -0.125 (/ (* (* D M) (* D M)) (/ d (sqrt (/ h (pow l 3.0))))))
(* d (* (pow h -0.5) (pow l -0.5))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (l * h);
double tmp;
if (d <= -3.15e-111) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (d <= 2.4e-294) {
tmp = d * sqrt(cbrt((t_0 * (t_0 * t_0))));
} else if ((d <= 6200000000000.0) || (!(d <= 2.3e+204) && (d <= 2.4e+228))) {
tmp = -0.125 * (((D * M) * (D * M)) / (d / sqrt((h / pow(l, 3.0)))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (l * h);
double tmp;
if (d <= -3.15e-111) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (d <= 2.4e-294) {
tmp = d * Math.sqrt(Math.cbrt((t_0 * (t_0 * t_0))));
} else if ((d <= 6200000000000.0) || (!(d <= 2.3e+204) && (d <= 2.4e+228))) {
tmp = -0.125 * (((D * M) * (D * M)) / (d / Math.sqrt((h / Math.pow(l, 3.0)))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(1.0 / Float64(l * h)) tmp = 0.0 if (d <= -3.15e-111) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (d <= 2.4e-294) tmp = Float64(d * sqrt(cbrt(Float64(t_0 * Float64(t_0 * t_0))))); elseif ((d <= 6200000000000.0) || (!(d <= 2.3e+204) && (d <= 2.4e+228))) tmp = Float64(-0.125 * Float64(Float64(Float64(D * M) * Float64(D * M)) / Float64(d / sqrt(Float64(h / (l ^ 3.0)))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -3.15e-111], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.4e-294], N[(d * N[Sqrt[N[Power[N[(t$95$0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[d, 6200000000000.0], And[N[Not[LessEqual[d, 2.3e+204]], $MachinePrecision], LessEqual[d, 2.4e+228]]], N[(-0.125 * N[(N[(N[(D * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision] / N[(d / N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{1}{\ell \cdot h}\\
\mathbf{if}\;d \leq -3.15 \cdot 10^{-111}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;d \leq 2.4 \cdot 10^{-294}:\\
\;\;\;\;d \cdot \sqrt{\sqrt[3]{t_0 \cdot \left(t_0 \cdot t_0\right)}}\\
\mathbf{elif}\;d \leq 6200000000000 \lor \neg \left(d \leq 2.3 \cdot 10^{+204}\right) \land d \leq 2.4 \cdot 10^{+228}:\\
\;\;\;\;-0.125 \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{\frac{d}{\sqrt{\frac{h}{{\ell}^{3}}}}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -3.1500000000000002e-111Initial program 75.4%
associate-*l*74.4%
metadata-eval74.4%
unpow1/274.4%
metadata-eval74.4%
unpow1/274.4%
sub-neg74.4%
+-commutative74.4%
*-commutative74.4%
distribute-rgt-neg-in74.4%
fma-def74.4%
Simplified76.5%
Taylor expanded in h around 0 59.6%
if -3.1500000000000002e-111 < d < 2.39999999999999997e-294Initial program 47.6%
metadata-eval47.6%
unpow1/247.6%
metadata-eval47.6%
unpow1/247.6%
*-commutative47.6%
associate-*l*47.6%
times-frac47.4%
metadata-eval47.4%
Simplified47.4%
Taylor expanded in d around inf 20.9%
add-cbrt-cube34.8%
*-commutative34.8%
*-commutative34.8%
*-commutative34.8%
Applied egg-rr34.8%
if 2.39999999999999997e-294 < d < 6.2e12 or 2.2999999999999999e204 < d < 2.39999999999999989e228Initial program 57.5%
metadata-eval57.5%
unpow1/257.5%
metadata-eval57.5%
unpow1/257.5%
*-commutative57.5%
associate-*l*57.5%
times-frac57.5%
metadata-eval57.5%
Simplified57.5%
associate-*r*57.5%
frac-times57.5%
*-commutative57.5%
metadata-eval57.5%
associate-*r/59.9%
metadata-eval59.9%
*-commutative59.9%
frac-times59.9%
div-inv59.9%
metadata-eval59.9%
Applied egg-rr59.9%
metadata-eval59.9%
div-inv59.9%
frac-times59.9%
*-commutative59.9%
Applied egg-rr59.9%
times-frac59.9%
Simplified59.9%
Taylor expanded in d around 0 45.9%
associate-*l/46.0%
associate-/l*46.0%
unpow246.0%
unpow246.0%
unswap-sqr51.0%
Simplified51.0%
if 6.2e12 < d < 2.2999999999999999e204 or 2.39999999999999989e228 < d Initial program 71.2%
metadata-eval71.2%
unpow1/271.2%
metadata-eval71.2%
unpow1/271.2%
*-commutative71.2%
associate-*l*71.2%
times-frac71.0%
metadata-eval71.0%
Simplified71.0%
Taylor expanded in d around inf 61.9%
*-un-lft-identity61.9%
*-commutative61.9%
Applied egg-rr61.9%
*-lft-identity61.9%
unpow-161.9%
sqr-pow61.9%
rem-sqrt-square61.9%
metadata-eval61.9%
sqr-pow61.6%
fabs-sqr61.6%
sqr-pow61.9%
Simplified61.9%
unpow-prod-down77.0%
Applied egg-rr77.0%
Final simplification54.7%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= D 9.2e-57)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(*
(sqrt (* (/ d h) (/ d l)))
(- 1.0 (* h (/ (* (pow (/ (* D M) d) 2.0) 0.25) (/ l 0.5)))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 9.2e-57) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else {
tmp = sqrt(((d / h) * (d / l))) * (1.0 - (h * ((pow(((D * M) / d), 2.0) * 0.25) / (l / 0.5))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 9.2d-57) then
tmp = sqrt((d / h)) * sqrt((d / l))
else
tmp = sqrt(((d / h) * (d / l))) * (1.0d0 - (h * (((((d_1 * m) / d) ** 2.0d0) * 0.25d0) / (l / 0.5d0))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 9.2e-57) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else {
tmp = Math.sqrt(((d / h) * (d / l))) * (1.0 - (h * ((Math.pow(((D * M) / d), 2.0) * 0.25) / (l / 0.5))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if D <= 9.2e-57: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) else: tmp = math.sqrt(((d / h) * (d / l))) * (1.0 - (h * ((math.pow(((D * M) / d), 2.0) * 0.25) / (l / 0.5)))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (D <= 9.2e-57) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); else tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 - Float64(h * Float64(Float64((Float64(Float64(D * M) / d) ^ 2.0) * 0.25) / Float64(l / 0.5))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (D <= 9.2e-57)
tmp = sqrt((d / h)) * sqrt((d / l));
else
tmp = sqrt(((d / h) * (d / l))) * (1.0 - (h * (((((D * M) / d) ^ 2.0) * 0.25) / (l / 0.5))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[D, 9.2e-57], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(h * N[(N[(N[Power[N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * 0.25), $MachinePrecision] / N[(l / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;D \leq 9.2 \cdot 10^{-57}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - h \cdot \frac{{\left(\frac{D \cdot M}{d}\right)}^{2} \cdot 0.25}{\frac{\ell}{0.5}}\right)\\
\end{array}
\end{array}
if D < 9.2000000000000001e-57Initial program 60.6%
associate-*l*60.1%
metadata-eval60.1%
unpow1/260.1%
metadata-eval60.1%
unpow1/260.1%
sub-neg60.1%
+-commutative60.1%
*-commutative60.1%
distribute-rgt-neg-in60.1%
fma-def60.1%
Simplified61.1%
Taylor expanded in h around 0 42.9%
if 9.2000000000000001e-57 < D Initial program 72.5%
metadata-eval72.5%
unpow1/272.5%
metadata-eval72.5%
unpow1/272.5%
*-commutative72.5%
associate-*l*72.5%
times-frac72.5%
metadata-eval72.5%
Simplified72.5%
associate-*r*72.5%
frac-times72.5%
*-commutative72.5%
metadata-eval72.5%
associate-*r/73.8%
metadata-eval73.8%
*-commutative73.8%
frac-times73.8%
div-inv73.8%
metadata-eval73.8%
Applied egg-rr73.8%
metadata-eval73.8%
div-inv73.8%
frac-times73.8%
*-commutative73.8%
Applied egg-rr73.8%
times-frac73.8%
Simplified73.8%
pow173.8%
sqrt-unprod64.4%
associate-/l*63.1%
div-inv63.1%
metadata-eval63.1%
Applied egg-rr63.1%
unpow163.1%
associate-/r/64.5%
*-commutative64.5%
associate-/l*64.5%
unpow264.5%
associate-*r*64.5%
associate-*r*64.5%
swap-sqr64.5%
unpow264.5%
*-commutative64.5%
associate-*r/64.5%
metadata-eval64.5%
Simplified64.5%
Final simplification49.0%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= D 5.1e-53)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(*
(sqrt (* (/ d h) (/ d l)))
(- 1.0 (* h (/ (* 0.5 (pow (* M (* 0.5 (/ D d))) 2.0)) l))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 5.1e-53) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else {
tmp = sqrt(((d / h) * (d / l))) * (1.0 - (h * ((0.5 * pow((M * (0.5 * (D / d))), 2.0)) / l)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 5.1d-53) then
tmp = sqrt((d / h)) * sqrt((d / l))
else
tmp = sqrt(((d / h) * (d / l))) * (1.0d0 - (h * ((0.5d0 * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0)) / l)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 5.1e-53) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else {
tmp = Math.sqrt(((d / h) * (d / l))) * (1.0 - (h * ((0.5 * Math.pow((M * (0.5 * (D / d))), 2.0)) / l)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if D <= 5.1e-53: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) else: tmp = math.sqrt(((d / h) * (d / l))) * (1.0 - (h * ((0.5 * math.pow((M * (0.5 * (D / d))), 2.0)) / l))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (D <= 5.1e-53) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); else tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 - Float64(h * Float64(Float64(0.5 * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0)) / l)))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (D <= 5.1e-53)
tmp = sqrt((d / h)) * sqrt((d / l));
else
tmp = sqrt(((d / h) * (d / l))) * (1.0 - (h * ((0.5 * ((M * (0.5 * (D / d))) ^ 2.0)) / l)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[D, 5.1e-53], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(h * N[(N[(0.5 * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;D \leq 5.1 \cdot 10^{-53}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - h \cdot \frac{0.5 \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\\
\end{array}
\end{array}
if D < 5.10000000000000045e-53Initial program 60.6%
associate-*l*60.1%
metadata-eval60.1%
unpow1/260.1%
metadata-eval60.1%
unpow1/260.1%
sub-neg60.1%
+-commutative60.1%
*-commutative60.1%
distribute-rgt-neg-in60.1%
fma-def60.1%
Simplified61.1%
Taylor expanded in h around 0 42.9%
if 5.10000000000000045e-53 < D Initial program 72.5%
metadata-eval72.5%
unpow1/272.5%
metadata-eval72.5%
unpow1/272.5%
*-commutative72.5%
associate-*l*72.5%
times-frac72.5%
metadata-eval72.5%
Simplified72.5%
associate-*r*72.5%
frac-times72.5%
*-commutative72.5%
metadata-eval72.5%
associate-*r/73.8%
metadata-eval73.8%
*-commutative73.8%
frac-times73.8%
div-inv73.8%
metadata-eval73.8%
Applied egg-rr73.8%
pow173.8%
sqrt-unprod64.4%
associate-/l*63.1%
*-commutative63.1%
associate-*l*63.1%
Applied egg-rr63.1%
unpow163.1%
associate-/r/64.5%
Simplified64.5%
Final simplification49.0%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= D 2.5e-55)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(*
(sqrt (* (/ d h) (/ d l)))
(+ 1.0 (/ -0.125 (/ l (* h (pow (* D (/ M d)) 2.0))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 2.5e-55) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else {
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (-0.125 / (l / (h * pow((D * (M / d)), 2.0)))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 2.5d-55) then
tmp = sqrt((d / h)) * sqrt((d / l))
else
tmp = sqrt(((d / h) * (d / l))) * (1.0d0 + ((-0.125d0) / (l / (h * ((d_1 * (m / d)) ** 2.0d0)))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 2.5e-55) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else {
tmp = Math.sqrt(((d / h) * (d / l))) * (1.0 + (-0.125 / (l / (h * Math.pow((D * (M / d)), 2.0)))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if D <= 2.5e-55: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) else: tmp = math.sqrt(((d / h) * (d / l))) * (1.0 + (-0.125 / (l / (h * math.pow((D * (M / d)), 2.0))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (D <= 2.5e-55) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); else tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 + Float64(-0.125 / Float64(l / Float64(h * (Float64(D * Float64(M / d)) ^ 2.0)))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (D <= 2.5e-55)
tmp = sqrt((d / h)) * sqrt((d / l));
else
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (-0.125 / (l / (h * ((D * (M / d)) ^ 2.0)))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[D, 2.5e-55], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.125 / N[(l / N[(h * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;D \leq 2.5 \cdot 10^{-55}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \frac{-0.125}{\frac{\ell}{h \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}}}\right)\\
\end{array}
\end{array}
if D < 2.5000000000000001e-55Initial program 60.6%
associate-*l*60.1%
metadata-eval60.1%
unpow1/260.1%
metadata-eval60.1%
unpow1/260.1%
sub-neg60.1%
+-commutative60.1%
*-commutative60.1%
distribute-rgt-neg-in60.1%
fma-def60.1%
Simplified61.1%
Taylor expanded in h around 0 42.9%
if 2.5000000000000001e-55 < D Initial program 72.5%
metadata-eval72.5%
unpow1/272.5%
metadata-eval72.5%
unpow1/272.5%
*-commutative72.5%
associate-*l*72.5%
times-frac72.5%
metadata-eval72.5%
Simplified72.5%
associate-*r*72.5%
frac-times72.5%
*-commutative72.5%
metadata-eval72.5%
associate-*r/73.8%
metadata-eval73.8%
*-commutative73.8%
frac-times73.8%
div-inv73.8%
metadata-eval73.8%
Applied egg-rr73.8%
metadata-eval73.8%
div-inv73.8%
frac-times73.8%
*-commutative73.8%
Applied egg-rr73.8%
times-frac73.8%
Simplified73.8%
Taylor expanded in M around 0 43.1%
associate-*r*43.2%
unpow243.2%
times-frac55.8%
associate-*r/60.0%
associate-*l/59.9%
*-commutative59.9%
unpow259.9%
unpow259.9%
unswap-sqr71.1%
associate-*l/72.5%
associate-*l/72.5%
associate-*r/73.8%
associate-*l/73.8%
unpow273.8%
*-commutative73.8%
*-commutative73.8%
associate-*r/73.8%
associate-/l*73.8%
Simplified73.8%
pow173.8%
sqrt-unprod64.4%
associate-/l*64.5%
associate-/r/64.5%
Applied egg-rr64.5%
unpow164.5%
sub-neg64.5%
distribute-neg-frac64.5%
metadata-eval64.5%
associate-/r/64.5%
*-rgt-identity64.5%
associate-*r/64.4%
associate-/r/64.4%
associate-*l/64.4%
*-lft-identity64.4%
Simplified64.4%
Final simplification49.0%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= M 1.35e-52)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(*
(sqrt (* (/ d h) (/ d l)))
(* -0.125 (* (/ h l) (pow (/ (* D M) d) 2.0))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 1.35e-52) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else {
tmp = sqrt(((d / h) * (d / l))) * (-0.125 * ((h / l) * pow(((D * M) / d), 2.0)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 1.35d-52) then
tmp = sqrt((d / h)) * sqrt((d / l))
else
tmp = sqrt(((d / h) * (d / l))) * ((-0.125d0) * ((h / l) * (((d_1 * m) / d) ** 2.0d0)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 1.35e-52) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else {
tmp = Math.sqrt(((d / h) * (d / l))) * (-0.125 * ((h / l) * Math.pow(((D * M) / d), 2.0)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if M <= 1.35e-52: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) else: tmp = math.sqrt(((d / h) * (d / l))) * (-0.125 * ((h / l) * math.pow(((D * M) / d), 2.0))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (M <= 1.35e-52) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); else tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(-0.125 * Float64(Float64(h / l) * (Float64(Float64(D * M) / d) ^ 2.0)))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (M <= 1.35e-52)
tmp = sqrt((d / h)) * sqrt((d / l));
else
tmp = sqrt(((d / h) * (d / l))) * (-0.125 * ((h / l) * (((D * M) / d) ^ 2.0)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[M, 1.35e-52], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-0.125 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.35 \cdot 10^{-52}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D \cdot M}{d}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if M < 1.35000000000000005e-52Initial program 65.0%
associate-*l*65.0%
metadata-eval65.0%
unpow1/265.0%
metadata-eval65.0%
unpow1/265.0%
sub-neg65.0%
+-commutative65.0%
*-commutative65.0%
distribute-rgt-neg-in65.0%
fma-def65.0%
Simplified66.0%
Taylor expanded in h around 0 46.5%
if 1.35000000000000005e-52 < M Initial program 61.6%
associate-*l*60.5%
metadata-eval60.5%
unpow1/260.5%
metadata-eval60.5%
unpow1/260.5%
sub-neg60.5%
+-commutative60.5%
*-commutative60.5%
distribute-rgt-neg-in60.5%
fma-def60.5%
Simplified60.5%
Taylor expanded in h around inf 33.6%
*-commutative33.6%
times-frac34.8%
unpow234.8%
*-commutative34.8%
unpow234.8%
times-frac38.6%
unpow238.6%
Simplified38.6%
Taylor expanded in D around 0 33.6%
*-commutative33.6%
associate-*l*33.5%
*-commutative33.5%
*-commutative33.5%
times-frac33.4%
unpow233.4%
unpow233.4%
unswap-sqr33.8%
unpow233.8%
times-frac41.4%
*-commutative41.4%
associate-/l*41.4%
*-commutative41.4%
associate-/l*41.5%
Simplified41.5%
pow141.5%
associate-*r*42.6%
sqrt-unprod38.5%
associate-*l*38.5%
pow238.5%
associate-/r/38.4%
Applied egg-rr38.4%
unpow138.4%
associate-*r*38.4%
*-commutative38.4%
*-commutative38.4%
*-commutative38.4%
associate-*r/38.5%
Simplified38.5%
Final simplification44.0%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= M 1.5e-53)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(*
(sqrt (* (/ d h) (/ d l)))
(* -0.125 (* (/ h l) (pow (* D (/ M d)) 2.0))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 1.5e-53) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else {
tmp = sqrt(((d / h) * (d / l))) * (-0.125 * ((h / l) * pow((D * (M / d)), 2.0)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 1.5d-53) then
tmp = sqrt((d / h)) * sqrt((d / l))
else
tmp = sqrt(((d / h) * (d / l))) * ((-0.125d0) * ((h / l) * ((d_1 * (m / d)) ** 2.0d0)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 1.5e-53) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else {
tmp = Math.sqrt(((d / h) * (d / l))) * (-0.125 * ((h / l) * Math.pow((D * (M / d)), 2.0)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if M <= 1.5e-53: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) else: tmp = math.sqrt(((d / h) * (d / l))) * (-0.125 * ((h / l) * math.pow((D * (M / d)), 2.0))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (M <= 1.5e-53) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); else tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(-0.125 * Float64(Float64(h / l) * (Float64(D * Float64(M / d)) ^ 2.0)))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (M <= 1.5e-53)
tmp = sqrt((d / h)) * sqrt((d / l));
else
tmp = sqrt(((d / h) * (d / l))) * (-0.125 * ((h / l) * ((D * (M / d)) ^ 2.0)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[M, 1.5e-53], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-0.125 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.5 \cdot 10^{-53}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if M < 1.5000000000000001e-53Initial program 65.0%
associate-*l*65.0%
metadata-eval65.0%
unpow1/265.0%
metadata-eval65.0%
unpow1/265.0%
sub-neg65.0%
+-commutative65.0%
*-commutative65.0%
distribute-rgt-neg-in65.0%
fma-def65.0%
Simplified66.0%
Taylor expanded in h around 0 46.5%
if 1.5000000000000001e-53 < M Initial program 61.6%
associate-*l*60.5%
metadata-eval60.5%
unpow1/260.5%
metadata-eval60.5%
unpow1/260.5%
sub-neg60.5%
+-commutative60.5%
*-commutative60.5%
distribute-rgt-neg-in60.5%
fma-def60.5%
Simplified60.5%
Taylor expanded in h around inf 33.6%
*-commutative33.6%
times-frac34.8%
unpow234.8%
*-commutative34.8%
unpow234.8%
times-frac38.6%
unpow238.6%
Simplified38.6%
Taylor expanded in D around 0 33.6%
*-commutative33.6%
associate-*l*33.5%
*-commutative33.5%
*-commutative33.5%
times-frac33.4%
unpow233.4%
unpow233.4%
unswap-sqr33.8%
unpow233.8%
times-frac41.4%
*-commutative41.4%
associate-/l*41.4%
*-commutative41.4%
associate-/l*41.5%
Simplified41.5%
pow141.5%
associate-*r*42.6%
sqrt-unprod38.5%
associate-*l*38.5%
pow238.5%
associate-/r/38.4%
Applied egg-rr38.4%
unpow138.4%
associate-*r*38.4%
*-commutative38.4%
*-commutative38.4%
Simplified38.4%
Final simplification44.0%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ 1.0 (* l h))))
(if (<= d -6.9e-115)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= d -5e-310)
(* d (cbrt (* t_0 (sqrt t_0))))
(* d (* (pow h -0.5) (pow l -0.5)))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (l * h);
double tmp;
if (d <= -6.9e-115) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (d <= -5e-310) {
tmp = d * cbrt((t_0 * sqrt(t_0)));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (l * h);
double tmp;
if (d <= -6.9e-115) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (d <= -5e-310) {
tmp = d * Math.cbrt((t_0 * Math.sqrt(t_0)));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(1.0 / Float64(l * h)) tmp = 0.0 if (d <= -6.9e-115) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (d <= -5e-310) tmp = Float64(d * cbrt(Float64(t_0 * sqrt(t_0)))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -6.9e-115], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Power[N[(t$95$0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{1}{\ell \cdot h}\\
\mathbf{if}\;d \leq -6.9 \cdot 10^{-115}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt[3]{t_0 \cdot \sqrt{t_0}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -6.89999999999999999e-115Initial program 75.4%
associate-*l*74.4%
metadata-eval74.4%
unpow1/274.4%
metadata-eval74.4%
unpow1/274.4%
sub-neg74.4%
+-commutative74.4%
*-commutative74.4%
distribute-rgt-neg-in74.4%
fma-def74.4%
Simplified76.5%
Taylor expanded in h around 0 59.6%
if -6.89999999999999999e-115 < d < -4.999999999999985e-310Initial program 49.6%
metadata-eval49.6%
unpow1/249.6%
metadata-eval49.6%
unpow1/249.6%
*-commutative49.6%
associate-*l*49.6%
times-frac49.4%
metadata-eval49.4%
Simplified49.4%
Taylor expanded in d around inf 21.7%
add-cbrt-cube23.8%
add-sqr-sqrt23.8%
*-commutative23.8%
*-commutative23.8%
Applied egg-rr23.8%
if -4.999999999999985e-310 < d Initial program 60.8%
metadata-eval60.8%
unpow1/260.8%
metadata-eval60.8%
unpow1/260.8%
*-commutative60.8%
associate-*l*60.8%
times-frac60.8%
metadata-eval60.8%
Simplified60.8%
Taylor expanded in d around inf 33.2%
*-un-lft-identity33.2%
*-commutative33.2%
Applied egg-rr33.2%
*-lft-identity33.2%
unpow-133.2%
sqr-pow33.3%
rem-sqrt-square33.3%
metadata-eval33.3%
sqr-pow33.1%
fabs-sqr33.1%
sqr-pow33.3%
Simplified33.3%
unpow-prod-down40.1%
Applied egg-rr40.1%
Final simplification44.0%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= d -3.7e-113)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= d 7.8e-297)
(* d (/ 1.0 (cbrt (pow (* l h) 1.5))))
(* d (* (pow h -0.5) (pow l -0.5))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -3.7e-113) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (d <= 7.8e-297) {
tmp = d * (1.0 / cbrt(pow((l * h), 1.5)));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -3.7e-113) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (d <= 7.8e-297) {
tmp = d * (1.0 / Math.cbrt(Math.pow((l * h), 1.5)));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (d <= -3.7e-113) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (d <= 7.8e-297) tmp = Float64(d * Float64(1.0 / cbrt((Float64(l * h) ^ 1.5)))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[d, -3.7e-113], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7.8e-297], N[(d * N[(1.0 / N[Power[N[Power[N[(l * h), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -3.7 \cdot 10^{-113}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;d \leq 7.8 \cdot 10^{-297}:\\
\;\;\;\;d \cdot \frac{1}{\sqrt[3]{{\left(\ell \cdot h\right)}^{1.5}}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -3.6999999999999998e-113Initial program 75.4%
associate-*l*74.4%
metadata-eval74.4%
unpow1/274.4%
metadata-eval74.4%
unpow1/274.4%
sub-neg74.4%
+-commutative74.4%
*-commutative74.4%
distribute-rgt-neg-in74.4%
fma-def74.4%
Simplified76.5%
Taylor expanded in h around 0 59.6%
if -3.6999999999999998e-113 < d < 7.8000000000000002e-297Initial program 48.6%
metadata-eval48.6%
unpow1/248.6%
metadata-eval48.6%
unpow1/248.6%
*-commutative48.6%
associate-*l*48.6%
times-frac48.4%
metadata-eval48.4%
Simplified48.4%
Taylor expanded in d around inf 21.3%
sqrt-div19.3%
metadata-eval19.3%
*-commutative19.3%
Applied egg-rr19.3%
add-cbrt-cube23.4%
add-sqr-sqrt23.4%
Applied egg-rr23.4%
*-commutative23.4%
unpow1/223.4%
pow-plus23.4%
metadata-eval23.4%
Simplified23.4%
if 7.8000000000000002e-297 < d Initial program 61.3%
metadata-eval61.3%
unpow1/261.3%
metadata-eval61.3%
unpow1/261.3%
*-commutative61.3%
associate-*l*61.3%
times-frac61.3%
metadata-eval61.3%
Simplified61.3%
Taylor expanded in d around inf 33.5%
*-un-lft-identity33.5%
*-commutative33.5%
Applied egg-rr33.5%
*-lft-identity33.5%
unpow-133.5%
sqr-pow33.5%
rem-sqrt-square33.5%
metadata-eval33.5%
sqr-pow33.4%
fabs-sqr33.4%
sqr-pow33.5%
Simplified33.5%
unpow-prod-down40.4%
Applied egg-rr40.4%
Final simplification44.0%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= d 7.8e-297) (* d (/ 1.0 (cbrt (pow (* l h) 1.5)))) (* d (* (pow h -0.5) (pow l -0.5)))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 7.8e-297) {
tmp = d * (1.0 / cbrt(pow((l * h), 1.5)));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 7.8e-297) {
tmp = d * (1.0 / Math.cbrt(Math.pow((l * h), 1.5)));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (d <= 7.8e-297) tmp = Float64(d * Float64(1.0 / cbrt((Float64(l * h) ^ 1.5)))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[d, 7.8e-297], N[(d * N[(1.0 / N[Power[N[Power[N[(l * h), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 7.8 \cdot 10^{-297}:\\
\;\;\;\;d \cdot \frac{1}{\sqrt[3]{{\left(\ell \cdot h\right)}^{1.5}}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < 7.8000000000000002e-297Initial program 66.1%
metadata-eval66.1%
unpow1/266.1%
metadata-eval66.1%
unpow1/266.1%
*-commutative66.1%
associate-*l*66.1%
times-frac67.4%
metadata-eval67.4%
Simplified67.4%
Taylor expanded in d around inf 12.8%
sqrt-div12.1%
metadata-eval12.1%
*-commutative12.1%
Applied egg-rr12.1%
add-cbrt-cube13.6%
add-sqr-sqrt13.6%
Applied egg-rr13.6%
*-commutative13.6%
unpow1/213.6%
pow-plus13.6%
metadata-eval13.6%
Simplified13.6%
if 7.8000000000000002e-297 < d Initial program 61.3%
metadata-eval61.3%
unpow1/261.3%
metadata-eval61.3%
unpow1/261.3%
*-commutative61.3%
associate-*l*61.3%
times-frac61.3%
metadata-eval61.3%
Simplified61.3%
Taylor expanded in d around inf 33.5%
*-un-lft-identity33.5%
*-commutative33.5%
Applied egg-rr33.5%
*-lft-identity33.5%
unpow-133.5%
sqr-pow33.5%
rem-sqrt-square33.5%
metadata-eval33.5%
sqr-pow33.4%
fabs-sqr33.4%
sqr-pow33.5%
Simplified33.5%
unpow-prod-down40.4%
Applied egg-rr40.4%
Final simplification25.8%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= d 5e-292) (* d (sqrt (/ 1.0 (* l h)))) (* d (* (pow h -0.5) (pow l -0.5)))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 5e-292) {
tmp = d * sqrt((1.0 / (l * h)));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= 5d-292) then
tmp = d * sqrt((1.0d0 / (l * h)))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 5e-292) {
tmp = d * Math.sqrt((1.0 / (l * h)));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if d <= 5e-292: tmp = d * math.sqrt((1.0 / (l * h))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (d <= 5e-292) tmp = Float64(d * sqrt(Float64(1.0 / Float64(l * h)))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (d <= 5e-292)
tmp = d * sqrt((1.0 / (l * h)));
else
tmp = d * ((h ^ -0.5) * (l ^ -0.5));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[d, 5e-292], N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 5 \cdot 10^{-292}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < 4.99999999999999981e-292Initial program 65.2%
metadata-eval65.2%
unpow1/265.2%
metadata-eval65.2%
unpow1/265.2%
*-commutative65.2%
associate-*l*65.2%
times-frac66.5%
metadata-eval66.5%
Simplified66.5%
Taylor expanded in d around inf 12.6%
if 4.99999999999999981e-292 < d Initial program 62.4%
metadata-eval62.4%
unpow1/262.4%
metadata-eval62.4%
unpow1/262.4%
*-commutative62.4%
associate-*l*62.4%
times-frac62.4%
metadata-eval62.4%
Simplified62.4%
Taylor expanded in d around inf 34.1%
*-un-lft-identity34.1%
*-commutative34.1%
Applied egg-rr34.1%
*-lft-identity34.1%
unpow-134.1%
sqr-pow34.1%
rem-sqrt-square34.1%
metadata-eval34.1%
sqr-pow34.0%
fabs-sqr34.0%
sqr-pow34.1%
Simplified34.1%
unpow-prod-down41.1%
Applied egg-rr41.1%
Final simplification25.4%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (* d (sqrt (/ 1.0 (* l h)))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
return d * sqrt((1.0 / (l * h)));
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * sqrt((1.0d0 / (l * h)))
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
return d * Math.sqrt((1.0 / (l * h)));
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): return d * math.sqrt((1.0 / (l * h)))
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) return Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp = code(d, h, l, M, D)
tmp = d * sqrt((1.0 / (l * h)));
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
d \cdot \sqrt{\frac{1}{\ell \cdot h}}
\end{array}
Initial program 63.9%
metadata-eval63.9%
unpow1/263.9%
metadata-eval63.9%
unpow1/263.9%
*-commutative63.9%
associate-*l*63.9%
times-frac64.6%
metadata-eval64.6%
Simplified64.6%
Taylor expanded in d around inf 22.3%
Final simplification22.3%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (* d (sqrt (/ (/ 1.0 h) l))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
return d * sqrt(((1.0 / h) / l));
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * sqrt(((1.0d0 / h) / l))
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
return d * Math.sqrt(((1.0 / h) / l));
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): return d * math.sqrt(((1.0 / h) / l))
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) return Float64(d * sqrt(Float64(Float64(1.0 / h) / l))) end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp = code(d, h, l, M, D)
tmp = d * sqrt(((1.0 / h) / l));
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}
\end{array}
Initial program 63.9%
metadata-eval63.9%
unpow1/263.9%
metadata-eval63.9%
unpow1/263.9%
*-commutative63.9%
associate-*l*63.9%
times-frac64.6%
metadata-eval64.6%
Simplified64.6%
Taylor expanded in d around inf 22.3%
add-cbrt-cube19.2%
*-commutative19.2%
*-commutative19.2%
*-commutative19.2%
Applied egg-rr19.2%
add-cbrt-cube22.3%
associate-/r*22.4%
Applied egg-rr22.4%
Final simplification22.4%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (* d (pow (* l h) -0.5)))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
return d * pow((l * h), -0.5);
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * ((l * h) ** (-0.5d0))
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
return d * Math.pow((l * h), -0.5);
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): return d * math.pow((l * h), -0.5)
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) return Float64(d * (Float64(l * h) ^ -0.5)) end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp = code(d, h, l, M, D)
tmp = d * ((l * h) ^ -0.5);
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
d \cdot {\left(\ell \cdot h\right)}^{-0.5}
\end{array}
Initial program 63.9%
metadata-eval63.9%
unpow1/263.9%
metadata-eval63.9%
unpow1/263.9%
*-commutative63.9%
associate-*l*63.9%
times-frac64.6%
metadata-eval64.6%
Simplified64.6%
Taylor expanded in d around inf 22.3%
*-un-lft-identity22.3%
*-commutative22.3%
Applied egg-rr22.3%
*-lft-identity22.3%
unpow-122.3%
sqr-pow22.3%
rem-sqrt-square21.9%
metadata-eval21.9%
sqr-pow21.8%
fabs-sqr21.8%
sqr-pow21.9%
Simplified21.9%
Final simplification21.9%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (/ d (sqrt (* l h))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
return d / sqrt((l * h));
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d / sqrt((l * h))
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((l * h));
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): return d / math.sqrt((l * h))
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) return Float64(d / sqrt(Float64(l * h))) end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp = code(d, h, l, M, D)
tmp = d / sqrt((l * h));
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 63.9%
metadata-eval63.9%
unpow1/263.9%
metadata-eval63.9%
unpow1/263.9%
*-commutative63.9%
associate-*l*63.9%
times-frac64.6%
metadata-eval64.6%
Simplified64.6%
associate-*r*64.6%
frac-times63.9%
*-commutative63.9%
metadata-eval63.9%
associate-*r/67.5%
metadata-eval67.5%
*-commutative67.5%
frac-times67.5%
div-inv67.5%
metadata-eval67.5%
Applied egg-rr67.5%
metadata-eval67.5%
div-inv67.5%
frac-times67.5%
*-commutative67.5%
Applied egg-rr67.5%
times-frac67.8%
Simplified67.8%
Taylor expanded in M around 0 44.5%
associate-*r*43.8%
unpow243.8%
times-frac50.6%
associate-*r/54.1%
associate-*l/53.3%
*-commutative53.3%
unpow253.3%
unpow253.3%
unswap-sqr65.1%
associate-*l/66.8%
associate-*l/66.7%
associate-*r/67.5%
associate-*l/67.8%
unpow267.8%
*-commutative67.8%
*-commutative67.8%
associate-*r/67.5%
associate-/l*67.8%
Simplified67.8%
Taylor expanded in d around inf 22.3%
*-commutative22.3%
rem-exp-log14.3%
*-commutative14.3%
rem-exp-log14.3%
unpow1/214.3%
log-pow14.3%
log-rec14.3%
distribute-rgt-neg-in14.3%
log-pow14.3%
unpow1/214.3%
log-rec14.3%
exp-sum14.3%
log-rec14.3%
sub-neg14.3%
log-div15.8%
rem-exp-log21.9%
Simplified21.9%
Final simplification21.9%
herbie shell --seed 2023229
(FPCore (d h l M D)
:name "Henrywood and Agarwal, Equation (12)"
:precision binary64
(* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))