
(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 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 (sqrt (/ d l)))
(t_2 (pow (* (* M 0.5) (/ D d)) 2.0)))
(if (<= d -7.2e+203)
(*
(* d (sqrt (/ (/ 1.0 l) h)))
(- -1.0 (/ -0.5 (/ l (* h (pow (/ M (/ d (* D 0.5))) 2.0))))))
(if (<= d -6.8e-125)
(* (* t_0 t_1) (- 1.0 (/ (* h (* 0.5 t_2)) l)))
(if (<= d -5e-310)
(-
(* (sqrt (/ h (pow l 3.0))) (* (* (/ (* D D) d) (* M M)) 0.125))
(* d (* (pow (/ -1.0 h) 0.5) (pow (- l) -0.5))))
(if (<= d 1.25e-272)
(* -0.125 (* (* (* M M) (/ (sqrt h) (pow l 1.5))) (* D (/ D d))))
(if (<= d 5e+17)
(*
t_0
(*
(/ (sqrt d) (sqrt l))
(fma (/ h l) (* -0.5 (pow (* D (/ M (* d 2.0))) 2.0)) 1.0)))
(/
(* (sqrt d) (* t_1 (- 1.0 (* 0.5 (* t_2 (/ h l))))))
(sqrt h)))))))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = sqrt((d / l));
double t_2 = pow(((M * 0.5) * (D / d)), 2.0);
double tmp;
if (d <= -7.2e+203) {
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * pow((M / (d / (D * 0.5))), 2.0)))));
} else if (d <= -6.8e-125) {
tmp = (t_0 * t_1) * (1.0 - ((h * (0.5 * t_2)) / l));
} else if (d <= -5e-310) {
tmp = (sqrt((h / pow(l, 3.0))) * ((((D * D) / d) * (M * M)) * 0.125)) - (d * (pow((-1.0 / h), 0.5) * pow(-l, -0.5)));
} else if (d <= 1.25e-272) {
tmp = -0.125 * (((M * M) * (sqrt(h) / pow(l, 1.5))) * (D * (D / d)));
} else if (d <= 5e+17) {
tmp = t_0 * ((sqrt(d) / sqrt(l)) * fma((h / l), (-0.5 * pow((D * (M / (d * 2.0))), 2.0)), 1.0));
} else {
tmp = (sqrt(d) * (t_1 * (1.0 - (0.5 * (t_2 * (h / l)))))) / sqrt(h);
}
return tmp;
}
M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = sqrt(Float64(d / l)) t_2 = Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0 tmp = 0.0 if (d <= -7.2e+203) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - Float64(-0.5 / Float64(l / Float64(h * (Float64(M / Float64(d / Float64(D * 0.5))) ^ 2.0)))))); elseif (d <= -6.8e-125) tmp = Float64(Float64(t_0 * t_1) * Float64(1.0 - Float64(Float64(h * Float64(0.5 * t_2)) / l))); elseif (d <= -5e-310) tmp = Float64(Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(Float64(Float64(Float64(D * D) / d) * Float64(M * M)) * 0.125)) - Float64(d * Float64((Float64(-1.0 / h) ^ 0.5) * (Float64(-l) ^ -0.5)))); elseif (d <= 1.25e-272) tmp = Float64(-0.125 * Float64(Float64(Float64(M * M) * Float64(sqrt(h) / (l ^ 1.5))) * Float64(D * Float64(D / d)))); elseif (d <= 5e+17) tmp = Float64(t_0 * Float64(Float64(sqrt(d) / sqrt(l)) * fma(Float64(h / l), Float64(-0.5 * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)), 1.0))); else tmp = Float64(Float64(sqrt(d) * Float64(t_1 * Float64(1.0 - Float64(0.5 * Float64(t_2 * Float64(h / l)))))) / sqrt(h)); end return tmp end
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[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[d, -7.2e+203], N[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 / N[(l / N[(h * N[Power[N[(M / N[(d / N[(D * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -6.8e-125], N[(N[(t$95$0 * t$95$1), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(0.5 * t$95$2), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(D * D), $MachinePrecision] / d), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] - N[(d * N[(N[Power[N[(-1.0 / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[(-l), -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.25e-272], N[(-0.125 * N[(N[(N[(M * M), $MachinePrecision] * N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5e+17], N[(t$95$0 * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] * N[(t$95$1 * N[(1.0 - N[(0.5 * N[(t$95$2 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\\
\mathbf{if}\;d \leq -7.2 \cdot 10^{+203}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - \frac{-0.5}{\frac{\ell}{h \cdot {\left(\frac{M}{\frac{d}{D \cdot 0.5}}\right)}^{2}}}\right)\\
\mathbf{elif}\;d \leq -6.8 \cdot 10^{-125}:\\
\;\;\;\;\left(t_0 \cdot t_1\right) \cdot \left(1 - \frac{h \cdot \left(0.5 \cdot t_2\right)}{\ell}\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\left(\frac{D \cdot D}{d} \cdot \left(M \cdot M\right)\right) \cdot 0.125\right) - d \cdot \left({\left(\frac{-1}{h}\right)}^{0.5} \cdot {\left(-\ell\right)}^{-0.5}\right)\\
\mathbf{elif}\;d \leq 1.25 \cdot 10^{-272}:\\
\;\;\;\;-0.125 \cdot \left(\left(\left(M \cdot M\right) \cdot \frac{\sqrt{h}}{{\ell}^{1.5}}\right) \cdot \left(D \cdot \frac{D}{d}\right)\right)\\
\mathbf{elif}\;d \leq 5 \cdot 10^{+17}:\\
\;\;\;\;t_0 \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, -0.5 \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d} \cdot \left(t_1 \cdot \left(1 - 0.5 \cdot \left(t_2 \cdot \frac{h}{\ell}\right)\right)\right)}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -7.19999999999999964e203Initial program 59.4%
metadata-eval59.4%
unpow1/259.4%
metadata-eval59.4%
unpow1/259.4%
*-commutative59.4%
associate-*l*59.4%
times-frac59.6%
metadata-eval59.6%
Simplified59.6%
associate-*r*59.6%
frac-times59.4%
*-commutative59.4%
metadata-eval59.4%
associate-*r/66.8%
metadata-eval66.8%
*-commutative66.8%
frac-times66.9%
div-inv66.9%
metadata-eval66.9%
Applied egg-rr66.9%
pow166.9%
sqrt-prod60.5%
*-commutative60.5%
associate-/l*53.1%
*-commutative53.1%
associate-*l*53.1%
Applied egg-rr53.1%
unpow153.1%
*-commutative53.1%
sub-neg53.1%
associate-/l*53.1%
distribute-neg-frac53.1%
metadata-eval53.1%
associate-/l/60.5%
associate-*r/60.5%
associate-*r/60.4%
associate-/l*60.6%
*-commutative60.6%
Simplified60.6%
Taylor expanded in d around -inf 85.6%
associate-*r*85.6%
mul-1-neg85.6%
associate-/r*85.7%
Simplified85.7%
if -7.19999999999999964e203 < d < -6.7999999999999995e-125Initial program 80.3%
metadata-eval80.3%
unpow1/280.3%
metadata-eval80.3%
unpow1/280.3%
*-commutative80.3%
associate-*l*80.3%
times-frac80.3%
metadata-eval80.3%
Simplified80.3%
associate-*r*80.3%
frac-times80.3%
*-commutative80.3%
metadata-eval80.3%
associate-*r/81.9%
metadata-eval81.9%
*-commutative81.9%
frac-times81.9%
div-inv81.9%
metadata-eval81.9%
Applied egg-rr81.9%
if -6.7999999999999995e-125 < d < -4.999999999999985e-310Initial program 49.5%
metadata-eval49.5%
unpow1/249.5%
metadata-eval49.5%
unpow1/249.5%
*-commutative49.5%
associate-*l*49.5%
times-frac49.4%
metadata-eval49.4%
Simplified49.4%
add-cbrt-cube45.1%
pow345.1%
Applied egg-rr35.8%
Taylor expanded in d around -inf 53.2%
mul-1-neg53.2%
*-commutative53.2%
unsub-neg53.2%
*-commutative53.2%
Simplified53.2%
Taylor expanded in h around -inf 63.2%
+-commutative63.2%
distribute-lft-in63.2%
*-commutative63.2%
exp-sum63.3%
*-commutative63.3%
*-commutative63.3%
associate-*l*63.3%
metadata-eval63.3%
exp-to-pow63.4%
exp-to-pow63.8%
mul-1-neg63.8%
Simplified63.8%
if -4.999999999999985e-310 < d < 1.24999999999999995e-272Initial program 25.5%
metadata-eval25.5%
unpow1/225.5%
metadata-eval25.5%
unpow1/225.5%
*-commutative25.5%
associate-*l*25.5%
times-frac13.0%
metadata-eval13.0%
Simplified13.0%
associate-*r*13.0%
frac-times25.5%
*-commutative25.5%
metadata-eval25.5%
associate-*r/25.5%
metadata-eval25.5%
*-commutative25.5%
frac-times13.0%
div-inv13.0%
metadata-eval13.0%
Applied egg-rr13.0%
pow113.0%
sqrt-prod0.0%
*-commutative0.0%
associate-/l*0.0%
*-commutative0.0%
associate-*l*0.0%
Applied egg-rr0.0%
unpow10.0%
*-commutative0.0%
sub-neg0.0%
associate-/l*0.0%
distribute-neg-frac0.0%
metadata-eval0.0%
associate-/l/0.0%
associate-*r/0.0%
associate-*r/12.5%
associate-/l*0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in d around 0 50.0%
*-commutative50.0%
unpow250.0%
unpow250.0%
unpow250.0%
associate-*l/25.6%
unpow225.6%
*-commutative25.6%
associate-*r*25.9%
associate-/l*25.9%
associate-/r/25.9%
Simplified25.9%
sqrt-div25.7%
Applied egg-rr25.7%
sqr-pow25.7%
rem-sqrt-square48.5%
sqr-pow48.7%
fabs-sqr48.7%
sqr-pow48.5%
metadata-eval48.5%
Simplified48.5%
if 1.24999999999999995e-272 < d < 5e17Initial program 69.4%
associate-*l*69.5%
metadata-eval69.5%
unpow1/269.5%
metadata-eval69.5%
unpow1/269.5%
sub-neg69.5%
+-commutative69.5%
*-commutative69.5%
distribute-rgt-neg-in69.5%
fma-def69.5%
Simplified67.8%
sqrt-div75.4%
Applied egg-rr75.4%
if 5e17 < d Initial program 70.6%
associate-*l*70.6%
metadata-eval70.6%
unpow1/270.6%
metadata-eval70.6%
unpow1/270.6%
associate-*l*70.6%
metadata-eval70.6%
times-frac70.8%
Simplified70.8%
sqrt-div90.9%
Applied egg-rr90.9%
associate-*l/90.9%
div-inv90.9%
metadata-eval90.9%
Applied egg-rr90.9%
Final simplification78.2%
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)))))
5e+296)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (* (pow (/ (/ (* M D) 2.0) d) 2.0) (/ h l))))))
(*
(* d (sqrt (/ (/ 1.0 l) h)))
(- -1.0 (/ -0.5 (/ l (* h (pow (/ M (/ d (* D 0.5))) 2.0))))))))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))))) <= 5e+296) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * (pow((((M * D) / 2.0) / d), 2.0) * (h / l)))));
} else {
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * pow((M / (d / (D * 0.5))), 2.0)))));
}
return tmp;
}
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))))) <= 5d+296) then
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * (((((m * d_1) / 2.0d0) / d) ** 2.0d0) * (h / l)))))
else
tmp = (d * sqrt(((1.0d0 / l) / h))) * ((-1.0d0) - ((-0.5d0) / (l / (h * ((m / (d / (d_1 * 0.5d0))) ** 2.0d0)))))
end if
code = tmp
end function
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))))) <= 5e+296) {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * (Math.pow((((M * D) / 2.0) / d), 2.0) * (h / l)))));
} else {
tmp = (d * Math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * Math.pow((M / (d / (D * 0.5))), 2.0)))));
}
return tmp;
}
[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))))) <= 5e+296: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * (math.pow((((M * D) / 2.0) / d), 2.0) * (h / l))))) else: tmp = (d * math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * math.pow((M / (d / (D * 0.5))), 2.0))))) return tmp
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))))) <= 5e+296) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(Float64(M * D) / 2.0) / d) ^ 2.0) * Float64(h / l)))))); else tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - Float64(-0.5 / Float64(l / Float64(h * (Float64(M / Float64(d / Float64(D * 0.5))) ^ 2.0)))))); end return tmp end
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))))) <= 5e+296)
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * (((((M * D) / 2.0) / d) ^ 2.0) * (h / l)))));
else
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * ((M / (d / (D * 0.5))) ^ 2.0)))));
end
tmp_2 = tmp;
end
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], 5e+296], 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[(N[(M * D), $MachinePrecision] / 2.0), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 / N[(l / N[(h * N[Power[N[(M / N[(d / N[(D * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[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 5 \cdot 10^{+296}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{\frac{M \cdot D}{2}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - \frac{-0.5}{\frac{\ell}{h \cdot {\left(\frac{M}{\frac{d}{D \cdot 0.5}}\right)}^{2}}}\right)\\
\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)))) < 5.0000000000000001e296Initial program 86.6%
associate-*l*86.6%
metadata-eval86.6%
unpow1/286.6%
metadata-eval86.6%
unpow1/286.6%
associate-*l*86.6%
metadata-eval86.6%
times-frac85.5%
Simplified85.5%
frac-times86.6%
associate-/r*86.6%
Applied egg-rr86.6%
if 5.0000000000000001e296 < (*.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 15.7%
metadata-eval15.7%
unpow1/215.7%
metadata-eval15.7%
unpow1/215.7%
*-commutative15.7%
associate-*l*15.7%
times-frac15.9%
metadata-eval15.9%
Simplified15.9%
associate-*r*15.9%
frac-times15.7%
*-commutative15.7%
metadata-eval15.7%
associate-*r/23.0%
metadata-eval23.0%
*-commutative23.0%
frac-times23.1%
div-inv23.1%
metadata-eval23.1%
Applied egg-rr23.1%
pow123.1%
sqrt-prod23.2%
*-commutative23.2%
associate-/l*17.3%
*-commutative17.3%
associate-*l*17.3%
Applied egg-rr17.3%
unpow117.3%
*-commutative17.3%
sub-neg17.3%
associate-/l*17.3%
distribute-neg-frac17.3%
metadata-eval17.3%
associate-/l/23.2%
associate-*r/23.2%
associate-*r/23.0%
associate-/l*23.2%
*-commutative23.2%
Simplified23.2%
Taylor expanded in d around -inf 33.6%
associate-*r*33.6%
mul-1-neg33.6%
associate-/r*33.6%
Simplified33.6%
Final simplification71.7%
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.8e+203)
(*
(* d (sqrt (/ (/ 1.0 l) h)))
(- -1.0 (/ -0.5 (/ l (* h (pow (/ M (/ d (* D 0.5))) 2.0))))))
(if (<= d -3e-123)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (/ (* h (* 0.5 (pow (* (* M 0.5) (/ D d)) 2.0))) l)))
(if (<= d -5e-310)
(-
(* (sqrt (/ h (pow l 3.0))) (* (* (/ (* D D) d) (* M M)) 0.125))
(* d (* (pow (/ -1.0 h) 0.5) (pow (- l) -0.5))))
(*
(/ (sqrt d) (sqrt h))
(*
(/ (sqrt d) (sqrt l))
(- 1.0 (* 0.5 (* (pow (/ (/ (* M D) 2.0) d) 2.0) (/ h l))))))))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.8e+203) {
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * pow((M / (d / (D * 0.5))), 2.0)))));
} else if (d <= -3e-123) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((h * (0.5 * pow(((M * 0.5) * (D / d)), 2.0))) / l));
} else if (d <= -5e-310) {
tmp = (sqrt((h / pow(l, 3.0))) * ((((D * D) / d) * (M * M)) * 0.125)) - (d * (pow((-1.0 / h), 0.5) * pow(-l, -0.5)));
} else {
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * (1.0 - (0.5 * (pow((((M * D) / 2.0) / d), 2.0) * (h / l)))));
}
return tmp;
}
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.8d+203)) then
tmp = (d * sqrt(((1.0d0 / l) / h))) * ((-1.0d0) - ((-0.5d0) / (l / (h * ((m / (d / (d_1 * 0.5d0))) ** 2.0d0)))))
else if (d <= (-3d-123)) then
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0d0 - ((h * (0.5d0 * (((m * 0.5d0) * (d_1 / d)) ** 2.0d0))) / l))
else if (d <= (-5d-310)) then
tmp = (sqrt((h / (l ** 3.0d0))) * ((((d_1 * d_1) / d) * (m * m)) * 0.125d0)) - (d * ((((-1.0d0) / h) ** 0.5d0) * (-l ** (-0.5d0))))
else
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * (1.0d0 - (0.5d0 * (((((m * d_1) / 2.0d0) / d) ** 2.0d0) * (h / l)))))
end if
code = tmp
end function
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.8e+203) {
tmp = (d * Math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * Math.pow((M / (d / (D * 0.5))), 2.0)))));
} else if (d <= -3e-123) {
tmp = (Math.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - ((h * (0.5 * Math.pow(((M * 0.5) * (D / d)), 2.0))) / l));
} else if (d <= -5e-310) {
tmp = (Math.sqrt((h / Math.pow(l, 3.0))) * ((((D * D) / d) * (M * M)) * 0.125)) - (d * (Math.pow((-1.0 / h), 0.5) * Math.pow(-l, -0.5)));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * ((Math.sqrt(d) / Math.sqrt(l)) * (1.0 - (0.5 * (Math.pow((((M * D) / 2.0) / d), 2.0) * (h / l)))));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if d <= -2.8e+203: tmp = (d * math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * math.pow((M / (d / (D * 0.5))), 2.0))))) elif d <= -3e-123: tmp = (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - ((h * (0.5 * math.pow(((M * 0.5) * (D / d)), 2.0))) / l)) elif d <= -5e-310: tmp = (math.sqrt((h / math.pow(l, 3.0))) * ((((D * D) / d) * (M * M)) * 0.125)) - (d * (math.pow((-1.0 / h), 0.5) * math.pow(-l, -0.5))) else: tmp = (math.sqrt(d) / math.sqrt(h)) * ((math.sqrt(d) / math.sqrt(l)) * (1.0 - (0.5 * (math.pow((((M * D) / 2.0) / d), 2.0) * (h / l))))) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (d <= -2.8e+203) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - Float64(-0.5 / Float64(l / Float64(h * (Float64(M / Float64(d / Float64(D * 0.5))) ^ 2.0)))))); elseif (d <= -3e-123) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(Float64(h * Float64(0.5 * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0))) / l))); elseif (d <= -5e-310) tmp = Float64(Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(Float64(Float64(Float64(D * D) / d) * Float64(M * M)) * 0.125)) - Float64(d * Float64((Float64(-1.0 / h) ^ 0.5) * (Float64(-l) ^ -0.5)))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(Float64(sqrt(d) / sqrt(l)) * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(Float64(M * D) / 2.0) / d) ^ 2.0) * Float64(h / l)))))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (d <= -2.8e+203)
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * ((M / (d / (D * 0.5))) ^ 2.0)))));
elseif (d <= -3e-123)
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((h * (0.5 * (((M * 0.5) * (D / d)) ^ 2.0))) / l));
elseif (d <= -5e-310)
tmp = (sqrt((h / (l ^ 3.0))) * ((((D * D) / d) * (M * M)) * 0.125)) - (d * (((-1.0 / h) ^ 0.5) * (-l ^ -0.5)));
else
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * (1.0 - (0.5 * (((((M * D) / 2.0) / d) ^ 2.0) * (h / l)))));
end
tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.8e+203], N[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 / N[(l / N[(h * N[Power[N[(M / N[(d / N[(D * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -3e-123], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(0.5 * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(D * D), $MachinePrecision] / d), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] - N[(d * N[(N[Power[N[(-1.0 / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[(-l), -0.5], $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[(N[(M * D), $MachinePrecision] / 2.0), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.8 \cdot 10^{+203}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - \frac{-0.5}{\frac{\ell}{h \cdot {\left(\frac{M}{\frac{d}{D \cdot 0.5}}\right)}^{2}}}\right)\\
\mathbf{elif}\;d \leq -3 \cdot 10^{-123}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{h \cdot \left(0.5 \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\right)}{\ell}\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\left(\frac{D \cdot D}{d} \cdot \left(M \cdot M\right)\right) \cdot 0.125\right) - d \cdot \left({\left(\frac{-1}{h}\right)}^{0.5} \cdot {\left(-\ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{\frac{M \cdot D}{2}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\
\end{array}
\end{array}
if d < -2.7999999999999999e203Initial program 59.4%
metadata-eval59.4%
unpow1/259.4%
metadata-eval59.4%
unpow1/259.4%
*-commutative59.4%
associate-*l*59.4%
times-frac59.6%
metadata-eval59.6%
Simplified59.6%
associate-*r*59.6%
frac-times59.4%
*-commutative59.4%
metadata-eval59.4%
associate-*r/66.8%
metadata-eval66.8%
*-commutative66.8%
frac-times66.9%
div-inv66.9%
metadata-eval66.9%
Applied egg-rr66.9%
pow166.9%
sqrt-prod60.5%
*-commutative60.5%
associate-/l*53.1%
*-commutative53.1%
associate-*l*53.1%
Applied egg-rr53.1%
unpow153.1%
*-commutative53.1%
sub-neg53.1%
associate-/l*53.1%
distribute-neg-frac53.1%
metadata-eval53.1%
associate-/l/60.5%
associate-*r/60.5%
associate-*r/60.4%
associate-/l*60.6%
*-commutative60.6%
Simplified60.6%
Taylor expanded in d around -inf 85.6%
associate-*r*85.6%
mul-1-neg85.6%
associate-/r*85.7%
Simplified85.7%
if -2.7999999999999999e203 < d < -2.99999999999999984e-123Initial program 80.3%
metadata-eval80.3%
unpow1/280.3%
metadata-eval80.3%
unpow1/280.3%
*-commutative80.3%
associate-*l*80.3%
times-frac80.3%
metadata-eval80.3%
Simplified80.3%
associate-*r*80.3%
frac-times80.3%
*-commutative80.3%
metadata-eval80.3%
associate-*r/81.9%
metadata-eval81.9%
*-commutative81.9%
frac-times81.9%
div-inv81.9%
metadata-eval81.9%
Applied egg-rr81.9%
if -2.99999999999999984e-123 < d < -4.999999999999985e-310Initial program 49.5%
metadata-eval49.5%
unpow1/249.5%
metadata-eval49.5%
unpow1/249.5%
*-commutative49.5%
associate-*l*49.5%
times-frac49.4%
metadata-eval49.4%
Simplified49.4%
add-cbrt-cube45.1%
pow345.1%
Applied egg-rr35.8%
Taylor expanded in d around -inf 53.2%
mul-1-neg53.2%
*-commutative53.2%
unsub-neg53.2%
*-commutative53.2%
Simplified53.2%
Taylor expanded in h around -inf 63.2%
+-commutative63.2%
distribute-lft-in63.2%
*-commutative63.2%
exp-sum63.3%
*-commutative63.3%
*-commutative63.3%
associate-*l*63.3%
metadata-eval63.3%
exp-to-pow63.4%
exp-to-pow63.8%
mul-1-neg63.8%
Simplified63.8%
if -4.999999999999985e-310 < d Initial program 66.9%
associate-*l*66.9%
metadata-eval66.9%
unpow1/266.9%
metadata-eval66.9%
unpow1/266.9%
associate-*l*66.9%
metadata-eval66.9%
times-frac65.2%
Simplified65.2%
sqrt-div75.4%
Applied egg-rr75.4%
frac-times66.9%
associate-/r*66.9%
Applied egg-rr76.2%
sqrt-div70.1%
Applied egg-rr82.7%
Final simplification79.6%
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.12e+204)
(*
(* d (sqrt (/ (/ 1.0 l) h)))
(- -1.0 (/ -0.5 (/ l (* h (pow (/ M (/ d (* D 0.5))) 2.0))))))
(if (<= d -3.3e-124)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (/ (* h (* 0.5 (pow (* (* M 0.5) (/ D d)) 2.0))) l)))
(if (<= d -5e-310)
(-
(* (sqrt (/ h (pow l 3.0))) (* (* (/ (* D D) d) (* M M)) 0.125))
(* d (* (pow (/ -1.0 h) 0.5) (pow (- l) -0.5))))
(*
(/ (sqrt d) (sqrt h))
(*
(/ (sqrt d) (sqrt l))
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ D d) (/ M 2.0)) 2.0))))))))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.12e+204) {
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * pow((M / (d / (D * 0.5))), 2.0)))));
} else if (d <= -3.3e-124) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((h * (0.5 * pow(((M * 0.5) * (D / d)), 2.0))) / l));
} else if (d <= -5e-310) {
tmp = (sqrt((h / pow(l, 3.0))) * ((((D * D) / d) * (M * M)) * 0.125)) - (d * (pow((-1.0 / h), 0.5) * pow(-l, -0.5)));
} else {
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * (1.0 - (0.5 * ((h / l) * pow(((D / d) * (M / 2.0)), 2.0)))));
}
return tmp;
}
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.12d+204)) then
tmp = (d * sqrt(((1.0d0 / l) / h))) * ((-1.0d0) - ((-0.5d0) / (l / (h * ((m / (d / (d_1 * 0.5d0))) ** 2.0d0)))))
else if (d <= (-3.3d-124)) then
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0d0 - ((h * (0.5d0 * (((m * 0.5d0) * (d_1 / d)) ** 2.0d0))) / l))
else if (d <= (-5d-310)) then
tmp = (sqrt((h / (l ** 3.0d0))) * ((((d_1 * d_1) / d) * (m * m)) * 0.125d0)) - (d * ((((-1.0d0) / h) ** 0.5d0) * (-l ** (-0.5d0))))
else
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * (1.0d0 - (0.5d0 * ((h / l) * (((d_1 / d) * (m / 2.0d0)) ** 2.0d0)))))
end if
code = tmp
end function
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.12e+204) {
tmp = (d * Math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * Math.pow((M / (d / (D * 0.5))), 2.0)))));
} else if (d <= -3.3e-124) {
tmp = (Math.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - ((h * (0.5 * Math.pow(((M * 0.5) * (D / d)), 2.0))) / l));
} else if (d <= -5e-310) {
tmp = (Math.sqrt((h / Math.pow(l, 3.0))) * ((((D * D) / d) * (M * M)) * 0.125)) - (d * (Math.pow((-1.0 / h), 0.5) * Math.pow(-l, -0.5)));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * ((Math.sqrt(d) / Math.sqrt(l)) * (1.0 - (0.5 * ((h / l) * Math.pow(((D / d) * (M / 2.0)), 2.0)))));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if d <= -1.12e+204: tmp = (d * math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * math.pow((M / (d / (D * 0.5))), 2.0))))) elif d <= -3.3e-124: tmp = (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - ((h * (0.5 * math.pow(((M * 0.5) * (D / d)), 2.0))) / l)) elif d <= -5e-310: tmp = (math.sqrt((h / math.pow(l, 3.0))) * ((((D * D) / d) * (M * M)) * 0.125)) - (d * (math.pow((-1.0 / h), 0.5) * math.pow(-l, -0.5))) else: tmp = (math.sqrt(d) / math.sqrt(h)) * ((math.sqrt(d) / math.sqrt(l)) * (1.0 - (0.5 * ((h / l) * math.pow(((D / d) * (M / 2.0)), 2.0))))) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (d <= -1.12e+204) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - Float64(-0.5 / Float64(l / Float64(h * (Float64(M / Float64(d / Float64(D * 0.5))) ^ 2.0)))))); elseif (d <= -3.3e-124) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(Float64(h * Float64(0.5 * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0))) / l))); elseif (d <= -5e-310) tmp = Float64(Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(Float64(Float64(Float64(D * D) / d) * Float64(M * M)) * 0.125)) - Float64(d * Float64((Float64(-1.0 / h) ^ 0.5) * (Float64(-l) ^ -0.5)))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(Float64(sqrt(d) / sqrt(l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0)))))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (d <= -1.12e+204)
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * ((M / (d / (D * 0.5))) ^ 2.0)))));
elseif (d <= -3.3e-124)
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((h * (0.5 * (((M * 0.5) * (D / d)) ^ 2.0))) / l));
elseif (d <= -5e-310)
tmp = (sqrt((h / (l ^ 3.0))) * ((((D * D) / d) * (M * M)) * 0.125)) - (d * (((-1.0 / h) ^ 0.5) * (-l ^ -0.5)));
else
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * (1.0 - (0.5 * ((h / l) * (((D / d) * (M / 2.0)) ^ 2.0)))));
end
tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.12e+204], N[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 / N[(l / N[(h * N[Power[N[(M / N[(d / N[(D * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -3.3e-124], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(0.5 * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(D * D), $MachinePrecision] / d), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] - N[(d * N[(N[Power[N[(-1.0 / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[(-l), -0.5], $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[(h / l), $MachinePrecision] * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.12 \cdot 10^{+204}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - \frac{-0.5}{\frac{\ell}{h \cdot {\left(\frac{M}{\frac{d}{D \cdot 0.5}}\right)}^{2}}}\right)\\
\mathbf{elif}\;d \leq -3.3 \cdot 10^{-124}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{h \cdot \left(0.5 \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\right)}{\ell}\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\left(\frac{D \cdot D}{d} \cdot \left(M \cdot M\right)\right) \cdot 0.125\right) - d \cdot \left({\left(\frac{-1}{h}\right)}^{0.5} \cdot {\left(-\ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if d < -1.11999999999999996e204Initial program 59.4%
metadata-eval59.4%
unpow1/259.4%
metadata-eval59.4%
unpow1/259.4%
*-commutative59.4%
associate-*l*59.4%
times-frac59.6%
metadata-eval59.6%
Simplified59.6%
associate-*r*59.6%
frac-times59.4%
*-commutative59.4%
metadata-eval59.4%
associate-*r/66.8%
metadata-eval66.8%
*-commutative66.8%
frac-times66.9%
div-inv66.9%
metadata-eval66.9%
Applied egg-rr66.9%
pow166.9%
sqrt-prod60.5%
*-commutative60.5%
associate-/l*53.1%
*-commutative53.1%
associate-*l*53.1%
Applied egg-rr53.1%
unpow153.1%
*-commutative53.1%
sub-neg53.1%
associate-/l*53.1%
distribute-neg-frac53.1%
metadata-eval53.1%
associate-/l/60.5%
associate-*r/60.5%
associate-*r/60.4%
associate-/l*60.6%
*-commutative60.6%
Simplified60.6%
Taylor expanded in d around -inf 85.6%
associate-*r*85.6%
mul-1-neg85.6%
associate-/r*85.7%
Simplified85.7%
if -1.11999999999999996e204 < d < -3.29999999999999984e-124Initial program 80.3%
metadata-eval80.3%
unpow1/280.3%
metadata-eval80.3%
unpow1/280.3%
*-commutative80.3%
associate-*l*80.3%
times-frac80.3%
metadata-eval80.3%
Simplified80.3%
associate-*r*80.3%
frac-times80.3%
*-commutative80.3%
metadata-eval80.3%
associate-*r/81.9%
metadata-eval81.9%
*-commutative81.9%
frac-times81.9%
div-inv81.9%
metadata-eval81.9%
Applied egg-rr81.9%
if -3.29999999999999984e-124 < d < -4.999999999999985e-310Initial program 49.5%
metadata-eval49.5%
unpow1/249.5%
metadata-eval49.5%
unpow1/249.5%
*-commutative49.5%
associate-*l*49.5%
times-frac49.4%
metadata-eval49.4%
Simplified49.4%
add-cbrt-cube45.1%
pow345.1%
Applied egg-rr35.8%
Taylor expanded in d around -inf 53.2%
mul-1-neg53.2%
*-commutative53.2%
unsub-neg53.2%
*-commutative53.2%
Simplified53.2%
Taylor expanded in h around -inf 63.2%
+-commutative63.2%
distribute-lft-in63.2%
*-commutative63.2%
exp-sum63.3%
*-commutative63.3%
*-commutative63.3%
associate-*l*63.3%
metadata-eval63.3%
exp-to-pow63.4%
exp-to-pow63.8%
mul-1-neg63.8%
Simplified63.8%
if -4.999999999999985e-310 < d Initial program 66.9%
associate-*l*66.9%
metadata-eval66.9%
unpow1/266.9%
metadata-eval66.9%
unpow1/266.9%
associate-*l*66.9%
metadata-eval66.9%
times-frac65.2%
Simplified65.2%
sqrt-div75.4%
Applied egg-rr75.4%
sqrt-div70.1%
Applied egg-rr81.9%
Final simplification79.2%
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= d -5.6e+203)
(*
(* d (sqrt (/ (/ 1.0 l) h)))
(- -1.0 (/ -0.5 (/ l (* h (pow (/ M (/ d (* D 0.5))) 2.0))))))
(if (<= d -2.7e-124)
(*
(* (sqrt (/ d h)) t_0)
(- 1.0 (/ (* h (* 0.5 (pow (* (* M 0.5) (/ D d)) 2.0))) l)))
(if (<= d -5e-310)
(-
(* (sqrt (/ h (pow l 3.0))) (* (* (/ (* D D) d) (* M M)) 0.125))
(* d (* (pow (/ -1.0 h) 0.5) (pow (- l) -0.5))))
(*
(/ (sqrt d) (sqrt h))
(*
t_0
(- 1.0 (* 0.5 (* (pow (/ (/ (* M D) 2.0) d) 2.0) (/ h l)))))))))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (d <= -5.6e+203) {
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * pow((M / (d / (D * 0.5))), 2.0)))));
} else if (d <= -2.7e-124) {
tmp = (sqrt((d / h)) * t_0) * (1.0 - ((h * (0.5 * pow(((M * 0.5) * (D / d)), 2.0))) / l));
} else if (d <= -5e-310) {
tmp = (sqrt((h / pow(l, 3.0))) * ((((D * D) / d) * (M * M)) * 0.125)) - (d * (pow((-1.0 / h), 0.5) * pow(-l, -0.5)));
} else {
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0 - (0.5 * (pow((((M * D) / 2.0) / d), 2.0) * (h / l)))));
}
return tmp;
}
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((d / l))
if (d <= (-5.6d+203)) then
tmp = (d * sqrt(((1.0d0 / l) / h))) * ((-1.0d0) - ((-0.5d0) / (l / (h * ((m / (d / (d_1 * 0.5d0))) ** 2.0d0)))))
else if (d <= (-2.7d-124)) then
tmp = (sqrt((d / h)) * t_0) * (1.0d0 - ((h * (0.5d0 * (((m * 0.5d0) * (d_1 / d)) ** 2.0d0))) / l))
else if (d <= (-5d-310)) then
tmp = (sqrt((h / (l ** 3.0d0))) * ((((d_1 * d_1) / d) * (m * m)) * 0.125d0)) - (d * ((((-1.0d0) / h) ** 0.5d0) * (-l ** (-0.5d0))))
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0d0 - (0.5d0 * (((((m * d_1) / 2.0d0) / d) ** 2.0d0) * (h / l)))))
end if
code = tmp
end function
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double tmp;
if (d <= -5.6e+203) {
tmp = (d * Math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * Math.pow((M / (d / (D * 0.5))), 2.0)))));
} else if (d <= -2.7e-124) {
tmp = (Math.sqrt((d / h)) * t_0) * (1.0 - ((h * (0.5 * Math.pow(((M * 0.5) * (D / d)), 2.0))) / l));
} else if (d <= -5e-310) {
tmp = (Math.sqrt((h / Math.pow(l, 3.0))) * ((((D * D) / d) * (M * M)) * 0.125)) - (d * (Math.pow((-1.0 / h), 0.5) * Math.pow(-l, -0.5)));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * (t_0 * (1.0 - (0.5 * (Math.pow((((M * D) / 2.0) / d), 2.0) * (h / l)))));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if d <= -5.6e+203: tmp = (d * math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * math.pow((M / (d / (D * 0.5))), 2.0))))) elif d <= -2.7e-124: tmp = (math.sqrt((d / h)) * t_0) * (1.0 - ((h * (0.5 * math.pow(((M * 0.5) * (D / d)), 2.0))) / l)) elif d <= -5e-310: tmp = (math.sqrt((h / math.pow(l, 3.0))) * ((((D * D) / d) * (M * M)) * 0.125)) - (d * (math.pow((-1.0 / h), 0.5) * math.pow(-l, -0.5))) else: tmp = (math.sqrt(d) / math.sqrt(h)) * (t_0 * (1.0 - (0.5 * (math.pow((((M * D) / 2.0) / d), 2.0) * (h / l))))) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (d <= -5.6e+203) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - Float64(-0.5 / Float64(l / Float64(h * (Float64(M / Float64(d / Float64(D * 0.5))) ^ 2.0)))))); elseif (d <= -2.7e-124) tmp = Float64(Float64(sqrt(Float64(d / h)) * t_0) * Float64(1.0 - Float64(Float64(h * Float64(0.5 * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0))) / l))); elseif (d <= -5e-310) tmp = Float64(Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(Float64(Float64(Float64(D * D) / d) * Float64(M * M)) * 0.125)) - Float64(d * Float64((Float64(-1.0 / h) ^ 0.5) * (Float64(-l) ^ -0.5)))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(Float64(M * D) / 2.0) / d) ^ 2.0) * Float64(h / l)))))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / l));
tmp = 0.0;
if (d <= -5.6e+203)
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * ((M / (d / (D * 0.5))) ^ 2.0)))));
elseif (d <= -2.7e-124)
tmp = (sqrt((d / h)) * t_0) * (1.0 - ((h * (0.5 * (((M * 0.5) * (D / d)) ^ 2.0))) / l));
elseif (d <= -5e-310)
tmp = (sqrt((h / (l ^ 3.0))) * ((((D * D) / d) * (M * M)) * 0.125)) - (d * (((-1.0 / h) ^ 0.5) * (-l ^ -0.5)));
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0 - (0.5 * (((((M * D) / 2.0) / d) ^ 2.0) * (h / l)))));
end
tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -5.6e+203], N[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 / N[(l / N[(h * N[Power[N[(M / N[(d / N[(D * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2.7e-124], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(0.5 * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(D * D), $MachinePrecision] / d), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] - N[(d * N[(N[Power[N[(-1.0 / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[(-l), -0.5], $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[(N[(M * D), $MachinePrecision] / 2.0), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;d \leq -5.6 \cdot 10^{+203}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - \frac{-0.5}{\frac{\ell}{h \cdot {\left(\frac{M}{\frac{d}{D \cdot 0.5}}\right)}^{2}}}\right)\\
\mathbf{elif}\;d \leq -2.7 \cdot 10^{-124}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot t_0\right) \cdot \left(1 - \frac{h \cdot \left(0.5 \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\right)}{\ell}\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\left(\frac{D \cdot D}{d} \cdot \left(M \cdot M\right)\right) \cdot 0.125\right) - d \cdot \left({\left(\frac{-1}{h}\right)}^{0.5} \cdot {\left(-\ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \left({\left(\frac{\frac{M \cdot D}{2}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\
\end{array}
\end{array}
if d < -5.5999999999999998e203Initial program 59.4%
metadata-eval59.4%
unpow1/259.4%
metadata-eval59.4%
unpow1/259.4%
*-commutative59.4%
associate-*l*59.4%
times-frac59.6%
metadata-eval59.6%
Simplified59.6%
associate-*r*59.6%
frac-times59.4%
*-commutative59.4%
metadata-eval59.4%
associate-*r/66.8%
metadata-eval66.8%
*-commutative66.8%
frac-times66.9%
div-inv66.9%
metadata-eval66.9%
Applied egg-rr66.9%
pow166.9%
sqrt-prod60.5%
*-commutative60.5%
associate-/l*53.1%
*-commutative53.1%
associate-*l*53.1%
Applied egg-rr53.1%
unpow153.1%
*-commutative53.1%
sub-neg53.1%
associate-/l*53.1%
distribute-neg-frac53.1%
metadata-eval53.1%
associate-/l/60.5%
associate-*r/60.5%
associate-*r/60.4%
associate-/l*60.6%
*-commutative60.6%
Simplified60.6%
Taylor expanded in d around -inf 85.6%
associate-*r*85.6%
mul-1-neg85.6%
associate-/r*85.7%
Simplified85.7%
if -5.5999999999999998e203 < d < -2.70000000000000018e-124Initial program 80.3%
metadata-eval80.3%
unpow1/280.3%
metadata-eval80.3%
unpow1/280.3%
*-commutative80.3%
associate-*l*80.3%
times-frac80.3%
metadata-eval80.3%
Simplified80.3%
associate-*r*80.3%
frac-times80.3%
*-commutative80.3%
metadata-eval80.3%
associate-*r/81.9%
metadata-eval81.9%
*-commutative81.9%
frac-times81.9%
div-inv81.9%
metadata-eval81.9%
Applied egg-rr81.9%
if -2.70000000000000018e-124 < d < -4.999999999999985e-310Initial program 49.5%
metadata-eval49.5%
unpow1/249.5%
metadata-eval49.5%
unpow1/249.5%
*-commutative49.5%
associate-*l*49.5%
times-frac49.4%
metadata-eval49.4%
Simplified49.4%
add-cbrt-cube45.1%
pow345.1%
Applied egg-rr35.8%
Taylor expanded in d around -inf 53.2%
mul-1-neg53.2%
*-commutative53.2%
unsub-neg53.2%
*-commutative53.2%
Simplified53.2%
Taylor expanded in h around -inf 63.2%
+-commutative63.2%
distribute-lft-in63.2%
*-commutative63.2%
exp-sum63.3%
*-commutative63.3%
*-commutative63.3%
associate-*l*63.3%
metadata-eval63.3%
exp-to-pow63.4%
exp-to-pow63.8%
mul-1-neg63.8%
Simplified63.8%
if -4.999999999999985e-310 < d Initial program 66.9%
associate-*l*66.9%
metadata-eval66.9%
unpow1/266.9%
metadata-eval66.9%
unpow1/266.9%
associate-*l*66.9%
metadata-eval66.9%
times-frac65.2%
Simplified65.2%
sqrt-div75.4%
Applied egg-rr75.4%
frac-times66.9%
associate-/r*66.9%
Applied egg-rr76.2%
Final simplification76.6%
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 (/ (* h (* 0.5 (pow (* (* M 0.5) (/ D d)) 2.0))) l)))
(t_2
(*
(* d (sqrt (/ (/ 1.0 l) h)))
(- -1.0 (/ -0.5 (/ l (* h (pow (/ M (/ d (* D 0.5))) 2.0))))))))
(if (<= d -8.6e+207)
t_2
(if (<= d -4.3e-54)
(* (* t_0 (sqrt (/ d l))) t_1)
(if (<= d -5e-310) t_2 (* t_1 (* t_0 (/ (sqrt d) (sqrt l)))))))))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 - ((h * (0.5 * pow(((M * 0.5) * (D / d)), 2.0))) / l);
double t_2 = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * pow((M / (d / (D * 0.5))), 2.0)))));
double tmp;
if (d <= -8.6e+207) {
tmp = t_2;
} else if (d <= -4.3e-54) {
tmp = (t_0 * sqrt((d / l))) * t_1;
} else if (d <= -5e-310) {
tmp = t_2;
} else {
tmp = t_1 * (t_0 * (sqrt(d) / sqrt(l)));
}
return tmp;
}
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = sqrt((d / h))
t_1 = 1.0d0 - ((h * (0.5d0 * (((m * 0.5d0) * (d_1 / d)) ** 2.0d0))) / l)
t_2 = (d * sqrt(((1.0d0 / l) / h))) * ((-1.0d0) - ((-0.5d0) / (l / (h * ((m / (d / (d_1 * 0.5d0))) ** 2.0d0)))))
if (d <= (-8.6d+207)) then
tmp = t_2
else if (d <= (-4.3d-54)) then
tmp = (t_0 * sqrt((d / l))) * t_1
else if (d <= (-5d-310)) then
tmp = t_2
else
tmp = t_1 * (t_0 * (sqrt(d) / sqrt(l)))
end if
code = tmp
end function
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 - ((h * (0.5 * Math.pow(((M * 0.5) * (D / d)), 2.0))) / l);
double t_2 = (d * Math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * Math.pow((M / (d / (D * 0.5))), 2.0)))));
double tmp;
if (d <= -8.6e+207) {
tmp = t_2;
} else if (d <= -4.3e-54) {
tmp = (t_0 * Math.sqrt((d / l))) * t_1;
} else if (d <= -5e-310) {
tmp = t_2;
} else {
tmp = t_1 * (t_0 * (Math.sqrt(d) / Math.sqrt(l)));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) t_1 = 1.0 - ((h * (0.5 * math.pow(((M * 0.5) * (D / d)), 2.0))) / l) t_2 = (d * math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * math.pow((M / (d / (D * 0.5))), 2.0))))) tmp = 0 if d <= -8.6e+207: tmp = t_2 elif d <= -4.3e-54: tmp = (t_0 * math.sqrt((d / l))) * t_1 elif d <= -5e-310: tmp = t_2 else: tmp = t_1 * (t_0 * (math.sqrt(d) / math.sqrt(l))) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = Float64(1.0 - Float64(Float64(h * Float64(0.5 * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0))) / l)) t_2 = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - Float64(-0.5 / Float64(l / Float64(h * (Float64(M / Float64(d / Float64(D * 0.5))) ^ 2.0)))))) tmp = 0.0 if (d <= -8.6e+207) tmp = t_2; elseif (d <= -4.3e-54) tmp = Float64(Float64(t_0 * sqrt(Float64(d / l))) * t_1); elseif (d <= -5e-310) tmp = t_2; else tmp = Float64(t_1 * Float64(t_0 * Float64(sqrt(d) / sqrt(l)))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / h));
t_1 = 1.0 - ((h * (0.5 * (((M * 0.5) * (D / d)) ^ 2.0))) / l);
t_2 = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * ((M / (d / (D * 0.5))) ^ 2.0)))));
tmp = 0.0;
if (d <= -8.6e+207)
tmp = t_2;
elseif (d <= -4.3e-54)
tmp = (t_0 * sqrt((d / l))) * t_1;
elseif (d <= -5e-310)
tmp = t_2;
else
tmp = t_1 * (t_0 * (sqrt(d) / sqrt(l)));
end
tmp_2 = tmp;
end
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[(N[(h * N[(0.5 * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 / N[(l / N[(h * N[Power[N[(M / N[(d / N[(D * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -8.6e+207], t$95$2, If[LessEqual[d, -4.3e-54], N[(N[(t$95$0 * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[d, -5e-310], t$95$2, N[(t$95$1 * N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := 1 - \frac{h \cdot \left(0.5 \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\right)}{\ell}\\
t_2 := \left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - \frac{-0.5}{\frac{\ell}{h \cdot {\left(\frac{M}{\frac{d}{D \cdot 0.5}}\right)}^{2}}}\right)\\
\mathbf{if}\;d \leq -8.6 \cdot 10^{+207}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;d \leq -4.3 \cdot 10^{-54}:\\
\;\;\;\;\left(t_0 \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t_1\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(t_0 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\end{array}
\end{array}
if d < -8.5999999999999995e207 or -4.3e-54 < d < -4.999999999999985e-310Initial program 52.5%
metadata-eval52.5%
unpow1/252.5%
metadata-eval52.5%
unpow1/252.5%
*-commutative52.5%
associate-*l*52.5%
times-frac52.5%
metadata-eval52.5%
Simplified52.5%
associate-*r*52.5%
frac-times52.5%
*-commutative52.5%
metadata-eval52.5%
associate-*r/54.8%
metadata-eval54.8%
*-commutative54.8%
frac-times54.8%
div-inv54.8%
metadata-eval54.8%
Applied egg-rr54.8%
pow154.8%
sqrt-prod43.9%
*-commutative43.9%
associate-/l*40.5%
*-commutative40.5%
associate-*l*40.5%
Applied egg-rr40.5%
unpow140.5%
*-commutative40.5%
sub-neg40.5%
associate-/l*40.5%
distribute-neg-frac40.5%
metadata-eval40.5%
associate-/l/43.9%
associate-*r/43.9%
associate-*r/43.9%
associate-/l*44.0%
*-commutative44.0%
Simplified44.0%
Taylor expanded in d around -inf 69.3%
associate-*r*69.3%
mul-1-neg69.3%
associate-/r*69.3%
Simplified69.3%
if -8.5999999999999995e207 < d < -4.3e-54Initial program 92.5%
metadata-eval92.5%
unpow1/292.5%
metadata-eval92.5%
unpow1/292.5%
*-commutative92.5%
associate-*l*92.5%
times-frac92.5%
metadata-eval92.5%
Simplified92.5%
associate-*r*92.5%
frac-times92.5%
*-commutative92.5%
metadata-eval92.5%
associate-*r/92.5%
metadata-eval92.5%
*-commutative92.5%
frac-times92.5%
div-inv92.5%
metadata-eval92.5%
Applied egg-rr92.5%
if -4.999999999999985e-310 < d Initial program 66.9%
metadata-eval66.9%
unpow1/266.9%
metadata-eval66.9%
unpow1/266.9%
*-commutative66.9%
associate-*l*66.9%
times-frac65.2%
metadata-eval65.2%
Simplified65.2%
associate-*r*65.2%
frac-times66.9%
*-commutative66.9%
metadata-eval66.9%
associate-*r/70.3%
metadata-eval70.3%
*-commutative70.3%
frac-times68.7%
div-inv68.7%
metadata-eval68.7%
Applied egg-rr68.7%
sqrt-div70.1%
Applied egg-rr72.9%
Final simplification75.4%
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
(*
(* d (sqrt (/ (/ 1.0 l) h)))
(- -1.0 (/ -0.5 (/ l (* h (pow (/ M (/ d (* D 0.5))) 2.0))))))))
(if (<= d -5.9e+203)
t_1
(if (<= d -9.4e-55)
(*
(* (sqrt (/ d h)) t_0)
(- 1.0 (/ (* h (* 0.5 (pow (* (* M 0.5) (/ D d)) 2.0))) l)))
(if (<= d -5e-310)
t_1
(*
(/ (sqrt d) (sqrt h))
(*
t_0
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ D d) (/ M 2.0)) 2.0)))))))))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * pow((M / (d / (D * 0.5))), 2.0)))));
double tmp;
if (d <= -5.9e+203) {
tmp = t_1;
} else if (d <= -9.4e-55) {
tmp = (sqrt((d / h)) * t_0) * (1.0 - ((h * (0.5 * pow(((M * 0.5) * (D / d)), 2.0))) / l));
} else if (d <= -5e-310) {
tmp = t_1;
} else {
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0 - (0.5 * ((h / l) * pow(((D / d) * (M / 2.0)), 2.0)))));
}
return tmp;
}
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 / l))
t_1 = (d * sqrt(((1.0d0 / l) / h))) * ((-1.0d0) - ((-0.5d0) / (l / (h * ((m / (d / (d_1 * 0.5d0))) ** 2.0d0)))))
if (d <= (-5.9d+203)) then
tmp = t_1
else if (d <= (-9.4d-55)) then
tmp = (sqrt((d / h)) * t_0) * (1.0d0 - ((h * (0.5d0 * (((m * 0.5d0) * (d_1 / d)) ** 2.0d0))) / l))
else if (d <= (-5d-310)) then
tmp = t_1
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0d0 - (0.5d0 * ((h / l) * (((d_1 / d) * (m / 2.0d0)) ** 2.0d0)))))
end if
code = tmp
end function
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 = (d * Math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * Math.pow((M / (d / (D * 0.5))), 2.0)))));
double tmp;
if (d <= -5.9e+203) {
tmp = t_1;
} else if (d <= -9.4e-55) {
tmp = (Math.sqrt((d / h)) * t_0) * (1.0 - ((h * (0.5 * Math.pow(((M * 0.5) * (D / d)), 2.0))) / l));
} else if (d <= -5e-310) {
tmp = t_1;
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * (t_0 * (1.0 - (0.5 * ((h / l) * Math.pow(((D / d) * (M / 2.0)), 2.0)))));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = (d * math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * math.pow((M / (d / (D * 0.5))), 2.0))))) tmp = 0 if d <= -5.9e+203: tmp = t_1 elif d <= -9.4e-55: tmp = (math.sqrt((d / h)) * t_0) * (1.0 - ((h * (0.5 * math.pow(((M * 0.5) * (D / d)), 2.0))) / l)) elif d <= -5e-310: tmp = t_1 else: tmp = (math.sqrt(d) / math.sqrt(h)) * (t_0 * (1.0 - (0.5 * ((h / l) * math.pow(((D / d) * (M / 2.0)), 2.0))))) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - Float64(-0.5 / Float64(l / Float64(h * (Float64(M / Float64(d / Float64(D * 0.5))) ^ 2.0)))))) tmp = 0.0 if (d <= -5.9e+203) tmp = t_1; elseif (d <= -9.4e-55) tmp = Float64(Float64(sqrt(Float64(d / h)) * t_0) * Float64(1.0 - Float64(Float64(h * Float64(0.5 * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0))) / l))); elseif (d <= -5e-310) tmp = t_1; else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0)))))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / l));
t_1 = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * ((M / (d / (D * 0.5))) ^ 2.0)))));
tmp = 0.0;
if (d <= -5.9e+203)
tmp = t_1;
elseif (d <= -9.4e-55)
tmp = (sqrt((d / h)) * t_0) * (1.0 - ((h * (0.5 * (((M * 0.5) * (D / d)) ^ 2.0))) / l));
elseif (d <= -5e-310)
tmp = t_1;
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0 - (0.5 * ((h / l) * (((D / d) * (M / 2.0)) ^ 2.0)))));
end
tmp_2 = tmp;
end
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[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 / N[(l / N[(h * N[Power[N[(M / N[(d / N[(D * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -5.9e+203], t$95$1, If[LessEqual[d, -9.4e-55], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(0.5 * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], t$95$1, N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - \frac{-0.5}{\frac{\ell}{h \cdot {\left(\frac{M}{\frac{d}{D \cdot 0.5}}\right)}^{2}}}\right)\\
\mathbf{if}\;d \leq -5.9 \cdot 10^{+203}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d \leq -9.4 \cdot 10^{-55}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot t_0\right) \cdot \left(1 - \frac{h \cdot \left(0.5 \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\right)}{\ell}\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if d < -5.89999999999999972e203 or -9.4000000000000001e-55 < d < -4.999999999999985e-310Initial program 52.5%
metadata-eval52.5%
unpow1/252.5%
metadata-eval52.5%
unpow1/252.5%
*-commutative52.5%
associate-*l*52.5%
times-frac52.5%
metadata-eval52.5%
Simplified52.5%
associate-*r*52.5%
frac-times52.5%
*-commutative52.5%
metadata-eval52.5%
associate-*r/54.8%
metadata-eval54.8%
*-commutative54.8%
frac-times54.8%
div-inv54.8%
metadata-eval54.8%
Applied egg-rr54.8%
pow154.8%
sqrt-prod43.9%
*-commutative43.9%
associate-/l*40.5%
*-commutative40.5%
associate-*l*40.5%
Applied egg-rr40.5%
unpow140.5%
*-commutative40.5%
sub-neg40.5%
associate-/l*40.5%
distribute-neg-frac40.5%
metadata-eval40.5%
associate-/l/43.9%
associate-*r/43.9%
associate-*r/43.9%
associate-/l*44.0%
*-commutative44.0%
Simplified44.0%
Taylor expanded in d around -inf 69.3%
associate-*r*69.3%
mul-1-neg69.3%
associate-/r*69.3%
Simplified69.3%
if -5.89999999999999972e203 < d < -9.4000000000000001e-55Initial program 92.5%
metadata-eval92.5%
unpow1/292.5%
metadata-eval92.5%
unpow1/292.5%
*-commutative92.5%
associate-*l*92.5%
times-frac92.5%
metadata-eval92.5%
Simplified92.5%
associate-*r*92.5%
frac-times92.5%
*-commutative92.5%
metadata-eval92.5%
associate-*r/92.5%
metadata-eval92.5%
*-commutative92.5%
frac-times92.5%
div-inv92.5%
metadata-eval92.5%
Applied egg-rr92.5%
if -4.999999999999985e-310 < d Initial program 66.9%
associate-*l*66.9%
metadata-eval66.9%
unpow1/266.9%
metadata-eval66.9%
unpow1/266.9%
associate-*l*66.9%
metadata-eval66.9%
times-frac65.2%
Simplified65.2%
sqrt-div75.4%
Applied egg-rr75.4%
Final simplification76.5%
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
(*
(* d (sqrt (/ (/ 1.0 l) h)))
(- -1.0 (/ -0.5 (/ l (* h (pow (/ M (/ d (* D 0.5))) 2.0))))))))
(if (<= d -3.1e+205)
t_1
(if (<= d -1.1e-54)
(*
(* (sqrt (/ d h)) t_0)
(- 1.0 (/ (* h (* 0.5 (pow (* (* M 0.5) (/ D d)) 2.0))) l)))
(if (<= d -5e-310)
t_1
(*
(/ (sqrt d) (sqrt h))
(*
t_0
(- 1.0 (* 0.5 (* (pow (/ (/ (* M D) 2.0) d) 2.0) (/ h l)))))))))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * pow((M / (d / (D * 0.5))), 2.0)))));
double tmp;
if (d <= -3.1e+205) {
tmp = t_1;
} else if (d <= -1.1e-54) {
tmp = (sqrt((d / h)) * t_0) * (1.0 - ((h * (0.5 * pow(((M * 0.5) * (D / d)), 2.0))) / l));
} else if (d <= -5e-310) {
tmp = t_1;
} else {
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0 - (0.5 * (pow((((M * D) / 2.0) / d), 2.0) * (h / l)))));
}
return tmp;
}
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 / l))
t_1 = (d * sqrt(((1.0d0 / l) / h))) * ((-1.0d0) - ((-0.5d0) / (l / (h * ((m / (d / (d_1 * 0.5d0))) ** 2.0d0)))))
if (d <= (-3.1d+205)) then
tmp = t_1
else if (d <= (-1.1d-54)) then
tmp = (sqrt((d / h)) * t_0) * (1.0d0 - ((h * (0.5d0 * (((m * 0.5d0) * (d_1 / d)) ** 2.0d0))) / l))
else if (d <= (-5d-310)) then
tmp = t_1
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0d0 - (0.5d0 * (((((m * d_1) / 2.0d0) / d) ** 2.0d0) * (h / l)))))
end if
code = tmp
end function
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 = (d * Math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * Math.pow((M / (d / (D * 0.5))), 2.0)))));
double tmp;
if (d <= -3.1e+205) {
tmp = t_1;
} else if (d <= -1.1e-54) {
tmp = (Math.sqrt((d / h)) * t_0) * (1.0 - ((h * (0.5 * Math.pow(((M * 0.5) * (D / d)), 2.0))) / l));
} else if (d <= -5e-310) {
tmp = t_1;
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * (t_0 * (1.0 - (0.5 * (Math.pow((((M * D) / 2.0) / d), 2.0) * (h / l)))));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = (d * math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * math.pow((M / (d / (D * 0.5))), 2.0))))) tmp = 0 if d <= -3.1e+205: tmp = t_1 elif d <= -1.1e-54: tmp = (math.sqrt((d / h)) * t_0) * (1.0 - ((h * (0.5 * math.pow(((M * 0.5) * (D / d)), 2.0))) / l)) elif d <= -5e-310: tmp = t_1 else: tmp = (math.sqrt(d) / math.sqrt(h)) * (t_0 * (1.0 - (0.5 * (math.pow((((M * D) / 2.0) / d), 2.0) * (h / l))))) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - Float64(-0.5 / Float64(l / Float64(h * (Float64(M / Float64(d / Float64(D * 0.5))) ^ 2.0)))))) tmp = 0.0 if (d <= -3.1e+205) tmp = t_1; elseif (d <= -1.1e-54) tmp = Float64(Float64(sqrt(Float64(d / h)) * t_0) * Float64(1.0 - Float64(Float64(h * Float64(0.5 * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0))) / l))); elseif (d <= -5e-310) tmp = t_1; else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(Float64(M * D) / 2.0) / d) ^ 2.0) * Float64(h / l)))))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / l));
t_1 = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 / (l / (h * ((M / (d / (D * 0.5))) ^ 2.0)))));
tmp = 0.0;
if (d <= -3.1e+205)
tmp = t_1;
elseif (d <= -1.1e-54)
tmp = (sqrt((d / h)) * t_0) * (1.0 - ((h * (0.5 * (((M * 0.5) * (D / d)) ^ 2.0))) / l));
elseif (d <= -5e-310)
tmp = t_1;
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0 - (0.5 * (((((M * D) / 2.0) / d) ^ 2.0) * (h / l)))));
end
tmp_2 = tmp;
end
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[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 / N[(l / N[(h * N[Power[N[(M / N[(d / N[(D * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -3.1e+205], t$95$1, If[LessEqual[d, -1.1e-54], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(0.5 * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], t$95$1, 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[(N[(M * D), $MachinePrecision] / 2.0), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - \frac{-0.5}{\frac{\ell}{h \cdot {\left(\frac{M}{\frac{d}{D \cdot 0.5}}\right)}^{2}}}\right)\\
\mathbf{if}\;d \leq -3.1 \cdot 10^{+205}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d \leq -1.1 \cdot 10^{-54}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot t_0\right) \cdot \left(1 - \frac{h \cdot \left(0.5 \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\right)}{\ell}\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \left({\left(\frac{\frac{M \cdot D}{2}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\
\end{array}
\end{array}
if d < -3.10000000000000017e205 or -1.1e-54 < d < -4.999999999999985e-310Initial program 52.5%
metadata-eval52.5%
unpow1/252.5%
metadata-eval52.5%
unpow1/252.5%
*-commutative52.5%
associate-*l*52.5%
times-frac52.5%
metadata-eval52.5%
Simplified52.5%
associate-*r*52.5%
frac-times52.5%
*-commutative52.5%
metadata-eval52.5%
associate-*r/54.8%
metadata-eval54.8%
*-commutative54.8%
frac-times54.8%
div-inv54.8%
metadata-eval54.8%
Applied egg-rr54.8%
pow154.8%
sqrt-prod43.9%
*-commutative43.9%
associate-/l*40.5%
*-commutative40.5%
associate-*l*40.5%
Applied egg-rr40.5%
unpow140.5%
*-commutative40.5%
sub-neg40.5%
associate-/l*40.5%
distribute-neg-frac40.5%
metadata-eval40.5%
associate-/l/43.9%
associate-*r/43.9%
associate-*r/43.9%
associate-/l*44.0%
*-commutative44.0%
Simplified44.0%
Taylor expanded in d around -inf 69.3%
associate-*r*69.3%
mul-1-neg69.3%
associate-/r*69.3%
Simplified69.3%
if -3.10000000000000017e205 < d < -1.1e-54Initial program 92.5%
metadata-eval92.5%
unpow1/292.5%
metadata-eval92.5%
unpow1/292.5%
*-commutative92.5%
associate-*l*92.5%
times-frac92.5%
metadata-eval92.5%
Simplified92.5%
associate-*r*92.5%
frac-times92.5%
*-commutative92.5%
metadata-eval92.5%
associate-*r/92.5%
metadata-eval92.5%
*-commutative92.5%
frac-times92.5%
div-inv92.5%
metadata-eval92.5%
Applied egg-rr92.5%
if -4.999999999999985e-310 < d Initial program 66.9%
associate-*l*66.9%
metadata-eval66.9%
unpow1/266.9%
metadata-eval66.9%
unpow1/266.9%
associate-*l*66.9%
metadata-eval66.9%
times-frac65.2%
Simplified65.2%
sqrt-div75.4%
Applied egg-rr75.4%
frac-times66.9%
associate-/r*66.9%
Applied egg-rr76.2%
Final simplification76.9%
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))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ D d) (/ M 2.0)) 2.0)))))))
(t_1 (* d (pow (* l h) -0.5))))
(if (<= l -7.2e+102)
t_0
(if (<= l -2.65e-14)
(- (* (sqrt (/ h (pow l 3.0))) (* (/ (* M D) (/ d D)) (* M 0.125))) t_1)
(if (<= l -1.05e-295)
(* t_1 (- -1.0 (/ -0.5 (/ l (* h (pow (/ M (/ d (* D 0.5))) 2.0))))))
(if (<= l 7e+35) t_0 (* d (* (pow h -0.5) (pow l -0.5)))))))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * pow(((D / d) * (M / 2.0)), 2.0)))));
double t_1 = d * pow((l * h), -0.5);
double tmp;
if (l <= -7.2e+102) {
tmp = t_0;
} else if (l <= -2.65e-14) {
tmp = (sqrt((h / pow(l, 3.0))) * (((M * D) / (d / D)) * (M * 0.125))) - t_1;
} else if (l <= -1.05e-295) {
tmp = t_1 * (-1.0 - (-0.5 / (l / (h * pow((M / (d / (D * 0.5))), 2.0)))));
} else if (l <= 7e+35) {
tmp = t_0;
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
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)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((h / l) * (((d_1 / d) * (m / 2.0d0)) ** 2.0d0)))))
t_1 = d * ((l * h) ** (-0.5d0))
if (l <= (-7.2d+102)) then
tmp = t_0
else if (l <= (-2.65d-14)) then
tmp = (sqrt((h / (l ** 3.0d0))) * (((m * d_1) / (d / d_1)) * (m * 0.125d0))) - t_1
else if (l <= (-1.05d-295)) then
tmp = t_1 * ((-1.0d0) - ((-0.5d0) / (l / (h * ((m / (d / (d_1 * 0.5d0))) ** 2.0d0)))))
else if (l <= 7d+35) then
tmp = t_0
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * Math.pow(((D / d) * (M / 2.0)), 2.0)))));
double t_1 = d * Math.pow((l * h), -0.5);
double tmp;
if (l <= -7.2e+102) {
tmp = t_0;
} else if (l <= -2.65e-14) {
tmp = (Math.sqrt((h / Math.pow(l, 3.0))) * (((M * D) / (d / D)) * (M * 0.125))) - t_1;
} else if (l <= -1.05e-295) {
tmp = t_1 * (-1.0 - (-0.5 / (l / (h * Math.pow((M / (d / (D * 0.5))), 2.0)))));
} else if (l <= 7e+35) {
tmp = t_0;
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * math.pow(((D / d) * (M / 2.0)), 2.0))))) t_1 = d * math.pow((l * h), -0.5) tmp = 0 if l <= -7.2e+102: tmp = t_0 elif l <= -2.65e-14: tmp = (math.sqrt((h / math.pow(l, 3.0))) * (((M * D) / (d / D)) * (M * 0.125))) - t_1 elif l <= -1.05e-295: tmp = t_1 * (-1.0 - (-0.5 / (l / (h * math.pow((M / (d / (D * 0.5))), 2.0))))) elif l <= 7e+35: tmp = t_0 else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0)))))) t_1 = Float64(d * (Float64(l * h) ^ -0.5)) tmp = 0.0 if (l <= -7.2e+102) tmp = t_0; elseif (l <= -2.65e-14) tmp = Float64(Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(Float64(Float64(M * D) / Float64(d / D)) * Float64(M * 0.125))) - t_1); elseif (l <= -1.05e-295) tmp = Float64(t_1 * Float64(-1.0 - Float64(-0.5 / Float64(l / Float64(h * (Float64(M / Float64(d / Float64(D * 0.5))) ^ 2.0)))))); elseif (l <= 7e+35) tmp = t_0; else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * (((D / d) * (M / 2.0)) ^ 2.0)))));
t_1 = d * ((l * h) ^ -0.5);
tmp = 0.0;
if (l <= -7.2e+102)
tmp = t_0;
elseif (l <= -2.65e-14)
tmp = (sqrt((h / (l ^ 3.0))) * (((M * D) / (d / D)) * (M * 0.125))) - t_1;
elseif (l <= -1.05e-295)
tmp = t_1 * (-1.0 - (-0.5 / (l / (h * ((M / (d / (D * 0.5))) ^ 2.0)))));
elseif (l <= 7e+35)
tmp = t_0;
else
tmp = d * ((h ^ -0.5) * (l ^ -0.5));
end
tmp_2 = tmp;
end
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[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[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -7.2e+102], t$95$0, If[LessEqual[l, -2.65e-14], N[(N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(M * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[l, -1.05e-295], N[(t$95$1 * N[(-1.0 - N[(-0.5 / N[(l / N[(h * N[Power[N[(M / N[(d / N[(D * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 7e+35], t$95$0, N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\right)\right)\right)\\
t_1 := d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq -7.2 \cdot 10^{+102}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq -2.65 \cdot 10^{-14}:\\
\;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\frac{M \cdot D}{\frac{d}{D}} \cdot \left(M \cdot 0.125\right)\right) - t_1\\
\mathbf{elif}\;\ell \leq -1.05 \cdot 10^{-295}:\\
\;\;\;\;t_1 \cdot \left(-1 - \frac{-0.5}{\frac{\ell}{h \cdot {\left(\frac{M}{\frac{d}{D \cdot 0.5}}\right)}^{2}}}\right)\\
\mathbf{elif}\;\ell \leq 7 \cdot 10^{+35}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -7.2000000000000003e102 or -1.04999999999999997e-295 < l < 7.0000000000000001e35Initial program 72.8%
associate-*l*72.9%
metadata-eval72.9%
unpow1/272.9%
metadata-eval72.9%
unpow1/272.9%
associate-*l*72.9%
metadata-eval72.9%
times-frac72.1%
Simplified72.1%
if -7.2000000000000003e102 < l < -2.6500000000000001e-14Initial program 67.5%
metadata-eval67.5%
unpow1/267.5%
metadata-eval67.5%
unpow1/267.5%
*-commutative67.5%
associate-*l*67.5%
times-frac67.3%
metadata-eval67.3%
Simplified67.3%
add-cbrt-cube46.7%
pow346.6%
Applied egg-rr31.7%
Taylor expanded in d around -inf 60.0%
mul-1-neg60.0%
*-commutative60.0%
unsub-neg60.0%
*-commutative60.0%
Simplified60.0%
Taylor expanded in D around 0 60.0%
*-commutative60.0%
*-commutative60.0%
unpow260.0%
unpow260.0%
unpow260.0%
associate-*l/60.0%
unpow260.0%
associate-*r*60.0%
associate-*r*60.0%
associate-*l*60.0%
associate-*r*63.8%
associate-/l*74.5%
associate-*l/85.0%
Simplified85.0%
if -2.6500000000000001e-14 < l < -1.04999999999999997e-295Initial program 70.2%
metadata-eval70.2%
unpow1/270.2%
metadata-eval70.2%
unpow1/270.2%
*-commutative70.2%
associate-*l*70.2%
times-frac70.2%
metadata-eval70.2%
Simplified70.2%
associate-*r*70.2%
frac-times70.2%
*-commutative70.2%
metadata-eval70.2%
associate-*r/75.2%
metadata-eval75.2%
*-commutative75.2%
frac-times75.1%
div-inv75.1%
metadata-eval75.1%
Applied egg-rr75.1%
pow175.1%
sqrt-prod66.1%
*-commutative66.1%
associate-/l*61.1%
*-commutative61.1%
associate-*l*61.1%
Applied egg-rr61.1%
unpow161.1%
*-commutative61.1%
sub-neg61.1%
associate-/l*61.1%
distribute-neg-frac61.1%
metadata-eval61.1%
associate-/l/66.1%
associate-*r/66.1%
associate-*r/66.1%
associate-/l*66.1%
*-commutative66.1%
Simplified66.1%
Taylor expanded in d around -inf 83.1%
associate-*r*83.1%
mul-1-neg83.1%
*-commutative83.1%
unpow-183.1%
sqr-pow83.1%
rem-sqrt-square83.9%
sqr-pow84.0%
fabs-sqr84.0%
sqr-pow83.9%
metadata-eval83.9%
Simplified83.9%
if 7.0000000000000001e35 < l Initial program 45.7%
metadata-eval45.7%
unpow1/245.7%
metadata-eval45.7%
unpow1/245.7%
*-commutative45.7%
associate-*l*45.7%
times-frac43.6%
metadata-eval43.6%
Simplified43.6%
Taylor expanded in d around inf 51.1%
*-un-lft-identity51.1%
*-commutative51.1%
Applied egg-rr51.1%
*-lft-identity51.1%
unpow-151.1%
sqr-pow51.1%
rem-sqrt-square51.1%
sqr-pow50.9%
fabs-sqr50.9%
sqr-pow51.1%
metadata-eval51.1%
Simplified51.1%
unpow-prod-down59.2%
Applied egg-rr59.2%
Final simplification74.0%
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 (/ -0.5 (/ l (* h (pow (/ M (/ d (* D 0.5))) 2.0)))))
(t_1 (* (sqrt (/ d h)) (sqrt (/ d l))))
(t_2 (* d (pow (* l h) -0.5))))
(if (<= l -8e+102)
(* t_1 (- 1.0 (* D (/ D (/ l (/ (* (* M M) 0.125) (* d (/ d h))))))))
(if (<= l -2.05e-19)
(- (* (sqrt (/ h (pow l 3.0))) (* (/ (* M D) (/ d D)) (* M 0.125))) t_2)
(if (<= l -1.6e-298)
(* t_2 (- -1.0 t_0))
(if (<= l 2.8e-138)
(* (+ 1.0 t_0) (sqrt (* (/ d h) (/ d l))))
(if (<= l 7e+35)
(*
t_1
(- 1.0 (/ (* (* M (/ D d)) (/ h (/ d M))) (/ (/ l D) 0.125))))
(* d (* (pow h -0.5) (pow l -0.5))))))))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = -0.5 / (l / (h * pow((M / (d / (D * 0.5))), 2.0)));
double t_1 = sqrt((d / h)) * sqrt((d / l));
double t_2 = d * pow((l * h), -0.5);
double tmp;
if (l <= -8e+102) {
tmp = t_1 * (1.0 - (D * (D / (l / (((M * M) * 0.125) / (d * (d / h)))))));
} else if (l <= -2.05e-19) {
tmp = (sqrt((h / pow(l, 3.0))) * (((M * D) / (d / D)) * (M * 0.125))) - t_2;
} else if (l <= -1.6e-298) {
tmp = t_2 * (-1.0 - t_0);
} else if (l <= 2.8e-138) {
tmp = (1.0 + t_0) * sqrt(((d / h) * (d / l)));
} else if (l <= 7e+35) {
tmp = t_1 * (1.0 - (((M * (D / d)) * (h / (d / M))) / ((l / D) / 0.125)));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
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 = (-0.5d0) / (l / (h * ((m / (d / (d_1 * 0.5d0))) ** 2.0d0)))
t_1 = sqrt((d / h)) * sqrt((d / l))
t_2 = d * ((l * h) ** (-0.5d0))
if (l <= (-8d+102)) then
tmp = t_1 * (1.0d0 - (d_1 * (d_1 / (l / (((m * m) * 0.125d0) / (d * (d / h)))))))
else if (l <= (-2.05d-19)) then
tmp = (sqrt((h / (l ** 3.0d0))) * (((m * d_1) / (d / d_1)) * (m * 0.125d0))) - t_2
else if (l <= (-1.6d-298)) then
tmp = t_2 * ((-1.0d0) - t_0)
else if (l <= 2.8d-138) then
tmp = (1.0d0 + t_0) * sqrt(((d / h) * (d / l)))
else if (l <= 7d+35) then
tmp = t_1 * (1.0d0 - (((m * (d_1 / d)) * (h / (d / m))) / ((l / d_1) / 0.125d0)))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = -0.5 / (l / (h * Math.pow((M / (d / (D * 0.5))), 2.0)));
double t_1 = Math.sqrt((d / h)) * Math.sqrt((d / l));
double t_2 = d * Math.pow((l * h), -0.5);
double tmp;
if (l <= -8e+102) {
tmp = t_1 * (1.0 - (D * (D / (l / (((M * M) * 0.125) / (d * (d / h)))))));
} else if (l <= -2.05e-19) {
tmp = (Math.sqrt((h / Math.pow(l, 3.0))) * (((M * D) / (d / D)) * (M * 0.125))) - t_2;
} else if (l <= -1.6e-298) {
tmp = t_2 * (-1.0 - t_0);
} else if (l <= 2.8e-138) {
tmp = (1.0 + t_0) * Math.sqrt(((d / h) * (d / l)));
} else if (l <= 7e+35) {
tmp = t_1 * (1.0 - (((M * (D / d)) * (h / (d / M))) / ((l / D) / 0.125)));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = -0.5 / (l / (h * math.pow((M / (d / (D * 0.5))), 2.0))) t_1 = math.sqrt((d / h)) * math.sqrt((d / l)) t_2 = d * math.pow((l * h), -0.5) tmp = 0 if l <= -8e+102: tmp = t_1 * (1.0 - (D * (D / (l / (((M * M) * 0.125) / (d * (d / h))))))) elif l <= -2.05e-19: tmp = (math.sqrt((h / math.pow(l, 3.0))) * (((M * D) / (d / D)) * (M * 0.125))) - t_2 elif l <= -1.6e-298: tmp = t_2 * (-1.0 - t_0) elif l <= 2.8e-138: tmp = (1.0 + t_0) * math.sqrt(((d / h) * (d / l))) elif l <= 7e+35: tmp = t_1 * (1.0 - (((M * (D / d)) * (h / (d / M))) / ((l / D) / 0.125))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(-0.5 / Float64(l / Float64(h * (Float64(M / Float64(d / Float64(D * 0.5))) ^ 2.0)))) t_1 = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) t_2 = Float64(d * (Float64(l * h) ^ -0.5)) tmp = 0.0 if (l <= -8e+102) tmp = Float64(t_1 * Float64(1.0 - Float64(D * Float64(D / Float64(l / Float64(Float64(Float64(M * M) * 0.125) / Float64(d * Float64(d / h)))))))); elseif (l <= -2.05e-19) tmp = Float64(Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(Float64(Float64(M * D) / Float64(d / D)) * Float64(M * 0.125))) - t_2); elseif (l <= -1.6e-298) tmp = Float64(t_2 * Float64(-1.0 - t_0)); elseif (l <= 2.8e-138) tmp = Float64(Float64(1.0 + t_0) * sqrt(Float64(Float64(d / h) * Float64(d / l)))); elseif (l <= 7e+35) tmp = Float64(t_1 * Float64(1.0 - Float64(Float64(Float64(M * Float64(D / d)) * Float64(h / Float64(d / M))) / Float64(Float64(l / D) / 0.125)))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = -0.5 / (l / (h * ((M / (d / (D * 0.5))) ^ 2.0)));
t_1 = sqrt((d / h)) * sqrt((d / l));
t_2 = d * ((l * h) ^ -0.5);
tmp = 0.0;
if (l <= -8e+102)
tmp = t_1 * (1.0 - (D * (D / (l / (((M * M) * 0.125) / (d * (d / h)))))));
elseif (l <= -2.05e-19)
tmp = (sqrt((h / (l ^ 3.0))) * (((M * D) / (d / D)) * (M * 0.125))) - t_2;
elseif (l <= -1.6e-298)
tmp = t_2 * (-1.0 - t_0);
elseif (l <= 2.8e-138)
tmp = (1.0 + t_0) * sqrt(((d / h) * (d / l)));
elseif (l <= 7e+35)
tmp = t_1 * (1.0 - (((M * (D / d)) * (h / (d / M))) / ((l / D) / 0.125)));
else
tmp = d * ((h ^ -0.5) * (l ^ -0.5));
end
tmp_2 = tmp;
end
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[(-0.5 / N[(l / N[(h * N[Power[N[(M / N[(d / N[(D * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -8e+102], N[(t$95$1 * N[(1.0 - N[(D * N[(D / N[(l / N[(N[(N[(M * M), $MachinePrecision] * 0.125), $MachinePrecision] / N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2.05e-19], N[(N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(M * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[l, -1.6e-298], N[(t$95$2 * N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.8e-138], N[(N[(1.0 + t$95$0), $MachinePrecision] * N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 7e+35], N[(t$95$1 * N[(1.0 - N[(N[(N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(h / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(l / D), $MachinePrecision] / 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{-0.5}{\frac{\ell}{h \cdot {\left(\frac{M}{\frac{d}{D \cdot 0.5}}\right)}^{2}}}\\
t_1 := \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
t_2 := d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq -8 \cdot 10^{+102}:\\
\;\;\;\;t_1 \cdot \left(1 - D \cdot \frac{D}{\frac{\ell}{\frac{\left(M \cdot M\right) \cdot 0.125}{d \cdot \frac{d}{h}}}}\right)\\
\mathbf{elif}\;\ell \leq -2.05 \cdot 10^{-19}:\\
\;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\frac{M \cdot D}{\frac{d}{D}} \cdot \left(M \cdot 0.125\right)\right) - t_2\\
\mathbf{elif}\;\ell \leq -1.6 \cdot 10^{-298}:\\
\;\;\;\;t_2 \cdot \left(-1 - t_0\right)\\
\mathbf{elif}\;\ell \leq 2.8 \cdot 10^{-138}:\\
\;\;\;\;\left(1 + t_0\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq 7 \cdot 10^{+35}:\\
\;\;\;\;t_1 \cdot \left(1 - \frac{\left(M \cdot \frac{D}{d}\right) \cdot \frac{h}{\frac{d}{M}}}{\frac{\frac{\ell}{D}}{0.125}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -7.99999999999999982e102Initial program 57.1%
metadata-eval57.1%
unpow1/257.1%
metadata-eval57.1%
unpow1/257.1%
*-commutative57.1%
associate-*l*57.1%
times-frac57.3%
metadata-eval57.3%
Simplified57.3%
Taylor expanded in M around 0 43.9%
*-commutative43.9%
times-frac42.0%
associate-*l*42.0%
unpow242.0%
associate-/l*42.2%
associate-/l*41.2%
unpow241.2%
unpow241.2%
Simplified41.2%
Taylor expanded in D around 0 43.9%
Simplified43.6%
if -7.99999999999999982e102 < l < -2.04999999999999993e-19Initial program 67.5%
metadata-eval67.5%
unpow1/267.5%
metadata-eval67.5%
unpow1/267.5%
*-commutative67.5%
associate-*l*67.5%
times-frac67.3%
metadata-eval67.3%
Simplified67.3%
add-cbrt-cube46.7%
pow346.6%
Applied egg-rr31.7%
Taylor expanded in d around -inf 60.0%
mul-1-neg60.0%
*-commutative60.0%
unsub-neg60.0%
*-commutative60.0%
Simplified60.0%
Taylor expanded in D around 0 60.0%
*-commutative60.0%
*-commutative60.0%
unpow260.0%
unpow260.0%
unpow260.0%
associate-*l/60.0%
unpow260.0%
associate-*r*60.0%
associate-*r*60.0%
associate-*l*60.0%
associate-*r*63.8%
associate-/l*74.5%
associate-*l/85.0%
Simplified85.0%
if -2.04999999999999993e-19 < l < -1.59999999999999999e-298Initial program 70.2%
metadata-eval70.2%
unpow1/270.2%
metadata-eval70.2%
unpow1/270.2%
*-commutative70.2%
associate-*l*70.2%
times-frac70.2%
metadata-eval70.2%
Simplified70.2%
associate-*r*70.2%
frac-times70.2%
*-commutative70.2%
metadata-eval70.2%
associate-*r/75.2%
metadata-eval75.2%
*-commutative75.2%
frac-times75.1%
div-inv75.1%
metadata-eval75.1%
Applied egg-rr75.1%
pow175.1%
sqrt-prod66.1%
*-commutative66.1%
associate-/l*61.1%
*-commutative61.1%
associate-*l*61.1%
Applied egg-rr61.1%
unpow161.1%
*-commutative61.1%
sub-neg61.1%
associate-/l*61.1%
distribute-neg-frac61.1%
metadata-eval61.1%
associate-/l/66.1%
associate-*r/66.1%
associate-*r/66.1%
associate-/l*66.1%
*-commutative66.1%
Simplified66.1%
Taylor expanded in d around -inf 83.1%
associate-*r*83.1%
mul-1-neg83.1%
*-commutative83.1%
unpow-183.1%
sqr-pow83.1%
rem-sqrt-square83.9%
sqr-pow84.0%
fabs-sqr84.0%
sqr-pow83.9%
metadata-eval83.9%
Simplified83.9%
if -1.59999999999999999e-298 < l < 2.80000000000000001e-138Initial program 85.0%
metadata-eval85.0%
unpow1/285.0%
metadata-eval85.0%
unpow1/285.0%
*-commutative85.0%
associate-*l*85.0%
times-frac85.0%
metadata-eval85.0%
Simplified85.0%
associate-*r*85.0%
frac-times85.0%
*-commutative85.0%
metadata-eval85.0%
associate-*r/91.1%
metadata-eval91.1%
*-commutative91.1%
frac-times91.1%
div-inv91.1%
metadata-eval91.1%
Applied egg-rr91.1%
pow191.1%
sqrt-prod88.5%
*-commutative88.5%
associate-/l*85.3%
*-commutative85.3%
associate-*l*85.3%
Applied egg-rr85.3%
unpow185.3%
*-commutative85.3%
sub-neg85.3%
associate-/l*85.3%
distribute-neg-frac85.3%
metadata-eval85.3%
associate-/l/88.5%
associate-*r/88.5%
associate-*r/88.5%
associate-/l*88.5%
*-commutative88.5%
Simplified88.5%
if 2.80000000000000001e-138 < l < 7.0000000000000001e35Initial program 80.7%
metadata-eval80.7%
unpow1/280.7%
metadata-eval80.7%
unpow1/280.7%
*-commutative80.7%
associate-*l*80.7%
times-frac78.4%
metadata-eval78.4%
Simplified78.4%
Taylor expanded in M around 0 61.1%
*-commutative61.1%
times-frac58.7%
associate-*l*58.7%
unpow258.7%
associate-/l*58.7%
associate-/l*56.3%
unpow256.3%
unpow256.3%
Simplified56.3%
Taylor expanded in D around 0 61.1%
Simplified78.5%
if 7.0000000000000001e35 < l Initial program 45.7%
metadata-eval45.7%
unpow1/245.7%
metadata-eval45.7%
unpow1/245.7%
*-commutative45.7%
associate-*l*45.7%
times-frac43.6%
metadata-eval43.6%
Simplified43.6%
Taylor expanded in d around inf 51.1%
*-un-lft-identity51.1%
*-commutative51.1%
Applied egg-rr51.1%
*-lft-identity51.1%
unpow-151.1%
sqr-pow51.1%
rem-sqrt-square51.1%
sqr-pow50.9%
fabs-sqr50.9%
sqr-pow51.1%
metadata-eval51.1%
Simplified51.1%
unpow-prod-down59.2%
Applied egg-rr59.2%
Final simplification72.0%
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 (/ -0.5 (/ l (* h (pow (/ M (/ d (* D 0.5))) 2.0))))))
(if (<= l -1.16e-297)
(* (* d (sqrt (/ (/ 1.0 l) h))) (- -1.0 t_0))
(if (<= l 7.4e-107)
(* (+ 1.0 t_0) (sqrt (* (/ d h) (/ d l))))
(if (<= l 7e+35)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* D (/ D (/ l (/ (* (* M M) 0.125) (* d (/ d h))))))))
(* d (* (pow h -0.5) (pow l -0.5))))))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = -0.5 / (l / (h * pow((M / (d / (D * 0.5))), 2.0)));
double tmp;
if (l <= -1.16e-297) {
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - t_0);
} else if (l <= 7.4e-107) {
tmp = (1.0 + t_0) * sqrt(((d / h) * (d / l)));
} else if (l <= 7e+35) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (D * (D / (l / (((M * M) * 0.125) / (d * (d / h)))))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
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 = (-0.5d0) / (l / (h * ((m / (d / (d_1 * 0.5d0))) ** 2.0d0)))
if (l <= (-1.16d-297)) then
tmp = (d * sqrt(((1.0d0 / l) / h))) * ((-1.0d0) - t_0)
else if (l <= 7.4d-107) then
tmp = (1.0d0 + t_0) * sqrt(((d / h) * (d / l)))
else if (l <= 7d+35) then
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0d0 - (d_1 * (d_1 / (l / (((m * m) * 0.125d0) / (d * (d / h)))))))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = -0.5 / (l / (h * Math.pow((M / (d / (D * 0.5))), 2.0)));
double tmp;
if (l <= -1.16e-297) {
tmp = (d * Math.sqrt(((1.0 / l) / h))) * (-1.0 - t_0);
} else if (l <= 7.4e-107) {
tmp = (1.0 + t_0) * Math.sqrt(((d / h) * (d / l)));
} else if (l <= 7e+35) {
tmp = (Math.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - (D * (D / (l / (((M * M) * 0.125) / (d * (d / h)))))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = -0.5 / (l / (h * math.pow((M / (d / (D * 0.5))), 2.0))) tmp = 0 if l <= -1.16e-297: tmp = (d * math.sqrt(((1.0 / l) / h))) * (-1.0 - t_0) elif l <= 7.4e-107: tmp = (1.0 + t_0) * math.sqrt(((d / h) * (d / l))) elif l <= 7e+35: tmp = (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - (D * (D / (l / (((M * M) * 0.125) / (d * (d / h))))))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(-0.5 / Float64(l / Float64(h * (Float64(M / Float64(d / Float64(D * 0.5))) ^ 2.0)))) tmp = 0.0 if (l <= -1.16e-297) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - t_0)); elseif (l <= 7.4e-107) tmp = Float64(Float64(1.0 + t_0) * sqrt(Float64(Float64(d / h) * Float64(d / l)))); elseif (l <= 7e+35) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(D * Float64(D / Float64(l / Float64(Float64(Float64(M * M) * 0.125) / Float64(d * Float64(d / h)))))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = -0.5 / (l / (h * ((M / (d / (D * 0.5))) ^ 2.0)));
tmp = 0.0;
if (l <= -1.16e-297)
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - t_0);
elseif (l <= 7.4e-107)
tmp = (1.0 + t_0) * sqrt(((d / h) * (d / l)));
elseif (l <= 7e+35)
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (D * (D / (l / (((M * M) * 0.125) / (d * (d / h)))))));
else
tmp = d * ((h ^ -0.5) * (l ^ -0.5));
end
tmp_2 = tmp;
end
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[(-0.5 / N[(l / N[(h * N[Power[N[(M / N[(d / N[(D * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.16e-297], N[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 7.4e-107], N[(N[(1.0 + t$95$0), $MachinePrecision] * N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 7e+35], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(D * N[(D / N[(l / N[(N[(N[(M * M), $MachinePrecision] * 0.125), $MachinePrecision] / N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{-0.5}{\frac{\ell}{h \cdot {\left(\frac{M}{\frac{d}{D \cdot 0.5}}\right)}^{2}}}\\
\mathbf{if}\;\ell \leq -1.16 \cdot 10^{-297}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - t_0\right)\\
\mathbf{elif}\;\ell \leq 7.4 \cdot 10^{-107}:\\
\;\;\;\;\left(1 + t_0\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq 7 \cdot 10^{+35}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - D \cdot \frac{D}{\frac{\ell}{\frac{\left(M \cdot M\right) \cdot 0.125}{d \cdot \frac{d}{h}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1.16000000000000006e-297Initial program 65.2%
metadata-eval65.2%
unpow1/265.2%
metadata-eval65.2%
unpow1/265.2%
*-commutative65.2%
associate-*l*65.2%
times-frac65.2%
metadata-eval65.2%
Simplified65.2%
associate-*r*65.2%
frac-times65.2%
*-commutative65.2%
metadata-eval65.2%
associate-*r/66.8%
metadata-eval66.8%
*-commutative66.8%
frac-times66.8%
div-inv66.8%
metadata-eval66.8%
Applied egg-rr66.8%
pow166.8%
sqrt-prod54.8%
*-commutative54.8%
associate-/l*52.5%
*-commutative52.5%
associate-*l*52.5%
Applied egg-rr52.5%
unpow152.5%
*-commutative52.5%
sub-neg52.5%
associate-/l*52.5%
distribute-neg-frac52.5%
metadata-eval52.5%
associate-/l/54.8%
associate-*r/54.8%
associate-*r/54.8%
associate-/l*54.9%
*-commutative54.9%
Simplified54.9%
Taylor expanded in d around -inf 67.9%
associate-*r*67.9%
mul-1-neg67.9%
associate-/r*68.4%
Simplified68.4%
if -1.16000000000000006e-297 < l < 7.4000000000000006e-107Initial program 84.7%
metadata-eval84.7%
unpow1/284.7%
metadata-eval84.7%
unpow1/284.7%
*-commutative84.7%
associate-*l*84.7%
times-frac84.7%
metadata-eval84.7%
Simplified84.7%
associate-*r*84.7%
frac-times84.7%
*-commutative84.7%
metadata-eval84.7%
associate-*r/92.4%
metadata-eval92.4%
*-commutative92.4%
frac-times92.4%
div-inv92.4%
metadata-eval92.4%
Applied egg-rr92.4%
pow192.4%
sqrt-prod87.8%
*-commutative87.8%
associate-/l*82.5%
*-commutative82.5%
associate-*l*82.5%
Applied egg-rr82.5%
unpow182.5%
*-commutative82.5%
sub-neg82.5%
associate-/l*82.5%
distribute-neg-frac82.5%
metadata-eval82.5%
associate-/l/87.8%
associate-*r/87.8%
associate-*r/87.8%
associate-/l*87.8%
*-commutative87.8%
Simplified87.8%
if 7.4000000000000006e-107 < l < 7.0000000000000001e35Initial program 80.3%
metadata-eval80.3%
unpow1/280.3%
metadata-eval80.3%
unpow1/280.3%
*-commutative80.3%
associate-*l*80.3%
times-frac77.6%
metadata-eval77.6%
Simplified77.6%
Taylor expanded in M around 0 57.4%
*-commutative57.4%
times-frac54.6%
associate-*l*54.6%
unpow254.6%
associate-/l*54.6%
associate-/l*54.6%
unpow254.6%
unpow254.6%
Simplified54.6%
Taylor expanded in D around 0 57.4%
Simplified63.2%
if 7.0000000000000001e35 < l Initial program 45.7%
metadata-eval45.7%
unpow1/245.7%
metadata-eval45.7%
unpow1/245.7%
*-commutative45.7%
associate-*l*45.7%
times-frac43.6%
metadata-eval43.6%
Simplified43.6%
Taylor expanded in d around inf 51.1%
*-un-lft-identity51.1%
*-commutative51.1%
Applied egg-rr51.1%
*-lft-identity51.1%
unpow-151.1%
sqr-pow51.1%
rem-sqrt-square51.1%
sqr-pow50.9%
fabs-sqr50.9%
sqr-pow51.1%
metadata-eval51.1%
Simplified51.1%
unpow-prod-down59.2%
Applied egg-rr59.2%
Final simplification68.9%
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 (/ -0.5 (/ l (* h (pow (/ M (/ d (* D 0.5))) 2.0))))))
(if (<= l -3.8e-297)
(* (* d (sqrt (/ (/ 1.0 l) h))) (- -1.0 t_0))
(if (<= l 4e-139)
(* (+ 1.0 t_0) (sqrt (* (/ d h) (/ d l))))
(if (<= l 7e+35)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (/ (* (* M (/ D d)) (/ h (/ d M))) (/ (/ l D) 0.125))))
(* d (* (pow h -0.5) (pow l -0.5))))))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = -0.5 / (l / (h * pow((M / (d / (D * 0.5))), 2.0)));
double tmp;
if (l <= -3.8e-297) {
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - t_0);
} else if (l <= 4e-139) {
tmp = (1.0 + t_0) * sqrt(((d / h) * (d / l)));
} else if (l <= 7e+35) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (((M * (D / d)) * (h / (d / M))) / ((l / D) / 0.125)));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
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 = (-0.5d0) / (l / (h * ((m / (d / (d_1 * 0.5d0))) ** 2.0d0)))
if (l <= (-3.8d-297)) then
tmp = (d * sqrt(((1.0d0 / l) / h))) * ((-1.0d0) - t_0)
else if (l <= 4d-139) then
tmp = (1.0d0 + t_0) * sqrt(((d / h) * (d / l)))
else if (l <= 7d+35) then
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0d0 - (((m * (d_1 / d)) * (h / (d / m))) / ((l / d_1) / 0.125d0)))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = -0.5 / (l / (h * Math.pow((M / (d / (D * 0.5))), 2.0)));
double tmp;
if (l <= -3.8e-297) {
tmp = (d * Math.sqrt(((1.0 / l) / h))) * (-1.0 - t_0);
} else if (l <= 4e-139) {
tmp = (1.0 + t_0) * Math.sqrt(((d / h) * (d / l)));
} else if (l <= 7e+35) {
tmp = (Math.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - (((M * (D / d)) * (h / (d / M))) / ((l / D) / 0.125)));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = -0.5 / (l / (h * math.pow((M / (d / (D * 0.5))), 2.0))) tmp = 0 if l <= -3.8e-297: tmp = (d * math.sqrt(((1.0 / l) / h))) * (-1.0 - t_0) elif l <= 4e-139: tmp = (1.0 + t_0) * math.sqrt(((d / h) * (d / l))) elif l <= 7e+35: tmp = (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - (((M * (D / d)) * (h / (d / M))) / ((l / D) / 0.125))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(-0.5 / Float64(l / Float64(h * (Float64(M / Float64(d / Float64(D * 0.5))) ^ 2.0)))) tmp = 0.0 if (l <= -3.8e-297) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - t_0)); elseif (l <= 4e-139) tmp = Float64(Float64(1.0 + t_0) * sqrt(Float64(Float64(d / h) * Float64(d / l)))); elseif (l <= 7e+35) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(Float64(Float64(M * Float64(D / d)) * Float64(h / Float64(d / M))) / Float64(Float64(l / D) / 0.125)))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = -0.5 / (l / (h * ((M / (d / (D * 0.5))) ^ 2.0)));
tmp = 0.0;
if (l <= -3.8e-297)
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - t_0);
elseif (l <= 4e-139)
tmp = (1.0 + t_0) * sqrt(((d / h) * (d / l)));
elseif (l <= 7e+35)
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (((M * (D / d)) * (h / (d / M))) / ((l / D) / 0.125)));
else
tmp = d * ((h ^ -0.5) * (l ^ -0.5));
end
tmp_2 = tmp;
end
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[(-0.5 / N[(l / N[(h * N[Power[N[(M / N[(d / N[(D * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.8e-297], N[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4e-139], N[(N[(1.0 + t$95$0), $MachinePrecision] * N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 7e+35], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(h / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(l / D), $MachinePrecision] / 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{-0.5}{\frac{\ell}{h \cdot {\left(\frac{M}{\frac{d}{D \cdot 0.5}}\right)}^{2}}}\\
\mathbf{if}\;\ell \leq -3.8 \cdot 10^{-297}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - t_0\right)\\
\mathbf{elif}\;\ell \leq 4 \cdot 10^{-139}:\\
\;\;\;\;\left(1 + t_0\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq 7 \cdot 10^{+35}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left(M \cdot \frac{D}{d}\right) \cdot \frac{h}{\frac{d}{M}}}{\frac{\frac{\ell}{D}}{0.125}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -3.80000000000000005e-297Initial program 65.2%
metadata-eval65.2%
unpow1/265.2%
metadata-eval65.2%
unpow1/265.2%
*-commutative65.2%
associate-*l*65.2%
times-frac65.2%
metadata-eval65.2%
Simplified65.2%
associate-*r*65.2%
frac-times65.2%
*-commutative65.2%
metadata-eval65.2%
associate-*r/66.8%
metadata-eval66.8%
*-commutative66.8%
frac-times66.8%
div-inv66.8%
metadata-eval66.8%
Applied egg-rr66.8%
pow166.8%
sqrt-prod54.8%
*-commutative54.8%
associate-/l*52.5%
*-commutative52.5%
associate-*l*52.5%
Applied egg-rr52.5%
unpow152.5%
*-commutative52.5%
sub-neg52.5%
associate-/l*52.5%
distribute-neg-frac52.5%
metadata-eval52.5%
associate-/l/54.8%
associate-*r/54.8%
associate-*r/54.8%
associate-/l*54.9%
*-commutative54.9%
Simplified54.9%
Taylor expanded in d around -inf 67.9%
associate-*r*67.9%
mul-1-neg67.9%
associate-/r*68.4%
Simplified68.4%
if -3.80000000000000005e-297 < l < 4.00000000000000012e-139Initial program 85.0%
metadata-eval85.0%
unpow1/285.0%
metadata-eval85.0%
unpow1/285.0%
*-commutative85.0%
associate-*l*85.0%
times-frac85.0%
metadata-eval85.0%
Simplified85.0%
associate-*r*85.0%
frac-times85.0%
*-commutative85.0%
metadata-eval85.0%
associate-*r/91.1%
metadata-eval91.1%
*-commutative91.1%
frac-times91.1%
div-inv91.1%
metadata-eval91.1%
Applied egg-rr91.1%
pow191.1%
sqrt-prod88.5%
*-commutative88.5%
associate-/l*85.3%
*-commutative85.3%
associate-*l*85.3%
Applied egg-rr85.3%
unpow185.3%
*-commutative85.3%
sub-neg85.3%
associate-/l*85.3%
distribute-neg-frac85.3%
metadata-eval85.3%
associate-/l/88.5%
associate-*r/88.5%
associate-*r/88.5%
associate-/l*88.5%
*-commutative88.5%
Simplified88.5%
if 4.00000000000000012e-139 < l < 7.0000000000000001e35Initial program 80.7%
metadata-eval80.7%
unpow1/280.7%
metadata-eval80.7%
unpow1/280.7%
*-commutative80.7%
associate-*l*80.7%
times-frac78.4%
metadata-eval78.4%
Simplified78.4%
Taylor expanded in M around 0 61.1%
*-commutative61.1%
times-frac58.7%
associate-*l*58.7%
unpow258.7%
associate-/l*58.7%
associate-/l*56.3%
unpow256.3%
unpow256.3%
Simplified56.3%
Taylor expanded in D around 0 61.1%
Simplified78.5%
if 7.0000000000000001e35 < l Initial program 45.7%
metadata-eval45.7%
unpow1/245.7%
metadata-eval45.7%
unpow1/245.7%
*-commutative45.7%
associate-*l*45.7%
times-frac43.6%
metadata-eval43.6%
Simplified43.6%
Taylor expanded in d around inf 51.1%
*-un-lft-identity51.1%
*-commutative51.1%
Applied egg-rr51.1%
*-lft-identity51.1%
unpow-151.1%
sqr-pow51.1%
rem-sqrt-square51.1%
sqr-pow50.9%
fabs-sqr50.9%
sqr-pow51.1%
metadata-eval51.1%
Simplified51.1%
unpow-prod-down59.2%
Applied egg-rr59.2%
Final simplification70.9%
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 (/ -0.5 (/ l (* h (pow (/ M (/ d (* D 0.5))) 2.0))))))
(if (<= l -4.7e-297)
(* (* d (pow (* l h) -0.5)) (- -1.0 t_0))
(if (<= l 1.3e-16)
(* (+ 1.0 t_0) (sqrt (* (/ d h) (/ d l))))
(* d (* (pow h -0.5) (pow l -0.5)))))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = -0.5 / (l / (h * pow((M / (d / (D * 0.5))), 2.0)));
double tmp;
if (l <= -4.7e-297) {
tmp = (d * pow((l * h), -0.5)) * (-1.0 - t_0);
} else if (l <= 1.3e-16) {
tmp = (1.0 + t_0) * sqrt(((d / h) * (d / l)));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
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 = (-0.5d0) / (l / (h * ((m / (d / (d_1 * 0.5d0))) ** 2.0d0)))
if (l <= (-4.7d-297)) then
tmp = (d * ((l * h) ** (-0.5d0))) * ((-1.0d0) - t_0)
else if (l <= 1.3d-16) then
tmp = (1.0d0 + t_0) * sqrt(((d / h) * (d / l)))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = -0.5 / (l / (h * Math.pow((M / (d / (D * 0.5))), 2.0)));
double tmp;
if (l <= -4.7e-297) {
tmp = (d * Math.pow((l * h), -0.5)) * (-1.0 - t_0);
} else if (l <= 1.3e-16) {
tmp = (1.0 + t_0) * Math.sqrt(((d / h) * (d / l)));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = -0.5 / (l / (h * math.pow((M / (d / (D * 0.5))), 2.0))) tmp = 0 if l <= -4.7e-297: tmp = (d * math.pow((l * h), -0.5)) * (-1.0 - t_0) elif l <= 1.3e-16: tmp = (1.0 + t_0) * math.sqrt(((d / h) * (d / l))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(-0.5 / Float64(l / Float64(h * (Float64(M / Float64(d / Float64(D * 0.5))) ^ 2.0)))) tmp = 0.0 if (l <= -4.7e-297) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 - t_0)); elseif (l <= 1.3e-16) tmp = Float64(Float64(1.0 + t_0) * sqrt(Float64(Float64(d / h) * Float64(d / l)))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = -0.5 / (l / (h * ((M / (d / (D * 0.5))) ^ 2.0)));
tmp = 0.0;
if (l <= -4.7e-297)
tmp = (d * ((l * h) ^ -0.5)) * (-1.0 - t_0);
elseif (l <= 1.3e-16)
tmp = (1.0 + t_0) * sqrt(((d / h) * (d / l)));
else
tmp = d * ((h ^ -0.5) * (l ^ -0.5));
end
tmp_2 = tmp;
end
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[(-0.5 / N[(l / N[(h * N[Power[N[(M / N[(d / N[(D * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -4.7e-297], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.3e-16], N[(N[(1.0 + t$95$0), $MachinePrecision] * N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{-0.5}{\frac{\ell}{h \cdot {\left(\frac{M}{\frac{d}{D \cdot 0.5}}\right)}^{2}}}\\
\mathbf{if}\;\ell \leq -4.7 \cdot 10^{-297}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 - t_0\right)\\
\mathbf{elif}\;\ell \leq 1.3 \cdot 10^{-16}:\\
\;\;\;\;\left(1 + t_0\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -4.69999999999999986e-297Initial program 65.2%
metadata-eval65.2%
unpow1/265.2%
metadata-eval65.2%
unpow1/265.2%
*-commutative65.2%
associate-*l*65.2%
times-frac65.2%
metadata-eval65.2%
Simplified65.2%
associate-*r*65.2%
frac-times65.2%
*-commutative65.2%
metadata-eval65.2%
associate-*r/66.8%
metadata-eval66.8%
*-commutative66.8%
frac-times66.8%
div-inv66.8%
metadata-eval66.8%
Applied egg-rr66.8%
pow166.8%
sqrt-prod54.8%
*-commutative54.8%
associate-/l*52.5%
*-commutative52.5%
associate-*l*52.5%
Applied egg-rr52.5%
unpow152.5%
*-commutative52.5%
sub-neg52.5%
associate-/l*52.5%
distribute-neg-frac52.5%
metadata-eval52.5%
associate-/l/54.8%
associate-*r/54.8%
associate-*r/54.8%
associate-/l*54.9%
*-commutative54.9%
Simplified54.9%
Taylor expanded in d around -inf 67.9%
associate-*r*67.9%
mul-1-neg67.9%
*-commutative67.9%
unpow-167.9%
sqr-pow67.9%
rem-sqrt-square68.3%
sqr-pow68.2%
fabs-sqr68.2%
sqr-pow68.3%
metadata-eval68.3%
Simplified68.3%
if -4.69999999999999986e-297 < l < 1.2999999999999999e-16Initial program 83.0%
metadata-eval83.0%
unpow1/283.0%
metadata-eval83.0%
unpow1/283.0%
*-commutative83.0%
associate-*l*83.0%
times-frac83.0%
metadata-eval83.0%
Simplified83.0%
associate-*r*83.0%
frac-times83.0%
*-commutative83.0%
metadata-eval83.0%
associate-*r/89.2%
metadata-eval89.2%
*-commutative89.2%
frac-times89.2%
div-inv89.2%
metadata-eval89.2%
Applied egg-rr89.2%
pow189.2%
sqrt-prod75.7%
*-commutative75.7%
associate-/l*71.6%
*-commutative71.6%
associate-*l*71.6%
Applied egg-rr71.6%
unpow171.6%
*-commutative71.6%
sub-neg71.6%
associate-/l*71.6%
distribute-neg-frac71.6%
metadata-eval71.6%
associate-/l/75.7%
associate-*r/75.7%
associate-*r/75.7%
associate-/l*75.7%
*-commutative75.7%
Simplified75.7%
if 1.2999999999999999e-16 < l Initial program 51.7%
metadata-eval51.7%
unpow1/251.7%
metadata-eval51.7%
unpow1/251.7%
*-commutative51.7%
associate-*l*51.7%
times-frac48.4%
metadata-eval48.4%
Simplified48.4%
Taylor expanded in d around inf 51.0%
*-un-lft-identity51.0%
*-commutative51.0%
Applied egg-rr51.0%
*-lft-identity51.0%
unpow-151.0%
sqr-pow51.0%
rem-sqrt-square51.0%
sqr-pow50.8%
fabs-sqr50.8%
sqr-pow51.0%
metadata-eval51.0%
Simplified51.0%
unpow-prod-down57.7%
Applied egg-rr57.7%
Final simplification67.8%
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 (/ -0.5 (/ l (* h (pow (/ M (/ d (* D 0.5))) 2.0))))))
(if (<= l -1.6e-298)
(* (* d (sqrt (/ (/ 1.0 l) h))) (- -1.0 t_0))
(if (<= l 1.1e-20)
(* (+ 1.0 t_0) (sqrt (* (/ d h) (/ d l))))
(* d (* (pow h -0.5) (pow l -0.5)))))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = -0.5 / (l / (h * pow((M / (d / (D * 0.5))), 2.0)));
double tmp;
if (l <= -1.6e-298) {
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - t_0);
} else if (l <= 1.1e-20) {
tmp = (1.0 + t_0) * sqrt(((d / h) * (d / l)));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
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 = (-0.5d0) / (l / (h * ((m / (d / (d_1 * 0.5d0))) ** 2.0d0)))
if (l <= (-1.6d-298)) then
tmp = (d * sqrt(((1.0d0 / l) / h))) * ((-1.0d0) - t_0)
else if (l <= 1.1d-20) then
tmp = (1.0d0 + t_0) * sqrt(((d / h) * (d / l)))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = -0.5 / (l / (h * Math.pow((M / (d / (D * 0.5))), 2.0)));
double tmp;
if (l <= -1.6e-298) {
tmp = (d * Math.sqrt(((1.0 / l) / h))) * (-1.0 - t_0);
} else if (l <= 1.1e-20) {
tmp = (1.0 + t_0) * Math.sqrt(((d / h) * (d / l)));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = -0.5 / (l / (h * math.pow((M / (d / (D * 0.5))), 2.0))) tmp = 0 if l <= -1.6e-298: tmp = (d * math.sqrt(((1.0 / l) / h))) * (-1.0 - t_0) elif l <= 1.1e-20: tmp = (1.0 + t_0) * math.sqrt(((d / h) * (d / l))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(-0.5 / Float64(l / Float64(h * (Float64(M / Float64(d / Float64(D * 0.5))) ^ 2.0)))) tmp = 0.0 if (l <= -1.6e-298) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - t_0)); elseif (l <= 1.1e-20) tmp = Float64(Float64(1.0 + t_0) * sqrt(Float64(Float64(d / h) * Float64(d / l)))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = -0.5 / (l / (h * ((M / (d / (D * 0.5))) ^ 2.0)));
tmp = 0.0;
if (l <= -1.6e-298)
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - t_0);
elseif (l <= 1.1e-20)
tmp = (1.0 + t_0) * sqrt(((d / h) * (d / l)));
else
tmp = d * ((h ^ -0.5) * (l ^ -0.5));
end
tmp_2 = tmp;
end
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[(-0.5 / N[(l / N[(h * N[Power[N[(M / N[(d / N[(D * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.6e-298], N[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.1e-20], N[(N[(1.0 + t$95$0), $MachinePrecision] * N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{-0.5}{\frac{\ell}{h \cdot {\left(\frac{M}{\frac{d}{D \cdot 0.5}}\right)}^{2}}}\\
\mathbf{if}\;\ell \leq -1.6 \cdot 10^{-298}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - t_0\right)\\
\mathbf{elif}\;\ell \leq 1.1 \cdot 10^{-20}:\\
\;\;\;\;\left(1 + t_0\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1.59999999999999999e-298Initial program 65.2%
metadata-eval65.2%
unpow1/265.2%
metadata-eval65.2%
unpow1/265.2%
*-commutative65.2%
associate-*l*65.2%
times-frac65.2%
metadata-eval65.2%
Simplified65.2%
associate-*r*65.2%
frac-times65.2%
*-commutative65.2%
metadata-eval65.2%
associate-*r/66.8%
metadata-eval66.8%
*-commutative66.8%
frac-times66.8%
div-inv66.8%
metadata-eval66.8%
Applied egg-rr66.8%
pow166.8%
sqrt-prod54.8%
*-commutative54.8%
associate-/l*52.5%
*-commutative52.5%
associate-*l*52.5%
Applied egg-rr52.5%
unpow152.5%
*-commutative52.5%
sub-neg52.5%
associate-/l*52.5%
distribute-neg-frac52.5%
metadata-eval52.5%
associate-/l/54.8%
associate-*r/54.8%
associate-*r/54.8%
associate-/l*54.9%
*-commutative54.9%
Simplified54.9%
Taylor expanded in d around -inf 67.9%
associate-*r*67.9%
mul-1-neg67.9%
associate-/r*68.4%
Simplified68.4%
if -1.59999999999999999e-298 < l < 1.09999999999999995e-20Initial program 83.0%
metadata-eval83.0%
unpow1/283.0%
metadata-eval83.0%
unpow1/283.0%
*-commutative83.0%
associate-*l*83.0%
times-frac83.0%
metadata-eval83.0%
Simplified83.0%
associate-*r*83.0%
frac-times83.0%
*-commutative83.0%
metadata-eval83.0%
associate-*r/89.2%
metadata-eval89.2%
*-commutative89.2%
frac-times89.2%
div-inv89.2%
metadata-eval89.2%
Applied egg-rr89.2%
pow189.2%
sqrt-prod75.7%
*-commutative75.7%
associate-/l*71.6%
*-commutative71.6%
associate-*l*71.6%
Applied egg-rr71.6%
unpow171.6%
*-commutative71.6%
sub-neg71.6%
associate-/l*71.6%
distribute-neg-frac71.6%
metadata-eval71.6%
associate-/l/75.7%
associate-*r/75.7%
associate-*r/75.7%
associate-/l*75.7%
*-commutative75.7%
Simplified75.7%
if 1.09999999999999995e-20 < l Initial program 51.7%
metadata-eval51.7%
unpow1/251.7%
metadata-eval51.7%
unpow1/251.7%
*-commutative51.7%
associate-*l*51.7%
times-frac48.4%
metadata-eval48.4%
Simplified48.4%
Taylor expanded in d around inf 51.0%
*-un-lft-identity51.0%
*-commutative51.0%
Applied egg-rr51.0%
*-lft-identity51.0%
unpow-151.0%
sqr-pow51.0%
rem-sqrt-square51.0%
sqr-pow50.8%
fabs-sqr50.8%
sqr-pow51.0%
metadata-eval51.0%
Simplified51.0%
unpow-prod-down57.7%
Applied egg-rr57.7%
Final simplification67.8%
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-27)
(*
(+ 1.0 (/ -0.5 (/ l (* h (pow (/ M (/ d (* D 0.5))) 2.0)))))
(sqrt (* (/ d h) (/ d l))))
(* d (* (pow h -0.5) (pow l -0.5)))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 1.7e-27) {
tmp = (1.0 + (-0.5 / (l / (h * pow((M / (d / (D * 0.5))), 2.0))))) * sqrt(((d / h) * (d / l)));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
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-27) then
tmp = (1.0d0 + ((-0.5d0) / (l / (h * ((m / (d / (d_1 * 0.5d0))) ** 2.0d0))))) * sqrt(((d / h) * (d / l)))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 1.7e-27) {
tmp = (1.0 + (-0.5 / (l / (h * Math.pow((M / (d / (D * 0.5))), 2.0))))) * Math.sqrt(((d / h) * (d / l)));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if l <= 1.7e-27: tmp = (1.0 + (-0.5 / (l / (h * math.pow((M / (d / (D * 0.5))), 2.0))))) * math.sqrt(((d / h) * (d / l))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= 1.7e-27) tmp = Float64(Float64(1.0 + Float64(-0.5 / Float64(l / Float64(h * (Float64(M / Float64(d / Float64(D * 0.5))) ^ 2.0))))) * sqrt(Float64(Float64(d / h) * Float64(d / l)))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= 1.7e-27)
tmp = (1.0 + (-0.5 / (l / (h * ((M / (d / (D * 0.5))) ^ 2.0))))) * sqrt(((d / h) * (d / l)));
else
tmp = d * ((h ^ -0.5) * (l ^ -0.5));
end
tmp_2 = tmp;
end
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-27], N[(N[(1.0 + N[(-0.5 / N[(l / N[(h * N[Power[N[(M / N[(d / N[(D * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.7 \cdot 10^{-27}:\\
\;\;\;\;\left(1 + \frac{-0.5}{\frac{\ell}{h \cdot {\left(\frac{M}{\frac{d}{D \cdot 0.5}}\right)}^{2}}}\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < 1.69999999999999985e-27Initial program 70.9%
metadata-eval70.9%
unpow1/270.9%
metadata-eval70.9%
unpow1/270.9%
*-commutative70.9%
associate-*l*70.9%
times-frac70.9%
metadata-eval70.9%
Simplified70.9%
associate-*r*70.9%
frac-times70.9%
*-commutative70.9%
metadata-eval70.9%
associate-*r/74.0%
metadata-eval74.0%
*-commutative74.0%
frac-times74.0%
div-inv74.0%
metadata-eval74.0%
Applied egg-rr74.0%
pow174.0%
sqrt-prod61.5%
*-commutative61.5%
associate-/l*58.7%
*-commutative58.7%
associate-*l*58.7%
Applied egg-rr58.7%
unpow158.7%
*-commutative58.7%
sub-neg58.7%
associate-/l*58.7%
distribute-neg-frac58.7%
metadata-eval58.7%
associate-/l/61.5%
associate-*r/61.5%
associate-*r/61.5%
associate-/l*61.6%
*-commutative61.6%
Simplified61.6%
if 1.69999999999999985e-27 < l Initial program 51.7%
metadata-eval51.7%
unpow1/251.7%
metadata-eval51.7%
unpow1/251.7%
*-commutative51.7%
associate-*l*51.7%
times-frac48.4%
metadata-eval48.4%
Simplified48.4%
Taylor expanded in d around inf 51.0%
*-un-lft-identity51.0%
*-commutative51.0%
Applied egg-rr51.0%
*-lft-identity51.0%
unpow-151.0%
sqr-pow51.0%
rem-sqrt-square51.0%
sqr-pow50.8%
fabs-sqr50.8%
sqr-pow51.0%
metadata-eval51.0%
Simplified51.0%
unpow-prod-down57.7%
Applied egg-rr57.7%
Final simplification60.7%
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) (/ d l)))))
(if (<= d -1.85e+203)
(* d (- (sqrt (/ 1.0 (* l h)))))
(if (<= d -1.5e-291)
(*
t_0
(+ 1.0 (/ -0.5 (* (* 4.0 (* (/ d D) (/ d D))) (/ l (* M (* h M)))))))
(if (<= d 3.15e-198)
(* -0.125 (* (* D (/ D d)) (* (sqrt (/ h (pow l 3.0))) (* M M))))
(if (<= d 7e+68)
(*
t_0
(+
1.0
(/ -0.5 (* 4.0 (/ (* d d) (/ (* h (* (* M D) (* M D))) l))))))
(* d (/ (sqrt (/ 1.0 l)) (sqrt h)))))))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(((d / h) * (d / l)));
double tmp;
if (d <= -1.85e+203) {
tmp = d * -sqrt((1.0 / (l * h)));
} else if (d <= -1.5e-291) {
tmp = t_0 * (1.0 + (-0.5 / ((4.0 * ((d / D) * (d / D))) * (l / (M * (h * M))))));
} else if (d <= 3.15e-198) {
tmp = -0.125 * ((D * (D / d)) * (sqrt((h / pow(l, 3.0))) * (M * M)));
} else if (d <= 7e+68) {
tmp = t_0 * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l)))));
} else {
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
}
return tmp;
}
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) * (d / l)))
if (d <= (-1.85d+203)) then
tmp = d * -sqrt((1.0d0 / (l * h)))
else if (d <= (-1.5d-291)) then
tmp = t_0 * (1.0d0 + ((-0.5d0) / ((4.0d0 * ((d / d_1) * (d / d_1))) * (l / (m * (h * m))))))
else if (d <= 3.15d-198) then
tmp = (-0.125d0) * ((d_1 * (d_1 / d)) * (sqrt((h / (l ** 3.0d0))) * (m * m)))
else if (d <= 7d+68) then
tmp = t_0 * (1.0d0 + ((-0.5d0) / (4.0d0 * ((d * d) / ((h * ((m * d_1) * (m * d_1))) / l)))))
else
tmp = d * (sqrt((1.0d0 / l)) / sqrt(h))
end if
code = tmp
end function
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(((d / h) * (d / l)));
double tmp;
if (d <= -1.85e+203) {
tmp = d * -Math.sqrt((1.0 / (l * h)));
} else if (d <= -1.5e-291) {
tmp = t_0 * (1.0 + (-0.5 / ((4.0 * ((d / D) * (d / D))) * (l / (M * (h * M))))));
} else if (d <= 3.15e-198) {
tmp = -0.125 * ((D * (D / d)) * (Math.sqrt((h / Math.pow(l, 3.0))) * (M * M)));
} else if (d <= 7e+68) {
tmp = t_0 * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l)))));
} else {
tmp = d * (Math.sqrt((1.0 / l)) / Math.sqrt(h));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt(((d / h) * (d / l))) tmp = 0 if d <= -1.85e+203: tmp = d * -math.sqrt((1.0 / (l * h))) elif d <= -1.5e-291: tmp = t_0 * (1.0 + (-0.5 / ((4.0 * ((d / D) * (d / D))) * (l / (M * (h * M)))))) elif d <= 3.15e-198: tmp = -0.125 * ((D * (D / d)) * (math.sqrt((h / math.pow(l, 3.0))) * (M * M))) elif d <= 7e+68: tmp = t_0 * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l))))) else: tmp = d * (math.sqrt((1.0 / l)) / math.sqrt(h)) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(Float64(d / h) * Float64(d / l))) tmp = 0.0 if (d <= -1.85e+203) tmp = Float64(d * Float64(-sqrt(Float64(1.0 / Float64(l * h))))); elseif (d <= -1.5e-291) tmp = Float64(t_0 * Float64(1.0 + Float64(-0.5 / Float64(Float64(4.0 * Float64(Float64(d / D) * Float64(d / D))) * Float64(l / Float64(M * Float64(h * M))))))); elseif (d <= 3.15e-198) tmp = Float64(-0.125 * Float64(Float64(D * Float64(D / d)) * Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(M * M)))); elseif (d <= 7e+68) tmp = Float64(t_0 * Float64(1.0 + Float64(-0.5 / Float64(4.0 * Float64(Float64(d * d) / Float64(Float64(h * Float64(Float64(M * D) * Float64(M * D))) / l)))))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / l)) / sqrt(h))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt(((d / h) * (d / l)));
tmp = 0.0;
if (d <= -1.85e+203)
tmp = d * -sqrt((1.0 / (l * h)));
elseif (d <= -1.5e-291)
tmp = t_0 * (1.0 + (-0.5 / ((4.0 * ((d / D) * (d / D))) * (l / (M * (h * M))))));
elseif (d <= 3.15e-198)
tmp = -0.125 * ((D * (D / d)) * (sqrt((h / (l ^ 3.0))) * (M * M)));
elseif (d <= 7e+68)
tmp = t_0 * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l)))));
else
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
end
tmp_2 = tmp;
end
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[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1.85e+203], N[(d * (-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -1.5e-291], N[(t$95$0 * N[(1.0 + N[(-0.5 / N[(N[(4.0 * N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.15e-198], N[(-0.125 * N[(N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7e+68], N[(t$95$0 * N[(1.0 + N[(-0.5 / N[(4.0 * N[(N[(d * d), $MachinePrecision] / N[(N[(h * N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{if}\;d \leq -1.85 \cdot 10^{+203}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{elif}\;d \leq -1.5 \cdot 10^{-291}:\\
\;\;\;\;t_0 \cdot \left(1 + \frac{-0.5}{\left(4 \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\right) \cdot \frac{\ell}{M \cdot \left(h \cdot M\right)}}\right)\\
\mathbf{elif}\;d \leq 3.15 \cdot 10^{-198}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \frac{D}{d}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(M \cdot M\right)\right)\right)\\
\mathbf{elif}\;d \leq 7 \cdot 10^{+68}:\\
\;\;\;\;t_0 \cdot \left(1 + \frac{-0.5}{4 \cdot \frac{d \cdot d}{\frac{h \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right)}{\ell}}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -1.85e203Initial program 59.4%
metadata-eval59.4%
unpow1/259.4%
metadata-eval59.4%
unpow1/259.4%
*-commutative59.4%
associate-*l*59.4%
times-frac59.6%
metadata-eval59.6%
Simplified59.6%
associate-*r*59.6%
frac-times59.4%
*-commutative59.4%
metadata-eval59.4%
associate-*r/66.8%
metadata-eval66.8%
*-commutative66.8%
frac-times66.9%
div-inv66.9%
metadata-eval66.9%
Applied egg-rr66.9%
pow166.9%
sqrt-prod60.5%
*-commutative60.5%
associate-/l*53.1%
*-commutative53.1%
associate-*l*53.1%
Applied egg-rr53.1%
unpow153.1%
*-commutative53.1%
sub-neg53.1%
associate-/l*53.1%
distribute-neg-frac53.1%
metadata-eval53.1%
associate-/l/60.5%
associate-*r/60.5%
associate-*r/60.4%
associate-/l*60.6%
*-commutative60.6%
Simplified60.6%
Taylor expanded in d around -inf 64.2%
mul-1-neg64.2%
*-commutative64.2%
distribute-rgt-neg-in64.2%
*-commutative64.2%
Simplified64.2%
if -1.85e203 < d < -1.5e-291Initial program 69.5%
metadata-eval69.5%
unpow1/269.5%
metadata-eval69.5%
unpow1/269.5%
*-commutative69.5%
associate-*l*69.5%
times-frac69.5%
metadata-eval69.5%
Simplified69.5%
associate-*r*69.5%
frac-times69.5%
*-commutative69.5%
metadata-eval69.5%
associate-*r/69.6%
metadata-eval69.6%
*-commutative69.6%
frac-times69.6%
div-inv69.6%
metadata-eval69.6%
Applied egg-rr69.6%
pow169.6%
sqrt-prod57.1%
*-commutative57.1%
associate-/l*56.1%
*-commutative56.1%
associate-*l*56.1%
Applied egg-rr56.1%
unpow156.1%
*-commutative56.1%
sub-neg56.1%
associate-/l*56.1%
distribute-neg-frac56.1%
metadata-eval56.1%
associate-/l/57.1%
associate-*r/57.1%
associate-*r/57.1%
associate-/l*57.1%
*-commutative57.1%
Simplified57.1%
Taylor expanded in l around 0 43.8%
times-frac40.9%
unpow240.9%
*-commutative40.9%
unpow240.9%
associate-*r*40.9%
unpow240.9%
unpow240.9%
times-frac48.4%
unpow248.4%
*-commutative48.4%
associate-*r*50.4%
Simplified50.4%
if -1.5e-291 < d < 3.15000000000000008e-198Initial program 46.3%
metadata-eval46.3%
unpow1/246.3%
metadata-eval46.3%
unpow1/246.3%
*-commutative46.3%
associate-*l*46.3%
times-frac39.6%
metadata-eval39.6%
Simplified39.6%
associate-*r*39.6%
frac-times46.3%
*-commutative46.3%
metadata-eval46.3%
associate-*r/46.3%
metadata-eval46.3%
*-commutative46.3%
frac-times39.6%
div-inv39.6%
metadata-eval39.6%
Applied egg-rr39.6%
pow139.6%
sqrt-prod22.2%
*-commutative22.2%
associate-/l*22.2%
*-commutative22.2%
associate-*l*22.2%
Applied egg-rr22.2%
unpow122.2%
*-commutative22.2%
sub-neg22.2%
associate-/l*22.2%
distribute-neg-frac22.2%
metadata-eval22.2%
associate-/l/22.2%
associate-*r/22.2%
associate-*r/25.7%
associate-/l*22.2%
*-commutative22.2%
Simplified22.2%
Taylor expanded in d around 0 42.6%
*-commutative42.6%
unpow242.6%
unpow242.6%
unpow242.6%
associate-*l/35.7%
unpow235.7%
*-commutative35.7%
associate-*r*35.8%
associate-/l*39.3%
associate-/r/39.3%
Simplified39.3%
if 3.15000000000000008e-198 < d < 6.99999999999999955e68Initial program 72.5%
metadata-eval72.5%
unpow1/272.5%
metadata-eval72.5%
unpow1/272.5%
*-commutative72.5%
associate-*l*72.5%
times-frac72.5%
metadata-eval72.5%
Simplified72.5%
associate-*r*72.5%
frac-times72.5%
*-commutative72.5%
metadata-eval72.5%
associate-*r/76.1%
metadata-eval76.1%
*-commutative76.1%
frac-times76.2%
div-inv76.2%
metadata-eval76.2%
Applied egg-rr76.2%
pow176.2%
sqrt-prod60.3%
*-commutative60.3%
associate-/l*57.4%
*-commutative57.4%
associate-*l*57.4%
Applied egg-rr57.4%
unpow157.4%
*-commutative57.4%
sub-neg57.4%
associate-/l*57.4%
distribute-neg-frac57.4%
metadata-eval57.4%
associate-/l/60.3%
associate-*r/60.3%
associate-*r/60.3%
associate-/l*60.3%
*-commutative60.3%
Simplified60.3%
Taylor expanded in l around 0 45.0%
associate-/l*48.9%
unpow248.9%
*-commutative48.9%
unpow248.9%
unpow248.9%
unpow248.9%
associate-*r*50.8%
unpow250.8%
unswap-sqr62.4%
Simplified62.4%
if 6.99999999999999955e68 < d Initial program 71.1%
metadata-eval71.1%
unpow1/271.1%
metadata-eval71.1%
unpow1/271.1%
*-commutative71.1%
associate-*l*71.1%
times-frac71.2%
metadata-eval71.2%
Simplified71.2%
Taylor expanded in d around inf 69.4%
*-un-lft-identity69.4%
*-commutative69.4%
Applied egg-rr69.4%
*-lft-identity69.4%
*-commutative69.4%
associate-/r*71.0%
Simplified71.0%
sqrt-div76.5%
Applied egg-rr76.5%
Final simplification57.2%
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) (/ d l)))))
(if (<= d -2.05e+203)
(* d (- (sqrt (/ 1.0 (* l h)))))
(if (<= d -4e-297)
(*
t_0
(+ 1.0 (/ -0.5 (* (* 4.0 (* (/ d D) (/ d D))) (/ l (* M (* h M)))))))
(if (<= d 3.15e-198)
(* -0.125 (* (* (* M M) (/ (sqrt h) (pow l 1.5))) (* D (/ D d))))
(if (<= d 7e+68)
(*
t_0
(+
1.0
(/ -0.5 (* 4.0 (/ (* d d) (/ (* h (* (* M D) (* M D))) l))))))
(* d (/ (sqrt (/ 1.0 l)) (sqrt h)))))))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(((d / h) * (d / l)));
double tmp;
if (d <= -2.05e+203) {
tmp = d * -sqrt((1.0 / (l * h)));
} else if (d <= -4e-297) {
tmp = t_0 * (1.0 + (-0.5 / ((4.0 * ((d / D) * (d / D))) * (l / (M * (h * M))))));
} else if (d <= 3.15e-198) {
tmp = -0.125 * (((M * M) * (sqrt(h) / pow(l, 1.5))) * (D * (D / d)));
} else if (d <= 7e+68) {
tmp = t_0 * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l)))));
} else {
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
}
return tmp;
}
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) * (d / l)))
if (d <= (-2.05d+203)) then
tmp = d * -sqrt((1.0d0 / (l * h)))
else if (d <= (-4d-297)) then
tmp = t_0 * (1.0d0 + ((-0.5d0) / ((4.0d0 * ((d / d_1) * (d / d_1))) * (l / (m * (h * m))))))
else if (d <= 3.15d-198) then
tmp = (-0.125d0) * (((m * m) * (sqrt(h) / (l ** 1.5d0))) * (d_1 * (d_1 / d)))
else if (d <= 7d+68) then
tmp = t_0 * (1.0d0 + ((-0.5d0) / (4.0d0 * ((d * d) / ((h * ((m * d_1) * (m * d_1))) / l)))))
else
tmp = d * (sqrt((1.0d0 / l)) / sqrt(h))
end if
code = tmp
end function
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(((d / h) * (d / l)));
double tmp;
if (d <= -2.05e+203) {
tmp = d * -Math.sqrt((1.0 / (l * h)));
} else if (d <= -4e-297) {
tmp = t_0 * (1.0 + (-0.5 / ((4.0 * ((d / D) * (d / D))) * (l / (M * (h * M))))));
} else if (d <= 3.15e-198) {
tmp = -0.125 * (((M * M) * (Math.sqrt(h) / Math.pow(l, 1.5))) * (D * (D / d)));
} else if (d <= 7e+68) {
tmp = t_0 * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l)))));
} else {
tmp = d * (Math.sqrt((1.0 / l)) / Math.sqrt(h));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.sqrt(((d / h) * (d / l))) tmp = 0 if d <= -2.05e+203: tmp = d * -math.sqrt((1.0 / (l * h))) elif d <= -4e-297: tmp = t_0 * (1.0 + (-0.5 / ((4.0 * ((d / D) * (d / D))) * (l / (M * (h * M)))))) elif d <= 3.15e-198: tmp = -0.125 * (((M * M) * (math.sqrt(h) / math.pow(l, 1.5))) * (D * (D / d))) elif d <= 7e+68: tmp = t_0 * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l))))) else: tmp = d * (math.sqrt((1.0 / l)) / math.sqrt(h)) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(Float64(d / h) * Float64(d / l))) tmp = 0.0 if (d <= -2.05e+203) tmp = Float64(d * Float64(-sqrt(Float64(1.0 / Float64(l * h))))); elseif (d <= -4e-297) tmp = Float64(t_0 * Float64(1.0 + Float64(-0.5 / Float64(Float64(4.0 * Float64(Float64(d / D) * Float64(d / D))) * Float64(l / Float64(M * Float64(h * M))))))); elseif (d <= 3.15e-198) tmp = Float64(-0.125 * Float64(Float64(Float64(M * M) * Float64(sqrt(h) / (l ^ 1.5))) * Float64(D * Float64(D / d)))); elseif (d <= 7e+68) tmp = Float64(t_0 * Float64(1.0 + Float64(-0.5 / Float64(4.0 * Float64(Float64(d * d) / Float64(Float64(h * Float64(Float64(M * D) * Float64(M * D))) / l)))))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / l)) / sqrt(h))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt(((d / h) * (d / l)));
tmp = 0.0;
if (d <= -2.05e+203)
tmp = d * -sqrt((1.0 / (l * h)));
elseif (d <= -4e-297)
tmp = t_0 * (1.0 + (-0.5 / ((4.0 * ((d / D) * (d / D))) * (l / (M * (h * M))))));
elseif (d <= 3.15e-198)
tmp = -0.125 * (((M * M) * (sqrt(h) / (l ^ 1.5))) * (D * (D / d)));
elseif (d <= 7e+68)
tmp = t_0 * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l)))));
else
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
end
tmp_2 = tmp;
end
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[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -2.05e+203], N[(d * (-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -4e-297], N[(t$95$0 * N[(1.0 + N[(-0.5 / N[(N[(4.0 * N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.15e-198], N[(-0.125 * N[(N[(N[(M * M), $MachinePrecision] * N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7e+68], N[(t$95$0 * N[(1.0 + N[(-0.5 / N[(4.0 * N[(N[(d * d), $MachinePrecision] / N[(N[(h * N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{if}\;d \leq -2.05 \cdot 10^{+203}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{elif}\;d \leq -4 \cdot 10^{-297}:\\
\;\;\;\;t_0 \cdot \left(1 + \frac{-0.5}{\left(4 \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\right) \cdot \frac{\ell}{M \cdot \left(h \cdot M\right)}}\right)\\
\mathbf{elif}\;d \leq 3.15 \cdot 10^{-198}:\\
\;\;\;\;-0.125 \cdot \left(\left(\left(M \cdot M\right) \cdot \frac{\sqrt{h}}{{\ell}^{1.5}}\right) \cdot \left(D \cdot \frac{D}{d}\right)\right)\\
\mathbf{elif}\;d \leq 7 \cdot 10^{+68}:\\
\;\;\;\;t_0 \cdot \left(1 + \frac{-0.5}{4 \cdot \frac{d \cdot d}{\frac{h \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right)}{\ell}}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -2.05000000000000008e203Initial program 59.4%
metadata-eval59.4%
unpow1/259.4%
metadata-eval59.4%
unpow1/259.4%
*-commutative59.4%
associate-*l*59.4%
times-frac59.6%
metadata-eval59.6%
Simplified59.6%
associate-*r*59.6%
frac-times59.4%
*-commutative59.4%
metadata-eval59.4%
associate-*r/66.8%
metadata-eval66.8%
*-commutative66.8%
frac-times66.9%
div-inv66.9%
metadata-eval66.9%
Applied egg-rr66.9%
pow166.9%
sqrt-prod60.5%
*-commutative60.5%
associate-/l*53.1%
*-commutative53.1%
associate-*l*53.1%
Applied egg-rr53.1%
unpow153.1%
*-commutative53.1%
sub-neg53.1%
associate-/l*53.1%
distribute-neg-frac53.1%
metadata-eval53.1%
associate-/l/60.5%
associate-*r/60.5%
associate-*r/60.4%
associate-/l*60.6%
*-commutative60.6%
Simplified60.6%
Taylor expanded in d around -inf 64.2%
mul-1-neg64.2%
*-commutative64.2%
distribute-rgt-neg-in64.2%
*-commutative64.2%
Simplified64.2%
if -2.05000000000000008e203 < d < -4.00000000000000016e-297Initial program 69.2%
metadata-eval69.2%
unpow1/269.2%
metadata-eval69.2%
unpow1/269.2%
*-commutative69.2%
associate-*l*69.2%
times-frac69.1%
metadata-eval69.1%
Simplified69.1%
associate-*r*69.1%
frac-times69.2%
*-commutative69.2%
metadata-eval69.2%
associate-*r/69.3%
metadata-eval69.3%
*-commutative69.3%
frac-times69.2%
div-inv69.2%
metadata-eval69.2%
Applied egg-rr69.2%
pow169.2%
sqrt-prod57.0%
*-commutative57.0%
associate-/l*56.0%
*-commutative56.0%
associate-*l*56.0%
Applied egg-rr56.0%
unpow156.0%
*-commutative56.0%
sub-neg56.0%
associate-/l*56.0%
distribute-neg-frac56.0%
metadata-eval56.0%
associate-/l/57.0%
associate-*r/57.0%
associate-*r/57.0%
associate-/l*57.0%
*-commutative57.0%
Simplified57.0%
Taylor expanded in l around 0 43.0%
times-frac40.1%
unpow240.1%
*-commutative40.1%
unpow240.1%
associate-*r*40.1%
unpow240.1%
unpow240.1%
times-frac48.5%
unpow248.5%
*-commutative48.5%
associate-*r*50.4%
Simplified50.4%
if -4.00000000000000016e-297 < d < 3.15000000000000008e-198Initial program 46.1%
metadata-eval46.1%
unpow1/246.1%
metadata-eval46.1%
unpow1/246.1%
*-commutative46.1%
associate-*l*46.1%
times-frac38.9%
metadata-eval38.9%
Simplified38.9%
associate-*r*38.9%
frac-times46.1%
*-commutative46.1%
metadata-eval46.1%
associate-*r/46.1%
metadata-eval46.1%
*-commutative46.1%
frac-times38.9%
div-inv38.9%
metadata-eval38.9%
Applied egg-rr38.9%
pow138.9%
sqrt-prod20.1%
*-commutative20.1%
associate-/l*20.1%
*-commutative20.1%
associate-*l*20.1%
Applied egg-rr20.1%
unpow120.1%
*-commutative20.1%
sub-neg20.1%
associate-/l*20.1%
distribute-neg-frac20.1%
metadata-eval20.1%
associate-/l/20.1%
associate-*r/20.1%
associate-*r/23.9%
associate-/l*20.1%
*-commutative20.1%
Simplified20.1%
Taylor expanded in d around 0 42.0%
*-commutative42.0%
unpow242.0%
unpow242.0%
unpow242.0%
associate-*l/34.6%
unpow234.6%
*-commutative34.6%
associate-*r*34.7%
associate-/l*38.4%
associate-/r/38.4%
Simplified38.4%
sqrt-div41.7%
Applied egg-rr41.7%
sqr-pow41.7%
rem-sqrt-square48.4%
sqr-pow48.4%
fabs-sqr48.4%
sqr-pow48.4%
metadata-eval48.4%
Simplified48.4%
if 3.15000000000000008e-198 < d < 6.99999999999999955e68Initial program 72.5%
metadata-eval72.5%
unpow1/272.5%
metadata-eval72.5%
unpow1/272.5%
*-commutative72.5%
associate-*l*72.5%
times-frac72.5%
metadata-eval72.5%
Simplified72.5%
associate-*r*72.5%
frac-times72.5%
*-commutative72.5%
metadata-eval72.5%
associate-*r/76.1%
metadata-eval76.1%
*-commutative76.1%
frac-times76.2%
div-inv76.2%
metadata-eval76.2%
Applied egg-rr76.2%
pow176.2%
sqrt-prod60.3%
*-commutative60.3%
associate-/l*57.4%
*-commutative57.4%
associate-*l*57.4%
Applied egg-rr57.4%
unpow157.4%
*-commutative57.4%
sub-neg57.4%
associate-/l*57.4%
distribute-neg-frac57.4%
metadata-eval57.4%
associate-/l/60.3%
associate-*r/60.3%
associate-*r/60.3%
associate-/l*60.3%
*-commutative60.3%
Simplified60.3%
Taylor expanded in l around 0 45.0%
associate-/l*48.9%
unpow248.9%
*-commutative48.9%
unpow248.9%
unpow248.9%
unpow248.9%
associate-*r*50.8%
unpow250.8%
unswap-sqr62.4%
Simplified62.4%
if 6.99999999999999955e68 < d Initial program 71.1%
metadata-eval71.1%
unpow1/271.1%
metadata-eval71.1%
unpow1/271.1%
*-commutative71.1%
associate-*l*71.1%
times-frac71.2%
metadata-eval71.2%
Simplified71.2%
Taylor expanded in d around inf 69.4%
*-un-lft-identity69.4%
*-commutative69.4%
Applied egg-rr69.4%
*-lft-identity69.4%
*-commutative69.4%
associate-/r*71.0%
Simplified71.0%
sqrt-div76.5%
Applied egg-rr76.5%
Final simplification58.2%
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= d -9.5e+184)
(* d (- (sqrt (/ 1.0 (* l h)))))
(if (<= d 4.4e+67)
(*
(sqrt (* (/ d h) (/ d l)))
(+ 1.0 (/ -0.5 (* 4.0 (/ (* d d) (/ (* h (* (* M D) (* M D))) l))))))
(* d (* (pow h -0.5) (pow l -0.5))))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -9.5e+184) {
tmp = d * -sqrt((1.0 / (l * h)));
} else if (d <= 4.4e+67) {
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l)))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
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 <= (-9.5d+184)) then
tmp = d * -sqrt((1.0d0 / (l * h)))
else if (d <= 4.4d+67) then
tmp = sqrt(((d / h) * (d / l))) * (1.0d0 + ((-0.5d0) / (4.0d0 * ((d * d) / ((h * ((m * d_1) * (m * d_1))) / l)))))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -9.5e+184) {
tmp = d * -Math.sqrt((1.0 / (l * h)));
} else if (d <= 4.4e+67) {
tmp = Math.sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l)))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if d <= -9.5e+184: tmp = d * -math.sqrt((1.0 / (l * h))) elif d <= 4.4e+67: tmp = math.sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l))))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (d <= -9.5e+184) tmp = Float64(d * Float64(-sqrt(Float64(1.0 / Float64(l * h))))); elseif (d <= 4.4e+67) tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 + Float64(-0.5 / Float64(4.0 * Float64(Float64(d * d) / Float64(Float64(h * Float64(Float64(M * D) * Float64(M * D))) / l)))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (d <= -9.5e+184)
tmp = d * -sqrt((1.0 / (l * h)));
elseif (d <= 4.4e+67)
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l)))));
else
tmp = d * ((h ^ -0.5) * (l ^ -0.5));
end
tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[d, -9.5e+184], N[(d * (-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, 4.4e+67], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 / N[(4.0 * N[(N[(d * d), $MachinePrecision] / N[(N[(h * N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -9.5 \cdot 10^{+184}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{elif}\;d \leq 4.4 \cdot 10^{+67}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \frac{-0.5}{4 \cdot \frac{d \cdot d}{\frac{h \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right)}{\ell}}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -9.4999999999999995e184Initial program 64.4%
metadata-eval64.4%
unpow1/264.4%
metadata-eval64.4%
unpow1/264.4%
*-commutative64.4%
associate-*l*64.4%
times-frac64.5%
metadata-eval64.5%
Simplified64.5%
associate-*r*64.5%
frac-times64.4%
*-commutative64.4%
metadata-eval64.4%
associate-*r/70.8%
metadata-eval70.8%
*-commutative70.8%
frac-times71.0%
div-inv71.0%
metadata-eval71.0%
Applied egg-rr71.0%
pow171.0%
sqrt-prod62.4%
*-commutative62.4%
associate-/l*55.9%
*-commutative55.9%
associate-*l*55.9%
Applied egg-rr55.9%
unpow155.9%
*-commutative55.9%
sub-neg55.9%
associate-/l*55.9%
distribute-neg-frac55.9%
metadata-eval55.9%
associate-/l/62.4%
associate-*r/62.4%
associate-*r/62.3%
associate-/l*62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in d around -inf 62.6%
mul-1-neg62.6%
*-commutative62.6%
distribute-rgt-neg-in62.6%
*-commutative62.6%
Simplified62.6%
if -9.4999999999999995e184 < d < 4.4e67Initial program 66.1%
metadata-eval66.1%
unpow1/266.1%
metadata-eval66.1%
unpow1/266.1%
*-commutative66.1%
associate-*l*66.1%
times-frac65.0%
metadata-eval65.0%
Simplified65.0%
associate-*r*65.0%
frac-times66.1%
*-commutative66.1%
metadata-eval66.1%
associate-*r/67.1%
metadata-eval67.1%
*-commutative67.1%
frac-times66.1%
div-inv66.1%
metadata-eval66.1%
Applied egg-rr66.1%
pow166.1%
sqrt-prod52.1%
*-commutative52.1%
associate-/l*50.7%
*-commutative50.7%
associate-*l*50.7%
Applied egg-rr50.7%
unpow150.7%
*-commutative50.7%
sub-neg50.7%
associate-/l*50.7%
distribute-neg-frac50.7%
metadata-eval50.7%
associate-/l/52.1%
associate-*r/52.1%
associate-*r/52.7%
associate-/l*52.1%
*-commutative52.1%
Simplified52.1%
Taylor expanded in l around 0 39.8%
associate-/l*41.5%
unpow241.5%
*-commutative41.5%
unpow241.5%
unpow241.5%
unpow241.5%
associate-*r*42.1%
unpow242.1%
unswap-sqr48.1%
Simplified48.1%
if 4.4e67 < d Initial program 71.1%
metadata-eval71.1%
unpow1/271.1%
metadata-eval71.1%
unpow1/271.1%
*-commutative71.1%
associate-*l*71.1%
times-frac71.2%
metadata-eval71.2%
Simplified71.2%
Taylor expanded in d around inf 69.4%
*-un-lft-identity69.4%
*-commutative69.4%
Applied egg-rr69.4%
*-lft-identity69.4%
unpow-169.4%
sqr-pow69.4%
rem-sqrt-square69.4%
sqr-pow69.2%
fabs-sqr69.2%
sqr-pow69.4%
metadata-eval69.4%
Simplified69.4%
unpow-prod-down76.4%
Applied egg-rr76.4%
Final simplification54.3%
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= d -1e+185)
(* d (- (sqrt (/ 1.0 (* l h)))))
(if (<= d 7e+68)
(*
(sqrt (* (/ d h) (/ d l)))
(+ 1.0 (/ -0.5 (* 4.0 (/ (* d d) (/ (* h (* (* M D) (* M D))) l))))))
(* d (/ (sqrt (/ 1.0 l)) (sqrt h))))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1e+185) {
tmp = d * -sqrt((1.0 / (l * h)));
} else if (d <= 7e+68) {
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l)))));
} else {
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
}
return tmp;
}
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 <= (-1d+185)) then
tmp = d * -sqrt((1.0d0 / (l * h)))
else if (d <= 7d+68) then
tmp = sqrt(((d / h) * (d / l))) * (1.0d0 + ((-0.5d0) / (4.0d0 * ((d * d) / ((h * ((m * d_1) * (m * d_1))) / l)))))
else
tmp = d * (sqrt((1.0d0 / l)) / sqrt(h))
end if
code = tmp
end function
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1e+185) {
tmp = d * -Math.sqrt((1.0 / (l * h)));
} else if (d <= 7e+68) {
tmp = Math.sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l)))));
} else {
tmp = d * (Math.sqrt((1.0 / l)) / Math.sqrt(h));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if d <= -1e+185: tmp = d * -math.sqrt((1.0 / (l * h))) elif d <= 7e+68: tmp = math.sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l))))) else: tmp = d * (math.sqrt((1.0 / l)) / math.sqrt(h)) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (d <= -1e+185) tmp = Float64(d * Float64(-sqrt(Float64(1.0 / Float64(l * h))))); elseif (d <= 7e+68) tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 + Float64(-0.5 / Float64(4.0 * Float64(Float64(d * d) / Float64(Float64(h * Float64(Float64(M * D) * Float64(M * D))) / l)))))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / l)) / sqrt(h))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (d <= -1e+185)
tmp = d * -sqrt((1.0 / (l * h)));
elseif (d <= 7e+68)
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l)))));
else
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
end
tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1e+185], N[(d * (-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, 7e+68], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 / N[(4.0 * N[(N[(d * d), $MachinePrecision] / N[(N[(h * N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1 \cdot 10^{+185}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{elif}\;d \leq 7 \cdot 10^{+68}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \frac{-0.5}{4 \cdot \frac{d \cdot d}{\frac{h \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right)}{\ell}}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -9.9999999999999998e184Initial program 64.4%
metadata-eval64.4%
unpow1/264.4%
metadata-eval64.4%
unpow1/264.4%
*-commutative64.4%
associate-*l*64.4%
times-frac64.5%
metadata-eval64.5%
Simplified64.5%
associate-*r*64.5%
frac-times64.4%
*-commutative64.4%
metadata-eval64.4%
associate-*r/70.8%
metadata-eval70.8%
*-commutative70.8%
frac-times71.0%
div-inv71.0%
metadata-eval71.0%
Applied egg-rr71.0%
pow171.0%
sqrt-prod62.4%
*-commutative62.4%
associate-/l*55.9%
*-commutative55.9%
associate-*l*55.9%
Applied egg-rr55.9%
unpow155.9%
*-commutative55.9%
sub-neg55.9%
associate-/l*55.9%
distribute-neg-frac55.9%
metadata-eval55.9%
associate-/l/62.4%
associate-*r/62.4%
associate-*r/62.3%
associate-/l*62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in d around -inf 62.6%
mul-1-neg62.6%
*-commutative62.6%
distribute-rgt-neg-in62.6%
*-commutative62.6%
Simplified62.6%
if -9.9999999999999998e184 < d < 6.99999999999999955e68Initial program 66.1%
metadata-eval66.1%
unpow1/266.1%
metadata-eval66.1%
unpow1/266.1%
*-commutative66.1%
associate-*l*66.1%
times-frac65.0%
metadata-eval65.0%
Simplified65.0%
associate-*r*65.0%
frac-times66.1%
*-commutative66.1%
metadata-eval66.1%
associate-*r/67.1%
metadata-eval67.1%
*-commutative67.1%
frac-times66.1%
div-inv66.1%
metadata-eval66.1%
Applied egg-rr66.1%
pow166.1%
sqrt-prod52.1%
*-commutative52.1%
associate-/l*50.7%
*-commutative50.7%
associate-*l*50.7%
Applied egg-rr50.7%
unpow150.7%
*-commutative50.7%
sub-neg50.7%
associate-/l*50.7%
distribute-neg-frac50.7%
metadata-eval50.7%
associate-/l/52.1%
associate-*r/52.1%
associate-*r/52.7%
associate-/l*52.1%
*-commutative52.1%
Simplified52.1%
Taylor expanded in l around 0 39.8%
associate-/l*41.5%
unpow241.5%
*-commutative41.5%
unpow241.5%
unpow241.5%
unpow241.5%
associate-*r*42.1%
unpow242.1%
unswap-sqr48.1%
Simplified48.1%
if 6.99999999999999955e68 < d Initial program 71.1%
metadata-eval71.1%
unpow1/271.1%
metadata-eval71.1%
unpow1/271.1%
*-commutative71.1%
associate-*l*71.1%
times-frac71.2%
metadata-eval71.2%
Simplified71.2%
Taylor expanded in d around inf 69.4%
*-un-lft-identity69.4%
*-commutative69.4%
Applied egg-rr69.4%
*-lft-identity69.4%
*-commutative69.4%
associate-/r*71.0%
Simplified71.0%
sqrt-div76.5%
Applied egg-rr76.5%
Final simplification54.3%
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= l -35.0)
(* d (- (sqrt (/ 1.0 (* l h)))))
(if (<= l 4.2e-52)
(*
(sqrt (* (/ d h) (/ d l)))
(+ 1.0 (/ -0.5 (* 4.0 (/ (* d d) (/ (* h (* (* M D) (* M D))) l))))))
(* d (sqrt (/ (/ 1.0 l) h))))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -35.0) {
tmp = d * -sqrt((1.0 / (l * h)));
} else if (l <= 4.2e-52) {
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l)))));
} else {
tmp = d * sqrt(((1.0 / l) / h));
}
return tmp;
}
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 <= (-35.0d0)) then
tmp = d * -sqrt((1.0d0 / (l * h)))
else if (l <= 4.2d-52) then
tmp = sqrt(((d / h) * (d / l))) * (1.0d0 + ((-0.5d0) / (4.0d0 * ((d * d) / ((h * ((m * d_1) * (m * d_1))) / l)))))
else
tmp = d * sqrt(((1.0d0 / l) / h))
end if
code = tmp
end function
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -35.0) {
tmp = d * -Math.sqrt((1.0 / (l * h)));
} else if (l <= 4.2e-52) {
tmp = Math.sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l)))));
} else {
tmp = d * Math.sqrt(((1.0 / l) / h));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if l <= -35.0: tmp = d * -math.sqrt((1.0 / (l * h))) elif l <= 4.2e-52: tmp = math.sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l))))) else: tmp = d * math.sqrt(((1.0 / l) / h)) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= -35.0) tmp = Float64(d * Float64(-sqrt(Float64(1.0 / Float64(l * h))))); elseif (l <= 4.2e-52) tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 + Float64(-0.5 / Float64(4.0 * Float64(Float64(d * d) / Float64(Float64(h * Float64(Float64(M * D) * Float64(M * D))) / l)))))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= -35.0)
tmp = d * -sqrt((1.0 / (l * h)));
elseif (l <= 4.2e-52)
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 / (4.0 * ((d * d) / ((h * ((M * D) * (M * D))) / l)))));
else
tmp = d * sqrt(((1.0 / l) / h));
end
tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, -35.0], N[(d * (-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, 4.2e-52], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 / N[(4.0 * N[(N[(d * d), $MachinePrecision] / N[(N[(h * N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -35:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{elif}\;\ell \leq 4.2 \cdot 10^{-52}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \frac{-0.5}{4 \cdot \frac{d \cdot d}{\frac{h \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right)}{\ell}}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\end{array}
\end{array}
if l < -35Initial program 62.4%
metadata-eval62.4%
unpow1/262.4%
metadata-eval62.4%
unpow1/262.4%
*-commutative62.4%
associate-*l*62.4%
times-frac62.5%
metadata-eval62.5%
Simplified62.5%
associate-*r*62.5%
frac-times62.4%
*-commutative62.4%
metadata-eval62.4%
associate-*r/61.1%
metadata-eval61.1%
*-commutative61.1%
frac-times61.2%
div-inv61.2%
metadata-eval61.2%
Applied egg-rr61.2%
pow161.2%
sqrt-prod46.5%
*-commutative46.5%
associate-/l*46.4%
*-commutative46.4%
associate-*l*46.4%
Applied egg-rr46.4%
unpow146.4%
*-commutative46.4%
sub-neg46.4%
associate-/l*46.4%
distribute-neg-frac46.4%
metadata-eval46.4%
associate-/l/46.5%
associate-*r/46.5%
associate-*r/46.4%
associate-/l*46.5%
*-commutative46.5%
Simplified46.5%
Taylor expanded in d around -inf 45.4%
mul-1-neg45.4%
*-commutative45.4%
distribute-rgt-neg-in45.4%
*-commutative45.4%
Simplified45.4%
if -35 < l < 4.1999999999999997e-52Initial program 76.0%
metadata-eval76.0%
unpow1/276.0%
metadata-eval76.0%
unpow1/276.0%
*-commutative76.0%
associate-*l*76.0%
times-frac76.0%
metadata-eval76.0%
Simplified76.0%
associate-*r*76.0%
frac-times76.0%
*-commutative76.0%
metadata-eval76.0%
associate-*r/81.2%
metadata-eval81.2%
*-commutative81.2%
frac-times81.1%
div-inv81.1%
metadata-eval81.1%
Applied egg-rr81.1%
pow181.1%
sqrt-prod72.3%
*-commutative72.3%
associate-/l*67.9%
*-commutative67.9%
associate-*l*67.9%
Applied egg-rr67.9%
unpow167.9%
*-commutative67.9%
sub-neg67.9%
associate-/l*67.9%
distribute-neg-frac67.9%
metadata-eval67.9%
associate-/l/72.3%
associate-*r/72.3%
associate-*r/72.3%
associate-/l*72.3%
*-commutative72.3%
Simplified72.3%
Taylor expanded in l around 0 49.8%
associate-/l*52.3%
unpow252.3%
*-commutative52.3%
unpow252.3%
unpow252.3%
unpow252.3%
associate-*r*53.3%
unpow253.3%
unswap-sqr60.2%
Simplified60.2%
if 4.1999999999999997e-52 < l Initial program 54.6%
metadata-eval54.6%
unpow1/254.6%
metadata-eval54.6%
unpow1/254.6%
*-commutative54.6%
associate-*l*54.6%
times-frac51.8%
metadata-eval51.8%
Simplified51.8%
Taylor expanded in d around inf 48.9%
*-un-lft-identity48.9%
*-commutative48.9%
Applied egg-rr48.9%
*-lft-identity48.9%
*-commutative48.9%
associate-/r*49.9%
Simplified49.9%
Final simplification53.4%
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= l -5.8e+28)
(* d (- (sqrt (/ 1.0 (* l h)))))
(if (<= l 5.8e-71)
(*
(sqrt (* (/ d h) (/ d l)))
(+ 1.0 (/ -0.5 (* (* 4.0 (* (/ d D) (/ d D))) (/ l (* M (* h M)))))))
(* d (sqrt (/ (/ 1.0 l) h))))))assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -5.8e+28) {
tmp = d * -sqrt((1.0 / (l * h)));
} else if (l <= 5.8e-71) {
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 / ((4.0 * ((d / D) * (d / D))) * (l / (M * (h * M))))));
} else {
tmp = d * sqrt(((1.0 / l) / h));
}
return tmp;
}
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 <= (-5.8d+28)) then
tmp = d * -sqrt((1.0d0 / (l * h)))
else if (l <= 5.8d-71) then
tmp = sqrt(((d / h) * (d / l))) * (1.0d0 + ((-0.5d0) / ((4.0d0 * ((d / d_1) * (d / d_1))) * (l / (m * (h * m))))))
else
tmp = d * sqrt(((1.0d0 / l) / h))
end if
code = tmp
end function
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -5.8e+28) {
tmp = d * -Math.sqrt((1.0 / (l * h)));
} else if (l <= 5.8e-71) {
tmp = Math.sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 / ((4.0 * ((d / D) * (d / D))) * (l / (M * (h * M))))));
} else {
tmp = d * Math.sqrt(((1.0 / l) / h));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if l <= -5.8e+28: tmp = d * -math.sqrt((1.0 / (l * h))) elif l <= 5.8e-71: tmp = math.sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 / ((4.0 * ((d / D) * (d / D))) * (l / (M * (h * M)))))) else: tmp = d * math.sqrt(((1.0 / l) / h)) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= -5.8e+28) tmp = Float64(d * Float64(-sqrt(Float64(1.0 / Float64(l * h))))); elseif (l <= 5.8e-71) tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 + Float64(-0.5 / Float64(Float64(4.0 * Float64(Float64(d / D) * Float64(d / D))) * Float64(l / Float64(M * Float64(h * M))))))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= -5.8e+28)
tmp = d * -sqrt((1.0 / (l * h)));
elseif (l <= 5.8e-71)
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 / ((4.0 * ((d / D) * (d / D))) * (l / (M * (h * M))))));
else
tmp = d * sqrt(((1.0 / l) / h));
end
tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, -5.8e+28], N[(d * (-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, 5.8e-71], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 / N[(N[(4.0 * N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.8 \cdot 10^{+28}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{-71}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \frac{-0.5}{\left(4 \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\right) \cdot \frac{\ell}{M \cdot \left(h \cdot M\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\end{array}
\end{array}
if l < -5.8000000000000002e28Initial program 60.8%
metadata-eval60.8%
unpow1/260.8%
metadata-eval60.8%
unpow1/260.8%
*-commutative60.8%
associate-*l*60.8%
times-frac60.8%
metadata-eval60.8%
Simplified60.8%
associate-*r*60.8%
frac-times60.8%
*-commutative60.8%
metadata-eval60.8%
associate-*r/59.4%
metadata-eval59.4%
*-commutative59.4%
frac-times59.5%
div-inv59.5%
metadata-eval59.5%
Applied egg-rr59.5%
pow159.5%
sqrt-prod45.6%
*-commutative45.6%
associate-/l*45.5%
*-commutative45.5%
associate-*l*45.5%
Applied egg-rr45.5%
unpow145.5%
*-commutative45.5%
sub-neg45.5%
associate-/l*45.5%
distribute-neg-frac45.5%
metadata-eval45.5%
associate-/l/45.6%
associate-*r/45.6%
associate-*r/45.5%
associate-/l*45.6%
*-commutative45.6%
Simplified45.6%
Taylor expanded in d around -inf 45.9%
mul-1-neg45.9%
*-commutative45.9%
distribute-rgt-neg-in45.9%
*-commutative45.9%
Simplified45.9%
if -5.8000000000000002e28 < l < 5.7999999999999997e-71Initial program 76.1%
metadata-eval76.1%
unpow1/276.1%
metadata-eval76.1%
unpow1/276.1%
*-commutative76.1%
associate-*l*76.1%
times-frac76.0%
metadata-eval76.0%
Simplified76.0%
associate-*r*76.0%
frac-times76.1%
*-commutative76.1%
metadata-eval76.1%
associate-*r/81.4%
metadata-eval81.4%
*-commutative81.4%
frac-times81.4%
div-inv81.4%
metadata-eval81.4%
Applied egg-rr81.4%
pow181.4%
sqrt-prod73.9%
*-commutative73.9%
associate-/l*69.4%
*-commutative69.4%
associate-*l*69.4%
Applied egg-rr69.4%
unpow169.4%
*-commutative69.4%
sub-neg69.4%
associate-/l*69.4%
distribute-neg-frac69.4%
metadata-eval69.4%
associate-/l/73.9%
associate-*r/73.9%
associate-*r/73.9%
associate-/l*73.9%
*-commutative73.9%
Simplified73.9%
Taylor expanded in l around 0 50.7%
times-frac51.4%
unpow251.4%
*-commutative51.4%
unpow251.4%
associate-*r*51.4%
unpow251.4%
unpow251.4%
times-frac59.5%
unpow259.5%
*-commutative59.5%
associate-*r*61.3%
Simplified61.3%
if 5.7999999999999997e-71 < l Initial program 57.5%
metadata-eval57.5%
unpow1/257.5%
metadata-eval57.5%
unpow1/257.5%
*-commutative57.5%
associate-*l*57.5%
times-frac55.0%
metadata-eval55.0%
Simplified55.0%
Taylor expanded in d around inf 47.1%
*-un-lft-identity47.1%
*-commutative47.1%
Applied egg-rr47.1%
*-lft-identity47.1%
*-commutative47.1%
associate-/r*47.9%
Simplified47.9%
Final simplification53.3%
NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= l -2.8e-252) (* d (- (sqrt (/ 1.0 (* l h))))) (* d (sqrt (/ (/ 1.0 l) h)))))
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.8e-252) {
tmp = d * -sqrt((1.0 / (l * h)));
} else {
tmp = d * sqrt(((1.0 / l) / h));
}
return tmp;
}
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 <= (-2.8d-252)) then
tmp = d * -sqrt((1.0d0 / (l * h)))
else
tmp = d * sqrt(((1.0d0 / l) / h))
end if
code = tmp
end function
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.8e-252) {
tmp = d * -Math.sqrt((1.0 / (l * h)));
} else {
tmp = d * Math.sqrt(((1.0 / l) / h));
}
return tmp;
}
[M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if l <= -2.8e-252: tmp = d * -math.sqrt((1.0 / (l * h))) else: tmp = d * math.sqrt(((1.0 / l) / h)) return tmp
M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.8e-252) tmp = Float64(d * Float64(-sqrt(Float64(1.0 / Float64(l * h))))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= -2.8e-252)
tmp = d * -sqrt((1.0 / (l * h)));
else
tmp = d * sqrt(((1.0 / l) / h));
end
tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.8e-252], N[(d * (-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.8 \cdot 10^{-252}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\end{array}
\end{array}
if l < -2.80000000000000018e-252Initial program 64.5%
metadata-eval64.5%
unpow1/264.5%
metadata-eval64.5%
unpow1/264.5%
*-commutative64.5%
associate-*l*64.5%
times-frac64.5%
metadata-eval64.5%
Simplified64.5%
associate-*r*64.5%
frac-times64.5%
*-commutative64.5%
metadata-eval64.5%
associate-*r/65.5%
metadata-eval65.5%
*-commutative65.5%
frac-times65.5%
div-inv65.5%
metadata-eval65.5%
Applied egg-rr65.5%
pow165.5%
sqrt-prod53.2%
*-commutative53.2%
associate-/l*51.4%
*-commutative51.4%
associate-*l*51.4%
Applied egg-rr51.4%
unpow151.4%
*-commutative51.4%
sub-neg51.4%
associate-/l*51.4%
distribute-neg-frac51.4%
metadata-eval51.4%
associate-/l/53.2%
associate-*r/53.2%
associate-*r/53.1%
associate-/l*53.2%
*-commutative53.2%
Simplified53.2%
Taylor expanded in d around -inf 39.2%
mul-1-neg39.2%
*-commutative39.2%
distribute-rgt-neg-in39.2%
*-commutative39.2%
Simplified39.2%
if -2.80000000000000018e-252 < l Initial program 68.7%
metadata-eval68.7%
unpow1/268.7%
metadata-eval68.7%
unpow1/268.7%
*-commutative68.7%
associate-*l*68.7%
times-frac67.2%
metadata-eval67.2%
Simplified67.2%
Taylor expanded in d around inf 44.1%
*-un-lft-identity44.1%
*-commutative44.1%
Applied egg-rr44.1%
*-lft-identity44.1%
*-commutative44.1%
associate-/r*44.6%
Simplified44.6%
Final simplification42.0%
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)))))
assert(M < D);
double code(double d, double h, double l, double M, double D) {
return d * sqrt((1.0 / (l * h)));
}
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
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, D] = sort([M, D]) def code(d, h, l, M, D): return d * math.sqrt((1.0 / (l * h)))
M, D = sort([M, D]) function code(d, h, l, M, D) return Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) end
M, D = num2cell(sort([M, D])){:}
function tmp = code(d, h, l, M, D)
tmp = d * sqrt((1.0 / (l * h)));
end
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, D] = \mathsf{sort}([M, D])\\
\\
d \cdot \sqrt{\frac{1}{\ell \cdot h}}
\end{array}
Initial program 66.6%
metadata-eval66.6%
unpow1/266.6%
metadata-eval66.6%
unpow1/266.6%
*-commutative66.6%
associate-*l*66.6%
times-frac65.9%
metadata-eval65.9%
Simplified65.9%
Taylor expanded in d around inf 26.8%
Final simplification26.8%
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))))
assert(M < D);
double code(double d, double h, double l, double M, double D) {
return d * sqrt(((1.0 / l) / h));
}
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
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, D] = sort([M, D]) def code(d, h, l, M, D): return d * math.sqrt(((1.0 / l) / h))
M, D = sort([M, D]) function code(d, h, l, M, D) return Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) end
M, D = num2cell(sort([M, D])){:}
function tmp = code(d, h, l, M, D)
tmp = d * sqrt(((1.0 / l) / h));
end
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 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}
\end{array}
Initial program 66.6%
metadata-eval66.6%
unpow1/266.6%
metadata-eval66.6%
unpow1/266.6%
*-commutative66.6%
associate-*l*66.6%
times-frac65.9%
metadata-eval65.9%
Simplified65.9%
Taylor expanded in d around inf 26.8%
*-un-lft-identity26.8%
*-commutative26.8%
Applied egg-rr26.8%
*-lft-identity26.8%
*-commutative26.8%
associate-/r*27.0%
Simplified27.0%
Final simplification27.0%
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)))
assert(M < D);
double code(double d, double h, double l, double M, double D) {
return d * pow((l * h), -0.5);
}
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
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, D] = sort([M, D]) def code(d, h, l, M, D): return d * math.pow((l * h), -0.5)
M, D = sort([M, D]) function code(d, h, l, M, D) return Float64(d * (Float64(l * h) ^ -0.5)) end
M, D = num2cell(sort([M, D])){:}
function tmp = code(d, h, l, M, D)
tmp = d * ((l * h) ^ -0.5);
end
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, D] = \mathsf{sort}([M, D])\\
\\
d \cdot {\left(\ell \cdot h\right)}^{-0.5}
\end{array}
Initial program 66.6%
metadata-eval66.6%
unpow1/266.6%
metadata-eval66.6%
unpow1/266.6%
*-commutative66.6%
associate-*l*66.6%
times-frac65.9%
metadata-eval65.9%
Simplified65.9%
Taylor expanded in d around inf 26.8%
*-un-lft-identity26.8%
*-commutative26.8%
Applied egg-rr26.8%
*-lft-identity26.8%
unpow-126.8%
sqr-pow26.8%
rem-sqrt-square26.4%
sqr-pow26.3%
fabs-sqr26.3%
sqr-pow26.4%
metadata-eval26.4%
Simplified26.4%
Final simplification26.4%
herbie shell --seed 2023182
(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)))))