
(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 22 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
(if (<=
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0)) (/ h l))))
5e+285)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* (pow (/ (/ (* M D) 2.0) d) 2.0) (* 0.5 (/ h l)))))
(* (fabs (pow (* h l) -0.5)) (fabs d))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((0.5 * pow(((M * D) / (d * 2.0)), 2.0)) * (h / l)))) <= 5e+285) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (pow((((M * D) / 2.0) / d), 2.0) * (0.5 * (h / l))));
} else {
tmp = fabs(pow((h * l), -0.5)) * fabs(d);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((0.5d0 * (((m * d_1) / (d * 2.0d0)) ** 2.0d0)) * (h / l)))) <= 5d+285) then
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0d0 - (((((m * d_1) / 2.0d0) / d) ** 2.0d0) * (0.5d0 * (h / l))))
else
tmp = abs(((h * l) ** (-0.5d0))) * abs(d)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((0.5 * Math.pow(((M * D) / (d * 2.0)), 2.0)) * (h / l)))) <= 5e+285) {
tmp = (Math.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - (Math.pow((((M * D) / 2.0) / d), 2.0) * (0.5 * (h / l))));
} else {
tmp = Math.abs(Math.pow((h * l), -0.5)) * Math.abs(d);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if ((math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((0.5 * math.pow(((M * D) / (d * 2.0)), 2.0)) * (h / l)))) <= 5e+285: tmp = (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - (math.pow((((M * D) / 2.0) / d), 2.0) * (0.5 * (h / l)))) else: tmp = math.fabs(math.pow((h * l), -0.5)) * math.fabs(d) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(0.5 * (Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0)) * Float64(h / l)))) <= 5e+285) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64((Float64(Float64(Float64(M * D) / 2.0) / d) ^ 2.0) * Float64(0.5 * Float64(h / l))))); else tmp = Float64(abs((Float64(h * l) ^ -0.5)) * abs(d)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((0.5 * (((M * D) / (d * 2.0)) ^ 2.0)) * (h / l)))) <= 5e+285) tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (((((M * D) / 2.0) / d) ^ 2.0) * (0.5 * (h / l)))); else tmp = abs(((h * l) ^ -0.5)) * abs(d); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(0.5 * N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+285], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[Power[N[(N[(N[(M * D), $MachinePrecision] / 2.0), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * N[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]], $MachinePrecision] * N[Abs[d], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 5 \cdot 10^{+285}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{\frac{M \cdot D}{2}}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|{\left(h \cdot \ell\right)}^{-0.5}\right| \cdot \left|d\right|\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < 5.00000000000000016e285Initial program 86.8%
metadata-eval86.8%
unpow1/286.8%
metadata-eval86.8%
unpow1/286.8%
*-commutative86.8%
associate-*l*86.8%
times-frac85.9%
metadata-eval85.9%
Simplified85.9%
frac-times86.8%
associate-/r*86.8%
Applied egg-rr86.8%
if 5.00000000000000016e285 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) Initial program 22.9%
Taylor expanded in d around inf 28.8%
*-un-lft-identity28.8%
*-commutative28.8%
Applied egg-rr28.8%
*-lft-identity28.8%
associate-/r*28.8%
Simplified28.8%
add-sqr-sqrt28.0%
sqrt-unprod34.1%
pow234.1%
*-commutative34.1%
associate-/l/34.1%
inv-pow34.1%
Applied egg-rr34.1%
unpow234.1%
rem-sqrt-square57.3%
sqr-pow57.4%
rem-sqrt-square57.4%
metadata-eval57.4%
Simplified57.4%
Final simplification78.1%
(FPCore (d h l M D) :precision binary64 (* (sqrt (/ d h)) (* (sqrt (/ d l)) (- 1.0 (* 0.5 (* (/ h l) (pow (* (/ M 2.0) (/ D d)) 2.0)))))))
double code(double d, double h, double l, double M, double D) {
return sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * pow(((M / 2.0) * (D / d)), 2.0)))));
}
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 = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((h / l) * (((m / 2.0d0) * (d_1 / d)) ** 2.0d0)))))
end function
public static double code(double d, double h, double l, double M, double D) {
return Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * Math.pow(((M / 2.0) * (D / d)), 2.0)))));
}
def code(d, h, l, M, D): return math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * math.pow(((M / 2.0) * (D / d)), 2.0)))))
function code(d, h, l, M, D) return Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0)))))) end
function tmp = code(d, h, l, M, D) tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * (((M / 2.0) * (D / d)) ^ 2.0))))); end
code[d_, h_, l_, M_, D_] := N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right)\right)
\end{array}
Initial program 67.8%
associate-*l*67.8%
metadata-eval67.8%
unpow1/267.8%
metadata-eval67.8%
unpow1/267.8%
associate-*l*67.8%
metadata-eval67.8%
times-frac67.2%
Simplified67.2%
Final simplification67.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h)))
(t_1 (sqrt (/ d l)))
(t_2
(*
(* t_0 t_1)
(- 1.0 (* 0.125 (/ (* (* h M) (* D (* M D))) (* l (* d d))))))))
(if (<= d -2.1e+156)
(*
t_0
(*
t_1
(- 1.0 (* 0.5 (* (* (/ D d) (/ D d)) (* (/ M (/ l (* h M))) 0.25))))))
(if (<= d -6.5e+70)
(* (fabs (pow (* h l) -0.5)) (fabs d))
(if (<= d -4.5e-155)
t_2
(if (<= d -5e-310)
(* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
(if (<= d 5.1e-163)
(* -0.125 (* (* D (* D (* M (/ M d)))) (sqrt (/ h (pow l 3.0)))))
(if (<= d 5.7e+88)
t_2
(if (<= d 8e+178)
(*
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ M 2.0) (/ D d)) 2.0))))
(sqrt (/ (* d (/ d h)) l)))
(* d (* (pow h -0.5) (pow l -0.5))))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = sqrt((d / l));
double t_2 = (t_0 * t_1) * (1.0 - (0.125 * (((h * M) * (D * (M * D))) / (l * (d * d)))));
double tmp;
if (d <= -2.1e+156) {
tmp = t_0 * (t_1 * (1.0 - (0.5 * (((D / d) * (D / d)) * ((M / (l / (h * M))) * 0.25)))));
} else if (d <= -6.5e+70) {
tmp = fabs(pow((h * l), -0.5)) * fabs(d);
} else if (d <= -4.5e-155) {
tmp = t_2;
} else if (d <= -5e-310) {
tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
} else if (d <= 5.1e-163) {
tmp = -0.125 * ((D * (D * (M * (M / d)))) * sqrt((h / pow(l, 3.0))));
} else if (d <= 5.7e+88) {
tmp = t_2;
} else if (d <= 8e+178) {
tmp = (1.0 - (0.5 * ((h / l) * pow(((M / 2.0) * (D / d)), 2.0)))) * sqrt(((d * (d / h)) / l));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h));
double t_1 = Math.sqrt((d / l));
double t_2 = (t_0 * t_1) * (1.0 - (0.125 * (((h * M) * (D * (M * D))) / (l * (d * d)))));
double tmp;
if (d <= -2.1e+156) {
tmp = t_0 * (t_1 * (1.0 - (0.5 * (((D / d) * (D / d)) * ((M / (l / (h * M))) * 0.25)))));
} else if (d <= -6.5e+70) {
tmp = Math.abs(Math.pow((h * l), -0.5)) * Math.abs(d);
} else if (d <= -4.5e-155) {
tmp = t_2;
} else if (d <= -5e-310) {
tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
} else if (d <= 5.1e-163) {
tmp = -0.125 * ((D * (D * (M * (M / d)))) * Math.sqrt((h / Math.pow(l, 3.0))));
} else if (d <= 5.7e+88) {
tmp = t_2;
} else if (d <= 8e+178) {
tmp = (1.0 - (0.5 * ((h / l) * Math.pow(((M / 2.0) * (D / d)), 2.0)))) * Math.sqrt(((d * (d / h)) / l));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) t_1 = math.sqrt((d / l)) t_2 = (t_0 * t_1) * (1.0 - (0.125 * (((h * M) * (D * (M * D))) / (l * (d * d))))) tmp = 0 if d <= -2.1e+156: tmp = t_0 * (t_1 * (1.0 - (0.5 * (((D / d) * (D / d)) * ((M / (l / (h * M))) * 0.25))))) elif d <= -6.5e+70: tmp = math.fabs(math.pow((h * l), -0.5)) * math.fabs(d) elif d <= -4.5e-155: tmp = t_2 elif d <= -5e-310: tmp = d * math.exp((-0.5 * math.log1p(((l * (1.0 / h)) + -1.0)))) elif d <= 5.1e-163: tmp = -0.125 * ((D * (D * (M * (M / d)))) * math.sqrt((h / math.pow(l, 3.0)))) elif d <= 5.7e+88: tmp = t_2 elif d <= 8e+178: tmp = (1.0 - (0.5 * ((h / l) * math.pow(((M / 2.0) * (D / d)), 2.0)))) * math.sqrt(((d * (d / h)) / l)) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = sqrt(Float64(d / l)) t_2 = Float64(Float64(t_0 * t_1) * Float64(1.0 - Float64(0.125 * Float64(Float64(Float64(h * M) * Float64(D * Float64(M * D))) / Float64(l * Float64(d * d)))))) tmp = 0.0 if (d <= -2.1e+156) tmp = Float64(t_0 * Float64(t_1 * Float64(1.0 - Float64(0.5 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M / Float64(l / Float64(h * M))) * 0.25)))))); elseif (d <= -6.5e+70) tmp = Float64(abs((Float64(h * l) ^ -0.5)) * abs(d)); elseif (d <= -4.5e-155) tmp = t_2; elseif (d <= -5e-310) tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0))))); elseif (d <= 5.1e-163) tmp = Float64(-0.125 * Float64(Float64(D * Float64(D * Float64(M * Float64(M / d)))) * sqrt(Float64(h / (l ^ 3.0))))); elseif (d <= 5.7e+88) tmp = t_2; elseif (d <= 8e+178) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0)))) * sqrt(Float64(Float64(d * Float64(d / h)) / l))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$0 * t$95$1), $MachinePrecision] * N[(1.0 - N[(0.125 * N[(N[(N[(h * M), $MachinePrecision] * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.1e+156], N[(t$95$0 * N[(t$95$1 * N[(1.0 - N[(0.5 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M / N[(l / N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -6.5e+70], N[(N[Abs[N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]], $MachinePrecision] * N[Abs[d], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -4.5e-155], t$95$2, If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.1e-163], N[(-0.125 * N[(N[(D * N[(D * N[(M * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.7e+88], t$95$2, If[LessEqual[d, 8e+178], N[(N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := \left(t_0 \cdot t_1\right) \cdot \left(1 - 0.125 \cdot \frac{\left(h \cdot M\right) \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\
\mathbf{if}\;d \leq -2.1 \cdot 10^{+156}:\\
\;\;\;\;t_0 \cdot \left(t_1 \cdot \left(1 - 0.5 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{\frac{\ell}{h \cdot M}} \cdot 0.25\right)\right)\right)\right)\\
\mathbf{elif}\;d \leq -6.5 \cdot 10^{+70}:\\
\;\;\;\;\left|{\left(h \cdot \ell\right)}^{-0.5}\right| \cdot \left|d\right|\\
\mathbf{elif}\;d \leq -4.5 \cdot 10^{-155}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\
\mathbf{elif}\;d \leq 5.1 \cdot 10^{-163}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\
\mathbf{elif}\;d \leq 5.7 \cdot 10^{+88}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;d \leq 8 \cdot 10^{+178}:\\
\;\;\;\;\left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d \cdot \frac{d}{h}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -2.09999999999999981e156Initial program 85.1%
associate-*l*85.1%
metadata-eval85.1%
unpow1/285.1%
metadata-eval85.1%
unpow1/285.1%
associate-*l*85.1%
metadata-eval85.1%
times-frac85.0%
Simplified85.0%
Taylor expanded in M around 0 85.1%
metadata-eval85.1%
*-commutative85.1%
times-frac85.1%
*-lft-identity85.1%
associate-/l/85.1%
*-commutative85.1%
associate-*r/81.3%
associate-/l*81.2%
Simplified81.2%
Taylor expanded in D around 0 38.8%
associate-/l*38.8%
*-commutative38.8%
associate-/l*38.8%
*-commutative38.8%
times-frac35.0%
associate-*l*35.0%
unpow235.0%
unpow235.0%
times-frac77.6%
unpow277.6%
associate-*l*77.6%
associate-/l*81.6%
Simplified81.6%
if -2.09999999999999981e156 < d < -6.49999999999999978e70Initial program 49.8%
Taylor expanded in d around inf 15.2%
*-un-lft-identity15.2%
*-commutative15.2%
Applied egg-rr15.2%
*-lft-identity15.2%
associate-/r*15.2%
Simplified15.2%
add-sqr-sqrt0.3%
sqrt-unprod35.8%
pow235.8%
*-commutative35.8%
associate-/l/35.8%
inv-pow35.8%
Applied egg-rr35.8%
unpow235.8%
rem-sqrt-square71.6%
sqr-pow71.5%
rem-sqrt-square71.5%
metadata-eval71.5%
Simplified71.5%
if -6.49999999999999978e70 < d < -4.5000000000000004e-155 or 5.0999999999999999e-163 < d < 5.70000000000000021e88Initial program 79.4%
metadata-eval79.4%
unpow1/279.4%
metadata-eval79.4%
unpow1/279.4%
*-commutative79.4%
associate-*l*79.4%
times-frac77.1%
metadata-eval77.1%
Simplified77.1%
frac-times79.4%
associate-/r*79.4%
Applied egg-rr79.4%
Taylor expanded in M around 0 63.4%
*-commutative63.4%
*-commutative63.4%
unpow263.4%
associate-*r*67.0%
unpow267.0%
associate-*r*71.7%
*-commutative71.7%
unpow271.7%
associate-*r*79.6%
*-commutative79.6%
Simplified79.6%
if -4.5000000000000004e-155 < d < -4.999999999999985e-310Initial program 32.2%
Taylor expanded in d around inf 14.4%
*-un-lft-identity14.4%
*-commutative14.4%
Applied egg-rr14.4%
*-lft-identity14.4%
unpow-114.4%
sqr-pow14.4%
rem-sqrt-square14.4%
sqr-pow14.4%
fabs-sqr14.4%
sqr-pow14.4%
metadata-eval14.4%
Simplified14.4%
Taylor expanded in h around -inf 8.2%
log1p-expm1-u33.3%
expm1-udef33.3%
Applied egg-rr49.3%
if -4.999999999999985e-310 < d < 5.0999999999999999e-163Initial program 33.3%
metadata-eval33.3%
unpow1/233.3%
metadata-eval33.3%
unpow1/233.3%
*-commutative33.3%
associate-*l*33.3%
times-frac37.5%
metadata-eval37.5%
Simplified37.5%
frac-times33.3%
associate-/r*33.3%
Applied egg-rr33.3%
Taylor expanded in d around 0 36.0%
associate-*r/31.9%
unpow231.9%
unpow231.9%
associate-*l*40.5%
associate-/l*48.9%
associate-/r/48.9%
Simplified48.9%
if 5.70000000000000021e88 < d < 8.0000000000000004e178Initial program 94.8%
metadata-eval94.8%
unpow1/294.8%
metadata-eval94.8%
unpow1/294.8%
*-commutative94.8%
associate-*l*94.8%
times-frac94.8%
metadata-eval94.8%
Simplified94.8%
frac-times94.8%
associate-/r*94.8%
Applied egg-rr94.8%
sqrt-div99.6%
pow1/299.6%
metadata-eval99.6%
associate-*r*99.6%
associate-/r*99.6%
*-commutative99.6%
metadata-eval99.6%
pow199.6%
Applied egg-rr90.3%
unpow190.3%
*-commutative90.3%
associate-*l/90.4%
associate-*r*90.4%
*-commutative90.4%
associate-*l*90.4%
Simplified90.4%
if 8.0000000000000004e178 < d Initial program 69.7%
Taylor expanded in d around inf 71.7%
*-un-lft-identity71.7%
*-commutative71.7%
Applied egg-rr71.7%
*-lft-identity71.7%
unpow-171.7%
sqr-pow71.8%
rem-sqrt-square71.8%
sqr-pow71.6%
fabs-sqr71.6%
sqr-pow71.8%
metadata-eval71.8%
Simplified71.8%
unpow-prod-down81.9%
Applied egg-rr81.9%
Final simplification73.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ M 2.0) (/ D d)) 2.0))))
(sqrt (/ (* d (/ d h)) l)))))
(if (<= d -1.46e-112)
t_0
(if (<= d -5e-310)
(* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
(if (<= d 1.75e-93)
(* (/ (sqrt h) (pow l 1.5)) (/ -0.125 (/ d (* M (* M (* D D))))))
(if (or (<= d 2400000.0) (and (not (<= d 7.2e+84)) (<= d 1e+178)))
t_0
(* d (* (pow h -0.5) (pow l -0.5)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (1.0 - (0.5 * ((h / l) * pow(((M / 2.0) * (D / d)), 2.0)))) * sqrt(((d * (d / h)) / l));
double tmp;
if (d <= -1.46e-112) {
tmp = t_0;
} else if (d <= -5e-310) {
tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
} else if (d <= 1.75e-93) {
tmp = (sqrt(h) / pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D)))));
} else if ((d <= 2400000.0) || (!(d <= 7.2e+84) && (d <= 1e+178))) {
tmp = t_0;
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (1.0 - (0.5 * ((h / l) * Math.pow(((M / 2.0) * (D / d)), 2.0)))) * Math.sqrt(((d * (d / h)) / l));
double tmp;
if (d <= -1.46e-112) {
tmp = t_0;
} else if (d <= -5e-310) {
tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
} else if (d <= 1.75e-93) {
tmp = (Math.sqrt(h) / Math.pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D)))));
} else if ((d <= 2400000.0) || (!(d <= 7.2e+84) && (d <= 1e+178))) {
tmp = t_0;
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (1.0 - (0.5 * ((h / l) * math.pow(((M / 2.0) * (D / d)), 2.0)))) * math.sqrt(((d * (d / h)) / l)) tmp = 0 if d <= -1.46e-112: tmp = t_0 elif d <= -5e-310: tmp = d * math.exp((-0.5 * math.log1p(((l * (1.0 / h)) + -1.0)))) elif d <= 1.75e-93: tmp = (math.sqrt(h) / math.pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D))))) elif (d <= 2400000.0) or (not (d <= 7.2e+84) and (d <= 1e+178)): tmp = t_0 else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0)))) * sqrt(Float64(Float64(d * Float64(d / h)) / l))) tmp = 0.0 if (d <= -1.46e-112) tmp = t_0; elseif (d <= -5e-310) tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0))))); elseif (d <= 1.75e-93) tmp = Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(-0.125 / Float64(d / Float64(M * Float64(M * Float64(D * D)))))); elseif ((d <= 2400000.0) || (!(d <= 7.2e+84) && (d <= 1e+178))) tmp = t_0; else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.46e-112], t$95$0, If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.75e-93], N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(-0.125 / N[(d / N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[d, 2400000.0], And[N[Not[LessEqual[d, 7.2e+84]], $MachinePrecision], LessEqual[d, 1e+178]]], t$95$0, N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d \cdot \frac{d}{h}}{\ell}}\\
\mathbf{if}\;d \leq -1.46 \cdot 10^{-112}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\
\mathbf{elif}\;d \leq 1.75 \cdot 10^{-93}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \frac{-0.125}{\frac{d}{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}}\\
\mathbf{elif}\;d \leq 2400000 \lor \neg \left(d \leq 7.2 \cdot 10^{+84}\right) \land d \leq 10^{+178}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -1.46000000000000002e-112 or 1.75e-93 < d < 2.4e6 or 7.1999999999999999e84 < d < 1.0000000000000001e178Initial program 77.5%
metadata-eval77.5%
unpow1/277.5%
metadata-eval77.5%
unpow1/277.5%
*-commutative77.5%
associate-*l*77.5%
times-frac76.7%
metadata-eval76.7%
Simplified76.7%
frac-times77.5%
associate-/r*77.5%
Applied egg-rr77.5%
sqrt-div34.5%
pow1/234.5%
metadata-eval34.5%
associate-*r*34.5%
associate-/r*34.5%
*-commutative34.5%
metadata-eval34.5%
pow134.5%
Applied egg-rr71.0%
unpow171.0%
*-commutative71.0%
associate-*l/68.8%
associate-*r*68.8%
*-commutative68.8%
associate-*l*68.8%
Simplified68.8%
if -1.46000000000000002e-112 < d < -4.999999999999985e-310Initial program 43.3%
Taylor expanded in d around inf 11.3%
*-un-lft-identity11.3%
*-commutative11.3%
Applied egg-rr11.3%
*-lft-identity11.3%
unpow-111.3%
sqr-pow11.3%
rem-sqrt-square11.3%
sqr-pow11.3%
fabs-sqr11.3%
sqr-pow11.3%
metadata-eval11.3%
Simplified11.3%
Taylor expanded in h around -inf 6.8%
log1p-expm1-u27.2%
expm1-udef27.2%
Applied egg-rr47.9%
if -4.999999999999985e-310 < d < 1.75e-93Initial program 54.5%
Taylor expanded in d around 0 43.0%
associate-*r*43.0%
*-commutative43.0%
associate-*r/43.0%
associate-/l*43.0%
unpow243.0%
associate-*r*48.4%
unpow248.4%
Simplified48.4%
sqrt-div53.8%
Applied egg-rr53.8%
sqr-pow53.8%
rem-sqrt-square56.4%
sqr-pow56.3%
fabs-sqr56.3%
sqr-pow56.4%
metadata-eval56.4%
Simplified56.4%
if 2.4e6 < d < 7.1999999999999999e84 or 1.0000000000000001e178 < d Initial program 74.7%
Taylor expanded in d around inf 63.2%
*-un-lft-identity63.2%
*-commutative63.2%
Applied egg-rr63.2%
*-lft-identity63.2%
unpow-163.2%
sqr-pow63.2%
rem-sqrt-square63.2%
sqr-pow63.0%
fabs-sqr63.0%
sqr-pow63.2%
metadata-eval63.2%
Simplified63.2%
unpow-prod-down81.9%
Applied egg-rr81.9%
Final simplification65.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (sqrt (/ d h)) (sqrt (/ d l)))))
(if (<= d -2.9e-153)
(* t_0 (- 1.0 (* 0.125 (* (* M (/ M d)) (* (/ h d) (* D (/ D l)))))))
(if (<= d -5e-310)
(* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
(if (<= d 1.55e-91)
(* (/ (sqrt h) (pow l 1.5)) (/ -0.125 (/ d (* M (* M (* D D))))))
(if (<= d 1.08e+86)
(*
t_0
(- 1.0 (* 0.125 (* (/ D l) (/ (* D (* M M)) (/ (* d d) h))))))
(if (<= d 7.2e+189)
(*
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ M 2.0) (/ D d)) 2.0))))
(sqrt (/ (* d (/ d h)) l)))
(* d (* (pow h -0.5) (pow l -0.5))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h)) * sqrt((d / l));
double tmp;
if (d <= -2.9e-153) {
tmp = t_0 * (1.0 - (0.125 * ((M * (M / d)) * ((h / d) * (D * (D / l))))));
} else if (d <= -5e-310) {
tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
} else if (d <= 1.55e-91) {
tmp = (sqrt(h) / pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D)))));
} else if (d <= 1.08e+86) {
tmp = t_0 * (1.0 - (0.125 * ((D / l) * ((D * (M * M)) / ((d * d) / h)))));
} else if (d <= 7.2e+189) {
tmp = (1.0 - (0.5 * ((h / l) * pow(((M / 2.0) * (D / d)), 2.0)))) * sqrt(((d * (d / h)) / l));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h)) * Math.sqrt((d / l));
double tmp;
if (d <= -2.9e-153) {
tmp = t_0 * (1.0 - (0.125 * ((M * (M / d)) * ((h / d) * (D * (D / l))))));
} else if (d <= -5e-310) {
tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
} else if (d <= 1.55e-91) {
tmp = (Math.sqrt(h) / Math.pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D)))));
} else if (d <= 1.08e+86) {
tmp = t_0 * (1.0 - (0.125 * ((D / l) * ((D * (M * M)) / ((d * d) / h)))));
} else if (d <= 7.2e+189) {
tmp = (1.0 - (0.5 * ((h / l) * Math.pow(((M / 2.0) * (D / d)), 2.0)))) * Math.sqrt(((d * (d / h)) / l));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) * math.sqrt((d / l)) tmp = 0 if d <= -2.9e-153: tmp = t_0 * (1.0 - (0.125 * ((M * (M / d)) * ((h / d) * (D * (D / l)))))) elif d <= -5e-310: tmp = d * math.exp((-0.5 * math.log1p(((l * (1.0 / h)) + -1.0)))) elif d <= 1.55e-91: tmp = (math.sqrt(h) / math.pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D))))) elif d <= 1.08e+86: tmp = t_0 * (1.0 - (0.125 * ((D / l) * ((D * (M * M)) / ((d * d) / h))))) elif d <= 7.2e+189: tmp = (1.0 - (0.5 * ((h / l) * math.pow(((M / 2.0) * (D / d)), 2.0)))) * math.sqrt(((d * (d / h)) / l)) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) tmp = 0.0 if (d <= -2.9e-153) tmp = Float64(t_0 * Float64(1.0 - Float64(0.125 * Float64(Float64(M * Float64(M / d)) * Float64(Float64(h / d) * Float64(D * Float64(D / l))))))); elseif (d <= -5e-310) tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0))))); elseif (d <= 1.55e-91) tmp = Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(-0.125 / Float64(d / Float64(M * Float64(M * Float64(D * D)))))); elseif (d <= 1.08e+86) tmp = Float64(t_0 * Float64(1.0 - Float64(0.125 * Float64(Float64(D / l) * Float64(Float64(D * Float64(M * M)) / Float64(Float64(d * d) / h)))))); elseif (d <= 7.2e+189) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0)))) * sqrt(Float64(Float64(d * Float64(d / h)) / l))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.9e-153], N[(t$95$0 * N[(1.0 - N[(0.125 * N[(N[(M * N[(M / d), $MachinePrecision]), $MachinePrecision] * N[(N[(h / d), $MachinePrecision] * N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.55e-91], N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(-0.125 / N[(d / N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.08e+86], N[(t$95$0 * N[(1.0 - N[(0.125 * N[(N[(D / l), $MachinePrecision] * N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7.2e+189], N[(N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;d \leq -2.9 \cdot 10^{-153}:\\
\;\;\;\;t_0 \cdot \left(1 - 0.125 \cdot \left(\left(M \cdot \frac{M}{d}\right) \cdot \left(\frac{h}{d} \cdot \left(D \cdot \frac{D}{\ell}\right)\right)\right)\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\
\mathbf{elif}\;d \leq 1.55 \cdot 10^{-91}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \frac{-0.125}{\frac{d}{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}}\\
\mathbf{elif}\;d \leq 1.08 \cdot 10^{+86}:\\
\;\;\;\;t_0 \cdot \left(1 - 0.125 \cdot \left(\frac{D}{\ell} \cdot \frac{D \cdot \left(M \cdot M\right)}{\frac{d \cdot d}{h}}\right)\right)\\
\mathbf{elif}\;d \leq 7.2 \cdot 10^{+189}:\\
\;\;\;\;\left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d \cdot \frac{d}{h}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -2.90000000000000002e-153Initial program 72.4%
metadata-eval72.4%
unpow1/272.4%
metadata-eval72.4%
unpow1/272.4%
*-commutative72.4%
associate-*l*72.4%
times-frac70.8%
metadata-eval70.8%
Simplified70.8%
frac-times72.4%
associate-/r*72.4%
Applied egg-rr72.4%
Taylor expanded in M around 0 51.7%
*-commutative51.7%
times-frac50.3%
*-commutative50.3%
unpow250.3%
associate-*r*51.5%
unpow251.5%
associate-*l/54.1%
associate-*r*53.0%
unpow253.0%
unpow253.0%
times-frac61.1%
unpow261.1%
associate-/r/61.1%
*-commutative61.1%
associate-*l*63.2%
associate-/l*65.4%
Simplified65.4%
if -2.90000000000000002e-153 < d < -4.999999999999985e-310Initial program 32.2%
Taylor expanded in d around inf 14.4%
*-un-lft-identity14.4%
*-commutative14.4%
Applied egg-rr14.4%
*-lft-identity14.4%
unpow-114.4%
sqr-pow14.4%
rem-sqrt-square14.4%
sqr-pow14.4%
fabs-sqr14.4%
sqr-pow14.4%
metadata-eval14.4%
Simplified14.4%
Taylor expanded in h around -inf 8.2%
log1p-expm1-u33.3%
expm1-udef33.3%
Applied egg-rr49.3%
if -4.999999999999985e-310 < d < 1.5499999999999999e-91Initial program 55.6%
Taylor expanded in d around 0 41.9%
associate-*r*41.9%
*-commutative41.9%
associate-*r/41.9%
associate-/l*41.9%
unpow241.9%
associate-*r*47.3%
unpow247.3%
Simplified47.3%
sqrt-div52.4%
Applied egg-rr52.4%
sqr-pow52.4%
rem-sqrt-square55.0%
sqr-pow54.9%
fabs-sqr54.9%
sqr-pow55.0%
metadata-eval55.0%
Simplified55.0%
if 1.5499999999999999e-91 < d < 1.07999999999999993e86Initial program 80.3%
metadata-eval80.3%
unpow1/280.3%
metadata-eval80.3%
unpow1/280.3%
*-commutative80.3%
associate-*l*80.3%
times-frac78.2%
metadata-eval78.2%
Simplified78.2%
frac-times80.3%
associate-/r*80.3%
Applied egg-rr80.3%
Taylor expanded in M around 0 65.1%
*-commutative65.1%
times-frac62.9%
*-commutative62.9%
unpow262.9%
associate-*r*65.0%
unpow265.0%
associate-*l/69.6%
associate-*r*67.4%
unpow267.4%
unpow267.4%
times-frac65.1%
unpow265.1%
associate-/r/65.1%
*-commutative65.1%
associate-*l*64.9%
associate-/l*65.0%
Simplified64.9%
Taylor expanded in M around 0 65.1%
unpow265.1%
unpow265.1%
times-frac62.9%
associate-*l/67.4%
unpow267.4%
*-commutative67.4%
associate-*l*74.1%
*-commutative74.1%
associate-/l*74.0%
associate-*l/74.0%
Simplified74.0%
if 1.07999999999999993e86 < d < 7.20000000000000017e189Initial program 94.8%
metadata-eval94.8%
unpow1/294.8%
metadata-eval94.8%
unpow1/294.8%
*-commutative94.8%
associate-*l*94.8%
times-frac94.8%
metadata-eval94.8%
Simplified94.8%
frac-times94.8%
associate-/r*94.8%
Applied egg-rr94.8%
sqrt-div99.6%
pow1/299.6%
metadata-eval99.6%
associate-*r*99.6%
associate-/r*99.6%
*-commutative99.6%
metadata-eval99.6%
pow199.6%
Applied egg-rr90.3%
unpow190.3%
*-commutative90.3%
associate-*l/90.4%
associate-*r*90.4%
*-commutative90.4%
associate-*l*90.4%
Simplified90.4%
if 7.20000000000000017e189 < d Initial program 69.7%
Taylor expanded in d around inf 71.7%
*-un-lft-identity71.7%
*-commutative71.7%
Applied egg-rr71.7%
*-lft-identity71.7%
unpow-171.7%
sqr-pow71.8%
rem-sqrt-square71.8%
sqr-pow71.6%
fabs-sqr71.6%
sqr-pow71.8%
metadata-eval71.8%
Simplified71.8%
unpow-prod-down81.9%
Applied egg-rr81.9%
Final simplification67.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* M (/ M d))) (t_1 (* (sqrt (/ d h)) (sqrt (/ d l)))))
(if (<= d -1.45e-155)
(* t_1 (- 1.0 (* 0.125 (* t_0 (* (/ h d) (* D (/ D l)))))))
(if (<= d -5e-310)
(* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
(if (<= d 5.1e-163)
(* -0.125 (* (* D (* D t_0)) (sqrt (/ h (pow l 3.0)))))
(if (<= d 3.5e+85)
(*
t_1
(- 1.0 (* 0.125 (/ (* (* h M) (* D (* M D))) (* l (* d d))))))
(if (<= d 2e+183)
(*
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ M 2.0) (/ D d)) 2.0))))
(sqrt (/ (* d (/ d h)) l)))
(* d (* (pow h -0.5) (pow l -0.5))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = M * (M / d);
double t_1 = sqrt((d / h)) * sqrt((d / l));
double tmp;
if (d <= -1.45e-155) {
tmp = t_1 * (1.0 - (0.125 * (t_0 * ((h / d) * (D * (D / l))))));
} else if (d <= -5e-310) {
tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
} else if (d <= 5.1e-163) {
tmp = -0.125 * ((D * (D * t_0)) * sqrt((h / pow(l, 3.0))));
} else if (d <= 3.5e+85) {
tmp = t_1 * (1.0 - (0.125 * (((h * M) * (D * (M * D))) / (l * (d * d)))));
} else if (d <= 2e+183) {
tmp = (1.0 - (0.5 * ((h / l) * pow(((M / 2.0) * (D / d)), 2.0)))) * sqrt(((d * (d / h)) / l));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = M * (M / d);
double t_1 = Math.sqrt((d / h)) * Math.sqrt((d / l));
double tmp;
if (d <= -1.45e-155) {
tmp = t_1 * (1.0 - (0.125 * (t_0 * ((h / d) * (D * (D / l))))));
} else if (d <= -5e-310) {
tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
} else if (d <= 5.1e-163) {
tmp = -0.125 * ((D * (D * t_0)) * Math.sqrt((h / Math.pow(l, 3.0))));
} else if (d <= 3.5e+85) {
tmp = t_1 * (1.0 - (0.125 * (((h * M) * (D * (M * D))) / (l * (d * d)))));
} else if (d <= 2e+183) {
tmp = (1.0 - (0.5 * ((h / l) * Math.pow(((M / 2.0) * (D / d)), 2.0)))) * Math.sqrt(((d * (d / h)) / l));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = M * (M / d) t_1 = math.sqrt((d / h)) * math.sqrt((d / l)) tmp = 0 if d <= -1.45e-155: tmp = t_1 * (1.0 - (0.125 * (t_0 * ((h / d) * (D * (D / l)))))) elif d <= -5e-310: tmp = d * math.exp((-0.5 * math.log1p(((l * (1.0 / h)) + -1.0)))) elif d <= 5.1e-163: tmp = -0.125 * ((D * (D * t_0)) * math.sqrt((h / math.pow(l, 3.0)))) elif d <= 3.5e+85: tmp = t_1 * (1.0 - (0.125 * (((h * M) * (D * (M * D))) / (l * (d * d))))) elif d <= 2e+183: tmp = (1.0 - (0.5 * ((h / l) * math.pow(((M / 2.0) * (D / d)), 2.0)))) * math.sqrt(((d * (d / h)) / l)) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = Float64(M * Float64(M / d)) t_1 = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) tmp = 0.0 if (d <= -1.45e-155) tmp = Float64(t_1 * Float64(1.0 - Float64(0.125 * Float64(t_0 * Float64(Float64(h / d) * Float64(D * Float64(D / l))))))); elseif (d <= -5e-310) tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0))))); elseif (d <= 5.1e-163) tmp = Float64(-0.125 * Float64(Float64(D * Float64(D * t_0)) * sqrt(Float64(h / (l ^ 3.0))))); elseif (d <= 3.5e+85) tmp = Float64(t_1 * Float64(1.0 - Float64(0.125 * Float64(Float64(Float64(h * M) * Float64(D * Float64(M * D))) / Float64(l * Float64(d * d)))))); elseif (d <= 2e+183) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0)))) * sqrt(Float64(Float64(d * Float64(d / h)) / l))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(M / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.45e-155], N[(t$95$1 * N[(1.0 - N[(0.125 * N[(t$95$0 * N[(N[(h / d), $MachinePrecision] * N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.1e-163], N[(-0.125 * N[(N[(D * N[(D * t$95$0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.5e+85], N[(t$95$1 * N[(1.0 - N[(0.125 * N[(N[(N[(h * M), $MachinePrecision] * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2e+183], N[(N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M \cdot \frac{M}{d}\\
t_1 := \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;d \leq -1.45 \cdot 10^{-155}:\\
\;\;\;\;t_1 \cdot \left(1 - 0.125 \cdot \left(t_0 \cdot \left(\frac{h}{d} \cdot \left(D \cdot \frac{D}{\ell}\right)\right)\right)\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\
\mathbf{elif}\;d \leq 5.1 \cdot 10^{-163}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot t_0\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\
\mathbf{elif}\;d \leq 3.5 \cdot 10^{+85}:\\
\;\;\;\;t_1 \cdot \left(1 - 0.125 \cdot \frac{\left(h \cdot M\right) \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\
\mathbf{elif}\;d \leq 2 \cdot 10^{+183}:\\
\;\;\;\;\left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d \cdot \frac{d}{h}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -1.45000000000000005e-155Initial program 72.4%
metadata-eval72.4%
unpow1/272.4%
metadata-eval72.4%
unpow1/272.4%
*-commutative72.4%
associate-*l*72.4%
times-frac70.8%
metadata-eval70.8%
Simplified70.8%
frac-times72.4%
associate-/r*72.4%
Applied egg-rr72.4%
Taylor expanded in M around 0 51.7%
*-commutative51.7%
times-frac50.3%
*-commutative50.3%
unpow250.3%
associate-*r*51.5%
unpow251.5%
associate-*l/54.1%
associate-*r*53.0%
unpow253.0%
unpow253.0%
times-frac61.1%
unpow261.1%
associate-/r/61.1%
*-commutative61.1%
associate-*l*63.2%
associate-/l*65.4%
Simplified65.4%
if -1.45000000000000005e-155 < d < -4.999999999999985e-310Initial program 32.2%
Taylor expanded in d around inf 14.4%
*-un-lft-identity14.4%
*-commutative14.4%
Applied egg-rr14.4%
*-lft-identity14.4%
unpow-114.4%
sqr-pow14.4%
rem-sqrt-square14.4%
sqr-pow14.4%
fabs-sqr14.4%
sqr-pow14.4%
metadata-eval14.4%
Simplified14.4%
Taylor expanded in h around -inf 8.2%
log1p-expm1-u33.3%
expm1-udef33.3%
Applied egg-rr49.3%
if -4.999999999999985e-310 < d < 5.0999999999999999e-163Initial program 33.3%
metadata-eval33.3%
unpow1/233.3%
metadata-eval33.3%
unpow1/233.3%
*-commutative33.3%
associate-*l*33.3%
times-frac37.5%
metadata-eval37.5%
Simplified37.5%
frac-times33.3%
associate-/r*33.3%
Applied egg-rr33.3%
Taylor expanded in d around 0 36.0%
associate-*r/31.9%
unpow231.9%
unpow231.9%
associate-*l*40.5%
associate-/l*48.9%
associate-/r/48.9%
Simplified48.9%
if 5.0999999999999999e-163 < d < 3.50000000000000005e85Initial program 82.3%
metadata-eval82.3%
unpow1/282.3%
metadata-eval82.3%
unpow1/282.3%
*-commutative82.3%
associate-*l*82.3%
times-frac80.7%
metadata-eval80.7%
Simplified80.7%
frac-times82.3%
associate-/r*82.3%
Applied egg-rr82.3%
Taylor expanded in M around 0 61.2%
*-commutative61.2%
*-commutative61.2%
unpow261.2%
associate-*r*64.5%
unpow264.5%
associate-*r*69.4%
*-commutative69.4%
unpow269.4%
associate-*r*79.2%
*-commutative79.2%
Simplified79.2%
if 3.50000000000000005e85 < d < 1.99999999999999989e183Initial program 94.8%
metadata-eval94.8%
unpow1/294.8%
metadata-eval94.8%
unpow1/294.8%
*-commutative94.8%
associate-*l*94.8%
times-frac94.8%
metadata-eval94.8%
Simplified94.8%
frac-times94.8%
associate-/r*94.8%
Applied egg-rr94.8%
sqrt-div99.6%
pow1/299.6%
metadata-eval99.6%
associate-*r*99.6%
associate-/r*99.6%
*-commutative99.6%
metadata-eval99.6%
pow199.6%
Applied egg-rr90.3%
unpow190.3%
*-commutative90.3%
associate-*l/90.4%
associate-*r*90.4%
*-commutative90.4%
associate-*l*90.4%
Simplified90.4%
if 1.99999999999999989e183 < d Initial program 69.7%
Taylor expanded in d around inf 71.7%
*-un-lft-identity71.7%
*-commutative71.7%
Applied egg-rr71.7%
*-lft-identity71.7%
unpow-171.7%
sqr-pow71.8%
rem-sqrt-square71.8%
sqr-pow71.6%
fabs-sqr71.6%
sqr-pow71.8%
metadata-eval71.8%
Simplified71.8%
unpow-prod-down81.9%
Applied egg-rr81.9%
Final simplification69.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(+ 1.0 (* -0.5 (* (/ h l) (pow (* D (/ (/ M d) 2.0)) 2.0))))
(sqrt (* (/ d h) (/ d l))))))
(if (<= d -3.8e-112)
t_0
(if (<= d -5e-310)
(* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
(if (<= d 1.02e-163)
(* -0.125 (* (* D (* D (* M (/ M d)))) (sqrt (/ h (pow l 3.0)))))
(if (<= d 1.85e+179) t_0 (* d (* (pow h -0.5) (pow l -0.5)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (1.0 + (-0.5 * ((h / l) * pow((D * ((M / d) / 2.0)), 2.0)))) * sqrt(((d / h) * (d / l)));
double tmp;
if (d <= -3.8e-112) {
tmp = t_0;
} else if (d <= -5e-310) {
tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
} else if (d <= 1.02e-163) {
tmp = -0.125 * ((D * (D * (M * (M / d)))) * sqrt((h / pow(l, 3.0))));
} else if (d <= 1.85e+179) {
tmp = t_0;
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (1.0 + (-0.5 * ((h / l) * Math.pow((D * ((M / d) / 2.0)), 2.0)))) * Math.sqrt(((d / h) * (d / l)));
double tmp;
if (d <= -3.8e-112) {
tmp = t_0;
} else if (d <= -5e-310) {
tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
} else if (d <= 1.02e-163) {
tmp = -0.125 * ((D * (D * (M * (M / d)))) * Math.sqrt((h / Math.pow(l, 3.0))));
} else if (d <= 1.85e+179) {
tmp = t_0;
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (1.0 + (-0.5 * ((h / l) * math.pow((D * ((M / d) / 2.0)), 2.0)))) * math.sqrt(((d / h) * (d / l))) tmp = 0 if d <= -3.8e-112: tmp = t_0 elif d <= -5e-310: tmp = d * math.exp((-0.5 * math.log1p(((l * (1.0 / h)) + -1.0)))) elif d <= 1.02e-163: tmp = -0.125 * ((D * (D * (M * (M / d)))) * math.sqrt((h / math.pow(l, 3.0)))) elif d <= 1.85e+179: tmp = t_0 else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(Float64(M / d) / 2.0)) ^ 2.0)))) * sqrt(Float64(Float64(d / h) * Float64(d / l)))) tmp = 0.0 if (d <= -3.8e-112) tmp = t_0; elseif (d <= -5e-310) tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0))))); elseif (d <= 1.02e-163) tmp = Float64(-0.125 * Float64(Float64(D * Float64(D * Float64(M * Float64(M / d)))) * sqrt(Float64(h / (l ^ 3.0))))); elseif (d <= 1.85e+179) tmp = t_0; else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(N[(M / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -3.8e-112], t$95$0, If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.02e-163], N[(-0.125 * N[(N[(D * N[(D * N[(M * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.85e+179], t$95$0, N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{if}\;d \leq -3.8 \cdot 10^{-112}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\
\mathbf{elif}\;d \leq 1.02 \cdot 10^{-163}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\
\mathbf{elif}\;d \leq 1.85 \cdot 10^{+179}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -3.79999999999999995e-112 or 1.02000000000000007e-163 < d < 1.85e179Initial program 78.9%
Applied egg-rr20.6%
expm1-def35.3%
expm1-log1p69.0%
cancel-sign-sub-inv69.0%
metadata-eval69.0%
associate-*l/71.0%
*-commutative71.0%
associate-/l*69.0%
associate-*r/69.0%
*-commutative69.0%
associate-*r/69.0%
+-commutative69.0%
fma-def69.0%
Simplified69.0%
if -3.79999999999999995e-112 < d < -4.999999999999985e-310Initial program 43.3%
Taylor expanded in d around inf 11.3%
*-un-lft-identity11.3%
*-commutative11.3%
Applied egg-rr11.3%
*-lft-identity11.3%
unpow-111.3%
sqr-pow11.3%
rem-sqrt-square11.3%
sqr-pow11.3%
fabs-sqr11.3%
sqr-pow11.3%
metadata-eval11.3%
Simplified11.3%
Taylor expanded in h around -inf 6.8%
log1p-expm1-u27.2%
expm1-udef27.2%
Applied egg-rr47.9%
if -4.999999999999985e-310 < d < 1.02000000000000007e-163Initial program 33.3%
metadata-eval33.3%
unpow1/233.3%
metadata-eval33.3%
unpow1/233.3%
*-commutative33.3%
associate-*l*33.3%
times-frac37.5%
metadata-eval37.5%
Simplified37.5%
frac-times33.3%
associate-/r*33.3%
Applied egg-rr33.3%
Taylor expanded in d around 0 36.0%
associate-*r/31.9%
unpow231.9%
unpow231.9%
associate-*l*40.5%
associate-/l*48.9%
associate-/r/48.9%
Simplified48.9%
if 1.85e179 < d Initial program 69.7%
Taylor expanded in d around inf 71.7%
*-un-lft-identity71.7%
*-commutative71.7%
Applied egg-rr71.7%
*-lft-identity71.7%
unpow-171.7%
sqr-pow71.8%
rem-sqrt-square71.8%
sqr-pow71.6%
fabs-sqr71.6%
sqr-pow71.8%
metadata-eval71.8%
Simplified71.8%
unpow-prod-down81.9%
Applied egg-rr81.9%
Final simplification65.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* M (/ M d))))
(if (<= d -3.4e-157)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* 0.125 (* t_0 (* (/ h d) (* D (/ D l)))))))
(if (<= d -5e-310)
(* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
(if (<= d 1.08e-163)
(* -0.125 (* (* D (* D t_0)) (sqrt (/ h (pow l 3.0)))))
(if (<= d 3.05e+178)
(*
(+ 1.0 (* -0.5 (* (/ h l) (pow (* D (/ (/ M d) 2.0)) 2.0))))
(sqrt (* (/ d h) (/ d l))))
(* d (* (pow h -0.5) (pow l -0.5)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = M * (M / d);
double tmp;
if (d <= -3.4e-157) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.125 * (t_0 * ((h / d) * (D * (D / l))))));
} else if (d <= -5e-310) {
tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
} else if (d <= 1.08e-163) {
tmp = -0.125 * ((D * (D * t_0)) * sqrt((h / pow(l, 3.0))));
} else if (d <= 3.05e+178) {
tmp = (1.0 + (-0.5 * ((h / l) * pow((D * ((M / d) / 2.0)), 2.0)))) * sqrt(((d / h) * (d / l)));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = M * (M / d);
double tmp;
if (d <= -3.4e-157) {
tmp = (Math.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - (0.125 * (t_0 * ((h / d) * (D * (D / l))))));
} else if (d <= -5e-310) {
tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
} else if (d <= 1.08e-163) {
tmp = -0.125 * ((D * (D * t_0)) * Math.sqrt((h / Math.pow(l, 3.0))));
} else if (d <= 3.05e+178) {
tmp = (1.0 + (-0.5 * ((h / l) * Math.pow((D * ((M / d) / 2.0)), 2.0)))) * Math.sqrt(((d / h) * (d / l)));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = M * (M / d) tmp = 0 if d <= -3.4e-157: tmp = (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - (0.125 * (t_0 * ((h / d) * (D * (D / l)))))) elif d <= -5e-310: tmp = d * math.exp((-0.5 * math.log1p(((l * (1.0 / h)) + -1.0)))) elif d <= 1.08e-163: tmp = -0.125 * ((D * (D * t_0)) * math.sqrt((h / math.pow(l, 3.0)))) elif d <= 3.05e+178: tmp = (1.0 + (-0.5 * ((h / l) * math.pow((D * ((M / d) / 2.0)), 2.0)))) * math.sqrt(((d / h) * (d / l))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = Float64(M * Float64(M / d)) tmp = 0.0 if (d <= -3.4e-157) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.125 * Float64(t_0 * Float64(Float64(h / d) * Float64(D * Float64(D / l))))))); elseif (d <= -5e-310) tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0))))); elseif (d <= 1.08e-163) tmp = Float64(-0.125 * Float64(Float64(D * Float64(D * t_0)) * sqrt(Float64(h / (l ^ 3.0))))); elseif (d <= 3.05e+178) tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(Float64(M / d) / 2.0)) ^ 2.0)))) * sqrt(Float64(Float64(d / h) * Float64(d / l)))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(M / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -3.4e-157], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.125 * N[(t$95$0 * N[(N[(h / d), $MachinePrecision] * N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.08e-163], N[(-0.125 * N[(N[(D * N[(D * t$95$0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.05e+178], N[(N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(N[(M / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M \cdot \frac{M}{d}\\
\mathbf{if}\;d \leq -3.4 \cdot 10^{-157}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(t_0 \cdot \left(\frac{h}{d} \cdot \left(D \cdot \frac{D}{\ell}\right)\right)\right)\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\
\mathbf{elif}\;d \leq 1.08 \cdot 10^{-163}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot t_0\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\
\mathbf{elif}\;d \leq 3.05 \cdot 10^{+178}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -3.39999999999999977e-157Initial program 72.4%
metadata-eval72.4%
unpow1/272.4%
metadata-eval72.4%
unpow1/272.4%
*-commutative72.4%
associate-*l*72.4%
times-frac70.8%
metadata-eval70.8%
Simplified70.8%
frac-times72.4%
associate-/r*72.4%
Applied egg-rr72.4%
Taylor expanded in M around 0 51.7%
*-commutative51.7%
times-frac50.3%
*-commutative50.3%
unpow250.3%
associate-*r*51.5%
unpow251.5%
associate-*l/54.1%
associate-*r*53.0%
unpow253.0%
unpow253.0%
times-frac61.1%
unpow261.1%
associate-/r/61.1%
*-commutative61.1%
associate-*l*63.2%
associate-/l*65.4%
Simplified65.4%
if -3.39999999999999977e-157 < d < -4.999999999999985e-310Initial program 32.2%
Taylor expanded in d around inf 14.4%
*-un-lft-identity14.4%
*-commutative14.4%
Applied egg-rr14.4%
*-lft-identity14.4%
unpow-114.4%
sqr-pow14.4%
rem-sqrt-square14.4%
sqr-pow14.4%
fabs-sqr14.4%
sqr-pow14.4%
metadata-eval14.4%
Simplified14.4%
Taylor expanded in h around -inf 8.2%
log1p-expm1-u33.3%
expm1-udef33.3%
Applied egg-rr49.3%
if -4.999999999999985e-310 < d < 1.0800000000000001e-163Initial program 33.3%
metadata-eval33.3%
unpow1/233.3%
metadata-eval33.3%
unpow1/233.3%
*-commutative33.3%
associate-*l*33.3%
times-frac37.5%
metadata-eval37.5%
Simplified37.5%
frac-times33.3%
associate-/r*33.3%
Applied egg-rr33.3%
Taylor expanded in d around 0 36.0%
associate-*r/31.9%
unpow231.9%
unpow231.9%
associate-*l*40.5%
associate-/l*48.9%
associate-/r/48.9%
Simplified48.9%
if 1.0800000000000001e-163 < d < 3.05e178Initial program 85.4%
Applied egg-rr19.3%
expm1-def37.1%
expm1-log1p71.4%
cancel-sign-sub-inv71.4%
metadata-eval71.4%
associate-*l/72.7%
*-commutative72.7%
associate-/l*71.3%
associate-*r/71.3%
*-commutative71.3%
associate-*r/71.3%
+-commutative71.3%
fma-def71.3%
Simplified71.4%
if 3.05e178 < d Initial program 69.7%
Taylor expanded in d around inf 71.7%
*-un-lft-identity71.7%
*-commutative71.7%
Applied egg-rr71.7%
*-lft-identity71.7%
unpow-171.7%
sqr-pow71.8%
rem-sqrt-square71.8%
sqr-pow71.6%
fabs-sqr71.6%
sqr-pow71.8%
metadata-eval71.8%
Simplified71.8%
unpow-prod-down81.9%
Applied egg-rr81.9%
Final simplification65.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ 1.0 (* h l))))
(if (<= d -6e-52)
(* d (cbrt (* (/ -1.0 (* h l)) (sqrt (/ (/ 1.0 h) l)))))
(if (<= d -1.7e-71)
(* d (sqrt (cbrt (* t_0 (* t_0 t_0)))))
(if (<= d -2.1e-94)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= d -5e-310)
(* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
(if (<= d 1.1e-92)
(* (/ (sqrt h) (pow l 1.5)) (/ -0.125 (/ d (* M (* M (* D D))))))
(* d (* (pow h -0.5) (pow l -0.5))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (h * l);
double tmp;
if (d <= -6e-52) {
tmp = d * cbrt(((-1.0 / (h * l)) * sqrt(((1.0 / h) / l))));
} else if (d <= -1.7e-71) {
tmp = d * sqrt(cbrt((t_0 * (t_0 * t_0))));
} else if (d <= -2.1e-94) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (d <= -5e-310) {
tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
} else if (d <= 1.1e-92) {
tmp = (sqrt(h) / pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D)))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (h * l);
double tmp;
if (d <= -6e-52) {
tmp = d * Math.cbrt(((-1.0 / (h * l)) * Math.sqrt(((1.0 / h) / l))));
} else if (d <= -1.7e-71) {
tmp = d * Math.sqrt(Math.cbrt((t_0 * (t_0 * t_0))));
} else if (d <= -2.1e-94) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (d <= -5e-310) {
tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
} else if (d <= 1.1e-92) {
tmp = (Math.sqrt(h) / Math.pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D)))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(1.0 / Float64(h * l)) tmp = 0.0 if (d <= -6e-52) tmp = Float64(d * cbrt(Float64(Float64(-1.0 / Float64(h * l)) * sqrt(Float64(Float64(1.0 / h) / l))))); elseif (d <= -1.7e-71) tmp = Float64(d * sqrt(cbrt(Float64(t_0 * Float64(t_0 * t_0))))); elseif (d <= -2.1e-94) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (d <= -5e-310) tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0))))); elseif (d <= 1.1e-92) tmp = Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(-0.125 / Float64(d / Float64(M * Float64(M * Float64(D * D)))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -6e-52], N[(d * N[Power[N[(N[(-1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.7e-71], N[(d * N[Sqrt[N[Power[N[(t$95$0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2.1e-94], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.1e-92], N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(-0.125 / N[(d / N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{h \cdot \ell}\\
\mathbf{if}\;d \leq -6 \cdot 10^{-52}:\\
\;\;\;\;d \cdot \sqrt[3]{\frac{-1}{h \cdot \ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}\\
\mathbf{elif}\;d \leq -1.7 \cdot 10^{-71}:\\
\;\;\;\;d \cdot \sqrt{\sqrt[3]{t_0 \cdot \left(t_0 \cdot t_0\right)}}\\
\mathbf{elif}\;d \leq -2.1 \cdot 10^{-94}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\
\mathbf{elif}\;d \leq 1.1 \cdot 10^{-92}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \frac{-0.125}{\frac{d}{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -6e-52Initial program 71.7%
Taylor expanded in d around inf 10.7%
add-cbrt-cube13.6%
*-commutative13.6%
*-commutative13.6%
*-commutative13.6%
Applied egg-rr13.6%
add-cbrt-cube13.6%
add-sqr-sqrt13.6%
add-cbrt-cube13.6%
associate-/r*13.6%
add-cbrt-cube12.2%
associate-/r*12.2%
Applied egg-rr12.2%
div-inv12.2%
frac-2neg12.2%
metadata-eval12.2%
mul-1-neg12.2%
add-sqr-sqrt12.2%
sqrt-unprod22.2%
mul-1-neg22.2%
mul-1-neg22.2%
sqr-neg22.2%
sqrt-unprod0.0%
add-sqr-sqrt47.8%
Applied egg-rr47.8%
associate-*r/47.8%
associate-*l/47.8%
metadata-eval47.8%
associate-/l/47.8%
Simplified47.8%
if -6e-52 < d < -1.70000000000000002e-71Initial program 80.0%
Taylor expanded in d around inf 4.3%
add-cbrt-cube81.6%
*-commutative81.6%
*-commutative81.6%
*-commutative81.6%
Applied egg-rr81.6%
if -1.70000000000000002e-71 < d < -2.1000000000000001e-94Initial program 59.7%
associate-*l*59.7%
metadata-eval59.7%
unpow1/259.7%
metadata-eval59.7%
unpow1/259.7%
sub-neg59.7%
+-commutative59.7%
*-commutative59.7%
distribute-rgt-neg-in59.7%
fma-def59.7%
Simplified40.2%
Taylor expanded in h around 0 60.7%
if -2.1000000000000001e-94 < d < -4.999999999999985e-310Initial program 46.9%
Taylor expanded in d around inf 12.9%
*-un-lft-identity12.9%
*-commutative12.9%
Applied egg-rr12.9%
*-lft-identity12.9%
unpow-112.9%
sqr-pow12.9%
rem-sqrt-square12.9%
sqr-pow12.9%
fabs-sqr12.9%
sqr-pow12.9%
metadata-eval12.9%
Simplified12.9%
Taylor expanded in h around -inf 6.7%
log1p-expm1-u29.9%
expm1-udef29.9%
Applied egg-rr47.1%
if -4.999999999999985e-310 < d < 1.09999999999999994e-92Initial program 54.5%
Taylor expanded in d around 0 43.0%
associate-*r*43.0%
*-commutative43.0%
associate-*r/43.0%
associate-/l*43.0%
unpow243.0%
associate-*r*48.4%
unpow248.4%
Simplified48.4%
sqrt-div53.8%
Applied egg-rr53.8%
sqr-pow53.8%
rem-sqrt-square56.4%
sqr-pow56.3%
fabs-sqr56.3%
sqr-pow56.4%
metadata-eval56.4%
Simplified56.4%
if 1.09999999999999994e-92 < d Initial program 80.4%
Taylor expanded in d around inf 47.8%
*-un-lft-identity47.8%
*-commutative47.8%
Applied egg-rr47.8%
*-lft-identity47.8%
unpow-147.8%
sqr-pow47.8%
rem-sqrt-square47.8%
sqr-pow47.7%
fabs-sqr47.7%
sqr-pow47.8%
metadata-eval47.8%
Simplified47.8%
unpow-prod-down64.8%
Applied egg-rr64.8%
Final simplification56.1%
(FPCore (d h l M D)
:precision binary64
(if (<= d -5.5e-93)
(* d (cbrt (* (/ -1.0 (* h l)) (sqrt (/ (/ 1.0 h) l)))))
(if (<= d -5e-310)
(* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
(if (<= d 7e-93)
(* -0.125 (* (* D (* D (* M (/ M d)))) (sqrt (/ h (pow l 3.0)))))
(* d (* (pow h -0.5) (pow l -0.5)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5.5e-93) {
tmp = d * cbrt(((-1.0 / (h * l)) * sqrt(((1.0 / h) / l))));
} else if (d <= -5e-310) {
tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
} else if (d <= 7e-93) {
tmp = -0.125 * ((D * (D * (M * (M / d)))) * sqrt((h / pow(l, 3.0))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5.5e-93) {
tmp = d * Math.cbrt(((-1.0 / (h * l)) * Math.sqrt(((1.0 / h) / l))));
} else if (d <= -5e-310) {
tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
} else if (d <= 7e-93) {
tmp = -0.125 * ((D * (D * (M * (M / d)))) * Math.sqrt((h / Math.pow(l, 3.0))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -5.5e-93) tmp = Float64(d * cbrt(Float64(Float64(-1.0 / Float64(h * l)) * sqrt(Float64(Float64(1.0 / h) / l))))); elseif (d <= -5e-310) tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0))))); elseif (d <= 7e-93) tmp = Float64(-0.125 * Float64(Float64(D * Float64(D * Float64(M * Float64(M / d)))) * sqrt(Float64(h / (l ^ 3.0))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5.5e-93], N[(d * N[Power[N[(N[(-1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7e-93], N[(-0.125 * N[(N[(D * N[(D * N[(M * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -5.5 \cdot 10^{-93}:\\
\;\;\;\;d \cdot \sqrt[3]{\frac{-1}{h \cdot \ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\
\mathbf{elif}\;d \leq 7 \cdot 10^{-93}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -5.49999999999999968e-93Initial program 71.4%
Taylor expanded in d around inf 9.9%
add-cbrt-cube17.4%
*-commutative17.4%
*-commutative17.4%
*-commutative17.4%
Applied egg-rr17.4%
add-cbrt-cube17.4%
add-sqr-sqrt17.4%
add-cbrt-cube17.4%
associate-/r*17.4%
add-cbrt-cube12.4%
associate-/r*12.4%
Applied egg-rr12.4%
div-inv12.4%
frac-2neg12.4%
metadata-eval12.4%
mul-1-neg12.4%
add-sqr-sqrt12.4%
sqrt-unprod21.0%
mul-1-neg21.0%
mul-1-neg21.0%
sqr-neg21.0%
sqrt-unprod0.0%
add-sqr-sqrt45.5%
Applied egg-rr45.5%
associate-*r/45.5%
associate-*l/45.5%
metadata-eval45.5%
associate-/l/45.5%
Simplified45.5%
if -5.49999999999999968e-93 < d < -4.999999999999985e-310Initial program 46.9%
Taylor expanded in d around inf 12.9%
*-un-lft-identity12.9%
*-commutative12.9%
Applied egg-rr12.9%
*-lft-identity12.9%
unpow-112.9%
sqr-pow12.9%
rem-sqrt-square12.9%
sqr-pow12.9%
fabs-sqr12.9%
sqr-pow12.9%
metadata-eval12.9%
Simplified12.9%
Taylor expanded in h around -inf 6.7%
log1p-expm1-u29.9%
expm1-udef29.9%
Applied egg-rr47.1%
if -4.999999999999985e-310 < d < 7e-93Initial program 54.5%
metadata-eval54.5%
unpow1/254.5%
metadata-eval54.5%
unpow1/254.5%
*-commutative54.5%
associate-*l*54.5%
times-frac57.0%
metadata-eval57.0%
Simplified57.0%
frac-times54.5%
associate-/r*54.5%
Applied egg-rr54.5%
Taylor expanded in d around 0 43.0%
associate-*r/40.6%
unpow240.6%
unpow240.6%
associate-*l*51.1%
associate-/l*56.2%
associate-/r/56.2%
Simplified56.2%
if 7e-93 < d Initial program 80.4%
Taylor expanded in d around inf 47.8%
*-un-lft-identity47.8%
*-commutative47.8%
Applied egg-rr47.8%
*-lft-identity47.8%
unpow-147.8%
sqr-pow47.8%
rem-sqrt-square47.8%
sqr-pow47.7%
fabs-sqr47.7%
sqr-pow47.8%
metadata-eval47.8%
Simplified47.8%
unpow-prod-down64.8%
Applied egg-rr64.8%
Final simplification54.5%
(FPCore (d h l M D)
:precision binary64
(if (<= d -2.5e-93)
(* d (cbrt (* (/ -1.0 (* h l)) (sqrt (/ (/ 1.0 h) l)))))
(if (<= d -5e-310)
(* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
(if (<= d 9.5e-93)
(* (/ (sqrt h) (pow l 1.5)) (/ -0.125 (/ d (* M (* M (* D D))))))
(* d (* (pow h -0.5) (pow l -0.5)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.5e-93) {
tmp = d * cbrt(((-1.0 / (h * l)) * sqrt(((1.0 / h) / l))));
} else if (d <= -5e-310) {
tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
} else if (d <= 9.5e-93) {
tmp = (sqrt(h) / pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D)))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.5e-93) {
tmp = d * Math.cbrt(((-1.0 / (h * l)) * Math.sqrt(((1.0 / h) / l))));
} else if (d <= -5e-310) {
tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
} else if (d <= 9.5e-93) {
tmp = (Math.sqrt(h) / Math.pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D)))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -2.5e-93) tmp = Float64(d * cbrt(Float64(Float64(-1.0 / Float64(h * l)) * sqrt(Float64(Float64(1.0 / h) / l))))); elseif (d <= -5e-310) tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0))))); elseif (d <= 9.5e-93) tmp = Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(-0.125 / Float64(d / Float64(M * Float64(M * Float64(D * D)))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.5e-93], N[(d * N[Power[N[(N[(-1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 9.5e-93], N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(-0.125 / N[(d / N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.5 \cdot 10^{-93}:\\
\;\;\;\;d \cdot \sqrt[3]{\frac{-1}{h \cdot \ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\
\mathbf{elif}\;d \leq 9.5 \cdot 10^{-93}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \frac{-0.125}{\frac{d}{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -2.49999999999999997e-93Initial program 71.4%
Taylor expanded in d around inf 9.9%
add-cbrt-cube17.4%
*-commutative17.4%
*-commutative17.4%
*-commutative17.4%
Applied egg-rr17.4%
add-cbrt-cube17.4%
add-sqr-sqrt17.4%
add-cbrt-cube17.4%
associate-/r*17.4%
add-cbrt-cube12.4%
associate-/r*12.4%
Applied egg-rr12.4%
div-inv12.4%
frac-2neg12.4%
metadata-eval12.4%
mul-1-neg12.4%
add-sqr-sqrt12.4%
sqrt-unprod21.0%
mul-1-neg21.0%
mul-1-neg21.0%
sqr-neg21.0%
sqrt-unprod0.0%
add-sqr-sqrt45.5%
Applied egg-rr45.5%
associate-*r/45.5%
associate-*l/45.5%
metadata-eval45.5%
associate-/l/45.5%
Simplified45.5%
if -2.49999999999999997e-93 < d < -4.999999999999985e-310Initial program 46.9%
Taylor expanded in d around inf 12.9%
*-un-lft-identity12.9%
*-commutative12.9%
Applied egg-rr12.9%
*-lft-identity12.9%
unpow-112.9%
sqr-pow12.9%
rem-sqrt-square12.9%
sqr-pow12.9%
fabs-sqr12.9%
sqr-pow12.9%
metadata-eval12.9%
Simplified12.9%
Taylor expanded in h around -inf 6.7%
log1p-expm1-u29.9%
expm1-udef29.9%
Applied egg-rr47.1%
if -4.999999999999985e-310 < d < 9.5000000000000001e-93Initial program 54.5%
Taylor expanded in d around 0 43.0%
associate-*r*43.0%
*-commutative43.0%
associate-*r/43.0%
associate-/l*43.0%
unpow243.0%
associate-*r*48.4%
unpow248.4%
Simplified48.4%
sqrt-div53.8%
Applied egg-rr53.8%
sqr-pow53.8%
rem-sqrt-square56.4%
sqr-pow56.3%
fabs-sqr56.3%
sqr-pow56.4%
metadata-eval56.4%
Simplified56.4%
if 9.5000000000000001e-93 < d Initial program 80.4%
Taylor expanded in d around inf 47.8%
*-un-lft-identity47.8%
*-commutative47.8%
Applied egg-rr47.8%
*-lft-identity47.8%
unpow-147.8%
sqr-pow47.8%
rem-sqrt-square47.8%
sqr-pow47.7%
fabs-sqr47.7%
sqr-pow47.8%
metadata-eval47.8%
Simplified47.8%
unpow-prod-down64.8%
Applied egg-rr64.8%
Final simplification54.5%
(FPCore (d h l M D)
:precision binary64
(if (<= h -1.9e+54)
(* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
(if (<= h -2e-310)
(* d (cbrt (* (sqrt (/ (/ 1.0 h) l)) (* (/ 1.0 h) (/ -1.0 l)))))
(* d (* (pow h -0.5) (pow l -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1.9e+54) {
tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
} else if (h <= -2e-310) {
tmp = d * cbrt((sqrt(((1.0 / h) / l)) * ((1.0 / h) * (-1.0 / l))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1.9e+54) {
tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
} else if (h <= -2e-310) {
tmp = d * Math.cbrt((Math.sqrt(((1.0 / h) / l)) * ((1.0 / h) * (-1.0 / l))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (h <= -1.9e+54) tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0))))); elseif (h <= -2e-310) tmp = Float64(d * cbrt(Float64(sqrt(Float64(Float64(1.0 / h) / l)) * Float64(Float64(1.0 / h) * Float64(-1.0 / l))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -1.9e+54], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(d * N[Power[N[(N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 / h), $MachinePrecision] * N[(-1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -1.9 \cdot 10^{+54}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\
\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt[3]{\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \left(\frac{1}{h} \cdot \frac{-1}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if h < -1.9000000000000001e54Initial program 61.0%
Taylor expanded in d around inf 6.9%
*-un-lft-identity6.9%
*-commutative6.9%
Applied egg-rr6.9%
*-lft-identity6.9%
unpow-16.9%
sqr-pow6.9%
rem-sqrt-square6.9%
sqr-pow6.9%
fabs-sqr6.9%
sqr-pow6.9%
metadata-eval6.9%
Simplified6.9%
Taylor expanded in h around -inf 6.8%
log1p-expm1-u23.8%
expm1-udef23.8%
Applied egg-rr57.7%
if -1.9000000000000001e54 < h < -1.999999999999994e-310Initial program 63.1%
Taylor expanded in d around inf 13.4%
add-cbrt-cube23.4%
*-commutative23.4%
*-commutative23.4%
*-commutative23.4%
Applied egg-rr23.4%
add-cbrt-cube23.4%
add-sqr-sqrt23.4%
add-cbrt-cube23.4%
associate-/r*23.4%
add-cbrt-cube18.3%
associate-/r*18.3%
Applied egg-rr18.3%
div-inv18.3%
frac-2neg18.3%
metadata-eval18.3%
mul-1-neg18.3%
add-sqr-sqrt18.3%
sqrt-unprod18.4%
mul-1-neg18.4%
mul-1-neg18.4%
sqr-neg18.4%
sqrt-unprod0.0%
add-sqr-sqrt45.8%
Applied egg-rr45.8%
if -1.999999999999994e-310 < h Initial program 73.0%
Taylor expanded in d around inf 38.2%
*-un-lft-identity38.2%
*-commutative38.2%
Applied egg-rr38.2%
*-lft-identity38.2%
unpow-138.2%
sqr-pow38.2%
rem-sqrt-square38.2%
sqr-pow38.1%
fabs-sqr38.1%
sqr-pow38.2%
metadata-eval38.2%
Simplified38.2%
unpow-prod-down51.0%
Applied egg-rr51.0%
Final simplification50.6%
(FPCore (d h l M D)
:precision binary64
(if (<= h -1.6e+52)
(* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
(if (<= h -2e-310)
(* d (cbrt (* (/ -1.0 (* h l)) (sqrt (/ (/ 1.0 h) l)))))
(* d (* (pow h -0.5) (pow l -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1.6e+52) {
tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
} else if (h <= -2e-310) {
tmp = d * cbrt(((-1.0 / (h * l)) * sqrt(((1.0 / h) / l))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1.6e+52) {
tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
} else if (h <= -2e-310) {
tmp = d * Math.cbrt(((-1.0 / (h * l)) * Math.sqrt(((1.0 / h) / l))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (h <= -1.6e+52) tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0))))); elseif (h <= -2e-310) tmp = Float64(d * cbrt(Float64(Float64(-1.0 / Float64(h * l)) * sqrt(Float64(Float64(1.0 / h) / l))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -1.6e+52], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(d * N[Power[N[(N[(-1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -1.6 \cdot 10^{+52}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\
\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt[3]{\frac{-1}{h \cdot \ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if h < -1.6e52Initial program 61.0%
Taylor expanded in d around inf 6.9%
*-un-lft-identity6.9%
*-commutative6.9%
Applied egg-rr6.9%
*-lft-identity6.9%
unpow-16.9%
sqr-pow6.9%
rem-sqrt-square6.9%
sqr-pow6.9%
fabs-sqr6.9%
sqr-pow6.9%
metadata-eval6.9%
Simplified6.9%
Taylor expanded in h around -inf 6.8%
log1p-expm1-u23.8%
expm1-udef23.8%
Applied egg-rr57.7%
if -1.6e52 < h < -1.999999999999994e-310Initial program 63.1%
Taylor expanded in d around inf 13.4%
add-cbrt-cube23.4%
*-commutative23.4%
*-commutative23.4%
*-commutative23.4%
Applied egg-rr23.4%
add-cbrt-cube23.4%
add-sqr-sqrt23.4%
add-cbrt-cube23.4%
associate-/r*23.4%
add-cbrt-cube18.3%
associate-/r*18.3%
Applied egg-rr18.3%
div-inv18.3%
frac-2neg18.3%
metadata-eval18.3%
mul-1-neg18.3%
add-sqr-sqrt18.3%
sqrt-unprod18.4%
mul-1-neg18.4%
mul-1-neg18.4%
sqr-neg18.4%
sqrt-unprod0.0%
add-sqr-sqrt45.8%
Applied egg-rr45.8%
associate-*r/45.8%
associate-*l/45.8%
metadata-eval45.8%
associate-/l/45.7%
Simplified45.7%
if -1.999999999999994e-310 < h Initial program 73.0%
Taylor expanded in d around inf 38.2%
*-un-lft-identity38.2%
*-commutative38.2%
Applied egg-rr38.2%
*-lft-identity38.2%
unpow-138.2%
sqr-pow38.2%
rem-sqrt-square38.2%
sqr-pow38.1%
fabs-sqr38.1%
sqr-pow38.2%
metadata-eval38.2%
Simplified38.2%
unpow-prod-down51.0%
Applied egg-rr51.0%
Final simplification50.6%
(FPCore (d h l M D)
:precision binary64
(if (<= d -2.32e-94)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= d 1.6e-303)
(* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
(* d (* (pow h -0.5) (pow l -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.32e-94) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (d <= 1.6e-303) {
tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.32e-94) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (d <= 1.6e-303) {
tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -2.32e-94: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif d <= 1.6e-303: tmp = d * math.exp((-0.5 * math.log1p(((l * (1.0 / h)) + -1.0)))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -2.32e-94) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (d <= 1.6e-303) tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.32e-94], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.6e-303], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.32 \cdot 10^{-94}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;d \leq 1.6 \cdot 10^{-303}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -2.32000000000000002e-94Initial program 71.4%
associate-*l*71.4%
metadata-eval71.4%
unpow1/271.4%
metadata-eval71.4%
unpow1/271.4%
sub-neg71.4%
+-commutative71.4%
*-commutative71.4%
distribute-rgt-neg-in71.4%
fma-def71.4%
Simplified68.9%
Taylor expanded in h around 0 43.5%
if -2.32000000000000002e-94 < d < 1.59999999999999995e-303Initial program 45.7%
Taylor expanded in d around inf 12.5%
*-un-lft-identity12.5%
*-commutative12.5%
Applied egg-rr12.5%
*-lft-identity12.5%
unpow-112.5%
sqr-pow12.5%
rem-sqrt-square12.5%
sqr-pow12.5%
fabs-sqr12.5%
sqr-pow12.5%
metadata-eval12.5%
Simplified12.5%
Taylor expanded in h around -inf 6.4%
log1p-expm1-u28.6%
expm1-udef28.6%
Applied egg-rr45.3%
if 1.59999999999999995e-303 < d Initial program 73.8%
Taylor expanded in d around inf 38.8%
*-un-lft-identity38.8%
*-commutative38.8%
Applied egg-rr38.8%
*-lft-identity38.8%
unpow-138.8%
sqr-pow38.8%
rem-sqrt-square38.8%
sqr-pow38.6%
fabs-sqr38.6%
sqr-pow38.8%
metadata-eval38.8%
Simplified38.8%
unpow-prod-down51.8%
Applied egg-rr51.8%
Final simplification48.0%
(FPCore (d h l M D)
:precision binary64
(if (<= h -6.4e-15)
(* d (pow (/ l h) -0.5))
(if (<= h -2e-310)
(* d (cbrt (pow (/ 1.0 (* h l)) 1.5)))
(* d (* (pow h -0.5) (pow l -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -6.4e-15) {
tmp = d * pow((l / h), -0.5);
} else if (h <= -2e-310) {
tmp = d * cbrt(pow((1.0 / (h * l)), 1.5));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -6.4e-15) {
tmp = d * Math.pow((l / h), -0.5);
} else if (h <= -2e-310) {
tmp = d * Math.cbrt(Math.pow((1.0 / (h * l)), 1.5));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (h <= -6.4e-15) tmp = Float64(d * (Float64(l / h) ^ -0.5)); elseif (h <= -2e-310) tmp = Float64(d * cbrt((Float64(1.0 / Float64(h * l)) ^ 1.5))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -6.4e-15], N[(d * N[Power[N[(l / h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(d * N[Power[N[Power[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -6.4 \cdot 10^{-15}:\\
\;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\
\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(\frac{1}{h \cdot \ell}\right)}^{1.5}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if h < -6.3999999999999999e-15Initial program 59.9%
Taylor expanded in d around inf 7.1%
*-un-lft-identity7.1%
*-commutative7.1%
Applied egg-rr7.1%
*-lft-identity7.1%
unpow-17.1%
sqr-pow7.1%
rem-sqrt-square7.1%
sqr-pow7.1%
fabs-sqr7.1%
sqr-pow7.1%
metadata-eval7.1%
Simplified7.1%
Taylor expanded in h around -inf 7.0%
expm1-log1p-u7.0%
expm1-udef7.0%
Applied egg-rr27.9%
expm1-def28.0%
expm1-log1p28.0%
associate-*r/28.0%
*-rgt-identity28.0%
Simplified28.0%
if -6.3999999999999999e-15 < h < -1.999999999999994e-310Initial program 64.7%
Taylor expanded in d around inf 14.7%
add-cbrt-cube27.1%
*-commutative27.1%
*-commutative27.1%
*-commutative27.1%
Applied egg-rr27.1%
add-cbrt-cube27.1%
add-sqr-sqrt27.1%
add-cbrt-cube27.1%
associate-/r*27.1%
add-cbrt-cube20.9%
associate-/r*20.9%
Applied egg-rr20.9%
expm1-log1p-u20.9%
expm1-udef21.0%
pow121.0%
pow1/221.0%
pow-prod-up21.0%
associate-/l/21.0%
inv-pow21.0%
metadata-eval21.0%
Applied egg-rr21.0%
expm1-def20.9%
expm1-log1p20.9%
unpow-120.9%
Simplified20.9%
if -1.999999999999994e-310 < h Initial program 73.0%
Taylor expanded in d around inf 38.2%
*-un-lft-identity38.2%
*-commutative38.2%
Applied egg-rr38.2%
*-lft-identity38.2%
unpow-138.2%
sqr-pow38.2%
rem-sqrt-square38.2%
sqr-pow38.1%
fabs-sqr38.1%
sqr-pow38.2%
metadata-eval38.2%
Simplified38.2%
unpow-prod-down51.0%
Applied egg-rr51.0%
Final simplification38.1%
(FPCore (d h l M D)
:precision binary64
(if (<= l -9e-177)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= l -5e-311)
(* d (cbrt (pow (/ 1.0 (* h l)) 1.5)))
(* d (* (pow h -0.5) (pow l -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -9e-177) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (l <= -5e-311) {
tmp = d * cbrt(pow((1.0 / (h * l)), 1.5));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -9e-177) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (l <= -5e-311) {
tmp = d * Math.cbrt(Math.pow((1.0 / (h * l)), 1.5));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -9e-177) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (l <= -5e-311) tmp = Float64(d * cbrt((Float64(1.0 / Float64(h * l)) ^ 1.5))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -9e-177], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-311], N[(d * N[Power[N[Power[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -9 \cdot 10^{-177}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-311}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(\frac{1}{h \cdot \ell}\right)}^{1.5}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -9.0000000000000007e-177Initial program 57.6%
associate-*l*57.6%
metadata-eval57.6%
unpow1/257.6%
metadata-eval57.6%
unpow1/257.6%
sub-neg57.6%
+-commutative57.6%
*-commutative57.6%
distribute-rgt-neg-in57.6%
fma-def57.6%
Simplified56.6%
Taylor expanded in h around 0 38.6%
if -9.0000000000000007e-177 < l < -5.00000000000023e-311Initial program 77.1%
Taylor expanded in d around inf 31.9%
add-cbrt-cube51.5%
*-commutative51.5%
*-commutative51.5%
*-commutative51.5%
Applied egg-rr51.5%
add-cbrt-cube51.5%
add-sqr-sqrt51.5%
add-cbrt-cube51.5%
associate-/r*51.5%
add-cbrt-cube44.9%
associate-/r*44.9%
Applied egg-rr44.9%
expm1-log1p-u44.9%
expm1-udef44.7%
pow144.7%
pow1/244.7%
pow-prod-up44.7%
associate-/l/44.7%
inv-pow44.7%
metadata-eval44.7%
Applied egg-rr44.7%
expm1-def44.9%
expm1-log1p44.9%
unpow-144.9%
Simplified44.9%
if -5.00000000000023e-311 < l Initial program 73.0%
Taylor expanded in d around inf 38.2%
*-un-lft-identity38.2%
*-commutative38.2%
Applied egg-rr38.2%
*-lft-identity38.2%
unpow-138.2%
sqr-pow38.2%
rem-sqrt-square38.2%
sqr-pow38.1%
fabs-sqr38.1%
sqr-pow38.2%
metadata-eval38.2%
Simplified38.2%
unpow-prod-down51.0%
Applied egg-rr51.0%
Final simplification45.8%
(FPCore (d h l M D)
:precision binary64
(if (<= h -6.4e-15)
(* d (pow (/ l h) -0.5))
(if (<= h -2e-310)
(* d (sqrt (/ (/ 1.0 h) l)))
(* d (* (pow h -0.5) (pow l -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -6.4e-15) {
tmp = d * pow((l / h), -0.5);
} else if (h <= -2e-310) {
tmp = d * sqrt(((1.0 / h) / l));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-6.4d-15)) then
tmp = d * ((l / h) ** (-0.5d0))
else if (h <= (-2d-310)) then
tmp = d * sqrt(((1.0d0 / h) / l))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -6.4e-15) {
tmp = d * Math.pow((l / h), -0.5);
} else if (h <= -2e-310) {
tmp = d * Math.sqrt(((1.0 / h) / l));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -6.4e-15: tmp = d * math.pow((l / h), -0.5) elif h <= -2e-310: tmp = d * math.sqrt(((1.0 / h) / l)) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -6.4e-15) tmp = Float64(d * (Float64(l / h) ^ -0.5)); elseif (h <= -2e-310) tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -6.4e-15) tmp = d * ((l / h) ^ -0.5); elseif (h <= -2e-310) tmp = d * sqrt(((1.0 / h) / l)); else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -6.4e-15], N[(d * N[Power[N[(l / h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -6.4 \cdot 10^{-15}:\\
\;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\
\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if h < -6.3999999999999999e-15Initial program 59.9%
Taylor expanded in d around inf 7.1%
*-un-lft-identity7.1%
*-commutative7.1%
Applied egg-rr7.1%
*-lft-identity7.1%
unpow-17.1%
sqr-pow7.1%
rem-sqrt-square7.1%
sqr-pow7.1%
fabs-sqr7.1%
sqr-pow7.1%
metadata-eval7.1%
Simplified7.1%
Taylor expanded in h around -inf 7.0%
expm1-log1p-u7.0%
expm1-udef7.0%
Applied egg-rr27.9%
expm1-def28.0%
expm1-log1p28.0%
associate-*r/28.0%
*-rgt-identity28.0%
Simplified28.0%
if -6.3999999999999999e-15 < h < -1.999999999999994e-310Initial program 64.7%
Taylor expanded in d around inf 14.7%
*-un-lft-identity14.7%
*-commutative14.7%
Applied egg-rr14.7%
*-lft-identity14.7%
associate-/r*14.7%
Simplified14.7%
if -1.999999999999994e-310 < h Initial program 73.0%
Taylor expanded in d around inf 38.2%
*-un-lft-identity38.2%
*-commutative38.2%
Applied egg-rr38.2%
*-lft-identity38.2%
unpow-138.2%
sqr-pow38.2%
rem-sqrt-square38.2%
sqr-pow38.1%
fabs-sqr38.1%
sqr-pow38.2%
metadata-eval38.2%
Simplified38.2%
unpow-prod-down51.0%
Applied egg-rr51.0%
Final simplification36.6%
(FPCore (d h l M D)
:precision binary64
(if (<= h -1.9e-15)
(* d (pow (/ l h) -0.5))
(if (<= h -2e-310)
(* d (sqrt (/ (/ 1.0 h) l)))
(* d (/ (pow h -0.5) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1.9e-15) {
tmp = d * pow((l / h), -0.5);
} else if (h <= -2e-310) {
tmp = d * sqrt(((1.0 / h) / l));
} else {
tmp = d * (pow(h, -0.5) / 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 (h <= (-1.9d-15)) then
tmp = d * ((l / h) ** (-0.5d0))
else if (h <= (-2d-310)) then
tmp = d * sqrt(((1.0d0 / h) / l))
else
tmp = d * ((h ** (-0.5d0)) / 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 (h <= -1.9e-15) {
tmp = d * Math.pow((l / h), -0.5);
} else if (h <= -2e-310) {
tmp = d * Math.sqrt(((1.0 / h) / l));
} else {
tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -1.9e-15: tmp = d * math.pow((l / h), -0.5) elif h <= -2e-310: tmp = d * math.sqrt(((1.0 / h) / l)) else: tmp = d * (math.pow(h, -0.5) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -1.9e-15) tmp = Float64(d * (Float64(l / h) ^ -0.5)); elseif (h <= -2e-310) tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l))); else tmp = Float64(d * Float64((h ^ -0.5) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -1.9e-15) tmp = d * ((l / h) ^ -0.5); elseif (h <= -2e-310) tmp = d * sqrt(((1.0 / h) / l)); else tmp = d * ((h ^ -0.5) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -1.9e-15], N[(d * N[Power[N[(l / h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -1.9 \cdot 10^{-15}:\\
\;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\
\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if h < -1.9000000000000001e-15Initial program 59.9%
Taylor expanded in d around inf 7.1%
*-un-lft-identity7.1%
*-commutative7.1%
Applied egg-rr7.1%
*-lft-identity7.1%
unpow-17.1%
sqr-pow7.1%
rem-sqrt-square7.1%
sqr-pow7.1%
fabs-sqr7.1%
sqr-pow7.1%
metadata-eval7.1%
Simplified7.1%
Taylor expanded in h around -inf 7.0%
expm1-log1p-u7.0%
expm1-udef7.0%
Applied egg-rr27.9%
expm1-def28.0%
expm1-log1p28.0%
associate-*r/28.0%
*-rgt-identity28.0%
Simplified28.0%
if -1.9000000000000001e-15 < h < -1.999999999999994e-310Initial program 64.7%
Taylor expanded in d around inf 14.7%
*-un-lft-identity14.7%
*-commutative14.7%
Applied egg-rr14.7%
*-lft-identity14.7%
associate-/r*14.7%
Simplified14.7%
if -1.999999999999994e-310 < h Initial program 73.0%
Taylor expanded in d around inf 38.2%
*-un-lft-identity38.2%
*-commutative38.2%
Applied egg-rr38.2%
*-lft-identity38.2%
associate-/r*40.1%
Simplified40.1%
sqrt-div51.0%
inv-pow51.0%
sqrt-pow151.0%
metadata-eval51.0%
Applied egg-rr51.0%
Final simplification36.6%
(FPCore (d h l M D) :precision binary64 (if (<= h -4.6e-17) (* d (pow (/ l h) -0.5)) (* d (sqrt (/ 1.0 (* h l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -4.6e-17) {
tmp = d * pow((l / h), -0.5);
} else {
tmp = d * sqrt((1.0 / (h * l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-4.6d-17)) then
tmp = d * ((l / h) ** (-0.5d0))
else
tmp = d * sqrt((1.0d0 / (h * l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -4.6e-17) {
tmp = d * Math.pow((l / h), -0.5);
} else {
tmp = d * Math.sqrt((1.0 / (h * l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -4.6e-17: tmp = d * math.pow((l / h), -0.5) else: tmp = d * math.sqrt((1.0 / (h * l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -4.6e-17) tmp = Float64(d * (Float64(l / h) ^ -0.5)); else tmp = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -4.6e-17) tmp = d * ((l / h) ^ -0.5); else tmp = d * sqrt((1.0 / (h * l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -4.6e-17], N[(d * N[Power[N[(l / h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -4.6 \cdot 10^{-17}:\\
\;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\end{array}
\end{array}
if h < -4.60000000000000018e-17Initial program 59.9%
Taylor expanded in d around inf 7.1%
*-un-lft-identity7.1%
*-commutative7.1%
Applied egg-rr7.1%
*-lft-identity7.1%
unpow-17.1%
sqr-pow7.1%
rem-sqrt-square7.1%
sqr-pow7.1%
fabs-sqr7.1%
sqr-pow7.1%
metadata-eval7.1%
Simplified7.1%
Taylor expanded in h around -inf 7.0%
expm1-log1p-u7.0%
expm1-udef7.0%
Applied egg-rr27.9%
expm1-def28.0%
expm1-log1p28.0%
associate-*r/28.0%
*-rgt-identity28.0%
Simplified28.0%
if -4.60000000000000018e-17 < h Initial program 70.3%
Taylor expanded in d around inf 30.6%
Final simplification30.0%
(FPCore (d h l M D) :precision binary64 (if (<= h -3.4e-15) (* d (pow (/ l h) -0.5)) (* d (sqrt (/ (/ 1.0 h) l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -3.4e-15) {
tmp = d * pow((l / h), -0.5);
} else {
tmp = d * sqrt(((1.0 / h) / l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-3.4d-15)) then
tmp = d * ((l / h) ** (-0.5d0))
else
tmp = d * sqrt(((1.0d0 / h) / l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -3.4e-15) {
tmp = d * Math.pow((l / h), -0.5);
} else {
tmp = d * Math.sqrt(((1.0 / h) / l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -3.4e-15: tmp = d * math.pow((l / h), -0.5) else: tmp = d * math.sqrt(((1.0 / h) / l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -3.4e-15) tmp = Float64(d * (Float64(l / h) ^ -0.5)); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -3.4e-15) tmp = d * ((l / h) ^ -0.5); else tmp = d * sqrt(((1.0 / h) / l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -3.4e-15], N[(d * N[Power[N[(l / h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -3.4 \cdot 10^{-15}:\\
\;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\end{array}
\end{array}
if h < -3.4e-15Initial program 59.9%
Taylor expanded in d around inf 7.1%
*-un-lft-identity7.1%
*-commutative7.1%
Applied egg-rr7.1%
*-lft-identity7.1%
unpow-17.1%
sqr-pow7.1%
rem-sqrt-square7.1%
sqr-pow7.1%
fabs-sqr7.1%
sqr-pow7.1%
metadata-eval7.1%
Simplified7.1%
Taylor expanded in h around -inf 7.0%
expm1-log1p-u7.0%
expm1-udef7.0%
Applied egg-rr27.9%
expm1-def28.0%
expm1-log1p28.0%
associate-*r/28.0%
*-rgt-identity28.0%
Simplified28.0%
if -3.4e-15 < h Initial program 70.3%
Taylor expanded in d around inf 30.6%
*-un-lft-identity30.6%
*-commutative30.6%
Applied egg-rr30.6%
*-lft-identity30.6%
associate-/r*31.9%
Simplified31.9%
Final simplification31.0%
(FPCore (d h l M D) :precision binary64 (if (<= h -6.4e-15) (* d (pow (/ l h) -0.5)) (* d (pow (* h l) -0.5))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -6.4e-15) {
tmp = d * pow((l / h), -0.5);
} else {
tmp = d * pow((h * l), -0.5);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-6.4d-15)) then
tmp = d * ((l / h) ** (-0.5d0))
else
tmp = d * ((h * l) ** (-0.5d0))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -6.4e-15) {
tmp = d * Math.pow((l / h), -0.5);
} else {
tmp = d * Math.pow((h * l), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -6.4e-15: tmp = d * math.pow((l / h), -0.5) else: tmp = d * math.pow((h * l), -0.5) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -6.4e-15) tmp = Float64(d * (Float64(l / h) ^ -0.5)); else tmp = Float64(d * (Float64(h * l) ^ -0.5)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -6.4e-15) tmp = d * ((l / h) ^ -0.5); else tmp = d * ((h * l) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -6.4e-15], N[(d * N[Power[N[(l / h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -6.4 \cdot 10^{-15}:\\
\;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\end{array}
\end{array}
if h < -6.3999999999999999e-15Initial program 59.9%
Taylor expanded in d around inf 7.1%
*-un-lft-identity7.1%
*-commutative7.1%
Applied egg-rr7.1%
*-lft-identity7.1%
unpow-17.1%
sqr-pow7.1%
rem-sqrt-square7.1%
sqr-pow7.1%
fabs-sqr7.1%
sqr-pow7.1%
metadata-eval7.1%
Simplified7.1%
Taylor expanded in h around -inf 7.0%
expm1-log1p-u7.0%
expm1-udef7.0%
Applied egg-rr27.9%
expm1-def28.0%
expm1-log1p28.0%
associate-*r/28.0%
*-rgt-identity28.0%
Simplified28.0%
if -6.3999999999999999e-15 < h Initial program 70.3%
Taylor expanded in d around inf 30.6%
*-un-lft-identity30.6%
*-commutative30.6%
Applied egg-rr30.6%
*-lft-identity30.6%
unpow-130.6%
sqr-pow30.6%
rem-sqrt-square30.6%
sqr-pow30.5%
fabs-sqr30.5%
sqr-pow30.6%
metadata-eval30.6%
Simplified30.6%
Final simplification30.0%
(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 67.8%
Taylor expanded in d around inf 25.0%
*-un-lft-identity25.0%
*-commutative25.0%
Applied egg-rr25.0%
*-lft-identity25.0%
unpow-125.0%
sqr-pow25.0%
rem-sqrt-square25.0%
sqr-pow25.0%
fabs-sqr25.0%
sqr-pow25.0%
metadata-eval25.0%
Simplified25.0%
Final simplification25.0%
herbie shell --seed 2023181
(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)))))