
(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 13 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 (/ (* h (* 0.5 (pow (* (/ D d) (* M 0.5)) 2.0))) l))))
(if (<= l -1e-310)
(* (* (pow (* (pow (/ -1.0 h) 0.25) (pow (- d) 0.25)) 2.0) t_0) t_1)
(if (<= l 7.2e+89)
(* t_1 (* t_0 (/ (sqrt d) (sqrt h))))
(* d (* (pow h -0.5) (pow l -0.5)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = 1.0 - ((h * (0.5 * pow(((D / d) * (M * 0.5)), 2.0))) / l);
double tmp;
if (l <= -1e-310) {
tmp = (pow((pow((-1.0 / h), 0.25) * pow(-d, 0.25)), 2.0) * t_0) * t_1;
} else if (l <= 7.2e+89) {
tmp = t_1 * (t_0 * (sqrt(d) / sqrt(h)));
} 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) :: t_1
real(8) :: tmp
t_0 = sqrt((d / l))
t_1 = 1.0d0 - ((h * (0.5d0 * (((d_1 / d) * (m * 0.5d0)) ** 2.0d0))) / l)
if (l <= (-1d-310)) then
tmp = ((((((-1.0d0) / h) ** 0.25d0) * (-d ** 0.25d0)) ** 2.0d0) * t_0) * t_1
else if (l <= 7.2d+89) then
tmp = t_1 * (t_0 * (sqrt(d) / sqrt(h)))
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.sqrt((d / l));
double t_1 = 1.0 - ((h * (0.5 * Math.pow(((D / d) * (M * 0.5)), 2.0))) / l);
double tmp;
if (l <= -1e-310) {
tmp = (Math.pow((Math.pow((-1.0 / h), 0.25) * Math.pow(-d, 0.25)), 2.0) * t_0) * t_1;
} else if (l <= 7.2e+89) {
tmp = t_1 * (t_0 * (Math.sqrt(d) / Math.sqrt(h)));
} 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.sqrt((d / l)) t_1 = 1.0 - ((h * (0.5 * math.pow(((D / d) * (M * 0.5)), 2.0))) / l) tmp = 0 if l <= -1e-310: tmp = (math.pow((math.pow((-1.0 / h), 0.25) * math.pow(-d, 0.25)), 2.0) * t_0) * t_1 elif l <= 7.2e+89: tmp = t_1 * (t_0 * (math.sqrt(d) / math.sqrt(h))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(1.0 - Float64(Float64(h * Float64(0.5 * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0))) / l)) tmp = 0.0 if (l <= -1e-310) tmp = Float64(Float64((Float64((Float64(-1.0 / h) ^ 0.25) * (Float64(-d) ^ 0.25)) ^ 2.0) * t_0) * t_1); elseif (l <= 7.2e+89) tmp = Float64(t_1 * Float64(t_0 * Float64(sqrt(d) / sqrt(h)))); 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 = sqrt((d / l)); t_1 = 1.0 - ((h * (0.5 * (((D / d) * (M * 0.5)) ^ 2.0))) / l); tmp = 0.0; if (l <= -1e-310) tmp = (((((-1.0 / h) ^ 0.25) * (-d ^ 0.25)) ^ 2.0) * t_0) * t_1; elseif (l <= 7.2e+89) tmp = t_1 * (t_0 * (sqrt(d) / sqrt(h))); 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[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - N[(N[(h * N[(0.5 * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1e-310], N[(N[(N[Power[N[(N[Power[N[(-1.0 / h), $MachinePrecision], 0.25], $MachinePrecision] * N[Power[(-d), 0.25], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[l, 7.2e+89], N[(t$95$1 * N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := 1 - \frac{h \cdot \left(0.5 \cdot {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}\right)}{\ell}\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left({\left({\left(\frac{-1}{h}\right)}^{0.25} \cdot {\left(-d\right)}^{0.25}\right)}^{2} \cdot t_0\right) \cdot t_1\\
\mathbf{elif}\;\ell \leq 7.2 \cdot 10^{+89}:\\
\;\;\;\;t_1 \cdot \left(t_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -9.999999999999969e-311Initial program 63.6%
metadata-eval63.6%
unpow1/263.6%
metadata-eval63.6%
unpow1/263.6%
*-commutative63.6%
associate-*l*63.6%
times-frac63.6%
metadata-eval63.6%
Simplified63.6%
associate-*r*63.6%
frac-times63.6%
*-commutative63.6%
metadata-eval63.6%
associate-*r/66.4%
metadata-eval66.4%
*-commutative66.4%
frac-times66.4%
*-commutative66.4%
div-inv66.4%
metadata-eval66.4%
Applied egg-rr66.4%
pow1/266.4%
sqr-pow66.3%
pow266.3%
metadata-eval66.3%
Applied egg-rr66.3%
Taylor expanded in h around -inf 75.1%
distribute-lft-in75.1%
exp-sum75.2%
*-commutative75.2%
exp-to-pow75.5%
*-commutative75.5%
rem-square-sqrt0.0%
unpow20.0%
exp-to-pow0.0%
unpow20.0%
rem-square-sqrt78.5%
mul-1-neg78.5%
Simplified78.5%
if -9.999999999999969e-311 < l < 7.2e89Initial program 66.4%
metadata-eval66.4%
unpow1/266.4%
metadata-eval66.4%
unpow1/266.4%
*-commutative66.4%
associate-*l*66.4%
times-frac66.5%
metadata-eval66.5%
Simplified66.5%
associate-*r*66.5%
frac-times66.4%
*-commutative66.4%
metadata-eval66.4%
associate-*r/75.7%
metadata-eval75.7%
*-commutative75.7%
frac-times75.7%
*-commutative75.7%
div-inv75.7%
metadata-eval75.7%
Applied egg-rr75.7%
sqrt-div87.9%
Applied egg-rr87.9%
if 7.2e89 < l Initial program 54.8%
metadata-eval54.8%
unpow1/254.8%
metadata-eval54.8%
unpow1/254.8%
*-commutative54.8%
associate-*l*54.8%
times-frac54.7%
metadata-eval54.7%
Simplified54.7%
Taylor expanded in d around inf 75.3%
*-un-lft-identity75.3%
*-commutative75.3%
Applied egg-rr75.3%
*-lft-identity75.3%
unpow-175.3%
sqr-pow75.3%
rem-sqrt-square75.3%
sqr-pow74.9%
fabs-sqr74.9%
sqr-pow75.3%
metadata-eval75.3%
Simplified75.3%
unpow-prod-down80.2%
Applied egg-rr80.2%
Final simplification82.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))) (t_1 (* 0.5 (/ h l))))
(if (<= l -6.8e-111)
(*
(* d (pow (* l h) -0.5))
(+ -1.0 (* (pow (* M (/ D (/ d 0.5))) 2.0) t_1)))
(if (<= l 1.75e-249)
(*
(* t_0 (sqrt (/ d h)))
(- 1.0 (* h (/ (pow (* (/ D d) (* M 0.5)) 2.0) (/ l 0.5)))))
(if (<= l 3.2e+89)
(*
(* t_0 (/ (sqrt d) (sqrt h)))
(- 1.0 (* t_1 (pow (* (/ D d) (/ M 2.0)) 2.0))))
(* d (* (pow h -0.5) (pow l -0.5))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = 0.5 * (h / l);
double tmp;
if (l <= -6.8e-111) {
tmp = (d * pow((l * h), -0.5)) * (-1.0 + (pow((M * (D / (d / 0.5))), 2.0) * t_1));
} else if (l <= 1.75e-249) {
tmp = (t_0 * sqrt((d / h))) * (1.0 - (h * (pow(((D / d) * (M * 0.5)), 2.0) / (l / 0.5))));
} else if (l <= 3.2e+89) {
tmp = (t_0 * (sqrt(d) / sqrt(h))) * (1.0 - (t_1 * pow(((D / d) * (M / 2.0)), 2.0)));
} 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) :: t_1
real(8) :: tmp
t_0 = sqrt((d / l))
t_1 = 0.5d0 * (h / l)
if (l <= (-6.8d-111)) then
tmp = (d * ((l * h) ** (-0.5d0))) * ((-1.0d0) + (((m * (d_1 / (d / 0.5d0))) ** 2.0d0) * t_1))
else if (l <= 1.75d-249) then
tmp = (t_0 * sqrt((d / h))) * (1.0d0 - (h * ((((d_1 / d) * (m * 0.5d0)) ** 2.0d0) / (l / 0.5d0))))
else if (l <= 3.2d+89) then
tmp = (t_0 * (sqrt(d) / sqrt(h))) * (1.0d0 - (t_1 * (((d_1 / d) * (m / 2.0d0)) ** 2.0d0)))
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.sqrt((d / l));
double t_1 = 0.5 * (h / l);
double tmp;
if (l <= -6.8e-111) {
tmp = (d * Math.pow((l * h), -0.5)) * (-1.0 + (Math.pow((M * (D / (d / 0.5))), 2.0) * t_1));
} else if (l <= 1.75e-249) {
tmp = (t_0 * Math.sqrt((d / h))) * (1.0 - (h * (Math.pow(((D / d) * (M * 0.5)), 2.0) / (l / 0.5))));
} else if (l <= 3.2e+89) {
tmp = (t_0 * (Math.sqrt(d) / Math.sqrt(h))) * (1.0 - (t_1 * Math.pow(((D / d) * (M / 2.0)), 2.0)));
} 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.sqrt((d / l)) t_1 = 0.5 * (h / l) tmp = 0 if l <= -6.8e-111: tmp = (d * math.pow((l * h), -0.5)) * (-1.0 + (math.pow((M * (D / (d / 0.5))), 2.0) * t_1)) elif l <= 1.75e-249: tmp = (t_0 * math.sqrt((d / h))) * (1.0 - (h * (math.pow(((D / d) * (M * 0.5)), 2.0) / (l / 0.5)))) elif l <= 3.2e+89: tmp = (t_0 * (math.sqrt(d) / math.sqrt(h))) * (1.0 - (t_1 * math.pow(((D / d) * (M / 2.0)), 2.0))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(0.5 * Float64(h / l)) tmp = 0.0 if (l <= -6.8e-111) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 + Float64((Float64(M * Float64(D / Float64(d / 0.5))) ^ 2.0) * t_1))); elseif (l <= 1.75e-249) tmp = Float64(Float64(t_0 * sqrt(Float64(d / h))) * Float64(1.0 - Float64(h * Float64((Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0) / Float64(l / 0.5))))); elseif (l <= 3.2e+89) tmp = Float64(Float64(t_0 * Float64(sqrt(d) / sqrt(h))) * Float64(1.0 - Float64(t_1 * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0)))); 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 = sqrt((d / l)); t_1 = 0.5 * (h / l); tmp = 0.0; if (l <= -6.8e-111) tmp = (d * ((l * h) ^ -0.5)) * (-1.0 + (((M * (D / (d / 0.5))) ^ 2.0) * t_1)); elseif (l <= 1.75e-249) tmp = (t_0 * sqrt((d / h))) * (1.0 - (h * ((((D / d) * (M * 0.5)) ^ 2.0) / (l / 0.5)))); elseif (l <= 3.2e+89) tmp = (t_0 * (sqrt(d) / sqrt(h))) * (1.0 - (t_1 * (((D / d) * (M / 2.0)) ^ 2.0))); 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[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -6.8e-111], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 + N[(N[Power[N[(M * N[(D / N[(d / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.75e-249], N[(N[(t$95$0 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(h * N[(N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / N[(l / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.2e+89], N[(N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(t$95$1 * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $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 := \sqrt{\frac{d}{\ell}}\\
t_1 := 0.5 \cdot \frac{h}{\ell}\\
\mathbf{if}\;\ell \leq -6.8 \cdot 10^{-111}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 + {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot t_1\right)\\
\mathbf{elif}\;\ell \leq 1.75 \cdot 10^{-249}:\\
\;\;\;\;\left(t_0 \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - h \cdot \frac{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\frac{\ell}{0.5}}\right)\\
\mathbf{elif}\;\ell \leq 3.2 \cdot 10^{+89}:\\
\;\;\;\;\left(t_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot \left(1 - t_1 \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -6.79999999999999993e-111Initial program 62.2%
metadata-eval62.2%
unpow1/262.2%
metadata-eval62.2%
unpow1/262.2%
*-commutative62.2%
associate-*l*62.2%
times-frac62.2%
metadata-eval62.2%
Simplified62.2%
Applied egg-rr26.9%
expm1-def36.5%
expm1-log1p47.3%
rem-log-exp43.3%
exp-diff43.3%
log-div43.3%
rem-log-exp43.3%
rem-log-exp47.3%
*-commutative47.3%
associate-*l*47.3%
*-commutative47.3%
associate-*l/47.3%
associate-/l*47.3%
Simplified47.3%
Taylor expanded in d around -inf 74.2%
associate-*r*74.2%
mul-1-neg74.2%
*-commutative74.2%
unpow-174.2%
sqr-pow74.2%
rem-sqrt-square74.2%
sqr-pow74.0%
fabs-sqr74.0%
sqr-pow74.2%
metadata-eval74.2%
Simplified74.2%
if -6.79999999999999993e-111 < l < 1.75000000000000006e-249Initial program 62.3%
metadata-eval62.3%
unpow1/262.3%
metadata-eval62.3%
unpow1/262.3%
*-commutative62.3%
associate-*l*62.3%
times-frac62.3%
metadata-eval62.3%
Simplified62.3%
associate-*r*62.3%
frac-times62.3%
*-commutative62.3%
metadata-eval62.3%
associate-*r/78.9%
metadata-eval78.9%
*-commutative78.9%
frac-times78.9%
*-commutative78.9%
div-inv78.9%
metadata-eval78.9%
Applied egg-rr78.9%
div-inv78.9%
*-commutative78.9%
Applied egg-rr78.9%
associate-*r/78.9%
*-rgt-identity78.9%
associate-*l/78.9%
*-commutative78.9%
*-commutative78.9%
associate-/l*78.9%
Simplified78.9%
if 1.75000000000000006e-249 < l < 3.19999999999999987e89Initial program 69.9%
metadata-eval69.9%
unpow1/269.9%
metadata-eval69.9%
unpow1/269.9%
*-commutative69.9%
associate-*l*69.9%
times-frac69.9%
metadata-eval69.9%
Simplified69.9%
sqrt-div86.3%
Applied egg-rr81.4%
if 3.19999999999999987e89 < l Initial program 54.6%
metadata-eval54.6%
unpow1/254.6%
metadata-eval54.6%
unpow1/254.6%
*-commutative54.6%
associate-*l*54.6%
times-frac54.4%
metadata-eval54.4%
Simplified54.4%
Taylor expanded in d around inf 74.0%
*-un-lft-identity74.0%
*-commutative74.0%
Applied egg-rr74.0%
*-lft-identity74.0%
unpow-174.0%
sqr-pow74.0%
rem-sqrt-square74.0%
sqr-pow73.7%
fabs-sqr73.7%
sqr-pow74.0%
metadata-eval74.0%
Simplified74.0%
unpow-prod-down78.7%
Applied egg-rr78.7%
Final simplification78.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))) (t_1 (* 0.5 (/ h l))))
(if (<= l -1.1e-110)
(*
(* d (pow (* l h) -0.5))
(+ -1.0 (* (pow (* M (/ D (/ d 0.5))) 2.0) t_1)))
(if (<= l 2.05e-249)
(*
(* t_0 (sqrt (/ d h)))
(- 1.0 (* h (/ (pow (* (/ D d) (* M 0.5)) 2.0) (/ l 0.5)))))
(*
(* t_0 (/ (sqrt d) (sqrt h)))
(- 1.0 (* t_1 (pow (/ D (/ (* d 2.0) M)) 2.0))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = 0.5 * (h / l);
double tmp;
if (l <= -1.1e-110) {
tmp = (d * pow((l * h), -0.5)) * (-1.0 + (pow((M * (D / (d / 0.5))), 2.0) * t_1));
} else if (l <= 2.05e-249) {
tmp = (t_0 * sqrt((d / h))) * (1.0 - (h * (pow(((D / d) * (M * 0.5)), 2.0) / (l / 0.5))));
} else {
tmp = (t_0 * (sqrt(d) / sqrt(h))) * (1.0 - (t_1 * pow((D / ((d * 2.0) / M)), 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 = 0.5d0 * (h / l)
if (l <= (-1.1d-110)) then
tmp = (d * ((l * h) ** (-0.5d0))) * ((-1.0d0) + (((m * (d_1 / (d / 0.5d0))) ** 2.0d0) * t_1))
else if (l <= 2.05d-249) then
tmp = (t_0 * sqrt((d / h))) * (1.0d0 - (h * ((((d_1 / d) * (m * 0.5d0)) ** 2.0d0) / (l / 0.5d0))))
else
tmp = (t_0 * (sqrt(d) / sqrt(h))) * (1.0d0 - (t_1 * ((d_1 / ((d * 2.0d0) / m)) ** 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 = 0.5 * (h / l);
double tmp;
if (l <= -1.1e-110) {
tmp = (d * Math.pow((l * h), -0.5)) * (-1.0 + (Math.pow((M * (D / (d / 0.5))), 2.0) * t_1));
} else if (l <= 2.05e-249) {
tmp = (t_0 * Math.sqrt((d / h))) * (1.0 - (h * (Math.pow(((D / d) * (M * 0.5)), 2.0) / (l / 0.5))));
} else {
tmp = (t_0 * (Math.sqrt(d) / Math.sqrt(h))) * (1.0 - (t_1 * Math.pow((D / ((d * 2.0) / M)), 2.0)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = 0.5 * (h / l) tmp = 0 if l <= -1.1e-110: tmp = (d * math.pow((l * h), -0.5)) * (-1.0 + (math.pow((M * (D / (d / 0.5))), 2.0) * t_1)) elif l <= 2.05e-249: tmp = (t_0 * math.sqrt((d / h))) * (1.0 - (h * (math.pow(((D / d) * (M * 0.5)), 2.0) / (l / 0.5)))) else: tmp = (t_0 * (math.sqrt(d) / math.sqrt(h))) * (1.0 - (t_1 * math.pow((D / ((d * 2.0) / M)), 2.0))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(0.5 * Float64(h / l)) tmp = 0.0 if (l <= -1.1e-110) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 + Float64((Float64(M * Float64(D / Float64(d / 0.5))) ^ 2.0) * t_1))); elseif (l <= 2.05e-249) tmp = Float64(Float64(t_0 * sqrt(Float64(d / h))) * Float64(1.0 - Float64(h * Float64((Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0) / Float64(l / 0.5))))); else tmp = Float64(Float64(t_0 * Float64(sqrt(d) / sqrt(h))) * Float64(1.0 - Float64(t_1 * (Float64(D / Float64(Float64(d * 2.0) / M)) ^ 2.0)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = 0.5 * (h / l); tmp = 0.0; if (l <= -1.1e-110) tmp = (d * ((l * h) ^ -0.5)) * (-1.0 + (((M * (D / (d / 0.5))) ^ 2.0) * t_1)); elseif (l <= 2.05e-249) tmp = (t_0 * sqrt((d / h))) * (1.0 - (h * ((((D / d) * (M * 0.5)) ^ 2.0) / (l / 0.5)))); else tmp = (t_0 * (sqrt(d) / sqrt(h))) * (1.0 - (t_1 * ((D / ((d * 2.0) / M)) ^ 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[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.1e-110], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 + N[(N[Power[N[(M * N[(D / N[(d / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.05e-249], N[(N[(t$95$0 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(h * N[(N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / N[(l / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(t$95$1 * N[Power[N[(D / N[(N[(d * 2.0), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := 0.5 \cdot \frac{h}{\ell}\\
\mathbf{if}\;\ell \leq -1.1 \cdot 10^{-110}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 + {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot t_1\right)\\
\mathbf{elif}\;\ell \leq 2.05 \cdot 10^{-249}:\\
\;\;\;\;\left(t_0 \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - h \cdot \frac{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\frac{\ell}{0.5}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot \left(1 - t_1 \cdot {\left(\frac{D}{\frac{d \cdot 2}{M}}\right)}^{2}\right)\\
\end{array}
\end{array}
if l < -1.1e-110Initial program 62.2%
metadata-eval62.2%
unpow1/262.2%
metadata-eval62.2%
unpow1/262.2%
*-commutative62.2%
associate-*l*62.2%
times-frac62.2%
metadata-eval62.2%
Simplified62.2%
Applied egg-rr26.9%
expm1-def36.5%
expm1-log1p47.3%
rem-log-exp43.3%
exp-diff43.3%
log-div43.3%
rem-log-exp43.3%
rem-log-exp47.3%
*-commutative47.3%
associate-*l*47.3%
*-commutative47.3%
associate-*l/47.3%
associate-/l*47.3%
Simplified47.3%
Taylor expanded in d around -inf 74.2%
associate-*r*74.2%
mul-1-neg74.2%
*-commutative74.2%
unpow-174.2%
sqr-pow74.2%
rem-sqrt-square74.2%
sqr-pow74.0%
fabs-sqr74.0%
sqr-pow74.2%
metadata-eval74.2%
Simplified74.2%
if -1.1e-110 < l < 2.05000000000000002e-249Initial program 62.3%
metadata-eval62.3%
unpow1/262.3%
metadata-eval62.3%
unpow1/262.3%
*-commutative62.3%
associate-*l*62.3%
times-frac62.3%
metadata-eval62.3%
Simplified62.3%
associate-*r*62.3%
frac-times62.3%
*-commutative62.3%
metadata-eval62.3%
associate-*r/78.9%
metadata-eval78.9%
*-commutative78.9%
frac-times78.9%
*-commutative78.9%
div-inv78.9%
metadata-eval78.9%
Applied egg-rr78.9%
div-inv78.9%
*-commutative78.9%
Applied egg-rr78.9%
associate-*r/78.9%
*-rgt-identity78.9%
associate-*l/78.9%
*-commutative78.9%
*-commutative78.9%
associate-/l*78.9%
Simplified78.9%
if 2.05000000000000002e-249 < l Initial program 64.8%
metadata-eval64.8%
unpow1/264.8%
metadata-eval64.8%
unpow1/264.8%
*-commutative64.8%
associate-*l*64.8%
times-frac64.7%
metadata-eval64.7%
Simplified64.7%
sqrt-div81.3%
Applied egg-rr77.2%
frac-times76.9%
Applied egg-rr76.9%
*-commutative76.9%
associate-/l*77.2%
Simplified77.2%
Final simplification76.6%
(FPCore (d h l M D)
:precision binary64
(if (<= h -5.2e-277)
(*
(* d (pow (* l h) -0.5))
(+ -1.0 (* (pow (* M (/ D (/ d 0.5))) 2.0) (* 0.5 (/ h l)))))
(if (<= h 9e-293)
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* D M) (* d 2.0)) 2.0)))))
(*
(- 1.0 (/ (* h (* 0.5 (pow (* (/ D d) (* M 0.5)) 2.0))) l))
(* (sqrt (/ d l)) (/ (sqrt d) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -5.2e-277) {
tmp = (d * pow((l * h), -0.5)) * (-1.0 + (pow((M * (D / (d / 0.5))), 2.0) * (0.5 * (h / l))));
} else if (h <= 9e-293) {
tmp = (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((D * M) / (d * 2.0)), 2.0))));
} else {
tmp = (1.0 - ((h * (0.5 * pow(((D / d) * (M * 0.5)), 2.0))) / l)) * (sqrt((d / l)) * (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) :: tmp
if (h <= (-5.2d-277)) then
tmp = (d * ((l * h) ** (-0.5d0))) * ((-1.0d0) + (((m * (d_1 / (d / 0.5d0))) ** 2.0d0) * (0.5d0 * (h / l))))
else if (h <= 9d-293) then
tmp = (((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((d_1 * m) / (d * 2.0d0)) ** 2.0d0))))
else
tmp = (1.0d0 - ((h * (0.5d0 * (((d_1 / d) * (m * 0.5d0)) ** 2.0d0))) / l)) * (sqrt((d / l)) * (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 tmp;
if (h <= -5.2e-277) {
tmp = (d * Math.pow((l * h), -0.5)) * (-1.0 + (Math.pow((M * (D / (d / 0.5))), 2.0) * (0.5 * (h / l))));
} else if (h <= 9e-293) {
tmp = (Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * Math.pow(((D * M) / (d * 2.0)), 2.0))));
} else {
tmp = (1.0 - ((h * (0.5 * Math.pow(((D / d) * (M * 0.5)), 2.0))) / l)) * (Math.sqrt((d / l)) * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -5.2e-277: tmp = (d * math.pow((l * h), -0.5)) * (-1.0 + (math.pow((M * (D / (d / 0.5))), 2.0) * (0.5 * (h / l)))) elif h <= 9e-293: tmp = (math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * math.pow(((D * M) / (d * 2.0)), 2.0)))) else: tmp = (1.0 - ((h * (0.5 * math.pow(((D / d) * (M * 0.5)), 2.0))) / l)) * (math.sqrt((d / l)) * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -5.2e-277) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 + Float64((Float64(M * Float64(D / Float64(d / 0.5))) ^ 2.0) * Float64(0.5 * Float64(h / l))))); elseif (h <= 9e-293) tmp = Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0))))); else tmp = Float64(Float64(1.0 - Float64(Float64(h * Float64(0.5 * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0))) / l)) * Float64(sqrt(Float64(d / l)) * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -5.2e-277) tmp = (d * ((l * h) ^ -0.5)) * (-1.0 + (((M * (D / (d / 0.5))) ^ 2.0) * (0.5 * (h / l)))); elseif (h <= 9e-293) tmp = (((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((D * M) / (d * 2.0)) ^ 2.0)))); else tmp = (1.0 - ((h * (0.5 * (((D / d) * (M * 0.5)) ^ 2.0))) / l)) * (sqrt((d / l)) * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -5.2e-277], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 + N[(N[Power[N[(M * N[(D / N[(d / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 9e-293], N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(h * N[(0.5 * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -5.2 \cdot 10^{-277}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 + {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{elif}\;h \leq 9 \cdot 10^{-293}:\\
\;\;\;\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{h \cdot \left(0.5 \cdot {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}\right)}{\ell}\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if h < -5.2e-277Initial program 62.2%
metadata-eval62.2%
unpow1/262.2%
metadata-eval62.2%
unpow1/262.2%
*-commutative62.2%
associate-*l*62.2%
times-frac62.2%
metadata-eval62.2%
Simplified62.2%
Applied egg-rr27.6%
expm1-def35.5%
expm1-log1p51.3%
rem-log-exp48.4%
exp-diff48.4%
log-div48.4%
rem-log-exp48.4%
rem-log-exp51.3%
*-commutative51.3%
associate-*l*51.3%
*-commutative51.3%
associate-*l/51.3%
associate-/l*51.3%
Simplified51.3%
Taylor expanded in d around -inf 71.9%
associate-*r*71.9%
mul-1-neg71.9%
*-commutative71.9%
unpow-171.9%
sqr-pow72.0%
rem-sqrt-square72.4%
sqr-pow72.2%
fabs-sqr72.2%
sqr-pow72.4%
metadata-eval72.4%
Simplified72.4%
if -5.2e-277 < h < 9.0000000000000005e-293Initial program 83.7%
if 9.0000000000000005e-293 < h Initial program 62.6%
metadata-eval62.6%
unpow1/262.6%
metadata-eval62.6%
unpow1/262.6%
*-commutative62.6%
associate-*l*62.6%
times-frac62.5%
metadata-eval62.5%
Simplified62.5%
associate-*r*62.5%
frac-times62.6%
*-commutative62.6%
metadata-eval62.6%
associate-*r/69.5%
metadata-eval69.5%
*-commutative69.5%
frac-times69.5%
*-commutative69.5%
div-inv69.5%
metadata-eval69.5%
Applied egg-rr69.5%
sqrt-div83.0%
Applied egg-rr83.0%
Final simplification78.2%
(FPCore (d h l M D)
:precision binary64
(if (<= l -5e-111)
(*
(* d (pow (* l h) -0.5))
(+ -1.0 (* (pow (* M (/ D (/ d 0.5))) 2.0) (* 0.5 (/ h l)))))
(if (<= l 6.6e+89)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(- 1.0 (* h (/ (pow (* (/ D d) (* M 0.5)) 2.0) (/ l 0.5)))))
(* 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 <= -5e-111) {
tmp = (d * pow((l * h), -0.5)) * (-1.0 + (pow((M * (D / (d / 0.5))), 2.0) * (0.5 * (h / l))));
} else if (l <= 6.6e+89) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (h * (pow(((D / d) * (M * 0.5)), 2.0) / (l / 0.5))));
} 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 <= (-5d-111)) then
tmp = (d * ((l * h) ** (-0.5d0))) * ((-1.0d0) + (((m * (d_1 / (d / 0.5d0))) ** 2.0d0) * (0.5d0 * (h / l))))
else if (l <= 6.6d+89) then
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (h * ((((d_1 / d) * (m * 0.5d0)) ** 2.0d0) / (l / 0.5d0))))
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 <= -5e-111) {
tmp = (d * Math.pow((l * h), -0.5)) * (-1.0 + (Math.pow((M * (D / (d / 0.5))), 2.0) * (0.5 * (h / l))));
} else if (l <= 6.6e+89) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (h * (Math.pow(((D / d) * (M * 0.5)), 2.0) / (l / 0.5))));
} 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 <= -5e-111: tmp = (d * math.pow((l * h), -0.5)) * (-1.0 + (math.pow((M * (D / (d / 0.5))), 2.0) * (0.5 * (h / l)))) elif l <= 6.6e+89: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (h * (math.pow(((D / d) * (M * 0.5)), 2.0) / (l / 0.5)))) 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 <= -5e-111) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 + Float64((Float64(M * Float64(D / Float64(d / 0.5))) ^ 2.0) * Float64(0.5 * Float64(h / l))))); elseif (l <= 6.6e+89) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(h * Float64((Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0) / Float64(l / 0.5))))); 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 <= -5e-111) tmp = (d * ((l * h) ^ -0.5)) * (-1.0 + (((M * (D / (d / 0.5))) ^ 2.0) * (0.5 * (h / l)))); elseif (l <= 6.6e+89) tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (h * ((((D / d) * (M * 0.5)) ^ 2.0) / (l / 0.5)))); else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -5e-111], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 + N[(N[Power[N[(M * N[(D / N[(d / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.6e+89], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(h * N[(N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / N[(l / 0.5), $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 -5 \cdot 10^{-111}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 + {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{elif}\;\ell \leq 6.6 \cdot 10^{+89}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - h \cdot \frac{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\frac{\ell}{0.5}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -5.0000000000000003e-111Initial program 62.2%
metadata-eval62.2%
unpow1/262.2%
metadata-eval62.2%
unpow1/262.2%
*-commutative62.2%
associate-*l*62.2%
times-frac62.2%
metadata-eval62.2%
Simplified62.2%
Applied egg-rr26.9%
expm1-def36.5%
expm1-log1p47.3%
rem-log-exp43.3%
exp-diff43.3%
log-div43.3%
rem-log-exp43.3%
rem-log-exp47.3%
*-commutative47.3%
associate-*l*47.3%
*-commutative47.3%
associate-*l/47.3%
associate-/l*47.3%
Simplified47.3%
Taylor expanded in d around -inf 74.2%
associate-*r*74.2%
mul-1-neg74.2%
*-commutative74.2%
unpow-174.2%
sqr-pow74.2%
rem-sqrt-square74.2%
sqr-pow74.0%
fabs-sqr74.0%
sqr-pow74.2%
metadata-eval74.2%
Simplified74.2%
if -5.0000000000000003e-111 < l < 6.59999999999999948e89Initial program 66.5%
metadata-eval66.5%
unpow1/266.5%
metadata-eval66.5%
unpow1/266.5%
*-commutative66.5%
associate-*l*66.5%
times-frac66.5%
metadata-eval66.5%
Simplified66.5%
associate-*r*66.5%
frac-times66.5%
*-commutative66.5%
metadata-eval66.5%
associate-*r/75.5%
metadata-eval75.5%
*-commutative75.5%
frac-times75.5%
*-commutative75.5%
div-inv75.5%
metadata-eval75.5%
Applied egg-rr75.5%
div-inv75.5%
*-commutative75.5%
Applied egg-rr75.5%
associate-*r/75.5%
*-rgt-identity75.5%
associate-*l/74.8%
*-commutative74.8%
*-commutative74.8%
associate-/l*74.8%
Simplified74.8%
if 6.59999999999999948e89 < l Initial program 54.8%
metadata-eval54.8%
unpow1/254.8%
metadata-eval54.8%
unpow1/254.8%
*-commutative54.8%
associate-*l*54.8%
times-frac54.7%
metadata-eval54.7%
Simplified54.7%
Taylor expanded in d around inf 75.3%
*-un-lft-identity75.3%
*-commutative75.3%
Applied egg-rr75.3%
*-lft-identity75.3%
unpow-175.3%
sqr-pow75.3%
rem-sqrt-square75.3%
sqr-pow74.9%
fabs-sqr74.9%
sqr-pow75.3%
metadata-eval75.3%
Simplified75.3%
unpow-prod-down80.2%
Applied egg-rr80.2%
Final simplification75.4%
(FPCore (d h l M D)
:precision binary64
(if (<= l -4e-111)
(*
(* d (pow (* l h) -0.5))
(+ -1.0 (* (pow (* M (/ D (/ d 0.5))) 2.0) (* 0.5 (/ h l)))))
(if (<= l 6.3e+89)
(*
(- 1.0 (/ (* h (* 0.5 (pow (* (/ D d) (* M 0.5)) 2.0))) l))
(* (sqrt (/ d l)) (sqrt (/ d h))))
(* 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 <= -4e-111) {
tmp = (d * pow((l * h), -0.5)) * (-1.0 + (pow((M * (D / (d / 0.5))), 2.0) * (0.5 * (h / l))));
} else if (l <= 6.3e+89) {
tmp = (1.0 - ((h * (0.5 * pow(((D / d) * (M * 0.5)), 2.0))) / l)) * (sqrt((d / l)) * sqrt((d / h)));
} 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 <= (-4d-111)) then
tmp = (d * ((l * h) ** (-0.5d0))) * ((-1.0d0) + (((m * (d_1 / (d / 0.5d0))) ** 2.0d0) * (0.5d0 * (h / l))))
else if (l <= 6.3d+89) then
tmp = (1.0d0 - ((h * (0.5d0 * (((d_1 / d) * (m * 0.5d0)) ** 2.0d0))) / l)) * (sqrt((d / l)) * sqrt((d / h)))
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 <= -4e-111) {
tmp = (d * Math.pow((l * h), -0.5)) * (-1.0 + (Math.pow((M * (D / (d / 0.5))), 2.0) * (0.5 * (h / l))));
} else if (l <= 6.3e+89) {
tmp = (1.0 - ((h * (0.5 * Math.pow(((D / d) * (M * 0.5)), 2.0))) / l)) * (Math.sqrt((d / l)) * Math.sqrt((d / h)));
} 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 <= -4e-111: tmp = (d * math.pow((l * h), -0.5)) * (-1.0 + (math.pow((M * (D / (d / 0.5))), 2.0) * (0.5 * (h / l)))) elif l <= 6.3e+89: tmp = (1.0 - ((h * (0.5 * math.pow(((D / d) * (M * 0.5)), 2.0))) / l)) * (math.sqrt((d / l)) * math.sqrt((d / h))) 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 <= -4e-111) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 + Float64((Float64(M * Float64(D / Float64(d / 0.5))) ^ 2.0) * Float64(0.5 * Float64(h / l))))); elseif (l <= 6.3e+89) tmp = Float64(Float64(1.0 - Float64(Float64(h * Float64(0.5 * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0))) / l)) * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))); 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 <= -4e-111) tmp = (d * ((l * h) ^ -0.5)) * (-1.0 + (((M * (D / (d / 0.5))) ^ 2.0) * (0.5 * (h / l)))); elseif (l <= 6.3e+89) tmp = (1.0 - ((h * (0.5 * (((D / d) * (M * 0.5)) ^ 2.0))) / l)) * (sqrt((d / l)) * sqrt((d / h))); else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4e-111], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 + N[(N[Power[N[(M * N[(D / N[(d / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.3e+89], N[(N[(1.0 - N[(N[(h * N[(0.5 * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4 \cdot 10^{-111}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 + {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{elif}\;\ell \leq 6.3 \cdot 10^{+89}:\\
\;\;\;\;\left(1 - \frac{h \cdot \left(0.5 \cdot {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}\right)}{\ell}\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -4.00000000000000035e-111Initial program 62.2%
metadata-eval62.2%
unpow1/262.2%
metadata-eval62.2%
unpow1/262.2%
*-commutative62.2%
associate-*l*62.2%
times-frac62.2%
metadata-eval62.2%
Simplified62.2%
Applied egg-rr26.9%
expm1-def36.5%
expm1-log1p47.3%
rem-log-exp43.3%
exp-diff43.3%
log-div43.3%
rem-log-exp43.3%
rem-log-exp47.3%
*-commutative47.3%
associate-*l*47.3%
*-commutative47.3%
associate-*l/47.3%
associate-/l*47.3%
Simplified47.3%
Taylor expanded in d around -inf 74.2%
associate-*r*74.2%
mul-1-neg74.2%
*-commutative74.2%
unpow-174.2%
sqr-pow74.2%
rem-sqrt-square74.2%
sqr-pow74.0%
fabs-sqr74.0%
sqr-pow74.2%
metadata-eval74.2%
Simplified74.2%
if -4.00000000000000035e-111 < l < 6.3e89Initial program 66.5%
metadata-eval66.5%
unpow1/266.5%
metadata-eval66.5%
unpow1/266.5%
*-commutative66.5%
associate-*l*66.5%
times-frac66.5%
metadata-eval66.5%
Simplified66.5%
associate-*r*66.5%
frac-times66.5%
*-commutative66.5%
metadata-eval66.5%
associate-*r/75.5%
metadata-eval75.5%
*-commutative75.5%
frac-times75.5%
*-commutative75.5%
div-inv75.5%
metadata-eval75.5%
Applied egg-rr75.5%
if 6.3e89 < l Initial program 54.8%
metadata-eval54.8%
unpow1/254.8%
metadata-eval54.8%
unpow1/254.8%
*-commutative54.8%
associate-*l*54.8%
times-frac54.7%
metadata-eval54.7%
Simplified54.7%
Taylor expanded in d around inf 75.3%
*-un-lft-identity75.3%
*-commutative75.3%
Applied egg-rr75.3%
*-lft-identity75.3%
unpow-175.3%
sqr-pow75.3%
rem-sqrt-square75.3%
sqr-pow74.9%
fabs-sqr74.9%
sqr-pow75.3%
metadata-eval75.3%
Simplified75.3%
unpow-prod-down80.2%
Applied egg-rr80.2%
Final simplification75.8%
(FPCore (d h l M D)
:precision binary64
(if (<= l -4.5e-111)
(*
(* d (pow (* l h) -0.5))
(+ -1.0 (* (pow (* M (/ D (/ d 0.5))) 2.0) (* 0.5 (/ h l)))))
(if (<= l 1850000000.0)
(*
(sqrt (* (/ d l) (/ d h)))
(- 1.0 (* h (/ (* 0.5 (pow (* 0.5 (* (/ D d) M)) 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 <= -4.5e-111) {
tmp = (d * pow((l * h), -0.5)) * (-1.0 + (pow((M * (D / (d / 0.5))), 2.0) * (0.5 * (h / l))));
} else if (l <= 1850000000.0) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 - (h * ((0.5 * pow((0.5 * ((D / d) * M)), 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 <= (-4.5d-111)) then
tmp = (d * ((l * h) ** (-0.5d0))) * ((-1.0d0) + (((m * (d_1 / (d / 0.5d0))) ** 2.0d0) * (0.5d0 * (h / l))))
else if (l <= 1850000000.0d0) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 - (h * ((0.5d0 * ((0.5d0 * ((d_1 / d) * m)) ** 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 <= -4.5e-111) {
tmp = (d * Math.pow((l * h), -0.5)) * (-1.0 + (Math.pow((M * (D / (d / 0.5))), 2.0) * (0.5 * (h / l))));
} else if (l <= 1850000000.0) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 - (h * ((0.5 * Math.pow((0.5 * ((D / d) * M)), 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 <= -4.5e-111: tmp = (d * math.pow((l * h), -0.5)) * (-1.0 + (math.pow((M * (D / (d / 0.5))), 2.0) * (0.5 * (h / l)))) elif l <= 1850000000.0: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 - (h * ((0.5 * math.pow((0.5 * ((D / d) * M)), 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 <= -4.5e-111) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 + Float64((Float64(M * Float64(D / Float64(d / 0.5))) ^ 2.0) * Float64(0.5 * Float64(h / l))))); elseif (l <= 1850000000.0) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 - Float64(h * Float64(Float64(0.5 * (Float64(0.5 * Float64(Float64(D / d) * M)) ^ 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 <= -4.5e-111) tmp = (d * ((l * h) ^ -0.5)) * (-1.0 + (((M * (D / (d / 0.5))) ^ 2.0) * (0.5 * (h / l)))); elseif (l <= 1850000000.0) tmp = sqrt(((d / l) * (d / h))) * (1.0 - (h * ((0.5 * ((0.5 * ((D / d) * M)) ^ 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, -4.5e-111], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 + N[(N[Power[N[(M * N[(D / N[(d / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1850000000.0], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(h * N[(N[(0.5 * N[Power[N[(0.5 * N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.5 \cdot 10^{-111}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 + {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{elif}\;\ell \leq 1850000000:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 - h \cdot \frac{0.5 \cdot {\left(0.5 \cdot \left(\frac{D}{d} \cdot M\right)\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -4.49999999999999994e-111Initial program 62.2%
metadata-eval62.2%
unpow1/262.2%
metadata-eval62.2%
unpow1/262.2%
*-commutative62.2%
associate-*l*62.2%
times-frac62.2%
metadata-eval62.2%
Simplified62.2%
Applied egg-rr26.9%
expm1-def36.5%
expm1-log1p47.3%
rem-log-exp43.3%
exp-diff43.3%
log-div43.3%
rem-log-exp43.3%
rem-log-exp47.3%
*-commutative47.3%
associate-*l*47.3%
*-commutative47.3%
associate-*l/47.3%
associate-/l*47.3%
Simplified47.3%
Taylor expanded in d around -inf 74.2%
associate-*r*74.2%
mul-1-neg74.2%
*-commutative74.2%
unpow-174.2%
sqr-pow74.2%
rem-sqrt-square74.2%
sqr-pow74.0%
fabs-sqr74.0%
sqr-pow74.2%
metadata-eval74.2%
Simplified74.2%
if -4.49999999999999994e-111 < l < 1.85e9Initial program 64.0%
metadata-eval64.0%
unpow1/264.0%
metadata-eval64.0%
unpow1/264.0%
*-commutative64.0%
associate-*l*64.0%
times-frac64.1%
metadata-eval64.1%
Simplified64.1%
associate-*r*64.1%
frac-times64.0%
*-commutative64.0%
metadata-eval64.0%
associate-*r/74.0%
metadata-eval74.0%
*-commutative74.0%
frac-times74.0%
*-commutative74.0%
div-inv74.0%
metadata-eval74.0%
Applied egg-rr74.0%
pow174.0%
sqrt-unprod70.6%
associate-/l*61.6%
*-commutative61.6%
Applied egg-rr61.6%
unpow161.6%
sub-neg61.6%
+-commutative61.6%
+-commutative61.6%
sub-neg61.6%
*-lft-identity61.6%
*-lft-identity61.6%
associate-/r/69.8%
Simplified69.8%
if 1.85e9 < l Initial program 63.9%
metadata-eval63.9%
unpow1/263.9%
metadata-eval63.9%
unpow1/263.9%
*-commutative63.9%
associate-*l*63.9%
times-frac63.8%
metadata-eval63.8%
Simplified63.8%
Taylor expanded in d around inf 65.0%
*-un-lft-identity65.0%
*-commutative65.0%
Applied egg-rr65.0%
*-lft-identity65.0%
unpow-165.0%
sqr-pow65.0%
rem-sqrt-square65.0%
sqr-pow64.7%
fabs-sqr64.7%
sqr-pow65.0%
metadata-eval65.0%
Simplified65.0%
unpow-prod-down71.1%
Applied egg-rr71.1%
Final simplification71.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l 135000000.0)
(*
(sqrt (* (/ d l) (/ d h)))
(- 1.0 (* h (/ (* 0.5 (pow (* 0.5 (* (/ D d) M)) 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 <= 135000000.0) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 - (h * ((0.5 * pow((0.5 * ((D / d) * M)), 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 <= 135000000.0d0) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 - (h * ((0.5d0 * ((0.5d0 * ((d_1 / d) * m)) ** 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 <= 135000000.0) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 - (h * ((0.5 * Math.pow((0.5 * ((D / d) * M)), 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 <= 135000000.0: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 - (h * ((0.5 * math.pow((0.5 * ((D / d) * M)), 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 <= 135000000.0) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 - Float64(h * Float64(Float64(0.5 * (Float64(0.5 * Float64(Float64(D / d) * M)) ^ 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 <= 135000000.0) tmp = sqrt(((d / l) * (d / h))) * (1.0 - (h * ((0.5 * ((0.5 * ((D / d) * M)) ^ 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, 135000000.0], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(h * N[(N[(0.5 * N[Power[N[(0.5 * N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 135000000:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 - h \cdot \frac{0.5 \cdot {\left(0.5 \cdot \left(\frac{D}{d} \cdot M\right)\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < 1.35e8Initial program 63.2%
metadata-eval63.2%
unpow1/263.2%
metadata-eval63.2%
unpow1/263.2%
*-commutative63.2%
associate-*l*63.2%
times-frac63.3%
metadata-eval63.3%
Simplified63.3%
associate-*r*63.3%
frac-times63.2%
*-commutative63.2%
metadata-eval63.2%
associate-*r/69.1%
metadata-eval69.1%
*-commutative69.1%
frac-times69.1%
*-commutative69.1%
div-inv69.1%
metadata-eval69.1%
Applied egg-rr69.1%
pow169.1%
sqrt-unprod60.7%
associate-/l*55.4%
*-commutative55.4%
Applied egg-rr55.4%
unpow155.4%
sub-neg55.4%
+-commutative55.4%
+-commutative55.4%
sub-neg55.4%
*-lft-identity55.4%
*-lft-identity55.4%
associate-/r/60.5%
Simplified60.5%
if 1.35e8 < l Initial program 63.9%
metadata-eval63.9%
unpow1/263.9%
metadata-eval63.9%
unpow1/263.9%
*-commutative63.9%
associate-*l*63.9%
times-frac63.8%
metadata-eval63.8%
Simplified63.8%
Taylor expanded in d around inf 65.0%
*-un-lft-identity65.0%
*-commutative65.0%
Applied egg-rr65.0%
*-lft-identity65.0%
unpow-165.0%
sqr-pow65.0%
rem-sqrt-square65.0%
sqr-pow64.7%
fabs-sqr64.7%
sqr-pow65.0%
metadata-eval65.0%
Simplified65.0%
unpow-prod-down71.1%
Applied egg-rr71.1%
Final simplification63.0%
(FPCore (d h l M D)
:precision binary64
(if (or (<= l 1.46e-285) (and (not (<= l 9.5e-254)) (<= l 75000000.0)))
(*
(sqrt (* (/ d l) (/ d h)))
(- 1.0 (* 0.125 (* (/ D d) (/ (* D (* M (* h M))) (* l d))))))
(* d (/ (sqrt (/ 1.0 l)) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if ((l <= 1.46e-285) || (!(l <= 9.5e-254) && (l <= 75000000.0))) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 - (0.125 * ((D / d) * ((D * (M * (h * M))) / (l * d)))));
} else {
tmp = d * (sqrt((1.0 / 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 ((l <= 1.46d-285) .or. (.not. (l <= 9.5d-254)) .and. (l <= 75000000.0d0)) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 - (0.125d0 * ((d_1 / d) * ((d_1 * (m * (h * m))) / (l * d)))))
else
tmp = d * (sqrt((1.0d0 / 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 ((l <= 1.46e-285) || (!(l <= 9.5e-254) && (l <= 75000000.0))) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 - (0.125 * ((D / d) * ((D * (M * (h * M))) / (l * d)))));
} else {
tmp = d * (Math.sqrt((1.0 / l)) / Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if (l <= 1.46e-285) or (not (l <= 9.5e-254) and (l <= 75000000.0)): tmp = math.sqrt(((d / l) * (d / h))) * (1.0 - (0.125 * ((D / d) * ((D * (M * (h * M))) / (l * d))))) else: tmp = d * (math.sqrt((1.0 / l)) / math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if ((l <= 1.46e-285) || (!(l <= 9.5e-254) && (l <= 75000000.0))) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 - Float64(0.125 * Float64(Float64(D / d) * Float64(Float64(D * Float64(M * Float64(h * M))) / Float64(l * d)))))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / l)) / sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if ((l <= 1.46e-285) || (~((l <= 9.5e-254)) && (l <= 75000000.0))) tmp = sqrt(((d / l) * (d / h))) * (1.0 - (0.125 * ((D / d) * ((D * (M * (h * M))) / (l * d))))); else tmp = d * (sqrt((1.0 / l)) / sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[Or[LessEqual[l, 1.46e-285], And[N[Not[LessEqual[l, 9.5e-254]], $MachinePrecision], LessEqual[l, 75000000.0]]], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.125 * N[(N[(D / d), $MachinePrecision] * N[(N[(D * N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.46 \cdot 10^{-285} \lor \neg \left(\ell \leq 9.5 \cdot 10^{-254}\right) \land \ell \leq 75000000:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 - 0.125 \cdot \left(\frac{D}{d} \cdot \frac{D \cdot \left(M \cdot \left(h \cdot M\right)\right)}{\ell \cdot d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < 1.45999999999999992e-285 or 9.5000000000000003e-254 < l < 7.5e7Initial program 64.2%
metadata-eval64.2%
unpow1/264.2%
metadata-eval64.2%
unpow1/264.2%
*-commutative64.2%
associate-*l*64.2%
times-frac64.2%
metadata-eval64.2%
Simplified64.2%
Applied egg-rr27.1%
expm1-def34.2%
expm1-log1p55.9%
rem-log-exp52.0%
exp-diff52.0%
log-div52.0%
rem-log-exp52.0%
rem-log-exp55.9%
*-commutative55.9%
associate-*l*55.9%
*-commutative55.9%
associate-*l/55.9%
associate-/l*55.9%
Simplified55.9%
Taylor expanded in M around 0 41.6%
associate-*r/41.6%
*-commutative41.6%
associate-*r/41.6%
unpow241.6%
*-commutative41.6%
associate-*l*44.0%
*-commutative44.0%
unpow244.0%
associate-*l*46.0%
times-frac51.4%
*-commutative51.4%
unpow251.4%
associate-*r*53.6%
Simplified53.6%
if 1.45999999999999992e-285 < l < 9.5000000000000003e-254 or 7.5e7 < l Initial program 61.2%
metadata-eval61.2%
unpow1/261.2%
metadata-eval61.2%
unpow1/261.2%
*-commutative61.2%
associate-*l*61.2%
times-frac61.1%
metadata-eval61.1%
Simplified61.1%
Taylor expanded in d around inf 63.6%
*-commutative63.6%
associate-/r*63.5%
Simplified63.5%
sqrt-div72.7%
Applied egg-rr72.7%
Final simplification58.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(sqrt (* (/ d l) (/ d h)))
(- 1.0 (* 0.125 (* (/ D d) (/ (* D (* M (* h M))) (* l d))))))))
(if (<= l 1.32e-285)
t_0
(if (<= l 1.95e-253)
(* d (/ (sqrt (/ 1.0 l)) (sqrt h)))
(if (<= l 2800000.0) t_0 (* d (* (pow h -0.5) (pow l -0.5))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(((d / l) * (d / h))) * (1.0 - (0.125 * ((D / d) * ((D * (M * (h * M))) / (l * d)))));
double tmp;
if (l <= 1.32e-285) {
tmp = t_0;
} else if (l <= 1.95e-253) {
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
} else if (l <= 2800000.0) {
tmp = t_0;
} 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 = sqrt(((d / l) * (d / h))) * (1.0d0 - (0.125d0 * ((d_1 / d) * ((d_1 * (m * (h * m))) / (l * d)))))
if (l <= 1.32d-285) then
tmp = t_0
else if (l <= 1.95d-253) then
tmp = d * (sqrt((1.0d0 / l)) / sqrt(h))
else if (l <= 2800000.0d0) then
tmp = t_0
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.sqrt(((d / l) * (d / h))) * (1.0 - (0.125 * ((D / d) * ((D * (M * (h * M))) / (l * d)))));
double tmp;
if (l <= 1.32e-285) {
tmp = t_0;
} else if (l <= 1.95e-253) {
tmp = d * (Math.sqrt((1.0 / l)) / Math.sqrt(h));
} else if (l <= 2800000.0) {
tmp = t_0;
} 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.sqrt(((d / l) * (d / h))) * (1.0 - (0.125 * ((D / d) * ((D * (M * (h * M))) / (l * d))))) tmp = 0 if l <= 1.32e-285: tmp = t_0 elif l <= 1.95e-253: tmp = d * (math.sqrt((1.0 / l)) / math.sqrt(h)) elif l <= 2800000.0: tmp = t_0 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(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 - Float64(0.125 * Float64(Float64(D / d) * Float64(Float64(D * Float64(M * Float64(h * M))) / Float64(l * d)))))) tmp = 0.0 if (l <= 1.32e-285) tmp = t_0; elseif (l <= 1.95e-253) tmp = Float64(d * Float64(sqrt(Float64(1.0 / l)) / sqrt(h))); elseif (l <= 2800000.0) tmp = t_0; 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 = sqrt(((d / l) * (d / h))) * (1.0 - (0.125 * ((D / d) * ((D * (M * (h * M))) / (l * d))))); tmp = 0.0; if (l <= 1.32e-285) tmp = t_0; elseif (l <= 1.95e-253) tmp = d * (sqrt((1.0 / l)) / sqrt(h)); elseif (l <= 2800000.0) tmp = t_0; 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[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.125 * N[(N[(D / d), $MachinePrecision] * N[(N[(D * N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, 1.32e-285], t$95$0, If[LessEqual[l, 1.95e-253], N[(d * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2800000.0], t$95$0, 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 := \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 - 0.125 \cdot \left(\frac{D}{d} \cdot \frac{D \cdot \left(M \cdot \left(h \cdot M\right)\right)}{\ell \cdot d}\right)\right)\\
\mathbf{if}\;\ell \leq 1.32 \cdot 10^{-285}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 1.95 \cdot 10^{-253}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\
\mathbf{elif}\;\ell \leq 2800000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < 1.3199999999999999e-285 or 1.9499999999999999e-253 < l < 2.8e6Initial program 64.2%
metadata-eval64.2%
unpow1/264.2%
metadata-eval64.2%
unpow1/264.2%
*-commutative64.2%
associate-*l*64.2%
times-frac64.2%
metadata-eval64.2%
Simplified64.2%
Applied egg-rr27.1%
expm1-def34.2%
expm1-log1p55.9%
rem-log-exp52.0%
exp-diff52.0%
log-div52.0%
rem-log-exp52.0%
rem-log-exp55.9%
*-commutative55.9%
associate-*l*55.9%
*-commutative55.9%
associate-*l/55.9%
associate-/l*55.9%
Simplified55.9%
Taylor expanded in M around 0 41.6%
associate-*r/41.6%
*-commutative41.6%
associate-*r/41.6%
unpow241.6%
*-commutative41.6%
associate-*l*44.0%
*-commutative44.0%
unpow244.0%
associate-*l*46.0%
times-frac51.4%
*-commutative51.4%
unpow251.4%
associate-*r*53.6%
Simplified53.6%
if 1.3199999999999999e-285 < l < 1.9499999999999999e-253Initial program 46.8%
metadata-eval46.8%
unpow1/246.8%
metadata-eval46.8%
unpow1/246.8%
*-commutative46.8%
associate-*l*46.8%
times-frac46.8%
metadata-eval46.8%
Simplified46.8%
Taylor expanded in d around inf 55.8%
*-commutative55.8%
associate-/r*56.0%
Simplified56.0%
sqrt-div81.4%
Applied egg-rr81.4%
if 2.8e6 < l Initial program 63.9%
metadata-eval63.9%
unpow1/263.9%
metadata-eval63.9%
unpow1/263.9%
*-commutative63.9%
associate-*l*63.9%
times-frac63.8%
metadata-eval63.8%
Simplified63.8%
Taylor expanded in d around inf 65.0%
*-un-lft-identity65.0%
*-commutative65.0%
Applied egg-rr65.0%
*-lft-identity65.0%
unpow-165.0%
sqr-pow65.0%
rem-sqrt-square65.0%
sqr-pow64.7%
fabs-sqr64.7%
sqr-pow65.0%
metadata-eval65.0%
Simplified65.0%
unpow-prod-down71.1%
Applied egg-rr71.1%
Final simplification58.9%
(FPCore (d h l M D)
:precision binary64
(if (<= M 4.8e-166)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(*
(sqrt (* (/ d l) (/ d h)))
(- 1.0 (* 0.125 (* (/ D d) (/ (* D (* M (* h M))) (* l d))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 4.8e-166) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = sqrt(((d / l) * (d / h))) * (1.0 - (0.125 * ((D / d) * ((D * (M * (h * M))) / (l * 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 <= 4.8d-166) then
tmp = sqrt((d / l)) * sqrt((d / h))
else
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 - (0.125d0 * ((d_1 / d) * ((d_1 * (m * (h * m))) / (l * 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 <= 4.8e-166) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 - (0.125 * ((D / d) * ((D * (M * (h * M))) / (l * d)))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if M <= 4.8e-166: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) else: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 - (0.125 * ((D / d) * ((D * (M * (h * M))) / (l * d))))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (M <= 4.8e-166) 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.125 * Float64(Float64(D / d) * Float64(Float64(D * Float64(M * Float64(h * M))) / Float64(l * d)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (M <= 4.8e-166) tmp = sqrt((d / l)) * sqrt((d / h)); else tmp = sqrt(((d / l) * (d / h))) * (1.0 - (0.125 * ((D / d) * ((D * (M * (h * M))) / (l * d))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[M, 4.8e-166], 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.125 * N[(N[(D / d), $MachinePrecision] * N[(N[(D * N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 4.8 \cdot 10^{-166}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 - 0.125 \cdot \left(\frac{D}{d} \cdot \frac{D \cdot \left(M \cdot \left(h \cdot M\right)\right)}{\ell \cdot d}\right)\right)\\
\end{array}
\end{array}
if M < 4.7999999999999997e-166Initial program 59.4%
associate-*l*58.9%
metadata-eval58.9%
unpow1/258.9%
metadata-eval58.9%
unpow1/258.9%
sub-neg58.9%
+-commutative58.9%
*-commutative58.9%
associate-*l*58.9%
distribute-rgt-neg-in58.9%
*-commutative58.9%
Simplified58.9%
Taylor expanded in M around 0 46.7%
if 4.7999999999999997e-166 < M Initial program 72.3%
metadata-eval72.3%
unpow1/272.3%
metadata-eval72.3%
unpow1/272.3%
*-commutative72.3%
associate-*l*72.3%
times-frac72.3%
metadata-eval72.3%
Simplified72.3%
Applied egg-rr28.7%
expm1-def35.9%
expm1-log1p62.6%
rem-log-exp56.8%
exp-diff56.8%
log-div56.8%
rem-log-exp56.8%
rem-log-exp62.6%
*-commutative62.6%
associate-*l*62.6%
*-commutative62.6%
associate-*l/62.6%
associate-/l*62.6%
Simplified62.6%
Taylor expanded in M around 0 46.0%
associate-*r/46.0%
*-commutative46.0%
associate-*r/46.0%
unpow246.0%
*-commutative46.0%
associate-*l*48.7%
*-commutative48.7%
unpow248.7%
associate-*l*48.8%
times-frac54.9%
*-commutative54.9%
unpow254.9%
associate-*r*57.5%
Simplified57.5%
Final simplification50.1%
(FPCore (d h l M D)
:precision binary64
(if (<= l 26000.0)
(*
(sqrt (* (/ d l) (/ d h)))
(- 1.0 (* 0.125 (* (/ D d) (/ (* D (* M (* h M))) (* l d))))))
(* d (pow (* l h) -0.5))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 26000.0) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 - (0.125 * ((D / d) * ((D * (M * (h * M))) / (l * d)))));
} else {
tmp = d * pow((l * h), -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 <= 26000.0d0) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 - (0.125d0 * ((d_1 / d) * ((d_1 * (m * (h * m))) / (l * d)))))
else
tmp = d * ((l * h) ** (-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 <= 26000.0) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 - (0.125 * ((D / d) * ((D * (M * (h * M))) / (l * d)))));
} else {
tmp = d * Math.pow((l * h), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 26000.0: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 - (0.125 * ((D / d) * ((D * (M * (h * M))) / (l * d))))) else: tmp = d * math.pow((l * h), -0.5) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 26000.0) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 - Float64(0.125 * Float64(Float64(D / d) * Float64(Float64(D * Float64(M * Float64(h * M))) / Float64(l * d)))))); else tmp = Float64(d * (Float64(l * h) ^ -0.5)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 26000.0) tmp = sqrt(((d / l) * (d / h))) * (1.0 - (0.125 * ((D / d) * ((D * (M * (h * M))) / (l * d))))); else tmp = d * ((l * h) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 26000.0], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.125 * N[(N[(D / d), $MachinePrecision] * N[(N[(D * N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 26000:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 - 0.125 \cdot \left(\frac{D}{d} \cdot \frac{D \cdot \left(M \cdot \left(h \cdot M\right)\right)}{\ell \cdot d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if l < 26000Initial program 63.2%
metadata-eval63.2%
unpow1/263.2%
metadata-eval63.2%
unpow1/263.2%
*-commutative63.2%
associate-*l*63.2%
times-frac63.3%
metadata-eval63.3%
Simplified63.3%
Applied egg-rr26.7%
expm1-def33.8%
expm1-log1p54.9%
rem-log-exp51.2%
exp-diff51.2%
log-div51.2%
rem-log-exp51.2%
rem-log-exp54.9%
*-commutative54.9%
associate-*l*54.9%
*-commutative54.9%
associate-*l/54.9%
associate-/l*54.9%
Simplified54.9%
Taylor expanded in M around 0 40.3%
associate-*r/40.3%
*-commutative40.3%
associate-*r/40.3%
unpow240.3%
*-commutative40.3%
associate-*l*43.1%
*-commutative43.1%
unpow243.1%
associate-*l*45.0%
times-frac50.0%
*-commutative50.0%
unpow250.0%
associate-*r*52.1%
Simplified52.1%
if 26000 < l Initial program 63.9%
metadata-eval63.9%
unpow1/263.9%
metadata-eval63.9%
unpow1/263.9%
*-commutative63.9%
associate-*l*63.9%
times-frac63.8%
metadata-eval63.8%
Simplified63.8%
Taylor expanded in d around inf 65.0%
*-un-lft-identity65.0%
*-commutative65.0%
Applied egg-rr65.0%
*-lft-identity65.0%
unpow-165.0%
sqr-pow65.0%
rem-sqrt-square65.0%
sqr-pow64.7%
fabs-sqr64.7%
sqr-pow65.0%
metadata-eval65.0%
Simplified65.0%
Final simplification55.1%
(FPCore (d h l M D) :precision binary64 (* d (pow (* l h) -0.5)))
double code(double d, double h, double l, double M, double D) {
return d * pow((l * h), -0.5);
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * ((l * h) ** (-0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.pow((l * h), -0.5);
}
def code(d, h, l, M, D): return d * math.pow((l * h), -0.5)
function code(d, h, l, M, D) return Float64(d * (Float64(l * h) ^ -0.5)) end
function tmp = code(d, h, l, M, D) tmp = d * ((l * h) ^ -0.5); end
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot {\left(\ell \cdot h\right)}^{-0.5}
\end{array}
Initial program 63.4%
metadata-eval63.4%
unpow1/263.4%
metadata-eval63.4%
unpow1/263.4%
*-commutative63.4%
associate-*l*63.4%
times-frac63.4%
metadata-eval63.4%
Simplified63.4%
Taylor expanded in d around inf 29.4%
*-un-lft-identity29.4%
*-commutative29.4%
Applied egg-rr29.4%
*-lft-identity29.4%
unpow-129.4%
sqr-pow29.4%
rem-sqrt-square29.5%
sqr-pow29.3%
fabs-sqr29.3%
sqr-pow29.5%
metadata-eval29.5%
Simplified29.5%
Final simplification29.5%
herbie shell --seed 2023215
(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)))))