
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d))) (t_1 (/ t_0 (sqrt (- l)))))
(if (<= l -1.1e-64)
(*
(/ t_0 (sqrt (- h)))
(* t_1 (- 1.0 (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))))))
(if (<= l -2e-310)
(*
t_1
(*
(sqrt (/ d h))
(+ 1.0 (/ (* h (* (pow (/ M (* 2.0 (/ d D))) 2.0) -0.5)) l))))
(/
(sqrt d)
(/
(sqrt h)
(*
(/ (sqrt d) (sqrt l))
(+ 1.0 (* -0.5 (* (/ h l) (pow (* M (/ (* D -0.5) d)) 2.0)))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double t_1 = t_0 / sqrt(-l);
double tmp;
if (l <= -1.1e-64) {
tmp = (t_0 / sqrt(-h)) * (t_1 * (1.0 - (0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))));
} else if (l <= -2e-310) {
tmp = t_1 * (sqrt((d / h)) * (1.0 + ((h * (pow((M / (2.0 * (d / D))), 2.0) * -0.5)) / l)));
} else {
tmp = sqrt(d) / (sqrt(h) / ((sqrt(d) / sqrt(l)) * (1.0 + (-0.5 * ((h / l) * pow((M * ((D * -0.5) / d)), 2.0))))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt(-d)
t_1 = t_0 / sqrt(-l)
if (l <= (-1.1d-64)) then
tmp = (t_0 / sqrt(-h)) * (t_1 * (1.0d0 - (0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l)))))
else if (l <= (-2d-310)) then
tmp = t_1 * (sqrt((d / h)) * (1.0d0 + ((h * (((m / (2.0d0 * (d / d_1))) ** 2.0d0) * (-0.5d0))) / l)))
else
tmp = sqrt(d) / (sqrt(h) / ((sqrt(d) / sqrt(l)) * (1.0d0 + ((-0.5d0) * ((h / l) * ((m * ((d_1 * (-0.5d0)) / d)) ** 2.0d0))))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(-d);
double t_1 = t_0 / Math.sqrt(-l);
double tmp;
if (l <= -1.1e-64) {
tmp = (t_0 / Math.sqrt(-h)) * (t_1 * (1.0 - (0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))));
} else if (l <= -2e-310) {
tmp = t_1 * (Math.sqrt((d / h)) * (1.0 + ((h * (Math.pow((M / (2.0 * (d / D))), 2.0) * -0.5)) / l)));
} else {
tmp = Math.sqrt(d) / (Math.sqrt(h) / ((Math.sqrt(d) / Math.sqrt(l)) * (1.0 + (-0.5 * ((h / l) * Math.pow((M * ((D * -0.5) / d)), 2.0))))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(-d) t_1 = t_0 / math.sqrt(-l) tmp = 0 if l <= -1.1e-64: tmp = (t_0 / math.sqrt(-h)) * (t_1 * (1.0 - (0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))))) elif l <= -2e-310: tmp = t_1 * (math.sqrt((d / h)) * (1.0 + ((h * (math.pow((M / (2.0 * (d / D))), 2.0) * -0.5)) / l))) else: tmp = math.sqrt(d) / (math.sqrt(h) / ((math.sqrt(d) / math.sqrt(l)) * (1.0 + (-0.5 * ((h / l) * math.pow((M * ((D * -0.5) / d)), 2.0)))))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) t_1 = Float64(t_0 / sqrt(Float64(-l))) tmp = 0.0 if (l <= -1.1e-64) tmp = Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(t_1 * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l)))))); elseif (l <= -2e-310) tmp = Float64(t_1 * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(h * Float64((Float64(M / Float64(2.0 * Float64(d / D))) ^ 2.0) * -0.5)) / l)))); else tmp = Float64(sqrt(d) / Float64(sqrt(h) / Float64(Float64(sqrt(d) / sqrt(l)) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(M * Float64(Float64(D * -0.5) / d)) ^ 2.0))))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(-d); t_1 = t_0 / sqrt(-l); tmp = 0.0; if (l <= -1.1e-64) tmp = (t_0 / sqrt(-h)) * (t_1 * (1.0 - (0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l))))); elseif (l <= -2e-310) tmp = t_1 * (sqrt((d / h)) * (1.0 + ((h * (((M / (2.0 * (d / D))) ^ 2.0) * -0.5)) / l))); else tmp = sqrt(d) / (sqrt(h) / ((sqrt(d) / sqrt(l)) * (1.0 + (-0.5 * ((h / l) * ((M * ((D * -0.5) / d)) ^ 2.0)))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.1e-64], N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(t$95$1 * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(N[Power[N[(M / N[(2.0 * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[d], $MachinePrecision] / N[(N[Sqrt[h], $MachinePrecision] / N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(N[(D * -0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
t_1 := \frac{t_0}{\sqrt{-\ell}}\\
\mathbf{if}\;\ell \leq -1.1 \cdot 10^{-64}:\\
\;\;\;\;\frac{t_0}{\sqrt{-h}} \cdot \left(t_1 \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;t_1 \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left({\left(\frac{M}{2 \cdot \frac{d}{D}}\right)}^{2} \cdot -0.5\right)}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\frac{\sqrt{h}}{\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \frac{D \cdot -0.5}{d}\right)}^{2}\right)\right)}}\\
\end{array}
\end{array}
if l < -1.1e-64Initial program 70.5%
Simplified71.7%
frac-2neg71.7%
sqrt-div86.6%
Applied egg-rr86.6%
frac-2neg86.6%
sqrt-div90.0%
Applied egg-rr90.0%
if -1.1e-64 < l < -1.999999999999994e-310Initial program 70.7%
Simplified70.7%
Applied egg-rr79.2%
add-sqr-sqrt51.6%
sqrt-prod79.2%
unpow279.2%
unpow-prod-down66.3%
unpow-prod-down66.3%
metadata-eval66.3%
metadata-eval66.3%
unpow-prod-down66.3%
metadata-eval66.3%
div-inv66.3%
unpow-prod-down79.2%
unpow279.2%
sqrt-prod44.9%
add-sqr-sqrt79.2%
*-commutative79.2%
clear-num79.2%
frac-times79.2%
*-un-lft-identity79.2%
Applied egg-rr79.2%
frac-2neg75.0%
sqrt-div76.9%
Applied egg-rr88.9%
if -1.999999999999994e-310 < l Initial program 69.2%
Simplified68.6%
pow1/268.6%
metadata-eval68.6%
add-cbrt-cube55.7%
pow1/353.9%
sqr-pow53.9%
pow-prod-up53.9%
metadata-eval53.9%
metadata-eval53.9%
Applied egg-rr53.9%
unpow1/355.7%
Simplified55.7%
Applied egg-rr76.0%
associate-/l*75.9%
associate-*r/75.9%
Simplified75.9%
sqrt-div85.4%
div-inv85.4%
Applied egg-rr85.4%
associate-*r/85.4%
*-rgt-identity85.4%
Simplified85.4%
Final simplification87.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d))))
(if (<= l -6.2e-241)
(*
(/ t_0 (sqrt (- h)))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* M -0.5)) 2.0)) l)))))
(if (<= l -2e-310)
(*
(/ t_0 (sqrt (- l)))
(*
(sqrt (/ d h))
(+ 1.0 (/ (* h (* (pow (/ M (* 2.0 (/ d D))) 2.0) -0.5)) l))))
(/
(sqrt d)
(/
(sqrt h)
(*
(/ (sqrt d) (sqrt l))
(+ 1.0 (* -0.5 (* (/ h l) (pow (* M (/ (* D -0.5) d)) 2.0)))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double tmp;
if (l <= -6.2e-241) {
tmp = (t_0 / sqrt(-h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h * pow(((D / d) * (M * -0.5)), 2.0)) / l))));
} else if (l <= -2e-310) {
tmp = (t_0 / sqrt(-l)) * (sqrt((d / h)) * (1.0 + ((h * (pow((M / (2.0 * (d / D))), 2.0) * -0.5)) / l)));
} else {
tmp = sqrt(d) / (sqrt(h) / ((sqrt(d) / sqrt(l)) * (1.0 + (-0.5 * ((h / l) * pow((M * ((D * -0.5) / d)), 2.0))))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt(-d)
if (l <= (-6.2d-241)) then
tmp = (t_0 / sqrt(-h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (m * (-0.5d0))) ** 2.0d0)) / l))))
else if (l <= (-2d-310)) then
tmp = (t_0 / sqrt(-l)) * (sqrt((d / h)) * (1.0d0 + ((h * (((m / (2.0d0 * (d / d_1))) ** 2.0d0) * (-0.5d0))) / l)))
else
tmp = sqrt(d) / (sqrt(h) / ((sqrt(d) / sqrt(l)) * (1.0d0 + ((-0.5d0) * ((h / l) * ((m * ((d_1 * (-0.5d0)) / d)) ** 2.0d0))))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(-d);
double tmp;
if (l <= -6.2e-241) {
tmp = (t_0 / Math.sqrt(-h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * ((h * Math.pow(((D / d) * (M * -0.5)), 2.0)) / l))));
} else if (l <= -2e-310) {
tmp = (t_0 / Math.sqrt(-l)) * (Math.sqrt((d / h)) * (1.0 + ((h * (Math.pow((M / (2.0 * (d / D))), 2.0) * -0.5)) / l)));
} else {
tmp = Math.sqrt(d) / (Math.sqrt(h) / ((Math.sqrt(d) / Math.sqrt(l)) * (1.0 + (-0.5 * ((h / l) * Math.pow((M * ((D * -0.5) / d)), 2.0))))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(-d) tmp = 0 if l <= -6.2e-241: tmp = (t_0 / math.sqrt(-h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * ((h * math.pow(((D / d) * (M * -0.5)), 2.0)) / l)))) elif l <= -2e-310: tmp = (t_0 / math.sqrt(-l)) * (math.sqrt((d / h)) * (1.0 + ((h * (math.pow((M / (2.0 * (d / D))), 2.0) * -0.5)) / l))) else: tmp = math.sqrt(d) / (math.sqrt(h) / ((math.sqrt(d) / math.sqrt(l)) * (1.0 + (-0.5 * ((h / l) * math.pow((M * ((D * -0.5) / d)), 2.0)))))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -6.2e-241) tmp = Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(M * -0.5)) ^ 2.0)) / l))))); elseif (l <= -2e-310) tmp = Float64(Float64(t_0 / sqrt(Float64(-l))) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(h * Float64((Float64(M / Float64(2.0 * Float64(d / D))) ^ 2.0) * -0.5)) / l)))); else tmp = Float64(sqrt(d) / Float64(sqrt(h) / Float64(Float64(sqrt(d) / sqrt(l)) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(M * Float64(Float64(D * -0.5) / d)) ^ 2.0))))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(-d); tmp = 0.0; if (l <= -6.2e-241) tmp = (t_0 / sqrt(-h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h * (((D / d) * (M * -0.5)) ^ 2.0)) / l)))); elseif (l <= -2e-310) tmp = (t_0 / sqrt(-l)) * (sqrt((d / h)) * (1.0 + ((h * (((M / (2.0 * (d / D))) ^ 2.0) * -0.5)) / l))); else tmp = sqrt(d) / (sqrt(h) / ((sqrt(d) / sqrt(l)) * (1.0 + (-0.5 * ((h / l) * ((M * ((D * -0.5) / d)) ^ 2.0)))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -6.2e-241], N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * -0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(N[Power[N[(M / N[(2.0 * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[d], $MachinePrecision] / N[(N[Sqrt[h], $MachinePrecision] / N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(N[(D * -0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -6.2 \cdot 10^{-241}:\\
\;\;\;\;\frac{t_0}{\sqrt{-h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(M \cdot -0.5\right)\right)}^{2}}{\ell}\right)\right)\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{t_0}{\sqrt{-\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left({\left(\frac{M}{2 \cdot \frac{d}{D}}\right)}^{2} \cdot -0.5\right)}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\frac{\sqrt{h}}{\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \frac{D \cdot -0.5}{d}\right)}^{2}\right)\right)}}\\
\end{array}
\end{array}
if l < -6.1999999999999998e-241Initial program 70.7%
Simplified71.5%
frac-2neg71.5%
sqrt-div84.1%
Applied egg-rr84.1%
associate-*r/85.9%
Applied egg-rr85.9%
if -6.1999999999999998e-241 < l < -1.999999999999994e-310Initial program 70.0%
Simplified70.0%
Applied egg-rr82.6%
add-sqr-sqrt44.7%
sqrt-prod82.6%
unpow282.6%
unpow-prod-down63.8%
unpow-prod-down63.8%
metadata-eval63.8%
metadata-eval63.8%
unpow-prod-down63.8%
metadata-eval63.8%
div-inv63.8%
unpow-prod-down82.6%
unpow282.6%
sqrt-prod38.9%
add-sqr-sqrt82.6%
*-commutative82.6%
clear-num82.6%
frac-times82.6%
*-un-lft-identity82.6%
Applied egg-rr82.6%
frac-2neg70.0%
sqrt-div75.7%
Applied egg-rr99.8%
if -1.999999999999994e-310 < l Initial program 69.2%
Simplified68.6%
pow1/268.6%
metadata-eval68.6%
add-cbrt-cube55.7%
pow1/353.9%
sqr-pow53.9%
pow-prod-up53.9%
metadata-eval53.9%
metadata-eval53.9%
Applied egg-rr53.9%
unpow1/355.7%
Simplified55.7%
Applied egg-rr76.0%
associate-/l*75.9%
associate-*r/75.9%
Simplified75.9%
sqrt-div85.4%
div-inv85.4%
Applied egg-rr85.4%
associate-*r/85.4%
*-rgt-identity85.4%
Simplified85.4%
Final simplification86.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* (/ D d) (* M -0.5)) 2.0)) (t_1 (sqrt (- d))))
(if (<= l -2.7e-240)
(*
(/ t_1 (sqrt (- h)))
(* (sqrt (/ d l)) (- 1.0 (* 0.5 (/ (* h t_0) l)))))
(if (<= l -2e-310)
(*
(/ t_1 (sqrt (- l)))
(* (sqrt (/ d h)) (+ 1.0 (/ (* h (* -0.5 t_0)) l))))
(*
(+ 1.0 (* -0.5 (* (/ h l) (pow (* M (/ (* D -0.5) d)) 2.0))))
(/ d (* (sqrt h) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow(((D / d) * (M * -0.5)), 2.0);
double t_1 = sqrt(-d);
double tmp;
if (l <= -2.7e-240) {
tmp = (t_1 / sqrt(-h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h * t_0) / l))));
} else if (l <= -2e-310) {
tmp = (t_1 / sqrt(-l)) * (sqrt((d / h)) * (1.0 + ((h * (-0.5 * t_0)) / l)));
} else {
tmp = (1.0 + (-0.5 * ((h / l) * pow((M * ((D * -0.5) / d)), 2.0)))) * (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 = ((d_1 / d) * (m * (-0.5d0))) ** 2.0d0
t_1 = sqrt(-d)
if (l <= (-2.7d-240)) then
tmp = (t_1 / sqrt(-h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((h * t_0) / l))))
else if (l <= (-2d-310)) then
tmp = (t_1 / sqrt(-l)) * (sqrt((d / h)) * (1.0d0 + ((h * ((-0.5d0) * t_0)) / l)))
else
tmp = (1.0d0 + ((-0.5d0) * ((h / l) * ((m * ((d_1 * (-0.5d0)) / d)) ** 2.0d0)))) * (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.pow(((D / d) * (M * -0.5)), 2.0);
double t_1 = Math.sqrt(-d);
double tmp;
if (l <= -2.7e-240) {
tmp = (t_1 / Math.sqrt(-h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * ((h * t_0) / l))));
} else if (l <= -2e-310) {
tmp = (t_1 / Math.sqrt(-l)) * (Math.sqrt((d / h)) * (1.0 + ((h * (-0.5 * t_0)) / l)));
} else {
tmp = (1.0 + (-0.5 * ((h / l) * Math.pow((M * ((D * -0.5) / d)), 2.0)))) * (d / (Math.sqrt(h) * Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow(((D / d) * (M * -0.5)), 2.0) t_1 = math.sqrt(-d) tmp = 0 if l <= -2.7e-240: tmp = (t_1 / math.sqrt(-h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * ((h * t_0) / l)))) elif l <= -2e-310: tmp = (t_1 / math.sqrt(-l)) * (math.sqrt((d / h)) * (1.0 + ((h * (-0.5 * t_0)) / l))) else: tmp = (1.0 + (-0.5 * ((h / l) * math.pow((M * ((D * -0.5) / d)), 2.0)))) * (d / (math.sqrt(h) * math.sqrt(l))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(D / d) * Float64(M * -0.5)) ^ 2.0 t_1 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -2.7e-240) tmp = Float64(Float64(t_1 / sqrt(Float64(-h))) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * t_0) / l))))); elseif (l <= -2e-310) tmp = Float64(Float64(t_1 / sqrt(Float64(-l))) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(h * Float64(-0.5 * t_0)) / l)))); else tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(M * Float64(Float64(D * -0.5) / d)) ^ 2.0)))) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = ((D / d) * (M * -0.5)) ^ 2.0; t_1 = sqrt(-d); tmp = 0.0; if (l <= -2.7e-240) tmp = (t_1 / sqrt(-h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h * t_0) / l)))); elseif (l <= -2e-310) tmp = (t_1 / sqrt(-l)) * (sqrt((d / h)) * (1.0 + ((h * (-0.5 * t_0)) / l))); else tmp = (1.0 + (-0.5 * ((h / l) * ((M * ((D * -0.5) / d)) ^ 2.0)))) * (d / (sqrt(h) * sqrt(l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * -0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -2.7e-240], N[(N[(t$95$1 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * t$95$0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(-0.5 * t$95$0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(N[(D * -0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\frac{D}{d} \cdot \left(M \cdot -0.5\right)\right)}^{2}\\
t_1 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -2.7 \cdot 10^{-240}:\\
\;\;\;\;\frac{t_1}{\sqrt{-h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{h \cdot t_0}{\ell}\right)\right)\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{t_1}{\sqrt{-\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot t_0\right)}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \frac{D \cdot -0.5}{d}\right)}^{2}\right)\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -2.70000000000000018e-240Initial program 70.7%
Simplified71.5%
frac-2neg71.5%
sqrt-div84.1%
Applied egg-rr84.1%
associate-*r/85.9%
Applied egg-rr85.9%
if -2.70000000000000018e-240 < l < -1.999999999999994e-310Initial program 70.0%
Simplified70.0%
Applied egg-rr82.6%
frac-2neg70.0%
sqrt-div75.7%
Applied egg-rr99.8%
if -1.999999999999994e-310 < l Initial program 69.2%
Simplified68.6%
pow1/268.6%
metadata-eval68.6%
add-cbrt-cube55.7%
pow1/353.9%
sqr-pow53.9%
pow-prod-up53.9%
metadata-eval53.9%
metadata-eval53.9%
Applied egg-rr53.9%
unpow1/355.7%
Simplified55.7%
Applied egg-rr34.0%
expm1-def51.9%
expm1-log1p81.6%
associate-*r/81.6%
Simplified81.6%
Final simplification84.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d))))
(if (<= l -3.8e-241)
(*
(/ t_0 (sqrt (- h)))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* M -0.5)) 2.0)) l)))))
(if (<= l -2e-310)
(*
(/ t_0 (sqrt (- l)))
(*
(sqrt (/ d h))
(+ 1.0 (/ (* h (* (pow (/ M (* 2.0 (/ d D))) 2.0) -0.5)) l))))
(*
(+ 1.0 (* -0.5 (* (/ h l) (pow (* M (/ (* D -0.5) d)) 2.0))))
(/ d (* (sqrt h) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double tmp;
if (l <= -3.8e-241) {
tmp = (t_0 / sqrt(-h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h * pow(((D / d) * (M * -0.5)), 2.0)) / l))));
} else if (l <= -2e-310) {
tmp = (t_0 / sqrt(-l)) * (sqrt((d / h)) * (1.0 + ((h * (pow((M / (2.0 * (d / D))), 2.0) * -0.5)) / l)));
} else {
tmp = (1.0 + (-0.5 * ((h / l) * pow((M * ((D * -0.5) / d)), 2.0)))) * (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 = sqrt(-d)
if (l <= (-3.8d-241)) then
tmp = (t_0 / sqrt(-h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (m * (-0.5d0))) ** 2.0d0)) / l))))
else if (l <= (-2d-310)) then
tmp = (t_0 / sqrt(-l)) * (sqrt((d / h)) * (1.0d0 + ((h * (((m / (2.0d0 * (d / d_1))) ** 2.0d0) * (-0.5d0))) / l)))
else
tmp = (1.0d0 + ((-0.5d0) * ((h / l) * ((m * ((d_1 * (-0.5d0)) / d)) ** 2.0d0)))) * (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);
double tmp;
if (l <= -3.8e-241) {
tmp = (t_0 / Math.sqrt(-h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * ((h * Math.pow(((D / d) * (M * -0.5)), 2.0)) / l))));
} else if (l <= -2e-310) {
tmp = (t_0 / Math.sqrt(-l)) * (Math.sqrt((d / h)) * (1.0 + ((h * (Math.pow((M / (2.0 * (d / D))), 2.0) * -0.5)) / l)));
} else {
tmp = (1.0 + (-0.5 * ((h / l) * Math.pow((M * ((D * -0.5) / d)), 2.0)))) * (d / (Math.sqrt(h) * Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(-d) tmp = 0 if l <= -3.8e-241: tmp = (t_0 / math.sqrt(-h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * ((h * math.pow(((D / d) * (M * -0.5)), 2.0)) / l)))) elif l <= -2e-310: tmp = (t_0 / math.sqrt(-l)) * (math.sqrt((d / h)) * (1.0 + ((h * (math.pow((M / (2.0 * (d / D))), 2.0) * -0.5)) / l))) else: tmp = (1.0 + (-0.5 * ((h / l) * math.pow((M * ((D * -0.5) / d)), 2.0)))) * (d / (math.sqrt(h) * math.sqrt(l))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -3.8e-241) tmp = Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(M * -0.5)) ^ 2.0)) / l))))); elseif (l <= -2e-310) tmp = Float64(Float64(t_0 / sqrt(Float64(-l))) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(h * Float64((Float64(M / Float64(2.0 * Float64(d / D))) ^ 2.0) * -0.5)) / l)))); else tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(M * Float64(Float64(D * -0.5) / d)) ^ 2.0)))) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(-d); tmp = 0.0; if (l <= -3.8e-241) tmp = (t_0 / sqrt(-h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h * (((D / d) * (M * -0.5)) ^ 2.0)) / l)))); elseif (l <= -2e-310) tmp = (t_0 / sqrt(-l)) * (sqrt((d / h)) * (1.0 + ((h * (((M / (2.0 * (d / D))) ^ 2.0) * -0.5)) / l))); else tmp = (1.0 + (-0.5 * ((h / l) * ((M * ((D * -0.5) / d)) ^ 2.0)))) * (d / (sqrt(h) * sqrt(l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -3.8e-241], N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * -0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(N[Power[N[(M / N[(2.0 * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(N[(D * -0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -3.8 \cdot 10^{-241}:\\
\;\;\;\;\frac{t_0}{\sqrt{-h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(M \cdot -0.5\right)\right)}^{2}}{\ell}\right)\right)\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{t_0}{\sqrt{-\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left({\left(\frac{M}{2 \cdot \frac{d}{D}}\right)}^{2} \cdot -0.5\right)}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \frac{D \cdot -0.5}{d}\right)}^{2}\right)\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -3.7999999999999999e-241Initial program 70.7%
Simplified71.5%
frac-2neg71.5%
sqrt-div84.1%
Applied egg-rr84.1%
associate-*r/85.9%
Applied egg-rr85.9%
if -3.7999999999999999e-241 < l < -1.999999999999994e-310Initial program 70.0%
Simplified70.0%
Applied egg-rr82.6%
add-sqr-sqrt44.7%
sqrt-prod82.6%
unpow282.6%
unpow-prod-down63.8%
unpow-prod-down63.8%
metadata-eval63.8%
metadata-eval63.8%
unpow-prod-down63.8%
metadata-eval63.8%
div-inv63.8%
unpow-prod-down82.6%
unpow282.6%
sqrt-prod38.9%
add-sqr-sqrt82.6%
*-commutative82.6%
clear-num82.6%
frac-times82.6%
*-un-lft-identity82.6%
Applied egg-rr82.6%
frac-2neg70.0%
sqrt-div75.7%
Applied egg-rr99.8%
if -1.999999999999994e-310 < l Initial program 69.2%
Simplified68.6%
pow1/268.6%
metadata-eval68.6%
add-cbrt-cube55.7%
pow1/353.9%
sqr-pow53.9%
pow-prod-up53.9%
metadata-eval53.9%
metadata-eval53.9%
Applied egg-rr53.9%
unpow1/355.7%
Simplified55.7%
Applied egg-rr34.0%
expm1-def51.9%
expm1-log1p81.6%
associate-*r/81.6%
Simplified81.6%
Final simplification84.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (* M D) (/ 0.5 d))) (t_1 (sqrt (/ d l))))
(if (<= l -1.4e-231)
(*
(/ (sqrt (- d)) (sqrt (- h)))
(* (- 1.0 (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l)))) t_1))
(if (<= l 7e-277)
(*
t_1
(* (sqrt (/ d h)) (+ 1.0 (* h (/ -0.5 (* (/ 1.0 t_0) (/ l t_0)))))))
(*
(+ 1.0 (* -0.5 (* (/ h l) (pow (* M (/ (* D -0.5) d)) 2.0))))
(/ d (* (sqrt h) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (M * D) * (0.5 / d);
double t_1 = sqrt((d / l));
double tmp;
if (l <= -1.4e-231) {
tmp = (sqrt(-d) / sqrt(-h)) * ((1.0 - (0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))) * t_1);
} else if (l <= 7e-277) {
tmp = t_1 * (sqrt((d / h)) * (1.0 + (h * (-0.5 / ((1.0 / t_0) * (l / t_0))))));
} else {
tmp = (1.0 + (-0.5 * ((h / l) * pow((M * ((D * -0.5) / d)), 2.0)))) * (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 = (m * d_1) * (0.5d0 / d)
t_1 = sqrt((d / l))
if (l <= (-1.4d-231)) then
tmp = (sqrt(-d) / sqrt(-h)) * ((1.0d0 - (0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l)))) * t_1)
else if (l <= 7d-277) then
tmp = t_1 * (sqrt((d / h)) * (1.0d0 + (h * ((-0.5d0) / ((1.0d0 / t_0) * (l / t_0))))))
else
tmp = (1.0d0 + ((-0.5d0) * ((h / l) * ((m * ((d_1 * (-0.5d0)) / d)) ** 2.0d0)))) * (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) * (0.5 / d);
double t_1 = Math.sqrt((d / l));
double tmp;
if (l <= -1.4e-231) {
tmp = (Math.sqrt(-d) / Math.sqrt(-h)) * ((1.0 - (0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))) * t_1);
} else if (l <= 7e-277) {
tmp = t_1 * (Math.sqrt((d / h)) * (1.0 + (h * (-0.5 / ((1.0 / t_0) * (l / t_0))))));
} else {
tmp = (1.0 + (-0.5 * ((h / l) * Math.pow((M * ((D * -0.5) / d)), 2.0)))) * (d / (Math.sqrt(h) * Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (M * D) * (0.5 / d) t_1 = math.sqrt((d / l)) tmp = 0 if l <= -1.4e-231: tmp = (math.sqrt(-d) / math.sqrt(-h)) * ((1.0 - (0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))) * t_1) elif l <= 7e-277: tmp = t_1 * (math.sqrt((d / h)) * (1.0 + (h * (-0.5 / ((1.0 / t_0) * (l / t_0)))))) else: tmp = (1.0 + (-0.5 * ((h / l) * math.pow((M * ((D * -0.5) / d)), 2.0)))) * (d / (math.sqrt(h) * math.sqrt(l))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(M * D) * Float64(0.5 / d)) t_1 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= -1.4e-231) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l)))) * t_1)); elseif (l <= 7e-277) tmp = Float64(t_1 * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(h * Float64(-0.5 / Float64(Float64(1.0 / t_0) * Float64(l / t_0))))))); else tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(M * Float64(Float64(D * -0.5) / d)) ^ 2.0)))) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (M * D) * (0.5 / d); t_1 = sqrt((d / l)); tmp = 0.0; if (l <= -1.4e-231) tmp = (sqrt(-d) / sqrt(-h)) * ((1.0 - (0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l)))) * t_1); elseif (l <= 7e-277) tmp = t_1 * (sqrt((d / h)) * (1.0 + (h * (-0.5 / ((1.0 / t_0) * (l / t_0)))))); else tmp = (1.0 + (-0.5 * ((h / l) * ((M * ((D * -0.5) / d)) ^ 2.0)))) * (d / (sqrt(h) * sqrt(l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.4e-231], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 7e-277], N[(t$95$1 * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(h * N[(-0.5 / N[(N[(1.0 / t$95$0), $MachinePrecision] * N[(l / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(N[(D * -0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(M \cdot D\right) \cdot \frac{0.5}{d}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq -1.4 \cdot 10^{-231}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(\left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \cdot t_1\right)\\
\mathbf{elif}\;\ell \leq 7 \cdot 10^{-277}:\\
\;\;\;\;t_1 \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \frac{-0.5}{\frac{1}{t_0} \cdot \frac{\ell}{t_0}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \frac{D \cdot -0.5}{d}\right)}^{2}\right)\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.3999999999999999e-231Initial program 71.1%
Simplified71.9%
frac-2neg71.9%
sqrt-div84.7%
Applied egg-rr84.7%
if -1.3999999999999999e-231 < l < 6.99999999999999966e-277Initial program 64.8%
Simplified64.8%
Applied egg-rr76.7%
add-sqr-sqrt45.0%
sqrt-prod76.7%
unpow276.7%
unpow-prod-down52.6%
unpow-prod-down52.6%
metadata-eval52.6%
metadata-eval52.6%
unpow-prod-down52.6%
metadata-eval52.6%
div-inv52.6%
unpow-prod-down76.7%
unpow276.7%
sqrt-prod32.7%
add-sqr-sqrt76.7%
*-commutative76.7%
clear-num76.7%
frac-times76.7%
*-un-lft-identity76.7%
Applied egg-rr76.7%
expm1-log1p-u4.7%
expm1-udef4.7%
log1p-udef4.7%
+-commutative4.7%
add-exp-log76.7%
associate-/l*64.8%
Applied egg-rr64.8%
associate--l+64.8%
metadata-eval64.8%
+-rgt-identity64.8%
associate-/r/76.7%
*-commutative76.7%
*-commutative76.7%
associate-/l*76.7%
associate-*l/76.7%
associate-/r/72.6%
*-commutative72.6%
Simplified72.6%
*-un-lft-identity72.6%
unpow272.6%
times-frac77.2%
*-commutative77.2%
div-inv77.3%
associate-*r*77.3%
associate-/r*77.3%
metadata-eval77.3%
*-commutative77.3%
div-inv77.2%
associate-*r*81.3%
associate-/r*81.3%
metadata-eval81.3%
Applied egg-rr81.3%
if 6.99999999999999966e-277 < l Initial program 69.9%
Simplified69.3%
pow1/269.3%
metadata-eval69.3%
add-cbrt-cube55.6%
pow1/353.7%
sqr-pow53.7%
pow-prod-up53.7%
metadata-eval53.7%
metadata-eval53.7%
Applied egg-rr53.7%
unpow1/355.6%
Simplified55.6%
Applied egg-rr36.0%
expm1-def54.9%
expm1-log1p83.0%
associate-*r/83.0%
Simplified83.0%
Final simplification83.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2e-310)
(*
(/ (sqrt (- d)) (sqrt (- h)))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* M -0.5)) 2.0)) l)))))
(*
(+ 1.0 (* -0.5 (* (/ h l) (pow (* M (/ (* D -0.5) d)) 2.0))))
(/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-310) {
tmp = (sqrt(-d) / sqrt(-h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h * pow(((D / d) * (M * -0.5)), 2.0)) / l))));
} else {
tmp = (1.0 + (-0.5 * ((h / l) * pow((M * ((D * -0.5) / d)), 2.0)))) * (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 <= (-2d-310)) then
tmp = (sqrt(-d) / sqrt(-h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (m * (-0.5d0))) ** 2.0d0)) / l))))
else
tmp = (1.0d0 + ((-0.5d0) * ((h / l) * ((m * ((d_1 * (-0.5d0)) / d)) ** 2.0d0)))) * (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 <= -2e-310) {
tmp = (Math.sqrt(-d) / Math.sqrt(-h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * ((h * Math.pow(((D / d) * (M * -0.5)), 2.0)) / l))));
} else {
tmp = (1.0 + (-0.5 * ((h / l) * Math.pow((M * ((D * -0.5) / d)), 2.0)))) * (d / (Math.sqrt(h) * Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2e-310: tmp = (math.sqrt(-d) / math.sqrt(-h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * ((h * math.pow(((D / d) * (M * -0.5)), 2.0)) / l)))) else: tmp = (1.0 + (-0.5 * ((h / l) * math.pow((M * ((D * -0.5) / d)), 2.0)))) * (d / (math.sqrt(h) * math.sqrt(l))) return tmp
function code(d, h, l, M, 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(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(M * -0.5)) ^ 2.0)) / l))))); else tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(M * Float64(Float64(D * -0.5) / d)) ^ 2.0)))) * 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 <= -2e-310) tmp = (sqrt(-d) / sqrt(-h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h * (((D / d) * (M * -0.5)) ^ 2.0)) / l)))); else tmp = (1.0 + (-0.5 * ((h / l) * ((M * ((D * -0.5) / d)) ^ 2.0)))) * (d / (sqrt(h) * sqrt(l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := 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[(0.5 * N[(N[(h * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * -0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(N[(D * -0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(M \cdot -0.5\right)\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \frac{D \cdot -0.5}{d}\right)}^{2}\right)\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 70.6%
Simplified71.3%
frac-2neg71.3%
sqrt-div82.4%
Applied egg-rr82.4%
associate-*r/84.1%
Applied egg-rr84.1%
if -1.999999999999994e-310 < l Initial program 69.2%
Simplified68.6%
pow1/268.6%
metadata-eval68.6%
add-cbrt-cube55.7%
pow1/353.9%
sqr-pow53.9%
pow-prod-up53.9%
metadata-eval53.9%
metadata-eval53.9%
Applied egg-rr53.9%
unpow1/355.7%
Simplified55.7%
Applied egg-rr34.0%
expm1-def51.9%
expm1-log1p81.6%
associate-*r/81.6%
Simplified81.6%
Final simplification82.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (* M D) (/ 0.5 d))))
(if (<= l -8e+134)
(* d (* (pow (- l) -0.5) (- (pow (/ -1.0 h) 0.5))))
(if (<= l 2.7e-275)
(*
(sqrt (/ d l))
(* (sqrt (/ d h)) (+ 1.0 (* h (/ -0.5 (* (/ 1.0 t_0) (/ l t_0)))))))
(*
(+ 1.0 (* -0.5 (* (/ h l) (pow (* M (/ (* D -0.5) d)) 2.0))))
(/ d (* (sqrt h) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (M * D) * (0.5 / d);
double tmp;
if (l <= -8e+134) {
tmp = d * (pow(-l, -0.5) * -pow((-1.0 / h), 0.5));
} else if (l <= 2.7e-275) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (h * (-0.5 / ((1.0 / t_0) * (l / t_0))))));
} else {
tmp = (1.0 + (-0.5 * ((h / l) * pow((M * ((D * -0.5) / d)), 2.0)))) * (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) * (0.5d0 / d)
if (l <= (-8d+134)) then
tmp = d * ((-l ** (-0.5d0)) * -(((-1.0d0) / h) ** 0.5d0))
else if (l <= 2.7d-275) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + (h * ((-0.5d0) / ((1.0d0 / t_0) * (l / t_0))))))
else
tmp = (1.0d0 + ((-0.5d0) * ((h / l) * ((m * ((d_1 * (-0.5d0)) / d)) ** 2.0d0)))) * (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) * (0.5 / d);
double tmp;
if (l <= -8e+134) {
tmp = d * (Math.pow(-l, -0.5) * -Math.pow((-1.0 / h), 0.5));
} else if (l <= 2.7e-275) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + (h * (-0.5 / ((1.0 / t_0) * (l / t_0))))));
} else {
tmp = (1.0 + (-0.5 * ((h / l) * Math.pow((M * ((D * -0.5) / d)), 2.0)))) * (d / (Math.sqrt(h) * Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (M * D) * (0.5 / d) tmp = 0 if l <= -8e+134: tmp = d * (math.pow(-l, -0.5) * -math.pow((-1.0 / h), 0.5)) elif l <= 2.7e-275: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + (h * (-0.5 / ((1.0 / t_0) * (l / t_0)))))) else: tmp = (1.0 + (-0.5 * ((h / l) * math.pow((M * ((D * -0.5) / d)), 2.0)))) * (d / (math.sqrt(h) * math.sqrt(l))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(M * D) * Float64(0.5 / d)) tmp = 0.0 if (l <= -8e+134) tmp = Float64(d * Float64((Float64(-l) ^ -0.5) * Float64(-(Float64(-1.0 / h) ^ 0.5)))); elseif (l <= 2.7e-275) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(h * Float64(-0.5 / Float64(Float64(1.0 / t_0) * Float64(l / t_0))))))); else tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(M * Float64(Float64(D * -0.5) / d)) ^ 2.0)))) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (M * D) * (0.5 / d); tmp = 0.0; if (l <= -8e+134) tmp = d * ((-l ^ -0.5) * -((-1.0 / h) ^ 0.5)); elseif (l <= 2.7e-275) tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (h * (-0.5 / ((1.0 / t_0) * (l / t_0)))))); else tmp = (1.0 + (-0.5 * ((h / l) * ((M * ((D * -0.5) / d)) ^ 2.0)))) * (d / (sqrt(h) * sqrt(l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -8e+134], N[(d * N[(N[Power[(-l), -0.5], $MachinePrecision] * (-N[Power[N[(-1.0 / h), $MachinePrecision], 0.5], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.7e-275], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(h * N[(-0.5 / N[(N[(1.0 / t$95$0), $MachinePrecision] * N[(l / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(N[(D * -0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(M \cdot D\right) \cdot \frac{0.5}{d}\\
\mathbf{if}\;\ell \leq -8 \cdot 10^{+134}:\\
\;\;\;\;d \cdot \left({\left(-\ell\right)}^{-0.5} \cdot \left(-{\left(\frac{-1}{h}\right)}^{0.5}\right)\right)\\
\mathbf{elif}\;\ell \leq 2.7 \cdot 10^{-275}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \frac{-0.5}{\frac{1}{t_0} \cdot \frac{\ell}{t_0}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \frac{D \cdot -0.5}{d}\right)}^{2}\right)\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -7.99999999999999937e134Initial program 56.0%
Simplified58.5%
frac-2neg58.5%
sqrt-div79.7%
Applied egg-rr79.7%
Taylor expanded in d around -inf 61.3%
mul-1-neg61.3%
distribute-rgt-neg-in61.3%
Simplified61.3%
Taylor expanded in d around 0 61.3%
mul-1-neg61.3%
*-commutative61.3%
unpow1/261.3%
rem-exp-log57.3%
exp-neg57.3%
exp-prod57.3%
distribute-lft-neg-out57.3%
distribute-rgt-neg-in57.3%
metadata-eval57.3%
exp-to-pow61.3%
distribute-rgt-neg-in61.3%
Simplified61.3%
Taylor expanded in h around -inf 71.0%
distribute-lft-in71.0%
exp-sum71.1%
*-commutative71.1%
neg-mul-171.1%
exp-to-pow72.6%
*-commutative72.6%
*-commutative72.6%
associate-*l*72.6%
metadata-eval72.6%
exp-to-pow77.7%
Simplified77.7%
if -7.99999999999999937e134 < l < 2.69999999999999993e-275Initial program 75.6%
Simplified75.5%
Applied egg-rr80.8%
add-sqr-sqrt54.1%
sqrt-prod80.8%
unpow280.8%
unpow-prod-down66.3%
unpow-prod-down66.3%
metadata-eval66.3%
metadata-eval66.3%
unpow-prod-down66.3%
metadata-eval66.3%
div-inv66.3%
unpow-prod-down80.8%
unpow280.8%
sqrt-prod41.6%
add-sqr-sqrt80.8%
*-commutative80.8%
clear-num80.8%
frac-times80.8%
*-un-lft-identity80.8%
Applied egg-rr80.8%
expm1-log1p-u32.3%
expm1-udef32.3%
log1p-udef32.3%
+-commutative32.3%
add-exp-log80.8%
associate-/l*75.5%
Applied egg-rr75.5%
associate--l+75.5%
metadata-eval75.5%
+-rgt-identity75.5%
associate-/r/79.8%
*-commutative79.8%
*-commutative79.8%
associate-/l*79.8%
associate-*l/79.8%
associate-/r/77.2%
*-commutative77.2%
Simplified77.2%
*-un-lft-identity77.2%
unpow277.2%
times-frac79.4%
*-commutative79.4%
div-inv79.4%
associate-*r*79.4%
associate-/r*79.4%
metadata-eval79.4%
*-commutative79.4%
div-inv79.4%
associate-*r*82.0%
associate-/r*82.0%
metadata-eval82.0%
Applied egg-rr82.0%
if 2.69999999999999993e-275 < l Initial program 69.9%
Simplified69.3%
pow1/269.3%
metadata-eval69.3%
add-cbrt-cube55.6%
pow1/353.7%
sqr-pow53.7%
pow-prod-up53.7%
metadata-eval53.7%
metadata-eval53.7%
Applied egg-rr53.7%
unpow1/355.6%
Simplified55.6%
Applied egg-rr36.0%
expm1-def54.9%
expm1-log1p83.0%
associate-*r/83.0%
Simplified83.0%
Final simplification81.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (* M D) (/ 0.5 d))))
(if (<= l -1.3e+134)
(* d (* (pow (- l) -0.5) (- (pow (/ -1.0 h) 0.5))))
(if (<= l 8.5e+121)
(*
(sqrt (/ d l))
(* (sqrt (/ d h)) (+ 1.0 (* h (/ -0.5 (* (/ 1.0 t_0) (/ l t_0)))))))
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (M * D) * (0.5 / d);
double tmp;
if (l <= -1.3e+134) {
tmp = d * (pow(-l, -0.5) * -pow((-1.0 / h), 0.5));
} else if (l <= 8.5e+121) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (h * (-0.5 / ((1.0 / t_0) * (l / 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 = (m * d_1) * (0.5d0 / d)
if (l <= (-1.3d+134)) then
tmp = d * ((-l ** (-0.5d0)) * -(((-1.0d0) / h) ** 0.5d0))
else if (l <= 8.5d+121) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + (h * ((-0.5d0) / ((1.0d0 / t_0) * (l / 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 = (M * D) * (0.5 / d);
double tmp;
if (l <= -1.3e+134) {
tmp = d * (Math.pow(-l, -0.5) * -Math.pow((-1.0 / h), 0.5));
} else if (l <= 8.5e+121) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + (h * (-0.5 / ((1.0 / t_0) * (l / t_0))))));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (M * D) * (0.5 / d) tmp = 0 if l <= -1.3e+134: tmp = d * (math.pow(-l, -0.5) * -math.pow((-1.0 / h), 0.5)) elif l <= 8.5e+121: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + (h * (-0.5 / ((1.0 / t_0) * (l / t_0)))))) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(M * D) * Float64(0.5 / d)) tmp = 0.0 if (l <= -1.3e+134) tmp = Float64(d * Float64((Float64(-l) ^ -0.5) * Float64(-(Float64(-1.0 / h) ^ 0.5)))); elseif (l <= 8.5e+121) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(h * Float64(-0.5 / Float64(Float64(1.0 / t_0) * Float64(l / 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 = (M * D) * (0.5 / d); tmp = 0.0; if (l <= -1.3e+134) tmp = d * ((-l ^ -0.5) * -((-1.0 / h) ^ 0.5)); elseif (l <= 8.5e+121) tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (h * (-0.5 / ((1.0 / t_0) * (l / 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[(N[(M * D), $MachinePrecision] * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.3e+134], N[(d * N[(N[Power[(-l), -0.5], $MachinePrecision] * (-N[Power[N[(-1.0 / h), $MachinePrecision], 0.5], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 8.5e+121], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(h * N[(-0.5 / N[(N[(1.0 / t$95$0), $MachinePrecision] * N[(l / t$95$0), $MachinePrecision]), $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 := \left(M \cdot D\right) \cdot \frac{0.5}{d}\\
\mathbf{if}\;\ell \leq -1.3 \cdot 10^{+134}:\\
\;\;\;\;d \cdot \left({\left(-\ell\right)}^{-0.5} \cdot \left(-{\left(\frac{-1}{h}\right)}^{0.5}\right)\right)\\
\mathbf{elif}\;\ell \leq 8.5 \cdot 10^{+121}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \frac{-0.5}{\frac{1}{t_0} \cdot \frac{\ell}{t_0}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.3000000000000001e134Initial program 56.0%
Simplified58.5%
frac-2neg58.5%
sqrt-div79.7%
Applied egg-rr79.7%
Taylor expanded in d around -inf 61.3%
mul-1-neg61.3%
distribute-rgt-neg-in61.3%
Simplified61.3%
Taylor expanded in d around 0 61.3%
mul-1-neg61.3%
*-commutative61.3%
unpow1/261.3%
rem-exp-log57.3%
exp-neg57.3%
exp-prod57.3%
distribute-lft-neg-out57.3%
distribute-rgt-neg-in57.3%
metadata-eval57.3%
exp-to-pow61.3%
distribute-rgt-neg-in61.3%
Simplified61.3%
Taylor expanded in h around -inf 71.0%
distribute-lft-in71.0%
exp-sum71.1%
*-commutative71.1%
neg-mul-171.1%
exp-to-pow72.6%
*-commutative72.6%
*-commutative72.6%
associate-*l*72.6%
metadata-eval72.6%
exp-to-pow77.7%
Simplified77.7%
if -1.3000000000000001e134 < l < 8.5e121Initial program 74.8%
Simplified74.3%
Applied egg-rr78.2%
add-sqr-sqrt48.7%
sqrt-prod78.2%
unpow278.2%
unpow-prod-down62.9%
unpow-prod-down62.9%
metadata-eval62.9%
metadata-eval62.9%
unpow-prod-down62.9%
metadata-eval62.9%
div-inv62.9%
unpow-prod-down78.2%
unpow278.2%
sqrt-prod47.3%
add-sqr-sqrt78.2%
*-commutative78.2%
clear-num78.2%
frac-times78.2%
*-un-lft-identity78.2%
Applied egg-rr78.2%
expm1-log1p-u36.6%
expm1-udef36.6%
log1p-udef36.6%
+-commutative36.6%
add-exp-log78.2%
associate-/l*74.4%
Applied egg-rr74.4%
associate--l+74.4%
metadata-eval74.4%
+-rgt-identity74.4%
associate-/r/77.7%
*-commutative77.7%
*-commutative77.7%
associate-/l*77.7%
associate-*l/77.7%
associate-/r/76.3%
*-commutative76.3%
Simplified76.3%
*-un-lft-identity76.3%
unpow276.3%
times-frac78.0%
*-commutative78.0%
div-inv78.0%
associate-*r*78.0%
associate-/r*78.0%
metadata-eval78.0%
*-commutative78.0%
div-inv78.0%
associate-*r*79.8%
associate-/r*79.8%
metadata-eval79.8%
Applied egg-rr79.8%
if 8.5e121 < l Initial program 59.5%
Simplified59.5%
Taylor expanded in M around 0 65.8%
*-commutative65.8%
sqrt-div73.2%
sqrt-div78.8%
frac-times78.6%
add-sqr-sqrt78.8%
Applied egg-rr78.8%
Final simplification79.4%
(FPCore (d h l M D)
:precision binary64
(if (<= l -4.3e-242)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= l -5e-309)
(/ d (sqrt (* l h)))
(if (<= l 1.55e-253)
(* d (- (exp (* 0.5 (- (log1p (+ -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 <= -4.3e-242) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (l <= -5e-309) {
tmp = d / sqrt((l * h));
} else if (l <= 1.55e-253) {
tmp = d * -exp((0.5 * -log1p((-1.0 + (l * h)))));
} 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 <= -4.3e-242) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (l <= -5e-309) {
tmp = d / Math.sqrt((l * h));
} else if (l <= 1.55e-253) {
tmp = d * -Math.exp((0.5 * -Math.log1p((-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 <= -4.3e-242: tmp = d * -math.sqrt(((1.0 / l) / h)) elif l <= -5e-309: tmp = d / math.sqrt((l * h)) elif l <= 1.55e-253: tmp = d * -math.exp((0.5 * -math.log1p((-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 <= -4.3e-242) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (l <= -5e-309) tmp = Float64(d / sqrt(Float64(l * h))); elseif (l <= 1.55e-253) tmp = Float64(d * Float64(-exp(Float64(0.5 * Float64(-log1p(Float64(-1.0 + Float64(l * h)))))))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4.3e-242], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, -5e-309], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.55e-253], N[(d * (-N[Exp[N[(0.5 * (-N[Log[1 + N[(-1.0 + N[(l * h), $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}
\mathbf{if}\;\ell \leq -4.3 \cdot 10^{-242}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-309}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{elif}\;\ell \leq 1.55 \cdot 10^{-253}:\\
\;\;\;\;d \cdot \left(-e^{0.5 \cdot \left(-\mathsf{log1p}\left(-1 + \ell \cdot h\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.3000000000000002e-242Initial program 70.1%
Simplified70.9%
frac-2neg70.9%
sqrt-div83.4%
Applied egg-rr83.4%
Taylor expanded in d around -inf 50.2%
mul-1-neg50.2%
distribute-rgt-neg-in50.2%
Simplified50.2%
expm1-log1p-u48.9%
expm1-udef25.1%
Applied egg-rr25.1%
expm1-def48.9%
expm1-log1p50.2%
*-commutative50.2%
associate-/r*51.7%
Simplified51.7%
if -4.3000000000000002e-242 < l < -4.9999999999999995e-309Initial program 74.6%
Simplified68.0%
Taylor expanded in M around 0 1.2%
sqrt-div0.0%
div-inv0.0%
Applied egg-rr0.0%
associate-*r/0.0%
*-rgt-identity0.0%
Simplified0.0%
expm1-log1p-u0.0%
expm1-udef0.0%
*-commutative0.0%
sqrt-div0.0%
frac-times0.0%
add-sqr-sqrt0.0%
sqrt-prod0.3%
Applied egg-rr0.3%
expm1-def0.6%
expm1-log1p42.2%
Simplified42.2%
if -4.9999999999999995e-309 < l < 1.54999999999999998e-253Initial program 69.1%
Simplified69.9%
frac-2neg69.9%
sqrt-div0.0%
Applied egg-rr0.0%
Taylor expanded in d around -inf 18.5%
mul-1-neg18.5%
distribute-rgt-neg-in18.5%
Simplified18.5%
pow1/218.5%
pow-to-exp18.5%
log-rec18.5%
Applied egg-rr18.5%
log1p-expm1-u69.5%
expm1-udef69.5%
add-exp-log69.5%
*-commutative69.5%
Applied egg-rr69.5%
if 1.54999999999999998e-253 < l Initial program 69.2%
Simplified68.5%
Taylor expanded in M around 0 51.1%
*-commutative51.1%
sqrt-div56.3%
sqrt-div61.1%
frac-times61.0%
add-sqr-sqrt61.1%
Applied egg-rr61.1%
Final simplification56.2%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2.3e-244)
(* d (* (pow (- l) -0.5) (- (pow (/ -1.0 h) 0.5))))
(if (<= l -2e-310)
(/ d (sqrt (* l h)))
(if (<= l 3.2e-254)
(* d (- (exp (* 0.5 (- (log1p (+ -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 <= -2.3e-244) {
tmp = d * (pow(-l, -0.5) * -pow((-1.0 / h), 0.5));
} else if (l <= -2e-310) {
tmp = d / sqrt((l * h));
} else if (l <= 3.2e-254) {
tmp = d * -exp((0.5 * -log1p((-1.0 + (l * h)))));
} 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 <= -2.3e-244) {
tmp = d * (Math.pow(-l, -0.5) * -Math.pow((-1.0 / h), 0.5));
} else if (l <= -2e-310) {
tmp = d / Math.sqrt((l * h));
} else if (l <= 3.2e-254) {
tmp = d * -Math.exp((0.5 * -Math.log1p((-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 <= -2.3e-244: tmp = d * (math.pow(-l, -0.5) * -math.pow((-1.0 / h), 0.5)) elif l <= -2e-310: tmp = d / math.sqrt((l * h)) elif l <= 3.2e-254: tmp = d * -math.exp((0.5 * -math.log1p((-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 <= -2.3e-244) tmp = Float64(d * Float64((Float64(-l) ^ -0.5) * Float64(-(Float64(-1.0 / h) ^ 0.5)))); elseif (l <= -2e-310) tmp = Float64(d / sqrt(Float64(l * h))); elseif (l <= 3.2e-254) tmp = Float64(d * Float64(-exp(Float64(0.5 * Float64(-log1p(Float64(-1.0 + Float64(l * h)))))))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.3e-244], N[(d * N[(N[Power[(-l), -0.5], $MachinePrecision] * (-N[Power[N[(-1.0 / h), $MachinePrecision], 0.5], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.2e-254], N[(d * (-N[Exp[N[(0.5 * (-N[Log[1 + N[(-1.0 + N[(l * h), $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}
\mathbf{if}\;\ell \leq -2.3 \cdot 10^{-244}:\\
\;\;\;\;d \cdot \left({\left(-\ell\right)}^{-0.5} \cdot \left(-{\left(\frac{-1}{h}\right)}^{0.5}\right)\right)\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{elif}\;\ell \leq 3.2 \cdot 10^{-254}:\\
\;\;\;\;d \cdot \left(-e^{0.5 \cdot \left(-\mathsf{log1p}\left(-1 + \ell \cdot h\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -2.3e-244Initial program 70.1%
Simplified70.9%
frac-2neg70.9%
sqrt-div83.4%
Applied egg-rr83.4%
Taylor expanded in d around -inf 50.2%
mul-1-neg50.2%
distribute-rgt-neg-in50.2%
Simplified50.2%
Taylor expanded in d around 0 50.2%
mul-1-neg50.2%
*-commutative50.2%
unpow1/250.2%
rem-exp-log47.2%
exp-neg47.2%
exp-prod47.6%
distribute-lft-neg-out47.6%
distribute-rgt-neg-in47.6%
metadata-eval47.6%
exp-to-pow50.6%
distribute-rgt-neg-in50.6%
Simplified50.6%
Taylor expanded in h around -inf 53.9%
distribute-lft-in53.9%
exp-sum54.2%
*-commutative54.2%
neg-mul-154.2%
exp-to-pow54.8%
*-commutative54.8%
*-commutative54.8%
associate-*l*54.8%
metadata-eval54.8%
exp-to-pow58.3%
Simplified58.3%
if -2.3e-244 < l < -1.999999999999994e-310Initial program 74.6%
Simplified68.0%
Taylor expanded in M around 0 1.2%
sqrt-div0.0%
div-inv0.0%
Applied egg-rr0.0%
associate-*r/0.0%
*-rgt-identity0.0%
Simplified0.0%
expm1-log1p-u0.0%
expm1-udef0.0%
*-commutative0.0%
sqrt-div0.0%
frac-times0.0%
add-sqr-sqrt0.0%
sqrt-prod0.3%
Applied egg-rr0.3%
expm1-def0.6%
expm1-log1p42.2%
Simplified42.2%
if -1.999999999999994e-310 < l < 3.2e-254Initial program 69.1%
Simplified69.9%
frac-2neg69.9%
sqrt-div0.0%
Applied egg-rr0.0%
Taylor expanded in d around -inf 18.5%
mul-1-neg18.5%
distribute-rgt-neg-in18.5%
Simplified18.5%
pow1/218.5%
pow-to-exp18.5%
log-rec18.5%
Applied egg-rr18.5%
log1p-expm1-u69.5%
expm1-udef69.5%
add-exp-log69.5%
*-commutative69.5%
Applied egg-rr69.5%
if 3.2e-254 < l Initial program 69.2%
Simplified68.5%
Taylor expanded in M around 0 51.1%
*-commutative51.1%
sqrt-div56.3%
sqrt-div61.1%
frac-times61.0%
add-sqr-sqrt61.1%
Applied egg-rr61.1%
Final simplification59.2%
(FPCore (d h l M D)
:precision binary64
(if (<= l -4.8e-244)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= l 2e+86)
(* d (sqrt (/ 1.0 (* l h))))
(* (sqrt (/ d h)) (sqrt (/ d l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -4.8e-244) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (l <= 2e+86) {
tmp = d * sqrt((1.0 / (l * h)));
} else {
tmp = sqrt((d / h)) * 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) :: tmp
if (l <= (-4.8d-244)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else if (l <= 2d+86) then
tmp = d * sqrt((1.0d0 / (l * h)))
else
tmp = sqrt((d / h)) * sqrt((d / 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 <= -4.8e-244) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (l <= 2e+86) {
tmp = d * Math.sqrt((1.0 / (l * h)));
} else {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -4.8e-244: tmp = d * -math.sqrt(((1.0 / l) / h)) elif l <= 2e+86: tmp = d * math.sqrt((1.0 / (l * h))) else: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -4.8e-244) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (l <= 2e+86) tmp = Float64(d * sqrt(Float64(1.0 / Float64(l * h)))); else tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -4.8e-244) tmp = d * -sqrt(((1.0 / l) / h)); elseif (l <= 2e+86) tmp = d * sqrt((1.0 / (l * h))); else tmp = sqrt((d / h)) * sqrt((d / l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4.8e-244], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, 2e+86], N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.8 \cdot 10^{-244}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;\ell \leq 2 \cdot 10^{+86}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\end{array}
\end{array}
if l < -4.80000000000000032e-244Initial program 70.1%
Simplified70.9%
frac-2neg70.9%
sqrt-div83.4%
Applied egg-rr83.4%
Taylor expanded in d around -inf 50.2%
mul-1-neg50.2%
distribute-rgt-neg-in50.2%
Simplified50.2%
expm1-log1p-u48.9%
expm1-udef25.1%
Applied egg-rr25.1%
expm1-def48.9%
expm1-log1p50.2%
*-commutative50.2%
associate-/r*51.7%
Simplified51.7%
if -4.80000000000000032e-244 < l < 2e86Initial program 73.7%
Simplified71.9%
Taylor expanded in M around 0 32.3%
Taylor expanded in d around 0 45.1%
if 2e86 < l Initial program 60.3%
Simplified60.3%
Applied egg-rr62.5%
add-sqr-sqrt42.1%
sqrt-prod62.5%
unpow262.5%
unpow-prod-down57.5%
unpow-prod-down57.5%
metadata-eval57.5%
metadata-eval57.5%
unpow-prod-down57.5%
metadata-eval57.5%
div-inv57.5%
unpow-prod-down62.5%
unpow262.5%
sqrt-prod45.4%
add-sqr-sqrt62.5%
*-commutative62.5%
clear-num62.5%
frac-times62.5%
*-un-lft-identity62.5%
Applied egg-rr62.5%
Taylor expanded in M around 0 63.0%
Final simplification50.9%
(FPCore (d h l M D) :precision binary64 (if (<= l -1.75e-244) (* d (- (sqrt (/ (/ 1.0 l) h)))) (if (<= l -2e-310) (/ d (sqrt (* l h))) (/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.75e-244) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (l <= -2e-310) {
tmp = d / sqrt((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.75d-244)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else if (l <= (-2d-310)) then
tmp = d / sqrt((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.75e-244) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (l <= -2e-310) {
tmp = d / Math.sqrt((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.75e-244: tmp = d * -math.sqrt(((1.0 / l) / h)) elif l <= -2e-310: tmp = d / math.sqrt((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.75e-244) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (l <= -2e-310) tmp = Float64(d / sqrt(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.75e-244) tmp = d * -sqrt(((1.0 / l) / h)); elseif (l <= -2e-310) tmp = d / sqrt((l * h)); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.75e-244], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, -2e-310], N[(d / N[Sqrt[N[(l * h), $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.75 \cdot 10^{-244}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.74999999999999996e-244Initial program 70.1%
Simplified70.9%
frac-2neg70.9%
sqrt-div83.4%
Applied egg-rr83.4%
Taylor expanded in d around -inf 50.2%
mul-1-neg50.2%
distribute-rgt-neg-in50.2%
Simplified50.2%
expm1-log1p-u48.9%
expm1-udef25.1%
Applied egg-rr25.1%
expm1-def48.9%
expm1-log1p50.2%
*-commutative50.2%
associate-/r*51.7%
Simplified51.7%
if -1.74999999999999996e-244 < l < -1.999999999999994e-310Initial program 74.6%
Simplified68.0%
Taylor expanded in M around 0 1.2%
sqrt-div0.0%
div-inv0.0%
Applied egg-rr0.0%
associate-*r/0.0%
*-rgt-identity0.0%
Simplified0.0%
expm1-log1p-u0.0%
expm1-udef0.0%
*-commutative0.0%
sqrt-div0.0%
frac-times0.0%
add-sqr-sqrt0.0%
sqrt-prod0.3%
Applied egg-rr0.3%
expm1-def0.6%
expm1-log1p42.2%
Simplified42.2%
if -1.999999999999994e-310 < l Initial program 69.2%
Simplified68.6%
Taylor expanded in M around 0 46.0%
*-commutative46.0%
sqrt-div52.9%
sqrt-div57.2%
frac-times57.1%
add-sqr-sqrt57.2%
Applied egg-rr57.2%
Final simplification53.8%
(FPCore (d h l M D) :precision binary64 (if (<= l -1.95e-244) (* d (- (sqrt (/ (/ 1.0 h) l)))) (/ d (sqrt (* l h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.95e-244) {
tmp = d * -sqrt(((1.0 / h) / l));
} else {
tmp = d / sqrt((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.95d-244)) then
tmp = d * -sqrt(((1.0d0 / h) / l))
else
tmp = d / sqrt((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.95e-244) {
tmp = d * -Math.sqrt(((1.0 / h) / l));
} else {
tmp = d / Math.sqrt((l * h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.95e-244: tmp = d * -math.sqrt(((1.0 / h) / l)) else: tmp = d / math.sqrt((l * h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.95e-244) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / h) / l)))); else tmp = Float64(d / sqrt(Float64(l * h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.95e-244) tmp = d * -sqrt(((1.0 / h) / l)); else tmp = d / sqrt((l * h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.95e-244], N[(d * (-N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.95 \cdot 10^{-244}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -1.9499999999999999e-244Initial program 70.1%
Simplified70.9%
frac-2neg70.9%
sqrt-div83.4%
Applied egg-rr83.4%
Taylor expanded in d around -inf 50.2%
mul-1-neg50.2%
distribute-rgt-neg-in50.2%
Simplified50.2%
Taylor expanded in d around 0 50.2%
mul-1-neg50.2%
*-commutative50.2%
unpow1/250.2%
rem-exp-log47.2%
exp-neg47.2%
exp-prod47.6%
distribute-lft-neg-out47.6%
distribute-rgt-neg-in47.6%
metadata-eval47.6%
exp-to-pow50.6%
distribute-rgt-neg-in50.6%
Simplified50.6%
Taylor expanded in d around 0 50.2%
mul-1-neg50.2%
distribute-rgt-neg-in50.2%
associate-/r*51.7%
Simplified51.7%
if -1.9499999999999999e-244 < l Initial program 69.8%
Simplified68.5%
Taylor expanded in M around 0 41.2%
sqrt-div76.3%
div-inv76.3%
Applied egg-rr47.2%
associate-*r/76.3%
*-rgt-identity76.3%
Simplified47.3%
expm1-log1p-u45.8%
expm1-udef30.6%
*-commutative30.6%
sqrt-div34.1%
frac-times34.1%
add-sqr-sqrt34.1%
sqrt-prod28.6%
Applied egg-rr28.6%
expm1-def40.6%
expm1-log1p46.5%
Simplified46.5%
Final simplification48.8%
(FPCore (d h l M D) :precision binary64 (if (<= l -1.7e-244) (* d (- (sqrt (/ (/ 1.0 l) h)))) (/ d (sqrt (* l h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.7e-244) {
tmp = d * -sqrt(((1.0 / l) / h));
} else {
tmp = d / sqrt((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.7d-244)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else
tmp = d / sqrt((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.7e-244) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else {
tmp = d / Math.sqrt((l * h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.7e-244: tmp = d * -math.sqrt(((1.0 / l) / h)) else: tmp = d / math.sqrt((l * h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.7e-244) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); else tmp = Float64(d / sqrt(Float64(l * h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.7e-244) tmp = d * -sqrt(((1.0 / l) / h)); else tmp = d / sqrt((l * h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.7e-244], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.7 \cdot 10^{-244}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -1.70000000000000004e-244Initial program 70.1%
Simplified70.9%
frac-2neg70.9%
sqrt-div83.4%
Applied egg-rr83.4%
Taylor expanded in d around -inf 50.2%
mul-1-neg50.2%
distribute-rgt-neg-in50.2%
Simplified50.2%
expm1-log1p-u48.9%
expm1-udef25.1%
Applied egg-rr25.1%
expm1-def48.9%
expm1-log1p50.2%
*-commutative50.2%
associate-/r*51.7%
Simplified51.7%
if -1.70000000000000004e-244 < l Initial program 69.8%
Simplified68.5%
Taylor expanded in M around 0 41.2%
sqrt-div76.3%
div-inv76.3%
Applied egg-rr47.2%
associate-*r/76.3%
*-rgt-identity76.3%
Simplified47.3%
expm1-log1p-u45.8%
expm1-udef30.6%
*-commutative30.6%
sqrt-div34.1%
frac-times34.1%
add-sqr-sqrt34.1%
sqrt-prod28.6%
Applied egg-rr28.6%
expm1-def40.6%
expm1-log1p46.5%
Simplified46.5%
Final simplification48.9%
(FPCore (d h l M D) :precision binary64 (if (<= l -5.2e-243) (* d (- (sqrt (/ (/ 1.0 l) h)))) (* d (pow (* l h) -0.5))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -5.2e-243) {
tmp = d * -sqrt(((1.0 / l) / h));
} else {
tmp = d * pow((l * h), -0.5);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-5.2d-243)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else
tmp = d * ((l * h) ** (-0.5d0))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -5.2e-243) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else {
tmp = d * Math.pow((l * h), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -5.2e-243: tmp = d * -math.sqrt(((1.0 / l) / h)) else: tmp = d * math.pow((l * h), -0.5) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -5.2e-243) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); else tmp = Float64(d * (Float64(l * h) ^ -0.5)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -5.2e-243) tmp = d * -sqrt(((1.0 / l) / h)); else tmp = d * ((l * h) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -5.2e-243], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.2 \cdot 10^{-243}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if l < -5.1999999999999995e-243Initial program 70.1%
Simplified70.9%
frac-2neg70.9%
sqrt-div83.4%
Applied egg-rr83.4%
Taylor expanded in d around -inf 50.2%
mul-1-neg50.2%
distribute-rgt-neg-in50.2%
Simplified50.2%
expm1-log1p-u48.9%
expm1-udef25.1%
Applied egg-rr25.1%
expm1-def48.9%
expm1-log1p50.2%
*-commutative50.2%
associate-/r*51.7%
Simplified51.7%
if -5.1999999999999995e-243 < l Initial program 69.8%
Simplified68.5%
Taylor expanded in M around 0 41.2%
pow1/241.2%
metadata-eval41.2%
add-cbrt-cube35.2%
pow1/333.8%
sqr-pow33.8%
pow-prod-up33.8%
metadata-eval33.8%
metadata-eval33.8%
Applied egg-rr33.8%
unpow1/335.2%
Simplified35.2%
Taylor expanded in d around 0 46.6%
unpow1/246.6%
rem-exp-log44.3%
exp-neg44.3%
exp-prod44.3%
distribute-lft-neg-out44.3%
distribute-rgt-neg-in44.3%
metadata-eval44.3%
exp-to-pow46.6%
Simplified46.6%
Final simplification48.9%
(FPCore (d h l M D) :precision binary64 (if (<= l -1.3e-243) (* d (- (sqrt (/ (/ 1.0 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.3e-243) {
tmp = d * -sqrt(((1.0 / 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.3d-243)) then
tmp = d * -sqrt(((1.0d0 / 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.3e-243) {
tmp = d * -Math.sqrt(((1.0 / 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.3e-243: tmp = d * -math.sqrt(((1.0 / 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.3e-243) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / 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 <= -1.3e-243) tmp = d * -sqrt(((1.0 / 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.3e-243], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / 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 -1.3 \cdot 10^{-243}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -1.2999999999999999e-243Initial program 70.1%
Simplified70.9%
frac-2neg70.9%
sqrt-div83.4%
Applied egg-rr83.4%
Taylor expanded in d around -inf 50.2%
mul-1-neg50.2%
distribute-rgt-neg-in50.2%
Simplified50.2%
expm1-log1p-u48.9%
expm1-udef25.1%
Applied egg-rr25.1%
expm1-def48.9%
expm1-log1p50.2%
*-commutative50.2%
associate-/r*51.7%
Simplified51.7%
if -1.2999999999999999e-243 < l Initial program 69.8%
Simplified68.5%
Taylor expanded in M around 0 41.2%
Taylor expanded in d around 0 46.6%
Final simplification48.9%
(FPCore (d h l M D) :precision binary64 (if (<= l -7.5e-244) (* d (- (pow (* l h) -0.5))) (/ d (sqrt (* l h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -7.5e-244) {
tmp = d * -pow((l * h), -0.5);
} else {
tmp = d / sqrt((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 <= (-7.5d-244)) then
tmp = d * -((l * h) ** (-0.5d0))
else
tmp = d / sqrt((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 <= -7.5e-244) {
tmp = d * -Math.pow((l * h), -0.5);
} else {
tmp = d / Math.sqrt((l * h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -7.5e-244: tmp = d * -math.pow((l * h), -0.5) else: tmp = d / math.sqrt((l * h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -7.5e-244) tmp = Float64(d * Float64(-(Float64(l * h) ^ -0.5))); else tmp = Float64(d / sqrt(Float64(l * h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -7.5e-244) tmp = d * -((l * h) ^ -0.5); else tmp = d / sqrt((l * h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -7.5e-244], N[(d * (-N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -7.5 \cdot 10^{-244}:\\
\;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -7.5000000000000003e-244Initial program 70.1%
Simplified70.9%
frac-2neg70.9%
sqrt-div83.4%
Applied egg-rr83.4%
Taylor expanded in d around -inf 50.2%
mul-1-neg50.2%
distribute-rgt-neg-in50.2%
Simplified50.2%
Taylor expanded in d around 0 50.2%
mul-1-neg50.2%
*-commutative50.2%
unpow1/250.2%
rem-exp-log47.2%
exp-neg47.2%
exp-prod47.6%
distribute-lft-neg-out47.6%
distribute-rgt-neg-in47.6%
metadata-eval47.6%
exp-to-pow50.6%
distribute-rgt-neg-in50.6%
Simplified50.6%
if -7.5000000000000003e-244 < l Initial program 69.8%
Simplified68.5%
Taylor expanded in M around 0 41.2%
sqrt-div76.3%
div-inv76.3%
Applied egg-rr47.2%
associate-*r/76.3%
*-rgt-identity76.3%
Simplified47.3%
expm1-log1p-u45.8%
expm1-udef30.6%
*-commutative30.6%
sqrt-div34.1%
frac-times34.1%
add-sqr-sqrt34.1%
sqrt-prod28.6%
Applied egg-rr28.6%
expm1-def40.6%
expm1-log1p46.5%
Simplified46.5%
Final simplification48.4%
(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}
\\
d \cdot \sqrt{\ell \cdot h}
\end{array}
Initial program 69.9%
Simplified70.0%
frac-2neg70.0%
sqrt-div41.8%
Applied egg-rr41.8%
Taylor expanded in d around -inf 27.7%
mul-1-neg27.7%
distribute-rgt-neg-in27.7%
Simplified27.7%
Taylor expanded in d around 0 27.7%
mul-1-neg27.7%
*-commutative27.7%
unpow1/227.7%
rem-exp-log26.3%
exp-neg26.3%
exp-prod26.5%
distribute-lft-neg-out26.5%
distribute-rgt-neg-in26.5%
metadata-eval26.5%
exp-to-pow27.9%
distribute-rgt-neg-in27.9%
Simplified27.9%
Applied egg-rr2.5%
expm1-def2.1%
expm1-log1p3.9%
Simplified3.9%
Final simplification3.9%
(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 69.9%
Simplified68.6%
Taylor expanded in M around 0 43.1%
sqrt-div42.0%
div-inv42.0%
Applied egg-rr26.0%
associate-*r/42.0%
*-rgt-identity42.0%
Simplified26.0%
expm1-log1p-u25.3%
expm1-udef16.9%
*-commutative16.9%
sqrt-div18.8%
frac-times18.8%
add-sqr-sqrt18.8%
sqrt-prod16.8%
Applied egg-rr16.8%
expm1-def23.4%
expm1-log1p29.0%
Simplified29.0%
Final simplification29.0%
herbie shell --seed 2023299
(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)))))