
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d))) (t_1 (/ M (/ d D))))
(if (<= d -4e-311)
(*
(/ t_0 (sqrt (- h)))
(*
(/ t_0 (sqrt (- l)))
(- 1.0 (* h (* 0.125 (/ (pow (* M (/ D d)) 2.0) l))))))
(*
(/ (sqrt d) (sqrt h))
(* (/ 1.0 (sqrt (/ l d))) (- 1.0 (* h (* 0.125 (* t_1 (/ t_1 l))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double t_1 = M / (d / D);
double tmp;
if (d <= -4e-311) {
tmp = (t_0 / sqrt(-h)) * ((t_0 / sqrt(-l)) * (1.0 - (h * (0.125 * (pow((M * (D / d)), 2.0) / l)))));
} else {
tmp = (sqrt(d) / sqrt(h)) * ((1.0 / sqrt((l / d))) * (1.0 - (h * (0.125 * (t_1 * (t_1 / 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)
t_1 = m / (d / d_1)
if (d <= (-4d-311)) then
tmp = (t_0 / sqrt(-h)) * ((t_0 / sqrt(-l)) * (1.0d0 - (h * (0.125d0 * (((m * (d_1 / d)) ** 2.0d0) / l)))))
else
tmp = (sqrt(d) / sqrt(h)) * ((1.0d0 / sqrt((l / d))) * (1.0d0 - (h * (0.125d0 * (t_1 * (t_1 / l))))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(-d);
double t_1 = M / (d / D);
double tmp;
if (d <= -4e-311) {
tmp = (t_0 / Math.sqrt(-h)) * ((t_0 / Math.sqrt(-l)) * (1.0 - (h * (0.125 * (Math.pow((M * (D / d)), 2.0) / l)))));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * ((1.0 / Math.sqrt((l / d))) * (1.0 - (h * (0.125 * (t_1 * (t_1 / l))))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(-d) t_1 = M / (d / D) tmp = 0 if d <= -4e-311: tmp = (t_0 / math.sqrt(-h)) * ((t_0 / math.sqrt(-l)) * (1.0 - (h * (0.125 * (math.pow((M * (D / d)), 2.0) / l))))) else: tmp = (math.sqrt(d) / math.sqrt(h)) * ((1.0 / math.sqrt((l / d))) * (1.0 - (h * (0.125 * (t_1 * (t_1 / l)))))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) t_1 = Float64(M / Float64(d / D)) tmp = 0.0 if (d <= -4e-311) tmp = Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(Float64(t_0 / sqrt(Float64(-l))) * Float64(1.0 - Float64(h * Float64(0.125 * Float64((Float64(M * Float64(D / d)) ^ 2.0) / l)))))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(Float64(1.0 / sqrt(Float64(l / d))) * Float64(1.0 - Float64(h * Float64(0.125 * Float64(t_1 * Float64(t_1 / l))))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(-d); t_1 = M / (d / D); tmp = 0.0; if (d <= -4e-311) tmp = (t_0 / sqrt(-h)) * ((t_0 / sqrt(-l)) * (1.0 - (h * (0.125 * (((M * (D / d)) ^ 2.0) / l))))); else tmp = (sqrt(d) / sqrt(h)) * ((1.0 / sqrt((l / d))) * (1.0 - (h * (0.125 * (t_1 * (t_1 / l)))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$1 = N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -4e-311], N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(h * N[(0.125 * N[(N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(h * N[(0.125 * N[(t$95$1 * N[(t$95$1 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
t_1 := \frac{M}{\frac{d}{D}}\\
\mathbf{if}\;d \leq -4 \cdot 10^{-311}:\\
\;\;\;\;\frac{t\_0}{\sqrt{-h}} \cdot \left(\frac{t\_0}{\sqrt{-\ell}} \cdot \left(1 - h \cdot \left(0.125 \cdot \frac{{\left(M \cdot \frac{D}{d}\right)}^{2}}{\ell}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - h \cdot \left(0.125 \cdot \left(t\_1 \cdot \frac{t\_1}{\ell}\right)\right)\right)\right)\\
\end{array}
\end{array}
if d < -3.99999999999979e-311Initial program 66.4%
Simplified65.7%
Taylor expanded in h around -inf 43.8%
associate-*r*43.8%
neg-mul-143.8%
sub-neg43.8%
distribute-lft-in43.8%
Simplified68.1%
frac-2neg68.1%
sqrt-div78.0%
Applied egg-rr78.0%
frac-2neg78.0%
sqrt-div92.4%
Applied egg-rr92.4%
if -3.99999999999979e-311 < d Initial program 71.6%
Simplified73.3%
Taylor expanded in h around -inf 48.0%
associate-*r*48.0%
neg-mul-148.0%
sub-neg48.0%
distribute-lft-in48.0%
Simplified75.8%
clear-num75.1%
sqrt-div75.7%
metadata-eval75.7%
Applied egg-rr75.7%
unpow275.7%
*-un-lft-identity75.7%
times-frac77.3%
clear-num77.3%
un-div-inv77.3%
clear-num77.3%
un-div-inv77.3%
Applied egg-rr77.3%
sqrt-div88.4%
Applied egg-rr88.4%
Final simplification90.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ M (/ d D))) (t_1 (sqrt (- d))))
(if (<= d -1.42e-95)
(*
(sqrt (/ d h))
(*
(/ t_1 (sqrt (- l)))
(+ 1.0 (* h (/ (* -0.125 (pow (* D (/ M d)) 2.0)) l)))))
(if (<= d -4e-311)
(*
(sqrt (/ d l))
(*
(/ t_1 (sqrt (- h)))
(+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5)))))
(*
(/ (sqrt d) (sqrt h))
(*
(/ 1.0 (sqrt (/ l d)))
(- 1.0 (* h (* 0.125 (* t_0 (/ t_0 l)))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = M / (d / D);
double t_1 = sqrt(-d);
double tmp;
if (d <= -1.42e-95) {
tmp = sqrt((d / h)) * ((t_1 / sqrt(-l)) * (1.0 + (h * ((-0.125 * pow((D * (M / d)), 2.0)) / l))));
} else if (d <= -4e-311) {
tmp = sqrt((d / l)) * ((t_1 / sqrt(-h)) * (1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5))));
} else {
tmp = (sqrt(d) / sqrt(h)) * ((1.0 / sqrt((l / d))) * (1.0 - (h * (0.125 * (t_0 * (t_0 / l))))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = m / (d / d_1)
t_1 = sqrt(-d)
if (d <= (-1.42d-95)) then
tmp = sqrt((d / h)) * ((t_1 / sqrt(-l)) * (1.0d0 + (h * (((-0.125d0) * ((d_1 * (m / d)) ** 2.0d0)) / l))))
else if (d <= (-4d-311)) then
tmp = sqrt((d / l)) * ((t_1 / sqrt(-h)) * (1.0d0 + ((h / l) * (((d_1 * ((m / 2.0d0) / d)) ** 2.0d0) * (-0.5d0)))))
else
tmp = (sqrt(d) / sqrt(h)) * ((1.0d0 / sqrt((l / d))) * (1.0d0 - (h * (0.125d0 * (t_0 * (t_0 / l))))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = M / (d / D);
double t_1 = Math.sqrt(-d);
double tmp;
if (d <= -1.42e-95) {
tmp = Math.sqrt((d / h)) * ((t_1 / Math.sqrt(-l)) * (1.0 + (h * ((-0.125 * Math.pow((D * (M / d)), 2.0)) / l))));
} else if (d <= -4e-311) {
tmp = Math.sqrt((d / l)) * ((t_1 / Math.sqrt(-h)) * (1.0 + ((h / l) * (Math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * ((1.0 / Math.sqrt((l / d))) * (1.0 - (h * (0.125 * (t_0 * (t_0 / l))))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = M / (d / D) t_1 = math.sqrt(-d) tmp = 0 if d <= -1.42e-95: tmp = math.sqrt((d / h)) * ((t_1 / math.sqrt(-l)) * (1.0 + (h * ((-0.125 * math.pow((D * (M / d)), 2.0)) / l)))) elif d <= -4e-311: tmp = math.sqrt((d / l)) * ((t_1 / math.sqrt(-h)) * (1.0 + ((h / l) * (math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5)))) else: tmp = (math.sqrt(d) / math.sqrt(h)) * ((1.0 / math.sqrt((l / d))) * (1.0 - (h * (0.125 * (t_0 * (t_0 / l)))))) return tmp
function code(d, h, l, M, D) t_0 = Float64(M / Float64(d / D)) t_1 = sqrt(Float64(-d)) tmp = 0.0 if (d <= -1.42e-95) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(t_1 / sqrt(Float64(-l))) * Float64(1.0 + Float64(h * Float64(Float64(-0.125 * (Float64(D * Float64(M / d)) ^ 2.0)) / l))))); elseif (d <= -4e-311) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(t_1 / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(Float64(1.0 / sqrt(Float64(l / d))) * Float64(1.0 - Float64(h * Float64(0.125 * Float64(t_0 * Float64(t_0 / l))))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = M / (d / D); t_1 = sqrt(-d); tmp = 0.0; if (d <= -1.42e-95) tmp = sqrt((d / h)) * ((t_1 / sqrt(-l)) * (1.0 + (h * ((-0.125 * ((D * (M / d)) ^ 2.0)) / l)))); elseif (d <= -4e-311) tmp = sqrt((d / l)) * ((t_1 / sqrt(-h)) * (1.0 + ((h / l) * (((D * ((M / 2.0) / d)) ^ 2.0) * -0.5)))); else tmp = (sqrt(d) / sqrt(h)) * ((1.0 / sqrt((l / d))) * (1.0 - (h * (0.125 * (t_0 * (t_0 / l)))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[d, -1.42e-95], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(h * N[(N[(-0.125 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -4e-311], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$1 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(h * N[(0.125 * N[(t$95$0 * N[(t$95$0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M}{\frac{d}{D}}\\
t_1 := \sqrt{-d}\\
\mathbf{if}\;d \leq -1.42 \cdot 10^{-95}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{t\_1}{\sqrt{-\ell}} \cdot \left(1 + h \cdot \frac{-0.125 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{elif}\;d \leq -4 \cdot 10^{-311}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{t\_1}{\sqrt{-h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - h \cdot \left(0.125 \cdot \left(t\_0 \cdot \frac{t\_0}{\ell}\right)\right)\right)\right)\\
\end{array}
\end{array}
if d < -1.42000000000000007e-95Initial program 78.0%
Simplified76.9%
Taylor expanded in h around -inf 58.9%
associate-*r*58.9%
neg-mul-158.9%
sub-neg58.9%
distribute-lft-in58.9%
Simplified83.0%
frac-2neg83.0%
sqrt-div92.9%
Applied egg-rr92.9%
expm1-log1p-u67.0%
expm1-undefine67.0%
associate-*r*67.0%
Applied egg-rr67.0%
sub-neg67.0%
metadata-eval67.0%
+-commutative67.0%
log1p-undefine67.0%
rem-exp-log92.9%
associate-+r+92.9%
metadata-eval92.9%
associate-*l*92.9%
cancel-sign-sub-inv92.9%
neg-sub092.9%
distribute-rgt-neg-in92.9%
associate-*r/92.9%
distribute-neg-frac92.9%
Simplified92.9%
if -1.42000000000000007e-95 < d < -3.99999999999979e-311Initial program 46.8%
Simplified46.6%
frac-2neg52.6%
sqrt-div82.5%
Applied egg-rr70.8%
if -3.99999999999979e-311 < d Initial program 71.6%
Simplified73.3%
Taylor expanded in h around -inf 48.0%
associate-*r*48.0%
neg-mul-148.0%
sub-neg48.0%
distribute-lft-in48.0%
Simplified75.8%
clear-num75.1%
sqrt-div75.7%
metadata-eval75.7%
Applied egg-rr75.7%
unpow275.7%
*-un-lft-identity75.7%
times-frac77.3%
clear-num77.3%
un-div-inv77.3%
clear-num77.3%
un-div-inv77.3%
Applied egg-rr77.3%
sqrt-div88.4%
Applied egg-rr88.4%
Final simplification86.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d)))
(t_1 (/ M (/ d D)))
(t_2 (- 1.0 (* h (* 0.125 (* t_1 (/ t_1 l)))))))
(if (<= h -1.7e+75)
(*
(/ t_0 (sqrt (- h)))
(* (- 1.0 (* h (* 0.125 (/ (pow (* M (/ D d)) 2.0) l)))) (sqrt (/ d l))))
(if (<= h -1e-311)
(* (sqrt (/ d h)) (* (/ t_0 (sqrt (- l))) t_2))
(* (/ (sqrt d) (sqrt h)) (* (/ 1.0 (sqrt (/ l d))) t_2))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double t_1 = M / (d / D);
double t_2 = 1.0 - (h * (0.125 * (t_1 * (t_1 / l))));
double tmp;
if (h <= -1.7e+75) {
tmp = (t_0 / sqrt(-h)) * ((1.0 - (h * (0.125 * (pow((M * (D / d)), 2.0) / l)))) * sqrt((d / l)));
} else if (h <= -1e-311) {
tmp = sqrt((d / h)) * ((t_0 / sqrt(-l)) * t_2);
} else {
tmp = (sqrt(d) / sqrt(h)) * ((1.0 / sqrt((l / d))) * t_2);
}
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) :: t_2
real(8) :: tmp
t_0 = sqrt(-d)
t_1 = m / (d / d_1)
t_2 = 1.0d0 - (h * (0.125d0 * (t_1 * (t_1 / l))))
if (h <= (-1.7d+75)) then
tmp = (t_0 / sqrt(-h)) * ((1.0d0 - (h * (0.125d0 * (((m * (d_1 / d)) ** 2.0d0) / l)))) * sqrt((d / l)))
else if (h <= (-1d-311)) then
tmp = sqrt((d / h)) * ((t_0 / sqrt(-l)) * t_2)
else
tmp = (sqrt(d) / sqrt(h)) * ((1.0d0 / sqrt((l / d))) * t_2)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(-d);
double t_1 = M / (d / D);
double t_2 = 1.0 - (h * (0.125 * (t_1 * (t_1 / l))));
double tmp;
if (h <= -1.7e+75) {
tmp = (t_0 / Math.sqrt(-h)) * ((1.0 - (h * (0.125 * (Math.pow((M * (D / d)), 2.0) / l)))) * Math.sqrt((d / l)));
} else if (h <= -1e-311) {
tmp = Math.sqrt((d / h)) * ((t_0 / Math.sqrt(-l)) * t_2);
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * ((1.0 / Math.sqrt((l / d))) * t_2);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(-d) t_1 = M / (d / D) t_2 = 1.0 - (h * (0.125 * (t_1 * (t_1 / l)))) tmp = 0 if h <= -1.7e+75: tmp = (t_0 / math.sqrt(-h)) * ((1.0 - (h * (0.125 * (math.pow((M * (D / d)), 2.0) / l)))) * math.sqrt((d / l))) elif h <= -1e-311: tmp = math.sqrt((d / h)) * ((t_0 / math.sqrt(-l)) * t_2) else: tmp = (math.sqrt(d) / math.sqrt(h)) * ((1.0 / math.sqrt((l / d))) * t_2) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) t_1 = Float64(M / Float64(d / D)) t_2 = Float64(1.0 - Float64(h * Float64(0.125 * Float64(t_1 * Float64(t_1 / l))))) tmp = 0.0 if (h <= -1.7e+75) tmp = Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(Float64(1.0 - Float64(h * Float64(0.125 * Float64((Float64(M * Float64(D / d)) ^ 2.0) / l)))) * sqrt(Float64(d / l)))); elseif (h <= -1e-311) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(t_0 / sqrt(Float64(-l))) * t_2)); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(Float64(1.0 / sqrt(Float64(l / d))) * t_2)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(-d); t_1 = M / (d / D); t_2 = 1.0 - (h * (0.125 * (t_1 * (t_1 / l)))); tmp = 0.0; if (h <= -1.7e+75) tmp = (t_0 / sqrt(-h)) * ((1.0 - (h * (0.125 * (((M * (D / d)) ^ 2.0) / l)))) * sqrt((d / l))); elseif (h <= -1e-311) tmp = sqrt((d / h)) * ((t_0 / sqrt(-l)) * t_2); else tmp = (sqrt(d) / sqrt(h)) * ((1.0 / sqrt((l / d))) * t_2); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$1 = N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[(h * N[(0.125 * N[(t$95$1 * N[(t$95$1 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -1.7e+75], N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - N[(h * N[(0.125 * N[(N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-311], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
t_1 := \frac{M}{\frac{d}{D}}\\
t_2 := 1 - h \cdot \left(0.125 \cdot \left(t\_1 \cdot \frac{t\_1}{\ell}\right)\right)\\
\mathbf{if}\;h \leq -1.7 \cdot 10^{+75}:\\
\;\;\;\;\frac{t\_0}{\sqrt{-h}} \cdot \left(\left(1 - h \cdot \left(0.125 \cdot \frac{{\left(M \cdot \frac{D}{d}\right)}^{2}}{\ell}\right)\right) \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-311}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{t\_0}{\sqrt{-\ell}} \cdot t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot t\_2\right)\\
\end{array}
\end{array}
if h < -1.70000000000000006e75Initial program 50.1%
Simplified48.4%
Taylor expanded in h around -inf 40.2%
associate-*r*40.2%
neg-mul-140.2%
sub-neg40.2%
distribute-lft-in40.2%
Simplified54.4%
frac-2neg63.7%
sqrt-div92.3%
Applied egg-rr77.5%
if -1.70000000000000006e75 < h < -9.99999999999948e-312Initial program 76.6%
Simplified76.5%
Taylor expanded in h around -inf 46.1%
associate-*r*46.1%
neg-mul-146.1%
sub-neg46.1%
distribute-lft-in46.1%
Simplified76.7%
frac-2neg76.7%
sqrt-div86.9%
Applied egg-rr86.9%
unpow276.6%
*-un-lft-identity76.6%
times-frac76.7%
clear-num76.7%
un-div-inv76.8%
clear-num76.8%
un-div-inv76.8%
Applied egg-rr88.1%
if -9.99999999999948e-312 < h Initial program 71.6%
Simplified73.3%
Taylor expanded in h around -inf 48.0%
associate-*r*48.0%
neg-mul-148.0%
sub-neg48.0%
distribute-lft-in48.0%
Simplified75.8%
clear-num75.1%
sqrt-div75.7%
metadata-eval75.7%
Applied egg-rr75.7%
unpow275.7%
*-un-lft-identity75.7%
times-frac77.3%
clear-num77.3%
un-div-inv77.3%
clear-num77.3%
un-div-inv77.3%
Applied egg-rr77.3%
sqrt-div88.4%
Applied egg-rr88.4%
Final simplification86.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d)))
(t_1 (/ M (/ d D)))
(t_2 (- 1.0 (* h (* 0.125 (* t_1 (/ t_1 l))))))
(t_3 (* (/ 1.0 (sqrt (/ l d))) t_2)))
(if (<= h -2.6e+68)
(* (/ t_0 (sqrt (- h))) t_3)
(if (<= h -1e-311)
(* (sqrt (/ d h)) (* (/ t_0 (sqrt (- l))) t_2))
(* (/ (sqrt d) (sqrt h)) t_3)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double t_1 = M / (d / D);
double t_2 = 1.0 - (h * (0.125 * (t_1 * (t_1 / l))));
double t_3 = (1.0 / sqrt((l / d))) * t_2;
double tmp;
if (h <= -2.6e+68) {
tmp = (t_0 / sqrt(-h)) * t_3;
} else if (h <= -1e-311) {
tmp = sqrt((d / h)) * ((t_0 / sqrt(-l)) * t_2);
} else {
tmp = (sqrt(d) / sqrt(h)) * t_3;
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = sqrt(-d)
t_1 = m / (d / d_1)
t_2 = 1.0d0 - (h * (0.125d0 * (t_1 * (t_1 / l))))
t_3 = (1.0d0 / sqrt((l / d))) * t_2
if (h <= (-2.6d+68)) then
tmp = (t_0 / sqrt(-h)) * t_3
else if (h <= (-1d-311)) then
tmp = sqrt((d / h)) * ((t_0 / sqrt(-l)) * t_2)
else
tmp = (sqrt(d) / sqrt(h)) * t_3
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(-d);
double t_1 = M / (d / D);
double t_2 = 1.0 - (h * (0.125 * (t_1 * (t_1 / l))));
double t_3 = (1.0 / Math.sqrt((l / d))) * t_2;
double tmp;
if (h <= -2.6e+68) {
tmp = (t_0 / Math.sqrt(-h)) * t_3;
} else if (h <= -1e-311) {
tmp = Math.sqrt((d / h)) * ((t_0 / Math.sqrt(-l)) * t_2);
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * t_3;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(-d) t_1 = M / (d / D) t_2 = 1.0 - (h * (0.125 * (t_1 * (t_1 / l)))) t_3 = (1.0 / math.sqrt((l / d))) * t_2 tmp = 0 if h <= -2.6e+68: tmp = (t_0 / math.sqrt(-h)) * t_3 elif h <= -1e-311: tmp = math.sqrt((d / h)) * ((t_0 / math.sqrt(-l)) * t_2) else: tmp = (math.sqrt(d) / math.sqrt(h)) * t_3 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) t_1 = Float64(M / Float64(d / D)) t_2 = Float64(1.0 - Float64(h * Float64(0.125 * Float64(t_1 * Float64(t_1 / l))))) t_3 = Float64(Float64(1.0 / sqrt(Float64(l / d))) * t_2) tmp = 0.0 if (h <= -2.6e+68) tmp = Float64(Float64(t_0 / sqrt(Float64(-h))) * t_3); elseif (h <= -1e-311) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(t_0 / sqrt(Float64(-l))) * t_2)); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * t_3); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(-d); t_1 = M / (d / D); t_2 = 1.0 - (h * (0.125 * (t_1 * (t_1 / l)))); t_3 = (1.0 / sqrt((l / d))) * t_2; tmp = 0.0; if (h <= -2.6e+68) tmp = (t_0 / sqrt(-h)) * t_3; elseif (h <= -1e-311) tmp = sqrt((d / h)) * ((t_0 / sqrt(-l)) * t_2); else tmp = (sqrt(d) / sqrt(h)) * t_3; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$1 = N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[(h * N[(0.125 * N[(t$95$1 * N[(t$95$1 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]}, If[LessEqual[h, -2.6e+68], N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[h, -1e-311], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
t_1 := \frac{M}{\frac{d}{D}}\\
t_2 := 1 - h \cdot \left(0.125 \cdot \left(t\_1 \cdot \frac{t\_1}{\ell}\right)\right)\\
t_3 := \frac{1}{\sqrt{\frac{\ell}{d}}} \cdot t\_2\\
\mathbf{if}\;h \leq -2.6 \cdot 10^{+68}:\\
\;\;\;\;\frac{t\_0}{\sqrt{-h}} \cdot t\_3\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-311}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{t\_0}{\sqrt{-\ell}} \cdot t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot t\_3\\
\end{array}
\end{array}
if h < -2.5999999999999998e68Initial program 51.1%
Simplified49.3%
Taylor expanded in h around -inf 39.5%
associate-*r*39.5%
neg-mul-139.5%
sub-neg39.5%
distribute-lft-in39.5%
Simplified55.2%
clear-num55.2%
sqrt-div56.1%
metadata-eval56.1%
Applied egg-rr56.1%
unpow256.1%
*-un-lft-identity56.1%
times-frac56.1%
clear-num56.1%
un-div-inv56.1%
clear-num56.1%
un-div-inv56.1%
Applied egg-rr56.1%
frac-2neg64.3%
sqrt-div92.5%
Applied egg-rr76.9%
if -2.5999999999999998e68 < h < -9.99999999999948e-312Initial program 76.3%
Simplified76.3%
Taylor expanded in h around -inf 46.7%
associate-*r*46.7%
neg-mul-146.7%
sub-neg46.7%
distribute-lft-in46.7%
Simplified76.4%
frac-2neg76.4%
sqrt-div86.8%
Applied egg-rr86.8%
unpow276.4%
*-un-lft-identity76.4%
times-frac76.4%
clear-num76.4%
un-div-inv76.5%
clear-num76.5%
un-div-inv76.5%
Applied egg-rr87.9%
if -9.99999999999948e-312 < h Initial program 71.6%
Simplified73.3%
Taylor expanded in h around -inf 48.0%
associate-*r*48.0%
neg-mul-148.0%
sub-neg48.0%
distribute-lft-in48.0%
Simplified75.8%
clear-num75.1%
sqrt-div75.7%
metadata-eval75.7%
Applied egg-rr75.7%
unpow275.7%
*-un-lft-identity75.7%
times-frac77.3%
clear-num77.3%
un-div-inv77.3%
clear-num77.3%
un-div-inv77.3%
Applied egg-rr77.3%
sqrt-div88.4%
Applied egg-rr88.4%
Final simplification85.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ M (/ d D))) (t_1 (- 1.0 (* h (* 0.125 (* t_0 (/ t_0 l)))))))
(if (<= h -1e-311)
(* (sqrt (/ d h)) (* (/ (sqrt (- d)) (sqrt (- l))) t_1))
(* (/ (sqrt d) (sqrt h)) (* (/ 1.0 (sqrt (/ l d))) t_1)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = M / (d / D);
double t_1 = 1.0 - (h * (0.125 * (t_0 * (t_0 / l))));
double tmp;
if (h <= -1e-311) {
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * t_1);
} else {
tmp = (sqrt(d) / sqrt(h)) * ((1.0 / sqrt((l / d))) * t_1);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = m / (d / d_1)
t_1 = 1.0d0 - (h * (0.125d0 * (t_0 * (t_0 / l))))
if (h <= (-1d-311)) then
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * t_1)
else
tmp = (sqrt(d) / sqrt(h)) * ((1.0d0 / sqrt((l / d))) * t_1)
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 t_1 = 1.0 - (h * (0.125 * (t_0 * (t_0 / l))));
double tmp;
if (h <= -1e-311) {
tmp = Math.sqrt((d / h)) * ((Math.sqrt(-d) / Math.sqrt(-l)) * t_1);
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * ((1.0 / Math.sqrt((l / d))) * t_1);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = M / (d / D) t_1 = 1.0 - (h * (0.125 * (t_0 * (t_0 / l)))) tmp = 0 if h <= -1e-311: tmp = math.sqrt((d / h)) * ((math.sqrt(-d) / math.sqrt(-l)) * t_1) else: tmp = (math.sqrt(d) / math.sqrt(h)) * ((1.0 / math.sqrt((l / d))) * t_1) return tmp
function code(d, h, l, M, D) t_0 = Float64(M / Float64(d / D)) t_1 = Float64(1.0 - Float64(h * Float64(0.125 * Float64(t_0 * Float64(t_0 / l))))) tmp = 0.0 if (h <= -1e-311) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * t_1)); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(Float64(1.0 / sqrt(Float64(l / d))) * t_1)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = M / (d / D); t_1 = 1.0 - (h * (0.125 * (t_0 * (t_0 / l)))); tmp = 0.0; if (h <= -1e-311) tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * t_1); else tmp = (sqrt(d) / sqrt(h)) * ((1.0 / sqrt((l / d))) * t_1); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - N[(h * N[(0.125 * N[(t$95$0 * N[(t$95$0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -1e-311], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M}{\frac{d}{D}}\\
t_1 := 1 - h \cdot \left(0.125 \cdot \left(t\_0 \cdot \frac{t\_0}{\ell}\right)\right)\\
\mathbf{if}\;h \leq -1 \cdot 10^{-311}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot t\_1\right)\\
\end{array}
\end{array}
if h < -9.99999999999948e-312Initial program 66.4%
Simplified65.7%
Taylor expanded in h around -inf 43.8%
associate-*r*43.8%
neg-mul-143.8%
sub-neg43.8%
distribute-lft-in43.8%
Simplified68.1%
frac-2neg68.1%
sqrt-div78.0%
Applied egg-rr78.0%
unpow268.4%
*-un-lft-identity68.4%
times-frac68.5%
clear-num68.5%
un-div-inv68.5%
clear-num68.5%
un-div-inv68.5%
Applied egg-rr78.7%
if -9.99999999999948e-312 < h Initial program 71.6%
Simplified73.3%
Taylor expanded in h around -inf 48.0%
associate-*r*48.0%
neg-mul-148.0%
sub-neg48.0%
distribute-lft-in48.0%
Simplified75.8%
clear-num75.1%
sqrt-div75.7%
metadata-eval75.7%
Applied egg-rr75.7%
unpow275.7%
*-un-lft-identity75.7%
times-frac77.3%
clear-num77.3%
un-div-inv77.3%
clear-num77.3%
un-div-inv77.3%
Applied egg-rr77.3%
sqrt-div88.4%
Applied egg-rr88.4%
Final simplification83.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h)))
(t_1 (/ M (/ d D)))
(t_2 (- 1.0 (* h (* 0.125 (* t_1 (/ t_1 l)))))))
(if (<= l -4e-310)
(* t_0 (* (/ (sqrt (- d)) (sqrt (- l))) t_2))
(* t_0 (* t_2 (/ 1.0 (/ (sqrt l) (sqrt d))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = M / (d / D);
double t_2 = 1.0 - (h * (0.125 * (t_1 * (t_1 / l))));
double tmp;
if (l <= -4e-310) {
tmp = t_0 * ((sqrt(-d) / sqrt(-l)) * t_2);
} else {
tmp = t_0 * (t_2 * (1.0 / (sqrt(l) / sqrt(d))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = sqrt((d / h))
t_1 = m / (d / d_1)
t_2 = 1.0d0 - (h * (0.125d0 * (t_1 * (t_1 / l))))
if (l <= (-4d-310)) then
tmp = t_0 * ((sqrt(-d) / sqrt(-l)) * t_2)
else
tmp = t_0 * (t_2 * (1.0d0 / (sqrt(l) / sqrt(d))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h));
double t_1 = M / (d / D);
double t_2 = 1.0 - (h * (0.125 * (t_1 * (t_1 / l))));
double tmp;
if (l <= -4e-310) {
tmp = t_0 * ((Math.sqrt(-d) / Math.sqrt(-l)) * t_2);
} else {
tmp = t_0 * (t_2 * (1.0 / (Math.sqrt(l) / Math.sqrt(d))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) t_1 = M / (d / D) t_2 = 1.0 - (h * (0.125 * (t_1 * (t_1 / l)))) tmp = 0 if l <= -4e-310: tmp = t_0 * ((math.sqrt(-d) / math.sqrt(-l)) * t_2) else: tmp = t_0 * (t_2 * (1.0 / (math.sqrt(l) / math.sqrt(d)))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = Float64(M / Float64(d / D)) t_2 = Float64(1.0 - Float64(h * Float64(0.125 * Float64(t_1 * Float64(t_1 / l))))) tmp = 0.0 if (l <= -4e-310) tmp = Float64(t_0 * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * t_2)); else tmp = Float64(t_0 * Float64(t_2 * Float64(1.0 / Float64(sqrt(l) / sqrt(d))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)); t_1 = M / (d / D); t_2 = 1.0 - (h * (0.125 * (t_1 * (t_1 / l)))); tmp = 0.0; if (l <= -4e-310) tmp = t_0 * ((sqrt(-d) / sqrt(-l)) * t_2); else tmp = t_0 * (t_2 * (1.0 / (sqrt(l) / sqrt(d)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[(h * N[(0.125 * N[(t$95$1 * N[(t$95$1 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -4e-310], N[(t$95$0 * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(t$95$2 * N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[d], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \frac{M}{\frac{d}{D}}\\
t_2 := 1 - h \cdot \left(0.125 \cdot \left(t\_1 \cdot \frac{t\_1}{\ell}\right)\right)\\
\mathbf{if}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;t\_0 \cdot \left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(t\_2 \cdot \frac{1}{\frac{\sqrt{\ell}}{\sqrt{d}}}\right)\\
\end{array}
\end{array}
if l < -3.999999999999988e-310Initial program 66.4%
Simplified65.7%
Taylor expanded in h around -inf 43.8%
associate-*r*43.8%
neg-mul-143.8%
sub-neg43.8%
distribute-lft-in43.8%
Simplified68.1%
frac-2neg68.1%
sqrt-div78.0%
Applied egg-rr78.0%
unpow268.4%
*-un-lft-identity68.4%
times-frac68.5%
clear-num68.5%
un-div-inv68.5%
clear-num68.5%
un-div-inv68.5%
Applied egg-rr78.7%
if -3.999999999999988e-310 < l Initial program 71.6%
Simplified73.3%
Taylor expanded in h around -inf 48.0%
associate-*r*48.0%
neg-mul-148.0%
sub-neg48.0%
distribute-lft-in48.0%
Simplified75.8%
clear-num75.1%
sqrt-div75.7%
metadata-eval75.7%
Applied egg-rr75.7%
unpow275.7%
*-un-lft-identity75.7%
times-frac77.3%
clear-num77.3%
un-div-inv77.3%
clear-num77.3%
un-div-inv77.3%
Applied egg-rr77.3%
sqrt-div84.4%
Applied egg-rr84.4%
Final simplification81.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ M (/ d D))) (t_1 (sqrt (/ d h))))
(if (<= h 1.05e-211)
(*
(sqrt (/ d l))
(* t_1 (+ 1.0 (/ (* (* h -0.5) (pow (* D (/ M (* d 2.0))) 2.0)) l))))
(*
t_1
(*
(- 1.0 (* h (* 0.125 (* t_0 (/ t_0 l)))))
(/ 1.0 (/ (sqrt l) (sqrt d))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = M / (d / D);
double t_1 = sqrt((d / h));
double tmp;
if (h <= 1.05e-211) {
tmp = sqrt((d / l)) * (t_1 * (1.0 + (((h * -0.5) * pow((D * (M / (d * 2.0))), 2.0)) / l)));
} else {
tmp = t_1 * ((1.0 - (h * (0.125 * (t_0 * (t_0 / l))))) * (1.0 / (sqrt(l) / sqrt(d))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = m / (d / d_1)
t_1 = sqrt((d / h))
if (h <= 1.05d-211) then
tmp = sqrt((d / l)) * (t_1 * (1.0d0 + (((h * (-0.5d0)) * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l)))
else
tmp = t_1 * ((1.0d0 - (h * (0.125d0 * (t_0 * (t_0 / l))))) * (1.0d0 / (sqrt(l) / sqrt(d))))
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 t_1 = Math.sqrt((d / h));
double tmp;
if (h <= 1.05e-211) {
tmp = Math.sqrt((d / l)) * (t_1 * (1.0 + (((h * -0.5) * Math.pow((D * (M / (d * 2.0))), 2.0)) / l)));
} else {
tmp = t_1 * ((1.0 - (h * (0.125 * (t_0 * (t_0 / l))))) * (1.0 / (Math.sqrt(l) / Math.sqrt(d))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = M / (d / D) t_1 = math.sqrt((d / h)) tmp = 0 if h <= 1.05e-211: tmp = math.sqrt((d / l)) * (t_1 * (1.0 + (((h * -0.5) * math.pow((D * (M / (d * 2.0))), 2.0)) / l))) else: tmp = t_1 * ((1.0 - (h * (0.125 * (t_0 * (t_0 / l))))) * (1.0 / (math.sqrt(l) / math.sqrt(d)))) return tmp
function code(d, h, l, M, D) t_0 = Float64(M / Float64(d / D)) t_1 = sqrt(Float64(d / h)) tmp = 0.0 if (h <= 1.05e-211) tmp = Float64(sqrt(Float64(d / l)) * Float64(t_1 * Float64(1.0 + Float64(Float64(Float64(h * -0.5) * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l)))); else tmp = Float64(t_1 * Float64(Float64(1.0 - Float64(h * Float64(0.125 * Float64(t_0 * Float64(t_0 / l))))) * Float64(1.0 / Float64(sqrt(l) / sqrt(d))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = M / (d / D); t_1 = sqrt((d / h)); tmp = 0.0; if (h <= 1.05e-211) tmp = sqrt((d / l)) * (t_1 * (1.0 + (((h * -0.5) * ((D * (M / (d * 2.0))) ^ 2.0)) / l))); else tmp = t_1 * ((1.0 - (h * (0.125 * (t_0 * (t_0 / l))))) * (1.0 / (sqrt(l) / sqrt(d)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, 1.05e-211], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[(1.0 + N[(N[(N[(h * -0.5), $MachinePrecision] * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(1.0 - N[(h * N[(0.125 * N[(t$95$0 * N[(t$95$0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[d], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M}{\frac{d}{D}}\\
t_1 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;h \leq 1.05 \cdot 10^{-211}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(t\_1 \cdot \left(1 + \frac{\left(h \cdot -0.5\right) \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(\left(1 - h \cdot \left(0.125 \cdot \left(t\_0 \cdot \frac{t\_0}{\ell}\right)\right)\right) \cdot \frac{1}{\frac{\sqrt{\ell}}{\sqrt{d}}}\right)\\
\end{array}
\end{array}
if h < 1.05000000000000004e-211Initial program 66.6%
Simplified66.6%
associate-*l/70.0%
*-commutative70.0%
associate-/l/70.0%
Applied egg-rr70.0%
associate-*r*70.0%
*-commutative70.0%
Simplified70.0%
if 1.05000000000000004e-211 < h Initial program 72.0%
Simplified74.8%
Taylor expanded in h around -inf 47.9%
associate-*r*47.9%
neg-mul-147.9%
sub-neg47.9%
distribute-lft-in47.9%
Simplified77.7%
clear-num76.9%
sqrt-div77.6%
metadata-eval77.6%
Applied egg-rr77.6%
unpow277.6%
*-un-lft-identity77.6%
times-frac79.4%
clear-num79.5%
un-div-inv79.5%
clear-num79.4%
un-div-inv79.4%
Applied egg-rr79.4%
sqrt-div86.6%
Applied egg-rr86.6%
Final simplification76.9%
(FPCore (d h l M D) :precision binary64 (* (sqrt (/ d l)) (* (sqrt (/ d h)) (+ 1.0 (/ (* (* h -0.5) (pow (* D (/ M (* d 2.0))) 2.0)) l)))))
double code(double d, double h, double l, double M, double D) {
return sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (((h * -0.5) * pow((D * (M / (d * 2.0))), 2.0)) / 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 = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + (((h * (-0.5d0)) * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + (((h * -0.5) * Math.pow((D * (M / (d * 2.0))), 2.0)) / l)));
}
def code(d, h, l, M, D): return math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + (((h * -0.5) * math.pow((D * (M / (d * 2.0))), 2.0)) / l)))
function code(d, h, l, M, D) return Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(Float64(h * -0.5) * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l)))) end
function tmp = code(d, h, l, M, D) tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (((h * -0.5) * ((D * (M / (d * 2.0))) ^ 2.0)) / l))); end
code[d_, h_, l_, M_, D_] := N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(N[(h * -0.5), $MachinePrecision] * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{\left(h \cdot -0.5\right) \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right)\right)
\end{array}
Initial program 68.9%
Simplified70.0%
associate-*l/72.8%
*-commutative72.8%
associate-/l/72.8%
Applied egg-rr72.8%
associate-*r*72.8%
*-commutative72.8%
Simplified72.8%
Final simplification72.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ M (/ d D))))
(*
(sqrt (/ d h))
(*
(/ 1.0 (sqrt (/ l d)))
(+ 1.0 (* h (* 0.125 (* t_0 (* t_0 (/ -1.0 l))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = M / (d / D);
return sqrt((d / h)) * ((1.0 / sqrt((l / d))) * (1.0 + (h * (0.125 * (t_0 * (t_0 * (-1.0 / 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
real(8) :: t_0
t_0 = m / (d / d_1)
code = sqrt((d / h)) * ((1.0d0 / sqrt((l / d))) * (1.0d0 + (h * (0.125d0 * (t_0 * (t_0 * ((-1.0d0) / l)))))))
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = M / (d / D);
return Math.sqrt((d / h)) * ((1.0 / Math.sqrt((l / d))) * (1.0 + (h * (0.125 * (t_0 * (t_0 * (-1.0 / l)))))));
}
def code(d, h, l, M, D): t_0 = M / (d / D) return math.sqrt((d / h)) * ((1.0 / math.sqrt((l / d))) * (1.0 + (h * (0.125 * (t_0 * (t_0 * (-1.0 / l)))))))
function code(d, h, l, M, D) t_0 = Float64(M / Float64(d / D)) return Float64(sqrt(Float64(d / h)) * Float64(Float64(1.0 / sqrt(Float64(l / d))) * Float64(1.0 + Float64(h * Float64(0.125 * Float64(t_0 * Float64(t_0 * Float64(-1.0 / l)))))))) end
function tmp = code(d, h, l, M, D) t_0 = M / (d / D); tmp = sqrt((d / h)) * ((1.0 / sqrt((l / d))) * (1.0 + (h * (0.125 * (t_0 * (t_0 * (-1.0 / l))))))); end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision]}, N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(h * N[(0.125 * N[(t$95$0 * N[(t$95$0 * N[(-1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M}{\frac{d}{D}}\\
\sqrt{\frac{d}{h}} \cdot \left(\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 + h \cdot \left(0.125 \cdot \left(t\_0 \cdot \left(t\_0 \cdot \frac{-1}{\ell}\right)\right)\right)\right)\right)
\end{array}
\end{array}
Initial program 68.9%
Simplified69.3%
Taylor expanded in h around -inf 45.8%
associate-*r*45.8%
neg-mul-145.8%
sub-neg45.8%
distribute-lft-in45.8%
Simplified71.8%
clear-num71.4%
sqrt-div71.9%
metadata-eval71.9%
Applied egg-rr71.9%
div-inv71.8%
unpow271.8%
associate-*l*72.6%
clear-num72.6%
un-div-inv72.6%
clear-num72.6%
un-div-inv72.6%
Applied egg-rr72.6%
Final simplification72.6%
(FPCore (d h l M D)
:precision binary64
(if (<= D 9.5e+80)
(fabs (/ d (sqrt (* h l))))
(*
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ D d) (/ M 2.0)) 2.0))))
(sqrt (* (/ d h) (/ d l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 9.5e+80) {
tmp = fabs((d / sqrt((h * l))));
} else {
tmp = (1.0 - (0.5 * ((h / l) * pow(((D / d) * (M / 2.0)), 2.0)))) * sqrt(((d / h) * (d / l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 9.5d+80) then
tmp = abs((d / sqrt((h * l))))
else
tmp = (1.0d0 - (0.5d0 * ((h / l) * (((d_1 / d) * (m / 2.0d0)) ** 2.0d0)))) * sqrt(((d / h) * (d / l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 9.5e+80) {
tmp = Math.abs((d / Math.sqrt((h * l))));
} else {
tmp = (1.0 - (0.5 * ((h / l) * Math.pow(((D / d) * (M / 2.0)), 2.0)))) * Math.sqrt(((d / h) * (d / l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if D <= 9.5e+80: tmp = math.fabs((d / math.sqrt((h * l)))) else: tmp = (1.0 - (0.5 * ((h / l) * math.pow(((D / d) * (M / 2.0)), 2.0)))) * math.sqrt(((d / h) * (d / l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (D <= 9.5e+80) tmp = abs(Float64(d / sqrt(Float64(h * l)))); else tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0)))) * sqrt(Float64(Float64(d / h) * Float64(d / l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (D <= 9.5e+80) tmp = abs((d / sqrt((h * l)))); else tmp = (1.0 - (0.5 * ((h / l) * (((D / d) * (M / 2.0)) ^ 2.0)))) * sqrt(((d / h) * (d / l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[D, 9.5e+80], N[Abs[N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(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] * N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \leq 9.5 \cdot 10^{+80}:\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\end{array}
\end{array}
if D < 9.499999999999999e80Initial program 67.2%
Simplified67.6%
frac-2neg40.2%
sqrt-div48.7%
Applied egg-rr41.7%
Taylor expanded in d around inf 25.4%
associate-/r*25.8%
Simplified25.8%
add-sqr-sqrt23.3%
sqrt-unprod34.3%
pow234.3%
associate-/l/33.7%
sqrt-div34.2%
metadata-eval34.2%
Applied egg-rr34.2%
unpow234.2%
rem-sqrt-square47.2%
associate-*r/47.3%
*-rgt-identity47.3%
*-commutative47.3%
Simplified47.3%
if 9.499999999999999e80 < D Initial program 76.0%
Simplified78.1%
pow178.1%
sqrt-unprod70.3%
Applied egg-rr70.3%
unpow170.3%
Simplified70.3%
Final simplification51.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ M (/ d D))))
(*
(* (/ 1.0 (sqrt (/ l d))) (- 1.0 (* h (* 0.125 (* t_0 (/ t_0 l))))))
(sqrt (/ d h)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = M / (d / D);
return ((1.0 / sqrt((l / d))) * (1.0 - (h * (0.125 * (t_0 * (t_0 / l)))))) * sqrt((d / 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
real(8) :: t_0
t_0 = m / (d / d_1)
code = ((1.0d0 / sqrt((l / d))) * (1.0d0 - (h * (0.125d0 * (t_0 * (t_0 / l)))))) * sqrt((d / h))
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = M / (d / D);
return ((1.0 / Math.sqrt((l / d))) * (1.0 - (h * (0.125 * (t_0 * (t_0 / l)))))) * Math.sqrt((d / h));
}
def code(d, h, l, M, D): t_0 = M / (d / D) return ((1.0 / math.sqrt((l / d))) * (1.0 - (h * (0.125 * (t_0 * (t_0 / l)))))) * math.sqrt((d / h))
function code(d, h, l, M, D) t_0 = Float64(M / Float64(d / D)) return Float64(Float64(Float64(1.0 / sqrt(Float64(l / d))) * Float64(1.0 - Float64(h * Float64(0.125 * Float64(t_0 * Float64(t_0 / l)))))) * sqrt(Float64(d / h))) end
function tmp = code(d, h, l, M, D) t_0 = M / (d / D); tmp = ((1.0 / sqrt((l / d))) * (1.0 - (h * (0.125 * (t_0 * (t_0 / l)))))) * sqrt((d / h)); end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(h * N[(0.125 * N[(t$95$0 * N[(t$95$0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M}{\frac{d}{D}}\\
\left(\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - h \cdot \left(0.125 \cdot \left(t\_0 \cdot \frac{t\_0}{\ell}\right)\right)\right)\right) \cdot \sqrt{\frac{d}{h}}
\end{array}
\end{array}
Initial program 68.9%
Simplified69.3%
Taylor expanded in h around -inf 45.8%
associate-*r*45.8%
neg-mul-145.8%
sub-neg45.8%
distribute-lft-in45.8%
Simplified71.8%
clear-num71.4%
sqrt-div71.9%
metadata-eval71.9%
Applied egg-rr71.9%
unpow271.9%
*-un-lft-identity71.9%
times-frac72.6%
clear-num72.7%
un-div-inv72.7%
clear-num72.7%
un-div-inv72.6%
Applied egg-rr72.6%
Final simplification72.6%
(FPCore (d h l M D) :precision binary64 (* (sqrt (/ d h)) (* (/ 1.0 (sqrt (/ l d))) (- 1.0 (* h (* 0.125 (* (/ (/ M (/ d D)) l) (* D (/ M d)))))))))
double code(double d, double h, double l, double M, double D) {
return sqrt((d / h)) * ((1.0 / sqrt((l / d))) * (1.0 - (h * (0.125 * (((M / (d / D)) / l) * (D * (M / d)))))));
}
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 = sqrt((d / h)) * ((1.0d0 / sqrt((l / d))) * (1.0d0 - (h * (0.125d0 * (((m / (d / d_1)) / l) * (d_1 * (m / d)))))))
end function
public static double code(double d, double h, double l, double M, double D) {
return Math.sqrt((d / h)) * ((1.0 / Math.sqrt((l / d))) * (1.0 - (h * (0.125 * (((M / (d / D)) / l) * (D * (M / d)))))));
}
def code(d, h, l, M, D): return math.sqrt((d / h)) * ((1.0 / math.sqrt((l / d))) * (1.0 - (h * (0.125 * (((M / (d / D)) / l) * (D * (M / d)))))))
function code(d, h, l, M, D) return Float64(sqrt(Float64(d / h)) * Float64(Float64(1.0 / sqrt(Float64(l / d))) * Float64(1.0 - Float64(h * Float64(0.125 * Float64(Float64(Float64(M / Float64(d / D)) / l) * Float64(D * Float64(M / d)))))))) end
function tmp = code(d, h, l, M, D) tmp = sqrt((d / h)) * ((1.0 / sqrt((l / d))) * (1.0 - (h * (0.125 * (((M / (d / D)) / l) * (D * (M / d))))))); end
code[d_, h_, l_, M_, D_] := N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(h * N[(0.125 * N[(N[(N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{d}{h}} \cdot \left(\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - h \cdot \left(0.125 \cdot \left(\frac{\frac{M}{\frac{d}{D}}}{\ell} \cdot \left(D \cdot \frac{M}{d}\right)\right)\right)\right)\right)
\end{array}
Initial program 68.9%
Simplified69.3%
Taylor expanded in h around -inf 45.8%
associate-*r*45.8%
neg-mul-145.8%
sub-neg45.8%
distribute-lft-in45.8%
Simplified71.8%
clear-num71.4%
sqrt-div71.9%
metadata-eval71.9%
Applied egg-rr71.9%
unpow271.9%
*-un-lft-identity71.9%
times-frac72.6%
clear-num72.7%
un-div-inv72.7%
clear-num72.7%
un-div-inv72.6%
Applied egg-rr72.6%
/-rgt-identity72.6%
associate-/r/72.2%
Applied egg-rr72.2%
Final simplification72.2%
(FPCore (d h l M D) :precision binary64 (if (<= d 2.35e-194) (* (- d) (sqrt (/ (/ 1.0 h) l))) (/ d (* (sqrt h) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 2.35e-194) {
tmp = -d * sqrt(((1.0 / h) / l));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= 2.35d-194) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else
tmp = d / (sqrt(h) * sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 2.35e-194) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 2.35e-194: tmp = -d * math.sqrt(((1.0 / h) / l)) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 2.35e-194) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= 2.35e-194) tmp = -d * sqrt(((1.0 / h) / l)); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 2.35e-194], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 2.35 \cdot 10^{-194}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < 2.3500000000000001e-194Initial program 64.2%
Simplified63.6%
Taylor expanded in d around inf 9.3%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt42.2%
neg-mul-142.2%
associate-/r*42.4%
Simplified42.4%
if 2.3500000000000001e-194 < d Initial program 75.6%
Simplified77.6%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt8.3%
mul-1-neg8.3%
Simplified8.3%
add-sqr-sqrt1.1%
sqrt-unprod48.9%
sqr-neg48.9%
add-sqr-sqrt48.9%
sqrt-div56.0%
sqrt-div58.6%
frac-times58.7%
add-sqr-sqrt58.8%
Applied egg-rr58.8%
*-commutative58.8%
Simplified58.8%
Final simplification49.1%
(FPCore (d h l M D) :precision binary64 (if (<= h 5.1e+225) (fabs (/ d (sqrt (* h l)))) (sqrt (* (/ d h) (/ d l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 5.1e+225) {
tmp = fabs((d / sqrt((h * l))));
} else {
tmp = sqrt(((d / h) * (d / l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= 5.1d+225) then
tmp = abs((d / sqrt((h * l))))
else
tmp = sqrt(((d / h) * (d / l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 5.1e+225) {
tmp = Math.abs((d / Math.sqrt((h * l))));
} else {
tmp = Math.sqrt(((d / h) * (d / l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= 5.1e+225: tmp = math.fabs((d / math.sqrt((h * l)))) else: tmp = math.sqrt(((d / h) * (d / l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= 5.1e+225) tmp = abs(Float64(d / sqrt(Float64(h * l)))); else tmp = sqrt(Float64(Float64(d / h) * Float64(d / l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= 5.1e+225) tmp = abs((d / sqrt((h * l)))); else tmp = sqrt(((d / h) * (d / l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, 5.1e+225], N[Abs[N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq 5.1 \cdot 10^{+225}:\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\end{array}
\end{array}
if h < 5.0999999999999999e225Initial program 68.3%
Simplified69.5%
frac-2neg44.0%
sqrt-div52.2%
Applied egg-rr44.5%
Taylor expanded in d around inf 26.9%
associate-/r*26.9%
Simplified26.9%
add-sqr-sqrt22.5%
sqrt-unprod33.4%
pow233.4%
associate-/l/33.3%
sqrt-div33.8%
metadata-eval33.8%
Applied egg-rr33.8%
unpow233.8%
rem-sqrt-square47.0%
associate-*r/47.0%
*-rgt-identity47.0%
*-commutative47.0%
Simplified47.0%
if 5.0999999999999999e225 < h Initial program 76.5%
Simplified76.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt8.8%
mul-1-neg8.8%
Simplified8.8%
pow1/28.8%
add-sqr-sqrt0.0%
sqrt-unprod53.4%
sqr-neg53.4%
add-sqr-sqrt53.4%
pow1/253.4%
pow-prod-down42.8%
Applied egg-rr42.8%
unpow1/242.8%
*-commutative42.8%
Simplified42.8%
Final simplification46.8%
(FPCore (d h l M D) :precision binary64 (if (or (<= h -1.3e-232) (not (<= h 2.7e+225))) (sqrt (* (/ d h) (/ d l))) (* d (pow (* h l) -0.5))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if ((h <= -1.3e-232) || !(h <= 2.7e+225)) {
tmp = sqrt(((d / h) * (d / l)));
} else {
tmp = d * pow((h * 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 <= (-1.3d-232)) .or. (.not. (h <= 2.7d+225))) then
tmp = sqrt(((d / h) * (d / l)))
else
tmp = d * ((h * 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 <= -1.3e-232) || !(h <= 2.7e+225)) {
tmp = Math.sqrt(((d / h) * (d / l)));
} else {
tmp = d * Math.pow((h * l), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if (h <= -1.3e-232) or not (h <= 2.7e+225): tmp = math.sqrt(((d / h) * (d / l))) else: tmp = d * math.pow((h * l), -0.5) return tmp
function code(d, h, l, M, D) tmp = 0.0 if ((h <= -1.3e-232) || !(h <= 2.7e+225)) tmp = sqrt(Float64(Float64(d / h) * Float64(d / l))); else tmp = Float64(d * (Float64(h * l) ^ -0.5)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if ((h <= -1.3e-232) || ~((h <= 2.7e+225))) tmp = sqrt(((d / h) * (d / l))); else tmp = d * ((h * l) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[Or[LessEqual[h, -1.3e-232], N[Not[LessEqual[h, 2.7e+225]], $MachinePrecision]], N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -1.3 \cdot 10^{-232} \lor \neg \left(h \leq 2.7 \cdot 10^{+225}\right):\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\end{array}
\end{array}
if h < -1.29999999999999998e-232 or 2.6999999999999999e225 < h Initial program 66.1%
Simplified65.4%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt7.4%
mul-1-neg7.4%
Simplified7.4%
pow1/27.4%
add-sqr-sqrt2.5%
sqrt-unprod44.9%
sqr-neg44.9%
add-sqr-sqrt44.9%
pow1/244.9%
pow-prod-down38.2%
Applied egg-rr38.2%
unpow1/238.2%
*-commutative38.2%
Simplified38.2%
if -1.29999999999999998e-232 < h < 2.6999999999999999e225Initial program 72.0%
Simplified74.4%
frac-2neg9.4%
sqrt-div11.0%
Applied egg-rr11.8%
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%
Final simplification42.5%
(FPCore (d h l M D) :precision binary64 (if (<= h -1.3e-232) (* (- d) (sqrt (/ (/ 1.0 h) l))) (if (<= h 4.4e+225) (* d (pow (* h l) -0.5)) (sqrt (* (/ d h) (/ d l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1.3e-232) {
tmp = -d * sqrt(((1.0 / h) / l));
} else if (h <= 4.4e+225) {
tmp = d * pow((h * l), -0.5);
} else {
tmp = sqrt(((d / h) * (d / l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-1.3d-232)) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else if (h <= 4.4d+225) then
tmp = d * ((h * l) ** (-0.5d0))
else
tmp = sqrt(((d / h) * (d / l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1.3e-232) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else if (h <= 4.4e+225) {
tmp = d * Math.pow((h * l), -0.5);
} else {
tmp = Math.sqrt(((d / h) * (d / l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -1.3e-232: tmp = -d * math.sqrt(((1.0 / h) / l)) elif h <= 4.4e+225: tmp = d * math.pow((h * l), -0.5) else: tmp = math.sqrt(((d / h) * (d / l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -1.3e-232) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); elseif (h <= 4.4e+225) tmp = Float64(d * (Float64(h * l) ^ -0.5)); else tmp = sqrt(Float64(Float64(d / h) * Float64(d / l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -1.3e-232) tmp = -d * sqrt(((1.0 / h) / l)); elseif (h <= 4.4e+225) tmp = d * ((h * l) ^ -0.5); else tmp = sqrt(((d / h) * (d / l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -1.3e-232], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 4.4e+225], N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -1.3 \cdot 10^{-232}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{elif}\;h \leq 4.4 \cdot 10^{+225}:\\
\;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\end{array}
\end{array}
if h < -1.29999999999999998e-232Initial program 64.7%
Simplified63.8%
Taylor expanded in d around inf 6.5%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt47.3%
neg-mul-147.3%
associate-/r*47.5%
Simplified47.5%
if -1.29999999999999998e-232 < h < 4.40000000000000028e225Initial program 72.0%
Simplified74.4%
frac-2neg9.4%
sqrt-div11.0%
Applied egg-rr11.8%
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%
if 4.40000000000000028e225 < h Initial program 76.5%
Simplified76.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt8.8%
mul-1-neg8.8%
Simplified8.8%
pow1/28.8%
add-sqr-sqrt0.0%
sqrt-unprod53.4%
sqr-neg53.4%
add-sqr-sqrt53.4%
pow1/253.4%
pow-prod-down42.8%
Applied egg-rr42.8%
unpow1/242.8%
*-commutative42.8%
Simplified42.8%
Final simplification47.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* h l) -0.5)))
(if (<= h -1.35e-232)
(* d (- t_0))
(if (<= h 4.4e+225) (* d t_0) (sqrt (* (/ d h) (/ d l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((h * l), -0.5);
double tmp;
if (h <= -1.35e-232) {
tmp = d * -t_0;
} else if (h <= 4.4e+225) {
tmp = d * t_0;
} else {
tmp = sqrt(((d / h) * (d / l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (h * l) ** (-0.5d0)
if (h <= (-1.35d-232)) then
tmp = d * -t_0
else if (h <= 4.4d+225) then
tmp = d * t_0
else
tmp = sqrt(((d / h) * (d / l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.pow((h * l), -0.5);
double tmp;
if (h <= -1.35e-232) {
tmp = d * -t_0;
} else if (h <= 4.4e+225) {
tmp = d * t_0;
} else {
tmp = Math.sqrt(((d / h) * (d / l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((h * l), -0.5) tmp = 0 if h <= -1.35e-232: tmp = d * -t_0 elif h <= 4.4e+225: tmp = d * t_0 else: tmp = math.sqrt(((d / h) * (d / l))) return tmp
function code(d, h, l, M, D) t_0 = Float64(h * l) ^ -0.5 tmp = 0.0 if (h <= -1.35e-232) tmp = Float64(d * Float64(-t_0)); elseif (h <= 4.4e+225) tmp = Float64(d * t_0); else tmp = sqrt(Float64(Float64(d / h) * Float64(d / l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (h * l) ^ -0.5; tmp = 0.0; if (h <= -1.35e-232) tmp = d * -t_0; elseif (h <= 4.4e+225) tmp = d * t_0; else tmp = sqrt(((d / h) * (d / l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[h, -1.35e-232], N[(d * (-t$95$0)), $MachinePrecision], If[LessEqual[h, 4.4e+225], N[(d * t$95$0), $MachinePrecision], N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{if}\;h \leq -1.35 \cdot 10^{-232}:\\
\;\;\;\;d \cdot \left(-t\_0\right)\\
\mathbf{elif}\;h \leq 4.4 \cdot 10^{+225}:\\
\;\;\;\;d \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\end{array}
\end{array}
if h < -1.35e-232Initial program 64.7%
Simplified63.8%
Taylor expanded in d around inf 6.5%
Taylor expanded in h around -inf 0.0%
*-commutative0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt47.3%
neg-mul-147.3%
Simplified47.3%
if -1.35e-232 < h < 4.40000000000000028e225Initial program 72.0%
Simplified74.4%
frac-2neg9.4%
sqrt-div11.0%
Applied egg-rr11.8%
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%
if 4.40000000000000028e225 < h Initial program 76.5%
Simplified76.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt8.8%
mul-1-neg8.8%
Simplified8.8%
pow1/28.8%
add-sqr-sqrt0.0%
sqrt-unprod53.4%
sqr-neg53.4%
add-sqr-sqrt53.4%
pow1/253.4%
pow-prod-down42.8%
Applied egg-rr42.8%
unpow1/242.8%
*-commutative42.8%
Simplified42.8%
Final simplification47.1%
(FPCore (d h l M D) :precision binary64 (* d (pow (* h l) -0.5)))
double code(double d, double h, double l, double M, double D) {
return d * pow((h * l), -0.5);
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * ((h * l) ** (-0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.pow((h * l), -0.5);
}
def code(d, h, l, M, D): return d * math.pow((h * l), -0.5)
function code(d, h, l, M, D) return Float64(d * (Float64(h * l) ^ -0.5)) end
function tmp = code(d, h, l, M, D) tmp = d * ((h * l) ^ -0.5); end
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot {\left(h \cdot \ell\right)}^{-0.5}
\end{array}
Initial program 68.9%
Simplified70.0%
frac-2neg41.1%
sqrt-div48.7%
Applied egg-rr41.5%
Taylor expanded in d around inf 25.3%
unpow-125.3%
metadata-eval25.3%
pow-sqr25.3%
rem-sqrt-square25.4%
rem-square-sqrt25.3%
fabs-sqr25.3%
rem-square-sqrt25.4%
Simplified25.4%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* h l))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((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((h * l))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((h * l));
}
def code(d, h, l, M, D): return d / math.sqrt((h * l))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(h * l))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((h * l)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{h \cdot \ell}}
\end{array}
Initial program 68.9%
Simplified70.0%
frac-2neg41.1%
sqrt-div48.7%
Applied egg-rr41.5%
Taylor expanded in d around inf 25.3%
associate-/r*25.7%
Simplified25.7%
pow125.7%
associate-/l/25.3%
sqrt-div25.3%
metadata-eval25.3%
Applied egg-rr25.3%
unpow125.3%
associate-*r/25.3%
*-rgt-identity25.3%
*-commutative25.3%
Simplified25.3%
herbie shell --seed 2024180
(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)))))