
(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 24 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}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1 (- 1.0 (* 0.5 (/ (* h (pow (* (* 0.5 M) (/ D d)) 2.0)) l))))
(t_2 (/ (sqrt d) (sqrt h))))
(if (<= h -2e-310)
(* (* (pow (* (pow (/ -1.0 d) -0.25) (pow (/ -1.0 h) 0.25)) 2.0) t_0) t_1)
(if (<= h 2.05e+210)
(*
(/ (sqrt d) (sqrt l))
(* t_2 (fma (pow (* 0.5 (/ M (/ d D))) 2.0) (* -0.5 (/ h l)) 1.0)))
(* t_1 (* t_0 t_2))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = 1.0 - (0.5 * ((h * pow(((0.5 * M) * (D / d)), 2.0)) / l));
double t_2 = sqrt(d) / sqrt(h);
double tmp;
if (h <= -2e-310) {
tmp = (pow((pow((-1.0 / d), -0.25) * pow((-1.0 / h), 0.25)), 2.0) * t_0) * t_1;
} else if (h <= 2.05e+210) {
tmp = (sqrt(d) / sqrt(l)) * (t_2 * fma(pow((0.5 * (M / (d / D))), 2.0), (-0.5 * (h / l)), 1.0));
} else {
tmp = t_1 * (t_0 * t_2);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(0.5 * M) * Float64(D / d)) ^ 2.0)) / l))) t_2 = Float64(sqrt(d) / sqrt(h)) tmp = 0.0 if (h <= -2e-310) tmp = Float64(Float64((Float64((Float64(-1.0 / d) ^ -0.25) * (Float64(-1.0 / h) ^ 0.25)) ^ 2.0) * t_0) * t_1); elseif (h <= 2.05e+210) tmp = Float64(Float64(sqrt(d) / sqrt(l)) * Float64(t_2 * fma((Float64(0.5 * Float64(M / Float64(d / D))) ^ 2.0), Float64(-0.5 * Float64(h / l)), 1.0))); else tmp = Float64(t_1 * Float64(t_0 * t_2)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(0.5 * M), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -2e-310], N[(N[(N[Power[N[(N[Power[N[(-1.0 / d), $MachinePrecision], -0.25], $MachinePrecision] * N[Power[N[(-1.0 / h), $MachinePrecision], 0.25], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[h, 2.05e+210], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(t$95$2 * N[(N[Power[N[(0.5 * N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := 1 - 0.5 \cdot \frac{h \cdot {\left(\left(0.5 \cdot M\right) \cdot \frac{D}{d}\right)}^{2}}{\ell}\\
t_2 := \frac{\sqrt{d}}{\sqrt{h}}\\
\mathbf{if}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left({\left({\left(\frac{-1}{d}\right)}^{-0.25} \cdot {\left(\frac{-1}{h}\right)}^{0.25}\right)}^{2} \cdot t_0\right) \cdot t_1\\
\mathbf{elif}\;h \leq 2.05 \cdot 10^{+210}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(t_2 \cdot \mathsf{fma}\left({\left(0.5 \cdot \frac{M}{\frac{d}{D}}\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(t_0 \cdot t_2\right)\\
\end{array}
\end{array}
if h < -1.999999999999994e-310Initial program 72.4%
Simplified72.4%
associate-*r/73.4%
div-inv73.4%
metadata-eval73.4%
Applied egg-rr73.4%
pow1/273.4%
sqr-pow73.4%
pow273.4%
metadata-eval73.4%
Applied egg-rr73.4%
Taylor expanded in d around -inf 81.1%
+-commutative81.1%
distribute-lft-in81.1%
*-commutative81.1%
exp-sum81.5%
*-commutative81.5%
*-commutative81.5%
associate-*l*81.5%
metadata-eval81.5%
metadata-eval81.5%
exp-to-pow81.9%
metadata-eval81.9%
exp-to-pow84.7%
Simplified84.7%
if -1.999999999999994e-310 < h < 2.05e210Initial program 72.8%
Simplified71.8%
sqrt-div84.3%
Applied egg-rr84.3%
sqrt-div90.3%
Applied egg-rr90.3%
if 2.05e210 < h Initial program 41.6%
Simplified41.7%
associate-*r/58.8%
div-inv58.8%
metadata-eval58.8%
Applied egg-rr58.8%
sqrt-div58.6%
Applied egg-rr77.5%
Final simplification86.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1 (- 1.0 (* 0.5 (/ (* h (pow (* (* 0.5 M) (/ D d)) 2.0)) l)))))
(if (<= d -2.6e-306)
(* (* (pow (* (pow (/ -1.0 d) -0.25) (pow (/ -1.0 h) 0.25)) 2.0) t_0) t_1)
(if (<= d 1.15e-174)
(+
(* (/ (sqrt h) (pow l 1.5)) (* (/ -0.125 d) (pow (* M D) 2.0)))
(/ d (sqrt (* h l))))
(* t_1 (* t_0 (/ (sqrt d) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = 1.0 - (0.5 * ((h * pow(((0.5 * M) * (D / d)), 2.0)) / l));
double tmp;
if (d <= -2.6e-306) {
tmp = (pow((pow((-1.0 / d), -0.25) * pow((-1.0 / h), 0.25)), 2.0) * t_0) * t_1;
} else if (d <= 1.15e-174) {
tmp = ((sqrt(h) / pow(l, 1.5)) * ((-0.125 / d) * pow((M * D), 2.0))) + (d / sqrt((h * l)));
} else {
tmp = t_1 * (t_0 * (sqrt(d) / sqrt(h)));
}
return tmp;
}
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 = 1.0d0 - (0.5d0 * ((h * (((0.5d0 * m) * (d_1 / d)) ** 2.0d0)) / l))
if (d <= (-2.6d-306)) then
tmp = ((((((-1.0d0) / d) ** (-0.25d0)) * (((-1.0d0) / h) ** 0.25d0)) ** 2.0d0) * t_0) * t_1
else if (d <= 1.15d-174) then
tmp = ((sqrt(h) / (l ** 1.5d0)) * (((-0.125d0) / d) * ((m * d_1) ** 2.0d0))) + (d / sqrt((h * l)))
else
tmp = t_1 * (t_0 * (sqrt(d) / sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double t_1 = 1.0 - (0.5 * ((h * Math.pow(((0.5 * M) * (D / d)), 2.0)) / l));
double tmp;
if (d <= -2.6e-306) {
tmp = (Math.pow((Math.pow((-1.0 / d), -0.25) * Math.pow((-1.0 / h), 0.25)), 2.0) * t_0) * t_1;
} else if (d <= 1.15e-174) {
tmp = ((Math.sqrt(h) / Math.pow(l, 1.5)) * ((-0.125 / d) * Math.pow((M * D), 2.0))) + (d / Math.sqrt((h * l)));
} else {
tmp = t_1 * (t_0 * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = 1.0 - (0.5 * ((h * math.pow(((0.5 * M) * (D / d)), 2.0)) / l)) tmp = 0 if d <= -2.6e-306: tmp = (math.pow((math.pow((-1.0 / d), -0.25) * math.pow((-1.0 / h), 0.25)), 2.0) * t_0) * t_1 elif d <= 1.15e-174: tmp = ((math.sqrt(h) / math.pow(l, 1.5)) * ((-0.125 / d) * math.pow((M * D), 2.0))) + (d / math.sqrt((h * l))) else: tmp = t_1 * (t_0 * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(0.5 * M) * Float64(D / d)) ^ 2.0)) / l))) tmp = 0.0 if (d <= -2.6e-306) tmp = Float64(Float64((Float64((Float64(-1.0 / d) ^ -0.25) * (Float64(-1.0 / h) ^ 0.25)) ^ 2.0) * t_0) * t_1); elseif (d <= 1.15e-174) tmp = Float64(Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(Float64(-0.125 / d) * (Float64(M * D) ^ 2.0))) + Float64(d / sqrt(Float64(h * l)))); else tmp = Float64(t_1 * Float64(t_0 * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = 1.0 - (0.5 * ((h * (((0.5 * M) * (D / d)) ^ 2.0)) / l)); tmp = 0.0; if (d <= -2.6e-306) tmp = (((((-1.0 / d) ^ -0.25) * ((-1.0 / h) ^ 0.25)) ^ 2.0) * t_0) * t_1; elseif (d <= 1.15e-174) tmp = ((sqrt(h) / (l ^ 1.5)) * ((-0.125 / d) * ((M * D) ^ 2.0))) + (d / sqrt((h * l))); else tmp = t_1 * (t_0 * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(0.5 * M), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.6e-306], N[(N[(N[Power[N[(N[Power[N[(-1.0 / d), $MachinePrecision], -0.25], $MachinePrecision] * N[Power[N[(-1.0 / h), $MachinePrecision], 0.25], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[d, 1.15e-174], N[(N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(N[(-0.125 / d), $MachinePrecision] * N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := 1 - 0.5 \cdot \frac{h \cdot {\left(\left(0.5 \cdot M\right) \cdot \frac{D}{d}\right)}^{2}}{\ell}\\
\mathbf{if}\;d \leq -2.6 \cdot 10^{-306}:\\
\;\;\;\;\left({\left({\left(\frac{-1}{d}\right)}^{-0.25} \cdot {\left(\frac{-1}{h}\right)}^{0.25}\right)}^{2} \cdot t_0\right) \cdot t_1\\
\mathbf{elif}\;d \leq 1.15 \cdot 10^{-174}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(\frac{-0.125}{d} \cdot {\left(M \cdot D\right)}^{2}\right) + \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(t_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if d < -2.6e-306Initial program 73.0%
Simplified73.0%
associate-*r/74.0%
div-inv74.0%
metadata-eval74.0%
Applied egg-rr74.0%
pow1/274.0%
sqr-pow74.0%
pow274.0%
metadata-eval74.0%
Applied egg-rr74.0%
Taylor expanded in d around -inf 81.7%
+-commutative81.7%
distribute-lft-in81.7%
*-commutative81.7%
exp-sum82.2%
*-commutative82.2%
*-commutative82.2%
associate-*l*82.2%
metadata-eval82.2%
metadata-eval82.2%
exp-to-pow82.6%
metadata-eval82.6%
exp-to-pow85.4%
Simplified85.4%
if -2.6e-306 < d < 1.1499999999999999e-174Initial program 32.1%
Simplified31.8%
Taylor expanded in d around -inf 0.0%
+-commutative0.0%
associate-*r*0.0%
*-commutative0.0%
fma-def0.0%
Simplified60.3%
sqrt-div49.1%
Applied egg-rr60.2%
sqr-pow49.1%
rem-sqrt-square55.3%
sqr-pow55.3%
fabs-sqr55.3%
sqr-pow55.3%
metadata-eval55.3%
Simplified66.3%
fma-udef66.3%
associate-/r/66.3%
pow266.3%
*-commutative66.3%
sqrt-div66.3%
metadata-eval66.3%
div-inv66.3%
Applied egg-rr66.3%
if 1.1499999999999999e-174 < d Initial program 77.7%
Simplified76.7%
associate-*r/77.9%
div-inv77.9%
metadata-eval77.9%
Applied egg-rr77.9%
sqrt-div86.7%
Applied egg-rr87.9%
Final simplification84.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* M (* 0.5 (/ D d))) 2.0))
(t_1 (sqrt (/ d l)))
(t_2 (/ (sqrt d) (sqrt h))))
(if (<= h -1.4e+253)
(-
(* (/ (pow (* M D) 2.0) d) (* (sqrt (/ h (pow l 3.0))) 0.125))
(* d (sqrt (/ 1.0 (* h l)))))
(if (<= h -5.3e+109)
(* (* t_1 (sqrt (/ d h))) (- 1.0 (* 0.5 (* h (/ t_0 l)))))
(if (<= h -2e-310)
(* (* d (sqrt (/ (/ 1.0 l) h))) (- -1.0 (* -0.5 (* (/ h l) t_0))))
(if (<= h 2.55e+208)
(*
t_1
(* t_2 (fma (pow (* 0.5 (/ M (/ d D))) 2.0) (* -0.5 (/ h l)) 1.0)))
(*
(- 1.0 (* 0.5 (/ (* h (pow (* (* 0.5 M) (/ D d)) 2.0)) l)))
(* t_1 t_2))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((M * (0.5 * (D / d))), 2.0);
double t_1 = sqrt((d / l));
double t_2 = sqrt(d) / sqrt(h);
double tmp;
if (h <= -1.4e+253) {
tmp = ((pow((M * D), 2.0) / d) * (sqrt((h / pow(l, 3.0))) * 0.125)) - (d * sqrt((1.0 / (h * l))));
} else if (h <= -5.3e+109) {
tmp = (t_1 * sqrt((d / h))) * (1.0 - (0.5 * (h * (t_0 / l))));
} else if (h <= -2e-310) {
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_0)));
} else if (h <= 2.55e+208) {
tmp = t_1 * (t_2 * fma(pow((0.5 * (M / (d / D))), 2.0), (-0.5 * (h / l)), 1.0));
} else {
tmp = (1.0 - (0.5 * ((h * pow(((0.5 * M) * (D / d)), 2.0)) / l))) * (t_1 * t_2);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0 t_1 = sqrt(Float64(d / l)) t_2 = Float64(sqrt(d) / sqrt(h)) tmp = 0.0 if (h <= -1.4e+253) tmp = Float64(Float64(Float64((Float64(M * D) ^ 2.0) / d) * Float64(sqrt(Float64(h / (l ^ 3.0))) * 0.125)) - Float64(d * sqrt(Float64(1.0 / Float64(h * l))))); elseif (h <= -5.3e+109) tmp = Float64(Float64(t_1 * sqrt(Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(h * Float64(t_0 / l))))); elseif (h <= -2e-310) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * t_0)))); elseif (h <= 2.55e+208) tmp = Float64(t_1 * Float64(t_2 * fma((Float64(0.5 * Float64(M / Float64(d / D))) ^ 2.0), Float64(-0.5 * Float64(h / l)), 1.0))); else tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(0.5 * M) * Float64(D / d)) ^ 2.0)) / l))) * Float64(t_1 * t_2)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -1.4e+253], N[(N[(N[(N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] - N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5.3e+109], N[(N[(t$95$1 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(h * N[(t$95$0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 2.55e+208], N[(t$95$1 * N[(t$95$2 * N[(N[Power[N[(0.5 * N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(0.5 * M), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := \frac{\sqrt{d}}{\sqrt{h}}\\
\mathbf{if}\;h \leq -1.4 \cdot 10^{+253}:\\
\;\;\;\;\frac{{\left(M \cdot D\right)}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) - d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;h \leq -5.3 \cdot 10^{+109}:\\
\;\;\;\;\left(t_1 \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{t_0}{\ell}\right)\right)\\
\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot t_0\right)\right)\\
\mathbf{elif}\;h \leq 2.55 \cdot 10^{+208}:\\
\;\;\;\;t_1 \cdot \left(t_2 \cdot \mathsf{fma}\left({\left(0.5 \cdot \frac{M}{\frac{d}{D}}\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(\left(0.5 \cdot M\right) \cdot \frac{D}{d}\right)}^{2}}{\ell}\right) \cdot \left(t_1 \cdot t_2\right)\\
\end{array}
\end{array}
if h < -1.4e253Initial program 30.3%
Simplified30.3%
expm1-log1p-u10.3%
expm1-udef10.3%
Applied egg-rr10.3%
expm1-def10.3%
expm1-log1p30.3%
rem-log-exp30.0%
exp-sum30.0%
log-prod30.0%
rem-log-exp30.0%
*-commutative30.0%
log1p-expm130.0%
log1p-def30.0%
Simplified30.3%
Taylor expanded in d around -inf 70.0%
mul-1-neg70.0%
distribute-rgt-neg-in70.0%
cancel-sign-sub70.0%
mul-1-neg70.0%
rem-square-sqrt0.0%
unpow20.0%
Simplified70.8%
if -1.4e253 < h < -5.30000000000000026e109Initial program 79.0%
Simplified79.0%
associate-*r/82.9%
div-inv82.9%
metadata-eval82.9%
Applied egg-rr82.9%
div-inv79.4%
associate-*l*79.4%
Applied egg-rr79.4%
associate-*r/82.9%
*-rgt-identity82.9%
associate-*l/86.1%
associate-/r/79.0%
Simplified79.0%
associate-/r/86.1%
Applied egg-rr86.1%
if -5.30000000000000026e109 < h < -1.999999999999994e-310Initial program 75.1%
Simplified75.1%
expm1-log1p-u43.3%
expm1-udef35.9%
Applied egg-rr30.0%
expm1-def36.3%
expm1-log1p63.0%
rem-log-exp57.6%
exp-sum57.6%
log-prod57.6%
rem-log-exp57.6%
*-commutative57.6%
log1p-expm157.6%
log1p-def57.6%
Simplified63.0%
Taylor expanded in d around -inf 85.2%
associate-*r*85.2%
mul-1-neg85.2%
associate-/r*85.2%
Simplified85.2%
if -1.999999999999994e-310 < h < 2.5500000000000001e208Initial program 73.5%
Simplified72.5%
sqrt-div85.1%
Applied egg-rr85.1%
if 2.5500000000000001e208 < h Initial program 40.0%
Simplified40.1%
associate-*r/56.4%
div-inv56.4%
metadata-eval56.4%
Applied egg-rr56.4%
sqrt-div56.2%
Applied egg-rr74.4%
Final simplification83.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (- -1.0 (* -0.5 (* (/ h l) (pow (* M (* 0.5 (/ D d))) 2.0)))))
(t_1 (sqrt (/ d h)))
(t_2 (pow (* M D) 2.0))
(t_3 (* d (sqrt (/ 1.0 (* h l))))))
(if (<= l -1.85e+102)
(* (* d (sqrt (/ (/ 1.0 l) h))) t_0)
(if (<= l -4.5e-88)
(- (* (/ t_2 d) (* (sqrt (/ h (pow l 3.0))) 0.125)) t_3)
(if (<= l -1.4e-235)
(* t_3 t_0)
(if (<= l 2.15e-107)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* (* 0.5 M) (/ D d)) 2.0)) l)))
(* (sqrt (/ d l)) t_1))
(if (<= l 3.1e+171)
(+
(* (/ (sqrt h) (pow l 1.5)) (* (/ -0.125 d) t_2))
(/ d (sqrt (* h l))))
(*
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ D d) (/ M 2.0)) 2.0))))
(* (/ (sqrt d) (sqrt l)) t_1)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = -1.0 - (-0.5 * ((h / l) * pow((M * (0.5 * (D / d))), 2.0)));
double t_1 = sqrt((d / h));
double t_2 = pow((M * D), 2.0);
double t_3 = d * sqrt((1.0 / (h * l)));
double tmp;
if (l <= -1.85e+102) {
tmp = (d * sqrt(((1.0 / l) / h))) * t_0;
} else if (l <= -4.5e-88) {
tmp = ((t_2 / d) * (sqrt((h / pow(l, 3.0))) * 0.125)) - t_3;
} else if (l <= -1.4e-235) {
tmp = t_3 * t_0;
} else if (l <= 2.15e-107) {
tmp = (1.0 - (0.5 * ((h * pow(((0.5 * M) * (D / d)), 2.0)) / l))) * (sqrt((d / l)) * t_1);
} else if (l <= 3.1e+171) {
tmp = ((sqrt(h) / pow(l, 1.5)) * ((-0.125 / d) * t_2)) + (d / sqrt((h * l)));
} else {
tmp = (1.0 - (0.5 * ((h / l) * pow(((D / d) * (M / 2.0)), 2.0)))) * ((sqrt(d) / sqrt(l)) * t_1);
}
return tmp;
}
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) :: t_3
real(8) :: tmp
t_0 = (-1.0d0) - ((-0.5d0) * ((h / l) * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0)))
t_1 = sqrt((d / h))
t_2 = (m * d_1) ** 2.0d0
t_3 = d * sqrt((1.0d0 / (h * l)))
if (l <= (-1.85d+102)) then
tmp = (d * sqrt(((1.0d0 / l) / h))) * t_0
else if (l <= (-4.5d-88)) then
tmp = ((t_2 / d) * (sqrt((h / (l ** 3.0d0))) * 0.125d0)) - t_3
else if (l <= (-1.4d-235)) then
tmp = t_3 * t_0
else if (l <= 2.15d-107) then
tmp = (1.0d0 - (0.5d0 * ((h * (((0.5d0 * m) * (d_1 / d)) ** 2.0d0)) / l))) * (sqrt((d / l)) * t_1)
else if (l <= 3.1d+171) then
tmp = ((sqrt(h) / (l ** 1.5d0)) * (((-0.125d0) / d) * t_2)) + (d / sqrt((h * l)))
else
tmp = (1.0d0 - (0.5d0 * ((h / l) * (((d_1 / d) * (m / 2.0d0)) ** 2.0d0)))) * ((sqrt(d) / sqrt(l)) * t_1)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = -1.0 - (-0.5 * ((h / l) * Math.pow((M * (0.5 * (D / d))), 2.0)));
double t_1 = Math.sqrt((d / h));
double t_2 = Math.pow((M * D), 2.0);
double t_3 = d * Math.sqrt((1.0 / (h * l)));
double tmp;
if (l <= -1.85e+102) {
tmp = (d * Math.sqrt(((1.0 / l) / h))) * t_0;
} else if (l <= -4.5e-88) {
tmp = ((t_2 / d) * (Math.sqrt((h / Math.pow(l, 3.0))) * 0.125)) - t_3;
} else if (l <= -1.4e-235) {
tmp = t_3 * t_0;
} else if (l <= 2.15e-107) {
tmp = (1.0 - (0.5 * ((h * Math.pow(((0.5 * M) * (D / d)), 2.0)) / l))) * (Math.sqrt((d / l)) * t_1);
} else if (l <= 3.1e+171) {
tmp = ((Math.sqrt(h) / Math.pow(l, 1.5)) * ((-0.125 / d) * t_2)) + (d / Math.sqrt((h * l)));
} else {
tmp = (1.0 - (0.5 * ((h / l) * Math.pow(((D / d) * (M / 2.0)), 2.0)))) * ((Math.sqrt(d) / Math.sqrt(l)) * t_1);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = -1.0 - (-0.5 * ((h / l) * math.pow((M * (0.5 * (D / d))), 2.0))) t_1 = math.sqrt((d / h)) t_2 = math.pow((M * D), 2.0) t_3 = d * math.sqrt((1.0 / (h * l))) tmp = 0 if l <= -1.85e+102: tmp = (d * math.sqrt(((1.0 / l) / h))) * t_0 elif l <= -4.5e-88: tmp = ((t_2 / d) * (math.sqrt((h / math.pow(l, 3.0))) * 0.125)) - t_3 elif l <= -1.4e-235: tmp = t_3 * t_0 elif l <= 2.15e-107: tmp = (1.0 - (0.5 * ((h * math.pow(((0.5 * M) * (D / d)), 2.0)) / l))) * (math.sqrt((d / l)) * t_1) elif l <= 3.1e+171: tmp = ((math.sqrt(h) / math.pow(l, 1.5)) * ((-0.125 / d) * t_2)) + (d / math.sqrt((h * l))) else: tmp = (1.0 - (0.5 * ((h / l) * math.pow(((D / d) * (M / 2.0)), 2.0)))) * ((math.sqrt(d) / math.sqrt(l)) * t_1) return tmp
function code(d, h, l, M, D) t_0 = Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0)))) t_1 = sqrt(Float64(d / h)) t_2 = Float64(M * D) ^ 2.0 t_3 = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) tmp = 0.0 if (l <= -1.85e+102) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * t_0); elseif (l <= -4.5e-88) tmp = Float64(Float64(Float64(t_2 / d) * Float64(sqrt(Float64(h / (l ^ 3.0))) * 0.125)) - t_3); elseif (l <= -1.4e-235) tmp = Float64(t_3 * t_0); elseif (l <= 2.15e-107) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(0.5 * M) * Float64(D / d)) ^ 2.0)) / l))) * Float64(sqrt(Float64(d / l)) * t_1)); elseif (l <= 3.1e+171) tmp = Float64(Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(Float64(-0.125 / d) * t_2)) + Float64(d / sqrt(Float64(h * l)))); else tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0)))) * Float64(Float64(sqrt(d) / sqrt(l)) * t_1)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = -1.0 - (-0.5 * ((h / l) * ((M * (0.5 * (D / d))) ^ 2.0))); t_1 = sqrt((d / h)); t_2 = (M * D) ^ 2.0; t_3 = d * sqrt((1.0 / (h * l))); tmp = 0.0; if (l <= -1.85e+102) tmp = (d * sqrt(((1.0 / l) / h))) * t_0; elseif (l <= -4.5e-88) tmp = ((t_2 / d) * (sqrt((h / (l ^ 3.0))) * 0.125)) - t_3; elseif (l <= -1.4e-235) tmp = t_3 * t_0; elseif (l <= 2.15e-107) tmp = (1.0 - (0.5 * ((h * (((0.5 * M) * (D / d)) ^ 2.0)) / l))) * (sqrt((d / l)) * t_1); elseif (l <= 3.1e+171) tmp = ((sqrt(h) / (l ^ 1.5)) * ((-0.125 / d) * t_2)) + (d / sqrt((h * l))); else tmp = (1.0 - (0.5 * ((h / l) * (((D / d) * (M / 2.0)) ^ 2.0)))) * ((sqrt(d) / sqrt(l)) * t_1); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.85e+102], N[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[l, -4.5e-88], N[(N[(N[(t$95$2 / d), $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision], If[LessEqual[l, -1.4e-235], N[(t$95$3 * t$95$0), $MachinePrecision], If[LessEqual[l, 2.15e-107], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(0.5 * M), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.1e+171], N[(N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(N[(-0.125 / d), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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] * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)\\
t_1 := \sqrt{\frac{d}{h}}\\
t_2 := {\left(M \cdot D\right)}^{2}\\
t_3 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{if}\;\ell \leq -1.85 \cdot 10^{+102}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot t_0\\
\mathbf{elif}\;\ell \leq -4.5 \cdot 10^{-88}:\\
\;\;\;\;\frac{t_2}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) - t_3\\
\mathbf{elif}\;\ell \leq -1.4 \cdot 10^{-235}:\\
\;\;\;\;t_3 \cdot t_0\\
\mathbf{elif}\;\ell \leq 2.15 \cdot 10^{-107}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(\left(0.5 \cdot M\right) \cdot \frac{D}{d}\right)}^{2}}{\ell}\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot t_1\right)\\
\mathbf{elif}\;\ell \leq 3.1 \cdot 10^{+171}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(\frac{-0.125}{d} \cdot t_2\right) + \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\right)\right) \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot t_1\right)\\
\end{array}
\end{array}
if l < -1.85000000000000011e102Initial program 69.6%
Simplified69.6%
expm1-log1p-u53.8%
expm1-udef39.0%
Applied egg-rr36.8%
expm1-def49.5%
expm1-log1p58.1%
rem-log-exp55.8%
exp-sum55.8%
log-prod55.8%
rem-log-exp55.8%
*-commutative55.8%
log1p-expm155.8%
log1p-def55.8%
Simplified58.1%
Taylor expanded in d around -inf 73.8%
associate-*r*73.8%
mul-1-neg73.8%
associate-/r*73.8%
Simplified73.8%
if -1.85000000000000011e102 < l < -4.49999999999999991e-88Initial program 68.3%
Simplified68.3%
expm1-log1p-u34.0%
expm1-udef28.2%
Applied egg-rr20.7%
expm1-def23.8%
expm1-log1p54.4%
rem-log-exp46.1%
exp-sum46.1%
log-prod46.1%
rem-log-exp46.1%
*-commutative46.1%
log1p-expm146.1%
log1p-def46.1%
Simplified54.4%
Taylor expanded in d around -inf 79.4%
mul-1-neg79.4%
distribute-rgt-neg-in79.4%
cancel-sign-sub79.4%
mul-1-neg79.4%
rem-square-sqrt0.0%
unpow20.0%
Simplified91.1%
if -4.49999999999999991e-88 < l < -1.39999999999999998e-235Initial program 77.5%
Simplified77.5%
expm1-log1p-u36.2%
expm1-udef33.4%
Applied egg-rr26.3%
expm1-def29.0%
expm1-log1p66.8%
rem-log-exp61.7%
exp-sum61.7%
log-prod61.7%
rem-log-exp61.7%
*-commutative61.7%
log1p-expm161.7%
log1p-def61.7%
Simplified66.8%
Taylor expanded in d around -inf 83.6%
mul-1-neg83.6%
distribute-rgt-neg-in83.6%
*-commutative83.6%
Simplified83.6%
if -1.39999999999999998e-235 < l < 2.1499999999999999e-107Initial program 71.9%
Simplified71.9%
associate-*r/80.0%
div-inv80.0%
metadata-eval80.0%
Applied egg-rr80.0%
if 2.1499999999999999e-107 < l < 3.0999999999999999e171Initial program 65.9%
Simplified64.2%
Taylor expanded in d around -inf 0.0%
+-commutative0.0%
associate-*r*0.0%
*-commutative0.0%
fma-def0.0%
Simplified66.3%
sqrt-div45.1%
Applied egg-rr79.7%
sqr-pow45.1%
rem-sqrt-square48.6%
sqr-pow48.6%
fabs-sqr48.6%
sqr-pow48.6%
metadata-eval48.6%
Simplified84.8%
fma-udef84.8%
associate-/r/84.8%
pow284.8%
*-commutative84.8%
sqrt-div84.8%
metadata-eval84.8%
div-inv84.9%
Applied egg-rr84.9%
if 3.0999999999999999e171 < l Initial program 66.4%
Simplified66.2%
sqrt-div87.5%
Applied egg-rr73.9%
Final simplification81.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h)))
(t_1 (pow (* M D) 2.0))
(t_2 (- 1.0 (* 0.5 (/ (* h (pow (* (* 0.5 M) (/ D d)) 2.0)) l))))
(t_3 (* (/ (sqrt d) (sqrt l)) t_0)))
(if (<= l -1.1e+101)
(*
(* d (sqrt (/ (/ 1.0 l) h)))
(- -1.0 (* -0.5 (* (/ h l) (pow (* M (* 0.5 (/ D d))) 2.0)))))
(if (<= l -3.4e-104)
(-
(* (/ t_1 d) (* (sqrt (/ h (pow l 3.0))) 0.125))
(* d (sqrt (/ 1.0 (* h l)))))
(if (<= l -2e-310)
(* t_2 (* (sqrt (/ d l)) t_0))
(if (<= l 2.1e-107)
(* t_2 t_3)
(if (<= l 2e+167)
(+
(* (/ (sqrt h) (pow l 1.5)) (* (/ -0.125 d) t_1))
(/ d (sqrt (* h l))))
(*
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ D d) (/ M 2.0)) 2.0))))
t_3))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = pow((M * D), 2.0);
double t_2 = 1.0 - (0.5 * ((h * pow(((0.5 * M) * (D / d)), 2.0)) / l));
double t_3 = (sqrt(d) / sqrt(l)) * t_0;
double tmp;
if (l <= -1.1e+101) {
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * pow((M * (0.5 * (D / d))), 2.0))));
} else if (l <= -3.4e-104) {
tmp = ((t_1 / d) * (sqrt((h / pow(l, 3.0))) * 0.125)) - (d * sqrt((1.0 / (h * l))));
} else if (l <= -2e-310) {
tmp = t_2 * (sqrt((d / l)) * t_0);
} else if (l <= 2.1e-107) {
tmp = t_2 * t_3;
} else if (l <= 2e+167) {
tmp = ((sqrt(h) / pow(l, 1.5)) * ((-0.125 / d) * t_1)) + (d / sqrt((h * l)));
} else {
tmp = (1.0 - (0.5 * ((h / l) * pow(((D / d) * (M / 2.0)), 2.0)))) * t_3;
}
return tmp;
}
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) :: t_3
real(8) :: tmp
t_0 = sqrt((d / h))
t_1 = (m * d_1) ** 2.0d0
t_2 = 1.0d0 - (0.5d0 * ((h * (((0.5d0 * m) * (d_1 / d)) ** 2.0d0)) / l))
t_3 = (sqrt(d) / sqrt(l)) * t_0
if (l <= (-1.1d+101)) then
tmp = (d * sqrt(((1.0d0 / l) / h))) * ((-1.0d0) - ((-0.5d0) * ((h / l) * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0))))
else if (l <= (-3.4d-104)) then
tmp = ((t_1 / d) * (sqrt((h / (l ** 3.0d0))) * 0.125d0)) - (d * sqrt((1.0d0 / (h * l))))
else if (l <= (-2d-310)) then
tmp = t_2 * (sqrt((d / l)) * t_0)
else if (l <= 2.1d-107) then
tmp = t_2 * t_3
else if (l <= 2d+167) then
tmp = ((sqrt(h) / (l ** 1.5d0)) * (((-0.125d0) / d) * t_1)) + (d / sqrt((h * l)))
else
tmp = (1.0d0 - (0.5d0 * ((h / l) * (((d_1 / d) * (m / 2.0d0)) ** 2.0d0)))) * t_3
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h));
double t_1 = Math.pow((M * D), 2.0);
double t_2 = 1.0 - (0.5 * ((h * Math.pow(((0.5 * M) * (D / d)), 2.0)) / l));
double t_3 = (Math.sqrt(d) / Math.sqrt(l)) * t_0;
double tmp;
if (l <= -1.1e+101) {
tmp = (d * Math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * Math.pow((M * (0.5 * (D / d))), 2.0))));
} else if (l <= -3.4e-104) {
tmp = ((t_1 / d) * (Math.sqrt((h / Math.pow(l, 3.0))) * 0.125)) - (d * Math.sqrt((1.0 / (h * l))));
} else if (l <= -2e-310) {
tmp = t_2 * (Math.sqrt((d / l)) * t_0);
} else if (l <= 2.1e-107) {
tmp = t_2 * t_3;
} else if (l <= 2e+167) {
tmp = ((Math.sqrt(h) / Math.pow(l, 1.5)) * ((-0.125 / d) * t_1)) + (d / Math.sqrt((h * l)));
} else {
tmp = (1.0 - (0.5 * ((h / l) * Math.pow(((D / d) * (M / 2.0)), 2.0)))) * t_3;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) t_1 = math.pow((M * D), 2.0) t_2 = 1.0 - (0.5 * ((h * math.pow(((0.5 * M) * (D / d)), 2.0)) / l)) t_3 = (math.sqrt(d) / math.sqrt(l)) * t_0 tmp = 0 if l <= -1.1e+101: tmp = (d * math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * math.pow((M * (0.5 * (D / d))), 2.0)))) elif l <= -3.4e-104: tmp = ((t_1 / d) * (math.sqrt((h / math.pow(l, 3.0))) * 0.125)) - (d * math.sqrt((1.0 / (h * l)))) elif l <= -2e-310: tmp = t_2 * (math.sqrt((d / l)) * t_0) elif l <= 2.1e-107: tmp = t_2 * t_3 elif l <= 2e+167: tmp = ((math.sqrt(h) / math.pow(l, 1.5)) * ((-0.125 / d) * t_1)) + (d / math.sqrt((h * l))) else: tmp = (1.0 - (0.5 * ((h / l) * math.pow(((D / d) * (M / 2.0)), 2.0)))) * t_3 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = Float64(M * D) ^ 2.0 t_2 = Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(0.5 * M) * Float64(D / d)) ^ 2.0)) / l))) t_3 = Float64(Float64(sqrt(d) / sqrt(l)) * t_0) tmp = 0.0 if (l <= -1.1e+101) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0))))); elseif (l <= -3.4e-104) tmp = Float64(Float64(Float64(t_1 / d) * Float64(sqrt(Float64(h / (l ^ 3.0))) * 0.125)) - Float64(d * sqrt(Float64(1.0 / Float64(h * l))))); elseif (l <= -2e-310) tmp = Float64(t_2 * Float64(sqrt(Float64(d / l)) * t_0)); elseif (l <= 2.1e-107) tmp = Float64(t_2 * t_3); elseif (l <= 2e+167) tmp = Float64(Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(Float64(-0.125 / d) * t_1)) + Float64(d / sqrt(Float64(h * l)))); else tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0)))) * t_3); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)); t_1 = (M * D) ^ 2.0; t_2 = 1.0 - (0.5 * ((h * (((0.5 * M) * (D / d)) ^ 2.0)) / l)); t_3 = (sqrt(d) / sqrt(l)) * t_0; tmp = 0.0; if (l <= -1.1e+101) tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * ((M * (0.5 * (D / d))) ^ 2.0)))); elseif (l <= -3.4e-104) tmp = ((t_1 / d) * (sqrt((h / (l ^ 3.0))) * 0.125)) - (d * sqrt((1.0 / (h * l)))); elseif (l <= -2e-310) tmp = t_2 * (sqrt((d / l)) * t_0); elseif (l <= 2.1e-107) tmp = t_2 * t_3; elseif (l <= 2e+167) tmp = ((sqrt(h) / (l ^ 1.5)) * ((-0.125 / d) * t_1)) + (d / sqrt((h * l))); else tmp = (1.0 - (0.5 * ((h / l) * (((D / d) * (M / 2.0)) ^ 2.0)))) * t_3; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(0.5 * M), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[l, -1.1e+101], N[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -3.4e-104], N[(N[(N[(t$95$1 / d), $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] - N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(t$95$2 * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.1e-107], N[(t$95$2 * t$95$3), $MachinePrecision], If[LessEqual[l, 2e+167], N[(N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(N[(-0.125 / d), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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] * t$95$3), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := {\left(M \cdot D\right)}^{2}\\
t_2 := 1 - 0.5 \cdot \frac{h \cdot {\left(\left(0.5 \cdot M\right) \cdot \frac{D}{d}\right)}^{2}}{\ell}\\
t_3 := \frac{\sqrt{d}}{\sqrt{\ell}} \cdot t_0\\
\mathbf{if}\;\ell \leq -1.1 \cdot 10^{+101}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)\right)\\
\mathbf{elif}\;\ell \leq -3.4 \cdot 10^{-104}:\\
\;\;\;\;\frac{t_1}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) - d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;t_2 \cdot \left(\sqrt{\frac{d}{\ell}} \cdot t_0\right)\\
\mathbf{elif}\;\ell \leq 2.1 \cdot 10^{-107}:\\
\;\;\;\;t_2 \cdot t_3\\
\mathbf{elif}\;\ell \leq 2 \cdot 10^{+167}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(\frac{-0.125}{d} \cdot t_1\right) + \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\right)\right) \cdot t_3\\
\end{array}
\end{array}
if l < -1.1e101Initial program 69.6%
Simplified69.6%
expm1-log1p-u53.8%
expm1-udef39.0%
Applied egg-rr36.8%
expm1-def49.5%
expm1-log1p58.1%
rem-log-exp55.8%
exp-sum55.8%
log-prod55.8%
rem-log-exp55.8%
*-commutative55.8%
log1p-expm155.8%
log1p-def55.8%
Simplified58.1%
Taylor expanded in d around -inf 73.8%
associate-*r*73.8%
mul-1-neg73.8%
associate-/r*73.8%
Simplified73.8%
if -1.1e101 < l < -3.40000000000000015e-104Initial program 69.8%
Simplified69.8%
expm1-log1p-u29.6%
expm1-udef24.5%
Applied egg-rr18.1%
expm1-def20.8%
expm1-log1p55.1%
rem-log-exp47.9%
exp-sum47.9%
log-prod47.9%
rem-log-exp47.9%
*-commutative47.9%
log1p-expm147.9%
log1p-def47.9%
Simplified55.1%
Taylor expanded in d around -inf 76.9%
mul-1-neg76.9%
distribute-rgt-neg-in76.9%
cancel-sign-sub76.9%
mul-1-neg76.9%
rem-square-sqrt0.0%
unpow20.0%
Simplified92.2%
if -3.40000000000000015e-104 < l < -1.999999999999994e-310Initial program 77.5%
Simplified77.5%
associate-*r/82.3%
div-inv82.3%
metadata-eval82.3%
Applied egg-rr82.3%
if -1.999999999999994e-310 < l < 2.0999999999999999e-107Initial program 69.5%
Simplified69.5%
associate-*r/75.4%
div-inv75.4%
metadata-eval75.4%
Applied egg-rr75.4%
sqrt-div79.5%
Applied egg-rr82.4%
if 2.0999999999999999e-107 < l < 2.0000000000000001e167Initial program 65.9%
Simplified64.2%
Taylor expanded in d around -inf 0.0%
+-commutative0.0%
associate-*r*0.0%
*-commutative0.0%
fma-def0.0%
Simplified66.3%
sqrt-div45.1%
Applied egg-rr79.7%
sqr-pow45.1%
rem-sqrt-square48.6%
sqr-pow48.6%
fabs-sqr48.6%
sqr-pow48.6%
metadata-eval48.6%
Simplified84.8%
fma-udef84.8%
associate-/r/84.8%
pow284.8%
*-commutative84.8%
sqrt-div84.8%
metadata-eval84.8%
div-inv84.9%
Applied egg-rr84.9%
if 2.0000000000000001e167 < l Initial program 66.4%
Simplified66.2%
sqrt-div87.5%
Applied egg-rr73.9%
Final simplification81.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))) (t_1 (pow (* M (* 0.5 (/ D d))) 2.0)))
(if (<= h -1.55e+253)
(-
(* (/ (pow (* M D) 2.0) d) (* (sqrt (/ h (pow l 3.0))) 0.125))
(* d (sqrt (/ 1.0 (* h l)))))
(if (<= h -2.9e+109)
(* (* t_0 (sqrt (/ d h))) (- 1.0 (* 0.5 (* h (/ t_1 l)))))
(if (<= h -2e-310)
(* (* d (sqrt (/ (/ 1.0 l) h))) (- -1.0 (* -0.5 (* (/ h l) t_1))))
(*
(* t_0 (/ (sqrt d) (sqrt h)))
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ D d) (/ M 2.0)) 2.0))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = pow((M * (0.5 * (D / d))), 2.0);
double tmp;
if (h <= -1.55e+253) {
tmp = ((pow((M * D), 2.0) / d) * (sqrt((h / pow(l, 3.0))) * 0.125)) - (d * sqrt((1.0 / (h * l))));
} else if (h <= -2.9e+109) {
tmp = (t_0 * sqrt((d / h))) * (1.0 - (0.5 * (h * (t_1 / l))));
} else if (h <= -2e-310) {
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_1)));
} else {
tmp = (t_0 * (sqrt(d) / sqrt(h))) * (1.0 - (0.5 * ((h / l) * pow(((D / d) * (M / 2.0)), 2.0))));
}
return tmp;
}
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 = (m * (0.5d0 * (d_1 / d))) ** 2.0d0
if (h <= (-1.55d+253)) then
tmp = ((((m * d_1) ** 2.0d0) / d) * (sqrt((h / (l ** 3.0d0))) * 0.125d0)) - (d * sqrt((1.0d0 / (h * l))))
else if (h <= (-2.9d+109)) then
tmp = (t_0 * sqrt((d / h))) * (1.0d0 - (0.5d0 * (h * (t_1 / l))))
else if (h <= (-2d-310)) then
tmp = (d * sqrt(((1.0d0 / l) / h))) * ((-1.0d0) - ((-0.5d0) * ((h / l) * t_1)))
else
tmp = (t_0 * (sqrt(d) / sqrt(h))) * (1.0d0 - (0.5d0 * ((h / l) * (((d_1 / d) * (m / 2.0d0)) ** 2.0d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double t_1 = Math.pow((M * (0.5 * (D / d))), 2.0);
double tmp;
if (h <= -1.55e+253) {
tmp = ((Math.pow((M * D), 2.0) / d) * (Math.sqrt((h / Math.pow(l, 3.0))) * 0.125)) - (d * Math.sqrt((1.0 / (h * l))));
} else if (h <= -2.9e+109) {
tmp = (t_0 * Math.sqrt((d / h))) * (1.0 - (0.5 * (h * (t_1 / l))));
} else if (h <= -2e-310) {
tmp = (d * Math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_1)));
} else {
tmp = (t_0 * (Math.sqrt(d) / Math.sqrt(h))) * (1.0 - (0.5 * ((h / l) * Math.pow(((D / d) * (M / 2.0)), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = math.pow((M * (0.5 * (D / d))), 2.0) tmp = 0 if h <= -1.55e+253: tmp = ((math.pow((M * D), 2.0) / d) * (math.sqrt((h / math.pow(l, 3.0))) * 0.125)) - (d * math.sqrt((1.0 / (h * l)))) elif h <= -2.9e+109: tmp = (t_0 * math.sqrt((d / h))) * (1.0 - (0.5 * (h * (t_1 / l)))) elif h <= -2e-310: tmp = (d * math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_1))) else: tmp = (t_0 * (math.sqrt(d) / math.sqrt(h))) * (1.0 - (0.5 * ((h / l) * math.pow(((D / d) * (M / 2.0)), 2.0)))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0 tmp = 0.0 if (h <= -1.55e+253) tmp = Float64(Float64(Float64((Float64(M * D) ^ 2.0) / d) * Float64(sqrt(Float64(h / (l ^ 3.0))) * 0.125)) - Float64(d * sqrt(Float64(1.0 / Float64(h * l))))); elseif (h <= -2.9e+109) tmp = Float64(Float64(t_0 * sqrt(Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(h * Float64(t_1 / l))))); elseif (h <= -2e-310) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * t_1)))); else tmp = Float64(Float64(t_0 * Float64(sqrt(d) / sqrt(h))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = (M * (0.5 * (D / d))) ^ 2.0; tmp = 0.0; if (h <= -1.55e+253) tmp = ((((M * D) ^ 2.0) / d) * (sqrt((h / (l ^ 3.0))) * 0.125)) - (d * sqrt((1.0 / (h * l)))); elseif (h <= -2.9e+109) tmp = (t_0 * sqrt((d / h))) * (1.0 - (0.5 * (h * (t_1 / l)))); elseif (h <= -2e-310) tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_1))); else tmp = (t_0 * (sqrt(d) / sqrt(h))) * (1.0 - (0.5 * ((h / l) * (((D / d) * (M / 2.0)) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[h, -1.55e+253], N[(N[(N[(N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] - N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2.9e+109], N[(N[(t$95$0 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(h * N[(t$95$1 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $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]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\\
\mathbf{if}\;h \leq -1.55 \cdot 10^{+253}:\\
\;\;\;\;\frac{{\left(M \cdot D\right)}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) - d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;h \leq -2.9 \cdot 10^{+109}:\\
\;\;\;\;\left(t_0 \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{t_1}{\ell}\right)\right)\\
\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if h < -1.55000000000000003e253Initial program 30.3%
Simplified30.3%
expm1-log1p-u10.3%
expm1-udef10.3%
Applied egg-rr10.3%
expm1-def10.3%
expm1-log1p30.3%
rem-log-exp30.0%
exp-sum30.0%
log-prod30.0%
rem-log-exp30.0%
*-commutative30.0%
log1p-expm130.0%
log1p-def30.0%
Simplified30.3%
Taylor expanded in d around -inf 70.0%
mul-1-neg70.0%
distribute-rgt-neg-in70.0%
cancel-sign-sub70.0%
mul-1-neg70.0%
rem-square-sqrt0.0%
unpow20.0%
Simplified70.8%
if -1.55000000000000003e253 < h < -2.9e109Initial program 79.0%
Simplified79.0%
associate-*r/82.9%
div-inv82.9%
metadata-eval82.9%
Applied egg-rr82.9%
div-inv79.4%
associate-*l*79.4%
Applied egg-rr79.4%
associate-*r/82.9%
*-rgt-identity82.9%
associate-*l/86.1%
associate-/r/79.0%
Simplified79.0%
associate-/r/86.1%
Applied egg-rr86.1%
if -2.9e109 < h < -1.999999999999994e-310Initial program 75.1%
Simplified75.1%
expm1-log1p-u43.3%
expm1-udef35.9%
Applied egg-rr30.0%
expm1-def36.3%
expm1-log1p63.0%
rem-log-exp57.6%
exp-sum57.6%
log-prod57.6%
rem-log-exp57.6%
*-commutative57.6%
log1p-expm157.6%
log1p-def57.6%
Simplified63.0%
Taylor expanded in d around -inf 85.2%
associate-*r*85.2%
mul-1-neg85.2%
associate-/r*85.2%
Simplified85.2%
if -1.999999999999994e-310 < h Initial program 67.1%
Simplified66.3%
sqrt-div79.6%
Applied egg-rr77.8%
Final simplification80.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))) (t_1 (pow (* M (* 0.5 (/ D d))) 2.0)))
(if (<= h -1.8e+248)
(-
(* (/ (pow (* M D) 2.0) d) (* (sqrt (/ h (pow l 3.0))) 0.125))
(* d (sqrt (/ 1.0 (* h l)))))
(if (<= h -8.8e+109)
(* (* t_0 (sqrt (/ d h))) (- 1.0 (* 0.5 (* h (/ t_1 l)))))
(if (<= h -2e-310)
(* (* d (sqrt (/ (/ 1.0 l) h))) (- -1.0 (* -0.5 (* (/ h l) t_1))))
(*
(- 1.0 (* 0.5 (/ (* h (pow (* (* 0.5 M) (/ D d)) 2.0)) l)))
(* t_0 (/ (sqrt d) (sqrt h)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = pow((M * (0.5 * (D / d))), 2.0);
double tmp;
if (h <= -1.8e+248) {
tmp = ((pow((M * D), 2.0) / d) * (sqrt((h / pow(l, 3.0))) * 0.125)) - (d * sqrt((1.0 / (h * l))));
} else if (h <= -8.8e+109) {
tmp = (t_0 * sqrt((d / h))) * (1.0 - (0.5 * (h * (t_1 / l))));
} else if (h <= -2e-310) {
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_1)));
} else {
tmp = (1.0 - (0.5 * ((h * pow(((0.5 * M) * (D / d)), 2.0)) / l))) * (t_0 * (sqrt(d) / sqrt(h)));
}
return tmp;
}
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 = (m * (0.5d0 * (d_1 / d))) ** 2.0d0
if (h <= (-1.8d+248)) then
tmp = ((((m * d_1) ** 2.0d0) / d) * (sqrt((h / (l ** 3.0d0))) * 0.125d0)) - (d * sqrt((1.0d0 / (h * l))))
else if (h <= (-8.8d+109)) then
tmp = (t_0 * sqrt((d / h))) * (1.0d0 - (0.5d0 * (h * (t_1 / l))))
else if (h <= (-2d-310)) then
tmp = (d * sqrt(((1.0d0 / l) / h))) * ((-1.0d0) - ((-0.5d0) * ((h / l) * t_1)))
else
tmp = (1.0d0 - (0.5d0 * ((h * (((0.5d0 * m) * (d_1 / d)) ** 2.0d0)) / l))) * (t_0 * (sqrt(d) / sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double t_1 = Math.pow((M * (0.5 * (D / d))), 2.0);
double tmp;
if (h <= -1.8e+248) {
tmp = ((Math.pow((M * D), 2.0) / d) * (Math.sqrt((h / Math.pow(l, 3.0))) * 0.125)) - (d * Math.sqrt((1.0 / (h * l))));
} else if (h <= -8.8e+109) {
tmp = (t_0 * Math.sqrt((d / h))) * (1.0 - (0.5 * (h * (t_1 / l))));
} else if (h <= -2e-310) {
tmp = (d * Math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_1)));
} else {
tmp = (1.0 - (0.5 * ((h * Math.pow(((0.5 * M) * (D / d)), 2.0)) / l))) * (t_0 * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = math.pow((M * (0.5 * (D / d))), 2.0) tmp = 0 if h <= -1.8e+248: tmp = ((math.pow((M * D), 2.0) / d) * (math.sqrt((h / math.pow(l, 3.0))) * 0.125)) - (d * math.sqrt((1.0 / (h * l)))) elif h <= -8.8e+109: tmp = (t_0 * math.sqrt((d / h))) * (1.0 - (0.5 * (h * (t_1 / l)))) elif h <= -2e-310: tmp = (d * math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_1))) else: tmp = (1.0 - (0.5 * ((h * math.pow(((0.5 * M) * (D / d)), 2.0)) / l))) * (t_0 * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0 tmp = 0.0 if (h <= -1.8e+248) tmp = Float64(Float64(Float64((Float64(M * D) ^ 2.0) / d) * Float64(sqrt(Float64(h / (l ^ 3.0))) * 0.125)) - Float64(d * sqrt(Float64(1.0 / Float64(h * l))))); elseif (h <= -8.8e+109) tmp = Float64(Float64(t_0 * sqrt(Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(h * Float64(t_1 / l))))); elseif (h <= -2e-310) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * t_1)))); else tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(0.5 * M) * Float64(D / d)) ^ 2.0)) / l))) * Float64(t_0 * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = (M * (0.5 * (D / d))) ^ 2.0; tmp = 0.0; if (h <= -1.8e+248) tmp = ((((M * D) ^ 2.0) / d) * (sqrt((h / (l ^ 3.0))) * 0.125)) - (d * sqrt((1.0 / (h * l)))); elseif (h <= -8.8e+109) tmp = (t_0 * sqrt((d / h))) * (1.0 - (0.5 * (h * (t_1 / l)))); elseif (h <= -2e-310) tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_1))); else tmp = (1.0 - (0.5 * ((h * (((0.5 * M) * (D / d)) ^ 2.0)) / l))) * (t_0 * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[h, -1.8e+248], N[(N[(N[(N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] - N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -8.8e+109], N[(N[(t$95$0 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(h * N[(t$95$1 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(0.5 * M), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\\
\mathbf{if}\;h \leq -1.8 \cdot 10^{+248}:\\
\;\;\;\;\frac{{\left(M \cdot D\right)}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) - d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;h \leq -8.8 \cdot 10^{+109}:\\
\;\;\;\;\left(t_0 \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{t_1}{\ell}\right)\right)\\
\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(\left(0.5 \cdot M\right) \cdot \frac{D}{d}\right)}^{2}}{\ell}\right) \cdot \left(t_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if h < -1.80000000000000001e248Initial program 30.3%
Simplified30.3%
expm1-log1p-u10.3%
expm1-udef10.3%
Applied egg-rr10.3%
expm1-def10.3%
expm1-log1p30.3%
rem-log-exp30.0%
exp-sum30.0%
log-prod30.0%
rem-log-exp30.0%
*-commutative30.0%
log1p-expm130.0%
log1p-def30.0%
Simplified30.3%
Taylor expanded in d around -inf 70.0%
mul-1-neg70.0%
distribute-rgt-neg-in70.0%
cancel-sign-sub70.0%
mul-1-neg70.0%
rem-square-sqrt0.0%
unpow20.0%
Simplified70.8%
if -1.80000000000000001e248 < h < -8.7999999999999997e109Initial program 79.0%
Simplified79.0%
associate-*r/82.9%
div-inv82.9%
metadata-eval82.9%
Applied egg-rr82.9%
div-inv79.4%
associate-*l*79.4%
Applied egg-rr79.4%
associate-*r/82.9%
*-rgt-identity82.9%
associate-*l/86.1%
associate-/r/79.0%
Simplified79.0%
associate-/r/86.1%
Applied egg-rr86.1%
if -8.7999999999999997e109 < h < -1.999999999999994e-310Initial program 75.1%
Simplified75.1%
expm1-log1p-u43.3%
expm1-udef35.9%
Applied egg-rr30.0%
expm1-def36.3%
expm1-log1p63.0%
rem-log-exp57.6%
exp-sum57.6%
log-prod57.6%
rem-log-exp57.6%
*-commutative57.6%
log1p-expm157.6%
log1p-def57.6%
Simplified63.0%
Taylor expanded in d around -inf 85.2%
associate-*r*85.2%
mul-1-neg85.2%
associate-/r*85.2%
Simplified85.2%
if -1.999999999999994e-310 < h Initial program 67.1%
Simplified66.3%
associate-*r/66.6%
div-inv66.6%
metadata-eval66.6%
Applied egg-rr66.6%
sqrt-div79.6%
Applied egg-rr79.1%
Final simplification81.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* M (* 0.5 (/ D d))) 2.0))
(t_1
(* (* (sqrt (/ d l)) (sqrt (/ d h))) (- 1.0 (* 0.5 (* h (/ t_0 l))))))
(t_2
(* (* d (sqrt (/ (/ 1.0 l) h))) (- -1.0 (* -0.5 (* (/ h l) t_0))))))
(if (<= d -1.5e+82)
t_2
(if (<= d -2.3e-93)
t_1
(if (<= d 3.45e-305)
t_2
(if (<= d 4.5e-174)
(+
(* (/ (sqrt h) (pow l 1.5)) (* (/ -0.125 d) (pow (* M D) 2.0)))
(/ d (sqrt (* h l))))
t_1))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((M * (0.5 * (D / d))), 2.0);
double t_1 = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (0.5 * (h * (t_0 / l))));
double t_2 = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_0)));
double tmp;
if (d <= -1.5e+82) {
tmp = t_2;
} else if (d <= -2.3e-93) {
tmp = t_1;
} else if (d <= 3.45e-305) {
tmp = t_2;
} else if (d <= 4.5e-174) {
tmp = ((sqrt(h) / pow(l, 1.5)) * ((-0.125 / d) * pow((M * D), 2.0))) + (d / sqrt((h * l)));
} else {
tmp = t_1;
}
return tmp;
}
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 = (m * (0.5d0 * (d_1 / d))) ** 2.0d0
t_1 = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (0.5d0 * (h * (t_0 / l))))
t_2 = (d * sqrt(((1.0d0 / l) / h))) * ((-1.0d0) - ((-0.5d0) * ((h / l) * t_0)))
if (d <= (-1.5d+82)) then
tmp = t_2
else if (d <= (-2.3d-93)) then
tmp = t_1
else if (d <= 3.45d-305) then
tmp = t_2
else if (d <= 4.5d-174) then
tmp = ((sqrt(h) / (l ** 1.5d0)) * (((-0.125d0) / d) * ((m * d_1) ** 2.0d0))) + (d / sqrt((h * l)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.pow((M * (0.5 * (D / d))), 2.0);
double t_1 = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (0.5 * (h * (t_0 / l))));
double t_2 = (d * Math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_0)));
double tmp;
if (d <= -1.5e+82) {
tmp = t_2;
} else if (d <= -2.3e-93) {
tmp = t_1;
} else if (d <= 3.45e-305) {
tmp = t_2;
} else if (d <= 4.5e-174) {
tmp = ((Math.sqrt(h) / Math.pow(l, 1.5)) * ((-0.125 / d) * Math.pow((M * D), 2.0))) + (d / Math.sqrt((h * l)));
} else {
tmp = t_1;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((M * (0.5 * (D / d))), 2.0) t_1 = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (0.5 * (h * (t_0 / l)))) t_2 = (d * math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_0))) tmp = 0 if d <= -1.5e+82: tmp = t_2 elif d <= -2.3e-93: tmp = t_1 elif d <= 3.45e-305: tmp = t_2 elif d <= 4.5e-174: tmp = ((math.sqrt(h) / math.pow(l, 1.5)) * ((-0.125 / d) * math.pow((M * D), 2.0))) + (d / math.sqrt((h * l))) else: tmp = t_1 return tmp
function code(d, h, l, M, D) t_0 = Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0 t_1 = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(h * Float64(t_0 / l))))) t_2 = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * t_0)))) tmp = 0.0 if (d <= -1.5e+82) tmp = t_2; elseif (d <= -2.3e-93) tmp = t_1; elseif (d <= 3.45e-305) tmp = t_2; elseif (d <= 4.5e-174) tmp = Float64(Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(Float64(-0.125 / d) * (Float64(M * D) ^ 2.0))) + Float64(d / sqrt(Float64(h * l)))); else tmp = t_1; end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (M * (0.5 * (D / d))) ^ 2.0; t_1 = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (0.5 * (h * (t_0 / l)))); t_2 = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_0))); tmp = 0.0; if (d <= -1.5e+82) tmp = t_2; elseif (d <= -2.3e-93) tmp = t_1; elseif (d <= 3.45e-305) tmp = t_2; elseif (d <= 4.5e-174) tmp = ((sqrt(h) / (l ^ 1.5)) * ((-0.125 / d) * ((M * D) ^ 2.0))) + (d / sqrt((h * l))); else tmp = t_1; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(h * N[(t$95$0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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[(N[(h / l), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.5e+82], t$95$2, If[LessEqual[d, -2.3e-93], t$95$1, If[LessEqual[d, 3.45e-305], t$95$2, If[LessEqual[d, 4.5e-174], N[(N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(N[(-0.125 / d), $MachinePrecision] * N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\\
t_1 := \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{t_0}{\ell}\right)\right)\\
t_2 := \left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot t_0\right)\right)\\
\mathbf{if}\;d \leq -1.5 \cdot 10^{+82}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;d \leq -2.3 \cdot 10^{-93}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d \leq 3.45 \cdot 10^{-305}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;d \leq 4.5 \cdot 10^{-174}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(\frac{-0.125}{d} \cdot {\left(M \cdot D\right)}^{2}\right) + \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if d < -1.49999999999999995e82 or -2.2999999999999998e-93 < d < 3.4499999999999999e-305Initial program 71.9%
Simplified71.9%
expm1-log1p-u40.7%
expm1-udef36.4%
Applied egg-rr30.5%
expm1-def32.7%
expm1-log1p58.8%
rem-log-exp54.4%
exp-sum54.4%
log-prod54.4%
rem-log-exp54.4%
*-commutative54.4%
log1p-expm154.4%
log1p-def54.4%
Simplified58.8%
Taylor expanded in d around -inf 78.5%
associate-*r*78.5%
mul-1-neg78.5%
associate-/r*78.5%
Simplified78.5%
if -1.49999999999999995e82 < d < -2.2999999999999998e-93 or 4.49999999999999964e-174 < d Initial program 76.9%
Simplified76.2%
associate-*r/78.6%
div-inv78.6%
metadata-eval78.6%
Applied egg-rr78.6%
div-inv77.9%
associate-*l*77.9%
Applied egg-rr77.9%
associate-*r/78.6%
*-rgt-identity78.6%
associate-*l/80.1%
associate-/r/76.7%
Simplified76.7%
associate-/r/80.1%
Applied egg-rr80.1%
if 3.4499999999999999e-305 < d < 4.49999999999999964e-174Initial program 28.5%
Simplified28.2%
Taylor expanded in d around -inf 0.0%
+-commutative0.0%
associate-*r*0.0%
*-commutative0.0%
fma-def0.0%
Simplified66.5%
sqrt-div50.8%
Applied egg-rr66.4%
sqr-pow50.8%
rem-sqrt-square57.6%
sqr-pow57.6%
fabs-sqr57.6%
sqr-pow57.6%
metadata-eval57.6%
Simplified73.1%
fma-udef73.1%
associate-/r/73.2%
pow273.2%
*-commutative73.2%
sqrt-div73.2%
metadata-eval73.2%
div-inv73.2%
Applied egg-rr73.2%
Final simplification78.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* M (* 0.5 (/ D d))) 2.0))
(t_1
(* (* (sqrt (/ d l)) (sqrt (/ d h))) (- 1.0 (* 0.5 (* h (/ t_0 l))))))
(t_2 (pow (* M D) 2.0)))
(if (<= d -2.4e+86)
(* (* d (sqrt (/ (/ 1.0 l) h))) (- -1.0 (* -0.5 (* (/ h l) t_0))))
(if (<= d -1.7e-101)
t_1
(if (<= d -5e-310)
(-
(* (/ t_2 d) (* (sqrt (/ h (pow l 3.0))) 0.125))
(* d (sqrt (/ 1.0 (* h l)))))
(if (<= d 2.9e-173)
(+
(* (/ (sqrt h) (pow l 1.5)) (* (/ -0.125 d) t_2))
(/ d (sqrt (* h l))))
t_1))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((M * (0.5 * (D / d))), 2.0);
double t_1 = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (0.5 * (h * (t_0 / l))));
double t_2 = pow((M * D), 2.0);
double tmp;
if (d <= -2.4e+86) {
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_0)));
} else if (d <= -1.7e-101) {
tmp = t_1;
} else if (d <= -5e-310) {
tmp = ((t_2 / d) * (sqrt((h / pow(l, 3.0))) * 0.125)) - (d * sqrt((1.0 / (h * l))));
} else if (d <= 2.9e-173) {
tmp = ((sqrt(h) / pow(l, 1.5)) * ((-0.125 / d) * t_2)) + (d / sqrt((h * l)));
} else {
tmp = t_1;
}
return tmp;
}
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 = (m * (0.5d0 * (d_1 / d))) ** 2.0d0
t_1 = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (0.5d0 * (h * (t_0 / l))))
t_2 = (m * d_1) ** 2.0d0
if (d <= (-2.4d+86)) then
tmp = (d * sqrt(((1.0d0 / l) / h))) * ((-1.0d0) - ((-0.5d0) * ((h / l) * t_0)))
else if (d <= (-1.7d-101)) then
tmp = t_1
else if (d <= (-5d-310)) then
tmp = ((t_2 / d) * (sqrt((h / (l ** 3.0d0))) * 0.125d0)) - (d * sqrt((1.0d0 / (h * l))))
else if (d <= 2.9d-173) then
tmp = ((sqrt(h) / (l ** 1.5d0)) * (((-0.125d0) / d) * t_2)) + (d / sqrt((h * l)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.pow((M * (0.5 * (D / d))), 2.0);
double t_1 = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (0.5 * (h * (t_0 / l))));
double t_2 = Math.pow((M * D), 2.0);
double tmp;
if (d <= -2.4e+86) {
tmp = (d * Math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_0)));
} else if (d <= -1.7e-101) {
tmp = t_1;
} else if (d <= -5e-310) {
tmp = ((t_2 / d) * (Math.sqrt((h / Math.pow(l, 3.0))) * 0.125)) - (d * Math.sqrt((1.0 / (h * l))));
} else if (d <= 2.9e-173) {
tmp = ((Math.sqrt(h) / Math.pow(l, 1.5)) * ((-0.125 / d) * t_2)) + (d / Math.sqrt((h * l)));
} else {
tmp = t_1;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((M * (0.5 * (D / d))), 2.0) t_1 = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (0.5 * (h * (t_0 / l)))) t_2 = math.pow((M * D), 2.0) tmp = 0 if d <= -2.4e+86: tmp = (d * math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_0))) elif d <= -1.7e-101: tmp = t_1 elif d <= -5e-310: tmp = ((t_2 / d) * (math.sqrt((h / math.pow(l, 3.0))) * 0.125)) - (d * math.sqrt((1.0 / (h * l)))) elif d <= 2.9e-173: tmp = ((math.sqrt(h) / math.pow(l, 1.5)) * ((-0.125 / d) * t_2)) + (d / math.sqrt((h * l))) else: tmp = t_1 return tmp
function code(d, h, l, M, D) t_0 = Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0 t_1 = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(h * Float64(t_0 / l))))) t_2 = Float64(M * D) ^ 2.0 tmp = 0.0 if (d <= -2.4e+86) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * t_0)))); elseif (d <= -1.7e-101) tmp = t_1; elseif (d <= -5e-310) tmp = Float64(Float64(Float64(t_2 / d) * Float64(sqrt(Float64(h / (l ^ 3.0))) * 0.125)) - Float64(d * sqrt(Float64(1.0 / Float64(h * l))))); elseif (d <= 2.9e-173) tmp = Float64(Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(Float64(-0.125 / d) * t_2)) + Float64(d / sqrt(Float64(h * l)))); else tmp = t_1; end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (M * (0.5 * (D / d))) ^ 2.0; t_1 = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (0.5 * (h * (t_0 / l)))); t_2 = (M * D) ^ 2.0; tmp = 0.0; if (d <= -2.4e+86) tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_0))); elseif (d <= -1.7e-101) tmp = t_1; elseif (d <= -5e-310) tmp = ((t_2 / d) * (sqrt((h / (l ^ 3.0))) * 0.125)) - (d * sqrt((1.0 / (h * l)))); elseif (d <= 2.9e-173) tmp = ((sqrt(h) / (l ^ 1.5)) * ((-0.125 / d) * t_2)) + (d / sqrt((h * l))); else tmp = t_1; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(h * N[(t$95$0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[d, -2.4e+86], N[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.7e-101], t$95$1, If[LessEqual[d, -5e-310], N[(N[(N[(t$95$2 / d), $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] - N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.9e-173], N[(N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(N[(-0.125 / d), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\\
t_1 := \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{t_0}{\ell}\right)\right)\\
t_2 := {\left(M \cdot D\right)}^{2}\\
\mathbf{if}\;d \leq -2.4 \cdot 10^{+86}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot t_0\right)\right)\\
\mathbf{elif}\;d \leq -1.7 \cdot 10^{-101}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{t_2}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) - d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;d \leq 2.9 \cdot 10^{-173}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(\frac{-0.125}{d} \cdot t_2\right) + \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if d < -2.4e86Initial program 78.5%
Simplified78.5%
expm1-log1p-u56.1%
expm1-udef56.0%
Applied egg-rr45.5%
expm1-def45.5%
expm1-log1p67.2%
rem-log-exp65.3%
exp-sum65.3%
log-prod65.3%
rem-log-exp65.3%
*-commutative65.3%
log1p-expm165.3%
log1p-def65.3%
Simplified67.2%
Taylor expanded in d around -inf 88.0%
associate-*r*88.0%
mul-1-neg88.0%
associate-/r*88.0%
Simplified88.0%
if -2.4e86 < d < -1.69999999999999995e-101 or 2.8999999999999998e-173 < d Initial program 77.4%
Simplified76.7%
associate-*r/79.1%
div-inv79.1%
metadata-eval79.1%
Applied egg-rr79.1%
div-inv78.3%
associate-*l*78.3%
Applied egg-rr78.3%
associate-*r/79.1%
*-rgt-identity79.1%
associate-*l/80.5%
associate-/r/77.2%
Simplified77.2%
associate-/r/80.5%
Applied egg-rr80.5%
if -1.69999999999999995e-101 < d < -4.999999999999985e-310Initial program 57.8%
Simplified57.8%
expm1-log1p-u21.2%
expm1-udef12.8%
Applied egg-rr12.8%
expm1-def15.6%
expm1-log1p43.2%
rem-log-exp37.4%
exp-sum37.4%
log-prod37.4%
rem-log-exp37.4%
*-commutative37.4%
log1p-expm137.4%
log1p-def37.4%
Simplified43.2%
Taylor expanded in d around -inf 65.2%
mul-1-neg65.2%
distribute-rgt-neg-in65.2%
cancel-sign-sub65.2%
mul-1-neg65.2%
rem-square-sqrt0.0%
unpow20.0%
Simplified68.2%
if -4.999999999999985e-310 < d < 2.8999999999999998e-173Initial program 33.1%
Simplified32.8%
Taylor expanded in d around -inf 0.0%
+-commutative0.0%
associate-*r*0.0%
*-commutative0.0%
fma-def0.0%
Simplified62.2%
sqrt-div50.7%
Applied egg-rr62.2%
sqr-pow50.7%
rem-sqrt-square57.1%
sqr-pow57.1%
fabs-sqr57.1%
sqr-pow57.1%
metadata-eval57.1%
Simplified68.4%
fma-udef68.4%
associate-/r/68.5%
pow268.5%
*-commutative68.5%
sqrt-div68.5%
metadata-eval68.5%
div-inv68.5%
Applied egg-rr68.5%
Final simplification78.9%
(FPCore (d h l M D)
:precision binary64
(if (<= d 1.95e-306)
(*
(* d (sqrt (/ (/ 1.0 l) h)))
(- -1.0 (* -0.5 (* (/ h l) (pow (* M (* 0.5 (/ D d))) 2.0)))))
(if (<= d 5e-170)
(* -0.125 (/ (pow (* M D) 2.0) (/ d (/ (sqrt h) (pow l 1.5)))))
(if (<= d 1.3e+194)
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(+ 1.0 (* (* -0.5 (/ h l)) (* 0.25 (pow (* M (/ D d)) 2.0))))))
(/ d (sqrt (* h l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 1.95e-306) {
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * pow((M * (0.5 * (D / d))), 2.0))));
} else if (d <= 5e-170) {
tmp = -0.125 * (pow((M * D), 2.0) / (d / (sqrt(h) / pow(l, 1.5))));
} else if (d <= 1.3e+194) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((-0.5 * (h / l)) * (0.25 * pow((M * (D / d)), 2.0)))));
} else {
tmp = d / sqrt((h * l));
}
return tmp;
}
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.95d-306) then
tmp = (d * sqrt(((1.0d0 / l) / h))) * ((-1.0d0) - ((-0.5d0) * ((h / l) * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0))))
else if (d <= 5d-170) then
tmp = (-0.125d0) * (((m * d_1) ** 2.0d0) / (d / (sqrt(h) / (l ** 1.5d0))))
else if (d <= 1.3d+194) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + (((-0.5d0) * (h / l)) * (0.25d0 * ((m * (d_1 / d)) ** 2.0d0)))))
else
tmp = d / sqrt((h * l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 1.95e-306) {
tmp = (d * Math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * Math.pow((M * (0.5 * (D / d))), 2.0))));
} else if (d <= 5e-170) {
tmp = -0.125 * (Math.pow((M * D), 2.0) / (d / (Math.sqrt(h) / Math.pow(l, 1.5))));
} else if (d <= 1.3e+194) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + ((-0.5 * (h / l)) * (0.25 * Math.pow((M * (D / d)), 2.0)))));
} else {
tmp = d / Math.sqrt((h * l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 1.95e-306: tmp = (d * math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * math.pow((M * (0.5 * (D / d))), 2.0)))) elif d <= 5e-170: tmp = -0.125 * (math.pow((M * D), 2.0) / (d / (math.sqrt(h) / math.pow(l, 1.5)))) elif d <= 1.3e+194: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + ((-0.5 * (h / l)) * (0.25 * math.pow((M * (D / d)), 2.0))))) else: tmp = d / math.sqrt((h * l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 1.95e-306) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0))))); elseif (d <= 5e-170) tmp = Float64(-0.125 * Float64((Float64(M * D) ^ 2.0) / Float64(d / Float64(sqrt(h) / (l ^ 1.5))))); elseif (d <= 1.3e+194) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(-0.5 * Float64(h / l)) * Float64(0.25 * (Float64(M * Float64(D / d)) ^ 2.0)))))); else tmp = Float64(d / sqrt(Float64(h * l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= 1.95e-306) tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * ((M * (0.5 * (D / d))) ^ 2.0)))); elseif (d <= 5e-170) tmp = -0.125 * (((M * D) ^ 2.0) / (d / (sqrt(h) / (l ^ 1.5)))); elseif (d <= 1.3e+194) tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((-0.5 * (h / l)) * (0.25 * ((M * (D / d)) ^ 2.0))))); else tmp = d / sqrt((h * l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 1.95e-306], N[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5e-170], N[(-0.125 * N[(N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision] / N[(d / N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.3e+194], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[(0.25 * N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.95 \cdot 10^{-306}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)\right)\\
\mathbf{elif}\;d \leq 5 \cdot 10^{-170}:\\
\;\;\;\;-0.125 \cdot \frac{{\left(M \cdot D\right)}^{2}}{\frac{d}{\frac{\sqrt{h}}{{\ell}^{1.5}}}}\\
\mathbf{elif}\;d \leq 1.3 \cdot 10^{+194}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot \left(0.25 \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if d < 1.95e-306Initial program 72.7%
Simplified72.7%
expm1-log1p-u40.3%
expm1-udef32.3%
Applied egg-rr27.6%
expm1-def34.2%
expm1-log1p62.1%
rem-log-exp57.0%
exp-sum57.0%
log-prod57.0%
rem-log-exp57.0%
*-commutative57.0%
log1p-expm157.0%
log1p-def57.0%
Simplified62.1%
Taylor expanded in d around -inf 76.5%
associate-*r*76.5%
mul-1-neg76.5%
associate-/r*76.5%
Simplified76.5%
if 1.95e-306 < d < 5.0000000000000001e-170Initial program 29.9%
Simplified29.6%
associate-*r/26.8%
div-inv26.8%
metadata-eval26.8%
Applied egg-rr26.8%
pow1/226.8%
sqr-pow26.8%
pow226.8%
metadata-eval26.8%
Applied egg-rr26.8%
Taylor expanded in d around 0 46.1%
associate-*l/49.0%
associate-/l*47.2%
*-commutative47.2%
unpow247.2%
unpow247.2%
swap-sqr50.9%
unpow250.9%
*-commutative50.9%
Simplified50.9%
sqrt-div50.8%
Applied egg-rr50.8%
sqr-pow50.8%
rem-sqrt-square57.2%
sqr-pow57.2%
fabs-sqr57.2%
sqr-pow57.2%
metadata-eval57.2%
Simplified57.2%
if 5.0000000000000001e-170 < d < 1.2999999999999999e194Initial program 83.8%
Simplified82.5%
fma-udef82.5%
unpow-prod-down82.5%
metadata-eval82.5%
div-inv82.5%
clear-num82.5%
Applied egg-rr82.5%
if 1.2999999999999999e194 < d Initial program 63.4%
Simplified63.4%
Taylor expanded in d around inf 80.5%
pow180.5%
*-commutative80.5%
sqrt-div80.5%
metadata-eval80.5%
*-commutative80.5%
Applied egg-rr80.5%
unpow180.5%
associate-*r/80.7%
*-rgt-identity80.7%
Simplified80.7%
Final simplification76.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* M (* 0.5 (/ D d))) 2.0)))
(if (or (<= h -4.9e+110) (not (<= h -4e-308)))
(* (* (sqrt (/ d l)) (sqrt (/ d h))) (- 1.0 (* 0.5 (* h (/ t_0 l)))))
(* (* d (sqrt (/ (/ 1.0 l) h))) (- -1.0 (* -0.5 (* (/ h l) t_0)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((M * (0.5 * (D / d))), 2.0);
double tmp;
if ((h <= -4.9e+110) || !(h <= -4e-308)) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (0.5 * (h * (t_0 / l))));
} else {
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_0)));
}
return tmp;
}
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 = (m * (0.5d0 * (d_1 / d))) ** 2.0d0
if ((h <= (-4.9d+110)) .or. (.not. (h <= (-4d-308)))) then
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (0.5d0 * (h * (t_0 / l))))
else
tmp = (d * sqrt(((1.0d0 / l) / h))) * ((-1.0d0) - ((-0.5d0) * ((h / l) * t_0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.pow((M * (0.5 * (D / d))), 2.0);
double tmp;
if ((h <= -4.9e+110) || !(h <= -4e-308)) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (0.5 * (h * (t_0 / l))));
} else {
tmp = (d * Math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_0)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((M * (0.5 * (D / d))), 2.0) tmp = 0 if (h <= -4.9e+110) or not (h <= -4e-308): tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (0.5 * (h * (t_0 / l)))) else: tmp = (d * math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_0))) return tmp
function code(d, h, l, M, D) t_0 = Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0 tmp = 0.0 if ((h <= -4.9e+110) || !(h <= -4e-308)) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(h * Float64(t_0 / l))))); else tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * t_0)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (M * (0.5 * (D / d))) ^ 2.0; tmp = 0.0; if ((h <= -4.9e+110) || ~((h <= -4e-308))) tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (0.5 * (h * (t_0 / l)))); else tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_0))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, If[Or[LessEqual[h, -4.9e+110], N[Not[LessEqual[h, -4e-308]], $MachinePrecision]], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(h * N[(t$95$0 / l), $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[(N[(h / l), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\\
\mathbf{if}\;h \leq -4.9 \cdot 10^{+110} \lor \neg \left(h \leq -4 \cdot 10^{-308}\right):\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{t_0}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot t_0\right)\right)\\
\end{array}
\end{array}
if h < -4.90000000000000002e110 or -4.00000000000000013e-308 < h Initial program 67.0%
Simplified66.4%
associate-*r/67.2%
div-inv67.2%
metadata-eval67.2%
Applied egg-rr67.2%
div-inv66.6%
associate-*l*66.6%
Applied egg-rr66.6%
associate-*r/67.2%
*-rgt-identity67.2%
associate-*l/69.6%
associate-/r/66.8%
Simplified66.8%
associate-/r/69.6%
Applied egg-rr69.6%
if -4.90000000000000002e110 < h < -4.00000000000000013e-308Initial program 75.1%
Simplified75.1%
expm1-log1p-u43.3%
expm1-udef35.9%
Applied egg-rr30.0%
expm1-def36.3%
expm1-log1p63.0%
rem-log-exp57.6%
exp-sum57.6%
log-prod57.6%
rem-log-exp57.6%
*-commutative57.6%
log1p-expm157.6%
log1p-def57.6%
Simplified63.0%
Taylor expanded in d around -inf 85.2%
associate-*r*85.2%
mul-1-neg85.2%
associate-/r*85.2%
Simplified85.2%
Final simplification74.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* M (* 0.5 (/ D d))) 2.0)))
(if (<= l -1.3e-233)
(* (* d (sqrt (/ 1.0 (* h l)))) (- -1.0 (* -0.5 (* (/ h l) t_0))))
(if (<= l 9.2e+69)
(* (sqrt (* (/ d l) (/ d h))) (+ 1.0 (* -0.5 (* h (/ t_0 l)))))
(* d (* (pow h -0.5) (pow l -0.5)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((M * (0.5 * (D / d))), 2.0);
double tmp;
if (l <= -1.3e-233) {
tmp = (d * sqrt((1.0 / (h * l)))) * (-1.0 - (-0.5 * ((h / l) * t_0)));
} else if (l <= 9.2e+69) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (t_0 / l))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
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 = (m * (0.5d0 * (d_1 / d))) ** 2.0d0
if (l <= (-1.3d-233)) then
tmp = (d * sqrt((1.0d0 / (h * l)))) * ((-1.0d0) - ((-0.5d0) * ((h / l) * t_0)))
else if (l <= 9.2d+69) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + ((-0.5d0) * (h * (t_0 / l))))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.pow((M * (0.5 * (D / d))), 2.0);
double tmp;
if (l <= -1.3e-233) {
tmp = (d * Math.sqrt((1.0 / (h * l)))) * (-1.0 - (-0.5 * ((h / l) * t_0)));
} else if (l <= 9.2e+69) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (t_0 / l))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((M * (0.5 * (D / d))), 2.0) tmp = 0 if l <= -1.3e-233: tmp = (d * math.sqrt((1.0 / (h * l)))) * (-1.0 - (-0.5 * ((h / l) * t_0))) elif l <= 9.2e+69: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (t_0 / l)))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0 tmp = 0.0 if (l <= -1.3e-233) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * t_0)))); elseif (l <= 9.2e+69) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(-0.5 * Float64(h * Float64(t_0 / l))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (M * (0.5 * (D / d))) ^ 2.0; tmp = 0.0; if (l <= -1.3e-233) tmp = (d * sqrt((1.0 / (h * l)))) * (-1.0 - (-0.5 * ((h / l) * t_0))); elseif (l <= 9.2e+69) tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (t_0 / l)))); else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[l, -1.3e-233], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 9.2e+69], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(h * N[(t$95$0 / l), $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}
\\
\begin{array}{l}
t_0 := {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\\
\mathbf{if}\;\ell \leq -1.3 \cdot 10^{-233}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot t_0\right)\right)\\
\mathbf{elif}\;\ell \leq 9.2 \cdot 10^{+69}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \left(h \cdot \frac{t_0}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1.2999999999999999e-233Initial program 71.7%
Simplified71.7%
expm1-log1p-u42.2%
expm1-udef33.9%
Applied egg-rr28.5%
expm1-def35.2%
expm1-log1p59.7%
rem-log-exp54.7%
exp-sum54.7%
log-prod54.7%
rem-log-exp54.7%
*-commutative54.7%
log1p-expm154.7%
log1p-def54.7%
Simplified59.7%
Taylor expanded in d around -inf 77.8%
mul-1-neg77.8%
distribute-rgt-neg-in77.8%
*-commutative77.8%
Simplified77.8%
if -1.2999999999999999e-233 < l < 9.20000000000000067e69Initial program 71.9%
Simplified70.8%
associate-*r/77.4%
div-inv77.4%
metadata-eval77.4%
Applied egg-rr77.4%
pow177.4%
sqrt-unprod70.5%
cancel-sign-sub-inv70.5%
metadata-eval70.5%
associate-/l*64.8%
associate-*l*64.8%
Applied egg-rr64.8%
Simplified69.5%
if 9.20000000000000067e69 < l Initial program 61.1%
Simplified60.9%
Taylor expanded in d around inf 58.2%
pow1/258.2%
*-commutative58.2%
Applied egg-rr58.2%
unpow1/258.2%
unpow-158.2%
sqr-pow58.2%
rem-sqrt-square58.2%
metadata-eval58.2%
sqr-pow58.0%
fabs-sqr58.0%
sqr-pow58.2%
Simplified58.2%
unpow-prod-down65.7%
Applied egg-rr65.7%
Final simplification72.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* M (* 0.5 (/ D d))) 2.0)))
(if (<= l -3.8e-235)
(* (* d (sqrt (/ (/ 1.0 l) h))) (- -1.0 (* -0.5 (* (/ h l) t_0))))
(if (<= l 8.4e+68)
(* (sqrt (* (/ d l) (/ d h))) (+ 1.0 (* -0.5 (* h (/ t_0 l)))))
(* d (* (pow h -0.5) (pow l -0.5)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((M * (0.5 * (D / d))), 2.0);
double tmp;
if (l <= -3.8e-235) {
tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_0)));
} else if (l <= 8.4e+68) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (t_0 / l))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
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 = (m * (0.5d0 * (d_1 / d))) ** 2.0d0
if (l <= (-3.8d-235)) then
tmp = (d * sqrt(((1.0d0 / l) / h))) * ((-1.0d0) - ((-0.5d0) * ((h / l) * t_0)))
else if (l <= 8.4d+68) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + ((-0.5d0) * (h * (t_0 / l))))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.pow((M * (0.5 * (D / d))), 2.0);
double tmp;
if (l <= -3.8e-235) {
tmp = (d * Math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_0)));
} else if (l <= 8.4e+68) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (t_0 / l))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((M * (0.5 * (D / d))), 2.0) tmp = 0 if l <= -3.8e-235: tmp = (d * math.sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_0))) elif l <= 8.4e+68: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (t_0 / l)))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0 tmp = 0.0 if (l <= -3.8e-235) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * t_0)))); elseif (l <= 8.4e+68) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(-0.5 * Float64(h * Float64(t_0 / l))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (M * (0.5 * (D / d))) ^ 2.0; tmp = 0.0; if (l <= -3.8e-235) tmp = (d * sqrt(((1.0 / l) / h))) * (-1.0 - (-0.5 * ((h / l) * t_0))); elseif (l <= 8.4e+68) tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (t_0 / l)))); else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[l, -3.8e-235], N[(N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 8.4e+68], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(h * N[(t$95$0 / l), $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}
\\
\begin{array}{l}
t_0 := {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\\
\mathbf{if}\;\ell \leq -3.8 \cdot 10^{-235}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot t_0\right)\right)\\
\mathbf{elif}\;\ell \leq 8.4 \cdot 10^{+68}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \left(h \cdot \frac{t_0}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -3.80000000000000026e-235Initial program 71.7%
Simplified71.7%
expm1-log1p-u42.2%
expm1-udef33.9%
Applied egg-rr28.5%
expm1-def35.2%
expm1-log1p59.7%
rem-log-exp54.7%
exp-sum54.7%
log-prod54.7%
rem-log-exp54.7%
*-commutative54.7%
log1p-expm154.7%
log1p-def54.7%
Simplified59.7%
Taylor expanded in d around -inf 77.8%
associate-*r*77.8%
mul-1-neg77.8%
associate-/r*77.8%
Simplified77.8%
if -3.80000000000000026e-235 < l < 8.40000000000000003e68Initial program 71.9%
Simplified70.8%
associate-*r/77.4%
div-inv77.4%
metadata-eval77.4%
Applied egg-rr77.4%
pow177.4%
sqrt-unprod70.5%
cancel-sign-sub-inv70.5%
metadata-eval70.5%
associate-/l*64.8%
associate-*l*64.8%
Applied egg-rr64.8%
Simplified69.5%
if 8.40000000000000003e68 < l Initial program 61.1%
Simplified60.9%
Taylor expanded in d around inf 58.2%
pow1/258.2%
*-commutative58.2%
Applied egg-rr58.2%
unpow1/258.2%
unpow-158.2%
sqr-pow58.2%
rem-sqrt-square58.2%
metadata-eval58.2%
sqr-pow58.0%
fabs-sqr58.0%
sqr-pow58.2%
Simplified58.2%
unpow-prod-down65.7%
Applied egg-rr65.7%
Final simplification72.4%
(FPCore (d h l M D)
:precision binary64
(if (<= D 1.45e-8)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(*
(+ 1.0 (* -0.5 (* (/ h l) (pow (* M (* 0.5 (/ D d))) 2.0))))
(sqrt (* (/ d l) (/ d h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 1.45e-8) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = (1.0 + (-0.5 * ((h / l) * pow((M * (0.5 * (D / d))), 2.0)))) * sqrt(((d / l) * (d / h)));
}
return tmp;
}
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 <= 1.45d-8) then
tmp = sqrt((d / l)) * sqrt((d / h))
else
tmp = (1.0d0 + ((-0.5d0) * ((h / l) * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0)))) * sqrt(((d / l) * (d / h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 1.45e-8) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = (1.0 + (-0.5 * ((h / l) * Math.pow((M * (0.5 * (D / d))), 2.0)))) * Math.sqrt(((d / l) * (d / h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if D <= 1.45e-8: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) else: tmp = (1.0 + (-0.5 * ((h / l) * math.pow((M * (0.5 * (D / d))), 2.0)))) * math.sqrt(((d / l) * (d / h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (D <= 1.45e-8) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); else tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0)))) * sqrt(Float64(Float64(d / l) * Float64(d / h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (D <= 1.45e-8) tmp = sqrt((d / l)) * sqrt((d / h)); else tmp = (1.0 + (-0.5 * ((h / l) * ((M * (0.5 * (D / d))) ^ 2.0)))) * sqrt(((d / l) * (d / h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[D, 1.45e-8], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \leq 1.45 \cdot 10^{-8}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\end{array}
\end{array}
if D < 1.4500000000000001e-8Initial program 68.3%
Simplified67.7%
Taylor expanded in M around 0 46.1%
if 1.4500000000000001e-8 < D Initial program 73.8%
Simplified73.8%
expm1-log1p-u27.9%
expm1-udef16.7%
Applied egg-rr15.4%
expm1-def22.6%
expm1-log1p63.9%
rem-log-exp55.4%
exp-sum55.4%
log-prod55.4%
rem-log-exp55.4%
*-commutative55.4%
log1p-expm155.4%
log1p-def55.4%
Simplified63.9%
Final simplification50.8%
(FPCore (d h l M D)
:precision binary64
(if (<= D 1.42e-8)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* -0.5 (/ (pow (* M (* 0.5 (/ D d))) 2.0) (/ l h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 1.42e-8) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (pow((M * (0.5 * (D / d))), 2.0) / (l / h))));
}
return tmp;
}
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 <= 1.42d-8) then
tmp = sqrt((d / l)) * sqrt((d / h))
else
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + ((-0.5d0) * (((m * (0.5d0 * (d_1 / d))) ** 2.0d0) / (l / h))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 1.42e-8) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (Math.pow((M * (0.5 * (D / d))), 2.0) / (l / h))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if D <= 1.42e-8: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) else: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (math.pow((M * (0.5 * (D / d))), 2.0) / (l / h)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (D <= 1.42e-8) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); else tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(-0.5 * Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) / Float64(l / h))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (D <= 1.42e-8) tmp = sqrt((d / l)) * sqrt((d / h)); else tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (((M * (0.5 * (D / d))) ^ 2.0) / (l / h)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[D, 1.42e-8], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \leq 1.42 \cdot 10^{-8}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\frac{\ell}{h}}\right)\\
\end{array}
\end{array}
if D < 1.41999999999999998e-8Initial program 68.3%
Simplified67.7%
Taylor expanded in M around 0 46.1%
if 1.41999999999999998e-8 < D Initial program 73.8%
Simplified73.8%
expm1-log1p-u27.9%
expm1-udef16.7%
Applied egg-rr15.4%
expm1-def22.6%
expm1-log1p63.9%
rem-log-exp55.4%
exp-sum55.4%
log-prod55.4%
rem-log-exp55.4%
*-commutative55.4%
log1p-expm155.4%
log1p-def55.4%
Simplified63.9%
associate-*l/62.6%
associate-*r*62.6%
*-commutative62.6%
associate-/l*63.9%
associate-*r*63.9%
Applied egg-rr63.9%
Final simplification50.8%
(FPCore (d h l M D)
:precision binary64
(if (<= l 2.6e+70)
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* -0.5 (* h (/ (pow (* M (* 0.5 (/ D d))) 2.0) l)))))
(* d (* (pow h -0.5) (pow l -0.5)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 2.6e+70) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (pow((M * (0.5 * (D / d))), 2.0) / l))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
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.6d+70) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + ((-0.5d0) * (h * (((m * (0.5d0 * (d_1 / d))) ** 2.0d0) / l))))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 2.6e+70) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (Math.pow((M * (0.5 * (D / d))), 2.0) / l))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 2.6e+70: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (math.pow((M * (0.5 * (D / d))), 2.0) / l)))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 2.6e+70) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(-0.5 * Float64(h * Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) / l))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 2.6e+70) tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (((M * (0.5 * (D / d))) ^ 2.0) / l)))); else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 2.6e+70], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(h * N[(N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $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}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.6 \cdot 10^{+70}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \left(h \cdot \frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < 2.6e70Initial program 71.8%
Simplified71.3%
associate-*r/73.9%
div-inv73.9%
metadata-eval73.9%
Applied egg-rr73.9%
pow173.9%
sqrt-unprod64.4%
cancel-sign-sub-inv64.4%
metadata-eval64.4%
associate-/l*62.1%
associate-*l*62.1%
Applied egg-rr62.1%
Simplified63.9%
if 2.6e70 < l Initial program 61.1%
Simplified60.9%
Taylor expanded in d around inf 58.2%
pow1/258.2%
*-commutative58.2%
Applied egg-rr58.2%
unpow1/258.2%
unpow-158.2%
sqr-pow58.2%
rem-sqrt-square58.2%
metadata-eval58.2%
sqr-pow58.0%
fabs-sqr58.0%
sqr-pow58.2%
Simplified58.2%
unpow-prod-down65.7%
Applied egg-rr65.7%
Final simplification64.2%
(FPCore (d h l M D)
:precision binary64
(if (<= M 3.7e-99)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (<= M 1.05e+199)
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* -0.5 (* 0.25 (* (/ (* D D) l) (/ (* h (* M M)) (* d d)))))))
(* -0.125 (* (sqrt (/ h (pow l 3.0))) (/ (* D D) (/ d (* M M))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 3.7e-99) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if (M <= 1.05e+199) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d))))));
} else {
tmp = -0.125 * (sqrt((h / pow(l, 3.0))) * ((D * D) / (d / (M * M))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 3.7d-99) then
tmp = sqrt((d / l)) * sqrt((d / h))
else if (m <= 1.05d+199) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + ((-0.5d0) * (0.25d0 * (((d_1 * d_1) / l) * ((h * (m * m)) / (d * d))))))
else
tmp = (-0.125d0) * (sqrt((h / (l ** 3.0d0))) * ((d_1 * d_1) / (d / (m * m))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 3.7e-99) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else if (M <= 1.05e+199) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d))))));
} else {
tmp = -0.125 * (Math.sqrt((h / Math.pow(l, 3.0))) * ((D * D) / (d / (M * M))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if M <= 3.7e-99: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) elif M <= 1.05e+199: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d)))))) else: tmp = -0.125 * (math.sqrt((h / math.pow(l, 3.0))) * ((D * D) / (d / (M * M)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (M <= 3.7e-99) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif (M <= 1.05e+199) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(-0.5 * Float64(0.25 * Float64(Float64(Float64(D * D) / l) * Float64(Float64(h * Float64(M * M)) / Float64(d * d))))))); else tmp = Float64(-0.125 * Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(Float64(D * D) / Float64(d / Float64(M * M))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (M <= 3.7e-99) tmp = sqrt((d / l)) * sqrt((d / h)); elseif (M <= 1.05e+199) tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d)))))); else tmp = -0.125 * (sqrt((h / (l ^ 3.0))) * ((D * D) / (d / (M * M)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[M, 3.7e-99], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 1.05e+199], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(0.25 * N[(N[(N[(D * D), $MachinePrecision] / l), $MachinePrecision] * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.125 * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * D), $MachinePrecision] / N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 3.7 \cdot 10^{-99}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;M \leq 1.05 \cdot 10^{+199}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \left(0.25 \cdot \left(\frac{D \cdot D}{\ell} \cdot \frac{h \cdot \left(M \cdot M\right)}{d \cdot d}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{D \cdot D}{\frac{d}{M \cdot M}}\right)\\
\end{array}
\end{array}
if M < 3.7e-99Initial program 70.8%
Simplified70.2%
Taylor expanded in M around 0 47.7%
if 3.7e-99 < M < 1.05e199Initial program 64.7%
Simplified64.7%
expm1-log1p-u29.1%
expm1-udef22.1%
Applied egg-rr19.9%
expm1-def25.7%
expm1-log1p53.2%
rem-log-exp49.6%
exp-sum49.6%
log-prod49.6%
rem-log-exp49.6%
*-commutative49.6%
log1p-expm149.6%
log1p-def49.6%
Simplified53.2%
Taylor expanded in h around 0 44.8%
associate-*r/44.8%
*-commutative44.8%
associate-*r/44.8%
*-commutative44.8%
times-frac41.0%
unpow241.0%
*-commutative41.0%
unpow241.0%
unpow241.0%
Simplified41.0%
if 1.05e199 < M Initial program 79.9%
Simplified79.9%
Taylor expanded in d around 0 35.2%
associate-/l*35.2%
unpow235.2%
unpow235.2%
Simplified35.2%
Final simplification44.8%
(FPCore (d h l M D)
:precision binary64
(if (or (<= d -2.5e-255) (and (not (<= d 1.75e-158)) (<= d 1.25e+76)))
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* -0.5 (* 0.25 (* (/ (* D D) l) (/ (* h (* M M)) (* d d)))))))
(/ d (* (sqrt l) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if ((d <= -2.5e-255) || (!(d <= 1.75e-158) && (d <= 1.25e+76))) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d))))));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
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.5d-255)) .or. (.not. (d <= 1.75d-158)) .and. (d <= 1.25d+76)) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + ((-0.5d0) * (0.25d0 * (((d_1 * d_1) / l) * ((h * (m * m)) / (d * d))))))
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if ((d <= -2.5e-255) || (!(d <= 1.75e-158) && (d <= 1.25e+76))) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d))))));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if (d <= -2.5e-255) or (not (d <= 1.75e-158) and (d <= 1.25e+76)): tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d)))))) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if ((d <= -2.5e-255) || (!(d <= 1.75e-158) && (d <= 1.25e+76))) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(-0.5 * Float64(0.25 * Float64(Float64(Float64(D * D) / l) * Float64(Float64(h * Float64(M * M)) / Float64(d * d))))))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if ((d <= -2.5e-255) || (~((d <= 1.75e-158)) && (d <= 1.25e+76))) tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d)))))); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[Or[LessEqual[d, -2.5e-255], And[N[Not[LessEqual[d, 1.75e-158]], $MachinePrecision], LessEqual[d, 1.25e+76]]], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(0.25 * N[(N[(N[(D * D), $MachinePrecision] / l), $MachinePrecision] * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.5 \cdot 10^{-255} \lor \neg \left(d \leq 1.75 \cdot 10^{-158}\right) \land d \leq 1.25 \cdot 10^{+76}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \left(0.25 \cdot \left(\frac{D \cdot D}{\ell} \cdot \frac{h \cdot \left(M \cdot M\right)}{d \cdot d}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < -2.4999999999999998e-255 or 1.75000000000000006e-158 < d < 1.24999999999999998e76Initial program 79.0%
Simplified79.0%
expm1-log1p-u39.7%
expm1-udef29.2%
Applied egg-rr25.5%
expm1-def33.2%
expm1-log1p67.1%
rem-log-exp61.2%
exp-sum61.2%
log-prod61.2%
rem-log-exp61.2%
*-commutative61.2%
log1p-expm161.2%
log1p-def61.2%
Simplified67.1%
Taylor expanded in h around 0 46.3%
associate-*r/46.3%
*-commutative46.3%
associate-*r/46.3%
*-commutative46.3%
times-frac48.2%
unpow248.2%
*-commutative48.2%
unpow248.2%
unpow248.2%
Simplified48.2%
if -2.4999999999999998e-255 < d < 1.75000000000000006e-158 or 1.24999999999999998e76 < d Initial program 54.6%
Simplified53.4%
Taylor expanded in d around inf 49.9%
pow149.9%
*-commutative49.9%
sqrt-div49.9%
metadata-eval49.9%
*-commutative49.9%
Applied egg-rr49.9%
unpow149.9%
associate-*r/50.0%
*-rgt-identity50.0%
Simplified50.0%
sqrt-prod54.3%
Applied egg-rr54.3%
Final simplification50.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(sqrt (* (/ d l) (/ d h)))
(+
1.0
(* -0.5 (* 0.25 (* (/ (* D D) l) (/ (* h (* M M)) (* d d)))))))))
(if (<= d -5e-254)
t_0
(if (<= d 7.5e-156)
(* d (* (pow h -0.5) (pow l -0.5)))
(if (<= d 1.65e+76) t_0 (/ d (* (sqrt l) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d))))));
double tmp;
if (d <= -5e-254) {
tmp = t_0;
} else if (d <= 7.5e-156) {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
} else if (d <= 1.65e+76) {
tmp = t_0;
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
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) * (d / h))) * (1.0d0 + ((-0.5d0) * (0.25d0 * (((d_1 * d_1) / l) * ((h * (m * m)) / (d * d))))))
if (d <= (-5d-254)) then
tmp = t_0
else if (d <= 7.5d-156) then
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
else if (d <= 1.65d+76) then
tmp = t_0
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d))))));
double tmp;
if (d <= -5e-254) {
tmp = t_0;
} else if (d <= 7.5e-156) {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
} else if (d <= 1.65e+76) {
tmp = t_0;
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d)))))) tmp = 0 if d <= -5e-254: tmp = t_0 elif d <= 7.5e-156: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) elif d <= 1.65e+76: tmp = t_0 else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(-0.5 * Float64(0.25 * Float64(Float64(Float64(D * D) / l) * Float64(Float64(h * Float64(M * M)) / Float64(d * d))))))) tmp = 0.0 if (d <= -5e-254) tmp = t_0; elseif (d <= 7.5e-156) tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); elseif (d <= 1.65e+76) tmp = t_0; else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d)))))); tmp = 0.0; if (d <= -5e-254) tmp = t_0; elseif (d <= 7.5e-156) tmp = d * ((h ^ -0.5) * (l ^ -0.5)); elseif (d <= 1.65e+76) tmp = t_0; else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(0.25 * N[(N[(N[(D * D), $MachinePrecision] / l), $MachinePrecision] * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -5e-254], t$95$0, If[LessEqual[d, 7.5e-156], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.65e+76], t$95$0, N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \left(0.25 \cdot \left(\frac{D \cdot D}{\ell} \cdot \frac{h \cdot \left(M \cdot M\right)}{d \cdot d}\right)\right)\right)\\
\mathbf{if}\;d \leq -5 \cdot 10^{-254}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \leq 7.5 \cdot 10^{-156}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\mathbf{elif}\;d \leq 1.65 \cdot 10^{+76}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < -5.0000000000000003e-254 or 7.49999999999999959e-156 < d < 1.65e76Initial program 79.0%
Simplified79.0%
expm1-log1p-u39.7%
expm1-udef29.2%
Applied egg-rr25.5%
expm1-def33.2%
expm1-log1p67.1%
rem-log-exp61.2%
exp-sum61.2%
log-prod61.2%
rem-log-exp61.2%
*-commutative61.2%
log1p-expm161.2%
log1p-def61.2%
Simplified67.1%
Taylor expanded in h around 0 46.3%
associate-*r/46.3%
*-commutative46.3%
associate-*r/46.3%
*-commutative46.3%
times-frac48.2%
unpow248.2%
*-commutative48.2%
unpow248.2%
unpow248.2%
Simplified48.2%
if -5.0000000000000003e-254 < d < 7.49999999999999959e-156Initial program 32.6%
Simplified32.4%
Taylor expanded in d around inf 28.1%
pow1/228.1%
*-commutative28.1%
Applied egg-rr28.1%
unpow1/228.1%
unpow-128.1%
sqr-pow28.1%
rem-sqrt-square28.1%
metadata-eval28.1%
sqr-pow28.0%
fabs-sqr28.0%
sqr-pow28.1%
Simplified28.1%
unpow-prod-down31.8%
Applied egg-rr31.8%
if 1.65e76 < d Initial program 72.8%
Simplified70.9%
Taylor expanded in d around inf 68.1%
pow168.1%
*-commutative68.1%
sqrt-div68.0%
metadata-eval68.0%
*-commutative68.0%
Applied egg-rr68.0%
unpow168.0%
associate-*r/68.2%
*-rgt-identity68.2%
Simplified68.2%
sqrt-prod73.0%
Applied egg-rr73.0%
Final simplification50.5%
(FPCore (d h l M D)
:precision binary64
(if (<= M 3.6e-99)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* -0.5 (* 0.25 (* (/ (* D D) l) (/ (* h (* M M)) (* d d)))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 3.6e-99) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d))))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 3.6d-99) then
tmp = sqrt((d / l)) * sqrt((d / h))
else
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + ((-0.5d0) * (0.25d0 * (((d_1 * d_1) / l) * ((h * (m * m)) / (d * d))))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 3.6e-99) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d))))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if M <= 3.6e-99: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) else: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d)))))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (M <= 3.6e-99) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); else tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(-0.5 * Float64(0.25 * Float64(Float64(Float64(D * D) / l) * Float64(Float64(h * Float64(M * M)) / Float64(d * d))))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (M <= 3.6e-99) tmp = sqrt((d / l)) * sqrt((d / h)); else tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d)))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[M, 3.6e-99], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(0.25 * N[(N[(N[(D * D), $MachinePrecision] / l), $MachinePrecision] * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 3.6 \cdot 10^{-99}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \left(0.25 \cdot \left(\frac{D \cdot D}{\ell} \cdot \frac{h \cdot \left(M \cdot M\right)}{d \cdot d}\right)\right)\right)\\
\end{array}
\end{array}
if M < 3.6000000000000001e-99Initial program 70.8%
Simplified70.2%
Taylor expanded in M around 0 47.7%
if 3.6000000000000001e-99 < M Initial program 67.9%
Simplified67.9%
expm1-log1p-u27.0%
expm1-udef20.5%
Applied egg-rr18.8%
expm1-def24.4%
expm1-log1p57.8%
rem-log-exp53.9%
exp-sum53.9%
log-prod53.9%
rem-log-exp53.9%
*-commutative53.9%
log1p-expm153.9%
log1p-def53.9%
Simplified57.8%
Taylor expanded in h around 0 42.8%
associate-*r/42.8%
*-commutative42.8%
associate-*r/42.8%
*-commutative42.8%
times-frac40.8%
unpow240.8%
*-commutative40.8%
unpow240.8%
unpow240.8%
Simplified40.8%
Final simplification45.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(sqrt (* (/ d l) (/ d h)))
(+
1.0
(* -0.5 (* 0.25 (* (/ (* D D) l) (/ (* h (* M M)) (* d d)))))))))
(if (<= d -2.5e-186)
t_0
(if (<= d 8.5e-162)
(/ d (sqrt (* h l)))
(if (<= d 2.4e+113) t_0 (* d (sqrt (/ (/ 1.0 h) l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d))))));
double tmp;
if (d <= -2.5e-186) {
tmp = t_0;
} else if (d <= 8.5e-162) {
tmp = d / sqrt((h * l));
} else if (d <= 2.4e+113) {
tmp = t_0;
} else {
tmp = d * sqrt(((1.0 / h) / l));
}
return tmp;
}
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) * (d / h))) * (1.0d0 + ((-0.5d0) * (0.25d0 * (((d_1 * d_1) / l) * ((h * (m * m)) / (d * d))))))
if (d <= (-2.5d-186)) then
tmp = t_0
else if (d <= 8.5d-162) then
tmp = d / sqrt((h * l))
else if (d <= 2.4d+113) then
tmp = t_0
else
tmp = d * sqrt(((1.0d0 / h) / l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d))))));
double tmp;
if (d <= -2.5e-186) {
tmp = t_0;
} else if (d <= 8.5e-162) {
tmp = d / Math.sqrt((h * l));
} else if (d <= 2.4e+113) {
tmp = t_0;
} else {
tmp = d * Math.sqrt(((1.0 / h) / l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d)))))) tmp = 0 if d <= -2.5e-186: tmp = t_0 elif d <= 8.5e-162: tmp = d / math.sqrt((h * l)) elif d <= 2.4e+113: tmp = t_0 else: tmp = d * math.sqrt(((1.0 / h) / l)) return tmp
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(-0.5 * Float64(0.25 * Float64(Float64(Float64(D * D) / l) * Float64(Float64(h * Float64(M * M)) / Float64(d * d))))))) tmp = 0.0 if (d <= -2.5e-186) tmp = t_0; elseif (d <= 8.5e-162) tmp = Float64(d / sqrt(Float64(h * l))); elseif (d <= 2.4e+113) tmp = t_0; else tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (0.25 * (((D * D) / l) * ((h * (M * M)) / (d * d)))))); tmp = 0.0; if (d <= -2.5e-186) tmp = t_0; elseif (d <= 8.5e-162) tmp = d / sqrt((h * l)); elseif (d <= 2.4e+113) tmp = t_0; else tmp = d * sqrt(((1.0 / h) / l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(0.25 * N[(N[(N[(D * D), $MachinePrecision] / l), $MachinePrecision] * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.5e-186], t$95$0, If[LessEqual[d, 8.5e-162], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.4e+113], t$95$0, N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \left(0.25 \cdot \left(\frac{D \cdot D}{\ell} \cdot \frac{h \cdot \left(M \cdot M\right)}{d \cdot d}\right)\right)\right)\\
\mathbf{if}\;d \leq -2.5 \cdot 10^{-186}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \leq 8.5 \cdot 10^{-162}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{elif}\;d \leq 2.4 \cdot 10^{+113}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\end{array}
\end{array}
if d < -2.5e-186 or 8.49999999999999955e-162 < d < 2.39999999999999983e113Initial program 79.0%
Simplified79.0%
expm1-log1p-u41.0%
expm1-udef29.9%
Applied egg-rr26.2%
expm1-def34.4%
expm1-log1p67.8%
rem-log-exp62.4%
exp-sum62.4%
log-prod62.4%
rem-log-exp62.4%
*-commutative62.4%
log1p-expm162.4%
log1p-def62.4%
Simplified67.8%
Taylor expanded in h around 0 49.4%
associate-*r/49.4%
*-commutative49.4%
associate-*r/49.4%
*-commutative49.4%
times-frac50.7%
unpow250.7%
*-commutative50.7%
unpow250.7%
unpow250.7%
Simplified50.7%
if -2.5e-186 < d < 8.49999999999999955e-162Initial program 38.0%
Simplified37.8%
Taylor expanded in d around inf 28.5%
pow128.5%
*-commutative28.5%
sqrt-div28.5%
metadata-eval28.5%
*-commutative28.5%
Applied egg-rr28.5%
unpow128.5%
associate-*r/28.5%
*-rgt-identity28.5%
Simplified28.5%
if 2.39999999999999983e113 < d Initial program 72.9%
Simplified70.7%
Taylor expanded in d around inf 69.5%
*-commutative69.5%
*-un-lft-identity69.5%
Applied egg-rr69.5%
*-lft-identity69.5%
associate-/r*71.6%
Simplified71.6%
Final simplification50.0%
(FPCore (d h l M D) :precision binary64 (* d (sqrt (/ (/ 1.0 l) h))))
double code(double d, double h, double l, double M, double D) {
return d * sqrt(((1.0 / l) / h));
}
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
public static double code(double d, double h, double l, double M, double D) {
return d * Math.sqrt(((1.0 / l) / h));
}
def code(d, h, l, M, D): return d * math.sqrt(((1.0 / l) / h))
function code(d, h, l, M, D) return Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) end
function tmp = code(d, h, l, M, D) tmp = d * sqrt(((1.0 / l) / h)); end
code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}
\end{array}
Initial program 69.7%
Simplified69.3%
associate-*r/69.9%
div-inv69.9%
metadata-eval69.9%
Applied egg-rr69.9%
pow1/269.9%
sqr-pow69.9%
pow269.9%
metadata-eval69.9%
Applied egg-rr69.9%
Taylor expanded in d around inf 26.7%
*-commutative26.7%
associate-/r*27.1%
Simplified27.1%
Final simplification27.1%
(FPCore (d h l M D) :precision binary64 (* d (sqrt (/ (/ 1.0 h) l))))
double code(double d, double h, double l, double M, double D) {
return d * sqrt(((1.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 * sqrt(((1.0d0 / h) / l))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.sqrt(((1.0 / h) / l));
}
def code(d, h, l, M, D): return d * math.sqrt(((1.0 / h) / l))
function code(d, h, l, M, D) return Float64(d * sqrt(Float64(Float64(1.0 / h) / l))) end
function tmp = code(d, h, l, M, D) tmp = d * sqrt(((1.0 / h) / l)); end
code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}
\end{array}
Initial program 69.7%
Simplified69.3%
Taylor expanded in d around inf 26.7%
*-commutative26.7%
*-un-lft-identity26.7%
Applied egg-rr26.7%
*-lft-identity26.7%
associate-/r*27.1%
Simplified27.1%
Final simplification27.1%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* h l))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((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 / sqrt((h * l))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((h * l));
}
def code(d, h, l, M, D): return d / math.sqrt((h * l))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(h * l))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((h * l)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{h \cdot \ell}}
\end{array}
Initial program 69.7%
Simplified69.3%
Taylor expanded in d around inf 26.7%
pow126.7%
*-commutative26.7%
sqrt-div26.7%
metadata-eval26.7%
*-commutative26.7%
Applied egg-rr26.7%
unpow126.7%
associate-*r/26.8%
*-rgt-identity26.8%
Simplified26.8%
Final simplification26.8%
herbie shell --seed 2023309
(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)))))