
(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 14 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: 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) (- INFINITY))
(* w0 (sqrt (- 1.0 (* 0.25 (* (/ (* D D) l) (* (/ M d) (/ (* h M) d)))))))
(if (<= (/ h l) -1e-110)
(* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ D d) (/ M 2.0)) 2.0)))))
(if (<= (/ h l) 0.0)
(*
w0
(sqrt (- 1.0 (* 0.25 (* D (* (/ D l) (* h (* (/ M d) (/ M d)))))))))
w0))))M = abs(M);
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) <= -((double) INFINITY)) {
tmp = w0 * sqrt((1.0 - (0.25 * (((D * D) / l) * ((M / d) * ((h * M) / d))))));
} else if ((h / l) <= -1e-110) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((D / d) * (M / 2.0)), 2.0))));
} else if ((h / l) <= 0.0) {
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d))))))));
} else {
tmp = w0;
}
return tmp;
}
M = Math.abs(M);
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) <= -Double.POSITIVE_INFINITY) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D * D) / l) * ((M / d) * ((h * M) / d))))));
} else if ((h / l) <= -1e-110) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((D / d) * (M / 2.0)), 2.0))));
} else if ((h / l) <= 0.0) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d))))))));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (h / l) <= -math.inf: tmp = w0 * math.sqrt((1.0 - (0.25 * (((D * D) / l) * ((M / d) * ((h * M) / d)))))) elif (h / l) <= -1e-110: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((D / d) * (M / 2.0)), 2.0)))) elif (h / l) <= 0.0: tmp = w0 * math.sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d)))))))) else: tmp = w0 return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(h / l) <= Float64(-Inf)) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D * D) / l) * Float64(Float64(M / d) * Float64(Float64(h * M) / d))))))); elseif (Float64(h / l) <= -1e-110) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0))))); elseif (Float64(h / l) <= 0.0) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(D * Float64(Float64(D / l) * Float64(h * Float64(Float64(M / d) * Float64(M / d))))))))); else tmp = w0; end return tmp end
M = abs(M)
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) <= -Inf)
tmp = w0 * sqrt((1.0 - (0.25 * (((D * D) / l) * ((M / d) * ((h * M) / d))))));
elseif ((h / l) <= -1e-110)
tmp = w0 * sqrt((1.0 - ((h / l) * (((D / d) * (M / 2.0)) ^ 2.0))));
elseif ((h / l) <= 0.0)
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d))))))));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: 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], (-Infinity)], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(N[(D * D), $MachinePrecision] / l), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(h / l), $MachinePrecision], -1e-110], 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], If[LessEqual[N[(h / l), $MachinePrecision], 0.0], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(D * N[(N[(D / l), $MachinePrecision] * N[(h * N[(N[(M / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -\infty:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\frac{D \cdot D}{\ell} \cdot \left(\frac{M}{d} \cdot \frac{h \cdot M}{d}\right)\right)}\\
\mathbf{elif}\;\frac{h}{\ell} \leq -1 \cdot 10^{-110}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}}\\
\mathbf{elif}\;\frac{h}{\ell} \leq 0:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(D \cdot \left(\frac{D}{\ell} \cdot \left(h \cdot \left(\frac{M}{d} \cdot \frac{M}{d}\right)\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if (/.f64 h l) < -inf.0Initial program 48.1%
times-frac48.1%
Simplified48.1%
Taylor expanded in M around 0 63.6%
associate-*r/63.6%
*-commutative63.6%
associate-*r/63.6%
times-frac63.5%
unpow263.5%
*-commutative63.5%
unpow263.5%
unpow263.5%
Simplified63.5%
Taylor expanded in M around 0 63.5%
unpow263.5%
*-commutative63.5%
associate-*r*63.5%
unpow263.5%
times-frac70.3%
*-commutative70.3%
Simplified70.3%
if -inf.0 < (/.f64 h l) < -1.0000000000000001e-110Initial program 84.5%
times-frac83.5%
Simplified83.5%
if -1.0000000000000001e-110 < (/.f64 h l) < -0.0Initial program 72.1%
times-frac70.5%
Simplified70.5%
Taylor expanded in M around 0 53.1%
associate-*r/53.1%
*-commutative53.1%
*-commutative53.1%
times-frac53.1%
unpow253.1%
*-commutative53.1%
associate-*l*53.2%
unpow253.2%
unpow253.2%
swap-sqr67.5%
*-commutative67.5%
associate-*l*66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in d around 0 53.1%
*-commutative53.1%
times-frac49.9%
unpow249.9%
associate-*r/56.2%
unpow256.2%
times-frac64.2%
unpow264.2%
associate-/l*68.9%
*-commutative68.9%
associate-*l*75.3%
*-commutative75.3%
Simplified75.3%
Taylor expanded in M around 0 62.6%
unpow262.6%
associate-*l*67.3%
*-commutative67.3%
unpow267.3%
times-frac76.9%
associate-*l/78.4%
*-commutative78.4%
associate-*l*76.9%
Simplified76.9%
if -0.0 < (/.f64 h l) Initial program 95.4%
times-frac95.4%
Simplified95.4%
Taylor expanded in M around 0 100.0%
Final simplification86.5%
NOTE: M 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 (- 1.0 (* (pow (/ (* D M) (* 2.0 d)) 2.0) (/ h l)))))
(if (<= t_0 1e+264)
(* w0 (sqrt t_0))
(*
w0
(sqrt (- 1.0 (* 0.25 (* D (* (/ D l) (* h (* (/ M d) (/ M d))))))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (pow(((D * M) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 1e+264) {
tmp = w0 * sqrt(t_0);
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d))))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - ((((d * m) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))
if (t_0 <= 1d+264) then
tmp = w0 * sqrt(t_0)
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (d * ((d / l) * (h * ((m / d_1) * (m / d_1))))))))
end if
code = tmp
end function
M = Math.abs(M);
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 = 1.0 - (Math.pow(((D * M) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 1e+264) {
tmp = w0 * Math.sqrt(t_0);
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d))))))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): t_0 = 1.0 - (math.pow(((D * M) / (2.0 * d)), 2.0) * (h / l)) tmp = 0 if t_0 <= 1e+264: tmp = w0 * math.sqrt(t_0) else: tmp = w0 * math.sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d)))))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) t_0 = Float64(1.0 - Float64((Float64(Float64(D * M) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))) tmp = 0.0 if (t_0 <= 1e+264) tmp = Float64(w0 * sqrt(t_0)); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(D * Float64(Float64(D / l) * Float64(h * Float64(Float64(M / d) * Float64(M / d))))))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
t_0 = 1.0 - ((((D * M) / (2.0 * d)) ^ 2.0) * (h / l));
tmp = 0.0;
if (t_0 <= 1e+264)
tmp = w0 * sqrt(t_0);
else
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / 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: 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[(1.0 - N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e+264], N[(w0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(D * N[(N[(D / l), $MachinePrecision] * N[(h * N[(N[(M / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := 1 - {\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\
\mathbf{if}\;t_0 \leq 10^{+264}:\\
\;\;\;\;w0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(D \cdot \left(\frac{D}{\ell} \cdot \left(h \cdot \left(\frac{M}{d} \cdot \frac{M}{d}\right)\right)\right)\right)}\\
\end{array}
\end{array}
if (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < 1.00000000000000004e264Initial program 99.9%
if 1.00000000000000004e264 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) Initial program 46.1%
times-frac47.2%
Simplified47.2%
Taylor expanded in M around 0 44.7%
associate-*r/44.7%
*-commutative44.7%
*-commutative44.7%
times-frac45.8%
unpow245.8%
*-commutative45.8%
associate-*l*47.2%
unpow247.2%
unpow247.2%
swap-sqr54.5%
*-commutative54.5%
associate-*l*54.5%
*-commutative54.5%
Simplified54.5%
Taylor expanded in d around 0 44.7%
*-commutative44.7%
times-frac42.2%
unpow242.2%
associate-*r/44.5%
unpow244.5%
times-frac52.1%
unpow252.1%
associate-/l*56.8%
*-commutative56.8%
associate-*l*64.1%
*-commutative64.1%
Simplified64.1%
Taylor expanded in M around 0 48.4%
unpow248.4%
associate-*l*48.4%
*-commutative48.4%
unpow248.4%
times-frac61.7%
associate-*l/65.2%
*-commutative65.2%
associate-*l*64.0%
Simplified64.0%
Final simplification88.3%
NOTE: M 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) (- INFINITY))
(* w0 (sqrt (- 1.0 (* 0.25 (* (/ (* D D) l) (* (/ M d) (/ (* h M) d)))))))
(if (<= (/ h l) -1e-110)
(* w0 (sqrt (- 1.0 (* (/ h l) (pow (* M (* D (/ 0.5 d))) 2.0)))))
(if (<= (/ h l) 0.0)
(*
w0
(sqrt (- 1.0 (* 0.25 (* D (* (/ D l) (* h (* (/ M d) (/ M d)))))))))
w0))))M = abs(M);
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) <= -((double) INFINITY)) {
tmp = w0 * sqrt((1.0 - (0.25 * (((D * D) / l) * ((M / d) * ((h * M) / d))))));
} else if ((h / l) <= -1e-110) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow((M * (D * (0.5 / d))), 2.0))));
} else if ((h / l) <= 0.0) {
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d))))))));
} else {
tmp = w0;
}
return tmp;
}
M = Math.abs(M);
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) <= -Double.POSITIVE_INFINITY) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D * D) / l) * ((M / d) * ((h * M) / d))))));
} else if ((h / l) <= -1e-110) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow((M * (D * (0.5 / d))), 2.0))));
} else if ((h / l) <= 0.0) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d))))))));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (h / l) <= -math.inf: tmp = w0 * math.sqrt((1.0 - (0.25 * (((D * D) / l) * ((M / d) * ((h * M) / d)))))) elif (h / l) <= -1e-110: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow((M * (D * (0.5 / d))), 2.0)))) elif (h / l) <= 0.0: tmp = w0 * math.sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d)))))))) else: tmp = w0 return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(h / l) <= Float64(-Inf)) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D * D) / l) * Float64(Float64(M / d) * Float64(Float64(h * M) / d))))))); elseif (Float64(h / l) <= -1e-110) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0))))); elseif (Float64(h / l) <= 0.0) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(D * Float64(Float64(D / l) * Float64(h * Float64(Float64(M / d) * Float64(M / d))))))))); else tmp = w0; end return tmp end
M = abs(M)
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) <= -Inf)
tmp = w0 * sqrt((1.0 - (0.25 * (((D * D) / l) * ((M / d) * ((h * M) / d))))));
elseif ((h / l) <= -1e-110)
tmp = w0 * sqrt((1.0 - ((h / l) * ((M * (D * (0.5 / d))) ^ 2.0))));
elseif ((h / l) <= 0.0)
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d))))))));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: 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], (-Infinity)], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(N[(D * D), $MachinePrecision] / l), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(h / l), $MachinePrecision], -1e-110], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(h / l), $MachinePrecision], 0.0], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(D * N[(N[(D / l), $MachinePrecision] * N[(h * N[(N[(M / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -\infty:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\frac{D \cdot D}{\ell} \cdot \left(\frac{M}{d} \cdot \frac{h \cdot M}{d}\right)\right)}\\
\mathbf{elif}\;\frac{h}{\ell} \leq -1 \cdot 10^{-110}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}}\\
\mathbf{elif}\;\frac{h}{\ell} \leq 0:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(D \cdot \left(\frac{D}{\ell} \cdot \left(h \cdot \left(\frac{M}{d} \cdot \frac{M}{d}\right)\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if (/.f64 h l) < -inf.0Initial program 48.1%
times-frac48.1%
Simplified48.1%
Taylor expanded in M around 0 63.6%
associate-*r/63.6%
*-commutative63.6%
associate-*r/63.6%
times-frac63.5%
unpow263.5%
*-commutative63.5%
unpow263.5%
unpow263.5%
Simplified63.5%
Taylor expanded in M around 0 63.5%
unpow263.5%
*-commutative63.5%
associate-*r*63.5%
unpow263.5%
times-frac70.3%
*-commutative70.3%
Simplified70.3%
if -inf.0 < (/.f64 h l) < -1.0000000000000001e-110Initial program 84.5%
associate-/l*83.5%
Simplified83.5%
clear-num83.5%
associate-/r/83.5%
clear-num83.5%
div-inv83.5%
associate-/r*83.5%
metadata-eval83.5%
Applied egg-rr83.5%
if -1.0000000000000001e-110 < (/.f64 h l) < -0.0Initial program 72.1%
times-frac70.5%
Simplified70.5%
Taylor expanded in M around 0 53.1%
associate-*r/53.1%
*-commutative53.1%
*-commutative53.1%
times-frac53.1%
unpow253.1%
*-commutative53.1%
associate-*l*53.2%
unpow253.2%
unpow253.2%
swap-sqr67.5%
*-commutative67.5%
associate-*l*66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in d around 0 53.1%
*-commutative53.1%
times-frac49.9%
unpow249.9%
associate-*r/56.2%
unpow256.2%
times-frac64.2%
unpow264.2%
associate-/l*68.9%
*-commutative68.9%
associate-*l*75.3%
*-commutative75.3%
Simplified75.3%
Taylor expanded in M around 0 62.6%
unpow262.6%
associate-*l*67.3%
*-commutative67.3%
unpow267.3%
times-frac76.9%
associate-*l/78.4%
*-commutative78.4%
associate-*l*76.9%
Simplified76.9%
if -0.0 < (/.f64 h l) Initial program 95.4%
times-frac95.4%
Simplified95.4%
Taylor expanded in M around 0 100.0%
Final simplification86.5%
NOTE: M 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 (<= (* 2.0 d) 5e-113) (* w0 (sqrt (- 1.0 (* 0.25 (* D (* (/ D l) (* h (* (/ M d) (/ M d))))))))) (* w0 (sqrt (- 1.0 (/ (* h (pow (* (* M 0.5) (/ D d)) 2.0)) l))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((2.0 * d) <= 5e-113) {
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d))))))));
} else {
tmp = w0 * sqrt((1.0 - ((h * pow(((M * 0.5) * (D / d)), 2.0)) / l)));
}
return tmp;
}
NOTE: M 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 ((2.0d0 * d_1) <= 5d-113) then
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (d * ((d / l) * (h * ((m / d_1) * (m / d_1))))))))
else
tmp = w0 * sqrt((1.0d0 - ((h * (((m * 0.5d0) * (d / d_1)) ** 2.0d0)) / l)))
end if
code = tmp
end function
M = Math.abs(M);
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 ((2.0 * d) <= 5e-113) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d))))))));
} else {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow(((M * 0.5) * (D / d)), 2.0)) / l)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (2.0 * d) <= 5e-113: tmp = w0 * math.sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d)))))))) else: tmp = w0 * math.sqrt((1.0 - ((h * math.pow(((M * 0.5) * (D / d)), 2.0)) / l))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(2.0 * d) <= 5e-113) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(D * Float64(Float64(D / l) * Float64(h * Float64(Float64(M / d) * Float64(M / d))))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0)) / l)))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if ((2.0 * d) <= 5e-113)
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d))))))));
else
tmp = w0 * sqrt((1.0 - ((h * (((M * 0.5) * (D / d)) ^ 2.0)) / l)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(2.0 * d), $MachinePrecision], 5e-113], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(D * N[(N[(D / l), $MachinePrecision] * N[(h * N[(N[(M / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot d \leq 5 \cdot 10^{-113}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(D \cdot \left(\frac{D}{\ell} \cdot \left(h \cdot \left(\frac{M}{d} \cdot \frac{M}{d}\right)\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 2 d) < 4.9999999999999997e-113Initial program 80.8%
times-frac79.5%
Simplified79.5%
Taylor expanded in M around 0 53.1%
associate-*r/53.1%
*-commutative53.1%
*-commutative53.1%
times-frac53.9%
unpow253.9%
*-commutative53.9%
associate-*l*55.2%
unpow255.2%
unpow255.2%
swap-sqr68.5%
*-commutative68.5%
associate-*l*66.5%
*-commutative66.5%
Simplified66.5%
Taylor expanded in d around 0 53.1%
*-commutative53.1%
times-frac51.9%
unpow251.9%
associate-*r/55.1%
unpow255.1%
times-frac62.5%
unpow262.5%
associate-/l*68.5%
*-commutative68.5%
associate-*l*75.2%
*-commutative75.2%
Simplified75.2%
Taylor expanded in M around 0 60.5%
unpow260.5%
associate-*l*62.0%
*-commutative62.0%
unpow262.0%
times-frac76.4%
associate-*l/79.6%
*-commutative79.6%
associate-*l*78.3%
Simplified78.3%
if 4.9999999999999997e-113 < (*.f64 2 d) Initial program 84.9%
times-frac85.0%
Simplified85.0%
associate-*r/91.0%
frac-times90.9%
frac-times91.0%
unpow291.0%
unpow291.0%
div-inv91.0%
metadata-eval91.0%
Applied egg-rr91.0%
Final simplification83.4%
NOTE: M 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) 0.0) (* w0 (sqrt (- 1.0 (* 0.25 (* D (* (/ D l) (* h (* (/ M d) (/ M d))))))))) w0))
M = abs(M);
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) <= 0.0) {
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d))))))));
} else {
tmp = w0;
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: 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) <= 0.0d0) then
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (d * ((d / l) * (h * ((m / d_1) * (m / d_1))))))))
else
tmp = w0
end if
code = tmp
end function
M = Math.abs(M);
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) <= 0.0) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d))))))));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (h / l) <= 0.0: tmp = w0 * math.sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d)))))))) else: tmp = w0 return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(h / l) <= 0.0) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(D * Float64(Float64(D / l) * Float64(h * Float64(Float64(M / d) * Float64(M / d))))))))); else tmp = w0; end return tmp end
M = abs(M)
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) <= 0.0)
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D / l) * (h * ((M / d) * (M / d))))))));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: 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], 0.0], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(D * N[(N[(D / l), $MachinePrecision] * N[(h * N[(N[(M / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq 0:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(D \cdot \left(\frac{D}{\ell} \cdot \left(h \cdot \left(\frac{M}{d} \cdot \frac{M}{d}\right)\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if (/.f64 h l) < -0.0Initial program 75.8%
times-frac74.7%
Simplified74.7%
Taylor expanded in M around 0 51.7%
associate-*r/51.7%
*-commutative51.7%
*-commutative51.7%
times-frac52.8%
unpow252.8%
*-commutative52.8%
associate-*l*52.9%
unpow252.9%
unpow252.9%
swap-sqr67.6%
*-commutative67.6%
associate-*l*66.5%
*-commutative66.5%
Simplified66.5%
Taylor expanded in d around 0 51.7%
*-commutative51.7%
times-frac50.4%
unpow250.4%
associate-*r/54.6%
unpow254.6%
times-frac61.2%
unpow261.2%
associate-/l*68.9%
*-commutative68.9%
associate-*l*76.1%
*-commutative76.1%
Simplified76.1%
Taylor expanded in M around 0 60.1%
unpow260.1%
associate-*l*62.5%
*-commutative62.5%
unpow262.5%
times-frac75.4%
associate-*l/78.8%
*-commutative78.8%
associate-*l*77.1%
Simplified77.1%
if -0.0 < (/.f64 h l) Initial program 95.4%
times-frac95.4%
Simplified95.4%
Taylor expanded in M around 0 100.0%
Final simplification84.9%
NOTE: M 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.05e-201) w0 (* w0 (+ 1.0 (* -0.125 (* D (* (/ D l) (* M (/ (* M (/ h d)) d)))))))))
M = abs(M);
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.05e-201) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (M * ((M * (h / d)) / d))))));
}
return tmp;
}
NOTE: M 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.05d-201) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (d * ((d / l) * (m * ((m * (h / d_1)) / d_1))))))
end if
code = tmp
end function
M = Math.abs(M);
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.05e-201) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (M * ((M * (h / d)) / d))))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.05e-201: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (M * ((M * (h / d)) / d)))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.05e-201) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(D * Float64(Float64(D / l) * Float64(M * Float64(Float64(M * Float64(h / d)) / d))))))); end return tmp end
M = abs(M)
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.05e-201)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (M * ((M * (h / d)) / 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: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 1.05e-201], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(D * N[(N[(D / l), $MachinePrecision] * N[(M * N[(N[(M * N[(h / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.05 \cdot 10^{-201}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(D \cdot \left(\frac{D}{\ell} \cdot \left(M \cdot \frac{M \cdot \frac{h}{d}}{d}\right)\right)\right)\right)\\
\end{array}
\end{array}
if M < 1.05000000000000006e-201Initial program 83.2%
times-frac81.9%
Simplified81.9%
Taylor expanded in M around 0 69.9%
if 1.05000000000000006e-201 < M Initial program 81.4%
times-frac81.4%
Simplified81.4%
Taylor expanded in M around 0 56.8%
associate-*r/56.8%
*-commutative56.8%
associate-*r/56.8%
*-commutative56.8%
times-frac54.9%
unpow254.9%
*-commutative54.9%
unpow254.9%
unpow254.9%
Simplified54.9%
Taylor expanded in D around 0 56.8%
*-commutative56.8%
times-frac54.9%
unpow254.9%
associate-*l/57.8%
*-commutative57.8%
unpow257.8%
*-commutative57.8%
associate-*r*61.7%
unpow261.7%
times-frac70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in D around 0 56.8%
*-commutative56.8%
times-frac54.9%
unpow254.9%
associate-*r/57.8%
unpow257.8%
times-frac63.6%
unpow263.6%
associate-/l*73.3%
associate-*l*79.1%
associate-*r/80.1%
*-commutative80.1%
associate-/r/79.1%
*-commutative79.1%
Simplified79.1%
Final simplification73.7%
NOTE: M 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.3e-201) w0 (* w0 (+ 1.0 (* -0.125 (* D (* (/ D l) (* (/ M (/ d M)) (/ h d)))))))))
M = abs(M);
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.3e-201) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * ((M / (d / M)) * (h / d))))));
}
return tmp;
}
NOTE: M 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.3d-201) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (d * ((d / l) * ((m / (d_1 / m)) * (h / d_1))))))
end if
code = tmp
end function
M = Math.abs(M);
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.3e-201) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * ((M / (d / M)) * (h / d))))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.3e-201: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * ((M / (d / M)) * (h / d)))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.3e-201) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(D * Float64(Float64(D / l) * Float64(Float64(M / Float64(d / M)) * Float64(h / d))))))); end return tmp end
M = abs(M)
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.3e-201)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * ((M / (d / 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: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 1.3e-201], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(D * N[(N[(D / l), $MachinePrecision] * N[(N[(M / N[(d / M), $MachinePrecision]), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.3 \cdot 10^{-201}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(D \cdot \left(\frac{D}{\ell} \cdot \left(\frac{M}{\frac{d}{M}} \cdot \frac{h}{d}\right)\right)\right)\right)\\
\end{array}
\end{array}
if M < 1.29999999999999991e-201Initial program 83.2%
times-frac81.9%
Simplified81.9%
Taylor expanded in M around 0 69.9%
if 1.29999999999999991e-201 < M Initial program 81.4%
times-frac81.4%
Simplified81.4%
Taylor expanded in M around 0 56.8%
associate-*r/56.8%
*-commutative56.8%
associate-*r/56.8%
*-commutative56.8%
times-frac54.9%
unpow254.9%
*-commutative54.9%
unpow254.9%
unpow254.9%
Simplified54.9%
Taylor expanded in D around 0 56.8%
*-commutative56.8%
times-frac54.9%
unpow254.9%
associate-*l/57.8%
*-commutative57.8%
unpow257.8%
*-commutative57.8%
associate-*r*61.7%
unpow261.7%
times-frac70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in w0 around 0 56.8%
Simplified79.1%
Final simplification73.7%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= d 1.26e+150) (* w0 (+ 1.0 (* (* D (* (/ D l) (/ (* h M) (* d (/ d M))))) -0.125))) w0))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 1.26e+150) {
tmp = w0 * (1.0 + ((D * ((D / l) * ((h * M) / (d * (d / M))))) * -0.125));
} else {
tmp = w0;
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 1.26d+150) then
tmp = w0 * (1.0d0 + ((d * ((d / l) * ((h * m) / (d_1 * (d_1 / m))))) * (-0.125d0)))
else
tmp = w0
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 1.26e+150) {
tmp = w0 * (1.0 + ((D * ((D / l) * ((h * M) / (d * (d / M))))) * -0.125));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 1.26e+150: tmp = w0 * (1.0 + ((D * ((D / l) * ((h * M) / (d * (d / M))))) * -0.125)) else: tmp = w0 return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 1.26e+150) tmp = Float64(w0 * Float64(1.0 + Float64(Float64(D * Float64(Float64(D / l) * Float64(Float64(h * M) / Float64(d * Float64(d / M))))) * -0.125))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 1.26e+150)
tmp = w0 * (1.0 + ((D * ((D / l) * ((h * M) / (d * (d / M))))) * -0.125));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 1.26e+150], N[(w0 * N[(1.0 + N[(N[(D * N[(N[(D / l), $MachinePrecision] * N[(N[(h * M), $MachinePrecision] / N[(d * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.26 \cdot 10^{+150}:\\
\;\;\;\;w0 \cdot \left(1 + \left(D \cdot \left(\frac{D}{\ell} \cdot \frac{h \cdot M}{d \cdot \frac{d}{M}}\right)\right) \cdot -0.125\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 1.26e150Initial program 82.5%
times-frac81.6%
Simplified81.6%
Taylor expanded in M around 0 57.0%
associate-*r/57.0%
*-commutative57.0%
associate-*r/57.0%
*-commutative57.0%
times-frac57.5%
unpow257.5%
*-commutative57.5%
unpow257.5%
unpow257.5%
Simplified57.5%
Taylor expanded in D around 0 57.0%
*-commutative57.0%
times-frac57.5%
unpow257.5%
associate-*l/59.4%
*-commutative59.4%
unpow259.4%
*-commutative59.4%
associate-*r*61.0%
unpow261.0%
times-frac69.0%
*-commutative69.0%
Simplified69.0%
add-cbrt-cube33.5%
Applied egg-rr33.5%
associate-*l*33.5%
Simplified36.2%
*-commutative36.2%
associate-*r*36.2%
*-commutative36.2%
Applied egg-rr74.4%
if 1.26e150 < d Initial program 82.2%
times-frac82.3%
Simplified82.3%
Taylor expanded in M around 0 86.9%
Final simplification76.8%
NOTE: M 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 9.8e+45) w0 (* -0.125 (* (/ (* D D) (* d d)) (/ (* h (* M (* w0 M))) l)))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 9.8e+45) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) / (d * d)) * ((h * (M * (w0 * M))) / l));
}
return tmp;
}
NOTE: M 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 <= 9.8d+45) then
tmp = w0
else
tmp = (-0.125d0) * (((d * d) / (d_1 * d_1)) * ((h * (m * (w0 * m))) / l))
end if
code = tmp
end function
M = Math.abs(M);
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 <= 9.8e+45) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) / (d * d)) * ((h * (M * (w0 * M))) / l));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 9.8e+45: tmp = w0 else: tmp = -0.125 * (((D * D) / (d * d)) * ((h * (M * (w0 * M))) / l)) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 9.8e+45) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) / Float64(d * d)) * Float64(Float64(h * Float64(M * Float64(w0 * M))) / l))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 9.8e+45)
tmp = w0;
else
tmp = -0.125 * (((D * D) / (d * d)) * ((h * (M * (w0 * M))) / l));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 9.8e+45], w0, N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(N[(h * N[(M * N[(w0 * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 9.8 \cdot 10^{+45}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{d \cdot d} \cdot \frac{h \cdot \left(M \cdot \left(w0 \cdot M\right)\right)}{\ell}\right)\\
\end{array}
\end{array}
if M < 9.8000000000000004e45Initial program 83.9%
times-frac82.9%
Simplified82.9%
Taylor expanded in M around 0 74.7%
if 9.8000000000000004e45 < M Initial program 76.7%
times-frac76.7%
Simplified76.7%
Taylor expanded in M around 0 37.0%
associate-*r/37.0%
*-commutative37.0%
associate-*r/37.0%
*-commutative37.0%
times-frac36.9%
unpow236.9%
*-commutative36.9%
unpow236.9%
unpow236.9%
Simplified36.9%
Taylor expanded in D around 0 37.0%
*-commutative37.0%
times-frac36.9%
unpow236.9%
associate-*l/37.0%
*-commutative37.0%
unpow237.0%
*-commutative37.0%
associate-*r*45.1%
unpow245.1%
times-frac61.3%
*-commutative61.3%
Simplified61.3%
Taylor expanded in D around inf 27.3%
associate-/r*27.4%
associate-/r*27.3%
times-frac25.2%
*-commutative25.2%
unpow225.2%
unpow225.2%
*-commutative25.2%
*-commutative25.2%
*-commutative25.2%
unpow225.2%
Simplified25.2%
Taylor expanded in D around 0 27.3%
*-commutative27.3%
times-frac25.2%
unpow225.2%
unpow225.2%
*-commutative25.2%
associate-*r*25.3%
unpow225.3%
associate-*l*25.3%
Simplified25.3%
Final simplification65.0%
NOTE: M 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.05e+45) w0 (* -0.125 (* (/ (* D D) (* d d)) (/ (* w0 (* h (* M M))) l)))))
M = abs(M);
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.05e+45) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) / (d * d)) * ((w0 * (h * (M * M))) / l));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: 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.05d+45) then
tmp = w0
else
tmp = (-0.125d0) * (((d * d) / (d_1 * d_1)) * ((w0 * (h * (m * m))) / l))
end if
code = tmp
end function
M = Math.abs(M);
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.05e+45) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) / (d * d)) * ((w0 * (h * (M * M))) / l));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.05e+45: tmp = w0 else: tmp = -0.125 * (((D * D) / (d * d)) * ((w0 * (h * (M * M))) / l)) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.05e+45) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) / Float64(d * d)) * Float64(Float64(w0 * Float64(h * Float64(M * M))) / l))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 1.05e+45)
tmp = w0;
else
tmp = -0.125 * (((D * D) / (d * d)) * ((w0 * (h * (M * M))) / l));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 1.05e+45], w0, N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(N[(w0 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.05 \cdot 10^{+45}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{d \cdot d} \cdot \frac{w0 \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\ell}\right)\\
\end{array}
\end{array}
if M < 1.04999999999999997e45Initial program 83.9%
times-frac82.9%
Simplified82.9%
Taylor expanded in M around 0 74.7%
if 1.04999999999999997e45 < M Initial program 76.7%
times-frac76.7%
Simplified76.7%
Taylor expanded in M around 0 37.0%
associate-*r/37.0%
*-commutative37.0%
associate-*r/37.0%
*-commutative37.0%
times-frac36.9%
unpow236.9%
*-commutative36.9%
unpow236.9%
unpow236.9%
Simplified36.9%
Taylor expanded in D around 0 37.0%
*-commutative37.0%
times-frac36.9%
unpow236.9%
associate-*l/37.0%
*-commutative37.0%
unpow237.0%
*-commutative37.0%
associate-*r*45.1%
unpow245.1%
times-frac61.3%
*-commutative61.3%
Simplified61.3%
Taylor expanded in D around inf 27.3%
associate-/r*27.4%
associate-/r*27.3%
times-frac25.2%
*-commutative25.2%
unpow225.2%
unpow225.2%
*-commutative25.2%
*-commutative25.2%
*-commutative25.2%
unpow225.2%
Simplified25.2%
Final simplification65.0%
NOTE: M 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 1e+46) w0 (* -0.125 (/ (* (* D D) (* h (* w0 (* M M)))) (* l (* d d))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1e+46) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) * (h * (w0 * (M * M)))) / (l * (d * d)));
}
return tmp;
}
NOTE: M 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 <= 1d+46) then
tmp = w0
else
tmp = (-0.125d0) * (((d * d) * (h * (w0 * (m * m)))) / (l * (d_1 * d_1)))
end if
code = tmp
end function
M = Math.abs(M);
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 <= 1e+46) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) * (h * (w0 * (M * M)))) / (l * (d * d)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1e+46: tmp = w0 else: tmp = -0.125 * (((D * D) * (h * (w0 * (M * M)))) / (l * (d * d))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1e+46) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) * Float64(h * Float64(w0 * Float64(M * M)))) / Float64(l * Float64(d * d)))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 1e+46)
tmp = w0;
else
tmp = -0.125 * (((D * D) * (h * (w0 * (M * M)))) / (l * (d * 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: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 1e+46], w0, N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] * N[(h * N[(w0 * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 10^{+46}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\\
\end{array}
\end{array}
if M < 9.9999999999999999e45Initial program 83.9%
times-frac82.9%
Simplified82.9%
Taylor expanded in M around 0 74.7%
if 9.9999999999999999e45 < M Initial program 76.7%
times-frac76.7%
Simplified76.7%
Taylor expanded in M around 0 37.0%
associate-*r/37.0%
*-commutative37.0%
associate-*r/37.0%
*-commutative37.0%
times-frac36.9%
unpow236.9%
*-commutative36.9%
unpow236.9%
unpow236.9%
Simplified36.9%
Taylor expanded in D around 0 37.0%
*-commutative37.0%
times-frac36.9%
unpow236.9%
associate-*l/37.0%
*-commutative37.0%
unpow237.0%
*-commutative37.0%
associate-*r*45.1%
unpow245.1%
times-frac61.3%
*-commutative61.3%
Simplified61.3%
Taylor expanded in D around inf 27.3%
associate-/r*27.4%
associate-/r*27.3%
times-frac25.2%
*-commutative25.2%
unpow225.2%
unpow225.2%
*-commutative25.2%
*-commutative25.2%
*-commutative25.2%
unpow225.2%
Simplified25.2%
frac-times27.3%
associate-*l*27.5%
Applied egg-rr27.5%
Final simplification65.5%
NOTE: M 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 6.5e+15) w0 (* -0.125 (/ (* (* D D) (* w0 (/ h d))) (* (/ d M) (/ l M))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 6.5e+15) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) * (w0 * (h / d))) / ((d / M) * (l / M)));
}
return tmp;
}
NOTE: M 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 <= 6.5d+15) then
tmp = w0
else
tmp = (-0.125d0) * (((d * d) * (w0 * (h / d_1))) / ((d_1 / m) * (l / m)))
end if
code = tmp
end function
M = Math.abs(M);
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 <= 6.5e+15) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) * (w0 * (h / d))) / ((d / M) * (l / M)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 6.5e+15: tmp = w0 else: tmp = -0.125 * (((D * D) * (w0 * (h / d))) / ((d / M) * (l / M))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 6.5e+15) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) * Float64(w0 * Float64(h / d))) / Float64(Float64(d / M) * Float64(l / M)))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 6.5e+15)
tmp = w0;
else
tmp = -0.125 * (((D * D) * (w0 * (h / d))) / ((d / M) * (l / 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: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 6.5e+15], w0, N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] * N[(w0 * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d / M), $MachinePrecision] * N[(l / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 6.5 \cdot 10^{+15}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \frac{\left(D \cdot D\right) \cdot \left(w0 \cdot \frac{h}{d}\right)}{\frac{d}{M} \cdot \frac{\ell}{M}}\\
\end{array}
\end{array}
if M < 6.5e15Initial program 84.1%
times-frac83.1%
Simplified83.1%
Taylor expanded in M around 0 75.4%
if 6.5e15 < M Initial program 76.9%
times-frac76.9%
Simplified76.9%
Taylor expanded in M around 0 39.9%
associate-*r/39.9%
*-commutative39.9%
associate-*r/39.9%
*-commutative39.9%
times-frac39.8%
unpow239.8%
*-commutative39.8%
unpow239.8%
unpow239.8%
Simplified39.8%
Taylor expanded in D around 0 39.9%
*-commutative39.9%
times-frac39.8%
unpow239.8%
associate-*l/40.0%
*-commutative40.0%
unpow240.0%
*-commutative40.0%
associate-*r*46.8%
unpow246.8%
times-frac60.7%
*-commutative60.7%
Simplified60.7%
Taylor expanded in D around inf 25.2%
associate-*r/25.2%
*-commutative25.2%
associate-*r/25.2%
times-frac25.1%
*-commutative25.1%
associate-*r*25.1%
unpow225.1%
times-frac28.9%
associate-*r/28.9%
unpow228.9%
associate-/l*29.6%
*-commutative29.6%
unpow229.6%
associate-*r/29.8%
associate-*l*29.7%
Simplified29.2%
Final simplification64.8%
NOTE: M 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 6.5e+15) w0 (* -0.125 (/ (* (* (/ D d) (/ D d)) (* h (* w0 (* M M)))) l))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 6.5e+15) {
tmp = w0;
} else {
tmp = -0.125 * ((((D / d) * (D / d)) * (h * (w0 * (M * M)))) / l);
}
return tmp;
}
NOTE: M 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 <= 6.5d+15) then
tmp = w0
else
tmp = (-0.125d0) * ((((d / d_1) * (d / d_1)) * (h * (w0 * (m * m)))) / l)
end if
code = tmp
end function
M = Math.abs(M);
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 <= 6.5e+15) {
tmp = w0;
} else {
tmp = -0.125 * ((((D / d) * (D / d)) * (h * (w0 * (M * M)))) / l);
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 6.5e+15: tmp = w0 else: tmp = -0.125 * ((((D / d) * (D / d)) * (h * (w0 * (M * M)))) / l) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 6.5e+15) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(h * Float64(w0 * Float64(M * M)))) / l)); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 6.5e+15)
tmp = w0;
else
tmp = -0.125 * ((((D / d) * (D / d)) * (h * (w0 * (M * M)))) / l);
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 6.5e+15], w0, N[(-0.125 * N[(N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(h * N[(w0 * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 6.5 \cdot 10^{+15}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \frac{\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)\right)}{\ell}\\
\end{array}
\end{array}
if M < 6.5e15Initial program 84.1%
times-frac83.1%
Simplified83.1%
Taylor expanded in M around 0 75.4%
if 6.5e15 < M Initial program 76.9%
times-frac76.9%
Simplified76.9%
Taylor expanded in M around 0 39.9%
associate-*r/39.9%
*-commutative39.9%
associate-*r/39.9%
*-commutative39.9%
times-frac39.8%
unpow239.8%
*-commutative39.8%
unpow239.8%
unpow239.8%
Simplified39.8%
Taylor expanded in D around 0 39.9%
*-commutative39.9%
times-frac39.8%
unpow239.8%
associate-*l/40.0%
*-commutative40.0%
unpow240.0%
*-commutative40.0%
associate-*r*46.8%
unpow246.8%
times-frac60.7%
*-commutative60.7%
Simplified60.7%
Taylor expanded in D around inf 25.2%
associate-/r*25.2%
associate-/r*25.2%
times-frac23.4%
*-commutative23.4%
unpow223.4%
unpow223.4%
*-commutative23.4%
*-commutative23.4%
*-commutative23.4%
unpow223.4%
Simplified23.4%
associate-*r/23.4%
times-frac28.8%
associate-*l*28.9%
Applied egg-rr28.9%
Final simplification64.7%
NOTE: M 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);
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: 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);
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) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0
M = abs(M) 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)
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: 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|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0
\end{array}
Initial program 82.5%
times-frac81.7%
Simplified81.7%
Taylor expanded in M around 0 68.1%
Final simplification68.1%
herbie shell --seed 2023261
(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))))))