
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d))))
(if (<= h -2e-310)
(*
(/ t_0 (sqrt (- l)))
(*
(/ t_0 (sqrt (- h)))
(+ 1.0 (/ (* -0.5 (pow (* D (/ M (* d 2.0))) 2.0)) (/ l h)))))
(*
d
(/
(fma -0.5 (* h (/ (pow (* D (* M (/ 0.5 d))) 2.0) l)) 1.0)
(* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double tmp;
if (h <= -2e-310) {
tmp = (t_0 / sqrt(-l)) * ((t_0 / sqrt(-h)) * (1.0 + ((-0.5 * pow((D * (M / (d * 2.0))), 2.0)) / (l / h))));
} else {
tmp = d * (fma(-0.5, (h * (pow((D * (M * (0.5 / d))), 2.0) / l)), 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) tmp = 0.0 if (h <= -2e-310) tmp = Float64(Float64(t_0 / sqrt(Float64(-l))) * Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(-0.5 * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / Float64(l / h))))); else tmp = Float64(d * Float64(fma(-0.5, Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) / l)), 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[h, -2e-310], N[(N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(-0.5 * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(-0.5 * N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / 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 := \sqrt{-d}\\
\mathbf{if}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{t\_0}{\sqrt{-\ell}} \cdot \left(\frac{t\_0}{\sqrt{-h}} \cdot \left(1 + \frac{-0.5 \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\frac{\ell}{h}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5, h \cdot \frac{{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if h < -1.999999999999994e-310Initial program 72.3%
Simplified70.0%
*-commutative70.0%
clear-num70.0%
un-div-inv70.0%
*-commutative70.0%
add-sqr-sqrt70.0%
pow270.0%
unpow270.0%
sqrt-prod44.4%
add-sqr-sqrt70.0%
associate-/l/70.0%
Applied egg-rr70.0%
frac-2neg70.0%
sqrt-div73.1%
Applied egg-rr73.1%
frac-2neg73.1%
sqrt-div84.4%
Applied egg-rr84.4%
if -1.999999999999994e-310 < h Initial program 64.3%
Simplified64.1%
sub-neg64.1%
distribute-rgt-in53.9%
*-un-lft-identity53.9%
*-commutative53.9%
sqrt-div61.3%
sqrt-div62.9%
frac-times62.9%
add-sqr-sqrt63.0%
Applied egg-rr75.4%
*-rgt-identity75.4%
*-commutative75.4%
distribute-lft-in81.4%
associate-*l/82.3%
associate-/l*82.3%
Simplified86.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* D M) (* d 2.0)) 2.0))))))
(t_1 (sqrt (/ d l))))
(if (<= t_0 -1e-193)
(*
t_1
(*
(sqrt (/ d h))
(+ 1.0 (* (/ h l) (* -0.5 (pow (* M (/ D (* d 2.0))) 2.0))))))
(if (<= t_0 1e-282)
(* d (sqrt (/ (/ 1.0 h) l)))
(* t_1 (/ 1.0 (sqrt (/ h d))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((D * M) / (d * 2.0)), 2.0))));
double t_1 = sqrt((d / l));
double tmp;
if (t_0 <= -1e-193) {
tmp = t_1 * (sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * pow((M * (D / (d * 2.0))), 2.0)))));
} else if (t_0 <= 1e-282) {
tmp = d * sqrt(((1.0 / h) / l));
} else {
tmp = t_1 * (1.0 / sqrt((h / d)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((d_1 * m) / (d * 2.0d0)) ** 2.0d0))))
t_1 = sqrt((d / l))
if (t_0 <= (-1d-193)) then
tmp = t_1 * (sqrt((d / h)) * (1.0d0 + ((h / l) * ((-0.5d0) * ((m * (d_1 / (d * 2.0d0))) ** 2.0d0)))))
else if (t_0 <= 1d-282) then
tmp = d * sqrt(((1.0d0 / h) / l))
else
tmp = t_1 * (1.0d0 / sqrt((h / d)))
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((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))));
double t_1 = Math.sqrt((d / l));
double tmp;
if (t_0 <= -1e-193) {
tmp = t_1 * (Math.sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * Math.pow((M * (D / (d * 2.0))), 2.0)))));
} else if (t_0 <= 1e-282) {
tmp = d * Math.sqrt(((1.0 / h) / l));
} else {
tmp = t_1 * (1.0 / Math.sqrt((h / d)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (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)))) t_1 = math.sqrt((d / l)) tmp = 0 if t_0 <= -1e-193: tmp = t_1 * (math.sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * math.pow((M * (D / (d * 2.0))), 2.0))))) elif t_0 <= 1e-282: tmp = d * math.sqrt(((1.0 / h) / l)) else: tmp = t_1 * (1.0 / math.sqrt((h / d))) return tmp
function code(d, h, l, M, D) t_0 = 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))))) t_1 = sqrt(Float64(d / l)) tmp = 0.0 if (t_0 <= -1e-193) tmp = Float64(t_1 * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(M * Float64(D / Float64(d * 2.0))) ^ 2.0)))))); elseif (t_0 <= 1e-282) tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l))); else tmp = Float64(t_1 * Float64(1.0 / sqrt(Float64(h / d)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((D * M) / (d * 2.0)) ^ 2.0)))); t_1 = sqrt((d / l)); tmp = 0.0; if (t_0 <= -1e-193) tmp = t_1 * (sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * ((M * (D / (d * 2.0))) ^ 2.0))))); elseif (t_0 <= 1e-282) tmp = d * sqrt(((1.0 / h) / l)); else tmp = t_1 * (1.0 / sqrt((h / d))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -1e-193], N[(t$95$1 * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(M * N[(D / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e-282], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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)\\
t_1 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-193}:\\
\;\;\;\;t\_1 \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2}\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq 10^{-282}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\
\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)))) < -1e-193Initial program 82.1%
Simplified80.1%
clear-num80.1%
un-div-inv80.1%
div-inv80.1%
clear-num80.1%
Applied egg-rr80.1%
associate-*r/80.1%
associate-/r/82.2%
Simplified82.2%
if -1e-193 < (*.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)))) < 1e-282Initial program 33.6%
Simplified33.0%
Taylor expanded in d around inf 63.1%
associate-/r*64.9%
Simplified64.9%
if 1e-282 < (*.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 63.7%
Simplified63.0%
Taylor expanded in M around 0 68.4%
clear-num68.4%
sqrt-div69.7%
metadata-eval69.7%
Applied egg-rr69.7%
Final simplification74.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h))))
(if (<= d -2.1e-21)
(*
(* (sqrt (/ d l)) t_0)
(- 1.0 (* 0.5 (pow (* (* (/ D d) (* M 0.5)) (sqrt (/ h l))) 2.0))))
(if (<= d -5.1e-284)
(*
(/ (sqrt (- d)) (sqrt (- l)))
(* t_0 (+ 1.0 (* -0.125 (* (/ h l) (pow (* D (/ M d)) 2.0))))))
(*
d
(/
(fma -0.5 (* h (/ (pow (* D (* M (/ 0.5 d))) 2.0) l)) 1.0)
(* (sqrt l) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double tmp;
if (d <= -2.1e-21) {
tmp = (sqrt((d / l)) * t_0) * (1.0 - (0.5 * pow((((D / d) * (M * 0.5)) * sqrt((h / l))), 2.0)));
} else if (d <= -5.1e-284) {
tmp = (sqrt(-d) / sqrt(-l)) * (t_0 * (1.0 + (-0.125 * ((h / l) * pow((D * (M / d)), 2.0)))));
} else {
tmp = d * (fma(-0.5, (h * (pow((D * (M * (0.5 / d))), 2.0) / l)), 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) tmp = 0.0 if (d <= -2.1e-21) tmp = Float64(Float64(sqrt(Float64(d / l)) * t_0) * Float64(1.0 - Float64(0.5 * (Float64(Float64(Float64(D / d) * Float64(M * 0.5)) * sqrt(Float64(h / l))) ^ 2.0)))); elseif (d <= -5.1e-284) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * Float64(t_0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(h / l) * (Float64(D * Float64(M / d)) ^ 2.0)))))); else tmp = Float64(d * Float64(fma(-0.5, Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) / l)), 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -2.1e-21], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * t$95$0), $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], If[LessEqual[d, -5.1e-284], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.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]), $MachinePrecision], N[(d * N[(N[(-0.5 * N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / 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 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;d \leq -2.1 \cdot 10^{-21}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot t\_0\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{elif}\;d \leq -5.1 \cdot 10^{-284}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \left(t\_0 \cdot \left(1 + -0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5, h \cdot \frac{{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < -2.10000000000000013e-21Initial program 79.2%
Simplified79.3%
add-sqr-sqrt79.3%
pow279.3%
sqrt-prod79.3%
sqrt-pow184.8%
metadata-eval84.8%
pow184.8%
*-commutative84.8%
div-inv84.8%
metadata-eval84.8%
Applied egg-rr84.8%
if -2.10000000000000013e-21 < d < -5.1000000000000002e-284Initial program 65.5%
Simplified63.7%
*-commutative63.7%
clear-num63.7%
un-div-inv63.7%
*-commutative63.7%
add-sqr-sqrt63.7%
pow263.7%
unpow263.7%
sqrt-prod39.4%
add-sqr-sqrt63.7%
associate-/l/63.7%
Applied egg-rr63.7%
frac-2neg63.7%
sqrt-div71.6%
Applied egg-rr71.6%
Taylor expanded in D around 0 44.4%
associate-*r*46.4%
times-frac46.3%
unpow246.3%
unpow246.3%
unswap-sqr62.2%
unpow262.2%
times-frac73.5%
unpow273.5%
*-commutative73.5%
associate-/l*71.6%
Simplified71.6%
if -5.1000000000000002e-284 < d Initial program 63.3%
Simplified63.2%
sub-neg63.2%
distribute-rgt-in53.1%
*-un-lft-identity53.1%
*-commutative53.1%
sqrt-div60.4%
sqrt-div62.0%
frac-times62.0%
add-sqr-sqrt62.1%
Applied egg-rr74.3%
*-rgt-identity74.3%
*-commutative74.3%
distribute-lft-in80.2%
associate-*l/81.1%
associate-/l*81.0%
Simplified84.9%
Final simplification82.3%
(FPCore (d h l M D)
:precision binary64
(if (<= l -5e-310)
(*
(*
(/ (sqrt (- d)) (sqrt (- h)))
(+ 1.0 (/ (* -0.5 (pow (* D (/ M (* d 2.0))) 2.0)) (/ l h))))
(sqrt (/ d l)))
(*
d
(/
(fma -0.5 (* h (/ (pow (* D (* M (/ 0.5 d))) 2.0) 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)) * (1.0 + ((-0.5 * pow((D * (M / (d * 2.0))), 2.0)) / (l / h)))) * sqrt((d / l));
} else {
tmp = d * (fma(-0.5, (h * (pow((D * (M * (0.5 / d))), 2.0) / 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))) * Float64(1.0 + Float64(Float64(-0.5 * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / Float64(l / h)))) * sqrt(Float64(d / l))); else tmp = Float64(d * Float64(fma(-0.5, Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) / 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[(1.0 + N[(N[(-0.5 * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(-0.5 * N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / 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 \left(1 + \frac{-0.5 \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\frac{\ell}{h}}\right)\right) \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5, h \cdot \frac{{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 72.3%
Simplified70.0%
*-commutative70.0%
clear-num70.0%
un-div-inv70.0%
*-commutative70.0%
add-sqr-sqrt70.0%
pow270.0%
unpow270.0%
sqrt-prod44.4%
add-sqr-sqrt70.0%
associate-/l/70.0%
Applied egg-rr70.0%
frac-2neg70.0%
sqrt-div79.6%
Applied egg-rr79.6%
if -4.999999999999985e-310 < l Initial program 64.3%
Simplified64.1%
sub-neg64.1%
distribute-rgt-in53.9%
*-un-lft-identity53.9%
*-commutative53.9%
sqrt-div61.3%
sqrt-div62.9%
frac-times62.9%
add-sqr-sqrt63.0%
Applied egg-rr75.4%
*-rgt-identity75.4%
*-commutative75.4%
distribute-lft-in81.4%
associate-*l/82.3%
associate-/l*82.3%
Simplified86.2%
Final simplification83.0%
(FPCore (d h l M D)
:precision binary64
(if (<= l -5e-310)
(*
(sqrt (/ d l))
(*
(/ (sqrt (- d)) (sqrt (- h)))
(+ 1.0 (* (/ h l) (* -0.5 (pow (* D (/ (/ M 2.0) d)) 2.0))))))
(*
d
(/
(fma -0.5 (* h (/ (pow (* D (* M (/ 0.5 d))) 2.0) 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 / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0 + ((h / l) * (-0.5 * pow((D * ((M / 2.0) / d)), 2.0)))));
} else {
tmp = d * (fma(-0.5, (h * (pow((D * (M * (0.5 / d))), 2.0) / 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(sqrt(Float64(d / l)) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0)))))); else tmp = Float64(d * Float64(fma(-0.5, Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) / 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[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-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[(d * N[(N[(-0.5 * N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / 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}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-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}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5, h \cdot \frac{{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 72.3%
Simplified70.0%
frac-2neg70.0%
sqrt-div79.6%
Applied egg-rr79.6%
if -4.999999999999985e-310 < l Initial program 64.3%
Simplified64.1%
sub-neg64.1%
distribute-rgt-in53.9%
*-un-lft-identity53.9%
*-commutative53.9%
sqrt-div61.3%
sqrt-div62.9%
frac-times62.9%
add-sqr-sqrt63.0%
Applied egg-rr75.4%
*-rgt-identity75.4%
*-commutative75.4%
distribute-lft-in81.4%
associate-*l/82.3%
associate-/l*82.3%
Simplified86.2%
Final simplification83.0%
(FPCore (d h l M D)
:precision binary64
(if (<= l -5e-310)
(*
(/ (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ l d)))
(+ 1.0 (* (* (/ h l) (pow (* M (/ D d)) 2.0)) -0.125)))
(*
d
(/
(fma -0.5 (* h (/ (pow (* D (* M (/ 0.5 d))) 2.0) 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((l / d))) * (1.0 + (((h / l) * pow((M * (D / d)), 2.0)) * -0.125));
} else {
tmp = d * (fma(-0.5, (h * (pow((D * (M * (0.5 / d))), 2.0) / 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(l / d))) * Float64(1.0 + Float64(Float64(Float64(h / l) * (Float64(M * Float64(D / d)) ^ 2.0)) * -0.125))); else tmp = Float64(d * Float64(fma(-0.5, Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) / 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[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(-0.5 * N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / 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}:\\
\;\;\;\;\frac{\frac{\sqrt{-d}}{\sqrt{-h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 + \left(\frac{h}{\ell} \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\right) \cdot -0.125\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5, h \cdot \frac{{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 72.3%
Simplified71.6%
add-sqr-sqrt71.6%
pow271.6%
sqrt-prod71.6%
sqrt-pow175.5%
metadata-eval75.5%
pow175.5%
*-commutative75.5%
div-inv75.5%
metadata-eval75.5%
Applied egg-rr75.5%
clear-num75.5%
sqrt-div75.6%
metadata-eval75.6%
Applied egg-rr75.6%
pow175.6%
Applied egg-rr71.6%
unpow171.6%
*-commutative71.6%
associate-*r*71.6%
associate-*l*71.6%
*-commutative71.6%
metadata-eval71.6%
Simplified71.6%
frac-2neg71.6%
sqrt-div80.3%
Applied egg-rr80.3%
if -4.999999999999985e-310 < l Initial program 64.3%
Simplified64.1%
sub-neg64.1%
distribute-rgt-in53.9%
*-un-lft-identity53.9%
*-commutative53.9%
sqrt-div61.3%
sqrt-div62.9%
frac-times62.9%
add-sqr-sqrt63.0%
Applied egg-rr75.4%
*-rgt-identity75.4%
*-commutative75.4%
distribute-lft-in81.4%
associate-*l/82.3%
associate-/l*82.3%
Simplified86.2%
(FPCore (d h l M D)
:precision binary64
(if (<= l 6e-295)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(- 1.0 (* 0.5 (pow (* (* (/ D d) (* M 0.5)) (sqrt (/ h l))) 2.0))))
(*
d
(/
(fma -0.5 (* h (/ (pow (* D (* M (/ 0.5 d))) 2.0) l)) 1.0)
(* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 6e-295) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (0.5 * pow((((D / d) * (M * 0.5)) * sqrt((h / l))), 2.0)));
} else {
tmp = d * (fma(-0.5, (h * (pow((D * (M * (0.5 / d))), 2.0) / l)), 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= 6e-295) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 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(fma(-0.5, Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) / l)), 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 6e-295], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $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[(N[(-0.5 * N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / 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 6 \cdot 10^{-295}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\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 \frac{\mathsf{fma}\left(-0.5, h \cdot \frac{{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < 5.99999999999999993e-295Initial program 72.5%
Simplified71.0%
add-sqr-sqrt71.0%
pow271.0%
sqrt-prod71.0%
sqrt-pow174.9%
metadata-eval74.9%
pow174.9%
*-commutative74.9%
div-inv74.9%
metadata-eval74.9%
Applied egg-rr74.9%
if 5.99999999999999993e-295 < l Initial program 64.0%
Simplified64.6%
sub-neg64.6%
distribute-rgt-in54.3%
*-un-lft-identity54.3%
*-commutative54.3%
sqrt-div61.7%
sqrt-div63.4%
frac-times63.4%
add-sqr-sqrt63.5%
Applied egg-rr76.0%
*-rgt-identity76.0%
*-commutative76.0%
distribute-lft-in82.0%
associate-*l/82.9%
associate-/l*82.9%
Simplified86.1%
Final simplification80.7%
(FPCore (d h l M D)
:precision binary64
(if (<= l 6e-295)
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* D M) (* d 2.0)) 2.0)))))
(*
d
(/
(fma -0.5 (* h (/ (pow (* D (* M (/ 0.5 d))) 2.0) l)) 1.0)
(* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 6e-295) {
tmp = (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((D * M) / (d * 2.0)), 2.0))));
} else {
tmp = d * (fma(-0.5, (h * (pow((D * (M * (0.5 / d))), 2.0) / l)), 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= 6e-295) tmp = 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))))); else tmp = Float64(d * Float64(fma(-0.5, Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) / l)), 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 6e-295], 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], N[(d * N[(N[(-0.5 * N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / 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 6 \cdot 10^{-295}:\\
\;\;\;\;\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)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5, h \cdot \frac{{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < 5.99999999999999993e-295Initial program 72.5%
if 5.99999999999999993e-295 < l Initial program 64.0%
Simplified64.6%
sub-neg64.6%
distribute-rgt-in54.3%
*-un-lft-identity54.3%
*-commutative54.3%
sqrt-div61.7%
sqrt-div63.4%
frac-times63.4%
add-sqr-sqrt63.5%
Applied egg-rr76.0%
*-rgt-identity76.0%
*-commutative76.0%
distribute-lft-in82.0%
associate-*l/82.9%
associate-/l*82.9%
Simplified86.1%
Final simplification79.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l 2.8e+191)
(*
(/ (sqrt (/ d h)) (sqrt (/ l d)))
(+ 1.0 (* -0.125 (/ (* h (pow (/ (* D M) d) 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.8e+191) {
tmp = (sqrt((d / h)) / sqrt((l / d))) * (1.0 + (-0.125 * ((h * pow(((D * M) / d), 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.8d+191) then
tmp = (sqrt((d / h)) / sqrt((l / d))) * (1.0d0 + ((-0.125d0) * ((h * (((d_1 * m) / d) ** 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.8e+191) {
tmp = (Math.sqrt((d / h)) / Math.sqrt((l / d))) * (1.0 + (-0.125 * ((h * Math.pow(((D * M) / d), 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.8e+191: tmp = (math.sqrt((d / h)) / math.sqrt((l / d))) * (1.0 + (-0.125 * ((h * math.pow(((D * M) / d), 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.8e+191) tmp = Float64(Float64(sqrt(Float64(d / h)) / sqrt(Float64(l / d))) * Float64(1.0 + Float64(-0.125 * Float64(Float64(h * (Float64(Float64(D * M) / d) ^ 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.8e+191) tmp = (sqrt((d / h)) / sqrt((l / d))) * (1.0 + (-0.125 * ((h * (((D * M) / d) ^ 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.8e+191], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(N[(h * N[Power[N[(N[(D * M), $MachinePrecision] / d), $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.8 \cdot 10^{+191}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 + -0.125 \cdot \frac{h \cdot {\left(\frac{D \cdot M}{d}\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < 2.7999999999999999e191Initial program 69.2%
Simplified68.4%
add-sqr-sqrt68.4%
pow268.4%
sqrt-prod68.3%
sqrt-pow171.3%
metadata-eval71.3%
pow171.3%
*-commutative71.3%
div-inv71.3%
metadata-eval71.3%
Applied egg-rr71.3%
clear-num71.3%
sqrt-div71.3%
metadata-eval71.3%
Applied egg-rr71.3%
pow171.3%
Applied egg-rr68.4%
unpow168.4%
*-commutative68.4%
associate-*r*68.4%
associate-*l*68.4%
*-commutative68.4%
metadata-eval68.4%
Simplified68.4%
associate-*l/68.1%
associate-*r/69.1%
*-commutative69.1%
Applied egg-rr69.1%
if 2.7999999999999999e191 < l Initial program 60.2%
Simplified63.1%
add-sqr-sqrt63.1%
pow263.1%
sqrt-prod63.1%
sqrt-pow169.0%
metadata-eval69.0%
pow169.0%
*-commutative69.0%
div-inv69.0%
metadata-eval69.0%
Applied egg-rr69.0%
Taylor expanded in d around inf 54.6%
unpow-154.6%
metadata-eval54.6%
pow-sqr54.7%
rem-sqrt-square54.7%
rem-square-sqrt54.7%
fabs-sqr54.7%
rem-square-sqrt54.7%
Simplified54.7%
*-commutative54.7%
unpow-prod-down81.0%
Applied egg-rr81.0%
Final simplification70.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l 1.22e+190)
(*
(/ (sqrt (/ d h)) (sqrt (/ l d)))
(+ 1.0 (* -0.125 (* h (/ (pow (* M (/ D d)) 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 <= 1.22e+190) {
tmp = (sqrt((d / h)) / sqrt((l / d))) * (1.0 + (-0.125 * (h * (pow((M * (D / d)), 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 <= 1.22d+190) then
tmp = (sqrt((d / h)) / sqrt((l / d))) * (1.0d0 + ((-0.125d0) * (h * (((m * (d_1 / d)) ** 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 <= 1.22e+190) {
tmp = (Math.sqrt((d / h)) / Math.sqrt((l / d))) * (1.0 + (-0.125 * (h * (Math.pow((M * (D / d)), 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 <= 1.22e+190: tmp = (math.sqrt((d / h)) / math.sqrt((l / d))) * (1.0 + (-0.125 * (h * (math.pow((M * (D / d)), 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 <= 1.22e+190) tmp = Float64(Float64(sqrt(Float64(d / h)) / sqrt(Float64(l / d))) * Float64(1.0 + Float64(-0.125 * Float64(h * Float64((Float64(M * Float64(D / d)) ^ 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 <= 1.22e+190) tmp = (sqrt((d / h)) / sqrt((l / d))) * (1.0 + (-0.125 * (h * (((M * (D / d)) ^ 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, 1.22e+190], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(h * N[(N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.22 \cdot 10^{+190}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 + -0.125 \cdot \left(h \cdot \frac{{\left(M \cdot \frac{D}{d}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < 1.21999999999999995e190Initial program 69.2%
Simplified68.4%
add-sqr-sqrt68.4%
pow268.4%
sqrt-prod68.3%
sqrt-pow171.3%
metadata-eval71.3%
pow171.3%
*-commutative71.3%
div-inv71.3%
metadata-eval71.3%
Applied egg-rr71.3%
clear-num71.3%
sqrt-div71.3%
metadata-eval71.3%
Applied egg-rr71.3%
pow171.3%
Applied egg-rr68.4%
unpow168.4%
*-commutative68.4%
associate-*r*68.4%
associate-*l*68.4%
*-commutative68.4%
metadata-eval68.4%
Simplified68.4%
Taylor expanded in h around 0 44.2%
associate-*r*45.0%
times-frac44.2%
associate-/l*43.8%
unpow243.8%
unpow243.8%
unpow243.8%
times-frac54.5%
swap-sqr67.5%
associate-/l*67.5%
associate-/l*69.3%
unpow269.3%
*-commutative69.3%
associate-*l/69.1%
associate-/l*69.9%
*-commutative69.9%
associate-/l*69.0%
Simplified69.0%
if 1.21999999999999995e190 < l Initial program 60.2%
Simplified63.1%
add-sqr-sqrt63.1%
pow263.1%
sqrt-prod63.1%
sqrt-pow169.0%
metadata-eval69.0%
pow169.0%
*-commutative69.0%
div-inv69.0%
metadata-eval69.0%
Applied egg-rr69.0%
Taylor expanded in d around inf 54.6%
unpow-154.6%
metadata-eval54.6%
pow-sqr54.7%
rem-sqrt-square54.7%
rem-square-sqrt54.7%
fabs-sqr54.7%
rem-square-sqrt54.7%
Simplified54.7%
*-commutative54.7%
unpow-prod-down81.0%
Applied egg-rr81.0%
Final simplification70.5%
(FPCore (d h l M D)
:precision binary64
(if (<= l 1.72e+192)
(*
(sqrt (/ d l))
(* (sqrt (/ d h)) (+ 1.0 (* -0.125 (* h (/ (pow (* M (/ D d)) 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 <= 1.72e+192) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (-0.125 * (h * (pow((M * (D / d)), 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 <= 1.72d+192) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + ((-0.125d0) * (h * (((m * (d_1 / d)) ** 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 <= 1.72e+192) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + (-0.125 * (h * (Math.pow((M * (D / d)), 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 <= 1.72e+192: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + (-0.125 * (h * (math.pow((M * (D / d)), 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 <= 1.72e+192) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(-0.125 * Float64(h * Float64((Float64(M * Float64(D / d)) ^ 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 <= 1.72e+192) tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (-0.125 * (h * (((M * (D / d)) ^ 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, 1.72e+192], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(h * N[(N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.72 \cdot 10^{+192}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + -0.125 \cdot \left(h \cdot \frac{{\left(M \cdot \frac{D}{d}\right)}^{2}}{\ell}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < 1.7199999999999999e192Initial program 69.2%
Simplified67.5%
*-commutative67.5%
clear-num67.5%
un-div-inv67.5%
*-commutative67.5%
add-sqr-sqrt67.5%
pow267.5%
unpow267.5%
sqrt-prod44.2%
add-sqr-sqrt67.5%
associate-/l/67.5%
Applied egg-rr67.5%
Taylor expanded in D around 0 44.2%
associate-*r*45.1%
times-frac44.2%
unpow244.2%
unpow244.2%
unswap-sqr55.5%
unpow255.5%
times-frac69.3%
unpow269.3%
*-commutative69.3%
associate-*l/69.0%
associate-/l*69.9%
*-commutative69.9%
associate-/l*68.9%
Simplified68.9%
if 1.7199999999999999e192 < l Initial program 60.2%
Simplified63.1%
add-sqr-sqrt63.1%
pow263.1%
sqrt-prod63.1%
sqrt-pow169.0%
metadata-eval69.0%
pow169.0%
*-commutative69.0%
div-inv69.0%
metadata-eval69.0%
Applied egg-rr69.0%
Taylor expanded in d around inf 54.6%
unpow-154.6%
metadata-eval54.6%
pow-sqr54.7%
rem-sqrt-square54.7%
rem-square-sqrt54.7%
fabs-sqr54.7%
rem-square-sqrt54.7%
Simplified54.7%
*-commutative54.7%
unpow-prod-down81.0%
Applied egg-rr81.0%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1e+108)
(* (/ (sqrt (- d)) (sqrt (- l))) (sqrt (/ d h)))
(if (or (<= l 360.0) (and (not (<= l 1.05e+111)) (<= l 3.8e+189)))
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* h (* -0.5 (/ (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 <= -1e+108) {
tmp = (sqrt(-d) / sqrt(-l)) * sqrt((d / h));
} else if ((l <= 360.0) || (!(l <= 1.05e+111) && (l <= 3.8e+189))) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (h * (-0.5 * (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 <= (-1d+108)) then
tmp = (sqrt(-d) / sqrt(-l)) * sqrt((d / h))
else if ((l <= 360.0d0) .or. (.not. (l <= 1.05d+111)) .and. (l <= 3.8d+189)) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + (h * ((-0.5d0) * (((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 <= -1e+108) {
tmp = (Math.sqrt(-d) / Math.sqrt(-l)) * Math.sqrt((d / h));
} else if ((l <= 360.0) || (!(l <= 1.05e+111) && (l <= 3.8e+189))) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (h * (-0.5 * (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 <= -1e+108: tmp = (math.sqrt(-d) / math.sqrt(-l)) * math.sqrt((d / h)) elif (l <= 360.0) or (not (l <= 1.05e+111) and (l <= 3.8e+189)): tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (h * (-0.5 * (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 <= -1e+108) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * sqrt(Float64(d / h))); elseif ((l <= 360.0) || (!(l <= 1.05e+111) && (l <= 3.8e+189))) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(h * Float64(-0.5 * Float64((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 <= -1e+108) tmp = (sqrt(-d) / sqrt(-l)) * sqrt((d / h)); elseif ((l <= 360.0) || (~((l <= 1.05e+111)) && (l <= 3.8e+189))) tmp = sqrt(((d / l) * (d / h))) * (1.0 + (h * (-0.5 * (((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, -1e+108], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 360.0], And[N[Not[LessEqual[l, 1.05e+111]], $MachinePrecision], LessEqual[l, 3.8e+189]]], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(h * N[(-0.5 * N[(N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1 \cdot 10^{+108}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;\ell \leq 360 \lor \neg \left(\ell \leq 1.05 \cdot 10^{+111}\right) \land \ell \leq 3.8 \cdot 10^{+189}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + h \cdot \left(-0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1e108Initial program 53.2%
Simplified51.1%
*-commutative51.1%
clear-num51.0%
un-div-inv51.0%
*-commutative51.0%
add-sqr-sqrt51.0%
pow251.0%
unpow251.0%
sqrt-prod37.2%
add-sqr-sqrt51.0%
associate-/l/51.0%
Applied egg-rr51.0%
frac-2neg51.0%
sqrt-div60.0%
Applied egg-rr60.0%
Taylor expanded in d around inf 53.2%
if -1e108 < l < 360 or 1.04999999999999997e111 < l < 3.7999999999999998e189Initial program 75.3%
Simplified74.1%
add-sqr-sqrt74.1%
pow274.1%
sqrt-prod74.1%
sqrt-pow174.1%
metadata-eval74.1%
pow174.1%
*-commutative74.1%
div-inv74.1%
metadata-eval74.1%
Applied egg-rr74.1%
Applied egg-rr67.6%
unpow167.6%
*-commutative67.6%
*-commutative67.6%
associate-*l*67.6%
associate-*r/68.4%
associate-*l/69.0%
*-commutative69.0%
associate-/l*69.0%
associate-/l*67.1%
*-commutative67.1%
Simplified67.1%
if 360 < l < 1.04999999999999997e111 or 3.7999999999999998e189 < l Initial program 58.8%
Simplified60.5%
add-sqr-sqrt60.5%
pow260.5%
sqrt-prod60.5%
sqrt-pow167.6%
metadata-eval67.6%
pow167.6%
*-commutative67.6%
div-inv67.6%
metadata-eval67.6%
Applied egg-rr67.6%
Taylor expanded in d around inf 57.8%
unpow-157.8%
metadata-eval57.8%
pow-sqr57.9%
rem-sqrt-square57.9%
rem-square-sqrt57.6%
fabs-sqr57.6%
rem-square-sqrt57.9%
Simplified57.9%
*-commutative57.9%
unpow-prod-down77.2%
Applied egg-rr77.2%
Final simplification66.8%
(FPCore (d h l M D)
:precision binary64
(if (<= l -9.5e+107)
(* (sqrt (/ d h)) (/ 1.0 (sqrt (/ l d))))
(if (<= l 28500.0)
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* h (* -0.5 (/ (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 <= -9.5e+107) {
tmp = sqrt((d / h)) * (1.0 / sqrt((l / d)));
} else if (l <= 28500.0) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (h * (-0.5 * (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 <= (-9.5d+107)) then
tmp = sqrt((d / h)) * (1.0d0 / sqrt((l / d)))
else if (l <= 28500.0d0) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + (h * ((-0.5d0) * (((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 <= -9.5e+107) {
tmp = Math.sqrt((d / h)) * (1.0 / Math.sqrt((l / d)));
} else if (l <= 28500.0) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (h * (-0.5 * (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 <= -9.5e+107: tmp = math.sqrt((d / h)) * (1.0 / math.sqrt((l / d))) elif l <= 28500.0: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (h * (-0.5 * (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 <= -9.5e+107) tmp = Float64(sqrt(Float64(d / h)) * Float64(1.0 / sqrt(Float64(l / d)))); elseif (l <= 28500.0) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(h * Float64(-0.5 * Float64((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 <= -9.5e+107) tmp = sqrt((d / h)) * (1.0 / sqrt((l / d))); elseif (l <= 28500.0) tmp = sqrt(((d / l) * (d / h))) * (1.0 + (h * (-0.5 * (((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, -9.5e+107], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 28500.0], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(h * N[(-0.5 * N[(N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $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 -9.5 \cdot 10^{+107}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\\
\mathbf{elif}\;\ell \leq 28500:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + h \cdot \left(-0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -9.50000000000000019e107Initial program 53.2%
Simplified53.2%
Taylor expanded in M around 0 49.0%
clear-num49.0%
sqrt-div49.0%
metadata-eval49.0%
Applied egg-rr49.0%
if -9.50000000000000019e107 < l < 28500Initial program 77.7%
Simplified76.3%
add-sqr-sqrt76.3%
pow276.3%
sqrt-prod76.3%
sqrt-pow176.3%
metadata-eval76.3%
pow176.3%
*-commutative76.3%
div-inv76.3%
metadata-eval76.3%
Applied egg-rr76.3%
Applied egg-rr69.1%
unpow169.1%
*-commutative69.1%
*-commutative69.1%
associate-*l*69.1%
associate-*r/70.7%
associate-*l/70.6%
*-commutative70.6%
associate-/l*70.6%
associate-/l*68.5%
*-commutative68.5%
Simplified68.5%
if 28500 < l Initial program 58.3%
Simplified59.5%
add-sqr-sqrt59.5%
pow259.5%
sqrt-prod59.6%
sqrt-pow164.8%
metadata-eval64.8%
pow164.8%
*-commutative64.8%
div-inv64.8%
metadata-eval64.8%
Applied egg-rr64.8%
Taylor expanded in d around inf 50.4%
unpow-150.4%
metadata-eval50.4%
pow-sqr50.5%
rem-sqrt-square50.5%
rem-square-sqrt50.3%
fabs-sqr50.3%
rem-square-sqrt50.5%
Simplified50.5%
*-commutative50.5%
unpow-prod-down64.9%
Applied egg-rr64.9%
Final simplification64.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (- d) (sqrt (/ (/ 1.0 h) l)))))
(if (<= l -1.3e-200)
t_0
(if (<= l -3.5e-288)
(* d (pow (pow (* h l) 2.0) -0.25))
(if (<= l 3.8e-266) 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 = -d * sqrt(((1.0 / h) / l));
double tmp;
if (l <= -1.3e-200) {
tmp = t_0;
} else if (l <= -3.5e-288) {
tmp = d * pow(pow((h * l), 2.0), -0.25);
} else if (l <= 3.8e-266) {
tmp = t_0;
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = -d * sqrt(((1.0d0 / h) / l))
if (l <= (-1.3d-200)) then
tmp = t_0
else if (l <= (-3.5d-288)) then
tmp = d * (((h * l) ** 2.0d0) ** (-0.25d0))
else if (l <= 3.8d-266) then
tmp = t_0
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = -d * Math.sqrt(((1.0 / h) / l));
double tmp;
if (l <= -1.3e-200) {
tmp = t_0;
} else if (l <= -3.5e-288) {
tmp = d * Math.pow(Math.pow((h * l), 2.0), -0.25);
} else if (l <= 3.8e-266) {
tmp = t_0;
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = -d * math.sqrt(((1.0 / h) / l)) tmp = 0 if l <= -1.3e-200: tmp = t_0 elif l <= -3.5e-288: tmp = d * math.pow(math.pow((h * l), 2.0), -0.25) elif l <= 3.8e-266: tmp = t_0 else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))) tmp = 0.0 if (l <= -1.3e-200) tmp = t_0; elseif (l <= -3.5e-288) tmp = Float64(d * ((Float64(h * l) ^ 2.0) ^ -0.25)); elseif (l <= 3.8e-266) tmp = t_0; else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = -d * sqrt(((1.0 / h) / l)); tmp = 0.0; if (l <= -1.3e-200) tmp = t_0; elseif (l <= -3.5e-288) tmp = d * (((h * l) ^ 2.0) ^ -0.25); elseif (l <= 3.8e-266) tmp = t_0; else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.3e-200], t$95$0, If[LessEqual[l, -3.5e-288], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.8e-266], t$95$0, N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{if}\;\ell \leq -1.3 \cdot 10^{-200}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -3.5 \cdot 10^{-288}:\\
\;\;\;\;d \cdot {\left({\left(h \cdot \ell\right)}^{2}\right)}^{-0.25}\\
\mathbf{elif}\;\ell \leq 3.8 \cdot 10^{-266}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1.29999999999999995e-200 or -3.5000000000000003e-288 < l < 3.79999999999999994e-266Initial program 71.1%
Simplified69.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt47.6%
neg-mul-147.6%
Simplified47.6%
if -1.29999999999999995e-200 < l < -3.5000000000000003e-288Initial program 79.9%
Simplified79.9%
Taylor expanded in d around inf 34.7%
add-log-exp53.6%
pow1/253.6%
inv-pow53.6%
pow-pow53.6%
metadata-eval53.6%
Applied egg-rr53.6%
rem-log-exp34.7%
sqr-pow34.7%
pow-prod-down42.3%
pow242.3%
*-commutative42.3%
metadata-eval42.3%
Applied egg-rr42.3%
if 3.79999999999999994e-266 < l Initial program 63.4%
Simplified64.0%
add-sqr-sqrt64.0%
pow264.0%
sqrt-prod64.0%
sqrt-pow167.0%
metadata-eval67.0%
pow167.0%
*-commutative67.0%
div-inv67.0%
metadata-eval67.0%
Applied egg-rr67.0%
Taylor expanded in d around inf 45.5%
unpow-145.5%
metadata-eval45.5%
pow-sqr45.5%
rem-sqrt-square45.5%
rem-square-sqrt45.3%
fabs-sqr45.3%
rem-square-sqrt45.5%
Simplified45.5%
*-commutative45.5%
unpow-prod-down55.7%
Applied egg-rr55.7%
Final simplification51.2%
(FPCore (d h l M D)
:precision binary64
(if (<= h -7e+107)
(* (sqrt (/ d h)) (/ 1.0 (sqrt (/ l d))))
(if (<= h 1.4e-272)
(* (- d) (sqrt (/ (/ 1.0 h) 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 (h <= -7e+107) {
tmp = sqrt((d / h)) * (1.0 / sqrt((l / d)));
} else if (h <= 1.4e-272) {
tmp = -d * sqrt(((1.0 / h) / 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 (h <= (-7d+107)) then
tmp = sqrt((d / h)) * (1.0d0 / sqrt((l / d)))
else if (h <= 1.4d-272) then
tmp = -d * sqrt(((1.0d0 / h) / 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 (h <= -7e+107) {
tmp = Math.sqrt((d / h)) * (1.0 / Math.sqrt((l / d)));
} else if (h <= 1.4e-272) {
tmp = -d * Math.sqrt(((1.0 / h) / 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 h <= -7e+107: tmp = math.sqrt((d / h)) * (1.0 / math.sqrt((l / d))) elif h <= 1.4e-272: tmp = -d * math.sqrt(((1.0 / h) / 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 (h <= -7e+107) tmp = Float64(sqrt(Float64(d / h)) * Float64(1.0 / sqrt(Float64(l / d)))); elseif (h <= 1.4e-272) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / 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 (h <= -7e+107) tmp = sqrt((d / h)) * (1.0 / sqrt((l / d))); elseif (h <= 1.4e-272) tmp = -d * sqrt(((1.0 / h) / l)); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -7e+107], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 1.4e-272], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $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}\;h \leq -7 \cdot 10^{+107}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\\
\mathbf{elif}\;h \leq 1.4 \cdot 10^{-272}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if h < -6.9999999999999995e107Initial program 65.0%
Simplified65.1%
Taylor expanded in M around 0 41.9%
clear-num41.9%
sqrt-div41.9%
metadata-eval41.9%
Applied egg-rr41.9%
if -6.9999999999999995e107 < h < 1.39999999999999997e-272Initial program 75.0%
Simplified74.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt47.3%
neg-mul-147.3%
Simplified47.3%
if 1.39999999999999997e-272 < h Initial program 64.5%
Simplified64.4%
add-sqr-sqrt64.3%
pow264.3%
sqrt-prod64.4%
sqrt-pow167.2%
metadata-eval67.2%
pow167.2%
*-commutative67.2%
div-inv67.2%
metadata-eval67.2%
Applied egg-rr67.2%
Taylor expanded in d around inf 44.1%
unpow-144.1%
metadata-eval44.1%
pow-sqr44.2%
rem-sqrt-square44.2%
rem-square-sqrt44.0%
fabs-sqr44.0%
rem-square-sqrt44.2%
Simplified44.2%
*-commutative44.2%
unpow-prod-down54.0%
Applied egg-rr54.0%
Final simplification50.0%
(FPCore (d h l M D)
:precision binary64
(if (<= h -7e+111)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (<= h 1.4e-272)
(* (- d) (sqrt (/ (/ 1.0 h) 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 (h <= -7e+111) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if (h <= 1.4e-272) {
tmp = -d * sqrt(((1.0 / h) / 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 (h <= (-7d+111)) then
tmp = sqrt((d / l)) * sqrt((d / h))
else if (h <= 1.4d-272) then
tmp = -d * sqrt(((1.0d0 / h) / 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 (h <= -7e+111) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else if (h <= 1.4e-272) {
tmp = -d * Math.sqrt(((1.0 / h) / 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 h <= -7e+111: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) elif h <= 1.4e-272: tmp = -d * math.sqrt(((1.0 / h) / 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 (h <= -7e+111) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif (h <= 1.4e-272) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / 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 (h <= -7e+111) tmp = sqrt((d / l)) * sqrt((d / h)); elseif (h <= 1.4e-272) tmp = -d * sqrt(((1.0 / h) / l)); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -7e+111], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 1.4e-272], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $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}\;h \leq -7 \cdot 10^{+111}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;h \leq 1.4 \cdot 10^{-272}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if h < -7.0000000000000004e111Initial program 64.1%
Simplified64.2%
Taylor expanded in M around 0 43.0%
if -7.0000000000000004e111 < h < 1.39999999999999997e-272Initial program 75.3%
Simplified74.2%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt46.7%
neg-mul-146.7%
Simplified46.7%
if 1.39999999999999997e-272 < h Initial program 64.5%
Simplified64.4%
add-sqr-sqrt64.3%
pow264.3%
sqrt-prod64.4%
sqrt-pow167.2%
metadata-eval67.2%
pow167.2%
*-commutative67.2%
div-inv67.2%
metadata-eval67.2%
Applied egg-rr67.2%
Taylor expanded in d around inf 44.1%
unpow-144.1%
metadata-eval44.1%
pow-sqr44.2%
rem-sqrt-square44.2%
rem-square-sqrt44.0%
fabs-sqr44.0%
rem-square-sqrt44.2%
Simplified44.2%
*-commutative44.2%
unpow-prod-down54.0%
Applied egg-rr54.0%
Final simplification50.0%
(FPCore (d h l M D) :precision binary64 (if (<= h 1.4e-272) (* (- d) (sqrt (/ (/ 1.0 h) 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 (h <= 1.4e-272) {
tmp = -d * sqrt(((1.0 / h) / 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 (h <= 1.4d-272) then
tmp = -d * sqrt(((1.0d0 / h) / 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 (h <= 1.4e-272) {
tmp = -d * Math.sqrt(((1.0 / h) / 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 h <= 1.4e-272: tmp = -d * math.sqrt(((1.0 / h) / 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 (h <= 1.4e-272) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / 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 (h <= 1.4e-272) tmp = -d * sqrt(((1.0 / h) / l)); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, 1.4e-272], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $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}\;h \leq 1.4 \cdot 10^{-272}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if h < 1.39999999999999997e-272Initial program 72.0%
Simplified71.2%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt40.5%
neg-mul-140.5%
Simplified40.5%
if 1.39999999999999997e-272 < h Initial program 64.5%
Simplified64.4%
add-sqr-sqrt64.3%
pow264.3%
sqrt-prod64.4%
sqrt-pow167.2%
metadata-eval67.2%
pow167.2%
*-commutative67.2%
div-inv67.2%
metadata-eval67.2%
Applied egg-rr67.2%
Taylor expanded in d around inf 44.1%
unpow-144.1%
metadata-eval44.1%
pow-sqr44.2%
rem-sqrt-square44.2%
rem-square-sqrt44.0%
fabs-sqr44.0%
rem-square-sqrt44.2%
Simplified44.2%
*-commutative44.2%
unpow-prod-down54.0%
Applied egg-rr54.0%
Final simplification47.5%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (sqrt (/ (/ 1.0 h) l)))) (if (<= d -3.1e-139) (* (- 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 (d <= -3.1e-139) {
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 (d <= (-3.1d-139)) 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 (d <= -3.1e-139) {
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 d <= -3.1e-139: 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 (d <= -3.1e-139) 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 (d <= -3.1e-139) 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[d, -3.1e-139], 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}\;d \leq -3.1 \cdot 10^{-139}:\\
\;\;\;\;\left(-d\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot t\_0\\
\end{array}
\end{array}
if d < -3.0999999999999999e-139Initial program 77.3%
Simplified76.4%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt47.2%
neg-mul-147.2%
Simplified47.2%
if -3.0999999999999999e-139 < d Initial program 62.7%
Simplified62.6%
Taylor expanded in d around inf 40.8%
associate-/r*41.5%
Simplified41.5%
Final simplification43.6%
(FPCore (d h l M D) :precision binary64 (if (<= d -8.2e-145) (* d (- (pow (* h l) -0.5))) (* d (sqrt (/ (/ 1.0 h) l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -8.2e-145) {
tmp = d * -pow((h * l), -0.5);
} else {
tmp = d * sqrt(((1.0 / h) / l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-8.2d-145)) then
tmp = d * -((h * l) ** (-0.5d0))
else
tmp = d * sqrt(((1.0d0 / h) / l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -8.2e-145) {
tmp = d * -Math.pow((h * l), -0.5);
} else {
tmp = d * Math.sqrt(((1.0 / h) / l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -8.2e-145: tmp = d * -math.pow((h * l), -0.5) else: tmp = d * math.sqrt(((1.0 / h) / l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -8.2e-145) tmp = Float64(d * Float64(-(Float64(h * l) ^ -0.5))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -8.2e-145) tmp = d * -((h * l) ^ -0.5); else tmp = d * sqrt(((1.0 / h) / l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -8.2e-145], N[(d * (-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -8.2 \cdot 10^{-145}:\\
\;\;\;\;d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\end{array}
\end{array}
if d < -8.1999999999999995e-145Initial program 77.3%
Simplified76.4%
add-sqr-sqrt76.4%
pow276.4%
sqrt-prod76.3%
sqrt-pow181.4%
metadata-eval81.4%
pow181.4%
*-commutative81.4%
div-inv81.4%
metadata-eval81.4%
Applied egg-rr81.4%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt46.9%
neg-mul-146.9%
unpow-146.9%
metadata-eval46.9%
pow-sqr46.9%
rem-sqrt-square46.9%
rem-square-sqrt46.7%
fabs-sqr46.7%
rem-square-sqrt46.9%
Simplified46.9%
if -8.1999999999999995e-145 < d Initial program 62.7%
Simplified62.6%
Taylor expanded in d around inf 40.8%
associate-/r*41.5%
Simplified41.5%
(FPCore (d h l M D) :precision binary64 (if (<= d -1.9e-144) (* d (- (pow (* h l) -0.5))) (* d (sqrt (/ 1.0 (* h l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.9e-144) {
tmp = d * -pow((h * l), -0.5);
} else {
tmp = d * sqrt((1.0 / (h * l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-1.9d-144)) then
tmp = d * -((h * l) ** (-0.5d0))
else
tmp = d * sqrt((1.0d0 / (h * l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.9e-144) {
tmp = d * -Math.pow((h * l), -0.5);
} else {
tmp = d * Math.sqrt((1.0 / (h * l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -1.9e-144: tmp = d * -math.pow((h * l), -0.5) else: tmp = d * math.sqrt((1.0 / (h * l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -1.9e-144) tmp = Float64(d * Float64(-(Float64(h * l) ^ -0.5))); else tmp = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -1.9e-144) tmp = d * -((h * l) ^ -0.5); else tmp = d * sqrt((1.0 / (h * l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.9e-144], N[(d * (-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.9 \cdot 10^{-144}:\\
\;\;\;\;d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\end{array}
\end{array}
if d < -1.89999999999999996e-144Initial program 77.3%
Simplified76.4%
add-sqr-sqrt76.4%
pow276.4%
sqrt-prod76.3%
sqrt-pow181.4%
metadata-eval81.4%
pow181.4%
*-commutative81.4%
div-inv81.4%
metadata-eval81.4%
Applied egg-rr81.4%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt46.9%
neg-mul-146.9%
unpow-146.9%
metadata-eval46.9%
pow-sqr46.9%
rem-sqrt-square46.9%
rem-square-sqrt46.7%
fabs-sqr46.7%
rem-square-sqrt46.9%
Simplified46.9%
if -1.89999999999999996e-144 < d Initial program 62.7%
Simplified62.6%
Taylor expanded in d around inf 40.8%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (pow (* h l) -0.5))) (if (<= d -2.1e-144) (* d (- t_0)) (* d t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((h * l), -0.5);
double tmp;
if (d <= -2.1e-144) {
tmp = d * -t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (h * l) ** (-0.5d0)
if (d <= (-2.1d-144)) then
tmp = d * -t_0
else
tmp = d * t_0
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.pow((h * l), -0.5);
double tmp;
if (d <= -2.1e-144) {
tmp = d * -t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((h * l), -0.5) tmp = 0 if d <= -2.1e-144: tmp = d * -t_0 else: tmp = d * t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(h * l) ^ -0.5 tmp = 0.0 if (d <= -2.1e-144) tmp = Float64(d * Float64(-t_0)); else tmp = Float64(d * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (h * l) ^ -0.5; tmp = 0.0; if (d <= -2.1e-144) tmp = d * -t_0; else tmp = d * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[d, -2.1e-144], N[(d * (-t$95$0)), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{if}\;d \leq -2.1 \cdot 10^{-144}:\\
\;\;\;\;d \cdot \left(-t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot t\_0\\
\end{array}
\end{array}
if d < -2.1000000000000001e-144Initial program 77.3%
Simplified76.4%
add-sqr-sqrt76.4%
pow276.4%
sqrt-prod76.3%
sqrt-pow181.4%
metadata-eval81.4%
pow181.4%
*-commutative81.4%
div-inv81.4%
metadata-eval81.4%
Applied egg-rr81.4%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt46.9%
neg-mul-146.9%
unpow-146.9%
metadata-eval46.9%
pow-sqr46.9%
rem-sqrt-square46.9%
rem-square-sqrt46.7%
fabs-sqr46.7%
rem-square-sqrt46.9%
Simplified46.9%
if -2.1000000000000001e-144 < d Initial program 62.7%
Simplified62.6%
add-sqr-sqrt62.6%
pow262.6%
sqrt-prod62.6%
sqrt-pow164.9%
metadata-eval64.9%
pow164.9%
*-commutative64.9%
div-inv64.9%
metadata-eval64.9%
Applied egg-rr64.9%
Taylor expanded in d around inf 40.8%
unpow-140.8%
metadata-eval40.8%
pow-sqr40.8%
rem-sqrt-square40.2%
rem-square-sqrt40.0%
fabs-sqr40.0%
rem-square-sqrt40.2%
Simplified40.2%
(FPCore (d h l M D) :precision binary64 (* d (pow (* h l) -0.5)))
double code(double d, double h, double l, double M, double D) {
return d * pow((h * l), -0.5);
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * ((h * l) ** (-0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.pow((h * l), -0.5);
}
def code(d, h, l, M, D): return d * math.pow((h * l), -0.5)
function code(d, h, l, M, D) return Float64(d * (Float64(h * l) ^ -0.5)) end
function tmp = code(d, h, l, M, D) tmp = d * ((h * l) ^ -0.5); end
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot {\left(h \cdot \ell\right)}^{-0.5}
\end{array}
Initial program 68.1%
Simplified67.7%
add-sqr-sqrt67.7%
pow267.7%
sqrt-prod67.7%
sqrt-pow171.0%
metadata-eval71.0%
pow171.0%
*-commutative71.0%
div-inv71.0%
metadata-eval71.0%
Applied egg-rr71.0%
Taylor expanded in d around inf 28.6%
unpow-128.6%
metadata-eval28.6%
pow-sqr28.6%
rem-sqrt-square28.2%
rem-square-sqrt28.1%
fabs-sqr28.1%
rem-square-sqrt28.2%
Simplified28.2%
herbie shell --seed 2024102
(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)))))