
(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}
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
:precision binary64
(let* ((t_0 (sqrt (- d))))
(if (<= l -5.5e-52)
(*
(sqrt (/ d l))
(*
(/ t_0 (sqrt (- h)))
(+ 1.0 (* (/ h l) (* -0.5 (pow (* D (/ (/ M_m 2.0) d)) 2.0))))))
(if (<= l -5e-310)
(*
(- 1.0 (* 0.5 (* h (/ (pow (* (/ D d) (/ M_m 2.0)) 2.0) l))))
(* (sqrt (/ d h)) (/ t_0 (sqrt (- l)))))
(*
(/ d (* (sqrt h) (sqrt l)))
(+ 1.0 (* (* (/ h l) -0.5) (pow (* D (/ (/ M_m d) 2.0)) 2.0))))))))M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
double t_0 = sqrt(-d);
double tmp;
if (l <= -5.5e-52) {
tmp = sqrt((d / l)) * ((t_0 / sqrt(-h)) * (1.0 + ((h / l) * (-0.5 * pow((D * ((M_m / 2.0) / d)), 2.0)))));
} else if (l <= -5e-310) {
tmp = (1.0 - (0.5 * (h * (pow(((D / d) * (M_m / 2.0)), 2.0) / l)))) * (sqrt((d / h)) * (t_0 / sqrt(-l)));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (((h / l) * -0.5) * pow((D * ((M_m / d) / 2.0)), 2.0)));
}
return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt(-d)
if (l <= (-5.5d-52)) then
tmp = sqrt((d / l)) * ((t_0 / sqrt(-h)) * (1.0d0 + ((h / l) * ((-0.5d0) * ((d_1 * ((m_m / 2.0d0) / d)) ** 2.0d0)))))
else if (l <= (-5d-310)) then
tmp = (1.0d0 - (0.5d0 * (h * ((((d_1 / d) * (m_m / 2.0d0)) ** 2.0d0) / l)))) * (sqrt((d / h)) * (t_0 / sqrt(-l)))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 + (((h / l) * (-0.5d0)) * ((d_1 * ((m_m / d) / 2.0d0)) ** 2.0d0)))
end if
code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
double t_0 = Math.sqrt(-d);
double tmp;
if (l <= -5.5e-52) {
tmp = Math.sqrt((d / l)) * ((t_0 / Math.sqrt(-h)) * (1.0 + ((h / l) * (-0.5 * Math.pow((D * ((M_m / 2.0) / d)), 2.0)))));
} else if (l <= -5e-310) {
tmp = (1.0 - (0.5 * (h * (Math.pow(((D / d) * (M_m / 2.0)), 2.0) / l)))) * (Math.sqrt((d / h)) * (t_0 / Math.sqrt(-l)));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 + (((h / l) * -0.5) * Math.pow((D * ((M_m / d) / 2.0)), 2.0)));
}
return tmp;
}
M_m = math.fabs(M) [d, h, l, M_m, D] = sort([d, h, l, M_m, D]) def code(d, h, l, M_m, D): t_0 = math.sqrt(-d) tmp = 0 if l <= -5.5e-52: tmp = math.sqrt((d / l)) * ((t_0 / math.sqrt(-h)) * (1.0 + ((h / l) * (-0.5 * math.pow((D * ((M_m / 2.0) / d)), 2.0))))) elif l <= -5e-310: tmp = (1.0 - (0.5 * (h * (math.pow(((D / d) * (M_m / 2.0)), 2.0) / l)))) * (math.sqrt((d / h)) * (t_0 / math.sqrt(-l))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 + (((h / l) * -0.5) * math.pow((D * ((M_m / d) / 2.0)), 2.0))) return tmp
M_m = abs(M) d, h, l, M_m, D = sort([d, h, l, M_m, D]) function code(d, h, l, M_m, D) t_0 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -5.5e-52) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(D * Float64(Float64(M_m / 2.0) / d)) ^ 2.0)))))); elseif (l <= -5e-310) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(h * Float64((Float64(Float64(D / d) * Float64(M_m / 2.0)) ^ 2.0) / l)))) * Float64(sqrt(Float64(d / h)) * Float64(t_0 / sqrt(Float64(-l))))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 + Float64(Float64(Float64(h / l) * -0.5) * (Float64(D * Float64(Float64(M_m / d) / 2.0)) ^ 2.0)))); end return tmp end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
t_0 = sqrt(-d);
tmp = 0.0;
if (l <= -5.5e-52)
tmp = sqrt((d / l)) * ((t_0 / sqrt(-h)) * (1.0 + ((h / l) * (-0.5 * ((D * ((M_m / 2.0) / d)) ^ 2.0)))));
elseif (l <= -5e-310)
tmp = (1.0 - (0.5 * (h * ((((D / d) * (M_m / 2.0)) ^ 2.0) / l)))) * (sqrt((d / h)) * (t_0 / sqrt(-l)));
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (((h / l) * -0.5) * ((D * ((M_m / d) / 2.0)) ^ 2.0)));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -5.5e-52], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D * N[(N[(M$95$m / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(N[(1.0 - N[(0.5 * N[(h * N[(N[Power[N[(N[(D / d), $MachinePrecision] * N[(M$95$m / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * N[Power[N[(D * N[(N[(M$95$m / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -5.5 \cdot 10^{-52}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{t\_0}{\sqrt{-h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(D \cdot \frac{\frac{M\_m}{2}}{d}\right)}^{2}\right)\right)\right)\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(1 - 0.5 \cdot \left(h \cdot \frac{{\left(\frac{D}{d} \cdot \frac{M\_m}{2}\right)}^{2}}{\ell}\right)\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \frac{t\_0}{\sqrt{-\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + \left(\frac{h}{\ell} \cdot -0.5\right) \cdot {\left(D \cdot \frac{\frac{M\_m}{d}}{2}\right)}^{2}\right)\\
\end{array}
\end{array}
if l < -5.5e-52Initial program 60.6%
Simplified61.8%
frac-2neg65.5%
sqrt-div76.5%
Applied egg-rr74.2%
if -5.5e-52 < l < -4.999999999999985e-310Initial program 70.1%
Simplified70.1%
associate-*r/74.9%
frac-times74.9%
associate-/l*74.9%
*-commutative74.9%
Applied egg-rr74.9%
*-commutative74.9%
associate-/l*74.9%
associate-*r/74.9%
*-commutative74.9%
times-frac74.9%
Simplified74.9%
frac-2neg74.9%
sqrt-div86.0%
Applied egg-rr86.0%
if -4.999999999999985e-310 < l Initial program 64.4%
Simplified64.4%
Applied egg-rr78.7%
unpow178.7%
associate-*r*78.7%
*-commutative78.7%
associate-*r/79.5%
*-commutative79.5%
associate-*r/77.1%
associate-/r*77.1%
Simplified77.1%
Final simplification78.0%
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
:precision binary64
(if (<= l -5e-310)
(*
(* (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ d l)))
(- 1.0 (* 0.5 (* h (/ (pow (* (/ D d) (/ M_m 2.0)) 2.0) l)))))
(*
(/ d (* (sqrt h) (sqrt l)))
(+ 1.0 (* (* (/ h l) -0.5) (pow (* D (/ (/ M_m d) 2.0)) 2.0))))))M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (l <= -5e-310) {
tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * (1.0 - (0.5 * (h * (pow(((D / d) * (M_m / 2.0)), 2.0) / l))));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (((h / l) * -0.5) * pow((D * ((M_m / d) / 2.0)), 2.0)));
}
return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-5d-310)) then
tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * (1.0d0 - (0.5d0 * (h * ((((d_1 / d) * (m_m / 2.0d0)) ** 2.0d0) / l))))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 + (((h / l) * (-0.5d0)) * ((d_1 * ((m_m / d) / 2.0d0)) ** 2.0d0)))
end if
code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (l <= -5e-310) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-h)) * Math.sqrt((d / l))) * (1.0 - (0.5 * (h * (Math.pow(((D / d) * (M_m / 2.0)), 2.0) / l))));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 + (((h / l) * -0.5) * Math.pow((D * ((M_m / d) / 2.0)), 2.0)));
}
return tmp;
}
M_m = math.fabs(M) [d, h, l, M_m, D] = sort([d, h, l, M_m, D]) def code(d, h, l, M_m, D): tmp = 0 if l <= -5e-310: tmp = ((math.sqrt(-d) / math.sqrt(-h)) * math.sqrt((d / l))) * (1.0 - (0.5 * (h * (math.pow(((D / d) * (M_m / 2.0)), 2.0) / l)))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 + (((h / l) * -0.5) * math.pow((D * ((M_m / d) / 2.0)), 2.0))) return tmp
M_m = abs(M) d, h, l, M_m, D = sort([d, h, l, M_m, D]) function code(d, h, l, M_m, D) tmp = 0.0 if (l <= -5e-310) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * Float64(h * Float64((Float64(Float64(D / d) * Float64(M_m / 2.0)) ^ 2.0) / l))))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 + Float64(Float64(Float64(h / l) * -0.5) * (Float64(D * Float64(Float64(M_m / d) / 2.0)) ^ 2.0)))); end return tmp end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
tmp = 0.0;
if (l <= -5e-310)
tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * (1.0 - (0.5 * (h * ((((D / d) * (M_m / 2.0)) ^ 2.0) / l))));
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (((h / l) * -0.5) * ((D * ((M_m / d) / 2.0)) ^ 2.0)));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[l, -5e-310], 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[(h * N[(N[Power[N[(N[(D / d), $MachinePrecision] * N[(M$95$m / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * N[Power[N[(D * N[(N[(M$95$m / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{{\left(\frac{D}{d} \cdot \frac{M\_m}{2}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + \left(\frac{h}{\ell} \cdot -0.5\right) \cdot {\left(D \cdot \frac{\frac{M\_m}{d}}{2}\right)}^{2}\right)\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 64.3%
Simplified65.9%
associate-*r/68.3%
frac-times66.8%
associate-/l*68.3%
*-commutative68.3%
Applied egg-rr68.3%
*-commutative68.3%
associate-/l*69.1%
associate-*r/67.6%
*-commutative67.6%
times-frac69.1%
Simplified69.1%
frac-2neg69.1%
sqrt-div78.2%
Applied egg-rr78.2%
if -4.999999999999985e-310 < l Initial program 64.4%
Simplified64.4%
Applied egg-rr78.7%
unpow178.7%
associate-*r*78.7%
*-commutative78.7%
associate-*r/79.5%
*-commutative79.5%
associate-*r/77.1%
associate-/r*77.1%
Simplified77.1%
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
:precision binary64
(if (<= h -5e-310)
(*
(sqrt (/ d l))
(*
(/ (sqrt (- d)) (sqrt (- h)))
(+ 1.0 (* (/ h l) (* -0.5 (pow (* D (/ (/ M_m 2.0) d)) 2.0))))))
(*
(/ d (* (sqrt h) (sqrt l)))
(+ 1.0 (* (* (/ h l) -0.5) (pow (* D (/ (/ M_m d) 2.0)) 2.0))))))M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (h <= -5e-310) {
tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0 + ((h / l) * (-0.5 * pow((D * ((M_m / 2.0) / d)), 2.0)))));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (((h / l) * -0.5) * pow((D * ((M_m / d) / 2.0)), 2.0)));
}
return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-5d-310)) then
tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0d0 + ((h / l) * ((-0.5d0) * ((d_1 * ((m_m / 2.0d0) / d)) ** 2.0d0)))))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 + (((h / l) * (-0.5d0)) * ((d_1 * ((m_m / d) / 2.0d0)) ** 2.0d0)))
end if
code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (h <= -5e-310) {
tmp = Math.sqrt((d / l)) * ((Math.sqrt(-d) / Math.sqrt(-h)) * (1.0 + ((h / l) * (-0.5 * Math.pow((D * ((M_m / 2.0) / d)), 2.0)))));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 + (((h / l) * -0.5) * Math.pow((D * ((M_m / d) / 2.0)), 2.0)));
}
return tmp;
}
M_m = math.fabs(M) [d, h, l, M_m, D] = sort([d, h, l, M_m, D]) def code(d, h, l, M_m, D): tmp = 0 if h <= -5e-310: tmp = math.sqrt((d / l)) * ((math.sqrt(-d) / math.sqrt(-h)) * (1.0 + ((h / l) * (-0.5 * math.pow((D * ((M_m / 2.0) / d)), 2.0))))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 + (((h / l) * -0.5) * math.pow((D * ((M_m / d) / 2.0)), 2.0))) return tmp
M_m = abs(M) d, h, l, M_m, D = sort([d, h, l, M_m, D]) function code(d, h, l, M_m, D) tmp = 0.0 if (h <= -5e-310) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(D * Float64(Float64(M_m / 2.0) / d)) ^ 2.0)))))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 + Float64(Float64(Float64(h / l) * -0.5) * (Float64(D * Float64(Float64(M_m / d) / 2.0)) ^ 2.0)))); end return tmp end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
tmp = 0.0;
if (h <= -5e-310)
tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0 + ((h / l) * (-0.5 * ((D * ((M_m / 2.0) / d)) ^ 2.0)))));
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (((h / l) * -0.5) * ((D * ((M_m / d) / 2.0)) ^ 2.0)));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[h, -5e-310], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D * N[(N[(M$95$m / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * N[Power[N[(D * N[(N[(M$95$m / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(D \cdot \frac{\frac{M\_m}{2}}{d}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + \left(\frac{h}{\ell} \cdot -0.5\right) \cdot {\left(D \cdot \frac{\frac{M\_m}{d}}{2}\right)}^{2}\right)\\
\end{array}
\end{array}
if h < -4.999999999999985e-310Initial program 64.3%
Simplified65.0%
frac-2neg69.1%
sqrt-div78.2%
Applied egg-rr74.8%
if -4.999999999999985e-310 < h Initial program 64.4%
Simplified64.4%
Applied egg-rr78.7%
unpow178.7%
associate-*r*78.7%
*-commutative78.7%
associate-*r/79.5%
*-commutative79.5%
associate-*r/77.1%
associate-/r*77.1%
Simplified77.1%
Final simplification76.0%
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
:precision binary64
(if (<= l -4.6e+224)
(* d (- (pow (* l h) -0.5)))
(if (<= l 2.3e-297)
(*
(- 1.0 (* 0.5 (* h (/ (pow (* (/ D d) (/ M_m 2.0)) 2.0) l))))
(* (sqrt (/ d l)) (sqrt (/ d h))))
(*
(/ d (* (sqrt h) (sqrt l)))
(+ 1.0 (* (* (/ h l) -0.5) (pow (* D (/ (/ M_m d) 2.0)) 2.0)))))))M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (l <= -4.6e+224) {
tmp = d * -pow((l * h), -0.5);
} else if (l <= 2.3e-297) {
tmp = (1.0 - (0.5 * (h * (pow(((D / d) * (M_m / 2.0)), 2.0) / l)))) * (sqrt((d / l)) * sqrt((d / h)));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (((h / l) * -0.5) * pow((D * ((M_m / d) / 2.0)), 2.0)));
}
return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-4.6d+224)) then
tmp = d * -((l * h) ** (-0.5d0))
else if (l <= 2.3d-297) then
tmp = (1.0d0 - (0.5d0 * (h * ((((d_1 / d) * (m_m / 2.0d0)) ** 2.0d0) / l)))) * (sqrt((d / l)) * sqrt((d / h)))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 + (((h / l) * (-0.5d0)) * ((d_1 * ((m_m / d) / 2.0d0)) ** 2.0d0)))
end if
code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (l <= -4.6e+224) {
tmp = d * -Math.pow((l * h), -0.5);
} else if (l <= 2.3e-297) {
tmp = (1.0 - (0.5 * (h * (Math.pow(((D / d) * (M_m / 2.0)), 2.0) / l)))) * (Math.sqrt((d / l)) * Math.sqrt((d / h)));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 + (((h / l) * -0.5) * Math.pow((D * ((M_m / d) / 2.0)), 2.0)));
}
return tmp;
}
M_m = math.fabs(M) [d, h, l, M_m, D] = sort([d, h, l, M_m, D]) def code(d, h, l, M_m, D): tmp = 0 if l <= -4.6e+224: tmp = d * -math.pow((l * h), -0.5) elif l <= 2.3e-297: tmp = (1.0 - (0.5 * (h * (math.pow(((D / d) * (M_m / 2.0)), 2.0) / l)))) * (math.sqrt((d / l)) * math.sqrt((d / h))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 + (((h / l) * -0.5) * math.pow((D * ((M_m / d) / 2.0)), 2.0))) return tmp
M_m = abs(M) d, h, l, M_m, D = sort([d, h, l, M_m, D]) function code(d, h, l, M_m, D) tmp = 0.0 if (l <= -4.6e+224) tmp = Float64(d * Float64(-(Float64(l * h) ^ -0.5))); elseif (l <= 2.3e-297) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(h * Float64((Float64(Float64(D / d) * Float64(M_m / 2.0)) ^ 2.0) / l)))) * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 + Float64(Float64(Float64(h / l) * -0.5) * (Float64(D * Float64(Float64(M_m / d) / 2.0)) ^ 2.0)))); end return tmp end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
tmp = 0.0;
if (l <= -4.6e+224)
tmp = d * -((l * h) ^ -0.5);
elseif (l <= 2.3e-297)
tmp = (1.0 - (0.5 * (h * ((((D / d) * (M_m / 2.0)) ^ 2.0) / l)))) * (sqrt((d / l)) * sqrt((d / h)));
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (((h / l) * -0.5) * ((D * ((M_m / d) / 2.0)) ^ 2.0)));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[l, -4.6e+224], N[(d * (-N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, 2.3e-297], N[(N[(1.0 - N[(0.5 * N[(h * N[(N[Power[N[(N[(D / d), $MachinePrecision] * N[(M$95$m / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * N[Power[N[(D * N[(N[(M$95$m / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.6 \cdot 10^{+224}:\\
\;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\
\mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-297}:\\
\;\;\;\;\left(1 - 0.5 \cdot \left(h \cdot \frac{{\left(\frac{D}{d} \cdot \frac{M\_m}{2}\right)}^{2}}{\ell}\right)\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + \left(\frac{h}{\ell} \cdot -0.5\right) \cdot {\left(D \cdot \frac{\frac{M\_m}{d}}{2}\right)}^{2}\right)\\
\end{array}
\end{array}
if l < -4.60000000000000039e224Initial program 42.4%
Simplified42.4%
associate-*r/42.4%
frac-times42.4%
associate-/l*42.4%
*-commutative42.4%
Applied egg-rr42.4%
*-commutative42.4%
associate-/l*47.0%
associate-*r/47.0%
*-commutative47.0%
times-frac47.0%
Simplified47.0%
Taylor expanded in l 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-sqrt68.8%
mul-1-neg68.8%
Simplified68.8%
if -4.60000000000000039e224 < l < 2.2999999999999999e-297Initial program 69.2%
Simplified71.0%
associate-*r/73.9%
frac-times72.1%
associate-/l*73.9%
*-commutative73.9%
Applied egg-rr73.9%
*-commutative73.9%
associate-/l*73.9%
associate-*r/72.1%
*-commutative72.1%
times-frac73.9%
Simplified73.9%
if 2.2999999999999999e-297 < l Initial program 64.1%
Simplified64.0%
Applied egg-rr78.8%
unpow178.8%
associate-*r*78.8%
*-commutative78.8%
associate-*r/79.6%
*-commutative79.6%
associate-*r/78.0%
associate-/r*78.0%
Simplified78.0%
Final simplification75.5%
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
:precision binary64
(if (<= l -1.2e+221)
(* d (- (pow (* l h) -0.5)))
(if (<= l -5e-308)
(*
(sqrt (/ d l))
(*
(+ 1.0 (* (/ h l) (* -0.5 (pow (* D (/ (/ M_m 2.0) d)) 2.0))))
(sqrt (/ d h))))
(*
(/ d (* (sqrt h) (sqrt l)))
(+ 1.0 (* (* (/ h l) -0.5) (pow (* D (/ (/ M_m d) 2.0)) 2.0)))))))M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (l <= -1.2e+221) {
tmp = d * -pow((l * h), -0.5);
} else if (l <= -5e-308) {
tmp = sqrt((d / l)) * ((1.0 + ((h / l) * (-0.5 * pow((D * ((M_m / 2.0) / d)), 2.0)))) * sqrt((d / h)));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (((h / l) * -0.5) * pow((D * ((M_m / d) / 2.0)), 2.0)));
}
return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1.2d+221)) then
tmp = d * -((l * h) ** (-0.5d0))
else if (l <= (-5d-308)) then
tmp = sqrt((d / l)) * ((1.0d0 + ((h / l) * ((-0.5d0) * ((d_1 * ((m_m / 2.0d0) / d)) ** 2.0d0)))) * sqrt((d / h)))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 + (((h / l) * (-0.5d0)) * ((d_1 * ((m_m / d) / 2.0d0)) ** 2.0d0)))
end if
code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (l <= -1.2e+221) {
tmp = d * -Math.pow((l * h), -0.5);
} else if (l <= -5e-308) {
tmp = Math.sqrt((d / l)) * ((1.0 + ((h / l) * (-0.5 * Math.pow((D * ((M_m / 2.0) / d)), 2.0)))) * Math.sqrt((d / h)));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 + (((h / l) * -0.5) * Math.pow((D * ((M_m / d) / 2.0)), 2.0)));
}
return tmp;
}
M_m = math.fabs(M) [d, h, l, M_m, D] = sort([d, h, l, M_m, D]) def code(d, h, l, M_m, D): tmp = 0 if l <= -1.2e+221: tmp = d * -math.pow((l * h), -0.5) elif l <= -5e-308: tmp = math.sqrt((d / l)) * ((1.0 + ((h / l) * (-0.5 * math.pow((D * ((M_m / 2.0) / d)), 2.0)))) * math.sqrt((d / h))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 + (((h / l) * -0.5) * math.pow((D * ((M_m / d) / 2.0)), 2.0))) return tmp
M_m = abs(M) d, h, l, M_m, D = sort([d, h, l, M_m, D]) function code(d, h, l, M_m, D) tmp = 0.0 if (l <= -1.2e+221) tmp = Float64(d * Float64(-(Float64(l * h) ^ -0.5))); elseif (l <= -5e-308) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(D * Float64(Float64(M_m / 2.0) / d)) ^ 2.0)))) * sqrt(Float64(d / h)))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 + Float64(Float64(Float64(h / l) * -0.5) * (Float64(D * Float64(Float64(M_m / d) / 2.0)) ^ 2.0)))); end return tmp end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
tmp = 0.0;
if (l <= -1.2e+221)
tmp = d * -((l * h) ^ -0.5);
elseif (l <= -5e-308)
tmp = sqrt((d / l)) * ((1.0 + ((h / l) * (-0.5 * ((D * ((M_m / 2.0) / d)) ^ 2.0)))) * sqrt((d / h)));
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (((h / l) * -0.5) * ((D * ((M_m / d) / 2.0)) ^ 2.0)));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[l, -1.2e+221], N[(d * (-N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, -5e-308], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D * N[(N[(M$95$m / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * N[Power[N[(D * N[(N[(M$95$m / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.2 \cdot 10^{+221}:\\
\;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-308}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(D \cdot \frac{\frac{M\_m}{2}}{d}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + \left(\frac{h}{\ell} \cdot -0.5\right) \cdot {\left(D \cdot \frac{\frac{M\_m}{d}}{2}\right)}^{2}\right)\\
\end{array}
\end{array}
if l < -1.2000000000000001e221Initial program 42.4%
Simplified42.4%
associate-*r/42.4%
frac-times42.4%
associate-/l*42.4%
*-commutative42.4%
Applied egg-rr42.4%
*-commutative42.4%
associate-/l*47.0%
associate-*r/47.0%
*-commutative47.0%
times-frac47.0%
Simplified47.0%
Taylor expanded in l 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-sqrt68.8%
mul-1-neg68.8%
Simplified68.8%
if -1.2000000000000001e221 < l < -4.99999999999999955e-308Initial program 69.0%
Simplified70.8%
if -4.99999999999999955e-308 < l Initial program 64.4%
Simplified64.4%
Applied egg-rr78.7%
unpow178.7%
associate-*r*78.7%
*-commutative78.7%
associate-*r/79.5%
*-commutative79.5%
associate-*r/77.1%
associate-/r*77.1%
Simplified77.1%
Final simplification73.9%
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
:precision binary64
(if (<= h -2.4e-213)
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* -0.5 (* h (/ (pow (* D (/ (* 0.5 M_m) d)) 2.0) l)))))
(if (<= h -5e-310)
(* (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ d l)))
(*
(/ d (* (sqrt h) (sqrt l)))
(+ 1.0 (* (* (/ h l) -0.5) (pow (* D (/ (/ M_m d) 2.0)) 2.0)))))))M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (h <= -2.4e-213) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (pow((D * ((0.5 * M_m) / d)), 2.0) / l))));
} else if (h <= -5e-310) {
tmp = (sqrt(-d) / sqrt(-h)) * sqrt((d / l));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (((h / l) * -0.5) * pow((D * ((M_m / d) / 2.0)), 2.0)));
}
return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-2.4d-213)) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + ((-0.5d0) * (h * (((d_1 * ((0.5d0 * m_m) / d)) ** 2.0d0) / l))))
else if (h <= (-5d-310)) then
tmp = (sqrt(-d) / sqrt(-h)) * sqrt((d / l))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 + (((h / l) * (-0.5d0)) * ((d_1 * ((m_m / d) / 2.0d0)) ** 2.0d0)))
end if
code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (h <= -2.4e-213) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (Math.pow((D * ((0.5 * M_m) / d)), 2.0) / l))));
} else if (h <= -5e-310) {
tmp = (Math.sqrt(-d) / Math.sqrt(-h)) * Math.sqrt((d / l));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 + (((h / l) * -0.5) * Math.pow((D * ((M_m / d) / 2.0)), 2.0)));
}
return tmp;
}
M_m = math.fabs(M) [d, h, l, M_m, D] = sort([d, h, l, M_m, D]) def code(d, h, l, M_m, D): tmp = 0 if h <= -2.4e-213: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (math.pow((D * ((0.5 * M_m) / d)), 2.0) / l)))) elif h <= -5e-310: tmp = (math.sqrt(-d) / math.sqrt(-h)) * math.sqrt((d / l)) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 + (((h / l) * -0.5) * math.pow((D * ((M_m / d) / 2.0)), 2.0))) return tmp
M_m = abs(M) d, h, l, M_m, D = sort([d, h, l, M_m, D]) function code(d, h, l, M_m, D) tmp = 0.0 if (h <= -2.4e-213) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(-0.5 * Float64(h * Float64((Float64(D * Float64(Float64(0.5 * M_m) / d)) ^ 2.0) / l))))); elseif (h <= -5e-310) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * sqrt(Float64(d / l))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 + Float64(Float64(Float64(h / l) * -0.5) * (Float64(D * Float64(Float64(M_m / d) / 2.0)) ^ 2.0)))); end return tmp end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
tmp = 0.0;
if (h <= -2.4e-213)
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (((D * ((0.5 * M_m) / d)) ^ 2.0) / l))));
elseif (h <= -5e-310)
tmp = (sqrt(-d) / sqrt(-h)) * sqrt((d / l));
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (((h / l) * -0.5) * ((D * ((M_m / d) / 2.0)) ^ 2.0)));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[h, -2.4e-213], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(h * N[(N[Power[N[(D * N[(N[(0.5 * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * N[Power[N[(D * N[(N[(M$95$m / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -2.4 \cdot 10^{-213}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \left(h \cdot \frac{{\left(D \cdot \frac{0.5 \cdot M\_m}{d}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + \left(\frac{h}{\ell} \cdot -0.5\right) \cdot {\left(D \cdot \frac{\frac{M\_m}{d}}{2}\right)}^{2}\right)\\
\end{array}
\end{array}
if h < -2.39999999999999996e-213Initial program 66.3%
Simplified67.2%
associate-*r/70.3%
frac-times69.3%
associate-/l*70.3%
*-commutative70.3%
Applied egg-rr70.3%
*-commutative70.3%
associate-/l*71.3%
associate-*r/70.4%
*-commutative70.4%
times-frac71.3%
Simplified71.3%
pow171.3%
sqrt-unprod60.9%
cancel-sign-sub-inv60.9%
metadata-eval60.9%
associate-*r/59.8%
div-inv59.8%
metadata-eval59.8%
Applied egg-rr59.8%
unpow159.8%
associate-/l*60.9%
associate-*l/59.9%
associate-/l*59.0%
Simplified59.0%
if -2.39999999999999996e-213 < h < -4.999999999999985e-310Initial program 56.9%
Simplified60.8%
Taylor expanded in M around 0 53.4%
frac-2neg60.8%
sqrt-div85.4%
Applied egg-rr78.0%
if -4.999999999999985e-310 < h Initial program 64.4%
Simplified64.4%
Applied egg-rr78.7%
unpow178.7%
associate-*r*78.7%
*-commutative78.7%
associate-*r/79.5%
*-commutative79.5%
associate-*r/77.1%
associate-/r*77.1%
Simplified77.1%
Final simplification70.2%
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
:precision binary64
(if (<= h -4.7e-213)
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* -0.5 (* h (/ (pow (* D (/ (* 0.5 M_m) d)) 2.0) l)))))
(if (<= h -5e-310)
(* (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ d l)))
(*
(+ 1.0 (* -0.5 (* h (/ (pow (/ (* D M_m) d) 2.0) (* l 4.0)))))
(/ d (sqrt (* l h)))))))M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (h <= -4.7e-213) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (pow((D * ((0.5 * M_m) / d)), 2.0) / l))));
} else if (h <= -5e-310) {
tmp = (sqrt(-d) / sqrt(-h)) * sqrt((d / l));
} else {
tmp = (1.0 + (-0.5 * (h * (pow(((D * M_m) / d), 2.0) / (l * 4.0))))) * (d / sqrt((l * h)));
}
return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-4.7d-213)) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + ((-0.5d0) * (h * (((d_1 * ((0.5d0 * m_m) / d)) ** 2.0d0) / l))))
else if (h <= (-5d-310)) then
tmp = (sqrt(-d) / sqrt(-h)) * sqrt((d / l))
else
tmp = (1.0d0 + ((-0.5d0) * (h * ((((d_1 * m_m) / d) ** 2.0d0) / (l * 4.0d0))))) * (d / sqrt((l * h)))
end if
code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (h <= -4.7e-213) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (Math.pow((D * ((0.5 * M_m) / d)), 2.0) / l))));
} else if (h <= -5e-310) {
tmp = (Math.sqrt(-d) / Math.sqrt(-h)) * Math.sqrt((d / l));
} else {
tmp = (1.0 + (-0.5 * (h * (Math.pow(((D * M_m) / d), 2.0) / (l * 4.0))))) * (d / Math.sqrt((l * h)));
}
return tmp;
}
M_m = math.fabs(M) [d, h, l, M_m, D] = sort([d, h, l, M_m, D]) def code(d, h, l, M_m, D): tmp = 0 if h <= -4.7e-213: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (math.pow((D * ((0.5 * M_m) / d)), 2.0) / l)))) elif h <= -5e-310: tmp = (math.sqrt(-d) / math.sqrt(-h)) * math.sqrt((d / l)) else: tmp = (1.0 + (-0.5 * (h * (math.pow(((D * M_m) / d), 2.0) / (l * 4.0))))) * (d / math.sqrt((l * h))) return tmp
M_m = abs(M) d, h, l, M_m, D = sort([d, h, l, M_m, D]) function code(d, h, l, M_m, D) tmp = 0.0 if (h <= -4.7e-213) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(-0.5 * Float64(h * Float64((Float64(D * Float64(Float64(0.5 * M_m) / d)) ^ 2.0) / l))))); elseif (h <= -5e-310) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * sqrt(Float64(d / l))); else tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(h * Float64((Float64(Float64(D * M_m) / d) ^ 2.0) / Float64(l * 4.0))))) * Float64(d / sqrt(Float64(l * h)))); end return tmp end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
tmp = 0.0;
if (h <= -4.7e-213)
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (((D * ((0.5 * M_m) / d)) ^ 2.0) / l))));
elseif (h <= -5e-310)
tmp = (sqrt(-d) / sqrt(-h)) * sqrt((d / l));
else
tmp = (1.0 + (-0.5 * (h * ((((D * M_m) / d) ^ 2.0) / (l * 4.0))))) * (d / sqrt((l * h)));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[h, -4.7e-213], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(h * N[(N[Power[N[(D * N[(N[(0.5 * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(h * N[(N[Power[N[(N[(D * M$95$m), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] / N[(l * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -4.7 \cdot 10^{-213}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \left(h \cdot \frac{{\left(D \cdot \frac{0.5 \cdot M\_m}{d}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(h \cdot \frac{{\left(\frac{D \cdot M\_m}{d}\right)}^{2}}{\ell \cdot 4}\right)\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if h < -4.7e-213Initial program 66.3%
Simplified67.2%
associate-*r/70.3%
frac-times69.3%
associate-/l*70.3%
*-commutative70.3%
Applied egg-rr70.3%
*-commutative70.3%
associate-/l*71.3%
associate-*r/70.4%
*-commutative70.4%
times-frac71.3%
Simplified71.3%
pow171.3%
sqrt-unprod60.9%
cancel-sign-sub-inv60.9%
metadata-eval60.9%
associate-*r/59.8%
div-inv59.8%
metadata-eval59.8%
Applied egg-rr59.8%
unpow159.8%
associate-/l*60.9%
associate-*l/59.9%
associate-/l*59.0%
Simplified59.0%
if -4.7e-213 < h < -4.999999999999985e-310Initial program 56.9%
Simplified60.8%
Taylor expanded in M around 0 53.4%
frac-2neg60.8%
sqrt-div85.4%
Applied egg-rr78.0%
if -4.999999999999985e-310 < h Initial program 64.4%
Simplified64.4%
associate-*r/65.9%
frac-times66.0%
associate-/l*65.9%
*-commutative65.9%
Applied egg-rr65.9%
*-commutative65.9%
associate-/l*63.8%
associate-*r/63.9%
*-commutative63.9%
times-frac63.8%
Simplified63.8%
add-cbrt-cube54.9%
add-sqr-sqrt54.9%
cbrt-prod63.6%
Applied egg-rr63.6%
Applied egg-rr73.2%
unpow173.2%
associate-/l*71.8%
*-lft-identity71.8%
*-commutative71.8%
*-rgt-identity71.8%
associate-/l/71.8%
associate-*l/72.5%
Simplified72.5%
Final simplification67.8%
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
:precision binary64
(if (<= h -1e-212)
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* -0.5 (* h (/ (pow (* D (/ (* 0.5 M_m) d)) 2.0) l)))))
(if (<= h -5e-310)
(* d (- (sqrt (/ 1.0 (* l h)))))
(*
(+ 1.0 (* -0.5 (* h (/ (pow (/ (* D M_m) d) 2.0) (* l 4.0)))))
(/ d (sqrt (* l h)))))))M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (h <= -1e-212) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (pow((D * ((0.5 * M_m) / d)), 2.0) / l))));
} else if (h <= -5e-310) {
tmp = d * -sqrt((1.0 / (l * h)));
} else {
tmp = (1.0 + (-0.5 * (h * (pow(((D * M_m) / d), 2.0) / (l * 4.0))))) * (d / sqrt((l * h)));
}
return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-1d-212)) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + ((-0.5d0) * (h * (((d_1 * ((0.5d0 * m_m) / d)) ** 2.0d0) / l))))
else if (h <= (-5d-310)) then
tmp = d * -sqrt((1.0d0 / (l * h)))
else
tmp = (1.0d0 + ((-0.5d0) * (h * ((((d_1 * m_m) / d) ** 2.0d0) / (l * 4.0d0))))) * (d / sqrt((l * h)))
end if
code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (h <= -1e-212) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (Math.pow((D * ((0.5 * M_m) / d)), 2.0) / l))));
} else if (h <= -5e-310) {
tmp = d * -Math.sqrt((1.0 / (l * h)));
} else {
tmp = (1.0 + (-0.5 * (h * (Math.pow(((D * M_m) / d), 2.0) / (l * 4.0))))) * (d / Math.sqrt((l * h)));
}
return tmp;
}
M_m = math.fabs(M) [d, h, l, M_m, D] = sort([d, h, l, M_m, D]) def code(d, h, l, M_m, D): tmp = 0 if h <= -1e-212: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (math.pow((D * ((0.5 * M_m) / d)), 2.0) / l)))) elif h <= -5e-310: tmp = d * -math.sqrt((1.0 / (l * h))) else: tmp = (1.0 + (-0.5 * (h * (math.pow(((D * M_m) / d), 2.0) / (l * 4.0))))) * (d / math.sqrt((l * h))) return tmp
M_m = abs(M) d, h, l, M_m, D = sort([d, h, l, M_m, D]) function code(d, h, l, M_m, D) tmp = 0.0 if (h <= -1e-212) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(-0.5 * Float64(h * Float64((Float64(D * Float64(Float64(0.5 * M_m) / d)) ^ 2.0) / l))))); elseif (h <= -5e-310) tmp = Float64(d * Float64(-sqrt(Float64(1.0 / Float64(l * h))))); else tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(h * Float64((Float64(Float64(D * M_m) / d) ^ 2.0) / Float64(l * 4.0))))) * Float64(d / sqrt(Float64(l * h)))); end return tmp end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
tmp = 0.0;
if (h <= -1e-212)
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (h * (((D * ((0.5 * M_m) / d)) ^ 2.0) / l))));
elseif (h <= -5e-310)
tmp = d * -sqrt((1.0 / (l * h)));
else
tmp = (1.0 + (-0.5 * (h * ((((D * M_m) / d) ^ 2.0) / (l * 4.0))))) * (d / sqrt((l * h)));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[h, -1e-212], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(h * N[(N[Power[N[(D * N[(N[(0.5 * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(d * (-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(h * N[(N[Power[N[(N[(D * M$95$m), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] / N[(l * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -1 \cdot 10^{-212}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \left(h \cdot \frac{{\left(D \cdot \frac{0.5 \cdot M\_m}{d}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(h \cdot \frac{{\left(\frac{D \cdot M\_m}{d}\right)}^{2}}{\ell \cdot 4}\right)\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if h < -9.99999999999999954e-213Initial program 66.3%
Simplified67.2%
associate-*r/70.3%
frac-times69.3%
associate-/l*70.3%
*-commutative70.3%
Applied egg-rr70.3%
*-commutative70.3%
associate-/l*71.3%
associate-*r/70.4%
*-commutative70.4%
times-frac71.3%
Simplified71.3%
pow171.3%
sqrt-unprod60.9%
cancel-sign-sub-inv60.9%
metadata-eval60.9%
associate-*r/59.8%
div-inv59.8%
metadata-eval59.8%
Applied egg-rr59.8%
unpow159.8%
associate-/l*60.9%
associate-*l/59.9%
associate-/l*59.0%
Simplified59.0%
if -9.99999999999999954e-213 < h < -4.999999999999985e-310Initial program 56.9%
Simplified60.8%
associate-*r/60.8%
frac-times56.9%
associate-/l*60.8%
*-commutative60.8%
Applied egg-rr60.8%
*-commutative60.8%
associate-/l*60.8%
associate-*r/56.9%
*-commutative56.9%
times-frac60.8%
Simplified60.8%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt74.0%
mul-1-neg74.0%
Simplified74.0%
if -4.999999999999985e-310 < h Initial program 64.4%
Simplified64.4%
associate-*r/65.9%
frac-times66.0%
associate-/l*65.9%
*-commutative65.9%
Applied egg-rr65.9%
*-commutative65.9%
associate-/l*63.8%
associate-*r/63.9%
*-commutative63.9%
times-frac63.8%
Simplified63.8%
add-cbrt-cube54.9%
add-sqr-sqrt54.9%
cbrt-prod63.6%
Applied egg-rr63.6%
Applied egg-rr73.2%
unpow173.2%
associate-/l*71.8%
*-lft-identity71.8%
*-commutative71.8%
*-rgt-identity71.8%
associate-/l/71.8%
associate-*l/72.5%
Simplified72.5%
Final simplification67.4%
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
:precision binary64
(let* ((t_0 (/ 1.0 (* l h))))
(if (<= l -1.12e-106)
(* d (- (sqrt t_0)))
(if (<= l -5e-310)
(* d (cbrt (pow t_0 1.5)))
(*
(+ 1.0 (* -0.5 (* h (/ (pow (/ (* D M_m) d) 2.0) (* l 4.0)))))
(/ d (sqrt (* l h))))))))M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
double t_0 = 1.0 / (l * h);
double tmp;
if (l <= -1.12e-106) {
tmp = d * -sqrt(t_0);
} else if (l <= -5e-310) {
tmp = d * cbrt(pow(t_0, 1.5));
} else {
tmp = (1.0 + (-0.5 * (h * (pow(((D * M_m) / d), 2.0) / (l * 4.0))))) * (d / sqrt((l * h)));
}
return tmp;
}
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
double t_0 = 1.0 / (l * h);
double tmp;
if (l <= -1.12e-106) {
tmp = d * -Math.sqrt(t_0);
} else if (l <= -5e-310) {
tmp = d * Math.cbrt(Math.pow(t_0, 1.5));
} else {
tmp = (1.0 + (-0.5 * (h * (Math.pow(((D * M_m) / d), 2.0) / (l * 4.0))))) * (d / Math.sqrt((l * h)));
}
return tmp;
}
M_m = abs(M) d, h, l, M_m, D = sort([d, h, l, M_m, D]) function code(d, h, l, M_m, D) t_0 = Float64(1.0 / Float64(l * h)) tmp = 0.0 if (l <= -1.12e-106) tmp = Float64(d * Float64(-sqrt(t_0))); elseif (l <= -5e-310) tmp = Float64(d * cbrt((t_0 ^ 1.5))); else tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(h * Float64((Float64(Float64(D * M_m) / d) ^ 2.0) / Float64(l * 4.0))))) * Float64(d / sqrt(Float64(l * h)))); end return tmp end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := Block[{t$95$0 = N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.12e-106], N[(d * (-N[Sqrt[t$95$0], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[Power[N[Power[t$95$0, 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(h * N[(N[Power[N[(N[(D * M$95$m), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] / N[(l * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
t_0 := \frac{1}{\ell \cdot h}\\
\mathbf{if}\;\ell \leq -1.12 \cdot 10^{-106}:\\
\;\;\;\;d \cdot \left(-\sqrt{t\_0}\right)\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt[3]{{t\_0}^{1.5}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(h \cdot \frac{{\left(\frac{D \cdot M\_m}{d}\right)}^{2}}{\ell \cdot 4}\right)\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -1.12e-106Initial program 61.0%
Simplified63.3%
associate-*r/65.3%
frac-times63.0%
associate-/l*65.3%
*-commutative65.3%
Applied egg-rr65.3%
*-commutative65.3%
associate-/l*66.5%
associate-*r/64.2%
*-commutative64.2%
times-frac66.5%
Simplified66.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt57.9%
mul-1-neg57.9%
Simplified57.9%
if -1.12e-106 < l < -4.999999999999985e-310Initial program 71.2%
Simplified71.2%
Taylor expanded in d around inf 33.5%
add-cbrt-cube38.3%
pow1/338.3%
add-sqr-sqrt38.3%
pow138.3%
pow1/238.3%
pow-prod-up38.3%
associate-/r*38.3%
metadata-eval38.3%
Applied egg-rr38.3%
unpow1/338.3%
associate-/r*38.3%
Simplified38.3%
if -4.999999999999985e-310 < l Initial program 64.4%
Simplified64.4%
associate-*r/65.9%
frac-times66.0%
associate-/l*65.9%
*-commutative65.9%
Applied egg-rr65.9%
*-commutative65.9%
associate-/l*63.8%
associate-*r/63.9%
*-commutative63.9%
times-frac63.8%
Simplified63.8%
add-cbrt-cube54.9%
add-sqr-sqrt54.9%
cbrt-prod63.6%
Applied egg-rr63.6%
Applied egg-rr73.2%
unpow173.2%
associate-/l*71.8%
*-lft-identity71.8%
*-commutative71.8%
*-rgt-identity71.8%
associate-/l/71.8%
associate-*l/72.5%
Simplified72.5%
Final simplification62.3%
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
:precision binary64
(let* ((t_0 (/ 1.0 (* l h))))
(if (<= l -1.12e-106)
(* d (- (sqrt t_0)))
(if (<= l -5e-310)
(* d (cbrt (pow t_0 1.5)))
(* d (* (pow l -0.5) (pow h -0.5)))))))M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
double t_0 = 1.0 / (l * h);
double tmp;
if (l <= -1.12e-106) {
tmp = d * -sqrt(t_0);
} else if (l <= -5e-310) {
tmp = d * cbrt(pow(t_0, 1.5));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
double t_0 = 1.0 / (l * h);
double tmp;
if (l <= -1.12e-106) {
tmp = d * -Math.sqrt(t_0);
} else if (l <= -5e-310) {
tmp = d * Math.cbrt(Math.pow(t_0, 1.5));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
M_m = abs(M) d, h, l, M_m, D = sort([d, h, l, M_m, D]) function code(d, h, l, M_m, D) t_0 = Float64(1.0 / Float64(l * h)) tmp = 0.0 if (l <= -1.12e-106) tmp = Float64(d * Float64(-sqrt(t_0))); elseif (l <= -5e-310) tmp = Float64(d * cbrt((t_0 ^ 1.5))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := Block[{t$95$0 = N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.12e-106], N[(d * (-N[Sqrt[t$95$0], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[Power[N[Power[t$95$0, 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
t_0 := \frac{1}{\ell \cdot h}\\
\mathbf{if}\;\ell \leq -1.12 \cdot 10^{-106}:\\
\;\;\;\;d \cdot \left(-\sqrt{t\_0}\right)\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt[3]{{t\_0}^{1.5}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1.12e-106Initial program 61.0%
Simplified63.3%
associate-*r/65.3%
frac-times63.0%
associate-/l*65.3%
*-commutative65.3%
Applied egg-rr65.3%
*-commutative65.3%
associate-/l*66.5%
associate-*r/64.2%
*-commutative64.2%
times-frac66.5%
Simplified66.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt57.9%
mul-1-neg57.9%
Simplified57.9%
if -1.12e-106 < l < -4.999999999999985e-310Initial program 71.2%
Simplified71.2%
Taylor expanded in d around inf 33.5%
add-cbrt-cube38.3%
pow1/338.3%
add-sqr-sqrt38.3%
pow138.3%
pow1/238.3%
pow-prod-up38.3%
associate-/r*38.3%
metadata-eval38.3%
Applied egg-rr38.3%
unpow1/338.3%
associate-/r*38.3%
Simplified38.3%
if -4.999999999999985e-310 < l Initial program 64.4%
Simplified64.4%
associate-*r/65.9%
frac-times66.0%
associate-/l*65.9%
*-commutative65.9%
Applied egg-rr65.9%
*-commutative65.9%
associate-/l*63.8%
associate-*r/63.9%
*-commutative63.9%
times-frac63.8%
Simplified63.8%
Taylor expanded in d around inf 47.4%
unpow-147.4%
metadata-eval47.4%
pow-sqr47.4%
rem-sqrt-square48.1%
rem-square-sqrt47.9%
fabs-sqr47.9%
rem-square-sqrt48.1%
Simplified48.1%
*-commutative48.1%
unpow-prod-down54.9%
Applied egg-rr54.9%
Final simplification53.2%
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
:precision binary64
(if (<= l -1.12e-106)
(* d (- (sqrt (/ 1.0 (* l h)))))
(if (<= l 2.2e-283)
(/ d (sqrt (* l h)))
(* d (* (pow l -0.5) (pow h -0.5))))))M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (l <= -1.12e-106) {
tmp = d * -sqrt((1.0 / (l * h)));
} else if (l <= 2.2e-283) {
tmp = d / sqrt((l * h));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1.12d-106)) then
tmp = d * -sqrt((1.0d0 / (l * h)))
else if (l <= 2.2d-283) then
tmp = d / sqrt((l * h))
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (l <= -1.12e-106) {
tmp = d * -Math.sqrt((1.0 / (l * h)));
} else if (l <= 2.2e-283) {
tmp = d / Math.sqrt((l * h));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
M_m = math.fabs(M) [d, h, l, M_m, D] = sort([d, h, l, M_m, D]) def code(d, h, l, M_m, D): tmp = 0 if l <= -1.12e-106: tmp = d * -math.sqrt((1.0 / (l * h))) elif l <= 2.2e-283: tmp = d / math.sqrt((l * h)) else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
M_m = abs(M) d, h, l, M_m, D = sort([d, h, l, M_m, D]) function code(d, h, l, M_m, D) tmp = 0.0 if (l <= -1.12e-106) tmp = Float64(d * Float64(-sqrt(Float64(1.0 / Float64(l * h))))); elseif (l <= 2.2e-283) tmp = Float64(d / sqrt(Float64(l * h))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
tmp = 0.0;
if (l <= -1.12e-106)
tmp = d * -sqrt((1.0 / (l * h)));
elseif (l <= 2.2e-283)
tmp = d / sqrt((l * h));
else
tmp = d * ((l ^ -0.5) * (h ^ -0.5));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[l, -1.12e-106], N[(d * (-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, 2.2e-283], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.12 \cdot 10^{-106}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{elif}\;\ell \leq 2.2 \cdot 10^{-283}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1.12e-106Initial program 61.0%
Simplified63.3%
associate-*r/65.3%
frac-times63.0%
associate-/l*65.3%
*-commutative65.3%
Applied egg-rr65.3%
*-commutative65.3%
associate-/l*66.5%
associate-*r/64.2%
*-commutative64.2%
times-frac66.5%
Simplified66.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt57.9%
mul-1-neg57.9%
Simplified57.9%
if -1.12e-106 < l < 2.1999999999999998e-283Initial program 70.8%
Simplified70.8%
Taylor expanded in d around inf 35.6%
associate-/r*35.6%
Simplified35.6%
pow135.6%
associate-/l/35.6%
sqrt-div35.6%
metadata-eval35.6%
Applied egg-rr35.6%
unpow135.6%
associate-*r/35.7%
*-rgt-identity35.7%
*-commutative35.7%
Simplified35.7%
if 2.1999999999999998e-283 < l Initial program 64.2%
Simplified64.2%
associate-*r/65.8%
frac-times65.9%
associate-/l*65.8%
*-commutative65.8%
Applied egg-rr65.8%
*-commutative65.8%
associate-/l*63.6%
associate-*r/63.7%
*-commutative63.7%
times-frac63.6%
Simplified63.6%
Taylor expanded in d around inf 47.2%
unpow-147.2%
metadata-eval47.2%
pow-sqr47.3%
rem-sqrt-square48.0%
rem-square-sqrt47.8%
fabs-sqr47.8%
rem-square-sqrt48.0%
Simplified48.0%
*-commutative48.0%
unpow-prod-down55.1%
Applied egg-rr55.1%
Final simplification52.5%
M_m = (fabs.f64 M) NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. (FPCore (d h l M_m D) :precision binary64 (if (<= l -1.12e-106) (* d (- (sqrt (/ 1.0 (* l h))))) (if (<= l 3.2e-283) (/ d (sqrt (* l h))) (* d (/ (pow h -0.5) (sqrt l))))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (l <= -1.12e-106) {
tmp = d * -sqrt((1.0 / (l * h)));
} else if (l <= 3.2e-283) {
tmp = d / sqrt((l * h));
} else {
tmp = d * (pow(h, -0.5) / sqrt(l));
}
return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1.12d-106)) then
tmp = d * -sqrt((1.0d0 / (l * h)))
else if (l <= 3.2d-283) then
tmp = d / sqrt((l * h))
else
tmp = d * ((h ** (-0.5d0)) / sqrt(l))
end if
code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (l <= -1.12e-106) {
tmp = d * -Math.sqrt((1.0 / (l * h)));
} else if (l <= 3.2e-283) {
tmp = d / Math.sqrt((l * h));
} else {
tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
}
return tmp;
}
M_m = math.fabs(M) [d, h, l, M_m, D] = sort([d, h, l, M_m, D]) def code(d, h, l, M_m, D): tmp = 0 if l <= -1.12e-106: tmp = d * -math.sqrt((1.0 / (l * h))) elif l <= 3.2e-283: tmp = d / math.sqrt((l * h)) else: tmp = d * (math.pow(h, -0.5) / math.sqrt(l)) return tmp
M_m = abs(M) d, h, l, M_m, D = sort([d, h, l, M_m, D]) function code(d, h, l, M_m, D) tmp = 0.0 if (l <= -1.12e-106) tmp = Float64(d * Float64(-sqrt(Float64(1.0 / Float64(l * h))))); elseif (l <= 3.2e-283) tmp = Float64(d / sqrt(Float64(l * h))); else tmp = Float64(d * Float64((h ^ -0.5) / sqrt(l))); end return tmp end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
tmp = 0.0;
if (l <= -1.12e-106)
tmp = d * -sqrt((1.0 / (l * h)));
elseif (l <= 3.2e-283)
tmp = d / sqrt((l * h));
else
tmp = d * ((h ^ -0.5) / sqrt(l));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[l, -1.12e-106], N[(d * (-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, 3.2e-283], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.12 \cdot 10^{-106}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{elif}\;\ell \leq 3.2 \cdot 10^{-283}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.12e-106Initial program 61.0%
Simplified63.3%
associate-*r/65.3%
frac-times63.0%
associate-/l*65.3%
*-commutative65.3%
Applied egg-rr65.3%
*-commutative65.3%
associate-/l*66.5%
associate-*r/64.2%
*-commutative64.2%
times-frac66.5%
Simplified66.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt57.9%
mul-1-neg57.9%
Simplified57.9%
if -1.12e-106 < l < 3.20000000000000012e-283Initial program 70.8%
Simplified70.8%
Taylor expanded in d around inf 35.6%
associate-/r*35.6%
Simplified35.6%
pow135.6%
associate-/l/35.6%
sqrt-div35.6%
metadata-eval35.6%
Applied egg-rr35.6%
unpow135.6%
associate-*r/35.7%
*-rgt-identity35.7%
*-commutative35.7%
Simplified35.7%
if 3.20000000000000012e-283 < l Initial program 64.2%
Simplified64.2%
associate-*r/65.8%
frac-times65.9%
associate-/l*65.8%
*-commutative65.8%
Applied egg-rr65.8%
*-commutative65.8%
associate-/l*63.6%
associate-*r/63.7%
*-commutative63.7%
times-frac63.6%
Simplified63.6%
Taylor expanded in d around inf 47.2%
unpow-147.2%
metadata-eval47.2%
pow-sqr47.3%
rem-sqrt-square48.0%
rem-square-sqrt47.8%
fabs-sqr47.8%
rem-square-sqrt48.0%
Simplified48.0%
add-sqr-sqrt47.8%
sqrt-unprod47.3%
pow-prod-up47.2%
metadata-eval47.2%
inv-pow47.2%
*-commutative47.2%
associate-/l/47.6%
sqrt-div55.1%
inv-pow55.1%
sqrt-pow155.1%
metadata-eval55.1%
Applied egg-rr55.1%
Final simplification52.4%
M_m = (fabs.f64 M) NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. (FPCore (d h l M_m D) :precision binary64 (if (<= l -1.12e-106) (* d (- (sqrt (/ 1.0 (* l h))))) (* d (pow (* l h) -0.5))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (l <= -1.12e-106) {
tmp = d * -sqrt((1.0 / (l * h)));
} else {
tmp = d * pow((l * h), -0.5);
}
return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1.12d-106)) then
tmp = d * -sqrt((1.0d0 / (l * h)))
else
tmp = d * ((l * h) ** (-0.5d0))
end if
code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (l <= -1.12e-106) {
tmp = d * -Math.sqrt((1.0 / (l * h)));
} else {
tmp = d * Math.pow((l * h), -0.5);
}
return tmp;
}
M_m = math.fabs(M) [d, h, l, M_m, D] = sort([d, h, l, M_m, D]) def code(d, h, l, M_m, D): tmp = 0 if l <= -1.12e-106: tmp = d * -math.sqrt((1.0 / (l * h))) else: tmp = d * math.pow((l * h), -0.5) return tmp
M_m = abs(M) d, h, l, M_m, D = sort([d, h, l, M_m, D]) function code(d, h, l, M_m, D) tmp = 0.0 if (l <= -1.12e-106) tmp = Float64(d * Float64(-sqrt(Float64(1.0 / Float64(l * h))))); else tmp = Float64(d * (Float64(l * h) ^ -0.5)); end return tmp end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
tmp = 0.0;
if (l <= -1.12e-106)
tmp = d * -sqrt((1.0 / (l * h)));
else
tmp = d * ((l * h) ^ -0.5);
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[l, -1.12e-106], N[(d * (-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.12 \cdot 10^{-106}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if l < -1.12e-106Initial program 61.0%
Simplified63.3%
associate-*r/65.3%
frac-times63.0%
associate-/l*65.3%
*-commutative65.3%
Applied egg-rr65.3%
*-commutative65.3%
associate-/l*66.5%
associate-*r/64.2%
*-commutative64.2%
times-frac66.5%
Simplified66.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt57.9%
mul-1-neg57.9%
Simplified57.9%
if -1.12e-106 < l Initial program 66.0%
Simplified66.0%
associate-*r/68.0%
frac-times68.0%
associate-/l*68.0%
*-commutative68.0%
Applied egg-rr68.0%
*-commutative68.0%
associate-/l*66.4%
associate-*r/66.4%
*-commutative66.4%
times-frac66.4%
Simplified66.4%
Taylor expanded in d around inf 44.1%
unpow-144.1%
metadata-eval44.1%
pow-sqr44.1%
rem-sqrt-square44.6%
rem-square-sqrt44.5%
fabs-sqr44.5%
rem-square-sqrt44.6%
Simplified44.6%
Final simplification49.0%
M_m = (fabs.f64 M) NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. (FPCore (d h l M_m D) :precision binary64 (let* ((t_0 (pow (* l h) -0.5))) (if (<= l -1.12e-106) (* d (- t_0)) (* d t_0))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
double t_0 = pow((l * h), -0.5);
double tmp;
if (l <= -1.12e-106) {
tmp = d * -t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (l * h) ** (-0.5d0)
if (l <= (-1.12d-106)) then
tmp = d * -t_0
else
tmp = d * t_0
end if
code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
double t_0 = Math.pow((l * h), -0.5);
double tmp;
if (l <= -1.12e-106) {
tmp = d * -t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
M_m = math.fabs(M) [d, h, l, M_m, D] = sort([d, h, l, M_m, D]) def code(d, h, l, M_m, D): t_0 = math.pow((l * h), -0.5) tmp = 0 if l <= -1.12e-106: tmp = d * -t_0 else: tmp = d * t_0 return tmp
M_m = abs(M) d, h, l, M_m, D = sort([d, h, l, M_m, D]) function code(d, h, l, M_m, D) t_0 = Float64(l * h) ^ -0.5 tmp = 0.0 if (l <= -1.12e-106) tmp = Float64(d * Float64(-t_0)); else tmp = Float64(d * t_0); end return tmp end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
t_0 = (l * h) ^ -0.5;
tmp = 0.0;
if (l <= -1.12e-106)
tmp = d * -t_0;
else
tmp = d * t_0;
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := Block[{t$95$0 = N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[l, -1.12e-106], N[(d * (-t$95$0)), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
t_0 := {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq -1.12 \cdot 10^{-106}:\\
\;\;\;\;d \cdot \left(-t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot t\_0\\
\end{array}
\end{array}
if l < -1.12e-106Initial program 61.0%
Simplified63.3%
associate-*r/65.3%
frac-times63.0%
associate-/l*65.3%
*-commutative65.3%
Applied egg-rr65.3%
*-commutative65.3%
associate-/l*66.5%
associate-*r/64.2%
*-commutative64.2%
times-frac66.5%
Simplified66.5%
Taylor expanded in l 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-sqrt57.9%
mul-1-neg57.9%
Simplified57.9%
if -1.12e-106 < l Initial program 66.0%
Simplified66.0%
associate-*r/68.0%
frac-times68.0%
associate-/l*68.0%
*-commutative68.0%
Applied egg-rr68.0%
*-commutative68.0%
associate-/l*66.4%
associate-*r/66.4%
*-commutative66.4%
times-frac66.4%
Simplified66.4%
Taylor expanded in d around inf 44.1%
unpow-144.1%
metadata-eval44.1%
pow-sqr44.1%
rem-sqrt-square44.6%
rem-square-sqrt44.5%
fabs-sqr44.5%
rem-square-sqrt44.6%
Simplified44.6%
Final simplification49.0%
M_m = (fabs.f64 M) NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. (FPCore (d h l M_m D) :precision binary64 (if (<= l -1.4e-106) (sqrt (/ (* d (/ d h)) l)) (* d (pow (* l h) -0.5))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (l <= -1.4e-106) {
tmp = sqrt(((d * (d / h)) / l));
} else {
tmp = d * pow((l * h), -0.5);
}
return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1.4d-106)) then
tmp = sqrt(((d * (d / h)) / l))
else
tmp = d * ((l * h) ** (-0.5d0))
end if
code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
double tmp;
if (l <= -1.4e-106) {
tmp = Math.sqrt(((d * (d / h)) / l));
} else {
tmp = d * Math.pow((l * h), -0.5);
}
return tmp;
}
M_m = math.fabs(M) [d, h, l, M_m, D] = sort([d, h, l, M_m, D]) def code(d, h, l, M_m, D): tmp = 0 if l <= -1.4e-106: tmp = math.sqrt(((d * (d / h)) / l)) else: tmp = d * math.pow((l * h), -0.5) return tmp
M_m = abs(M) d, h, l, M_m, D = sort([d, h, l, M_m, D]) function code(d, h, l, M_m, D) tmp = 0.0 if (l <= -1.4e-106) tmp = sqrt(Float64(Float64(d * Float64(d / h)) / l)); else tmp = Float64(d * (Float64(l * h) ^ -0.5)); end return tmp end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
tmp = 0.0;
if (l <= -1.4e-106)
tmp = sqrt(((d * (d / h)) / l));
else
tmp = d * ((l * h) ^ -0.5);
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[l, -1.4e-106], N[Sqrt[N[(N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.4 \cdot 10^{-106}:\\
\;\;\;\;\sqrt{\frac{d \cdot \frac{d}{h}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if l < -1.39999999999999994e-106Initial program 61.0%
Simplified63.3%
Taylor expanded in M around 0 51.6%
pow151.6%
pow1/251.6%
*-rgt-identity51.6%
pow1/251.6%
pow-prod-down40.5%
Applied egg-rr40.5%
unpow140.5%
unpow1/240.5%
associate-*r/37.7%
Simplified37.7%
if -1.39999999999999994e-106 < l Initial program 66.0%
Simplified66.0%
associate-*r/68.0%
frac-times68.0%
associate-/l*68.0%
*-commutative68.0%
Applied egg-rr68.0%
*-commutative68.0%
associate-/l*66.4%
associate-*r/66.4%
*-commutative66.4%
times-frac66.4%
Simplified66.4%
Taylor expanded in d around inf 44.1%
unpow-144.1%
metadata-eval44.1%
pow-sqr44.1%
rem-sqrt-square44.6%
rem-square-sqrt44.5%
fabs-sqr44.5%
rem-square-sqrt44.6%
Simplified44.6%
Final simplification42.4%
M_m = (fabs.f64 M) NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. (FPCore (d h l M_m D) :precision binary64 (* d (pow (* l h) -0.5)))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
return d * pow((l * h), -0.5);
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_1
code = d * ((l * h) ** (-0.5d0))
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
return d * Math.pow((l * h), -0.5);
}
M_m = math.fabs(M) [d, h, l, M_m, D] = sort([d, h, l, M_m, D]) def code(d, h, l, M_m, D): return d * math.pow((l * h), -0.5)
M_m = abs(M) d, h, l, M_m, D = sort([d, h, l, M_m, D]) function code(d, h, l, M_m, D) return Float64(d * (Float64(l * h) ^ -0.5)) end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp = code(d, h, l, M_m, D)
tmp = d * ((l * h) ^ -0.5);
end
M_m = N[Abs[M], $MachinePrecision] NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D_] := N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
d \cdot {\left(\ell \cdot h\right)}^{-0.5}
\end{array}
Initial program 64.4%
Simplified65.1%
associate-*r/67.1%
frac-times66.3%
associate-/l*67.1%
*-commutative67.1%
Applied egg-rr67.1%
*-commutative67.1%
associate-/l*66.4%
associate-*r/65.7%
*-commutative65.7%
times-frac66.4%
Simplified66.4%
Taylor expanded in d around inf 32.3%
unpow-132.3%
metadata-eval32.3%
pow-sqr32.3%
rem-sqrt-square32.7%
rem-square-sqrt32.6%
fabs-sqr32.6%
rem-square-sqrt32.7%
Simplified32.7%
Final simplification32.7%
M_m = (fabs.f64 M) NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. (FPCore (d h l M_m D) :precision binary64 (/ d (sqrt (* l h))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
return d / sqrt((l * h));
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_1
code = d / sqrt((l * h))
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
return d / Math.sqrt((l * h));
}
M_m = math.fabs(M) [d, h, l, M_m, D] = sort([d, h, l, M_m, D]) def code(d, h, l, M_m, D): return d / math.sqrt((l * h))
M_m = abs(M) d, h, l, M_m, D = sort([d, h, l, M_m, D]) function code(d, h, l, M_m, D) return Float64(d / sqrt(Float64(l * h))) end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp = code(d, h, l, M_m, D)
tmp = d / sqrt((l * h));
end
M_m = N[Abs[M], $MachinePrecision] NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 64.4%
Simplified65.1%
Taylor expanded in d around inf 32.3%
associate-/r*32.5%
Simplified32.5%
pow132.5%
associate-/l/32.3%
sqrt-div32.6%
metadata-eval32.6%
Applied egg-rr32.6%
unpow132.6%
associate-*r/32.6%
*-rgt-identity32.6%
*-commutative32.6%
Simplified32.6%
Final simplification32.6%
herbie shell --seed 2024097
(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)))))