
(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 25 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
(let* ((t_0 (sqrt (- d))))
(if (<= l -8.2e-79)
(*
(/ t_0 (sqrt (- h)))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (/ (* h (pow (/ (* (* 0.5 M) D) d) 2.0)) l)))))
(if (<= l -2e-310)
(*
(sqrt (/ d h))
(*
(/ t_0 (sqrt (- l)))
(- 1.0 (* 0.5 (/ (* h (pow (* M (* 0.5 (/ D d))) 2.0)) l)))))
(*
(/ (sqrt d) (sqrt h))
(*
(/ (sqrt d) (sqrt l))
(- 1.0 (* 0.5 (* (pow (* (/ D d) (/ M 2.0)) 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);
double tmp;
if (l <= -8.2e-79) {
tmp = (t_0 / sqrt(-h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h * pow((((0.5 * M) * D) / d), 2.0)) / l))));
} else if (l <= -2e-310) {
tmp = sqrt((d / h)) * ((t_0 / sqrt(-l)) * (1.0 - (0.5 * ((h * pow((M * (0.5 * (D / d))), 2.0)) / l))));
} else {
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * (1.0 - (0.5 * (pow(((D / d) * (M / 2.0)), 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)
if (l <= (-8.2d-79)) then
tmp = (t_0 / sqrt(-h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((h * ((((0.5d0 * m) * d_1) / d) ** 2.0d0)) / l))))
else if (l <= (-2d-310)) then
tmp = sqrt((d / h)) * ((t_0 / sqrt(-l)) * (1.0d0 - (0.5d0 * ((h * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0)) / l))))
else
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * (1.0d0 - (0.5d0 * ((((d_1 / d) * (m / 2.0d0)) ** 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);
double tmp;
if (l <= -8.2e-79) {
tmp = (t_0 / Math.sqrt(-h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * ((h * Math.pow((((0.5 * M) * D) / d), 2.0)) / l))));
} else if (l <= -2e-310) {
tmp = Math.sqrt((d / h)) * ((t_0 / Math.sqrt(-l)) * (1.0 - (0.5 * ((h * Math.pow((M * (0.5 * (D / d))), 2.0)) / l))));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * ((Math.sqrt(d) / Math.sqrt(l)) * (1.0 - (0.5 * (Math.pow(((D / d) * (M / 2.0)), 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) tmp = 0 if l <= -8.2e-79: tmp = (t_0 / math.sqrt(-h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * ((h * math.pow((((0.5 * M) * D) / d), 2.0)) / l)))) elif l <= -2e-310: tmp = math.sqrt((d / h)) * ((t_0 / math.sqrt(-l)) * (1.0 - (0.5 * ((h * math.pow((M * (0.5 * (D / d))), 2.0)) / l)))) else: tmp = (math.sqrt(d) / math.sqrt(h)) * ((math.sqrt(d) / math.sqrt(l)) * (1.0 - (0.5 * (math.pow(((D / d) * (M / 2.0)), 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)) tmp = 0.0 if (l <= -8.2e-79) tmp = Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(Float64(0.5 * M) * D) / d) ^ 2.0)) / l))))); elseif (l <= -2e-310) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(t_0 / sqrt(Float64(-l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0)) / l))))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(Float64(sqrt(d) / sqrt(l)) * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(D / d) * Float64(M / 2.0)) ^ 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);
tmp = 0.0;
if (l <= -8.2e-79)
tmp = (t_0 / sqrt(-h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h * ((((0.5 * M) * D) / d) ^ 2.0)) / l))));
elseif (l <= -2e-310)
tmp = sqrt((d / h)) * ((t_0 / sqrt(-l)) * (1.0 - (0.5 * ((h * ((M * (0.5 * (D / d))) ^ 2.0)) / l))));
else
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * (1.0 - (0.5 * ((((D / d) * (M / 2.0)) ^ 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[(-d)], $MachinePrecision]}, If[LessEqual[l, -8.2e-79], N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(N[(0.5 * M), $MachinePrecision] * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $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[(D / d), $MachinePrecision] * N[(M / 2.0), $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{-d}\\
\mathbf{if}\;\ell \leq -8.2 \cdot 10^{-79}:\\
\;\;\;\;\frac{t_0}{\sqrt{-h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{\left(0.5 \cdot M\right) \cdot D}{d}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{t_0}{\sqrt{-\ell}} \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\
\end{array}
\end{array}
if l < -8.19999999999999987e-79Initial program 52.6%
Simplified52.6%
associate-*r/52.8%
div-inv52.8%
associate-*l*52.8%
metadata-eval52.8%
Applied egg-rr52.8%
associate-*r*52.8%
metadata-eval52.8%
div-inv52.8%
associate-*r/52.8%
div-inv52.8%
metadata-eval52.8%
Applied egg-rr52.8%
frac-2neg52.8%
sqrt-div70.5%
Applied egg-rr70.5%
if -8.19999999999999987e-79 < l < -1.999999999999994e-310Initial program 68.6%
Simplified68.6%
associate-*r/75.7%
div-inv75.7%
associate-*l*75.7%
metadata-eval75.7%
Applied egg-rr75.7%
frac-2neg75.7%
sqrt-div92.3%
Applied egg-rr92.3%
if -1.999999999999994e-310 < l Initial program 62.0%
Simplified60.6%
sqrt-div77.5%
div-inv77.4%
Applied egg-rr77.4%
associate-*r/77.5%
*-rgt-identity77.5%
Simplified77.5%
sqrt-div83.4%
div-inv83.3%
Applied egg-rr83.3%
associate-*r/83.4%
*-rgt-identity83.4%
Simplified83.4%
Final simplification81.2%
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 (<=
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0)))))
2e+267)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (pow (* (/ 0.5 (sqrt (/ l h))) (/ D (/ d M))) 2.0)))))
(sqrt (pow (* d (pow (* l h) -0.5)) 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 (((pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((M * D) / (d * 2.0)), 2.0))))) <= 2e+267) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * pow(((0.5 / sqrt((l / h))) * (D / (d / M))), 2.0))));
} else {
tmp = sqrt(pow((d * pow((l * h), -0.5)), 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 / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((m * d_1) / (d * 2.0d0)) ** 2.0d0))))) <= 2d+267) then
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * (((0.5d0 / sqrt((l / h))) * (d_1 / (d / m))) ** 2.0d0))))
else
tmp = sqrt(((d * ((l * h) ** (-0.5d0))) ** 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 (((Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * Math.pow(((M * D) / (d * 2.0)), 2.0))))) <= 2e+267) {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * Math.pow(((0.5 / Math.sqrt((l / h))) * (D / (d / M))), 2.0))));
} else {
tmp = Math.sqrt(Math.pow((d * Math.pow((l * h), -0.5)), 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 ((math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * math.pow(((M * D) / (d * 2.0)), 2.0))))) <= 2e+267: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * math.pow(((0.5 / math.sqrt((l / h))) * (D / (d / M))), 2.0)))) else: tmp = math.sqrt(math.pow((d * math.pow((l * h), -0.5)), 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 (Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0))))) <= 2e+267) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * (Float64(Float64(0.5 / sqrt(Float64(l / h))) * Float64(D / Float64(d / M))) ^ 2.0))))); else tmp = sqrt((Float64(d * (Float64(l * h) ^ -0.5)) ^ 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 / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((M * D) / (d * 2.0)) ^ 2.0))))) <= 2e+267)
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * (((0.5 / sqrt((l / h))) * (D / (d / M))) ^ 2.0))));
else
tmp = sqrt(((d * ((l * h) ^ -0.5)) ^ 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[N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+267], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[Power[N[(N[(0.5 / N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[Power[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right)\right) \leq 2 \cdot 10^{+267}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(\frac{0.5}{\sqrt{\frac{\ell}{h}}} \cdot \frac{D}{\frac{d}{M}}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{{\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right)}^{2}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < 1.9999999999999999e267Initial program 85.2%
Simplified84.1%
add-sqr-sqrt84.0%
pow284.0%
sqrt-prod84.0%
sqrt-pow186.4%
metadata-eval86.4%
pow186.4%
div-inv86.4%
associate-*l*86.4%
metadata-eval86.4%
Applied egg-rr86.4%
associate-*r*86.4%
associate-*r/87.1%
sqrt-div49.7%
associate-*r/49.7%
add-sqr-sqrt30.3%
sqrt-prod47.2%
unpow247.2%
sqrt-prod47.2%
sqrt-div84.6%
associate-/l*84.8%
sqrt-div84.8%
sqrt-pow187.2%
metadata-eval87.2%
pow187.2%
associate-*r/86.6%
*-commutative86.6%
associate-*l*86.6%
Applied egg-rr86.6%
associate-/l*86.6%
associate-/r/86.6%
*-commutative86.6%
associate-/r/85.2%
Simplified85.2%
if 1.9999999999999999e267 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) Initial program 17.0%
Taylor expanded in d around inf 21.9%
add-sqr-sqrt21.4%
sqrt-unprod34.9%
pow234.9%
inv-pow34.9%
sqrt-pow134.9%
metadata-eval34.9%
Applied egg-rr34.9%
Final simplification66.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
(let* ((t_0
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0)))))))
(if (<= t_0 2e+267) t_0 (sqrt (pow (* d (pow (* l h) -0.5)) 2.0)))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((M * D) / (d * 2.0)), 2.0))));
double tmp;
if (t_0 <= 2e+267) {
tmp = t_0;
} else {
tmp = sqrt(pow((d * pow((l * h), -0.5)), 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) :: t_0
real(8) :: tmp
t_0 = (((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((m * d_1) / (d * 2.0d0)) ** 2.0d0))))
if (t_0 <= 2d+267) then
tmp = t_0
else
tmp = sqrt(((d * ((l * h) ** (-0.5d0))) ** 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 t_0 = (Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * Math.pow(((M * D) / (d * 2.0)), 2.0))));
double tmp;
if (t_0 <= 2e+267) {
tmp = t_0;
} else {
tmp = Math.sqrt(Math.pow((d * Math.pow((l * h), -0.5)), 2.0));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = (math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * math.pow(((M * D) / (d * 2.0)), 2.0)))) tmp = 0 if t_0 <= 2e+267: tmp = t_0 else: tmp = math.sqrt(math.pow((d * math.pow((l * h), -0.5)), 2.0)) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0))))) tmp = 0.0 if (t_0 <= 2e+267) tmp = t_0; else tmp = sqrt((Float64(d * (Float64(l * h) ^ -0.5)) ^ 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)
t_0 = (((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((M * D) / (d * 2.0)) ^ 2.0))));
tmp = 0.0;
if (t_0 <= 2e+267)
tmp = t_0;
else
tmp = sqrt(((d * ((l * h) ^ -0.5)) ^ 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_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e+267], t$95$0, N[Sqrt[N[Power[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right)\right)\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{+267}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{{\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right)}^{2}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < 1.9999999999999999e267Initial program 85.2%
if 1.9999999999999999e267 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) Initial program 17.0%
Taylor expanded in d around inf 21.9%
add-sqr-sqrt21.4%
sqrt-unprod34.9%
pow234.9%
inv-pow34.9%
sqrt-pow134.9%
metadata-eval34.9%
Applied egg-rr34.9%
Final simplification67.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 (sqrt (/ d l)))
(t_1 (sqrt (- d)))
(t_2 (- 1.0 (* 0.5 (/ (* h (pow (* M (* 0.5 (/ D d))) 2.0)) l)))))
(if (<= l -6.5e-55)
(*
(/ t_1 (sqrt (- h)))
(* t_0 (- 1.0 (* 0.5 (* (pow (* (/ D d) (/ M 2.0)) 2.0) (/ h l))))))
(if (<= l -2e-310)
(* (sqrt (/ d h)) (* (/ t_1 (sqrt (- l))) t_2))
(* (/ (sqrt d) (sqrt h)) (* t_0 t_2))))))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 t_1 = sqrt(-d);
double t_2 = 1.0 - (0.5 * ((h * pow((M * (0.5 * (D / d))), 2.0)) / l));
double tmp;
if (l <= -6.5e-55) {
tmp = (t_1 / sqrt(-h)) * (t_0 * (1.0 - (0.5 * (pow(((D / d) * (M / 2.0)), 2.0) * (h / l)))));
} else if (l <= -2e-310) {
tmp = sqrt((d / h)) * ((t_1 / sqrt(-l)) * t_2);
} else {
tmp = (sqrt(d) / sqrt(h)) * (t_0 * t_2);
}
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 / l))
t_1 = sqrt(-d)
t_2 = 1.0d0 - (0.5d0 * ((h * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0)) / l))
if (l <= (-6.5d-55)) then
tmp = (t_1 / sqrt(-h)) * (t_0 * (1.0d0 - (0.5d0 * ((((d_1 / d) * (m / 2.0d0)) ** 2.0d0) * (h / l)))))
else if (l <= (-2d-310)) then
tmp = sqrt((d / h)) * ((t_1 / sqrt(-l)) * t_2)
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * t_2)
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 t_1 = Math.sqrt(-d);
double t_2 = 1.0 - (0.5 * ((h * Math.pow((M * (0.5 * (D / d))), 2.0)) / l));
double tmp;
if (l <= -6.5e-55) {
tmp = (t_1 / Math.sqrt(-h)) * (t_0 * (1.0 - (0.5 * (Math.pow(((D / d) * (M / 2.0)), 2.0) * (h / l)))));
} else if (l <= -2e-310) {
tmp = Math.sqrt((d / h)) * ((t_1 / Math.sqrt(-l)) * t_2);
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * (t_0 * t_2);
}
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)) t_1 = math.sqrt(-d) t_2 = 1.0 - (0.5 * ((h * math.pow((M * (0.5 * (D / d))), 2.0)) / l)) tmp = 0 if l <= -6.5e-55: tmp = (t_1 / math.sqrt(-h)) * (t_0 * (1.0 - (0.5 * (math.pow(((D / d) * (M / 2.0)), 2.0) * (h / l))))) elif l <= -2e-310: tmp = math.sqrt((d / h)) * ((t_1 / math.sqrt(-l)) * t_2) else: tmp = (math.sqrt(d) / math.sqrt(h)) * (t_0 * t_2) 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)) t_1 = sqrt(Float64(-d)) t_2 = Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0)) / l))) tmp = 0.0 if (l <= -6.5e-55) tmp = Float64(Float64(t_1 / sqrt(Float64(-h))) * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0) * Float64(h / l)))))); elseif (l <= -2e-310) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(t_1 / sqrt(Float64(-l))) * t_2)); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(t_0 * t_2)); 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));
t_1 = sqrt(-d);
t_2 = 1.0 - (0.5 * ((h * ((M * (0.5 * (D / d))) ^ 2.0)) / l));
tmp = 0.0;
if (l <= -6.5e-55)
tmp = (t_1 / sqrt(-h)) * (t_0 * (1.0 - (0.5 * ((((D / d) * (M / 2.0)) ^ 2.0) * (h / l)))));
elseif (l <= -2e-310)
tmp = sqrt((d / h)) * ((t_1 / sqrt(-l)) * t_2);
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * t_2);
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]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -6.5e-55], N[(N[(t$95$1 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \sqrt{-d}\\
t_2 := 1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\\
\mathbf{if}\;\ell \leq -6.5 \cdot 10^{-55}:\\
\;\;\;\;\frac{t_1}{\sqrt{-h}} \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \left({\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{t_1}{\sqrt{-\ell}} \cdot t_2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(t_0 \cdot t_2\right)\\
\end{array}
\end{array}
if l < -6.50000000000000006e-55Initial program 54.0%
Simplified54.0%
frac-2neg52.8%
sqrt-div69.7%
Applied egg-rr70.9%
if -6.50000000000000006e-55 < l < -1.999999999999994e-310Initial program 65.7%
Simplified65.7%
associate-*r/74.7%
div-inv74.7%
associate-*l*74.7%
metadata-eval74.7%
Applied egg-rr74.7%
frac-2neg74.7%
sqrt-div90.5%
Applied egg-rr90.5%
if -1.999999999999994e-310 < l Initial program 62.0%
Simplified60.6%
associate-*r/62.2%
div-inv62.2%
associate-*l*62.2%
metadata-eval62.2%
Applied egg-rr62.2%
sqrt-div77.5%
div-inv77.4%
Applied egg-rr80.3%
associate-*r/77.5%
*-rgt-identity77.5%
Simplified80.4%
Final simplification79.6%
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 (* 0.5 (/ (* h (pow (* M (* 0.5 (/ D d))) 2.0)) l))))
(t_1 (* (sqrt (/ d l)) t_0))
(t_2 (sqrt (- d))))
(if (<= l -9e-71)
(* (/ t_2 (sqrt (- h))) t_1)
(if (<= l -1.7e-304)
(* (sqrt (/ d h)) (* (/ t_2 (sqrt (- l))) t_0))
(* (/ (sqrt d) (sqrt h)) t_1)))))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 - (0.5 * ((h * pow((M * (0.5 * (D / d))), 2.0)) / l));
double t_1 = sqrt((d / l)) * t_0;
double t_2 = sqrt(-d);
double tmp;
if (l <= -9e-71) {
tmp = (t_2 / sqrt(-h)) * t_1;
} else if (l <= -1.7e-304) {
tmp = sqrt((d / h)) * ((t_2 / sqrt(-l)) * t_0);
} else {
tmp = (sqrt(d) / sqrt(h)) * t_1;
}
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 = 1.0d0 - (0.5d0 * ((h * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0)) / l))
t_1 = sqrt((d / l)) * t_0
t_2 = sqrt(-d)
if (l <= (-9d-71)) then
tmp = (t_2 / sqrt(-h)) * t_1
else if (l <= (-1.7d-304)) then
tmp = sqrt((d / h)) * ((t_2 / sqrt(-l)) * t_0)
else
tmp = (sqrt(d) / sqrt(h)) * t_1
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 = 1.0 - (0.5 * ((h * Math.pow((M * (0.5 * (D / d))), 2.0)) / l));
double t_1 = Math.sqrt((d / l)) * t_0;
double t_2 = Math.sqrt(-d);
double tmp;
if (l <= -9e-71) {
tmp = (t_2 / Math.sqrt(-h)) * t_1;
} else if (l <= -1.7e-304) {
tmp = Math.sqrt((d / h)) * ((t_2 / Math.sqrt(-l)) * t_0);
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * t_1;
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = 1.0 - (0.5 * ((h * math.pow((M * (0.5 * (D / d))), 2.0)) / l)) t_1 = math.sqrt((d / l)) * t_0 t_2 = math.sqrt(-d) tmp = 0 if l <= -9e-71: tmp = (t_2 / math.sqrt(-h)) * t_1 elif l <= -1.7e-304: tmp = math.sqrt((d / h)) * ((t_2 / math.sqrt(-l)) * t_0) else: tmp = (math.sqrt(d) / math.sqrt(h)) * t_1 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(0.5 * Float64(Float64(h * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0)) / l))) t_1 = Float64(sqrt(Float64(d / l)) * t_0) t_2 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -9e-71) tmp = Float64(Float64(t_2 / sqrt(Float64(-h))) * t_1); elseif (l <= -1.7e-304) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(t_2 / sqrt(Float64(-l))) * t_0)); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * t_1); 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 = 1.0 - (0.5 * ((h * ((M * (0.5 * (D / d))) ^ 2.0)) / l));
t_1 = sqrt((d / l)) * t_0;
t_2 = sqrt(-d);
tmp = 0.0;
if (l <= -9e-71)
tmp = (t_2 / sqrt(-h)) * t_1;
elseif (l <= -1.7e-304)
tmp = sqrt((d / h)) * ((t_2 / sqrt(-l)) * t_0);
else
tmp = (sqrt(d) / sqrt(h)) * t_1;
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[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -9e-71], N[(N[(t$95$2 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[l, -1.7e-304], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$2 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := 1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\\
t_1 := \sqrt{\frac{d}{\ell}} \cdot t_0\\
t_2 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -9 \cdot 10^{-71}:\\
\;\;\;\;\frac{t_2}{\sqrt{-h}} \cdot t_1\\
\mathbf{elif}\;\ell \leq -1.7 \cdot 10^{-304}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{t_2}{\sqrt{-\ell}} \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot t_1\\
\end{array}
\end{array}
if l < -9.0000000000000004e-71Initial program 52.6%
Simplified52.6%
associate-*r/52.8%
div-inv52.8%
associate-*l*52.8%
metadata-eval52.8%
Applied egg-rr52.8%
frac-2neg52.8%
sqrt-div70.5%
Applied egg-rr70.5%
if -9.0000000000000004e-71 < l < -1.6999999999999999e-304Initial program 70.2%
Simplified70.2%
associate-*r/77.4%
div-inv77.4%
associate-*l*77.4%
metadata-eval77.4%
Applied egg-rr77.4%
frac-2neg77.4%
sqrt-div94.4%
Applied egg-rr94.4%
if -1.6999999999999999e-304 < l Initial program 61.6%
Simplified60.2%
associate-*r/61.8%
div-inv61.8%
associate-*l*61.8%
metadata-eval61.8%
Applied egg-rr61.8%
sqrt-div76.9%
div-inv76.8%
Applied egg-rr79.8%
associate-*r/76.9%
*-rgt-identity76.9%
Simplified79.9%
Final simplification79.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
(let* ((t_0 (sqrt (/ d l)))
(t_1 (sqrt (- d)))
(t_2 (- 1.0 (* 0.5 (/ (* h (pow (* M (* 0.5 (/ D d))) 2.0)) l)))))
(if (<= l -4e-69)
(*
(/ t_1 (sqrt (- h)))
(* t_0 (- 1.0 (* 0.5 (/ (* h (pow (/ (* (* 0.5 M) D) d) 2.0)) l)))))
(if (<= l -2e-310)
(* (sqrt (/ d h)) (* (/ t_1 (sqrt (- l))) t_2))
(* (/ (sqrt d) (sqrt h)) (* t_0 t_2))))))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 t_1 = sqrt(-d);
double t_2 = 1.0 - (0.5 * ((h * pow((M * (0.5 * (D / d))), 2.0)) / l));
double tmp;
if (l <= -4e-69) {
tmp = (t_1 / sqrt(-h)) * (t_0 * (1.0 - (0.5 * ((h * pow((((0.5 * M) * D) / d), 2.0)) / l))));
} else if (l <= -2e-310) {
tmp = sqrt((d / h)) * ((t_1 / sqrt(-l)) * t_2);
} else {
tmp = (sqrt(d) / sqrt(h)) * (t_0 * t_2);
}
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 / l))
t_1 = sqrt(-d)
t_2 = 1.0d0 - (0.5d0 * ((h * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0)) / l))
if (l <= (-4d-69)) then
tmp = (t_1 / sqrt(-h)) * (t_0 * (1.0d0 - (0.5d0 * ((h * ((((0.5d0 * m) * d_1) / d) ** 2.0d0)) / l))))
else if (l <= (-2d-310)) then
tmp = sqrt((d / h)) * ((t_1 / sqrt(-l)) * t_2)
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * t_2)
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 t_1 = Math.sqrt(-d);
double t_2 = 1.0 - (0.5 * ((h * Math.pow((M * (0.5 * (D / d))), 2.0)) / l));
double tmp;
if (l <= -4e-69) {
tmp = (t_1 / Math.sqrt(-h)) * (t_0 * (1.0 - (0.5 * ((h * Math.pow((((0.5 * M) * D) / d), 2.0)) / l))));
} else if (l <= -2e-310) {
tmp = Math.sqrt((d / h)) * ((t_1 / Math.sqrt(-l)) * t_2);
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * (t_0 * t_2);
}
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)) t_1 = math.sqrt(-d) t_2 = 1.0 - (0.5 * ((h * math.pow((M * (0.5 * (D / d))), 2.0)) / l)) tmp = 0 if l <= -4e-69: tmp = (t_1 / math.sqrt(-h)) * (t_0 * (1.0 - (0.5 * ((h * math.pow((((0.5 * M) * D) / d), 2.0)) / l)))) elif l <= -2e-310: tmp = math.sqrt((d / h)) * ((t_1 / math.sqrt(-l)) * t_2) else: tmp = (math.sqrt(d) / math.sqrt(h)) * (t_0 * t_2) 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)) t_1 = sqrt(Float64(-d)) t_2 = Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0)) / l))) tmp = 0.0 if (l <= -4e-69) tmp = Float64(Float64(t_1 / sqrt(Float64(-h))) * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(Float64(0.5 * M) * D) / d) ^ 2.0)) / l))))); elseif (l <= -2e-310) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(t_1 / sqrt(Float64(-l))) * t_2)); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(t_0 * t_2)); 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));
t_1 = sqrt(-d);
t_2 = 1.0 - (0.5 * ((h * ((M * (0.5 * (D / d))) ^ 2.0)) / l));
tmp = 0.0;
if (l <= -4e-69)
tmp = (t_1 / sqrt(-h)) * (t_0 * (1.0 - (0.5 * ((h * ((((0.5 * M) * D) / d) ^ 2.0)) / l))));
elseif (l <= -2e-310)
tmp = sqrt((d / h)) * ((t_1 / sqrt(-l)) * t_2);
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * t_2);
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]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -4e-69], N[(N[(t$95$1 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(N[(0.5 * M), $MachinePrecision] * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \sqrt{-d}\\
t_2 := 1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\\
\mathbf{if}\;\ell \leq -4 \cdot 10^{-69}:\\
\;\;\;\;\frac{t_1}{\sqrt{-h}} \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{\left(0.5 \cdot M\right) \cdot D}{d}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{t_1}{\sqrt{-\ell}} \cdot t_2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(t_0 \cdot t_2\right)\\
\end{array}
\end{array}
if l < -3.9999999999999999e-69Initial program 52.6%
Simplified52.6%
associate-*r/52.8%
div-inv52.8%
associate-*l*52.8%
metadata-eval52.8%
Applied egg-rr52.8%
associate-*r*52.8%
metadata-eval52.8%
div-inv52.8%
associate-*r/52.8%
div-inv52.8%
metadata-eval52.8%
Applied egg-rr52.8%
frac-2neg52.8%
sqrt-div70.5%
Applied egg-rr70.5%
if -3.9999999999999999e-69 < l < -1.999999999999994e-310Initial program 68.6%
Simplified68.6%
associate-*r/75.7%
div-inv75.7%
associate-*l*75.7%
metadata-eval75.7%
Applied egg-rr75.7%
frac-2neg75.7%
sqrt-div92.3%
Applied egg-rr92.3%
if -1.999999999999994e-310 < l Initial program 62.0%
Simplified60.6%
associate-*r/62.2%
div-inv62.2%
associate-*l*62.2%
metadata-eval62.2%
Applied egg-rr62.2%
sqrt-div77.5%
div-inv77.4%
Applied egg-rr80.3%
associate-*r/77.5%
*-rgt-identity77.5%
Simplified80.4%
Final simplification79.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
(let* ((t_0 (sqrt (/ d h))))
(if (<= d 1.12e-302)
(*
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (/ (* h (pow (/ (* (* 0.5 M) D) d) 2.0)) l))))
t_0)
(if (<= d 7e-211)
(*
-0.125
(/ (* (sqrt (/ h (pow l 3.0))) (pow D 2.0)) (/ d (pow M 2.0))))
(*
t_0
(*
(- 1.0 (* 0.5 (/ (* h (pow (* M (* 0.5 (/ D d))) 2.0)) l)))
(/ (sqrt d) (sqrt 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 tmp;
if (d <= 1.12e-302) {
tmp = (sqrt((d / l)) * (1.0 - (0.5 * ((h * pow((((0.5 * M) * D) / d), 2.0)) / l)))) * t_0;
} else if (d <= 7e-211) {
tmp = -0.125 * ((sqrt((h / pow(l, 3.0))) * pow(D, 2.0)) / (d / pow(M, 2.0)));
} else {
tmp = t_0 * ((1.0 - (0.5 * ((h * pow((M * (0.5 * (D / d))), 2.0)) / l))) * (sqrt(d) / sqrt(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 / h))
if (d <= 1.12d-302) then
tmp = (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((h * ((((0.5d0 * m) * d_1) / d) ** 2.0d0)) / l)))) * t_0
else if (d <= 7d-211) then
tmp = (-0.125d0) * ((sqrt((h / (l ** 3.0d0))) * (d_1 ** 2.0d0)) / (d / (m ** 2.0d0)))
else
tmp = t_0 * ((1.0d0 - (0.5d0 * ((h * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0)) / l))) * (sqrt(d) / sqrt(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 tmp;
if (d <= 1.12e-302) {
tmp = (Math.sqrt((d / l)) * (1.0 - (0.5 * ((h * Math.pow((((0.5 * M) * D) / d), 2.0)) / l)))) * t_0;
} else if (d <= 7e-211) {
tmp = -0.125 * ((Math.sqrt((h / Math.pow(l, 3.0))) * Math.pow(D, 2.0)) / (d / Math.pow(M, 2.0)));
} else {
tmp = t_0 * ((1.0 - (0.5 * ((h * Math.pow((M * (0.5 * (D / d))), 2.0)) / l))) * (Math.sqrt(d) / Math.sqrt(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)) tmp = 0 if d <= 1.12e-302: tmp = (math.sqrt((d / l)) * (1.0 - (0.5 * ((h * math.pow((((0.5 * M) * D) / d), 2.0)) / l)))) * t_0 elif d <= 7e-211: tmp = -0.125 * ((math.sqrt((h / math.pow(l, 3.0))) * math.pow(D, 2.0)) / (d / math.pow(M, 2.0))) else: tmp = t_0 * ((1.0 - (0.5 * ((h * math.pow((M * (0.5 * (D / d))), 2.0)) / l))) * (math.sqrt(d) / math.sqrt(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)) tmp = 0.0 if (d <= 1.12e-302) tmp = Float64(Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(Float64(0.5 * M) * D) / d) ^ 2.0)) / l)))) * t_0); elseif (d <= 7e-211) tmp = Float64(-0.125 * Float64(Float64(sqrt(Float64(h / (l ^ 3.0))) * (D ^ 2.0)) / Float64(d / (M ^ 2.0)))); else tmp = Float64(t_0 * Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0)) / l))) * Float64(sqrt(d) / sqrt(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));
tmp = 0.0;
if (d <= 1.12e-302)
tmp = (sqrt((d / l)) * (1.0 - (0.5 * ((h * ((((0.5 * M) * D) / d) ^ 2.0)) / l)))) * t_0;
elseif (d <= 7e-211)
tmp = -0.125 * ((sqrt((h / (l ^ 3.0))) * (D ^ 2.0)) / (d / (M ^ 2.0)));
else
tmp = t_0 * ((1.0 - (0.5 * ((h * ((M * (0.5 * (D / d))) ^ 2.0)) / l))) * (sqrt(d) / sqrt(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]}, If[LessEqual[d, 1.12e-302], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(N[(0.5 * M), $MachinePrecision] * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[d, 7e-211], N[(-0.125 * N[(N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[D, 2.0], $MachinePrecision]), $MachinePrecision] / N[(d / N[Power[M, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[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}}\\
\mathbf{if}\;d \leq 1.12 \cdot 10^{-302}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{\left(0.5 \cdot M\right) \cdot D}{d}\right)}^{2}}{\ell}\right)\right) \cdot t_0\\
\mathbf{elif}\;d \leq 7 \cdot 10^{-211}:\\
\;\;\;\;-0.125 \cdot \frac{\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}}{\frac{d}{{M}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(\left(1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right) \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\end{array}
\end{array}
if d < 1.12e-302Initial program 58.5%
Simplified58.5%
associate-*r/61.3%
div-inv61.3%
associate-*l*61.3%
metadata-eval61.3%
Applied egg-rr61.3%
associate-*r*61.3%
metadata-eval61.3%
div-inv61.3%
associate-*r/61.3%
div-inv61.3%
metadata-eval61.3%
Applied egg-rr61.3%
if 1.12e-302 < d < 7e-211Initial program 34.0%
Simplified34.0%
sqrt-div74.7%
div-inv74.7%
Applied egg-rr74.7%
associate-*r/74.7%
*-rgt-identity74.7%
Simplified74.7%
Taylor expanded in d around 0 63.6%
*-commutative63.6%
associate-/l*63.5%
associate-*r/63.6%
Simplified63.6%
if 7e-211 < d Initial program 69.2%
Simplified67.4%
associate-*r/69.5%
div-inv69.5%
associate-*l*69.5%
metadata-eval69.5%
Applied egg-rr69.5%
sqrt-div84.3%
div-inv84.3%
Applied egg-rr78.8%
associate-*r/84.3%
*-rgt-identity84.3%
Simplified78.8%
Final simplification68.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
(let* ((t_0 (sqrt (/ d h)))
(t_1 (- 1.0 (* 0.5 (/ (* h (pow (/ (* (* 0.5 M) D) d) 2.0)) l)))))
(if (<= d 7.6e-303)
(* (* (sqrt (/ d l)) t_1) t_0)
(if (<= d 4.2e-211)
(*
-0.125
(/ (* (sqrt (/ h (pow l 3.0))) (pow D 2.0)) (/ d (pow M 2.0))))
(* t_0 (* t_1 (/ (sqrt d) (sqrt 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 = 1.0 - (0.5 * ((h * pow((((0.5 * M) * D) / d), 2.0)) / l));
double tmp;
if (d <= 7.6e-303) {
tmp = (sqrt((d / l)) * t_1) * t_0;
} else if (d <= 4.2e-211) {
tmp = -0.125 * ((sqrt((h / pow(l, 3.0))) * pow(D, 2.0)) / (d / pow(M, 2.0)));
} else {
tmp = t_0 * (t_1 * (sqrt(d) / sqrt(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) :: tmp
t_0 = sqrt((d / h))
t_1 = 1.0d0 - (0.5d0 * ((h * ((((0.5d0 * m) * d_1) / d) ** 2.0d0)) / l))
if (d <= 7.6d-303) then
tmp = (sqrt((d / l)) * t_1) * t_0
else if (d <= 4.2d-211) then
tmp = (-0.125d0) * ((sqrt((h / (l ** 3.0d0))) * (d_1 ** 2.0d0)) / (d / (m ** 2.0d0)))
else
tmp = t_0 * (t_1 * (sqrt(d) / sqrt(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 = 1.0 - (0.5 * ((h * Math.pow((((0.5 * M) * D) / d), 2.0)) / l));
double tmp;
if (d <= 7.6e-303) {
tmp = (Math.sqrt((d / l)) * t_1) * t_0;
} else if (d <= 4.2e-211) {
tmp = -0.125 * ((Math.sqrt((h / Math.pow(l, 3.0))) * Math.pow(D, 2.0)) / (d / Math.pow(M, 2.0)));
} else {
tmp = t_0 * (t_1 * (Math.sqrt(d) / Math.sqrt(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 = 1.0 - (0.5 * ((h * math.pow((((0.5 * M) * D) / d), 2.0)) / l)) tmp = 0 if d <= 7.6e-303: tmp = (math.sqrt((d / l)) * t_1) * t_0 elif d <= 4.2e-211: tmp = -0.125 * ((math.sqrt((h / math.pow(l, 3.0))) * math.pow(D, 2.0)) / (d / math.pow(M, 2.0))) else: tmp = t_0 * (t_1 * (math.sqrt(d) / math.sqrt(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(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(Float64(0.5 * M) * D) / d) ^ 2.0)) / l))) tmp = 0.0 if (d <= 7.6e-303) tmp = Float64(Float64(sqrt(Float64(d / l)) * t_1) * t_0); elseif (d <= 4.2e-211) tmp = Float64(-0.125 * Float64(Float64(sqrt(Float64(h / (l ^ 3.0))) * (D ^ 2.0)) / Float64(d / (M ^ 2.0)))); else tmp = Float64(t_0 * Float64(t_1 * Float64(sqrt(d) / sqrt(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 = 1.0 - (0.5 * ((h * ((((0.5 * M) * D) / d) ^ 2.0)) / l));
tmp = 0.0;
if (d <= 7.6e-303)
tmp = (sqrt((d / l)) * t_1) * t_0;
elseif (d <= 4.2e-211)
tmp = -0.125 * ((sqrt((h / (l ^ 3.0))) * (D ^ 2.0)) / (d / (M ^ 2.0)));
else
tmp = t_0 * (t_1 * (sqrt(d) / sqrt(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[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(N[(0.5 * M), $MachinePrecision] * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, 7.6e-303], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[d, 4.2e-211], N[(-0.125 * N[(N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[D, 2.0], $MachinePrecision]), $MachinePrecision] / N[(d / N[Power[M, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(t$95$1 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[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 := 1 - 0.5 \cdot \frac{h \cdot {\left(\frac{\left(0.5 \cdot M\right) \cdot D}{d}\right)}^{2}}{\ell}\\
\mathbf{if}\;d \leq 7.6 \cdot 10^{-303}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot t_1\right) \cdot t_0\\
\mathbf{elif}\;d \leq 4.2 \cdot 10^{-211}:\\
\;\;\;\;-0.125 \cdot \frac{\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}}{\frac{d}{{M}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(t_1 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\end{array}
\end{array}
if d < 7.60000000000000018e-303Initial program 58.5%
Simplified58.5%
associate-*r/61.3%
div-inv61.3%
associate-*l*61.3%
metadata-eval61.3%
Applied egg-rr61.3%
associate-*r*61.3%
metadata-eval61.3%
div-inv61.3%
associate-*r/61.3%
div-inv61.3%
metadata-eval61.3%
Applied egg-rr61.3%
if 7.60000000000000018e-303 < d < 4.20000000000000015e-211Initial program 34.0%
Simplified34.0%
sqrt-div74.7%
div-inv74.7%
Applied egg-rr74.7%
associate-*r/74.7%
*-rgt-identity74.7%
Simplified74.7%
Taylor expanded in d around 0 63.6%
*-commutative63.6%
associate-/l*63.5%
associate-*r/63.6%
Simplified63.6%
if 4.20000000000000015e-211 < d Initial program 69.2%
Simplified67.4%
associate-*r/69.5%
div-inv69.5%
associate-*l*69.5%
metadata-eval69.5%
Applied egg-rr69.5%
associate-*r*69.5%
metadata-eval69.5%
div-inv69.5%
associate-*r/70.5%
div-inv70.5%
metadata-eval70.5%
Applied egg-rr70.5%
sqrt-div84.3%
div-inv84.3%
Applied egg-rr79.7%
associate-*r/84.3%
*-rgt-identity84.3%
Simplified79.7%
Final simplification69.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 -2e-310)
(*
(sqrt (/ d h))
(*
(/ (sqrt (- d)) (sqrt (- l)))
(- 1.0 (* 0.5 (* (pow (* (/ D d) (/ M 2.0)) 2.0) (/ h l))))))
(*
(/ (sqrt d) (sqrt h))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (/ (* h (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 (h <= -2e-310) {
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * (1.0 - (0.5 * (pow(((D / d) * (M / 2.0)), 2.0) * (h / l)))));
} else {
tmp = (sqrt(d) / sqrt(h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h * 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 (h <= (-2d-310)) then
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * (1.0d0 - (0.5d0 * ((((d_1 / d) * (m / 2.0d0)) ** 2.0d0) * (h / l)))))
else
tmp = (sqrt(d) / sqrt(h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((h * ((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 (h <= -2e-310) {
tmp = Math.sqrt((d / h)) * ((Math.sqrt(-d) / Math.sqrt(-l)) * (1.0 - (0.5 * (Math.pow(((D / d) * (M / 2.0)), 2.0) * (h / l)))));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * ((h * 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 h <= -2e-310: tmp = math.sqrt((d / h)) * ((math.sqrt(-d) / math.sqrt(-l)) * (1.0 - (0.5 * (math.pow(((D / d) * (M / 2.0)), 2.0) * (h / l))))) else: tmp = (math.sqrt(d) / math.sqrt(h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * ((h * 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 (h <= -2e-310) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0) * Float64(h / l)))))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (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 (h <= -2e-310)
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * (1.0 - (0.5 * ((((D / d) * (M / 2.0)) ^ 2.0) * (h / l)))));
else
tmp = (sqrt(d) / sqrt(h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h * ((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[h, -2e-310], N[(N[Sqrt[N[(d / 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[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $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 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\right)\\
\end{array}
\end{array}
if h < -1.999999999999994e-310Initial program 58.6%
Simplified58.6%
frac-2neg61.5%
sqrt-div73.7%
Applied egg-rr66.5%
if -1.999999999999994e-310 < h Initial program 62.0%
Simplified60.6%
associate-*r/62.2%
div-inv62.2%
associate-*l*62.2%
metadata-eval62.2%
Applied egg-rr62.2%
sqrt-div77.5%
div-inv77.4%
Applied egg-rr80.3%
associate-*r/77.5%
*-rgt-identity77.5%
Simplified80.4%
Final simplification74.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 (* 0.5 (/ (* h (pow (* M (* 0.5 (/ D d))) 2.0)) l)))))
(if (<= l -1.7e-304)
(* (sqrt (/ d h)) (* (/ (sqrt (- d)) (sqrt (- l))) t_0))
(* (/ (sqrt d) (sqrt h)) (* (sqrt (/ d l)) t_0)))))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 - (0.5 * ((h * pow((M * (0.5 * (D / d))), 2.0)) / l));
double tmp;
if (l <= -1.7e-304) {
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * t_0);
} else {
tmp = (sqrt(d) / sqrt(h)) * (sqrt((d / l)) * t_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) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - (0.5d0 * ((h * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0)) / l))
if (l <= (-1.7d-304)) then
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * t_0)
else
tmp = (sqrt(d) / sqrt(h)) * (sqrt((d / l)) * t_0)
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 = 1.0 - (0.5 * ((h * Math.pow((M * (0.5 * (D / d))), 2.0)) / l));
double tmp;
if (l <= -1.7e-304) {
tmp = Math.sqrt((d / h)) * ((Math.sqrt(-d) / Math.sqrt(-l)) * t_0);
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * (Math.sqrt((d / l)) * t_0);
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = 1.0 - (0.5 * ((h * math.pow((M * (0.5 * (D / d))), 2.0)) / l)) tmp = 0 if l <= -1.7e-304: tmp = math.sqrt((d / h)) * ((math.sqrt(-d) / math.sqrt(-l)) * t_0) else: tmp = (math.sqrt(d) / math.sqrt(h)) * (math.sqrt((d / l)) * t_0) 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(0.5 * Float64(Float64(h * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0)) / l))) tmp = 0.0 if (l <= -1.7e-304) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * t_0)); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(sqrt(Float64(d / l)) * t_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)
t_0 = 1.0 - (0.5 * ((h * ((M * (0.5 * (D / d))) ^ 2.0)) / l));
tmp = 0.0;
if (l <= -1.7e-304)
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * t_0);
else
tmp = (sqrt(d) / sqrt(h)) * (sqrt((d / l)) * t_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_] := Block[{t$95$0 = N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.7e-304], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := 1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\\
\mathbf{if}\;\ell \leq -1.7 \cdot 10^{-304}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot t_0\right)\\
\end{array}
\end{array}
if l < -1.6999999999999999e-304Initial program 59.1%
Simplified59.1%
associate-*r/62.0%
div-inv62.0%
associate-*l*62.0%
metadata-eval62.0%
Applied egg-rr62.0%
frac-2neg62.0%
sqrt-div74.3%
Applied egg-rr74.3%
if -1.6999999999999999e-304 < l Initial program 61.6%
Simplified60.2%
associate-*r/61.8%
div-inv61.8%
associate-*l*61.8%
metadata-eval61.8%
Applied egg-rr61.8%
sqrt-div76.9%
div-inv76.8%
Applied egg-rr79.8%
associate-*r/76.9%
*-rgt-identity76.9%
Simplified79.9%
Final simplification77.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 (<= l -1.7e-304)
(*
(sqrt (/ d h))
(*
(- 1.0 (* 0.5 (/ (* h (pow (/ (* (* 0.5 M) D) d) 2.0)) l)))
(/ (sqrt (- d)) (sqrt (- l)))))
(*
(/ (sqrt d) (sqrt h))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (/ (* h (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 (l <= -1.7e-304) {
tmp = sqrt((d / h)) * ((1.0 - (0.5 * ((h * pow((((0.5 * M) * D) / d), 2.0)) / l))) * (sqrt(-d) / sqrt(-l)));
} else {
tmp = (sqrt(d) / sqrt(h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h * 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 (l <= (-1.7d-304)) then
tmp = sqrt((d / h)) * ((1.0d0 - (0.5d0 * ((h * ((((0.5d0 * m) * d_1) / d) ** 2.0d0)) / l))) * (sqrt(-d) / sqrt(-l)))
else
tmp = (sqrt(d) / sqrt(h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((h * ((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 (l <= -1.7e-304) {
tmp = Math.sqrt((d / h)) * ((1.0 - (0.5 * ((h * Math.pow((((0.5 * M) * D) / d), 2.0)) / l))) * (Math.sqrt(-d) / Math.sqrt(-l)));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * ((h * 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 l <= -1.7e-304: tmp = math.sqrt((d / h)) * ((1.0 - (0.5 * ((h * math.pow((((0.5 * M) * D) / d), 2.0)) / l))) * (math.sqrt(-d) / math.sqrt(-l))) else: tmp = (math.sqrt(d) / math.sqrt(h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * ((h * 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 (l <= -1.7e-304) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(Float64(0.5 * M) * D) / d) ^ 2.0)) / l))) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (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 (l <= -1.7e-304)
tmp = sqrt((d / h)) * ((1.0 - (0.5 * ((h * ((((0.5 * M) * D) / d) ^ 2.0)) / l))) * (sqrt(-d) / sqrt(-l)));
else
tmp = (sqrt(d) / sqrt(h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h * ((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[l, -1.7e-304], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(N[(0.5 * M), $MachinePrecision] * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $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 -1.7 \cdot 10^{-304}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{\left(0.5 \cdot M\right) \cdot D}{d}\right)}^{2}}{\ell}\right) \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\right)\\
\end{array}
\end{array}
if l < -1.6999999999999999e-304Initial program 59.1%
Simplified59.1%
associate-*r/62.0%
div-inv62.0%
associate-*l*62.0%
metadata-eval62.0%
Applied egg-rr62.0%
associate-*r*62.0%
metadata-eval62.0%
div-inv62.0%
associate-*r/62.0%
div-inv62.0%
metadata-eval62.0%
Applied egg-rr62.0%
frac-2neg62.0%
sqrt-div74.3%
Applied egg-rr74.3%
if -1.6999999999999999e-304 < l Initial program 61.6%
Simplified60.2%
associate-*r/61.8%
div-inv61.8%
associate-*l*61.8%
metadata-eval61.8%
Applied egg-rr61.8%
sqrt-div76.9%
div-inv76.8%
Applied egg-rr79.8%
associate-*r/76.9%
*-rgt-identity76.9%
Simplified79.9%
Final simplification77.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 1.06e-240)
(*
(* t_0 (- 1.0 (* 0.5 (/ (* h (pow (/ (* (* 0.5 M) D) d) 2.0)) l))))
(/ 1.0 (sqrt (/ h d))))
(*
(/ (sqrt d) (sqrt h))
(* t_0 (- 1.0 (* 0.5 (* (pow (* (/ D d) (/ M 2.0)) 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 <= 1.06e-240) {
tmp = (t_0 * (1.0 - (0.5 * ((h * pow((((0.5 * M) * D) / d), 2.0)) / l)))) * (1.0 / sqrt((h / d)));
} else {
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0 - (0.5 * (pow(((D / d) * (M / 2.0)), 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 <= 1.06d-240) then
tmp = (t_0 * (1.0d0 - (0.5d0 * ((h * ((((0.5d0 * m) * d_1) / d) ** 2.0d0)) / l)))) * (1.0d0 / sqrt((h / d)))
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0d0 - (0.5d0 * ((((d_1 / d) * (m / 2.0d0)) ** 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 <= 1.06e-240) {
tmp = (t_0 * (1.0 - (0.5 * ((h * Math.pow((((0.5 * M) * D) / d), 2.0)) / l)))) * (1.0 / Math.sqrt((h / d)));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * (t_0 * (1.0 - (0.5 * (Math.pow(((D / d) * (M / 2.0)), 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 <= 1.06e-240: tmp = (t_0 * (1.0 - (0.5 * ((h * math.pow((((0.5 * M) * D) / d), 2.0)) / l)))) * (1.0 / math.sqrt((h / d))) else: tmp = (math.sqrt(d) / math.sqrt(h)) * (t_0 * (1.0 - (0.5 * (math.pow(((D / d) * (M / 2.0)), 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 <= 1.06e-240) tmp = Float64(Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(Float64(0.5 * M) * D) / d) ^ 2.0)) / l)))) * Float64(1.0 / sqrt(Float64(h / d)))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(D / d) * Float64(M / 2.0)) ^ 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 <= 1.06e-240)
tmp = (t_0 * (1.0 - (0.5 * ((h * ((((0.5 * M) * D) / d) ^ 2.0)) / l)))) * (1.0 / sqrt((h / d)));
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0 - (0.5 * ((((D / d) * (M / 2.0)) ^ 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, 1.06e-240], N[(N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(N[(0.5 * M), $MachinePrecision] * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $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[(D / d), $MachinePrecision] * N[(M / 2.0), $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 1.06 \cdot 10^{-240}:\\
\;\;\;\;\left(t_0 \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{\left(0.5 \cdot M\right) \cdot D}{d}\right)}^{2}}{\ell}\right)\right) \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \left({\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\
\end{array}
\end{array}
if l < 1.06e-240Initial program 58.1%
Simplified58.2%
associate-*r/61.7%
div-inv61.7%
associate-*l*61.7%
metadata-eval61.7%
Applied egg-rr61.7%
associate-*r*61.7%
metadata-eval61.7%
div-inv61.7%
associate-*r/61.7%
div-inv61.7%
metadata-eval61.7%
Applied egg-rr61.7%
clear-num61.3%
sqrt-div62.4%
metadata-eval62.4%
Applied egg-rr62.4%
if 1.06e-240 < l Initial program 62.7%
Simplified61.2%
sqrt-div79.1%
div-inv79.0%
Applied egg-rr79.0%
associate-*r/79.1%
*-rgt-identity79.1%
Simplified79.1%
Final simplification70.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
(let* ((t_0 (sqrt (/ d l))))
(if (<= h 2.55e-284)
(*
(* t_0 (- 1.0 (* 0.5 (/ (* h (pow (/ (* (* 0.5 M) D) d) 2.0)) l))))
(/ 1.0 (sqrt (/ h d))))
(*
(/ (sqrt d) (sqrt h))
(* t_0 (- 1.0 (* 0.5 (/ (* h (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 t_0 = sqrt((d / l));
double tmp;
if (h <= 2.55e-284) {
tmp = (t_0 * (1.0 - (0.5 * ((h * pow((((0.5 * M) * D) / d), 2.0)) / l)))) * (1.0 / sqrt((h / d)));
} else {
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0 - (0.5 * ((h * 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) :: t_0
real(8) :: tmp
t_0 = sqrt((d / l))
if (h <= 2.55d-284) then
tmp = (t_0 * (1.0d0 - (0.5d0 * ((h * ((((0.5d0 * m) * d_1) / d) ** 2.0d0)) / l)))) * (1.0d0 / sqrt((h / d)))
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0d0 - (0.5d0 * ((h * ((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 t_0 = Math.sqrt((d / l));
double tmp;
if (h <= 2.55e-284) {
tmp = (t_0 * (1.0 - (0.5 * ((h * Math.pow((((0.5 * M) * D) / d), 2.0)) / l)))) * (1.0 / Math.sqrt((h / d)));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * (t_0 * (1.0 - (0.5 * ((h * 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): t_0 = math.sqrt((d / l)) tmp = 0 if h <= 2.55e-284: tmp = (t_0 * (1.0 - (0.5 * ((h * math.pow((((0.5 * M) * D) / d), 2.0)) / l)))) * (1.0 / math.sqrt((h / d))) else: tmp = (math.sqrt(d) / math.sqrt(h)) * (t_0 * (1.0 - (0.5 * ((h * 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) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (h <= 2.55e-284) tmp = Float64(Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(Float64(0.5 * M) * D) / d) ^ 2.0)) / l)))) * Float64(1.0 / sqrt(Float64(h / d)))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (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)
t_0 = sqrt((d / l));
tmp = 0.0;
if (h <= 2.55e-284)
tmp = (t_0 * (1.0 - (0.5 * ((h * ((((0.5 * M) * D) / d) ^ 2.0)) / l)))) * (1.0 / sqrt((h / d)));
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0 - (0.5 * ((h * ((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_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, 2.55e-284], N[(N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(N[(0.5 * M), $MachinePrecision] * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $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[(h * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $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}\;h \leq 2.55 \cdot 10^{-284}:\\
\;\;\;\;\left(t_0 \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{\left(0.5 \cdot M\right) \cdot D}{d}\right)}^{2}}{\ell}\right)\right) \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\right)\\
\end{array}
\end{array}
if h < 2.5500000000000001e-284Initial program 59.6%
Simplified59.6%
associate-*r/62.3%
div-inv62.3%
associate-*l*62.3%
metadata-eval62.3%
Applied egg-rr62.3%
associate-*r*62.3%
metadata-eval62.3%
div-inv62.3%
associate-*r/62.3%
div-inv62.3%
metadata-eval62.3%
Applied egg-rr62.3%
clear-num61.9%
sqrt-div63.0%
metadata-eval63.0%
Applied egg-rr63.0%
if 2.5500000000000001e-284 < h Initial program 61.3%
Simplified59.8%
associate-*r/61.5%
div-inv61.5%
associate-*l*61.5%
metadata-eval61.5%
Applied egg-rr61.5%
sqrt-div77.3%
div-inv77.2%
Applied egg-rr80.3%
associate-*r/77.3%
*-rgt-identity77.3%
Simplified80.4%
Final simplification72.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 (<= l 1.7e+74)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (* (pow (* (/ D d) (/ M 2.0)) 2.0) (/ h l))))))
(* d (/ (sqrt (/ 1.0 h)) (sqrt 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 <= 1.7e+74) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * (pow(((D / d) * (M / 2.0)), 2.0) * (h / l)))));
} else {
tmp = d * (sqrt((1.0 / h)) / sqrt(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 <= 1.7d+74) then
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((((d_1 / d) * (m / 2.0d0)) ** 2.0d0) * (h / l)))))
else
tmp = d * (sqrt((1.0d0 / h)) / sqrt(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 <= 1.7e+74) {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * (Math.pow(((D / d) * (M / 2.0)), 2.0) * (h / l)))));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(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 <= 1.7e+74: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * (math.pow(((D / d) * (M / 2.0)), 2.0) * (h / l))))) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(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 <= 1.7e+74) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0) * Float64(h / l)))))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(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 <= 1.7e+74)
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((((D / d) * (M / 2.0)) ^ 2.0) * (h / l)))));
else
tmp = d * (sqrt((1.0 / h)) / sqrt(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, 1.7e+74], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.7 \cdot 10^{+74}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 1.7e74Initial program 62.3%
Simplified61.3%
if 1.7e74 < l Initial program 53.1%
Taylor expanded in d around inf 54.7%
associate-/r*54.7%
sqrt-div72.7%
Applied egg-rr72.7%
Final simplification63.6%
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 1.8e+74)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (* (/ h l) (pow (/ (* M (* 0.5 D)) d) 2.0))))))
(* d (/ (sqrt (/ 1.0 h)) (sqrt 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 <= 1.8e+74) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * pow(((M * (0.5 * D)) / d), 2.0)))));
} else {
tmp = d * (sqrt((1.0 / h)) / sqrt(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 <= 1.8d+74) then
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((h / l) * (((m * (0.5d0 * d_1)) / d) ** 2.0d0)))))
else
tmp = d * (sqrt((1.0d0 / h)) / sqrt(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 <= 1.8e+74) {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * Math.pow(((M * (0.5 * D)) / d), 2.0)))));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(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 <= 1.8e+74: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * math.pow(((M * (0.5 * D)) / d), 2.0))))) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(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 <= 1.8e+74) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(M * Float64(0.5 * D)) / d) ^ 2.0)))))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(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 <= 1.8e+74)
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * (((M * (0.5 * D)) / d) ^ 2.0)))));
else
tmp = d * (sqrt((1.0 / h)) / sqrt(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, 1.8e+74], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M * N[(0.5 * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.8 \cdot 10^{+74}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M \cdot \left(0.5 \cdot D\right)}{d}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 1.79999999999999994e74Initial program 62.3%
Simplified61.3%
associate-*r/61.8%
div-inv61.8%
associate-*l*61.8%
metadata-eval61.8%
Applied egg-rr61.8%
if 1.79999999999999994e74 < l Initial program 53.1%
Taylor expanded in d around inf 54.7%
associate-/r*54.7%
sqrt-div72.7%
Applied egg-rr72.7%
Final simplification64.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 (<= l 1.45e+74)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (/ (* h (pow (* M (* 0.5 (/ D d))) 2.0)) l)))))
(* d (/ (sqrt (/ 1.0 h)) (sqrt 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 <= 1.45e+74) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h * pow((M * (0.5 * (D / d))), 2.0)) / l))));
} else {
tmp = d * (sqrt((1.0 / h)) / sqrt(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 <= 1.45d+74) then
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((h * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0)) / l))))
else
tmp = d * (sqrt((1.0d0 / h)) / sqrt(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 <= 1.45e+74) {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * ((h * Math.pow((M * (0.5 * (D / d))), 2.0)) / l))));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(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 <= 1.45e+74: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * ((h * math.pow((M * (0.5 * (D / d))), 2.0)) / l)))) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(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 <= 1.45e+74) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0)) / l))))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(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 <= 1.45e+74)
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h * ((M * (0.5 * (D / d))) ^ 2.0)) / l))));
else
tmp = d * (sqrt((1.0 / h)) / sqrt(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, 1.45e+74], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.45 \cdot 10^{+74}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 1.4500000000000001e74Initial program 62.3%
Simplified61.3%
associate-*r/63.6%
div-inv63.6%
associate-*l*63.6%
metadata-eval63.6%
Applied egg-rr63.6%
if 1.4500000000000001e74 < l Initial program 53.1%
Taylor expanded in d around inf 54.7%
associate-/r*54.7%
sqrt-div72.7%
Applied egg-rr72.7%
Final simplification65.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
(if (<= l 1.7e+74)
(*
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (/ (* h (pow (/ (* (* 0.5 M) D) d) 2.0)) l))))
(sqrt (/ d h)))
(* d (/ (sqrt (/ 1.0 h)) (sqrt 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 <= 1.7e+74) {
tmp = (sqrt((d / l)) * (1.0 - (0.5 * ((h * pow((((0.5 * M) * D) / d), 2.0)) / l)))) * sqrt((d / h));
} else {
tmp = d * (sqrt((1.0 / h)) / sqrt(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 <= 1.7d+74) then
tmp = (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((h * ((((0.5d0 * m) * d_1) / d) ** 2.0d0)) / l)))) * sqrt((d / h))
else
tmp = d * (sqrt((1.0d0 / h)) / sqrt(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 <= 1.7e+74) {
tmp = (Math.sqrt((d / l)) * (1.0 - (0.5 * ((h * Math.pow((((0.5 * M) * D) / d), 2.0)) / l)))) * Math.sqrt((d / h));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(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 <= 1.7e+74: tmp = (math.sqrt((d / l)) * (1.0 - (0.5 * ((h * math.pow((((0.5 * M) * D) / d), 2.0)) / l)))) * math.sqrt((d / h)) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(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 <= 1.7e+74) tmp = Float64(Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(Float64(0.5 * M) * D) / d) ^ 2.0)) / l)))) * sqrt(Float64(d / h))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(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 <= 1.7e+74)
tmp = (sqrt((d / l)) * (1.0 - (0.5 * ((h * ((((0.5 * M) * D) / d) ^ 2.0)) / l)))) * sqrt((d / h));
else
tmp = d * (sqrt((1.0 / h)) / sqrt(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, 1.7e+74], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(N[(0.5 * M), $MachinePrecision] * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.7 \cdot 10^{+74}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{\left(0.5 \cdot M\right) \cdot D}{d}\right)}^{2}}{\ell}\right)\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 1.7e74Initial program 62.3%
Simplified61.3%
associate-*r/63.6%
div-inv63.6%
associate-*l*63.6%
metadata-eval63.6%
Applied egg-rr63.6%
associate-*r*63.6%
metadata-eval63.6%
div-inv63.6%
associate-*r/64.1%
div-inv64.1%
metadata-eval64.1%
Applied egg-rr64.1%
if 1.7e74 < l Initial program 53.1%
Taylor expanded in d around inf 54.7%
associate-/r*54.7%
sqrt-div72.7%
Applied egg-rr72.7%
Final simplification65.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 (<= l 3.4e+38)
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* -0.5 (* (/ h l) (pow (* M (/ 0.5 (/ d D))) 2.0)))))
(* d (/ (sqrt (/ 1.0 h)) (sqrt 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.4e+38) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * ((h / l) * pow((M * (0.5 / (d / D))), 2.0))));
} else {
tmp = d * (sqrt((1.0 / h)) / sqrt(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.4d+38) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + ((-0.5d0) * ((h / l) * ((m * (0.5d0 / (d / d_1))) ** 2.0d0))))
else
tmp = d * (sqrt((1.0d0 / h)) / sqrt(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.4e+38) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * ((h / l) * Math.pow((M * (0.5 / (d / D))), 2.0))));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(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.4e+38: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * ((h / l) * math.pow((M * (0.5 / (d / D))), 2.0)))) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(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.4e+38) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(M * Float64(0.5 / Float64(d / D))) ^ 2.0))))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(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.4e+38)
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * ((h / l) * ((M * (0.5 / (d / D))) ^ 2.0))));
else
tmp = d * (sqrt((1.0 / h)) / sqrt(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.4e+38], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 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], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.4 \cdot 10^{+38}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \frac{0.5}{\frac{d}{D}}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 3.39999999999999996e38Initial program 62.2%
Simplified61.2%
sqrt-div32.8%
div-inv32.7%
Applied egg-rr32.7%
associate-*r/32.8%
*-rgt-identity32.8%
Simplified32.8%
expm1-log1p-u13.2%
expm1-udef9.8%
Applied egg-rr19.7%
expm1-def24.1%
expm1-log1p49.9%
associate-/l*49.9%
Simplified49.9%
if 3.39999999999999996e38 < l Initial program 54.5%
Taylor expanded in d around inf 52.5%
associate-/r*52.5%
sqrt-div68.0%
Applied egg-rr68.0%
Final simplification54.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
(if (<= d -1.05e-135)
(sqrt (/ (pow d 2.0) (* l h)))
(if (<= d -1e-311)
(* d (cbrt (/ 1.0 (pow (* l h) 1.5))))
(* d (/ (sqrt (/ 1.0 h)) (sqrt 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 <= -1.05e-135) {
tmp = sqrt((pow(d, 2.0) / (l * h)));
} else if (d <= -1e-311) {
tmp = d * cbrt((1.0 / pow((l * h), 1.5)));
} else {
tmp = d * (sqrt((1.0 / h)) / sqrt(l));
}
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 <= -1.05e-135) {
tmp = Math.sqrt((Math.pow(d, 2.0) / (l * h)));
} else if (d <= -1e-311) {
tmp = d * Math.cbrt((1.0 / Math.pow((l * h), 1.5)));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(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 <= -1.05e-135) tmp = sqrt(Float64((d ^ 2.0) / Float64(l * h))); elseif (d <= -1e-311) tmp = Float64(d * cbrt(Float64(1.0 / (Float64(l * h) ^ 1.5)))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); 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, -1.05e-135], N[Sqrt[N[(N[Power[d, 2.0], $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, -1e-311], N[(d * N[Power[N[(1.0 / N[Power[N[(l * h), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.05 \cdot 10^{-135}:\\
\;\;\;\;\sqrt{\frac{{d}^{2}}{\ell \cdot h}}\\
\mathbf{elif}\;d \leq -1 \cdot 10^{-311}:\\
\;\;\;\;d \cdot \sqrt[3]{\frac{1}{{\left(\ell \cdot h\right)}^{1.5}}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < -1.05e-135Initial program 62.0%
Simplified62.0%
sqrt-div0.0%
div-inv0.0%
Applied egg-rr0.0%
associate-*r/0.0%
*-rgt-identity0.0%
Simplified0.0%
Taylor expanded in d around inf 5.5%
unpow-15.5%
metadata-eval5.5%
pow-sqr5.5%
rem-sqrt-square5.5%
sqr-pow5.5%
fabs-sqr5.5%
sqr-pow5.5%
Simplified5.5%
add-sqr-sqrt5.5%
sqrt-unprod5.5%
pow-sqr5.5%
metadata-eval5.5%
inv-pow5.5%
associate-/r*5.5%
pow1/25.5%
metadata-eval5.5%
pow-pow6.6%
add-sqr-sqrt0.7%
sqrt-unprod31.7%
*-commutative31.7%
*-commutative31.7%
swap-sqr27.4%
Applied egg-rr30.9%
associate-*l/30.9%
*-lft-identity30.9%
Simplified30.9%
if -1.05e-135 < d < -9.99999999999948e-312Initial program 49.4%
Taylor expanded in d around inf 9.6%
add-cbrt-cube21.8%
pow1/321.8%
add-sqr-sqrt21.8%
pow121.8%
pow1/221.8%
pow-prod-up21.8%
associate-/r*21.8%
metadata-eval21.8%
Applied egg-rr21.8%
Taylor expanded in h around 0 0.0%
exp-prod0.0%
mul-1-neg0.0%
log-rec0.0%
+-commutative0.0%
exp-prod0.0%
unpow1/30.0%
exp-prod0.0%
log-rec0.0%
log-rec0.0%
distribute-neg-in0.0%
log-prod21.8%
exp-prod21.8%
distribute-rgt-neg-out21.8%
rec-exp21.8%
*-commutative21.8%
exp-to-pow21.8%
Simplified21.8%
if -9.99999999999948e-312 < d Initial program 62.0%
Taylor expanded in d around inf 40.9%
associate-/r*40.9%
sqrt-div52.2%
Applied egg-rr52.2%
Final simplification41.2%
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 1.45e-290) (sqrt (/ (pow d 2.0) (* l h))) (* d (/ (sqrt (/ 1.0 h)) (sqrt 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 <= 1.45e-290) {
tmp = sqrt((pow(d, 2.0) / (l * h)));
} else {
tmp = d * (sqrt((1.0 / h)) / sqrt(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.45d-290) then
tmp = sqrt(((d ** 2.0d0) / (l * h)))
else
tmp = d * (sqrt((1.0d0 / h)) / sqrt(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 <= 1.45e-290) {
tmp = Math.sqrt((Math.pow(d, 2.0) / (l * h)));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(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 <= 1.45e-290: tmp = math.sqrt((math.pow(d, 2.0) / (l * h))) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(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 <= 1.45e-290) tmp = sqrt(Float64((d ^ 2.0) / Float64(l * h))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(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 <= 1.45e-290)
tmp = sqrt(((d ^ 2.0) / (l * h)));
else
tmp = d * (sqrt((1.0 / h)) / sqrt(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, 1.45e-290], N[Sqrt[N[(N[Power[d, 2.0], $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.45 \cdot 10^{-290}:\\
\;\;\;\;\sqrt{\frac{{d}^{2}}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < 1.44999999999999997e-290Initial program 57.9%
Simplified57.9%
sqrt-div2.5%
div-inv2.5%
Applied egg-rr2.5%
associate-*r/2.5%
*-rgt-identity2.5%
Simplified2.5%
Taylor expanded in d around inf 7.3%
unpow-17.3%
metadata-eval7.3%
pow-sqr7.3%
rem-sqrt-square7.3%
sqr-pow7.3%
fabs-sqr7.3%
sqr-pow7.3%
Simplified7.3%
add-sqr-sqrt7.3%
sqrt-unprod7.3%
pow-sqr7.3%
metadata-eval7.3%
inv-pow7.3%
associate-/r*7.3%
pow1/27.3%
metadata-eval7.3%
pow-pow11.2%
add-sqr-sqrt2.4%
sqrt-unprod24.6%
*-commutative24.6%
*-commutative24.6%
swap-sqr21.6%
Applied egg-rr24.1%
associate-*l/24.2%
*-lft-identity24.2%
Simplified24.2%
if 1.44999999999999997e-290 < d Initial program 62.8%
Taylor expanded in d around inf 41.6%
associate-/r*41.6%
sqrt-div53.3%
Applied egg-rr53.3%
Final simplification39.2%
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.45e-138) (sqrt (/ (pow d 2.0) (* l h))) (* 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) {
double tmp;
if (d <= -2.45e-138) {
tmp = sqrt((pow(d, 2.0) / (l * h)));
} else {
tmp = d * sqrt(((1.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 (d <= (-2.45d-138)) then
tmp = sqrt(((d ** 2.0d0) / (l * h)))
else
tmp = d * sqrt(((1.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 (d <= -2.45e-138) {
tmp = Math.sqrt((Math.pow(d, 2.0) / (l * h)));
} else {
tmp = d * Math.sqrt(((1.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 d <= -2.45e-138: tmp = math.sqrt((math.pow(d, 2.0) / (l * h))) else: tmp = d * math.sqrt(((1.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 (d <= -2.45e-138) tmp = sqrt(Float64((d ^ 2.0) / Float64(l * h))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / 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 (d <= -2.45e-138)
tmp = sqrt(((d ^ 2.0) / (l * h)));
else
tmp = d * sqrt(((1.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[d, -2.45e-138], N[Sqrt[N[(N[Power[d, 2.0], $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.45 \cdot 10^{-138}:\\
\;\;\;\;\sqrt{\frac{{d}^{2}}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\end{array}
\end{array}
if d < -2.45000000000000008e-138Initial program 62.0%
Simplified62.0%
sqrt-div0.0%
div-inv0.0%
Applied egg-rr0.0%
associate-*r/0.0%
*-rgt-identity0.0%
Simplified0.0%
Taylor expanded in d around inf 5.5%
unpow-15.5%
metadata-eval5.5%
pow-sqr5.5%
rem-sqrt-square5.5%
sqr-pow5.5%
fabs-sqr5.5%
sqr-pow5.5%
Simplified5.5%
add-sqr-sqrt5.5%
sqrt-unprod5.5%
pow-sqr5.5%
metadata-eval5.5%
inv-pow5.5%
associate-/r*5.5%
pow1/25.5%
metadata-eval5.5%
pow-pow6.6%
add-sqr-sqrt0.7%
sqrt-unprod31.7%
*-commutative31.7%
*-commutative31.7%
swap-sqr27.4%
Applied egg-rr30.9%
associate-*l/30.9%
*-lft-identity30.9%
Simplified30.9%
if -2.45000000000000008e-138 < d Initial program 59.6%
Taylor expanded in d around inf 35.0%
associate-/r*35.0%
Simplified35.0%
Final simplification33.6%
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.7e-290) (sqrt (/ (pow d 2.0) (* l h))) (* d (/ (pow h -0.5) (sqrt 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 <= 2.7e-290) {
tmp = sqrt((pow(d, 2.0) / (l * h)));
} else {
tmp = d * (pow(h, -0.5) / sqrt(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 <= 2.7d-290) then
tmp = sqrt(((d ** 2.0d0) / (l * h)))
else
tmp = d * ((h ** (-0.5d0)) / sqrt(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 <= 2.7e-290) {
tmp = Math.sqrt((Math.pow(d, 2.0) / (l * h)));
} else {
tmp = d * (Math.pow(h, -0.5) / Math.sqrt(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 <= 2.7e-290: tmp = math.sqrt((math.pow(d, 2.0) / (l * h))) else: tmp = d * (math.pow(h, -0.5) / math.sqrt(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 <= 2.7e-290) tmp = sqrt(Float64((d ^ 2.0) / Float64(l * h))); else tmp = Float64(d * Float64((h ^ -0.5) / sqrt(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 <= 2.7e-290)
tmp = sqrt(((d ^ 2.0) / (l * h)));
else
tmp = d * ((h ^ -0.5) / sqrt(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, 2.7e-290], N[Sqrt[N[(N[Power[d, 2.0], $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 2.7 \cdot 10^{-290}:\\
\;\;\;\;\sqrt{\frac{{d}^{2}}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < 2.69999999999999999e-290Initial program 57.9%
Simplified57.9%
sqrt-div2.5%
div-inv2.5%
Applied egg-rr2.5%
associate-*r/2.5%
*-rgt-identity2.5%
Simplified2.5%
Taylor expanded in d around inf 7.3%
unpow-17.3%
metadata-eval7.3%
pow-sqr7.3%
rem-sqrt-square7.3%
sqr-pow7.3%
fabs-sqr7.3%
sqr-pow7.3%
Simplified7.3%
add-sqr-sqrt7.3%
sqrt-unprod7.3%
pow-sqr7.3%
metadata-eval7.3%
inv-pow7.3%
associate-/r*7.3%
pow1/27.3%
metadata-eval7.3%
pow-pow11.2%
add-sqr-sqrt2.4%
sqrt-unprod24.6%
*-commutative24.6%
*-commutative24.6%
swap-sqr21.6%
Applied egg-rr24.1%
associate-*l/24.2%
*-lft-identity24.2%
Simplified24.2%
if 2.69999999999999999e-290 < d Initial program 62.8%
Simplified61.4%
sqrt-div78.1%
div-inv78.0%
Applied egg-rr78.0%
associate-*r/78.1%
*-rgt-identity78.1%
Simplified78.1%
Taylor expanded in d around inf 41.6%
unpow-141.6%
metadata-eval41.6%
pow-sqr41.6%
rem-sqrt-square41.6%
sqr-pow41.5%
fabs-sqr41.5%
sqr-pow41.6%
Simplified41.6%
add-sqr-sqrt41.5%
sqrt-unprod41.6%
pow-sqr41.6%
metadata-eval41.6%
inv-pow41.6%
associate-/r*41.6%
sqrt-div53.3%
inv-pow53.3%
sqrt-pow153.3%
metadata-eval53.3%
Applied egg-rr53.3%
Final simplification39.2%
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 60.4%
Taylor expanded in d around inf 24.9%
Final simplification24.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 (/ (/ 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 60.4%
Taylor expanded in d around inf 24.9%
associate-/r*25.0%
Simplified25.0%
Final simplification25.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 (* 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 60.4%
Simplified59.7%
sqrt-div41.5%
div-inv41.4%
Applied egg-rr41.4%
associate-*r/41.5%
*-rgt-identity41.5%
Simplified41.5%
Taylor expanded in d around inf 24.9%
unpow-124.9%
metadata-eval24.9%
pow-sqr24.9%
rem-sqrt-square24.9%
sqr-pow24.9%
fabs-sqr24.9%
sqr-pow24.9%
Simplified24.9%
Final simplification24.9%
herbie shell --seed 2023311
(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)))))