
(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 17 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 (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -1e+44)
(pow
(*
(cbrt w0)
(exp
(*
0.16666666666666666
(+
(* -2.0 (log (/ 1.0 M)))
(+ (log (* (/ h l) -0.25)) (+ (* 2.0 (log D)) (* -2.0 (log d))))))))
3.0)
(* w0 (sqrt (- 1.0 (/ (* h (pow (* M (* D (/ 0.5 d))) 2.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 tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -1e+44) {
tmp = pow((cbrt(w0) * exp((0.16666666666666666 * ((-2.0 * log((1.0 / M))) + (log(((h / l) * -0.25)) + ((2.0 * log(D)) + (-2.0 * log(d)))))))), 3.0);
} else {
tmp = w0 * sqrt((1.0 - ((h * pow((M * (D * (0.5 / d))), 2.0)) / l)));
}
return tmp;
}
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)) <= -1e+44) {
tmp = Math.pow((Math.cbrt(w0) * Math.exp((0.16666666666666666 * ((-2.0 * Math.log((1.0 / M))) + (Math.log(((h / l) * -0.25)) + ((2.0 * Math.log(D)) + (-2.0 * Math.log(d)))))))), 3.0);
} else {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow((M * (D * (0.5 / d))), 2.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) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -1e+44) tmp = Float64(cbrt(w0) * exp(Float64(0.16666666666666666 * Float64(Float64(-2.0 * log(Float64(1.0 / M))) + Float64(log(Float64(Float64(h / l) * -0.25)) + Float64(Float64(2.0 * log(D)) + Float64(-2.0 * log(d)))))))) ^ 3.0; else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0)) / l)))); end return 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], -1e+44], N[Power[N[(N[Power[w0, 1/3], $MachinePrecision] * N[Exp[N[(0.16666666666666666 * N[(N[(-2.0 * N[Log[N[(1.0 / M), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Log[N[(N[(h / l), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision] + N[(N[(2.0 * N[Log[D], $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[Log[d], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 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]]
\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 -1 \cdot 10^{+44}:\\
\;\;\;\;{\left(\sqrt[3]{w0} \cdot e^{0.16666666666666666 \cdot \left(-2 \cdot \log \left(\frac{1}{M}\right) + \left(\log \left(\frac{h}{\ell} \cdot -0.25\right) + \left(2 \cdot \log D + -2 \cdot \log d\right)\right)\right)}\right)}^{3}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < -1.0000000000000001e44Initial program 56.8%
times-frac57.3%
Simplified57.3%
add-cube-cbrt57.3%
pow357.2%
Applied egg-rr57.3%
Taylor expanded in D around inf 14.1%
unpow1/326.0%
*-lft-identity26.0%
exp-prod25.6%
distribute-lft-neg-in25.6%
metadata-eval25.6%
associate-/r*24.6%
unpow224.6%
associate-/l*24.7%
unpow224.7%
log-rec24.7%
Simplified24.7%
Taylor expanded in d around 0 14.3%
Taylor expanded in M around inf 8.6%
if -1.0000000000000001e44 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 91.5%
times-frac91.5%
Simplified91.5%
associate-*r/97.3%
frac-times97.3%
div-inv97.3%
associate-*l*97.3%
associate-/r*97.3%
metadata-eval97.3%
Applied egg-rr97.3%
Final simplification70.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 (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -1e+44)
(pow
(*
(cbrt w0)
(exp
(*
0.16666666666666666
(+
(log (* (/ h l) -0.25))
(+ (+ (* 2.0 (log D)) (* -2.0 (log d))) (* 2.0 (log M)))))))
3.0)
(* w0 (sqrt (- 1.0 (/ (* h (pow (* M (* D (/ 0.5 d))) 2.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 tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -1e+44) {
tmp = pow((cbrt(w0) * exp((0.16666666666666666 * (log(((h / l) * -0.25)) + (((2.0 * log(D)) + (-2.0 * log(d))) + (2.0 * log(M))))))), 3.0);
} else {
tmp = w0 * sqrt((1.0 - ((h * pow((M * (D * (0.5 / d))), 2.0)) / l)));
}
return tmp;
}
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)) <= -1e+44) {
tmp = Math.pow((Math.cbrt(w0) * Math.exp((0.16666666666666666 * (Math.log(((h / l) * -0.25)) + (((2.0 * Math.log(D)) + (-2.0 * Math.log(d))) + (2.0 * Math.log(M))))))), 3.0);
} else {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow((M * (D * (0.5 / d))), 2.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) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -1e+44) tmp = Float64(cbrt(w0) * exp(Float64(0.16666666666666666 * Float64(log(Float64(Float64(h / l) * -0.25)) + Float64(Float64(Float64(2.0 * log(D)) + Float64(-2.0 * log(d))) + Float64(2.0 * log(M))))))) ^ 3.0; else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0)) / l)))); end return 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], -1e+44], N[Power[N[(N[Power[w0, 1/3], $MachinePrecision] * N[Exp[N[(0.16666666666666666 * N[(N[Log[N[(N[(h / l), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision] + N[(N[(N[(2.0 * N[Log[D], $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[Log[d], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[Log[M], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 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]]
\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 -1 \cdot 10^{+44}:\\
\;\;\;\;{\left(\sqrt[3]{w0} \cdot e^{0.16666666666666666 \cdot \left(\log \left(\frac{h}{\ell} \cdot -0.25\right) + \left(\left(2 \cdot \log D + -2 \cdot \log d\right) + 2 \cdot \log M\right)\right)}\right)}^{3}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < -1.0000000000000001e44Initial program 56.8%
times-frac57.3%
Simplified57.3%
add-cube-cbrt57.3%
pow357.2%
Applied egg-rr57.3%
Taylor expanded in D around inf 14.1%
unpow1/326.0%
*-lft-identity26.0%
exp-prod25.6%
distribute-lft-neg-in25.6%
metadata-eval25.6%
associate-/r*24.6%
unpow224.6%
associate-/l*24.7%
unpow224.7%
log-rec24.7%
Simplified24.7%
Taylor expanded in d around 0 14.3%
Taylor expanded in M around 0 8.6%
if -1.0000000000000001e44 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 91.5%
times-frac91.5%
Simplified91.5%
associate-*r/97.3%
frac-times97.3%
div-inv97.3%
associate-*l*97.3%
associate-/r*97.3%
metadata-eval97.3%
Applied egg-rr97.3%
Final simplification70.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 (<= (pow (/ (* M D) (* 2.0 d)) 2.0) 5e+268)
(* w0 (sqrt (- 1.0 (/ (* h (pow (* M (* D (/ 0.5 d))) 2.0)) l))))
(pow
(*
(cbrt w0)
(exp
(*
0.16666666666666666
(+
(* 2.0 (log D))
(+ (* -2.0 (log d)) (log (* -0.25 (* M (* M (/ h l))))))))))
3.0)))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) <= 5e+268) {
tmp = w0 * sqrt((1.0 - ((h * pow((M * (D * (0.5 / d))), 2.0)) / l)));
} else {
tmp = pow((cbrt(w0) * exp((0.16666666666666666 * ((2.0 * log(D)) + ((-2.0 * log(d)) + log((-0.25 * (M * (M * (h / l)))))))))), 3.0);
}
return tmp;
}
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) <= 5e+268) {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow((M * (D * (0.5 / d))), 2.0)) / l)));
} else {
tmp = Math.pow((Math.cbrt(w0) * Math.exp((0.16666666666666666 * ((2.0 * Math.log(D)) + ((-2.0 * Math.log(d)) + Math.log((-0.25 * (M * (M * (h / l)))))))))), 3.0);
}
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) <= 5e+268) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0)) / l)))); else tmp = Float64(cbrt(w0) * exp(Float64(0.16666666666666666 * Float64(Float64(2.0 * log(D)) + Float64(Float64(-2.0 * log(d)) + log(Float64(-0.25 * Float64(M * Float64(M * Float64(h / l)))))))))) ^ 3.0; end return 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], 5e+268], 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[Power[N[(N[Power[w0, 1/3], $MachinePrecision] * N[Exp[N[(0.16666666666666666 * N[(N[(2.0 * N[Log[D], $MachinePrecision]), $MachinePrecision] + N[(N[(-2.0 * N[Log[d], $MachinePrecision]), $MachinePrecision] + N[Log[N[(-0.25 * N[(M * N[(M * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 3.0], $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 5 \cdot 10^{+268}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{w0} \cdot e^{0.16666666666666666 \cdot \left(2 \cdot \log D + \left(-2 \cdot \log d + \log \left(-0.25 \cdot \left(M \cdot \left(M \cdot \frac{h}{\ell}\right)\right)\right)\right)\right)}\right)}^{3}\\
\end{array}
\end{array}
if (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) < 5.0000000000000002e268Initial program 90.2%
times-frac89.9%
Simplified89.9%
associate-*r/95.5%
frac-times95.8%
div-inv95.8%
associate-*l*95.5%
associate-/r*95.5%
metadata-eval95.5%
Applied egg-rr95.5%
if 5.0000000000000002e268 < (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) Initial program 52.1%
times-frac53.7%
Simplified53.7%
add-cube-cbrt53.7%
pow353.7%
Applied egg-rr53.7%
Taylor expanded in D around inf 17.5%
unpow1/329.4%
*-lft-identity29.4%
exp-prod29.0%
distribute-lft-neg-in29.0%
metadata-eval29.0%
associate-/r*28.9%
unpow228.9%
associate-/l*29.0%
unpow229.0%
log-rec29.0%
Simplified29.0%
Taylor expanded in d around 0 17.5%
pow217.5%
associate-*r/16.2%
associate-*l*17.5%
Applied egg-rr17.5%
Final simplification76.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
(let* ((t_0
(* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))))))
(if (<= t_0 INFINITY) t_0 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 t_0 = w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = t_0;
} else {
tmp = w0;
}
return tmp;
}
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 = w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0;
} 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): t_0 = w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)))) tmp = 0 if t_0 <= math.inf: tmp = t_0 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) t_0 = Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) tmp = 0.0 if (t_0 <= Inf) tmp = t_0; 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)
t_0 = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l))));
tmp = 0.0;
if (t_0 <= Inf)
tmp = t_0;
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_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, Infinity], t$95$0, w0]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\\
\mathbf{if}\;t_0 \leq \infty:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))))) < +inf.0Initial program 86.0%
if +inf.0 < (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))))) Initial program 0.0%
times-frac0.0%
Simplified0.0%
Taylor expanded in M around 0 62.6%
Final simplification84.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 (<= (/ h l) 2e+230) (* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ M 2.0) (/ D d)) 2.0))))) 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) <= 2e+230) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((M / 2.0) * (D / d)), 2.0))));
} 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) <= 2d+230) then
tmp = w0 * sqrt((1.0d0 - ((h / l) * (((m / 2.0d0) * (d / d_1)) ** 2.0d0))))
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) <= 2e+230) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((M / 2.0) * (D / d)), 2.0))));
} 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) <= 2e+230: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((M / 2.0) * (D / d)), 2.0)))) 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) <= 2e+230) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0))))); 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) <= 2e+230)
tmp = w0 * sqrt((1.0 - ((h / l) * (((M / 2.0) * (D / d)) ^ 2.0))));
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], 2e+230], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $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 2 \cdot 10^{+230}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if (/.f64 h l) < 2.0000000000000002e230Initial program 83.1%
times-frac83.3%
Simplified83.3%
if 2.0000000000000002e230 < (/.f64 h l) Initial program 22.2%
times-frac22.2%
Simplified22.2%
Taylor expanded in M around 0 100.0%
Final simplification83.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 (sqrt (- 1.0 (/ (* h (pow (* M (* D (/ 0.5 d))) 2.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) {
return w0 * sqrt((1.0 - ((h * pow((M * (D * (0.5 / d))), 2.0)) / l)));
}
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 * sqrt((1.0d0 - ((h * ((m * (d * (0.5d0 / d_1))) ** 2.0d0)) / l)))
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 * Math.sqrt((1.0 - ((h * Math.pow((M * (D * (0.5 / d))), 2.0)) / l)));
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - ((h * math.pow((M * (D * (0.5 / d))), 2.0)) / l)))
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0)) / l)))) 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 * sqrt((1.0 - ((h * ((M * (D * (0.5 / d))) ^ 2.0)) / l)));
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_] := 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]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0 \cdot \sqrt{1 - \frac{h \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}}
\end{array}
Initial program 81.0%
times-frac81.1%
Simplified81.1%
associate-*r/85.9%
frac-times85.7%
div-inv85.7%
associate-*l*85.9%
associate-/r*85.9%
metadata-eval85.9%
Applied egg-rr85.9%
Final simplification85.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 (<= M 2e-151)
w0
(if (<= M 155000000.0)
(* w0 (sqrt (- 1.0 (* 0.25 (* (/ (* D (* M M)) l) (/ D (/ (* d d) h)))))))
(*
w0
(sqrt (- 1.0 (* 0.25 (/ (* D D) (/ (* d l) (* (* M M) (/ h 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 (M <= 2e-151) {
tmp = w0;
} else if (M <= 155000000.0) {
tmp = w0 * sqrt((1.0 - (0.25 * (((D * (M * M)) / l) * (D / ((d * d) / h))))));
} else {
tmp = w0 * sqrt((1.0 - (0.25 * ((D * D) / ((d * l) / ((M * M) * (h / 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 <= 2d-151) then
tmp = w0
else if (m <= 155000000.0d0) then
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (((d * (m * m)) / l) * (d / ((d_1 * d_1) / h))))))
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * ((d * d) / ((d_1 * l) / ((m * m) * (h / d_1)))))))
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 <= 2e-151) {
tmp = w0;
} else if (M <= 155000000.0) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D * (M * M)) / l) * (D / ((d * d) / h))))));
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * ((D * D) / ((d * l) / ((M * M) * (h / 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 M <= 2e-151: tmp = w0 elif M <= 155000000.0: tmp = w0 * math.sqrt((1.0 - (0.25 * (((D * (M * M)) / l) * (D / ((d * d) / h)))))) else: tmp = w0 * math.sqrt((1.0 - (0.25 * ((D * D) / ((d * l) / ((M * M) * (h / 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 (M <= 2e-151) tmp = w0; elseif (M <= 155000000.0) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D * Float64(M * M)) / l) * Float64(D / Float64(Float64(d * d) / h))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * l) / Float64(Float64(M * M) * Float64(h / 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 <= 2e-151)
tmp = w0;
elseif (M <= 155000000.0)
tmp = w0 * sqrt((1.0 - (0.25 * (((D * (M * M)) / l) * (D / ((d * d) / h))))));
else
tmp = w0 * sqrt((1.0 - (0.25 * ((D * D) / ((d * l) / ((M * M) * (h / 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[M, 2e-151], w0, If[LessEqual[M, 155000000.0], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(D / N[(N[(d * d), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * l), $MachinePrecision] / N[(N[(M * M), $MachinePrecision] * N[(h / d), $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}\;M \leq 2 \cdot 10^{-151}:\\
\;\;\;\;w0\\
\mathbf{elif}\;M \leq 155000000:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\frac{D \cdot \left(M \cdot M\right)}{\ell} \cdot \frac{D}{\frac{d \cdot d}{h}}\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot \ell}{\left(M \cdot M\right) \cdot \frac{h}{d}}}}\\
\end{array}
\end{array}
if M < 1.9999999999999999e-151Initial program 81.1%
times-frac80.8%
Simplified80.8%
Taylor expanded in M around 0 71.0%
if 1.9999999999999999e-151 < M < 1.55e8Initial program 91.4%
times-frac91.5%
Simplified91.5%
Taylor expanded in M around 0 85.2%
*-commutative85.2%
associate-/l*85.2%
unpow285.2%
unpow285.2%
*-commutative85.2%
unpow285.2%
Simplified85.2%
Taylor expanded in l around 0 85.2%
unpow279.8%
times-frac77.0%
unpow277.0%
associate-/l*77.0%
Simplified82.5%
*-un-lft-identity82.5%
times-frac85.7%
associate-/r/85.7%
Applied egg-rr85.7%
*-lft-identity85.7%
unpow285.7%
associate-/r/88.6%
unpow288.6%
associate-*l/88.6%
Simplified88.6%
associate-*l/88.7%
Applied egg-rr88.7%
if 1.55e8 < M Initial program 73.3%
times-frac75.2%
Simplified75.2%
Taylor expanded in M around 0 49.2%
*-commutative49.2%
associate-/l*51.2%
unpow251.2%
unpow251.2%
*-commutative51.2%
unpow251.2%
Simplified51.2%
Taylor expanded in l around 0 51.2%
unpow245.8%
times-frac39.7%
unpow239.7%
associate-/l*40.0%
Simplified43.6%
frac-times48.1%
Applied egg-rr55.3%
Final simplification70.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 (<= M 2.9e-151) w0 (* w0 (sqrt (- 1.0 (* 0.25 (* (/ D (/ (* d d) h)) (* (* M M) (/ D 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.9e-151) {
tmp = w0;
} else {
tmp = w0 * sqrt((1.0 - (0.25 * ((D / ((d * d) / h)) * ((M * M) * (D / 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.9d-151) then
tmp = w0
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * ((d / ((d_1 * d_1) / h)) * ((m * m) * (d / 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.9e-151) {
tmp = w0;
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * ((D / ((d * d) / h)) * ((M * M) * (D / 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.9e-151: tmp = w0 else: tmp = w0 * math.sqrt((1.0 - (0.25 * ((D / ((d * d) / h)) * ((M * M) * (D / 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.9e-151) tmp = w0; else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(D / Float64(Float64(d * d) / h)) * Float64(Float64(M * M) * Float64(D / 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.9e-151)
tmp = w0;
else
tmp = w0 * sqrt((1.0 - (0.25 * ((D / ((d * d) / h)) * ((M * M) * (D / 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.9e-151], w0, N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(D / N[(N[(d * d), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] * N[(D / l), $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 2.9 \cdot 10^{-151}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\frac{D}{\frac{d \cdot d}{h}} \cdot \left(\left(M \cdot M\right) \cdot \frac{D}{\ell}\right)\right)}\\
\end{array}
\end{array}
if M < 2.90000000000000013e-151Initial program 81.1%
times-frac80.8%
Simplified80.8%
Taylor expanded in M around 0 71.0%
if 2.90000000000000013e-151 < M Initial program 80.6%
times-frac81.8%
Simplified81.8%
Taylor expanded in M around 0 63.8%
*-commutative63.8%
associate-/l*65.0%
unpow265.0%
unpow265.0%
*-commutative65.0%
unpow265.0%
Simplified65.0%
Taylor expanded in l around 0 65.0%
unpow259.6%
times-frac54.8%
unpow254.8%
associate-/l*55.0%
Simplified59.3%
*-un-lft-identity59.3%
times-frac60.5%
associate-/r/60.5%
Applied egg-rr60.5%
*-lft-identity60.5%
unpow260.5%
associate-/r/64.0%
unpow264.0%
associate-*l/63.9%
Simplified63.9%
Final simplification68.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 8.8e-150) w0 (* w0 (sqrt (- 1.0 (* 0.25 (* (/ D (/ l (* M M))) (/ D (* d (/ d h))))))))))
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 <= 8.8e-150) {
tmp = w0;
} else {
tmp = w0 * sqrt((1.0 - (0.25 * ((D / (l / (M * M))) * (D / (d * (d / h)))))));
}
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 <= 8.8d-150) then
tmp = w0
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * ((d / (l / (m * m))) * (d / (d_1 * (d_1 / h)))))))
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 <= 8.8e-150) {
tmp = w0;
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * ((D / (l / (M * M))) * (D / (d * (d / h)))))));
}
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 <= 8.8e-150: tmp = w0 else: tmp = w0 * math.sqrt((1.0 - (0.25 * ((D / (l / (M * M))) * (D / (d * (d / h))))))) 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 <= 8.8e-150) tmp = w0; else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(D / Float64(l / Float64(M * M))) * Float64(D / Float64(d * Float64(d / h)))))))); 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 <= 8.8e-150)
tmp = w0;
else
tmp = w0 * sqrt((1.0 - (0.25 * ((D / (l / (M * M))) * (D / (d * (d / h)))))));
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, 8.8e-150], w0, N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(D / N[(l / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / N[(d * N[(d / h), $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}\;M \leq 8.8 \cdot 10^{-150}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\frac{D}{\frac{\ell}{M \cdot M}} \cdot \frac{D}{d \cdot \frac{d}{h}}\right)}\\
\end{array}
\end{array}
if M < 8.7999999999999997e-150Initial program 81.1%
times-frac80.8%
Simplified80.8%
Taylor expanded in M around 0 71.0%
if 8.7999999999999997e-150 < M Initial program 80.6%
times-frac81.8%
Simplified81.8%
Taylor expanded in M around 0 63.8%
*-commutative63.8%
associate-/l*65.0%
unpow265.0%
unpow265.0%
*-commutative65.0%
unpow265.0%
Simplified65.0%
Taylor expanded in l around 0 65.0%
unpow259.6%
times-frac54.8%
unpow254.8%
associate-/l*55.0%
Simplified59.3%
times-frac60.5%
associate-/r/60.5%
Applied egg-rr60.5%
Final simplification67.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 (<= M 1.25e-151) w0 (* w0 (sqrt (- 1.0 (* 0.25 (* (/ (* D (* M M)) l) (/ D (/ (* d d) h)))))))))
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.25e-151) {
tmp = w0;
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (((D * (M * M)) / l) * (D / ((d * d) / h))))));
}
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.25d-151) then
tmp = w0
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (((d * (m * m)) / l) * (d / ((d_1 * d_1) / h))))))
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.25e-151) {
tmp = w0;
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D * (M * M)) / l) * (D / ((d * d) / h))))));
}
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.25e-151: tmp = w0 else: tmp = w0 * math.sqrt((1.0 - (0.25 * (((D * (M * M)) / l) * (D / ((d * d) / h)))))) 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.25e-151) tmp = w0; else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D * Float64(M * M)) / l) * Float64(D / Float64(Float64(d * d) / h))))))); 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.25e-151)
tmp = w0;
else
tmp = w0 * sqrt((1.0 - (0.25 * (((D * (M * M)) / l) * (D / ((d * d) / h))))));
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.25e-151], w0, N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(D / N[(N[(d * d), $MachinePrecision] / h), $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.25 \cdot 10^{-151}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\frac{D \cdot \left(M \cdot M\right)}{\ell} \cdot \frac{D}{\frac{d \cdot d}{h}}\right)}\\
\end{array}
\end{array}
if M < 1.25000000000000001e-151Initial program 81.1%
times-frac80.8%
Simplified80.8%
Taylor expanded in M around 0 71.0%
if 1.25000000000000001e-151 < M Initial program 80.6%
times-frac81.8%
Simplified81.8%
Taylor expanded in M around 0 63.8%
*-commutative63.8%
associate-/l*65.0%
unpow265.0%
unpow265.0%
*-commutative65.0%
unpow265.0%
Simplified65.0%
Taylor expanded in l around 0 65.0%
unpow259.6%
times-frac54.8%
unpow254.8%
associate-/l*55.0%
Simplified59.3%
*-un-lft-identity59.3%
times-frac60.5%
associate-/r/60.5%
Applied egg-rr60.5%
*-lft-identity60.5%
unpow260.5%
associate-/r/64.0%
unpow264.0%
associate-*l/63.9%
Simplified63.9%
associate-*l/63.9%
Applied egg-rr63.9%
Final simplification68.7%
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.1e-137) w0 (fma -0.125 (* (* (/ D d) (/ D d)) (/ (* M (* M h)) (/ l w0))) 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 (M <= 1.1e-137) {
tmp = w0;
} else {
tmp = fma(-0.125, (((D / d) * (D / d)) * ((M * (M * h)) / (l / w0))), 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 (M <= 1.1e-137) tmp = w0; else tmp = fma(-0.125, Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * Float64(M * h)) / Float64(l / w0))), w0); end return 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.1e-137], w0, N[(-0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision] / N[(l / w0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.1 \cdot 10^{-137}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\frac{\ell}{w0}}, w0\right)\\
\end{array}
\end{array}
if M < 1.1000000000000001e-137Initial program 81.1%
times-frac80.8%
Simplified80.8%
Taylor expanded in M around 0 71.0%
if 1.1000000000000001e-137 < M Initial program 80.6%
times-frac81.8%
Simplified81.8%
Taylor expanded in M around 0 53.5%
fma-def53.5%
*-commutative53.5%
times-frac54.6%
unpow254.6%
unpow254.6%
times-frac57.3%
unpow257.3%
*-commutative57.3%
associate-/l*56.0%
*-commutative56.0%
unpow256.0%
associate-*l*59.6%
Simplified59.6%
unpow259.6%
Applied egg-rr59.6%
Final simplification67.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 1.7e-100) w0 (* w0 (+ 1.0 (* -0.125 (/ (* D D) (* (/ l h) (/ (* d d) (* M 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.7e-100) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((D * D) / ((l / h) * ((d * d) / (M * 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.7d-100) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d * d) / ((l / h) * ((d_1 * d_1) / (m * 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.7e-100) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((D * D) / ((l / h) * ((d * d) / (M * 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.7e-100: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * ((D * D) / ((l / h) * ((d * d) / (M * 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.7e-100) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D * D) / Float64(Float64(l / h) * Float64(Float64(d * d) / Float64(M * 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.7e-100)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * ((D * D) / ((l / h) * ((d * d) / (M * 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.7e-100], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D * D), $MachinePrecision] / N[(N[(l / h), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(M * 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.7 \cdot 10^{-100}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{D \cdot D}{\frac{\ell}{h} \cdot \frac{d \cdot d}{M \cdot M}}\right)\\
\end{array}
\end{array}
if M < 1.69999999999999988e-100Initial program 81.1%
times-frac80.8%
Simplified80.8%
Taylor expanded in M around 0 71.0%
if 1.69999999999999988e-100 < M Initial program 80.6%
times-frac81.9%
Simplified81.9%
Taylor expanded in M around 0 55.5%
*-commutative55.5%
*-commutative55.5%
associate-/l*56.8%
unpow256.8%
unpow256.8%
*-commutative56.8%
unpow256.8%
Simplified56.8%
Taylor expanded in l around 0 56.8%
unpow256.8%
times-frac51.3%
unpow251.3%
associate-/l*51.5%
Simplified51.5%
Taylor expanded in l around 0 56.8%
times-frac58.3%
unpow258.3%
unpow258.3%
Simplified58.3%
Final simplification67.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 (<= M 1.35e-100) w0 (* w0 (+ 1.0 (* (/ (* D D) (/ (* d l) (* (* M M) (/ h 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 (M <= 1.35e-100) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (((D * D) / ((d * l) / ((M * M) * (h / 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 (m <= 1.35d-100) then
tmp = w0
else
tmp = w0 * (1.0d0 + (((d * d) / ((d_1 * l) / ((m * m) * (h / 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 (M <= 1.35e-100) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (((D * D) / ((d * l) / ((M * M) * (h / 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 M <= 1.35e-100: tmp = w0 else: tmp = w0 * (1.0 + (((D * D) / ((d * l) / ((M * M) * (h / 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 (M <= 1.35e-100) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(D * D) / Float64(Float64(d * l) / Float64(Float64(M * M) * Float64(h / 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 (M <= 1.35e-100)
tmp = w0;
else
tmp = w0 * (1.0 + (((D * D) / ((d * l) / ((M * M) * (h / 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[LessEqual[M, 1.35e-100], w0, N[(w0 * N[(1.0 + N[(N[(N[(D * D), $MachinePrecision] / N[(N[(d * l), $MachinePrecision] / N[(N[(M * M), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision]), $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}\;M \leq 1.35 \cdot 10^{-100}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \frac{D \cdot D}{\frac{d \cdot \ell}{\left(M \cdot M\right) \cdot \frac{h}{d}}} \cdot -0.125\right)\\
\end{array}
\end{array}
if M < 1.35000000000000008e-100Initial program 81.1%
times-frac80.8%
Simplified80.8%
Taylor expanded in M around 0 71.0%
if 1.35000000000000008e-100 < M Initial program 80.6%
times-frac81.9%
Simplified81.9%
Taylor expanded in M around 0 55.5%
*-commutative55.5%
*-commutative55.5%
associate-/l*56.8%
unpow256.8%
unpow256.8%
*-commutative56.8%
unpow256.8%
Simplified56.8%
Taylor expanded in l around 0 56.8%
unpow256.8%
times-frac51.3%
unpow251.3%
associate-/l*51.5%
Simplified51.5%
frac-times59.7%
Applied egg-rr59.7%
Final simplification67.7%
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 3.2e-151) w0 (+ w0 (* w0 (* (* (/ D (/ (* d d) h)) (* (* M M) (/ D l))) -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 (M <= 3.2e-151) {
tmp = w0;
} else {
tmp = w0 + (w0 * (((D / ((d * d) / h)) * ((M * M) * (D / l))) * -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 (m <= 3.2d-151) then
tmp = w0
else
tmp = w0 + (w0 * (((d / ((d_1 * d_1) / h)) * ((m * m) * (d / l))) * (-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 (M <= 3.2e-151) {
tmp = w0;
} else {
tmp = w0 + (w0 * (((D / ((d * d) / h)) * ((M * M) * (D / l))) * -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 M <= 3.2e-151: tmp = w0 else: tmp = w0 + (w0 * (((D / ((d * d) / h)) * ((M * M) * (D / l))) * -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 (M <= 3.2e-151) tmp = w0; else tmp = Float64(w0 + Float64(w0 * Float64(Float64(Float64(D / Float64(Float64(d * d) / h)) * Float64(Float64(M * M) * Float64(D / l))) * -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 (M <= 3.2e-151)
tmp = w0;
else
tmp = w0 + (w0 * (((D / ((d * d) / h)) * ((M * M) * (D / l))) * -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[LessEqual[M, 3.2e-151], w0, N[(w0 + N[(w0 * N[(N[(N[(D / N[(N[(d * d), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] * N[(D / l), $MachinePrecision]), $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}\;M \leq 3.2 \cdot 10^{-151}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 + w0 \cdot \left(\left(\frac{D}{\frac{d \cdot d}{h}} \cdot \left(\left(M \cdot M\right) \cdot \frac{D}{\ell}\right)\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if M < 3.20000000000000021e-151Initial program 81.1%
times-frac80.8%
Simplified80.8%
Taylor expanded in M around 0 71.0%
if 3.20000000000000021e-151 < M Initial program 80.6%
times-frac81.8%
Simplified81.8%
Taylor expanded in M around 0 58.4%
*-commutative58.4%
*-commutative58.4%
associate-/l*59.6%
unpow259.6%
unpow259.6%
*-commutative59.6%
unpow259.6%
Simplified59.6%
Taylor expanded in l around 0 59.6%
unpow259.6%
times-frac54.8%
unpow254.8%
associate-/l*55.0%
Simplified55.0%
distribute-rgt-in55.0%
*-un-lft-identity55.0%
times-frac55.1%
associate-/r/55.1%
Applied egg-rr55.1%
*-commutative55.1%
*-commutative55.1%
unpow255.1%
associate-/r/58.6%
unpow258.6%
associate-*l/58.5%
Simplified58.5%
Final simplification66.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 (<= M 4e-151) w0 (+ w0 (* w0 (* (* (/ D (/ l (* M M))) (/ D (* d (/ d h)))) -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 (M <= 4e-151) {
tmp = w0;
} else {
tmp = w0 + (w0 * (((D / (l / (M * M))) * (D / (d * (d / h)))) * -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 (m <= 4d-151) then
tmp = w0
else
tmp = w0 + (w0 * (((d / (l / (m * m))) * (d / (d_1 * (d_1 / h)))) * (-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 (M <= 4e-151) {
tmp = w0;
} else {
tmp = w0 + (w0 * (((D / (l / (M * M))) * (D / (d * (d / h)))) * -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 M <= 4e-151: tmp = w0 else: tmp = w0 + (w0 * (((D / (l / (M * M))) * (D / (d * (d / h)))) * -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 (M <= 4e-151) tmp = w0; else tmp = Float64(w0 + Float64(w0 * Float64(Float64(Float64(D / Float64(l / Float64(M * M))) * Float64(D / Float64(d * Float64(d / h)))) * -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 (M <= 4e-151)
tmp = w0;
else
tmp = w0 + (w0 * (((D / (l / (M * M))) * (D / (d * (d / h)))) * -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[LessEqual[M, 4e-151], w0, N[(w0 + N[(w0 * N[(N[(N[(D / N[(l / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision]), $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}\;M \leq 4 \cdot 10^{-151}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 + w0 \cdot \left(\left(\frac{D}{\frac{\ell}{M \cdot M}} \cdot \frac{D}{d \cdot \frac{d}{h}}\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if M < 3.9999999999999998e-151Initial program 81.1%
times-frac80.8%
Simplified80.8%
Taylor expanded in M around 0 71.0%
if 3.9999999999999998e-151 < M Initial program 80.6%
times-frac81.8%
Simplified81.8%
Taylor expanded in M around 0 58.4%
*-commutative58.4%
*-commutative58.4%
associate-/l*59.6%
unpow259.6%
unpow259.6%
*-commutative59.6%
unpow259.6%
Simplified59.6%
Taylor expanded in l around 0 59.6%
unpow259.6%
times-frac54.8%
unpow254.8%
associate-/l*55.0%
Simplified55.0%
distribute-rgt-in55.0%
*-un-lft-identity55.0%
times-frac55.1%
associate-/r/55.1%
Applied egg-rr55.1%
Final simplification65.8%
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.02e+41) w0 (* -0.125 (* (* (/ D d) (/ D d)) (* w0 (* (/ h l) (* M 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.02e+41) {
tmp = w0;
} else {
tmp = -0.125 * (((D / d) * (D / d)) * (w0 * ((h / l) * (M * 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.02d+41) then
tmp = w0
else
tmp = (-0.125d0) * (((d / d_1) * (d / d_1)) * (w0 * ((h / l) * (m * 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.02e+41) {
tmp = w0;
} else {
tmp = -0.125 * (((D / d) * (D / d)) * (w0 * ((h / l) * (M * 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.02e+41: tmp = w0 else: tmp = -0.125 * (((D / d) * (D / d)) * (w0 * ((h / l) * (M * 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.02e+41) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(w0 * Float64(Float64(h / l) * Float64(M * 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.02e+41)
tmp = w0;
else
tmp = -0.125 * (((D / d) * (D / d)) * (w0 * ((h / l) * (M * 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.02e+41], w0, N[(-0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(w0 * N[(N[(h / l), $MachinePrecision] * N[(M * M), $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.02 \cdot 10^{+41}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(w0 \cdot \left(\frac{h}{\ell} \cdot \left(M \cdot M\right)\right)\right)\right)\\
\end{array}
\end{array}
if M < 1.01999999999999992e41Initial program 81.7%
times-frac81.9%
Simplified81.9%
Taylor expanded in M around 0 70.2%
if 1.01999999999999992e41 < M Initial program 76.9%
times-frac76.9%
Simplified76.9%
Taylor expanded in M around 0 45.4%
*-commutative45.4%
*-commutative45.4%
associate-/l*45.4%
unpow245.4%
unpow245.4%
*-commutative45.4%
unpow245.4%
Simplified45.4%
Taylor expanded in l around 0 45.4%
unpow245.4%
times-frac37.9%
unpow237.9%
associate-/l*38.3%
Simplified38.3%
Taylor expanded in D around inf 26.7%
*-commutative26.7%
times-frac26.4%
unpow226.4%
unpow226.4%
unpow226.4%
associate-*r*26.6%
associate-*r/26.6%
associate-*r*26.4%
unpow226.4%
associate-*r/26.5%
unpow226.5%
Simplified26.5%
times-frac26.8%
Applied egg-rr26.8%
Final simplification63.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 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 81.0%
times-frac81.1%
Simplified81.1%
Taylor expanded in M around 0 66.8%
Final simplification66.8%
herbie shell --seed 2023238
(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))))))