
(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 16 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 (<= l -5e-310)
(*
(* (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ d l)))
(- 1.0 (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l)))))
(*
d
(/
(fma h (* (* 0.25 (pow (* D (/ M d)) 2.0)) (/ -0.5 l)) 1.0)
(* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -5e-310) {
tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * (1.0 - (0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))));
} else {
tmp = d * (fma(h, ((0.25 * pow((D * (M / d)), 2.0)) * (-0.5 / l)), 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -5e-310) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))))); else tmp = Float64(d * Float64(fma(h, Float64(Float64(0.25 * (Float64(D * Float64(M / d)) ^ 2.0)) * Float64(-0.5 / l)), 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -5e-310], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * N[(N[(0.25 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(-0.5 / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, \left(0.25 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}\right) \cdot \frac{-0.5}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 65.5%
Simplified65.5%
frac-2neg65.5%
sqrt-div77.6%
Applied egg-rr77.6%
if -4.999999999999985e-310 < l Initial program 63.4%
Simplified63.4%
Applied egg-rr80.4%
Simplified89.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* 0.25 (pow (* D (/ M d)) 2.0))))
(if (<= d -3.4e+214)
(* (- d) (sqrt (/ (/ 1.0 h) l)))
(if (<= d -7e-231)
(* (* (sqrt (/ d l)) (sqrt (/ d h))) (- 1.0 (* 0.5 (* h (/ t_0 l)))))
(if (<= d -5e-310)
(*
(sqrt (/ h (pow l 3.0)))
(* -0.125 (* (* (pow D 2.0) (pow M 2.0)) (/ -1.0 d))))
(* d (/ (fma h (* t_0 (/ -0.5 l)) 1.0) (* (sqrt l) (sqrt h)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 0.25 * pow((D * (M / d)), 2.0);
double tmp;
if (d <= -3.4e+214) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (d <= -7e-231) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (0.5 * (h * (t_0 / l))));
} else if (d <= -5e-310) {
tmp = sqrt((h / pow(l, 3.0))) * (-0.125 * ((pow(D, 2.0) * pow(M, 2.0)) * (-1.0 / d)));
} else {
tmp = d * (fma(h, (t_0 * (-0.5 / l)), 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(0.25 * (Float64(D * Float64(M / d)) ^ 2.0)) tmp = 0.0 if (d <= -3.4e+214) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (d <= -7e-231) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(h * Float64(t_0 / l))))); elseif (d <= -5e-310) tmp = Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(-0.125 * Float64(Float64((D ^ 2.0) * (M ^ 2.0)) * Float64(-1.0 / d)))); else tmp = Float64(d * Float64(fma(h, Float64(t_0 * Float64(-0.5 / l)), 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(0.25 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -3.4e+214], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -7e-231], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(h * N[(t$95$0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-0.125 * N[(N[(N[Power[D, 2.0], $MachinePrecision] * N[Power[M, 2.0], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * N[(t$95$0 * N[(-0.5 / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.25 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}\\
\mathbf{if}\;d \leq -3.4 \cdot 10^{+214}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;d \leq -7 \cdot 10^{-231}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{t\_0}{\ell}\right)\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \frac{-1}{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, t\_0 \cdot \frac{-0.5}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < -3.3999999999999998e214Initial program 60.5%
Simplified61.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt86.9%
neg-mul-186.9%
Simplified86.9%
if -3.3999999999999998e214 < d < -7.0000000000000002e-231Initial program 71.6%
Simplified71.5%
associate-*r/74.4%
Applied egg-rr73.5%
*-commutative73.5%
associate-/l*72.5%
unpow272.5%
associate-*r/72.6%
associate-*l/72.6%
associate-*r*72.6%
*-commutative72.6%
*-commutative72.6%
associate-*r/73.6%
associate-*l/73.6%
associate-*r*73.6%
*-commutative73.6%
*-commutative73.6%
swap-sqr73.6%
metadata-eval73.6%
unpow273.6%
associate-*r/73.6%
*-commutative73.6%
associate-/l*72.5%
Simplified72.5%
if -7.0000000000000002e-231 < d < -4.999999999999985e-310Initial program 23.9%
Simplified23.9%
Taylor expanded in h around -inf 0.0%
associate-*r*0.0%
*-commutative0.0%
associate-*r*0.0%
unpow20.0%
rem-square-sqrt62.6%
associate-/l*62.5%
Simplified62.5%
if -4.999999999999985e-310 < d Initial program 63.4%
Simplified63.4%
Applied egg-rr80.4%
Simplified89.0%
Final simplification80.9%
(FPCore (d h l M D)
:precision binary64
(if (<= d -4.2e+214)
(* (- d) (sqrt (/ (/ 1.0 h) l)))
(if (<= d -9e-231)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(- 1.0 (* 0.5 (* h (/ (* 0.25 (pow (* D (/ M d)) 2.0)) l)))))
(if (<= d -5e-310)
(*
(sqrt (/ h (pow l 3.0)))
(* -0.125 (* (* (pow D 2.0) (pow M 2.0)) (/ -1.0 d))))
(*
(/ d (* (sqrt l) (sqrt h)))
(+ 1.0 (* -0.5 (* (/ h l) (pow (* D (/ M (* d 2.0))) 2.0)))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -4.2e+214) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (d <= -9e-231) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (0.5 * (h * ((0.25 * pow((D * (M / d)), 2.0)) / l))));
} else if (d <= -5e-310) {
tmp = sqrt((h / pow(l, 3.0))) * (-0.125 * ((pow(D, 2.0) * pow(M, 2.0)) * (-1.0 / d)));
} else {
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + (-0.5 * ((h / l) * pow((D * (M / (d * 2.0))), 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.2d+214)) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else if (d <= (-9d-231)) then
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (0.5d0 * (h * ((0.25d0 * ((d_1 * (m / d)) ** 2.0d0)) / l))))
else if (d <= (-5d-310)) then
tmp = sqrt((h / (l ** 3.0d0))) * ((-0.125d0) * (((d_1 ** 2.0d0) * (m ** 2.0d0)) * ((-1.0d0) / d)))
else
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0d0 + ((-0.5d0) * ((h / l) * ((d_1 * (m / (d * 2.0d0))) ** 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.2e+214) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else if (d <= -9e-231) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (0.5 * (h * ((0.25 * Math.pow((D * (M / d)), 2.0)) / l))));
} else if (d <= -5e-310) {
tmp = Math.sqrt((h / Math.pow(l, 3.0))) * (-0.125 * ((Math.pow(D, 2.0) * Math.pow(M, 2.0)) * (-1.0 / d)));
} else {
tmp = (d / (Math.sqrt(l) * Math.sqrt(h))) * (1.0 + (-0.5 * ((h / l) * Math.pow((D * (M / (d * 2.0))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -4.2e+214: tmp = -d * math.sqrt(((1.0 / h) / l)) elif d <= -9e-231: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (0.5 * (h * ((0.25 * math.pow((D * (M / d)), 2.0)) / l)))) elif d <= -5e-310: tmp = math.sqrt((h / math.pow(l, 3.0))) * (-0.125 * ((math.pow(D, 2.0) * math.pow(M, 2.0)) * (-1.0 / d))) else: tmp = (d / (math.sqrt(l) * math.sqrt(h))) * (1.0 + (-0.5 * ((h / l) * math.pow((D * (M / (d * 2.0))), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -4.2e+214) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (d <= -9e-231) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(h * Float64(Float64(0.25 * (Float64(D * Float64(M / d)) ^ 2.0)) / l))))); elseif (d <= -5e-310) tmp = Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(-0.125 * Float64(Float64((D ^ 2.0) * (M ^ 2.0)) * Float64(-1.0 / d)))); else tmp = Float64(Float64(d / Float64(sqrt(l) * sqrt(h))) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -4.2e+214) tmp = -d * sqrt(((1.0 / h) / l)); elseif (d <= -9e-231) tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (0.5 * (h * ((0.25 * ((D * (M / d)) ^ 2.0)) / l)))); elseif (d <= -5e-310) tmp = sqrt((h / (l ^ 3.0))) * (-0.125 * (((D ^ 2.0) * (M ^ 2.0)) * (-1.0 / d))); else tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + (-0.5 * ((h / l) * ((D * (M / (d * 2.0))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -4.2e+214], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -9e-231], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(h * N[(N[(0.25 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-0.125 * N[(N[(N[Power[D, 2.0], $MachinePrecision] * N[Power[M, 2.0], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -4.2 \cdot 10^{+214}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;d \leq -9 \cdot 10^{-231}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{0.25 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \frac{-1}{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if d < -4.2000000000000001e214Initial program 60.5%
Simplified61.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt86.9%
neg-mul-186.9%
Simplified86.9%
if -4.2000000000000001e214 < d < -8.9999999999999996e-231Initial program 71.6%
Simplified71.5%
associate-*r/74.4%
Applied egg-rr73.5%
*-commutative73.5%
associate-/l*72.5%
unpow272.5%
associate-*r/72.6%
associate-*l/72.6%
associate-*r*72.6%
*-commutative72.6%
*-commutative72.6%
associate-*r/73.6%
associate-*l/73.6%
associate-*r*73.6%
*-commutative73.6%
*-commutative73.6%
swap-sqr73.6%
metadata-eval73.6%
unpow273.6%
associate-*r/73.6%
*-commutative73.6%
associate-/l*72.5%
Simplified72.5%
if -8.9999999999999996e-231 < d < -4.999999999999985e-310Initial program 23.9%
Simplified23.9%
Taylor expanded in h around -inf 0.0%
associate-*r*0.0%
*-commutative0.0%
associate-*r*0.0%
unpow20.0%
rem-square-sqrt62.6%
associate-/l*62.5%
Simplified62.5%
if -4.999999999999985e-310 < d Initial program 63.4%
Simplified63.4%
sqrt-div70.4%
Applied egg-rr70.4%
pow170.4%
Applied egg-rr80.4%
unpow180.4%
associate-/l*80.4%
Simplified80.4%
Final simplification76.7%
(FPCore (d h l M D)
:precision binary64
(if (<= d -3.4e+214)
(* (- d) (sqrt (/ (/ 1.0 h) l)))
(if (<= d -6.5e-297)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(- 1.0 (* 0.5 (* h (/ (* 0.25 (pow (* D (/ M d)) 2.0)) l)))))
(*
(/ d (* (sqrt l) (sqrt h)))
(+ 1.0 (* -0.5 (* (/ h l) (pow (* D (/ M (* d 2.0))) 2.0))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -3.4e+214) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (d <= -6.5e-297) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (0.5 * (h * ((0.25 * pow((D * (M / d)), 2.0)) / l))));
} else {
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + (-0.5 * ((h / l) * pow((D * (M / (d * 2.0))), 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.4d+214)) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else if (d <= (-6.5d-297)) then
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (0.5d0 * (h * ((0.25d0 * ((d_1 * (m / d)) ** 2.0d0)) / l))))
else
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0d0 + ((-0.5d0) * ((h / l) * ((d_1 * (m / (d * 2.0d0))) ** 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.4e+214) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else if (d <= -6.5e-297) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (0.5 * (h * ((0.25 * Math.pow((D * (M / d)), 2.0)) / l))));
} else {
tmp = (d / (Math.sqrt(l) * Math.sqrt(h))) * (1.0 + (-0.5 * ((h / l) * Math.pow((D * (M / (d * 2.0))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -3.4e+214: tmp = -d * math.sqrt(((1.0 / h) / l)) elif d <= -6.5e-297: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (0.5 * (h * ((0.25 * math.pow((D * (M / d)), 2.0)) / l)))) else: tmp = (d / (math.sqrt(l) * math.sqrt(h))) * (1.0 + (-0.5 * ((h / l) * math.pow((D * (M / (d * 2.0))), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -3.4e+214) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (d <= -6.5e-297) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(h * Float64(Float64(0.25 * (Float64(D * Float64(M / d)) ^ 2.0)) / l))))); else tmp = Float64(Float64(d / Float64(sqrt(l) * sqrt(h))) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -3.4e+214) tmp = -d * sqrt(((1.0 / h) / l)); elseif (d <= -6.5e-297) tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (0.5 * (h * ((0.25 * ((D * (M / d)) ^ 2.0)) / l)))); else tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + (-0.5 * ((h / l) * ((D * (M / (d * 2.0))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -3.4e+214], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -6.5e-297], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(h * N[(N[(0.25 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -3.4 \cdot 10^{+214}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;d \leq -6.5 \cdot 10^{-297}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{0.25 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if d < -3.3999999999999998e214Initial program 60.5%
Simplified61.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt86.9%
neg-mul-186.9%
Simplified86.9%
if -3.3999999999999998e214 < d < -6.5000000000000002e-297Initial program 67.4%
Simplified67.3%
associate-*r/70.0%
Applied egg-rr69.1%
*-commutative69.1%
associate-/l*68.3%
unpow268.3%
associate-*r/68.3%
associate-*l/68.3%
associate-*r*68.3%
*-commutative68.3%
*-commutative68.3%
associate-*r/69.2%
associate-*l/69.2%
associate-*r*69.2%
*-commutative69.2%
*-commutative69.2%
swap-sqr69.2%
metadata-eval69.2%
unpow269.2%
associate-*r/69.2%
*-commutative69.2%
associate-/l*68.3%
Simplified68.3%
if -6.5000000000000002e-297 < d Initial program 62.3%
Simplified62.4%
sqrt-div69.2%
Applied egg-rr69.2%
pow169.2%
Applied egg-rr79.1%
unpow179.1%
associate-/l*79.1%
Simplified79.1%
Final simplification74.8%
(FPCore (d h l M D)
:precision binary64
(if (<= d -3.6e+214)
(* (- d) (sqrt (/ (/ 1.0 h) l)))
(if (<= d -6.5e-297)
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(+ 1.0 (* (/ h l) (* -0.5 (pow (/ (/ (* M D) 2.0) d) 2.0))))))
(*
(/ d (* (sqrt l) (sqrt h)))
(+ 1.0 (* -0.5 (* (/ h l) (pow (* D (/ M (* d 2.0))) 2.0))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -3.6e+214) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (d <= -6.5e-297) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * pow((((M * D) / 2.0) / d), 2.0)))));
} else {
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + (-0.5 * ((h / l) * pow((D * (M / (d * 2.0))), 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.6d+214)) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else if (d <= (-6.5d-297)) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + ((h / l) * ((-0.5d0) * ((((m * d_1) / 2.0d0) / d) ** 2.0d0)))))
else
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0d0 + ((-0.5d0) * ((h / l) * ((d_1 * (m / (d * 2.0d0))) ** 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.6e+214) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else if (d <= -6.5e-297) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * Math.pow((((M * D) / 2.0) / d), 2.0)))));
} else {
tmp = (d / (Math.sqrt(l) * Math.sqrt(h))) * (1.0 + (-0.5 * ((h / l) * Math.pow((D * (M / (d * 2.0))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -3.6e+214: tmp = -d * math.sqrt(((1.0 / h) / l)) elif d <= -6.5e-297: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * math.pow((((M * D) / 2.0) / d), 2.0))))) else: tmp = (d / (math.sqrt(l) * math.sqrt(h))) * (1.0 + (-0.5 * ((h / l) * math.pow((D * (M / (d * 2.0))), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -3.6e+214) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (d <= -6.5e-297) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(Float64(M * D) / 2.0) / d) ^ 2.0)))))); else tmp = Float64(Float64(d / Float64(sqrt(l) * sqrt(h))) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -3.6e+214) tmp = -d * sqrt(((1.0 / h) / l)); elseif (d <= -6.5e-297) tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * ((((M * D) / 2.0) / d) ^ 2.0))))); else tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + (-0.5 * ((h / l) * ((D * (M / (d * 2.0))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -3.6e+214], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -6.5e-297], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(N[(N[(M * D), $MachinePrecision] / 2.0), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -3.6 \cdot 10^{+214}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;d \leq -6.5 \cdot 10^{-297}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{\frac{M \cdot D}{2}}{d}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if d < -3.6000000000000001e214Initial program 60.5%
Simplified61.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt86.9%
neg-mul-186.9%
Simplified86.9%
if -3.6000000000000001e214 < d < -6.5000000000000002e-297Initial program 67.4%
Simplified66.4%
associate-*r/67.4%
*-un-lft-identity67.4%
times-frac66.4%
associate-/l/66.4%
*-commutative66.4%
times-frac67.4%
*-commutative67.4%
*-un-lft-identity67.4%
associate-/r*67.4%
Applied egg-rr67.4%
if -6.5000000000000002e-297 < d Initial program 62.3%
Simplified62.4%
sqrt-div69.2%
Applied egg-rr69.2%
pow169.2%
Applied egg-rr79.1%
unpow179.1%
associate-/l*79.1%
Simplified79.1%
Final simplification74.4%
(FPCore (d h l M D)
:precision binary64
(if (<= d -3.2e+214)
(* (- d) (sqrt (/ (/ 1.0 h) l)))
(if (<= d -6.5e-297)
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(+ 1.0 (* (/ h l) (* -0.5 (pow (* D (/ (/ M 2.0) d)) 2.0))))))
(*
(/ d (* (sqrt l) (sqrt h)))
(+ 1.0 (* -0.5 (* (/ h l) (pow (* D (/ M (* d 2.0))) 2.0))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -3.2e+214) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (d <= -6.5e-297) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * pow((D * ((M / 2.0) / d)), 2.0)))));
} else {
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + (-0.5 * ((h / l) * pow((D * (M / (d * 2.0))), 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+214)) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else if (d <= (-6.5d-297)) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + ((h / l) * ((-0.5d0) * ((d_1 * ((m / 2.0d0) / d)) ** 2.0d0)))))
else
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0d0 + ((-0.5d0) * ((h / l) * ((d_1 * (m / (d * 2.0d0))) ** 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+214) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else if (d <= -6.5e-297) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * Math.pow((D * ((M / 2.0) / d)), 2.0)))));
} else {
tmp = (d / (Math.sqrt(l) * Math.sqrt(h))) * (1.0 + (-0.5 * ((h / l) * Math.pow((D * (M / (d * 2.0))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -3.2e+214: tmp = -d * math.sqrt(((1.0 / h) / l)) elif d <= -6.5e-297: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * math.pow((D * ((M / 2.0) / d)), 2.0))))) else: tmp = (d / (math.sqrt(l) * math.sqrt(h))) * (1.0 + (-0.5 * ((h / l) * math.pow((D * (M / (d * 2.0))), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -3.2e+214) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (d <= -6.5e-297) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0)))))); else tmp = Float64(Float64(d / Float64(sqrt(l) * sqrt(h))) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -3.2e+214) tmp = -d * sqrt(((1.0 / h) / l)); elseif (d <= -6.5e-297) tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * ((D * ((M / 2.0) / d)) ^ 2.0))))); else tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + (-0.5 * ((h / l) * ((D * (M / (d * 2.0))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -3.2e+214], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -6.5e-297], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -3.2 \cdot 10^{+214}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;d \leq -6.5 \cdot 10^{-297}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if d < -3.19999999999999995e214Initial program 60.5%
Simplified61.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt86.9%
neg-mul-186.9%
Simplified86.9%
if -3.19999999999999995e214 < d < -6.5000000000000002e-297Initial program 67.4%
Simplified66.4%
if -6.5000000000000002e-297 < d Initial program 62.3%
Simplified62.4%
sqrt-div69.2%
Applied egg-rr69.2%
pow169.2%
Applied egg-rr79.1%
unpow179.1%
associate-/l*79.1%
Simplified79.1%
Final simplification74.0%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.85e-150)
(* (- d) (sqrt (/ (/ 1.0 h) l)))
(if (<= l -5e-310)
(*
(sqrt (/ d h))
(* (sqrt (/ d l)) (* -0.125 (* (/ h l) (pow (* D (/ M d)) 2.0)))))
(*
(/ d (* (sqrt l) (sqrt h)))
(+ 1.0 (* -0.5 (* (/ h l) (pow (* D (/ M (* d 2.0))) 2.0))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.85e-150) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (l <= -5e-310) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (-0.125 * ((h / l) * pow((D * (M / d)), 2.0))));
} else {
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + (-0.5 * ((h / l) * pow((D * (M / (d * 2.0))), 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 (l <= (-1.85d-150)) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else if (l <= (-5d-310)) then
tmp = sqrt((d / h)) * (sqrt((d / l)) * ((-0.125d0) * ((h / l) * ((d_1 * (m / d)) ** 2.0d0))))
else
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0d0 + ((-0.5d0) * ((h / l) * ((d_1 * (m / (d * 2.0d0))) ** 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 (l <= -1.85e-150) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else if (l <= -5e-310) {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (-0.125 * ((h / l) * Math.pow((D * (M / d)), 2.0))));
} else {
tmp = (d / (Math.sqrt(l) * Math.sqrt(h))) * (1.0 + (-0.5 * ((h / l) * Math.pow((D * (M / (d * 2.0))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.85e-150: tmp = -d * math.sqrt(((1.0 / h) / l)) elif l <= -5e-310: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (-0.125 * ((h / l) * math.pow((D * (M / d)), 2.0)))) else: tmp = (d / (math.sqrt(l) * math.sqrt(h))) * (1.0 + (-0.5 * ((h / l) * math.pow((D * (M / (d * 2.0))), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.85e-150) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (l <= -5e-310) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(-0.125 * Float64(Float64(h / l) * (Float64(D * Float64(M / d)) ^ 2.0))))); else tmp = Float64(Float64(d / Float64(sqrt(l) * sqrt(h))) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.85e-150) tmp = -d * sqrt(((1.0 / h) / l)); elseif (l <= -5e-310) tmp = sqrt((d / h)) * (sqrt((d / l)) * (-0.125 * ((h / l) * ((D * (M / d)) ^ 2.0)))); else tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + (-0.5 * ((h / l) * ((D * (M / (d * 2.0))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.85e-150], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(-0.125 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.85 \cdot 10^{-150}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if l < -1.85e-150Initial program 59.2%
Simplified59.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt51.7%
neg-mul-151.7%
Simplified51.7%
if -1.85e-150 < l < -4.999999999999985e-310Initial program 83.0%
Simplified82.9%
Taylor expanded in M around inf 46.0%
associate-*r*48.7%
times-frac51.7%
*-commutative51.7%
associate-/l*48.8%
unpow248.8%
unpow248.8%
unpow248.8%
times-frac54.4%
swap-sqr63.2%
unpow263.2%
associate-*r/63.2%
*-commutative63.2%
associate-/l*63.1%
Simplified63.1%
if -4.999999999999985e-310 < l Initial program 63.4%
Simplified63.4%
sqrt-div70.4%
Applied egg-rr70.4%
pow170.4%
Applied egg-rr80.4%
unpow180.4%
associate-/l*80.4%
Simplified80.4%
Final simplification67.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))) (t_1 (sqrt (/ d h))))
(if (<= M 1.8e-63)
(* t_0 t_1)
(* t_1 (* t_0 (* -0.125 (* (/ h l) (pow (* D (/ M d)) 2.0))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = sqrt((d / h));
double tmp;
if (M <= 1.8e-63) {
tmp = t_0 * t_1;
} else {
tmp = t_1 * (t_0 * (-0.125 * ((h / l) * pow((D * (M / d)), 2.0))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((d / l))
t_1 = sqrt((d / h))
if (m <= 1.8d-63) then
tmp = t_0 * t_1
else
tmp = t_1 * (t_0 * ((-0.125d0) * ((h / l) * ((d_1 * (m / d)) ** 2.0d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double t_1 = Math.sqrt((d / h));
double tmp;
if (M <= 1.8e-63) {
tmp = t_0 * t_1;
} else {
tmp = t_1 * (t_0 * (-0.125 * ((h / l) * Math.pow((D * (M / d)), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = math.sqrt((d / h)) tmp = 0 if M <= 1.8e-63: tmp = t_0 * t_1 else: tmp = t_1 * (t_0 * (-0.125 * ((h / l) * math.pow((D * (M / d)), 2.0)))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = sqrt(Float64(d / h)) tmp = 0.0 if (M <= 1.8e-63) tmp = Float64(t_0 * t_1); else tmp = Float64(t_1 * Float64(t_0 * Float64(-0.125 * Float64(Float64(h / l) * (Float64(D * Float64(M / d)) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = sqrt((d / h)); tmp = 0.0; if (M <= 1.8e-63) tmp = t_0 * t_1; else tmp = t_1 * (t_0 * (-0.125 * ((h / l) * ((D * (M / 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]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M, 1.8e-63], N[(t$95$0 * t$95$1), $MachinePrecision], N[(t$95$1 * N[(t$95$0 * N[(-0.125 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;M \leq 1.8 \cdot 10^{-63}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(t\_0 \cdot \left(-0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if M < 1.80000000000000004e-63Initial program 64.5%
Simplified64.5%
Taylor expanded in M around 0 41.3%
if 1.80000000000000004e-63 < M Initial program 64.4%
Simplified64.3%
Taylor expanded in M around inf 26.4%
associate-*r*26.4%
times-frac25.2%
*-commutative25.2%
associate-/l*23.9%
unpow223.9%
unpow223.9%
unpow223.9%
times-frac38.2%
swap-sqr42.2%
unpow242.2%
associate-*r/42.2%
*-commutative42.2%
associate-/l*41.0%
Simplified41.0%
Final simplification41.2%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.1e-149)
(* (- d) (sqrt (/ (/ 1.0 h) l)))
(if (<= l -5e-310)
(* d (sqrt (log (exp (/ 1.0 (* l h))))))
(* d (/ (pow h -0.5) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.1e-149) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (l <= -5e-310) {
tmp = d * sqrt(log(exp((1.0 / (l * h)))));
} 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 (l <= (-1.1d-149)) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else if (l <= (-5d-310)) then
tmp = d * sqrt(log(exp((1.0d0 / (l * h)))))
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 (l <= -1.1e-149) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else if (l <= -5e-310) {
tmp = d * Math.sqrt(Math.log(Math.exp((1.0 / (l * h)))));
} else {
tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.1e-149: tmp = -d * math.sqrt(((1.0 / h) / l)) elif l <= -5e-310: tmp = d * math.sqrt(math.log(math.exp((1.0 / (l * h))))) else: tmp = d * (math.pow(h, -0.5) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.1e-149) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (l <= -5e-310) tmp = Float64(d * sqrt(log(exp(Float64(1.0 / Float64(l * h)))))); 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 (l <= -1.1e-149) tmp = -d * sqrt(((1.0 / h) / l)); elseif (l <= -5e-310) tmp = d * sqrt(log(exp((1.0 / (l * h))))); else tmp = d * ((h ^ -0.5) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.1e-149], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[Sqrt[N[Log[N[Exp[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.1 \cdot 10^{-149}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\log \left(e^{\frac{1}{\ell \cdot h}}\right)}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.0999999999999999e-149Initial program 59.2%
Simplified59.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt51.7%
neg-mul-151.7%
Simplified51.7%
if -1.0999999999999999e-149 < l < -4.999999999999985e-310Initial program 83.0%
Simplified82.9%
Taylor expanded in d around inf 33.1%
associate-/r*33.1%
Simplified33.1%
add-log-exp55.5%
associate-/l/55.5%
Applied egg-rr55.5%
if -4.999999999999985e-310 < l Initial program 63.4%
Simplified63.4%
Taylor expanded in d around inf 38.6%
associate-/r*39.3%
Simplified39.3%
*-un-lft-identity39.3%
sqrt-div47.8%
inv-pow47.8%
sqrt-pow147.8%
metadata-eval47.8%
Applied egg-rr47.8%
*-lft-identity47.8%
Simplified47.8%
Final simplification50.3%
(FPCore (d h l M D)
:precision binary64
(if (<= l -3.7e-274)
(* (- d) (sqrt (/ (/ 1.0 h) l)))
(if (<= l -5e-310)
(* d (cbrt (pow (/ 1.0 (* l h)) 1.5)))
(* d (/ (pow h -0.5) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.7e-274) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (l <= -5e-310) {
tmp = d * cbrt(pow((1.0 / (l * h)), 1.5));
} else {
tmp = d * (pow(h, -0.5) / sqrt(l));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.7e-274) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else if (l <= -5e-310) {
tmp = d * Math.cbrt(Math.pow((1.0 / (l * h)), 1.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 (l <= -3.7e-274) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (l <= -5e-310) tmp = Float64(d * cbrt((Float64(1.0 / Float64(l * h)) ^ 1.5))); else tmp = Float64(d * Float64((h ^ -0.5) / sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -3.7e-274], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[Power[N[Power[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $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}\;\ell \leq -3.7 \cdot 10^{-274}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(\frac{1}{\ell \cdot h}\right)}^{1.5}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -3.69999999999999984e-274Initial program 63.0%
Simplified63.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt45.1%
neg-mul-145.1%
Simplified45.1%
if -3.69999999999999984e-274 < l < -4.999999999999985e-310Initial program 100.0%
Simplified100.0%
Taylor expanded in d around inf 78.2%
associate-/r*78.2%
Simplified78.2%
add-cbrt-cube78.2%
pow1/378.2%
add-sqr-sqrt78.2%
pow178.2%
pow1/278.2%
metadata-eval78.2%
pow-prod-up78.2%
associate-/l/78.2%
metadata-eval78.2%
metadata-eval78.2%
Applied egg-rr78.2%
unpow1/378.2%
Simplified78.2%
if -4.999999999999985e-310 < l Initial program 63.4%
Simplified63.4%
Taylor expanded in d around inf 38.6%
associate-/r*39.3%
Simplified39.3%
*-un-lft-identity39.3%
sqrt-div47.8%
inv-pow47.8%
sqrt-pow147.8%
metadata-eval47.8%
Applied egg-rr47.8%
*-lft-identity47.8%
Simplified47.8%
Final simplification47.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.15e-274)
(* (- d) (sqrt (/ (/ 1.0 h) l)))
(if (<= l 8.6e-308)
(* 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 (l <= -1.15e-274) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (l <= 8.6e-308) {
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 (l <= (-1.15d-274)) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else if (l <= 8.6d-308) 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 (l <= -1.15e-274) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else if (l <= 8.6e-308) {
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 l <= -1.15e-274: tmp = -d * math.sqrt(((1.0 / h) / l)) elif l <= 8.6e-308: 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 (l <= -1.15e-274) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (l <= 8.6e-308) 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 (l <= -1.15e-274) tmp = -d * sqrt(((1.0 / h) / l)); elseif (l <= 8.6e-308) 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[l, -1.15e-274], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 8.6e-308], 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}\;\ell \leq -1.15 \cdot 10^{-274}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;\ell \leq 8.6 \cdot 10^{-308}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.14999999999999998e-274Initial program 63.0%
Simplified63.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt45.1%
neg-mul-145.1%
Simplified45.1%
if -1.14999999999999998e-274 < l < 8.60000000000000041e-308Initial program 90.0%
Simplified90.0%
Taylor expanded in d around inf 70.4%
associate-/r*70.4%
Simplified70.4%
Taylor expanded in h around 0 70.4%
*-commutative70.4%
unpow1/270.4%
rem-exp-log70.4%
exp-neg70.4%
exp-prod70.4%
distribute-lft-neg-out70.4%
distribute-rgt-neg-in70.4%
metadata-eval70.4%
exp-to-pow70.4%
Simplified70.4%
if 8.60000000000000041e-308 < l Initial program 63.9%
Simplified63.9%
Taylor expanded in d around inf 38.9%
associate-/r*39.6%
Simplified39.6%
*-un-lft-identity39.6%
sqrt-div48.2%
inv-pow48.2%
sqrt-pow148.2%
metadata-eval48.2%
Applied egg-rr48.2%
*-lft-identity48.2%
Simplified48.2%
Final simplification47.6%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (sqrt (/ (/ 1.0 h) l)))) (if (<= l -1.25e-274) (* (- 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 <= -1.25e-274) {
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 <= (-1.25d-274)) 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 <= -1.25e-274) {
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 <= -1.25e-274: 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 <= -1.25e-274) tmp = Float64(Float64(-d) * 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 <= -1.25e-274) 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, -1.25e-274], 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 -1.25 \cdot 10^{-274}:\\
\;\;\;\;\left(-d\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot t\_0\\
\end{array}
\end{array}
if l < -1.25e-274Initial program 63.0%
Simplified63.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt45.1%
neg-mul-145.1%
Simplified45.1%
if -1.25e-274 < l Initial program 65.9%
Simplified65.9%
Taylor expanded in d around inf 41.3%
associate-/r*41.9%
Simplified41.9%
Final simplification43.5%
(FPCore (d h l M D) :precision binary64 (if (<= l -1.52e-274) (* (- d) (sqrt (/ 1.0 (* l h)))) (* d (sqrt (/ (/ 1.0 h) l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.52e-274) {
tmp = -d * sqrt((1.0 / (l * h)));
} 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.52d-274)) then
tmp = -d * sqrt((1.0d0 / (l * h)))
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.52e-274) {
tmp = -d * Math.sqrt((1.0 / (l * h)));
} else {
tmp = d * Math.sqrt(((1.0 / h) / l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.52e-274: tmp = -d * math.sqrt((1.0 / (l * h))) else: tmp = d * math.sqrt(((1.0 / h) / l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.52e-274) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); 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.52e-274) tmp = -d * sqrt((1.0 / (l * h))); else tmp = d * sqrt(((1.0 / h) / l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.52e-274], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $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.52 \cdot 10^{-274}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\end{array}
\end{array}
if l < -1.51999999999999989e-274Initial program 63.0%
Simplified63.0%
Taylor expanded in d around inf 7.1%
associate-/r*7.1%
Simplified7.1%
Taylor expanded in h around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt44.2%
neg-mul-144.2%
Simplified44.2%
if -1.51999999999999989e-274 < l Initial program 65.9%
Simplified65.9%
Taylor expanded in d around inf 41.3%
associate-/r*41.9%
Simplified41.9%
Final simplification43.0%
(FPCore (d h l M D) :precision binary64 (if (<= l -1.35e-274) (* (- d) (pow (* l h) -0.5)) (* d (sqrt (/ (/ 1.0 h) l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.35e-274) {
tmp = -d * pow((l * h), -0.5);
} else {
tmp = d * sqrt(((1.0 / h) / l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1.35d-274)) then
tmp = -d * ((l * h) ** (-0.5d0))
else
tmp = d * sqrt(((1.0d0 / h) / l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.35e-274) {
tmp = -d * Math.pow((l * h), -0.5);
} else {
tmp = d * Math.sqrt(((1.0 / h) / l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.35e-274: tmp = -d * math.pow((l * h), -0.5) else: tmp = d * math.sqrt(((1.0 / h) / l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.35e-274) tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.35e-274) tmp = -d * ((l * h) ^ -0.5); else tmp = d * sqrt(((1.0 / h) / l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.35e-274], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.35 \cdot 10^{-274}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\end{array}
\end{array}
if l < -1.35e-274Initial program 63.0%
Simplified63.0%
Taylor expanded in d around inf 7.1%
associate-/r*7.1%
Simplified7.1%
Taylor expanded in h around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
unpow1/20.0%
rem-exp-log0.0%
exp-neg0.0%
exp-prod0.0%
distribute-lft-neg-out0.0%
distribute-rgt-neg-in0.0%
metadata-eval0.0%
exp-to-pow0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt44.2%
neg-mul-144.2%
Simplified44.2%
if -1.35e-274 < l Initial program 65.9%
Simplified65.9%
Taylor expanded in d around inf 41.3%
associate-/r*41.9%
Simplified41.9%
Final simplification43.0%
(FPCore (d h l M D) :precision binary64 (* d (sqrt (/ (/ 1.0 h) l))))
double code(double d, double h, double l, double M, double D) {
return d * sqrt(((1.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 * sqrt(((1.0d0 / h) / l))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.sqrt(((1.0 / h) / l));
}
def code(d, h, l, M, D): return d * math.sqrt(((1.0 / h) / l))
function code(d, h, l, M, D) return Float64(d * sqrt(Float64(Float64(1.0 / h) / l))) end
function tmp = code(d, h, l, M, D) tmp = d * sqrt(((1.0 / h) / l)); end
code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}
\end{array}
Initial program 64.5%
Simplified64.5%
Taylor expanded in d around inf 24.7%
associate-/r*25.0%
Simplified25.0%
(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 64.5%
Simplified64.5%
Taylor expanded in d around inf 24.7%
associate-/r*25.0%
Simplified25.0%
Taylor expanded in h around 0 24.7%
*-commutative24.7%
unpow1/224.7%
rem-exp-log23.8%
exp-neg23.8%
exp-prod23.9%
distribute-lft-neg-out23.9%
distribute-rgt-neg-in23.9%
metadata-eval23.9%
exp-to-pow24.8%
Simplified24.8%
herbie shell --seed 2024089
(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)))))