
(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 19 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 (* D (* 0.5 (/ M d))) 2.0) l)))))
(t_2 (sqrt (/ d h)))
(t_3 (+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5))))
(t_4 (sqrt (- d))))
(if (<= d -2.2e-153)
(* (* (/ t_4 (sqrt (- h))) t_0) t_1)
(if (<= d -2.2e-260)
(* (/ t_4 (sqrt (- l))) (* t_2 t_3))
(if (<= d 8e-309)
(/
(fma
d
(sqrt (/ h l))
(* (sqrt (pow (/ h l) 3.0)) (* -0.125 (/ (pow (* D M) 2.0) d))))
h)
(if (<= d 3.3e-219)
(* t_0 (* t_3 (/ (sqrt d) (sqrt h))))
(* t_1 (* t_2 (/ (sqrt d) (sqrt l))))))))))
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((D * (0.5 * (M / d))), 2.0) / l)));
double t_2 = sqrt((d / h));
double t_3 = 1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5));
double t_4 = sqrt(-d);
double tmp;
if (d <= -2.2e-153) {
tmp = ((t_4 / sqrt(-h)) * t_0) * t_1;
} else if (d <= -2.2e-260) {
tmp = (t_4 / sqrt(-l)) * (t_2 * t_3);
} else if (d <= 8e-309) {
tmp = fma(d, sqrt((h / l)), (sqrt(pow((h / l), 3.0)) * (-0.125 * (pow((D * M), 2.0) / d)))) / h;
} else if (d <= 3.3e-219) {
tmp = t_0 * (t_3 * (sqrt(d) / sqrt(h)));
} else {
tmp = t_1 * (t_2 * (sqrt(d) / sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(1.0 - Float64(0.5 * Float64(h * Float64((Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0) / l)))) t_2 = sqrt(Float64(d / h)) t_3 = Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))) t_4 = sqrt(Float64(-d)) tmp = 0.0 if (d <= -2.2e-153) tmp = Float64(Float64(Float64(t_4 / sqrt(Float64(-h))) * t_0) * t_1); elseif (d <= -2.2e-260) tmp = Float64(Float64(t_4 / sqrt(Float64(-l))) * Float64(t_2 * t_3)); elseif (d <= 8e-309) tmp = Float64(fma(d, sqrt(Float64(h / l)), Float64(sqrt((Float64(h / l) ^ 3.0)) * Float64(-0.125 * Float64((Float64(D * M) ^ 2.0) / d)))) / h); elseif (d <= 3.3e-219) tmp = Float64(t_0 * Float64(t_3 * Float64(sqrt(d) / sqrt(h)))); else tmp = Float64(t_1 * Float64(t_2 * Float64(sqrt(d) / sqrt(l)))); 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[(h * N[(N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[d, -2.2e-153], N[(N[(N[(t$95$4 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[d, -2.2e-260], N[(N[(t$95$4 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(t$95$2 * t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 8e-309], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[Power[N[(h / l), $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[(-0.125 * N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[d, 3.3e-219], N[(t$95$0 * N[(t$95$3 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t$95$2 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := 1 - 0.5 \cdot \left(h \cdot \frac{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\ell}\right)\\
t_2 := \sqrt{\frac{d}{h}}\\
t_3 := 1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\\
t_4 := \sqrt{-d}\\
\mathbf{if}\;d \leq -2.2 \cdot 10^{-153}:\\
\;\;\;\;\left(\frac{t\_4}{\sqrt{-h}} \cdot t\_0\right) \cdot t\_1\\
\mathbf{elif}\;d \leq -2.2 \cdot 10^{-260}:\\
\;\;\;\;\frac{t\_4}{\sqrt{-\ell}} \cdot \left(t\_2 \cdot t\_3\right)\\
\mathbf{elif}\;d \leq 8 \cdot 10^{-309}:\\
\;\;\;\;\frac{\mathsf{fma}\left(d, \sqrt{\frac{h}{\ell}}, \sqrt{{\left(\frac{h}{\ell}\right)}^{3}} \cdot \left(-0.125 \cdot \frac{{\left(D \cdot M\right)}^{2}}{d}\right)\right)}{h}\\
\mathbf{elif}\;d \leq 3.3 \cdot 10^{-219}:\\
\;\;\;\;t\_0 \cdot \left(t\_3 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(t\_2 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\end{array}
\end{array}
if d < -2.20000000000000001e-153Initial program 72.4%
Simplified72.4%
associate-*r/77.4%
frac-times78.4%
associate-/l*77.4%
*-commutative77.4%
Applied egg-rr77.4%
*-commutative77.4%
associate-/l*77.4%
associate-*r/77.4%
*-rgt-identity77.4%
times-frac77.4%
metadata-eval77.4%
*-commutative77.4%
associate-/l*78.4%
associate-*l*78.4%
Simplified78.4%
frac-2neg78.4%
sqrt-div87.6%
Applied egg-rr87.6%
if -2.20000000000000001e-153 < d < -2.20000000000000017e-260Initial program 41.5%
Simplified45.2%
frac-2neg45.2%
sqrt-div71.1%
Applied egg-rr71.1%
if -2.20000000000000017e-260 < d < 8.0000000000000003e-309Initial program 25.4%
Simplified25.4%
associate-*r/25.6%
frac-times25.6%
associate-/l*25.6%
*-commutative25.6%
Applied egg-rr25.6%
*-commutative25.6%
associate-/l*25.6%
associate-*r/25.6%
*-rgt-identity25.6%
times-frac25.6%
metadata-eval25.6%
*-commutative25.6%
associate-/l*25.6%
associate-*l*25.6%
Simplified25.6%
Taylor expanded in h around 0 25.4%
+-commutative25.4%
fma-define25.4%
associate-*r*25.4%
*-commutative25.4%
cube-div58.7%
unpow258.7%
unpow258.7%
swap-sqr67.0%
unpow267.0%
Simplified67.0%
if 8.0000000000000003e-309 < d < 3.3000000000000002e-219Initial program 40.3%
Simplified40.3%
sqrt-div80.2%
Applied egg-rr80.2%
if 3.3000000000000002e-219 < d Initial program 74.2%
Simplified75.1%
associate-*r/80.2%
frac-times80.2%
associate-/l*80.2%
*-commutative80.2%
Applied egg-rr80.2%
*-commutative80.2%
associate-/l*82.1%
associate-*r/81.2%
*-rgt-identity81.2%
times-frac81.2%
metadata-eval81.2%
*-commutative81.2%
associate-/l*82.2%
associate-*l*82.2%
Simplified82.2%
sqrt-div89.4%
Applied egg-rr89.4%
Final simplification85.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1 (- 1.0 (* 0.5 (* h (/ (pow (* D (* 0.5 (/ M d))) 2.0) l))))))
(if (<= d -3.2e-291)
(* (* (/ (sqrt (- d)) (sqrt (- h))) t_0) t_1)
(if (<= d 3.2e-219)
(*
t_0
(*
(+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5)))
(/ (sqrt d) (sqrt h))))
(* t_1 (* (sqrt (/ d h)) (/ (sqrt d) (sqrt l))))))))
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((D * (0.5 * (M / d))), 2.0) / l)));
double tmp;
if (d <= -3.2e-291) {
tmp = ((sqrt(-d) / sqrt(-h)) * t_0) * t_1;
} else if (d <= 3.2e-219) {
tmp = t_0 * ((1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (sqrt(d) / sqrt(h)));
} else {
tmp = t_1 * (sqrt((d / h)) * (sqrt(d) / sqrt(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) :: t_1
real(8) :: tmp
t_0 = sqrt((d / l))
t_1 = 1.0d0 - (0.5d0 * (h * (((d_1 * (0.5d0 * (m / d))) ** 2.0d0) / l)))
if (d <= (-3.2d-291)) then
tmp = ((sqrt(-d) / sqrt(-h)) * t_0) * t_1
else if (d <= 3.2d-219) then
tmp = t_0 * ((1.0d0 + ((h / l) * (((d_1 * ((m / 2.0d0) / d)) ** 2.0d0) * (-0.5d0)))) * (sqrt(d) / sqrt(h)))
else
tmp = t_1 * (sqrt((d / h)) * (sqrt(d) / sqrt(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));
double t_1 = 1.0 - (0.5 * (h * (Math.pow((D * (0.5 * (M / d))), 2.0) / l)));
double tmp;
if (d <= -3.2e-291) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-h)) * t_0) * t_1;
} else if (d <= 3.2e-219) {
tmp = t_0 * ((1.0 + ((h / l) * (Math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (Math.sqrt(d) / Math.sqrt(h)));
} else {
tmp = t_1 * (Math.sqrt((d / h)) * (Math.sqrt(d) / Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = 1.0 - (0.5 * (h * (math.pow((D * (0.5 * (M / d))), 2.0) / l))) tmp = 0 if d <= -3.2e-291: tmp = ((math.sqrt(-d) / math.sqrt(-h)) * t_0) * t_1 elif d <= 3.2e-219: tmp = t_0 * ((1.0 + ((h / l) * (math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (math.sqrt(d) / math.sqrt(h))) else: tmp = t_1 * (math.sqrt((d / h)) * (math.sqrt(d) / math.sqrt(l))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(1.0 - Float64(0.5 * Float64(h * Float64((Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0) / l)))) tmp = 0.0 if (d <= -3.2e-291) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * t_0) * t_1); elseif (d <= 3.2e-219) tmp = Float64(t_0 * Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))) * Float64(sqrt(d) / sqrt(h)))); else tmp = Float64(t_1 * Float64(sqrt(Float64(d / h)) * Float64(sqrt(d) / sqrt(l)))); 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 * (((D * (0.5 * (M / d))) ^ 2.0) / l))); tmp = 0.0; if (d <= -3.2e-291) tmp = ((sqrt(-d) / sqrt(-h)) * t_0) * t_1; elseif (d <= 3.2e-219) tmp = t_0 * ((1.0 + ((h / l) * (((D * ((M / 2.0) / d)) ^ 2.0) * -0.5))) * (sqrt(d) / sqrt(h))); else tmp = t_1 * (sqrt((d / h)) * (sqrt(d) / sqrt(l))); 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[(h * N[(N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -3.2e-291], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[d, 3.2e-219], N[(t$95$0 * N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := 1 - 0.5 \cdot \left(h \cdot \frac{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\ell}\right)\\
\mathbf{if}\;d \leq -3.2 \cdot 10^{-291}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot t\_0\right) \cdot t\_1\\
\mathbf{elif}\;d \leq 3.2 \cdot 10^{-219}:\\
\;\;\;\;t\_0 \cdot \left(\left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\end{array}
\end{array}
if d < -3.2000000000000002e-291Initial program 63.5%
Simplified64.1%
associate-*r/67.8%
frac-times67.9%
associate-/l*67.8%
*-commutative67.8%
Applied egg-rr67.8%
*-commutative67.8%
associate-/l*67.9%
associate-*r/67.2%
*-rgt-identity67.2%
times-frac67.2%
metadata-eval67.2%
*-commutative67.2%
associate-/l*68.6%
associate-*l*68.6%
Simplified68.6%
frac-2neg68.6%
sqrt-div77.9%
Applied egg-rr77.9%
if -3.2000000000000002e-291 < d < 3.19999999999999998e-219Initial program 36.6%
Simplified36.6%
sqrt-div72.9%
Applied egg-rr72.9%
if 3.19999999999999998e-219 < d Initial program 74.2%
Simplified75.1%
associate-*r/80.2%
frac-times80.2%
associate-/l*80.2%
*-commutative80.2%
Applied egg-rr80.2%
*-commutative80.2%
associate-/l*82.1%
associate-*r/81.2%
*-rgt-identity81.2%
times-frac81.2%
metadata-eval81.2%
*-commutative81.2%
associate-/l*82.2%
associate-*l*82.2%
Simplified82.2%
sqrt-div89.4%
Applied egg-rr89.4%
Final simplification81.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= d -3.2e-291)
(*
(* (/ (sqrt (- d)) (sqrt (- h))) t_0)
(- 1.0 (* 0.5 (* h (/ (pow (* D (* M (/ 0.5 d))) 2.0) l)))))
(if (<= d 1.7e-219)
(*
t_0
(*
(+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5)))
(/ (sqrt d) (sqrt h))))
(*
(- 1.0 (* 0.5 (* h (/ (pow (* D (* 0.5 (/ M d))) 2.0) l))))
(* (sqrt (/ d h)) (/ (sqrt d) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (d <= -3.2e-291) {
tmp = ((sqrt(-d) / sqrt(-h)) * t_0) * (1.0 - (0.5 * (h * (pow((D * (M * (0.5 / d))), 2.0) / l))));
} else if (d <= 1.7e-219) {
tmp = t_0 * ((1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (sqrt(d) / sqrt(h)));
} else {
tmp = (1.0 - (0.5 * (h * (pow((D * (0.5 * (M / d))), 2.0) / l)))) * (sqrt((d / h)) * (sqrt(d) / sqrt(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))
if (d <= (-3.2d-291)) then
tmp = ((sqrt(-d) / sqrt(-h)) * t_0) * (1.0d0 - (0.5d0 * (h * (((d_1 * (m * (0.5d0 / d))) ** 2.0d0) / l))))
else if (d <= 1.7d-219) then
tmp = t_0 * ((1.0d0 + ((h / l) * (((d_1 * ((m / 2.0d0) / d)) ** 2.0d0) * (-0.5d0)))) * (sqrt(d) / sqrt(h)))
else
tmp = (1.0d0 - (0.5d0 * (h * (((d_1 * (0.5d0 * (m / d))) ** 2.0d0) / l)))) * (sqrt((d / h)) * (sqrt(d) / sqrt(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));
double tmp;
if (d <= -3.2e-291) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-h)) * t_0) * (1.0 - (0.5 * (h * (Math.pow((D * (M * (0.5 / d))), 2.0) / l))));
} else if (d <= 1.7e-219) {
tmp = t_0 * ((1.0 + ((h / l) * (Math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (Math.sqrt(d) / Math.sqrt(h)));
} else {
tmp = (1.0 - (0.5 * (h * (Math.pow((D * (0.5 * (M / d))), 2.0) / l)))) * (Math.sqrt((d / h)) * (Math.sqrt(d) / Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if d <= -3.2e-291: tmp = ((math.sqrt(-d) / math.sqrt(-h)) * t_0) * (1.0 - (0.5 * (h * (math.pow((D * (M * (0.5 / d))), 2.0) / l)))) elif d <= 1.7e-219: tmp = t_0 * ((1.0 + ((h / l) * (math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (math.sqrt(d) / math.sqrt(h))) else: tmp = (1.0 - (0.5 * (h * (math.pow((D * (0.5 * (M / d))), 2.0) / l)))) * (math.sqrt((d / h)) * (math.sqrt(d) / math.sqrt(l))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (d <= -3.2e-291) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * t_0) * Float64(1.0 - Float64(0.5 * Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) / l))))); elseif (d <= 1.7e-219) tmp = Float64(t_0 * Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))) * Float64(sqrt(d) / sqrt(h)))); else tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(h * Float64((Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0) / l)))) * Float64(sqrt(Float64(d / h)) * Float64(sqrt(d) / sqrt(l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); tmp = 0.0; if (d <= -3.2e-291) tmp = ((sqrt(-d) / sqrt(-h)) * t_0) * (1.0 - (0.5 * (h * (((D * (M * (0.5 / d))) ^ 2.0) / l)))); elseif (d <= 1.7e-219) tmp = t_0 * ((1.0 + ((h / l) * (((D * ((M / 2.0) / d)) ^ 2.0) * -0.5))) * (sqrt(d) / sqrt(h))); else tmp = (1.0 - (0.5 * (h * (((D * (0.5 * (M / d))) ^ 2.0) / l)))) * (sqrt((d / h)) * (sqrt(d) / sqrt(l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -3.2e-291], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.7e-219], N[(t$95$0 * N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(0.5 * N[(h * N[(N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;d \leq -3.2 \cdot 10^{-291}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot t\_0\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}\right)\right)\\
\mathbf{elif}\;d \leq 1.7 \cdot 10^{-219}:\\
\;\;\;\;t\_0 \cdot \left(\left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - 0.5 \cdot \left(h \cdot \frac{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\ell}\right)\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\end{array}
\end{array}
if d < -3.2000000000000002e-291Initial program 63.5%
Simplified64.1%
associate-*r/67.8%
frac-times67.9%
associate-/l*67.8%
*-commutative67.8%
Applied egg-rr67.8%
*-commutative67.8%
associate-/l*67.9%
associate-*r/67.2%
*-rgt-identity67.2%
times-frac67.2%
metadata-eval67.2%
*-commutative67.2%
associate-/l*68.6%
associate-*l*68.6%
Simplified68.6%
*-un-lft-identity68.6%
associate-*l/68.6%
metadata-eval68.6%
div-inv68.6%
associate-*r/67.2%
div-inv67.2%
metadata-eval67.2%
Applied egg-rr67.2%
*-lft-identity67.2%
associate-/l*68.6%
associate-/l*68.6%
Simplified68.6%
frac-2neg68.6%
sqrt-div77.9%
Applied egg-rr77.8%
if -3.2000000000000002e-291 < d < 1.6999999999999999e-219Initial program 36.6%
Simplified36.6%
sqrt-div72.9%
Applied egg-rr72.9%
if 1.6999999999999999e-219 < d Initial program 74.2%
Simplified75.1%
associate-*r/80.2%
frac-times80.2%
associate-/l*80.2%
*-commutative80.2%
Applied egg-rr80.2%
*-commutative80.2%
associate-/l*82.1%
associate-*r/81.2%
*-rgt-identity81.2%
times-frac81.2%
metadata-eval81.2%
*-commutative81.2%
associate-/l*82.2%
associate-*l*82.2%
Simplified82.2%
sqrt-div89.4%
Applied egg-rr89.4%
Final simplification81.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* 0.5 (* h (/ (pow (* D (* 0.5 (/ M d))) 2.0) l)))))
(if (<= d -3.2e-291)
(* (* d (sqrt (/ 1.0 (* h l)))) (+ t_0 -1.0))
(if (<= d 3.9e-219)
(*
(sqrt (/ d l))
(*
(+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5)))
(/ (sqrt d) (sqrt h))))
(* (- 1.0 t_0) (* (sqrt (/ d h)) (/ (sqrt d) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (h * (pow((D * (0.5 * (M / d))), 2.0) / l));
double tmp;
if (d <= -3.2e-291) {
tmp = (d * sqrt((1.0 / (h * l)))) * (t_0 + -1.0);
} else if (d <= 3.9e-219) {
tmp = sqrt((d / l)) * ((1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (sqrt(d) / sqrt(h)));
} else {
tmp = (1.0 - t_0) * (sqrt((d / h)) * (sqrt(d) / sqrt(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 = 0.5d0 * (h * (((d_1 * (0.5d0 * (m / d))) ** 2.0d0) / l))
if (d <= (-3.2d-291)) then
tmp = (d * sqrt((1.0d0 / (h * l)))) * (t_0 + (-1.0d0))
else if (d <= 3.9d-219) then
tmp = sqrt((d / l)) * ((1.0d0 + ((h / l) * (((d_1 * ((m / 2.0d0) / d)) ** 2.0d0) * (-0.5d0)))) * (sqrt(d) / sqrt(h)))
else
tmp = (1.0d0 - t_0) * (sqrt((d / h)) * (sqrt(d) / sqrt(l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (h * (Math.pow((D * (0.5 * (M / d))), 2.0) / l));
double tmp;
if (d <= -3.2e-291) {
tmp = (d * Math.sqrt((1.0 / (h * l)))) * (t_0 + -1.0);
} else if (d <= 3.9e-219) {
tmp = Math.sqrt((d / l)) * ((1.0 + ((h / l) * (Math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (Math.sqrt(d) / Math.sqrt(h)));
} else {
tmp = (1.0 - t_0) * (Math.sqrt((d / h)) * (Math.sqrt(d) / Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 0.5 * (h * (math.pow((D * (0.5 * (M / d))), 2.0) / l)) tmp = 0 if d <= -3.2e-291: tmp = (d * math.sqrt((1.0 / (h * l)))) * (t_0 + -1.0) elif d <= 3.9e-219: tmp = math.sqrt((d / l)) * ((1.0 + ((h / l) * (math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (math.sqrt(d) / math.sqrt(h))) else: tmp = (1.0 - t_0) * (math.sqrt((d / h)) * (math.sqrt(d) / math.sqrt(l))) return tmp
function code(d, h, l, M, D) t_0 = Float64(0.5 * Float64(h * Float64((Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0) / l))) tmp = 0.0 if (d <= -3.2e-291) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(t_0 + -1.0)); elseif (d <= 3.9e-219) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))) * Float64(sqrt(d) / sqrt(h)))); else tmp = Float64(Float64(1.0 - t_0) * Float64(sqrt(Float64(d / h)) * Float64(sqrt(d) / sqrt(l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 0.5 * (h * (((D * (0.5 * (M / d))) ^ 2.0) / l)); tmp = 0.0; if (d <= -3.2e-291) tmp = (d * sqrt((1.0 / (h * l)))) * (t_0 + -1.0); elseif (d <= 3.9e-219) tmp = sqrt((d / l)) * ((1.0 + ((h / l) * (((D * ((M / 2.0) / d)) ^ 2.0) * -0.5))) * (sqrt(d) / sqrt(h))); else tmp = (1.0 - t_0) * (sqrt((d / h)) * (sqrt(d) / sqrt(l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(0.5 * N[(h * N[(N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -3.2e-291], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.9e-219], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(h \cdot \frac{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\ell}\right)\\
\mathbf{if}\;d \leq -3.2 \cdot 10^{-291}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(t\_0 + -1\right)\\
\mathbf{elif}\;d \leq 3.9 \cdot 10^{-219}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - t\_0\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\end{array}
\end{array}
if d < -3.2000000000000002e-291Initial program 63.5%
Simplified64.1%
associate-*r/67.8%
frac-times67.9%
associate-/l*67.8%
*-commutative67.8%
Applied egg-rr67.8%
*-commutative67.8%
associate-/l*67.9%
associate-*r/67.2%
*-rgt-identity67.2%
times-frac67.2%
metadata-eval67.2%
*-commutative67.2%
associate-/l*68.6%
associate-*l*68.6%
Simplified68.6%
pow168.6%
sqrt-unprod59.4%
Applied egg-rr59.4%
unpow159.4%
associate-*r/53.8%
associate-*l/48.9%
unpow248.9%
Simplified48.9%
Taylor expanded in d around -inf 75.8%
if -3.2000000000000002e-291 < d < 3.89999999999999987e-219Initial program 36.6%
Simplified36.6%
sqrt-div72.9%
Applied egg-rr72.9%
if 3.89999999999999987e-219 < d Initial program 74.2%
Simplified75.1%
associate-*r/80.2%
frac-times80.2%
associate-/l*80.2%
*-commutative80.2%
Applied egg-rr80.2%
*-commutative80.2%
associate-/l*82.1%
associate-*r/81.2%
*-rgt-identity81.2%
times-frac81.2%
metadata-eval81.2%
*-commutative81.2%
associate-/l*82.2%
associate-*l*82.2%
Simplified82.2%
sqrt-div89.4%
Applied egg-rr89.4%
Final simplification80.7%
(FPCore (d h l M D)
:precision binary64
(if (<= d -3.2e-291)
(*
(* d (sqrt (/ 1.0 (* h l))))
(+ (* 0.5 (* h (/ (pow (* D (* 0.5 (/ M d))) 2.0) l))) -1.0))
(if (<= d 2.3e-219)
(*
(sqrt (/ d l))
(*
(+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5)))
(/ (sqrt d) (sqrt h))))
(*
(sqrt (/ d h))
(*
(/ (sqrt d) (sqrt l))
(- 1.0 (* h (* 0.125 (/ (pow (* D (/ M d)) 2.0) l)))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -3.2e-291) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (h * (pow((D * (0.5 * (M / d))), 2.0) / l))) + -1.0);
} else if (d <= 2.3e-219) {
tmp = sqrt((d / l)) * ((1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (sqrt(d) / sqrt(h)));
} else {
tmp = sqrt((d / h)) * ((sqrt(d) / sqrt(l)) * (1.0 - (h * (0.125 * (pow((D * (M / d)), 2.0) / 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 <= (-3.2d-291)) then
tmp = (d * sqrt((1.0d0 / (h * l)))) * ((0.5d0 * (h * (((d_1 * (0.5d0 * (m / d))) ** 2.0d0) / l))) + (-1.0d0))
else if (d <= 2.3d-219) then
tmp = sqrt((d / l)) * ((1.0d0 + ((h / l) * (((d_1 * ((m / 2.0d0) / d)) ** 2.0d0) * (-0.5d0)))) * (sqrt(d) / sqrt(h)))
else
tmp = sqrt((d / h)) * ((sqrt(d) / sqrt(l)) * (1.0d0 - (h * (0.125d0 * (((d_1 * (m / d)) ** 2.0d0) / 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 <= -3.2e-291) {
tmp = (d * Math.sqrt((1.0 / (h * l)))) * ((0.5 * (h * (Math.pow((D * (0.5 * (M / d))), 2.0) / l))) + -1.0);
} else if (d <= 2.3e-219) {
tmp = Math.sqrt((d / l)) * ((1.0 + ((h / l) * (Math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (Math.sqrt(d) / Math.sqrt(h)));
} else {
tmp = Math.sqrt((d / h)) * ((Math.sqrt(d) / Math.sqrt(l)) * (1.0 - (h * (0.125 * (Math.pow((D * (M / d)), 2.0) / l)))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -3.2e-291: tmp = (d * math.sqrt((1.0 / (h * l)))) * ((0.5 * (h * (math.pow((D * (0.5 * (M / d))), 2.0) / l))) + -1.0) elif d <= 2.3e-219: tmp = math.sqrt((d / l)) * ((1.0 + ((h / l) * (math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (math.sqrt(d) / math.sqrt(h))) else: tmp = math.sqrt((d / h)) * ((math.sqrt(d) / math.sqrt(l)) * (1.0 - (h * (0.125 * (math.pow((D * (M / d)), 2.0) / l))))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -3.2e-291) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64(h * Float64((Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0) / l))) + -1.0)); elseif (d <= 2.3e-219) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))) * Float64(sqrt(d) / sqrt(h)))); else tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(sqrt(d) / sqrt(l)) * Float64(1.0 - Float64(h * Float64(0.125 * Float64((Float64(D * Float64(M / d)) ^ 2.0) / l)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -3.2e-291) tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (h * (((D * (0.5 * (M / d))) ^ 2.0) / l))) + -1.0); elseif (d <= 2.3e-219) tmp = sqrt((d / l)) * ((1.0 + ((h / l) * (((D * ((M / 2.0) / d)) ^ 2.0) * -0.5))) * (sqrt(d) / sqrt(h))); else tmp = sqrt((d / h)) * ((sqrt(d) / sqrt(l)) * (1.0 - (h * (0.125 * (((D * (M / d)) ^ 2.0) / l))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -3.2e-291], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(h * N[(N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.3e-219], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(h * N[(0.125 * N[(N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -3.2 \cdot 10^{-291}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left(h \cdot \frac{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\ell}\right) + -1\right)\\
\mathbf{elif}\;d \leq 2.3 \cdot 10^{-219}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(1 - h \cdot \left(0.125 \cdot \frac{{\left(D \cdot \frac{M}{d}\right)}^{2}}{\ell}\right)\right)\right)\\
\end{array}
\end{array}
if d < -3.2000000000000002e-291Initial program 63.5%
Simplified64.1%
associate-*r/67.8%
frac-times67.9%
associate-/l*67.8%
*-commutative67.8%
Applied egg-rr67.8%
*-commutative67.8%
associate-/l*67.9%
associate-*r/67.2%
*-rgt-identity67.2%
times-frac67.2%
metadata-eval67.2%
*-commutative67.2%
associate-/l*68.6%
associate-*l*68.6%
Simplified68.6%
pow168.6%
sqrt-unprod59.4%
Applied egg-rr59.4%
unpow159.4%
associate-*r/53.8%
associate-*l/48.9%
unpow248.9%
Simplified48.9%
Taylor expanded in d around -inf 75.8%
if -3.2000000000000002e-291 < d < 2.29999999999999988e-219Initial program 36.6%
Simplified36.6%
sqrt-div72.9%
Applied egg-rr72.9%
if 2.29999999999999988e-219 < d Initial program 74.2%
Simplified75.1%
Taylor expanded in h around -inf 61.8%
associate-*r*61.8%
neg-mul-161.8%
sub-neg61.8%
distribute-lft-in61.8%
Simplified81.3%
sqrt-div89.4%
Applied egg-rr88.5%
Final simplification80.4%
(FPCore (d h l M D)
:precision binary64
(if (<= d -3.2e-291)
(*
(* d (sqrt (/ 1.0 (* h l))))
(+ (* 0.5 (* h (/ (pow (* D (* 0.5 (/ M d))) 2.0) l))) -1.0))
(if (<= d 5.2e-226)
(* (* -0.125 (/ (pow (* D M) 2.0) d)) (sqrt (/ h (pow l 3.0))))
(*
(sqrt (/ d h))
(*
(/ (sqrt d) (sqrt l))
(- 1.0 (* h (* 0.125 (/ (pow (* D (/ M d)) 2.0) l)))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -3.2e-291) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (h * (pow((D * (0.5 * (M / d))), 2.0) / l))) + -1.0);
} else if (d <= 5.2e-226) {
tmp = (-0.125 * (pow((D * M), 2.0) / d)) * sqrt((h / pow(l, 3.0)));
} else {
tmp = sqrt((d / h)) * ((sqrt(d) / sqrt(l)) * (1.0 - (h * (0.125 * (pow((D * (M / d)), 2.0) / 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 <= (-3.2d-291)) then
tmp = (d * sqrt((1.0d0 / (h * l)))) * ((0.5d0 * (h * (((d_1 * (0.5d0 * (m / d))) ** 2.0d0) / l))) + (-1.0d0))
else if (d <= 5.2d-226) then
tmp = ((-0.125d0) * (((d_1 * m) ** 2.0d0) / d)) * sqrt((h / (l ** 3.0d0)))
else
tmp = sqrt((d / h)) * ((sqrt(d) / sqrt(l)) * (1.0d0 - (h * (0.125d0 * (((d_1 * (m / d)) ** 2.0d0) / 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 <= -3.2e-291) {
tmp = (d * Math.sqrt((1.0 / (h * l)))) * ((0.5 * (h * (Math.pow((D * (0.5 * (M / d))), 2.0) / l))) + -1.0);
} else if (d <= 5.2e-226) {
tmp = (-0.125 * (Math.pow((D * M), 2.0) / d)) * Math.sqrt((h / Math.pow(l, 3.0)));
} else {
tmp = Math.sqrt((d / h)) * ((Math.sqrt(d) / Math.sqrt(l)) * (1.0 - (h * (0.125 * (Math.pow((D * (M / d)), 2.0) / l)))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -3.2e-291: tmp = (d * math.sqrt((1.0 / (h * l)))) * ((0.5 * (h * (math.pow((D * (0.5 * (M / d))), 2.0) / l))) + -1.0) elif d <= 5.2e-226: tmp = (-0.125 * (math.pow((D * M), 2.0) / d)) * math.sqrt((h / math.pow(l, 3.0))) else: tmp = math.sqrt((d / h)) * ((math.sqrt(d) / math.sqrt(l)) * (1.0 - (h * (0.125 * (math.pow((D * (M / d)), 2.0) / l))))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -3.2e-291) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64(h * Float64((Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0) / l))) + -1.0)); elseif (d <= 5.2e-226) tmp = Float64(Float64(-0.125 * Float64((Float64(D * M) ^ 2.0) / d)) * sqrt(Float64(h / (l ^ 3.0)))); else tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(sqrt(d) / sqrt(l)) * Float64(1.0 - Float64(h * Float64(0.125 * Float64((Float64(D * Float64(M / d)) ^ 2.0) / l)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -3.2e-291) tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (h * (((D * (0.5 * (M / d))) ^ 2.0) / l))) + -1.0); elseif (d <= 5.2e-226) tmp = (-0.125 * (((D * M) ^ 2.0) / d)) * sqrt((h / (l ^ 3.0))); else tmp = sqrt((d / h)) * ((sqrt(d) / sqrt(l)) * (1.0 - (h * (0.125 * (((D * (M / d)) ^ 2.0) / l))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -3.2e-291], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(h * N[(N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.2e-226], N[(N[(-0.125 * N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(h * N[(0.125 * N[(N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -3.2 \cdot 10^{-291}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left(h \cdot \frac{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\ell}\right) + -1\right)\\
\mathbf{elif}\;d \leq 5.2 \cdot 10^{-226}:\\
\;\;\;\;\left(-0.125 \cdot \frac{{\left(D \cdot M\right)}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(1 - h \cdot \left(0.125 \cdot \frac{{\left(D \cdot \frac{M}{d}\right)}^{2}}{\ell}\right)\right)\right)\\
\end{array}
\end{array}
if d < -3.2000000000000002e-291Initial program 63.5%
Simplified64.1%
associate-*r/67.8%
frac-times67.9%
associate-/l*67.8%
*-commutative67.8%
Applied egg-rr67.8%
*-commutative67.8%
associate-/l*67.9%
associate-*r/67.2%
*-rgt-identity67.2%
times-frac67.2%
metadata-eval67.2%
*-commutative67.2%
associate-/l*68.6%
associate-*l*68.6%
Simplified68.6%
pow168.6%
sqrt-unprod59.4%
Applied egg-rr59.4%
unpow159.4%
associate-*r/53.8%
associate-*l/48.9%
unpow248.9%
Simplified48.9%
Taylor expanded in d around -inf 75.8%
if -3.2000000000000002e-291 < d < 5.1999999999999997e-226Initial program 30.4%
Simplified26.0%
associate-*r/26.2%
frac-times30.6%
associate-/l*26.2%
*-commutative26.2%
Applied egg-rr26.2%
*-commutative26.2%
associate-/l*21.5%
associate-*r/25.8%
*-rgt-identity25.8%
times-frac25.8%
metadata-eval25.8%
*-commutative25.8%
associate-/l*25.8%
associate-*l*25.8%
Simplified25.8%
Taylor expanded in d around 0 46.0%
associate-*r*46.0%
*-commutative46.0%
unpow246.0%
unpow246.0%
swap-sqr61.2%
unpow261.2%
Simplified61.2%
if 5.1999999999999997e-226 < d Initial program 74.7%
Simplified75.6%
Taylor expanded in h around -inf 60.5%
associate-*r*60.5%
neg-mul-160.5%
sub-neg60.5%
distribute-lft-in60.5%
Simplified81.7%
sqrt-div89.6%
Applied egg-rr88.7%
Final simplification79.6%
(FPCore (d h l M D)
:precision binary64
(if (<= d -3.2e-291)
(*
(* d (sqrt (/ 1.0 (* h l))))
(+ (* 0.5 (* h (/ (pow (* D (* 0.5 (/ M d))) 2.0) l))) -1.0))
(if (<= d 1.05e-220)
(* (* -0.125 (/ (pow (* D M) 2.0) d)) (sqrt (/ h (pow l 3.0))))
(*
(- 1.0 (* 0.5 (* h (/ (pow (* D (* M (/ 0.5 d))) 2.0) l))))
(* (sqrt (/ d l)) (sqrt (/ d h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -3.2e-291) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (h * (pow((D * (0.5 * (M / d))), 2.0) / l))) + -1.0);
} else if (d <= 1.05e-220) {
tmp = (-0.125 * (pow((D * M), 2.0) / d)) * sqrt((h / pow(l, 3.0)));
} else {
tmp = (1.0 - (0.5 * (h * (pow((D * (M * (0.5 / d))), 2.0) / l)))) * (sqrt((d / l)) * sqrt((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 <= (-3.2d-291)) then
tmp = (d * sqrt((1.0d0 / (h * l)))) * ((0.5d0 * (h * (((d_1 * (0.5d0 * (m / d))) ** 2.0d0) / l))) + (-1.0d0))
else if (d <= 1.05d-220) then
tmp = ((-0.125d0) * (((d_1 * m) ** 2.0d0) / d)) * sqrt((h / (l ** 3.0d0)))
else
tmp = (1.0d0 - (0.5d0 * (h * (((d_1 * (m * (0.5d0 / d))) ** 2.0d0) / l)))) * (sqrt((d / l)) * sqrt((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 <= -3.2e-291) {
tmp = (d * Math.sqrt((1.0 / (h * l)))) * ((0.5 * (h * (Math.pow((D * (0.5 * (M / d))), 2.0) / l))) + -1.0);
} else if (d <= 1.05e-220) {
tmp = (-0.125 * (Math.pow((D * M), 2.0) / d)) * Math.sqrt((h / Math.pow(l, 3.0)));
} else {
tmp = (1.0 - (0.5 * (h * (Math.pow((D * (M * (0.5 / d))), 2.0) / l)))) * (Math.sqrt((d / l)) * Math.sqrt((d / h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -3.2e-291: tmp = (d * math.sqrt((1.0 / (h * l)))) * ((0.5 * (h * (math.pow((D * (0.5 * (M / d))), 2.0) / l))) + -1.0) elif d <= 1.05e-220: tmp = (-0.125 * (math.pow((D * M), 2.0) / d)) * math.sqrt((h / math.pow(l, 3.0))) else: tmp = (1.0 - (0.5 * (h * (math.pow((D * (M * (0.5 / d))), 2.0) / l)))) * (math.sqrt((d / l)) * math.sqrt((d / h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -3.2e-291) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64(h * Float64((Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0) / l))) + -1.0)); elseif (d <= 1.05e-220) tmp = Float64(Float64(-0.125 * Float64((Float64(D * M) ^ 2.0) / d)) * sqrt(Float64(h / (l ^ 3.0)))); else tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) / l)))) * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -3.2e-291) tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (h * (((D * (0.5 * (M / d))) ^ 2.0) / l))) + -1.0); elseif (d <= 1.05e-220) tmp = (-0.125 * (((D * M) ^ 2.0) / d)) * sqrt((h / (l ^ 3.0))); else tmp = (1.0 - (0.5 * (h * (((D * (M * (0.5 / d))) ^ 2.0) / l)))) * (sqrt((d / l)) * sqrt((d / h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -3.2e-291], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(h * N[(N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.05e-220], N[(N[(-0.125 * N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(0.5 * N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -3.2 \cdot 10^{-291}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left(h \cdot \frac{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\ell}\right) + -1\right)\\
\mathbf{elif}\;d \leq 1.05 \cdot 10^{-220}:\\
\;\;\;\;\left(-0.125 \cdot \frac{{\left(D \cdot M\right)}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 - 0.5 \cdot \left(h \cdot \frac{{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}\right)\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\end{array}
\end{array}
if d < -3.2000000000000002e-291Initial program 63.5%
Simplified64.1%
associate-*r/67.8%
frac-times67.9%
associate-/l*67.8%
*-commutative67.8%
Applied egg-rr67.8%
*-commutative67.8%
associate-/l*67.9%
associate-*r/67.2%
*-rgt-identity67.2%
times-frac67.2%
metadata-eval67.2%
*-commutative67.2%
associate-/l*68.6%
associate-*l*68.6%
Simplified68.6%
pow168.6%
sqrt-unprod59.4%
Applied egg-rr59.4%
unpow159.4%
associate-*r/53.8%
associate-*l/48.9%
unpow248.9%
Simplified48.9%
Taylor expanded in d around -inf 75.8%
if -3.2000000000000002e-291 < d < 1.04999999999999996e-220Initial program 30.4%
Simplified26.0%
associate-*r/26.2%
frac-times30.6%
associate-/l*26.2%
*-commutative26.2%
Applied egg-rr26.2%
*-commutative26.2%
associate-/l*21.5%
associate-*r/25.8%
*-rgt-identity25.8%
times-frac25.8%
metadata-eval25.8%
*-commutative25.8%
associate-/l*25.8%
associate-*l*25.8%
Simplified25.8%
Taylor expanded in d around 0 46.0%
associate-*r*46.0%
*-commutative46.0%
unpow246.0%
unpow246.0%
swap-sqr61.2%
unpow261.2%
Simplified61.2%
if 1.04999999999999996e-220 < d Initial program 74.7%
Simplified75.6%
associate-*r/80.6%
frac-times80.6%
associate-/l*80.6%
*-commutative80.6%
Applied egg-rr80.6%
*-commutative80.6%
associate-/l*82.5%
associate-*r/81.6%
*-rgt-identity81.6%
times-frac81.6%
metadata-eval81.6%
*-commutative81.6%
associate-/l*82.5%
associate-*l*82.5%
Simplified82.5%
*-un-lft-identity82.5%
associate-*l/82.5%
metadata-eval82.5%
div-inv82.5%
associate-*r/81.6%
div-inv81.6%
metadata-eval81.6%
Applied egg-rr81.6%
*-lft-identity81.6%
associate-/l*82.5%
associate-/l*82.5%
Simplified82.5%
Final simplification77.2%
(FPCore (d h l M D)
:precision binary64
(if (<= d -3.2e-291)
(*
(* d (sqrt (/ 1.0 (* h l))))
(+ (* 0.5 (* h (/ (pow (* D (* 0.5 (/ M d))) 2.0) l))) -1.0))
(if (<= d 6e-220)
(* (* -0.125 (/ (pow (* D M) 2.0) d)) (sqrt (/ h (pow l 3.0))))
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(- 1.0 (* h (* 0.125 (/ (pow (* D (/ M d)) 2.0) l)))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -3.2e-291) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (h * (pow((D * (0.5 * (M / d))), 2.0) / l))) + -1.0);
} else if (d <= 6e-220) {
tmp = (-0.125 * (pow((D * M), 2.0) / d)) * sqrt((h / pow(l, 3.0)));
} else {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (h * (0.125 * (pow((D * (M / d)), 2.0) / 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 <= (-3.2d-291)) then
tmp = (d * sqrt((1.0d0 / (h * l)))) * ((0.5d0 * (h * (((d_1 * (0.5d0 * (m / d))) ** 2.0d0) / l))) + (-1.0d0))
else if (d <= 6d-220) then
tmp = ((-0.125d0) * (((d_1 * m) ** 2.0d0) / d)) * sqrt((h / (l ** 3.0d0)))
else
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 - (h * (0.125d0 * (((d_1 * (m / d)) ** 2.0d0) / 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 <= -3.2e-291) {
tmp = (d * Math.sqrt((1.0 / (h * l)))) * ((0.5 * (h * (Math.pow((D * (0.5 * (M / d))), 2.0) / l))) + -1.0);
} else if (d <= 6e-220) {
tmp = (-0.125 * (Math.pow((D * M), 2.0) / d)) * Math.sqrt((h / Math.pow(l, 3.0)));
} else {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 - (h * (0.125 * (Math.pow((D * (M / d)), 2.0) / l)))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -3.2e-291: tmp = (d * math.sqrt((1.0 / (h * l)))) * ((0.5 * (h * (math.pow((D * (0.5 * (M / d))), 2.0) / l))) + -1.0) elif d <= 6e-220: tmp = (-0.125 * (math.pow((D * M), 2.0) / d)) * math.sqrt((h / math.pow(l, 3.0))) else: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 - (h * (0.125 * (math.pow((D * (M / d)), 2.0) / l))))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -3.2e-291) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64(h * Float64((Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0) / l))) + -1.0)); elseif (d <= 6e-220) tmp = Float64(Float64(-0.125 * Float64((Float64(D * M) ^ 2.0) / d)) * sqrt(Float64(h / (l ^ 3.0)))); else tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(h * Float64(0.125 * Float64((Float64(D * Float64(M / d)) ^ 2.0) / l)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -3.2e-291) tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (h * (((D * (0.5 * (M / d))) ^ 2.0) / l))) + -1.0); elseif (d <= 6e-220) tmp = (-0.125 * (((D * M) ^ 2.0) / d)) * sqrt((h / (l ^ 3.0))); else tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (h * (0.125 * (((D * (M / d)) ^ 2.0) / l))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -3.2e-291], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(h * N[(N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 6e-220], N[(N[(-0.125 * N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(h * N[(0.125 * N[(N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -3.2 \cdot 10^{-291}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left(h \cdot \frac{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\ell}\right) + -1\right)\\
\mathbf{elif}\;d \leq 6 \cdot 10^{-220}:\\
\;\;\;\;\left(-0.125 \cdot \frac{{\left(D \cdot M\right)}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - h \cdot \left(0.125 \cdot \frac{{\left(D \cdot \frac{M}{d}\right)}^{2}}{\ell}\right)\right)\right)\\
\end{array}
\end{array}
if d < -3.2000000000000002e-291Initial program 63.5%
Simplified64.1%
associate-*r/67.8%
frac-times67.9%
associate-/l*67.8%
*-commutative67.8%
Applied egg-rr67.8%
*-commutative67.8%
associate-/l*67.9%
associate-*r/67.2%
*-rgt-identity67.2%
times-frac67.2%
metadata-eval67.2%
*-commutative67.2%
associate-/l*68.6%
associate-*l*68.6%
Simplified68.6%
pow168.6%
sqrt-unprod59.4%
Applied egg-rr59.4%
unpow159.4%
associate-*r/53.8%
associate-*l/48.9%
unpow248.9%
Simplified48.9%
Taylor expanded in d around -inf 75.8%
if -3.2000000000000002e-291 < d < 6.00000000000000035e-220Initial program 30.4%
Simplified26.0%
associate-*r/26.2%
frac-times30.6%
associate-/l*26.2%
*-commutative26.2%
Applied egg-rr26.2%
*-commutative26.2%
associate-/l*21.5%
associate-*r/25.8%
*-rgt-identity25.8%
times-frac25.8%
metadata-eval25.8%
*-commutative25.8%
associate-/l*25.8%
associate-*l*25.8%
Simplified25.8%
Taylor expanded in d around 0 46.0%
associate-*r*46.0%
*-commutative46.0%
unpow246.0%
unpow246.0%
swap-sqr61.2%
unpow261.2%
Simplified61.2%
if 6.00000000000000035e-220 < d Initial program 74.7%
Simplified75.6%
Taylor expanded in h around -inf 60.5%
associate-*r*60.5%
neg-mul-160.5%
sub-neg60.5%
distribute-lft-in60.5%
Simplified81.7%
Final simplification76.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (pow (* D (* 0.5 (/ M d))) 2.0) l)))
(if (<= d -3.2e-291)
(* (* d (sqrt (/ 1.0 (* h l)))) (+ (* 0.5 (* h t_0)) -1.0))
(if (<= d 2.6e-220)
(* (* -0.125 (/ (pow (* D M) 2.0) d)) (sqrt (/ h (pow l 3.0))))
(* (sqrt (* (/ d l) (/ d h))) (- 1.0 (* (* h 0.5) t_0)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((D * (0.5 * (M / d))), 2.0) / l;
double tmp;
if (d <= -3.2e-291) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (h * t_0)) + -1.0);
} else if (d <= 2.6e-220) {
tmp = (-0.125 * (pow((D * M), 2.0) / d)) * sqrt((h / pow(l, 3.0)));
} else {
tmp = sqrt(((d / l) * (d / h))) * (1.0 - ((h * 0.5) * 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 = ((d_1 * (0.5d0 * (m / d))) ** 2.0d0) / l
if (d <= (-3.2d-291)) then
tmp = (d * sqrt((1.0d0 / (h * l)))) * ((0.5d0 * (h * t_0)) + (-1.0d0))
else if (d <= 2.6d-220) then
tmp = ((-0.125d0) * (((d_1 * m) ** 2.0d0) / d)) * sqrt((h / (l ** 3.0d0)))
else
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 - ((h * 0.5d0) * 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((D * (0.5 * (M / d))), 2.0) / l;
double tmp;
if (d <= -3.2e-291) {
tmp = (d * Math.sqrt((1.0 / (h * l)))) * ((0.5 * (h * t_0)) + -1.0);
} else if (d <= 2.6e-220) {
tmp = (-0.125 * (Math.pow((D * M), 2.0) / d)) * Math.sqrt((h / Math.pow(l, 3.0)));
} else {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 - ((h * 0.5) * t_0));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((D * (0.5 * (M / d))), 2.0) / l tmp = 0 if d <= -3.2e-291: tmp = (d * math.sqrt((1.0 / (h * l)))) * ((0.5 * (h * t_0)) + -1.0) elif d <= 2.6e-220: tmp = (-0.125 * (math.pow((D * M), 2.0) / d)) * math.sqrt((h / math.pow(l, 3.0))) else: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 - ((h * 0.5) * t_0)) return tmp
function code(d, h, l, M, D) t_0 = Float64((Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0) / l) tmp = 0.0 if (d <= -3.2e-291) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64(h * t_0)) + -1.0)); elseif (d <= 2.6e-220) tmp = Float64(Float64(-0.125 * Float64((Float64(D * M) ^ 2.0) / d)) * sqrt(Float64(h / (l ^ 3.0)))); else tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 - Float64(Float64(h * 0.5) * t_0))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = ((D * (0.5 * (M / d))) ^ 2.0) / l; tmp = 0.0; if (d <= -3.2e-291) tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (h * t_0)) + -1.0); elseif (d <= 2.6e-220) tmp = (-0.125 * (((D * M) ^ 2.0) / d)) * sqrt((h / (l ^ 3.0))); else tmp = sqrt(((d / l) * (d / h))) * (1.0 - ((h * 0.5) * t_0)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[d, -3.2e-291], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(h * t$95$0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.6e-220], N[(N[(-0.125 * N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[(h * 0.5), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\ell}\\
\mathbf{if}\;d \leq -3.2 \cdot 10^{-291}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left(h \cdot t\_0\right) + -1\right)\\
\mathbf{elif}\;d \leq 2.6 \cdot 10^{-220}:\\
\;\;\;\;\left(-0.125 \cdot \frac{{\left(D \cdot M\right)}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 - \left(h \cdot 0.5\right) \cdot t\_0\right)\\
\end{array}
\end{array}
if d < -3.2000000000000002e-291Initial program 63.5%
Simplified64.1%
associate-*r/67.8%
frac-times67.9%
associate-/l*67.8%
*-commutative67.8%
Applied egg-rr67.8%
*-commutative67.8%
associate-/l*67.9%
associate-*r/67.2%
*-rgt-identity67.2%
times-frac67.2%
metadata-eval67.2%
*-commutative67.2%
associate-/l*68.6%
associate-*l*68.6%
Simplified68.6%
pow168.6%
sqrt-unprod59.4%
Applied egg-rr59.4%
unpow159.4%
associate-*r/53.8%
associate-*l/48.9%
unpow248.9%
Simplified48.9%
Taylor expanded in d around -inf 75.8%
if -3.2000000000000002e-291 < d < 2.6e-220Initial program 30.4%
Simplified26.0%
associate-*r/26.2%
frac-times30.6%
associate-/l*26.2%
*-commutative26.2%
Applied egg-rr26.2%
*-commutative26.2%
associate-/l*21.5%
associate-*r/25.8%
*-rgt-identity25.8%
times-frac25.8%
metadata-eval25.8%
*-commutative25.8%
associate-/l*25.8%
associate-*l*25.8%
Simplified25.8%
Taylor expanded in d around 0 46.0%
associate-*r*46.0%
*-commutative46.0%
unpow246.0%
unpow246.0%
swap-sqr61.2%
unpow261.2%
Simplified61.2%
if 2.6e-220 < d Initial program 74.7%
Simplified75.6%
associate-*r/80.6%
frac-times80.6%
associate-/l*80.6%
*-commutative80.6%
Applied egg-rr80.6%
*-commutative80.6%
associate-/l*82.5%
associate-*r/81.6%
*-rgt-identity81.6%
times-frac81.6%
metadata-eval81.6%
*-commutative81.6%
associate-/l*82.5%
associate-*l*82.5%
Simplified82.5%
pow182.5%
Applied egg-rr65.1%
unpow165.1%
*-commutative65.1%
*-commutative65.1%
associate-/l*66.1%
*-commutative66.1%
associate-*r/66.1%
Simplified66.1%
Final simplification70.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (pow (* D (* 0.5 (/ M d))) 2.0) l)))
(if (<= d -3.2e-291)
(* (* d (sqrt (/ 1.0 (* h l)))) (+ (* 0.5 (* h t_0)) -1.0))
(if (<= d 2.8e-220)
(* -0.125 (* (pow (* D M) 2.0) (/ (sqrt (* h (pow l -3.0))) d)))
(* (sqrt (* (/ d l) (/ d h))) (- 1.0 (* (* h 0.5) t_0)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((D * (0.5 * (M / d))), 2.0) / l;
double tmp;
if (d <= -3.2e-291) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (h * t_0)) + -1.0);
} else if (d <= 2.8e-220) {
tmp = -0.125 * (pow((D * M), 2.0) * (sqrt((h * pow(l, -3.0))) / d));
} else {
tmp = sqrt(((d / l) * (d / h))) * (1.0 - ((h * 0.5) * 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 = ((d_1 * (0.5d0 * (m / d))) ** 2.0d0) / l
if (d <= (-3.2d-291)) then
tmp = (d * sqrt((1.0d0 / (h * l)))) * ((0.5d0 * (h * t_0)) + (-1.0d0))
else if (d <= 2.8d-220) then
tmp = (-0.125d0) * (((d_1 * m) ** 2.0d0) * (sqrt((h * (l ** (-3.0d0)))) / d))
else
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 - ((h * 0.5d0) * 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((D * (0.5 * (M / d))), 2.0) / l;
double tmp;
if (d <= -3.2e-291) {
tmp = (d * Math.sqrt((1.0 / (h * l)))) * ((0.5 * (h * t_0)) + -1.0);
} else if (d <= 2.8e-220) {
tmp = -0.125 * (Math.pow((D * M), 2.0) * (Math.sqrt((h * Math.pow(l, -3.0))) / d));
} else {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 - ((h * 0.5) * t_0));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((D * (0.5 * (M / d))), 2.0) / l tmp = 0 if d <= -3.2e-291: tmp = (d * math.sqrt((1.0 / (h * l)))) * ((0.5 * (h * t_0)) + -1.0) elif d <= 2.8e-220: tmp = -0.125 * (math.pow((D * M), 2.0) * (math.sqrt((h * math.pow(l, -3.0))) / d)) else: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 - ((h * 0.5) * t_0)) return tmp
function code(d, h, l, M, D) t_0 = Float64((Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0) / l) tmp = 0.0 if (d <= -3.2e-291) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64(h * t_0)) + -1.0)); elseif (d <= 2.8e-220) tmp = Float64(-0.125 * Float64((Float64(D * M) ^ 2.0) * Float64(sqrt(Float64(h * (l ^ -3.0))) / d))); else tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 - Float64(Float64(h * 0.5) * t_0))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = ((D * (0.5 * (M / d))) ^ 2.0) / l; tmp = 0.0; if (d <= -3.2e-291) tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (h * t_0)) + -1.0); elseif (d <= 2.8e-220) tmp = -0.125 * (((D * M) ^ 2.0) * (sqrt((h * (l ^ -3.0))) / d)); else tmp = sqrt(((d / l) * (d / h))) * (1.0 - ((h * 0.5) * t_0)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[d, -3.2e-291], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(h * t$95$0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.8e-220], N[(-0.125 * N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Sqrt[N[(h * N[Power[l, -3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[(h * 0.5), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\ell}\\
\mathbf{if}\;d \leq -3.2 \cdot 10^{-291}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left(h \cdot t\_0\right) + -1\right)\\
\mathbf{elif}\;d \leq 2.8 \cdot 10^{-220}:\\
\;\;\;\;-0.125 \cdot \left({\left(D \cdot M\right)}^{2} \cdot \frac{\sqrt{h \cdot {\ell}^{-3}}}{d}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 - \left(h \cdot 0.5\right) \cdot t\_0\right)\\
\end{array}
\end{array}
if d < -3.2000000000000002e-291Initial program 63.5%
Simplified64.1%
associate-*r/67.8%
frac-times67.9%
associate-/l*67.8%
*-commutative67.8%
Applied egg-rr67.8%
*-commutative67.8%
associate-/l*67.9%
associate-*r/67.2%
*-rgt-identity67.2%
times-frac67.2%
metadata-eval67.2%
*-commutative67.2%
associate-/l*68.6%
associate-*l*68.6%
Simplified68.6%
pow168.6%
sqrt-unprod59.4%
Applied egg-rr59.4%
unpow159.4%
associate-*r/53.8%
associate-*l/48.9%
unpow248.9%
Simplified48.9%
Taylor expanded in d around -inf 75.8%
if -3.2000000000000002e-291 < d < 2.7999999999999999e-220Initial program 30.4%
Simplified26.0%
Taylor expanded in d around 0 46.0%
pow146.0%
associate-*r*46.0%
pow-prod-down61.2%
div-inv61.2%
pow-flip61.2%
metadata-eval61.2%
Applied egg-rr61.2%
unpow161.2%
associate-*l*61.2%
associate-*l/56.5%
associate-/l*60.9%
Simplified60.9%
if 2.7999999999999999e-220 < d Initial program 74.7%
Simplified75.6%
associate-*r/80.6%
frac-times80.6%
associate-/l*80.6%
*-commutative80.6%
Applied egg-rr80.6%
*-commutative80.6%
associate-/l*82.5%
associate-*r/81.6%
*-rgt-identity81.6%
times-frac81.6%
metadata-eval81.6%
*-commutative81.6%
associate-/l*82.5%
associate-*l*82.5%
Simplified82.5%
pow182.5%
Applied egg-rr65.1%
unpow165.1%
*-commutative65.1%
*-commutative65.1%
associate-/l*66.1%
*-commutative66.1%
associate-*r/66.1%
Simplified66.1%
Final simplification70.9%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2.05e-303)
(*
(* d (sqrt (/ 1.0 (* h l))))
(+ (* 0.5 (* h (/ (pow (* D (* 0.5 (/ M d))) 2.0) l))) -1.0))
(if (<= l 1.15e+22)
(*
(sqrt (* (/ d l) (/ d h)))
(- 1.0 (* 0.5 (/ (* h (pow (* D (* M (/ 0.5 d))) 2.0)) l))))
(* d (* (pow l -0.5) (pow h -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.05e-303) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (h * (pow((D * (0.5 * (M / d))), 2.0) / l))) + -1.0);
} else if (l <= 1.15e+22) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h * pow((D * (M * (0.5 / d))), 2.0)) / l)));
} else {
tmp = d * (pow(l, -0.5) * pow(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 <= (-2.05d-303)) then
tmp = (d * sqrt((1.0d0 / (h * l)))) * ((0.5d0 * (h * (((d_1 * (0.5d0 * (m / d))) ** 2.0d0) / l))) + (-1.0d0))
else if (l <= 1.15d+22) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 - (0.5d0 * ((h * ((d_1 * (m * (0.5d0 / d))) ** 2.0d0)) / l)))
else
tmp = d * ((l ** (-0.5d0)) * (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 <= -2.05e-303) {
tmp = (d * Math.sqrt((1.0 / (h * l)))) * ((0.5 * (h * (Math.pow((D * (0.5 * (M / d))), 2.0) / l))) + -1.0);
} else if (l <= 1.15e+22) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h * Math.pow((D * (M * (0.5 / d))), 2.0)) / l)));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2.05e-303: tmp = (d * math.sqrt((1.0 / (h * l)))) * ((0.5 * (h * (math.pow((D * (0.5 * (M / d))), 2.0) / l))) + -1.0) elif l <= 1.15e+22: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h * math.pow((D * (M * (0.5 / d))), 2.0)) / l))) else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.05e-303) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64(h * Float64((Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0) / l))) + -1.0)); elseif (l <= 1.15e+22) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0)) / l)))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -2.05e-303) tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (h * (((D * (0.5 * (M / d))) ^ 2.0) / l))) + -1.0); elseif (l <= 1.15e+22) tmp = sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h * ((D * (M * (0.5 / d))) ^ 2.0)) / l))); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.05e-303], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(h * N[(N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.15e+22], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.05 \cdot 10^{-303}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left(h \cdot \frac{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\ell}\right) + -1\right)\\
\mathbf{elif}\;\ell \leq 1.15 \cdot 10^{+22}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -2.05000000000000009e-303Initial program 62.0%
Simplified62.7%
associate-*r/66.4%
frac-times66.4%
associate-/l*66.4%
*-commutative66.4%
Applied egg-rr66.4%
*-commutative66.4%
associate-/l*66.4%
associate-*r/65.8%
*-rgt-identity65.8%
times-frac65.8%
metadata-eval65.8%
*-commutative65.8%
associate-/l*67.1%
associate-*l*67.1%
Simplified67.1%
pow167.1%
sqrt-unprod58.0%
Applied egg-rr58.0%
unpow158.0%
associate-*r/53.1%
associate-*l/48.2%
unpow248.2%
Simplified48.2%
Taylor expanded in d around -inf 75.0%
if -2.05000000000000009e-303 < l < 1.1500000000000001e22Initial program 68.8%
Simplified68.7%
*-commutative68.7%
sqrt-unprod57.3%
Applied egg-rr57.3%
Taylor expanded in M around 0 57.3%
associate-*r/57.3%
*-commutative57.3%
associate-*r*57.3%
*-commutative57.3%
*-commutative57.3%
associate-*r/57.3%
Simplified57.3%
associate-*r/66.2%
associate-*r/66.2%
Applied egg-rr66.2%
if 1.1500000000000001e22 < l Initial program 69.1%
Simplified69.2%
associate-*r/67.6%
frac-times69.1%
associate-/l*67.6%
*-commutative67.6%
Applied egg-rr67.6%
*-commutative67.6%
associate-/l*71.1%
associate-*r/70.9%
*-rgt-identity70.9%
times-frac70.9%
metadata-eval70.9%
*-commutative70.9%
associate-/l*72.8%
associate-*l*72.8%
Simplified72.8%
Taylor expanded in d around inf 48.7%
associate-/r*48.6%
unpow1/248.6%
associate-/r*48.7%
rem-exp-log46.3%
exp-neg46.3%
exp-prod46.3%
distribute-lft-neg-out46.3%
distribute-rgt-neg-in46.3%
metadata-eval46.3%
exp-to-pow48.7%
Simplified48.7%
*-commutative48.7%
unpow-prod-down64.1%
Applied egg-rr64.1%
Final simplification70.5%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2.4e+163)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= l 1.9e+22)
(*
(sqrt (* (/ d l) (/ d h)))
(- 1.0 (* 0.5 (/ (* h (pow (* D (* M (/ 0.5 d))) 2.0)) l))))
(* d (* (pow l -0.5) (pow h -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.4e+163) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (l <= 1.9e+22) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h * pow((D * (M * (0.5 / d))), 2.0)) / l)));
} else {
tmp = d * (pow(l, -0.5) * pow(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 <= (-2.4d+163)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else if (l <= 1.9d+22) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 - (0.5d0 * ((h * ((d_1 * (m * (0.5d0 / d))) ** 2.0d0)) / l)))
else
tmp = d * ((l ** (-0.5d0)) * (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 <= -2.4e+163) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (l <= 1.9e+22) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h * Math.pow((D * (M * (0.5 / d))), 2.0)) / l)));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2.4e+163: tmp = d * -math.sqrt(((1.0 / l) / h)) elif l <= 1.9e+22: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h * math.pow((D * (M * (0.5 / d))), 2.0)) / l))) else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.4e+163) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (l <= 1.9e+22) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0)) / l)))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -2.4e+163) tmp = d * -sqrt(((1.0 / l) / h)); elseif (l <= 1.9e+22) tmp = sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h * ((D * (M * (0.5 / d))) ^ 2.0)) / l))); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.4e+163], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, 1.9e+22], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.4 \cdot 10^{+163}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;\ell \leq 1.9 \cdot 10^{+22}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -2.3999999999999999e163Initial program 36.5%
Simplified36.4%
Taylor expanded in d around inf 2.5%
Taylor expanded in h around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
associate-/l/0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt52.2%
neg-mul-152.2%
Simplified52.2%
if -2.3999999999999999e163 < l < 1.9000000000000002e22Initial program 70.4%
Simplified71.0%
*-commutative71.0%
sqrt-unprod59.7%
Applied egg-rr59.7%
Taylor expanded in M around 0 59.2%
associate-*r/59.2%
*-commutative59.2%
associate-*r*59.2%
*-commutative59.2%
*-commutative59.2%
associate-*r/59.7%
Simplified59.7%
associate-*r/65.7%
associate-*r/65.7%
Applied egg-rr65.7%
if 1.9000000000000002e22 < l Initial program 69.1%
Simplified69.2%
associate-*r/67.6%
frac-times69.1%
associate-/l*67.6%
*-commutative67.6%
Applied egg-rr67.6%
*-commutative67.6%
associate-/l*71.1%
associate-*r/70.9%
*-rgt-identity70.9%
times-frac70.9%
metadata-eval70.9%
*-commutative70.9%
associate-/l*72.8%
associate-*l*72.8%
Simplified72.8%
Taylor expanded in d around inf 48.7%
associate-/r*48.6%
unpow1/248.6%
associate-/r*48.7%
rem-exp-log46.3%
exp-neg46.3%
exp-prod46.3%
distribute-lft-neg-out46.3%
distribute-rgt-neg-in46.3%
metadata-eval46.3%
exp-to-pow48.7%
Simplified48.7%
*-commutative48.7%
unpow-prod-down64.1%
Applied egg-rr64.1%
Final simplification63.4%
(FPCore (d h l M D)
:precision binary64
(if (<= D 3.8e-7)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(*
(sqrt (* (/ d l) (/ d h)))
(- 1.0 (* (* h 0.5) (/ (pow (* D (* 0.5 (/ M d))) 2.0) l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 3.8e-7) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = sqrt(((d / l) * (d / h))) * (1.0 - ((h * 0.5) * (pow((D * (0.5 * (M / d))), 2.0) / 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 <= 3.8d-7) then
tmp = sqrt((d / l)) * sqrt((d / h))
else
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 - ((h * 0.5d0) * (((d_1 * (0.5d0 * (m / d))) ** 2.0d0) / 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 <= 3.8e-7) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 - ((h * 0.5) * (Math.pow((D * (0.5 * (M / d))), 2.0) / l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if D <= 3.8e-7: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) else: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 - ((h * 0.5) * (math.pow((D * (0.5 * (M / d))), 2.0) / l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (D <= 3.8e-7) 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(Float64(h * 0.5) * Float64((Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0) / l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (D <= 3.8e-7) tmp = sqrt((d / l)) * sqrt((d / h)); else tmp = sqrt(((d / l) * (d / h))) * (1.0 - ((h * 0.5) * (((D * (0.5 * (M / d))) ^ 2.0) / l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[D, 3.8e-7], 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[(N[(h * 0.5), $MachinePrecision] * N[(N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \leq 3.8 \cdot 10^{-7}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 - \left(h \cdot 0.5\right) \cdot \frac{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\ell}\right)\\
\end{array}
\end{array}
if D < 3.80000000000000015e-7Initial program 65.9%
Simplified65.9%
Taylor expanded in d around inf 45.4%
if 3.80000000000000015e-7 < D Initial program 63.4%
Simplified64.9%
associate-*r/66.4%
frac-times67.7%
associate-/l*66.4%
*-commutative66.4%
Applied egg-rr66.4%
*-commutative66.4%
associate-/l*70.7%
associate-*r/69.2%
*-rgt-identity69.2%
times-frac69.2%
metadata-eval69.2%
*-commutative69.2%
associate-/l*72.1%
associate-*l*72.1%
Simplified72.1%
pow172.1%
Applied egg-rr59.1%
unpow159.1%
*-commutative59.1%
*-commutative59.1%
associate-/l*62.0%
*-commutative62.0%
associate-*r/62.0%
Simplified62.0%
Final simplification49.7%
(FPCore (d h l M D)
:precision binary64
(if (<= M 5e-114)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(*
(sqrt (* (/ d l) (/ d h)))
(- 1.0 (* 0.5 (* (/ h l) (pow (* D (/ (* 0.5 M) d)) 2.0)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 5e-114) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h / l) * pow((D * ((0.5 * M) / d)), 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) :: tmp
if (m <= 5d-114) then
tmp = sqrt((d / l)) * sqrt((d / h))
else
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 - (0.5d0 * ((h / l) * ((d_1 * ((0.5d0 * m) / d)) ** 2.0d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 5e-114) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h / l) * Math.pow((D * ((0.5 * M) / d)), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if M <= 5e-114: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) else: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h / l) * math.pow((D * ((0.5 * M) / d)), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (M <= 5e-114) 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(h / l) * (Float64(D * Float64(Float64(0.5 * M) / d)) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (M <= 5e-114) tmp = sqrt((d / l)) * sqrt((d / h)); else tmp = sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h / l) * ((D * ((0.5 * M) / d)) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[M, 5e-114], 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[(h / l), $MachinePrecision] * N[Power[N[(D * N[(N[(0.5 * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 5 \cdot 10^{-114}:\\
\;\;\;\;\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(\frac{h}{\ell} \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if M < 4.99999999999999989e-114Initial program 65.7%
Simplified65.2%
Taylor expanded in d around inf 43.1%
if 4.99999999999999989e-114 < M Initial program 64.3%
Simplified66.6%
*-commutative66.6%
sqrt-unprod57.1%
Applied egg-rr57.1%
Taylor expanded in M around 0 54.7%
associate-*r/54.7%
*-commutative54.7%
associate-*r*54.7%
*-commutative54.7%
*-commutative54.7%
associate-*r/57.1%
Simplified57.1%
Final simplification47.4%
(FPCore (d h l M D) :precision binary64 (if (<= d 1.65e-250) (* (- d) (pow (* h l) -0.5)) (* d (/ (sqrt (/ 1.0 h)) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 1.65e-250) {
tmp = -d * pow((h * l), -0.5);
} else {
tmp = d * (sqrt((1.0 / h)) / sqrt(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.65d-250) then
tmp = -d * ((h * l) ** (-0.5d0))
else
tmp = d * (sqrt((1.0d0 / h)) / sqrt(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.65e-250) {
tmp = -d * Math.pow((h * l), -0.5);
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 1.65e-250: tmp = -d * math.pow((h * l), -0.5) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 1.65e-250) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= 1.65e-250) tmp = -d * ((h * l) ^ -0.5); else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 1.65e-250], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.65 \cdot 10^{-250}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < 1.65e-250Initial program 59.9%
Simplified59.9%
Taylor expanded in d around inf 7.1%
Taylor expanded in h around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
unpow1/20.0%
associate-/r*0.0%
rem-exp-log0.0%
exp-neg0.0%
exp-prod0.0%
distribute-lft-neg-out0.0%
distribute-rgt-neg-in0.0%
metadata-eval0.0%
exp-to-pow0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt41.6%
neg-mul-141.6%
Simplified41.6%
if 1.65e-250 < d Initial program 73.0%
Simplified73.9%
associate-*r/78.6%
frac-times78.6%
associate-/l*78.6%
*-commutative78.6%
Applied egg-rr78.6%
*-commutative78.6%
associate-/l*80.4%
associate-*r/79.5%
*-rgt-identity79.5%
times-frac79.5%
metadata-eval79.5%
*-commutative79.5%
associate-/l*80.4%
associate-*l*80.4%
Simplified80.4%
Taylor expanded in d around inf 41.4%
associate-/r*41.4%
Simplified41.4%
sqrt-div52.9%
Applied egg-rr52.9%
Final simplification46.2%
(FPCore (d h l M D) :precision binary64 (if (<= d 6e-251) (* (- d) (pow (* h l) -0.5)) (* d (* (pow l -0.5) (pow h -0.5)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 6e-251) {
tmp = -d * pow((h * l), -0.5);
} else {
tmp = d * (pow(l, -0.5) * pow(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 (d <= 6d-251) then
tmp = -d * ((h * l) ** (-0.5d0))
else
tmp = d * ((l ** (-0.5d0)) * (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 (d <= 6e-251) {
tmp = -d * Math.pow((h * l), -0.5);
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 6e-251: tmp = -d * math.pow((h * l), -0.5) else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 6e-251) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= 6e-251) tmp = -d * ((h * l) ^ -0.5); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 6e-251], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 6 \cdot 10^{-251}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if d < 5.9999999999999997e-251Initial program 59.9%
Simplified59.9%
Taylor expanded in d around inf 7.1%
Taylor expanded in h around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
unpow1/20.0%
associate-/r*0.0%
rem-exp-log0.0%
exp-neg0.0%
exp-prod0.0%
distribute-lft-neg-out0.0%
distribute-rgt-neg-in0.0%
metadata-eval0.0%
exp-to-pow0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt41.6%
neg-mul-141.6%
Simplified41.6%
if 5.9999999999999997e-251 < d Initial program 73.0%
Simplified73.9%
associate-*r/78.6%
frac-times78.6%
associate-/l*78.6%
*-commutative78.6%
Applied egg-rr78.6%
*-commutative78.6%
associate-/l*80.4%
associate-*r/79.5%
*-rgt-identity79.5%
times-frac79.5%
metadata-eval79.5%
*-commutative79.5%
associate-/l*80.4%
associate-*l*80.4%
Simplified80.4%
Taylor expanded in d around inf 41.4%
associate-/r*41.4%
unpow1/241.4%
associate-/r*41.4%
rem-exp-log39.5%
exp-neg39.5%
exp-prod40.1%
distribute-lft-neg-out40.1%
distribute-rgt-neg-in40.1%
metadata-eval40.1%
exp-to-pow42.0%
Simplified42.0%
*-commutative42.0%
unpow-prod-down52.9%
Applied egg-rr52.9%
Final simplification46.2%
(FPCore (d h l M D) :precision binary64 (if (<= d 6.5e-251) (* (- d) (pow (* h l) -0.5)) (* d (/ 1.0 (sqrt (* h l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 6.5e-251) {
tmp = -d * pow((h * l), -0.5);
} else {
tmp = d * (1.0 / 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 <= 6.5d-251) then
tmp = -d * ((h * l) ** (-0.5d0))
else
tmp = d * (1.0d0 / 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 <= 6.5e-251) {
tmp = -d * Math.pow((h * l), -0.5);
} else {
tmp = d * (1.0 / Math.sqrt((h * l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 6.5e-251: tmp = -d * math.pow((h * l), -0.5) else: tmp = d * (1.0 / math.sqrt((h * l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 6.5e-251) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); else tmp = Float64(d * Float64(1.0 / sqrt(Float64(h * l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= 6.5e-251) tmp = -d * ((h * l) ^ -0.5); else tmp = d * (1.0 / sqrt((h * l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 6.5e-251], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[(1.0 / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 6.5 \cdot 10^{-251}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{1}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if d < 6.5000000000000002e-251Initial program 59.9%
Simplified59.9%
Taylor expanded in d around inf 7.1%
Taylor expanded in h around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
unpow1/20.0%
associate-/r*0.0%
rem-exp-log0.0%
exp-neg0.0%
exp-prod0.0%
distribute-lft-neg-out0.0%
distribute-rgt-neg-in0.0%
metadata-eval0.0%
exp-to-pow0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt41.6%
neg-mul-141.6%
Simplified41.6%
if 6.5000000000000002e-251 < d Initial program 73.0%
Simplified73.9%
Taylor expanded in d around inf 41.4%
sqrt-div42.0%
metadata-eval42.0%
Applied egg-rr42.0%
Final simplification41.8%
(FPCore (d h l M D) :precision binary64 (* d (/ 1.0 (sqrt (* h l)))))
double code(double d, double h, double l, double M, double D) {
return d * (1.0 / 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 * (1.0d0 / sqrt((h * l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * (1.0 / Math.sqrt((h * l)));
}
def code(d, h, l, M, D): return d * (1.0 / math.sqrt((h * l)))
function code(d, h, l, M, D) return Float64(d * Float64(1.0 / sqrt(Float64(h * l)))) end
function tmp = code(d, h, l, M, D) tmp = d * (1.0 / sqrt((h * l))); end
code[d_, h_, l_, M_, D_] := N[(d * N[(1.0 / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot \frac{1}{\sqrt{h \cdot \ell}}
\end{array}
Initial program 65.2%
Simplified65.6%
Taylor expanded in d around inf 21.0%
sqrt-div21.3%
metadata-eval21.3%
Applied egg-rr21.3%
(FPCore (d h l M D) :precision binary64 (* d (pow (* h l) -0.5)))
double code(double d, double h, double l, double M, double D) {
return d * pow((h * l), -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 * ((h * l) ** (-0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.pow((h * l), -0.5);
}
def code(d, h, l, M, D): return d * math.pow((h * l), -0.5)
function code(d, h, l, M, D) return Float64(d * (Float64(h * l) ^ -0.5)) end
function tmp = code(d, h, l, M, D) tmp = d * ((h * l) ^ -0.5); end
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot {\left(h \cdot \ell\right)}^{-0.5}
\end{array}
Initial program 65.2%
Simplified65.6%
associate-*r/69.5%
frac-times69.9%
associate-/l*69.5%
*-commutative69.5%
Applied egg-rr69.5%
*-commutative69.5%
associate-/l*69.9%
associate-*r/69.5%
*-rgt-identity69.5%
times-frac69.5%
metadata-eval69.5%
*-commutative69.5%
associate-/l*70.6%
associate-*l*70.6%
Simplified70.6%
Taylor expanded in d around inf 21.0%
associate-/r*21.0%
unpow1/221.0%
associate-/r*21.0%
rem-exp-log20.2%
exp-neg20.2%
exp-prod20.5%
distribute-lft-neg-out20.5%
distribute-rgt-neg-in20.5%
metadata-eval20.5%
exp-to-pow21.3%
Simplified21.3%
herbie shell --seed 2024152
(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)))))