
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (- 1.0 (* 0.5 (/ (* h (* 0.25 (pow (/ M (/ d D)) 2.0))) l)))))
(if (<= l -1e-310)
(* (* (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ d l))) t_0)
(* t_0 (/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - (0.5 * ((h * (0.25 * pow((M / (d / D)), 2.0))) / l));
double tmp;
if (l <= -1e-310) {
tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * t_0;
} else {
tmp = t_0 * (d / (sqrt(l) * sqrt(h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - (0.5d0 * ((h * (0.25d0 * ((m / (d / d_1)) ** 2.0d0))) / l))
if (l <= (-1d-310)) then
tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * t_0
else
tmp = t_0 * (d / (sqrt(l) * sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - (0.5 * ((h * (0.25 * Math.pow((M / (d / D)), 2.0))) / l));
double tmp;
if (l <= -1e-310) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-h)) * Math.sqrt((d / l))) * t_0;
} else {
tmp = t_0 * (d / (Math.sqrt(l) * Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 - (0.5 * ((h * (0.25 * math.pow((M / (d / D)), 2.0))) / l)) tmp = 0 if l <= -1e-310: tmp = ((math.sqrt(-d) / math.sqrt(-h)) * math.sqrt((d / l))) * t_0 else: tmp = t_0 * (d / (math.sqrt(l) * math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 - Float64(0.5 * Float64(Float64(h * Float64(0.25 * (Float64(M / Float64(d / D)) ^ 2.0))) / l))) tmp = 0.0 if (l <= -1e-310) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * sqrt(Float64(d / l))) * t_0); else tmp = Float64(t_0 * Float64(d / Float64(sqrt(l) * sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 - (0.5 * ((h * (0.25 * ((M / (d / D)) ^ 2.0))) / l)); tmp = 0.0; if (l <= -1e-310) tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * t_0; else tmp = t_0 * (d / (sqrt(l) * sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = 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]}, If[LessEqual[l, -1e-310], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - 0.5 \cdot \frac{h \cdot \left(0.25 \cdot {\left(\frac{M}{\frac{d}{D}}\right)}^{2}\right)}{\ell}\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -9.999999999999969e-311Initial program 66.3%
Simplified66.3%
associate-*r/68.3%
associate-*l/68.3%
div-inv68.3%
metadata-eval68.3%
*-commutative68.3%
unpow-prod-down68.3%
metadata-eval68.3%
clear-num68.3%
un-div-inv68.3%
Applied egg-rr68.3%
frac-2neg68.3%
sqrt-div81.1%
Applied egg-rr81.1%
if -9.999999999999969e-311 < l Initial program 61.8%
Simplified63.5%
associate-*r/68.4%
associate-*l/68.4%
div-inv68.4%
metadata-eval68.4%
*-commutative68.4%
unpow-prod-down68.4%
metadata-eval68.4%
clear-num68.4%
un-div-inv68.3%
Applied egg-rr68.3%
*-commutative68.3%
sqrt-div74.7%
sqrt-div88.0%
frac-times88.0%
add-sqr-sqrt88.1%
Applied egg-rr88.1%
Final simplification84.4%
(FPCore (d h l M D)
:precision binary64
(if (<= l -4.6e-306)
(*
(* (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ d l)))
(- 1.0 (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l)))))
(*
(- 1.0 (* 0.5 (/ (* h (* 0.25 (pow (/ M (/ d D)) 2.0))) l)))
(/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -4.6e-306) {
tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * (1.0 - (0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))));
} else {
tmp = (1.0 - (0.5 * ((h * (0.25 * pow((M / (d / D)), 2.0))) / l))) * (d / (sqrt(l) * sqrt(h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-4.6d-306)) then
tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * (1.0d0 - (0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l))))
else
tmp = (1.0d0 - (0.5d0 * ((h * (0.25d0 * ((m / (d / d_1)) ** 2.0d0))) / l))) * (d / (sqrt(l) * sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -4.6e-306) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-h)) * Math.sqrt((d / l))) * (1.0 - (0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))));
} else {
tmp = (1.0 - (0.5 * ((h * (0.25 * Math.pow((M / (d / D)), 2.0))) / l))) * (d / (Math.sqrt(l) * Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -4.6e-306: tmp = ((math.sqrt(-d) / math.sqrt(-h)) * math.sqrt((d / l))) * (1.0 - (0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))) else: tmp = (1.0 - (0.5 * ((h * (0.25 * math.pow((M / (d / D)), 2.0))) / l))) * (d / (math.sqrt(l) * math.sqrt(h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -4.6e-306) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))))); else tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * Float64(0.25 * (Float64(M / Float64(d / D)) ^ 2.0))) / l))) * Float64(d / Float64(sqrt(l) * sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -4.6e-306) tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * (1.0 - (0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l)))); else tmp = (1.0 - (0.5 * ((h * (0.25 * ((M / (d / D)) ^ 2.0))) / l))) * (d / (sqrt(l) * sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4.6e-306], 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[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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] * N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.6 \cdot 10^{-306}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot \left(0.25 \cdot {\left(\frac{M}{\frac{d}{D}}\right)}^{2}\right)}{\ell}\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -4.59999999999999978e-306Initial program 66.8%
Simplified66.8%
frac-2neg68.8%
sqrt-div81.7%
Applied egg-rr79.6%
if -4.59999999999999978e-306 < l Initial program 61.3%
Simplified63.0%
associate-*r/67.9%
associate-*l/67.9%
div-inv67.9%
metadata-eval67.9%
*-commutative67.9%
unpow-prod-down67.9%
metadata-eval67.9%
clear-num67.9%
un-div-inv67.9%
Applied egg-rr67.9%
*-commutative67.9%
sqrt-div74.1%
sqrt-div87.3%
frac-times87.3%
add-sqr-sqrt87.3%
Applied egg-rr87.3%
Final simplification83.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (- 1.0 (* 0.5 (/ (* h (* 0.25 (pow (/ M (/ d D)) 2.0))) l)))))
(if (<= l -1.82e+143)
(* (- d) (sqrt (/ (/ 1.0 h) l)))
(if (<= l -1e-310)
(* t_0 (* (sqrt (/ d l)) (sqrt (/ d h))))
(* t_0 (/ d (* (sqrt l) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - (0.5 * ((h * (0.25 * pow((M / (d / D)), 2.0))) / l));
double tmp;
if (l <= -1.82e+143) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (l <= -1e-310) {
tmp = t_0 * (sqrt((d / l)) * sqrt((d / h)));
} else {
tmp = t_0 * (d / (sqrt(l) * sqrt(h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - (0.5d0 * ((h * (0.25d0 * ((m / (d / d_1)) ** 2.0d0))) / l))
if (l <= (-1.82d+143)) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else if (l <= (-1d-310)) then
tmp = t_0 * (sqrt((d / l)) * sqrt((d / h)))
else
tmp = t_0 * (d / (sqrt(l) * sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - (0.5 * ((h * (0.25 * Math.pow((M / (d / D)), 2.0))) / l));
double tmp;
if (l <= -1.82e+143) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else if (l <= -1e-310) {
tmp = t_0 * (Math.sqrt((d / l)) * Math.sqrt((d / h)));
} else {
tmp = t_0 * (d / (Math.sqrt(l) * Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 - (0.5 * ((h * (0.25 * math.pow((M / (d / D)), 2.0))) / l)) tmp = 0 if l <= -1.82e+143: tmp = -d * math.sqrt(((1.0 / h) / l)) elif l <= -1e-310: tmp = t_0 * (math.sqrt((d / l)) * math.sqrt((d / h))) else: tmp = t_0 * (d / (math.sqrt(l) * math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 - Float64(0.5 * Float64(Float64(h * Float64(0.25 * (Float64(M / Float64(d / D)) ^ 2.0))) / l))) tmp = 0.0 if (l <= -1.82e+143) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (l <= -1e-310) tmp = Float64(t_0 * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))); else tmp = Float64(t_0 * Float64(d / Float64(sqrt(l) * sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 - (0.5 * ((h * (0.25 * ((M / (d / D)) ^ 2.0))) / l)); tmp = 0.0; if (l <= -1.82e+143) tmp = -d * sqrt(((1.0 / h) / l)); elseif (l <= -1e-310) tmp = t_0 * (sqrt((d / l)) * sqrt((d / h))); else tmp = t_0 * (d / (sqrt(l) * sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = 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]}, If[LessEqual[l, -1.82e+143], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-310], N[(t$95$0 * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - 0.5 \cdot \frac{h \cdot \left(0.25 \cdot {\left(\frac{M}{\frac{d}{D}}\right)}^{2}\right)}{\ell}\\
\mathbf{if}\;\ell \leq -1.82 \cdot 10^{+143}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.8200000000000001e143Initial program 32.2%
Simplified32.4%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt56.3%
neg-mul-156.3%
Simplified56.3%
if -1.8200000000000001e143 < l < -9.999999999999969e-311Initial program 76.5%
Simplified76.5%
associate-*r/79.0%
associate-*l/79.0%
div-inv79.0%
metadata-eval79.0%
*-commutative79.0%
unpow-prod-down79.0%
metadata-eval79.0%
clear-num79.0%
un-div-inv79.0%
Applied egg-rr79.0%
if -9.999999999999969e-311 < l Initial program 61.8%
Simplified63.5%
associate-*r/68.4%
associate-*l/68.4%
div-inv68.4%
metadata-eval68.4%
*-commutative68.4%
unpow-prod-down68.4%
metadata-eval68.4%
clear-num68.4%
un-div-inv68.3%
Applied egg-rr68.3%
*-commutative68.3%
sqrt-div74.7%
sqrt-div88.0%
frac-times88.0%
add-sqr-sqrt88.1%
Applied egg-rr88.1%
Final simplification80.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.8e+143)
(* (- d) (sqrt (/ (/ 1.0 h) l)))
(if (<= l -4.6e-306)
(*
(- 1.0 (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))))
(* (sqrt (/ d l)) (sqrt (/ d h))))
(*
(- 1.0 (* 0.5 (/ (* h (* 0.25 (pow (/ M (/ d D)) 2.0))) l)))
(/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.8e+143) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (l <= -4.6e-306) {
tmp = (1.0 - (0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))) * (sqrt((d / l)) * sqrt((d / h)));
} else {
tmp = (1.0 - (0.5 * ((h * (0.25 * pow((M / (d / D)), 2.0))) / l))) * (d / (sqrt(l) * sqrt(h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1.8d+143)) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else if (l <= (-4.6d-306)) then
tmp = (1.0d0 - (0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l)))) * (sqrt((d / l)) * sqrt((d / h)))
else
tmp = (1.0d0 - (0.5d0 * ((h * (0.25d0 * ((m / (d / d_1)) ** 2.0d0))) / l))) * (d / (sqrt(l) * sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.8e+143) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else if (l <= -4.6e-306) {
tmp = (1.0 - (0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))) * (Math.sqrt((d / l)) * Math.sqrt((d / h)));
} else {
tmp = (1.0 - (0.5 * ((h * (0.25 * Math.pow((M / (d / D)), 2.0))) / l))) * (d / (Math.sqrt(l) * Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.8e+143: tmp = -d * math.sqrt(((1.0 / h) / l)) elif l <= -4.6e-306: tmp = (1.0 - (0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))) * (math.sqrt((d / l)) * math.sqrt((d / h))) else: tmp = (1.0 - (0.5 * ((h * (0.25 * math.pow((M / (d / D)), 2.0))) / l))) * (d / (math.sqrt(l) * math.sqrt(h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.8e+143) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (l <= -4.6e-306) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l)))) * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))); else tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * Float64(0.25 * (Float64(M / Float64(d / D)) ^ 2.0))) / l))) * Float64(d / Float64(sqrt(l) * sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.8e+143) tmp = -d * sqrt(((1.0 / h) / l)); elseif (l <= -4.6e-306) tmp = (1.0 - (0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l)))) * (sqrt((d / l)) * sqrt((d / h))); else tmp = (1.0 - (0.5 * ((h * (0.25 * ((M / (d / D)) ^ 2.0))) / l))) * (d / (sqrt(l) * sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.8e+143], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4.6e-306], N[(N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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] * N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.8 \cdot 10^{+143}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;\ell \leq -4.6 \cdot 10^{-306}:\\
\;\;\;\;\left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot \left(0.25 \cdot {\left(\frac{M}{\frac{d}{D}}\right)}^{2}\right)}{\ell}\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.8e143Initial program 32.2%
Simplified32.4%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt56.3%
neg-mul-156.3%
Simplified56.3%
if -1.8e143 < l < -4.59999999999999978e-306Initial program 77.3%
Simplified77.3%
if -4.59999999999999978e-306 < l Initial program 61.3%
Simplified63.0%
associate-*r/67.9%
associate-*l/67.9%
div-inv67.9%
metadata-eval67.9%
*-commutative67.9%
unpow-prod-down67.9%
metadata-eval67.9%
clear-num67.9%
un-div-inv67.9%
Applied egg-rr67.9%
*-commutative67.9%
sqrt-div74.1%
sqrt-div87.3%
frac-times87.3%
add-sqr-sqrt87.3%
Applied egg-rr87.3%
Final simplification79.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l -7.4e+142)
(* (- d) (sqrt (/ (/ 1.0 h) l)))
(if (<= l -4.6e-306)
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(+ 1.0 (* (/ h l) (* (pow (/ (/ D d) (/ 2.0 M)) 2.0) -0.5)))))
(*
(- 1.0 (* 0.5 (/ (* h (* 0.25 (pow (/ M (/ d D)) 2.0))) l)))
(/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -7.4e+142) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (l <= -4.6e-306) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h / l) * (pow(((D / d) / (2.0 / M)), 2.0) * -0.5))));
} else {
tmp = (1.0 - (0.5 * ((h * (0.25 * pow((M / (d / D)), 2.0))) / l))) * (d / (sqrt(l) * sqrt(h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-7.4d+142)) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else if (l <= (-4.6d-306)) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + ((h / l) * ((((d_1 / d) / (2.0d0 / m)) ** 2.0d0) * (-0.5d0)))))
else
tmp = (1.0d0 - (0.5d0 * ((h * (0.25d0 * ((m / (d / d_1)) ** 2.0d0))) / l))) * (d / (sqrt(l) * sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -7.4e+142) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else if (l <= -4.6e-306) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + ((h / l) * (Math.pow(((D / d) / (2.0 / M)), 2.0) * -0.5))));
} else {
tmp = (1.0 - (0.5 * ((h * (0.25 * Math.pow((M / (d / D)), 2.0))) / l))) * (d / (Math.sqrt(l) * Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -7.4e+142: tmp = -d * math.sqrt(((1.0 / h) / l)) elif l <= -4.6e-306: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + ((h / l) * (math.pow(((D / d) / (2.0 / M)), 2.0) * -0.5)))) else: tmp = (1.0 - (0.5 * ((h * (0.25 * math.pow((M / (d / D)), 2.0))) / l))) * (d / (math.sqrt(l) * math.sqrt(h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -7.4e+142) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (l <= -4.6e-306) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(D / d) / Float64(2.0 / M)) ^ 2.0) * -0.5))))); else tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * Float64(0.25 * (Float64(M / Float64(d / D)) ^ 2.0))) / l))) * Float64(d / Float64(sqrt(l) * sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -7.4e+142) tmp = -d * sqrt(((1.0 / h) / l)); elseif (l <= -4.6e-306) tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h / l) * ((((D / d) / (2.0 / M)) ^ 2.0) * -0.5)))); else tmp = (1.0 - (0.5 * ((h * (0.25 * ((M / (d / D)) ^ 2.0))) / l))) * (d / (sqrt(l) * sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -7.4e+142], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4.6e-306], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D / d), $MachinePrecision] / N[(2.0 / M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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] * N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -7.4 \cdot 10^{+142}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;\ell \leq -4.6 \cdot 10^{-306}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{\frac{D}{d}}{\frac{2}{M}}\right)}^{2} \cdot -0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot \left(0.25 \cdot {\left(\frac{M}{\frac{d}{D}}\right)}^{2}\right)}{\ell}\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -7.3999999999999995e142Initial program 32.2%
Simplified32.4%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt56.3%
neg-mul-156.3%
Simplified56.3%
if -7.3999999999999995e142 < l < -4.59999999999999978e-306Initial program 77.3%
Simplified76.3%
associate-/l/76.3%
*-un-lft-identity76.3%
times-frac76.3%
associate-*l*77.2%
div-inv77.3%
clear-num77.3%
un-div-inv77.2%
Applied egg-rr77.2%
if -4.59999999999999978e-306 < l Initial program 61.3%
Simplified63.0%
associate-*r/67.9%
associate-*l/67.9%
div-inv67.9%
metadata-eval67.9%
*-commutative67.9%
unpow-prod-down67.9%
metadata-eval67.9%
clear-num67.9%
un-div-inv67.9%
Applied egg-rr67.9%
*-commutative67.9%
sqrt-div74.1%
sqrt-div87.3%
frac-times87.3%
add-sqr-sqrt87.3%
Applied egg-rr87.3%
Final simplification79.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l -8.6e+142)
(* (- d) (sqrt (/ (/ 1.0 h) l)))
(if (<= l -4.6e-306)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(- 1.0 (* (/ h l) (* 0.125 (pow (* D (/ M d)) 2.0)))))
(*
(- 1.0 (* 0.5 (/ (* h (* 0.25 (pow (/ M (/ d D)) 2.0))) l)))
(/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -8.6e+142) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (l <= -4.6e-306) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((h / l) * (0.125 * pow((D * (M / d)), 2.0))));
} else {
tmp = (1.0 - (0.5 * ((h * (0.25 * pow((M / (d / D)), 2.0))) / l))) * (d / (sqrt(l) * sqrt(h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-8.6d+142)) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else if (l <= (-4.6d-306)) then
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - ((h / l) * (0.125d0 * ((d_1 * (m / d)) ** 2.0d0))))
else
tmp = (1.0d0 - (0.5d0 * ((h * (0.25d0 * ((m / (d / d_1)) ** 2.0d0))) / l))) * (d / (sqrt(l) * sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -8.6e+142) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else if (l <= -4.6e-306) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - ((h / l) * (0.125 * Math.pow((D * (M / d)), 2.0))));
} else {
tmp = (1.0 - (0.5 * ((h * (0.25 * Math.pow((M / (d / D)), 2.0))) / l))) * (d / (Math.sqrt(l) * Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -8.6e+142: tmp = -d * math.sqrt(((1.0 / h) / l)) elif l <= -4.6e-306: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - ((h / l) * (0.125 * math.pow((D * (M / d)), 2.0)))) else: tmp = (1.0 - (0.5 * ((h * (0.25 * math.pow((M / (d / D)), 2.0))) / l))) * (d / (math.sqrt(l) * math.sqrt(h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -8.6e+142) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (l <= -4.6e-306) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.125 * (Float64(D * Float64(M / d)) ^ 2.0))))); else tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * Float64(0.25 * (Float64(M / Float64(d / D)) ^ 2.0))) / l))) * Float64(d / Float64(sqrt(l) * sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -8.6e+142) tmp = -d * sqrt(((1.0 / h) / l)); elseif (l <= -4.6e-306) tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((h / l) * (0.125 * ((D * (M / d)) ^ 2.0)))); else tmp = (1.0 - (0.5 * ((h * (0.25 * ((M / (d / D)) ^ 2.0))) / l))) * (d / (sqrt(l) * sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -8.6e+142], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4.6e-306], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.125 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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] * N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -8.6 \cdot 10^{+142}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;\ell \leq -4.6 \cdot 10^{-306}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.125 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot \left(0.25 \cdot {\left(\frac{M}{\frac{d}{D}}\right)}^{2}\right)}{\ell}\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -8.60000000000000025e142Initial program 32.2%
Simplified32.4%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt56.3%
neg-mul-156.3%
Simplified56.3%
if -8.60000000000000025e142 < l < -4.59999999999999978e-306Initial program 77.3%
Simplified77.3%
associate-*r/79.7%
associate-*l/79.7%
div-inv79.7%
metadata-eval79.7%
*-commutative79.7%
unpow-prod-down79.7%
metadata-eval79.7%
clear-num79.7%
un-div-inv79.7%
Applied egg-rr79.7%
Taylor expanded in M around 0 49.6%
metadata-eval49.6%
associate-*r*50.6%
times-frac48.6%
associate-/l*48.6%
*-commutative48.6%
unpow248.6%
unpow248.6%
times-frac59.6%
unpow259.6%
swap-sqr76.3%
unpow276.3%
associate-*r*76.3%
associate-*l*76.3%
associate-*r*76.3%
*-commutative76.3%
associate-*r*76.3%
metadata-eval76.3%
Simplified76.3%
if -4.59999999999999978e-306 < l Initial program 61.3%
Simplified63.0%
associate-*r/67.9%
associate-*l/67.9%
div-inv67.9%
metadata-eval67.9%
*-commutative67.9%
unpow-prod-down67.9%
metadata-eval67.9%
clear-num67.9%
un-div-inv67.9%
Applied egg-rr67.9%
*-commutative67.9%
sqrt-div74.1%
sqrt-div87.3%
frac-times87.3%
add-sqr-sqrt87.3%
Applied egg-rr87.3%
Final simplification79.2%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2.5e+143)
(* (- d) (sqrt (/ (/ 1.0 h) l)))
(if (<= l -4.6e-306)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(- 1.0 (* (/ h l) (* 0.125 (pow (* D (/ M d)) 2.0)))))
(*
(+ 1.0 (* h (* (pow (* M (/ D d)) 2.0) (/ -0.125 l))))
(/ (/ d (sqrt l)) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.5e+143) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (l <= -4.6e-306) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((h / l) * (0.125 * pow((D * (M / d)), 2.0))));
} else {
tmp = (1.0 + (h * (pow((M * (D / d)), 2.0) * (-0.125 / l)))) * ((d / sqrt(l)) / sqrt(h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-2.5d+143)) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else if (l <= (-4.6d-306)) then
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - ((h / l) * (0.125d0 * ((d_1 * (m / d)) ** 2.0d0))))
else
tmp = (1.0d0 + (h * (((m * (d_1 / d)) ** 2.0d0) * ((-0.125d0) / l)))) * ((d / sqrt(l)) / sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.5e+143) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else if (l <= -4.6e-306) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - ((h / l) * (0.125 * Math.pow((D * (M / d)), 2.0))));
} else {
tmp = (1.0 + (h * (Math.pow((M * (D / d)), 2.0) * (-0.125 / l)))) * ((d / Math.sqrt(l)) / Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2.5e+143: tmp = -d * math.sqrt(((1.0 / h) / l)) elif l <= -4.6e-306: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - ((h / l) * (0.125 * math.pow((D * (M / d)), 2.0)))) else: tmp = (1.0 + (h * (math.pow((M * (D / d)), 2.0) * (-0.125 / l)))) * ((d / math.sqrt(l)) / math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.5e+143) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (l <= -4.6e-306) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.125 * (Float64(D * Float64(M / d)) ^ 2.0))))); else tmp = Float64(Float64(1.0 + Float64(h * Float64((Float64(M * Float64(D / d)) ^ 2.0) * Float64(-0.125 / l)))) * Float64(Float64(d / sqrt(l)) / sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -2.5e+143) tmp = -d * sqrt(((1.0 / h) / l)); elseif (l <= -4.6e-306) tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((h / l) * (0.125 * ((D * (M / d)) ^ 2.0)))); else tmp = (1.0 + (h * (((M * (D / d)) ^ 2.0) * (-0.125 / l)))) * ((d / sqrt(l)) / sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.5e+143], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4.6e-306], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.125 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(h * N[(N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.125 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.5 \cdot 10^{+143}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;\ell \leq -4.6 \cdot 10^{-306}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.125 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + h \cdot \left({\left(M \cdot \frac{D}{d}\right)}^{2} \cdot \frac{-0.125}{\ell}\right)\right) \cdot \frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -2.50000000000000006e143Initial program 32.2%
Simplified32.4%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt56.3%
neg-mul-156.3%
Simplified56.3%
if -2.50000000000000006e143 < l < -4.59999999999999978e-306Initial program 77.3%
Simplified77.3%
associate-*r/79.7%
associate-*l/79.7%
div-inv79.7%
metadata-eval79.7%
*-commutative79.7%
unpow-prod-down79.7%
metadata-eval79.7%
clear-num79.7%
un-div-inv79.7%
Applied egg-rr79.7%
Taylor expanded in M around 0 49.6%
metadata-eval49.6%
associate-*r*50.6%
times-frac48.6%
associate-/l*48.6%
*-commutative48.6%
unpow248.6%
unpow248.6%
times-frac59.6%
unpow259.6%
swap-sqr76.3%
unpow276.3%
associate-*r*76.3%
associate-*l*76.3%
associate-*r*76.3%
*-commutative76.3%
associate-*r*76.3%
metadata-eval76.3%
Simplified76.3%
if -4.59999999999999978e-306 < l Initial program 61.3%
Simplified63.0%
Applied egg-rr71.4%
Simplified83.1%
fma-undefine83.1%
*-commutative83.1%
*-commutative83.1%
associate-/r/84.4%
div-inv84.4%
clear-num84.4%
Applied egg-rr84.4%
Final simplification77.8%
(FPCore (d h l M D)
:precision binary64
(if (<= l -0.0013)
(* (- d) (sqrt (/ (/ 1.0 h) l)))
(if (<= l -1e-310)
(*
(- 1.0 (* 0.5 (/ (* h (* 0.25 (pow (/ M (/ d D)) 2.0))) l)))
(sqrt (* (/ d l) (/ d h))))
(*
(+ 1.0 (* h (* (pow (* M (/ D d)) 2.0) (/ -0.125 l))))
(/ (/ d (sqrt l)) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -0.0013) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (l <= -1e-310) {
tmp = (1.0 - (0.5 * ((h * (0.25 * pow((M / (d / D)), 2.0))) / l))) * sqrt(((d / l) * (d / h)));
} else {
tmp = (1.0 + (h * (pow((M * (D / d)), 2.0) * (-0.125 / l)))) * ((d / sqrt(l)) / sqrt(h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-0.0013d0)) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else if (l <= (-1d-310)) then
tmp = (1.0d0 - (0.5d0 * ((h * (0.25d0 * ((m / (d / d_1)) ** 2.0d0))) / l))) * sqrt(((d / l) * (d / h)))
else
tmp = (1.0d0 + (h * (((m * (d_1 / d)) ** 2.0d0) * ((-0.125d0) / l)))) * ((d / sqrt(l)) / sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -0.0013) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else if (l <= -1e-310) {
tmp = (1.0 - (0.5 * ((h * (0.25 * Math.pow((M / (d / D)), 2.0))) / l))) * Math.sqrt(((d / l) * (d / h)));
} else {
tmp = (1.0 + (h * (Math.pow((M * (D / d)), 2.0) * (-0.125 / l)))) * ((d / Math.sqrt(l)) / Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -0.0013: tmp = -d * math.sqrt(((1.0 / h) / l)) elif l <= -1e-310: tmp = (1.0 - (0.5 * ((h * (0.25 * math.pow((M / (d / D)), 2.0))) / l))) * math.sqrt(((d / l) * (d / h))) else: tmp = (1.0 + (h * (math.pow((M * (D / d)), 2.0) * (-0.125 / l)))) * ((d / math.sqrt(l)) / math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -0.0013) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (l <= -1e-310) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * Float64(0.25 * (Float64(M / Float64(d / D)) ^ 2.0))) / l))) * sqrt(Float64(Float64(d / l) * Float64(d / h)))); else tmp = Float64(Float64(1.0 + Float64(h * Float64((Float64(M * Float64(D / d)) ^ 2.0) * Float64(-0.125 / l)))) * Float64(Float64(d / sqrt(l)) / sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -0.0013) tmp = -d * sqrt(((1.0 / h) / l)); elseif (l <= -1e-310) tmp = (1.0 - (0.5 * ((h * (0.25 * ((M / (d / D)) ^ 2.0))) / l))) * sqrt(((d / l) * (d / h))); else tmp = (1.0 + (h * (((M * (D / d)) ^ 2.0) * (-0.125 / l)))) * ((d / sqrt(l)) / sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -0.0013], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-310], N[(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] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(h * N[(N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.125 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.0013:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot \left(0.25 \cdot {\left(\frac{M}{\frac{d}{D}}\right)}^{2}\right)}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + h \cdot \left({\left(M \cdot \frac{D}{d}\right)}^{2} \cdot \frac{-0.125}{\ell}\right)\right) \cdot \frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -0.0012999999999999999Initial program 53.6%
Simplified53.7%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt65.7%
neg-mul-165.7%
Simplified65.7%
if -0.0012999999999999999 < l < -9.999999999999969e-311Initial program 76.5%
Simplified76.5%
associate-*r/80.0%
associate-*l/80.0%
div-inv80.0%
metadata-eval80.0%
*-commutative80.0%
unpow-prod-down80.0%
metadata-eval80.0%
clear-num80.0%
un-div-inv80.0%
Applied egg-rr80.0%
add-cube-cbrt80.0%
pow380.0%
Applied egg-rr80.0%
pow180.0%
sqrt-unprod75.4%
unpow375.4%
add-cube-cbrt75.5%
Applied egg-rr75.5%
unpow175.5%
Simplified75.5%
if -9.999999999999969e-311 < l Initial program 61.8%
Simplified63.5%
Applied egg-rr71.9%
Simplified83.8%
fma-undefine83.8%
*-commutative83.8%
*-commutative83.8%
associate-/r/85.1%
div-inv85.1%
clear-num85.1%
Applied egg-rr85.1%
Final simplification77.8%
(FPCore (d h l M D)
:precision binary64
(if (<= l -6e-168)
(* (- d) (sqrt (/ (/ 1.0 h) l)))
(if (<= l -1e-310)
(* d (pow (pow (* l h) 2.0) -0.25))
(if (<= l 1.35e+91)
(*
(/ d (sqrt (* l h)))
(- 1.0 (* 0.125 (* (pow (/ M (/ d D)) 2.0) (/ h l)))))
(/ 1.0 (* (sqrt h) (/ (sqrt l) d)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6e-168) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (l <= -1e-310) {
tmp = d * pow(pow((l * h), 2.0), -0.25);
} else if (l <= 1.35e+91) {
tmp = (d / sqrt((l * h))) * (1.0 - (0.125 * (pow((M / (d / D)), 2.0) * (h / l))));
} else {
tmp = 1.0 / (sqrt(h) * (sqrt(l) / 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 (l <= (-6d-168)) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else if (l <= (-1d-310)) then
tmp = d * (((l * h) ** 2.0d0) ** (-0.25d0))
else if (l <= 1.35d+91) then
tmp = (d / sqrt((l * h))) * (1.0d0 - (0.125d0 * (((m / (d / d_1)) ** 2.0d0) * (h / l))))
else
tmp = 1.0d0 / (sqrt(h) * (sqrt(l) / d))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6e-168) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else if (l <= -1e-310) {
tmp = d * Math.pow(Math.pow((l * h), 2.0), -0.25);
} else if (l <= 1.35e+91) {
tmp = (d / Math.sqrt((l * h))) * (1.0 - (0.125 * (Math.pow((M / (d / D)), 2.0) * (h / l))));
} else {
tmp = 1.0 / (Math.sqrt(h) * (Math.sqrt(l) / d));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -6e-168: tmp = -d * math.sqrt(((1.0 / h) / l)) elif l <= -1e-310: tmp = d * math.pow(math.pow((l * h), 2.0), -0.25) elif l <= 1.35e+91: tmp = (d / math.sqrt((l * h))) * (1.0 - (0.125 * (math.pow((M / (d / D)), 2.0) * (h / l)))) else: tmp = 1.0 / (math.sqrt(h) * (math.sqrt(l) / d)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -6e-168) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (l <= -1e-310) tmp = Float64(d * ((Float64(l * h) ^ 2.0) ^ -0.25)); elseif (l <= 1.35e+91) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * Float64(1.0 - Float64(0.125 * Float64((Float64(M / Float64(d / D)) ^ 2.0) * Float64(h / l))))); else tmp = Float64(1.0 / Float64(sqrt(h) * Float64(sqrt(l) / d))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -6e-168) tmp = -d * sqrt(((1.0 / h) / l)); elseif (l <= -1e-310) tmp = d * (((l * h) ^ 2.0) ^ -0.25); elseif (l <= 1.35e+91) tmp = (d / sqrt((l * h))) * (1.0 - (0.125 * (((M / (d / D)) ^ 2.0) * (h / l)))); else tmp = 1.0 / (sqrt(h) * (sqrt(l) / d)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -6e-168], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-310], N[(d * N[Power[N[Power[N[(l * h), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.35e+91], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.125 * N[(N[Power[N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[h], $MachinePrecision] * N[(N[Sqrt[l], $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6 \cdot 10^{-168}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;d \cdot {\left({\left(\ell \cdot h\right)}^{2}\right)}^{-0.25}\\
\mathbf{elif}\;\ell \leq 1.35 \cdot 10^{+91}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(1 - 0.125 \cdot \left({\left(\frac{M}{\frac{d}{D}}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{h} \cdot \frac{\sqrt{\ell}}{d}}\\
\end{array}
\end{array}
if l < -5.99999999999999983e-168Initial program 61.4%
Simplified61.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt56.2%
neg-mul-156.2%
Simplified56.2%
if -5.99999999999999983e-168 < l < -9.999999999999969e-311Initial program 80.5%
Simplified80.5%
Taylor expanded in d around inf 25.7%
add-log-exp53.7%
pow1/253.7%
inv-pow53.7%
pow-pow53.7%
metadata-eval53.7%
Applied egg-rr53.7%
rem-log-exp22.9%
sqr-pow22.9%
pow-prod-down42.5%
pow242.5%
metadata-eval42.5%
Applied egg-rr42.5%
if -9.999999999999969e-311 < l < 1.35e91Initial program 70.6%
Simplified70.6%
sqrt-div81.6%
sqrt-div82.6%
frac-times82.6%
add-sqr-sqrt82.7%
Applied egg-rr82.7%
associate-/l/81.6%
Simplified81.6%
*-un-lft-identity81.6%
associate-/l/82.7%
pow1/282.7%
pow1/282.7%
pow-prod-down78.0%
pow1/278.0%
Applied egg-rr78.0%
*-lft-identity78.0%
Simplified78.0%
Taylor expanded in M around 0 56.9%
associate-/l*56.9%
times-frac55.5%
associate-*r*55.5%
associate-/l*55.6%
*-commutative55.6%
associate-/l*53.2%
unpow253.2%
unpow253.2%
unpow253.2%
times-frac63.2%
swap-sqr78.0%
unpow278.0%
*-commutative78.0%
associate-*r/78.0%
associate-*l/78.0%
associate-/r/78.0%
Simplified78.0%
if 1.35e91 < l Initial program 44.6%
Simplified49.5%
sqrt-div67.6%
sqrt-div72.8%
frac-times72.7%
add-sqr-sqrt72.7%
Applied egg-rr72.7%
associate-/l/72.8%
Simplified72.8%
Taylor expanded in d around inf 52.2%
unpow-152.2%
metadata-eval52.2%
pow-sqr52.2%
rem-sqrt-square52.2%
rem-square-sqrt52.2%
fabs-sqr52.2%
rem-square-sqrt52.2%
Simplified52.2%
metadata-eval52.2%
pow-flip52.2%
pow1/252.2%
div-inv52.3%
sqrt-prod68.2%
associate-/l/68.3%
clear-num68.5%
Applied egg-rr68.5%
*-un-lft-identity68.5%
associate-/r/60.8%
Applied egg-rr60.8%
*-lft-identity60.8%
associate-*l/68.2%
associate-/l*68.5%
Simplified68.5%
Final simplification63.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (- 1.0 (* 0.5 (/ (* h (* 0.25 (pow (/ M (/ d D)) 2.0))) l)))))
(if (<= l -0.27)
(* (- d) (sqrt (/ (/ 1.0 h) l)))
(if (<= l -1e-310)
(* t_0 (sqrt (* (/ d l) (/ d h))))
(* t_0 (/ d (sqrt (* l h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - (0.5 * ((h * (0.25 * pow((M / (d / D)), 2.0))) / l));
double tmp;
if (l <= -0.27) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (l <= -1e-310) {
tmp = t_0 * sqrt(((d / l) * (d / h)));
} else {
tmp = t_0 * (d / sqrt((l * h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - (0.5d0 * ((h * (0.25d0 * ((m / (d / d_1)) ** 2.0d0))) / l))
if (l <= (-0.27d0)) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else if (l <= (-1d-310)) then
tmp = t_0 * sqrt(((d / l) * (d / h)))
else
tmp = t_0 * (d / sqrt((l * h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - (0.5 * ((h * (0.25 * Math.pow((M / (d / D)), 2.0))) / l));
double tmp;
if (l <= -0.27) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else if (l <= -1e-310) {
tmp = t_0 * Math.sqrt(((d / l) * (d / h)));
} else {
tmp = t_0 * (d / Math.sqrt((l * h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 - (0.5 * ((h * (0.25 * math.pow((M / (d / D)), 2.0))) / l)) tmp = 0 if l <= -0.27: tmp = -d * math.sqrt(((1.0 / h) / l)) elif l <= -1e-310: tmp = t_0 * math.sqrt(((d / l) * (d / h))) else: tmp = t_0 * (d / math.sqrt((l * h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 - Float64(0.5 * Float64(Float64(h * Float64(0.25 * (Float64(M / Float64(d / D)) ^ 2.0))) / l))) tmp = 0.0 if (l <= -0.27) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (l <= -1e-310) tmp = Float64(t_0 * sqrt(Float64(Float64(d / l) * Float64(d / h)))); else tmp = Float64(t_0 * Float64(d / sqrt(Float64(l * h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 - (0.5 * ((h * (0.25 * ((M / (d / D)) ^ 2.0))) / l)); tmp = 0.0; if (l <= -0.27) tmp = -d * sqrt(((1.0 / h) / l)); elseif (l <= -1e-310) tmp = t_0 * sqrt(((d / l) * (d / h))); else tmp = t_0 * (d / sqrt((l * h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = 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]}, If[LessEqual[l, -0.27], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-310], N[(t$95$0 * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - 0.5 \cdot \frac{h \cdot \left(0.25 \cdot {\left(\frac{M}{\frac{d}{D}}\right)}^{2}\right)}{\ell}\\
\mathbf{if}\;\ell \leq -0.27:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;t\_0 \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -0.27000000000000002Initial program 53.6%
Simplified53.7%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt65.7%
neg-mul-165.7%
Simplified65.7%
if -0.27000000000000002 < l < -9.999999999999969e-311Initial program 76.5%
Simplified76.5%
associate-*r/80.0%
associate-*l/80.0%
div-inv80.0%
metadata-eval80.0%
*-commutative80.0%
unpow-prod-down80.0%
metadata-eval80.0%
clear-num80.0%
un-div-inv80.0%
Applied egg-rr80.0%
add-cube-cbrt80.0%
pow380.0%
Applied egg-rr80.0%
pow180.0%
sqrt-unprod75.4%
unpow375.4%
add-cube-cbrt75.5%
Applied egg-rr75.5%
unpow175.5%
Simplified75.5%
if -9.999999999999969e-311 < l Initial program 61.8%
Simplified63.5%
sqrt-div76.9%
sqrt-div79.3%
frac-times79.3%
add-sqr-sqrt79.3%
Applied egg-rr79.3%
associate-/l/78.6%
Simplified78.6%
*-un-lft-identity78.6%
associate-/l/79.3%
pow1/279.3%
pow1/279.3%
pow-prod-down68.4%
pow1/268.4%
Applied egg-rr68.4%
*-lft-identity68.4%
Simplified68.4%
associate-*r/68.4%
associate-*l/68.4%
div-inv68.4%
metadata-eval68.4%
*-commutative68.4%
unpow-prod-down68.4%
metadata-eval68.4%
clear-num68.4%
un-div-inv68.3%
Applied egg-rr77.2%
Final simplification74.0%
(FPCore (d h l M D)
:precision binary64
(if (<= l -3.5e-169)
(* (- d) (sqrt (/ (/ 1.0 h) l)))
(if (<= l -4.8e-286)
(* d (pow (pow (* l h) 2.0) -0.25))
(*
(- 1.0 (* 0.5 (/ (* h (* 0.25 (pow (/ M (/ d D)) 2.0))) l)))
(/ d (sqrt (* l h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.5e-169) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (l <= -4.8e-286) {
tmp = d * pow(pow((l * h), 2.0), -0.25);
} else {
tmp = (1.0 - (0.5 * ((h * (0.25 * pow((M / (d / D)), 2.0))) / l))) * (d / sqrt((l * h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-3.5d-169)) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else if (l <= (-4.8d-286)) then
tmp = d * (((l * h) ** 2.0d0) ** (-0.25d0))
else
tmp = (1.0d0 - (0.5d0 * ((h * (0.25d0 * ((m / (d / d_1)) ** 2.0d0))) / l))) * (d / sqrt((l * h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.5e-169) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else if (l <= -4.8e-286) {
tmp = d * Math.pow(Math.pow((l * h), 2.0), -0.25);
} else {
tmp = (1.0 - (0.5 * ((h * (0.25 * Math.pow((M / (d / D)), 2.0))) / l))) * (d / Math.sqrt((l * h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -3.5e-169: tmp = -d * math.sqrt(((1.0 / h) / l)) elif l <= -4.8e-286: tmp = d * math.pow(math.pow((l * h), 2.0), -0.25) else: tmp = (1.0 - (0.5 * ((h * (0.25 * math.pow((M / (d / D)), 2.0))) / l))) * (d / math.sqrt((l * h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -3.5e-169) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (l <= -4.8e-286) tmp = Float64(d * ((Float64(l * h) ^ 2.0) ^ -0.25)); else tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * Float64(0.25 * (Float64(M / Float64(d / D)) ^ 2.0))) / l))) * Float64(d / sqrt(Float64(l * h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -3.5e-169) tmp = -d * sqrt(((1.0 / h) / l)); elseif (l <= -4.8e-286) tmp = d * (((l * h) ^ 2.0) ^ -0.25); else tmp = (1.0 - (0.5 * ((h * (0.25 * ((M / (d / D)) ^ 2.0))) / l))) * (d / sqrt((l * h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -3.5e-169], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4.8e-286], N[(d * N[Power[N[Power[N[(l * h), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $MachinePrecision]), $MachinePrecision], N[(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] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.5 \cdot 10^{-169}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;\ell \leq -4.8 \cdot 10^{-286}:\\
\;\;\;\;d \cdot {\left({\left(\ell \cdot h\right)}^{2}\right)}^{-0.25}\\
\mathbf{else}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot \left(0.25 \cdot {\left(\frac{M}{\frac{d}{D}}\right)}^{2}\right)}{\ell}\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -3.5000000000000003e-169Initial program 61.4%
Simplified61.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt56.2%
neg-mul-156.2%
Simplified56.2%
if -3.5000000000000003e-169 < l < -4.79999999999999987e-286Initial program 85.1%
Simplified85.1%
Taylor expanded in d around inf 28.2%
add-log-exp58.9%
pow1/258.9%
inv-pow58.9%
pow-pow58.9%
metadata-eval58.9%
Applied egg-rr58.9%
rem-log-exp25.1%
sqr-pow25.1%
pow-prod-down46.6%
pow246.6%
metadata-eval46.6%
Applied egg-rr46.6%
if -4.79999999999999987e-286 < l Initial program 61.2%
Simplified62.8%
sqrt-div75.1%
sqrt-div77.4%
frac-times77.4%
add-sqr-sqrt77.4%
Applied egg-rr77.4%
associate-/l/76.8%
Simplified76.8%
*-un-lft-identity76.8%
associate-/l/77.4%
pow1/277.4%
pow1/277.4%
pow-prod-down66.8%
pow1/266.8%
Applied egg-rr66.8%
*-lft-identity66.8%
Simplified66.8%
associate-*r/68.4%
associate-*l/68.4%
div-inv68.4%
metadata-eval68.4%
*-commutative68.4%
unpow-prod-down68.4%
metadata-eval68.4%
clear-num68.4%
un-div-inv68.4%
Applied egg-rr75.3%
Final simplification64.4%
(FPCore (d h l M D) :precision binary64 (if (<= l 1.25e-276) (* (- d) (sqrt (/ (/ 1.0 h) l))) (/ d (* (sqrt l) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 1.25e-276) {
tmp = -d * sqrt(((1.0 / h) / l));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 1.25d-276) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 1.25e-276) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 1.25e-276: tmp = -d * math.sqrt(((1.0 / h) / l)) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 1.25e-276) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 1.25e-276) tmp = -d * sqrt(((1.0 / h) / l)); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 1.25e-276], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.25 \cdot 10^{-276}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < 1.24999999999999992e-276Initial program 65.6%
Simplified65.6%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt49.3%
neg-mul-149.3%
Simplified49.3%
if 1.24999999999999992e-276 < l Initial program 62.3%
Simplified64.2%
sqrt-div76.8%
sqrt-div79.4%
frac-times79.4%
add-sqr-sqrt79.4%
Applied egg-rr79.4%
associate-/l/78.7%
Simplified78.7%
Taylor expanded in d around inf 46.8%
unpow-146.8%
metadata-eval46.8%
pow-sqr46.8%
rem-sqrt-square46.8%
rem-square-sqrt46.7%
fabs-sqr46.7%
rem-square-sqrt46.8%
Simplified46.8%
metadata-eval46.8%
pow-flip46.8%
pow1/246.8%
div-inv46.8%
sqrt-prod56.0%
associate-/l/53.7%
Applied egg-rr53.7%
associate-/l/56.0%
Simplified56.0%
Final simplification52.2%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (sqrt (/ (/ 1.0 h) l)))) (if (<= l 3.6e-255) (* (- d) t_0) (* d t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(((1.0 / h) / l));
double tmp;
if (l <= 3.6e-255) {
tmp = -d * t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt(((1.0d0 / h) / l))
if (l <= 3.6d-255) then
tmp = -d * t_0
else
tmp = d * t_0
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(((1.0 / h) / l));
double tmp;
if (l <= 3.6e-255) {
tmp = -d * t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(((1.0 / h) / l)) tmp = 0 if l <= 3.6e-255: tmp = -d * t_0 else: tmp = d * t_0 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(Float64(1.0 / h) / l)) tmp = 0.0 if (l <= 3.6e-255) tmp = Float64(Float64(-d) * t_0); else tmp = Float64(d * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(((1.0 / h) / l)); tmp = 0.0; if (l <= 3.6e-255) tmp = -d * t_0; else tmp = d * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, 3.6e-255], N[((-d) * t$95$0), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{if}\;\ell \leq 3.6 \cdot 10^{-255}:\\
\;\;\;\;\left(-d\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot t\_0\\
\end{array}
\end{array}
if l < 3.6000000000000002e-255Initial program 66.3%
Simplified66.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt48.7%
neg-mul-148.7%
Simplified48.7%
if 3.6000000000000002e-255 < l Initial program 61.2%
Simplified63.1%
Taylor expanded in d around inf 47.5%
associate-/r*48.2%
Simplified48.2%
Final simplification48.5%
(FPCore (d h l M D) :precision binary64 (if (<= l 5.6e-255) (* (- d) (sqrt (/ 1.0 (* l h)))) (* d (sqrt (/ (/ 1.0 h) l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 5.6e-255) {
tmp = -d * sqrt((1.0 / (l * h)));
} else {
tmp = d * sqrt(((1.0 / h) / l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 5.6d-255) then
tmp = -d * sqrt((1.0d0 / (l * h)))
else
tmp = d * sqrt(((1.0d0 / h) / l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 5.6e-255) {
tmp = -d * Math.sqrt((1.0 / (l * h)));
} else {
tmp = d * Math.sqrt(((1.0 / h) / l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 5.6e-255: tmp = -d * math.sqrt((1.0 / (l * h))) else: tmp = d * math.sqrt(((1.0 / h) / l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 5.6e-255) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 5.6e-255) tmp = -d * sqrt((1.0 / (l * h))); else tmp = d * sqrt(((1.0 / h) / l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 5.6e-255], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 5.6 \cdot 10^{-255}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\end{array}
\end{array}
if l < 5.60000000000000023e-255Initial program 66.3%
Simplified66.3%
sqrt-div8.1%
sqrt-div8.1%
frac-times8.1%
add-sqr-sqrt8.1%
Applied egg-rr8.1%
associate-/l/8.1%
Simplified8.1%
Taylor expanded in d around inf 11.8%
unpow-111.8%
metadata-eval11.8%
pow-sqr11.8%
rem-sqrt-square11.1%
rem-square-sqrt11.1%
fabs-sqr11.1%
rem-square-sqrt11.1%
Simplified11.1%
Taylor expanded in h around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt48.2%
mul-1-neg48.2%
Simplified48.2%
if 5.60000000000000023e-255 < l Initial program 61.2%
Simplified63.1%
Taylor expanded in d around inf 47.5%
associate-/r*48.2%
Simplified48.2%
Final simplification48.2%
(FPCore (d h l M D) :precision binary64 (if (<= l 3.05e-256) (* (- d) (pow (* l h) -0.5)) (* d (sqrt (/ (/ 1.0 h) l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3.05e-256) {
tmp = -d * pow((l * h), -0.5);
} else {
tmp = d * sqrt(((1.0 / h) / l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 3.05d-256) then
tmp = -d * ((l * h) ** (-0.5d0))
else
tmp = d * sqrt(((1.0d0 / h) / l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3.05e-256) {
tmp = -d * Math.pow((l * h), -0.5);
} else {
tmp = d * Math.sqrt(((1.0 / h) / l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 3.05e-256: tmp = -d * math.pow((l * h), -0.5) else: tmp = d * math.sqrt(((1.0 / h) / l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 3.05e-256) tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 3.05e-256) tmp = -d * ((l * h) ^ -0.5); else tmp = d * sqrt(((1.0 / h) / l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 3.05e-256], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.05 \cdot 10^{-256}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\end{array}
\end{array}
if l < 3.05000000000000012e-256Initial program 66.3%
Simplified66.3%
Taylor expanded in d around inf 11.8%
Taylor expanded in h around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt48.2%
mul-1-neg48.2%
unpow-148.2%
metadata-eval48.2%
pow-sqr48.3%
rem-sqrt-square47.6%
rem-square-sqrt47.4%
fabs-sqr47.4%
rem-square-sqrt47.6%
Simplified47.6%
if 3.05000000000000012e-256 < l Initial program 61.2%
Simplified63.1%
Taylor expanded in d around inf 47.5%
associate-/r*48.2%
Simplified48.2%
Final simplification47.9%
(FPCore (d h l M D) :precision binary64 (if (<= l 2.4e-255) (* (- d) (pow (* l h) -0.5)) (/ d (sqrt (* l h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 2.4e-255) {
tmp = -d * pow((l * h), -0.5);
} else {
tmp = d / sqrt((l * h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 2.4d-255) then
tmp = -d * ((l * h) ** (-0.5d0))
else
tmp = d / sqrt((l * h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 2.4e-255) {
tmp = -d * Math.pow((l * h), -0.5);
} else {
tmp = d / Math.sqrt((l * h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 2.4e-255: tmp = -d * math.pow((l * h), -0.5) else: tmp = d / math.sqrt((l * h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 2.4e-255) tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); else tmp = Float64(d / sqrt(Float64(l * h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 2.4e-255) tmp = -d * ((l * h) ^ -0.5); else tmp = d / sqrt((l * h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 2.4e-255], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.4 \cdot 10^{-255}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < 2.3999999999999998e-255Initial program 66.3%
Simplified66.3%
Taylor expanded in d around inf 11.8%
Taylor expanded in h around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt48.2%
mul-1-neg48.2%
unpow-148.2%
metadata-eval48.2%
pow-sqr48.3%
rem-sqrt-square47.6%
rem-square-sqrt47.4%
fabs-sqr47.4%
rem-square-sqrt47.6%
Simplified47.6%
if 2.3999999999999998e-255 < l Initial program 61.2%
Simplified63.1%
sqrt-div76.4%
sqrt-div79.2%
frac-times79.1%
add-sqr-sqrt79.2%
Applied egg-rr79.2%
associate-/l/78.4%
Simplified78.4%
Taylor expanded in d around inf 47.5%
unpow-147.5%
metadata-eval47.5%
pow-sqr47.5%
rem-sqrt-square47.5%
rem-square-sqrt47.4%
fabs-sqr47.4%
rem-square-sqrt47.5%
Simplified47.5%
metadata-eval47.5%
pow-flip47.5%
pow1/247.5%
div-inv47.6%
Applied egg-rr47.6%
Final simplification47.6%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* l h))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((l * h));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d / sqrt((l * h))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((l * h));
}
def code(d, h, l, M, D): return d / math.sqrt((l * h))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(l * h))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((l * h)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 64.2%
Simplified65.0%
sqrt-div36.7%
sqrt-div37.8%
frac-times37.8%
add-sqr-sqrt37.8%
Applied egg-rr37.8%
associate-/l/37.5%
Simplified37.5%
Taylor expanded in d around inf 26.7%
unpow-126.7%
metadata-eval26.7%
pow-sqr26.7%
rem-sqrt-square26.3%
rem-square-sqrt26.3%
fabs-sqr26.3%
rem-square-sqrt26.3%
Simplified26.3%
metadata-eval26.3%
pow-flip26.3%
pow1/226.3%
div-inv26.4%
Applied egg-rr26.4%
Final simplification26.4%
herbie shell --seed 2024139
(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)))))