
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(if (<= l -1e-311)
(*
(* d (pow (* l h) -0.5))
(- -1.0 (* -0.5 (* (pow (* 0.5 (* M (/ D d))) 2.0) (/ h l)))))
(if (<= l 1.55e+135)
(*
(* (/ (sqrt d) (sqrt h)) (sqrt (/ d l)))
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* 0.5 M)) 2.0)) l))))
(* d (* (pow h -0.5) (pow l -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1e-311) {
tmp = (d * pow((l * h), -0.5)) * (-1.0 - (-0.5 * (pow((0.5 * (M * (D / d))), 2.0) * (h / l))));
} else if (l <= 1.55e+135) {
tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0 - (0.5 * ((h * pow(((D / d) * (0.5 * M)), 2.0)) / l)));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1d-311)) then
tmp = (d * ((l * h) ** (-0.5d0))) * ((-1.0d0) - ((-0.5d0) * (((0.5d0 * (m * (d_1 / d))) ** 2.0d0) * (h / l))))
else if (l <= 1.55d+135) then
tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (0.5d0 * m)) ** 2.0d0)) / l)))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1e-311) {
tmp = (d * Math.pow((l * h), -0.5)) * (-1.0 - (-0.5 * (Math.pow((0.5 * (M * (D / d))), 2.0) * (h / l))));
} else if (l <= 1.55e+135) {
tmp = ((Math.sqrt(d) / Math.sqrt(h)) * Math.sqrt((d / l))) * (1.0 - (0.5 * ((h * Math.pow(((D / d) * (0.5 * M)), 2.0)) / l)));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1e-311: tmp = (d * math.pow((l * h), -0.5)) * (-1.0 - (-0.5 * (math.pow((0.5 * (M * (D / d))), 2.0) * (h / l)))) elif l <= 1.55e+135: tmp = ((math.sqrt(d) / math.sqrt(h)) * math.sqrt((d / l))) * (1.0 - (0.5 * ((h * math.pow(((D / d) * (0.5 * M)), 2.0)) / l))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1e-311) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 - Float64(-0.5 * Float64((Float64(0.5 * Float64(M * Float64(D / d))) ^ 2.0) * Float64(h / l))))); elseif (l <= 1.55e+135) tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(0.5 * M)) ^ 2.0)) / l)))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1e-311) tmp = (d * ((l * h) ^ -0.5)) * (-1.0 - (-0.5 * (((0.5 * (M * (D / d))) ^ 2.0) * (h / l)))); elseif (l <= 1.55e+135) tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0 - (0.5 * ((h * (((D / d) * (0.5 * M)) ^ 2.0)) / l))); else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1e-311], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[Power[N[(0.5 * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.55e+135], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(D / d), $MachinePrecision] * N[(0.5 * M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1 \cdot 10^{-311}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 - -0.5 \cdot \left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{elif}\;\ell \leq 1.55 \cdot 10^{+135}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(0.5 \cdot M\right)\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -9.99999999999948e-312Initial program 61.9%
Simplified62.3%
associate-*r/62.5%
div-inv62.5%
metadata-eval62.5%
Applied egg-rr62.5%
sqrt-div0.0%
metadata-eval0.0%
div-inv0.0%
associate-*r/0.0%
pow10.0%
Applied egg-rr54.4%
unpow154.4%
*-commutative54.4%
*-commutative54.4%
associate-*r*54.4%
Simplified54.4%
Taylor expanded in d around -inf 72.7%
mul-1-neg72.7%
distribute-rgt-neg-in72.7%
unpow-172.7%
metadata-eval72.7%
pow-sqr72.8%
rem-sqrt-square72.8%
rem-square-sqrt72.6%
fabs-sqr72.6%
rem-square-sqrt72.8%
Simplified72.8%
if -9.99999999999948e-312 < l < 1.55000000000000011e135Initial program 70.2%
Simplified70.2%
associate-*r/74.8%
div-inv74.8%
metadata-eval74.8%
Applied egg-rr74.8%
sqrt-div89.5%
Applied egg-rr89.5%
if 1.55000000000000011e135 < l Initial program 44.4%
Simplified44.3%
associate-*r/44.1%
div-inv44.1%
metadata-eval44.1%
Applied egg-rr44.1%
Taylor expanded in d around inf 51.6%
unpow-151.6%
sqr-pow51.7%
rem-sqrt-square51.7%
metadata-eval51.7%
sqr-pow51.4%
fabs-sqr51.4%
sqr-pow51.7%
Simplified51.7%
unpow-prod-down64.6%
Applied egg-rr64.6%
Final simplification78.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h))))
(if (<= h -4.8e+153)
(*
(sqrt (/ d l))
(* t_0 (fma (pow (* 0.5 (/ M (/ d D))) 2.0) (* -0.5 (/ h l)) 1.0)))
(if (<= h -1e-310)
(*
(* d (pow (* l h) -0.5))
(- -1.0 (* -0.5 (* (pow (* 0.5 (* M (/ D d))) 2.0) (/ h l)))))
(if (<= h 3.85e+198)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* 0.5 M)) 2.0)) l)))
(* t_0 (/ (sqrt d) (sqrt l))))
(* (/ (sqrt h) (pow l 1.5)) (* -0.125 (* M (* M (* D (/ D d)))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double tmp;
if (h <= -4.8e+153) {
tmp = sqrt((d / l)) * (t_0 * fma(pow((0.5 * (M / (d / D))), 2.0), (-0.5 * (h / l)), 1.0));
} else if (h <= -1e-310) {
tmp = (d * pow((l * h), -0.5)) * (-1.0 - (-0.5 * (pow((0.5 * (M * (D / d))), 2.0) * (h / l))));
} else if (h <= 3.85e+198) {
tmp = (1.0 - (0.5 * ((h * pow(((D / d) * (0.5 * M)), 2.0)) / l))) * (t_0 * (sqrt(d) / sqrt(l)));
} else {
tmp = (sqrt(h) / pow(l, 1.5)) * (-0.125 * (M * (M * (D * (D / d)))));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) tmp = 0.0 if (h <= -4.8e+153) tmp = Float64(sqrt(Float64(d / l)) * Float64(t_0 * fma((Float64(0.5 * Float64(M / Float64(d / D))) ^ 2.0), Float64(-0.5 * Float64(h / l)), 1.0))); elseif (h <= -1e-310) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 - Float64(-0.5 * Float64((Float64(0.5 * Float64(M * Float64(D / d))) ^ 2.0) * Float64(h / l))))); elseif (h <= 3.85e+198) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(0.5 * M)) ^ 2.0)) / l))) * Float64(t_0 * Float64(sqrt(d) / sqrt(l)))); else tmp = Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(-0.125 * Float64(M * Float64(M * Float64(D * Float64(D / d)))))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -4.8e+153], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[(N[Power[N[(0.5 * N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-310], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[Power[N[(0.5 * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 3.85e+198], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(D / d), $MachinePrecision] * N[(0.5 * M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(-0.125 * N[(M * N[(M * N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;h \leq -4.8 \cdot 10^{+153}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(t_0 \cdot \mathsf{fma}\left({\left(0.5 \cdot \frac{M}{\frac{d}{D}}\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 - -0.5 \cdot \left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{elif}\;h \leq 3.85 \cdot 10^{+198}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(0.5 \cdot M\right)\right)}^{2}}{\ell}\right) \cdot \left(t_0 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(-0.125 \cdot \left(M \cdot \left(M \cdot \left(D \cdot \frac{D}{d}\right)\right)\right)\right)\\
\end{array}
\end{array}
if h < -4.79999999999999985e153Initial program 56.5%
Simplified53.2%
if -4.79999999999999985e153 < h < -9.999999999999969e-311Initial program 64.1%
Simplified64.1%
associate-*r/65.4%
div-inv65.4%
metadata-eval65.4%
Applied egg-rr65.4%
sqrt-div0.0%
metadata-eval0.0%
div-inv0.0%
associate-*r/0.0%
pow10.0%
Applied egg-rr57.9%
unpow157.9%
*-commutative57.9%
*-commutative57.9%
associate-*r*57.9%
Simplified57.9%
Taylor expanded in d around -inf 84.5%
mul-1-neg84.5%
distribute-rgt-neg-in84.5%
unpow-184.5%
metadata-eval84.5%
pow-sqr84.5%
rem-sqrt-square84.5%
rem-square-sqrt84.4%
fabs-sqr84.4%
rem-square-sqrt84.5%
Simplified84.5%
if -9.999999999999969e-311 < h < 3.85000000000000019e198Initial program 68.2%
Simplified68.1%
associate-*r/71.4%
div-inv71.4%
metadata-eval71.4%
Applied egg-rr71.4%
sqrt-div78.8%
Applied egg-rr78.8%
if 3.85000000000000019e198 < h Initial program 39.6%
Simplified39.6%
Taylor expanded in d around 0 48.6%
associate-*r*48.6%
*-commutative48.6%
associate-/l*48.6%
associate-/r/53.0%
unpow253.0%
unpow253.0%
Simplified53.0%
Taylor expanded in D around 0 48.6%
unpow248.6%
unpow248.6%
unpow248.6%
associate-*l/53.0%
*-commutative53.0%
unpow253.0%
associate-*l*57.3%
associate-/l*57.3%
associate-/r/57.3%
Simplified57.3%
sqrt-div61.4%
Applied egg-rr61.4%
sqr-pow61.4%
rem-sqrt-square65.7%
sqr-pow65.6%
fabs-sqr65.6%
sqr-pow65.7%
metadata-eval65.7%
Simplified65.7%
Final simplification76.1%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1e-311)
(*
(* d (pow (* l h) -0.5))
(- -1.0 (* -0.5 (* (pow (* 0.5 (* M (/ D d))) 2.0) (/ h l)))))
(if (<= l 1.3e+135)
(*
(* (/ (sqrt d) (sqrt h)) (sqrt (/ d l)))
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ D d) (/ M 2.0)) 2.0)))))
(* d (* (pow h -0.5) (pow l -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1e-311) {
tmp = (d * pow((l * h), -0.5)) * (-1.0 - (-0.5 * (pow((0.5 * (M * (D / d))), 2.0) * (h / l))));
} else if (l <= 1.3e+135) {
tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0 - (0.5 * ((h / l) * pow(((D / d) * (M / 2.0)), 2.0))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1d-311)) then
tmp = (d * ((l * h) ** (-0.5d0))) * ((-1.0d0) - ((-0.5d0) * (((0.5d0 * (m * (d_1 / d))) ** 2.0d0) * (h / l))))
else if (l <= 1.3d+135) then
tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0d0 - (0.5d0 * ((h / l) * (((d_1 / d) * (m / 2.0d0)) ** 2.0d0))))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1e-311) {
tmp = (d * Math.pow((l * h), -0.5)) * (-1.0 - (-0.5 * (Math.pow((0.5 * (M * (D / d))), 2.0) * (h / l))));
} else if (l <= 1.3e+135) {
tmp = ((Math.sqrt(d) / Math.sqrt(h)) * Math.sqrt((d / l))) * (1.0 - (0.5 * ((h / l) * Math.pow(((D / d) * (M / 2.0)), 2.0))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1e-311: tmp = (d * math.pow((l * h), -0.5)) * (-1.0 - (-0.5 * (math.pow((0.5 * (M * (D / d))), 2.0) * (h / l)))) elif l <= 1.3e+135: tmp = ((math.sqrt(d) / math.sqrt(h)) * math.sqrt((d / l))) * (1.0 - (0.5 * ((h / l) * math.pow(((D / d) * (M / 2.0)), 2.0)))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1e-311) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 - Float64(-0.5 * Float64((Float64(0.5 * Float64(M * Float64(D / d))) ^ 2.0) * Float64(h / l))))); elseif (l <= 1.3e+135) tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1e-311) tmp = (d * ((l * h) ^ -0.5)) * (-1.0 - (-0.5 * (((0.5 * (M * (D / d))) ^ 2.0) * (h / l)))); elseif (l <= 1.3e+135) tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0 - (0.5 * ((h / l) * (((D / d) * (M / 2.0)) ^ 2.0)))); else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1e-311], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[Power[N[(0.5 * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.3e+135], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1 \cdot 10^{-311}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 - -0.5 \cdot \left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{elif}\;\ell \leq 1.3 \cdot 10^{+135}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -9.99999999999948e-312Initial program 61.9%
Simplified62.3%
associate-*r/62.5%
div-inv62.5%
metadata-eval62.5%
Applied egg-rr62.5%
sqrt-div0.0%
metadata-eval0.0%
div-inv0.0%
associate-*r/0.0%
pow10.0%
Applied egg-rr54.4%
unpow154.4%
*-commutative54.4%
*-commutative54.4%
associate-*r*54.4%
Simplified54.4%
Taylor expanded in d around -inf 72.7%
mul-1-neg72.7%
distribute-rgt-neg-in72.7%
unpow-172.7%
metadata-eval72.7%
pow-sqr72.8%
rem-sqrt-square72.8%
rem-square-sqrt72.6%
fabs-sqr72.6%
rem-square-sqrt72.8%
Simplified72.8%
if -9.99999999999948e-312 < l < 1.3e135Initial program 70.2%
Simplified70.2%
sqrt-div89.5%
Applied egg-rr84.1%
if 1.3e135 < l Initial program 44.4%
Simplified44.3%
associate-*r/44.1%
div-inv44.1%
metadata-eval44.1%
Applied egg-rr44.1%
Taylor expanded in d around inf 51.6%
unpow-151.6%
sqr-pow51.7%
rem-sqrt-square51.7%
metadata-eval51.7%
sqr-pow51.4%
fabs-sqr51.4%
sqr-pow51.7%
Simplified51.7%
unpow-prod-down64.6%
Applied egg-rr64.6%
Final simplification76.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* M (/ D d))))
(if (<= l -6.2e-272)
(*
(* d (pow (* l h) -0.5))
(- -1.0 (* -0.5 (* (pow (* 0.5 t_0) 2.0) (/ h l)))))
(if (<= l 3.75e+133)
(*
(sqrt (/ d l))
(* (sqrt (/ d h)) (+ 1.0 (* (* -0.5 (/ h l)) (* 0.25 (pow t_0 2.0))))))
(* d (* (pow h -0.5) (pow l -0.5)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = M * (D / d);
double tmp;
if (l <= -6.2e-272) {
tmp = (d * pow((l * h), -0.5)) * (-1.0 - (-0.5 * (pow((0.5 * t_0), 2.0) * (h / l))));
} else if (l <= 3.75e+133) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((-0.5 * (h / l)) * (0.25 * pow(t_0, 2.0)))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = m * (d_1 / d)
if (l <= (-6.2d-272)) then
tmp = (d * ((l * h) ** (-0.5d0))) * ((-1.0d0) - ((-0.5d0) * (((0.5d0 * t_0) ** 2.0d0) * (h / l))))
else if (l <= 3.75d+133) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + (((-0.5d0) * (h / l)) * (0.25d0 * (t_0 ** 2.0d0)))))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = M * (D / d);
double tmp;
if (l <= -6.2e-272) {
tmp = (d * Math.pow((l * h), -0.5)) * (-1.0 - (-0.5 * (Math.pow((0.5 * t_0), 2.0) * (h / l))));
} else if (l <= 3.75e+133) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + ((-0.5 * (h / l)) * (0.25 * Math.pow(t_0, 2.0)))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = M * (D / d) tmp = 0 if l <= -6.2e-272: tmp = (d * math.pow((l * h), -0.5)) * (-1.0 - (-0.5 * (math.pow((0.5 * t_0), 2.0) * (h / l)))) elif l <= 3.75e+133: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + ((-0.5 * (h / l)) * (0.25 * math.pow(t_0, 2.0))))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = Float64(M * Float64(D / d)) tmp = 0.0 if (l <= -6.2e-272) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 - Float64(-0.5 * Float64((Float64(0.5 * t_0) ^ 2.0) * Float64(h / l))))); elseif (l <= 3.75e+133) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(-0.5 * Float64(h / l)) * Float64(0.25 * (t_0 ^ 2.0)))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = M * (D / d); tmp = 0.0; if (l <= -6.2e-272) tmp = (d * ((l * h) ^ -0.5)) * (-1.0 - (-0.5 * (((0.5 * t_0) ^ 2.0) * (h / l)))); elseif (l <= 3.75e+133) tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((-0.5 * (h / l)) * (0.25 * (t_0 ^ 2.0))))); else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); 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, -6.2e-272], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[Power[N[(0.5 * t$95$0), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.75e+133], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[(0.25 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M \cdot \frac{D}{d}\\
\mathbf{if}\;\ell \leq -6.2 \cdot 10^{-272}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 - -0.5 \cdot \left({\left(0.5 \cdot t_0\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{elif}\;\ell \leq 3.75 \cdot 10^{+133}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot \left(0.25 \cdot {t_0}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -6.20000000000000059e-272Initial program 60.0%
Simplified60.4%
associate-*r/60.7%
div-inv60.7%
metadata-eval60.7%
Applied egg-rr60.7%
sqrt-div0.0%
metadata-eval0.0%
div-inv0.0%
associate-*r/0.0%
pow10.0%
Applied egg-rr52.2%
unpow152.2%
*-commutative52.2%
*-commutative52.2%
associate-*r*52.2%
Simplified52.2%
Taylor expanded in d around -inf 71.4%
mul-1-neg71.4%
distribute-rgt-neg-in71.4%
unpow-171.4%
metadata-eval71.4%
pow-sqr71.4%
rem-sqrt-square71.4%
rem-square-sqrt71.3%
fabs-sqr71.3%
rem-square-sqrt71.4%
Simplified71.4%
if -6.20000000000000059e-272 < l < 3.74999999999999996e133Initial program 71.5%
Simplified71.5%
fma-udef71.5%
unpow-prod-down71.5%
metadata-eval71.5%
div-inv71.4%
clear-num71.4%
Applied egg-rr71.4%
if 3.74999999999999996e133 < l Initial program 44.4%
Simplified44.3%
associate-*r/44.1%
div-inv44.1%
metadata-eval44.1%
Applied egg-rr44.1%
Taylor expanded in d around inf 51.6%
unpow-151.6%
sqr-pow51.7%
rem-sqrt-square51.7%
metadata-eval51.7%
sqr-pow51.4%
fabs-sqr51.4%
sqr-pow51.7%
Simplified51.7%
unpow-prod-down64.6%
Applied egg-rr64.6%
Final simplification70.4%
(FPCore (d h l M D)
:precision binary64
(if (<= l -3.2e-244)
(*
(* d (pow (* l h) -0.5))
(- -1.0 (* -0.5 (* (pow (* 0.5 (* M (/ D d))) 2.0) (/ h l)))))
(if (<= l 2.05e+129)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(- 1.0 (* 0.5 (/ (* h (pow (/ 0.5 (/ d (* M D))) 2.0)) l))))
(* d (* (pow h -0.5) (pow l -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.2e-244) {
tmp = (d * pow((l * h), -0.5)) * (-1.0 - (-0.5 * (pow((0.5 * (M * (D / d))), 2.0) * (h / l))));
} else if (l <= 2.05e+129) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (0.5 * ((h * pow((0.5 / (d / (M * D))), 2.0)) / l)));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-3.2d-244)) then
tmp = (d * ((l * h) ** (-0.5d0))) * ((-1.0d0) - ((-0.5d0) * (((0.5d0 * (m * (d_1 / d))) ** 2.0d0) * (h / l))))
else if (l <= 2.05d+129) then
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (0.5d0 * ((h * ((0.5d0 / (d / (m * d_1))) ** 2.0d0)) / l)))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.2e-244) {
tmp = (d * Math.pow((l * h), -0.5)) * (-1.0 - (-0.5 * (Math.pow((0.5 * (M * (D / d))), 2.0) * (h / l))));
} else if (l <= 2.05e+129) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (0.5 * ((h * Math.pow((0.5 / (d / (M * D))), 2.0)) / l)));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -3.2e-244: tmp = (d * math.pow((l * h), -0.5)) * (-1.0 - (-0.5 * (math.pow((0.5 * (M * (D / d))), 2.0) * (h / l)))) elif l <= 2.05e+129: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (0.5 * ((h * math.pow((0.5 / (d / (M * D))), 2.0)) / l))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -3.2e-244) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 - Float64(-0.5 * Float64((Float64(0.5 * Float64(M * Float64(D / d))) ^ 2.0) * Float64(h / l))))); elseif (l <= 2.05e+129) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(0.5 / Float64(d / Float64(M * D))) ^ 2.0)) / l)))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -3.2e-244) tmp = (d * ((l * h) ^ -0.5)) * (-1.0 - (-0.5 * (((0.5 * (M * (D / d))) ^ 2.0) * (h / l)))); elseif (l <= 2.05e+129) tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (0.5 * ((h * ((0.5 / (d / (M * D))) ^ 2.0)) / l))); else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -3.2e-244], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[Power[N[(0.5 * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.05e+129], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(0.5 / N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.2 \cdot 10^{-244}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 - -0.5 \cdot \left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{elif}\;\ell \leq 2.05 \cdot 10^{+129}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{0.5}{\frac{d}{M \cdot D}}\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -3.1999999999999998e-244Initial program 60.2%
Simplified60.7%
associate-*r/59.9%
div-inv59.9%
metadata-eval59.9%
Applied egg-rr59.9%
sqrt-div0.0%
metadata-eval0.0%
div-inv0.0%
associate-*r/0.0%
pow10.0%
Applied egg-rr51.6%
unpow151.6%
*-commutative51.6%
*-commutative51.6%
associate-*r*51.6%
Simplified51.6%
Taylor expanded in d around -inf 71.7%
mul-1-neg71.7%
distribute-rgt-neg-in71.7%
unpow-171.7%
metadata-eval71.7%
pow-sqr71.7%
rem-sqrt-square71.7%
rem-square-sqrt71.6%
fabs-sqr71.6%
rem-square-sqrt71.7%
Simplified71.7%
if -3.1999999999999998e-244 < l < 2.0500000000000001e129Initial program 70.5%
Simplified70.5%
associate-*r/75.4%
div-inv75.4%
metadata-eval75.4%
Applied egg-rr75.4%
pow175.4%
*-commutative75.4%
metadata-eval75.4%
div-inv75.4%
*-commutative75.4%
div-inv75.4%
metadata-eval75.4%
Applied egg-rr75.4%
unpow175.4%
associate-*l/75.4%
associate-*r*75.4%
associate-*l/75.4%
*-commutative75.4%
associate-*r/75.4%
associate-/l*75.3%
Simplified75.3%
if 2.0500000000000001e129 < l Initial program 44.4%
Simplified44.3%
associate-*r/44.1%
div-inv44.1%
metadata-eval44.1%
Applied egg-rr44.1%
Taylor expanded in d around inf 51.6%
unpow-151.6%
sqr-pow51.7%
rem-sqrt-square51.7%
metadata-eval51.7%
sqr-pow51.4%
fabs-sqr51.4%
sqr-pow51.7%
Simplified51.7%
unpow-prod-down64.6%
Applied egg-rr64.6%
Final simplification72.5%
(FPCore (d h l M D)
:precision binary64
(if (<= l -3.2e-244)
(*
(* d (pow (* l h) -0.5))
(- -1.0 (* -0.5 (* (pow (* 0.5 (* M (/ D d))) 2.0) (/ h l)))))
(if (<= l 1.08e+126)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* 0.5 M)) 2.0)) l)))
(* (sqrt (/ d l)) (sqrt (/ d h))))
(* d (* (pow h -0.5) (pow l -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.2e-244) {
tmp = (d * pow((l * h), -0.5)) * (-1.0 - (-0.5 * (pow((0.5 * (M * (D / d))), 2.0) * (h / l))));
} else if (l <= 1.08e+126) {
tmp = (1.0 - (0.5 * ((h * pow(((D / d) * (0.5 * M)), 2.0)) / l))) * (sqrt((d / l)) * sqrt((d / h)));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-3.2d-244)) then
tmp = (d * ((l * h) ** (-0.5d0))) * ((-1.0d0) - ((-0.5d0) * (((0.5d0 * (m * (d_1 / d))) ** 2.0d0) * (h / l))))
else if (l <= 1.08d+126) then
tmp = (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (0.5d0 * m)) ** 2.0d0)) / l))) * (sqrt((d / l)) * sqrt((d / h)))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.2e-244) {
tmp = (d * Math.pow((l * h), -0.5)) * (-1.0 - (-0.5 * (Math.pow((0.5 * (M * (D / d))), 2.0) * (h / l))));
} else if (l <= 1.08e+126) {
tmp = (1.0 - (0.5 * ((h * Math.pow(((D / d) * (0.5 * M)), 2.0)) / l))) * (Math.sqrt((d / l)) * Math.sqrt((d / h)));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -3.2e-244: tmp = (d * math.pow((l * h), -0.5)) * (-1.0 - (-0.5 * (math.pow((0.5 * (M * (D / d))), 2.0) * (h / l)))) elif l <= 1.08e+126: tmp = (1.0 - (0.5 * ((h * math.pow(((D / d) * (0.5 * M)), 2.0)) / l))) * (math.sqrt((d / l)) * math.sqrt((d / h))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -3.2e-244) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 - Float64(-0.5 * Float64((Float64(0.5 * Float64(M * Float64(D / d))) ^ 2.0) * Float64(h / l))))); elseif (l <= 1.08e+126) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(0.5 * M)) ^ 2.0)) / l))) * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -3.2e-244) tmp = (d * ((l * h) ^ -0.5)) * (-1.0 - (-0.5 * (((0.5 * (M * (D / d))) ^ 2.0) * (h / l)))); elseif (l <= 1.08e+126) tmp = (1.0 - (0.5 * ((h * (((D / d) * (0.5 * M)) ^ 2.0)) / l))) * (sqrt((d / l)) * sqrt((d / h))); else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -3.2e-244], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[Power[N[(0.5 * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.08e+126], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(D / d), $MachinePrecision] * N[(0.5 * M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.2 \cdot 10^{-244}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 - -0.5 \cdot \left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{elif}\;\ell \leq 1.08 \cdot 10^{+126}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(0.5 \cdot M\right)\right)}^{2}}{\ell}\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -3.1999999999999998e-244Initial program 60.2%
Simplified60.7%
associate-*r/59.9%
div-inv59.9%
metadata-eval59.9%
Applied egg-rr59.9%
sqrt-div0.0%
metadata-eval0.0%
div-inv0.0%
associate-*r/0.0%
pow10.0%
Applied egg-rr51.6%
unpow151.6%
*-commutative51.6%
*-commutative51.6%
associate-*r*51.6%
Simplified51.6%
Taylor expanded in d around -inf 71.7%
mul-1-neg71.7%
distribute-rgt-neg-in71.7%
unpow-171.7%
metadata-eval71.7%
pow-sqr71.7%
rem-sqrt-square71.7%
rem-square-sqrt71.6%
fabs-sqr71.6%
rem-square-sqrt71.7%
Simplified71.7%
if -3.1999999999999998e-244 < l < 1.0799999999999999e126Initial program 70.5%
Simplified70.5%
associate-*r/75.4%
div-inv75.4%
metadata-eval75.4%
Applied egg-rr75.4%
if 1.0799999999999999e126 < l Initial program 44.4%
Simplified44.3%
associate-*r/44.1%
div-inv44.1%
metadata-eval44.1%
Applied egg-rr44.1%
Taylor expanded in d around inf 51.6%
unpow-151.6%
sqr-pow51.7%
rem-sqrt-square51.7%
metadata-eval51.7%
sqr-pow51.4%
fabs-sqr51.4%
sqr-pow51.7%
Simplified51.7%
unpow-prod-down64.6%
Applied egg-rr64.6%
Final simplification72.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (sqrt (/ d l)) (sqrt (/ d h))))
(t_1
(*
(* d (pow (* l h) -0.5))
(- -1.0 (* -0.5 (* (pow (* 0.5 (* M (/ D d))) 2.0) (/ h l)))))))
(if (<= d -1.3e+83)
t_1
(if (<= d -1.15e-41)
(*
t_0
(- 1.0 (* 0.5 (* (/ 0.25 l) (/ (* M (* D (* M D))) (* d (/ d h)))))))
(if (<= d -5e-310)
t_1
(if (<= d 1.45e-102)
(* (/ (sqrt h) (pow l 1.5)) (* -0.125 (* M (* M (* D (/ D d))))))
(if (<= d 8.5e+112)
(*
t_0
(-
1.0
(* 0.5 (/ (/ (* h (* D (* M (* M D)))) (/ (* d d) 0.25)) l))))
(* d (/ (sqrt (/ 1.0 h)) (sqrt l))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l)) * sqrt((d / h));
double t_1 = (d * pow((l * h), -0.5)) * (-1.0 - (-0.5 * (pow((0.5 * (M * (D / d))), 2.0) * (h / l))));
double tmp;
if (d <= -1.3e+83) {
tmp = t_1;
} else if (d <= -1.15e-41) {
tmp = t_0 * (1.0 - (0.5 * ((0.25 / l) * ((M * (D * (M * D))) / (d * (d / h))))));
} else if (d <= -5e-310) {
tmp = t_1;
} else if (d <= 1.45e-102) {
tmp = (sqrt(h) / pow(l, 1.5)) * (-0.125 * (M * (M * (D * (D / d)))));
} else if (d <= 8.5e+112) {
tmp = t_0 * (1.0 - (0.5 * (((h * (D * (M * (M * D)))) / ((d * d) / 0.25)) / l)));
} else {
tmp = d * (sqrt((1.0 / 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)) * sqrt((d / h))
t_1 = (d * ((l * h) ** (-0.5d0))) * ((-1.0d0) - ((-0.5d0) * (((0.5d0 * (m * (d_1 / d))) ** 2.0d0) * (h / l))))
if (d <= (-1.3d+83)) then
tmp = t_1
else if (d <= (-1.15d-41)) then
tmp = t_0 * (1.0d0 - (0.5d0 * ((0.25d0 / l) * ((m * (d_1 * (m * d_1))) / (d * (d / h))))))
else if (d <= (-5d-310)) then
tmp = t_1
else if (d <= 1.45d-102) then
tmp = (sqrt(h) / (l ** 1.5d0)) * ((-0.125d0) * (m * (m * (d_1 * (d_1 / d)))))
else if (d <= 8.5d+112) then
tmp = t_0 * (1.0d0 - (0.5d0 * (((h * (d_1 * (m * (m * d_1)))) / ((d * d) / 0.25d0)) / l)))
else
tmp = d * (sqrt((1.0d0 / 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)) * Math.sqrt((d / h));
double t_1 = (d * Math.pow((l * h), -0.5)) * (-1.0 - (-0.5 * (Math.pow((0.5 * (M * (D / d))), 2.0) * (h / l))));
double tmp;
if (d <= -1.3e+83) {
tmp = t_1;
} else if (d <= -1.15e-41) {
tmp = t_0 * (1.0 - (0.5 * ((0.25 / l) * ((M * (D * (M * D))) / (d * (d / h))))));
} else if (d <= -5e-310) {
tmp = t_1;
} else if (d <= 1.45e-102) {
tmp = (Math.sqrt(h) / Math.pow(l, 1.5)) * (-0.125 * (M * (M * (D * (D / d)))));
} else if (d <= 8.5e+112) {
tmp = t_0 * (1.0 - (0.5 * (((h * (D * (M * (M * D)))) / ((d * d) / 0.25)) / l)));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) * math.sqrt((d / h)) t_1 = (d * math.pow((l * h), -0.5)) * (-1.0 - (-0.5 * (math.pow((0.5 * (M * (D / d))), 2.0) * (h / l)))) tmp = 0 if d <= -1.3e+83: tmp = t_1 elif d <= -1.15e-41: tmp = t_0 * (1.0 - (0.5 * ((0.25 / l) * ((M * (D * (M * D))) / (d * (d / h)))))) elif d <= -5e-310: tmp = t_1 elif d <= 1.45e-102: tmp = (math.sqrt(h) / math.pow(l, 1.5)) * (-0.125 * (M * (M * (D * (D / d))))) elif d <= 8.5e+112: tmp = t_0 * (1.0 - (0.5 * (((h * (D * (M * (M * D)))) / ((d * d) / 0.25)) / l))) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) t_1 = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 - Float64(-0.5 * Float64((Float64(0.5 * Float64(M * Float64(D / d))) ^ 2.0) * Float64(h / l))))) tmp = 0.0 if (d <= -1.3e+83) tmp = t_1; elseif (d <= -1.15e-41) tmp = Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64(Float64(0.25 / l) * Float64(Float64(M * Float64(D * Float64(M * D))) / Float64(d * Float64(d / h))))))); elseif (d <= -5e-310) tmp = t_1; elseif (d <= 1.45e-102) tmp = Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(-0.125 * Float64(M * Float64(M * Float64(D * Float64(D / d)))))); elseif (d <= 8.5e+112) tmp = Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64(Float64(Float64(h * Float64(D * Float64(M * Float64(M * D)))) / Float64(Float64(d * d) / 0.25)) / l)))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)) * sqrt((d / h)); t_1 = (d * ((l * h) ^ -0.5)) * (-1.0 - (-0.5 * (((0.5 * (M * (D / d))) ^ 2.0) * (h / l)))); tmp = 0.0; if (d <= -1.3e+83) tmp = t_1; elseif (d <= -1.15e-41) tmp = t_0 * (1.0 - (0.5 * ((0.25 / l) * ((M * (D * (M * D))) / (d * (d / h)))))); elseif (d <= -5e-310) tmp = t_1; elseif (d <= 1.45e-102) tmp = (sqrt(h) / (l ^ 1.5)) * (-0.125 * (M * (M * (D * (D / d))))); elseif (d <= 8.5e+112) tmp = t_0 * (1.0 - (0.5 * (((h * (D * (M * (M * D)))) / ((d * d) / 0.25)) / l))); else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[Power[N[(0.5 * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.3e+83], t$95$1, If[LessEqual[d, -1.15e-41], N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[(0.25 / l), $MachinePrecision] * N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], t$95$1, If[LessEqual[d, 1.45e-102], N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(-0.125 * N[(M * N[(M * N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 8.5e+112], N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[(N[(h * N[(D * N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / 0.25), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
t_1 := \left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 - -0.5 \cdot \left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{if}\;d \leq -1.3 \cdot 10^{+83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d \leq -1.15 \cdot 10^{-41}:\\
\;\;\;\;t_0 \cdot \left(1 - 0.5 \cdot \left(\frac{0.25}{\ell} \cdot \frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{d \cdot \frac{d}{h}}\right)\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d \leq 1.45 \cdot 10^{-102}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(-0.125 \cdot \left(M \cdot \left(M \cdot \left(D \cdot \frac{D}{d}\right)\right)\right)\right)\\
\mathbf{elif}\;d \leq 8.5 \cdot 10^{+112}:\\
\;\;\;\;t_0 \cdot \left(1 - 0.5 \cdot \frac{\frac{h \cdot \left(D \cdot \left(M \cdot \left(M \cdot D\right)\right)\right)}{\frac{d \cdot d}{0.25}}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < -1.3000000000000001e83 or -1.15000000000000005e-41 < d < -4.999999999999985e-310Initial program 56.6%
Simplified57.2%
associate-*r/56.3%
div-inv56.3%
metadata-eval56.3%
Applied egg-rr56.3%
sqrt-div0.0%
metadata-eval0.0%
div-inv0.0%
associate-*r/0.0%
pow10.0%
Applied egg-rr51.7%
unpow151.7%
*-commutative51.7%
*-commutative51.7%
associate-*r*51.7%
Simplified51.7%
Taylor expanded in d around -inf 75.3%
mul-1-neg75.3%
distribute-rgt-neg-in75.3%
unpow-175.3%
metadata-eval75.3%
pow-sqr75.3%
rem-sqrt-square75.3%
rem-square-sqrt75.2%
fabs-sqr75.2%
rem-square-sqrt75.3%
Simplified75.3%
if -1.3000000000000001e83 < d < -1.15000000000000005e-41Initial program 84.8%
Simplified84.8%
associate-*r/89.8%
div-inv89.8%
metadata-eval89.8%
Applied egg-rr89.8%
pow189.8%
*-commutative89.8%
metadata-eval89.8%
div-inv89.8%
*-commutative89.8%
div-inv89.8%
metadata-eval89.8%
Applied egg-rr89.8%
unpow189.8%
associate-*l/89.8%
associate-*r*89.8%
associate-*l/89.8%
*-commutative89.8%
associate-*r/89.8%
associate-/l*89.8%
Simplified89.8%
div-inv89.8%
Applied egg-rr89.8%
Taylor expanded in h around 0 60.1%
associate-*r/60.1%
*-commutative60.1%
times-frac60.3%
associate-*r*65.2%
unpow265.2%
associate-*r*80.1%
unpow280.1%
associate-/l*84.9%
unpow284.9%
associate-*r*70.1%
unpow270.1%
*-commutative70.1%
unpow270.1%
associate-*l*75.1%
*-commutative75.1%
unpow275.1%
associate-*l*80.0%
unpow280.0%
associate-*l/80.0%
*-commutative80.0%
Simplified80.0%
if -4.999999999999985e-310 < d < 1.44999999999999993e-102Initial program 35.3%
Simplified35.2%
Taylor expanded in d around 0 41.2%
associate-*r*41.2%
*-commutative41.2%
associate-/l*41.1%
associate-/r/43.3%
unpow243.3%
unpow243.3%
Simplified43.3%
Taylor expanded in D around 0 41.2%
unpow241.2%
unpow241.2%
unpow241.2%
associate-*l/43.3%
*-commutative43.3%
unpow243.3%
associate-*l*45.4%
associate-/l*45.8%
associate-/r/45.7%
Simplified45.7%
sqrt-div47.8%
Applied egg-rr47.8%
sqr-pow47.8%
rem-sqrt-square57.7%
sqr-pow57.7%
fabs-sqr57.7%
sqr-pow57.7%
metadata-eval57.7%
Simplified57.7%
if 1.44999999999999993e-102 < d < 8.50000000000000047e112Initial program 84.7%
Simplified84.7%
associate-*r/92.2%
div-inv92.2%
metadata-eval92.2%
Applied egg-rr92.2%
Taylor expanded in M around 0 76.7%
associate-*r/76.7%
unpow276.7%
unpow276.7%
associate-*r*76.7%
*-commutative76.7%
associate-/l*76.7%
associate-*r*84.5%
associate-*r*86.4%
associate-*r*80.5%
*-commutative80.5%
unswap-sqr92.2%
associate-*l*90.4%
unpow290.4%
Simplified90.4%
if 8.50000000000000047e112 < d Initial program 70.5%
Simplified70.5%
Taylor expanded in d around inf 68.3%
associate-/r*69.0%
Simplified69.0%
sqrt-div79.5%
Applied egg-rr79.5%
Final simplification76.1%
(FPCore (d h l M D)
:precision binary64
(if (<= l -6.2e-272)
(*
(* d (pow (* l h) -0.5))
(- -1.0 (* -0.5 (* (pow (* 0.5 (* M (/ D d))) 2.0) (/ h l)))))
(if (<= l 6e+126)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(- 1.0 (* 0.5 (* 0.25 (* (* D (/ D d)) (/ (* M (* h M)) (* l d)))))))
(* d (* (pow h -0.5) (pow l -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6.2e-272) {
tmp = (d * pow((l * h), -0.5)) * (-1.0 - (-0.5 * (pow((0.5 * (M * (D / d))), 2.0) * (h / l))));
} else if (l <= 6e+126) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (0.5 * (0.25 * ((D * (D / d)) * ((M * (h * M)) / (l * d))))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -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 <= (-6.2d-272)) then
tmp = (d * ((l * h) ** (-0.5d0))) * ((-1.0d0) - ((-0.5d0) * (((0.5d0 * (m * (d_1 / d))) ** 2.0d0) * (h / l))))
else if (l <= 6d+126) then
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (0.5d0 * (0.25d0 * ((d_1 * (d_1 / d)) * ((m * (h * m)) / (l * d))))))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-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 <= -6.2e-272) {
tmp = (d * Math.pow((l * h), -0.5)) * (-1.0 - (-0.5 * (Math.pow((0.5 * (M * (D / d))), 2.0) * (h / l))));
} else if (l <= 6e+126) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (0.5 * (0.25 * ((D * (D / d)) * ((M * (h * M)) / (l * d))))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -6.2e-272: tmp = (d * math.pow((l * h), -0.5)) * (-1.0 - (-0.5 * (math.pow((0.5 * (M * (D / d))), 2.0) * (h / l)))) elif l <= 6e+126: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (0.5 * (0.25 * ((D * (D / d)) * ((M * (h * M)) / (l * d)))))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -6.2e-272) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 - Float64(-0.5 * Float64((Float64(0.5 * Float64(M * Float64(D / d))) ^ 2.0) * Float64(h / l))))); elseif (l <= 6e+126) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(0.25 * Float64(Float64(D * Float64(D / d)) * Float64(Float64(M * Float64(h * M)) / Float64(l * d))))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -6.2e-272) tmp = (d * ((l * h) ^ -0.5)) * (-1.0 - (-0.5 * (((0.5 * (M * (D / d))) ^ 2.0) * (h / l)))); elseif (l <= 6e+126) tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (0.5 * (0.25 * ((D * (D / d)) * ((M * (h * M)) / (l * d)))))); else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -6.2e-272], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[Power[N[(0.5 * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6e+126], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(0.25 * N[(N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.2 \cdot 10^{-272}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 - -0.5 \cdot \left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{elif}\;\ell \leq 6 \cdot 10^{+126}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \left(\left(D \cdot \frac{D}{d}\right) \cdot \frac{M \cdot \left(h \cdot M\right)}{\ell \cdot d}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -6.20000000000000059e-272Initial program 60.0%
Simplified60.4%
associate-*r/60.7%
div-inv60.7%
metadata-eval60.7%
Applied egg-rr60.7%
sqrt-div0.0%
metadata-eval0.0%
div-inv0.0%
associate-*r/0.0%
pow10.0%
Applied egg-rr52.2%
unpow152.2%
*-commutative52.2%
*-commutative52.2%
associate-*r*52.2%
Simplified52.2%
Taylor expanded in d around -inf 71.4%
mul-1-neg71.4%
distribute-rgt-neg-in71.4%
unpow-171.4%
metadata-eval71.4%
pow-sqr71.4%
rem-sqrt-square71.4%
rem-square-sqrt71.3%
fabs-sqr71.3%
rem-square-sqrt71.4%
Simplified71.4%
if -6.20000000000000059e-272 < l < 6.0000000000000005e126Initial program 71.5%
Simplified71.5%
Taylor expanded in M around 0 53.9%
associate-*r/53.9%
unpow253.9%
unpow253.9%
unpow253.9%
Simplified53.9%
Taylor expanded in D around 0 53.9%
unpow253.9%
unpow253.9%
associate-*r*55.7%
unpow255.7%
associate-*r*60.9%
times-frac64.4%
associate-/l*65.4%
associate-/r/65.4%
Simplified65.4%
if 6.0000000000000005e126 < l Initial program 44.4%
Simplified44.3%
associate-*r/44.1%
div-inv44.1%
metadata-eval44.1%
Applied egg-rr44.1%
Taylor expanded in d around inf 51.6%
unpow-151.6%
sqr-pow51.7%
rem-sqrt-square51.7%
metadata-eval51.7%
sqr-pow51.4%
fabs-sqr51.4%
sqr-pow51.7%
Simplified51.7%
unpow-prod-down64.6%
Applied egg-rr64.6%
Final simplification67.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(+ 1.0 (* -0.5 (* (pow (* 0.5 (* M (/ D d))) 2.0) (/ h l))))
(sqrt (* (/ d l) (/ d h))))))
(if (<= d -2.6e-270)
t_0
(if (<= d 2.05e-54)
(* (/ (sqrt h) (pow l 1.5)) (* -0.125 (* M (* M (* D (/ D d))))))
(if (<= d 3.1e+125) t_0 (* d (* (pow h -0.5) (pow l -0.5))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (1.0 + (-0.5 * (pow((0.5 * (M * (D / d))), 2.0) * (h / l)))) * sqrt(((d / l) * (d / h)));
double tmp;
if (d <= -2.6e-270) {
tmp = t_0;
} else if (d <= 2.05e-54) {
tmp = (sqrt(h) / pow(l, 1.5)) * (-0.125 * (M * (M * (D * (D / d)))));
} else if (d <= 3.1e+125) {
tmp = t_0;
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (1.0d0 + ((-0.5d0) * (((0.5d0 * (m * (d_1 / d))) ** 2.0d0) * (h / l)))) * sqrt(((d / l) * (d / h)))
if (d <= (-2.6d-270)) then
tmp = t_0
else if (d <= 2.05d-54) then
tmp = (sqrt(h) / (l ** 1.5d0)) * ((-0.125d0) * (m * (m * (d_1 * (d_1 / d)))))
else if (d <= 3.1d+125) then
tmp = t_0
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (1.0 + (-0.5 * (Math.pow((0.5 * (M * (D / d))), 2.0) * (h / l)))) * Math.sqrt(((d / l) * (d / h)));
double tmp;
if (d <= -2.6e-270) {
tmp = t_0;
} else if (d <= 2.05e-54) {
tmp = (Math.sqrt(h) / Math.pow(l, 1.5)) * (-0.125 * (M * (M * (D * (D / d)))));
} else if (d <= 3.1e+125) {
tmp = t_0;
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (1.0 + (-0.5 * (math.pow((0.5 * (M * (D / d))), 2.0) * (h / l)))) * math.sqrt(((d / l) * (d / h))) tmp = 0 if d <= -2.6e-270: tmp = t_0 elif d <= 2.05e-54: tmp = (math.sqrt(h) / math.pow(l, 1.5)) * (-0.125 * (M * (M * (D * (D / d))))) elif d <= 3.1e+125: tmp = t_0 else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(1.0 + Float64(-0.5 * Float64((Float64(0.5 * Float64(M * Float64(D / d))) ^ 2.0) * Float64(h / l)))) * sqrt(Float64(Float64(d / l) * Float64(d / h)))) tmp = 0.0 if (d <= -2.6e-270) tmp = t_0; elseif (d <= 2.05e-54) tmp = Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(-0.125 * Float64(M * Float64(M * Float64(D * Float64(D / d)))))); elseif (d <= 3.1e+125) tmp = t_0; else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (1.0 + (-0.5 * (((0.5 * (M * (D / d))) ^ 2.0) * (h / l)))) * sqrt(((d / l) * (d / h))); tmp = 0.0; if (d <= -2.6e-270) tmp = t_0; elseif (d <= 2.05e-54) tmp = (sqrt(h) / (l ^ 1.5)) * (-0.125 * (M * (M * (D * (D / d))))); elseif (d <= 3.1e+125) tmp = t_0; else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(1.0 + N[(-0.5 * N[(N[Power[N[(0.5 * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.6e-270], t$95$0, If[LessEqual[d, 2.05e-54], N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(-0.125 * N[(M * N[(M * N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.1e+125], t$95$0, N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 + -0.5 \cdot \left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{if}\;d \leq -2.6 \cdot 10^{-270}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \leq 2.05 \cdot 10^{-54}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(-0.125 \cdot \left(M \cdot \left(M \cdot \left(D \cdot \frac{D}{d}\right)\right)\right)\right)\\
\mathbf{elif}\;d \leq 3.1 \cdot 10^{+125}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -2.6000000000000002e-270 or 2.05e-54 < d < 3.1e125Initial program 71.9%
Simplified72.2%
associate-*r/75.1%
div-inv75.1%
metadata-eval75.1%
Applied egg-rr75.1%
sqrt-div29.4%
metadata-eval29.4%
div-inv29.4%
associate-*r/26.8%
pow126.8%
Applied egg-rr63.0%
unpow163.0%
*-commutative63.0%
*-commutative63.0%
associate-*r*63.0%
Simplified63.0%
if -2.6000000000000002e-270 < d < 2.05e-54Initial program 38.5%
Simplified38.3%
Taylor expanded in d around 0 38.3%
associate-*r*38.3%
*-commutative38.3%
associate-/l*38.1%
associate-/r/39.8%
unpow239.8%
unpow239.8%
Simplified39.8%
Taylor expanded in D around 0 38.3%
unpow238.3%
unpow238.3%
unpow238.3%
associate-*l/39.8%
*-commutative39.8%
unpow239.8%
associate-*l*41.4%
associate-/l*41.7%
associate-/r/41.7%
Simplified41.7%
sqrt-div43.1%
Applied egg-rr43.1%
sqr-pow43.1%
rem-sqrt-square51.9%
sqr-pow51.9%
fabs-sqr51.9%
sqr-pow51.9%
metadata-eval51.9%
Simplified51.9%
if 3.1e125 < d Initial program 69.9%
Simplified69.9%
associate-*r/72.6%
div-inv72.6%
metadata-eval72.6%
Applied egg-rr72.6%
Taylor expanded in d around inf 69.8%
unpow-169.8%
sqr-pow70.0%
rem-sqrt-square70.0%
metadata-eval70.0%
sqr-pow69.6%
fabs-sqr69.6%
sqr-pow70.0%
Simplified70.0%
unpow-prod-down80.0%
Applied egg-rr80.0%
Final simplification63.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* -0.5 (/ (* h (* 0.25 (pow (* M (/ D d)) 2.0))) l))))))
(if (<= d -2.6e-270)
t_0
(if (<= d 2.05e-54)
(* (/ (sqrt h) (pow l 1.5)) (* -0.125 (* M (* M (* D (/ D d))))))
(if (<= d 5e+127) t_0 (* d (* (pow h -0.5) (pow l -0.5))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * ((h * (0.25 * pow((M * (D / d)), 2.0))) / l)));
double tmp;
if (d <= -2.6e-270) {
tmp = t_0;
} else if (d <= 2.05e-54) {
tmp = (sqrt(h) / pow(l, 1.5)) * (-0.125 * (M * (M * (D * (D / d)))));
} else if (d <= 5e+127) {
tmp = t_0;
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt(((d / l) * (d / h))) * (1.0d0 + ((-0.5d0) * ((h * (0.25d0 * ((m * (d_1 / d)) ** 2.0d0))) / l)))
if (d <= (-2.6d-270)) then
tmp = t_0
else if (d <= 2.05d-54) then
tmp = (sqrt(h) / (l ** 1.5d0)) * ((-0.125d0) * (m * (m * (d_1 * (d_1 / d)))))
else if (d <= 5d+127) then
tmp = t_0
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * ((h * (0.25 * Math.pow((M * (D / d)), 2.0))) / l)));
double tmp;
if (d <= -2.6e-270) {
tmp = t_0;
} else if (d <= 2.05e-54) {
tmp = (Math.sqrt(h) / Math.pow(l, 1.5)) * (-0.125 * (M * (M * (D * (D / d)))));
} else if (d <= 5e+127) {
tmp = t_0;
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * ((h * (0.25 * math.pow((M * (D / d)), 2.0))) / l))) tmp = 0 if d <= -2.6e-270: tmp = t_0 elif d <= 2.05e-54: tmp = (math.sqrt(h) / math.pow(l, 1.5)) * (-0.125 * (M * (M * (D * (D / d))))) elif d <= 5e+127: tmp = t_0 else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h * Float64(0.25 * (Float64(M * Float64(D / d)) ^ 2.0))) / l)))) tmp = 0.0 if (d <= -2.6e-270) tmp = t_0; elseif (d <= 2.05e-54) tmp = Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(-0.125 * Float64(M * Float64(M * Float64(D * Float64(D / d)))))); elseif (d <= 5e+127) tmp = t_0; else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * ((h * (0.25 * ((M * (D / d)) ^ 2.0))) / l))); tmp = 0.0; if (d <= -2.6e-270) tmp = t_0; elseif (d <= 2.05e-54) tmp = (sqrt(h) / (l ^ 1.5)) * (-0.125 * (M * (M * (D * (D / d))))); elseif (d <= 5e+127) tmp = t_0; else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[(h * N[(0.25 * N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.6e-270], t$95$0, If[LessEqual[d, 2.05e-54], N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(-0.125 * N[(M * N[(M * N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5e+127], t$95$0, N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \frac{h \cdot \left(0.25 \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\right)}{\ell}\right)\\
\mathbf{if}\;d \leq -2.6 \cdot 10^{-270}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \leq 2.05 \cdot 10^{-54}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(-0.125 \cdot \left(M \cdot \left(M \cdot \left(D \cdot \frac{D}{d}\right)\right)\right)\right)\\
\mathbf{elif}\;d \leq 5 \cdot 10^{+127}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -2.6000000000000002e-270 or 2.05e-54 < d < 5.0000000000000004e127Initial program 71.9%
Simplified72.2%
associate-*r/75.1%
div-inv75.1%
metadata-eval75.1%
Applied egg-rr75.1%
sqrt-div29.4%
metadata-eval29.4%
div-inv29.4%
associate-*r/26.8%
pow126.8%
Applied egg-rr63.0%
unpow163.0%
*-commutative63.0%
*-commutative63.0%
associate-*r*63.0%
Simplified63.0%
associate-*r/65.9%
unpow-prod-down65.9%
metadata-eval65.9%
Applied egg-rr65.9%
if -2.6000000000000002e-270 < d < 2.05e-54Initial program 38.5%
Simplified38.3%
Taylor expanded in d around 0 38.3%
associate-*r*38.3%
*-commutative38.3%
associate-/l*38.1%
associate-/r/39.8%
unpow239.8%
unpow239.8%
Simplified39.8%
Taylor expanded in D around 0 38.3%
unpow238.3%
unpow238.3%
unpow238.3%
associate-*l/39.8%
*-commutative39.8%
unpow239.8%
associate-*l*41.4%
associate-/l*41.7%
associate-/r/41.7%
Simplified41.7%
sqrt-div43.1%
Applied egg-rr43.1%
sqr-pow43.1%
rem-sqrt-square51.9%
sqr-pow51.9%
fabs-sqr51.9%
sqr-pow51.9%
metadata-eval51.9%
Simplified51.9%
if 5.0000000000000004e127 < d Initial program 69.9%
Simplified69.9%
associate-*r/72.6%
div-inv72.6%
metadata-eval72.6%
Applied egg-rr72.6%
Taylor expanded in d around inf 69.8%
unpow-169.8%
sqr-pow70.0%
rem-sqrt-square70.0%
metadata-eval70.0%
sqr-pow69.6%
fabs-sqr69.6%
sqr-pow70.0%
Simplified70.0%
unpow-prod-down80.0%
Applied egg-rr80.0%
Final simplification64.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* M (/ D d))))
(if (<= d -5e-310)
(*
(* d (pow (* l h) -0.5))
(- -1.0 (* -0.5 (* (pow (* 0.5 t_0) 2.0) (/ h l)))))
(if (<= d 2.05e-54)
(* (/ (sqrt h) (pow l 1.5)) (* -0.125 (* M (* M (* D (/ D d))))))
(if (<= d 8.6e+128)
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* -0.5 (/ (* h (* 0.25 (pow t_0 2.0))) l))))
(* d (* (pow h -0.5) (pow l -0.5))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = M * (D / d);
double tmp;
if (d <= -5e-310) {
tmp = (d * pow((l * h), -0.5)) * (-1.0 - (-0.5 * (pow((0.5 * t_0), 2.0) * (h / l))));
} else if (d <= 2.05e-54) {
tmp = (sqrt(h) / pow(l, 1.5)) * (-0.125 * (M * (M * (D * (D / d)))));
} else if (d <= 8.6e+128) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * ((h * (0.25 * pow(t_0, 2.0))) / l)));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = m * (d_1 / d)
if (d <= (-5d-310)) then
tmp = (d * ((l * h) ** (-0.5d0))) * ((-1.0d0) - ((-0.5d0) * (((0.5d0 * t_0) ** 2.0d0) * (h / l))))
else if (d <= 2.05d-54) then
tmp = (sqrt(h) / (l ** 1.5d0)) * ((-0.125d0) * (m * (m * (d_1 * (d_1 / d)))))
else if (d <= 8.6d+128) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + ((-0.5d0) * ((h * (0.25d0 * (t_0 ** 2.0d0))) / l)))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = M * (D / d);
double tmp;
if (d <= -5e-310) {
tmp = (d * Math.pow((l * h), -0.5)) * (-1.0 - (-0.5 * (Math.pow((0.5 * t_0), 2.0) * (h / l))));
} else if (d <= 2.05e-54) {
tmp = (Math.sqrt(h) / Math.pow(l, 1.5)) * (-0.125 * (M * (M * (D * (D / d)))));
} else if (d <= 8.6e+128) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * ((h * (0.25 * Math.pow(t_0, 2.0))) / l)));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = M * (D / d) tmp = 0 if d <= -5e-310: tmp = (d * math.pow((l * h), -0.5)) * (-1.0 - (-0.5 * (math.pow((0.5 * t_0), 2.0) * (h / l)))) elif d <= 2.05e-54: tmp = (math.sqrt(h) / math.pow(l, 1.5)) * (-0.125 * (M * (M * (D * (D / d))))) elif d <= 8.6e+128: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * ((h * (0.25 * math.pow(t_0, 2.0))) / l))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = Float64(M * Float64(D / d)) tmp = 0.0 if (d <= -5e-310) tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 - Float64(-0.5 * Float64((Float64(0.5 * t_0) ^ 2.0) * Float64(h / l))))); elseif (d <= 2.05e-54) tmp = Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(-0.125 * Float64(M * Float64(M * Float64(D * Float64(D / d)))))); elseif (d <= 8.6e+128) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h * Float64(0.25 * (t_0 ^ 2.0))) / l)))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = M * (D / d); tmp = 0.0; if (d <= -5e-310) tmp = (d * ((l * h) ^ -0.5)) * (-1.0 - (-0.5 * (((0.5 * t_0) ^ 2.0) * (h / l)))); elseif (d <= 2.05e-54) tmp = (sqrt(h) / (l ^ 1.5)) * (-0.125 * (M * (M * (D * (D / d))))); elseif (d <= 8.6e+128) tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * ((h * (0.25 * (t_0 ^ 2.0))) / l))); else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -5e-310], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[Power[N[(0.5 * t$95$0), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.05e-54], N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(-0.125 * N[(M * N[(M * N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 8.6e+128], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[(h * N[(0.25 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M \cdot \frac{D}{d}\\
\mathbf{if}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 - -0.5 \cdot \left({\left(0.5 \cdot t_0\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{elif}\;d \leq 2.05 \cdot 10^{-54}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(-0.125 \cdot \left(M \cdot \left(M \cdot \left(D \cdot \frac{D}{d}\right)\right)\right)\right)\\
\mathbf{elif}\;d \leq 8.6 \cdot 10^{+128}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \frac{h \cdot \left(0.25 \cdot {t_0}^{2}\right)}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -4.999999999999985e-310Initial program 61.9%
Simplified62.3%
associate-*r/62.5%
div-inv62.5%
metadata-eval62.5%
Applied egg-rr62.5%
sqrt-div0.0%
metadata-eval0.0%
div-inv0.0%
associate-*r/0.0%
pow10.0%
Applied egg-rr54.4%
unpow154.4%
*-commutative54.4%
*-commutative54.4%
associate-*r*54.4%
Simplified54.4%
Taylor expanded in d around -inf 72.7%
mul-1-neg72.7%
distribute-rgt-neg-in72.7%
unpow-172.7%
metadata-eval72.7%
pow-sqr72.8%
rem-sqrt-square72.8%
rem-square-sqrt72.6%
fabs-sqr72.6%
rem-square-sqrt72.8%
Simplified72.8%
if -4.999999999999985e-310 < d < 2.05e-54Initial program 42.7%
Simplified42.5%
Taylor expanded in d around 0 44.2%
associate-*r*44.2%
*-commutative44.2%
associate-/l*44.1%
associate-/r/46.0%
unpow246.0%
unpow246.0%
Simplified46.0%
Taylor expanded in D around 0 44.2%
unpow244.2%
unpow244.2%
unpow244.2%
associate-*l/46.0%
*-commutative46.0%
unpow246.0%
associate-*l*47.9%
associate-/l*48.2%
associate-/r/48.2%
Simplified48.2%
sqrt-div49.9%
Applied egg-rr49.9%
sqr-pow49.9%
rem-sqrt-square60.1%
sqr-pow60.1%
fabs-sqr60.1%
sqr-pow60.1%
metadata-eval60.1%
Simplified60.1%
if 2.05e-54 < d < 8.59999999999999949e128Initial program 83.5%
Simplified83.5%
associate-*r/91.7%
div-inv91.7%
metadata-eval91.7%
Applied egg-rr91.7%
sqrt-div91.5%
metadata-eval91.5%
div-inv91.5%
associate-*r/83.3%
pow183.3%
Applied egg-rr71.0%
unpow171.0%
*-commutative71.0%
*-commutative71.0%
associate-*r*71.0%
Simplified71.0%
associate-*r/79.2%
unpow-prod-down79.2%
metadata-eval79.2%
Applied egg-rr79.2%
if 8.59999999999999949e128 < d Initial program 69.9%
Simplified69.9%
associate-*r/72.6%
div-inv72.6%
metadata-eval72.6%
Applied egg-rr72.6%
Taylor expanded in d around inf 69.8%
unpow-169.8%
sqr-pow70.0%
rem-sqrt-square70.0%
metadata-eval70.0%
sqr-pow69.6%
fabs-sqr69.6%
sqr-pow70.0%
Simplified70.0%
unpow-prod-down80.0%
Applied egg-rr80.0%
Final simplification72.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ 1.0 (* l h))))
(if (<= d -6.2e-127)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (<= d 1.65e-284)
(* d (sqrt (cbrt (* t_0 (* t_0 t_0)))))
(if (<= d 4.6e+70)
(* (/ (sqrt h) (pow l 1.5)) (* -0.125 (* M (* M (* D (/ D d))))))
(* d (* (pow h -0.5) (pow l -0.5))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (l * h);
double tmp;
if (d <= -6.2e-127) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if (d <= 1.65e-284) {
tmp = d * sqrt(cbrt((t_0 * (t_0 * t_0))));
} else if (d <= 4.6e+70) {
tmp = (sqrt(h) / pow(l, 1.5)) * (-0.125 * (M * (M * (D * (D / d)))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (l * h);
double tmp;
if (d <= -6.2e-127) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else if (d <= 1.65e-284) {
tmp = d * Math.sqrt(Math.cbrt((t_0 * (t_0 * t_0))));
} else if (d <= 4.6e+70) {
tmp = (Math.sqrt(h) / Math.pow(l, 1.5)) * (-0.125 * (M * (M * (D * (D / d)))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(1.0 / Float64(l * h)) tmp = 0.0 if (d <= -6.2e-127) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif (d <= 1.65e-284) tmp = Float64(d * sqrt(cbrt(Float64(t_0 * Float64(t_0 * t_0))))); elseif (d <= 4.6e+70) tmp = Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(-0.125 * Float64(M * Float64(M * Float64(D * Float64(D / d)))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -6.2e-127], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.65e-284], N[(d * N[Sqrt[N[Power[N[(t$95$0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.6e+70], N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(-0.125 * N[(M * N[(M * N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\ell \cdot h}\\
\mathbf{if}\;d \leq -6.2 \cdot 10^{-127}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;d \leq 1.65 \cdot 10^{-284}:\\
\;\;\;\;d \cdot \sqrt{\sqrt[3]{t_0 \cdot \left(t_0 \cdot t_0\right)}}\\
\mathbf{elif}\;d \leq 4.6 \cdot 10^{+70}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(-0.125 \cdot \left(M \cdot \left(M \cdot \left(D \cdot \frac{D}{d}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -6.2e-127Initial program 70.2%
Simplified68.9%
Taylor expanded in M around 0 46.4%
if -6.2e-127 < d < 1.65000000000000004e-284Initial program 36.4%
Simplified36.4%
Taylor expanded in d around inf 19.9%
add-cbrt-cube25.7%
Applied egg-rr25.7%
if 1.65000000000000004e-284 < d < 4.59999999999999987e70Initial program 59.7%
Simplified59.6%
Taylor expanded in d around 0 45.9%
associate-*r*45.9%
*-commutative45.9%
associate-/l*44.7%
associate-/r/45.9%
unpow245.9%
unpow245.9%
Simplified45.9%
Taylor expanded in D around 0 45.9%
unpow245.9%
unpow245.9%
unpow245.9%
associate-*l/45.9%
*-commutative45.9%
unpow245.9%
associate-*l*47.2%
associate-/l*47.4%
associate-/r/47.4%
Simplified47.4%
sqrt-div50.8%
Applied egg-rr50.8%
sqr-pow50.8%
rem-sqrt-square58.6%
sqr-pow58.6%
fabs-sqr58.6%
sqr-pow58.6%
metadata-eval58.6%
Simplified58.6%
if 4.59999999999999987e70 < d Initial program 74.2%
Simplified74.3%
associate-*r/76.4%
div-inv76.4%
metadata-eval76.4%
Applied egg-rr76.4%
Taylor expanded in d around inf 67.0%
unpow-167.0%
sqr-pow67.0%
rem-sqrt-square67.0%
metadata-eval67.0%
sqr-pow66.8%
fabs-sqr66.8%
sqr-pow67.0%
Simplified67.0%
unpow-prod-down78.4%
Applied egg-rr78.4%
Final simplification54.8%
(FPCore (d h l M D)
:precision binary64
(if (<= d 1.65e-284)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (<= d 4.6e+70)
(* (/ (sqrt h) (pow l 1.5)) (* -0.125 (* M (* M (* D (/ D d))))))
(* d (* (pow h -0.5) (pow l -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 1.65e-284) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if (d <= 4.6e+70) {
tmp = (sqrt(h) / pow(l, 1.5)) * (-0.125 * (M * (M * (D * (D / d)))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= 1.65d-284) then
tmp = sqrt((d / l)) * sqrt((d / h))
else if (d <= 4.6d+70) then
tmp = (sqrt(h) / (l ** 1.5d0)) * ((-0.125d0) * (m * (m * (d_1 * (d_1 / d)))))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-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 (d <= 1.65e-284) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else if (d <= 4.6e+70) {
tmp = (Math.sqrt(h) / Math.pow(l, 1.5)) * (-0.125 * (M * (M * (D * (D / d)))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 1.65e-284: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) elif d <= 4.6e+70: tmp = (math.sqrt(h) / math.pow(l, 1.5)) * (-0.125 * (M * (M * (D * (D / d))))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 1.65e-284) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif (d <= 4.6e+70) tmp = Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(-0.125 * Float64(M * Float64(M * Float64(D * Float64(D / d)))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= 1.65e-284) tmp = sqrt((d / l)) * sqrt((d / h)); elseif (d <= 4.6e+70) tmp = (sqrt(h) / (l ^ 1.5)) * (-0.125 * (M * (M * (D * (D / d))))); else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 1.65e-284], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.6e+70], N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(-0.125 * N[(M * N[(M * N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.65 \cdot 10^{-284}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;d \leq 4.6 \cdot 10^{+70}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(-0.125 \cdot \left(M \cdot \left(M \cdot \left(D \cdot \frac{D}{d}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < 1.65000000000000004e-284Initial program 60.0%
Simplified59.1%
Taylor expanded in M around 0 36.7%
if 1.65000000000000004e-284 < d < 4.59999999999999987e70Initial program 59.7%
Simplified59.6%
Taylor expanded in d around 0 45.9%
associate-*r*45.9%
*-commutative45.9%
associate-/l*44.7%
associate-/r/45.9%
unpow245.9%
unpow245.9%
Simplified45.9%
Taylor expanded in D around 0 45.9%
unpow245.9%
unpow245.9%
unpow245.9%
associate-*l/45.9%
*-commutative45.9%
unpow245.9%
associate-*l*47.2%
associate-/l*47.4%
associate-/r/47.4%
Simplified47.4%
sqrt-div50.8%
Applied egg-rr50.8%
sqr-pow50.8%
rem-sqrt-square58.6%
sqr-pow58.6%
fabs-sqr58.6%
sqr-pow58.6%
metadata-eval58.6%
Simplified58.6%
if 4.59999999999999987e70 < d Initial program 74.2%
Simplified74.3%
associate-*r/76.4%
div-inv76.4%
metadata-eval76.4%
Applied egg-rr76.4%
Taylor expanded in d around inf 67.0%
unpow-167.0%
sqr-pow67.0%
rem-sqrt-square67.0%
metadata-eval67.0%
sqr-pow66.8%
fabs-sqr66.8%
sqr-pow67.0%
Simplified67.0%
unpow-prod-down78.4%
Applied egg-rr78.4%
Final simplification53.2%
(FPCore (d h l M D) :precision binary64 (if (<= M 4.2e-68) (* (sqrt (/ d l)) (sqrt (/ d h))) (* -0.125 (/ (* (* M (* M (* D D))) (sqrt (/ h (pow l 3.0)))) d))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 4.2e-68) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = -0.125 * (((M * (M * (D * D))) * sqrt((h / pow(l, 3.0)))) / d);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 4.2d-68) then
tmp = sqrt((d / l)) * sqrt((d / h))
else
tmp = (-0.125d0) * (((m * (m * (d_1 * d_1))) * sqrt((h / (l ** 3.0d0)))) / d)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 4.2e-68) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = -0.125 * (((M * (M * (D * D))) * Math.sqrt((h / Math.pow(l, 3.0)))) / d);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if M <= 4.2e-68: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) else: tmp = -0.125 * (((M * (M * (D * D))) * math.sqrt((h / math.pow(l, 3.0)))) / d) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (M <= 4.2e-68) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); else tmp = Float64(-0.125 * Float64(Float64(Float64(M * Float64(M * Float64(D * D))) * sqrt(Float64(h / (l ^ 3.0)))) / d)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (M <= 4.2e-68) tmp = sqrt((d / l)) * sqrt((d / h)); else tmp = -0.125 * (((M * (M * (D * D))) * sqrt((h / (l ^ 3.0)))) / d); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[M, 4.2e-68], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(-0.125 * N[(N[(N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 4.2 \cdot 10^{-68}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \frac{\left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}}{d}\\
\end{array}
\end{array}
if M < 4.20000000000000016e-68Initial program 61.3%
Simplified60.6%
Taylor expanded in M around 0 36.6%
if 4.20000000000000016e-68 < M Initial program 66.9%
Simplified66.9%
Taylor expanded in d around 0 24.3%
associate-*l/24.5%
*-commutative24.5%
unpow224.5%
associate-*l*24.6%
unpow224.6%
Simplified24.6%
Final simplification33.0%
(FPCore (d h l M D) :precision binary64 (if (<= h -1e-310) (* d (sqrt (/ (/ 1.0 h) l))) (* d (* (pow h -0.5) (pow l -0.5)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1e-310) {
tmp = d * sqrt(((1.0 / h) / l));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-1d-310)) then
tmp = d * sqrt(((1.0d0 / h) / l))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1e-310) {
tmp = d * Math.sqrt(((1.0 / h) / l));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -1e-310: tmp = d * math.sqrt(((1.0 / h) / l)) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -1e-310) tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -1e-310) tmp = d * sqrt(((1.0 / h) / l)); else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -1e-310], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -1 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if h < -9.999999999999969e-311Initial program 61.9%
Simplified62.3%
Taylor expanded in d around inf 7.9%
associate-/r*7.9%
Simplified7.9%
if -9.999999999999969e-311 < h Initial program 63.7%
Simplified63.7%
associate-*r/67.1%
div-inv67.1%
metadata-eval67.1%
Applied egg-rr67.1%
Taylor expanded in d around inf 39.6%
unpow-139.6%
sqr-pow39.6%
rem-sqrt-square40.2%
metadata-eval40.2%
sqr-pow40.1%
fabs-sqr40.1%
sqr-pow40.2%
Simplified40.2%
unpow-prod-down47.3%
Applied egg-rr47.3%
Final simplification30.7%
(FPCore (d h l M D) :precision binary64 (if (<= h -1e-310) (* (sqrt (/ d l)) (sqrt (/ d h))) (* d (* (pow h -0.5) (pow l -0.5)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1e-310) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-1d-310)) then
tmp = sqrt((d / l)) * sqrt((d / h))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1e-310) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -1e-310: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -1e-310) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -1e-310) tmp = sqrt((d / l)) * sqrt((d / h)); else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -1e-310], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if h < -9.999999999999969e-311Initial program 61.9%
Simplified60.9%
Taylor expanded in M around 0 37.3%
if -9.999999999999969e-311 < h Initial program 63.7%
Simplified63.7%
associate-*r/67.1%
div-inv67.1%
metadata-eval67.1%
Applied egg-rr67.1%
Taylor expanded in d around inf 39.6%
unpow-139.6%
sqr-pow39.6%
rem-sqrt-square40.2%
metadata-eval40.2%
sqr-pow40.1%
fabs-sqr40.1%
sqr-pow40.2%
Simplified40.2%
unpow-prod-down47.3%
Applied egg-rr47.3%
Final simplification43.0%
(FPCore (d h l M D) :precision binary64 (* d (sqrt (/ (/ 1.0 h) l))))
double code(double d, double h, double l, double M, double D) {
return d * sqrt(((1.0 / h) / l));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * sqrt(((1.0d0 / h) / l))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.sqrt(((1.0 / h) / l));
}
def code(d, h, l, M, D): return d * math.sqrt(((1.0 / h) / l))
function code(d, h, l, M, D) return Float64(d * sqrt(Float64(Float64(1.0 / h) / l))) end
function tmp = code(d, h, l, M, D) tmp = d * sqrt(((1.0 / h) / l)); end
code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}
\end{array}
Initial program 62.9%
Simplified63.1%
Taylor expanded in d around inf 26.2%
associate-/r*26.7%
Simplified26.7%
Final simplification26.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 62.9%
Simplified63.1%
associate-*r/65.2%
div-inv65.2%
metadata-eval65.2%
Applied egg-rr65.2%
Taylor expanded in d around inf 26.2%
unpow-126.2%
sqr-pow26.2%
rem-sqrt-square26.6%
metadata-eval26.6%
sqr-pow26.5%
fabs-sqr26.5%
sqr-pow26.6%
Simplified26.6%
Final simplification26.6%
herbie shell --seed 2023272
(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)))))