
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (/ (* M D) (* 2.0 d)) 5e+84)
(* w0 (sqrt (- 1.0 (/ (* h (pow (* (* M D) (/ 0.5 d)) 2.0)) l))))
(*
w0
(sqrt (+ 1.0 (* (/ D l) (* D (/ (* h -0.25) (* (/ d M) (/ d M))))))))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 5e+84) {
tmp = w0 * sqrt((1.0 - ((h * pow(((M * D) * (0.5 / d)), 2.0)) / l)));
} else {
tmp = w0 * sqrt((1.0 + ((D / l) * (D * ((h * -0.25) / ((d / M) * (d / M)))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d 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(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (((m * d) / (2.0d0 * d_1)) <= 5d+84) then
tmp = w0 * sqrt((1.0d0 - ((h * (((m * d) * (0.5d0 / d_1)) ** 2.0d0)) / l)))
else
tmp = w0 * sqrt((1.0d0 + ((d / l) * (d * ((h * (-0.25d0)) / ((d_1 / m) * (d_1 / m)))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 5e+84) {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow(((M * D) * (0.5 / d)), 2.0)) / l)));
} else {
tmp = w0 * Math.sqrt((1.0 + ((D / l) * (D * ((h * -0.25) / ((d / M) * (d / M)))))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if ((M * D) / (2.0 * d)) <= 5e+84: tmp = w0 * math.sqrt((1.0 - ((h * math.pow(((M * D) * (0.5 / d)), 2.0)) / l))) else: tmp = w0 * math.sqrt((1.0 + ((D / l) * (D * ((h * -0.25) / ((d / M) * (d / M))))))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(Float64(M * D) / Float64(2.0 * d)) <= 5e+84) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(Float64(M * D) * Float64(0.5 / d)) ^ 2.0)) / l)))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(D / l) * Float64(D * Float64(Float64(h * -0.25) / Float64(Float64(d / M) * Float64(d / M)))))))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (((M * D) / (2.0 * d)) <= 5e+84)
tmp = w0 * sqrt((1.0 - ((h * (((M * D) * (0.5 / d)) ^ 2.0)) / l)));
else
tmp = w0 * sqrt((1.0 + ((D / l) * (D * ((h * -0.25) / ((d / M) * (d / M)))))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 5e+84], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(N[(M * D), $MachinePrecision] * N[(0.5 / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(D / l), $MachinePrecision] * N[(D * N[(N[(h * -0.25), $MachinePrecision] / N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 5 \cdot 10^{+84}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(\left(M \cdot D\right) \cdot \frac{0.5}{d}\right)}^{2}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{D}{\ell} \cdot \left(D \cdot \frac{h \cdot -0.25}{\frac{d}{M} \cdot \frac{d}{M}}\right)}\\
\end{array}
\end{array}
if (/.f64 (*.f64 M D) (*.f64 2 d)) < 5.0000000000000001e84Initial program 83.6%
*-commutative83.6%
times-frac82.7%
Simplified82.7%
*-commutative82.7%
frac-times83.6%
*-commutative83.6%
associate-*l/89.7%
div-inv89.7%
associate-*l*88.9%
associate-/r*88.9%
metadata-eval88.9%
Applied egg-rr88.9%
Taylor expanded in M around 0 89.7%
*-commutative89.7%
associate-*l/89.7%
associate-*r/89.7%
Simplified89.7%
if 5.0000000000000001e84 < (/.f64 (*.f64 M D) (*.f64 2 d)) Initial program 64.1%
*-commutative64.1%
times-frac66.6%
Simplified66.6%
Taylor expanded in w0 around 0 55.9%
*-commutative55.9%
cancel-sign-sub-inv55.9%
*-commutative55.9%
cancel-sign-sub-inv55.9%
*-commutative55.9%
cancel-sign-sub-inv55.9%
distribute-lft-neg-in55.9%
distribute-rgt-neg-in55.9%
Simplified61.3%
*-un-lft-identity61.3%
associate-*l*61.3%
associate-/r/61.3%
times-frac69.0%
Applied egg-rr69.0%
*-lft-identity69.0%
associate-*l*69.0%
associate-*l/69.0%
Simplified69.0%
Final simplification86.5%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) 0.01)
(* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ M d) (/ D 2.0)) 2.0)))))
(*
w0
(sqrt (+ 1.0 (* -0.25 (/ (* D h) (* (* (/ d M) (/ d M)) (/ l D)))))))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= 0.01) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((M / d) * (D / 2.0)), 2.0))));
} else {
tmp = w0 * sqrt((1.0 + (-0.25 * ((D * h) / (((d / M) * (d / M)) * (l / D))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d 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(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l)) <= 0.01d0) then
tmp = w0 * sqrt((1.0d0 - ((h / l) * (((m / d_1) * (d / 2.0d0)) ** 2.0d0))))
else
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((d * h) / (((d_1 / m) * (d_1 / m)) * (l / d))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= 0.01) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((M / d) * (D / 2.0)), 2.0))));
} else {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((D * h) / (((d / M) * (d / M)) * (l / D))))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= 0.01: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((M / d) * (D / 2.0)), 2.0)))) else: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((D * h) / (((d / M) * (d / M)) * (l / D)))))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= 0.01) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(M / d) * Float64(D / 2.0)) ^ 2.0))))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(D * h) / Float64(Float64(Float64(d / M) * Float64(d / M)) * Float64(l / D))))))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)) <= 0.01)
tmp = w0 * sqrt((1.0 - ((h / l) * (((M / d) * (D / 2.0)) ^ 2.0))));
else
tmp = w0 * sqrt((1.0 + (-0.25 * ((D * h) / (((d / M) * (d / M)) * (l / D))))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], 0.01], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / d), $MachinePrecision] * N[(D / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(D * h), $MachinePrecision] / N[(N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision] * N[(l / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq 0.01:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{M}{d} \cdot \frac{D}{2}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \frac{D \cdot h}{\left(\frac{d}{M} \cdot \frac{d}{M}\right) \cdot \frac{\ell}{D}}}\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < 0.0100000000000000002Initial program 88.5%
*-commutative88.5%
times-frac88.1%
Simplified88.1%
if 0.0100000000000000002 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 0.0%
*-commutative0.0%
times-frac0.0%
Simplified0.0%
Taylor expanded in w0 around 0 48.3%
*-commutative48.3%
cancel-sign-sub-inv48.3%
*-commutative48.3%
cancel-sign-sub-inv48.3%
*-commutative48.3%
cancel-sign-sub-inv48.3%
distribute-lft-neg-in48.3%
distribute-rgt-neg-in48.3%
Simplified57.5%
frac-times66.2%
times-frac78.6%
Applied egg-rr78.6%
Final simplification87.2%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (pow (/ (* M D) (* 2.0 d)) 2.0) 2e+66)
(* w0 (sqrt (- 1.0 (/ (* h (pow (* M (* D (/ 0.5 d))) 2.0)) l))))
(*
w0
(sqrt (+ 1.0 (* (/ D l) (* D (/ (* h -0.25) (* (/ d M) (/ d M))))))))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (pow(((M * D) / (2.0 * d)), 2.0) <= 2e+66) {
tmp = w0 * sqrt((1.0 - ((h * pow((M * (D * (0.5 / d))), 2.0)) / l)));
} else {
tmp = w0 * sqrt((1.0 + ((D / l) * (D * ((h * -0.25) / ((d / M) * (d / M)))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d 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(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) <= 2d+66) then
tmp = w0 * sqrt((1.0d0 - ((h * ((m * (d * (0.5d0 / d_1))) ** 2.0d0)) / l)))
else
tmp = w0 * sqrt((1.0d0 + ((d / l) * (d * ((h * (-0.25d0)) / ((d_1 / m) * (d_1 / m)))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (Math.pow(((M * D) / (2.0 * d)), 2.0) <= 2e+66) {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow((M * (D * (0.5 / d))), 2.0)) / l)));
} else {
tmp = w0 * Math.sqrt((1.0 + ((D / l) * (D * ((h * -0.25) / ((d / M) * (d / M)))))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if math.pow(((M * D) / (2.0 * d)), 2.0) <= 2e+66: tmp = w0 * math.sqrt((1.0 - ((h * math.pow((M * (D * (0.5 / d))), 2.0)) / l))) else: tmp = w0 * math.sqrt((1.0 + ((D / l) * (D * ((h * -0.25) / ((d / M) * (d / M))))))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if ((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) <= 2e+66) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0)) / l)))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(D / l) * Float64(D * Float64(Float64(h * -0.25) / Float64(Float64(d / M) * Float64(d / M)))))))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if ((((M * D) / (2.0 * d)) ^ 2.0) <= 2e+66)
tmp = w0 * sqrt((1.0 - ((h * ((M * (D * (0.5 / d))) ^ 2.0)) / l)));
else
tmp = w0 * sqrt((1.0 + ((D / l) * (D * ((h * -0.25) / ((d / M) * (d / M)))))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], 2e+66], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(D / l), $MachinePrecision] * N[(D * N[(N[(h * -0.25), $MachinePrecision] / N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \leq 2 \cdot 10^{+66}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{D}{\ell} \cdot \left(D \cdot \frac{h \cdot -0.25}{\frac{d}{M} \cdot \frac{d}{M}}\right)}\\
\end{array}
\end{array}
if (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) < 1.99999999999999989e66Initial program 89.8%
*-commutative89.8%
times-frac89.8%
Simplified89.8%
*-commutative89.8%
frac-times89.8%
*-commutative89.8%
associate-*l/99.4%
div-inv99.4%
associate-*l*98.8%
associate-/r*98.8%
metadata-eval98.8%
Applied egg-rr98.8%
if 1.99999999999999989e66 < (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) Initial program 63.2%
*-commutative63.2%
times-frac62.1%
Simplified62.1%
Taylor expanded in w0 around 0 41.2%
*-commutative41.2%
cancel-sign-sub-inv41.2%
*-commutative41.2%
cancel-sign-sub-inv41.2%
*-commutative41.2%
cancel-sign-sub-inv41.2%
distribute-lft-neg-in41.2%
distribute-rgt-neg-in41.2%
Simplified48.4%
*-un-lft-identity48.4%
associate-*l*48.4%
associate-/r/48.4%
times-frac58.7%
Applied egg-rr58.7%
*-lft-identity58.7%
associate-*l*63.4%
associate-*l/63.4%
Simplified63.4%
Final simplification86.5%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (or (<= l -5e-110) (not (<= l 1e-109))) (* w0 (sqrt (+ 1.0 (* (/ D l) (* D (/ (* h -0.25) (* (/ d M) (/ d M)))))))) (* w0 (+ 1.0 (* (* (* D (/ D d)) (/ (/ (* M h) (/ l M)) d)) -0.125)))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((l <= -5e-110) || !(l <= 1e-109)) {
tmp = w0 * sqrt((1.0 + ((D / l) * (D * ((h * -0.25) / ((d / M) * (d / M)))))));
} else {
tmp = w0 * (1.0 + (((D * (D / d)) * (((M * h) / (l / M)) / d)) * -0.125));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d 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(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if ((l <= (-5d-110)) .or. (.not. (l <= 1d-109))) then
tmp = w0 * sqrt((1.0d0 + ((d / l) * (d * ((h * (-0.25d0)) / ((d_1 / m) * (d_1 / m)))))))
else
tmp = w0 * (1.0d0 + (((d * (d / d_1)) * (((m * h) / (l / m)) / d_1)) * (-0.125d0)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((l <= -5e-110) || !(l <= 1e-109)) {
tmp = w0 * Math.sqrt((1.0 + ((D / l) * (D * ((h * -0.25) / ((d / M) * (d / M)))))));
} else {
tmp = w0 * (1.0 + (((D * (D / d)) * (((M * h) / (l / M)) / d)) * -0.125));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (l <= -5e-110) or not (l <= 1e-109): tmp = w0 * math.sqrt((1.0 + ((D / l) * (D * ((h * -0.25) / ((d / M) * (d / M))))))) else: tmp = w0 * (1.0 + (((D * (D / d)) * (((M * h) / (l / M)) / d)) * -0.125)) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if ((l <= -5e-110) || !(l <= 1e-109)) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(D / l) * Float64(D * Float64(Float64(h * -0.25) / Float64(Float64(d / M) * Float64(d / M)))))))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(D * Float64(D / d)) * Float64(Float64(Float64(M * h) / Float64(l / M)) / d)) * -0.125))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if ((l <= -5e-110) || ~((l <= 1e-109)))
tmp = w0 * sqrt((1.0 + ((D / l) * (D * ((h * -0.25) / ((d / M) * (d / M)))))));
else
tmp = w0 * (1.0 + (((D * (D / d)) * (((M * h) / (l / M)) / d)) * -0.125));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[Or[LessEqual[l, -5e-110], N[Not[LessEqual[l, 1e-109]], $MachinePrecision]], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(D / l), $MachinePrecision] * N[(D * N[(N[(h * -0.25), $MachinePrecision] / N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * h), $MachinePrecision] / N[(l / M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-110} \lor \neg \left(\ell \leq 10^{-109}\right):\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{D}{\ell} \cdot \left(D \cdot \frac{h \cdot -0.25}{\frac{d}{M} \cdot \frac{d}{M}}\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \left(\left(D \cdot \frac{D}{d}\right) \cdot \frac{\frac{M \cdot h}{\frac{\ell}{M}}}{d}\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if l < -5e-110 or 9.9999999999999999e-110 < l Initial program 87.1%
*-commutative87.1%
times-frac86.6%
Simplified86.6%
Taylor expanded in w0 around 0 51.9%
*-commutative51.9%
cancel-sign-sub-inv51.9%
*-commutative51.9%
cancel-sign-sub-inv51.9%
*-commutative51.9%
cancel-sign-sub-inv51.9%
distribute-lft-neg-in51.9%
distribute-rgt-neg-in51.9%
Simplified59.2%
*-un-lft-identity59.2%
associate-*l*59.2%
associate-/r/59.2%
times-frac73.4%
Applied egg-rr73.4%
*-lft-identity73.4%
associate-*l*80.5%
associate-*l/80.5%
Simplified80.5%
if -5e-110 < l < 9.9999999999999999e-110Initial program 66.6%
*-commutative66.6%
times-frac66.6%
Simplified66.6%
Taylor expanded in M around 0 57.5%
*-commutative57.5%
*-commutative57.5%
times-frac57.6%
*-commutative57.6%
unpow257.6%
unpow257.6%
*-commutative57.6%
unpow257.6%
Simplified57.6%
Taylor expanded in D around 0 57.5%
*-commutative57.5%
times-frac57.6%
unpow257.6%
*-commutative57.6%
*-commutative57.6%
associate-/l*46.7%
associate-*l/46.7%
unpow246.7%
times-frac51.9%
unpow251.9%
associate-*r/54.3%
associate-/r/60.5%
*-commutative60.5%
associate-/l*61.9%
Simplified61.9%
associate-*r/64.2%
Applied egg-rr64.2%
Final simplification75.3%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= d 1.45e+18) (* w0 (sqrt (+ 1.0 (* -0.25 (* (/ D (/ l D)) (* M (/ (* M (/ h d)) d))))))) (* w0 (+ 1.0 (* -0.125 (* (* (/ D d) (/ D d)) (/ (* h (* M M)) l)))))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 1.45e+18) {
tmp = w0 * sqrt((1.0 + (-0.25 * ((D / (l / D)) * (M * ((M * (h / d)) / d))))));
} else {
tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / d)) * ((h * (M * M)) / l))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d 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(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 1.45d+18) then
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((d / (l / d)) * (m * ((m * (h / d_1)) / d_1))))))
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (((d / d_1) * (d / d_1)) * ((h * (m * m)) / l))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 1.45e+18) {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((D / (l / D)) * (M * ((M * (h / d)) / d))))));
} else {
tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / d)) * ((h * (M * M)) / l))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 1.45e+18: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((D / (l / D)) * (M * ((M * (h / d)) / d)))))) else: tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / d)) * ((h * (M * M)) / l)))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 1.45e+18) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(D / Float64(l / D)) * Float64(M * Float64(Float64(M * Float64(h / d)) / d))))))); else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(h * Float64(M * M)) / l))))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 1.45e+18)
tmp = w0 * sqrt((1.0 + (-0.25 * ((D / (l / D)) * (M * ((M * (h / d)) / d))))));
else
tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / d)) * ((h * (M * M)) / l))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 1.45e+18], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(D / N[(l / D), $MachinePrecision]), $MachinePrecision] * N[(M * N[(N[(M * N[(h / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.45 \cdot 10^{+18}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\frac{D}{\frac{\ell}{D}} \cdot \left(M \cdot \frac{M \cdot \frac{h}{d}}{d}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{h \cdot \left(M \cdot M\right)}{\ell}\right)\right)\\
\end{array}
\end{array}
if d < 1.45e18Initial program 78.2%
*-commutative78.2%
times-frac77.2%
Simplified77.2%
Taylor expanded in w0 around 0 50.5%
*-commutative50.5%
cancel-sign-sub-inv50.5%
*-commutative50.5%
cancel-sign-sub-inv50.5%
*-commutative50.5%
cancel-sign-sub-inv50.5%
distribute-lft-neg-in50.5%
distribute-rgt-neg-in50.5%
Simplified55.9%
Taylor expanded in h around 0 54.2%
unpow254.2%
associate-*l/54.4%
unpow254.4%
associate-*r*59.3%
*-commutative59.3%
associate-/r*66.9%
associate-*l/70.3%
Simplified70.3%
if 1.45e18 < d Initial program 89.2%
*-commutative89.2%
times-frac91.0%
Simplified91.0%
Taylor expanded in M around 0 63.9%
*-commutative63.9%
*-commutative63.9%
times-frac60.4%
*-commutative60.4%
unpow260.4%
unpow260.4%
*-commutative60.4%
unpow260.4%
Simplified60.4%
Taylor expanded in D around 0 60.4%
unpow22.7%
unpow22.7%
times-frac5.2%
Simplified73.3%
Final simplification70.9%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= d 4.2e+18) (* w0 (sqrt (+ 1.0 (* (/ D l) (* D (/ (* h -0.25) (* (/ d M) (/ d M)))))))) (* w0 (sqrt (- 1.0 (/ (* 0.25 (* (* (/ D d) (/ D d)) (* h (* M M)))) l))))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 4.2e+18) {
tmp = w0 * sqrt((1.0 + ((D / l) * (D * ((h * -0.25) / ((d / M) * (d / M)))))));
} else {
tmp = w0 * sqrt((1.0 - ((0.25 * (((D / d) * (D / d)) * (h * (M * M)))) / l)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d 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(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 4.2d+18) then
tmp = w0 * sqrt((1.0d0 + ((d / l) * (d * ((h * (-0.25d0)) / ((d_1 / m) * (d_1 / m)))))))
else
tmp = w0 * sqrt((1.0d0 - ((0.25d0 * (((d / d_1) * (d / d_1)) * (h * (m * m)))) / l)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 4.2e+18) {
tmp = w0 * Math.sqrt((1.0 + ((D / l) * (D * ((h * -0.25) / ((d / M) * (d / M)))))));
} else {
tmp = w0 * Math.sqrt((1.0 - ((0.25 * (((D / d) * (D / d)) * (h * (M * M)))) / l)));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 4.2e+18: tmp = w0 * math.sqrt((1.0 + ((D / l) * (D * ((h * -0.25) / ((d / M) * (d / M))))))) else: tmp = w0 * math.sqrt((1.0 - ((0.25 * (((D / d) * (D / d)) * (h * (M * M)))) / l))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 4.2e+18) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(D / l) * Float64(D * Float64(Float64(h * -0.25) / Float64(Float64(d / M) * Float64(d / M)))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(h * Float64(M * M)))) / l)))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 4.2e+18)
tmp = w0 * sqrt((1.0 + ((D / l) * (D * ((h * -0.25) / ((d / M) * (d / M)))))));
else
tmp = w0 * sqrt((1.0 - ((0.25 * (((D / d) * (D / d)) * (h * (M * M)))) / l)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 4.2e+18], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(D / l), $MachinePrecision] * N[(D * N[(N[(h * -0.25), $MachinePrecision] / N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 4.2 \cdot 10^{+18}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{D}{\ell} \cdot \left(D \cdot \frac{h \cdot -0.25}{\frac{d}{M} \cdot \frac{d}{M}}\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{\ell}}\\
\end{array}
\end{array}
if d < 4.2e18Initial program 78.2%
*-commutative78.2%
times-frac77.2%
Simplified77.2%
Taylor expanded in w0 around 0 50.5%
*-commutative50.5%
cancel-sign-sub-inv50.5%
*-commutative50.5%
cancel-sign-sub-inv50.5%
*-commutative50.5%
cancel-sign-sub-inv50.5%
distribute-lft-neg-in50.5%
distribute-rgt-neg-in50.5%
Simplified55.9%
*-un-lft-identity55.9%
associate-*l*55.9%
associate-/r/55.9%
times-frac70.3%
Applied egg-rr70.3%
*-lft-identity70.3%
associate-*l*75.9%
associate-*l/75.9%
Simplified75.9%
if 4.2e18 < d Initial program 89.2%
*-commutative89.2%
times-frac91.0%
Simplified91.0%
*-commutative91.0%
frac-times89.2%
*-commutative89.2%
associate-*l/94.7%
div-inv94.7%
associate-*l*94.7%
associate-/r*94.7%
metadata-eval94.7%
Applied egg-rr94.7%
Taylor expanded in h around 0 65.6%
associate-/l*67.4%
unpow267.4%
associate-/r/67.3%
unpow267.3%
unpow267.3%
times-frac81.9%
Simplified81.9%
Final simplification77.2%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= M 7e-39)
w0
(if (<= M 3.4e-16)
(* -0.125 (* (/ (* D D) (* d d)) (* (/ w0 l) (* M (* M h)))))
(if (<= M 2.05e+20)
w0
(* -0.125 (* (* (/ D d) (/ D d)) (/ (* w0 (* h (* M M))) l)))))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 7e-39) {
tmp = w0;
} else if (M <= 3.4e-16) {
tmp = -0.125 * (((D * D) / (d * d)) * ((w0 / l) * (M * (M * h))));
} else if (M <= 2.05e+20) {
tmp = w0;
} else {
tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * (h * (M * M))) / l));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d 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(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 7d-39) then
tmp = w0
else if (m <= 3.4d-16) then
tmp = (-0.125d0) * (((d * d) / (d_1 * d_1)) * ((w0 / l) * (m * (m * h))))
else if (m <= 2.05d+20) then
tmp = w0
else
tmp = (-0.125d0) * (((d / d_1) * (d / d_1)) * ((w0 * (h * (m * m))) / l))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 7e-39) {
tmp = w0;
} else if (M <= 3.4e-16) {
tmp = -0.125 * (((D * D) / (d * d)) * ((w0 / l) * (M * (M * h))));
} else if (M <= 2.05e+20) {
tmp = w0;
} else {
tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * (h * (M * M))) / l));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 7e-39: tmp = w0 elif M <= 3.4e-16: tmp = -0.125 * (((D * D) / (d * d)) * ((w0 / l) * (M * (M * h)))) elif M <= 2.05e+20: tmp = w0 else: tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * (h * (M * M))) / l)) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 7e-39) tmp = w0; elseif (M <= 3.4e-16) tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) / Float64(d * d)) * Float64(Float64(w0 / l) * Float64(M * Float64(M * h))))); elseif (M <= 2.05e+20) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(w0 * Float64(h * Float64(M * M))) / l))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 7e-39)
tmp = w0;
elseif (M <= 3.4e-16)
tmp = -0.125 * (((D * D) / (d * d)) * ((w0 / l) * (M * (M * h))));
elseif (M <= 2.05e+20)
tmp = w0;
else
tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * (h * (M * M))) / l));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 7e-39], w0, If[LessEqual[M, 3.4e-16], N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(N[(w0 / l), $MachinePrecision] * N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 2.05e+20], w0, N[(-0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(w0 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 7 \cdot 10^{-39}:\\
\;\;\;\;w0\\
\mathbf{elif}\;M \leq 3.4 \cdot 10^{-16}:\\
\;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{d \cdot d} \cdot \left(\frac{w0}{\ell} \cdot \left(M \cdot \left(M \cdot h\right)\right)\right)\right)\\
\mathbf{elif}\;M \leq 2.05 \cdot 10^{+20}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{w0 \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\ell}\right)\\
\end{array}
\end{array}
if M < 6.99999999999999999e-39 or 3.4e-16 < M < 2.05e20Initial program 80.0%
*-commutative80.0%
times-frac79.5%
Simplified79.5%
Taylor expanded in M around 0 71.9%
if 6.99999999999999999e-39 < M < 3.4e-16Initial program 61.4%
*-commutative61.4%
times-frac61.4%
Simplified61.4%
Taylor expanded in M around 0 61.4%
*-commutative61.4%
*-commutative61.4%
times-frac61.4%
*-commutative61.4%
unpow261.4%
unpow261.4%
*-commutative61.4%
unpow261.4%
Simplified61.4%
Taylor expanded in D around 0 61.4%
*-commutative61.4%
times-frac61.4%
unpow261.4%
*-commutative61.4%
*-commutative61.4%
associate-/l*61.4%
associate-*l/61.4%
unpow261.4%
times-frac62.0%
unpow262.0%
associate-*r/62.0%
associate-/r/62.0%
*-commutative62.0%
associate-/l*62.0%
Simplified62.0%
Taylor expanded in D around inf 21.9%
associate-*r/21.9%
*-commutative21.9%
*-commutative21.9%
associate-*r/21.9%
times-frac21.9%
unpow221.9%
unpow221.9%
*-commutative21.9%
unpow221.9%
Simplified21.9%
Taylor expanded in h around 0 21.9%
associate-/l*21.9%
*-commutative21.9%
associate-/r/21.9%
unpow221.9%
associate-*r*21.9%
*-commutative21.9%
Simplified21.9%
if 2.05e20 < M Initial program 85.0%
*-commutative85.0%
times-frac85.1%
Simplified85.1%
Taylor expanded in M around 0 59.0%
*-commutative59.0%
*-commutative59.0%
times-frac56.8%
*-commutative56.8%
unpow256.8%
unpow256.8%
*-commutative56.8%
unpow256.8%
Simplified56.8%
Taylor expanded in D around 0 59.0%
*-commutative59.0%
times-frac56.8%
unpow256.8%
*-commutative56.8%
*-commutative56.8%
associate-/l*58.9%
associate-*l/58.8%
unpow258.8%
times-frac61.3%
unpow261.3%
associate-*r/65.7%
associate-/r/57.1%
*-commutative57.1%
associate-/l*59.3%
Simplified59.3%
Taylor expanded in D around inf 33.8%
associate-*r/33.8%
*-commutative33.8%
*-commutative33.8%
associate-*r/33.8%
times-frac33.8%
unpow233.8%
unpow233.8%
*-commutative33.8%
unpow233.8%
Simplified33.8%
Taylor expanded in D around 0 33.8%
unpow233.8%
unpow233.8%
times-frac36.4%
Simplified36.4%
Final simplification64.5%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (* h (* M M))))
(if (<= M 7e-39)
w0
(if (<= M 3.4e-16)
(* -0.125 (/ (* (* D D) (/ t_0 (/ l w0))) (* d d)))
(if (<= M 9e+18)
w0
(* -0.125 (* (* (/ D d) (/ D d)) (/ (* w0 t_0) l))))))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = h * (M * M);
double tmp;
if (M <= 7e-39) {
tmp = w0;
} else if (M <= 3.4e-16) {
tmp = -0.125 * (((D * D) * (t_0 / (l / w0))) / (d * d));
} else if (M <= 9e+18) {
tmp = w0;
} else {
tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * t_0) / l));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d 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(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = h * (m * m)
if (m <= 7d-39) then
tmp = w0
else if (m <= 3.4d-16) then
tmp = (-0.125d0) * (((d * d) * (t_0 / (l / w0))) / (d_1 * d_1))
else if (m <= 9d+18) then
tmp = w0
else
tmp = (-0.125d0) * (((d / d_1) * (d / d_1)) * ((w0 * t_0) / l))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = h * (M * M);
double tmp;
if (M <= 7e-39) {
tmp = w0;
} else if (M <= 3.4e-16) {
tmp = -0.125 * (((D * D) * (t_0 / (l / w0))) / (d * d));
} else if (M <= 9e+18) {
tmp = w0;
} else {
tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * t_0) / l));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): t_0 = h * (M * M) tmp = 0 if M <= 7e-39: tmp = w0 elif M <= 3.4e-16: tmp = -0.125 * (((D * D) * (t_0 / (l / w0))) / (d * d)) elif M <= 9e+18: tmp = w0 else: tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * t_0) / l)) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) t_0 = Float64(h * Float64(M * M)) tmp = 0.0 if (M <= 7e-39) tmp = w0; elseif (M <= 3.4e-16) tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) * Float64(t_0 / Float64(l / w0))) / Float64(d * d))); elseif (M <= 9e+18) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(w0 * t_0) / l))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
t_0 = h * (M * M);
tmp = 0.0;
if (M <= 7e-39)
tmp = w0;
elseif (M <= 3.4e-16)
tmp = -0.125 * (((D * D) * (t_0 / (l / w0))) / (d * d));
elseif (M <= 9e+18)
tmp = w0;
else
tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * t_0) / l));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, 7e-39], w0, If[LessEqual[M, 3.4e-16], N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] * N[(t$95$0 / N[(l / w0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 9e+18], w0, N[(-0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(w0 * t$95$0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := h \cdot \left(M \cdot M\right)\\
\mathbf{if}\;M \leq 7 \cdot 10^{-39}:\\
\;\;\;\;w0\\
\mathbf{elif}\;M \leq 3.4 \cdot 10^{-16}:\\
\;\;\;\;-0.125 \cdot \frac{\left(D \cdot D\right) \cdot \frac{t_0}{\frac{\ell}{w0}}}{d \cdot d}\\
\mathbf{elif}\;M \leq 9 \cdot 10^{+18}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{w0 \cdot t_0}{\ell}\right)\\
\end{array}
\end{array}
if M < 6.99999999999999999e-39 or 3.4e-16 < M < 9e18Initial program 80.0%
*-commutative80.0%
times-frac79.5%
Simplified79.5%
Taylor expanded in M around 0 71.9%
if 6.99999999999999999e-39 < M < 3.4e-16Initial program 61.4%
*-commutative61.4%
times-frac61.4%
Simplified61.4%
Taylor expanded in M around 0 61.4%
*-commutative61.4%
*-commutative61.4%
times-frac61.4%
*-commutative61.4%
unpow261.4%
unpow261.4%
*-commutative61.4%
unpow261.4%
Simplified61.4%
Taylor expanded in D around 0 61.4%
*-commutative61.4%
times-frac61.4%
unpow261.4%
*-commutative61.4%
*-commutative61.4%
associate-/l*61.4%
associate-*l/61.4%
unpow261.4%
times-frac62.0%
unpow262.0%
associate-*r/62.0%
associate-/r/62.0%
*-commutative62.0%
associate-/l*62.0%
Simplified62.0%
Taylor expanded in D around inf 21.9%
associate-*r/21.9%
*-commutative21.9%
*-commutative21.9%
associate-*r/21.9%
times-frac21.9%
unpow221.9%
unpow221.9%
*-commutative21.9%
unpow221.9%
Simplified21.9%
associate-*l/21.9%
associate-/l*21.9%
Applied egg-rr21.9%
if 9e18 < M Initial program 85.0%
*-commutative85.0%
times-frac85.1%
Simplified85.1%
Taylor expanded in M around 0 59.0%
*-commutative59.0%
*-commutative59.0%
times-frac56.8%
*-commutative56.8%
unpow256.8%
unpow256.8%
*-commutative56.8%
unpow256.8%
Simplified56.8%
Taylor expanded in D around 0 59.0%
*-commutative59.0%
times-frac56.8%
unpow256.8%
*-commutative56.8%
*-commutative56.8%
associate-/l*58.9%
associate-*l/58.8%
unpow258.8%
times-frac61.3%
unpow261.3%
associate-*r/65.7%
associate-/r/57.1%
*-commutative57.1%
associate-/l*59.3%
Simplified59.3%
Taylor expanded in D around inf 33.8%
associate-*r/33.8%
*-commutative33.8%
*-commutative33.8%
associate-*r/33.8%
times-frac33.8%
unpow233.8%
unpow233.8%
*-commutative33.8%
unpow233.8%
Simplified33.8%
Taylor expanded in D around 0 33.8%
unpow233.8%
unpow233.8%
times-frac36.4%
Simplified36.4%
Final simplification64.5%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= (/ h l) -1e-234) (* w0 (+ 1.0 (* -0.125 (* (* D (/ D d)) (/ (* h (/ M (/ l M))) d))))) w0))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -1e-234) {
tmp = w0 * (1.0 + (-0.125 * ((D * (D / d)) * ((h * (M / (l / M))) / d))));
} else {
tmp = w0;
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d 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(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if ((h / l) <= (-1d-234)) then
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d * (d / d_1)) * ((h * (m / (l / m))) / d_1))))
else
tmp = w0
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -1e-234) {
tmp = w0 * (1.0 + (-0.125 * ((D * (D / d)) * ((h * (M / (l / M))) / d))));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (h / l) <= -1e-234: tmp = w0 * (1.0 + (-0.125 * ((D * (D / d)) * ((h * (M / (l / M))) / d)))) else: tmp = w0 return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(h / l) <= -1e-234) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D * Float64(D / d)) * Float64(Float64(h * Float64(M / Float64(l / M))) / d))))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if ((h / l) <= -1e-234)
tmp = w0 * (1.0 + (-0.125 * ((D * (D / d)) * ((h * (M / (l / M))) / d))));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(h / l), $MachinePrecision], -1e-234], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(h * N[(M / N[(l / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -1 \cdot 10^{-234}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\left(D \cdot \frac{D}{d}\right) \cdot \frac{h \cdot \frac{M}{\frac{\ell}{M}}}{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if (/.f64 h l) < -9.9999999999999996e-235Initial program 75.8%
*-commutative75.8%
times-frac76.5%
Simplified76.5%
Taylor expanded in M around 0 50.6%
*-commutative50.6%
*-commutative50.6%
times-frac50.7%
*-commutative50.7%
unpow250.7%
unpow250.7%
*-commutative50.7%
unpow250.7%
Simplified50.7%
Taylor expanded in D around 0 50.6%
*-commutative50.6%
times-frac50.7%
unpow250.7%
*-commutative50.7%
*-commutative50.7%
associate-/l*47.1%
associate-*l/47.1%
unpow247.1%
times-frac55.5%
unpow255.5%
associate-*r/59.2%
associate-/r/62.1%
*-commutative62.1%
associate-/l*63.7%
Simplified63.7%
if -9.9999999999999996e-235 < (/.f64 h l) Initial program 86.0%
*-commutative86.0%
times-frac84.3%
Simplified84.3%
Taylor expanded in M around 0 90.7%
Final simplification76.4%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= (/ h l) -1e-234) (* w0 (+ 1.0 (* (* (* D (/ D d)) (/ (/ (* M h) (/ l M)) d)) -0.125))) w0))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -1e-234) {
tmp = w0 * (1.0 + (((D * (D / d)) * (((M * h) / (l / M)) / d)) * -0.125));
} else {
tmp = w0;
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d 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(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if ((h / l) <= (-1d-234)) then
tmp = w0 * (1.0d0 + (((d * (d / d_1)) * (((m * h) / (l / m)) / d_1)) * (-0.125d0)))
else
tmp = w0
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -1e-234) {
tmp = w0 * (1.0 + (((D * (D / d)) * (((M * h) / (l / M)) / d)) * -0.125));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (h / l) <= -1e-234: tmp = w0 * (1.0 + (((D * (D / d)) * (((M * h) / (l / M)) / d)) * -0.125)) else: tmp = w0 return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(h / l) <= -1e-234) tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(D * Float64(D / d)) * Float64(Float64(Float64(M * h) / Float64(l / M)) / d)) * -0.125))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if ((h / l) <= -1e-234)
tmp = w0 * (1.0 + (((D * (D / d)) * (((M * h) / (l / M)) / d)) * -0.125));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(h / l), $MachinePrecision], -1e-234], N[(w0 * N[(1.0 + N[(N[(N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * h), $MachinePrecision] / N[(l / M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -1 \cdot 10^{-234}:\\
\;\;\;\;w0 \cdot \left(1 + \left(\left(D \cdot \frac{D}{d}\right) \cdot \frac{\frac{M \cdot h}{\frac{\ell}{M}}}{d}\right) \cdot -0.125\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if (/.f64 h l) < -9.9999999999999996e-235Initial program 75.8%
*-commutative75.8%
times-frac76.5%
Simplified76.5%
Taylor expanded in M around 0 50.6%
*-commutative50.6%
*-commutative50.6%
times-frac50.7%
*-commutative50.7%
unpow250.7%
unpow250.7%
*-commutative50.7%
unpow250.7%
Simplified50.7%
Taylor expanded in D around 0 50.6%
*-commutative50.6%
times-frac50.7%
unpow250.7%
*-commutative50.7%
*-commutative50.7%
associate-/l*47.1%
associate-*l/47.1%
unpow247.1%
times-frac55.5%
unpow255.5%
associate-*r/59.2%
associate-/r/62.1%
*-commutative62.1%
associate-/l*63.7%
Simplified63.7%
associate-*r/62.2%
Applied egg-rr62.2%
if -9.9999999999999996e-235 < (/.f64 h l) Initial program 86.0%
*-commutative86.0%
times-frac84.3%
Simplified84.3%
Taylor expanded in M around 0 90.7%
Final simplification75.6%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 1.15e-45) w0 (* w0 (+ 1.0 (* -0.125 (* (* D (/ D d)) (* (/ h l) (/ M (/ d M)))))))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.15e-45) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((D * (D / d)) * ((h / l) * (M / (d / M))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d 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(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 1.15d-45) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d * (d / d_1)) * ((h / l) * (m / (d_1 / m))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.15e-45) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((D * (D / d)) * ((h / l) * (M / (d / M))))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.15e-45: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * ((D * (D / d)) * ((h / l) * (M / (d / M)))))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.15e-45) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D * Float64(D / d)) * Float64(Float64(h / l) * Float64(M / Float64(d / M))))))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 1.15e-45)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * ((D * (D / d)) * ((h / l) * (M / (d / M))))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 1.15e-45], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * N[(M / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.15 \cdot 10^{-45}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\left(D \cdot \frac{D}{d}\right) \cdot \left(\frac{h}{\ell} \cdot \frac{M}{\frac{d}{M}}\right)\right)\right)\\
\end{array}
\end{array}
if M < 1.14999999999999996e-45Initial program 80.3%
*-commutative80.3%
times-frac80.3%
Simplified80.3%
Taylor expanded in M around 0 71.3%
if 1.14999999999999996e-45 < M Initial program 81.3%
*-commutative81.3%
times-frac79.8%
Simplified79.8%
Taylor expanded in M around 0 57.2%
*-commutative57.2%
*-commutative57.2%
times-frac53.9%
*-commutative53.9%
unpow253.9%
unpow253.9%
*-commutative53.9%
unpow253.9%
Simplified53.9%
Taylor expanded in D around 0 57.2%
*-commutative57.2%
times-frac53.9%
unpow253.9%
*-commutative53.9%
*-commutative53.9%
associate-/l*55.5%
associate-*l/55.4%
unpow255.4%
times-frac63.8%
unpow263.8%
associate-*r/67.0%
associate-/r/60.7%
*-commutative60.7%
associate-/l*62.3%
Simplified62.3%
Taylor expanded in h around 0 67.1%
*-commutative67.1%
times-frac67.0%
unpow267.0%
associate-/l*71.8%
Simplified71.8%
Final simplification71.4%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 2.25e+20) w0 (* -0.125 (* (* (/ D d) (/ D d)) (/ (* w0 (* h (* M M))) l)))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2.25e+20) {
tmp = w0;
} else {
tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * (h * (M * M))) / l));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d 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(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 2.25d+20) then
tmp = w0
else
tmp = (-0.125d0) * (((d / d_1) * (d / d_1)) * ((w0 * (h * (m * m))) / l))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2.25e+20) {
tmp = w0;
} else {
tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * (h * (M * M))) / l));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 2.25e+20: tmp = w0 else: tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * (h * (M * M))) / l)) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 2.25e+20) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(w0 * Float64(h * Float64(M * M))) / l))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 2.25e+20)
tmp = w0;
else
tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * (h * (M * M))) / l));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 2.25e+20], w0, N[(-0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(w0 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 2.25 \cdot 10^{+20}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{w0 \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\ell}\right)\\
\end{array}
\end{array}
if M < 2.25e20Initial program 79.6%
*-commutative79.6%
times-frac79.1%
Simplified79.1%
Taylor expanded in M around 0 71.2%
if 2.25e20 < M Initial program 85.0%
*-commutative85.0%
times-frac85.1%
Simplified85.1%
Taylor expanded in M around 0 59.0%
*-commutative59.0%
*-commutative59.0%
times-frac56.8%
*-commutative56.8%
unpow256.8%
unpow256.8%
*-commutative56.8%
unpow256.8%
Simplified56.8%
Taylor expanded in D around 0 59.0%
*-commutative59.0%
times-frac56.8%
unpow256.8%
*-commutative56.8%
*-commutative56.8%
associate-/l*58.9%
associate-*l/58.8%
unpow258.8%
times-frac61.3%
unpow261.3%
associate-*r/65.7%
associate-/r/57.1%
*-commutative57.1%
associate-/l*59.3%
Simplified59.3%
Taylor expanded in D around inf 33.8%
associate-*r/33.8%
*-commutative33.8%
*-commutative33.8%
associate-*r/33.8%
times-frac33.8%
unpow233.8%
unpow233.8%
*-commutative33.8%
unpow233.8%
Simplified33.8%
Taylor expanded in D around 0 33.8%
unpow233.8%
unpow233.8%
times-frac36.4%
Simplified36.4%
Final simplification64.9%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 w0)
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d 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(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return w0 end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := w0
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0
\end{array}
Initial program 80.6%
*-commutative80.6%
times-frac80.2%
Simplified80.2%
Taylor expanded in M around 0 66.7%
Final simplification66.7%
herbie shell --seed 2023207
(FPCore (w0 M D h l d)
:name "Henrywood and Agarwal, Equation (9a)"
:precision binary64
(* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))