
(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 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5))))
(t_1 (sqrt (- d))))
(if (<= l -2e-311)
(* (/ t_1 (sqrt (- l))) (* (/ t_1 (sqrt (- h))) t_0))
(* (/ (sqrt d) (sqrt l)) (* t_0 (/ (sqrt d) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5));
double t_1 = sqrt(-d);
double tmp;
if (l <= -2e-311) {
tmp = (t_1 / sqrt(-l)) * ((t_1 / sqrt(-h)) * t_0);
} else {
tmp = (sqrt(d) / sqrt(l)) * (t_0 * (sqrt(d) / 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 + ((h / l) * (((d_1 * ((m / 2.0d0) / d)) ** 2.0d0) * (-0.5d0)))
t_1 = sqrt(-d)
if (l <= (-2d-311)) then
tmp = (t_1 / sqrt(-l)) * ((t_1 / sqrt(-h)) * t_0)
else
tmp = (sqrt(d) / sqrt(l)) * (t_0 * (sqrt(d) / sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((h / l) * (Math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5));
double t_1 = Math.sqrt(-d);
double tmp;
if (l <= -2e-311) {
tmp = (t_1 / Math.sqrt(-l)) * ((t_1 / Math.sqrt(-h)) * t_0);
} else {
tmp = (Math.sqrt(d) / Math.sqrt(l)) * (t_0 * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 + ((h / l) * (math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5)) t_1 = math.sqrt(-d) tmp = 0 if l <= -2e-311: tmp = (t_1 / math.sqrt(-l)) * ((t_1 / math.sqrt(-h)) * t_0) else: tmp = (math.sqrt(d) / math.sqrt(l)) * (t_0 * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))) t_1 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -2e-311) tmp = Float64(Float64(t_1 / sqrt(Float64(-l))) * Float64(Float64(t_1 / sqrt(Float64(-h))) * t_0)); else tmp = Float64(Float64(sqrt(d) / sqrt(l)) * Float64(t_0 * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 + ((h / l) * (((D * ((M / 2.0) / d)) ^ 2.0) * -0.5)); t_1 = sqrt(-d); tmp = 0.0; if (l <= -2e-311) tmp = (t_1 / sqrt(-l)) * ((t_1 / sqrt(-h)) * t_0); else tmp = (sqrt(d) / sqrt(l)) * (t_0 * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -2e-311], N[(N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\\
t_1 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-311}:\\
\;\;\;\;\frac{t\_1}{\sqrt{-\ell}} \cdot \left(\frac{t\_1}{\sqrt{-h}} \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(t\_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if l < -1.9999999999999e-311Initial program 68.6%
Simplified68.6%
frac-2neg68.6%
sqrt-div76.6%
Applied egg-rr76.6%
frac-2neg76.6%
sqrt-div82.9%
Applied egg-rr82.9%
if -1.9999999999999e-311 < l Initial program 63.4%
Simplified65.0%
sqrt-div70.4%
Applied egg-rr70.4%
sqrt-div80.2%
Applied egg-rr80.2%
Final simplification81.6%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* D M) (* d 2.0)) 2.0)))))
2e+274)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* 0.5 (pow (* (* (/ D d) (* M 0.5)) (sqrt (/ h l))) 2.0))))
(* d (- (pow (* l h) -0.5)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((D * M) / (d * 2.0)), 2.0))))) <= 2e+274) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * pow((((D / d) * (M * 0.5)) * sqrt((h / l))), 2.0)));
} else {
tmp = d * -pow((l * h), -0.5);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((d_1 * m) / (d * 2.0d0)) ** 2.0d0))))) <= 2d+274) then
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0d0 - (0.5d0 * ((((d_1 / d) * (m * 0.5d0)) * sqrt((h / l))) ** 2.0d0)))
else
tmp = d * -((l * h) ** (-0.5d0))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * Math.pow(((D * M) / (d * 2.0)), 2.0))))) <= 2e+274) {
tmp = (Math.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - (0.5 * Math.pow((((D / d) * (M * 0.5)) * Math.sqrt((h / l))), 2.0)));
} else {
tmp = d * -Math.pow((l * h), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if ((math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * math.pow(((D * M) / (d * 2.0)), 2.0))))) <= 2e+274: tmp = (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - (0.5 * math.pow((((D / d) * (M * 0.5)) * math.sqrt((h / l))), 2.0))) else: tmp = d * -math.pow((l * h), -0.5) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0))))) <= 2e+274) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * (Float64(Float64(Float64(D / d) * Float64(M * 0.5)) * sqrt(Float64(h / l))) ^ 2.0)))); else tmp = Float64(d * Float64(-(Float64(l * h) ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((D * M) / (d * 2.0)) ^ 2.0))))) <= 2e+274) tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * ((((D / d) * (M * 0.5)) * sqrt((h / l))) ^ 2.0))); else tmp = d * -((l * h) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+274], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[Power[N[(N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * (-N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right) \leq 2 \cdot 10^{+274}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.99999999999999984e274Initial program 88.9%
Simplified89.4%
add-sqr-sqrt89.4%
pow289.4%
sqrt-prod89.4%
sqrt-pow192.5%
metadata-eval92.5%
pow192.5%
*-commutative92.5%
div-inv92.5%
metadata-eval92.5%
Applied egg-rr92.5%
if 1.99999999999999984e274 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 13.2%
metadata-eval13.2%
associate-*l*13.2%
frac-times13.2%
add-sqr-sqrt13.2%
pow213.2%
Applied egg-rr16.6%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt29.4%
neg-mul-129.4%
unpow-129.4%
metadata-eval29.4%
pow-sqr29.4%
rem-sqrt-square29.4%
rem-square-sqrt29.3%
fabs-sqr29.3%
rem-square-sqrt29.4%
Simplified29.4%
Final simplification73.5%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* D M) (* d 2.0)) 2.0)))))
2e+274)
(*
(sqrt (/ d l))
(*
(+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5)))
(sqrt (/ d h))))
(* d (- (pow (* l h) -0.5)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((D * M) / (d * 2.0)), 2.0))))) <= 2e+274) {
tmp = sqrt((d / l)) * ((1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * sqrt((d / h)));
} else {
tmp = d * -pow((l * h), -0.5);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((d_1 * m) / (d * 2.0d0)) ** 2.0d0))))) <= 2d+274) then
tmp = sqrt((d / l)) * ((1.0d0 + ((h / l) * (((d_1 * ((m / 2.0d0) / d)) ** 2.0d0) * (-0.5d0)))) * sqrt((d / h)))
else
tmp = d * -((l * h) ** (-0.5d0))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * Math.pow(((D * M) / (d * 2.0)), 2.0))))) <= 2e+274) {
tmp = Math.sqrt((d / l)) * ((1.0 + ((h / l) * (Math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * Math.sqrt((d / h)));
} else {
tmp = d * -Math.pow((l * h), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if ((math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * math.pow(((D * M) / (d * 2.0)), 2.0))))) <= 2e+274: tmp = math.sqrt((d / l)) * ((1.0 + ((h / l) * (math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * math.sqrt((d / h))) else: tmp = d * -math.pow((l * h), -0.5) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0))))) <= 2e+274) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))) * sqrt(Float64(d / h)))); else tmp = Float64(d * Float64(-(Float64(l * h) ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((D * M) / (d * 2.0)) ^ 2.0))))) <= 2e+274) tmp = sqrt((d / l)) * ((1.0 + ((h / l) * (((D * ((M / 2.0) / d)) ^ 2.0) * -0.5))) * sqrt((d / h))); else tmp = d * -((l * h) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+274], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * (-N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right) \leq 2 \cdot 10^{+274}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right) \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.99999999999999984e274Initial program 88.9%
Simplified90.0%
if 1.99999999999999984e274 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 13.2%
metadata-eval13.2%
associate-*l*13.2%
frac-times13.2%
add-sqr-sqrt13.2%
pow213.2%
Applied egg-rr16.6%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt29.4%
neg-mul-129.4%
unpow-129.4%
metadata-eval29.4%
pow-sqr29.4%
rem-sqrt-square29.4%
rem-square-sqrt29.3%
fabs-sqr29.3%
rem-square-sqrt29.4%
Simplified29.4%
Final simplification71.8%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2e-311)
(*
(/ (sqrt (- d)) (sqrt (- l)))
(*
(sqrt (/ d h))
(+ 1.0 (/ (* (* h -0.5) (pow (* D (/ M (* d 2.0))) 2.0)) l))))
(*
(/ (sqrt d) (sqrt l))
(*
(+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5)))
(/ (sqrt d) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-311) {
tmp = (sqrt(-d) / sqrt(-l)) * (sqrt((d / h)) * (1.0 + (((h * -0.5) * pow((D * (M / (d * 2.0))), 2.0)) / l)));
} else {
tmp = (sqrt(d) / sqrt(l)) * ((1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (sqrt(d) / 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 <= (-2d-311)) then
tmp = (sqrt(-d) / sqrt(-l)) * (sqrt((d / h)) * (1.0d0 + (((h * (-0.5d0)) * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l)))
else
tmp = (sqrt(d) / sqrt(l)) * ((1.0d0 + ((h / l) * (((d_1 * ((m / 2.0d0) / d)) ** 2.0d0) * (-0.5d0)))) * (sqrt(d) / 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 <= -2e-311) {
tmp = (Math.sqrt(-d) / Math.sqrt(-l)) * (Math.sqrt((d / h)) * (1.0 + (((h * -0.5) * Math.pow((D * (M / (d * 2.0))), 2.0)) / l)));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(l)) * ((1.0 + ((h / l) * (Math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2e-311: tmp = (math.sqrt(-d) / math.sqrt(-l)) * (math.sqrt((d / h)) * (1.0 + (((h * -0.5) * math.pow((D * (M / (d * 2.0))), 2.0)) / l))) else: tmp = (math.sqrt(d) / math.sqrt(l)) * ((1.0 + ((h / l) * (math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2e-311) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(Float64(h * -0.5) * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l)))); else tmp = Float64(Float64(sqrt(d) / sqrt(l)) * Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))) * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -2e-311) tmp = (sqrt(-d) / sqrt(-l)) * (sqrt((d / h)) * (1.0 + (((h * -0.5) * ((D * (M / (d * 2.0))) ^ 2.0)) / l))); else tmp = (sqrt(d) / sqrt(l)) * ((1.0 + ((h / l) * (((D * ((M / 2.0) / d)) ^ 2.0) * -0.5))) * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2e-311], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(N[(h * -0.5), $MachinePrecision] * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-311}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{\left(h \cdot -0.5\right) \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if l < -1.9999999999999e-311Initial program 68.6%
Simplified68.6%
frac-2neg76.6%
sqrt-div82.9%
Applied egg-rr73.5%
associate-*l/79.5%
*-commutative79.5%
associate-/l/79.5%
Applied egg-rr79.5%
associate-*r*79.5%
*-commutative79.5%
Simplified79.5%
if -1.9999999999999e-311 < l Initial program 63.4%
Simplified65.0%
sqrt-div70.4%
Applied egg-rr70.4%
sqrt-div80.2%
Applied egg-rr80.2%
Final simplification79.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(sqrt (/ d h))
(+ 1.0 (/ (* (* h -0.5) (pow (* D (/ M (* d 2.0))) 2.0)) l)))))
(if (<= l -2e-311)
(* (/ (sqrt (- d)) (sqrt (- l))) t_0)
(* (/ (sqrt d) (sqrt l)) t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h)) * (1.0 + (((h * -0.5) * pow((D * (M / (d * 2.0))), 2.0)) / l));
double tmp;
if (l <= -2e-311) {
tmp = (sqrt(-d) / sqrt(-l)) * t_0;
} else {
tmp = (sqrt(d) / sqrt(l)) * t_0;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((d / h)) * (1.0d0 + (((h * (-0.5d0)) * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l))
if (l <= (-2d-311)) then
tmp = (sqrt(-d) / sqrt(-l)) * t_0
else
tmp = (sqrt(d) / sqrt(l)) * t_0
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h)) * (1.0 + (((h * -0.5) * Math.pow((D * (M / (d * 2.0))), 2.0)) / l));
double tmp;
if (l <= -2e-311) {
tmp = (Math.sqrt(-d) / Math.sqrt(-l)) * t_0;
} else {
tmp = (Math.sqrt(d) / Math.sqrt(l)) * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) * (1.0 + (((h * -0.5) * math.pow((D * (M / (d * 2.0))), 2.0)) / l)) tmp = 0 if l <= -2e-311: tmp = (math.sqrt(-d) / math.sqrt(-l)) * t_0 else: tmp = (math.sqrt(d) / math.sqrt(l)) * t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(Float64(h * -0.5) * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) tmp = 0.0 if (l <= -2e-311) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * t_0); else tmp = Float64(Float64(sqrt(d) / sqrt(l)) * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)) * (1.0 + (((h * -0.5) * ((D * (M / (d * 2.0))) ^ 2.0)) / l)); tmp = 0.0; if (l <= -2e-311) tmp = (sqrt(-d) / sqrt(-l)) * t_0; else tmp = (sqrt(d) / sqrt(l)) * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(N[(h * -0.5), $MachinePrecision] * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2e-311], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}} \cdot \left(1 + \frac{\left(h \cdot -0.5\right) \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right)\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-311}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot t\_0\\
\end{array}
\end{array}
if l < -1.9999999999999e-311Initial program 68.6%
Simplified68.6%
frac-2neg76.6%
sqrt-div82.9%
Applied egg-rr73.5%
associate-*l/79.5%
*-commutative79.5%
associate-/l/79.5%
Applied egg-rr79.5%
associate-*r*79.5%
*-commutative79.5%
Simplified79.5%
if -1.9999999999999e-311 < l Initial program 63.4%
Simplified65.0%
sqrt-div70.4%
Applied egg-rr70.4%
associate-*l/0.0%
*-commutative0.0%
associate-/l/0.0%
Applied egg-rr75.4%
associate-*r*0.0%
*-commutative0.0%
Simplified75.4%
Final simplification77.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h))))
(if (<= l -2e-311)
(*
(* (/ (sqrt (- d)) (sqrt (- l))) t_0)
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* M 0.5)) 2.0)) l))))
(*
(/ (sqrt d) (sqrt l))
(* t_0 (+ 1.0 (/ (* (* h -0.5) (pow (* D (/ M (* d 2.0))) 2.0)) l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double tmp;
if (l <= -2e-311) {
tmp = ((sqrt(-d) / sqrt(-l)) * t_0) * (1.0 - (0.5 * ((h * pow(((D / d) * (M * 0.5)), 2.0)) / l)));
} else {
tmp = (sqrt(d) / sqrt(l)) * (t_0 * (1.0 + (((h * -0.5) * pow((D * (M / (d * 2.0))), 2.0)) / l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((d / h))
if (l <= (-2d-311)) then
tmp = ((sqrt(-d) / sqrt(-l)) * t_0) * (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (m * 0.5d0)) ** 2.0d0)) / l)))
else
tmp = (sqrt(d) / sqrt(l)) * (t_0 * (1.0d0 + (((h * (-0.5d0)) * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h));
double tmp;
if (l <= -2e-311) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-l)) * t_0) * (1.0 - (0.5 * ((h * Math.pow(((D / d) * (M * 0.5)), 2.0)) / l)));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(l)) * (t_0 * (1.0 + (((h * -0.5) * Math.pow((D * (M / (d * 2.0))), 2.0)) / l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) tmp = 0 if l <= -2e-311: tmp = ((math.sqrt(-d) / math.sqrt(-l)) * t_0) * (1.0 - (0.5 * ((h * math.pow(((D / d) * (M * 0.5)), 2.0)) / l))) else: tmp = (math.sqrt(d) / math.sqrt(l)) * (t_0 * (1.0 + (((h * -0.5) * math.pow((D * (M / (d * 2.0))), 2.0)) / l))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) tmp = 0.0 if (l <= -2e-311) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * t_0) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0)) / l)))); else tmp = Float64(Float64(sqrt(d) / sqrt(l)) * Float64(t_0 * Float64(1.0 + Float64(Float64(Float64(h * -0.5) * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)); tmp = 0.0; if (l <= -2e-311) tmp = ((sqrt(-d) / sqrt(-l)) * t_0) * (1.0 - (0.5 * ((h * (((D / d) * (M * 0.5)) ^ 2.0)) / l))); else tmp = (sqrt(d) / sqrt(l)) * (t_0 * (1.0 + (((h * -0.5) * ((D * (M / (d * 2.0))) ^ 2.0)) / l))); 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, -2e-311], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.0 + N[(N[(N[(h * -0.5), $MachinePrecision] * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-311}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot t\_0\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(t\_0 \cdot \left(1 + \frac{\left(h \cdot -0.5\right) \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right)\right)\\
\end{array}
\end{array}
if l < -1.9999999999999e-311Initial program 68.6%
Simplified67.9%
associate-*r/70.3%
*-commutative70.3%
div-inv70.3%
metadata-eval70.3%
Applied egg-rr70.3%
frac-2neg76.6%
sqrt-div82.9%
Applied egg-rr78.0%
if -1.9999999999999e-311 < l Initial program 63.4%
Simplified65.0%
sqrt-div70.4%
Applied egg-rr70.4%
associate-*l/0.0%
*-commutative0.0%
associate-/l/0.0%
Applied egg-rr75.4%
associate-*r*0.0%
*-commutative0.0%
Simplified75.4%
Final simplification76.8%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2e-311)
(*
(*
(/ (sqrt (- d)) (sqrt (- h)))
(+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5))))
(sqrt (/ d l)))
(*
(/ (sqrt d) (sqrt l))
(*
(sqrt (/ d h))
(+ 1.0 (/ (* (* h -0.5) (pow (* D (/ M (* d 2.0))) 2.0)) l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-311) {
tmp = ((sqrt(-d) / sqrt(-h)) * (1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5)))) * sqrt((d / l));
} else {
tmp = (sqrt(d) / sqrt(l)) * (sqrt((d / h)) * (1.0 + (((h * -0.5) * pow((D * (M / (d * 2.0))), 2.0)) / l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-2d-311)) then
tmp = ((sqrt(-d) / sqrt(-h)) * (1.0d0 + ((h / l) * (((d_1 * ((m / 2.0d0) / d)) ** 2.0d0) * (-0.5d0))))) * sqrt((d / l))
else
tmp = (sqrt(d) / sqrt(l)) * (sqrt((d / h)) * (1.0d0 + (((h * (-0.5d0)) * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-311) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-h)) * (1.0 + ((h / l) * (Math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5)))) * Math.sqrt((d / l));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(l)) * (Math.sqrt((d / h)) * (1.0 + (((h * -0.5) * Math.pow((D * (M / (d * 2.0))), 2.0)) / l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2e-311: tmp = ((math.sqrt(-d) / math.sqrt(-h)) * (1.0 + ((h / l) * (math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5)))) * math.sqrt((d / l)) else: tmp = (math.sqrt(d) / math.sqrt(l)) * (math.sqrt((d / h)) * (1.0 + (((h * -0.5) * math.pow((D * (M / (d * 2.0))), 2.0)) / l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2e-311) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5)))) * sqrt(Float64(d / l))); else tmp = Float64(Float64(sqrt(d) / sqrt(l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(Float64(h * -0.5) * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -2e-311) tmp = ((sqrt(-d) / sqrt(-h)) * (1.0 + ((h / l) * (((D * ((M / 2.0) / d)) ^ 2.0) * -0.5)))) * sqrt((d / l)); else tmp = (sqrt(d) / sqrt(l)) * (sqrt((d / h)) * (1.0 + (((h * -0.5) * ((D * (M / (d * 2.0))) ^ 2.0)) / l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2e-311], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(N[(h * -0.5), $MachinePrecision] * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-311}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right)\right) \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{\left(h \cdot -0.5\right) \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right)\right)\\
\end{array}
\end{array}
if l < -1.9999999999999e-311Initial program 68.6%
Simplified68.6%
frac-2neg68.6%
sqrt-div76.6%
Applied egg-rr76.6%
if -1.9999999999999e-311 < l Initial program 63.4%
Simplified65.0%
sqrt-div70.4%
Applied egg-rr70.4%
associate-*l/0.0%
*-commutative0.0%
associate-/l/0.0%
Applied egg-rr75.4%
associate-*r*0.0%
*-commutative0.0%
Simplified75.4%
Final simplification76.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= l 2.85e-235)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* M 0.5)) 2.0)) l)))
(* (sqrt (/ d h)) t_0))
(*
(*
(+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5)))
(/ (sqrt d) (sqrt h)))
t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (l <= 2.85e-235) {
tmp = (1.0 - (0.5 * ((h * pow(((D / d) * (M * 0.5)), 2.0)) / l))) * (sqrt((d / h)) * t_0);
} else {
tmp = ((1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (sqrt(d) / sqrt(h))) * t_0;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((d / l))
if (l <= 2.85d-235) then
tmp = (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (m * 0.5d0)) ** 2.0d0)) / l))) * (sqrt((d / h)) * t_0)
else
tmp = ((1.0d0 + ((h / l) * (((d_1 * ((m / 2.0d0) / d)) ** 2.0d0) * (-0.5d0)))) * (sqrt(d) / sqrt(h))) * t_0
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double tmp;
if (l <= 2.85e-235) {
tmp = (1.0 - (0.5 * ((h * Math.pow(((D / d) * (M * 0.5)), 2.0)) / l))) * (Math.sqrt((d / h)) * t_0);
} else {
tmp = ((1.0 + ((h / l) * (Math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (Math.sqrt(d) / Math.sqrt(h))) * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if l <= 2.85e-235: tmp = (1.0 - (0.5 * ((h * math.pow(((D / d) * (M * 0.5)), 2.0)) / l))) * (math.sqrt((d / h)) * t_0) else: tmp = ((1.0 + ((h / l) * (math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (math.sqrt(d) / math.sqrt(h))) * t_0 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= 2.85e-235) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0)) / l))) * Float64(sqrt(Float64(d / h)) * t_0)); else tmp = Float64(Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))) * Float64(sqrt(d) / sqrt(h))) * t_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.85e-235) tmp = (1.0 - (0.5 * ((h * (((D / d) * (M * 0.5)) ^ 2.0)) / l))) * (sqrt((d / h)) * t_0); else tmp = ((1.0 + ((h / l) * (((D * ((M / 2.0) / d)) ^ 2.0) * -0.5))) * (sqrt(d) / sqrt(h))) * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, 2.85e-235], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq 2.85 \cdot 10^{-235}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\ell}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot t\_0\\
\end{array}
\end{array}
if l < 2.85e-235Initial program 68.3%
Simplified67.6%
associate-*r/70.5%
*-commutative70.5%
div-inv70.5%
metadata-eval70.5%
Applied egg-rr70.5%
if 2.85e-235 < l Initial program 63.2%
Simplified65.0%
sqrt-div81.4%
Applied egg-rr74.2%
Final simplification72.1%
(FPCore (d h l M D) :precision binary64 (* (sqrt (/ d h)) (* (sqrt (/ d l)) (- 1.0 (* h (* 0.125 (/ (pow (* M (/ D d)) 2.0) l)))))))
double code(double d, double h, double l, double M, double D) {
return sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (h * (0.125 * (pow((M * (D / d)), 2.0) / 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 = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 - (h * (0.125d0 * (((m * (d_1 / d)) ** 2.0d0) / l)))))
end function
public static double code(double d, double h, double l, double M, double D) {
return Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 - (h * (0.125 * (Math.pow((M * (D / d)), 2.0) / l)))));
}
def code(d, h, l, M, D): return math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 - (h * (0.125 * (math.pow((M * (D / d)), 2.0) / l)))))
function code(d, h, l, M, D) return Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(h * Float64(0.125 * Float64((Float64(M * Float64(D / d)) ^ 2.0) / l)))))) end
function tmp = code(d, h, l, M, D) tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (h * (0.125 * (((M * (D / d)) ^ 2.0) / l))))); end
code[d_, h_, l_, M_, D_] := N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(h * N[(0.125 * N[(N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - h \cdot \left(0.125 \cdot \frac{{\left(M \cdot \frac{D}{d}\right)}^{2}}{\ell}\right)\right)\right)
\end{array}
Initial program 66.2%
Simplified66.5%
Taylor expanded in h around -inf 45.4%
associate-*r*45.4%
neg-mul-145.4%
sub-neg45.4%
distribute-lft-in45.4%
Simplified68.6%
Final simplification68.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2.65e+213)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= l -3.5e-33)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= l 1.9e+132)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* M 0.5)) 2.0)) l)))
(sqrt (* (/ d h) (/ d l))))
(* d (* (pow l -0.5) (pow h -0.5)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.65e+213) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (l <= -3.5e-33) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (l <= 1.9e+132) {
tmp = (1.0 - (0.5 * ((h * pow(((D / d) * (M * 0.5)), 2.0)) / l))) * sqrt(((d / h) * (d / l)));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-2.65d+213)) then
tmp = sqrt((d / h)) * sqrt((d / l))
else if (l <= (-3.5d-33)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else if (l <= 1.9d+132) then
tmp = (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (m * 0.5d0)) ** 2.0d0)) / l))) * sqrt(((d / h) * (d / l)))
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.65e+213) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (l <= -3.5e-33) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (l <= 1.9e+132) {
tmp = (1.0 - (0.5 * ((h * Math.pow(((D / d) * (M * 0.5)), 2.0)) / l))) * Math.sqrt(((d / h) * (d / l)));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2.65e+213: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif l <= -3.5e-33: tmp = d * -math.sqrt(((1.0 / l) / h)) elif l <= 1.9e+132: tmp = (1.0 - (0.5 * ((h * math.pow(((D / d) * (M * 0.5)), 2.0)) / l))) * math.sqrt(((d / h) * (d / l))) else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.65e+213) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (l <= -3.5e-33) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (l <= 1.9e+132) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0)) / l))) * sqrt(Float64(Float64(d / h) * Float64(d / l)))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -2.65e+213) tmp = sqrt((d / h)) * sqrt((d / l)); elseif (l <= -3.5e-33) tmp = d * -sqrt(((1.0 / l) / h)); elseif (l <= 1.9e+132) tmp = (1.0 - (0.5 * ((h * (((D / d) * (M * 0.5)) ^ 2.0)) / l))) * sqrt(((d / h) * (d / l))); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.65e+213], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -3.5e-33], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, 1.9e+132], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.65 \cdot 10^{+213}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq -3.5 \cdot 10^{-33}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;\ell \leq 1.9 \cdot 10^{+132}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\ell}\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -2.6499999999999999e213Initial program 73.6%
Simplified73.6%
Taylor expanded in d around inf 74.1%
if -2.6499999999999999e213 < l < -3.4999999999999999e-33Initial program 60.8%
metadata-eval60.8%
associate-*l*60.8%
frac-times58.9%
add-sqr-sqrt58.9%
pow258.9%
Applied egg-rr63.4%
associate-*r*63.4%
unpow-prod-down63.4%
metadata-eval63.4%
div-inv63.4%
associate-*l/63.6%
associate-*r/65.2%
associate-/l/65.2%
pow265.2%
pow1/265.2%
pow1/265.2%
pow-prod-up65.3%
metadata-eval65.3%
metadata-eval65.3%
Applied egg-rr65.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt57.1%
neg-mul-157.1%
Simplified57.1%
if -3.4999999999999999e-33 < l < 1.90000000000000003e132Initial program 73.3%
Simplified73.3%
associate-*r/76.9%
*-commutative76.9%
div-inv76.9%
metadata-eval76.9%
Applied egg-rr76.9%
pow176.9%
sqrt-unprod68.6%
Applied egg-rr68.6%
unpow168.6%
Simplified68.6%
if 1.90000000000000003e132 < l Initial program 43.9%
metadata-eval43.9%
associate-*l*43.9%
frac-times48.6%
add-sqr-sqrt48.5%
pow248.5%
Applied egg-rr58.4%
Taylor expanded in d around inf 39.0%
unpow-139.0%
metadata-eval39.0%
pow-sqr39.0%
rem-sqrt-square39.0%
rem-square-sqrt38.8%
fabs-sqr38.8%
rem-square-sqrt39.0%
Simplified39.0%
*-commutative39.0%
unpow-prod-down57.9%
Applied egg-rr57.9%
Final simplification65.1%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2.3e+213)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= l -6.8e-33)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= l 2.15e+131)
(*
(sqrt (* (/ d h) (/ d l)))
(- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l))))
(* d (* (pow l -0.5) (pow h -0.5)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.3e+213) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (l <= -6.8e-33) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (l <= 2.15e+131) {
tmp = sqrt(((d / h) * (d / l))) * (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l)));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-2.3d+213)) then
tmp = sqrt((d / h)) * sqrt((d / l))
else if (l <= (-6.8d-33)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else if (l <= 2.15d+131) then
tmp = sqrt(((d / h) * (d / l))) * (1.0d0 - (0.5d0 * ((h * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l)))
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.3e+213) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (l <= -6.8e-33) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (l <= 2.15e+131) {
tmp = Math.sqrt(((d / h) * (d / l))) * (1.0 - (0.5 * ((h * Math.pow((D * (M / (d * 2.0))), 2.0)) / l)));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2.3e+213: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif l <= -6.8e-33: tmp = d * -math.sqrt(((1.0 / l) / h)) elif l <= 2.15e+131: tmp = math.sqrt(((d / h) * (d / l))) * (1.0 - (0.5 * ((h * math.pow((D * (M / (d * 2.0))), 2.0)) / l))) else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.3e+213) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (l <= -6.8e-33) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (l <= 2.15e+131) tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l)))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -2.3e+213) tmp = sqrt((d / h)) * sqrt((d / l)); elseif (l <= -6.8e-33) tmp = d * -sqrt(((1.0 / l) / h)); elseif (l <= 2.15e+131) tmp = sqrt(((d / h) * (d / l))) * (1.0 - (0.5 * ((h * ((D * (M / (d * 2.0))) ^ 2.0)) / l))); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.3e+213], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -6.8e-33], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, 2.15e+131], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.3 \cdot 10^{+213}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq -6.8 \cdot 10^{-33}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;\ell \leq 2.15 \cdot 10^{+131}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -2.29999999999999998e213Initial program 73.6%
Simplified73.6%
Taylor expanded in d around inf 74.1%
if -2.29999999999999998e213 < l < -6.8000000000000001e-33Initial program 60.8%
metadata-eval60.8%
associate-*l*60.8%
frac-times58.9%
add-sqr-sqrt58.9%
pow258.9%
Applied egg-rr63.4%
associate-*r*63.4%
unpow-prod-down63.4%
metadata-eval63.4%
div-inv63.4%
associate-*l/63.6%
associate-*r/65.2%
associate-/l/65.2%
pow265.2%
pow1/265.2%
pow1/265.2%
pow-prod-up65.3%
metadata-eval65.3%
metadata-eval65.3%
Applied egg-rr65.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt57.1%
neg-mul-157.1%
Simplified57.1%
if -6.8000000000000001e-33 < l < 2.1500000000000001e131Initial program 73.3%
Simplified73.3%
pow176.9%
sqrt-unprod68.6%
Applied egg-rr65.0%
unpow168.6%
Simplified65.0%
associate-*r/65.0%
div-inv65.0%
metadata-eval65.0%
Applied egg-rr65.0%
associate-*r/68.8%
metadata-eval68.8%
div-inv68.8%
*-commutative68.8%
div-inv68.8%
metadata-eval68.8%
metadata-eval68.8%
div-inv68.8%
associate-*r/68.7%
associate-/l/68.7%
Applied egg-rr68.7%
if 2.1500000000000001e131 < l Initial program 43.9%
metadata-eval43.9%
associate-*l*43.9%
frac-times48.6%
add-sqr-sqrt48.5%
pow248.5%
Applied egg-rr58.4%
Taylor expanded in d around inf 39.0%
unpow-139.0%
metadata-eval39.0%
pow-sqr39.0%
rem-sqrt-square39.0%
rem-square-sqrt38.8%
fabs-sqr38.8%
rem-square-sqrt39.0%
Simplified39.0%
*-commutative39.0%
unpow-prod-down57.9%
Applied egg-rr57.9%
Final simplification65.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* D (* M (/ 0.5 d)))))
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (* t_0 t_0)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = D * (M * (0.5 / d));
return (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * (t_0 * t_0))));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
t_0 = d_1 * (m * (0.5d0 / d))
code = (((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (t_0 * t_0))))
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = D * (M * (0.5 / d));
return (Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * (t_0 * t_0))));
}
def code(d, h, l, M, D): t_0 = D * (M * (0.5 / d)) return (math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * (t_0 * t_0))))
function code(d, h, l, M, D) t_0 = Float64(D * Float64(M * Float64(0.5 / d))) return Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * Float64(t_0 * t_0))))) end
function tmp = code(d, h, l, M, D) t_0 = D * (M * (0.5 / d)); tmp = (((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (t_0 * t_0)))); end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := D \cdot \left(M \cdot \frac{0.5}{d}\right)\\
\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot \left(t\_0 \cdot t\_0\right)\right)\right)
\end{array}
\end{array}
Initial program 66.2%
metadata-eval66.2%
associate-*l*66.2%
frac-times66.5%
add-sqr-sqrt66.5%
pow266.5%
Applied egg-rr69.7%
unpow269.7%
metadata-eval69.7%
div-inv69.7%
associate-*l*69.7%
div-inv69.7%
metadata-eval69.7%
metadata-eval69.7%
div-inv69.7%
associate-*l*69.7%
Applied egg-rr69.7%
swap-sqr66.5%
rem-square-sqrt66.5%
associate-*r*66.5%
associate-*r*66.5%
swap-sqr66.5%
associate-*l/65.7%
associate-/l*66.5%
associate-/l*66.5%
associate-*l/66.1%
associate-/l*66.8%
associate-/l*66.8%
rem-square-sqrt66.9%
Simplified66.9%
Final simplification66.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (+ -1.0 (fma h l 1.0)) -0.5)))
(if (<= l -8.4e+213)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= l -1.52e-58)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= l 2.3e-308)
(* d t_0)
(if (<= l 6.6e-131)
(* d (- t_0))
(* d (* (pow l -0.5) (pow h -0.5)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((-1.0 + fma(h, l, 1.0)), -0.5);
double tmp;
if (l <= -8.4e+213) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (l <= -1.52e-58) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (l <= 2.3e-308) {
tmp = d * t_0;
} else if (l <= 6.6e-131) {
tmp = d * -t_0;
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(-1.0 + fma(h, l, 1.0)) ^ -0.5 tmp = 0.0 if (l <= -8.4e+213) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (l <= -1.52e-58) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (l <= 2.3e-308) tmp = Float64(d * t_0); elseif (l <= 6.6e-131) tmp = Float64(d * Float64(-t_0)); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(-1.0 + N[(h * l + 1.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[l, -8.4e+213], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1.52e-58], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, 2.3e-308], N[(d * t$95$0), $MachinePrecision], If[LessEqual[l, 6.6e-131], N[(d * (-t$95$0)), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq -8.4 \cdot 10^{+213}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq -1.52 \cdot 10^{-58}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-308}:\\
\;\;\;\;d \cdot t\_0\\
\mathbf{elif}\;\ell \leq 6.6 \cdot 10^{-131}:\\
\;\;\;\;d \cdot \left(-t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -8.4000000000000003e213Initial program 73.6%
Simplified73.6%
Taylor expanded in d around inf 74.1%
if -8.4000000000000003e213 < l < -1.51999999999999993e-58Initial program 63.0%
metadata-eval63.0%
associate-*l*63.0%
frac-times61.5%
add-sqr-sqrt61.4%
pow261.4%
Applied egg-rr66.7%
associate-*r*66.6%
unpow-prod-down66.6%
metadata-eval66.6%
div-inv66.6%
associate-*l/66.8%
associate-*r/68.3%
associate-/l/68.3%
pow268.3%
pow1/268.3%
pow1/268.3%
pow-prod-up68.3%
metadata-eval68.3%
metadata-eval68.3%
Applied egg-rr68.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt54.6%
neg-mul-154.6%
Simplified54.6%
if -1.51999999999999993e-58 < l < 2.2999999999999999e-308Initial program 73.6%
metadata-eval73.6%
associate-*l*73.6%
frac-times73.6%
add-sqr-sqrt73.5%
pow273.5%
Applied egg-rr73.6%
Taylor expanded in d around inf 16.2%
unpow-116.2%
metadata-eval16.2%
pow-sqr16.2%
rem-sqrt-square14.3%
rem-square-sqrt14.3%
fabs-sqr14.3%
rem-square-sqrt14.3%
Simplified14.3%
expm1-log1p-u14.3%
expm1-undefine39.8%
Applied egg-rr39.8%
sub-neg39.8%
metadata-eval39.8%
+-commutative39.8%
log1p-undefine39.8%
rem-exp-log39.8%
+-commutative39.8%
fma-define39.8%
Simplified39.8%
if 2.2999999999999999e-308 < l < 6.6000000000000004e-131Initial program 63.3%
metadata-eval63.3%
associate-*l*63.3%
frac-times63.3%
add-sqr-sqrt63.3%
pow263.3%
Applied egg-rr63.3%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt24.7%
neg-mul-124.7%
unpow-124.7%
metadata-eval24.7%
pow-sqr24.7%
rem-sqrt-square21.1%
rem-square-sqrt21.1%
fabs-sqr21.1%
rem-square-sqrt21.1%
Simplified21.1%
expm1-log1p-u15.8%
expm1-undefine4.8%
Applied egg-rr49.0%
sub-neg4.8%
metadata-eval4.8%
+-commutative4.8%
log1p-undefine4.8%
rem-exp-log4.9%
+-commutative4.9%
fma-define4.9%
Simplified49.0%
if 6.6000000000000004e-131 < l Initial program 63.0%
metadata-eval63.0%
associate-*l*63.0%
frac-times65.0%
add-sqr-sqrt65.0%
pow265.0%
Applied egg-rr70.4%
Taylor expanded in d around inf 43.0%
unpow-143.0%
metadata-eval43.0%
pow-sqr43.0%
rem-sqrt-square43.6%
rem-square-sqrt43.4%
fabs-sqr43.4%
rem-square-sqrt43.6%
Simplified43.6%
*-commutative43.6%
unpow-prod-down54.0%
Applied egg-rr54.0%
Final simplification52.5%
(FPCore (d h l M D)
:precision binary64
(if (<= M 4.7e-164)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(*
(sqrt (* (/ d h) (/ d l)))
(+ 1.0 (* (pow (* D (/ M (* d 2.0))) 2.0) (/ (* h -0.5) l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 4.7e-164) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else {
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (pow((D * (M / (d * 2.0))), 2.0) * ((h * -0.5) / 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 (m <= 4.7d-164) then
tmp = sqrt((d / h)) * sqrt((d / l))
else
tmp = sqrt(((d / h) * (d / l))) * (1.0d0 + (((d_1 * (m / (d * 2.0d0))) ** 2.0d0) * ((h * (-0.5d0)) / l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 4.7e-164) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else {
tmp = Math.sqrt(((d / h) * (d / l))) * (1.0 + (Math.pow((D * (M / (d * 2.0))), 2.0) * ((h * -0.5) / l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if M <= 4.7e-164: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) else: tmp = math.sqrt(((d / h) * (d / l))) * (1.0 + (math.pow((D * (M / (d * 2.0))), 2.0) * ((h * -0.5) / l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (M <= 4.7e-164) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); else tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 + Float64((Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0) * Float64(Float64(h * -0.5) / l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (M <= 4.7e-164) tmp = sqrt((d / h)) * sqrt((d / l)); else tmp = sqrt(((d / h) * (d / l))) * (1.0 + (((D * (M / (d * 2.0))) ^ 2.0) * ((h * -0.5) / l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[M, 4.7e-164], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h * -0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 4.7 \cdot 10^{-164}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot \frac{h \cdot -0.5}{\ell}\right)\\
\end{array}
\end{array}
if M < 4.6999999999999997e-164Initial program 68.4%
Simplified67.8%
Taylor expanded in d around inf 46.7%
if 4.6999999999999997e-164 < M Initial program 62.8%
Simplified64.6%
pow164.6%
associate-*r*64.6%
sqrt-unprod56.2%
associate-*r*56.2%
Applied egg-rr56.2%
unpow156.2%
*-commutative56.2%
*-commutative56.2%
associate-*r/57.0%
Simplified57.0%
fma-undefine57.0%
metadata-eval57.0%
div-inv57.0%
associate-*l/56.3%
associate-*r/57.2%
associate-/l/57.2%
*-commutative57.2%
Applied egg-rr57.2%
Final simplification50.9%
(FPCore (d h l M D)
:precision binary64
(if (<= l -9.2e+212)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= l -1.52e-58)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= l 3.05e-305)
(* d (pow (+ -1.0 (fma h l 1.0)) -0.5))
(* d (* (pow l -0.5) (pow h -0.5)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -9.2e+212) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (l <= -1.52e-58) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (l <= 3.05e-305) {
tmp = d * pow((-1.0 + fma(h, l, 1.0)), -0.5);
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -9.2e+212) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (l <= -1.52e-58) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (l <= 3.05e-305) tmp = Float64(d * (Float64(-1.0 + fma(h, l, 1.0)) ^ -0.5)); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -9.2e+212], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1.52e-58], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, 3.05e-305], N[(d * N[Power[N[(-1.0 + N[(h * l + 1.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -9.2 \cdot 10^{+212}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq -1.52 \cdot 10^{-58}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;\ell \leq 3.05 \cdot 10^{-305}:\\
\;\;\;\;d \cdot {\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -9.1999999999999993e212Initial program 73.6%
Simplified73.6%
Taylor expanded in d around inf 74.1%
if -9.1999999999999993e212 < l < -1.51999999999999993e-58Initial program 63.0%
metadata-eval63.0%
associate-*l*63.0%
frac-times61.5%
add-sqr-sqrt61.4%
pow261.4%
Applied egg-rr66.7%
associate-*r*66.6%
unpow-prod-down66.6%
metadata-eval66.6%
div-inv66.6%
associate-*l/66.8%
associate-*r/68.3%
associate-/l/68.3%
pow268.3%
pow1/268.3%
pow1/268.3%
pow-prod-up68.3%
metadata-eval68.3%
metadata-eval68.3%
Applied egg-rr68.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt54.6%
neg-mul-154.6%
Simplified54.6%
if -1.51999999999999993e-58 < l < 3.05e-305Initial program 74.1%
metadata-eval74.1%
associate-*l*74.1%
frac-times74.1%
add-sqr-sqrt74.0%
pow274.0%
Applied egg-rr74.1%
Taylor expanded in d around inf 15.9%
unpow-115.9%
metadata-eval15.9%
pow-sqr15.9%
rem-sqrt-square14.0%
rem-square-sqrt14.0%
fabs-sqr14.0%
rem-square-sqrt14.0%
Simplified14.0%
expm1-log1p-u14.0%
expm1-undefine39.1%
Applied egg-rr39.1%
sub-neg39.1%
metadata-eval39.1%
+-commutative39.1%
log1p-undefine39.1%
rem-exp-log39.1%
+-commutative39.1%
fma-define39.1%
Simplified39.1%
if 3.05e-305 < l Initial program 62.8%
metadata-eval62.8%
associate-*l*62.8%
frac-times64.3%
add-sqr-sqrt64.3%
pow264.3%
Applied egg-rr68.5%
Taylor expanded in d around inf 37.2%
unpow-137.2%
metadata-eval37.2%
pow-sqr37.2%
rem-sqrt-square37.7%
rem-square-sqrt37.5%
fabs-sqr37.5%
rem-square-sqrt37.7%
Simplified37.7%
*-commutative37.7%
unpow-prod-down48.2%
Applied egg-rr48.2%
Final simplification50.1%
(FPCore (d h l M D)
:precision binary64
(if (<= l -3.4e+211)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= l 9.5e-281)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(* d (* (pow l -0.5) (pow h -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.4e+211) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (l <= 9.5e-281) {
tmp = d * -sqrt(((1.0 / l) / h));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-3.4d+211)) then
tmp = sqrt((d / h)) * sqrt((d / l))
else if (l <= 9.5d-281) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.4e+211) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (l <= 9.5e-281) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -3.4e+211: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif l <= 9.5e-281: tmp = d * -math.sqrt(((1.0 / l) / h)) else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -3.4e+211) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (l <= 9.5e-281) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -3.4e+211) tmp = sqrt((d / h)) * sqrt((d / l)); elseif (l <= 9.5e-281) tmp = d * -sqrt(((1.0 / l) / h)); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -3.4e+211], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 9.5e-281], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.4 \cdot 10^{+211}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq 9.5 \cdot 10^{-281}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -3.3999999999999999e211Initial program 73.6%
Simplified73.6%
Taylor expanded in d around inf 74.1%
if -3.3999999999999999e211 < l < 9.5000000000000003e-281Initial program 68.9%
metadata-eval68.9%
associate-*l*68.9%
frac-times68.1%
add-sqr-sqrt68.1%
pow268.1%
Applied egg-rr70.8%
associate-*r*70.8%
unpow-prod-down70.8%
metadata-eval70.8%
div-inv70.8%
associate-*l/70.9%
associate-*r/71.6%
associate-/l/71.6%
pow271.6%
pow1/271.6%
pow1/271.6%
pow-prod-up71.6%
metadata-eval71.6%
metadata-eval71.6%
Applied egg-rr71.6%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt42.4%
neg-mul-142.4%
Simplified42.4%
if 9.5000000000000003e-281 < l Initial program 61.7%
metadata-eval61.7%
associate-*l*61.7%
frac-times63.3%
add-sqr-sqrt63.3%
pow263.3%
Applied egg-rr67.7%
Taylor expanded in d around inf 38.3%
unpow-138.3%
metadata-eval38.3%
pow-sqr38.3%
rem-sqrt-square38.8%
rem-square-sqrt38.6%
fabs-sqr38.6%
rem-square-sqrt38.8%
Simplified38.8%
*-commutative38.8%
unpow-prod-down49.8%
Applied egg-rr49.8%
Final simplification48.5%
(FPCore (d h l M D) :precision binary64 (if (<= l 4.2e-281) (* d (- (sqrt (/ (/ 1.0 l) h)))) (* d (* (pow l -0.5) (pow h -0.5)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 4.2e-281) {
tmp = d * -sqrt(((1.0 / l) / h));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 4.2d-281) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 4.2e-281) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 4.2e-281: tmp = d * -math.sqrt(((1.0 / l) / h)) else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 4.2e-281) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 4.2e-281) tmp = d * -sqrt(((1.0 / l) / h)); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 4.2e-281], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 4.2 \cdot 10^{-281}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < 4.1999999999999998e-281Initial program 69.7%
metadata-eval69.7%
associate-*l*69.7%
frac-times69.0%
add-sqr-sqrt69.0%
pow269.0%
Applied egg-rr71.3%
associate-*r*71.3%
unpow-prod-down71.3%
metadata-eval71.3%
div-inv71.3%
associate-*l/71.4%
associate-*r/72.0%
associate-/l/72.0%
pow272.0%
pow1/272.0%
pow1/272.0%
pow-prod-up72.0%
metadata-eval72.0%
metadata-eval72.0%
Applied egg-rr72.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt41.4%
neg-mul-141.4%
Simplified41.4%
if 4.1999999999999998e-281 < l Initial program 61.7%
metadata-eval61.7%
associate-*l*61.7%
frac-times63.3%
add-sqr-sqrt63.3%
pow263.3%
Applied egg-rr67.7%
Taylor expanded in d around inf 38.3%
unpow-138.3%
metadata-eval38.3%
pow-sqr38.3%
rem-sqrt-square38.8%
rem-square-sqrt38.6%
fabs-sqr38.6%
rem-square-sqrt38.8%
Simplified38.8%
*-commutative38.8%
unpow-prod-down49.8%
Applied egg-rr49.8%
Final simplification45.1%
(FPCore (d h l M D) :precision binary64 (if (<= l 3.1e-282) (* d (- (sqrt (/ (/ 1.0 l) h)))) (* d (pow (* l h) -0.5))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3.1e-282) {
tmp = d * -sqrt(((1.0 / l) / h));
} else {
tmp = d * pow((l * h), -0.5);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 3.1d-282) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else
tmp = d * ((l * h) ** (-0.5d0))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3.1e-282) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else {
tmp = d * Math.pow((l * h), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 3.1e-282: tmp = d * -math.sqrt(((1.0 / l) / h)) else: tmp = d * math.pow((l * h), -0.5) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 3.1e-282) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); else tmp = Float64(d * (Float64(l * h) ^ -0.5)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 3.1e-282) tmp = d * -sqrt(((1.0 / l) / h)); else tmp = d * ((l * h) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 3.1e-282], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.1 \cdot 10^{-282}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if l < 3.10000000000000013e-282Initial program 69.7%
metadata-eval69.7%
associate-*l*69.7%
frac-times69.0%
add-sqr-sqrt69.0%
pow269.0%
Applied egg-rr71.3%
associate-*r*71.3%
unpow-prod-down71.3%
metadata-eval71.3%
div-inv71.3%
associate-*l/71.4%
associate-*r/72.0%
associate-/l/72.0%
pow272.0%
pow1/272.0%
pow1/272.0%
pow-prod-up72.0%
metadata-eval72.0%
metadata-eval72.0%
Applied egg-rr72.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt41.4%
neg-mul-141.4%
Simplified41.4%
if 3.10000000000000013e-282 < l Initial program 61.7%
metadata-eval61.7%
associate-*l*61.7%
frac-times63.3%
add-sqr-sqrt63.3%
pow263.3%
Applied egg-rr67.7%
Taylor expanded in d around inf 38.3%
unpow-138.3%
metadata-eval38.3%
pow-sqr38.3%
rem-sqrt-square38.8%
rem-square-sqrt38.6%
fabs-sqr38.6%
rem-square-sqrt38.8%
Simplified38.8%
Final simplification40.2%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (pow (* l h) -0.5))) (if (<= l 2.1e-283) (* d (- t_0)) (* d t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((l * h), -0.5);
double tmp;
if (l <= 2.1e-283) {
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 = (l * h) ** (-0.5d0)
if (l <= 2.1d-283) 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((l * h), -0.5);
double tmp;
if (l <= 2.1e-283) {
tmp = d * -t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((l * h), -0.5) tmp = 0 if l <= 2.1e-283: tmp = d * -t_0 else: tmp = d * t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(l * h) ^ -0.5 tmp = 0.0 if (l <= 2.1e-283) 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 = (l * h) ^ -0.5; tmp = 0.0; if (l <= 2.1e-283) 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[(l * h), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[l, 2.1e-283], N[(d * (-t$95$0)), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq 2.1 \cdot 10^{-283}:\\
\;\;\;\;d \cdot \left(-t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot t\_0\\
\end{array}
\end{array}
if l < 2.09999999999999997e-283Initial program 69.7%
metadata-eval69.7%
associate-*l*69.7%
frac-times69.0%
add-sqr-sqrt69.0%
pow269.0%
Applied egg-rr71.3%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt40.8%
neg-mul-140.8%
unpow-140.8%
metadata-eval40.8%
pow-sqr40.9%
rem-sqrt-square40.9%
rem-square-sqrt40.7%
fabs-sqr40.7%
rem-square-sqrt40.9%
Simplified40.9%
if 2.09999999999999997e-283 < l Initial program 61.7%
metadata-eval61.7%
associate-*l*61.7%
frac-times63.3%
add-sqr-sqrt63.3%
pow263.3%
Applied egg-rr67.7%
Taylor expanded in d around inf 38.3%
unpow-138.3%
metadata-eval38.3%
pow-sqr38.3%
rem-sqrt-square38.8%
rem-square-sqrt38.6%
fabs-sqr38.6%
rem-square-sqrt38.8%
Simplified38.8%
Final simplification39.9%
(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 66.2%
metadata-eval66.2%
associate-*l*66.2%
frac-times66.5%
add-sqr-sqrt66.5%
pow266.5%
Applied egg-rr69.7%
Taylor expanded in d around inf 22.5%
unpow-122.5%
metadata-eval22.5%
pow-sqr22.6%
rem-sqrt-square22.4%
rem-square-sqrt22.3%
fabs-sqr22.3%
rem-square-sqrt22.4%
Simplified22.4%
Final simplification22.4%
herbie shell --seed 2024191
(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)))))