
(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 21 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}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= h -5e-310)
(*
(/ (sqrt (- d)) (sqrt (- h)))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))))))
(*
(/ d (* (sqrt l) (sqrt h)))
(+ 1.0 (* (/ h l) (* (pow (/ (* D (* 0.5 M)) d) 2.0) -0.5))))))M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -5e-310) {
tmp = (sqrt(-d) / sqrt(-h)) * (sqrt((d / l)) * (1.0 - (0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))));
} else {
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + ((h / l) * (pow(((D * (0.5 * M)) / d), 2.0) * -0.5)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 <= (-5d-310)) then
tmp = (sqrt(-d) / sqrt(-h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l)))))
else
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0d0 + ((h / l) * ((((d_1 * (0.5d0 * m)) / d) ** 2.0d0) * (-0.5d0))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -5e-310) {
tmp = (Math.sqrt(-d) / Math.sqrt(-h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))));
} else {
tmp = (d / (Math.sqrt(l) * Math.sqrt(h))) * (1.0 + ((h / l) * (Math.pow(((D * (0.5 * M)) / d), 2.0) * -0.5)));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if h <= -5e-310: tmp = (math.sqrt(-d) / math.sqrt(-h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))))) else: tmp = (d / (math.sqrt(l) * math.sqrt(h))) * (1.0 + ((h / l) * (math.pow(((D * (0.5 * M)) / d), 2.0) * -0.5))) return tmp
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (h <= -5e-310) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l)))))); else tmp = Float64(Float64(d / Float64(sqrt(l) * sqrt(h))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(D * Float64(0.5 * M)) / d) ^ 2.0) * -0.5)))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (h <= -5e-310)
tmp = (sqrt(-d) / sqrt(-h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l)))));
else
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + ((h / l) * ((((D * (0.5 * M)) / d) ^ 2.0) * -0.5)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[h, -5e-310], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * N[(0.5 * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot \left(0.5 \cdot M\right)}{d}\right)}^{2} \cdot -0.5\right)\right)\\
\end{array}
\end{array}
if h < -4.999999999999985e-310Initial program 63.3%
associate-*l*63.4%
metadata-eval63.4%
unpow1/263.4%
metadata-eval63.4%
unpow1/263.4%
associate-*l*63.4%
metadata-eval63.4%
times-frac61.9%
Simplified61.9%
frac-2neg61.9%
sqrt-div70.5%
Applied egg-rr70.5%
if -4.999999999999985e-310 < h Initial program 68.6%
metadata-eval68.6%
unpow1/268.6%
metadata-eval68.6%
unpow1/268.6%
*-commutative68.6%
associate-*l*68.6%
times-frac68.6%
metadata-eval68.6%
Simplified68.6%
Applied egg-rr75.2%
distribute-rgt1-in78.4%
+-commutative78.4%
*-commutative78.4%
*-commutative78.4%
associate-*r/78.4%
*-commutative78.4%
Simplified78.4%
Final simplification74.3%
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0)))))
4e+300)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(- 1.0 (pow (* (* (/ D d) (* 0.5 M)) (sqrt (/ 0.5 (/ l h)))) 2.0)))
(* d (- (pow (* h l) -0.5)))))M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((M * D) / (d * 2.0)), 2.0))))) <= 4e+300) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - pow((((D / d) * (0.5 * M)) * sqrt((0.5 / (l / h)))), 2.0));
} else {
tmp = d * -pow((h * l), -0.5);
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((m * d_1) / (d * 2.0d0)) ** 2.0d0))))) <= 4d+300) then
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - ((((d_1 / d) * (0.5d0 * m)) * sqrt((0.5d0 / (l / h)))) ** 2.0d0))
else
tmp = d * -((h * l) ** (-0.5d0))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * Math.pow(((M * D) / (d * 2.0)), 2.0))))) <= 4e+300) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - Math.pow((((D / d) * (0.5 * M)) * Math.sqrt((0.5 / (l / h)))), 2.0));
} else {
tmp = d * -Math.pow((h * l), -0.5);
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if ((math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * math.pow(((M * D) / (d * 2.0)), 2.0))))) <= 4e+300: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - math.pow((((D / d) * (0.5 * M)) * math.sqrt((0.5 / (l / h)))), 2.0)) else: tmp = d * -math.pow((h * l), -0.5) return tmp
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0))))) <= 4e+300) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - (Float64(Float64(Float64(D / d) * Float64(0.5 * M)) * sqrt(Float64(0.5 / Float64(l / h)))) ^ 2.0))); else tmp = Float64(d * Float64(-(Float64(h * l) ^ -0.5))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (((((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((M * D) / (d * 2.0)) ^ 2.0))))) <= 4e+300)
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((((D / d) * (0.5 * M)) * sqrt((0.5 / (l / h)))) ^ 2.0));
else
tmp = d * -((h * l) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4e+300], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[Power[N[(N[(N[(D / d), $MachinePrecision] * N[(0.5 * M), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(0.5 / N[(l / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * (-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right)\right) \leq 4 \cdot 10^{+300}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - {\left(\left(\frac{D}{d} \cdot \left(0.5 \cdot M\right)\right) \cdot \sqrt{\frac{0.5}{\frac{\ell}{h}}}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < 4.0000000000000002e300Initial program 84.9%
metadata-eval84.9%
unpow1/284.9%
metadata-eval84.9%
unpow1/285.0%
*-commutative85.0%
associate-*l*85.0%
times-frac83.9%
metadata-eval83.9%
Simplified83.9%
associate-*r*83.9%
frac-times85.0%
*-commutative85.0%
metadata-eval85.0%
add-sqr-sqrt85.0%
pow285.0%
Applied egg-rr85.9%
if 4.0000000000000002e300 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) Initial program 14.2%
metadata-eval14.2%
unpow1/214.2%
metadata-eval14.2%
unpow1/214.2%
*-commutative14.2%
associate-*l*14.2%
times-frac14.2%
metadata-eval14.2%
Simplified14.2%
Applied egg-rr14.2%
associate-*l*14.2%
associate-*r/14.2%
*-commutative14.2%
Simplified14.2%
Taylor expanded in d around -inf 34.6%
mul-1-neg34.6%
distribute-rgt-neg-in34.6%
unpow-134.6%
sqr-pow34.6%
rem-sqrt-square34.6%
metadata-eval34.6%
sqr-pow34.4%
fabs-sqr34.4%
sqr-pow34.6%
*-commutative34.6%
Simplified34.6%
Final simplification72.1%
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0)))))
4e+300)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(- 1.0 (* (pow (/ (* 0.5 (* M D)) d) 2.0) (* 0.5 (/ h l)))))
(* d (- (pow (* h l) -0.5)))))M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((M * D) / (d * 2.0)), 2.0))))) <= 4e+300) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (pow(((0.5 * (M * D)) / d), 2.0) * (0.5 * (h / l))));
} else {
tmp = d * -pow((h * l), -0.5);
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((m * d_1) / (d * 2.0d0)) ** 2.0d0))))) <= 4d+300) then
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - ((((0.5d0 * (m * d_1)) / d) ** 2.0d0) * (0.5d0 * (h / l))))
else
tmp = d * -((h * l) ** (-0.5d0))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * Math.pow(((M * D) / (d * 2.0)), 2.0))))) <= 4e+300) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (Math.pow(((0.5 * (M * D)) / d), 2.0) * (0.5 * (h / l))));
} else {
tmp = d * -Math.pow((h * l), -0.5);
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if ((math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * math.pow(((M * D) / (d * 2.0)), 2.0))))) <= 4e+300: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (math.pow(((0.5 * (M * D)) / d), 2.0) * (0.5 * (h / l)))) else: tmp = d * -math.pow((h * l), -0.5) return tmp
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0))))) <= 4e+300) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64((Float64(Float64(0.5 * Float64(M * D)) / d) ^ 2.0) * Float64(0.5 * Float64(h / l))))); else tmp = Float64(d * Float64(-(Float64(h * l) ^ -0.5))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (((((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((M * D) / (d * 2.0)) ^ 2.0))))) <= 4e+300)
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((((0.5 * (M * D)) / d) ^ 2.0) * (0.5 * (h / l))));
else
tmp = d * -((h * l) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4e+300], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[Power[N[(N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * N[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * (-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right)\right) \leq 4 \cdot 10^{+300}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - {\left(\frac{0.5 \cdot \left(M \cdot D\right)}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < 4.0000000000000002e300Initial program 84.9%
metadata-eval84.9%
unpow1/284.9%
metadata-eval84.9%
unpow1/285.0%
*-commutative85.0%
associate-*l*85.0%
times-frac83.9%
metadata-eval83.9%
Simplified83.9%
frac-times85.0%
associate-/r*85.0%
div-inv85.0%
metadata-eval85.0%
Applied egg-rr85.0%
if 4.0000000000000002e300 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) Initial program 14.2%
metadata-eval14.2%
unpow1/214.2%
metadata-eval14.2%
unpow1/214.2%
*-commutative14.2%
associate-*l*14.2%
times-frac14.2%
metadata-eval14.2%
Simplified14.2%
Applied egg-rr14.2%
associate-*l*14.2%
associate-*r/14.2%
*-commutative14.2%
Simplified14.2%
Taylor expanded in d around -inf 34.6%
mul-1-neg34.6%
distribute-rgt-neg-in34.6%
unpow-134.6%
sqr-pow34.6%
rem-sqrt-square34.6%
metadata-eval34.6%
sqr-pow34.4%
fabs-sqr34.4%
sqr-pow34.6%
*-commutative34.6%
Simplified34.6%
Final simplification71.4%
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= l -2e-304)
(*
(sqrt (/ d h))
(*
(- 1.0 (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))))
(/ (sqrt (- d)) (sqrt (- l)))))
(*
(/ d (* (sqrt l) (sqrt h)))
(+ 1.0 (* (/ h l) (* (pow (/ (* D (* 0.5 M)) d) 2.0) -0.5))))))M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-304) {
tmp = sqrt((d / h)) * ((1.0 - (0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))) * (sqrt(-d) / sqrt(-l)));
} else {
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + ((h / l) * (pow(((D * (0.5 * M)) / d), 2.0) * -0.5)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-2d-304)) then
tmp = sqrt((d / h)) * ((1.0d0 - (0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l)))) * (sqrt(-d) / sqrt(-l)))
else
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0d0 + ((h / l) * ((((d_1 * (0.5d0 * m)) / d) ** 2.0d0) * (-0.5d0))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-304) {
tmp = Math.sqrt((d / h)) * ((1.0 - (0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))) * (Math.sqrt(-d) / Math.sqrt(-l)));
} else {
tmp = (d / (Math.sqrt(l) * Math.sqrt(h))) * (1.0 + ((h / l) * (Math.pow(((D * (0.5 * M)) / d), 2.0) * -0.5)));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if l <= -2e-304: tmp = math.sqrt((d / h)) * ((1.0 - (0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))) * (math.sqrt(-d) / math.sqrt(-l))) else: tmp = (d / (math.sqrt(l) * math.sqrt(h))) * (1.0 + ((h / l) * (math.pow(((D * (0.5 * M)) / d), 2.0) * -0.5))) return tmp
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= -2e-304) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l)))) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))))); else tmp = Float64(Float64(d / Float64(sqrt(l) * sqrt(h))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(D * Float64(0.5 * M)) / d) ^ 2.0) * -0.5)))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= -2e-304)
tmp = sqrt((d / h)) * ((1.0 - (0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l)))) * (sqrt(-d) / sqrt(-l)));
else
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + ((h / l) * ((((D * (0.5 * M)) / d) ^ 2.0) * -0.5)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2e-304], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * N[(0.5 * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-304}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot \left(0.5 \cdot M\right)}{d}\right)}^{2} \cdot -0.5\right)\right)\\
\end{array}
\end{array}
if l < -1.99999999999999994e-304Initial program 63.8%
associate-*l*63.8%
metadata-eval63.8%
unpow1/263.8%
metadata-eval63.8%
unpow1/263.9%
associate-*l*63.9%
metadata-eval63.9%
times-frac62.4%
Simplified62.4%
frac-2neg62.4%
sqrt-div68.0%
Applied egg-rr68.0%
if -1.99999999999999994e-304 < l Initial program 68.1%
metadata-eval68.1%
unpow1/268.1%
metadata-eval68.1%
unpow1/268.1%
*-commutative68.1%
associate-*l*68.1%
times-frac68.1%
metadata-eval68.1%
Simplified68.1%
Applied egg-rr74.6%
distribute-rgt1-in77.8%
+-commutative77.8%
*-commutative77.8%
*-commutative77.8%
associate-*r/77.7%
*-commutative77.7%
Simplified77.7%
Final simplification72.7%
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= h -5e-310)
(*
(* (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ d l)))
(- 1.0 (* (pow (* D (/ M (/ d 0.5))) 2.0) (* h (/ 0.5 l)))))
(*
(/ d (* (sqrt l) (sqrt h)))
(+ 1.0 (* (/ h l) (* (pow (/ (* D (* 0.5 M)) d) 2.0) -0.5))))))M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -5e-310) {
tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * (1.0 - (pow((D * (M / (d / 0.5))), 2.0) * (h * (0.5 / l))));
} else {
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + ((h / l) * (pow(((D * (0.5 * M)) / d), 2.0) * -0.5)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 <= (-5d-310)) then
tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * (1.0d0 - (((d_1 * (m / (d / 0.5d0))) ** 2.0d0) * (h * (0.5d0 / l))))
else
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0d0 + ((h / l) * ((((d_1 * (0.5d0 * m)) / d) ** 2.0d0) * (-0.5d0))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -5e-310) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-h)) * Math.sqrt((d / l))) * (1.0 - (Math.pow((D * (M / (d / 0.5))), 2.0) * (h * (0.5 / l))));
} else {
tmp = (d / (Math.sqrt(l) * Math.sqrt(h))) * (1.0 + ((h / l) * (Math.pow(((D * (0.5 * M)) / d), 2.0) * -0.5)));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if h <= -5e-310: tmp = ((math.sqrt(-d) / math.sqrt(-h)) * math.sqrt((d / l))) * (1.0 - (math.pow((D * (M / (d / 0.5))), 2.0) * (h * (0.5 / l)))) else: tmp = (d / (math.sqrt(l) * math.sqrt(h))) * (1.0 + ((h / l) * (math.pow(((D * (0.5 * M)) / d), 2.0) * -0.5))) return tmp
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (h <= -5e-310) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * sqrt(Float64(d / l))) * Float64(1.0 - Float64((Float64(D * Float64(M / Float64(d / 0.5))) ^ 2.0) * Float64(h * Float64(0.5 / l))))); else tmp = Float64(Float64(d / Float64(sqrt(l) * sqrt(h))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(D * Float64(0.5 * M)) / d) ^ 2.0) * -0.5)))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (h <= -5e-310)
tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * (1.0 - (((D * (M / (d / 0.5))) ^ 2.0) * (h * (0.5 / l))));
else
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + ((h / l) * ((((D * (0.5 * M)) / d) ^ 2.0) * -0.5)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[h, -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[(N[Power[N[(D * N[(M / N[(d / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h * N[(0.5 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * N[(0.5 * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(D \cdot \frac{M}{\frac{d}{0.5}}\right)}^{2} \cdot \left(h \cdot \frac{0.5}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot \left(0.5 \cdot M\right)}{d}\right)}^{2} \cdot -0.5\right)\right)\\
\end{array}
\end{array}
if h < -4.999999999999985e-310Initial program 63.3%
metadata-eval63.3%
unpow1/263.3%
metadata-eval63.3%
unpow1/263.4%
*-commutative63.4%
associate-*l*63.4%
times-frac61.9%
metadata-eval61.9%
Simplified61.9%
associate-*r*61.9%
frac-times63.4%
*-commutative63.4%
metadata-eval63.4%
expm1-log1p-u63.2%
expm1-udef63.2%
Applied egg-rr61.9%
+-commutative61.9%
associate--l+61.9%
metadata-eval61.9%
+-rgt-identity61.9%
associate-/r/61.9%
associate-*r/63.4%
associate-*l/63.4%
*-commutative63.4%
associate-/l*63.4%
*-commutative63.4%
Simplified63.4%
frac-2neg61.9%
sqrt-div70.5%
Applied egg-rr71.9%
if -4.999999999999985e-310 < h Initial program 68.6%
metadata-eval68.6%
unpow1/268.6%
metadata-eval68.6%
unpow1/268.6%
*-commutative68.6%
associate-*l*68.6%
times-frac68.6%
metadata-eval68.6%
Simplified68.6%
Applied egg-rr75.2%
distribute-rgt1-in78.4%
+-commutative78.4%
*-commutative78.4%
*-commutative78.4%
associate-*r/78.4%
*-commutative78.4%
Simplified78.4%
Final simplification75.0%
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= h -8.2e-224)
(*
(/ 1.0 (sqrt (/ h d)))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (* (* (/ D d) (/ D d)) (* (/ (* M M) (/ l h)) 0.25))))))
(if (<= h -5e-310)
(* d (- (pow (* h l) -0.5)))
(*
(/ d (* (sqrt l) (sqrt h)))
(+ 1.0 (* (/ h l) (* (pow (/ (* D (* 0.5 M)) d) 2.0) -0.5)))))))M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -8.2e-224) {
tmp = (1.0 / sqrt((h / d))) * (sqrt((d / l)) * (1.0 - (0.5 * (((D / d) * (D / d)) * (((M * M) / (l / h)) * 0.25)))));
} else if (h <= -5e-310) {
tmp = d * -pow((h * l), -0.5);
} else {
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + ((h / l) * (pow(((D * (0.5 * M)) / d), 2.0) * -0.5)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 <= (-8.2d-224)) then
tmp = (1.0d0 / sqrt((h / d))) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * (((d_1 / d) * (d_1 / d)) * (((m * m) / (l / h)) * 0.25d0)))))
else if (h <= (-5d-310)) then
tmp = d * -((h * l) ** (-0.5d0))
else
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0d0 + ((h / l) * ((((d_1 * (0.5d0 * m)) / d) ** 2.0d0) * (-0.5d0))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -8.2e-224) {
tmp = (1.0 / Math.sqrt((h / d))) * (Math.sqrt((d / l)) * (1.0 - (0.5 * (((D / d) * (D / d)) * (((M * M) / (l / h)) * 0.25)))));
} else if (h <= -5e-310) {
tmp = d * -Math.pow((h * l), -0.5);
} else {
tmp = (d / (Math.sqrt(l) * Math.sqrt(h))) * (1.0 + ((h / l) * (Math.pow(((D * (0.5 * M)) / d), 2.0) * -0.5)));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if h <= -8.2e-224: tmp = (1.0 / math.sqrt((h / d))) * (math.sqrt((d / l)) * (1.0 - (0.5 * (((D / d) * (D / d)) * (((M * M) / (l / h)) * 0.25))))) elif h <= -5e-310: tmp = d * -math.pow((h * l), -0.5) else: tmp = (d / (math.sqrt(l) * math.sqrt(h))) * (1.0 + ((h / l) * (math.pow(((D * (0.5 * M)) / d), 2.0) * -0.5))) return tmp
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (h <= -8.2e-224) tmp = Float64(Float64(1.0 / sqrt(Float64(h / d))) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(Float64(M * M) / Float64(l / h)) * 0.25)))))); elseif (h <= -5e-310) tmp = Float64(d * Float64(-(Float64(h * l) ^ -0.5))); else tmp = Float64(Float64(d / Float64(sqrt(l) * sqrt(h))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(D * Float64(0.5 * M)) / d) ^ 2.0) * -0.5)))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (h <= -8.2e-224)
tmp = (1.0 / sqrt((h / d))) * (sqrt((d / l)) * (1.0 - (0.5 * (((D / d) * (D / d)) * (((M * M) / (l / h)) * 0.25)))));
elseif (h <= -5e-310)
tmp = d * -((h * l) ^ -0.5);
else
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + ((h / l) * ((((D * (0.5 * M)) / d) ^ 2.0) * -0.5)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[h, -8.2e-224], N[(N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(d * (-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], N[(N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * N[(0.5 * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -8.2 \cdot 10^{-224}:\\
\;\;\;\;\frac{1}{\sqrt{\frac{h}{d}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(\frac{M \cdot M}{\frac{\ell}{h}} \cdot 0.25\right)\right)\right)\right)\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot \left(0.5 \cdot M\right)}{d}\right)}^{2} \cdot -0.5\right)\right)\\
\end{array}
\end{array}
if h < -8.19999999999999972e-224Initial program 64.8%
associate-*l*64.8%
metadata-eval64.8%
unpow1/264.8%
metadata-eval64.8%
unpow1/264.8%
associate-*l*64.8%
metadata-eval64.8%
times-frac63.2%
Simplified63.2%
Taylor expanded in M around 0 44.1%
associate-*r/44.1%
*-commutative44.1%
associate-*r/44.1%
*-commutative44.1%
times-frac44.1%
unpow244.1%
unpow244.1%
times-frac57.2%
associate-*l*57.2%
associate-/l*56.3%
unpow256.3%
Simplified56.3%
clear-num56.2%
sqrt-div56.2%
metadata-eval56.2%
Applied egg-rr56.2%
if -8.19999999999999972e-224 < h < -4.999999999999985e-310Initial program 47.2%
metadata-eval47.2%
unpow1/247.2%
metadata-eval47.2%
unpow1/247.2%
*-commutative47.2%
associate-*l*47.2%
times-frac47.2%
metadata-eval47.2%
Simplified47.2%
Applied egg-rr30.0%
associate-*l*30.0%
associate-*r/30.0%
*-commutative30.0%
Simplified30.0%
Taylor expanded in d around -inf 82.2%
mul-1-neg82.2%
distribute-rgt-neg-in82.2%
unpow-182.2%
sqr-pow82.2%
rem-sqrt-square82.2%
metadata-eval82.2%
sqr-pow82.0%
fabs-sqr82.0%
sqr-pow82.2%
*-commutative82.2%
Simplified82.2%
if -4.999999999999985e-310 < h Initial program 68.6%
metadata-eval68.6%
unpow1/268.6%
metadata-eval68.6%
unpow1/268.6%
*-commutative68.6%
associate-*l*68.6%
times-frac68.6%
metadata-eval68.6%
Simplified68.6%
Applied egg-rr75.2%
distribute-rgt1-in78.4%
+-commutative78.4%
*-commutative78.4%
*-commutative78.4%
associate-*r/78.4%
*-commutative78.4%
Simplified78.4%
Final simplification68.0%
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= l 7.5e-293)
(*
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l)))))
(sqrt (/ d h)))
(*
(/ d (* (sqrt l) (sqrt h)))
(+ 1.0 (* (/ h l) (* (pow (/ (* D (* 0.5 M)) d) 2.0) -0.5))))))M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 7.5e-293) {
tmp = (sqrt((d / l)) * (1.0 - (0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))))) * sqrt((d / h));
} else {
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + ((h / l) * (pow(((D * (0.5 * M)) / d), 2.0) * -0.5)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 7.5d-293) then
tmp = (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l))))) * sqrt((d / h))
else
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0d0 + ((h / l) * ((((d_1 * (0.5d0 * m)) / d) ** 2.0d0) * (-0.5d0))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 7.5e-293) {
tmp = (Math.sqrt((d / l)) * (1.0 - (0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))))) * Math.sqrt((d / h));
} else {
tmp = (d / (Math.sqrt(l) * Math.sqrt(h))) * (1.0 + ((h / l) * (Math.pow(((D * (0.5 * M)) / d), 2.0) * -0.5)));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if l <= 7.5e-293: tmp = (math.sqrt((d / l)) * (1.0 - (0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))))) * math.sqrt((d / h)) else: tmp = (d / (math.sqrt(l) * math.sqrt(h))) * (1.0 + ((h / l) * (math.pow(((D * (0.5 * M)) / d), 2.0) * -0.5))) return tmp
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= 7.5e-293) tmp = Float64(Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))))) * sqrt(Float64(d / h))); else tmp = Float64(Float64(d / Float64(sqrt(l) * sqrt(h))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(D * Float64(0.5 * M)) / d) ^ 2.0) * -0.5)))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= 7.5e-293)
tmp = (sqrt((d / l)) * (1.0 - (0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l))))) * sqrt((d / h));
else
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + ((h / l) * ((((D * (0.5 * M)) / d) ^ 2.0) * -0.5)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, 7.5e-293], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * N[(0.5 * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 7.5 \cdot 10^{-293}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot \left(0.5 \cdot M\right)}{d}\right)}^{2} \cdot -0.5\right)\right)\\
\end{array}
\end{array}
if l < 7.50000000000000038e-293Initial program 64.4%
associate-*l*64.4%
metadata-eval64.4%
unpow1/264.4%
metadata-eval64.4%
unpow1/264.4%
associate-*l*64.4%
metadata-eval64.4%
times-frac63.0%
Simplified63.0%
if 7.50000000000000038e-293 < l Initial program 67.6%
metadata-eval67.6%
unpow1/267.6%
metadata-eval67.6%
unpow1/267.6%
*-commutative67.6%
associate-*l*67.6%
times-frac67.6%
metadata-eval67.6%
Simplified67.6%
Applied egg-rr74.4%
distribute-rgt1-in77.7%
+-commutative77.7%
*-commutative77.7%
*-commutative77.7%
associate-*r/77.7%
*-commutative77.7%
Simplified77.7%
Final simplification69.8%
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= M 4.2e-237)
(sqrt (/ d (/ l (/ d h))))
(*
(sqrt (/ d h))
(*
(- 1.0 (* 0.5 (* (* (/ D d) (/ D d)) (* (/ (* M M) (/ l h)) 0.25))))
(/ 1.0 (sqrt (/ l d)))))))M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 4.2e-237) {
tmp = sqrt((d / (l / (d / h))));
} else {
tmp = sqrt((d / h)) * ((1.0 - (0.5 * (((D / d) * (D / d)) * (((M * M) / (l / h)) * 0.25)))) * (1.0 / sqrt((l / d))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 4.2d-237) then
tmp = sqrt((d / (l / (d / h))))
else
tmp = sqrt((d / h)) * ((1.0d0 - (0.5d0 * (((d_1 / d) * (d_1 / d)) * (((m * m) / (l / h)) * 0.25d0)))) * (1.0d0 / sqrt((l / d))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 4.2e-237) {
tmp = Math.sqrt((d / (l / (d / h))));
} else {
tmp = Math.sqrt((d / h)) * ((1.0 - (0.5 * (((D / d) * (D / d)) * (((M * M) / (l / h)) * 0.25)))) * (1.0 / Math.sqrt((l / d))));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if M <= 4.2e-237: tmp = math.sqrt((d / (l / (d / h)))) else: tmp = math.sqrt((d / h)) * ((1.0 - (0.5 * (((D / d) * (D / d)) * (((M * M) / (l / h)) * 0.25)))) * (1.0 / math.sqrt((l / d)))) return tmp
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (M <= 4.2e-237) tmp = sqrt(Float64(d / Float64(l / Float64(d / h)))); else tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(Float64(M * M) / Float64(l / h)) * 0.25)))) * Float64(1.0 / sqrt(Float64(l / d))))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (M <= 4.2e-237)
tmp = sqrt((d / (l / (d / h))));
else
tmp = sqrt((d / h)) * ((1.0 - (0.5 * (((D / d) * (D / d)) * (((M * M) / (l / h)) * 0.25)))) * (1.0 / sqrt((l / d))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[M, 4.2e-237], N[Sqrt[N[(d / N[(l / N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 - N[(0.5 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 4.2 \cdot 10^{-237}:\\
\;\;\;\;\sqrt{\frac{d}{\frac{\ell}{\frac{d}{h}}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\left(1 - 0.5 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(\frac{M \cdot M}{\frac{\ell}{h}} \cdot 0.25\right)\right)\right) \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right)\\
\end{array}
\end{array}
if M < 4.2000000000000002e-237Initial program 66.8%
metadata-eval66.8%
unpow1/266.8%
metadata-eval66.8%
unpow1/266.8%
*-commutative66.8%
associate-*l*66.8%
times-frac65.5%
metadata-eval65.5%
Simplified65.5%
Applied egg-rr32.5%
associate-*l/29.5%
associate-/l*33.1%
+-commutative33.1%
associate-*r*33.1%
*-commutative33.1%
associate-*l*33.1%
fma-def33.1%
associate-*r/33.1%
associate-*l/33.1%
*-commutative33.1%
associate-/l*33.1%
Simplified33.1%
Taylor expanded in D around 0 35.9%
if 4.2000000000000002e-237 < M Initial program 64.7%
associate-*l*63.9%
metadata-eval63.9%
unpow1/263.9%
metadata-eval63.9%
unpow1/263.9%
associate-*l*63.9%
metadata-eval63.9%
times-frac63.9%
Simplified63.9%
Taylor expanded in M around 0 45.2%
associate-*r/45.2%
*-commutative45.2%
associate-*r/45.2%
*-commutative45.2%
times-frac46.1%
unpow246.1%
unpow246.1%
times-frac54.3%
associate-*l*54.3%
associate-/l*53.4%
unpow253.4%
Simplified53.4%
clear-num53.4%
sqrt-div53.5%
metadata-eval53.5%
Applied egg-rr53.5%
Final simplification43.7%
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= M 4.5e-237)
(sqrt (/ d (/ l (/ d h))))
(*
(/ 1.0 (sqrt (/ h d)))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (* (* (/ D d) (/ D d)) (* (/ (* M M) (/ l h)) 0.25))))))))M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 4.5e-237) {
tmp = sqrt((d / (l / (d / h))));
} else {
tmp = (1.0 / sqrt((h / d))) * (sqrt((d / l)) * (1.0 - (0.5 * (((D / d) * (D / d)) * (((M * M) / (l / h)) * 0.25)))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 4.5d-237) then
tmp = sqrt((d / (l / (d / h))))
else
tmp = (1.0d0 / sqrt((h / d))) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * (((d_1 / d) * (d_1 / d)) * (((m * m) / (l / h)) * 0.25d0)))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 4.5e-237) {
tmp = Math.sqrt((d / (l / (d / h))));
} else {
tmp = (1.0 / Math.sqrt((h / d))) * (Math.sqrt((d / l)) * (1.0 - (0.5 * (((D / d) * (D / d)) * (((M * M) / (l / h)) * 0.25)))));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if M <= 4.5e-237: tmp = math.sqrt((d / (l / (d / h)))) else: tmp = (1.0 / math.sqrt((h / d))) * (math.sqrt((d / l)) * (1.0 - (0.5 * (((D / d) * (D / d)) * (((M * M) / (l / h)) * 0.25))))) return tmp
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (M <= 4.5e-237) tmp = sqrt(Float64(d / Float64(l / Float64(d / h)))); else tmp = Float64(Float64(1.0 / sqrt(Float64(h / d))) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(Float64(M * M) / Float64(l / h)) * 0.25)))))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (M <= 4.5e-237)
tmp = sqrt((d / (l / (d / h))));
else
tmp = (1.0 / sqrt((h / d))) * (sqrt((d / l)) * (1.0 - (0.5 * (((D / d) * (D / d)) * (((M * M) / (l / h)) * 0.25)))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[M, 4.5e-237], N[Sqrt[N[(d / N[(l / N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 4.5 \cdot 10^{-237}:\\
\;\;\;\;\sqrt{\frac{d}{\frac{\ell}{\frac{d}{h}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{\frac{h}{d}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(\frac{M \cdot M}{\frac{\ell}{h}} \cdot 0.25\right)\right)\right)\right)\\
\end{array}
\end{array}
if M < 4.50000000000000009e-237Initial program 66.8%
metadata-eval66.8%
unpow1/266.8%
metadata-eval66.8%
unpow1/266.8%
*-commutative66.8%
associate-*l*66.8%
times-frac65.5%
metadata-eval65.5%
Simplified65.5%
Applied egg-rr32.5%
associate-*l/29.5%
associate-/l*33.1%
+-commutative33.1%
associate-*r*33.1%
*-commutative33.1%
associate-*l*33.1%
fma-def33.1%
associate-*r/33.1%
associate-*l/33.1%
*-commutative33.1%
associate-/l*33.1%
Simplified33.1%
Taylor expanded in D around 0 35.9%
if 4.50000000000000009e-237 < M Initial program 64.7%
associate-*l*63.9%
metadata-eval63.9%
unpow1/263.9%
metadata-eval63.9%
unpow1/263.9%
associate-*l*63.9%
metadata-eval63.9%
times-frac63.9%
Simplified63.9%
Taylor expanded in M around 0 45.2%
associate-*r/45.2%
*-commutative45.2%
associate-*r/45.2%
*-commutative45.2%
times-frac46.1%
unpow246.1%
unpow246.1%
times-frac54.3%
associate-*l*54.3%
associate-/l*53.4%
unpow253.4%
Simplified53.4%
clear-num53.4%
sqrt-div53.4%
metadata-eval53.4%
Applied egg-rr53.4%
Final simplification43.7%
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= M 5e-237)
(sqrt (/ d (/ l (/ d h))))
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (* (* (/ D d) (/ D d)) (* (/ (* M M) (/ l h)) 0.25))))))))M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 5e-237) {
tmp = sqrt((d / (l / (d / h))));
} else {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * (((D / d) * (D / d)) * (((M * M) / (l / h)) * 0.25)))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 5d-237) then
tmp = sqrt((d / (l / (d / h))))
else
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * (((d_1 / d) * (d_1 / d)) * (((m * m) / (l / h)) * 0.25d0)))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 5e-237) {
tmp = Math.sqrt((d / (l / (d / h))));
} else {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * (((D / d) * (D / d)) * (((M * M) / (l / h)) * 0.25)))));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if M <= 5e-237: tmp = math.sqrt((d / (l / (d / h)))) else: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * (((D / d) * (D / d)) * (((M * M) / (l / h)) * 0.25))))) return tmp
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (M <= 5e-237) tmp = sqrt(Float64(d / Float64(l / Float64(d / h)))); else tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(Float64(M * M) / Float64(l / h)) * 0.25)))))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (M <= 5e-237)
tmp = sqrt((d / (l / (d / h))));
else
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * (((D / d) * (D / d)) * (((M * M) / (l / h)) * 0.25)))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[M, 5e-237], N[Sqrt[N[(d / N[(l / N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 5 \cdot 10^{-237}:\\
\;\;\;\;\sqrt{\frac{d}{\frac{\ell}{\frac{d}{h}}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(\frac{M \cdot M}{\frac{\ell}{h}} \cdot 0.25\right)\right)\right)\right)\\
\end{array}
\end{array}
if M < 5.0000000000000002e-237Initial program 66.8%
metadata-eval66.8%
unpow1/266.8%
metadata-eval66.8%
unpow1/266.8%
*-commutative66.8%
associate-*l*66.8%
times-frac65.5%
metadata-eval65.5%
Simplified65.5%
Applied egg-rr32.5%
associate-*l/29.5%
associate-/l*33.1%
+-commutative33.1%
associate-*r*33.1%
*-commutative33.1%
associate-*l*33.1%
fma-def33.1%
associate-*r/33.1%
associate-*l/33.1%
*-commutative33.1%
associate-/l*33.1%
Simplified33.1%
Taylor expanded in D around 0 35.9%
if 5.0000000000000002e-237 < M Initial program 64.7%
associate-*l*63.9%
metadata-eval63.9%
unpow1/263.9%
metadata-eval63.9%
unpow1/263.9%
associate-*l*63.9%
metadata-eval63.9%
times-frac63.9%
Simplified63.9%
Taylor expanded in M around 0 45.2%
associate-*r/45.2%
*-commutative45.2%
associate-*r/45.2%
*-commutative45.2%
times-frac46.1%
unpow246.1%
unpow246.1%
times-frac54.3%
associate-*l*54.3%
associate-/l*53.4%
unpow253.4%
Simplified53.4%
Final simplification43.7%
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= D 2.4e+144)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(- 1.0 (* (* (/ D (/ l D)) (/ (* M M) (* d (/ d h)))) 0.125)))
(*
(sqrt (/ (/ d h) (/ l d)))
(- 1.0 (* (pow (* D (/ M (/ d 0.5))) 2.0) (/ (* h 0.5) l))))))M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 2.4e+144) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((D / (l / D)) * ((M * M) / (d * (d / h)))) * 0.125));
} else {
tmp = sqrt(((d / h) / (l / d))) * (1.0 - (pow((D * (M / (d / 0.5))), 2.0) * ((h * 0.5) / l)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 <= 2.4d+144) then
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (((d_1 / (l / d_1)) * ((m * m) / (d * (d / h)))) * 0.125d0))
else
tmp = sqrt(((d / h) / (l / d))) * (1.0d0 - (((d_1 * (m / (d / 0.5d0))) ** 2.0d0) * ((h * 0.5d0) / l)))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 2.4e+144) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (((D / (l / D)) * ((M * M) / (d * (d / h)))) * 0.125));
} else {
tmp = Math.sqrt(((d / h) / (l / d))) * (1.0 - (Math.pow((D * (M / (d / 0.5))), 2.0) * ((h * 0.5) / l)));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if D <= 2.4e+144: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (((D / (l / D)) * ((M * M) / (d * (d / h)))) * 0.125)) else: tmp = math.sqrt(((d / h) / (l / d))) * (1.0 - (math.pow((D * (M / (d / 0.5))), 2.0) * ((h * 0.5) / l))) return tmp
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (D <= 2.4e+144) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(D / Float64(l / D)) * Float64(Float64(M * M) / Float64(d * Float64(d / h)))) * 0.125))); else tmp = Float64(sqrt(Float64(Float64(d / h) / Float64(l / d))) * Float64(1.0 - Float64((Float64(D * Float64(M / Float64(d / 0.5))) ^ 2.0) * Float64(Float64(h * 0.5) / l)))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (D <= 2.4e+144)
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((D / (l / D)) * ((M * M) / (d * (d / h)))) * 0.125));
else
tmp = sqrt(((d / h) / (l / d))) * (1.0 - (((D * (M / (d / 0.5))) ^ 2.0) * ((h * 0.5) / l)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[D, 2.4e+144], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(D / N[(l / D), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[Power[N[(D * N[(M / N[(d / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h * 0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;D \leq 2.4 \cdot 10^{+144}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(\frac{D}{\frac{\ell}{D}} \cdot \frac{M \cdot M}{d \cdot \frac{d}{h}}\right) \cdot 0.125\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(D \cdot \frac{M}{\frac{d}{0.5}}\right)}^{2} \cdot \frac{h \cdot 0.5}{\ell}\right)\\
\end{array}
\end{array}
if D < 2.4000000000000001e144Initial program 66.1%
metadata-eval66.1%
unpow1/266.1%
metadata-eval66.1%
unpow1/266.1%
*-commutative66.1%
associate-*l*66.1%
times-frac65.2%
metadata-eval65.2%
Simplified65.2%
Taylor expanded in M around 0 43.8%
*-commutative43.8%
times-frac47.7%
unpow247.7%
associate-/l*47.7%
associate-/l*46.8%
unpow246.8%
unpow246.8%
associate-*r/50.3%
Simplified50.3%
if 2.4000000000000001e144 < D Initial program 64.7%
metadata-eval64.7%
unpow1/264.7%
metadata-eval64.7%
unpow1/264.7%
*-commutative64.7%
associate-*l*64.7%
times-frac64.7%
metadata-eval64.7%
Simplified64.7%
associate-*r*64.7%
frac-times64.7%
*-commutative64.7%
metadata-eval64.7%
add-sqr-sqrt64.7%
pow264.7%
Applied egg-rr66.9%
pow166.9%
sqrt-unprod66.9%
*-commutative66.9%
div-inv66.9%
clear-num66.9%
associate-*l*66.9%
Applied egg-rr66.9%
unpow166.9%
associate-*r/57.5%
associate-/l*66.9%
unpow266.9%
swap-sqr64.6%
rem-square-sqrt64.7%
associate-*r/64.7%
unpow264.7%
associate-*r*64.7%
associate-*r/64.6%
associate-*l/62.3%
associate-*l/62.3%
*-commutative62.3%
associate-*l/62.3%
associate-/l*62.3%
Simplified62.3%
Final simplification52.3%
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ 1.0 (* h l))) (t_1 (* d (- (pow (* h l) -0.5)))))
(if (<= l -2.6e-216)
t_1
(if (<= l -3.1e-304)
(* d (cbrt (* t_0 (sqrt t_0))))
(if (<= l 7.5e-293)
t_1
(if (or (<= l 5.8e-127) (and (not (<= l 1.55e-21)) (<= l 1.5e+51)))
(* -0.125 (/ (* (sqrt (/ h (pow l 3.0))) (* (* M M) (* D D))) d))
(* d (* (pow h -0.5) (pow l -0.5)))))))))M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (h * l);
double t_1 = d * -pow((h * l), -0.5);
double tmp;
if (l <= -2.6e-216) {
tmp = t_1;
} else if (l <= -3.1e-304) {
tmp = d * cbrt((t_0 * sqrt(t_0)));
} else if (l <= 7.5e-293) {
tmp = t_1;
} else if ((l <= 5.8e-127) || (!(l <= 1.55e-21) && (l <= 1.5e+51))) {
tmp = -0.125 * ((sqrt((h / pow(l, 3.0))) * ((M * M) * (D * D))) / d);
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (h * l);
double t_1 = d * -Math.pow((h * l), -0.5);
double tmp;
if (l <= -2.6e-216) {
tmp = t_1;
} else if (l <= -3.1e-304) {
tmp = d * Math.cbrt((t_0 * Math.sqrt(t_0)));
} else if (l <= 7.5e-293) {
tmp = t_1;
} else if ((l <= 5.8e-127) || (!(l <= 1.55e-21) && (l <= 1.5e+51))) {
tmp = -0.125 * ((Math.sqrt((h / Math.pow(l, 3.0))) * ((M * M) * (D * D))) / d);
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(1.0 / Float64(h * l)) t_1 = Float64(d * Float64(-(Float64(h * l) ^ -0.5))) tmp = 0.0 if (l <= -2.6e-216) tmp = t_1; elseif (l <= -3.1e-304) tmp = Float64(d * cbrt(Float64(t_0 * sqrt(t_0)))); elseif (l <= 7.5e-293) tmp = t_1; elseif ((l <= 5.8e-127) || (!(l <= 1.55e-21) && (l <= 1.5e+51))) tmp = Float64(-0.125 * Float64(Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(Float64(M * M) * Float64(D * D))) / d)); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d * (-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[l, -2.6e-216], t$95$1, If[LessEqual[l, -3.1e-304], N[(d * N[Power[N[(t$95$0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 7.5e-293], t$95$1, If[Or[LessEqual[l, 5.8e-127], And[N[Not[LessEqual[l, 1.55e-21]], $MachinePrecision], LessEqual[l, 1.5e+51]]], N[(-0.125 * N[(N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(M * M), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{1}{h \cdot \ell}\\
t_1 := d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{if}\;\ell \leq -2.6 \cdot 10^{-216}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq -3.1 \cdot 10^{-304}:\\
\;\;\;\;d \cdot \sqrt[3]{t_0 \cdot \sqrt{t_0}}\\
\mathbf{elif}\;\ell \leq 7.5 \cdot 10^{-293}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{-127} \lor \neg \left(\ell \leq 1.55 \cdot 10^{-21}\right) \land \ell \leq 1.5 \cdot 10^{+51}:\\
\;\;\;\;-0.125 \cdot \frac{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\left(M \cdot M\right) \cdot \left(D \cdot D\right)\right)}{d}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -2.5999999999999999e-216 or -3.09999999999999985e-304 < l < 7.50000000000000038e-293Initial program 64.1%
metadata-eval64.1%
unpow1/264.1%
metadata-eval64.1%
unpow1/264.1%
*-commutative64.1%
associate-*l*64.1%
times-frac63.3%
metadata-eval63.3%
Simplified63.3%
Applied egg-rr35.4%
associate-*l*35.4%
associate-*r/35.4%
*-commutative35.4%
Simplified35.4%
Taylor expanded in d around -inf 51.6%
mul-1-neg51.6%
distribute-rgt-neg-in51.6%
unpow-151.6%
sqr-pow51.7%
rem-sqrt-square51.7%
metadata-eval51.7%
sqr-pow51.4%
fabs-sqr51.4%
sqr-pow51.7%
*-commutative51.7%
Simplified51.7%
if -2.5999999999999999e-216 < l < -3.09999999999999985e-304Initial program 67.3%
metadata-eval67.3%
unpow1/267.3%
metadata-eval67.3%
unpow1/267.3%
*-commutative67.3%
associate-*l*67.3%
times-frac60.7%
metadata-eval60.7%
Simplified60.7%
Taylor expanded in d around inf 35.6%
add-cbrt-cube42.0%
add-sqr-sqrt42.0%
Applied egg-rr42.0%
if 7.50000000000000038e-293 < l < 5.8000000000000001e-127 or 1.5499999999999999e-21 < l < 1.5e51Initial program 77.9%
metadata-eval77.9%
unpow1/277.9%
metadata-eval77.9%
unpow1/277.9%
*-commutative77.9%
associate-*l*77.9%
times-frac77.9%
metadata-eval77.9%
Simplified77.9%
Taylor expanded in d around 0 58.7%
associate-*l/58.7%
unpow258.7%
unpow258.7%
Simplified58.7%
if 5.8000000000000001e-127 < l < 1.5499999999999999e-21 or 1.5e51 < l Initial program 63.1%
metadata-eval63.1%
unpow1/263.1%
metadata-eval63.1%
unpow1/263.1%
*-commutative63.1%
associate-*l*63.1%
times-frac63.1%
metadata-eval63.1%
Simplified63.1%
Taylor expanded in d around inf 41.0%
*-un-lft-identity41.0%
Applied egg-rr41.0%
*-lft-identity41.0%
unpow-141.0%
sqr-pow41.1%
rem-sqrt-square41.1%
metadata-eval41.1%
sqr-pow40.9%
fabs-sqr40.9%
sqr-pow41.1%
*-commutative41.1%
Simplified41.1%
unpow-prod-down54.5%
Applied egg-rr54.5%
Final simplification53.0%
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ 1.0 (* h l))))
(if (<= l -2.4e-214)
(* d (- (pow (* h l) -0.5)))
(if (<= l -2e-310)
(* d (cbrt (* t_0 (sqrt t_0))))
(if (or (<= l 2.1e-126) (and (not (<= l 3.1e-72)) (<= l 1.4e+54)))
(* -0.125 (/ (* (* (* M D) (* M D)) (sqrt (/ h (pow l 3.0)))) d))
(* d (* (pow h -0.5) (pow l -0.5))))))))M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (h * l);
double tmp;
if (l <= -2.4e-214) {
tmp = d * -pow((h * l), -0.5);
} else if (l <= -2e-310) {
tmp = d * cbrt((t_0 * sqrt(t_0)));
} else if ((l <= 2.1e-126) || (!(l <= 3.1e-72) && (l <= 1.4e+54))) {
tmp = -0.125 * ((((M * D) * (M * D)) * sqrt((h / pow(l, 3.0)))) / d);
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (h * l);
double tmp;
if (l <= -2.4e-214) {
tmp = d * -Math.pow((h * l), -0.5);
} else if (l <= -2e-310) {
tmp = d * Math.cbrt((t_0 * Math.sqrt(t_0)));
} else if ((l <= 2.1e-126) || (!(l <= 3.1e-72) && (l <= 1.4e+54))) {
tmp = -0.125 * ((((M * D) * (M * D)) * Math.sqrt((h / Math.pow(l, 3.0)))) / d);
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(1.0 / Float64(h * l)) tmp = 0.0 if (l <= -2.4e-214) tmp = Float64(d * Float64(-(Float64(h * l) ^ -0.5))); elseif (l <= -2e-310) tmp = Float64(d * cbrt(Float64(t_0 * sqrt(t_0)))); elseif ((l <= 2.1e-126) || (!(l <= 3.1e-72) && (l <= 1.4e+54))) tmp = Float64(-0.125 * Float64(Float64(Float64(Float64(M * D) * Float64(M * D)) * sqrt(Float64(h / (l ^ 3.0)))) / d)); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.4e-214], N[(d * (-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, -2e-310], N[(d * N[Power[N[(t$95$0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 2.1e-126], And[N[Not[LessEqual[l, 3.1e-72]], $MachinePrecision], LessEqual[l, 1.4e+54]]], N[(-0.125 * N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{1}{h \cdot \ell}\\
\mathbf{if}\;\ell \leq -2.4 \cdot 10^{-214}:\\
\;\;\;\;d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt[3]{t_0 \cdot \sqrt{t_0}}\\
\mathbf{elif}\;\ell \leq 2.1 \cdot 10^{-126} \lor \neg \left(\ell \leq 3.1 \cdot 10^{-72}\right) \land \ell \leq 1.4 \cdot 10^{+54}:\\
\;\;\;\;-0.125 \cdot \frac{\left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}}{d}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -2.4000000000000002e-214Initial program 63.4%
metadata-eval63.4%
unpow1/263.4%
metadata-eval63.4%
unpow1/263.4%
*-commutative63.4%
associate-*l*63.4%
times-frac62.5%
metadata-eval62.5%
Simplified62.5%
Applied egg-rr36.0%
associate-*l*36.0%
associate-*r/36.1%
*-commutative36.1%
Simplified36.1%
Taylor expanded in d around -inf 50.4%
mul-1-neg50.4%
distribute-rgt-neg-in50.4%
unpow-150.4%
sqr-pow50.5%
rem-sqrt-square50.5%
metadata-eval50.5%
sqr-pow50.2%
fabs-sqr50.2%
sqr-pow50.5%
*-commutative50.5%
Simplified50.5%
if -2.4000000000000002e-214 < l < -1.999999999999994e-310Initial program 63.1%
metadata-eval63.1%
unpow1/263.1%
metadata-eval63.1%
unpow1/263.1%
*-commutative63.1%
associate-*l*63.1%
times-frac56.9%
metadata-eval56.9%
Simplified56.9%
Taylor expanded in d around inf 33.5%
add-cbrt-cube39.4%
add-sqr-sqrt39.4%
Applied egg-rr39.4%
if -1.999999999999994e-310 < l < 2.0999999999999999e-126 or 3.0999999999999998e-72 < l < 1.40000000000000008e54Initial program 78.9%
metadata-eval78.9%
unpow1/278.9%
metadata-eval78.9%
unpow1/278.9%
*-commutative78.9%
associate-*l*78.9%
times-frac78.9%
metadata-eval78.9%
Simplified78.9%
associate-*r*78.9%
frac-times78.9%
*-commutative78.9%
metadata-eval78.9%
expm1-log1p-u78.2%
expm1-udef78.2%
Applied egg-rr78.9%
+-commutative78.9%
associate--l+78.9%
metadata-eval78.9%
+-rgt-identity78.9%
associate-/r/79.0%
associate-*r/78.9%
associate-*l/77.2%
*-commutative77.2%
associate-/l*77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in d around 0 52.3%
associate-*l/52.3%
unpow252.3%
unpow252.3%
unswap-sqr66.5%
Simplified66.5%
if 2.0999999999999999e-126 < l < 3.0999999999999998e-72 or 1.40000000000000008e54 < l Initial program 60.0%
metadata-eval60.0%
unpow1/260.0%
metadata-eval60.0%
unpow1/260.0%
*-commutative60.0%
associate-*l*60.0%
times-frac60.0%
metadata-eval60.0%
Simplified60.0%
Taylor expanded in d around inf 41.6%
*-un-lft-identity41.6%
Applied egg-rr41.6%
*-lft-identity41.6%
unpow-141.6%
sqr-pow41.7%
rem-sqrt-square41.7%
metadata-eval41.7%
sqr-pow41.5%
fabs-sqr41.5%
sqr-pow41.7%
*-commutative41.7%
Simplified41.7%
unpow-prod-down57.0%
Applied egg-rr57.0%
Final simplification55.0%
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ 1.0 (* h l))))
(if (<= l -1.3e-204)
(* d (- (pow (* h l) -0.5)))
(if (<= l -2e-310)
(* d (sqrt (cbrt (* t_0 (* t_0 t_0)))))
(if (or (<= l 9.8e-126) (and (not (<= l 4.2e-72)) (<= l 1.5e+51)))
(* -0.125 (/ (* (* (* M D) (* M D)) (sqrt (/ h (pow l 3.0)))) d))
(* d (* (pow h -0.5) (pow l -0.5))))))))M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (h * l);
double tmp;
if (l <= -1.3e-204) {
tmp = d * -pow((h * l), -0.5);
} else if (l <= -2e-310) {
tmp = d * sqrt(cbrt((t_0 * (t_0 * t_0))));
} else if ((l <= 9.8e-126) || (!(l <= 4.2e-72) && (l <= 1.5e+51))) {
tmp = -0.125 * ((((M * D) * (M * D)) * sqrt((h / pow(l, 3.0)))) / d);
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (h * l);
double tmp;
if (l <= -1.3e-204) {
tmp = d * -Math.pow((h * l), -0.5);
} else if (l <= -2e-310) {
tmp = d * Math.sqrt(Math.cbrt((t_0 * (t_0 * t_0))));
} else if ((l <= 9.8e-126) || (!(l <= 4.2e-72) && (l <= 1.5e+51))) {
tmp = -0.125 * ((((M * D) * (M * D)) * Math.sqrt((h / Math.pow(l, 3.0)))) / d);
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(1.0 / Float64(h * l)) tmp = 0.0 if (l <= -1.3e-204) tmp = Float64(d * Float64(-(Float64(h * l) ^ -0.5))); elseif (l <= -2e-310) tmp = Float64(d * sqrt(cbrt(Float64(t_0 * Float64(t_0 * t_0))))); elseif ((l <= 9.8e-126) || (!(l <= 4.2e-72) && (l <= 1.5e+51))) tmp = Float64(-0.125 * Float64(Float64(Float64(Float64(M * D) * Float64(M * D)) * sqrt(Float64(h / (l ^ 3.0)))) / d)); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.3e-204], N[(d * (-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, -2e-310], N[(d * N[Sqrt[N[Power[N[(t$95$0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 9.8e-126], And[N[Not[LessEqual[l, 4.2e-72]], $MachinePrecision], LessEqual[l, 1.5e+51]]], N[(-0.125 * N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{1}{h \cdot \ell}\\
\mathbf{if}\;\ell \leq -1.3 \cdot 10^{-204}:\\
\;\;\;\;d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\sqrt[3]{t_0 \cdot \left(t_0 \cdot t_0\right)}}\\
\mathbf{elif}\;\ell \leq 9.8 \cdot 10^{-126} \lor \neg \left(\ell \leq 4.2 \cdot 10^{-72}\right) \land \ell \leq 1.5 \cdot 10^{+51}:\\
\;\;\;\;-0.125 \cdot \frac{\left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}}{d}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1.29999999999999991e-204Initial program 63.4%
metadata-eval63.4%
unpow1/263.4%
metadata-eval63.4%
unpow1/263.4%
*-commutative63.4%
associate-*l*63.4%
times-frac62.5%
metadata-eval62.5%
Simplified62.5%
Applied egg-rr36.0%
associate-*l*36.0%
associate-*r/36.1%
*-commutative36.1%
Simplified36.1%
Taylor expanded in d around -inf 50.4%
mul-1-neg50.4%
distribute-rgt-neg-in50.4%
unpow-150.4%
sqr-pow50.5%
rem-sqrt-square50.5%
metadata-eval50.5%
sqr-pow50.2%
fabs-sqr50.2%
sqr-pow50.5%
*-commutative50.5%
Simplified50.5%
if -1.29999999999999991e-204 < l < -1.999999999999994e-310Initial program 63.1%
metadata-eval63.1%
unpow1/263.1%
metadata-eval63.1%
unpow1/263.1%
*-commutative63.1%
associate-*l*63.1%
times-frac56.9%
metadata-eval56.9%
Simplified56.9%
Taylor expanded in d around inf 33.5%
add-cbrt-cube51.2%
Applied egg-rr51.2%
if -1.999999999999994e-310 < l < 9.8000000000000002e-126 or 4.2e-72 < l < 1.5e51Initial program 78.9%
metadata-eval78.9%
unpow1/278.9%
metadata-eval78.9%
unpow1/278.9%
*-commutative78.9%
associate-*l*78.9%
times-frac78.9%
metadata-eval78.9%
Simplified78.9%
associate-*r*78.9%
frac-times78.9%
*-commutative78.9%
metadata-eval78.9%
expm1-log1p-u78.2%
expm1-udef78.2%
Applied egg-rr78.9%
+-commutative78.9%
associate--l+78.9%
metadata-eval78.9%
+-rgt-identity78.9%
associate-/r/79.0%
associate-*r/78.9%
associate-*l/77.2%
*-commutative77.2%
associate-/l*77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in d around 0 52.3%
associate-*l/52.3%
unpow252.3%
unpow252.3%
unswap-sqr66.5%
Simplified66.5%
if 9.8000000000000002e-126 < l < 4.2e-72 or 1.5e51 < l Initial program 60.0%
metadata-eval60.0%
unpow1/260.0%
metadata-eval60.0%
unpow1/260.0%
*-commutative60.0%
associate-*l*60.0%
times-frac60.0%
metadata-eval60.0%
Simplified60.0%
Taylor expanded in d around inf 41.6%
*-un-lft-identity41.6%
Applied egg-rr41.6%
*-lft-identity41.6%
unpow-141.6%
sqr-pow41.7%
rem-sqrt-square41.7%
metadata-eval41.7%
sqr-pow41.5%
fabs-sqr41.5%
sqr-pow41.7%
*-commutative41.7%
Simplified41.7%
unpow-prod-down57.0%
Applied egg-rr57.0%
Final simplification55.7%
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.1e+135)
(* d (- (pow (* h l) -0.5)))
(*
(sqrt (/ (/ d h) (/ l d)))
(- 1.0 (* (pow (* D (/ M (/ d 0.5))) 2.0) (/ (* h 0.5) l))))))M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.1e+135) {
tmp = d * -pow((h * l), -0.5);
} else {
tmp = sqrt(((d / h) / (l / d))) * (1.0 - (pow((D * (M / (d / 0.5))), 2.0) * ((h * 0.5) / l)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1.1d+135)) then
tmp = d * -((h * l) ** (-0.5d0))
else
tmp = sqrt(((d / h) / (l / d))) * (1.0d0 - (((d_1 * (m / (d / 0.5d0))) ** 2.0d0) * ((h * 0.5d0) / l)))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.1e+135) {
tmp = d * -Math.pow((h * l), -0.5);
} else {
tmp = Math.sqrt(((d / h) / (l / d))) * (1.0 - (Math.pow((D * (M / (d / 0.5))), 2.0) * ((h * 0.5) / l)));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if l <= -1.1e+135: tmp = d * -math.pow((h * l), -0.5) else: tmp = math.sqrt(((d / h) / (l / d))) * (1.0 - (math.pow((D * (M / (d / 0.5))), 2.0) * ((h * 0.5) / l))) return tmp
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.1e+135) tmp = Float64(d * Float64(-(Float64(h * l) ^ -0.5))); else tmp = Float64(sqrt(Float64(Float64(d / h) / Float64(l / d))) * Float64(1.0 - Float64((Float64(D * Float64(M / Float64(d / 0.5))) ^ 2.0) * Float64(Float64(h * 0.5) / l)))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= -1.1e+135)
tmp = d * -((h * l) ^ -0.5);
else
tmp = sqrt(((d / h) / (l / d))) * (1.0 - (((D * (M / (d / 0.5))) ^ 2.0) * ((h * 0.5) / l)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.1e+135], N[(d * (-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[Power[N[(D * N[(M / N[(d / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h * 0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.1 \cdot 10^{+135}:\\
\;\;\;\;d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(D \cdot \frac{M}{\frac{d}{0.5}}\right)}^{2} \cdot \frac{h \cdot 0.5}{\ell}\right)\\
\end{array}
\end{array}
if l < -1.1e135Initial program 45.6%
metadata-eval45.6%
unpow1/245.6%
metadata-eval45.6%
unpow1/245.6%
*-commutative45.6%
associate-*l*45.6%
times-frac45.6%
metadata-eval45.6%
Simplified45.6%
Applied egg-rr30.9%
associate-*l*30.9%
associate-*r/30.9%
*-commutative30.9%
Simplified30.9%
Taylor expanded in d around -inf 50.3%
mul-1-neg50.3%
distribute-rgt-neg-in50.3%
unpow-150.3%
sqr-pow50.3%
rem-sqrt-square50.3%
metadata-eval50.3%
sqr-pow50.0%
fabs-sqr50.0%
sqr-pow50.3%
*-commutative50.3%
Simplified50.3%
if -1.1e135 < l Initial program 69.7%
metadata-eval69.7%
unpow1/269.7%
metadata-eval69.7%
unpow1/269.7%
*-commutative69.7%
associate-*l*69.7%
times-frac68.8%
metadata-eval68.8%
Simplified68.8%
associate-*r*68.8%
frac-times69.7%
*-commutative69.7%
metadata-eval69.7%
add-sqr-sqrt69.7%
pow269.7%
Applied egg-rr70.2%
pow170.2%
sqrt-unprod62.2%
*-commutative62.2%
div-inv62.2%
clear-num62.2%
associate-*l*62.2%
Applied egg-rr62.2%
unpow162.2%
associate-*r/56.5%
associate-/l*62.2%
unpow262.2%
swap-sqr60.9%
rem-square-sqrt60.9%
associate-*r/60.9%
unpow260.9%
associate-*r*60.9%
associate-*r/61.4%
associate-*l/60.9%
associate-*l/60.9%
*-commutative60.9%
associate-*l/60.9%
associate-/l*60.9%
Simplified60.9%
Final simplification59.2%
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ 1.0 (* h l))) (t_1 (* d (- (pow (* h l) -0.5)))))
(if (<= l -1.4e-208)
t_1
(if (<= l -3.6e-302)
(* d (cbrt (* t_0 (sqrt t_0))))
(if (<= l 4.8e-224) t_1 (* d (* (pow h -0.5) (pow l -0.5))))))))M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (h * l);
double t_1 = d * -pow((h * l), -0.5);
double tmp;
if (l <= -1.4e-208) {
tmp = t_1;
} else if (l <= -3.6e-302) {
tmp = d * cbrt((t_0 * sqrt(t_0)));
} else if (l <= 4.8e-224) {
tmp = t_1;
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (h * l);
double t_1 = d * -Math.pow((h * l), -0.5);
double tmp;
if (l <= -1.4e-208) {
tmp = t_1;
} else if (l <= -3.6e-302) {
tmp = d * Math.cbrt((t_0 * Math.sqrt(t_0)));
} else if (l <= 4.8e-224) {
tmp = t_1;
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(1.0 / Float64(h * l)) t_1 = Float64(d * Float64(-(Float64(h * l) ^ -0.5))) tmp = 0.0 if (l <= -1.4e-208) tmp = t_1; elseif (l <= -3.6e-302) tmp = Float64(d * cbrt(Float64(t_0 * sqrt(t_0)))); elseif (l <= 4.8e-224) tmp = t_1; else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d * (-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[l, -1.4e-208], t$95$1, If[LessEqual[l, -3.6e-302], N[(d * N[Power[N[(t$95$0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4.8e-224], t$95$1, N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{1}{h \cdot \ell}\\
t_1 := d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{if}\;\ell \leq -1.4 \cdot 10^{-208}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq -3.6 \cdot 10^{-302}:\\
\;\;\;\;d \cdot \sqrt[3]{t_0 \cdot \sqrt{t_0}}\\
\mathbf{elif}\;\ell \leq 4.8 \cdot 10^{-224}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1.40000000000000001e-208 or -3.6000000000000001e-302 < l < 4.80000000000000028e-224Initial program 64.7%
metadata-eval64.7%
unpow1/264.7%
metadata-eval64.7%
unpow1/264.7%
*-commutative64.7%
associate-*l*64.7%
times-frac64.0%
metadata-eval64.0%
Simplified64.0%
Applied egg-rr34.0%
associate-*l*34.0%
associate-*r/34.0%
*-commutative34.0%
Simplified34.0%
Taylor expanded in d around -inf 50.1%
mul-1-neg50.1%
distribute-rgt-neg-in50.1%
unpow-150.1%
sqr-pow50.2%
rem-sqrt-square50.2%
metadata-eval50.2%
sqr-pow49.9%
fabs-sqr49.9%
sqr-pow50.2%
*-commutative50.2%
Simplified50.2%
if -1.40000000000000001e-208 < l < -3.6000000000000001e-302Initial program 67.3%
metadata-eval67.3%
unpow1/267.3%
metadata-eval67.3%
unpow1/267.3%
*-commutative67.3%
associate-*l*67.3%
times-frac60.7%
metadata-eval60.7%
Simplified60.7%
Taylor expanded in d around inf 35.6%
add-cbrt-cube42.0%
add-sqr-sqrt42.0%
Applied egg-rr42.0%
if 4.80000000000000028e-224 < l Initial program 67.0%
metadata-eval67.0%
unpow1/267.0%
metadata-eval67.0%
unpow1/267.0%
*-commutative67.0%
associate-*l*67.0%
times-frac67.0%
metadata-eval67.0%
Simplified67.0%
Taylor expanded in d around inf 31.9%
*-un-lft-identity31.9%
Applied egg-rr31.9%
*-lft-identity31.9%
unpow-131.9%
sqr-pow32.0%
rem-sqrt-square32.0%
metadata-eval32.0%
sqr-pow31.9%
fabs-sqr31.9%
sqr-pow32.0%
*-commutative32.0%
Simplified32.0%
unpow-prod-down44.5%
Applied egg-rr44.5%
Final simplification47.3%
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= d 2.15e-259) (* d (- (pow (* h l) -0.5))) (* d (* (pow h -0.5) (pow l -0.5)))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 2.15e-259) {
tmp = d * -pow((h * l), -0.5);
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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.15d-259) then
tmp = d * -((h * l) ** (-0.5d0))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 2.15e-259) {
tmp = d * -Math.pow((h * l), -0.5);
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if d <= 2.15e-259: tmp = d * -math.pow((h * l), -0.5) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (d <= 2.15e-259) tmp = Float64(d * Float64(-(Float64(h * l) ^ -0.5))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (d <= 2.15e-259)
tmp = d * -((h * l) ^ -0.5);
else
tmp = d * ((h ^ -0.5) * (l ^ -0.5));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[d, 2.15e-259], N[(d * (-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 2.15 \cdot 10^{-259}:\\
\;\;\;\;d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if d < 2.15e-259Initial program 60.5%
metadata-eval60.5%
unpow1/260.5%
metadata-eval60.5%
unpow1/260.5%
*-commutative60.5%
associate-*l*60.5%
times-frac59.1%
metadata-eval59.1%
Simplified59.1%
Applied egg-rr30.9%
associate-*l*30.9%
associate-*r/31.0%
*-commutative31.0%
Simplified31.0%
Taylor expanded in d around -inf 43.6%
mul-1-neg43.6%
distribute-rgt-neg-in43.6%
unpow-143.6%
sqr-pow43.7%
rem-sqrt-square43.7%
metadata-eval43.7%
sqr-pow43.4%
fabs-sqr43.4%
sqr-pow43.7%
*-commutative43.7%
Simplified43.7%
if 2.15e-259 < d Initial program 72.7%
metadata-eval72.7%
unpow1/272.7%
metadata-eval72.7%
unpow1/272.7%
*-commutative72.7%
associate-*l*72.7%
times-frac72.7%
metadata-eval72.7%
Simplified72.7%
Taylor expanded in d around inf 32.1%
*-un-lft-identity32.1%
Applied egg-rr32.1%
*-lft-identity32.1%
unpow-132.1%
sqr-pow32.2%
rem-sqrt-square32.2%
metadata-eval32.2%
sqr-pow32.1%
fabs-sqr32.1%
sqr-pow32.2%
*-commutative32.2%
Simplified32.2%
unpow-prod-down44.5%
Applied egg-rr44.5%
Final simplification44.0%
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* h l) -0.5)))
(if (or (<= l -1.6e-212) (and (not (<= l -1.2e-303)) (<= l 4.4e-127)))
(* d (- t_0))
(* d t_0))))M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((h * l), -0.5);
double tmp;
if ((l <= -1.6e-212) || (!(l <= -1.2e-303) && (l <= 4.4e-127))) {
tmp = d * -t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 ((l <= (-1.6d-212)) .or. (.not. (l <= (-1.2d-303))) .and. (l <= 4.4d-127)) then
tmp = d * -t_0
else
tmp = d * t_0
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
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 ((l <= -1.6e-212) || (!(l <= -1.2e-303) && (l <= 4.4e-127))) {
tmp = d * -t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = math.pow((h * l), -0.5) tmp = 0 if (l <= -1.6e-212) or (not (l <= -1.2e-303) and (l <= 4.4e-127)): tmp = d * -t_0 else: tmp = d * t_0 return tmp
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(h * l) ^ -0.5 tmp = 0.0 if ((l <= -1.6e-212) || (!(l <= -1.2e-303) && (l <= 4.4e-127))) tmp = Float64(d * Float64(-t_0)); else tmp = Float64(d * t_0); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = (h * l) ^ -0.5;
tmp = 0.0;
if ((l <= -1.6e-212) || (~((l <= -1.2e-303)) && (l <= 4.4e-127)))
tmp = d * -t_0;
else
tmp = d * t_0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]}, If[Or[LessEqual[l, -1.6e-212], And[N[Not[LessEqual[l, -1.2e-303]], $MachinePrecision], LessEqual[l, 4.4e-127]]], N[(d * (-t$95$0)), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq -1.6 \cdot 10^{-212} \lor \neg \left(\ell \leq -1.2 \cdot 10^{-303}\right) \land \ell \leq 4.4 \cdot 10^{-127}:\\
\;\;\;\;d \cdot \left(-t_0\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot t_0\\
\end{array}
\end{array}
if l < -1.5999999999999999e-212 or -1.2e-303 < l < 4.4000000000000003e-127Initial program 66.7%
metadata-eval66.7%
unpow1/266.7%
metadata-eval66.7%
unpow1/266.7%
*-commutative66.7%
associate-*l*66.7%
times-frac66.1%
metadata-eval66.1%
Simplified66.1%
Applied egg-rr31.5%
associate-*l*31.5%
associate-*r/31.5%
*-commutative31.5%
Simplified31.5%
Taylor expanded in d around -inf 46.6%
mul-1-neg46.6%
distribute-rgt-neg-in46.6%
unpow-146.6%
sqr-pow46.6%
rem-sqrt-square46.6%
metadata-eval46.6%
sqr-pow46.4%
fabs-sqr46.4%
sqr-pow46.6%
*-commutative46.6%
Simplified46.6%
if -1.5999999999999999e-212 < l < -1.2e-303 or 4.4000000000000003e-127 < l Initial program 64.7%
metadata-eval64.7%
unpow1/264.7%
metadata-eval64.7%
unpow1/264.7%
*-commutative64.7%
associate-*l*64.7%
times-frac63.8%
metadata-eval63.8%
Simplified63.8%
Taylor expanded in d around inf 36.3%
*-un-lft-identity36.3%
Applied egg-rr36.3%
*-lft-identity36.3%
unpow-136.3%
sqr-pow36.3%
rem-sqrt-square36.3%
metadata-eval36.3%
sqr-pow36.2%
fabs-sqr36.2%
sqr-pow36.3%
*-commutative36.3%
Simplified36.3%
Final simplification42.2%
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= l -4.1e-237) (sqrt (* (/ d l) (/ d h))) (* d (pow (* h l) -0.5))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -4.1e-237) {
tmp = sqrt(((d / l) * (d / h)));
} else {
tmp = d * pow((h * l), -0.5);
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-4.1d-237)) then
tmp = sqrt(((d / l) * (d / h)))
else
tmp = d * ((h * l) ** (-0.5d0))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -4.1e-237) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else {
tmp = d * Math.pow((h * l), -0.5);
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if l <= -4.1e-237: tmp = math.sqrt(((d / l) * (d / h))) else: tmp = d * math.pow((h * l), -0.5) return tmp
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= -4.1e-237) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); else tmp = Float64(d * (Float64(h * l) ^ -0.5)); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= -4.1e-237)
tmp = sqrt(((d / l) * (d / h)));
else
tmp = d * ((h * l) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4.1e-237], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.1 \cdot 10^{-237}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\end{array}
\end{array}
if l < -4.1000000000000001e-237Initial program 63.3%
metadata-eval63.3%
unpow1/263.3%
metadata-eval63.3%
unpow1/263.3%
*-commutative63.3%
associate-*l*63.3%
times-frac61.7%
metadata-eval61.7%
Simplified61.7%
Applied egg-rr36.2%
associate-*l*36.2%
associate-*r/36.2%
*-commutative36.2%
Simplified36.2%
Taylor expanded in d around inf 38.6%
if -4.1000000000000001e-237 < l Initial program 68.2%
metadata-eval68.2%
unpow1/268.2%
metadata-eval68.2%
unpow1/268.2%
*-commutative68.2%
associate-*l*68.2%
times-frac68.2%
metadata-eval68.2%
Simplified68.2%
Taylor expanded in d around inf 31.1%
*-un-lft-identity31.1%
Applied egg-rr31.1%
*-lft-identity31.1%
unpow-131.1%
sqr-pow31.2%
rem-sqrt-square31.2%
metadata-eval31.2%
sqr-pow31.1%
fabs-sqr31.1%
sqr-pow31.2%
*-commutative31.2%
Simplified31.2%
Final simplification34.7%
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= l -2.35e-237) (sqrt (/ (/ d h) (/ l d))) (* d (pow (* h l) -0.5))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.35e-237) {
tmp = sqrt(((d / h) / (l / d)));
} else {
tmp = d * pow((h * l), -0.5);
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-2.35d-237)) then
tmp = sqrt(((d / h) / (l / d)))
else
tmp = d * ((h * l) ** (-0.5d0))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.35e-237) {
tmp = Math.sqrt(((d / h) / (l / d)));
} else {
tmp = d * Math.pow((h * l), -0.5);
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(d, h, l, M, D): tmp = 0 if l <= -2.35e-237: tmp = math.sqrt(((d / h) / (l / d))) else: tmp = d * math.pow((h * l), -0.5) return tmp
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.35e-237) tmp = sqrt(Float64(Float64(d / h) / Float64(l / d))); else tmp = Float64(d * (Float64(h * l) ^ -0.5)); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= -2.35e-237)
tmp = sqrt(((d / h) / (l / d)));
else
tmp = d * ((h * l) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.35e-237], N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.35 \cdot 10^{-237}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\end{array}
\end{array}
if l < -2.3499999999999999e-237Initial program 63.3%
metadata-eval63.3%
unpow1/263.3%
metadata-eval63.3%
unpow1/263.3%
*-commutative63.3%
associate-*l*63.3%
times-frac61.7%
metadata-eval61.7%
Simplified61.7%
Applied egg-rr36.2%
associate-*l*36.2%
associate-*r/36.2%
*-commutative36.2%
Simplified36.2%
Taylor expanded in d around inf 29.0%
unpow229.0%
*-commutative29.0%
times-frac38.6%
associate-*r/35.9%
associate-/l*38.6%
Simplified38.6%
if -2.3499999999999999e-237 < l Initial program 68.2%
metadata-eval68.2%
unpow1/268.2%
metadata-eval68.2%
unpow1/268.2%
*-commutative68.2%
associate-*l*68.2%
times-frac68.2%
metadata-eval68.2%
Simplified68.2%
Taylor expanded in d around inf 31.1%
*-un-lft-identity31.1%
Applied egg-rr31.1%
*-lft-identity31.1%
unpow-131.1%
sqr-pow31.2%
rem-sqrt-square31.2%
metadata-eval31.2%
sqr-pow31.1%
fabs-sqr31.1%
sqr-pow31.2%
*-commutative31.2%
Simplified31.2%
Final simplification34.7%
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (* d (pow (* h l) -0.5)))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
return d * pow((h * l), -0.5);
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
return d * Math.pow((h * l), -0.5);
}
M = abs(M) [M, D] = sort([M, D]) def code(d, h, l, M, D): return d * math.pow((h * l), -0.5)
M = abs(M) M, D = sort([M, D]) function code(d, h, l, M, D) return Float64(d * (Float64(h * l) ^ -0.5)) end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp = code(d, h, l, M, D)
tmp = d * ((h * l) ^ -0.5);
end
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
d \cdot {\left(h \cdot \ell\right)}^{-0.5}
\end{array}
Initial program 65.9%
metadata-eval65.9%
unpow1/265.9%
metadata-eval65.9%
unpow1/265.9%
*-commutative65.9%
associate-*l*65.9%
times-frac65.1%
metadata-eval65.1%
Simplified65.1%
Taylor expanded in d around inf 19.2%
*-un-lft-identity19.2%
Applied egg-rr19.2%
*-lft-identity19.2%
unpow-119.2%
sqr-pow19.2%
rem-sqrt-square19.2%
metadata-eval19.2%
sqr-pow19.2%
fabs-sqr19.2%
sqr-pow19.2%
*-commutative19.2%
Simplified19.2%
Final simplification19.2%
herbie shell --seed 2023238
(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)))))