
(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
(let* ((t_0 (+ 1.0 (/ (* h (* (pow (* (* M 0.5) (/ D d)) 2.0) -0.5)) l)))
(t_1 (sqrt (- d))))
(if (<= l -1e-309)
(* (/ t_1 (sqrt (- h))) (* (/ t_1 (sqrt (- l))) t_0))
(* (/ (sqrt d) (sqrt h)) (* t_0 (/ (sqrt d) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((h * (pow(((M * 0.5) * (D / d)), 2.0) * -0.5)) / l);
double t_1 = sqrt(-d);
double tmp;
if (l <= -1e-309) {
tmp = (t_1 / sqrt(-h)) * ((t_1 / sqrt(-l)) * t_0);
} else {
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (sqrt(d) / sqrt(l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 + ((h * ((((m * 0.5d0) * (d_1 / d)) ** 2.0d0) * (-0.5d0))) / l)
t_1 = sqrt(-d)
if (l <= (-1d-309)) then
tmp = (t_1 / sqrt(-h)) * ((t_1 / sqrt(-l)) * t_0)
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (sqrt(d) / sqrt(l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((h * (Math.pow(((M * 0.5) * (D / d)), 2.0) * -0.5)) / l);
double t_1 = Math.sqrt(-d);
double tmp;
if (l <= -1e-309) {
tmp = (t_1 / Math.sqrt(-h)) * ((t_1 / Math.sqrt(-l)) * t_0);
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * (t_0 * (Math.sqrt(d) / Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 + ((h * (math.pow(((M * 0.5) * (D / d)), 2.0) * -0.5)) / l) t_1 = math.sqrt(-d) tmp = 0 if l <= -1e-309: tmp = (t_1 / math.sqrt(-h)) * ((t_1 / math.sqrt(-l)) * t_0) else: tmp = (math.sqrt(d) / math.sqrt(h)) * (t_0 * (math.sqrt(d) / math.sqrt(l))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 + Float64(Float64(h * Float64((Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0) * -0.5)) / l)) t_1 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -1e-309) tmp = Float64(Float64(t_1 / sqrt(Float64(-h))) * Float64(Float64(t_1 / sqrt(Float64(-l))) * t_0)); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(t_0 * Float64(sqrt(d) / sqrt(l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 + ((h * ((((M * 0.5) * (D / d)) ^ 2.0) * -0.5)) / l); t_1 = sqrt(-d); tmp = 0.0; if (l <= -1e-309) tmp = (t_1 / sqrt(-h)) * ((t_1 / sqrt(-l)) * t_0); else tmp = (sqrt(d) / sqrt(h)) * (t_0 * (sqrt(d) / sqrt(l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(h * N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -1e-309], N[(N[(t$95$1 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{h \cdot \left({\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2} \cdot -0.5\right)}{\ell}\\
t_1 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{t\_1}{\sqrt{-h}} \cdot \left(\frac{t\_1}{\sqrt{-\ell}} \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(t\_0 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\end{array}
\end{array}
if l < -1.000000000000002e-309Initial program 72.4%
Simplified73.7%
associate-*l/75.4%
Applied egg-rr75.4%
frac-2neg75.4%
sqrt-div79.4%
Applied egg-rr79.4%
frac-2neg79.4%
sqrt-div89.6%
Applied egg-rr89.6%
if -1.000000000000002e-309 < l Initial program 67.2%
Simplified66.4%
associate-*l/68.3%
Applied egg-rr68.3%
sqrt-div84.3%
Applied egg-rr84.3%
sqrt-div89.1%
Applied egg-rr89.1%
Final simplification89.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (+ 1.0 (/ (* h (* (pow (* (* M 0.5) (/ D d)) 2.0) -0.5)) l))))
(if (<= l -1e-309)
(* (/ (sqrt (- d)) (sqrt (- h))) (* t_0 (sqrt (/ d l))))
(* (/ (sqrt d) (sqrt h)) (* t_0 (/ (sqrt d) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((h * (pow(((M * 0.5) * (D / d)), 2.0) * -0.5)) / l);
double tmp;
if (l <= -1e-309) {
tmp = (sqrt(-d) / sqrt(-h)) * (t_0 * sqrt((d / l)));
} else {
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (sqrt(d) / sqrt(l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + ((h * ((((m * 0.5d0) * (d_1 / d)) ** 2.0d0) * (-0.5d0))) / l)
if (l <= (-1d-309)) then
tmp = (sqrt(-d) / sqrt(-h)) * (t_0 * sqrt((d / l)))
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (sqrt(d) / sqrt(l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((h * (Math.pow(((M * 0.5) * (D / d)), 2.0) * -0.5)) / l);
double tmp;
if (l <= -1e-309) {
tmp = (Math.sqrt(-d) / Math.sqrt(-h)) * (t_0 * Math.sqrt((d / l)));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * (t_0 * (Math.sqrt(d) / Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 + ((h * (math.pow(((M * 0.5) * (D / d)), 2.0) * -0.5)) / l) tmp = 0 if l <= -1e-309: tmp = (math.sqrt(-d) / math.sqrt(-h)) * (t_0 * math.sqrt((d / l))) else: tmp = (math.sqrt(d) / math.sqrt(h)) * (t_0 * (math.sqrt(d) / math.sqrt(l))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 + Float64(Float64(h * Float64((Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0) * -0.5)) / l)) tmp = 0.0 if (l <= -1e-309) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(t_0 * sqrt(Float64(d / l)))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(t_0 * Float64(sqrt(d) / sqrt(l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 + ((h * ((((M * 0.5) * (D / d)) ^ 2.0) * -0.5)) / l); tmp = 0.0; if (l <= -1e-309) tmp = (sqrt(-d) / sqrt(-h)) * (t_0 * sqrt((d / l))); else tmp = (sqrt(d) / sqrt(h)) * (t_0 * (sqrt(d) / sqrt(l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(h * N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1e-309], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{h \cdot \left({\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2} \cdot -0.5\right)}{\ell}\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(t\_0 \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(t\_0 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\end{array}
\end{array}
if l < -1.000000000000002e-309Initial program 72.4%
Simplified73.7%
associate-*l/75.4%
Applied egg-rr75.4%
frac-2neg79.4%
sqrt-div89.6%
Applied egg-rr82.6%
if -1.000000000000002e-309 < l Initial program 67.2%
Simplified66.4%
associate-*l/68.3%
Applied egg-rr68.3%
sqrt-div84.3%
Applied egg-rr84.3%
sqrt-div89.1%
Applied egg-rr89.1%
Final simplification85.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (+ 1.0 (/ (* h (* (pow (* (* M 0.5) (/ D d)) 2.0) -0.5)) l))))
(if (<= d -5e-137)
(* (* (/ (sqrt (- d)) (sqrt (- l))) t_0) (sqrt (/ d h)))
(if (<= d -1e-309)
(*
(* d (sqrt (/ (/ 1.0 h) l)))
(- -1.0 (* -0.5 (* (/ h l) (pow (* D (* M (/ 0.5 d))) 2.0)))))
(* (* t_0 (sqrt (/ d l))) (/ 1.0 (/ (sqrt h) (sqrt d))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((h * (pow(((M * 0.5) * (D / d)), 2.0) * -0.5)) / l);
double tmp;
if (d <= -5e-137) {
tmp = ((sqrt(-d) / sqrt(-l)) * t_0) * sqrt((d / h));
} else if (d <= -1e-309) {
tmp = (d * sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * pow((D * (M * (0.5 / d))), 2.0))));
} else {
tmp = (t_0 * sqrt((d / l))) * (1.0 / (sqrt(h) / sqrt(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) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + ((h * ((((m * 0.5d0) * (d_1 / d)) ** 2.0d0) * (-0.5d0))) / l)
if (d <= (-5d-137)) then
tmp = ((sqrt(-d) / sqrt(-l)) * t_0) * sqrt((d / h))
else if (d <= (-1d-309)) then
tmp = (d * sqrt(((1.0d0 / h) / l))) * ((-1.0d0) - ((-0.5d0) * ((h / l) * ((d_1 * (m * (0.5d0 / d))) ** 2.0d0))))
else
tmp = (t_0 * sqrt((d / l))) * (1.0d0 / (sqrt(h) / sqrt(d)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((h * (Math.pow(((M * 0.5) * (D / d)), 2.0) * -0.5)) / l);
double tmp;
if (d <= -5e-137) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-l)) * t_0) * Math.sqrt((d / h));
} else if (d <= -1e-309) {
tmp = (d * Math.sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * Math.pow((D * (M * (0.5 / d))), 2.0))));
} else {
tmp = (t_0 * Math.sqrt((d / l))) * (1.0 / (Math.sqrt(h) / Math.sqrt(d)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 + ((h * (math.pow(((M * 0.5) * (D / d)), 2.0) * -0.5)) / l) tmp = 0 if d <= -5e-137: tmp = ((math.sqrt(-d) / math.sqrt(-l)) * t_0) * math.sqrt((d / h)) elif d <= -1e-309: tmp = (d * math.sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * math.pow((D * (M * (0.5 / d))), 2.0)))) else: tmp = (t_0 * math.sqrt((d / l))) * (1.0 / (math.sqrt(h) / math.sqrt(d))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 + Float64(Float64(h * Float64((Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0) * -0.5)) / l)) tmp = 0.0 if (d <= -5e-137) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * t_0) * sqrt(Float64(d / h))); elseif (d <= -1e-309) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / h) / l))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0))))); else tmp = Float64(Float64(t_0 * sqrt(Float64(d / l))) * Float64(1.0 / Float64(sqrt(h) / sqrt(d)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 + ((h * ((((M * 0.5) * (D / d)) ^ 2.0) * -0.5)) / l); tmp = 0.0; if (d <= -5e-137) tmp = ((sqrt(-d) / sqrt(-l)) * t_0) * sqrt((d / h)); elseif (d <= -1e-309) tmp = (d * sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * ((D * (M * (0.5 / d))) ^ 2.0)))); else tmp = (t_0 * sqrt((d / l))) * (1.0 / (sqrt(h) / sqrt(d))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(h * N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -5e-137], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1e-309], N[(N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[Sqrt[h], $MachinePrecision] / N[Sqrt[d], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{h \cdot \left({\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2} \cdot -0.5\right)}{\ell}\\
\mathbf{if}\;d \leq -5 \cdot 10^{-137}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot t\_0\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_0 \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{1}{\frac{\sqrt{h}}{\sqrt{d}}}\\
\end{array}
\end{array}
if d < -5.00000000000000001e-137Initial program 85.9%
Simplified88.0%
associate-*l/90.4%
Applied egg-rr90.4%
frac-2neg90.4%
sqrt-div92.3%
Applied egg-rr92.3%
if -5.00000000000000001e-137 < d < -1.000000000000002e-309Initial program 43.3%
Simplified43.1%
add-sqr-sqrt43.2%
pow243.2%
sqrt-prod43.1%
unpow243.1%
sqrt-prod19.7%
add-sqr-sqrt43.3%
div-inv43.3%
metadata-eval43.3%
Applied egg-rr43.3%
*-commutative43.3%
/-rgt-identity43.3%
associate-/l*43.3%
metadata-eval43.3%
times-frac43.5%
associate-*r/43.3%
associate-*l*43.3%
*-lft-identity43.3%
associate-/l*43.3%
associate-/r/43.3%
*-commutative43.3%
associate-/r*43.3%
metadata-eval43.3%
Simplified43.3%
expm1-log1p-u12.7%
expm1-udef5.0%
Applied egg-rr5.1%
expm1-def8.4%
expm1-log1p31.8%
rem-log-exp29.2%
rem-log-exp31.8%
*-commutative31.8%
Simplified31.8%
Taylor expanded in d around -inf 68.1%
mul-1-neg68.1%
*-commutative68.1%
distribute-rgt-neg-in68.1%
associate-/r*68.2%
Simplified68.2%
if -1.000000000000002e-309 < d Initial program 67.2%
Simplified66.4%
associate-*l/68.3%
Applied egg-rr68.3%
clear-num37.2%
sqrt-div38.2%
metadata-eval38.2%
Applied egg-rr67.2%
sqrt-div84.3%
Applied egg-rr84.3%
Final simplification84.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= d -7.5e-137)
(*
(sqrt (/ d h))
(* t_0 (+ 1.0 (/ (* h (* -0.5 (pow (* M (* D (/ 0.5 d))) 2.0))) l))))
(if (<= d -1e-309)
(*
(* d (sqrt (/ (/ 1.0 h) l)))
(- -1.0 (* -0.5 (* (/ h l) (pow (* D (* M (/ 0.5 d))) 2.0)))))
(*
(/ (sqrt d) (sqrt h))
(*
(+ 1.0 (/ (* h (* (pow (* (* M 0.5) (/ D d)) 2.0) -0.5)) l))
t_0))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (d <= -7.5e-137) {
tmp = sqrt((d / h)) * (t_0 * (1.0 + ((h * (-0.5 * pow((M * (D * (0.5 / d))), 2.0))) / l)));
} else if (d <= -1e-309) {
tmp = (d * sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * pow((D * (M * (0.5 / d))), 2.0))));
} else {
tmp = (sqrt(d) / sqrt(h)) * ((1.0 + ((h * (pow(((M * 0.5) * (D / d)), 2.0) * -0.5)) / l)) * t_0);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((d / l))
if (d <= (-7.5d-137)) then
tmp = sqrt((d / h)) * (t_0 * (1.0d0 + ((h * ((-0.5d0) * ((m * (d_1 * (0.5d0 / d))) ** 2.0d0))) / l)))
else if (d <= (-1d-309)) then
tmp = (d * sqrt(((1.0d0 / h) / l))) * ((-1.0d0) - ((-0.5d0) * ((h / l) * ((d_1 * (m * (0.5d0 / d))) ** 2.0d0))))
else
tmp = (sqrt(d) / sqrt(h)) * ((1.0d0 + ((h * ((((m * 0.5d0) * (d_1 / d)) ** 2.0d0) * (-0.5d0))) / l)) * t_0)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double tmp;
if (d <= -7.5e-137) {
tmp = Math.sqrt((d / h)) * (t_0 * (1.0 + ((h * (-0.5 * Math.pow((M * (D * (0.5 / d))), 2.0))) / l)));
} else if (d <= -1e-309) {
tmp = (d * Math.sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * Math.pow((D * (M * (0.5 / d))), 2.0))));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * ((1.0 + ((h * (Math.pow(((M * 0.5) * (D / d)), 2.0) * -0.5)) / l)) * t_0);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if d <= -7.5e-137: tmp = math.sqrt((d / h)) * (t_0 * (1.0 + ((h * (-0.5 * math.pow((M * (D * (0.5 / d))), 2.0))) / l))) elif d <= -1e-309: tmp = (d * math.sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * math.pow((D * (M * (0.5 / d))), 2.0)))) else: tmp = (math.sqrt(d) / math.sqrt(h)) * ((1.0 + ((h * (math.pow(((M * 0.5) * (D / d)), 2.0) * -0.5)) / l)) * t_0) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (d <= -7.5e-137) tmp = Float64(sqrt(Float64(d / h)) * Float64(t_0 * Float64(1.0 + Float64(Float64(h * Float64(-0.5 * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0))) / l)))); elseif (d <= -1e-309) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / h) / l))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0))))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(Float64(1.0 + Float64(Float64(h * Float64((Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0) * -0.5)) / l)) * t_0)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); tmp = 0.0; if (d <= -7.5e-137) tmp = sqrt((d / h)) * (t_0 * (1.0 + ((h * (-0.5 * ((M * (D * (0.5 / d))) ^ 2.0))) / l))); elseif (d <= -1e-309) tmp = (d * sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * ((D * (M * (0.5 / d))) ^ 2.0)))); else tmp = (sqrt(d) / sqrt(h)) * ((1.0 + ((h * ((((M * 0.5) * (D / d)) ^ 2.0) * -0.5)) / l)) * t_0); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -7.5e-137], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[(1.0 + N[(N[(h * N[(-0.5 * N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1e-309], N[(N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(N[(h * N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;d \leq -7.5 \cdot 10^{-137}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(t\_0 \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}\right)}{\ell}\right)\right)\\
\mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\left(1 + \frac{h \cdot \left({\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2} \cdot -0.5\right)}{\ell}\right) \cdot t\_0\right)\\
\end{array}
\end{array}
if d < -7.4999999999999995e-137Initial program 85.9%
Simplified88.0%
associate-*l/90.4%
Applied egg-rr90.4%
Taylor expanded in M around 0 89.4%
*-commutative89.4%
associate-*l/89.4%
associate-*r/89.4%
associate-*r*90.2%
*-commutative90.2%
associate-*l*90.4%
Simplified90.4%
if -7.4999999999999995e-137 < d < -1.000000000000002e-309Initial program 43.3%
Simplified43.1%
add-sqr-sqrt43.2%
pow243.2%
sqrt-prod43.1%
unpow243.1%
sqrt-prod19.7%
add-sqr-sqrt43.3%
div-inv43.3%
metadata-eval43.3%
Applied egg-rr43.3%
*-commutative43.3%
/-rgt-identity43.3%
associate-/l*43.3%
metadata-eval43.3%
times-frac43.5%
associate-*r/43.3%
associate-*l*43.3%
*-lft-identity43.3%
associate-/l*43.3%
associate-/r/43.3%
*-commutative43.3%
associate-/r*43.3%
metadata-eval43.3%
Simplified43.3%
expm1-log1p-u12.7%
expm1-udef5.0%
Applied egg-rr5.1%
expm1-def8.4%
expm1-log1p31.8%
rem-log-exp29.2%
rem-log-exp31.8%
*-commutative31.8%
Simplified31.8%
Taylor expanded in d around -inf 68.1%
mul-1-neg68.1%
*-commutative68.1%
distribute-rgt-neg-in68.1%
associate-/r*68.2%
Simplified68.2%
if -1.000000000000002e-309 < d Initial program 67.2%
Simplified66.4%
associate-*l/68.3%
Applied egg-rr68.3%
sqrt-div84.3%
Applied egg-rr84.3%
Final simplification83.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (+ 1.0 (/ (* h (* (pow (* (* M 0.5) (/ D d)) 2.0) -0.5)) l))))
(if (<= d -1.5e-134)
(* (* (/ (sqrt (- d)) (sqrt (- l))) t_0) (sqrt (/ d h)))
(if (<= d -1e-309)
(*
(* d (sqrt (/ (/ 1.0 h) l)))
(- -1.0 (* -0.5 (* (/ h l) (pow (* D (* M (/ 0.5 d))) 2.0)))))
(* (/ (sqrt d) (sqrt h)) (* t_0 (sqrt (/ d l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((h * (pow(((M * 0.5) * (D / d)), 2.0) * -0.5)) / l);
double tmp;
if (d <= -1.5e-134) {
tmp = ((sqrt(-d) / sqrt(-l)) * t_0) * sqrt((d / h));
} else if (d <= -1e-309) {
tmp = (d * sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * pow((D * (M * (0.5 / d))), 2.0))));
} else {
tmp = (sqrt(d) / sqrt(h)) * (t_0 * sqrt((d / l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + ((h * ((((m * 0.5d0) * (d_1 / d)) ** 2.0d0) * (-0.5d0))) / l)
if (d <= (-1.5d-134)) then
tmp = ((sqrt(-d) / sqrt(-l)) * t_0) * sqrt((d / h))
else if (d <= (-1d-309)) then
tmp = (d * sqrt(((1.0d0 / h) / l))) * ((-1.0d0) - ((-0.5d0) * ((h / l) * ((d_1 * (m * (0.5d0 / d))) ** 2.0d0))))
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * sqrt((d / l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((h * (Math.pow(((M * 0.5) * (D / d)), 2.0) * -0.5)) / l);
double tmp;
if (d <= -1.5e-134) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-l)) * t_0) * Math.sqrt((d / h));
} else if (d <= -1e-309) {
tmp = (d * Math.sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * Math.pow((D * (M * (0.5 / d))), 2.0))));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * (t_0 * Math.sqrt((d / l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 + ((h * (math.pow(((M * 0.5) * (D / d)), 2.0) * -0.5)) / l) tmp = 0 if d <= -1.5e-134: tmp = ((math.sqrt(-d) / math.sqrt(-l)) * t_0) * math.sqrt((d / h)) elif d <= -1e-309: tmp = (d * math.sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * math.pow((D * (M * (0.5 / d))), 2.0)))) else: tmp = (math.sqrt(d) / math.sqrt(h)) * (t_0 * math.sqrt((d / l))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 + Float64(Float64(h * Float64((Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0) * -0.5)) / l)) tmp = 0.0 if (d <= -1.5e-134) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * t_0) * sqrt(Float64(d / h))); elseif (d <= -1e-309) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / h) / l))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0))))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(t_0 * sqrt(Float64(d / l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 + ((h * ((((M * 0.5) * (D / d)) ^ 2.0) * -0.5)) / l); tmp = 0.0; if (d <= -1.5e-134) tmp = ((sqrt(-d) / sqrt(-l)) * t_0) * sqrt((d / h)); elseif (d <= -1e-309) tmp = (d * sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * ((D * (M * (0.5 / d))) ^ 2.0)))); else tmp = (sqrt(d) / sqrt(h)) * (t_0 * sqrt((d / l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(h * N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.5e-134], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1e-309], N[(N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{h \cdot \left({\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2} \cdot -0.5\right)}{\ell}\\
\mathbf{if}\;d \leq -1.5 \cdot 10^{-134}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot t\_0\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(t\_0 \cdot \sqrt{\frac{d}{\ell}}\right)\\
\end{array}
\end{array}
if d < -1.5e-134Initial program 85.9%
Simplified88.0%
associate-*l/90.4%
Applied egg-rr90.4%
frac-2neg90.4%
sqrt-div92.3%
Applied egg-rr92.3%
if -1.5e-134 < d < -1.000000000000002e-309Initial program 43.3%
Simplified43.1%
add-sqr-sqrt43.2%
pow243.2%
sqrt-prod43.1%
unpow243.1%
sqrt-prod19.7%
add-sqr-sqrt43.3%
div-inv43.3%
metadata-eval43.3%
Applied egg-rr43.3%
*-commutative43.3%
/-rgt-identity43.3%
associate-/l*43.3%
metadata-eval43.3%
times-frac43.5%
associate-*r/43.3%
associate-*l*43.3%
*-lft-identity43.3%
associate-/l*43.3%
associate-/r/43.3%
*-commutative43.3%
associate-/r*43.3%
metadata-eval43.3%
Simplified43.3%
expm1-log1p-u12.7%
expm1-udef5.0%
Applied egg-rr5.1%
expm1-def8.4%
expm1-log1p31.8%
rem-log-exp29.2%
rem-log-exp31.8%
*-commutative31.8%
Simplified31.8%
Taylor expanded in d around -inf 68.1%
mul-1-neg68.1%
*-commutative68.1%
distribute-rgt-neg-in68.1%
associate-/r*68.2%
Simplified68.2%
if -1.000000000000002e-309 < d Initial program 67.2%
Simplified66.4%
associate-*l/68.3%
Applied egg-rr68.3%
sqrt-div84.3%
Applied egg-rr84.3%
Final simplification84.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(+ 1.0 (/ (* h (* (pow (* (* M 0.5) (/ D d)) 2.0) -0.5)) l))
(sqrt (/ d l)))))
(if (<= l -1e-309)
(* (/ (sqrt (- d)) (sqrt (- h))) t_0)
(* t_0 (/ 1.0 (/ (sqrt h) (sqrt d)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (1.0 + ((h * (pow(((M * 0.5) * (D / d)), 2.0) * -0.5)) / l)) * sqrt((d / l));
double tmp;
if (l <= -1e-309) {
tmp = (sqrt(-d) / sqrt(-h)) * t_0;
} else {
tmp = t_0 * (1.0 / (sqrt(h) / sqrt(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) :: t_0
real(8) :: tmp
t_0 = (1.0d0 + ((h * ((((m * 0.5d0) * (d_1 / d)) ** 2.0d0) * (-0.5d0))) / l)) * sqrt((d / l))
if (l <= (-1d-309)) then
tmp = (sqrt(-d) / sqrt(-h)) * t_0
else
tmp = t_0 * (1.0d0 / (sqrt(h) / sqrt(d)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (1.0 + ((h * (Math.pow(((M * 0.5) * (D / d)), 2.0) * -0.5)) / l)) * Math.sqrt((d / l));
double tmp;
if (l <= -1e-309) {
tmp = (Math.sqrt(-d) / Math.sqrt(-h)) * t_0;
} else {
tmp = t_0 * (1.0 / (Math.sqrt(h) / Math.sqrt(d)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (1.0 + ((h * (math.pow(((M * 0.5) * (D / d)), 2.0) * -0.5)) / l)) * math.sqrt((d / l)) tmp = 0 if l <= -1e-309: tmp = (math.sqrt(-d) / math.sqrt(-h)) * t_0 else: tmp = t_0 * (1.0 / (math.sqrt(h) / math.sqrt(d))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(1.0 + Float64(Float64(h * Float64((Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0) * -0.5)) / l)) * sqrt(Float64(d / l))) tmp = 0.0 if (l <= -1e-309) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * t_0); else tmp = Float64(t_0 * Float64(1.0 / Float64(sqrt(h) / sqrt(d)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (1.0 + ((h * ((((M * 0.5) * (D / d)) ^ 2.0) * -0.5)) / l)) * sqrt((d / l)); tmp = 0.0; if (l <= -1e-309) tmp = (sqrt(-d) / sqrt(-h)) * t_0; else tmp = t_0 * (1.0 / (sqrt(h) / sqrt(d))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(1.0 + N[(N[(h * N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1e-309], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * N[(1.0 / N[(N[Sqrt[h], $MachinePrecision] / N[Sqrt[d], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 + \frac{h \cdot \left({\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2} \cdot -0.5\right)}{\ell}\right) \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{1}{\frac{\sqrt{h}}{\sqrt{d}}}\\
\end{array}
\end{array}
if l < -1.000000000000002e-309Initial program 72.4%
Simplified73.7%
associate-*l/75.4%
Applied egg-rr75.4%
frac-2neg79.4%
sqrt-div89.6%
Applied egg-rr82.6%
if -1.000000000000002e-309 < l Initial program 67.2%
Simplified66.4%
associate-*l/68.3%
Applied egg-rr68.3%
clear-num37.2%
sqrt-div38.2%
metadata-eval38.2%
Applied egg-rr67.2%
sqrt-div84.3%
Applied egg-rr84.3%
Final simplification83.4%
(FPCore (d h l M D)
:precision binary64
(if (<= d -2.8e-133)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(+ 1.0 (/ (* h (* -0.5 (pow (* M (* D (/ 0.5 d))) 2.0))) l))))
(if (<= d -1e-309)
(*
(* d (sqrt (/ (/ 1.0 h) l)))
(- -1.0 (* -0.5 (* (/ h l) (pow (* D (* M (/ 0.5 d))) 2.0)))))
(*
(fma (/ h l) (* -0.5 (pow (* M (/ D (* d 2.0))) 2.0)) 1.0)
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.8e-133) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h * (-0.5 * pow((M * (D * (0.5 / d))), 2.0))) / l)));
} else if (d <= -1e-309) {
tmp = (d * sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * pow((D * (M * (0.5 / d))), 2.0))));
} else {
tmp = fma((h / l), (-0.5 * pow((M * (D / (d * 2.0))), 2.0)), 1.0) * (d / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -2.8e-133) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h * Float64(-0.5 * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0))) / l)))); elseif (d <= -1e-309) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / h) / l))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0))))); else tmp = Float64(fma(Float64(h / l), Float64(-0.5 * (Float64(M * Float64(D / Float64(d * 2.0))) ^ 2.0)), 1.0) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.8e-133], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(-0.5 * N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1e-309], N[(N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(M * N[(D / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.8 \cdot 10^{-133}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}\right)}{\ell}\right)\right)\\
\mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{h}{\ell}, -0.5 \cdot {\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2}, 1\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -2.7999999999999999e-133Initial program 85.9%
Simplified88.0%
associate-*l/90.4%
Applied egg-rr90.4%
Taylor expanded in M around 0 89.4%
*-commutative89.4%
associate-*l/89.4%
associate-*r/89.4%
associate-*r*90.2%
*-commutative90.2%
associate-*l*90.4%
Simplified90.4%
if -2.7999999999999999e-133 < d < -1.000000000000002e-309Initial program 43.3%
Simplified43.1%
add-sqr-sqrt43.2%
pow243.2%
sqrt-prod43.1%
unpow243.1%
sqrt-prod19.7%
add-sqr-sqrt43.3%
div-inv43.3%
metadata-eval43.3%
Applied egg-rr43.3%
*-commutative43.3%
/-rgt-identity43.3%
associate-/l*43.3%
metadata-eval43.3%
times-frac43.5%
associate-*r/43.3%
associate-*l*43.3%
*-lft-identity43.3%
associate-/l*43.3%
associate-/r/43.3%
*-commutative43.3%
associate-/r*43.3%
metadata-eval43.3%
Simplified43.3%
expm1-log1p-u12.7%
expm1-udef5.0%
Applied egg-rr5.1%
expm1-def8.4%
expm1-log1p31.8%
rem-log-exp29.2%
rem-log-exp31.8%
*-commutative31.8%
Simplified31.8%
Taylor expanded in d around -inf 68.1%
mul-1-neg68.1%
*-commutative68.1%
distribute-rgt-neg-in68.1%
associate-/r*68.2%
Simplified68.2%
if -1.000000000000002e-309 < d Initial program 67.2%
Simplified66.5%
expm1-log1p-u35.3%
expm1-udef24.5%
Applied egg-rr30.1%
expm1-def42.5%
expm1-log1p81.8%
*-commutative81.8%
Simplified81.8%
Final simplification82.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(+ 1.0 (/ (* h (* -0.5 (pow (* M (* D (/ 0.5 d))) 2.0))) l))))))
(if (<= d -6.5e-135)
t_0
(if (<= d 4e-304)
(*
(* d (sqrt (/ (/ 1.0 h) l)))
(- -1.0 (* -0.5 (* (/ h l) (pow (* D (* M (/ 0.5 d))) 2.0)))))
(if (<= d 2.8e-267)
(*
(sqrt (/ h (pow l 3.0)))
(* -0.125 (* (/ (pow D 2.0) d) (pow M 2.0))))
t_0)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h * (-0.5 * pow((M * (D * (0.5 / d))), 2.0))) / l)));
double tmp;
if (d <= -6.5e-135) {
tmp = t_0;
} else if (d <= 4e-304) {
tmp = (d * sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * pow((D * (M * (0.5 / d))), 2.0))));
} else if (d <= 2.8e-267) {
tmp = sqrt((h / pow(l, 3.0))) * (-0.125 * ((pow(D, 2.0) / d) * pow(M, 2.0)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 + ((h * ((-0.5d0) * ((m * (d_1 * (0.5d0 / d))) ** 2.0d0))) / l)))
if (d <= (-6.5d-135)) then
tmp = t_0
else if (d <= 4d-304) then
tmp = (d * sqrt(((1.0d0 / h) / l))) * ((-1.0d0) - ((-0.5d0) * ((h / l) * ((d_1 * (m * (0.5d0 / d))) ** 2.0d0))))
else if (d <= 2.8d-267) then
tmp = sqrt((h / (l ** 3.0d0))) * ((-0.125d0) * (((d_1 ** 2.0d0) / d) * (m ** 2.0d0)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 + ((h * (-0.5 * Math.pow((M * (D * (0.5 / d))), 2.0))) / l)));
double tmp;
if (d <= -6.5e-135) {
tmp = t_0;
} else if (d <= 4e-304) {
tmp = (d * Math.sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * Math.pow((D * (M * (0.5 / d))), 2.0))));
} else if (d <= 2.8e-267) {
tmp = Math.sqrt((h / Math.pow(l, 3.0))) * (-0.125 * ((Math.pow(D, 2.0) / d) * Math.pow(M, 2.0)));
} else {
tmp = t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 + ((h * (-0.5 * math.pow((M * (D * (0.5 / d))), 2.0))) / l))) tmp = 0 if d <= -6.5e-135: tmp = t_0 elif d <= 4e-304: tmp = (d * math.sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * math.pow((D * (M * (0.5 / d))), 2.0)))) elif d <= 2.8e-267: tmp = math.sqrt((h / math.pow(l, 3.0))) * (-0.125 * ((math.pow(D, 2.0) / d) * math.pow(M, 2.0))) else: tmp = t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h * Float64(-0.5 * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0))) / l)))) tmp = 0.0 if (d <= -6.5e-135) tmp = t_0; elseif (d <= 4e-304) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / h) / l))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0))))); elseif (d <= 2.8e-267) tmp = Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(-0.125 * Float64(Float64((D ^ 2.0) / d) * (M ^ 2.0)))); else tmp = t_0; end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h * (-0.5 * ((M * (D * (0.5 / d))) ^ 2.0))) / l))); tmp = 0.0; if (d <= -6.5e-135) tmp = t_0; elseif (d <= 4e-304) tmp = (d * sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * ((D * (M * (0.5 / d))) ^ 2.0)))); elseif (d <= 2.8e-267) tmp = sqrt((h / (l ^ 3.0))) * (-0.125 * (((D ^ 2.0) / d) * (M ^ 2.0))); else tmp = t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(-0.5 * N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -6.5e-135], t$95$0, If[LessEqual[d, 4e-304], N[(N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.8e-267], N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-0.125 * N[(N[(N[Power[D, 2.0], $MachinePrecision] / d), $MachinePrecision] * N[Power[M, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}\right)}{\ell}\right)\right)\\
\mathbf{if}\;d \leq -6.5 \cdot 10^{-135}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d \leq 4 \cdot 10^{-304}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\
\mathbf{elif}\;d \leq 2.8 \cdot 10^{-267}:\\
\;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \left(\frac{{D}^{2}}{d} \cdot {M}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if d < -6.50000000000000056e-135 or 2.80000000000000004e-267 < d Initial program 77.9%
Simplified78.4%
associate-*l/80.6%
Applied egg-rr80.6%
Taylor expanded in M around 0 80.6%
*-commutative80.6%
associate-*l/80.6%
associate-*r/80.6%
associate-*r*80.5%
*-commutative80.5%
associate-*l*80.6%
Simplified80.6%
if -6.50000000000000056e-135 < d < 3.99999999999999988e-304Initial program 42.3%
Simplified42.1%
add-sqr-sqrt42.2%
pow242.2%
sqrt-prod42.2%
unpow242.2%
sqrt-prod19.3%
add-sqr-sqrt42.3%
div-inv42.3%
metadata-eval42.3%
Applied egg-rr42.3%
*-commutative42.3%
/-rgt-identity42.3%
associate-/l*42.3%
metadata-eval42.3%
times-frac42.5%
associate-*r/42.3%
associate-*l*42.3%
*-lft-identity42.3%
associate-/l*42.3%
associate-/r/42.3%
*-commutative42.3%
associate-/r*42.3%
metadata-eval42.3%
Simplified42.3%
expm1-log1p-u12.4%
expm1-udef4.9%
Applied egg-rr4.9%
expm1-def8.2%
expm1-log1p31.1%
rem-log-exp28.6%
rem-log-exp31.1%
*-commutative31.1%
Simplified31.1%
Taylor expanded in d around -inf 66.5%
mul-1-neg66.5%
*-commutative66.5%
distribute-rgt-neg-in66.5%
associate-/r*66.6%
Simplified66.6%
if 3.99999999999999988e-304 < d < 2.80000000000000004e-267Initial program 30.7%
Simplified30.7%
Taylor expanded in d around 0 70.7%
associate-*r*70.7%
*-commutative70.7%
associate-/l*70.7%
associate-/r/70.7%
Simplified70.7%
Final simplification77.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(+ 1.0 (* (/ h l) (* -0.5 (pow (* (/ D d) (/ M 2.0)) 2.0))))))))
(if (<= l -1.75e+148)
t_0
(if (<= l -1.9e-280)
(*
(* d (sqrt (/ (/ 1.0 h) l)))
(- -1.0 (* -0.5 (* (/ h l) (pow (* D (* M (/ 0.5 d))) 2.0)))))
(if (<= l 2.9e+51) t_0 (* d (* (pow l -0.5) (pow h -0.5))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * pow(((D / d) * (M / 2.0)), 2.0)))));
double tmp;
if (l <= -1.75e+148) {
tmp = t_0;
} else if (l <= -1.9e-280) {
tmp = (d * sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * pow((D * (M * (0.5 / d))), 2.0))));
} else if (l <= 2.9e+51) {
tmp = t_0;
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 + ((h / l) * ((-0.5d0) * (((d_1 / d) * (m / 2.0d0)) ** 2.0d0)))))
if (l <= (-1.75d+148)) then
tmp = t_0
else if (l <= (-1.9d-280)) then
tmp = (d * sqrt(((1.0d0 / h) / l))) * ((-1.0d0) - ((-0.5d0) * ((h / l) * ((d_1 * (m * (0.5d0 / d))) ** 2.0d0))))
else if (l <= 2.9d+51) then
tmp = t_0
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * Math.pow(((D / d) * (M / 2.0)), 2.0)))));
double tmp;
if (l <= -1.75e+148) {
tmp = t_0;
} else if (l <= -1.9e-280) {
tmp = (d * Math.sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * Math.pow((D * (M * (0.5 / d))), 2.0))));
} else if (l <= 2.9e+51) {
tmp = t_0;
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * math.pow(((D / d) * (M / 2.0)), 2.0))))) tmp = 0 if l <= -1.75e+148: tmp = t_0 elif l <= -1.9e-280: tmp = (d * math.sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * math.pow((D * (M * (0.5 / d))), 2.0)))) elif l <= 2.9e+51: tmp = t_0 else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0)))))) tmp = 0.0 if (l <= -1.75e+148) tmp = t_0; elseif (l <= -1.9e-280) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / h) / l))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0))))); elseif (l <= 2.9e+51) tmp = t_0; else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * (((D / d) * (M / 2.0)) ^ 2.0))))); tmp = 0.0; if (l <= -1.75e+148) tmp = t_0; elseif (l <= -1.9e-280) tmp = (d * sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * ((D * (M * (0.5 / d))) ^ 2.0)))); elseif (l <= 2.9e+51) tmp = t_0; else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.75e+148], t$95$0, If[LessEqual[l, -1.9e-280], N[(N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.9e+51], t$95$0, N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\right)\right)\right)\\
\mathbf{if}\;\ell \leq -1.75 \cdot 10^{+148}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -1.9 \cdot 10^{-280}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\
\mathbf{elif}\;\ell \leq 2.9 \cdot 10^{+51}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1.7499999999999999e148 or -1.9000000000000001e-280 < l < 2.8999999999999998e51Initial program 74.1%
Simplified74.1%
if -1.7499999999999999e148 < l < -1.9000000000000001e-280Initial program 73.5%
Simplified74.4%
add-sqr-sqrt74.4%
pow274.4%
sqrt-prod74.4%
unpow274.4%
sqrt-prod46.4%
add-sqr-sqrt74.4%
div-inv74.4%
metadata-eval74.4%
Applied egg-rr74.4%
*-commutative74.4%
/-rgt-identity74.4%
associate-/l*74.4%
metadata-eval74.4%
times-frac74.5%
associate-*r/75.4%
associate-*l*75.4%
*-lft-identity75.4%
associate-/l*75.4%
associate-/r/75.4%
*-commutative75.4%
associate-/r*75.4%
metadata-eval75.4%
Simplified75.4%
expm1-log1p-u41.2%
expm1-udef31.7%
Applied egg-rr29.0%
expm1-def36.5%
expm1-log1p66.0%
rem-log-exp58.8%
rem-log-exp66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in d around -inf 85.2%
mul-1-neg85.2%
*-commutative85.2%
distribute-rgt-neg-in85.2%
associate-/r*85.2%
Simplified85.2%
if 2.8999999999999998e51 < l Initial program 49.4%
Simplified49.4%
add-sqr-sqrt49.4%
pow249.4%
sqrt-prod49.4%
unpow249.4%
sqrt-prod32.5%
add-sqr-sqrt49.8%
div-inv49.8%
metadata-eval49.8%
Applied egg-rr49.8%
*-commutative49.8%
/-rgt-identity49.8%
associate-/l*49.8%
metadata-eval49.8%
times-frac52.2%
associate-*r/52.0%
associate-*l*52.0%
*-lft-identity52.0%
associate-/l*52.0%
associate-/r/52.0%
*-commutative52.0%
associate-/r*52.0%
metadata-eval52.0%
Simplified52.0%
Taylor expanded in d around inf 55.1%
unpow-155.1%
metadata-eval55.1%
pow-sqr55.1%
rem-sqrt-square55.1%
rem-square-sqrt54.9%
fabs-sqr54.9%
rem-square-sqrt55.1%
Simplified55.1%
*-commutative55.1%
unpow-prod-down61.7%
Applied egg-rr61.7%
Final simplification76.2%
(FPCore (d h l M D)
:precision binary64
(if (or (<= d -7.2e-138) (not (<= d 4e-304)))
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(+ 1.0 (/ (* h (* -0.5 (pow (* M (* D (/ 0.5 d))) 2.0))) l))))
(*
(* d (sqrt (/ (/ 1.0 h) l)))
(- -1.0 (* -0.5 (* (/ h l) (pow (* D (* M (/ 0.5 d))) 2.0)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if ((d <= -7.2e-138) || !(d <= 4e-304)) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h * (-0.5 * pow((M * (D * (0.5 / d))), 2.0))) / l)));
} else {
tmp = (d * sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * pow((D * (M * (0.5 / d))), 2.0))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if ((d <= (-7.2d-138)) .or. (.not. (d <= 4d-304))) then
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 + ((h * ((-0.5d0) * ((m * (d_1 * (0.5d0 / d))) ** 2.0d0))) / l)))
else
tmp = (d * sqrt(((1.0d0 / h) / l))) * ((-1.0d0) - ((-0.5d0) * ((h / l) * ((d_1 * (m * (0.5d0 / d))) ** 2.0d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if ((d <= -7.2e-138) || !(d <= 4e-304)) {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 + ((h * (-0.5 * Math.pow((M * (D * (0.5 / d))), 2.0))) / l)));
} else {
tmp = (d * Math.sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * Math.pow((D * (M * (0.5 / d))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if (d <= -7.2e-138) or not (d <= 4e-304): tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 + ((h * (-0.5 * math.pow((M * (D * (0.5 / d))), 2.0))) / l))) else: tmp = (d * math.sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * math.pow((D * (M * (0.5 / d))), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if ((d <= -7.2e-138) || !(d <= 4e-304)) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h * Float64(-0.5 * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0))) / l)))); else tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / h) / l))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if ((d <= -7.2e-138) || ~((d <= 4e-304))) tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h * (-0.5 * ((M * (D * (0.5 / d))) ^ 2.0))) / l))); else tmp = (d * sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * ((D * (M * (0.5 / d))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[Or[LessEqual[d, -7.2e-138], N[Not[LessEqual[d, 4e-304]], $MachinePrecision]], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(-0.5 * N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -7.2 \cdot 10^{-138} \lor \neg \left(d \leq 4 \cdot 10^{-304}\right):\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}\right)}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if d < -7.20000000000000036e-138 or 3.99999999999999988e-304 < d Initial program 75.7%
Simplified76.1%
associate-*l/78.2%
Applied egg-rr78.2%
Taylor expanded in M around 0 78.2%
*-commutative78.2%
associate-*l/78.2%
associate-*r/78.2%
associate-*r*78.2%
*-commutative78.2%
associate-*l*78.2%
Simplified78.2%
if -7.20000000000000036e-138 < d < 3.99999999999999988e-304Initial program 42.3%
Simplified42.1%
add-sqr-sqrt42.2%
pow242.2%
sqrt-prod42.2%
unpow242.2%
sqrt-prod19.3%
add-sqr-sqrt42.3%
div-inv42.3%
metadata-eval42.3%
Applied egg-rr42.3%
*-commutative42.3%
/-rgt-identity42.3%
associate-/l*42.3%
metadata-eval42.3%
times-frac42.5%
associate-*r/42.3%
associate-*l*42.3%
*-lft-identity42.3%
associate-/l*42.3%
associate-/r/42.3%
*-commutative42.3%
associate-/r*42.3%
metadata-eval42.3%
Simplified42.3%
expm1-log1p-u12.4%
expm1-udef4.9%
Applied egg-rr4.9%
expm1-def8.2%
expm1-log1p31.1%
rem-log-exp28.6%
rem-log-exp31.1%
*-commutative31.1%
Simplified31.1%
Taylor expanded in d around -inf 66.5%
mul-1-neg66.5%
*-commutative66.5%
distribute-rgt-neg-in66.5%
associate-/r*66.6%
Simplified66.6%
Final simplification76.2%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.25e+200)
(* (/ (sqrt (- d)) (sqrt (- l))) (sqrt (/ d h)))
(if (<= l -2.6e-259)
(*
(* d (sqrt (/ (/ 1.0 h) l)))
(- -1.0 (* -0.5 (* (/ h l) (pow (* D (* M (/ 0.5 d))) 2.0)))))
(if (<= l 8.5e+50)
(*
(+ 1.0 (* -0.5 (/ (* h (pow (* D (/ (* M 0.5) d)) 2.0)) l)))
(sqrt (* (/ d l) (/ d h))))
(* d (* (pow l -0.5) (pow h -0.5)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.25e+200) {
tmp = (sqrt(-d) / sqrt(-l)) * sqrt((d / h));
} else if (l <= -2.6e-259) {
tmp = (d * sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * pow((D * (M * (0.5 / d))), 2.0))));
} else if (l <= 8.5e+50) {
tmp = (1.0 + (-0.5 * ((h * pow((D * ((M * 0.5) / d)), 2.0)) / l))) * sqrt(((d / l) * (d / h)));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1.25d+200)) then
tmp = (sqrt(-d) / sqrt(-l)) * sqrt((d / h))
else if (l <= (-2.6d-259)) then
tmp = (d * sqrt(((1.0d0 / h) / l))) * ((-1.0d0) - ((-0.5d0) * ((h / l) * ((d_1 * (m * (0.5d0 / d))) ** 2.0d0))))
else if (l <= 8.5d+50) then
tmp = (1.0d0 + ((-0.5d0) * ((h * ((d_1 * ((m * 0.5d0) / d)) ** 2.0d0)) / l))) * sqrt(((d / l) * (d / h)))
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.25e+200) {
tmp = (Math.sqrt(-d) / Math.sqrt(-l)) * Math.sqrt((d / h));
} else if (l <= -2.6e-259) {
tmp = (d * Math.sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * Math.pow((D * (M * (0.5 / d))), 2.0))));
} else if (l <= 8.5e+50) {
tmp = (1.0 + (-0.5 * ((h * Math.pow((D * ((M * 0.5) / d)), 2.0)) / l))) * Math.sqrt(((d / l) * (d / h)));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.25e+200: tmp = (math.sqrt(-d) / math.sqrt(-l)) * math.sqrt((d / h)) elif l <= -2.6e-259: tmp = (d * math.sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * math.pow((D * (M * (0.5 / d))), 2.0)))) elif l <= 8.5e+50: tmp = (1.0 + (-0.5 * ((h * math.pow((D * ((M * 0.5) / d)), 2.0)) / l))) * math.sqrt(((d / l) * (d / h))) else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.25e+200) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * sqrt(Float64(d / h))); elseif (l <= -2.6e-259) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / h) / l))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0))))); elseif (l <= 8.5e+50) tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h * (Float64(D * Float64(Float64(M * 0.5) / d)) ^ 2.0)) / l))) * sqrt(Float64(Float64(d / l) * Float64(d / h)))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.25e+200) tmp = (sqrt(-d) / sqrt(-l)) * sqrt((d / h)); elseif (l <= -2.6e-259) tmp = (d * sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * ((D * (M * (0.5 / d))) ^ 2.0)))); elseif (l <= 8.5e+50) tmp = (1.0 + (-0.5 * ((h * ((D * ((M * 0.5) / d)) ^ 2.0)) / l))) * sqrt(((d / l) * (d / h))); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.25e+200], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2.6e-259], N[(N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 8.5e+50], N[(N[(1.0 + N[(-0.5 * N[(N[(h * N[Power[N[(D * N[(N[(M * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.25 \cdot 10^{+200}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;\ell \leq -2.6 \cdot 10^{-259}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\
\mathbf{elif}\;\ell \leq 8.5 \cdot 10^{+50}:\\
\;\;\;\;\left(1 + -0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2}}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1.25000000000000005e200Initial program 53.8%
Simplified57.9%
Taylor expanded in h around 0 41.8%
frac-2neg53.9%
sqrt-div65.5%
Applied egg-rr52.8%
if -1.25000000000000005e200 < l < -2.60000000000000001e-259Initial program 73.6%
Simplified74.5%
add-sqr-sqrt74.5%
pow274.5%
sqrt-prod74.5%
unpow274.5%
sqrt-prod45.7%
add-sqr-sqrt74.5%
div-inv74.5%
metadata-eval74.5%
Applied egg-rr74.5%
*-commutative74.5%
/-rgt-identity74.5%
associate-/l*74.5%
metadata-eval74.5%
times-frac74.6%
associate-*r/75.4%
associate-*l*75.4%
*-lft-identity75.4%
associate-/l*75.4%
associate-/r/75.4%
*-commutative75.4%
associate-/r*75.4%
metadata-eval75.4%
Simplified75.4%
expm1-log1p-u43.7%
expm1-udef30.2%
Applied egg-rr27.7%
expm1-def39.4%
expm1-log1p66.7%
rem-log-exp60.0%
rem-log-exp66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in d around -inf 82.5%
mul-1-neg82.5%
*-commutative82.5%
distribute-rgt-neg-in82.5%
associate-/r*82.9%
Simplified82.9%
if -2.60000000000000001e-259 < l < 8.49999999999999961e50Initial program 79.2%
Simplified78.2%
add-sqr-sqrt78.2%
pow278.2%
sqrt-prod78.2%
unpow278.2%
sqrt-prod45.4%
add-sqr-sqrt78.3%
div-inv78.3%
metadata-eval78.3%
Applied egg-rr78.3%
*-commutative78.3%
/-rgt-identity78.3%
associate-/l*78.3%
metadata-eval78.3%
times-frac79.3%
associate-*r/78.2%
associate-*l*78.1%
*-lft-identity78.1%
associate-/l*78.2%
associate-/r/78.2%
*-commutative78.2%
associate-/r*78.2%
metadata-eval78.2%
Simplified78.2%
expm1-log1p-u29.5%
expm1-udef25.3%
Applied egg-rr21.6%
expm1-def25.8%
expm1-log1p71.9%
rem-log-exp65.6%
rem-log-exp71.9%
*-commutative71.9%
Simplified71.9%
associate-*l/73.2%
*-commutative73.2%
associate-*r*73.2%
associate-*r*73.2%
*-commutative73.2%
associate-*r/73.2%
Applied egg-rr73.2%
if 8.49999999999999961e50 < l Initial program 49.4%
Simplified49.4%
add-sqr-sqrt49.4%
pow249.4%
sqrt-prod49.4%
unpow249.4%
sqrt-prod32.5%
add-sqr-sqrt49.8%
div-inv49.8%
metadata-eval49.8%
Applied egg-rr49.8%
*-commutative49.8%
/-rgt-identity49.8%
associate-/l*49.8%
metadata-eval49.8%
times-frac52.2%
associate-*r/52.0%
associate-*l*52.0%
*-lft-identity52.0%
associate-/l*52.0%
associate-/r/52.0%
*-commutative52.0%
associate-/r*52.0%
metadata-eval52.0%
Simplified52.0%
Taylor expanded in d around inf 55.1%
unpow-155.1%
metadata-eval55.1%
pow-sqr55.1%
rem-sqrt-square55.1%
rem-square-sqrt54.9%
fabs-sqr54.9%
rem-square-sqrt55.1%
Simplified55.1%
*-commutative55.1%
unpow-prod-down61.7%
Applied egg-rr61.7%
Final simplification73.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(+ 1.0 (* -0.5 (/ (* h (pow (* D (/ (* M 0.5) d)) 2.0)) l)))
(sqrt (* (/ d l) (/ d h))))))
(if (<= l -6.2e+155)
t_0
(if (<= l -2.55e-259)
(*
(* d (pow (* l h) -0.5))
(- -1.0 (* -0.5 (* (/ h l) (pow (* D (* M (/ 0.5 d))) 2.0)))))
(if (<= l 2.15e+51) t_0 (* d (* (pow l -0.5) (pow h -0.5))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (1.0 + (-0.5 * ((h * pow((D * ((M * 0.5) / d)), 2.0)) / l))) * sqrt(((d / l) * (d / h)));
double tmp;
if (l <= -6.2e+155) {
tmp = t_0;
} else if (l <= -2.55e-259) {
tmp = (d * pow((l * h), -0.5)) * (-1.0 - (-0.5 * ((h / l) * pow((D * (M * (0.5 / d))), 2.0))));
} else if (l <= 2.15e+51) {
tmp = t_0;
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (1.0d0 + ((-0.5d0) * ((h * ((d_1 * ((m * 0.5d0) / d)) ** 2.0d0)) / l))) * sqrt(((d / l) * (d / h)))
if (l <= (-6.2d+155)) then
tmp = t_0
else if (l <= (-2.55d-259)) then
tmp = (d * ((l * h) ** (-0.5d0))) * ((-1.0d0) - ((-0.5d0) * ((h / l) * ((d_1 * (m * (0.5d0 / d))) ** 2.0d0))))
else if (l <= 2.15d+51) then
tmp = t_0
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (1.0 + (-0.5 * ((h * Math.pow((D * ((M * 0.5) / d)), 2.0)) / l))) * Math.sqrt(((d / l) * (d / h)));
double tmp;
if (l <= -6.2e+155) {
tmp = t_0;
} else if (l <= -2.55e-259) {
tmp = (d * Math.pow((l * h), -0.5)) * (-1.0 - (-0.5 * ((h / l) * Math.pow((D * (M * (0.5 / d))), 2.0))));
} else if (l <= 2.15e+51) {
tmp = t_0;
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (1.0 + (-0.5 * ((h * math.pow((D * ((M * 0.5) / d)), 2.0)) / l))) * math.sqrt(((d / l) * (d / h))) tmp = 0 if l <= -6.2e+155: tmp = t_0 elif l <= -2.55e-259: tmp = (d * math.pow((l * h), -0.5)) * (-1.0 - (-0.5 * ((h / l) * math.pow((D * (M * (0.5 / d))), 2.0)))) elif l <= 2.15e+51: tmp = t_0 else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h * (Float64(D * Float64(Float64(M * 0.5) / d)) ^ 2.0)) / l))) * sqrt(Float64(Float64(d / l) * Float64(d / h)))) tmp = 0.0 if (l <= -6.2e+155) tmp = t_0; elseif (l <= -2.55e-259) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0))))); elseif (l <= 2.15e+51) tmp = t_0; else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (1.0 + (-0.5 * ((h * ((D * ((M * 0.5) / d)) ^ 2.0)) / l))) * sqrt(((d / l) * (d / h))); tmp = 0.0; if (l <= -6.2e+155) tmp = t_0; elseif (l <= -2.55e-259) tmp = (d * ((l * h) ^ -0.5)) * (-1.0 - (-0.5 * ((h / l) * ((D * (M * (0.5 / d))) ^ 2.0)))); elseif (l <= 2.15e+51) tmp = t_0; else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(1.0 + N[(-0.5 * N[(N[(h * N[Power[N[(D * N[(N[(M * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -6.2e+155], t$95$0, If[LessEqual[l, -2.55e-259], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.15e+51], t$95$0, N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 + -0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2}}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{if}\;\ell \leq -6.2 \cdot 10^{+155}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -2.55 \cdot 10^{-259}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\
\mathbf{elif}\;\ell \leq 2.15 \cdot 10^{+51}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -6.19999999999999978e155 or -2.5499999999999999e-259 < l < 2.1499999999999999e51Initial program 74.7%
Simplified74.8%
add-sqr-sqrt74.8%
pow274.8%
sqrt-prod74.8%
unpow274.8%
sqrt-prod44.6%
add-sqr-sqrt74.9%
div-inv74.9%
metadata-eval74.9%
Applied egg-rr74.9%
*-commutative74.9%
/-rgt-identity74.9%
associate-/l*74.9%
metadata-eval74.9%
times-frac74.9%
associate-*r/74.8%
associate-*l*74.8%
*-lft-identity74.8%
associate-/l*74.8%
associate-/r/74.8%
*-commutative74.8%
associate-/r*74.8%
metadata-eval74.8%
Simplified74.8%
expm1-log1p-u35.0%
expm1-udef23.6%
Applied egg-rr20.9%
expm1-def30.9%
expm1-log1p67.2%
rem-log-exp61.8%
rem-log-exp67.2%
*-commutative67.2%
Simplified67.2%
associate-*l/68.2%
*-commutative68.2%
associate-*r*68.2%
associate-*r*68.2%
*-commutative68.2%
associate-*r/68.2%
Applied egg-rr68.2%
if -6.19999999999999978e155 < l < -2.5499999999999999e-259Initial program 72.6%
Simplified73.6%
add-sqr-sqrt73.6%
pow273.6%
sqrt-prod73.6%
unpow273.6%
sqrt-prod43.5%
add-sqr-sqrt73.6%
div-inv73.6%
metadata-eval73.6%
Applied egg-rr73.6%
*-commutative73.6%
/-rgt-identity73.6%
associate-/l*73.6%
metadata-eval73.6%
times-frac73.7%
associate-*r/74.6%
associate-*l*74.6%
*-lft-identity74.6%
associate-/l*74.6%
associate-/r/74.6%
*-commutative74.6%
associate-/r*74.6%
metadata-eval74.6%
Simplified74.6%
expm1-log1p-u41.4%
expm1-udef31.6%
Applied egg-rr28.8%
expm1-def36.6%
expm1-log1p64.9%
rem-log-exp57.4%
rem-log-exp64.9%
*-commutative64.9%
Simplified64.9%
Taylor expanded in d around -inf 84.7%
mul-1-neg84.7%
distribute-rgt-neg-in84.7%
unpow-184.7%
metadata-eval84.7%
pow-sqr84.7%
rem-sqrt-square84.7%
rem-square-sqrt84.5%
fabs-sqr84.5%
rem-square-sqrt84.7%
Simplified84.7%
if 2.1499999999999999e51 < l Initial program 49.4%
Simplified49.4%
add-sqr-sqrt49.4%
pow249.4%
sqrt-prod49.4%
unpow249.4%
sqrt-prod32.5%
add-sqr-sqrt49.8%
div-inv49.8%
metadata-eval49.8%
Applied egg-rr49.8%
*-commutative49.8%
/-rgt-identity49.8%
associate-/l*49.8%
metadata-eval49.8%
times-frac52.2%
associate-*r/52.0%
associate-*l*52.0%
*-lft-identity52.0%
associate-/l*52.0%
associate-/r/52.0%
*-commutative52.0%
associate-/r*52.0%
metadata-eval52.0%
Simplified52.0%
Taylor expanded in d around inf 55.1%
unpow-155.1%
metadata-eval55.1%
pow-sqr55.1%
rem-sqrt-square55.1%
rem-square-sqrt54.9%
fabs-sqr54.9%
rem-square-sqrt55.1%
Simplified55.1%
*-commutative55.1%
unpow-prod-down61.7%
Applied egg-rr61.7%
Final simplification73.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(+ 1.0 (* -0.5 (/ (* h (pow (* D (/ (* M 0.5) d)) 2.0)) l)))
(sqrt (* (/ d l) (/ d h))))))
(if (<= l -2.9e+166)
t_0
(if (<= l -2.5e-259)
(*
(* d (sqrt (/ (/ 1.0 h) l)))
(- -1.0 (* -0.5 (* (/ h l) (pow (* D (* M (/ 0.5 d))) 2.0)))))
(if (<= l 3.1e+50) t_0 (* d (* (pow l -0.5) (pow h -0.5))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (1.0 + (-0.5 * ((h * pow((D * ((M * 0.5) / d)), 2.0)) / l))) * sqrt(((d / l) * (d / h)));
double tmp;
if (l <= -2.9e+166) {
tmp = t_0;
} else if (l <= -2.5e-259) {
tmp = (d * sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * pow((D * (M * (0.5 / d))), 2.0))));
} else if (l <= 3.1e+50) {
tmp = t_0;
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (1.0d0 + ((-0.5d0) * ((h * ((d_1 * ((m * 0.5d0) / d)) ** 2.0d0)) / l))) * sqrt(((d / l) * (d / h)))
if (l <= (-2.9d+166)) then
tmp = t_0
else if (l <= (-2.5d-259)) then
tmp = (d * sqrt(((1.0d0 / h) / l))) * ((-1.0d0) - ((-0.5d0) * ((h / l) * ((d_1 * (m * (0.5d0 / d))) ** 2.0d0))))
else if (l <= 3.1d+50) then
tmp = t_0
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (1.0 + (-0.5 * ((h * Math.pow((D * ((M * 0.5) / d)), 2.0)) / l))) * Math.sqrt(((d / l) * (d / h)));
double tmp;
if (l <= -2.9e+166) {
tmp = t_0;
} else if (l <= -2.5e-259) {
tmp = (d * Math.sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * Math.pow((D * (M * (0.5 / d))), 2.0))));
} else if (l <= 3.1e+50) {
tmp = t_0;
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (1.0 + (-0.5 * ((h * math.pow((D * ((M * 0.5) / d)), 2.0)) / l))) * math.sqrt(((d / l) * (d / h))) tmp = 0 if l <= -2.9e+166: tmp = t_0 elif l <= -2.5e-259: tmp = (d * math.sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * math.pow((D * (M * (0.5 / d))), 2.0)))) elif l <= 3.1e+50: tmp = t_0 else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h * (Float64(D * Float64(Float64(M * 0.5) / d)) ^ 2.0)) / l))) * sqrt(Float64(Float64(d / l) * Float64(d / h)))) tmp = 0.0 if (l <= -2.9e+166) tmp = t_0; elseif (l <= -2.5e-259) tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / h) / l))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0))))); elseif (l <= 3.1e+50) tmp = t_0; else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (1.0 + (-0.5 * ((h * ((D * ((M * 0.5) / d)) ^ 2.0)) / l))) * sqrt(((d / l) * (d / h))); tmp = 0.0; if (l <= -2.9e+166) tmp = t_0; elseif (l <= -2.5e-259) tmp = (d * sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * ((D * (M * (0.5 / d))) ^ 2.0)))); elseif (l <= 3.1e+50) tmp = t_0; else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(1.0 + N[(-0.5 * N[(N[(h * N[Power[N[(D * N[(N[(M * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.9e+166], t$95$0, If[LessEqual[l, -2.5e-259], N[(N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.1e+50], t$95$0, N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 + -0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2}}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{if}\;\ell \leq -2.9 \cdot 10^{+166}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -2.5 \cdot 10^{-259}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\
\mathbf{elif}\;\ell \leq 3.1 \cdot 10^{+50}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -2.9000000000000001e166 or -2.49999999999999989e-259 < l < 3.10000000000000003e50Initial program 74.3%
Simplified74.4%
add-sqr-sqrt74.4%
pow274.4%
sqrt-prod74.4%
unpow274.4%
sqrt-prod44.5%
add-sqr-sqrt74.5%
div-inv74.5%
metadata-eval74.5%
Applied egg-rr74.5%
*-commutative74.5%
/-rgt-identity74.5%
associate-/l*74.5%
metadata-eval74.5%
times-frac74.5%
associate-*r/74.4%
associate-*l*74.3%
*-lft-identity74.3%
associate-/l*74.4%
associate-/r/74.4%
*-commutative74.4%
associate-/r*74.4%
metadata-eval74.4%
Simplified74.4%
expm1-log1p-u33.9%
expm1-udef24.0%
Applied egg-rr21.2%
expm1-def29.7%
expm1-log1p66.6%
rem-log-exp61.2%
rem-log-exp66.6%
*-commutative66.6%
Simplified66.6%
associate-*l/67.7%
*-commutative67.7%
associate-*r*67.7%
associate-*r*67.7%
*-commutative67.7%
associate-*r/67.7%
Applied egg-rr67.7%
if -2.9000000000000001e166 < l < -2.49999999999999989e-259Initial program 73.2%
Simplified74.2%
add-sqr-sqrt74.2%
pow274.2%
sqrt-prod74.2%
unpow274.2%
sqrt-prod43.6%
add-sqr-sqrt74.2%
div-inv74.2%
metadata-eval74.2%
Applied egg-rr74.2%
*-commutative74.2%
/-rgt-identity74.2%
associate-/l*74.2%
metadata-eval74.2%
times-frac74.3%
associate-*r/75.2%
associate-*l*75.1%
*-lft-identity75.1%
associate-/l*75.2%
associate-/r/75.2%
*-commutative75.2%
associate-/r*75.2%
metadata-eval75.2%
Simplified75.2%
expm1-log1p-u42.7%
expm1-udef31.0%
Applied egg-rr28.3%
expm1-def38.0%
expm1-log1p65.7%
rem-log-exp58.3%
rem-log-exp65.7%
*-commutative65.7%
Simplified65.7%
Taylor expanded in d around -inf 85.0%
mul-1-neg85.0%
*-commutative85.0%
distribute-rgt-neg-in85.0%
associate-/r*85.1%
Simplified85.1%
if 3.10000000000000003e50 < l Initial program 49.4%
Simplified49.4%
add-sqr-sqrt49.4%
pow249.4%
sqrt-prod49.4%
unpow249.4%
sqrt-prod32.5%
add-sqr-sqrt49.8%
div-inv49.8%
metadata-eval49.8%
Applied egg-rr49.8%
*-commutative49.8%
/-rgt-identity49.8%
associate-/l*49.8%
metadata-eval49.8%
times-frac52.2%
associate-*r/52.0%
associate-*l*52.0%
*-lft-identity52.0%
associate-/l*52.0%
associate-/r/52.0%
*-commutative52.0%
associate-/r*52.0%
metadata-eval52.0%
Simplified52.0%
Taylor expanded in d around inf 55.1%
unpow-155.1%
metadata-eval55.1%
pow-sqr55.1%
rem-sqrt-square55.1%
rem-square-sqrt54.9%
fabs-sqr54.9%
rem-square-sqrt55.1%
Simplified55.1%
*-commutative55.1%
unpow-prod-down61.7%
Applied egg-rr61.7%
Final simplification73.0%
(FPCore (d h l M D)
:precision binary64
(if (<= D 16000000000.0)
(* (sqrt (/ d l)) (/ 1.0 (sqrt (/ h d))))
(*
(+ 1.0 (* -0.5 (* (/ h l) (pow (* D (* M (/ 0.5 d))) 2.0))))
(sqrt (* (/ d l) (/ d h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 16000000000.0) {
tmp = sqrt((d / l)) * (1.0 / sqrt((h / d)));
} else {
tmp = (1.0 + (-0.5 * ((h / l) * pow((D * (M * (0.5 / d))), 2.0)))) * sqrt(((d / l) * (d / h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 16000000000.0d0) then
tmp = sqrt((d / l)) * (1.0d0 / sqrt((h / d)))
else
tmp = (1.0d0 + ((-0.5d0) * ((h / l) * ((d_1 * (m * (0.5d0 / d))) ** 2.0d0)))) * sqrt(((d / l) * (d / h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 16000000000.0) {
tmp = Math.sqrt((d / l)) * (1.0 / Math.sqrt((h / d)));
} else {
tmp = (1.0 + (-0.5 * ((h / l) * Math.pow((D * (M * (0.5 / d))), 2.0)))) * Math.sqrt(((d / l) * (d / h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if D <= 16000000000.0: tmp = math.sqrt((d / l)) * (1.0 / math.sqrt((h / d))) else: tmp = (1.0 + (-0.5 * ((h / l) * math.pow((D * (M * (0.5 / d))), 2.0)))) * math.sqrt(((d / l) * (d / h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (D <= 16000000000.0) tmp = Float64(sqrt(Float64(d / l)) * Float64(1.0 / sqrt(Float64(h / d)))); else tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0)))) * sqrt(Float64(Float64(d / l) * Float64(d / h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (D <= 16000000000.0) tmp = sqrt((d / l)) * (1.0 / sqrt((h / d))); else tmp = (1.0 + (-0.5 * ((h / l) * ((D * (M * (0.5 / d))) ^ 2.0)))) * sqrt(((d / l) * (d / h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[D, 16000000000.0], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \leq 16000000000:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\end{array}
\end{array}
if D < 1.6e10Initial program 72.2%
Simplified72.7%
Taylor expanded in h around 0 47.4%
clear-num47.0%
sqrt-div47.7%
metadata-eval47.7%
Applied egg-rr47.7%
if 1.6e10 < D Initial program 63.7%
Simplified62.2%
add-sqr-sqrt62.2%
pow262.2%
sqrt-prod62.2%
unpow262.2%
sqrt-prod34.1%
add-sqr-sqrt62.3%
div-inv62.3%
metadata-eval62.3%
Applied egg-rr62.3%
*-commutative62.3%
/-rgt-identity62.3%
associate-/l*62.3%
metadata-eval62.3%
times-frac63.8%
associate-*r/63.6%
associate-*l*63.6%
*-lft-identity63.6%
associate-/l*63.6%
associate-/r/63.6%
*-commutative63.6%
associate-/r*63.6%
metadata-eval63.6%
Simplified63.6%
expm1-log1p-u21.8%
expm1-udef13.5%
Applied egg-rr13.4%
expm1-def21.4%
expm1-log1p60.3%
rem-log-exp57.4%
rem-log-exp60.3%
*-commutative60.3%
Simplified60.3%
Final simplification51.0%
(FPCore (d h l M D)
:precision binary64
(if (<= D 5.5e-10)
(* (sqrt (/ d l)) (/ 1.0 (sqrt (/ h d))))
(*
(+ 1.0 (* -0.5 (/ (* h (pow (* D (/ (* M 0.5) d)) 2.0)) l)))
(sqrt (* (/ d l) (/ d h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 5.5e-10) {
tmp = sqrt((d / l)) * (1.0 / sqrt((h / d)));
} else {
tmp = (1.0 + (-0.5 * ((h * pow((D * ((M * 0.5) / d)), 2.0)) / l))) * sqrt(((d / l) * (d / h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 5.5d-10) then
tmp = sqrt((d / l)) * (1.0d0 / sqrt((h / d)))
else
tmp = (1.0d0 + ((-0.5d0) * ((h * ((d_1 * ((m * 0.5d0) / d)) ** 2.0d0)) / l))) * sqrt(((d / l) * (d / h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 5.5e-10) {
tmp = Math.sqrt((d / l)) * (1.0 / Math.sqrt((h / d)));
} else {
tmp = (1.0 + (-0.5 * ((h * Math.pow((D * ((M * 0.5) / d)), 2.0)) / l))) * Math.sqrt(((d / l) * (d / h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if D <= 5.5e-10: tmp = math.sqrt((d / l)) * (1.0 / math.sqrt((h / d))) else: tmp = (1.0 + (-0.5 * ((h * math.pow((D * ((M * 0.5) / d)), 2.0)) / l))) * math.sqrt(((d / l) * (d / h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (D <= 5.5e-10) tmp = Float64(sqrt(Float64(d / l)) * Float64(1.0 / sqrt(Float64(h / d)))); else tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h * (Float64(D * Float64(Float64(M * 0.5) / d)) ^ 2.0)) / l))) * sqrt(Float64(Float64(d / l) * Float64(d / h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (D <= 5.5e-10) tmp = sqrt((d / l)) * (1.0 / sqrt((h / d))); else tmp = (1.0 + (-0.5 * ((h * ((D * ((M * 0.5) / d)) ^ 2.0)) / l))) * sqrt(((d / l) * (d / h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[D, 5.5e-10], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(N[(h * N[Power[N[(D * N[(N[(M * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \leq 5.5 \cdot 10^{-10}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + -0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2}}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\end{array}
\end{array}
if D < 5.4999999999999996e-10Initial program 72.1%
Simplified72.6%
Taylor expanded in h around 0 47.3%
clear-num47.0%
sqrt-div47.6%
metadata-eval47.6%
Applied egg-rr47.6%
if 5.4999999999999996e-10 < D Initial program 64.3%
Simplified62.9%
add-sqr-sqrt62.9%
pow262.9%
sqrt-prod62.9%
unpow262.9%
sqrt-prod35.0%
add-sqr-sqrt63.0%
div-inv63.0%
metadata-eval63.0%
Applied egg-rr63.0%
*-commutative63.0%
/-rgt-identity63.0%
associate-/l*63.0%
metadata-eval63.0%
times-frac64.5%
associate-*r/64.2%
associate-*l*64.2%
*-lft-identity64.2%
associate-/l*64.2%
associate-/r/64.2%
*-commutative64.2%
associate-/r*64.2%
metadata-eval64.2%
Simplified64.2%
expm1-log1p-u23.2%
expm1-udef15.4%
Applied egg-rr15.3%
expm1-def22.9%
expm1-log1p59.7%
rem-log-exp56.9%
rem-log-exp59.7%
*-commutative59.7%
Simplified59.7%
associate-*l/61.5%
*-commutative61.5%
associate-*r*60.3%
associate-*r*61.5%
*-commutative61.5%
associate-*r/61.5%
Applied egg-rr61.5%
Final simplification51.5%
(FPCore (d h l M D)
:precision binary64
(if (<= d -5.2e-11)
(sqrt (* (/ d l) (/ d h)))
(if (<= d -1e-309)
(* d (pow (pow (* l h) 2.0) -0.25))
(* d (/ (pow h -0.5) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5.2e-11) {
tmp = sqrt(((d / l) * (d / h)));
} else if (d <= -1e-309) {
tmp = d * pow(pow((l * h), 2.0), -0.25);
} 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 (d <= (-5.2d-11)) then
tmp = sqrt(((d / l) * (d / h)))
else if (d <= (-1d-309)) then
tmp = d * (((l * h) ** 2.0d0) ** (-0.25d0))
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 (d <= -5.2e-11) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else if (d <= -1e-309) {
tmp = d * Math.pow(Math.pow((l * h), 2.0), -0.25);
} else {
tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -5.2e-11: tmp = math.sqrt(((d / l) * (d / h))) elif d <= -1e-309: tmp = d * math.pow(math.pow((l * h), 2.0), -0.25) else: tmp = d * (math.pow(h, -0.5) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -5.2e-11) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); elseif (d <= -1e-309) tmp = Float64(d * ((Float64(l * h) ^ 2.0) ^ -0.25)); 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 (d <= -5.2e-11) tmp = sqrt(((d / l) * (d / h))); elseif (d <= -1e-309) tmp = d * (((l * h) ^ 2.0) ^ -0.25); else tmp = d * ((h ^ -0.5) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5.2e-11], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, -1e-309], N[(d * N[Power[N[Power[N[(l * h), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $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}\;d \leq -5.2 \cdot 10^{-11}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\
\;\;\;\;d \cdot {\left({\left(\ell \cdot h\right)}^{2}\right)}^{-0.25}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < -5.2000000000000001e-11Initial program 85.7%
Simplified88.2%
Taylor expanded in h around 0 70.9%
*-rgt-identity70.9%
*-commutative70.9%
sqrt-unprod66.9%
Applied egg-rr66.9%
if -5.2000000000000001e-11 < d < -1.000000000000002e-309Initial program 58.4%
Simplified58.3%
add-sqr-sqrt58.3%
pow258.3%
sqrt-prod58.3%
unpow258.3%
sqrt-prod35.5%
add-sqr-sqrt58.4%
div-inv58.4%
metadata-eval58.4%
Applied egg-rr58.4%
*-commutative58.4%
/-rgt-identity58.4%
associate-/l*58.4%
metadata-eval58.4%
times-frac58.5%
associate-*r/58.4%
associate-*l*58.4%
*-lft-identity58.4%
associate-/l*58.4%
associate-/r/58.4%
*-commutative58.4%
associate-/r*58.4%
metadata-eval58.4%
Simplified58.4%
Taylor expanded in d around inf 15.2%
unpow-115.2%
metadata-eval15.2%
pow-sqr15.2%
rem-sqrt-square15.2%
rem-square-sqrt15.2%
fabs-sqr15.2%
rem-square-sqrt15.2%
Simplified15.2%
Taylor expanded in d around 0 15.2%
associate-/r*15.2%
Simplified15.2%
associate-/l/15.2%
*-commutative15.2%
inv-pow15.2%
metadata-eval15.2%
pow-prod-up15.2%
sqrt-unprod15.2%
add-sqr-sqrt15.2%
sqr-pow15.2%
pow-prod-down25.4%
pow225.4%
metadata-eval25.4%
Applied egg-rr25.4%
if -1.000000000000002e-309 < d Initial program 67.2%
Simplified66.5%
add-sqr-sqrt66.4%
pow266.4%
sqrt-prod66.4%
unpow266.4%
sqrt-prod39.4%
add-sqr-sqrt66.7%
div-inv66.7%
metadata-eval66.7%
Applied egg-rr66.7%
*-commutative66.7%
/-rgt-identity66.7%
associate-/l*66.7%
metadata-eval66.7%
times-frac68.3%
associate-*r/67.4%
associate-*l*67.3%
*-lft-identity67.3%
associate-/l*67.3%
associate-/r/67.3%
*-commutative67.3%
associate-/r*67.3%
metadata-eval67.3%
Simplified67.3%
Taylor expanded in d around inf 43.2%
unpow-143.2%
metadata-eval43.2%
pow-sqr43.2%
rem-sqrt-square43.6%
rem-square-sqrt43.5%
fabs-sqr43.5%
rem-square-sqrt43.6%
Simplified43.6%
Taylor expanded in d around 0 43.2%
associate-/r*43.2%
Simplified43.2%
sqrt-div47.8%
inv-pow47.8%
sqrt-pow147.8%
metadata-eval47.8%
Applied egg-rr47.8%
Final simplification47.2%
(FPCore (d h l M D)
:precision binary64
(if (<= d -5.4e-139)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (<= d -1e-309)
(* d (pow (pow (* l h) 2.0) -0.25))
(* d (/ (pow h -0.5) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5.4e-139) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if (d <= -1e-309) {
tmp = d * pow(pow((l * h), 2.0), -0.25);
} 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 (d <= (-5.4d-139)) then
tmp = sqrt((d / l)) * sqrt((d / h))
else if (d <= (-1d-309)) then
tmp = d * (((l * h) ** 2.0d0) ** (-0.25d0))
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 (d <= -5.4e-139) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else if (d <= -1e-309) {
tmp = d * Math.pow(Math.pow((l * h), 2.0), -0.25);
} else {
tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -5.4e-139: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) elif d <= -1e-309: tmp = d * math.pow(math.pow((l * h), 2.0), -0.25) else: tmp = d * (math.pow(h, -0.5) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -5.4e-139) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif (d <= -1e-309) tmp = Float64(d * ((Float64(l * h) ^ 2.0) ^ -0.25)); 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 (d <= -5.4e-139) tmp = sqrt((d / l)) * sqrt((d / h)); elseif (d <= -1e-309) tmp = d * (((l * h) ^ 2.0) ^ -0.25); else tmp = d * ((h ^ -0.5) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5.4e-139], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1e-309], N[(d * N[Power[N[Power[N[(l * h), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $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}\;d \leq -5.4 \cdot 10^{-139}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\
\;\;\;\;d \cdot {\left({\left(\ell \cdot h\right)}^{2}\right)}^{-0.25}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < -5.3999999999999997e-139Initial program 85.9%
Simplified87.8%
Taylor expanded in h around 0 59.9%
if -5.3999999999999997e-139 < d < -1.000000000000002e-309Initial program 43.3%
Simplified43.1%
add-sqr-sqrt43.2%
pow243.2%
sqrt-prod43.1%
unpow243.1%
sqrt-prod19.7%
add-sqr-sqrt43.3%
div-inv43.3%
metadata-eval43.3%
Applied egg-rr43.3%
*-commutative43.3%
/-rgt-identity43.3%
associate-/l*43.3%
metadata-eval43.3%
times-frac43.5%
associate-*r/43.3%
associate-*l*43.3%
*-lft-identity43.3%
associate-/l*43.3%
associate-/r/43.3%
*-commutative43.3%
associate-/r*43.3%
metadata-eval43.3%
Simplified43.3%
Taylor expanded in d around inf 17.0%
unpow-117.0%
metadata-eval17.0%
pow-sqr17.0%
rem-sqrt-square17.0%
rem-square-sqrt17.0%
fabs-sqr17.0%
rem-square-sqrt17.0%
Simplified17.0%
Taylor expanded in d around 0 17.0%
associate-/r*17.0%
Simplified17.0%
associate-/l/17.0%
*-commutative17.0%
inv-pow17.0%
metadata-eval17.0%
pow-prod-up17.0%
sqrt-unprod17.0%
add-sqr-sqrt17.0%
sqr-pow17.0%
pow-prod-down26.1%
pow226.1%
metadata-eval26.1%
Applied egg-rr26.1%
if -1.000000000000002e-309 < d Initial program 67.2%
Simplified66.5%
add-sqr-sqrt66.4%
pow266.4%
sqrt-prod66.4%
unpow266.4%
sqrt-prod39.4%
add-sqr-sqrt66.7%
div-inv66.7%
metadata-eval66.7%
Applied egg-rr66.7%
*-commutative66.7%
/-rgt-identity66.7%
associate-/l*66.7%
metadata-eval66.7%
times-frac68.3%
associate-*r/67.4%
associate-*l*67.3%
*-lft-identity67.3%
associate-/l*67.3%
associate-/r/67.3%
*-commutative67.3%
associate-/r*67.3%
metadata-eval67.3%
Simplified67.3%
Taylor expanded in d around inf 43.2%
unpow-143.2%
metadata-eval43.2%
pow-sqr43.2%
rem-sqrt-square43.6%
rem-square-sqrt43.5%
fabs-sqr43.5%
rem-square-sqrt43.6%
Simplified43.6%
Taylor expanded in d around 0 43.2%
associate-/r*43.2%
Simplified43.2%
sqrt-div47.8%
inv-pow47.8%
sqrt-pow147.8%
metadata-eval47.8%
Applied egg-rr47.8%
Final simplification48.5%
(FPCore (d h l M D)
:precision binary64
(if (<= d -5.5e-189)
(sqrt (* (/ d l) (/ d h)))
(if (<= d -1e-309)
(* d (pow (* l h) -0.5))
(* d (/ (pow h -0.5) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5.5e-189) {
tmp = sqrt(((d / l) * (d / h)));
} else if (d <= -1e-309) {
tmp = d * pow((l * h), -0.5);
} 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 (d <= (-5.5d-189)) then
tmp = sqrt(((d / l) * (d / h)))
else if (d <= (-1d-309)) then
tmp = d * ((l * h) ** (-0.5d0))
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 (d <= -5.5e-189) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else if (d <= -1e-309) {
tmp = d * Math.pow((l * h), -0.5);
} else {
tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -5.5e-189: tmp = math.sqrt(((d / l) * (d / h))) elif d <= -1e-309: tmp = d * math.pow((l * h), -0.5) else: tmp = d * (math.pow(h, -0.5) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -5.5e-189) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); elseif (d <= -1e-309) tmp = Float64(d * (Float64(l * h) ^ -0.5)); 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 (d <= -5.5e-189) tmp = sqrt(((d / l) * (d / h))); elseif (d <= -1e-309) tmp = d * ((l * h) ^ -0.5); else tmp = d * ((h ^ -0.5) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5.5e-189], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, -1e-309], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $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}\;d \leq -5.5 \cdot 10^{-189}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < -5.4999999999999999e-189Initial program 85.2%
Simplified86.9%
Taylor expanded in h around 0 56.6%
*-rgt-identity56.6%
*-commutative56.6%
sqrt-unprod52.1%
Applied egg-rr52.1%
if -5.4999999999999999e-189 < d < -1.000000000000002e-309Initial program 34.3%
Simplified34.0%
add-sqr-sqrt34.1%
pow234.1%
sqrt-prod34.1%
unpow234.1%
sqrt-prod16.2%
add-sqr-sqrt34.3%
div-inv34.3%
metadata-eval34.3%
Applied egg-rr34.3%
*-commutative34.3%
/-rgt-identity34.3%
associate-/l*34.3%
metadata-eval34.3%
times-frac34.5%
associate-*r/34.3%
associate-*l*34.3%
*-lft-identity34.3%
associate-/l*34.3%
associate-/r/34.3%
*-commutative34.3%
associate-/r*34.3%
metadata-eval34.3%
Simplified34.3%
Taylor expanded in d around inf 20.7%
unpow-120.7%
metadata-eval20.7%
pow-sqr20.7%
rem-sqrt-square20.7%
rem-square-sqrt20.7%
fabs-sqr20.7%
rem-square-sqrt20.7%
Simplified20.7%
if -1.000000000000002e-309 < d Initial program 67.2%
Simplified66.5%
add-sqr-sqrt66.4%
pow266.4%
sqrt-prod66.4%
unpow266.4%
sqrt-prod39.4%
add-sqr-sqrt66.7%
div-inv66.7%
metadata-eval66.7%
Applied egg-rr66.7%
*-commutative66.7%
/-rgt-identity66.7%
associate-/l*66.7%
metadata-eval66.7%
times-frac68.3%
associate-*r/67.4%
associate-*l*67.3%
*-lft-identity67.3%
associate-/l*67.3%
associate-/r/67.3%
*-commutative67.3%
associate-/r*67.3%
metadata-eval67.3%
Simplified67.3%
Taylor expanded in d around inf 43.2%
unpow-143.2%
metadata-eval43.2%
pow-sqr43.2%
rem-sqrt-square43.6%
rem-square-sqrt43.5%
fabs-sqr43.5%
rem-square-sqrt43.6%
Simplified43.6%
Taylor expanded in d around 0 43.2%
associate-/r*43.2%
Simplified43.2%
sqrt-div47.8%
inv-pow47.8%
sqrt-pow147.8%
metadata-eval47.8%
Applied egg-rr47.8%
Final simplification45.9%
(FPCore (d h l M D) :precision binary64 (if (<= l -1.48e-227) (sqrt (* (/ d l) (/ d h))) (* d (/ 1.0 (sqrt (/ l (/ 1.0 h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.48e-227) {
tmp = sqrt(((d / l) * (d / h)));
} else {
tmp = d * (1.0 / sqrt((l / (1.0 / h))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1.48d-227)) then
tmp = sqrt(((d / l) * (d / h)))
else
tmp = d * (1.0d0 / sqrt((l / (1.0d0 / h))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.48e-227) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else {
tmp = d * (1.0 / Math.sqrt((l / (1.0 / h))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.48e-227: tmp = math.sqrt(((d / l) * (d / h))) else: tmp = d * (1.0 / math.sqrt((l / (1.0 / h)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.48e-227) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); else tmp = Float64(d * Float64(1.0 / sqrt(Float64(l / Float64(1.0 / h))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.48e-227) tmp = sqrt(((d / l) * (d / h))); else tmp = d * (1.0 / sqrt((l / (1.0 / h)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.48e-227], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[(1.0 / N[Sqrt[N[(l / N[(1.0 / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.48 \cdot 10^{-227}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{1}{\sqrt{\frac{\ell}{\frac{1}{h}}}}\\
\end{array}
\end{array}
if l < -1.48e-227Initial program 69.6%
Simplified71.1%
Taylor expanded in h around 0 47.5%
*-rgt-identity47.5%
*-commutative47.5%
sqrt-unprod43.6%
Applied egg-rr43.6%
if -1.48e-227 < l Initial program 70.2%
Simplified69.6%
add-sqr-sqrt69.6%
pow269.6%
sqrt-prod69.6%
unpow269.6%
sqrt-prod41.2%
add-sqr-sqrt69.8%
div-inv69.8%
metadata-eval69.8%
Applied egg-rr69.8%
*-commutative69.8%
/-rgt-identity69.8%
associate-/l*69.8%
metadata-eval69.8%
times-frac71.1%
associate-*r/70.4%
associate-*l*70.3%
*-lft-identity70.3%
associate-/l*70.3%
associate-/r/70.3%
*-commutative70.3%
associate-/r*70.3%
metadata-eval70.3%
Simplified70.3%
Taylor expanded in d around inf 45.3%
unpow-145.3%
metadata-eval45.3%
pow-sqr45.3%
rem-sqrt-square45.6%
rem-square-sqrt45.6%
fabs-sqr45.6%
rem-square-sqrt45.6%
Simplified45.6%
Taylor expanded in d around 0 45.3%
associate-/r*45.3%
Simplified45.3%
clear-num45.3%
sqrt-div45.7%
metadata-eval45.7%
Applied egg-rr45.7%
Final simplification44.7%
(FPCore (d h l M D) :precision binary64 (if (<= l -6.3e-227) (sqrt (* (/ d l) (/ d h))) (* d (pow (* l h) -0.5))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6.3e-227) {
tmp = sqrt(((d / l) * (d / h)));
} else {
tmp = d * pow((l * h), -0.5);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-6.3d-227)) then
tmp = sqrt(((d / l) * (d / h)))
else
tmp = d * ((l * h) ** (-0.5d0))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6.3e-227) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else {
tmp = d * Math.pow((l * h), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -6.3e-227: tmp = math.sqrt(((d / l) * (d / h))) else: tmp = d * math.pow((l * h), -0.5) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -6.3e-227) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); else tmp = Float64(d * (Float64(l * h) ^ -0.5)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -6.3e-227) tmp = sqrt(((d / l) * (d / h))); else tmp = d * ((l * h) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -6.3e-227], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.3 \cdot 10^{-227}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if l < -6.2999999999999999e-227Initial program 69.6%
Simplified71.1%
Taylor expanded in h around 0 47.5%
*-rgt-identity47.5%
*-commutative47.5%
sqrt-unprod43.6%
Applied egg-rr43.6%
if -6.2999999999999999e-227 < l Initial program 70.2%
Simplified69.6%
add-sqr-sqrt69.6%
pow269.6%
sqrt-prod69.6%
unpow269.6%
sqrt-prod41.2%
add-sqr-sqrt69.8%
div-inv69.8%
metadata-eval69.8%
Applied egg-rr69.8%
*-commutative69.8%
/-rgt-identity69.8%
associate-/l*69.8%
metadata-eval69.8%
times-frac71.1%
associate-*r/70.4%
associate-*l*70.3%
*-lft-identity70.3%
associate-/l*70.3%
associate-/r/70.3%
*-commutative70.3%
associate-/r*70.3%
metadata-eval70.3%
Simplified70.3%
Taylor expanded in d around inf 45.3%
unpow-145.3%
metadata-eval45.3%
pow-sqr45.3%
rem-sqrt-square45.6%
rem-square-sqrt45.6%
fabs-sqr45.6%
rem-square-sqrt45.6%
Simplified45.6%
Final simplification44.7%
(FPCore (d h l M D) :precision binary64 (if (<= l -1.5e-226) (sqrt (* (/ d l) (/ d h))) (* d (/ 1.0 (sqrt (* l h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.5e-226) {
tmp = sqrt(((d / l) * (d / h)));
} else {
tmp = d * (1.0 / sqrt((l * h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1.5d-226)) then
tmp = sqrt(((d / l) * (d / h)))
else
tmp = d * (1.0d0 / sqrt((l * h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.5e-226) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else {
tmp = d * (1.0 / Math.sqrt((l * h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.5e-226: tmp = math.sqrt(((d / l) * (d / h))) else: tmp = d * (1.0 / math.sqrt((l * h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.5e-226) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); else tmp = Float64(d * Float64(1.0 / sqrt(Float64(l * h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.5e-226) tmp = sqrt(((d / l) * (d / h))); else tmp = d * (1.0 / sqrt((l * h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.5e-226], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[(1.0 / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.5 \cdot 10^{-226}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{1}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -1.49999999999999998e-226Initial program 69.6%
Simplified71.1%
Taylor expanded in h around 0 47.5%
*-rgt-identity47.5%
*-commutative47.5%
sqrt-unprod43.6%
Applied egg-rr43.6%
if -1.49999999999999998e-226 < l Initial program 70.2%
Simplified69.6%
Taylor expanded in d around inf 45.3%
sqrt-div45.7%
metadata-eval45.7%
Applied egg-rr45.7%
Final simplification44.7%
(FPCore (d h l M D) :precision binary64 (* d (pow (* l h) -0.5)))
double code(double d, double h, double l, double M, double D) {
return d * pow((l * h), -0.5);
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * ((l * h) ** (-0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.pow((l * h), -0.5);
}
def code(d, h, l, M, D): return d * math.pow((l * h), -0.5)
function code(d, h, l, M, D) return Float64(d * (Float64(l * h) ^ -0.5)) end
function tmp = code(d, h, l, M, D) tmp = d * ((l * h) ^ -0.5); end
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot {\left(\ell \cdot h\right)}^{-0.5}
\end{array}
Initial program 69.9%
Simplified70.3%
add-sqr-sqrt70.3%
pow270.3%
sqrt-prod70.3%
unpow270.3%
sqrt-prod42.3%
add-sqr-sqrt70.4%
div-inv70.4%
metadata-eval70.4%
Applied egg-rr70.4%
*-commutative70.4%
/-rgt-identity70.4%
associate-/l*70.4%
metadata-eval70.4%
times-frac70.8%
associate-*r/71.1%
associate-*l*71.1%
*-lft-identity71.1%
associate-/l*71.1%
associate-/r/71.1%
*-commutative71.1%
associate-/r*71.1%
metadata-eval71.1%
Simplified71.1%
Taylor expanded in d around inf 27.1%
unpow-127.1%
metadata-eval27.1%
pow-sqr27.1%
rem-sqrt-square27.3%
rem-square-sqrt27.3%
fabs-sqr27.3%
rem-square-sqrt27.3%
Simplified27.3%
Final simplification27.3%
herbie shell --seed 2024096
(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)))))