
(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 21 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 (* 0.125 (/ (pow (/ (* M D) d) 2.0) l)))))
(t_1 (sqrt (- d))))
(if (<= l -2e-310)
(* (/ t_1 (sqrt (- h))) (* (/ t_1 (sqrt (- l))) t_0))
(* (/ (sqrt d) (sqrt h)) (* t_0 (sqrt (/ d l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - (h * (0.125 * (pow(((M * D) / d), 2.0) / l)));
double t_1 = sqrt(-d);
double tmp;
if (l <= -2e-310) {
tmp = (t_1 / sqrt(-h)) * ((t_1 / sqrt(-l)) * t_0);
} else {
tmp = (sqrt(d) / sqrt(h)) * (t_0 * sqrt((d / l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (h * (0.125d0 * ((((m * d_1) / d) ** 2.0d0) / l)))
t_1 = sqrt(-d)
if (l <= (-2d-310)) then
tmp = (t_1 / sqrt(-h)) * ((t_1 / sqrt(-l)) * t_0)
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * sqrt((d / l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - (h * (0.125 * (Math.pow(((M * D) / d), 2.0) / l)));
double t_1 = Math.sqrt(-d);
double tmp;
if (l <= -2e-310) {
tmp = (t_1 / Math.sqrt(-h)) * ((t_1 / Math.sqrt(-l)) * t_0);
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * (t_0 * Math.sqrt((d / l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 - (h * (0.125 * (math.pow(((M * D) / d), 2.0) / l))) t_1 = math.sqrt(-d) tmp = 0 if l <= -2e-310: tmp = (t_1 / math.sqrt(-h)) * ((t_1 / math.sqrt(-l)) * t_0) else: tmp = (math.sqrt(d) / math.sqrt(h)) * (t_0 * math.sqrt((d / l))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 - Float64(h * Float64(0.125 * Float64((Float64(Float64(M * D) / d) ^ 2.0) / l)))) t_1 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -2e-310) tmp = Float64(Float64(t_1 / sqrt(Float64(-h))) * Float64(Float64(t_1 / sqrt(Float64(-l))) * t_0)); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(t_0 * sqrt(Float64(d / l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 - (h * (0.125 * ((((M * D) / d) ^ 2.0) / l))); t_1 = sqrt(-d); tmp = 0.0; if (l <= -2e-310) tmp = (t_1 / sqrt(-h)) * ((t_1 / sqrt(-l)) * t_0); else tmp = (sqrt(d) / sqrt(h)) * (t_0 * sqrt((d / l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 - N[(h * N[(0.125 * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -2e-310], N[(N[(t$95$1 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - h \cdot \left(0.125 \cdot \frac{{\left(\frac{M \cdot D}{d}\right)}^{2}}{\ell}\right)\\
t_1 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{t\_1}{\sqrt{-h}} \cdot \left(\frac{t\_1}{\sqrt{-\ell}} \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(t\_0 \cdot \sqrt{\frac{d}{\ell}}\right)\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 62.2%
Simplified61.4%
Taylor expanded in h around -inf 43.3%
associate-*r*43.3%
neg-mul-143.3%
sub-neg43.3%
distribute-lft-in43.3%
Simplified62.4%
associate-*r/63.2%
Applied egg-rr63.2%
frac-2neg63.2%
sqrt-div79.2%
Applied egg-rr79.2%
frac-2neg79.2%
sqrt-div87.3%
Applied egg-rr87.3%
if -1.999999999999994e-310 < l Initial program 66.8%
Simplified66.2%
Taylor expanded in h around -inf 45.2%
associate-*r*45.2%
neg-mul-145.2%
sub-neg45.2%
distribute-lft-in45.2%
Simplified68.5%
associate-*r/68.5%
Applied egg-rr68.5%
sqrt-div79.9%
Applied egg-rr79.9%
Final simplification83.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d))))
(if (<= h -5e-312)
(*
(/ t_0 (sqrt (- h)))
(*
(/ t_0 (sqrt (- l)))
(- 1.0 (* h (* 0.125 (/ (pow (* M (/ D d)) 2.0) l))))))
(*
(/ (sqrt d) (sqrt h))
(*
(- 1.0 (* h (* 0.125 (/ (pow (/ (* M D) d) 2.0) l))))
(sqrt (/ d l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double tmp;
if (h <= -5e-312) {
tmp = (t_0 / sqrt(-h)) * ((t_0 / sqrt(-l)) * (1.0 - (h * (0.125 * (pow((M * (D / d)), 2.0) / l)))));
} else {
tmp = (sqrt(d) / sqrt(h)) * ((1.0 - (h * (0.125 * (pow(((M * D) / d), 2.0) / l)))) * sqrt((d / l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt(-d)
if (h <= (-5d-312)) then
tmp = (t_0 / sqrt(-h)) * ((t_0 / sqrt(-l)) * (1.0d0 - (h * (0.125d0 * (((m * (d_1 / d)) ** 2.0d0) / l)))))
else
tmp = (sqrt(d) / sqrt(h)) * ((1.0d0 - (h * (0.125d0 * ((((m * d_1) / d) ** 2.0d0) / l)))) * sqrt((d / l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(-d);
double tmp;
if (h <= -5e-312) {
tmp = (t_0 / Math.sqrt(-h)) * ((t_0 / Math.sqrt(-l)) * (1.0 - (h * (0.125 * (Math.pow((M * (D / d)), 2.0) / l)))));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * ((1.0 - (h * (0.125 * (Math.pow(((M * D) / d), 2.0) / l)))) * Math.sqrt((d / l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(-d) tmp = 0 if h <= -5e-312: tmp = (t_0 / math.sqrt(-h)) * ((t_0 / math.sqrt(-l)) * (1.0 - (h * (0.125 * (math.pow((M * (D / d)), 2.0) / l))))) else: tmp = (math.sqrt(d) / math.sqrt(h)) * ((1.0 - (h * (0.125 * (math.pow(((M * D) / d), 2.0) / l)))) * math.sqrt((d / l))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) tmp = 0.0 if (h <= -5e-312) tmp = Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(Float64(t_0 / sqrt(Float64(-l))) * Float64(1.0 - Float64(h * Float64(0.125 * Float64((Float64(M * Float64(D / d)) ^ 2.0) / l)))))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(Float64(1.0 - Float64(h * Float64(0.125 * Float64((Float64(Float64(M * D) / d) ^ 2.0) / l)))) * sqrt(Float64(d / l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(-d); tmp = 0.0; if (h <= -5e-312) tmp = (t_0 / sqrt(-h)) * ((t_0 / sqrt(-l)) * (1.0 - (h * (0.125 * (((M * (D / d)) ^ 2.0) / l))))); else tmp = (sqrt(d) / sqrt(h)) * ((1.0 - (h * (0.125 * ((((M * D) / d) ^ 2.0) / l)))) * sqrt((d / l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[h, -5e-312], N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-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], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - N[(h * N[(0.125 * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
\mathbf{if}\;h \leq -5 \cdot 10^{-312}:\\
\;\;\;\;\frac{t\_0}{\sqrt{-h}} \cdot \left(\frac{t\_0}{\sqrt{-\ell}} \cdot \left(1 - h \cdot \left(0.125 \cdot \frac{{\left(M \cdot \frac{D}{d}\right)}^{2}}{\ell}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\left(1 - h \cdot \left(0.125 \cdot \frac{{\left(\frac{M \cdot D}{d}\right)}^{2}}{\ell}\right)\right) \cdot \sqrt{\frac{d}{\ell}}\right)\\
\end{array}
\end{array}
if h < -5.0000000000022e-312Initial program 62.2%
Simplified61.4%
Taylor expanded in h around -inf 43.3%
associate-*r*43.3%
neg-mul-143.3%
sub-neg43.3%
distribute-lft-in43.3%
Simplified62.4%
frac-2neg79.2%
sqrt-div87.3%
Applied egg-rr68.3%
frac-2neg63.2%
sqrt-div79.2%
Applied egg-rr85.8%
if -5.0000000000022e-312 < h Initial program 66.8%
Simplified66.2%
Taylor expanded in h around -inf 45.2%
associate-*r*45.2%
neg-mul-145.2%
sub-neg45.2%
distribute-lft-in45.2%
Simplified68.5%
associate-*r/68.5%
Applied egg-rr68.5%
sqrt-div79.9%
Applied egg-rr79.9%
Final simplification82.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))) (t_1 (* M (/ D d))))
(if (<= l -2e-310)
(*
(/ (sqrt (- d)) (sqrt (- h)))
(* t_0 (- 1.0 (* h (* 0.125 (* t_1 (/ t_1 l)))))))
(if (<= l 8.2e+238)
(*
(/ (sqrt d) (sqrt h))
(* t_0 (- 1.0 (* h (* 0.125 (/ (pow t_1 2.0) l))))))
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = M * (D / d);
double tmp;
if (l <= -2e-310) {
tmp = (sqrt(-d) / sqrt(-h)) * (t_0 * (1.0 - (h * (0.125 * (t_1 * (t_1 / l))))));
} else if (l <= 8.2e+238) {
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0 - (h * (0.125 * (pow(t_1, 2.0) / l)))));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((d / l))
t_1 = m * (d_1 / d)
if (l <= (-2d-310)) then
tmp = (sqrt(-d) / sqrt(-h)) * (t_0 * (1.0d0 - (h * (0.125d0 * (t_1 * (t_1 / l))))))
else if (l <= 8.2d+238) then
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0d0 - (h * (0.125d0 * ((t_1 ** 2.0d0) / l)))))
else
tmp = d / (sqrt(h) * sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double t_1 = M * (D / d);
double tmp;
if (l <= -2e-310) {
tmp = (Math.sqrt(-d) / Math.sqrt(-h)) * (t_0 * (1.0 - (h * (0.125 * (t_1 * (t_1 / l))))));
} else if (l <= 8.2e+238) {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * (t_0 * (1.0 - (h * (0.125 * (Math.pow(t_1, 2.0) / l)))));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = M * (D / d) tmp = 0 if l <= -2e-310: tmp = (math.sqrt(-d) / math.sqrt(-h)) * (t_0 * (1.0 - (h * (0.125 * (t_1 * (t_1 / l)))))) elif l <= 8.2e+238: tmp = (math.sqrt(d) / math.sqrt(h)) * (t_0 * (1.0 - (h * (0.125 * (math.pow(t_1, 2.0) / l))))) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(M * Float64(D / d)) tmp = 0.0 if (l <= -2e-310) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(t_0 * Float64(1.0 - Float64(h * Float64(0.125 * Float64(t_1 * Float64(t_1 / l))))))); elseif (l <= 8.2e+238) tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(t_0 * Float64(1.0 - Float64(h * Float64(0.125 * Float64((t_1 ^ 2.0) / l)))))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = M * (D / d); tmp = 0.0; if (l <= -2e-310) tmp = (sqrt(-d) / sqrt(-h)) * (t_0 * (1.0 - (h * (0.125 * (t_1 * (t_1 / l)))))); elseif (l <= 8.2e+238) tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0 - (h * (0.125 * ((t_1 ^ 2.0) / l))))); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2e-310], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.0 - N[(h * N[(0.125 * N[(t$95$1 * N[(t$95$1 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 8.2e+238], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.0 - N[(h * N[(0.125 * N[(N[Power[t$95$1, 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := M \cdot \frac{D}{d}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(t\_0 \cdot \left(1 - h \cdot \left(0.125 \cdot \left(t\_1 \cdot \frac{t\_1}{\ell}\right)\right)\right)\right)\\
\mathbf{elif}\;\ell \leq 8.2 \cdot 10^{+238}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(t\_0 \cdot \left(1 - h \cdot \left(0.125 \cdot \frac{{t\_1}^{2}}{\ell}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 62.2%
Simplified61.4%
Taylor expanded in h around -inf 43.3%
associate-*r*43.3%
neg-mul-143.3%
sub-neg43.3%
distribute-lft-in43.3%
Simplified62.4%
associate-*r/63.2%
Applied egg-rr63.2%
frac-2neg63.2%
sqrt-div79.2%
Applied egg-rr79.2%
unpow279.2%
*-un-lft-identity79.2%
times-frac79.4%
associate-/l*78.6%
associate-/l*78.6%
Applied egg-rr78.6%
if -1.999999999999994e-310 < l < 8.1999999999999998e238Initial program 68.9%
Simplified68.1%
Taylor expanded in h around -inf 46.9%
associate-*r*46.9%
neg-mul-146.9%
sub-neg46.9%
distribute-lft-in46.9%
Simplified70.8%
sqrt-div82.2%
Applied egg-rr82.2%
if 8.1999999999999998e238 < l Initial program 52.2%
Simplified52.1%
Taylor expanded in d around inf 50.2%
expm1-log1p-u47.1%
expm1-undefine47.1%
Applied egg-rr47.1%
sub-neg47.1%
metadata-eval47.1%
+-commutative47.1%
log1p-undefine47.1%
rem-exp-log50.2%
+-commutative50.2%
fma-define50.2%
Simplified50.2%
sqrt-div50.1%
metadata-eval50.1%
un-div-inv50.1%
+-commutative50.1%
fma-undefine50.1%
associate-+l+50.1%
metadata-eval50.1%
Applied egg-rr50.1%
+-rgt-identity50.1%
Simplified50.1%
*-commutative50.1%
sqrt-prod85.3%
Applied egg-rr85.3%
Final simplification80.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(- 1.0 (* h (* 0.125 (/ (pow (/ (* M D) d) 2.0) l))))
(sqrt (/ d l)))))
(if (<= h -5e-312)
(* (/ (sqrt (- d)) (sqrt (- h))) t_0)
(* (/ (sqrt d) (sqrt h)) t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (1.0 - (h * (0.125 * (pow(((M * D) / d), 2.0) / l)))) * sqrt((d / l));
double tmp;
if (h <= -5e-312) {
tmp = (sqrt(-d) / sqrt(-h)) * t_0;
} else {
tmp = (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 = (1.0d0 - (h * (0.125d0 * ((((m * d_1) / d) ** 2.0d0) / l)))) * sqrt((d / l))
if (h <= (-5d-312)) then
tmp = (sqrt(-d) / sqrt(-h)) * t_0
else
tmp = (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 = (1.0 - (h * (0.125 * (Math.pow(((M * D) / d), 2.0) / l)))) * Math.sqrt((d / l));
double tmp;
if (h <= -5e-312) {
tmp = (Math.sqrt(-d) / Math.sqrt(-h)) * t_0;
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (1.0 - (h * (0.125 * (math.pow(((M * D) / d), 2.0) / l)))) * math.sqrt((d / l)) tmp = 0 if h <= -5e-312: tmp = (math.sqrt(-d) / math.sqrt(-h)) * t_0 else: tmp = (math.sqrt(d) / math.sqrt(h)) * t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(1.0 - Float64(h * Float64(0.125 * Float64((Float64(Float64(M * D) / d) ^ 2.0) / l)))) * sqrt(Float64(d / l))) tmp = 0.0 if (h <= -5e-312) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * t_0); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (1.0 - (h * (0.125 * ((((M * D) / d) ^ 2.0) / l)))) * sqrt((d / l)); tmp = 0.0; if (h <= -5e-312) tmp = (sqrt(-d) / sqrt(-h)) * t_0; else tmp = (sqrt(d) / sqrt(h)) * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(1.0 - N[(h * N[(0.125 * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -5e-312], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 - h \cdot \left(0.125 \cdot \frac{{\left(\frac{M \cdot D}{d}\right)}^{2}}{\ell}\right)\right) \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;h \leq -5 \cdot 10^{-312}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot t\_0\\
\end{array}
\end{array}
if h < -5.0000000000022e-312Initial program 62.2%
Simplified61.4%
Taylor expanded in h around -inf 43.3%
associate-*r*43.3%
neg-mul-143.3%
sub-neg43.3%
distribute-lft-in43.3%
Simplified62.4%
associate-*r/63.2%
Applied egg-rr63.2%
frac-2neg63.2%
sqrt-div79.2%
Applied egg-rr79.2%
if -5.0000000000022e-312 < h Initial program 66.8%
Simplified66.2%
Taylor expanded in h around -inf 45.2%
associate-*r*45.2%
neg-mul-145.2%
sub-neg45.2%
distribute-lft-in45.2%
Simplified68.5%
associate-*r/68.5%
Applied egg-rr68.5%
sqrt-div79.9%
Applied egg-rr79.9%
Final simplification79.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))) (t_1 (* M (/ D d))))
(if (<= l -2e-310)
(*
(/ (sqrt (- d)) (sqrt (- h)))
(* t_0 (- 1.0 (* h (* 0.125 (* t_1 (/ t_1 l)))))))
(*
(/ (sqrt d) (sqrt h))
(* (- 1.0 (* h (* 0.125 (/ (pow (/ (* M D) d) 2.0) l)))) t_0)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = M * (D / d);
double tmp;
if (l <= -2e-310) {
tmp = (sqrt(-d) / sqrt(-h)) * (t_0 * (1.0 - (h * (0.125 * (t_1 * (t_1 / l))))));
} else {
tmp = (sqrt(d) / sqrt(h)) * ((1.0 - (h * (0.125 * (pow(((M * D) / d), 2.0) / 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) :: t_1
real(8) :: tmp
t_0 = sqrt((d / l))
t_1 = m * (d_1 / d)
if (l <= (-2d-310)) then
tmp = (sqrt(-d) / sqrt(-h)) * (t_0 * (1.0d0 - (h * (0.125d0 * (t_1 * (t_1 / l))))))
else
tmp = (sqrt(d) / sqrt(h)) * ((1.0d0 - (h * (0.125d0 * ((((m * d_1) / d) ** 2.0d0) / l)))) * t_0)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double t_1 = M * (D / d);
double tmp;
if (l <= -2e-310) {
tmp = (Math.sqrt(-d) / Math.sqrt(-h)) * (t_0 * (1.0 - (h * (0.125 * (t_1 * (t_1 / l))))));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * ((1.0 - (h * (0.125 * (Math.pow(((M * D) / d), 2.0) / l)))) * t_0);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = M * (D / d) tmp = 0 if l <= -2e-310: tmp = (math.sqrt(-d) / math.sqrt(-h)) * (t_0 * (1.0 - (h * (0.125 * (t_1 * (t_1 / l)))))) else: tmp = (math.sqrt(d) / math.sqrt(h)) * ((1.0 - (h * (0.125 * (math.pow(((M * D) / d), 2.0) / l)))) * t_0) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(M * Float64(D / d)) tmp = 0.0 if (l <= -2e-310) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(t_0 * Float64(1.0 - Float64(h * Float64(0.125 * Float64(t_1 * Float64(t_1 / l))))))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(Float64(1.0 - Float64(h * Float64(0.125 * Float64((Float64(Float64(M * D) / d) ^ 2.0) / l)))) * t_0)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = M * (D / d); tmp = 0.0; if (l <= -2e-310) tmp = (sqrt(-d) / sqrt(-h)) * (t_0 * (1.0 - (h * (0.125 * (t_1 * (t_1 / l)))))); else tmp = (sqrt(d) / sqrt(h)) * ((1.0 - (h * (0.125 * ((((M * D) / d) ^ 2.0) / l)))) * t_0); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2e-310], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.0 - N[(h * N[(0.125 * N[(t$95$1 * N[(t$95$1 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - N[(h * N[(0.125 * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := M \cdot \frac{D}{d}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(t\_0 \cdot \left(1 - h \cdot \left(0.125 \cdot \left(t\_1 \cdot \frac{t\_1}{\ell}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\left(1 - h \cdot \left(0.125 \cdot \frac{{\left(\frac{M \cdot D}{d}\right)}^{2}}{\ell}\right)\right) \cdot t\_0\right)\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 62.2%
Simplified61.4%
Taylor expanded in h around -inf 43.3%
associate-*r*43.3%
neg-mul-143.3%
sub-neg43.3%
distribute-lft-in43.3%
Simplified62.4%
associate-*r/63.2%
Applied egg-rr63.2%
frac-2neg63.2%
sqrt-div79.2%
Applied egg-rr79.2%
unpow279.2%
*-un-lft-identity79.2%
times-frac79.4%
associate-/l*78.6%
associate-/l*78.6%
Applied egg-rr78.6%
if -1.999999999999994e-310 < l Initial program 66.8%
Simplified66.2%
Taylor expanded in h around -inf 45.2%
associate-*r*45.2%
neg-mul-145.2%
sub-neg45.2%
distribute-lft-in45.2%
Simplified68.5%
associate-*r/68.5%
Applied egg-rr68.5%
sqrt-div79.9%
Applied egg-rr79.9%
Final simplification79.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* M (/ D d))))
(if (<= l -2e-310)
(*
(/ (sqrt (- d)) (sqrt (- h)))
(* (sqrt (/ d l)) (- 1.0 (* h (* 0.125 (* t_0 (/ t_0 l)))))))
(if (<= l 3.1e+184)
(*
(* d (pow (* l h) -0.5))
(- 1.0 (* 0.5 (* (pow (* (/ D d) (/ M 2.0)) 2.0) (/ h l)))))
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = M * (D / d);
double tmp;
if (l <= -2e-310) {
tmp = (sqrt(-d) / sqrt(-h)) * (sqrt((d / l)) * (1.0 - (h * (0.125 * (t_0 * (t_0 / l))))));
} else if (l <= 3.1e+184) {
tmp = (d * pow((l * h), -0.5)) * (1.0 - (0.5 * (pow(((D / d) * (M / 2.0)), 2.0) * (h / l))));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = m * (d_1 / d)
if (l <= (-2d-310)) then
tmp = (sqrt(-d) / sqrt(-h)) * (sqrt((d / l)) * (1.0d0 - (h * (0.125d0 * (t_0 * (t_0 / l))))))
else if (l <= 3.1d+184) then
tmp = (d * ((l * h) ** (-0.5d0))) * (1.0d0 - (0.5d0 * ((((d_1 / d) * (m / 2.0d0)) ** 2.0d0) * (h / l))))
else
tmp = d / (sqrt(h) * sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = M * (D / d);
double tmp;
if (l <= -2e-310) {
tmp = (Math.sqrt(-d) / Math.sqrt(-h)) * (Math.sqrt((d / l)) * (1.0 - (h * (0.125 * (t_0 * (t_0 / l))))));
} else if (l <= 3.1e+184) {
tmp = (d * Math.pow((l * h), -0.5)) * (1.0 - (0.5 * (Math.pow(((D / d) * (M / 2.0)), 2.0) * (h / l))));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = M * (D / d) tmp = 0 if l <= -2e-310: tmp = (math.sqrt(-d) / math.sqrt(-h)) * (math.sqrt((d / l)) * (1.0 - (h * (0.125 * (t_0 * (t_0 / l)))))) elif l <= 3.1e+184: tmp = (d * math.pow((l * h), -0.5)) * (1.0 - (0.5 * (math.pow(((D / d) * (M / 2.0)), 2.0) * (h / l)))) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = Float64(M * Float64(D / d)) tmp = 0.0 if (l <= -2e-310) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(h * Float64(0.125 * Float64(t_0 * Float64(t_0 / l))))))); elseif (l <= 3.1e+184) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0) * Float64(h / l))))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = M * (D / d); tmp = 0.0; if (l <= -2e-310) tmp = (sqrt(-d) / sqrt(-h)) * (sqrt((d / l)) * (1.0 - (h * (0.125 * (t_0 * (t_0 / l)))))); elseif (l <= 3.1e+184) tmp = (d * ((l * h) ^ -0.5)) * (1.0 - (0.5 * ((((D / d) * (M / 2.0)) ^ 2.0) * (h / l)))); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2e-310], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(h * N[(0.125 * N[(t$95$0 * N[(t$95$0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.1e+184], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M \cdot \frac{D}{d}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - h \cdot \left(0.125 \cdot \left(t\_0 \cdot \frac{t\_0}{\ell}\right)\right)\right)\right)\\
\mathbf{elif}\;\ell \leq 3.1 \cdot 10^{+184}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 62.2%
Simplified61.4%
Taylor expanded in h around -inf 43.3%
associate-*r*43.3%
neg-mul-143.3%
sub-neg43.3%
distribute-lft-in43.3%
Simplified62.4%
associate-*r/63.2%
Applied egg-rr63.2%
frac-2neg63.2%
sqrt-div79.2%
Applied egg-rr79.2%
unpow279.2%
*-un-lft-identity79.2%
times-frac79.4%
associate-/l*78.6%
associate-/l*78.6%
Applied egg-rr78.6%
if -1.999999999999994e-310 < l < 3.0999999999999998e184Initial program 71.6%
Simplified71.6%
frac-2neg72.8%
sqrt-div0.0%
Applied egg-rr0.0%
Taylor expanded in d around 0 80.3%
unpow-180.3%
metadata-eval80.3%
pow-sqr80.3%
rem-sqrt-square80.8%
rem-square-sqrt80.5%
fabs-sqr80.5%
rem-square-sqrt80.8%
Simplified80.8%
if 3.0999999999999998e184 < l Initial program 47.5%
Simplified47.5%
Taylor expanded in d around inf 40.3%
expm1-log1p-u37.7%
expm1-undefine36.9%
Applied egg-rr36.9%
sub-neg36.9%
metadata-eval36.9%
+-commutative36.9%
log1p-undefine36.9%
rem-exp-log39.4%
+-commutative39.4%
fma-define39.4%
Simplified39.4%
sqrt-div39.4%
metadata-eval39.4%
un-div-inv39.4%
+-commutative39.4%
fma-undefine39.4%
associate-+l+40.2%
metadata-eval40.2%
Applied egg-rr40.2%
+-rgt-identity40.2%
Simplified40.2%
*-commutative40.2%
sqrt-prod69.1%
Applied egg-rr69.1%
Final simplification78.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (- 1.0 (* 0.5 (* (pow (* (/ D d) (/ M 2.0)) 2.0) (/ h l))))))
(if (<= l -4.4e+93)
(* (- d) (sqrt (/ (/ 1.0 l) h)))
(if (<= l 2e-306)
(* t_0 (sqrt (* (/ d l) (/ d h))))
(if (<= l 2.7e+181)
(* (* d (pow (* l h) -0.5)) t_0)
(/ d (* (sqrt h) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - (0.5 * (pow(((D / d) * (M / 2.0)), 2.0) * (h / l)));
double tmp;
if (l <= -4.4e+93) {
tmp = -d * sqrt(((1.0 / l) / h));
} else if (l <= 2e-306) {
tmp = t_0 * sqrt(((d / l) * (d / h)));
} else if (l <= 2.7e+181) {
tmp = (d * pow((l * h), -0.5)) * t_0;
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - (0.5d0 * ((((d_1 / d) * (m / 2.0d0)) ** 2.0d0) * (h / l)))
if (l <= (-4.4d+93)) then
tmp = -d * sqrt(((1.0d0 / l) / h))
else if (l <= 2d-306) then
tmp = t_0 * sqrt(((d / l) * (d / h)))
else if (l <= 2.7d+181) then
tmp = (d * ((l * h) ** (-0.5d0))) * t_0
else
tmp = d / (sqrt(h) * sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - (0.5 * (Math.pow(((D / d) * (M / 2.0)), 2.0) * (h / l)));
double tmp;
if (l <= -4.4e+93) {
tmp = -d * Math.sqrt(((1.0 / l) / h));
} else if (l <= 2e-306) {
tmp = t_0 * Math.sqrt(((d / l) * (d / h)));
} else if (l <= 2.7e+181) {
tmp = (d * Math.pow((l * h), -0.5)) * t_0;
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 - (0.5 * (math.pow(((D / d) * (M / 2.0)), 2.0) * (h / l))) tmp = 0 if l <= -4.4e+93: tmp = -d * math.sqrt(((1.0 / l) / h)) elif l <= 2e-306: tmp = t_0 * math.sqrt(((d / l) * (d / h))) elif l <= 2.7e+181: tmp = (d * math.pow((l * h), -0.5)) * t_0 else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0) * Float64(h / l)))) tmp = 0.0 if (l <= -4.4e+93) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / l) / h))); elseif (l <= 2e-306) tmp = Float64(t_0 * sqrt(Float64(Float64(d / l) * Float64(d / h)))); elseif (l <= 2.7e+181) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * t_0); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 - (0.5 * ((((D / d) * (M / 2.0)) ^ 2.0) * (h / l))); tmp = 0.0; if (l <= -4.4e+93) tmp = -d * sqrt(((1.0 / l) / h)); elseif (l <= 2e-306) tmp = t_0 * sqrt(((d / l) * (d / h))); elseif (l <= 2.7e+181) tmp = (d * ((l * h) ^ -0.5)) * t_0; else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -4.4e+93], N[((-d) * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2e-306], N[(t$95$0 * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.7e+181], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - 0.5 \cdot \left({\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot \frac{h}{\ell}\right)\\
\mathbf{if}\;\ell \leq -4.4 \cdot 10^{+93}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\mathbf{elif}\;\ell \leq 2 \cdot 10^{-306}:\\
\;\;\;\;t\_0 \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{elif}\;\ell \leq 2.7 \cdot 10^{+181}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.40000000000000042e93Initial program 51.0%
Simplified50.9%
Taylor expanded in d around inf 2.8%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt65.2%
*-commutative65.2%
associate-*r*65.2%
*-commutative65.2%
associate-/r*66.8%
neg-mul-166.8%
Simplified66.8%
if -4.40000000000000042e93 < l < 2.00000000000000006e-306Initial program 68.5%
Simplified67.3%
pow167.3%
sqrt-unprod57.0%
Applied egg-rr57.0%
unpow157.0%
Simplified57.0%
if 2.00000000000000006e-306 < l < 2.70000000000000007e181Initial program 71.6%
Simplified71.6%
frac-2neg72.8%
sqrt-div0.0%
Applied egg-rr0.0%
Taylor expanded in d around 0 80.3%
unpow-180.3%
metadata-eval80.3%
pow-sqr80.3%
rem-sqrt-square80.8%
rem-square-sqrt80.5%
fabs-sqr80.5%
rem-square-sqrt80.8%
Simplified80.8%
if 2.70000000000000007e181 < l Initial program 47.5%
Simplified47.5%
Taylor expanded in d around inf 40.3%
expm1-log1p-u37.7%
expm1-undefine36.9%
Applied egg-rr36.9%
sub-neg36.9%
metadata-eval36.9%
+-commutative36.9%
log1p-undefine36.9%
rem-exp-log39.4%
+-commutative39.4%
fma-define39.4%
Simplified39.4%
sqrt-div39.4%
metadata-eval39.4%
un-div-inv39.4%
+-commutative39.4%
fma-undefine39.4%
associate-+l+40.2%
metadata-eval40.2%
Applied egg-rr40.2%
+-rgt-identity40.2%
Simplified40.2%
*-commutative40.2%
sqrt-prod69.1%
Applied egg-rr69.1%
Final simplification69.7%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.5e-172)
(* (- d) (sqrt (/ (/ 1.0 l) h)))
(if (<= l -2e-310)
(/ d (sqrt (+ -1.0 (fma h l 1.0))))
(if (<= l 3.2e+182)
(*
(* d (pow (* l h) -0.5))
(- 1.0 (* 0.5 (* (pow (* (/ D d) (/ M 2.0)) 2.0) (/ h l)))))
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.5e-172) {
tmp = -d * sqrt(((1.0 / l) / h));
} else if (l <= -2e-310) {
tmp = d / sqrt((-1.0 + fma(h, l, 1.0)));
} else if (l <= 3.2e+182) {
tmp = (d * pow((l * h), -0.5)) * (1.0 - (0.5 * (pow(((D / d) * (M / 2.0)), 2.0) * (h / l))));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.5e-172) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / l) / h))); elseif (l <= -2e-310) tmp = Float64(d / sqrt(Float64(-1.0 + fma(h, l, 1.0)))); elseif (l <= 3.2e+182) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0) * Float64(h / l))))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.5e-172], N[((-d) * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(d / N[Sqrt[N[(-1.0 + N[(h * l + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.2e+182], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.5 \cdot 10^{-172}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{d}{\sqrt{-1 + \mathsf{fma}\left(h, \ell, 1\right)}}\\
\mathbf{elif}\;\ell \leq 3.2 \cdot 10^{+182}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.49999999999999992e-172Initial program 55.5%
Simplified54.3%
Taylor expanded in d around inf 3.9%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt54.0%
*-commutative54.0%
associate-*r*54.0%
*-commutative54.0%
associate-/r*54.9%
neg-mul-154.9%
Simplified54.9%
if -1.49999999999999992e-172 < l < -1.999999999999994e-310Initial program 76.0%
Simplified76.0%
Taylor expanded in d around inf 33.5%
expm1-log1p-u33.5%
expm1-undefine47.9%
Applied egg-rr47.9%
sub-neg47.9%
metadata-eval47.9%
+-commutative47.9%
log1p-undefine47.9%
rem-exp-log47.9%
+-commutative47.9%
fma-define47.9%
Simplified47.9%
sqrt-div47.9%
metadata-eval47.9%
un-div-inv47.9%
+-commutative47.9%
fma-undefine47.9%
associate-+l+28.8%
metadata-eval28.8%
Applied egg-rr28.8%
+-rgt-identity28.8%
Simplified28.8%
expm1-log1p-u33.5%
expm1-undefine47.9%
Applied egg-rr47.9%
sub-neg47.9%
metadata-eval47.9%
+-commutative47.9%
log1p-undefine47.9%
rem-exp-log47.9%
+-commutative47.9%
fma-define47.9%
Simplified47.9%
if -1.999999999999994e-310 < l < 3.1999999999999997e182Initial program 71.6%
Simplified71.6%
frac-2neg72.8%
sqrt-div0.0%
Applied egg-rr0.0%
Taylor expanded in d around 0 80.3%
unpow-180.3%
metadata-eval80.3%
pow-sqr80.3%
rem-sqrt-square80.8%
rem-square-sqrt80.5%
fabs-sqr80.5%
rem-square-sqrt80.8%
Simplified80.8%
if 3.1999999999999997e182 < l Initial program 47.5%
Simplified47.5%
Taylor expanded in d around inf 40.3%
expm1-log1p-u37.7%
expm1-undefine36.9%
Applied egg-rr36.9%
sub-neg36.9%
metadata-eval36.9%
+-commutative36.9%
log1p-undefine36.9%
rem-exp-log39.4%
+-commutative39.4%
fma-define39.4%
Simplified39.4%
sqrt-div39.4%
metadata-eval39.4%
un-div-inv39.4%
+-commutative39.4%
fma-undefine39.4%
associate-+l+40.2%
metadata-eval40.2%
Applied egg-rr40.2%
+-rgt-identity40.2%
Simplified40.2%
*-commutative40.2%
sqrt-prod69.1%
Applied egg-rr69.1%
Final simplification65.8%
(FPCore (d h l M D)
:precision binary64
(if (<= l -5.6e-174)
(* (- d) (sqrt (/ (/ 1.0 l) h)))
(if (<= l 1.95e-301)
(/ d (sqrt (+ -1.0 (fma h l 1.0))))
(if (<= l 2.45e-65)
(* (/ d (sqrt (* l h))) (* -0.125 (* h (/ (pow (/ D (/ d M)) 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 <= -5.6e-174) {
tmp = -d * sqrt(((1.0 / l) / h));
} else if (l <= 1.95e-301) {
tmp = d / sqrt((-1.0 + fma(h, l, 1.0)));
} else if (l <= 2.45e-65) {
tmp = (d / sqrt((l * h))) * (-0.125 * (h * (pow((D / (d / M)), 2.0) / l)));
} 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 <= -5.6e-174) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / l) / h))); elseif (l <= 1.95e-301) tmp = Float64(d / sqrt(Float64(-1.0 + fma(h, l, 1.0)))); elseif (l <= 2.45e-65) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * Float64(-0.125 * Float64(h * Float64((Float64(D / Float64(d / M)) ^ 2.0) / l)))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -5.6e-174], N[((-d) * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.95e-301], N[(d / N[Sqrt[N[(-1.0 + N[(h * l + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.45e-65], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-0.125 * N[(h * N[(N[Power[N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision], 2.0], $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 -5.6 \cdot 10^{-174}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\mathbf{elif}\;\ell \leq 1.95 \cdot 10^{-301}:\\
\;\;\;\;\frac{d}{\sqrt{-1 + \mathsf{fma}\left(h, \ell, 1\right)}}\\
\mathbf{elif}\;\ell \leq 2.45 \cdot 10^{-65}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(-0.125 \cdot \left(h \cdot \frac{{\left(\frac{D}{\frac{d}{M}}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -5.59999999999999998e-174Initial program 55.5%
Simplified54.3%
Taylor expanded in d around inf 3.9%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt54.0%
*-commutative54.0%
associate-*r*54.0%
*-commutative54.0%
associate-/r*54.9%
neg-mul-154.9%
Simplified54.9%
if -5.59999999999999998e-174 < l < 1.9500000000000001e-301Initial program 76.5%
Simplified76.5%
Taylor expanded in d around inf 35.1%
expm1-log1p-u35.1%
expm1-undefine49.1%
Applied egg-rr49.1%
sub-neg49.1%
metadata-eval49.1%
+-commutative49.1%
log1p-undefine49.1%
rem-exp-log49.1%
+-commutative49.1%
fma-define49.1%
Simplified49.1%
sqrt-div49.1%
metadata-eval49.1%
un-div-inv49.1%
+-commutative49.1%
fma-undefine49.1%
associate-+l+30.5%
metadata-eval30.5%
Applied egg-rr30.5%
+-rgt-identity30.5%
Simplified30.5%
expm1-log1p-u35.1%
expm1-undefine49.1%
Applied egg-rr49.1%
sub-neg49.1%
metadata-eval49.1%
+-commutative49.1%
log1p-undefine49.1%
rem-exp-log49.1%
+-commutative49.1%
fma-define49.1%
Simplified49.1%
if 1.9500000000000001e-301 < l < 2.44999999999999982e-65Initial program 70.2%
Simplified70.3%
Taylor expanded in M around inf 28.1%
associate-*r*30.4%
times-frac32.6%
*-commutative32.6%
associate-/l*30.5%
unpow230.5%
unpow230.5%
unpow230.5%
times-frac34.7%
swap-sqr43.2%
unpow243.2%
Simplified43.2%
pow143.2%
associate-*r*43.1%
sqrt-div62.4%
sqrt-div62.4%
frac-times62.4%
add-sqr-sqrt62.4%
sqrt-prod62.3%
Applied egg-rr62.3%
unpow162.3%
associate-*r/62.5%
*-commutative62.5%
associate-/l*62.5%
*-commutative62.5%
associate-/r/62.5%
Simplified62.5%
if 2.44999999999999982e-65 < l Initial program 64.5%
Simplified63.5%
Taylor expanded in d around inf 48.0%
*-un-lft-identity48.0%
pow1/248.0%
inv-pow48.0%
pow-pow48.1%
metadata-eval48.1%
Applied egg-rr48.1%
*-lft-identity48.1%
Simplified48.1%
*-commutative48.1%
unpow-prod-down60.4%
Applied egg-rr60.4%
Final simplification57.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* 0.5 (* (pow (* (/ D d) (/ M 2.0)) 2.0) (/ h l)))))
(if (<= l -2e-310)
(* (* d (sqrt (/ 1.0 (* l h)))) (+ t_0 -1.0))
(if (<= l 3.2e+182)
(* (* d (pow (* l h) -0.5)) (- 1.0 t_0))
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (pow(((D / d) * (M / 2.0)), 2.0) * (h / l));
double tmp;
if (l <= -2e-310) {
tmp = (d * sqrt((1.0 / (l * h)))) * (t_0 + -1.0);
} else if (l <= 3.2e+182) {
tmp = (d * pow((l * h), -0.5)) * (1.0 - t_0);
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = 0.5d0 * ((((d_1 / d) * (m / 2.0d0)) ** 2.0d0) * (h / l))
if (l <= (-2d-310)) then
tmp = (d * sqrt((1.0d0 / (l * h)))) * (t_0 + (-1.0d0))
else if (l <= 3.2d+182) then
tmp = (d * ((l * h) ** (-0.5d0))) * (1.0d0 - t_0)
else
tmp = d / (sqrt(h) * sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (Math.pow(((D / d) * (M / 2.0)), 2.0) * (h / l));
double tmp;
if (l <= -2e-310) {
tmp = (d * Math.sqrt((1.0 / (l * h)))) * (t_0 + -1.0);
} else if (l <= 3.2e+182) {
tmp = (d * Math.pow((l * h), -0.5)) * (1.0 - t_0);
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 0.5 * (math.pow(((D / d) * (M / 2.0)), 2.0) * (h / l)) tmp = 0 if l <= -2e-310: tmp = (d * math.sqrt((1.0 / (l * h)))) * (t_0 + -1.0) elif l <= 3.2e+182: tmp = (d * math.pow((l * h), -0.5)) * (1.0 - t_0) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = Float64(0.5 * Float64((Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0) * Float64(h / l))) tmp = 0.0 if (l <= -2e-310) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(t_0 + -1.0)); elseif (l <= 3.2e+182) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(1.0 - t_0)); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 0.5 * ((((D / d) * (M / 2.0)) ^ 2.0) * (h / l)); tmp = 0.0; if (l <= -2e-310) tmp = (d * sqrt((1.0 / (l * h)))) * (t_0 + -1.0); elseif (l <= 3.2e+182) tmp = (d * ((l * h) ^ -0.5)) * (1.0 - t_0); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(0.5 * N[(N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2e-310], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.2e+182], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left({\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot \frac{h}{\ell}\right)\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(t\_0 + -1\right)\\
\mathbf{elif}\;\ell \leq 3.2 \cdot 10^{+182}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(1 - t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 62.2%
Simplified61.4%
frac-2neg63.2%
sqrt-div79.2%
Applied egg-rr77.4%
Taylor expanded in d around -inf 72.1%
if -1.999999999999994e-310 < l < 3.1999999999999997e182Initial program 71.6%
Simplified71.6%
frac-2neg72.8%
sqrt-div0.0%
Applied egg-rr0.0%
Taylor expanded in d around 0 80.3%
unpow-180.3%
metadata-eval80.3%
pow-sqr80.3%
rem-sqrt-square80.8%
rem-square-sqrt80.5%
fabs-sqr80.5%
rem-square-sqrt80.8%
Simplified80.8%
if 3.1999999999999997e182 < l Initial program 47.5%
Simplified47.5%
Taylor expanded in d around inf 40.3%
expm1-log1p-u37.7%
expm1-undefine36.9%
Applied egg-rr36.9%
sub-neg36.9%
metadata-eval36.9%
+-commutative36.9%
log1p-undefine36.9%
rem-exp-log39.4%
+-commutative39.4%
fma-define39.4%
Simplified39.4%
sqrt-div39.4%
metadata-eval39.4%
un-div-inv39.4%
+-commutative39.4%
fma-undefine39.4%
associate-+l+40.2%
metadata-eval40.2%
Applied egg-rr40.2%
+-rgt-identity40.2%
Simplified40.2%
*-commutative40.2%
sqrt-prod69.1%
Applied egg-rr69.1%
Final simplification75.3%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.42e-162)
(* (- d) (sqrt (/ (/ 1.0 l) h)))
(if (<= l 3.5e-301)
(/ d (sqrt (+ -1.0 (fma h l 1.0))))
(if (<= l 8.5e-254)
(* (sqrt (/ d h)) (/ (pow (/ d l) 1.5) (/ 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 <= -1.42e-162) {
tmp = -d * sqrt(((1.0 / l) / h));
} else if (l <= 3.5e-301) {
tmp = d / sqrt((-1.0 + fma(h, l, 1.0)));
} else if (l <= 8.5e-254) {
tmp = sqrt((d / h)) * (pow((d / l), 1.5) / (d / -l));
} 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 <= -1.42e-162) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / l) / h))); elseif (l <= 3.5e-301) tmp = Float64(d / sqrt(Float64(-1.0 + fma(h, l, 1.0)))); elseif (l <= 8.5e-254) tmp = Float64(sqrt(Float64(d / h)) * Float64((Float64(d / l) ^ 1.5) / Float64(d / Float64(-l)))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.42e-162], N[((-d) * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.5e-301], N[(d / N[Sqrt[N[(-1.0 + N[(h * l + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 8.5e-254], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], 1.5], $MachinePrecision] / N[(d / (-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}\;\ell \leq -1.42 \cdot 10^{-162}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\mathbf{elif}\;\ell \leq 3.5 \cdot 10^{-301}:\\
\;\;\;\;\frac{d}{\sqrt{-1 + \mathsf{fma}\left(h, \ell, 1\right)}}\\
\mathbf{elif}\;\ell \leq 8.5 \cdot 10^{-254}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \frac{{\left(\frac{d}{\ell}\right)}^{1.5}}{\frac{d}{-\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1.41999999999999989e-162Initial program 55.5%
Simplified54.3%
Taylor expanded in d around inf 3.9%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt54.0%
*-commutative54.0%
associate-*r*54.0%
*-commutative54.0%
associate-/r*54.9%
neg-mul-154.9%
Simplified54.9%
if -1.41999999999999989e-162 < l < 3.49999999999999992e-301Initial program 76.5%
Simplified76.5%
Taylor expanded in d around inf 35.1%
expm1-log1p-u35.1%
expm1-undefine49.1%
Applied egg-rr49.1%
sub-neg49.1%
metadata-eval49.1%
+-commutative49.1%
log1p-undefine49.1%
rem-exp-log49.1%
+-commutative49.1%
fma-define49.1%
Simplified49.1%
sqrt-div49.1%
metadata-eval49.1%
un-div-inv49.1%
+-commutative49.1%
fma-undefine49.1%
associate-+l+30.5%
metadata-eval30.5%
Applied egg-rr30.5%
+-rgt-identity30.5%
Simplified30.5%
expm1-log1p-u35.1%
expm1-undefine49.1%
Applied egg-rr49.1%
sub-neg49.1%
metadata-eval49.1%
+-commutative49.1%
log1p-undefine49.1%
rem-exp-log49.1%
+-commutative49.1%
fma-define49.1%
Simplified49.1%
if 3.49999999999999992e-301 < l < 8.49999999999999963e-254Initial program 85.7%
Simplified85.7%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt17.3%
mul-1-neg17.3%
Simplified17.3%
neg-sub017.3%
flip3--71.7%
metadata-eval71.7%
pow371.7%
add-sqr-sqrt71.7%
pow171.7%
pow1/271.7%
pow-prod-up71.7%
metadata-eval71.7%
metadata-eval71.7%
add-sqr-sqrt71.7%
Applied egg-rr71.7%
sub0-neg71.7%
+-lft-identity71.7%
mul0-lft71.7%
+-rgt-identity71.7%
Simplified71.7%
if 8.49999999999999963e-254 < l Initial program 65.5%
Simplified64.8%
Taylor expanded in d around inf 42.4%
*-un-lft-identity42.4%
pow1/242.4%
inv-pow42.4%
pow-pow42.9%
metadata-eval42.9%
Applied egg-rr42.9%
*-lft-identity42.9%
Simplified42.9%
*-commutative42.9%
unpow-prod-down53.1%
Applied egg-rr53.1%
Final simplification53.5%
(FPCore (d h l M D)
:precision binary64
(if (<= l -3e-174)
(* (- d) (sqrt (/ (/ 1.0 l) h)))
(if (<= l -2e-310)
(/ d (sqrt (+ -1.0 (fma h l 1.0))))
(* 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 <= -3e-174) {
tmp = -d * sqrt(((1.0 / l) / h));
} else if (l <= -2e-310) {
tmp = d / sqrt((-1.0 + fma(h, l, 1.0)));
} 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 <= -3e-174) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / l) / h))); elseif (l <= -2e-310) tmp = Float64(d / sqrt(Float64(-1.0 + fma(h, l, 1.0)))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -3e-174], N[((-d) * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(d / N[Sqrt[N[(-1.0 + N[(h * l + 1.0), $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 -3 \cdot 10^{-174}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{d}{\sqrt{-1 + \mathsf{fma}\left(h, \ell, 1\right)}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -3.00000000000000021e-174Initial program 55.5%
Simplified54.3%
Taylor expanded in d around inf 3.9%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt54.0%
*-commutative54.0%
associate-*r*54.0%
*-commutative54.0%
associate-/r*54.9%
neg-mul-154.9%
Simplified54.9%
if -3.00000000000000021e-174 < l < -1.999999999999994e-310Initial program 76.0%
Simplified76.0%
Taylor expanded in d around inf 33.5%
expm1-log1p-u33.5%
expm1-undefine47.9%
Applied egg-rr47.9%
sub-neg47.9%
metadata-eval47.9%
+-commutative47.9%
log1p-undefine47.9%
rem-exp-log47.9%
+-commutative47.9%
fma-define47.9%
Simplified47.9%
sqrt-div47.9%
metadata-eval47.9%
un-div-inv47.9%
+-commutative47.9%
fma-undefine47.9%
associate-+l+28.8%
metadata-eval28.8%
Applied egg-rr28.8%
+-rgt-identity28.8%
Simplified28.8%
expm1-log1p-u33.5%
expm1-undefine47.9%
Applied egg-rr47.9%
sub-neg47.9%
metadata-eval47.9%
+-commutative47.9%
log1p-undefine47.9%
rem-exp-log47.9%
+-commutative47.9%
fma-define47.9%
Simplified47.9%
if -1.999999999999994e-310 < l Initial program 66.8%
Simplified66.2%
Taylor expanded in d around inf 40.6%
*-un-lft-identity40.6%
pow1/240.6%
inv-pow40.6%
pow-pow41.0%
metadata-eval41.0%
Applied egg-rr41.0%
*-lft-identity41.0%
Simplified41.0%
*-commutative41.0%
unpow-prod-down50.6%
Applied egg-rr50.6%
Final simplification51.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l -8.2e-185)
(* (- d) (sqrt (/ (/ 1.0 l) h)))
(if (<= l -2e-310)
(/ d (cbrt (pow (* l h) 1.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 <= -8.2e-185) {
tmp = -d * sqrt(((1.0 / l) / h));
} else if (l <= -2e-310) {
tmp = d / cbrt(pow((l * h), 1.5));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -8.2e-185) {
tmp = -d * Math.sqrt(((1.0 / l) / h));
} else if (l <= -2e-310) {
tmp = d / Math.cbrt(Math.pow((l * h), 1.5));
} 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 <= -8.2e-185) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / l) / h))); elseif (l <= -2e-310) tmp = Float64(d / cbrt((Float64(l * h) ^ 1.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, -8.2e-185], N[((-d) * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(d / N[Power[N[Power[N[(l * h), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $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 -8.2 \cdot 10^{-185}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{d}{\sqrt[3]{{\left(\ell \cdot h\right)}^{1.5}}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -8.2e-185Initial program 57.0%
Simplified55.8%
Taylor expanded in d around inf 3.9%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt53.3%
*-commutative53.3%
associate-*r*53.3%
*-commutative53.3%
associate-/r*54.2%
neg-mul-154.2%
Simplified54.2%
if -8.2e-185 < l < -1.999999999999994e-310Initial program 74.2%
Simplified74.2%
Taylor expanded in d around inf 36.0%
expm1-log1p-u36.0%
expm1-undefine48.8%
Applied egg-rr48.8%
sub-neg48.8%
metadata-eval48.8%
+-commutative48.8%
log1p-undefine48.8%
rem-exp-log48.8%
+-commutative48.8%
fma-define48.8%
Simplified48.8%
sqrt-div48.8%
metadata-eval48.8%
un-div-inv48.8%
+-commutative48.8%
fma-undefine48.8%
associate-+l+30.8%
metadata-eval30.8%
Applied egg-rr30.8%
+-rgt-identity30.8%
Simplified30.8%
add-cbrt-cube38.5%
pow1/338.5%
add-sqr-sqrt38.5%
pow138.5%
pow1/238.5%
pow-prod-up38.5%
metadata-eval38.5%
Applied egg-rr38.5%
unpow1/338.5%
Simplified38.5%
if -1.999999999999994e-310 < l Initial program 66.8%
Simplified66.2%
Taylor expanded in d around inf 40.6%
*-un-lft-identity40.6%
pow1/240.6%
inv-pow40.6%
pow-pow41.0%
metadata-eval41.0%
Applied egg-rr41.0%
*-lft-identity41.0%
Simplified41.0%
*-commutative41.0%
unpow-prod-down50.6%
Applied egg-rr50.6%
Final simplification50.0%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.7e-180)
(* (- d) (sqrt (/ (/ 1.0 l) h)))
(if (<= l -2e-310)
(/ d (cbrt (pow (* l h) 1.5)))
(/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.7e-180) {
tmp = -d * sqrt(((1.0 / l) / h));
} else if (l <= -2e-310) {
tmp = d / cbrt(pow((l * h), 1.5));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.7e-180) {
tmp = -d * Math.sqrt(((1.0 / l) / h));
} else if (l <= -2e-310) {
tmp = d / Math.cbrt(Math.pow((l * h), 1.5));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.7e-180) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / l) / h))); elseif (l <= -2e-310) tmp = Float64(d / cbrt((Float64(l * h) ^ 1.5))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.7e-180], N[((-d) * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(d / N[Power[N[Power[N[(l * h), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.7 \cdot 10^{-180}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{d}{\sqrt[3]{{\left(\ell \cdot h\right)}^{1.5}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.69999999999999991e-180Initial program 57.0%
Simplified55.8%
Taylor expanded in d around inf 3.9%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt53.3%
*-commutative53.3%
associate-*r*53.3%
*-commutative53.3%
associate-/r*54.2%
neg-mul-154.2%
Simplified54.2%
if -1.69999999999999991e-180 < l < -1.999999999999994e-310Initial program 74.2%
Simplified74.2%
Taylor expanded in d around inf 36.0%
expm1-log1p-u36.0%
expm1-undefine48.8%
Applied egg-rr48.8%
sub-neg48.8%
metadata-eval48.8%
+-commutative48.8%
log1p-undefine48.8%
rem-exp-log48.8%
+-commutative48.8%
fma-define48.8%
Simplified48.8%
sqrt-div48.8%
metadata-eval48.8%
un-div-inv48.8%
+-commutative48.8%
fma-undefine48.8%
associate-+l+30.8%
metadata-eval30.8%
Applied egg-rr30.8%
+-rgt-identity30.8%
Simplified30.8%
add-cbrt-cube38.5%
pow1/338.5%
add-sqr-sqrt38.5%
pow138.5%
pow1/238.5%
pow-prod-up38.5%
metadata-eval38.5%
Applied egg-rr38.5%
unpow1/338.5%
Simplified38.5%
if -1.999999999999994e-310 < l Initial program 66.8%
Simplified66.2%
Taylor expanded in d around inf 40.6%
expm1-log1p-u39.4%
expm1-undefine24.8%
Applied egg-rr24.8%
sub-neg24.8%
metadata-eval24.8%
+-commutative24.8%
log1p-undefine24.8%
rem-exp-log26.0%
+-commutative26.0%
fma-define26.0%
Simplified26.0%
sqrt-div26.0%
metadata-eval26.0%
un-div-inv26.0%
+-commutative26.0%
fma-undefine26.0%
associate-+l+41.0%
metadata-eval41.0%
Applied egg-rr41.0%
+-rgt-identity41.0%
Simplified41.0%
*-commutative41.0%
sqrt-prod50.6%
Applied egg-rr50.6%
Final simplification50.0%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.7e-185)
(* (- d) (sqrt (/ (/ 1.0 l) h)))
(if (<= l -2e-310)
(* d (sqrt (/ 1.0 (* l h))))
(/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.7e-185) {
tmp = -d * sqrt(((1.0 / l) / h));
} else if (l <= -2e-310) {
tmp = d * sqrt((1.0 / (l * h)));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1.7d-185)) then
tmp = -d * sqrt(((1.0d0 / l) / h))
else if (l <= (-2d-310)) then
tmp = d * sqrt((1.0d0 / (l * h)))
else
tmp = d / (sqrt(h) * sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.7e-185) {
tmp = -d * Math.sqrt(((1.0 / l) / h));
} else if (l <= -2e-310) {
tmp = d * Math.sqrt((1.0 / (l * h)));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.7e-185: tmp = -d * math.sqrt(((1.0 / l) / h)) elif l <= -2e-310: tmp = d * math.sqrt((1.0 / (l * h))) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.7e-185) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / l) / h))); elseif (l <= -2e-310) tmp = Float64(d * sqrt(Float64(1.0 / Float64(l * h)))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.7e-185) tmp = -d * sqrt(((1.0 / l) / h)); elseif (l <= -2e-310) tmp = d * sqrt((1.0 / (l * h))); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.7e-185], N[((-d) * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.7 \cdot 10^{-185}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.6999999999999999e-185Initial program 57.0%
Simplified55.8%
Taylor expanded in d around inf 3.9%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt53.3%
*-commutative53.3%
associate-*r*53.3%
*-commutative53.3%
associate-/r*54.2%
neg-mul-154.2%
Simplified54.2%
if -1.6999999999999999e-185 < l < -1.999999999999994e-310Initial program 74.2%
Simplified74.2%
Taylor expanded in d around inf 36.0%
if -1.999999999999994e-310 < l Initial program 66.8%
Simplified66.2%
Taylor expanded in d around inf 40.6%
expm1-log1p-u39.4%
expm1-undefine24.8%
Applied egg-rr24.8%
sub-neg24.8%
metadata-eval24.8%
+-commutative24.8%
log1p-undefine24.8%
rem-exp-log26.0%
+-commutative26.0%
fma-define26.0%
Simplified26.0%
sqrt-div26.0%
metadata-eval26.0%
un-div-inv26.0%
+-commutative26.0%
fma-undefine26.0%
associate-+l+41.0%
metadata-eval41.0%
Applied egg-rr41.0%
+-rgt-identity41.0%
Simplified41.0%
*-commutative41.0%
sqrt-prod50.6%
Applied egg-rr50.6%
Final simplification49.6%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (sqrt (/ (/ 1.0 l) h)))) (if (<= l -3.1e-183) (* (- d) t_0) (* d t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(((1.0 / l) / h));
double tmp;
if (l <= -3.1e-183) {
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 / l) / h))
if (l <= (-3.1d-183)) 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 / l) / h));
double tmp;
if (l <= -3.1e-183) {
tmp = -d * t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(((1.0 / l) / h)) tmp = 0 if l <= -3.1e-183: 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 / l) / h)) tmp = 0.0 if (l <= -3.1e-183) 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 / l) / h)); tmp = 0.0; if (l <= -3.1e-183) 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 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -3.1e-183], N[((-d) * t$95$0), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\mathbf{if}\;\ell \leq -3.1 \cdot 10^{-183}:\\
\;\;\;\;\left(-d\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot t\_0\\
\end{array}
\end{array}
if l < -3.1e-183Initial program 57.0%
Simplified55.8%
Taylor expanded in d around inf 3.9%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt53.3%
*-commutative53.3%
associate-*r*53.3%
*-commutative53.3%
associate-/r*54.2%
neg-mul-154.2%
Simplified54.2%
if -3.1e-183 < l Initial program 68.5%
Simplified68.0%
Taylor expanded in d around inf 39.6%
*-un-lft-identity39.6%
Applied egg-rr39.6%
*-lft-identity39.6%
*-commutative39.6%
associate-/r*39.9%
Simplified39.9%
Final simplification44.8%
(FPCore (d h l M D) :precision binary64 (if (<= l -1.55e-185) (/ d (- (sqrt (* l h)))) (* d (sqrt (/ (/ 1.0 l) h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.55e-185) {
tmp = d / -sqrt((l * h));
} else {
tmp = d * sqrt(((1.0 / l) / h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1.55d-185)) then
tmp = d / -sqrt((l * h))
else
tmp = d * sqrt(((1.0d0 / l) / h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.55e-185) {
tmp = d / -Math.sqrt((l * h));
} else {
tmp = d * Math.sqrt(((1.0 / l) / h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.55e-185: tmp = d / -math.sqrt((l * h)) else: tmp = d * math.sqrt(((1.0 / l) / h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.55e-185) tmp = Float64(d / Float64(-sqrt(Float64(l * h)))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.55e-185) tmp = d / -sqrt((l * h)); else tmp = d * sqrt(((1.0 / l) / h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.55e-185], N[(d / (-N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.55 \cdot 10^{-185}:\\
\;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\end{array}
\end{array}
if l < -1.5499999999999998e-185Initial program 57.0%
Simplified55.8%
Taylor expanded in d around inf 3.9%
expm1-log1p-u3.9%
expm1-undefine7.0%
Applied egg-rr7.0%
sub-neg7.0%
metadata-eval7.0%
+-commutative7.0%
log1p-undefine7.0%
rem-exp-log7.0%
+-commutative7.0%
fma-define7.0%
Simplified7.0%
sqrt-div7.0%
metadata-eval7.0%
un-div-inv7.0%
+-commutative7.0%
fma-undefine7.0%
associate-+l+2.8%
metadata-eval2.8%
Applied egg-rr2.8%
+-rgt-identity2.8%
Simplified2.8%
add-sqr-sqrt0.0%
sqrt-prod0.0%
frac-times0.0%
sqrt-div0.0%
sqrt-div37.6%
add-sqr-sqrt37.6%
sqr-neg37.6%
sqrt-unprod0.6%
add-sqr-sqrt3.8%
distribute-rgt-neg-out3.8%
sqrt-div0.0%
sqrt-div0.0%
frac-times0.0%
add-sqr-sqrt0.0%
sqrt-prod53.4%
neg-sub053.4%
Applied egg-rr53.4%
neg-sub053.4%
distribute-frac-neg253.4%
Simplified53.4%
if -1.5499999999999998e-185 < l Initial program 68.5%
Simplified68.0%
Taylor expanded in d around inf 39.6%
*-un-lft-identity39.6%
Applied egg-rr39.6%
*-lft-identity39.6%
*-commutative39.6%
associate-/r*39.9%
Simplified39.9%
Final simplification44.5%
(FPCore (d h l M D) :precision binary64 (if (<= l -5.2e-185) (/ d (- (sqrt (* l h)))) (* d (sqrt (/ 1.0 (* l h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -5.2e-185) {
tmp = d / -sqrt((l * h));
} else {
tmp = d * sqrt((1.0 / (l * h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-5.2d-185)) then
tmp = d / -sqrt((l * h))
else
tmp = d * sqrt((1.0d0 / (l * h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -5.2e-185) {
tmp = d / -Math.sqrt((l * h));
} else {
tmp = d * Math.sqrt((1.0 / (l * h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -5.2e-185: tmp = d / -math.sqrt((l * h)) else: tmp = d * math.sqrt((1.0 / (l * h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -5.2e-185) tmp = Float64(d / Float64(-sqrt(Float64(l * h)))); else tmp = Float64(d * sqrt(Float64(1.0 / Float64(l * h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -5.2e-185) tmp = d / -sqrt((l * h)); else tmp = d * sqrt((1.0 / (l * h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -5.2e-185], N[(d / (-N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.2 \cdot 10^{-185}:\\
\;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -5.1999999999999997e-185Initial program 57.0%
Simplified55.8%
Taylor expanded in d around inf 3.9%
expm1-log1p-u3.9%
expm1-undefine7.0%
Applied egg-rr7.0%
sub-neg7.0%
metadata-eval7.0%
+-commutative7.0%
log1p-undefine7.0%
rem-exp-log7.0%
+-commutative7.0%
fma-define7.0%
Simplified7.0%
sqrt-div7.0%
metadata-eval7.0%
un-div-inv7.0%
+-commutative7.0%
fma-undefine7.0%
associate-+l+2.8%
metadata-eval2.8%
Applied egg-rr2.8%
+-rgt-identity2.8%
Simplified2.8%
add-sqr-sqrt0.0%
sqrt-prod0.0%
frac-times0.0%
sqrt-div0.0%
sqrt-div37.6%
add-sqr-sqrt37.6%
sqr-neg37.6%
sqrt-unprod0.6%
add-sqr-sqrt3.8%
distribute-rgt-neg-out3.8%
sqrt-div0.0%
sqrt-div0.0%
frac-times0.0%
add-sqr-sqrt0.0%
sqrt-prod53.4%
neg-sub053.4%
Applied egg-rr53.4%
neg-sub053.4%
distribute-frac-neg253.4%
Simplified53.4%
if -5.1999999999999997e-185 < l Initial program 68.5%
Simplified68.0%
Taylor expanded in d around inf 39.6%
Final simplification44.3%
(FPCore (d h l M D) :precision binary64 (if (<= l -2.35e-185) (/ d (- (sqrt (* l h)))) (* d (pow (* l h) -0.5))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.35e-185) {
tmp = d / -sqrt((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 <= (-2.35d-185)) then
tmp = d / -sqrt((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 <= -2.35e-185) {
tmp = d / -Math.sqrt((l * h));
} else {
tmp = d * Math.pow((l * h), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2.35e-185: tmp = d / -math.sqrt((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 <= -2.35e-185) tmp = Float64(d / Float64(-sqrt(Float64(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 <= -2.35e-185) tmp = d / -sqrt((l * h)); else tmp = d * ((l * h) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.35e-185], N[(d / (-N[Sqrt[N[(l * 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 -2.35 \cdot 10^{-185}:\\
\;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if l < -2.3500000000000001e-185Initial program 57.0%
Simplified55.8%
Taylor expanded in d around inf 3.9%
expm1-log1p-u3.9%
expm1-undefine7.0%
Applied egg-rr7.0%
sub-neg7.0%
metadata-eval7.0%
+-commutative7.0%
log1p-undefine7.0%
rem-exp-log7.0%
+-commutative7.0%
fma-define7.0%
Simplified7.0%
sqrt-div7.0%
metadata-eval7.0%
un-div-inv7.0%
+-commutative7.0%
fma-undefine7.0%
associate-+l+2.8%
metadata-eval2.8%
Applied egg-rr2.8%
+-rgt-identity2.8%
Simplified2.8%
add-sqr-sqrt0.0%
sqrt-prod0.0%
frac-times0.0%
sqrt-div0.0%
sqrt-div37.6%
add-sqr-sqrt37.6%
sqr-neg37.6%
sqrt-unprod0.6%
add-sqr-sqrt3.8%
distribute-rgt-neg-out3.8%
sqrt-div0.0%
sqrt-div0.0%
frac-times0.0%
add-sqr-sqrt0.0%
sqrt-prod53.4%
neg-sub053.4%
Applied egg-rr53.4%
neg-sub053.4%
distribute-frac-neg253.4%
Simplified53.4%
if -2.3500000000000001e-185 < l Initial program 68.5%
Simplified68.0%
Taylor expanded in d around inf 39.6%
*-un-lft-identity39.6%
pow1/239.6%
inv-pow39.6%
pow-pow38.7%
metadata-eval38.7%
Applied egg-rr38.7%
*-lft-identity38.7%
Simplified38.7%
Final simplification43.7%
(FPCore (d h l M D) :precision binary64 (* d (pow (* l h) -0.5)))
double code(double d, double h, double l, double M, double D) {
return d * pow((l * h), -0.5);
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * ((l * h) ** (-0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.pow((l * h), -0.5);
}
def code(d, h, l, M, D): return d * math.pow((l * h), -0.5)
function code(d, h, l, M, D) return Float64(d * (Float64(l * h) ^ -0.5)) end
function tmp = code(d, h, l, M, D) tmp = d * ((l * h) ^ -0.5); end
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot {\left(\ell \cdot h\right)}^{-0.5}
\end{array}
Initial program 64.6%
Simplified63.8%
Taylor expanded in d around inf 27.4%
*-un-lft-identity27.4%
pow1/227.4%
inv-pow27.4%
pow-pow26.5%
metadata-eval26.5%
Applied egg-rr26.5%
*-lft-identity26.5%
Simplified26.5%
Final simplification26.5%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* l h))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((l * h));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d / sqrt((l * h))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((l * h));
}
def code(d, h, l, M, D): return d / math.sqrt((l * h))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(l * h))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((l * h)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 64.6%
Simplified63.8%
Taylor expanded in d around inf 27.4%
expm1-log1p-u26.8%
expm1-undefine22.3%
Applied egg-rr22.3%
sub-neg22.3%
metadata-eval22.3%
+-commutative22.3%
log1p-undefine22.3%
rem-exp-log23.0%
+-commutative23.0%
fma-define23.0%
Simplified23.0%
sqrt-div22.9%
metadata-eval22.9%
un-div-inv22.9%
+-commutative22.9%
fma-undefine22.9%
associate-+l+26.5%
metadata-eval26.5%
Applied egg-rr26.5%
+-rgt-identity26.5%
Simplified26.5%
Final simplification26.5%
herbie shell --seed 2024137
(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)))))