
(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 19 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)) (- INFINITY))
(*
w0
(pow
(exp 0.5)
(fma
2.0
(log D)
(fma -2.0 (log d) (fma 2.0 (log M) (log (* (/ h l) -0.25)))))))
(* w0 (sqrt (- 1.0 (/ (* h (pow (* 0.5 (/ (* M D) 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)) <= -((double) INFINITY)) {
tmp = w0 * pow(exp(0.5), fma(2.0, log(D), fma(-2.0, log(d), fma(2.0, log(M), log(((h / l) * -0.25))))));
} else {
tmp = w0 * sqrt((1.0 - ((h * pow((0.5 * ((M * D) / 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)) <= Float64(-Inf)) tmp = Float64(w0 * (exp(0.5) ^ fma(2.0, log(D), fma(-2.0, log(d), fma(2.0, log(M), log(Float64(Float64(h / l) * -0.25))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(0.5 * Float64(Float64(M * D) / 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], (-Infinity)], N[(w0 * N[Power[N[Exp[0.5], $MachinePrecision], N[(2.0 * N[Log[D], $MachinePrecision] + N[(-2.0 * N[Log[d], $MachinePrecision] + N[(2.0 * N[Log[M], $MachinePrecision] + N[Log[N[(N[(h / l), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(0.5 * N[(N[(M * D), $MachinePrecision] / d), $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 -\infty:\\
\;\;\;\;w0 \cdot {\left(e^{0.5}\right)}^{\left(\mathsf{fma}\left(2, \log D, \mathsf{fma}\left(-2, \log d, \mathsf{fma}\left(2, \log M, \log \left(\frac{h}{\ell} \cdot -0.25\right)\right)\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(0.5 \cdot \frac{M \cdot D}{d}\right)}^{2}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < -inf.0Initial program 53.3%
*-commutative53.3%
times-frac53.3%
Simplified53.3%
Applied egg-rr53.3%
Taylor expanded in d around 0 25.1%
associate-/l*23.7%
*-commutative23.7%
unpow223.7%
associate-*r*26.5%
unpow226.5%
Simplified26.5%
Taylor expanded in D around 0 6.6%
associate-/l*5.2%
unpow25.2%
Simplified5.2%
Taylor expanded in w0 around 0 6.7%
*-commutative6.7%
exp-prod6.6%
+-commutative6.6%
*-commutative6.6%
associate-+r+6.6%
fma-def6.6%
fma-def6.6%
log-prod0.0%
*-commutative0.0%
associate-*l/0.0%
unpow20.0%
Simplified4.7%
if -inf.0 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 92.2%
*-commutative92.2%
times-frac92.3%
Simplified92.3%
unpow292.3%
associate-*l*92.9%
div-inv92.8%
associate-*l*92.4%
times-frac92.4%
*-un-lft-identity92.4%
*-commutative92.4%
clear-num92.4%
div-inv92.4%
div-inv92.3%
associate-*l*93.4%
times-frac93.4%
*-un-lft-identity93.4%
*-commutative93.4%
clear-num93.4%
div-inv93.4%
associate-*l*92.8%
Applied egg-rr98.0%
Taylor expanded in M around 0 97.5%
Final simplification75.4%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) (- INFINITY))
(*
w0
(exp
(*
0.5
(+
(log (* (/ h l) -0.25))
(+ (* 2.0 (log M)) (+ (* 2.0 (log D)) (* -2.0 (log d))))))))
(* w0 (sqrt (- 1.0 (/ (* h (pow (* 0.5 (/ (* M D) 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)) <= -((double) INFINITY)) {
tmp = w0 * exp((0.5 * (log(((h / l) * -0.25)) + ((2.0 * log(M)) + ((2.0 * log(D)) + (-2.0 * log(d)))))));
} else {
tmp = w0 * sqrt((1.0 - ((h * pow((0.5 * ((M * D) / 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)) <= -Double.POSITIVE_INFINITY) {
tmp = w0 * Math.exp((0.5 * (Math.log(((h / l) * -0.25)) + ((2.0 * Math.log(M)) + ((2.0 * Math.log(D)) + (-2.0 * Math.log(d)))))));
} else {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow((0.5 * ((M * D) / d)), 2.0)) / l)));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -math.inf: tmp = w0 * math.exp((0.5 * (math.log(((h / l) * -0.25)) + ((2.0 * math.log(M)) + ((2.0 * math.log(D)) + (-2.0 * math.log(d))))))) else: tmp = w0 * math.sqrt((1.0 - ((h * math.pow((0.5 * ((M * D) / 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)) <= Float64(-Inf)) tmp = Float64(w0 * exp(Float64(0.5 * Float64(log(Float64(Float64(h / l) * -0.25)) + Float64(Float64(2.0 * log(M)) + Float64(Float64(2.0 * log(D)) + Float64(-2.0 * log(d)))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(0.5 * Float64(Float64(M * D) / d)) ^ 2.0)) / l)))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)) <= -Inf)
tmp = w0 * exp((0.5 * (log(((h / l) * -0.25)) + ((2.0 * log(M)) + ((2.0 * log(D)) + (-2.0 * log(d)))))));
else
tmp = w0 * sqrt((1.0 - ((h * ((0.5 * ((M * 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: 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], (-Infinity)], N[(w0 * N[Exp[N[(0.5 * N[(N[Log[N[(N[(h / l), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision] + N[(N[(2.0 * N[Log[M], $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], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(0.5 * N[(N[(M * D), $MachinePrecision] / d), $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 -\infty:\\
\;\;\;\;w0 \cdot e^{0.5 \cdot \left(\log \left(\frac{h}{\ell} \cdot -0.25\right) + \left(2 \cdot \log M + \left(2 \cdot \log D + -2 \cdot \log d\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(0.5 \cdot \frac{M \cdot D}{d}\right)}^{2}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < -inf.0Initial program 53.3%
*-commutative53.3%
times-frac53.3%
Simplified53.3%
Applied egg-rr53.3%
Taylor expanded in d around 0 25.1%
associate-/l*23.7%
*-commutative23.7%
unpow223.7%
associate-*r*26.5%
unpow226.5%
Simplified26.5%
Taylor expanded in D around 0 6.6%
associate-/l*5.2%
unpow25.2%
Simplified5.2%
Taylor expanded in M around 0 4.7%
if -inf.0 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 92.2%
*-commutative92.2%
times-frac92.3%
Simplified92.3%
unpow292.3%
associate-*l*92.9%
div-inv92.8%
associate-*l*92.4%
times-frac92.4%
*-un-lft-identity92.4%
*-commutative92.4%
clear-num92.4%
div-inv92.4%
div-inv92.3%
associate-*l*93.4%
times-frac93.4%
*-un-lft-identity93.4%
*-commutative93.4%
clear-num93.4%
div-inv93.4%
associate-*l*92.8%
Applied egg-rr98.0%
Taylor expanded in M around 0 97.5%
Final simplification75.4%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) (- INFINITY))
(*
w0
(exp
(*
0.5
(+
(* -2.0 (log d))
(fma 2.0 (log D) (log (* -0.25 (/ (* M h) (/ l M)))))))))
(* w0 (sqrt (- 1.0 (/ (* h (pow (* 0.5 (/ (* M D) 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)) <= -((double) INFINITY)) {
tmp = w0 * exp((0.5 * ((-2.0 * log(d)) + fma(2.0, log(D), log((-0.25 * ((M * h) / (l / M))))))));
} else {
tmp = w0 * sqrt((1.0 - ((h * pow((0.5 * ((M * D) / 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)) <= Float64(-Inf)) tmp = Float64(w0 * exp(Float64(0.5 * Float64(Float64(-2.0 * log(d)) + fma(2.0, log(D), log(Float64(-0.25 * Float64(Float64(M * h) / Float64(l / M))))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(0.5 * Float64(Float64(M * D) / 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], (-Infinity)], N[(w0 * N[Exp[N[(0.5 * N[(N[(-2.0 * N[Log[d], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[Log[D], $MachinePrecision] + N[Log[N[(-0.25 * N[(N[(M * h), $MachinePrecision] / N[(l / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(0.5 * N[(N[(M * D), $MachinePrecision] / d), $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 -\infty:\\
\;\;\;\;w0 \cdot e^{0.5 \cdot \left(-2 \cdot \log d + \mathsf{fma}\left(2, \log D, \log \left(-0.25 \cdot \frac{M \cdot h}{\frac{\ell}{M}}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(0.5 \cdot \frac{M \cdot D}{d}\right)}^{2}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < -inf.0Initial program 53.3%
*-commutative53.3%
times-frac53.3%
Simplified53.3%
Applied egg-rr53.3%
Taylor expanded in d around 0 25.1%
associate-/l*23.7%
*-commutative23.7%
unpow223.7%
associate-*r*26.5%
unpow226.5%
Simplified26.5%
Taylor expanded in D around 0 6.6%
+-commutative6.6%
fma-def6.6%
*-commutative6.6%
unpow26.6%
associate-*r*8.1%
*-commutative8.1%
associate-/l*8.1%
*-commutative8.1%
Simplified8.1%
if -inf.0 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 92.2%
*-commutative92.2%
times-frac92.3%
Simplified92.3%
unpow292.3%
associate-*l*92.9%
div-inv92.8%
associate-*l*92.4%
times-frac92.4%
*-un-lft-identity92.4%
*-commutative92.4%
clear-num92.4%
div-inv92.4%
div-inv92.3%
associate-*l*93.4%
times-frac93.4%
*-un-lft-identity93.4%
*-commutative93.4%
clear-num93.4%
div-inv93.4%
associate-*l*92.8%
Applied egg-rr98.0%
Taylor expanded in M around 0 97.5%
Final simplification76.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
(let* ((t_0 (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))))
(if (<= t_0 5e+230)
(* w0 (sqrt t_0))
(*
w0
(sqrt (- 1.0 (/ (* 0.25 (* (/ (* (* M D) (* M D)) d) (/ h 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 t_0 = 1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 5e+230) {
tmp = w0 * sqrt(t_0);
} else {
tmp = w0 * sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / 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) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))
if (t_0 <= 5d+230) then
tmp = w0 * sqrt(t_0)
else
tmp = w0 * sqrt((1.0d0 - ((0.25d0 * ((((m * d) * (m * d)) / d_1) * (h / d_1))) / l)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 5e+230) {
tmp = w0 * Math.sqrt(t_0);
} else {
tmp = w0 * Math.sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / 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): t_0 = 1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) tmp = 0 if t_0 <= 5e+230: tmp = w0 * math.sqrt(t_0) else: tmp = w0 * math.sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / 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) t_0 = Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))) tmp = 0.0 if (t_0 <= 5e+230) tmp = Float64(w0 * sqrt(t_0)); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.25 * Float64(Float64(Float64(Float64(M * D) * Float64(M * D)) / d) * Float64(h / 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)
t_0 = 1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l));
tmp = 0.0;
if (t_0 <= 5e+230)
tmp = w0 * sqrt(t_0);
else
tmp = w0 * sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / 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_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, 5e+230], N[(w0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.25 * N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := 1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{+230}:\\
\;\;\;\;w0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{d} \cdot \frac{h}{d}\right)}{\ell}}\\
\end{array}
\end{array}
if (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < 5.0000000000000003e230Initial program 99.9%
if 5.0000000000000003e230 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) Initial program 44.2%
*-commutative44.2%
times-frac46.8%
Simplified46.8%
unpow246.8%
associate-*l*50.7%
div-inv50.7%
associate-*l*49.5%
times-frac49.5%
*-un-lft-identity49.5%
*-commutative49.5%
clear-num49.5%
div-inv49.5%
div-inv49.5%
associate-*l*50.9%
times-frac50.9%
*-un-lft-identity50.9%
*-commutative50.9%
clear-num50.9%
div-inv50.9%
associate-*l*46.8%
Applied egg-rr63.5%
Taylor expanded in M around 0 61.1%
Taylor expanded in D around 0 50.1%
associate-*r*50.2%
unpow250.2%
times-frac54.5%
unpow254.5%
unpow254.5%
swap-sqr62.0%
Simplified62.0%
Final simplification88.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 D) (* 2.0 d)) 1e+157)
(* w0 (sqrt (- 1.0 (/ (* h (pow (* 0.5 (/ (* M D) d)) 2.0)) l))))
(*
w0
(exp
(*
0.5
(+ (* -2.0 (log d)) (log (* -0.25 (* (* M h) (/ (* M D) (/ l D)))))))))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 1e+157) {
tmp = w0 * sqrt((1.0 - ((h * pow((0.5 * ((M * D) / d)), 2.0)) / l)));
} else {
tmp = w0 * exp((0.5 * ((-2.0 * log(d)) + log((-0.25 * ((M * h) * ((M * D) / (l / D))))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (((m * d) / (2.0d0 * d_1)) <= 1d+157) then
tmp = w0 * sqrt((1.0d0 - ((h * ((0.5d0 * ((m * d) / d_1)) ** 2.0d0)) / l)))
else
tmp = w0 * exp((0.5d0 * (((-2.0d0) * log(d_1)) + log(((-0.25d0) * ((m * h) * ((m * d) / (l / d))))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 1e+157) {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow((0.5 * ((M * D) / d)), 2.0)) / l)));
} else {
tmp = w0 * Math.exp((0.5 * ((-2.0 * Math.log(d)) + Math.log((-0.25 * ((M * h) * ((M * D) / (l / D))))))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if ((M * D) / (2.0 * d)) <= 1e+157: tmp = w0 * math.sqrt((1.0 - ((h * math.pow((0.5 * ((M * D) / d)), 2.0)) / l))) else: tmp = w0 * math.exp((0.5 * ((-2.0 * math.log(d)) + math.log((-0.25 * ((M * h) * ((M * D) / (l / D)))))))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(Float64(M * D) / Float64(2.0 * d)) <= 1e+157) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(0.5 * Float64(Float64(M * D) / d)) ^ 2.0)) / l)))); else tmp = Float64(w0 * exp(Float64(0.5 * Float64(Float64(-2.0 * log(d)) + log(Float64(-0.25 * Float64(Float64(M * h) * Float64(Float64(M * D) / Float64(l / D))))))))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (((M * D) / (2.0 * d)) <= 1e+157)
tmp = w0 * sqrt((1.0 - ((h * ((0.5 * ((M * D) / d)) ^ 2.0)) / l)));
else
tmp = w0 * exp((0.5 * ((-2.0 * log(d)) + log((-0.25 * ((M * h) * ((M * D) / (l / D))))))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 1e+157], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(0.5 * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Exp[N[(0.5 * N[(N[(-2.0 * N[Log[d], $MachinePrecision]), $MachinePrecision] + N[Log[N[(-0.25 * N[(N[(M * h), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / N[(l / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 10^{+157}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(0.5 \cdot \frac{M \cdot D}{d}\right)}^{2}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot e^{0.5 \cdot \left(-2 \cdot \log d + \log \left(-0.25 \cdot \left(\left(M \cdot h\right) \cdot \frac{M \cdot D}{\frac{\ell}{D}}\right)\right)\right)}\\
\end{array}
\end{array}
if (/.f64 (*.f64 M D) (*.f64 2 d)) < 9.99999999999999983e156Initial program 88.7%
*-commutative88.7%
times-frac88.4%
Simplified88.4%
unpow288.4%
associate-*l*89.2%
div-inv89.2%
associate-*l*88.8%
times-frac88.8%
*-un-lft-identity88.8%
*-commutative88.8%
clear-num88.8%
div-inv88.8%
div-inv88.8%
associate-*l*89.7%
times-frac89.7%
*-un-lft-identity89.7%
*-commutative89.7%
clear-num89.7%
div-inv89.7%
associate-*l*88.8%
Applied egg-rr94.4%
Taylor expanded in M around 0 94.5%
if 9.99999999999999983e156 < (/.f64 (*.f64 M D) (*.f64 2 d)) Initial program 35.5%
*-commutative35.5%
times-frac39.1%
Simplified39.1%
Applied egg-rr39.1%
Taylor expanded in d around 0 29.2%
associate-/l*29.1%
*-commutative29.1%
unpow229.1%
associate-*r*29.1%
unpow229.1%
Simplified29.1%
Taylor expanded in l around 0 18.1%
+-commutative18.1%
*-commutative18.1%
mul-1-neg18.1%
unsub-neg18.1%
*-commutative18.1%
log-div29.2%
associate-*r/29.2%
associate-/l*29.1%
unpow229.1%
associate-*r*29.1%
associate-/r*29.1%
associate-/r/26.2%
Simplified25.9%
Final simplification87.0%
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.8e-117) (* w0 (sqrt (- 1.0 (/ (* 0.25 (* (/ (* (* M D) (* M D)) d) (/ h d))) l)))) (* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ M d) (/ D 2.0)) 2.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 (M <= 2.8e-117) {
tmp = w0 * sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / d))) / l)));
} else {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((M / d) * (D / 2.0)), 2.0))));
}
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.8d-117) then
tmp = w0 * sqrt((1.0d0 - ((0.25d0 * ((((m * d) * (m * d)) / d_1) * (h / d_1))) / l)))
else
tmp = w0 * sqrt((1.0d0 - ((h / l) * (((m / d_1) * (d / 2.0d0)) ** 2.0d0))))
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.8e-117) {
tmp = w0 * Math.sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / d))) / l)));
} else {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((M / d) * (D / 2.0)), 2.0))));
}
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.8e-117: tmp = w0 * math.sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / d))) / l))) else: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((M / d) * (D / 2.0)), 2.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 (M <= 2.8e-117) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.25 * Float64(Float64(Float64(Float64(M * D) * Float64(M * D)) / d) * Float64(h / d))) / l)))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(M / d) * Float64(D / 2.0)) ^ 2.0))))); 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.8e-117)
tmp = w0 * sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / d))) / l)));
else
tmp = w0 * sqrt((1.0 - ((h / l) * (((M / d) * (D / 2.0)) ^ 2.0))));
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.8e-117], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.25 * N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / d), $MachinePrecision] * N[(D / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 2.8 \cdot 10^{-117}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{d} \cdot \frac{h}{d}\right)}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{M}{d} \cdot \frac{D}{2}\right)}^{2}}\\
\end{array}
\end{array}
if M < 2.8e-117Initial program 84.3%
*-commutative84.3%
times-frac84.3%
Simplified84.3%
unpow284.3%
associate-*l*85.4%
div-inv85.4%
associate-*l*84.9%
times-frac84.9%
*-un-lft-identity84.9%
*-commutative84.9%
clear-num84.9%
div-inv84.9%
div-inv84.9%
associate-*l*86.0%
times-frac86.0%
*-un-lft-identity86.0%
*-commutative86.0%
clear-num86.0%
div-inv86.0%
associate-*l*84.3%
Applied egg-rr89.8%
Taylor expanded in M around 0 89.8%
Taylor expanded in D around 0 59.4%
associate-*r*59.4%
unpow259.4%
times-frac66.8%
unpow266.8%
unpow266.8%
swap-sqr84.8%
Simplified84.8%
if 2.8e-117 < M Initial program 79.8%
*-commutative79.8%
times-frac79.8%
Simplified79.8%
Final simplification83.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 (sqrt (- 1.0 (/ (* h (pow (* 0.5 (/ (* M D) 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((0.5 * ((M * D) / 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 * ((0.5d0 * ((m * d) / 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((0.5 * ((M * D) / 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((0.5 * ((M * D) / 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(0.5 * Float64(Float64(M * D) / 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 * ((0.5 * ((M * D) / 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[(0.5 * N[(N[(M * D), $MachinePrecision] / d), $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(0.5 \cdot \frac{M \cdot D}{d}\right)}^{2}}{\ell}}
\end{array}
Initial program 82.9%
*-commutative82.9%
times-frac83.0%
Simplified83.0%
unpow283.0%
associate-*l*84.2%
div-inv84.2%
associate-*l*83.4%
times-frac83.4%
*-un-lft-identity83.4%
*-commutative83.4%
clear-num83.4%
div-inv83.4%
div-inv83.4%
associate-*l*84.6%
times-frac84.6%
*-un-lft-identity84.6%
*-commutative84.6%
clear-num84.6%
div-inv84.6%
associate-*l*83.3%
Applied egg-rr88.4%
Taylor expanded in M around 0 88.1%
Final simplification88.1%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= d 3.1e-153)
(* w0 (sqrt (+ 1.0 (* -0.25 (* (* (/ M d) (/ (* M h) d)) (/ (* D D) l))))))
(if (<= d 7e+106)
(* w0 (sqrt (- 1.0 (* (/ (* D (* h (* D (* M M)))) l) (/ (/ 0.25 d) d)))))
(* w0 (+ 1.0 (* (* (/ (* M h) (/ l M)) (* (/ D d) (/ D 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 (d <= 3.1e-153) {
tmp = w0 * sqrt((1.0 + (-0.25 * (((M / d) * ((M * h) / d)) * ((D * D) / l)))));
} else if (d <= 7e+106) {
tmp = w0 * sqrt((1.0 - (((D * (h * (D * (M * M)))) / l) * ((0.25 / d) / d))));
} else {
tmp = w0 * (1.0 + ((((M * h) / (l / M)) * ((D / d) * (D / 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 (d_1 <= 3.1d-153) then
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * (((m / d_1) * ((m * h) / d_1)) * ((d * d) / l)))))
else if (d_1 <= 7d+106) then
tmp = w0 * sqrt((1.0d0 - (((d * (h * (d * (m * m)))) / l) * ((0.25d0 / d_1) / d_1))))
else
tmp = w0 * (1.0d0 + ((((m * h) / (l / m)) * ((d / d_1) * (d / 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 (d <= 3.1e-153) {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * (((M / d) * ((M * h) / d)) * ((D * D) / l)))));
} else if (d <= 7e+106) {
tmp = w0 * Math.sqrt((1.0 - (((D * (h * (D * (M * M)))) / l) * ((0.25 / d) / d))));
} else {
tmp = w0 * (1.0 + ((((M * h) / (l / M)) * ((D / d) * (D / 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 d <= 3.1e-153: tmp = w0 * math.sqrt((1.0 + (-0.25 * (((M / d) * ((M * h) / d)) * ((D * D) / l))))) elif d <= 7e+106: tmp = w0 * math.sqrt((1.0 - (((D * (h * (D * (M * M)))) / l) * ((0.25 / d) / d)))) else: tmp = w0 * (1.0 + ((((M * h) / (l / M)) * ((D / d) * (D / 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 (d <= 3.1e-153) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(Float64(M / d) * Float64(Float64(M * h) / d)) * Float64(Float64(D * D) / l)))))); elseif (d <= 7e+106) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(D * Float64(h * Float64(D * Float64(M * M)))) / l) * Float64(Float64(0.25 / d) / d))))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(Float64(M * h) / Float64(l / M)) * Float64(Float64(D / d) * Float64(D / 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 (d <= 3.1e-153)
tmp = w0 * sqrt((1.0 + (-0.25 * (((M / d) * ((M * h) / d)) * ((D * D) / l)))));
elseif (d <= 7e+106)
tmp = w0 * sqrt((1.0 - (((D * (h * (D * (M * M)))) / l) * ((0.25 / d) / d))));
else
tmp = w0 * (1.0 + ((((M * h) / (l / M)) * ((D / d) * (D / 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[d, 3.1e-153], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(N[(M / d), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7e+106], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(D * N[(h * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(0.25 / d), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(N[(N[(M * h), $MachinePrecision] / N[(l / M), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(D / d), $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}\;d \leq 3.1 \cdot 10^{-153}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\left(\frac{M}{d} \cdot \frac{M \cdot h}{d}\right) \cdot \frac{D \cdot D}{\ell}\right)}\\
\mathbf{elif}\;d \leq 7 \cdot 10^{+106}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{D \cdot \left(h \cdot \left(D \cdot \left(M \cdot M\right)\right)\right)}{\ell} \cdot \frac{\frac{0.25}{d}}{d}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \left(\frac{M \cdot h}{\frac{\ell}{M}} \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if d < 3.09999999999999995e-153Initial program 81.7%
*-commutative81.7%
times-frac81.2%
Simplified81.2%
Applied egg-rr81.4%
Taylor expanded in w0 around 0 50.4%
associate-*r/50.4%
*-commutative50.4%
associate-*r/50.4%
times-frac51.8%
unpow251.8%
associate-*r*54.1%
unpow254.1%
unpow254.1%
associate-/l*57.9%
*-commutative57.9%
times-frac71.7%
associate-/l*67.3%
Simplified67.3%
if 3.09999999999999995e-153 < d < 6.99999999999999962e106Initial program 82.7%
*-commutative82.7%
times-frac82.7%
Simplified82.7%
Taylor expanded in M around 0 64.6%
associate-*r/64.6%
*-commutative64.6%
associate-/r*74.6%
*-commutative74.6%
*-commutative74.6%
associate-*l*74.5%
unpow274.5%
unpow274.5%
unpow274.5%
Simplified74.5%
pow1/274.5%
associate-/l/64.6%
associate-*r*64.6%
*-commutative64.6%
*-commutative64.6%
associate-*l*69.0%
associate-*l*69.1%
*-commutative69.1%
Applied egg-rr69.1%
*-un-lft-identity69.1%
unpow1/269.0%
times-frac80.9%
associate-*r*86.6%
Applied egg-rr86.6%
*-lft-identity86.6%
*-commutative86.6%
*-commutative86.6%
associate-*l*80.9%
associate-*r*79.0%
unpow279.0%
associate-*r*79.0%
unpow279.0%
associate-/r*79.0%
Simplified79.0%
if 6.99999999999999962e106 < d Initial program 87.3%
*-commutative87.3%
times-frac89.5%
Simplified89.5%
Taylor expanded in M around 0 55.4%
*-commutative55.4%
unpow255.4%
unpow255.4%
unpow255.4%
Simplified55.4%
Taylor expanded in D around 0 55.4%
times-frac51.1%
unpow251.1%
associate-*r*55.5%
unpow255.5%
unpow255.5%
associate-/l*59.7%
*-commutative59.7%
times-frac64.3%
associate-/l*60.0%
Simplified60.0%
Taylor expanded in M around 0 55.4%
*-commutative55.4%
*-commutative55.4%
times-frac53.3%
unpow253.3%
associate-*r*57.5%
*-commutative57.5%
associate-/l*57.5%
*-commutative57.5%
unpow257.5%
unpow257.5%
times-frac70.6%
Simplified70.6%
Final simplification70.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 9e-58)
(* w0 (sqrt (- 1.0 (/ (* 0.25 (* (/ (* (* M D) (* M D)) d) (/ h d))) l))))
(*
w0
(pow (- 1.0 (* 0.25 (* (* (/ D d) (/ D d)) (* M (/ M (/ l h)))))) 0.5))))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 <= 9e-58) {
tmp = w0 * sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / d))) / l)));
} else {
tmp = w0 * pow((1.0 - (0.25 * (((D / d) * (D / d)) * (M * (M / (l / h)))))), 0.5);
}
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 <= 9d-58) then
tmp = w0 * sqrt((1.0d0 - ((0.25d0 * ((((m * d) * (m * d)) / d_1) * (h / d_1))) / l)))
else
tmp = w0 * ((1.0d0 - (0.25d0 * (((d / d_1) * (d / d_1)) * (m * (m / (l / h)))))) ** 0.5d0)
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 <= 9e-58) {
tmp = w0 * Math.sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / d))) / l)));
} else {
tmp = w0 * Math.pow((1.0 - (0.25 * (((D / d) * (D / d)) * (M * (M / (l / h)))))), 0.5);
}
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 <= 9e-58: tmp = w0 * math.sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / d))) / l))) else: tmp = w0 * math.pow((1.0 - (0.25 * (((D / d) * (D / d)) * (M * (M / (l / h)))))), 0.5) 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 <= 9e-58) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.25 * Float64(Float64(Float64(Float64(M * D) * Float64(M * D)) / d) * Float64(h / d))) / l)))); else tmp = Float64(w0 * (Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(M * Float64(M / Float64(l / h)))))) ^ 0.5)); 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 <= 9e-58)
tmp = w0 * sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / d))) / l)));
else
tmp = w0 * ((1.0 - (0.25 * (((D / d) * (D / d)) * (M * (M / (l / h)))))) ^ 0.5);
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, 9e-58], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.25 * N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Power[N[(1.0 - N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M * N[(M / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 9 \cdot 10^{-58}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{d} \cdot \frac{h}{d}\right)}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot {\left(1 - 0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(M \cdot \frac{M}{\frac{\ell}{h}}\right)\right)\right)}^{0.5}\\
\end{array}
\end{array}
if M < 9.0000000000000006e-58Initial program 83.1%
*-commutative83.1%
times-frac83.2%
Simplified83.2%
unpow283.2%
associate-*l*84.7%
div-inv84.7%
associate-*l*83.7%
times-frac83.7%
*-un-lft-identity83.7%
*-commutative83.7%
clear-num83.7%
div-inv83.7%
div-inv83.7%
associate-*l*84.8%
times-frac84.8%
*-un-lft-identity84.8%
*-commutative84.8%
clear-num84.7%
div-inv84.7%
associate-*l*83.2%
Applied egg-rr89.2%
Taylor expanded in M around 0 89.2%
Taylor expanded in D around 0 61.0%
associate-*r*61.0%
unpow261.0%
times-frac67.8%
unpow267.8%
unpow267.8%
swap-sqr84.2%
Simplified84.2%
if 9.0000000000000006e-58 < M Initial program 82.2%
*-commutative82.2%
times-frac82.2%
Simplified82.2%
Taylor expanded in M around 0 49.9%
associate-*r/49.9%
*-commutative49.9%
associate-/r*51.7%
*-commutative51.7%
*-commutative51.7%
associate-*l*58.2%
unpow258.2%
unpow258.2%
unpow258.2%
Simplified58.2%
pow1/258.4%
associate-/l/56.5%
associate-*r*49.9%
*-commutative49.9%
*-commutative49.9%
associate-*l*55.4%
associate-*l*58.8%
*-commutative58.8%
Applied egg-rr58.8%
Taylor expanded in D around 0 49.9%
*-commutative49.9%
*-commutative49.9%
times-frac50.0%
unpow250.0%
associate-*r*53.3%
*-commutative53.3%
associate-/l*58.4%
*-commutative58.4%
unpow258.4%
unpow258.4%
times-frac70.4%
Simplified70.4%
associate-/r/72.1%
*-commutative72.1%
Applied egg-rr72.1%
*-commutative72.1%
associate-/l*72.3%
Simplified72.3%
Final simplification81.4%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= d 4e+119)
(* w0 (sqrt (- 1.0 (/ (* 0.25 (* (/ (* (* M D) (* M D)) d) (/ h d))) l))))
(*
w0
(pow (- 1.0 (* 0.25 (* (/ (* M h) (/ l M)) (* (/ D d) (/ D d))))) 0.5))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 4e+119) {
tmp = w0 * sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / d))) / l)));
} else {
tmp = w0 * pow((1.0 - (0.25 * (((M * h) / (l / M)) * ((D / d) * (D / d))))), 0.5);
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 4d+119) then
tmp = w0 * sqrt((1.0d0 - ((0.25d0 * ((((m * d) * (m * d)) / d_1) * (h / d_1))) / l)))
else
tmp = w0 * ((1.0d0 - (0.25d0 * (((m * h) / (l / m)) * ((d / d_1) * (d / d_1))))) ** 0.5d0)
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 4e+119) {
tmp = w0 * Math.sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / d))) / l)));
} else {
tmp = w0 * Math.pow((1.0 - (0.25 * (((M * h) / (l / M)) * ((D / d) * (D / d))))), 0.5);
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 4e+119: tmp = w0 * math.sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / d))) / l))) else: tmp = w0 * math.pow((1.0 - (0.25 * (((M * h) / (l / M)) * ((D / d) * (D / d))))), 0.5) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 4e+119) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.25 * Float64(Float64(Float64(Float64(M * D) * Float64(M * D)) / d) * Float64(h / d))) / l)))); else tmp = Float64(w0 * (Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(M * h) / Float64(l / M)) * Float64(Float64(D / d) * Float64(D / d))))) ^ 0.5)); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 4e+119)
tmp = w0 * sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / d))) / l)));
else
tmp = w0 * ((1.0 - (0.25 * (((M * h) / (l / M)) * ((D / d) * (D / d))))) ^ 0.5);
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 4e+119], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.25 * N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Power[N[(1.0 - N[(0.25 * N[(N[(N[(M * h), $MachinePrecision] / N[(l / M), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 4 \cdot 10^{+119}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{d} \cdot \frac{h}{d}\right)}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot {\left(1 - 0.25 \cdot \left(\frac{M \cdot h}{\frac{\ell}{M}} \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\right)}^{0.5}\\
\end{array}
\end{array}
if d < 3.99999999999999978e119Initial program 82.5%
*-commutative82.5%
times-frac82.1%
Simplified82.1%
unpow282.1%
associate-*l*83.5%
div-inv83.5%
associate-*l*82.6%
times-frac82.6%
*-un-lft-identity82.6%
*-commutative82.6%
clear-num82.6%
div-inv82.6%
div-inv82.6%
associate-*l*84.0%
times-frac84.0%
*-un-lft-identity84.0%
*-commutative84.0%
clear-num84.0%
div-inv84.0%
associate-*l*82.5%
Applied egg-rr86.8%
Taylor expanded in M around 0 86.8%
Taylor expanded in D around 0 58.6%
associate-*r*60.0%
unpow260.0%
times-frac66.2%
unpow266.2%
unpow266.2%
swap-sqr82.5%
Simplified82.5%
if 3.99999999999999978e119 < d Initial program 85.2%
*-commutative85.2%
times-frac87.7%
Simplified87.7%
Taylor expanded in M around 0 60.0%
associate-*r/60.0%
*-commutative60.0%
associate-/r*60.0%
*-commutative60.0%
*-commutative60.0%
associate-*l*52.5%
unpow252.5%
unpow252.5%
unpow252.5%
Simplified52.5%
pow1/252.6%
associate-/l/52.5%
associate-*r*60.0%
*-commutative60.0%
*-commutative60.0%
associate-*l*67.5%
associate-*l*70.2%
*-commutative70.2%
Applied egg-rr70.2%
Taylor expanded in D around 0 60.0%
*-commutative60.0%
*-commutative60.0%
times-frac57.5%
unpow257.5%
associate-*r*60.0%
*-commutative60.0%
associate-/l*60.0%
*-commutative60.0%
unpow260.0%
unpow260.0%
times-frac77.6%
Simplified77.6%
Final simplification81.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 2.15e-35) (* w0 (sqrt (- 1.0 (/ (* 0.25 (* (/ (* (* M D) (* M D)) d) (/ h d))) l)))) (* w0 (+ 1.0 (* (* (/ (* M h) (/ l M)) (* (/ D d) (/ D 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 <= 2.15e-35) {
tmp = w0 * sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / d))) / l)));
} else {
tmp = w0 * (1.0 + ((((M * h) / (l / M)) * ((D / d) * (D / 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 <= 2.15d-35) then
tmp = w0 * sqrt((1.0d0 - ((0.25d0 * ((((m * d) * (m * d)) / d_1) * (h / d_1))) / l)))
else
tmp = w0 * (1.0d0 + ((((m * h) / (l / m)) * ((d / d_1) * (d / 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 <= 2.15e-35) {
tmp = w0 * Math.sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / d))) / l)));
} else {
tmp = w0 * (1.0 + ((((M * h) / (l / M)) * ((D / d) * (D / 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 <= 2.15e-35: tmp = w0 * math.sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / d))) / l))) else: tmp = w0 * (1.0 + ((((M * h) / (l / M)) * ((D / d) * (D / 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 <= 2.15e-35) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.25 * Float64(Float64(Float64(Float64(M * D) * Float64(M * D)) / d) * Float64(h / d))) / l)))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(Float64(M * h) / Float64(l / M)) * Float64(Float64(D / d) * Float64(D / 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 <= 2.15e-35)
tmp = w0 * sqrt((1.0 - ((0.25 * ((((M * D) * (M * D)) / d) * (h / d))) / l)));
else
tmp = w0 * (1.0 + ((((M * h) / (l / M)) * ((D / d) * (D / 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, 2.15e-35], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.25 * N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(N[(N[(M * h), $MachinePrecision] / N[(l / M), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(D / d), $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 2.15 \cdot 10^{-35}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{d} \cdot \frac{h}{d}\right)}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \left(\frac{M \cdot h}{\frac{\ell}{M}} \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if M < 2.1500000000000001e-35Initial program 83.8%
*-commutative83.8%
times-frac83.9%
Simplified83.9%
unpow283.9%
associate-*l*85.3%
div-inv85.3%
associate-*l*84.4%
times-frac84.4%
*-un-lft-identity84.4%
*-commutative84.4%
clear-num84.3%
div-inv84.3%
div-inv84.3%
associate-*l*85.3%
times-frac85.3%
*-un-lft-identity85.3%
*-commutative85.3%
clear-num85.3%
div-inv85.3%
associate-*l*83.8%
Applied egg-rr89.6%
Taylor expanded in M around 0 89.6%
Taylor expanded in D around 0 62.5%
associate-*r*62.5%
unpow262.5%
times-frac69.0%
unpow269.0%
unpow269.0%
swap-sqr84.8%
Simplified84.8%
if 2.1500000000000001e-35 < M Initial program 79.4%
*-commutative79.4%
times-frac79.4%
Simplified79.4%
Taylor expanded in M around 0 44.0%
*-commutative44.0%
unpow244.0%
unpow244.0%
unpow244.0%
Simplified44.0%
Taylor expanded in D around 0 44.0%
times-frac42.1%
unpow242.1%
associate-*r*46.0%
unpow246.0%
unpow246.0%
associate-/l*52.0%
*-commutative52.0%
times-frac64.2%
associate-/l*58.1%
Simplified58.1%
Taylor expanded in M around 0 44.0%
*-commutative44.0%
*-commutative44.0%
times-frac42.1%
unpow242.1%
associate-*r*46.0%
*-commutative46.0%
associate-/l*53.8%
*-commutative53.8%
unpow253.8%
unpow253.8%
times-frac66.0%
Simplified66.0%
Final simplification81.0%
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 (fma -0.125 (* D (/ (* (* h (/ M d)) (/ (* M w0) d)) (/ l D))) w0))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
return fma(-0.125, (D * (((h * (M / d)) * ((M * w0) / d)) / (l / D))), w0);
}
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return fma(-0.125, Float64(D * Float64(Float64(Float64(h * Float64(M / d)) * Float64(Float64(M * w0) / d)) / Float64(l / D))), 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_] := N[(-0.125 * N[(D * N[(N[(N[(h * N[(M / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * w0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] / N[(l / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\mathsf{fma}\left(-0.125, D \cdot \frac{\left(h \cdot \frac{M}{d}\right) \cdot \frac{M \cdot w0}{d}}{\frac{\ell}{D}}, w0\right)
\end{array}
Initial program 82.9%
*-commutative82.9%
times-frac83.0%
Simplified83.0%
unpow283.0%
associate-*l*84.2%
div-inv84.2%
associate-*l*83.4%
times-frac83.4%
*-un-lft-identity83.4%
*-commutative83.4%
clear-num83.4%
div-inv83.4%
div-inv83.4%
associate-*l*84.6%
times-frac84.6%
*-un-lft-identity84.6%
*-commutative84.6%
clear-num84.6%
div-inv84.6%
associate-*l*83.3%
Applied egg-rr88.4%
Taylor expanded in M around 0 88.1%
Taylor expanded in D around 0 52.2%
fma-def52.2%
Simplified72.0%
Final simplification72.0%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= d 1.6e+46) (* w0 (+ 1.0 (* -0.125 (* (* (/ M d) (/ (* M h) d)) (* D (/ D l)))))) 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 (d <= 1.6e+46) {
tmp = w0 * (1.0 + (-0.125 * (((M / d) * ((M * h) / d)) * (D * (D / l)))));
} 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 (d_1 <= 1.6d+46) then
tmp = w0 * (1.0d0 + ((-0.125d0) * (((m / d_1) * ((m * h) / d_1)) * (d * (d / l)))))
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 (d <= 1.6e+46) {
tmp = w0 * (1.0 + (-0.125 * (((M / d) * ((M * h) / d)) * (D * (D / l)))));
} 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 d <= 1.6e+46: tmp = w0 * (1.0 + (-0.125 * (((M / d) * ((M * h) / d)) * (D * (D / l))))) 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 (d <= 1.6e+46) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(Float64(M / d) * Float64(Float64(M * h) / d)) * Float64(D * Float64(D / l)))))); 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 (d <= 1.6e+46)
tmp = w0 * (1.0 + (-0.125 * (((M / d) * ((M * h) / d)) * (D * (D / l)))));
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[d, 1.6e+46], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(N[(M / d), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(D * N[(D / l), $MachinePrecision]), $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}\;d \leq 1.6 \cdot 10^{+46}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\left(\frac{M}{d} \cdot \frac{M \cdot h}{d}\right) \cdot \left(D \cdot \frac{D}{\ell}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 1.5999999999999999e46Initial program 81.3%
*-commutative81.3%
times-frac80.9%
Simplified80.9%
Taylor expanded in M around 0 51.0%
*-commutative51.0%
unpow251.0%
unpow251.0%
unpow251.0%
Simplified51.0%
Taylor expanded in D around 0 51.0%
times-frac53.4%
unpow253.4%
associate-*r*55.0%
unpow255.0%
unpow255.0%
associate-/l*58.6%
*-commutative58.6%
times-frac66.7%
associate-/l*63.1%
Simplified63.1%
associate-/l*66.7%
associate-/r/66.7%
Applied egg-rr66.7%
if 1.5999999999999999e46 < d Initial program 88.2%
*-commutative88.2%
times-frac89.9%
Simplified89.9%
Taylor expanded in M around 0 87.2%
Final simplification71.4%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 2e+49) w0 (* -0.125 (* D (* (/ D (* d d)) (/ (* w0 (* h (* M M))) l))))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2e+49) {
tmp = w0;
} else {
tmp = -0.125 * (D * ((D / (d * d)) * ((w0 * (h * (M * M))) / l)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 2d+49) 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);
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+49) {
tmp = w0;
} else {
tmp = -0.125 * (D * ((D / (d * d)) * ((w0 * (h * (M * M))) / l)));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 2e+49: tmp = w0 else: tmp = -0.125 * (D * ((D / (d * d)) * ((w0 * (h * (M * M))) / l))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 2e+49) tmp = w0; else tmp = Float64(-0.125 * Float64(D * Float64(Float64(D / Float64(d * d)) * Float64(Float64(w0 * Float64(h * Float64(M * M))) / l)))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 2e+49)
tmp = w0;
else
tmp = -0.125 * (D * ((D / (d * d)) * ((w0 * (h * (M * M))) / l)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 2e+49], w0, N[(-0.125 * N[(D * N[(N[(D / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(N[(w0 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 2 \cdot 10^{+49}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(D \cdot \left(\frac{D}{d \cdot d} \cdot \frac{w0 \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\ell}\right)\right)\\
\end{array}
\end{array}
if M < 1.99999999999999989e49Initial program 82.9%
*-commutative82.9%
times-frac83.4%
Simplified83.4%
Taylor expanded in M around 0 69.7%
if 1.99999999999999989e49 < M Initial program 82.9%
*-commutative82.9%
times-frac79.9%
Simplified79.9%
Taylor expanded in M around 0 34.2%
*-commutative34.2%
unpow234.2%
unpow234.2%
unpow234.2%
Simplified34.2%
Taylor expanded in D around 0 34.2%
times-frac31.2%
unpow231.2%
associate-*r*37.3%
unpow237.3%
unpow237.3%
associate-/l*43.6%
*-commutative43.6%
times-frac62.4%
associate-/l*56.1%
Simplified56.1%
Taylor expanded in M around inf 19.7%
*-commutative19.7%
times-frac19.6%
unpow219.6%
associate-/l*23.0%
associate-*l/23.2%
associate-*r*23.2%
unpow223.2%
times-frac23.6%
*-commutative23.6%
unpow223.6%
associate-*r*23.8%
associate-/r/23.7%
Simplified24.5%
Taylor expanded in h around 0 23.3%
*-commutative23.3%
times-frac23.4%
unpow223.4%
*-commutative23.4%
*-commutative23.4%
unpow223.4%
Simplified23.4%
Final simplification63.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 5.4e+48) w0 (* -0.125 (* D (* (/ (* D w0) l) (/ (* h (* M M)) (* d 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 <= 5.4e+48) {
tmp = w0;
} else {
tmp = -0.125 * (D * (((D * w0) / l) * ((h * (M * M)) / (d * 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 <= 5.4d+48) then
tmp = w0
else
tmp = (-0.125d0) * (d * (((d * w0) / l) * ((h * (m * m)) / (d_1 * 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 <= 5.4e+48) {
tmp = w0;
} else {
tmp = -0.125 * (D * (((D * w0) / l) * ((h * (M * M)) / (d * 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 <= 5.4e+48: tmp = w0 else: tmp = -0.125 * (D * (((D * w0) / l) * ((h * (M * M)) / (d * 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 <= 5.4e+48) tmp = w0; else tmp = Float64(-0.125 * Float64(D * Float64(Float64(Float64(D * w0) / l) * Float64(Float64(h * Float64(M * M)) / Float64(d * 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 <= 5.4e+48)
tmp = w0;
else
tmp = -0.125 * (D * (((D * w0) / l) * ((h * (M * M)) / (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: 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, 5.4e+48], w0, N[(-0.125 * N[(D * N[(N[(N[(D * w0), $MachinePrecision] / l), $MachinePrecision] * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d * d), $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 5.4 \cdot 10^{+48}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(D \cdot \left(\frac{D \cdot w0}{\ell} \cdot \frac{h \cdot \left(M \cdot M\right)}{d \cdot d}\right)\right)\\
\end{array}
\end{array}
if M < 5.40000000000000007e48Initial program 82.9%
*-commutative82.9%
times-frac83.4%
Simplified83.4%
Taylor expanded in M around 0 69.7%
if 5.40000000000000007e48 < M Initial program 82.9%
*-commutative82.9%
times-frac79.9%
Simplified79.9%
Taylor expanded in M around 0 34.2%
*-commutative34.2%
unpow234.2%
unpow234.2%
unpow234.2%
Simplified34.2%
Taylor expanded in D around 0 34.2%
times-frac31.2%
unpow231.2%
associate-*r*37.3%
unpow237.3%
unpow237.3%
associate-/l*43.6%
*-commutative43.6%
times-frac62.4%
associate-/l*56.1%
Simplified56.1%
Taylor expanded in M around inf 19.7%
*-commutative19.7%
times-frac19.6%
unpow219.6%
associate-/l*23.0%
associate-*l/23.2%
associate-*r*23.2%
unpow223.2%
times-frac23.6%
*-commutative23.6%
unpow223.6%
associate-*r*23.8%
associate-/r/23.7%
Simplified24.5%
Taylor expanded in h around 0 23.3%
associate-*r*23.2%
*-commutative23.2%
times-frac23.2%
unpow223.2%
unpow223.2%
Simplified23.2%
Final simplification63.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 (<= d 5.2e-184) (* -0.125 (* D (/ (* (* D h) (* (/ M d) (* w0 (/ M d)))) l))) 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 (d <= 5.2e-184) {
tmp = -0.125 * (D * (((D * h) * ((M / d) * (w0 * (M / d)))) / l));
} 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 (d_1 <= 5.2d-184) then
tmp = (-0.125d0) * (d * (((d * h) * ((m / d_1) * (w0 * (m / d_1)))) / l))
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 (d <= 5.2e-184) {
tmp = -0.125 * (D * (((D * h) * ((M / d) * (w0 * (M / d)))) / l));
} 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 d <= 5.2e-184: tmp = -0.125 * (D * (((D * h) * ((M / d) * (w0 * (M / d)))) / l)) 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 (d <= 5.2e-184) tmp = Float64(-0.125 * Float64(D * Float64(Float64(Float64(D * h) * Float64(Float64(M / d) * Float64(w0 * Float64(M / d)))) / l))); 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 (d <= 5.2e-184)
tmp = -0.125 * (D * (((D * h) * ((M / d) * (w0 * (M / d)))) / l));
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[d, 5.2e-184], N[(-0.125 * N[(D * N[(N[(N[(D * h), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(w0 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 5.2 \cdot 10^{-184}:\\
\;\;\;\;-0.125 \cdot \left(D \cdot \frac{\left(D \cdot h\right) \cdot \left(\frac{M}{d} \cdot \left(w0 \cdot \frac{M}{d}\right)\right)}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 5.19999999999999957e-184Initial program 81.5%
*-commutative81.5%
times-frac80.9%
Simplified80.9%
Taylor expanded in M around 0 51.1%
*-commutative51.1%
unpow251.1%
unpow251.1%
unpow251.1%
Simplified51.1%
Taylor expanded in D around 0 51.1%
times-frac53.0%
unpow253.0%
associate-*r*55.0%
unpow255.0%
unpow255.0%
associate-/l*59.1%
*-commutative59.1%
times-frac68.6%
associate-/l*64.5%
Simplified64.5%
Taylor expanded in M around inf 16.5%
*-commutative16.5%
times-frac15.2%
unpow215.2%
associate-/l*16.0%
associate-*l/17.9%
associate-*r*17.8%
unpow217.8%
times-frac18.9%
*-commutative18.9%
unpow218.9%
associate-*r*19.7%
associate-/r/19.4%
Simplified19.9%
*-un-lft-identity19.9%
associate-/r/21.3%
associate-*l*21.3%
associate-/l*21.3%
Applied egg-rr21.3%
*-lft-identity21.3%
associate-*l/21.4%
*-commutative21.4%
associate-*r*19.8%
associate-/r/19.8%
Simplified19.8%
if 5.19999999999999957e-184 < d Initial program 84.8%
*-commutative84.8%
times-frac85.7%
Simplified85.7%
Taylor expanded in M around 0 73.1%
Final simplification42.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 (<= d 2.15e-184) (* -0.125 (* D (/ (* (* h (/ M d)) (/ w0 (/ d M))) (/ l D)))) w0))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 2.15e-184) {
tmp = -0.125 * (D * (((h * (M / d)) * (w0 / (d / M))) / (l / D)));
} else {
tmp = w0;
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 2.15d-184) then
tmp = (-0.125d0) * (d * (((h * (m / d_1)) * (w0 / (d_1 / m))) / (l / d)))
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 (d <= 2.15e-184) {
tmp = -0.125 * (D * (((h * (M / d)) * (w0 / (d / M))) / (l / D)));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 2.15e-184: tmp = -0.125 * (D * (((h * (M / d)) * (w0 / (d / M))) / (l / D))) else: tmp = w0 return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 2.15e-184) tmp = Float64(-0.125 * Float64(D * Float64(Float64(Float64(h * Float64(M / d)) * Float64(w0 / Float64(d / M))) / Float64(l / D)))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 2.15e-184)
tmp = -0.125 * (D * (((h * (M / d)) * (w0 / (d / M))) / (l / D)));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 2.15e-184], N[(-0.125 * N[(D * N[(N[(N[(h * N[(M / d), $MachinePrecision]), $MachinePrecision] * N[(w0 / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l / D), $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}\;d \leq 2.15 \cdot 10^{-184}:\\
\;\;\;\;-0.125 \cdot \left(D \cdot \frac{\left(h \cdot \frac{M}{d}\right) \cdot \frac{w0}{\frac{d}{M}}}{\frac{\ell}{D}}\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 2.15000000000000003e-184Initial program 81.5%
*-commutative81.5%
times-frac80.9%
Simplified80.9%
Taylor expanded in M around 0 51.1%
*-commutative51.1%
unpow251.1%
unpow251.1%
unpow251.1%
Simplified51.1%
Taylor expanded in D around 0 51.1%
times-frac53.0%
unpow253.0%
associate-*r*55.0%
unpow255.0%
unpow255.0%
associate-/l*59.1%
*-commutative59.1%
times-frac68.6%
associate-/l*64.5%
Simplified64.5%
Taylor expanded in M around inf 16.5%
*-commutative16.5%
times-frac15.2%
unpow215.2%
associate-/l*16.0%
associate-*l/17.9%
associate-*r*17.8%
unpow217.8%
times-frac18.9%
*-commutative18.9%
unpow218.9%
associate-*r*19.7%
associate-/r/19.4%
Simplified19.9%
Taylor expanded in M around 0 19.9%
associate-/l*20.0%
Simplified20.0%
if 2.15000000000000003e-184 < d Initial program 84.8%
*-commutative84.8%
times-frac85.7%
Simplified85.7%
Taylor expanded in M around 0 73.1%
Final simplification42.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 (<= d 2.7e-184) (* -0.125 (* D (/ (* (* h (/ M d)) (/ (* M w0) d)) (/ l D)))) w0))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 2.7e-184) {
tmp = -0.125 * (D * (((h * (M / d)) * ((M * w0) / d)) / (l / D)));
} else {
tmp = w0;
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 2.7d-184) then
tmp = (-0.125d0) * (d * (((h * (m / d_1)) * ((m * w0) / d_1)) / (l / d)))
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 (d <= 2.7e-184) {
tmp = -0.125 * (D * (((h * (M / d)) * ((M * w0) / d)) / (l / D)));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 2.7e-184: tmp = -0.125 * (D * (((h * (M / d)) * ((M * w0) / d)) / (l / D))) else: tmp = w0 return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 2.7e-184) tmp = Float64(-0.125 * Float64(D * Float64(Float64(Float64(h * Float64(M / d)) * Float64(Float64(M * w0) / d)) / Float64(l / D)))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 2.7e-184)
tmp = -0.125 * (D * (((h * (M / d)) * ((M * w0) / d)) / (l / D)));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 2.7e-184], N[(-0.125 * N[(D * N[(N[(N[(h * N[(M / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * w0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] / N[(l / D), $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}\;d \leq 2.7 \cdot 10^{-184}:\\
\;\;\;\;-0.125 \cdot \left(D \cdot \frac{\left(h \cdot \frac{M}{d}\right) \cdot \frac{M \cdot w0}{d}}{\frac{\ell}{D}}\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 2.7000000000000001e-184Initial program 81.5%
*-commutative81.5%
times-frac80.9%
Simplified80.9%
Taylor expanded in M around 0 51.1%
*-commutative51.1%
unpow251.1%
unpow251.1%
unpow251.1%
Simplified51.1%
Taylor expanded in D around 0 51.1%
times-frac53.0%
unpow253.0%
associate-*r*55.0%
unpow255.0%
unpow255.0%
associate-/l*59.1%
*-commutative59.1%
times-frac68.6%
associate-/l*64.5%
Simplified64.5%
Taylor expanded in M around inf 16.5%
*-commutative16.5%
times-frac15.2%
unpow215.2%
associate-/l*16.0%
associate-*l/17.9%
associate-*r*17.8%
unpow217.8%
times-frac18.9%
*-commutative18.9%
unpow218.9%
associate-*r*19.7%
associate-/r/19.4%
Simplified19.9%
if 2.7000000000000001e-184 < d Initial program 84.8%
*-commutative84.8%
times-frac85.7%
Simplified85.7%
Taylor expanded in M around 0 73.1%
Final simplification42.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 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 82.9%
*-commutative82.9%
times-frac83.0%
Simplified83.0%
Taylor expanded in M around 0 68.4%
Final simplification68.4%
herbie shell --seed 2023217
(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))))))