
(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: 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) 5e+112)
(* w0 (sqrt (- 1.0 (/ (* (pow (* (* M 0.5) (/ D d)) 2.0) h) l))))
(*
w0
(sqrt (+ 1.0 (* -0.25 (* (/ M d) (* (/ D (/ l (* D h))) (/ M d)))))))))M = abs(M);
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) <= 5e+112) {
tmp = w0 * sqrt((1.0 - ((pow(((M * 0.5) * (D / d)), 2.0) * h) / l)));
} else {
tmp = w0 * sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / 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(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) <= 5d+112) then
tmp = w0 * sqrt((1.0d0 - (((((m * 0.5d0) * (d / d_1)) ** 2.0d0) * h) / l)))
else
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((m / d_1) * ((d / (l / (d * h))) * (m / d_1))))))
end if
code = tmp
end function
M = Math.abs(M);
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) <= 5e+112) {
tmp = w0 * Math.sqrt((1.0 - ((Math.pow(((M * 0.5) * (D / d)), 2.0) * h) / l)));
} else {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / d))))));
}
return tmp;
}
M = abs(M) [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) <= 5e+112: tmp = w0 * math.sqrt((1.0 - ((math.pow(((M * 0.5) * (D / d)), 2.0) * h) / l))) else: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / d)))))) return tmp
M = abs(M) 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) <= 5e+112) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64((Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0) * h) / l)))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(M / d) * Float64(Float64(D / Float64(l / Float64(D * h))) * Float64(M / d))))))); end return tmp end
M = abs(M)
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) <= 5e+112)
tmp = w0 * sqrt((1.0 - (((((M * 0.5) * (D / d)) ^ 2.0) * h) / l)));
else
tmp = w0 * sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / 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[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], 5e+112], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(M / d), $MachinePrecision] * N[(N[(D / N[(l / N[(D * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \leq 5 \cdot 10^{+112}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2} \cdot h}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\frac{M}{d} \cdot \left(\frac{D}{\frac{\ell}{D \cdot h}} \cdot \frac{M}{d}\right)\right)}\\
\end{array}
\end{array}
if (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) < 5e112Initial program 93.4%
times-frac92.9%
Simplified92.9%
associate-*r/96.2%
div-inv96.2%
metadata-eval96.2%
Applied egg-rr96.2%
if 5e112 < (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) Initial program 57.3%
times-frac60.5%
Simplified60.5%
Taylor expanded in w0 around 0 43.6%
cancel-sign-sub-inv43.6%
*-commutative43.6%
cancel-sign-sub-inv43.6%
Simplified44.1%
*-un-lft-identity44.1%
associate-*r*44.1%
times-frac54.8%
Applied egg-rr54.8%
*-lft-identity54.8%
associate-*l*54.8%
associate-*r*57.6%
associate-/l*61.0%
Simplified61.0%
Final simplification83.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 (w0 M D h l d)
:precision binary64
(if (<= (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))) 1e+261)
(* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ M d) (/ D 2.0)) 2.0)))))
(*
w0
(sqrt (+ 1.0 (* -0.25 (* (/ M d) (* (/ D (/ l (* D h))) (/ M d)))))))))M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= 1e+261) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((M / d) * (D / 2.0)), 2.0))));
} else {
tmp = w0 * sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / 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(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 ((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))) <= 1d+261) then
tmp = w0 * sqrt((1.0d0 - ((h / l) * (((m / d_1) * (d / 2.0d0)) ** 2.0d0))))
else
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((m / d_1) * ((d / (l / (d * h))) * (m / d_1))))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= 1e+261) {
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 * ((M / d) * ((D / (l / (D * h))) * (M / d))))));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= 1e+261: 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 * ((M / d) * ((D / (l / (D * h))) * (M / d)))))) return tmp
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))) <= 1e+261) 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(M / d) * Float64(Float64(D / Float64(l / Float64(D * h))) * Float64(M / d))))))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if ((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l))) <= 1e+261)
tmp = w0 * sqrt((1.0 - ((h / l) * (((M / d) * (D / 2.0)) ^ 2.0))));
else
tmp = w0 * sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / 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[w0_, M_, D_, h_, l_, d_] := If[LessEqual[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], 1e+261], 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[(M / d), $MachinePrecision] * N[(N[(D / N[(l / N[(D * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq 10^{+261}:\\
\;\;\;\;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 \left(\frac{M}{d} \cdot \left(\frac{D}{\frac{\ell}{D \cdot h}} \cdot \frac{M}{d}\right)\right)}\\
\end{array}
\end{array}
if (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < 9.9999999999999993e260Initial program 99.3%
*-commutative99.3%
times-frac98.9%
Simplified98.9%
if 9.9999999999999993e260 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) Initial program 46.5%
times-frac48.6%
Simplified48.6%
Taylor expanded in w0 around 0 42.7%
cancel-sign-sub-inv42.7%
*-commutative42.7%
cancel-sign-sub-inv42.7%
Simplified41.4%
*-un-lft-identity41.4%
associate-*r*41.4%
times-frac52.7%
Applied egg-rr52.7%
*-lft-identity52.7%
associate-*l*52.7%
associate-*r*53.1%
associate-/l*56.0%
Simplified56.0%
Final simplification83.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 (w0 M D h l d)
:precision binary64
(if (<= (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))) 1e+261)
(* w0 (sqrt (- 1.0 (* (/ h l) (pow (/ (/ M d) (/ 2.0 D)) 2.0)))))
(*
w0
(sqrt (+ 1.0 (* -0.25 (* (/ M d) (* (/ D (/ l (* D h))) (/ M d)))))))))M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= 1e+261) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((M / d) / (2.0 / D)), 2.0))));
} else {
tmp = w0 * sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / 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(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 ((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))) <= 1d+261) then
tmp = w0 * sqrt((1.0d0 - ((h / l) * (((m / d_1) / (2.0d0 / d)) ** 2.0d0))))
else
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((m / d_1) * ((d / (l / (d * h))) * (m / d_1))))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= 1e+261) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((M / d) / (2.0 / D)), 2.0))));
} else {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / d))))));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= 1e+261: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((M / d) / (2.0 / D)), 2.0)))) else: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / d)))))) return tmp
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))) <= 1e+261) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(M / d) / Float64(2.0 / D)) ^ 2.0))))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(M / d) * Float64(Float64(D / Float64(l / Float64(D * h))) * Float64(M / d))))))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if ((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l))) <= 1e+261)
tmp = w0 * sqrt((1.0 - ((h / l) * (((M / d) / (2.0 / D)) ^ 2.0))));
else
tmp = w0 * sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / 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[w0_, M_, D_, h_, l_, d_] := If[LessEqual[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], 1e+261], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / d), $MachinePrecision] / N[(2.0 / D), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(M / d), $MachinePrecision] * N[(N[(D / N[(l / N[(D * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq 10^{+261}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{\frac{M}{d}}{\frac{2}{D}}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\frac{M}{d} \cdot \left(\frac{D}{\frac{\ell}{D \cdot h}} \cdot \frac{M}{d}\right)\right)}\\
\end{array}
\end{array}
if (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < 9.9999999999999993e260Initial program 99.3%
*-commutative99.3%
times-frac98.9%
Simplified98.9%
clear-num98.9%
un-div-inv98.9%
Applied egg-rr98.9%
if 9.9999999999999993e260 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) Initial program 46.5%
times-frac48.6%
Simplified48.6%
Taylor expanded in w0 around 0 42.7%
cancel-sign-sub-inv42.7%
*-commutative42.7%
cancel-sign-sub-inv42.7%
Simplified41.4%
*-un-lft-identity41.4%
associate-*r*41.4%
times-frac52.7%
Applied egg-rr52.7%
*-lft-identity52.7%
associate-*l*52.7%
associate-*r*53.1%
associate-/l*56.0%
Simplified56.0%
Final simplification83.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 (w0 M D h l d)
:precision binary64
(if (<= (pow (/ (* M D) (* 2.0 d)) 2.0) 5e+112)
(* w0 (sqrt (- 1.0 (/ (* h (pow (* 0.5 (/ D (/ d M))) 2.0)) l))))
(*
w0
(sqrt (+ 1.0 (* -0.25 (* (/ M d) (* (/ D (/ l (* D h))) (/ M d)))))))))M = abs(M);
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) <= 5e+112) {
tmp = w0 * sqrt((1.0 - ((h * pow((0.5 * (D / (d / M))), 2.0)) / l)));
} else {
tmp = w0 * sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / 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(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) <= 5d+112) then
tmp = w0 * sqrt((1.0d0 - ((h * ((0.5d0 * (d / (d_1 / m))) ** 2.0d0)) / l)))
else
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((m / d_1) * ((d / (l / (d * h))) * (m / d_1))))))
end if
code = tmp
end function
M = Math.abs(M);
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) <= 5e+112) {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow((0.5 * (D / (d / M))), 2.0)) / l)));
} else {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / d))))));
}
return tmp;
}
M = abs(M) [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) <= 5e+112: tmp = w0 * math.sqrt((1.0 - ((h * math.pow((0.5 * (D / (d / M))), 2.0)) / l))) else: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / d)))))) return tmp
M = abs(M) 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) <= 5e+112) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(0.5 * Float64(D / Float64(d / M))) ^ 2.0)) / l)))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(M / d) * Float64(Float64(D / Float64(l / Float64(D * h))) * Float64(M / d))))))); end return tmp end
M = abs(M)
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) <= 5e+112)
tmp = w0 * sqrt((1.0 - ((h * ((0.5 * (D / (d / M))) ^ 2.0)) / l)));
else
tmp = w0 * sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / 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[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], 5e+112], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(0.5 * N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(M / d), $MachinePrecision] * N[(N[(D / N[(l / N[(D * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \leq 5 \cdot 10^{+112}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(0.5 \cdot \frac{D}{\frac{d}{M}}\right)}^{2}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\frac{M}{d} \cdot \left(\frac{D}{\frac{\ell}{D \cdot h}} \cdot \frac{M}{d}\right)\right)}\\
\end{array}
\end{array}
if (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) < 5e112Initial program 93.4%
times-frac92.9%
Simplified92.9%
associate-*r/96.2%
div-inv96.2%
metadata-eval96.2%
Applied egg-rr96.2%
Taylor expanded in M around 0 96.7%
associate-/l*96.2%
Simplified96.2%
if 5e112 < (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) Initial program 57.3%
times-frac60.5%
Simplified60.5%
Taylor expanded in w0 around 0 43.6%
cancel-sign-sub-inv43.6%
*-commutative43.6%
cancel-sign-sub-inv43.6%
Simplified44.1%
*-un-lft-identity44.1%
associate-*r*44.1%
times-frac54.8%
Applied egg-rr54.8%
*-lft-identity54.8%
associate-*l*54.8%
associate-*r*57.6%
associate-/l*61.0%
Simplified61.0%
Final simplification83.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 (w0 M D h l d) :precision binary64 (if (<= d 2e-65) (* w0 (sqrt (+ 1.0 (* -0.25 (* (/ M d) (* (/ D (/ l (* D h))) (/ M d))))))) (* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ D d) (/ M 2.0)) 2.0)))))))
M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 2e-65) {
tmp = w0 * sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / d))))));
} else {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((D / d) * (M / 2.0)), 2.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(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 <= 2d-65) then
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((m / d_1) * ((d / (l / (d * h))) * (m / d_1))))))
else
tmp = w0 * sqrt((1.0d0 - ((h / l) * (((d / d_1) * (m / 2.0d0)) ** 2.0d0))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 2e-65) {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / d))))));
} else {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((D / d) * (M / 2.0)), 2.0))));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 2e-65: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / d)))))) else: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((D / d) * (M / 2.0)), 2.0)))) return tmp
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 2e-65) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(M / d) * Float64(Float64(D / Float64(l / Float64(D * h))) * Float64(M / d))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0))))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 2e-65)
tmp = w0 * sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / d))))));
else
tmp = w0 * sqrt((1.0 - ((h / l) * (((D / d) * (M / 2.0)) ^ 2.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[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 2e-65], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(M / d), $MachinePrecision] * N[(N[(D / N[(l / N[(D * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 2 \cdot 10^{-65}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\frac{M}{d} \cdot \left(\frac{D}{\frac{\ell}{D \cdot h}} \cdot \frac{M}{d}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}}\\
\end{array}
\end{array}
if d < 1.99999999999999985e-65Initial program 78.3%
times-frac78.9%
Simplified78.9%
Taylor expanded in w0 around 0 49.5%
cancel-sign-sub-inv49.5%
*-commutative49.5%
cancel-sign-sub-inv49.5%
Simplified50.0%
*-un-lft-identity50.0%
associate-*r*50.0%
times-frac65.6%
Applied egg-rr65.6%
*-lft-identity65.6%
associate-*l*65.6%
associate-*r*70.5%
associate-/l*73.1%
Simplified73.1%
if 1.99999999999999985e-65 < d Initial program 85.9%
times-frac87.1%
Simplified87.1%
Final simplification77.6%
NOTE: M 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 5.3e-64) (* w0 (sqrt (+ 1.0 (* -0.25 (* (/ M d) (* (/ D (/ l (* D h))) (/ M d))))))) (* w0 (+ 1.0 (* -0.125 (* h (/ (pow (/ D (/ d M)) 2.0) l)))))))
M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 5.3e-64) {
tmp = w0 * sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / d))))));
} else {
tmp = w0 * (1.0 + (-0.125 * (h * (pow((D / (d / M)), 2.0) / 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(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 <= 5.3d-64) then
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((m / d_1) * ((d / (l / (d * h))) * (m / d_1))))))
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (h * (((d / (d_1 / m)) ** 2.0d0) / l))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 5.3e-64) {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / d))))));
} else {
tmp = w0 * (1.0 + (-0.125 * (h * (Math.pow((D / (d / M)), 2.0) / l))));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 5.3e-64: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / d)))))) else: tmp = w0 * (1.0 + (-0.125 * (h * (math.pow((D / (d / M)), 2.0) / l)))) return tmp
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 5.3e-64) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(M / d) * Float64(Float64(D / Float64(l / Float64(D * h))) * Float64(M / d))))))); else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(h * Float64((Float64(D / Float64(d / M)) ^ 2.0) / l))))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 5.3e-64)
tmp = w0 * sqrt((1.0 + (-0.25 * ((M / d) * ((D / (l / (D * h))) * (M / d))))));
else
tmp = w0 * (1.0 + (-0.125 * (h * (((D / (d / M)) ^ 2.0) / 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[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 5.3e-64], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(M / d), $MachinePrecision] * N[(N[(D / N[(l / N[(D * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(-0.125 * N[(h * N[(N[Power[N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 5.3 \cdot 10^{-64}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\frac{M}{d} \cdot \left(\frac{D}{\frac{\ell}{D \cdot h}} \cdot \frac{M}{d}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(h \cdot \frac{{\left(\frac{D}{\frac{d}{M}}\right)}^{2}}{\ell}\right)\right)\\
\end{array}
\end{array}
if d < 5.3000000000000002e-64Initial program 78.3%
times-frac78.9%
Simplified78.9%
Taylor expanded in w0 around 0 49.5%
cancel-sign-sub-inv49.5%
*-commutative49.5%
cancel-sign-sub-inv49.5%
Simplified50.0%
*-un-lft-identity50.0%
associate-*r*50.0%
times-frac65.6%
Applied egg-rr65.6%
*-lft-identity65.6%
associate-*l*65.6%
associate-*r*70.5%
associate-/l*73.1%
Simplified73.1%
if 5.3000000000000002e-64 < d Initial program 85.9%
times-frac87.1%
Simplified87.1%
Taylor expanded in M around 0 55.3%
associate-*r/55.3%
*-commutative55.3%
associate-*r/55.3%
associate-/l*55.3%
unpow255.3%
unpow255.3%
*-commutative55.3%
unpow255.3%
Simplified55.3%
Taylor expanded in l around 0 55.3%
unpow255.3%
unpow255.3%
*-commutative55.3%
times-frac55.3%
times-frac62.9%
Simplified62.9%
times-frac73.7%
pow273.7%
Applied egg-rr73.7%
frac-times62.9%
Applied egg-rr62.9%
times-frac73.7%
associate-*l/77.6%
associate-/r/78.8%
associate-*r/64.3%
unpow264.3%
associate-/r*68.3%
associate-*r/81.4%
associate-/l*81.4%
*-commutative81.4%
associate-*l/81.4%
associate-*l/82.6%
associate-/l*81.4%
*-commutative81.4%
associate-*l/82.6%
unpow282.6%
*-commutative82.6%
Simplified82.6%
Final simplification76.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 (w0 M D h l d) :precision binary64 (* w0 (+ 1.0 (* -0.125 (* h (/ (pow (/ D (/ d M)) 2.0) l))))))
M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * (1.0 + (-0.125 * (h * (pow((D / (d / M)), 2.0) / l))));
}
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(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 * (1.0d0 + ((-0.125d0) * (h * (((d / (d_1 / m)) ** 2.0d0) / l))))
end function
M = Math.abs(M);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * (1.0 + (-0.125 * (h * (Math.pow((D / (d / M)), 2.0) / l))));
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0 * (1.0 + (-0.125 * (h * (math.pow((D / (d / M)), 2.0) / l))))
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(h * Float64((Float64(D / Float64(d / M)) ^ 2.0) / l))))) end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0 * (1.0 + (-0.125 * (h * (((D / (d / M)) ^ 2.0) / l))));
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[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[(1.0 + N[(-0.125 * N[(h * N[(N[Power[N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0 \cdot \left(1 + -0.125 \cdot \left(h \cdot \frac{{\left(\frac{D}{\frac{d}{M}}\right)}^{2}}{\ell}\right)\right)
\end{array}
Initial program 80.7%
times-frac81.5%
Simplified81.5%
Taylor expanded in M around 0 50.6%
associate-*r/50.6%
*-commutative50.6%
associate-*r/50.6%
associate-/l*50.7%
unpow250.7%
unpow250.7%
*-commutative50.7%
unpow250.7%
Simplified50.7%
Taylor expanded in l around 0 50.7%
unpow250.7%
unpow250.7%
*-commutative50.7%
times-frac49.9%
times-frac60.7%
Simplified60.7%
times-frac68.8%
pow268.8%
Applied egg-rr68.8%
frac-times60.7%
Applied egg-rr60.7%
times-frac68.8%
associate-*l/71.7%
associate-/r/74.3%
associate-*r/63.9%
unpow263.9%
associate-/r*66.9%
associate-*r/75.6%
associate-/l*75.6%
*-commutative75.6%
associate-*l/75.6%
associate-*l/77.2%
associate-/l*76.4%
*-commutative76.4%
associate-*l/77.2%
unpow277.2%
*-commutative77.2%
Simplified77.2%
Final simplification77.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 (w0 M D h l d)
:precision binary64
(let* ((t_0 (* M (* M h))))
(if (<= d 2.25e-178)
(* w0 (+ 1.0 (* -0.125 (/ (* D D) (* (/ l h) (* (/ d M) (/ d M)))))))
(if (<= d 2.05e+124)
(* w0 (+ 1.0 (* -0.125 (/ D (/ (/ l (/ t_0 (* d d))) D)))))
(* w0 (+ 1.0 (* -0.125 (* t_0 (/ (* (/ D d) (/ D d)) l)))))))))M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = M * (M * h);
double tmp;
if (d <= 2.25e-178) {
tmp = w0 * (1.0 + (-0.125 * ((D * D) / ((l / h) * ((d / M) * (d / M))))));
} else if (d <= 2.05e+124) {
tmp = w0 * (1.0 + (-0.125 * (D / ((l / (t_0 / (d * d))) / D))));
} else {
tmp = w0 * (1.0 + (-0.125 * (t_0 * (((D / d) * (D / d)) / 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(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 = m * (m * h)
if (d_1 <= 2.25d-178) then
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d * d) / ((l / h) * ((d_1 / m) * (d_1 / m))))))
else if (d_1 <= 2.05d+124) then
tmp = w0 * (1.0d0 + ((-0.125d0) * (d / ((l / (t_0 / (d_1 * d_1))) / d))))
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (t_0 * (((d / d_1) * (d / d_1)) / l))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = M * (M * h);
double tmp;
if (d <= 2.25e-178) {
tmp = w0 * (1.0 + (-0.125 * ((D * D) / ((l / h) * ((d / M) * (d / M))))));
} else if (d <= 2.05e+124) {
tmp = w0 * (1.0 + (-0.125 * (D / ((l / (t_0 / (d * d))) / D))));
} else {
tmp = w0 * (1.0 + (-0.125 * (t_0 * (((D / d) * (D / d)) / l))));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): t_0 = M * (M * h) tmp = 0 if d <= 2.25e-178: tmp = w0 * (1.0 + (-0.125 * ((D * D) / ((l / h) * ((d / M) * (d / M)))))) elif d <= 2.05e+124: tmp = w0 * (1.0 + (-0.125 * (D / ((l / (t_0 / (d * d))) / D)))) else: tmp = w0 * (1.0 + (-0.125 * (t_0 * (((D / d) * (D / d)) / l)))) return tmp
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) t_0 = Float64(M * Float64(M * h)) tmp = 0.0 if (d <= 2.25e-178) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D * D) / Float64(Float64(l / h) * Float64(Float64(d / M) * Float64(d / M))))))); elseif (d <= 2.05e+124) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(D / Float64(Float64(l / Float64(t_0 / Float64(d * d))) / D))))); else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(t_0 * Float64(Float64(Float64(D / d) * Float64(D / d)) / l))))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
t_0 = M * (M * h);
tmp = 0.0;
if (d <= 2.25e-178)
tmp = w0 * (1.0 + (-0.125 * ((D * D) / ((l / h) * ((d / M) * (d / M))))));
elseif (d <= 2.05e+124)
tmp = w0 * (1.0 + (-0.125 * (D / ((l / (t_0 / (d * d))) / D))));
else
tmp = w0 * (1.0 + (-0.125 * (t_0 * (((D / d) * (D / d)) / 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[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, 2.25e-178], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D * D), $MachinePrecision] / N[(N[(l / h), $MachinePrecision] * N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.05e+124], N[(w0 * N[(1.0 + N[(-0.125 * N[(D / N[(N[(l / N[(t$95$0 / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(-0.125 * N[(t$95$0 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := M \cdot \left(M \cdot h\right)\\
\mathbf{if}\;d \leq 2.25 \cdot 10^{-178}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{D \cdot D}{\frac{\ell}{h} \cdot \left(\frac{d}{M} \cdot \frac{d}{M}\right)}\right)\\
\mathbf{elif}\;d \leq 2.05 \cdot 10^{+124}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{D}{\frac{\frac{\ell}{\frac{t_0}{d \cdot d}}}{D}}\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(t_0 \cdot \frac{\frac{D}{d} \cdot \frac{D}{d}}{\ell}\right)\right)\\
\end{array}
\end{array}
if d < 2.24999999999999989e-178Initial program 78.5%
times-frac79.2%
Simplified79.2%
Taylor expanded in M around 0 46.3%
associate-*r/46.3%
*-commutative46.3%
associate-*r/46.3%
associate-/l*46.4%
unpow246.4%
unpow246.4%
*-commutative46.4%
unpow246.4%
Simplified46.4%
Taylor expanded in l around 0 46.4%
unpow246.4%
unpow246.4%
*-commutative46.4%
times-frac45.7%
times-frac60.0%
Simplified60.0%
if 2.24999999999999989e-178 < d < 2.05000000000000001e124Initial program 81.0%
times-frac81.0%
Simplified81.0%
Taylor expanded in M around 0 55.8%
associate-*r/55.8%
*-commutative55.8%
associate-*r/55.8%
associate-/l*55.8%
unpow255.8%
unpow255.8%
*-commutative55.8%
unpow255.8%
Simplified55.8%
*-un-lft-identity55.8%
associate-/l*68.7%
associate-/l*69.6%
associate-*l*72.7%
Applied egg-rr72.7%
if 2.05000000000000001e124 < d Initial program 89.1%
times-frac91.9%
Simplified91.9%
Taylor expanded in M around 0 58.3%
associate-*r/58.3%
*-commutative58.3%
associate-*r/58.3%
associate-/l*58.3%
unpow258.3%
unpow258.3%
*-commutative58.3%
unpow258.3%
Simplified58.3%
Taylor expanded in D around 0 58.3%
unpow258.3%
*-commutative58.3%
*-commutative58.3%
unpow258.3%
associate-*r*61.1%
associate-*r/61.1%
*-commutative61.1%
associate-/r*61.1%
unpow261.1%
times-frac78.6%
unpow278.6%
Simplified78.6%
unpow278.6%
Applied egg-rr78.6%
Final simplification66.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 (w0 M D h l d) :precision binary64 (if (<= M 3.6e-121) w0 (* w0 (+ 1.0 (* -0.125 (* (* M (* M h)) (/ (* (/ D d) (/ D d)) l)))))))
M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 3.6e-121) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((M * (M * h)) * (((D / d) * (D / d)) / 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(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 <= 3.6d-121) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((m * (m * h)) * (((d / d_1) * (d / d_1)) / l))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 3.6e-121) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((M * (M * h)) * (((D / d) * (D / d)) / l))));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 3.6e-121: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * ((M * (M * h)) * (((D / d) * (D / d)) / l)))) return tmp
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 3.6e-121) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(M * Float64(M * h)) * Float64(Float64(Float64(D / d) * Float64(D / d)) / l))))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 3.6e-121)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * ((M * (M * h)) * (((D / d) * (D / d)) / 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[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 3.6e-121], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 3.6 \cdot 10^{-121}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\left(M \cdot \left(M \cdot h\right)\right) \cdot \frac{\frac{D}{d} \cdot \frac{D}{d}}{\ell}\right)\right)\\
\end{array}
\end{array}
if M < 3.59999999999999984e-121Initial program 84.1%
times-frac83.6%
Simplified83.6%
Taylor expanded in M around 0 67.1%
if 3.59999999999999984e-121 < M Initial program 74.1%
times-frac77.5%
Simplified77.5%
Taylor expanded in M around 0 44.8%
associate-*r/44.8%
*-commutative44.8%
associate-*r/44.8%
associate-/l*45.0%
unpow245.0%
unpow245.0%
*-commutative45.0%
unpow245.0%
Simplified45.0%
Taylor expanded in D around 0 44.8%
unpow244.8%
*-commutative44.8%
*-commutative44.8%
unpow244.8%
associate-*r*48.4%
associate-*r/48.6%
*-commutative48.6%
associate-/r*48.6%
unpow248.6%
times-frac57.3%
unpow257.3%
Simplified57.3%
unpow257.3%
Applied egg-rr57.3%
Final simplification63.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 (w0 M D h l d) :precision binary64 (if (<= M 1.95e-13) w0 (* -0.125 (* (* D (/ D l)) (/ (* w0 (* h (* M M))) (* d d))))))
M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.95e-13) {
tmp = w0;
} else {
tmp = -0.125 * ((D * (D / l)) * ((w0 * (h * (M * M))) / (d * 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(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.95d-13) then
tmp = w0
else
tmp = (-0.125d0) * ((d * (d / l)) * ((w0 * (h * (m * m))) / (d_1 * d_1)))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.95e-13) {
tmp = w0;
} else {
tmp = -0.125 * ((D * (D / l)) * ((w0 * (h * (M * M))) / (d * d)));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.95e-13: tmp = w0 else: tmp = -0.125 * ((D * (D / l)) * ((w0 * (h * (M * M))) / (d * d))) return tmp
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.95e-13) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(D * Float64(D / l)) * Float64(Float64(w0 * Float64(h * Float64(M * M))) / Float64(d * d)))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 1.95e-13)
tmp = w0;
else
tmp = -0.125 * ((D * (D / l)) * ((w0 * (h * (M * M))) / (d * 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[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 1.95e-13], w0, N[(-0.125 * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(N[(w0 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.95 \cdot 10^{-13}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot \frac{w0 \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}\right)\\
\end{array}
\end{array}
if M < 1.95000000000000002e-13Initial program 84.0%
times-frac83.5%
Simplified83.5%
Taylor expanded in M around 0 67.5%
if 1.95000000000000002e-13 < M Initial program 71.9%
times-frac76.1%
Simplified76.1%
Taylor expanded in M around 0 38.3%
associate-*r/38.3%
*-commutative38.3%
associate-*r/38.3%
associate-/l*38.6%
unpow238.6%
unpow238.6%
*-commutative38.6%
unpow238.6%
Simplified38.6%
Taylor expanded in l around 0 38.6%
unpow238.6%
unpow238.6%
*-commutative38.6%
times-frac37.2%
times-frac49.2%
Simplified49.2%
Taylor expanded in D around inf 20.1%
times-frac20.1%
unpow220.1%
unpow220.1%
*-commutative20.1%
unpow220.1%
Simplified20.1%
Taylor expanded in D around 0 20.1%
unpow220.1%
associate-*l/21.7%
*-commutative21.7%
Simplified21.7%
Final simplification55.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 (w0 M D h l d) :precision binary64 (if (<= M 2.6e-15) w0 (* -0.125 (* (/ (* D D) l) (* (/ w0 d) (/ (* M h) (/ d M)))))))
M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2.6e-15) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) / l) * ((w0 / d) * ((M * h) / (d / M))));
}
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(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.6d-15) then
tmp = w0
else
tmp = (-0.125d0) * (((d * d) / l) * ((w0 / d_1) * ((m * h) / (d_1 / m))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2.6e-15) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) / l) * ((w0 / d) * ((M * h) / (d / M))));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 2.6e-15: tmp = w0 else: tmp = -0.125 * (((D * D) / l) * ((w0 / d) * ((M * h) / (d / M)))) return tmp
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 2.6e-15) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) / l) * Float64(Float64(w0 / d) * Float64(Float64(M * h) / Float64(d / M))))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 2.6e-15)
tmp = w0;
else
tmp = -0.125 * (((D * D) / l) * ((w0 / d) * ((M * h) / (d / M))));
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[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 2.6e-15], w0, N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] / l), $MachinePrecision] * N[(N[(w0 / d), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 2.6 \cdot 10^{-15}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{\ell} \cdot \left(\frac{w0}{d} \cdot \frac{M \cdot h}{\frac{d}{M}}\right)\right)\\
\end{array}
\end{array}
if M < 2.60000000000000004e-15Initial program 84.0%
times-frac83.5%
Simplified83.5%
Taylor expanded in M around 0 67.5%
if 2.60000000000000004e-15 < M Initial program 71.9%
times-frac76.1%
Simplified76.1%
Taylor expanded in M around 0 38.3%
associate-*r/38.3%
*-commutative38.3%
associate-*r/38.3%
associate-/l*38.6%
unpow238.6%
unpow238.6%
*-commutative38.6%
unpow238.6%
Simplified38.6%
Taylor expanded in l around 0 38.6%
unpow238.6%
unpow238.6%
*-commutative38.6%
times-frac37.2%
times-frac49.2%
Simplified49.2%
Taylor expanded in D around inf 20.1%
times-frac20.1%
unpow220.1%
unpow220.1%
*-commutative20.1%
unpow220.1%
Simplified20.1%
Taylor expanded in h around 0 20.1%
*-commutative20.1%
unpow220.1%
associate-*l*20.2%
unpow220.2%
associate-/r*22.7%
*-commutative22.7%
associate-*r/24.3%
associate-*l/24.3%
associate-/l*24.3%
*-commutative24.3%
Simplified24.3%
Final simplification55.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 (w0 M D h l d) :precision binary64 (if (<= M 9.2e-12) w0 (* -0.125 (* (/ (/ D (/ l D)) d) (* (* M (* M h)) (/ w0 d))))))
M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 9.2e-12) {
tmp = w0;
} else {
tmp = -0.125 * (((D / (l / D)) / d) * ((M * (M * h)) * (w0 / 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(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 <= 9.2d-12) then
tmp = w0
else
tmp = (-0.125d0) * (((d / (l / d)) / d_1) * ((m * (m * h)) * (w0 / d_1)))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 9.2e-12) {
tmp = w0;
} else {
tmp = -0.125 * (((D / (l / D)) / d) * ((M * (M * h)) * (w0 / d)));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 9.2e-12: tmp = w0 else: tmp = -0.125 * (((D / (l / D)) / d) * ((M * (M * h)) * (w0 / d))) return tmp
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 9.2e-12) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D / Float64(l / D)) / d) * Float64(Float64(M * Float64(M * h)) * Float64(w0 / d)))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 9.2e-12)
tmp = w0;
else
tmp = -0.125 * (((D / (l / D)) / d) * ((M * (M * h)) * (w0 / 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[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 9.2e-12], w0, N[(-0.125 * N[(N[(N[(D / N[(l / D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision] * N[(w0 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 9.2 \cdot 10^{-12}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\frac{\frac{D}{\frac{\ell}{D}}}{d} \cdot \left(\left(M \cdot \left(M \cdot h\right)\right) \cdot \frac{w0}{d}\right)\right)\\
\end{array}
\end{array}
if M < 9.19999999999999957e-12Initial program 84.0%
times-frac83.5%
Simplified83.5%
Taylor expanded in M around 0 67.5%
if 9.19999999999999957e-12 < M Initial program 71.9%
times-frac76.1%
Simplified76.1%
Taylor expanded in M around 0 38.3%
associate-*r/38.3%
*-commutative38.3%
associate-*r/38.3%
associate-/l*38.6%
unpow238.6%
unpow238.6%
*-commutative38.6%
unpow238.6%
Simplified38.6%
Taylor expanded in l around 0 38.6%
unpow238.6%
unpow238.6%
*-commutative38.6%
times-frac37.2%
times-frac49.2%
Simplified49.2%
Taylor expanded in D around inf 20.1%
times-frac20.1%
unpow220.1%
unpow220.1%
*-commutative20.1%
unpow220.1%
Simplified20.1%
Taylor expanded in D around 0 20.1%
*-commutative20.1%
unpow220.1%
times-frac20.1%
*-commutative20.1%
*-commutative20.1%
unpow220.1%
associate-*l*20.2%
associate-*r/20.2%
unpow220.2%
times-frac22.7%
*-commutative22.7%
associate-*r/24.3%
Simplified25.8%
Final simplification56.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 (w0 M D h l d) :precision binary64 w0)
M = abs(M);
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: 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);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return w0 end
M = abs(M)
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: 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|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0
\end{array}
Initial program 80.7%
times-frac81.5%
Simplified81.5%
Taylor expanded in M around 0 60.6%
Final simplification60.6%
herbie shell --seed 2023240
(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))))))