
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(if (<= d -4.4e-239)
(*
(* (/ (sqrt (- d)) (sqrt (- h))) (/ 1.0 (sqrt (/ l d))))
(- 1.0 (* 0.5 (* (pow (* (/ D 2.0) (/ M d)) 2.0) (/ h l)))))
(if (<= d 3.8e-305)
(-
(* (/ (pow (* D M) 2.0) d) (* (sqrt (/ h (pow l 3.0))) 0.125))
(* d (pow (* h l) -0.5)))
(*
(/ (sqrt d) (sqrt h))
(*
(/ (sqrt d) (sqrt l))
(+ 1.0 (* (/ h l) (* -0.5 (pow (* (/ M 2.0) (/ D d)) 2.0)))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -4.4e-239) {
tmp = ((sqrt(-d) / sqrt(-h)) * (1.0 / sqrt((l / d)))) * (1.0 - (0.5 * (pow(((D / 2.0) * (M / d)), 2.0) * (h / l))));
} else if (d <= 3.8e-305) {
tmp = ((pow((D * M), 2.0) / d) * (sqrt((h / pow(l, 3.0))) * 0.125)) - (d * pow((h * l), -0.5));
} else {
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * (1.0 + ((h / l) * (-0.5 * pow(((M / 2.0) * (D / 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 <= (-4.4d-239)) then
tmp = ((sqrt(-d) / sqrt(-h)) * (1.0d0 / sqrt((l / d)))) * (1.0d0 - (0.5d0 * ((((d_1 / 2.0d0) * (m / d)) ** 2.0d0) * (h / l))))
else if (d <= 3.8d-305) then
tmp = ((((d_1 * m) ** 2.0d0) / d) * (sqrt((h / (l ** 3.0d0))) * 0.125d0)) - (d * ((h * l) ** (-0.5d0)))
else
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * (1.0d0 + ((h / l) * ((-0.5d0) * (((m / 2.0d0) * (d_1 / 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 <= -4.4e-239) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-h)) * (1.0 / Math.sqrt((l / d)))) * (1.0 - (0.5 * (Math.pow(((D / 2.0) * (M / d)), 2.0) * (h / l))));
} else if (d <= 3.8e-305) {
tmp = ((Math.pow((D * M), 2.0) / d) * (Math.sqrt((h / Math.pow(l, 3.0))) * 0.125)) - (d * Math.pow((h * l), -0.5));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * ((Math.sqrt(d) / Math.sqrt(l)) * (1.0 + ((h / l) * (-0.5 * Math.pow(((M / 2.0) * (D / d)), 2.0)))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -4.4e-239: tmp = ((math.sqrt(-d) / math.sqrt(-h)) * (1.0 / math.sqrt((l / d)))) * (1.0 - (0.5 * (math.pow(((D / 2.0) * (M / d)), 2.0) * (h / l)))) elif d <= 3.8e-305: tmp = ((math.pow((D * M), 2.0) / d) * (math.sqrt((h / math.pow(l, 3.0))) * 0.125)) - (d * math.pow((h * l), -0.5)) else: tmp = (math.sqrt(d) / math.sqrt(h)) * ((math.sqrt(d) / math.sqrt(l)) * (1.0 + ((h / l) * (-0.5 * math.pow(((M / 2.0) * (D / d)), 2.0))))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -4.4e-239) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(1.0 / sqrt(Float64(l / d)))) * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(D / 2.0) * Float64(M / d)) ^ 2.0) * Float64(h / l))))); elseif (d <= 3.8e-305) tmp = Float64(Float64(Float64((Float64(D * M) ^ 2.0) / d) * Float64(sqrt(Float64(h / (l ^ 3.0))) * 0.125)) - Float64(d * (Float64(h * l) ^ -0.5))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(Float64(sqrt(d) / sqrt(l)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -4.4e-239) tmp = ((sqrt(-d) / sqrt(-h)) * (1.0 / sqrt((l / d)))) * (1.0 - (0.5 * ((((D / 2.0) * (M / d)) ^ 2.0) * (h / l)))); elseif (d <= 3.8e-305) tmp = ((((D * M) ^ 2.0) / d) * (sqrt((h / (l ^ 3.0))) * 0.125)) - (d * ((h * l) ^ -0.5)); else tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * (1.0 + ((h / l) * (-0.5 * (((M / 2.0) * (D / d)) ^ 2.0))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -4.4e-239], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(D / 2.0), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.8e-305], N[(N[(N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] - N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -4.4 \cdot 10^{-239}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{elif}\;d \leq 3.8 \cdot 10^{-305}:\\
\;\;\;\;\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) - d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if d < -4.39999999999999965e-239Initial program 73.1%
Simplified74.3%
clear-num74.3%
sqrt-div74.3%
metadata-eval74.3%
Applied egg-rr74.3%
frac-2neg74.3%
sqrt-div84.0%
Applied egg-rr84.0%
if -4.39999999999999965e-239 < d < 3.8e-305Initial program 10.9%
Simplified10.9%
clear-num10.9%
sqrt-div10.8%
metadata-eval10.8%
Applied egg-rr10.8%
Taylor expanded in d around -inf 25.9%
Simplified45.9%
if 3.8e-305 < d Initial program 70.7%
Simplified69.8%
sqrt-div75.4%
Applied egg-rr75.4%
sqrt-div84.6%
Applied egg-rr84.6%
Final simplification81.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h))) (t_1 (/ (sqrt (- d)) (sqrt (- l)))))
(if (<= l -1.6e+122)
(*
t_0
(* (+ 1.0 (* (/ h l) (* -0.5 (pow (* (/ M 2.0) (/ D d)) 2.0)))) t_1))
(if (<= l -4.2e-56)
(-
(* (/ (pow (* D M) 2.0) d) (* (sqrt (/ h (pow l 3.0))) 0.125))
(* d (pow (* h l) -0.5)))
(if (<= l -5e-310)
(*
(* t_0 t_1)
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* 0.5 M)) 2.0)) l))))
(*
(/ d (* (sqrt h) (sqrt l)))
(- 1.0 (* 0.5 (* (/ h l) (pow (* M (* 0.5 (/ D d))) 2.0))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = sqrt(-d) / sqrt(-l);
double tmp;
if (l <= -1.6e+122) {
tmp = t_0 * ((1.0 + ((h / l) * (-0.5 * pow(((M / 2.0) * (D / d)), 2.0)))) * t_1);
} else if (l <= -4.2e-56) {
tmp = ((pow((D * M), 2.0) / d) * (sqrt((h / pow(l, 3.0))) * 0.125)) - (d * pow((h * l), -0.5));
} else if (l <= -5e-310) {
tmp = (t_0 * t_1) * (1.0 - (0.5 * ((h * pow(((D / d) * (0.5 * M)), 2.0)) / l)));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * pow((M * (0.5 * (D / 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((d / h))
t_1 = sqrt(-d) / sqrt(-l)
if (l <= (-1.6d+122)) then
tmp = t_0 * ((1.0d0 + ((h / l) * ((-0.5d0) * (((m / 2.0d0) * (d_1 / d)) ** 2.0d0)))) * t_1)
else if (l <= (-4.2d-56)) then
tmp = ((((d_1 * m) ** 2.0d0) / d) * (sqrt((h / (l ** 3.0d0))) * 0.125d0)) - (d * ((h * l) ** (-0.5d0)))
else if (l <= (-5d-310)) then
tmp = (t_0 * t_1) * (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (0.5d0 * m)) ** 2.0d0)) / l)))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 - (0.5d0 * ((h / l) * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h));
double t_1 = Math.sqrt(-d) / Math.sqrt(-l);
double tmp;
if (l <= -1.6e+122) {
tmp = t_0 * ((1.0 + ((h / l) * (-0.5 * Math.pow(((M / 2.0) * (D / d)), 2.0)))) * t_1);
} else if (l <= -4.2e-56) {
tmp = ((Math.pow((D * M), 2.0) / d) * (Math.sqrt((h / Math.pow(l, 3.0))) * 0.125)) - (d * Math.pow((h * l), -0.5));
} else if (l <= -5e-310) {
tmp = (t_0 * t_1) * (1.0 - (0.5 * ((h * Math.pow(((D / d) * (0.5 * M)), 2.0)) / l)));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 - (0.5 * ((h / l) * Math.pow((M * (0.5 * (D / d))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) t_1 = math.sqrt(-d) / math.sqrt(-l) tmp = 0 if l <= -1.6e+122: tmp = t_0 * ((1.0 + ((h / l) * (-0.5 * math.pow(((M / 2.0) * (D / d)), 2.0)))) * t_1) elif l <= -4.2e-56: tmp = ((math.pow((D * M), 2.0) / d) * (math.sqrt((h / math.pow(l, 3.0))) * 0.125)) - (d * math.pow((h * l), -0.5)) elif l <= -5e-310: tmp = (t_0 * t_1) * (1.0 - (0.5 * ((h * math.pow(((D / d) * (0.5 * M)), 2.0)) / l))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 - (0.5 * ((h / l) * math.pow((M * (0.5 * (D / d))), 2.0)))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) tmp = 0.0 if (l <= -1.6e+122) tmp = Float64(t_0 * Float64(Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0)))) * t_1)); elseif (l <= -4.2e-56) tmp = Float64(Float64(Float64((Float64(D * M) ^ 2.0) / d) * Float64(sqrt(Float64(h / (l ^ 3.0))) * 0.125)) - Float64(d * (Float64(h * l) ^ -0.5))); elseif (l <= -5e-310) tmp = Float64(Float64(t_0 * t_1) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(0.5 * M)) ^ 2.0)) / l)))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)); t_1 = sqrt(-d) / sqrt(-l); tmp = 0.0; if (l <= -1.6e+122) tmp = t_0 * ((1.0 + ((h / l) * (-0.5 * (((M / 2.0) * (D / d)) ^ 2.0)))) * t_1); elseif (l <= -4.2e-56) tmp = ((((D * M) ^ 2.0) / d) * (sqrt((h / (l ^ 3.0))) * 0.125)) - (d * ((h * l) ^ -0.5)); elseif (l <= -5e-310) tmp = (t_0 * t_1) * (1.0 - (0.5 * ((h * (((D / d) * (0.5 * M)) ^ 2.0)) / l))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * ((M * (0.5 * (D / d))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.6e+122], N[(t$95$0 * N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4.2e-56], N[(N[(N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] - N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(N[(t$95$0 * t$95$1), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(D / d), $MachinePrecision] * N[(0.5 * M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \frac{\sqrt{-d}}{\sqrt{-\ell}}\\
\mathbf{if}\;\ell \leq -1.6 \cdot 10^{+122}:\\
\;\;\;\;t_0 \cdot \left(\left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right) \cdot t_1\right)\\
\mathbf{elif}\;\ell \leq -4.2 \cdot 10^{-56}:\\
\;\;\;\;\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) - d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(t_0 \cdot t_1\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(0.5 \cdot M\right)\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if l < -1.60000000000000006e122Initial program 49.8%
Simplified52.5%
frac-2neg52.5%
sqrt-div62.1%
Applied egg-rr62.1%
if -1.60000000000000006e122 < l < -4.20000000000000012e-56Initial program 63.1%
Simplified63.2%
clear-num63.1%
sqrt-div63.2%
metadata-eval63.2%
Applied egg-rr63.2%
Taylor expanded in d around -inf 57.6%
Simplified83.7%
if -4.20000000000000012e-56 < l < -4.999999999999985e-310Initial program 77.2%
Simplified77.9%
associate-*r/83.1%
Applied egg-rr83.1%
frac-2neg77.8%
sqrt-div79.4%
Applied egg-rr86.2%
if -4.999999999999985e-310 < l Initial program 69.5%
Simplified68.7%
Applied egg-rr23.6%
expm1-def41.3%
expm1-log1p81.5%
associate-*l*81.5%
*-commutative81.5%
associate-*l*81.5%
Simplified81.5%
Final simplification79.8%
(FPCore (d h l M D)
:precision binary64
(if (<= d -1.8e-239)
(*
(* (/ (sqrt (- d)) (sqrt (- h))) (/ 1.0 (sqrt (/ l d))))
(- 1.0 (* 0.5 (* (pow (* (/ D 2.0) (/ M d)) 2.0) (/ h l)))))
(if (<= d 3.8e-305)
(-
(* (/ (pow (* D M) 2.0) d) (* (sqrt (/ h (pow l 3.0))) 0.125))
(* d (pow (* h l) -0.5)))
(*
(/ d (* (sqrt h) (sqrt l)))
(- 1.0 (* 0.5 (* (/ h l) (pow (* M (* 0.5 (/ D d))) 2.0))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.8e-239) {
tmp = ((sqrt(-d) / sqrt(-h)) * (1.0 / sqrt((l / d)))) * (1.0 - (0.5 * (pow(((D / 2.0) * (M / d)), 2.0) * (h / l))));
} else if (d <= 3.8e-305) {
tmp = ((pow((D * M), 2.0) / d) * (sqrt((h / pow(l, 3.0))) * 0.125)) - (d * pow((h * l), -0.5));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * pow((M * (0.5 * (D / 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 <= (-1.8d-239)) then
tmp = ((sqrt(-d) / sqrt(-h)) * (1.0d0 / sqrt((l / d)))) * (1.0d0 - (0.5d0 * ((((d_1 / 2.0d0) * (m / d)) ** 2.0d0) * (h / l))))
else if (d <= 3.8d-305) then
tmp = ((((d_1 * m) ** 2.0d0) / d) * (sqrt((h / (l ** 3.0d0))) * 0.125d0)) - (d * ((h * l) ** (-0.5d0)))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 - (0.5d0 * ((h / l) * ((m * (0.5d0 * (d_1 / 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 <= -1.8e-239) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-h)) * (1.0 / Math.sqrt((l / d)))) * (1.0 - (0.5 * (Math.pow(((D / 2.0) * (M / d)), 2.0) * (h / l))));
} else if (d <= 3.8e-305) {
tmp = ((Math.pow((D * M), 2.0) / d) * (Math.sqrt((h / Math.pow(l, 3.0))) * 0.125)) - (d * Math.pow((h * l), -0.5));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 - (0.5 * ((h / l) * Math.pow((M * (0.5 * (D / d))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -1.8e-239: tmp = ((math.sqrt(-d) / math.sqrt(-h)) * (1.0 / math.sqrt((l / d)))) * (1.0 - (0.5 * (math.pow(((D / 2.0) * (M / d)), 2.0) * (h / l)))) elif d <= 3.8e-305: tmp = ((math.pow((D * M), 2.0) / d) * (math.sqrt((h / math.pow(l, 3.0))) * 0.125)) - (d * math.pow((h * l), -0.5)) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 - (0.5 * ((h / l) * math.pow((M * (0.5 * (D / d))), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -1.8e-239) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(1.0 / sqrt(Float64(l / d)))) * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(D / 2.0) * Float64(M / d)) ^ 2.0) * Float64(h / l))))); elseif (d <= 3.8e-305) tmp = Float64(Float64(Float64((Float64(D * M) ^ 2.0) / d) * Float64(sqrt(Float64(h / (l ^ 3.0))) * 0.125)) - Float64(d * (Float64(h * l) ^ -0.5))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -1.8e-239) tmp = ((sqrt(-d) / sqrt(-h)) * (1.0 / sqrt((l / d)))) * (1.0 - (0.5 * ((((D / 2.0) * (M / d)) ^ 2.0) * (h / l)))); elseif (d <= 3.8e-305) tmp = ((((D * M) ^ 2.0) / d) * (sqrt((h / (l ^ 3.0))) * 0.125)) - (d * ((h * l) ^ -0.5)); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * ((M * (0.5 * (D / d))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.8e-239], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(D / 2.0), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.8e-305], N[(N[(N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] - N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.8 \cdot 10^{-239}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{elif}\;d \leq 3.8 \cdot 10^{-305}:\\
\;\;\;\;\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) - d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if d < -1.8000000000000001e-239Initial program 73.1%
Simplified74.3%
clear-num74.3%
sqrt-div74.3%
metadata-eval74.3%
Applied egg-rr74.3%
frac-2neg74.3%
sqrt-div84.0%
Applied egg-rr84.0%
if -1.8000000000000001e-239 < d < 3.8e-305Initial program 10.9%
Simplified10.9%
clear-num10.9%
sqrt-div10.8%
metadata-eval10.8%
Applied egg-rr10.8%
Taylor expanded in d around -inf 25.9%
Simplified45.9%
if 3.8e-305 < d Initial program 70.7%
Simplified69.9%
Applied egg-rr24.0%
expm1-def42.0%
expm1-log1p82.9%
associate-*l*82.9%
*-commutative82.9%
associate-*l*82.9%
Simplified82.9%
Final simplification80.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h))))
(if (<= l -1.62e+122)
(*
t_0
(*
(+ 1.0 (* (/ h l) (* -0.5 (pow (* (/ M 2.0) (/ D d)) 2.0))))
(/ (sqrt (- d)) (sqrt (- l)))))
(if (<= l -2e-51)
(-
(* (/ (pow (* D M) 2.0) d) (* (sqrt (/ h (pow l 3.0))) 0.125))
(* d (pow (* h l) -0.5)))
(if (<= l 5.2e-292)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* 0.5 M)) 2.0)) l)))
(* (sqrt (/ d l)) t_0))
(*
(/ d (* (sqrt h) (sqrt l)))
(- 1.0 (* 0.5 (* (/ h l) (pow (* M (* 0.5 (/ D d))) 2.0))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double tmp;
if (l <= -1.62e+122) {
tmp = t_0 * ((1.0 + ((h / l) * (-0.5 * pow(((M / 2.0) * (D / d)), 2.0)))) * (sqrt(-d) / sqrt(-l)));
} else if (l <= -2e-51) {
tmp = ((pow((D * M), 2.0) / d) * (sqrt((h / pow(l, 3.0))) * 0.125)) - (d * pow((h * l), -0.5));
} else if (l <= 5.2e-292) {
tmp = (1.0 - (0.5 * ((h * pow(((D / d) * (0.5 * M)), 2.0)) / l))) * (sqrt((d / l)) * t_0);
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * pow((M * (0.5 * (D / 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) :: t_0
real(8) :: tmp
t_0 = sqrt((d / h))
if (l <= (-1.62d+122)) then
tmp = t_0 * ((1.0d0 + ((h / l) * ((-0.5d0) * (((m / 2.0d0) * (d_1 / d)) ** 2.0d0)))) * (sqrt(-d) / sqrt(-l)))
else if (l <= (-2d-51)) then
tmp = ((((d_1 * m) ** 2.0d0) / d) * (sqrt((h / (l ** 3.0d0))) * 0.125d0)) - (d * ((h * l) ** (-0.5d0)))
else if (l <= 5.2d-292) then
tmp = (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (0.5d0 * m)) ** 2.0d0)) / l))) * (sqrt((d / l)) * t_0)
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 - (0.5d0 * ((h / l) * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h));
double tmp;
if (l <= -1.62e+122) {
tmp = t_0 * ((1.0 + ((h / l) * (-0.5 * Math.pow(((M / 2.0) * (D / d)), 2.0)))) * (Math.sqrt(-d) / Math.sqrt(-l)));
} else if (l <= -2e-51) {
tmp = ((Math.pow((D * M), 2.0) / d) * (Math.sqrt((h / Math.pow(l, 3.0))) * 0.125)) - (d * Math.pow((h * l), -0.5));
} else if (l <= 5.2e-292) {
tmp = (1.0 - (0.5 * ((h * Math.pow(((D / d) * (0.5 * M)), 2.0)) / l))) * (Math.sqrt((d / l)) * t_0);
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 - (0.5 * ((h / l) * Math.pow((M * (0.5 * (D / d))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) tmp = 0 if l <= -1.62e+122: tmp = t_0 * ((1.0 + ((h / l) * (-0.5 * math.pow(((M / 2.0) * (D / d)), 2.0)))) * (math.sqrt(-d) / math.sqrt(-l))) elif l <= -2e-51: tmp = ((math.pow((D * M), 2.0) / d) * (math.sqrt((h / math.pow(l, 3.0))) * 0.125)) - (d * math.pow((h * l), -0.5)) elif l <= 5.2e-292: tmp = (1.0 - (0.5 * ((h * math.pow(((D / d) * (0.5 * M)), 2.0)) / l))) * (math.sqrt((d / l)) * t_0) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 - (0.5 * ((h / l) * math.pow((M * (0.5 * (D / d))), 2.0)))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) tmp = 0.0 if (l <= -1.62e+122) tmp = Float64(t_0 * Float64(Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0)))) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))))); elseif (l <= -2e-51) tmp = Float64(Float64(Float64((Float64(D * M) ^ 2.0) / d) * Float64(sqrt(Float64(h / (l ^ 3.0))) * 0.125)) - Float64(d * (Float64(h * l) ^ -0.5))); elseif (l <= 5.2e-292) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(0.5 * M)) ^ 2.0)) / l))) * Float64(sqrt(Float64(d / l)) * t_0)); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)); tmp = 0.0; if (l <= -1.62e+122) tmp = t_0 * ((1.0 + ((h / l) * (-0.5 * (((M / 2.0) * (D / d)) ^ 2.0)))) * (sqrt(-d) / sqrt(-l))); elseif (l <= -2e-51) tmp = ((((D * M) ^ 2.0) / d) * (sqrt((h / (l ^ 3.0))) * 0.125)) - (d * ((h * l) ^ -0.5)); elseif (l <= 5.2e-292) tmp = (1.0 - (0.5 * ((h * (((D / d) * (0.5 * M)) ^ 2.0)) / l))) * (sqrt((d / l)) * t_0); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * ((M * (0.5 * (D / d))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.62e+122], N[(t$95$0 * N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-51], N[(N[(N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] - N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.2e-292], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(D / d), $MachinePrecision] * N[(0.5 * M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;\ell \leq -1.62 \cdot 10^{+122}:\\
\;\;\;\;t_0 \cdot \left(\left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right) \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right)\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-51}:\\
\;\;\;\;\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) - d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq 5.2 \cdot 10^{-292}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(0.5 \cdot M\right)\right)}^{2}}{\ell}\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if l < -1.61999999999999994e122Initial program 49.8%
Simplified52.5%
frac-2neg52.5%
sqrt-div62.1%
Applied egg-rr62.1%
if -1.61999999999999994e122 < l < -2e-51Initial program 63.1%
Simplified63.2%
clear-num63.1%
sqrt-div63.2%
metadata-eval63.2%
Applied egg-rr63.2%
Taylor expanded in d around -inf 57.6%
Simplified83.7%
if -2e-51 < l < 5.20000000000000027e-292Initial program 75.0%
Simplified75.7%
associate-*r/82.3%
Applied egg-rr82.4%
if 5.20000000000000027e-292 < l Initial program 70.4%
Simplified69.6%
Applied egg-rr24.2%
expm1-def42.4%
expm1-log1p82.8%
associate-*l*82.8%
*-commutative82.8%
associate-*l*82.8%
Simplified82.8%
Final simplification79.5%
(FPCore (d h l M D)
:precision binary64
(if (<= d -4e-310)
(*
(/ (sqrt (- d)) (sqrt (- h)))
(*
(+ 1.0 (* (/ h l) (* -0.5 (pow (* (/ M 2.0) (/ D d)) 2.0))))
(sqrt (/ d l))))
(*
(/ d (* (sqrt h) (sqrt l)))
(- 1.0 (* 0.5 (* (/ h l) (pow (* M (* 0.5 (/ D d))) 2.0)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -4e-310) {
tmp = (sqrt(-d) / sqrt(-h)) * ((1.0 + ((h / l) * (-0.5 * pow(((M / 2.0) * (D / d)), 2.0)))) * sqrt((d / l)));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * pow((M * (0.5 * (D / 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 <= (-4d-310)) then
tmp = (sqrt(-d) / sqrt(-h)) * ((1.0d0 + ((h / l) * ((-0.5d0) * (((m / 2.0d0) * (d_1 / d)) ** 2.0d0)))) * sqrt((d / l)))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 - (0.5d0 * ((h / l) * ((m * (0.5d0 * (d_1 / 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 <= -4e-310) {
tmp = (Math.sqrt(-d) / Math.sqrt(-h)) * ((1.0 + ((h / l) * (-0.5 * Math.pow(((M / 2.0) * (D / d)), 2.0)))) * Math.sqrt((d / l)));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 - (0.5 * ((h / l) * Math.pow((M * (0.5 * (D / d))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -4e-310: tmp = (math.sqrt(-d) / math.sqrt(-h)) * ((1.0 + ((h / l) * (-0.5 * math.pow(((M / 2.0) * (D / d)), 2.0)))) * math.sqrt((d / l))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 - (0.5 * ((h / l) * math.pow((M * (0.5 * (D / d))), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -4e-310) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0)))) * sqrt(Float64(d / l)))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -4e-310) tmp = (sqrt(-d) / sqrt(-h)) * ((1.0 + ((h / l) * (-0.5 * (((M / 2.0) * (D / d)) ^ 2.0)))) * sqrt((d / l))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * ((M * (0.5 * (D / d))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -4e-310], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(\left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if d < -3.999999999999988e-310Initial program 65.1%
Simplified64.0%
frac-2neg66.1%
sqrt-div76.0%
Applied egg-rr74.8%
if -3.999999999999988e-310 < d Initial program 69.5%
Simplified68.7%
Applied egg-rr23.6%
expm1-def41.3%
expm1-log1p81.5%
associate-*l*81.5%
*-commutative81.5%
associate-*l*81.5%
Simplified81.5%
Final simplification77.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= l -2.7e+122)
(*
(* (+ 1.0 (* (/ h l) (* -0.5 (pow (* (/ M 2.0) (/ D d)) 2.0)))) t_0)
(/ 1.0 (sqrt (/ h d))))
(if (<= l -1.35e-54)
(-
(* (/ (pow (* D M) 2.0) d) (* (sqrt (/ h (pow l 3.0))) 0.125))
(* d (pow (* h l) -0.5)))
(if (<= l 3.5e-291)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* 0.5 M)) 2.0)) l)))
(* t_0 (sqrt (/ d h))))
(*
(/ d (* (sqrt h) (sqrt l)))
(- 1.0 (* 0.5 (* (/ h l) (pow (* M (* 0.5 (/ D d))) 2.0))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (l <= -2.7e+122) {
tmp = ((1.0 + ((h / l) * (-0.5 * pow(((M / 2.0) * (D / d)), 2.0)))) * t_0) * (1.0 / sqrt((h / d)));
} else if (l <= -1.35e-54) {
tmp = ((pow((D * M), 2.0) / d) * (sqrt((h / pow(l, 3.0))) * 0.125)) - (d * pow((h * l), -0.5));
} else if (l <= 3.5e-291) {
tmp = (1.0 - (0.5 * ((h * pow(((D / d) * (0.5 * M)), 2.0)) / l))) * (t_0 * sqrt((d / h)));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * pow((M * (0.5 * (D / 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) :: t_0
real(8) :: tmp
t_0 = sqrt((d / l))
if (l <= (-2.7d+122)) then
tmp = ((1.0d0 + ((h / l) * ((-0.5d0) * (((m / 2.0d0) * (d_1 / d)) ** 2.0d0)))) * t_0) * (1.0d0 / sqrt((h / d)))
else if (l <= (-1.35d-54)) then
tmp = ((((d_1 * m) ** 2.0d0) / d) * (sqrt((h / (l ** 3.0d0))) * 0.125d0)) - (d * ((h * l) ** (-0.5d0)))
else if (l <= 3.5d-291) then
tmp = (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (0.5d0 * m)) ** 2.0d0)) / l))) * (t_0 * sqrt((d / h)))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 - (0.5d0 * ((h / l) * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double tmp;
if (l <= -2.7e+122) {
tmp = ((1.0 + ((h / l) * (-0.5 * Math.pow(((M / 2.0) * (D / d)), 2.0)))) * t_0) * (1.0 / Math.sqrt((h / d)));
} else if (l <= -1.35e-54) {
tmp = ((Math.pow((D * M), 2.0) / d) * (Math.sqrt((h / Math.pow(l, 3.0))) * 0.125)) - (d * Math.pow((h * l), -0.5));
} else if (l <= 3.5e-291) {
tmp = (1.0 - (0.5 * ((h * Math.pow(((D / d) * (0.5 * M)), 2.0)) / l))) * (t_0 * Math.sqrt((d / h)));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 - (0.5 * ((h / l) * Math.pow((M * (0.5 * (D / d))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if l <= -2.7e+122: tmp = ((1.0 + ((h / l) * (-0.5 * math.pow(((M / 2.0) * (D / d)), 2.0)))) * t_0) * (1.0 / math.sqrt((h / d))) elif l <= -1.35e-54: tmp = ((math.pow((D * M), 2.0) / d) * (math.sqrt((h / math.pow(l, 3.0))) * 0.125)) - (d * math.pow((h * l), -0.5)) elif l <= 3.5e-291: tmp = (1.0 - (0.5 * ((h * math.pow(((D / d) * (0.5 * M)), 2.0)) / l))) * (t_0 * math.sqrt((d / h))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 - (0.5 * ((h / l) * math.pow((M * (0.5 * (D / d))), 2.0)))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= -2.7e+122) tmp = Float64(Float64(Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0)))) * t_0) * Float64(1.0 / sqrt(Float64(h / d)))); elseif (l <= -1.35e-54) tmp = Float64(Float64(Float64((Float64(D * M) ^ 2.0) / d) * Float64(sqrt(Float64(h / (l ^ 3.0))) * 0.125)) - Float64(d * (Float64(h * l) ^ -0.5))); elseif (l <= 3.5e-291) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(0.5 * M)) ^ 2.0)) / l))) * Float64(t_0 * sqrt(Float64(d / h)))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); tmp = 0.0; if (l <= -2.7e+122) tmp = ((1.0 + ((h / l) * (-0.5 * (((M / 2.0) * (D / d)) ^ 2.0)))) * t_0) * (1.0 / sqrt((h / d))); elseif (l <= -1.35e-54) tmp = ((((D * M) ^ 2.0) / d) * (sqrt((h / (l ^ 3.0))) * 0.125)) - (d * ((h * l) ^ -0.5)); elseif (l <= 3.5e-291) tmp = (1.0 - (0.5 * ((h * (((D / d) * (0.5 * M)) ^ 2.0)) / l))) * (t_0 * sqrt((d / h))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * ((M * (0.5 * (D / d))) ^ 2.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[l, -2.7e+122], N[(N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1.35e-54], N[(N[(N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] - N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.5e-291], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(D / d), $MachinePrecision] * N[(0.5 * M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq -2.7 \cdot 10^{+122}:\\
\;\;\;\;\left(\left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right) \cdot t_0\right) \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\
\mathbf{elif}\;\ell \leq -1.35 \cdot 10^{-54}:\\
\;\;\;\;\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) - d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq 3.5 \cdot 10^{-291}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(0.5 \cdot M\right)\right)}^{2}}{\ell}\right) \cdot \left(t_0 \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if l < -2.6999999999999998e122Initial program 49.8%
Simplified52.5%
clear-num52.5%
sqrt-div54.4%
metadata-eval54.4%
Applied egg-rr54.4%
if -2.6999999999999998e122 < l < -1.35000000000000013e-54Initial program 63.1%
Simplified63.2%
clear-num63.1%
sqrt-div63.2%
metadata-eval63.2%
Applied egg-rr63.2%
Taylor expanded in d around -inf 57.6%
Simplified83.7%
if -1.35000000000000013e-54 < l < 3.49999999999999996e-291Initial program 75.0%
Simplified75.7%
associate-*r/82.3%
Applied egg-rr82.4%
if 3.49999999999999996e-291 < l Initial program 70.4%
Simplified69.6%
Applied egg-rr24.2%
expm1-def42.4%
expm1-log1p82.8%
associate-*l*82.8%
*-commutative82.8%
associate-*l*82.8%
Simplified82.8%
Final simplification78.3%
(FPCore (d h l M D)
:precision binary64
(if (<= d -5.8e-226)
(*
(/ (sqrt (/ d h)) (sqrt (/ l d)))
(fma -0.5 (* h (/ (pow (* (/ M d) (* 0.5 D)) 2.0) l)) 1.0))
(if (<= d 3.8e-305)
(-
(* (/ (pow (* D M) 2.0) d) (* (sqrt (/ h (pow l 3.0))) 0.125))
(* d (pow (* h l) -0.5)))
(*
(/ d (* (sqrt h) (sqrt l)))
(- 1.0 (* 0.5 (* (/ h l) (pow (* M (* 0.5 (/ D d))) 2.0))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5.8e-226) {
tmp = (sqrt((d / h)) / sqrt((l / d))) * fma(-0.5, (h * (pow(((M / d) * (0.5 * D)), 2.0) / l)), 1.0);
} else if (d <= 3.8e-305) {
tmp = ((pow((D * M), 2.0) / d) * (sqrt((h / pow(l, 3.0))) * 0.125)) - (d * pow((h * l), -0.5));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * pow((M * (0.5 * (D / d))), 2.0))));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -5.8e-226) tmp = Float64(Float64(sqrt(Float64(d / h)) / sqrt(Float64(l / d))) * fma(-0.5, Float64(h * Float64((Float64(Float64(M / d) * Float64(0.5 * D)) ^ 2.0) / l)), 1.0)); elseif (d <= 3.8e-305) tmp = Float64(Float64(Float64((Float64(D * M) ^ 2.0) / d) * Float64(sqrt(Float64(h / (l ^ 3.0))) * 0.125)) - Float64(d * (Float64(h * l) ^ -0.5))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0))))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5.8e-226], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-0.5 * N[(h * N[(N[Power[N[(N[(M / d), $MachinePrecision] * N[(0.5 * D), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.8e-305], N[(N[(N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] - N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -5.8 \cdot 10^{-226}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \mathsf{fma}\left(-0.5, h \cdot \frac{{\left(\frac{M}{d} \cdot \left(0.5 \cdot D\right)\right)}^{2}}{\ell}, 1\right)\\
\mathbf{elif}\;d \leq 3.8 \cdot 10^{-305}:\\
\;\;\;\;\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) - d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if d < -5.80000000000000003e-226Initial program 73.8%
Simplified74.8%
clear-num74.7%
sqrt-div74.7%
metadata-eval74.7%
Applied egg-rr74.7%
expm1-log1p-u39.8%
expm1-udef25.6%
Applied egg-rr25.6%
expm1-def39.7%
expm1-log1p74.7%
+-commutative74.7%
fma-def74.7%
Simplified77.4%
if -5.80000000000000003e-226 < d < 3.8e-305Initial program 12.6%
Simplified14.3%
clear-num14.3%
sqrt-div14.3%
metadata-eval14.3%
Applied egg-rr14.3%
Taylor expanded in d around -inf 23.5%
Simplified46.2%
if 3.8e-305 < d Initial program 70.7%
Simplified69.9%
Applied egg-rr24.0%
expm1-def42.0%
expm1-log1p82.9%
associate-*l*82.9%
*-commutative82.9%
associate-*l*82.9%
Simplified82.9%
Final simplification77.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h))) (t_1 (sqrt (/ d l))))
(if (<= l -6.5e+45)
(*
t_0
(* t_1 (+ 1.0 (* (/ h l) (* -0.5 (pow (/ D (/ (* d 2.0) M)) 2.0))))))
(if (<= l 8e-291)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* 0.5 M)) 2.0)) l)))
(* t_1 t_0))
(*
(/ d (* (sqrt h) (sqrt l)))
(- 1.0 (* 0.5 (* (/ h l) (pow (* M (* 0.5 (/ D d))) 2.0)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = sqrt((d / l));
double tmp;
if (l <= -6.5e+45) {
tmp = t_0 * (t_1 * (1.0 + ((h / l) * (-0.5 * pow((D / ((d * 2.0) / M)), 2.0)))));
} else if (l <= 8e-291) {
tmp = (1.0 - (0.5 * ((h * pow(((D / d) * (0.5 * M)), 2.0)) / l))) * (t_1 * t_0);
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * pow((M * (0.5 * (D / 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((d / h))
t_1 = sqrt((d / l))
if (l <= (-6.5d+45)) then
tmp = t_0 * (t_1 * (1.0d0 + ((h / l) * ((-0.5d0) * ((d_1 / ((d * 2.0d0) / m)) ** 2.0d0)))))
else if (l <= 8d-291) then
tmp = (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (0.5d0 * m)) ** 2.0d0)) / l))) * (t_1 * t_0)
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 - (0.5d0 * ((h / l) * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h));
double t_1 = Math.sqrt((d / l));
double tmp;
if (l <= -6.5e+45) {
tmp = t_0 * (t_1 * (1.0 + ((h / l) * (-0.5 * Math.pow((D / ((d * 2.0) / M)), 2.0)))));
} else if (l <= 8e-291) {
tmp = (1.0 - (0.5 * ((h * Math.pow(((D / d) * (0.5 * M)), 2.0)) / l))) * (t_1 * t_0);
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 - (0.5 * ((h / l) * Math.pow((M * (0.5 * (D / d))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) t_1 = math.sqrt((d / l)) tmp = 0 if l <= -6.5e+45: tmp = t_0 * (t_1 * (1.0 + ((h / l) * (-0.5 * math.pow((D / ((d * 2.0) / M)), 2.0))))) elif l <= 8e-291: tmp = (1.0 - (0.5 * ((h * math.pow(((D / d) * (0.5 * M)), 2.0)) / l))) * (t_1 * t_0) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 - (0.5 * ((h / l) * math.pow((M * (0.5 * (D / d))), 2.0)))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= -6.5e+45) tmp = Float64(t_0 * Float64(t_1 * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(D / Float64(Float64(d * 2.0) / M)) ^ 2.0)))))); elseif (l <= 8e-291) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(0.5 * M)) ^ 2.0)) / l))) * Float64(t_1 * t_0)); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)); t_1 = sqrt((d / l)); tmp = 0.0; if (l <= -6.5e+45) tmp = t_0 * (t_1 * (1.0 + ((h / l) * (-0.5 * ((D / ((d * 2.0) / M)) ^ 2.0))))); elseif (l <= 8e-291) tmp = (1.0 - (0.5 * ((h * (((D / d) * (0.5 * M)) ^ 2.0)) / l))) * (t_1 * t_0); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * ((M * (0.5 * (D / d))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -6.5e+45], N[(t$95$0 * N[(t$95$1 * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D / N[(N[(d * 2.0), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 8e-291], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(D / d), $MachinePrecision] * N[(0.5 * M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq -6.5 \cdot 10^{+45}:\\
\;\;\;\;t_0 \cdot \left(t_1 \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D}{\frac{d \cdot 2}{M}}\right)}^{2}\right)\right)\right)\\
\mathbf{elif}\;\ell \leq 8 \cdot 10^{-291}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(0.5 \cdot M\right)\right)}^{2}}{\ell}\right) \cdot \left(t_1 \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if l < -6.50000000000000034e45Initial program 50.9%
Simplified47.6%
clear-num47.6%
frac-times52.8%
*-un-lft-identity52.8%
associate-*l/52.9%
Applied egg-rr52.9%
if -6.50000000000000034e45 < l < 7.9999999999999997e-291Initial program 73.4%
Simplified73.9%
associate-*r/78.7%
Applied egg-rr78.8%
if 7.9999999999999997e-291 < l Initial program 70.4%
Simplified69.6%
Applied egg-rr24.2%
expm1-def42.4%
expm1-log1p82.8%
associate-*l*82.8%
*-commutative82.8%
associate-*l*82.8%
Simplified82.8%
Final simplification74.9%
(FPCore (d h l M D)
:precision binary64
(if (<= d -2.35e+119)
(* d (- (sqrt (/ (/ 1.0 h) l))))
(if (<= d -3.2e-304)
(*
(sqrt (/ (* d (/ d h)) l))
(+ 1.0 (* (/ h l) (* -0.5 (pow (* D (* M (/ 0.5 d))) 2.0)))))
(*
(/ d (* (sqrt h) (sqrt l)))
(- 1.0 (* 0.5 (* (/ h l) (pow (* M (* 0.5 (/ D d))) 2.0))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.35e+119) {
tmp = d * -sqrt(((1.0 / h) / l));
} else if (d <= -3.2e-304) {
tmp = sqrt(((d * (d / h)) / l)) * (1.0 + ((h / l) * (-0.5 * pow((D * (M * (0.5 / d))), 2.0))));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * pow((M * (0.5 * (D / 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 <= (-2.35d+119)) then
tmp = d * -sqrt(((1.0d0 / h) / l))
else if (d <= (-3.2d-304)) then
tmp = sqrt(((d * (d / h)) / l)) * (1.0d0 + ((h / l) * ((-0.5d0) * ((d_1 * (m * (0.5d0 / d))) ** 2.0d0))))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 - (0.5d0 * ((h / l) * ((m * (0.5d0 * (d_1 / 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 <= -2.35e+119) {
tmp = d * -Math.sqrt(((1.0 / h) / l));
} else if (d <= -3.2e-304) {
tmp = Math.sqrt(((d * (d / h)) / l)) * (1.0 + ((h / l) * (-0.5 * Math.pow((D * (M * (0.5 / d))), 2.0))));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 - (0.5 * ((h / l) * Math.pow((M * (0.5 * (D / d))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -2.35e+119: tmp = d * -math.sqrt(((1.0 / h) / l)) elif d <= -3.2e-304: tmp = math.sqrt(((d * (d / h)) / l)) * (1.0 + ((h / l) * (-0.5 * math.pow((D * (M * (0.5 / d))), 2.0)))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 - (0.5 * ((h / l) * math.pow((M * (0.5 * (D / d))), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -2.35e+119) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / h) / l)))); elseif (d <= -3.2e-304) tmp = Float64(sqrt(Float64(Float64(d * Float64(d / h)) / l)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0))))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -2.35e+119) tmp = d * -sqrt(((1.0 / h) / l)); elseif (d <= -3.2e-304) tmp = sqrt(((d * (d / h)) / l)) * (1.0 + ((h / l) * (-0.5 * ((D * (M * (0.5 / d))) ^ 2.0)))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * ((M * (0.5 * (D / d))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.35e+119], N[(d * (-N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -3.2e-304], N[(N[Sqrt[N[(N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.35 \cdot 10^{+119}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\
\mathbf{elif}\;d \leq -3.2 \cdot 10^{-304}:\\
\;\;\;\;\sqrt{\frac{d \cdot \frac{d}{h}}{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if d < -2.35000000000000004e119Initial program 69.6%
Simplified72.9%
clear-num72.9%
sqrt-div72.9%
metadata-eval72.9%
Applied egg-rr72.9%
Taylor expanded in d around -inf 72.4%
mul-1-neg72.4%
associate-/r*74.8%
Simplified74.8%
if -2.35000000000000004e119 < d < -3.19999999999999999e-304Initial program 65.6%
Simplified66.0%
add-sqr-sqrt66.0%
pow266.0%
Applied egg-rr63.1%
associate-*r/65.8%
associate-*l*65.8%
*-commutative65.8%
associate-*l/66.0%
*-commutative66.0%
associate-*l*66.0%
associate-*l*66.1%
metadata-eval66.1%
associate-/r/66.1%
associate-/l*66.1%
associate-/r/66.1%
*-commutative66.1%
associate-/r*66.1%
metadata-eval66.1%
Simplified66.1%
expm1-log1p-u30.6%
expm1-udef14.3%
Applied egg-rr11.8%
expm1-def23.5%
expm1-log1p57.4%
associate-*r/51.5%
associate-*r*51.5%
Simplified51.5%
if -3.19999999999999999e-304 < d Initial program 67.8%
Simplified67.0%
Applied egg-rr23.0%
expm1-def40.3%
expm1-log1p79.5%
associate-*l*79.5%
*-commutative79.5%
associate-*l*79.5%
Simplified79.5%
Final simplification67.8%
(FPCore (d h l M D)
:precision binary64
(if (<= h 2.2e-289)
(*
(*
(+ 1.0 (* (/ h l) (* -0.5 (pow (* (/ M 2.0) (/ D d)) 2.0))))
(sqrt (/ d l)))
(sqrt (/ d h)))
(*
(/ d (* (sqrt h) (sqrt l)))
(- 1.0 (* 0.5 (* (/ h l) (pow (* M (* 0.5 (/ D d))) 2.0)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 2.2e-289) {
tmp = ((1.0 + ((h / l) * (-0.5 * pow(((M / 2.0) * (D / d)), 2.0)))) * sqrt((d / l))) * sqrt((d / h));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * pow((M * (0.5 * (D / 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 (h <= 2.2d-289) then
tmp = ((1.0d0 + ((h / l) * ((-0.5d0) * (((m / 2.0d0) * (d_1 / d)) ** 2.0d0)))) * sqrt((d / l))) * sqrt((d / h))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 - (0.5d0 * ((h / l) * ((m * (0.5d0 * (d_1 / 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 (h <= 2.2e-289) {
tmp = ((1.0 + ((h / l) * (-0.5 * Math.pow(((M / 2.0) * (D / d)), 2.0)))) * Math.sqrt((d / l))) * Math.sqrt((d / h));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 - (0.5 * ((h / l) * Math.pow((M * (0.5 * (D / d))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= 2.2e-289: tmp = ((1.0 + ((h / l) * (-0.5 * math.pow(((M / 2.0) * (D / d)), 2.0)))) * math.sqrt((d / l))) * math.sqrt((d / h)) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 - (0.5 * ((h / l) * math.pow((M * (0.5 * (D / d))), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= 2.2e-289) tmp = Float64(Float64(Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0)))) * sqrt(Float64(d / l))) * sqrt(Float64(d / h))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= 2.2e-289) tmp = ((1.0 + ((h / l) * (-0.5 * (((M / 2.0) * (D / d)) ^ 2.0)))) * sqrt((d / l))) * sqrt((d / h)); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * ((M * (0.5 * (D / d))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, 2.2e-289], N[(N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq 2.2 \cdot 10^{-289}:\\
\;\;\;\;\left(\left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if h < 2.2e-289Initial program 65.4%
Simplified64.4%
if 2.2e-289 < h Initial program 69.3%
Simplified68.5%
Applied egg-rr22.1%
expm1-def39.5%
expm1-log1p82.1%
associate-*l*82.1%
*-commutative82.1%
associate-*l*82.1%
Simplified82.1%
Final simplification72.2%
(FPCore (d h l M D)
:precision binary64
(if (<= d -3.2e-304)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(+ 1.0 (* (/ h l) (* -0.5 (pow (/ D (/ (* d 2.0) M)) 2.0))))))
(*
(/ d (* (sqrt h) (sqrt l)))
(- 1.0 (* 0.5 (* (/ h l) (pow (* M (* 0.5 (/ D d))) 2.0)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -3.2e-304) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * pow((D / ((d * 2.0) / M)), 2.0)))));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * pow((M * (0.5 * (D / 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 <= (-3.2d-304)) then
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 + ((h / l) * ((-0.5d0) * ((d_1 / ((d * 2.0d0) / m)) ** 2.0d0)))))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 - (0.5d0 * ((h / l) * ((m * (0.5d0 * (d_1 / 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 <= -3.2e-304) {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * Math.pow((D / ((d * 2.0) / M)), 2.0)))));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 - (0.5 * ((h / l) * Math.pow((M * (0.5 * (D / d))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -3.2e-304: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * math.pow((D / ((d * 2.0) / M)), 2.0))))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 - (0.5 * ((h / l) * math.pow((M * (0.5 * (D / d))), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -3.2e-304) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(D / Float64(Float64(d * 2.0) / M)) ^ 2.0)))))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -3.2e-304) tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * ((D / ((d * 2.0) / M)) ^ 2.0))))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - (0.5 * ((h / l) * ((M * (0.5 * (D / d))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -3.2e-304], 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[(D / N[(N[(d * 2.0), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -3.2 \cdot 10^{-304}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D}{\frac{d \cdot 2}{M}}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if d < -3.19999999999999999e-304Initial program 66.5%
Simplified65.5%
clear-num65.5%
frac-times67.6%
*-un-lft-identity67.6%
associate-*l/67.7%
Applied egg-rr67.7%
if -3.19999999999999999e-304 < d Initial program 67.8%
Simplified67.0%
Applied egg-rr23.0%
expm1-def40.3%
expm1-log1p79.5%
associate-*l*79.5%
*-commutative79.5%
associate-*l*79.5%
Simplified79.5%
Final simplification73.3%
(FPCore (d h l M D)
:precision binary64
(if (<= l -5.1e+19)
(* d (- (sqrt (/ (/ 1.0 h) l))))
(if (<= l 7.2e+32)
(*
(sqrt (/ (* d (/ d h)) l))
(+ 1.0 (* (/ h l) (* -0.5 (pow (* D (* M (/ 0.5 d))) 2.0)))))
(* d (/ (sqrt (/ 1.0 l)) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -5.1e+19) {
tmp = d * -sqrt(((1.0 / h) / l));
} else if (l <= 7.2e+32) {
tmp = sqrt(((d * (d / h)) / l)) * (1.0 + ((h / l) * (-0.5 * pow((D * (M * (0.5 / d))), 2.0))));
} else {
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-5.1d+19)) then
tmp = d * -sqrt(((1.0d0 / h) / l))
else if (l <= 7.2d+32) then
tmp = sqrt(((d * (d / h)) / l)) * (1.0d0 + ((h / l) * ((-0.5d0) * ((d_1 * (m * (0.5d0 / d))) ** 2.0d0))))
else
tmp = d * (sqrt((1.0d0 / l)) / sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -5.1e+19) {
tmp = d * -Math.sqrt(((1.0 / h) / l));
} else if (l <= 7.2e+32) {
tmp = Math.sqrt(((d * (d / h)) / l)) * (1.0 + ((h / l) * (-0.5 * Math.pow((D * (M * (0.5 / d))), 2.0))));
} else {
tmp = d * (Math.sqrt((1.0 / l)) / Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -5.1e+19: tmp = d * -math.sqrt(((1.0 / h) / l)) elif l <= 7.2e+32: tmp = math.sqrt(((d * (d / h)) / l)) * (1.0 + ((h / l) * (-0.5 * math.pow((D * (M * (0.5 / d))), 2.0)))) else: tmp = d * (math.sqrt((1.0 / l)) / math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -5.1e+19) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / h) / l)))); elseif (l <= 7.2e+32) tmp = Float64(sqrt(Float64(Float64(d * Float64(d / h)) / l)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0))))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / l)) / sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -5.1e+19) tmp = d * -sqrt(((1.0 / h) / l)); elseif (l <= 7.2e+32) tmp = sqrt(((d * (d / h)) / l)) * (1.0 + ((h / l) * (-0.5 * ((D * (M * (0.5 / d))) ^ 2.0)))); else tmp = d * (sqrt((1.0 / l)) / sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -5.1e+19], N[(d * (-N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, 7.2e+32], N[(N[Sqrt[N[(N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.1 \cdot 10^{+19}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\
\mathbf{elif}\;\ell \leq 7.2 \cdot 10^{+32}:\\
\;\;\;\;\sqrt{\frac{d \cdot \frac{d}{h}}{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -5.1e19Initial program 49.9%
Simplified51.7%
clear-num51.6%
sqrt-div51.6%
metadata-eval51.6%
Applied egg-rr51.6%
Taylor expanded in d around -inf 40.5%
mul-1-neg40.5%
associate-/r*43.1%
Simplified43.1%
if -5.1e19 < l < 7.1999999999999994e32Initial program 76.9%
Simplified76.6%
add-sqr-sqrt76.5%
pow276.5%
Applied egg-rr77.8%
associate-*r/78.2%
associate-*l*78.2%
*-commutative78.2%
associate-*l/77.2%
*-commutative77.2%
associate-*l*77.2%
associate-*l*77.2%
metadata-eval77.2%
associate-/r/77.2%
associate-/l*77.2%
associate-/r/77.2%
*-commutative77.2%
associate-/r*77.2%
metadata-eval77.2%
Simplified77.2%
expm1-log1p-u30.0%
expm1-udef21.9%
Applied egg-rr17.9%
expm1-def25.4%
expm1-log1p70.2%
associate-*r/64.1%
associate-*r*64.1%
Simplified64.1%
if 7.1999999999999994e32 < l Initial program 59.0%
Simplified59.0%
Taylor expanded in d around inf 43.8%
*-commutative43.8%
associate-/r*45.7%
Simplified45.7%
sqrt-div61.4%
Applied egg-rr61.4%
Final simplification58.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l -6.5e-235)
(* d (- (sqrt (/ (/ 1.0 h) l))))
(if (<= l -4.6e-290)
(* d (cbrt (pow (/ 1.0 (* h l)) 1.5)))
(if (<= l 1e-247)
(* d (- (pow (* h l) -0.5)))
(* d (/ (sqrt (/ 1.0 l)) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6.5e-235) {
tmp = d * -sqrt(((1.0 / h) / l));
} else if (l <= -4.6e-290) {
tmp = d * cbrt(pow((1.0 / (h * l)), 1.5));
} else if (l <= 1e-247) {
tmp = d * -pow((h * l), -0.5);
} else {
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6.5e-235) {
tmp = d * -Math.sqrt(((1.0 / h) / l));
} else if (l <= -4.6e-290) {
tmp = d * Math.cbrt(Math.pow((1.0 / (h * l)), 1.5));
} else if (l <= 1e-247) {
tmp = d * -Math.pow((h * l), -0.5);
} else {
tmp = d * (Math.sqrt((1.0 / l)) / Math.sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -6.5e-235) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / h) / l)))); elseif (l <= -4.6e-290) tmp = Float64(d * cbrt((Float64(1.0 / Float64(h * l)) ^ 1.5))); elseif (l <= 1e-247) tmp = Float64(d * Float64(-(Float64(h * l) ^ -0.5))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / l)) / sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -6.5e-235], N[(d * (-N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, -4.6e-290], N[(d * N[Power[N[Power[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1e-247], N[(d * (-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.5 \cdot 10^{-235}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\
\mathbf{elif}\;\ell \leq -4.6 \cdot 10^{-290}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(\frac{1}{h \cdot \ell}\right)}^{1.5}}\\
\mathbf{elif}\;\ell \leq 10^{-247}:\\
\;\;\;\;d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -6.49999999999999973e-235Initial program 65.1%
Simplified66.3%
clear-num66.2%
sqrt-div66.2%
metadata-eval66.2%
Applied egg-rr66.2%
Taylor expanded in d around -inf 40.2%
mul-1-neg40.2%
associate-/r*41.5%
Simplified41.5%
if -6.49999999999999973e-235 < l < -4.6000000000000001e-290Initial program 66.7%
Simplified66.7%
Taylor expanded in d around inf 22.5%
add-cbrt-cube35.3%
pow1/335.3%
add-sqr-sqrt35.3%
pow135.3%
pow1/235.3%
pow-prod-up35.3%
metadata-eval35.3%
Applied egg-rr35.3%
unpow1/335.3%
Simplified35.3%
if -4.6000000000000001e-290 < l < 1e-247Initial program 73.9%
Simplified73.9%
clear-num73.9%
sqrt-div73.9%
metadata-eval73.9%
Applied egg-rr73.9%
Taylor expanded in d around -inf 48.5%
mul-1-neg48.5%
*-commutative48.5%
distribute-rgt-neg-in48.5%
rem-exp-log48.5%
exp-neg48.5%
unpow1/248.5%
exp-prod52.0%
distribute-lft-neg-out52.0%
distribute-rgt-neg-in52.0%
metadata-eval52.0%
exp-to-pow52.0%
*-commutative52.0%
Simplified52.0%
if 1e-247 < l Initial program 68.6%
Simplified67.7%
Taylor expanded in d around inf 39.1%
*-commutative39.1%
associate-/r*40.0%
Simplified40.0%
sqrt-div48.8%
Applied egg-rr48.8%
Final simplification44.8%
(FPCore (d h l M D) :precision binary64 (if (<= l 1.68e-248) (* d (- (sqrt (/ (/ 1.0 h) l)))) (* d (/ (sqrt (/ 1.0 h)) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 1.68e-248) {
tmp = d * -sqrt(((1.0 / h) / l));
} else {
tmp = d * (sqrt((1.0 / h)) / sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 1.68d-248) then
tmp = d * -sqrt(((1.0d0 / h) / l))
else
tmp = d * (sqrt((1.0d0 / h)) / sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 1.68e-248) {
tmp = d * -Math.sqrt(((1.0 / h) / l));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 1.68e-248: tmp = d * -math.sqrt(((1.0 / h) / l)) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 1.68e-248) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / h) / l)))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 1.68e-248) tmp = d * -sqrt(((1.0 / h) / l)); else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 1.68e-248], N[(d * (-N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.68 \cdot 10^{-248}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 1.67999999999999994e-248Initial program 66.1%
Simplified67.1%
clear-num67.0%
sqrt-div67.0%
metadata-eval67.0%
Applied egg-rr67.0%
Taylor expanded in d around -inf 37.8%
mul-1-neg37.8%
associate-/r*38.8%
Simplified38.8%
if 1.67999999999999994e-248 < l Initial program 68.6%
Simplified67.7%
Taylor expanded in d around inf 39.1%
associate-/r*40.0%
sqrt-div48.7%
Applied egg-rr48.7%
Final simplification42.9%
(FPCore (d h l M D) :precision binary64 (if (<= l 2.25e-248) (* d (- (sqrt (/ (/ 1.0 h) l)))) (* d (/ (sqrt (/ 1.0 l)) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 2.25e-248) {
tmp = d * -sqrt(((1.0 / h) / l));
} else {
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 2.25d-248) then
tmp = d * -sqrt(((1.0d0 / h) / l))
else
tmp = d * (sqrt((1.0d0 / l)) / sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 2.25e-248) {
tmp = d * -Math.sqrt(((1.0 / h) / l));
} else {
tmp = d * (Math.sqrt((1.0 / l)) / Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 2.25e-248: tmp = d * -math.sqrt(((1.0 / h) / l)) else: tmp = d * (math.sqrt((1.0 / l)) / math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 2.25e-248) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / h) / l)))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / l)) / sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 2.25e-248) tmp = d * -sqrt(((1.0 / h) / l)); else tmp = d * (sqrt((1.0 / l)) / sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 2.25e-248], N[(d * (-N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.25 \cdot 10^{-248}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < 2.2499999999999998e-248Initial program 66.1%
Simplified67.1%
clear-num67.0%
sqrt-div67.0%
metadata-eval67.0%
Applied egg-rr67.0%
Taylor expanded in d around -inf 37.8%
mul-1-neg37.8%
associate-/r*38.8%
Simplified38.8%
if 2.2499999999999998e-248 < l Initial program 68.6%
Simplified67.7%
Taylor expanded in d around inf 39.1%
*-commutative39.1%
associate-/r*40.0%
Simplified40.0%
sqrt-div48.8%
Applied egg-rr48.8%
Final simplification43.0%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (sqrt (/ (/ 1.0 h) l)))) (if (<= l 5.8e-248) (* d (- t_0)) (* d t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(((1.0 / h) / l));
double tmp;
if (l <= 5.8e-248) {
tmp = d * -t_0;
} else {
tmp = d * 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(((1.0d0 / h) / l))
if (l <= 5.8d-248) then
tmp = d * -t_0
else
tmp = d * 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(((1.0 / h) / l));
double tmp;
if (l <= 5.8e-248) {
tmp = d * -t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(((1.0 / h) / l)) tmp = 0 if l <= 5.8e-248: tmp = d * -t_0 else: tmp = d * t_0 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(Float64(1.0 / h) / l)) tmp = 0.0 if (l <= 5.8e-248) tmp = Float64(d * Float64(-t_0)); else tmp = Float64(d * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(((1.0 / h) / l)); tmp = 0.0; if (l <= 5.8e-248) tmp = d * -t_0; else tmp = d * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, 5.8e-248], N[(d * (-t$95$0)), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{if}\;\ell \leq 5.8 \cdot 10^{-248}:\\
\;\;\;\;d \cdot \left(-t_0\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot t_0\\
\end{array}
\end{array}
if l < 5.8000000000000002e-248Initial program 66.1%
Simplified67.1%
clear-num67.0%
sqrt-div67.0%
metadata-eval67.0%
Applied egg-rr67.0%
Taylor expanded in d around -inf 37.8%
mul-1-neg37.8%
associate-/r*38.8%
Simplified38.8%
if 5.8000000000000002e-248 < l Initial program 68.6%
Simplified67.7%
clear-num67.6%
sqrt-div67.6%
metadata-eval67.6%
Applied egg-rr67.6%
Taylor expanded in d around inf 39.1%
associate-/r*40.0%
Simplified40.0%
Final simplification39.3%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (pow (* h l) -0.5))) (if (<= l 5.4e-248) (* d (- t_0)) (* d t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((h * l), -0.5);
double tmp;
if (l <= 5.4e-248) {
tmp = d * -t_0;
} else {
tmp = d * 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 = (h * l) ** (-0.5d0)
if (l <= 5.4d-248) then
tmp = d * -t_0
else
tmp = d * t_0
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.pow((h * l), -0.5);
double tmp;
if (l <= 5.4e-248) {
tmp = d * -t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((h * l), -0.5) tmp = 0 if l <= 5.4e-248: tmp = d * -t_0 else: tmp = d * t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(h * l) ^ -0.5 tmp = 0.0 if (l <= 5.4e-248) tmp = Float64(d * Float64(-t_0)); else tmp = Float64(d * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (h * l) ^ -0.5; tmp = 0.0; if (l <= 5.4e-248) tmp = d * -t_0; else tmp = d * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[l, 5.4e-248], N[(d * (-t$95$0)), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq 5.4 \cdot 10^{-248}:\\
\;\;\;\;d \cdot \left(-t_0\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot t_0\\
\end{array}
\end{array}
if l < 5.4000000000000002e-248Initial program 66.1%
Simplified67.1%
clear-num67.0%
sqrt-div67.0%
metadata-eval67.0%
Applied egg-rr67.0%
Taylor expanded in d around -inf 37.8%
mul-1-neg37.8%
*-commutative37.8%
distribute-rgt-neg-in37.8%
rem-exp-log36.1%
exp-neg36.1%
unpow1/236.1%
exp-prod36.4%
distribute-lft-neg-out36.4%
distribute-rgt-neg-in36.4%
metadata-eval36.4%
exp-to-pow38.1%
*-commutative38.1%
Simplified38.1%
if 5.4000000000000002e-248 < l Initial program 68.6%
Simplified67.7%
add-sqr-sqrt67.6%
pow267.6%
Applied egg-rr71.2%
associate-*r/72.1%
associate-*l*72.1%
*-commutative72.1%
associate-*l/71.2%
*-commutative71.2%
associate-*l*71.2%
associate-*l*71.2%
metadata-eval71.2%
associate-/r/71.2%
associate-/l*71.2%
associate-/r/71.2%
*-commutative71.2%
associate-/r*71.2%
metadata-eval71.2%
Simplified71.2%
Taylor expanded in d around inf 39.1%
unpow-139.1%
metadata-eval39.1%
pow-sqr39.1%
rem-sqrt-square39.9%
rem-square-sqrt39.7%
fabs-sqr39.7%
rem-square-sqrt39.9%
Simplified39.9%
Final simplification38.9%
(FPCore (d h l M D) :precision binary64 (if (<= l 1.22e-248) (* d (- (pow (* h l) -0.5))) (* d (sqrt (/ (/ 1.0 h) l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 1.22e-248) {
tmp = d * -pow((h * l), -0.5);
} else {
tmp = d * sqrt(((1.0 / h) / l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 1.22d-248) then
tmp = d * -((h * l) ** (-0.5d0))
else
tmp = d * sqrt(((1.0d0 / h) / l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 1.22e-248) {
tmp = d * -Math.pow((h * l), -0.5);
} else {
tmp = d * Math.sqrt(((1.0 / h) / l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 1.22e-248: tmp = d * -math.pow((h * l), -0.5) else: tmp = d * math.sqrt(((1.0 / h) / l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 1.22e-248) tmp = Float64(d * Float64(-(Float64(h * l) ^ -0.5))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 1.22e-248) tmp = d * -((h * l) ^ -0.5); else tmp = d * sqrt(((1.0 / h) / l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 1.22e-248], N[(d * (-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.22 \cdot 10^{-248}:\\
\;\;\;\;d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\end{array}
\end{array}
if l < 1.22e-248Initial program 66.1%
Simplified67.1%
clear-num67.0%
sqrt-div67.0%
metadata-eval67.0%
Applied egg-rr67.0%
Taylor expanded in d around -inf 37.8%
mul-1-neg37.8%
*-commutative37.8%
distribute-rgt-neg-in37.8%
rem-exp-log36.1%
exp-neg36.1%
unpow1/236.1%
exp-prod36.4%
distribute-lft-neg-out36.4%
distribute-rgt-neg-in36.4%
metadata-eval36.4%
exp-to-pow38.1%
*-commutative38.1%
Simplified38.1%
if 1.22e-248 < l Initial program 68.6%
Simplified67.7%
clear-num67.6%
sqrt-div67.6%
metadata-eval67.6%
Applied egg-rr67.6%
Taylor expanded in d around inf 39.1%
associate-/r*40.0%
Simplified40.0%
Final simplification38.9%
(FPCore (d h l M D) :precision binary64 (* d (pow (* h l) -0.5)))
double code(double d, double h, double l, double M, double D) {
return d * pow((h * l), -0.5);
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * ((h * l) ** (-0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.pow((h * l), -0.5);
}
def code(d, h, l, M, D): return d * math.pow((h * l), -0.5)
function code(d, h, l, M, D) return Float64(d * (Float64(h * l) ^ -0.5)) end
function tmp = code(d, h, l, M, D) tmp = d * ((h * l) ^ -0.5); end
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot {\left(h \cdot \ell\right)}^{-0.5}
\end{array}
Initial program 67.1%
Simplified67.3%
add-sqr-sqrt67.3%
pow267.3%
Applied egg-rr67.7%
associate-*r/69.1%
associate-*l*69.1%
*-commutative69.1%
associate-*l/69.2%
*-commutative69.2%
associate-*l*69.2%
associate-*l*69.2%
metadata-eval69.2%
associate-/r/69.2%
associate-/l*69.2%
associate-/r/69.2%
*-commutative69.2%
associate-/r*69.2%
metadata-eval69.2%
Simplified69.2%
Taylor expanded in d around inf 22.0%
unpow-122.0%
metadata-eval22.0%
pow-sqr22.0%
rem-sqrt-square22.4%
rem-square-sqrt22.3%
fabs-sqr22.3%
rem-square-sqrt22.4%
Simplified22.4%
Final simplification22.4%
herbie shell --seed 2023319
(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)))))