
(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 12 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) -2e-30) (* w0 (sqrt (+ 1.0 (/ -1.0 (/ l (* h (pow (* (/ M d) (* D 0.5)) 2.0))))))) (* w0 (+ 1.0 (* (/ (* D (* D (* (/ M d) (/ (* h M) d)))) l) -0.125)))))
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) <= -2e-30) {
tmp = w0 * sqrt((1.0 + (-1.0 / (l / (h * pow(((M / d) * (D * 0.5)), 2.0))))));
} else {
tmp = w0 * (1.0 + (((D * (D * ((M / d) * ((h * M) / d)))) / l) * -0.125));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if ((h / l) <= (-2d-30)) then
tmp = w0 * sqrt((1.0d0 + ((-1.0d0) / (l / (h * (((m / d_1) * (d * 0.5d0)) ** 2.0d0))))))
else
tmp = w0 * (1.0d0 + (((d * (d * ((m / d_1) * ((h * m) / d_1)))) / l) * (-0.125d0)))
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) <= -2e-30) {
tmp = w0 * Math.sqrt((1.0 + (-1.0 / (l / (h * Math.pow(((M / d) * (D * 0.5)), 2.0))))));
} else {
tmp = w0 * (1.0 + (((D * (D * ((M / d) * ((h * M) / d)))) / l) * -0.125));
}
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) <= -2e-30: tmp = w0 * math.sqrt((1.0 + (-1.0 / (l / (h * math.pow(((M / d) * (D * 0.5)), 2.0)))))) else: tmp = w0 * (1.0 + (((D * (D * ((M / d) * ((h * M) / d)))) / l) * -0.125)) 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) <= -2e-30) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-1.0 / Float64(l / Float64(h * (Float64(Float64(M / d) * Float64(D * 0.5)) ^ 2.0))))))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(D * Float64(D * Float64(Float64(M / d) * Float64(Float64(h * M) / d)))) / l) * -0.125))); 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) <= -2e-30)
tmp = w0 * sqrt((1.0 + (-1.0 / (l / (h * (((M / d) * (D * 0.5)) ^ 2.0))))));
else
tmp = w0 * (1.0 + (((D * (D * ((M / d) * ((h * M) / d)))) / l) * -0.125));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(h / l), $MachinePrecision], -2e-30], N[(w0 * N[Sqrt[N[(1.0 + N[(-1.0 / N[(l / N[(h * N[Power[N[(N[(M / d), $MachinePrecision] * N[(D * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(N[(D * N[(D * N[(N[(M / d), $MachinePrecision] * N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -2 \cdot 10^{-30}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{-1}{\frac{\ell}{h \cdot {\left(\frac{M}{d} \cdot \left(D \cdot 0.5\right)\right)}^{2}}}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \frac{D \cdot \left(D \cdot \left(\frac{M}{d} \cdot \frac{h \cdot M}{d}\right)\right)}{\ell} \cdot -0.125\right)\\
\end{array}
\end{array}
if (/.f64 h l) < -2e-30Initial program 75.0%
times-frac75.0%
Simplified75.0%
associate-*r/81.2%
clear-num81.2%
frac-times81.2%
*-commutative81.2%
frac-times82.3%
div-inv82.3%
metadata-eval82.3%
Applied egg-rr82.3%
if -2e-30 < (/.f64 h l) Initial program 88.3%
times-frac88.3%
Simplified88.3%
Taylor expanded in M around 0 58.1%
associate-*r/58.1%
*-commutative58.1%
associate-*r/58.1%
*-commutative58.1%
times-frac58.8%
unpow258.8%
*-commutative58.8%
unpow258.8%
unpow258.8%
Simplified58.8%
associate-*l/60.1%
times-frac69.0%
Applied egg-rr69.0%
associate-*l*76.7%
Simplified76.7%
Taylor expanded in M around 0 67.9%
unpow267.9%
unpow267.9%
associate-*r*71.6%
times-frac82.9%
Simplified82.9%
Final simplification82.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 (<= (* (/ h l) (pow (/ (* M D) (* d 2.0)) 2.0)) 5e-28) (* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ M d) (/ D 2.0)) 2.0))))) (* w0 (sqrt (- 1.0 (* (/ D d) (* (/ D (/ l (* M (* h M)))) (/ 0.25 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 (((h / l) * pow(((M * D) / (d * 2.0)), 2.0)) <= 5e-28) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((M / d) * (D / 2.0)), 2.0))));
} else {
tmp = w0 * sqrt((1.0 - ((D / d) * ((D / (l / (M * (h * M)))) * (0.25 / 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 (((h / l) * (((m * d) / (d_1 * 2.0d0)) ** 2.0d0)) <= 5d-28) then
tmp = w0 * sqrt((1.0d0 - ((h / l) * (((m / d_1) * (d / 2.0d0)) ** 2.0d0))))
else
tmp = w0 * sqrt((1.0d0 - ((d / d_1) * ((d / (l / (m * (h * m)))) * (0.25d0 / 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 (((h / l) * Math.pow(((M * D) / (d * 2.0)), 2.0)) <= 5e-28) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((M / d) * (D / 2.0)), 2.0))));
} else {
tmp = w0 * Math.sqrt((1.0 - ((D / d) * ((D / (l / (M * (h * M)))) * (0.25 / 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 ((h / l) * math.pow(((M * D) / (d * 2.0)), 2.0)) <= 5e-28: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((M / d) * (D / 2.0)), 2.0)))) else: tmp = w0 * math.sqrt((1.0 - ((D / d) * ((D / (l / (M * (h * M)))) * (0.25 / 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 (Float64(Float64(h / l) * (Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0)) <= 5e-28) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(M / d) * Float64(D / 2.0)) ^ 2.0))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(D / d) * Float64(Float64(D / Float64(l / Float64(M * Float64(h * M)))) * Float64(0.25 / 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 (((h / l) * (((M * D) / (d * 2.0)) ^ 2.0)) <= 5e-28)
tmp = w0 * sqrt((1.0 - ((h / l) * (((M / d) * (D / 2.0)) ^ 2.0))));
else
tmp = w0 * sqrt((1.0 - ((D / d) * ((D / (l / (M * (h * M)))) * (0.25 / 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[N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 5e-28], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / d), $MachinePrecision] * N[(D / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(D / d), $MachinePrecision] * N[(N[(D / N[(l / N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.25 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \leq 5 \cdot 10^{-28}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{M}{d} \cdot \frac{D}{2}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{D}{d} \cdot \left(\frac{D}{\frac{\ell}{M \cdot \left(h \cdot M\right)}} \cdot \frac{0.25}{d}\right)}\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < 5.0000000000000002e-28Initial program 89.4%
*-commutative89.4%
times-frac89.0%
Simplified89.0%
if 5.0000000000000002e-28 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 10.0%
times-frac14.9%
Simplified14.9%
Taylor expanded in M around 0 40.8%
associate-*r/40.8%
*-commutative40.8%
*-commutative40.8%
*-commutative40.8%
associate-*l*45.8%
unpow245.8%
unpow245.8%
swap-sqr50.8%
*-commutative50.8%
*-commutative50.8%
unpow250.8%
associate-*l*55.7%
Simplified55.7%
Taylor expanded in h around 0 45.7%
*-commutative45.7%
unpow245.7%
associate-*r*50.7%
unpow250.7%
associate-*l*55.2%
Simplified55.2%
times-frac60.7%
Applied egg-rr60.7%
*-un-lft-identity60.7%
*-commutative60.7%
times-frac60.6%
Applied egg-rr60.6%
*-lft-identity60.6%
associate-*l*60.6%
associate-/l*65.9%
Simplified65.9%
Final simplification87.2%
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 (* (/ D d) (* (/ D (/ l (* M (* h M)))) (/ 0.25 d))))))
(if (<= (/ h l) -2e-30)
(* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ D d) (/ M 2.0)) 2.0)))))
(* w0 (+ 1.0 (* (/ (* D (* D (* (/ M d) (/ (* h M) d)))) l) -0.125))))))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 - ((D / d) * ((D / (l / (M * (h * M)))) * (0.25 / d)))));
} else if ((h / l) <= -2e-30) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((D / d) * (M / 2.0)), 2.0))));
} else {
tmp = w0 * (1.0 + (((D * (D * ((M / d) * ((h * M) / d)))) / l) * -0.125));
}
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 - ((D / d) * ((D / (l / (M * (h * M)))) * (0.25 / d)))));
} else if ((h / l) <= -2e-30) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((D / d) * (M / 2.0)), 2.0))));
} else {
tmp = w0 * (1.0 + (((D * (D * ((M / d) * ((h * M) / d)))) / l) * -0.125));
}
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 - ((D / d) * ((D / (l / (M * (h * M)))) * (0.25 / d))))) elif (h / l) <= -2e-30: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((D / d) * (M / 2.0)), 2.0)))) else: tmp = w0 * (1.0 + (((D * (D * ((M / d) * ((h * M) / d)))) / l) * -0.125)) 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(Float64(D / d) * Float64(Float64(D / Float64(l / Float64(M * Float64(h * M)))) * Float64(0.25 / d)))))); elseif (Float64(h / l) <= -2e-30) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0))))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(D * Float64(D * Float64(Float64(M / d) * Float64(Float64(h * M) / d)))) / l) * -0.125))); 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 - ((D / d) * ((D / (l / (M * (h * M)))) * (0.25 / d)))));
elseif ((h / l) <= -2e-30)
tmp = w0 * sqrt((1.0 - ((h / l) * (((D / d) * (M / 2.0)) ^ 2.0))));
else
tmp = w0 * (1.0 + (((D * (D * ((M / d) * ((h * M) / d)))) / l) * -0.125));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: 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[(N[(D / d), $MachinePrecision] * N[(N[(D / N[(l / N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.25 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(h / l), $MachinePrecision], -2e-30], 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], N[(w0 * N[(1.0 + N[(N[(N[(D * N[(D * N[(N[(M / d), $MachinePrecision] * N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\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 - \frac{D}{d} \cdot \left(\frac{D}{\frac{\ell}{M \cdot \left(h \cdot M\right)}} \cdot \frac{0.25}{d}\right)}\\
\mathbf{elif}\;\frac{h}{\ell} \leq -2 \cdot 10^{-30}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \frac{D \cdot \left(D \cdot \left(\frac{M}{d} \cdot \frac{h \cdot M}{d}\right)\right)}{\ell} \cdot -0.125\right)\\
\end{array}
\end{array}
if (/.f64 h l) < -inf.0Initial program 44.7%
times-frac44.7%
Simplified44.7%
Taylor expanded in M around 0 61.3%
associate-*r/61.3%
*-commutative61.3%
*-commutative61.3%
*-commutative61.3%
associate-*l*61.5%
unpow261.5%
unpow261.5%
swap-sqr66.2%
*-commutative66.2%
*-commutative66.2%
unpow266.2%
associate-*l*66.2%
Simplified66.2%
Taylor expanded in h around 0 61.3%
*-commutative61.3%
unpow261.3%
associate-*r*61.3%
unpow261.3%
associate-*l*66.2%
Simplified66.2%
times-frac66.2%
Applied egg-rr66.2%
*-un-lft-identity66.2%
*-commutative66.2%
times-frac74.9%
Applied egg-rr74.9%
*-lft-identity74.9%
associate-*l*74.9%
associate-/l*70.8%
Simplified70.8%
if -inf.0 < (/.f64 h l) < -2e-30Initial program 84.3%
times-frac84.4%
Simplified84.4%
if -2e-30 < (/.f64 h l) Initial program 88.3%
times-frac88.3%
Simplified88.3%
Taylor expanded in M around 0 58.1%
associate-*r/58.1%
*-commutative58.1%
associate-*r/58.1%
*-commutative58.1%
times-frac58.8%
unpow258.8%
*-commutative58.8%
unpow258.8%
unpow258.8%
Simplified58.8%
associate-*l/60.1%
times-frac69.0%
Applied egg-rr69.0%
associate-*l*76.7%
Simplified76.7%
Taylor expanded in M around 0 67.9%
unpow267.9%
unpow267.9%
associate-*r*71.6%
times-frac82.9%
Simplified82.9%
Final simplification82.2%
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) -2e-30) (* w0 (sqrt (- 1.0 (/ (* h (pow (* (/ M d) (* D 0.5)) 2.0)) l)))) (* w0 (+ 1.0 (* (/ (* D (* D (* (/ M d) (/ (* h M) d)))) l) -0.125)))))
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) <= -2e-30) {
tmp = w0 * sqrt((1.0 - ((h * pow(((M / d) * (D * 0.5)), 2.0)) / l)));
} else {
tmp = w0 * (1.0 + (((D * (D * ((M / d) * ((h * M) / d)))) / l) * -0.125));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if ((h / l) <= (-2d-30)) then
tmp = w0 * sqrt((1.0d0 - ((h * (((m / d_1) * (d * 0.5d0)) ** 2.0d0)) / l)))
else
tmp = w0 * (1.0d0 + (((d * (d * ((m / d_1) * ((h * m) / d_1)))) / l) * (-0.125d0)))
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) <= -2e-30) {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow(((M / d) * (D * 0.5)), 2.0)) / l)));
} else {
tmp = w0 * (1.0 + (((D * (D * ((M / d) * ((h * M) / d)))) / l) * -0.125));
}
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) <= -2e-30: tmp = w0 * math.sqrt((1.0 - ((h * math.pow(((M / d) * (D * 0.5)), 2.0)) / l))) else: tmp = w0 * (1.0 + (((D * (D * ((M / d) * ((h * M) / d)))) / l) * -0.125)) 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) <= -2e-30) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(Float64(M / d) * Float64(D * 0.5)) ^ 2.0)) / l)))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(D * Float64(D * Float64(Float64(M / d) * Float64(Float64(h * M) / d)))) / l) * -0.125))); 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) <= -2e-30)
tmp = w0 * sqrt((1.0 - ((h * (((M / d) * (D * 0.5)) ^ 2.0)) / l)));
else
tmp = w0 * (1.0 + (((D * (D * ((M / d) * ((h * M) / d)))) / l) * -0.125));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(h / l), $MachinePrecision], -2e-30], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(N[(M / d), $MachinePrecision] * N[(D * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(N[(D * N[(D * N[(N[(M / d), $MachinePrecision] * N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -2 \cdot 10^{-30}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(\frac{M}{d} \cdot \left(D \cdot 0.5\right)\right)}^{2}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \frac{D \cdot \left(D \cdot \left(\frac{M}{d} \cdot \frac{h \cdot M}{d}\right)\right)}{\ell} \cdot -0.125\right)\\
\end{array}
\end{array}
if (/.f64 h l) < -2e-30Initial program 75.0%
times-frac75.0%
Simplified75.0%
frac-times75.0%
associate-*r/81.2%
*-commutative81.2%
frac-times82.2%
div-inv82.2%
metadata-eval82.2%
Applied egg-rr82.2%
if -2e-30 < (/.f64 h l) Initial program 88.3%
times-frac88.3%
Simplified88.3%
Taylor expanded in M around 0 58.1%
associate-*r/58.1%
*-commutative58.1%
associate-*r/58.1%
*-commutative58.1%
times-frac58.8%
unpow258.8%
*-commutative58.8%
unpow258.8%
unpow258.8%
Simplified58.8%
associate-*l/60.1%
times-frac69.0%
Applied egg-rr69.0%
associate-*l*76.7%
Simplified76.7%
Taylor expanded in M around 0 67.9%
unpow267.9%
unpow267.9%
associate-*r*71.6%
times-frac82.9%
Simplified82.9%
Final simplification82.6%
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 7.2e-82)
(* w0 (+ 1.0 (* -0.125 (/ (* D (* D (/ h (* (/ d M) (/ d M))))) l))))
(if (<= d 1.42e+115)
(* w0 (sqrt (- 1.0 (* (/ 0.25 d) (/ (* D (* D (* M (* h M)))) (* l d))))))
(* w0 (+ 1.0 (* -0.125 (/ (* D (* D (* (/ h d) (/ (* M M) d)))) 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 (d <= 7.2e-82) {
tmp = w0 * (1.0 + (-0.125 * ((D * (D * (h / ((d / M) * (d / M))))) / l)));
} else if (d <= 1.42e+115) {
tmp = w0 * sqrt((1.0 - ((0.25 / d) * ((D * (D * (M * (h * M)))) / (l * d)))));
} else {
tmp = w0 * (1.0 + (-0.125 * ((D * (D * ((h / d) * ((M * M) / d)))) / l)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: 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 <= 7.2d-82) then
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d * (d * (h / ((d_1 / m) * (d_1 / m))))) / l)))
else if (d_1 <= 1.42d+115) then
tmp = w0 * sqrt((1.0d0 - ((0.25d0 / d_1) * ((d * (d * (m * (h * m)))) / (l * d_1)))))
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d * (d * ((h / d_1) * ((m * m) / d_1)))) / 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 (d <= 7.2e-82) {
tmp = w0 * (1.0 + (-0.125 * ((D * (D * (h / ((d / M) * (d / M))))) / l)));
} else if (d <= 1.42e+115) {
tmp = w0 * Math.sqrt((1.0 - ((0.25 / d) * ((D * (D * (M * (h * M)))) / (l * d)))));
} else {
tmp = w0 * (1.0 + (-0.125 * ((D * (D * ((h / d) * ((M * M) / d)))) / 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 d <= 7.2e-82: tmp = w0 * (1.0 + (-0.125 * ((D * (D * (h / ((d / M) * (d / M))))) / l))) elif d <= 1.42e+115: tmp = w0 * math.sqrt((1.0 - ((0.25 / d) * ((D * (D * (M * (h * M)))) / (l * d))))) else: tmp = w0 * (1.0 + (-0.125 * ((D * (D * ((h / d) * ((M * M) / d)))) / 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 (d <= 7.2e-82) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D * Float64(D * Float64(h / Float64(Float64(d / M) * Float64(d / M))))) / l)))); elseif (d <= 1.42e+115) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.25 / d) * Float64(Float64(D * Float64(D * Float64(M * Float64(h * M)))) / Float64(l * d)))))); else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D * Float64(D * Float64(Float64(h / d) * Float64(Float64(M * M) / d)))) / 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 (d <= 7.2e-82)
tmp = w0 * (1.0 + (-0.125 * ((D * (D * (h / ((d / M) * (d / M))))) / l)));
elseif (d <= 1.42e+115)
tmp = w0 * sqrt((1.0 - ((0.25 / d) * ((D * (D * (M * (h * M)))) / (l * d)))));
else
tmp = w0 * (1.0 + (-0.125 * ((D * (D * ((h / d) * ((M * M) / d)))) / l)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 7.2e-82], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D * N[(D * N[(h / N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.42e+115], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.25 / d), $MachinePrecision] * N[(N[(D * N[(D * N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D * N[(D * N[(N[(h / d), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $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}\;d \leq 7.2 \cdot 10^{-82}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{D \cdot \left(D \cdot \frac{h}{\frac{d}{M} \cdot \frac{d}{M}}\right)}{\ell}\right)\\
\mathbf{elif}\;d \leq 1.42 \cdot 10^{+115}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25}{d} \cdot \frac{D \cdot \left(D \cdot \left(M \cdot \left(h \cdot M\right)\right)\right)}{\ell \cdot d}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{D \cdot \left(D \cdot \left(\frac{h}{d} \cdot \frac{M \cdot M}{d}\right)\right)}{\ell}\right)\\
\end{array}
\end{array}
if d < 7.19999999999999996e-82Initial program 81.8%
times-frac81.8%
Simplified81.8%
Taylor expanded in M around 0 48.3%
associate-*r/48.3%
*-commutative48.3%
associate-*r/48.3%
*-commutative48.3%
times-frac49.6%
unpow249.6%
*-commutative49.6%
unpow249.6%
unpow249.6%
Simplified49.6%
associate-*l/49.7%
times-frac60.7%
Applied egg-rr60.7%
associate-*l*69.6%
Simplified69.6%
Taylor expanded in M around 0 58.6%
*-commutative58.6%
associate-/l*60.7%
unpow260.7%
unpow260.7%
times-frac71.6%
Simplified71.6%
if 7.19999999999999996e-82 < d < 1.42e115Initial program 79.9%
times-frac79.9%
Simplified79.9%
Taylor expanded in M around 0 64.6%
associate-*r/64.6%
*-commutative64.6%
*-commutative64.6%
*-commutative64.6%
associate-*l*62.8%
unpow262.8%
unpow262.8%
swap-sqr74.0%
*-commutative74.0%
*-commutative74.0%
unpow274.0%
associate-*l*74.0%
Simplified74.0%
Taylor expanded in h around 0 64.6%
*-commutative64.6%
unpow264.6%
associate-*r*66.5%
unpow266.5%
associate-*l*68.4%
Simplified68.4%
times-frac74.2%
Applied egg-rr74.2%
if 1.42e115 < d Initial program 91.7%
times-frac91.7%
Simplified91.7%
Taylor expanded in M around 0 62.5%
associate-*r/62.5%
*-commutative62.5%
associate-*r/62.5%
*-commutative62.5%
times-frac60.4%
unpow260.4%
*-commutative60.4%
unpow260.4%
unpow260.4%
Simplified60.4%
associate-*l/66.7%
times-frac75.3%
Applied egg-rr75.3%
associate-*l*81.7%
Simplified81.7%
Final simplification74.1%
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 5e-151) (* w0 (+ 1.0 (* -0.125 (/ (* D (* D (/ h (* (/ d M) (/ d M))))) l)))) (* w0 (sqrt (- 1.0 (* (/ D d) (* (/ D (/ l (* M (* h M)))) (/ 0.25 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 <= 5e-151) {
tmp = w0 * (1.0 + (-0.125 * ((D * (D * (h / ((d / M) * (d / M))))) / l)));
} else {
tmp = w0 * sqrt((1.0 - ((D / d) * ((D / (l / (M * (h * M)))) * (0.25 / 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 <= 5d-151) then
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d * (d * (h / ((d_1 / m) * (d_1 / m))))) / l)))
else
tmp = w0 * sqrt((1.0d0 - ((d / d_1) * ((d / (l / (m * (h * m)))) * (0.25d0 / 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 <= 5e-151) {
tmp = w0 * (1.0 + (-0.125 * ((D * (D * (h / ((d / M) * (d / M))))) / l)));
} else {
tmp = w0 * Math.sqrt((1.0 - ((D / d) * ((D / (l / (M * (h * M)))) * (0.25 / 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 <= 5e-151: tmp = w0 * (1.0 + (-0.125 * ((D * (D * (h / ((d / M) * (d / M))))) / l))) else: tmp = w0 * math.sqrt((1.0 - ((D / d) * ((D / (l / (M * (h * M)))) * (0.25 / 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 <= 5e-151) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D * Float64(D * Float64(h / Float64(Float64(d / M) * Float64(d / M))))) / l)))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(D / d) * Float64(Float64(D / Float64(l / Float64(M * Float64(h * M)))) * Float64(0.25 / 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 <= 5e-151)
tmp = w0 * (1.0 + (-0.125 * ((D * (D * (h / ((d / M) * (d / M))))) / l)));
else
tmp = w0 * sqrt((1.0 - ((D / d) * ((D / (l / (M * (h * M)))) * (0.25 / 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, 5e-151], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D * N[(D * N[(h / N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(D / d), $MachinePrecision] * N[(N[(D / N[(l / N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.25 / d), $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 5 \cdot 10^{-151}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{D \cdot \left(D \cdot \frac{h}{\frac{d}{M} \cdot \frac{d}{M}}\right)}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{D}{d} \cdot \left(\frac{D}{\frac{\ell}{M \cdot \left(h \cdot M\right)}} \cdot \frac{0.25}{d}\right)}\\
\end{array}
\end{array}
if M < 5.00000000000000003e-151Initial program 86.8%
times-frac86.8%
Simplified86.8%
Taylor expanded in M around 0 59.3%
associate-*r/59.3%
*-commutative59.3%
associate-*r/59.3%
*-commutative59.3%
times-frac60.5%
unpow260.5%
*-commutative60.5%
unpow260.5%
unpow260.5%
Simplified60.5%
associate-*l/62.4%
times-frac70.6%
Applied egg-rr70.6%
associate-*l*76.3%
Simplified76.3%
Taylor expanded in M around 0 68.3%
*-commutative68.3%
associate-/l*69.6%
unpow269.6%
unpow269.6%
times-frac81.3%
Simplified81.3%
if 5.00000000000000003e-151 < M Initial program 77.0%
times-frac77.1%
Simplified77.1%
Taylor expanded in M around 0 45.8%
associate-*r/45.8%
*-commutative45.8%
*-commutative45.8%
*-commutative45.8%
associate-*l*48.0%
unpow248.0%
unpow248.0%
swap-sqr64.2%
*-commutative64.2%
*-commutative64.2%
unpow264.2%
associate-*l*69.4%
Simplified69.4%
Taylor expanded in h around 0 51.1%
*-commutative51.1%
unpow251.1%
associate-*r*52.2%
unpow252.2%
associate-*l*58.8%
Simplified58.8%
times-frac62.1%
Applied egg-rr62.1%
*-un-lft-identity62.1%
*-commutative62.1%
times-frac66.6%
Applied egg-rr66.6%
*-lft-identity66.6%
associate-*l*66.6%
associate-/l*65.3%
Simplified65.3%
Final simplification75.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 (<= d 4.1e-253) (* w0 (sqrt (- 1.0 (/ (* 0.25 (* (/ (* D D) l) (* M (* M (/ h d))))) d)))) (* w0 (sqrt (- 1.0 (* (/ D d) (* (/ D (/ l (* M (* h M)))) (/ 0.25 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 (d <= 4.1e-253) {
tmp = w0 * sqrt((1.0 - ((0.25 * (((D * D) / l) * (M * (M * (h / d))))) / d)));
} else {
tmp = w0 * sqrt((1.0 - ((D / d) * ((D / (l / (M * (h * M)))) * (0.25 / 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 (d_1 <= 4.1d-253) then
tmp = w0 * sqrt((1.0d0 - ((0.25d0 * (((d * d) / l) * (m * (m * (h / d_1))))) / d_1)))
else
tmp = w0 * sqrt((1.0d0 - ((d / d_1) * ((d / (l / (m * (h * m)))) * (0.25d0 / 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 (d <= 4.1e-253) {
tmp = w0 * Math.sqrt((1.0 - ((0.25 * (((D * D) / l) * (M * (M * (h / d))))) / d)));
} else {
tmp = w0 * Math.sqrt((1.0 - ((D / d) * ((D / (l / (M * (h * M)))) * (0.25 / 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 d <= 4.1e-253: tmp = w0 * math.sqrt((1.0 - ((0.25 * (((D * D) / l) * (M * (M * (h / d))))) / d))) else: tmp = w0 * math.sqrt((1.0 - ((D / d) * ((D / (l / (M * (h * M)))) * (0.25 / 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 (d <= 4.1e-253) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.25 * Float64(Float64(Float64(D * D) / l) * Float64(M * Float64(M * Float64(h / d))))) / d)))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(D / d) * Float64(Float64(D / Float64(l / Float64(M * Float64(h * M)))) * Float64(0.25 / 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 (d <= 4.1e-253)
tmp = w0 * sqrt((1.0 - ((0.25 * (((D * D) / l) * (M * (M * (h / d))))) / d)));
else
tmp = w0 * sqrt((1.0 - ((D / d) * ((D / (l / (M * (h * M)))) * (0.25 / 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[d, 4.1e-253], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.25 * N[(N[(N[(D * D), $MachinePrecision] / l), $MachinePrecision] * N[(M * N[(M * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(D / d), $MachinePrecision] * N[(N[(D / N[(l / N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.25 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 4.1 \cdot 10^{-253}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\frac{D \cdot D}{\ell} \cdot \left(M \cdot \left(M \cdot \frac{h}{d}\right)\right)\right)}{d}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{D}{d} \cdot \left(\frac{D}{\frac{\ell}{M \cdot \left(h \cdot M\right)}} \cdot \frac{0.25}{d}\right)}\\
\end{array}
\end{array}
if d < 4.10000000000000002e-253Initial program 81.7%
times-frac81.7%
Simplified81.7%
Taylor expanded in M around 0 51.2%
associate-*r/51.2%
*-commutative51.2%
*-commutative51.2%
*-commutative51.2%
associate-*l*52.8%
unpow252.8%
unpow252.8%
swap-sqr67.0%
*-commutative67.0%
*-commutative67.0%
unpow267.0%
associate-*l*71.6%
Simplified71.6%
*-un-lft-identity71.6%
times-frac77.9%
pow277.9%
*-commutative77.9%
Applied egg-rr77.9%
*-lft-identity77.9%
associate-*l/77.9%
associate-/l*77.9%
associate-*r/77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in h around 0 60.8%
associate-*r/60.8%
*-commutative60.8%
associate-*r/60.8%
times-frac63.9%
unpow263.9%
associate-*r/64.7%
unpow264.7%
associate-*l*68.6%
Simplified68.6%
if 4.10000000000000002e-253 < d Initial program 84.8%
times-frac84.8%
Simplified84.8%
Taylor expanded in M around 0 58.9%
associate-*r/58.9%
*-commutative58.9%
*-commutative58.9%
*-commutative58.9%
associate-*l*59.0%
unpow259.0%
unpow259.0%
swap-sqr69.1%
*-commutative69.1%
*-commutative69.1%
unpow269.1%
associate-*l*70.6%
Simplified70.6%
Taylor expanded in h around 0 60.5%
*-commutative60.5%
unpow260.5%
associate-*r*64.4%
unpow264.4%
associate-*l*66.8%
Simplified66.8%
times-frac77.1%
Applied egg-rr77.1%
*-un-lft-identity77.1%
*-commutative77.1%
times-frac80.4%
Applied egg-rr80.4%
*-lft-identity80.4%
associate-*l*80.4%
associate-/l*78.5%
Simplified78.5%
Final simplification73.6%
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 3.9e-147)
w0
(if (or (<= M 12500000.0) (not (<= M 1.3e+38)))
(* w0 (+ 1.0 (* -0.125 (* (/ (* D D) l) (/ (* h (* M M)) (* d 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 (M <= 3.9e-147) {
tmp = w0;
} else if ((M <= 12500000.0) || !(M <= 1.3e+38)) {
tmp = w0 * (1.0 + (-0.125 * (((D * D) / l) * ((h * (M * M)) / (d * 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 (m <= 3.9d-147) then
tmp = w0
else if ((m <= 12500000.0d0) .or. (.not. (m <= 1.3d+38))) then
tmp = w0 * (1.0d0 + ((-0.125d0) * (((d * d) / l) * ((h * (m * m)) / (d_1 * 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 (M <= 3.9e-147) {
tmp = w0;
} else if ((M <= 12500000.0) || !(M <= 1.3e+38)) {
tmp = w0 * (1.0 + (-0.125 * (((D * D) / l) * ((h * (M * M)) / (d * 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 M <= 3.9e-147: tmp = w0 elif (M <= 12500000.0) or not (M <= 1.3e+38): tmp = w0 * (1.0 + (-0.125 * (((D * D) / l) * ((h * (M * M)) / (d * 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 (M <= 3.9e-147) tmp = w0; elseif ((M <= 12500000.0) || !(M <= 1.3e+38)) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(Float64(D * D) / l) * Float64(Float64(h * Float64(M * M)) / Float64(d * 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 (M <= 3.9e-147)
tmp = w0;
elseif ((M <= 12500000.0) || ~((M <= 1.3e+38)))
tmp = w0 * (1.0 + (-0.125 * (((D * D) / l) * ((h * (M * M)) / (d * 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[M, 3.9e-147], w0, If[Or[LessEqual[M, 12500000.0], N[Not[LessEqual[M, 1.3e+38]], $MachinePrecision]], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] / l), $MachinePrecision] * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d * d), $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}\;M \leq 3.9 \cdot 10^{-147}:\\
\;\;\;\;w0\\
\mathbf{elif}\;M \leq 12500000 \lor \neg \left(M \leq 1.3 \cdot 10^{+38}\right):\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\frac{D \cdot D}{\ell} \cdot \frac{h \cdot \left(M \cdot M\right)}{d \cdot d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if M < 3.8999999999999998e-147 or 1.25e7 < M < 1.3e38Initial program 86.7%
times-frac86.7%
Simplified86.7%
Taylor expanded in M around 0 76.7%
if 3.8999999999999998e-147 < M < 1.25e7 or 1.3e38 < M Initial program 76.3%
times-frac76.4%
Simplified76.4%
Taylor expanded in M around 0 43.7%
associate-*r/43.7%
*-commutative43.7%
associate-*r/43.7%
*-commutative43.7%
times-frac45.0%
unpow245.0%
*-commutative45.0%
unpow245.0%
unpow245.0%
Simplified45.0%
Final simplification66.1%
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 4.8e-151) w0 (* w0 (+ 1.0 (* -0.125 (/ (* D (* D (* M (* h M)))) (* d (* l 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 <= 4.8e-151) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((D * (D * (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: 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 <= 4.8d-151) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d * (d * (m * (h * m)))) / (d_1 * (l * 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 <= 4.8e-151) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((D * (D * (M * (h * M)))) / (d * (l * 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 <= 4.8e-151: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * ((D * (D * (M * (h * M)))) / (d * (l * 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 <= 4.8e-151) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D * Float64(D * Float64(M * Float64(h * M)))) / Float64(d * Float64(l * 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 <= 4.8e-151)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * ((D * (D * (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: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 4.8e-151], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D * N[(D * N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * d), $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 4.8 \cdot 10^{-151}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{D \cdot \left(D \cdot \left(M \cdot \left(h \cdot M\right)\right)\right)}{d \cdot \left(\ell \cdot d\right)}\right)\\
\end{array}
\end{array}
if M < 4.8e-151Initial program 86.8%
times-frac86.8%
Simplified86.8%
Taylor expanded in M around 0 76.3%
if 4.8e-151 < M Initial program 77.0%
times-frac77.1%
Simplified77.1%
Taylor expanded in M around 0 44.7%
associate-*r/44.7%
*-commutative44.7%
associate-*r/44.7%
*-commutative44.7%
times-frac46.0%
unpow246.0%
*-commutative46.0%
unpow246.0%
unpow246.0%
Simplified46.0%
Taylor expanded in D around 0 44.7%
unpow244.7%
associate-*r*45.8%
unpow245.8%
associate-*l*51.5%
unpow251.5%
associate-*r*55.8%
Simplified55.8%
Final simplification68.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.4e+80) w0 (* -0.125 (* (* (/ D d) (/ D d)) (/ (* w0 (* M (* h 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.4e+80) {
tmp = w0;
} else {
tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * (M * (h * 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.4d+80) then
tmp = w0
else
tmp = (-0.125d0) * (((d / d_1) * (d / d_1)) * ((w0 * (m * (h * 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.4e+80) {
tmp = w0;
} else {
tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * (M * (h * 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.4e+80: tmp = w0 else: tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * (M * (h * 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.4e+80) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(w0 * Float64(M * Float64(h * 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.4e+80)
tmp = w0;
else
tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * (M * (h * 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.4e+80], w0, N[(-0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(w0 * N[(M * N[(h * 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.4 \cdot 10^{+80}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{w0 \cdot \left(M \cdot \left(h \cdot M\right)\right)}{\ell}\right)\\
\end{array}
\end{array}
if M < 1.39999999999999992e80Initial program 84.6%
times-frac84.6%
Simplified84.6%
Taylor expanded in M around 0 76.2%
if 1.39999999999999992e80 < M Initial program 76.2%
times-frac76.2%
Simplified76.2%
Taylor expanded in M around 0 30.1%
associate-*r/30.1%
*-commutative30.1%
associate-*r/30.1%
*-commutative30.1%
times-frac30.4%
unpow230.4%
*-commutative30.4%
unpow230.4%
unpow230.4%
Simplified30.4%
Taylor expanded in D around 0 30.1%
unpow230.1%
associate-*r*32.5%
unpow232.5%
associate-*l*40.3%
unpow240.3%
associate-*r*40.4%
Simplified40.4%
Taylor expanded in D around inf 25.3%
times-frac23.3%
unpow223.3%
unpow223.3%
times-frac35.8%
unpow235.8%
unpow235.8%
associate-*r*35.9%
Simplified35.9%
pow235.9%
Applied egg-rr35.9%
Final simplification69.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 (* w0 (+ 1.0 (* (/ (* D (* D (* (/ M d) (/ (* h M) d)))) l) -0.125))))
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 * (1.0 + (((D * (D * ((M / d) * ((h * M) / d)))) / l) * -0.125));
}
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 * (1.0d0 + (((d * (d * ((m / d_1) * ((h * m) / d_1)))) / l) * (-0.125d0)))
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 * (1.0 + (((D * (D * ((M / d) * ((h * M) / d)))) / l) * -0.125));
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0 * (1.0 + (((D * (D * ((M / d) * ((h * M) / d)))) / l) * -0.125))
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return Float64(w0 * Float64(1.0 + Float64(Float64(Float64(D * Float64(D * Float64(Float64(M / d) * Float64(Float64(h * M) / d)))) / l) * -0.125))) end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0 * (1.0 + (((D * (D * ((M / d) * ((h * M) / d)))) / l) * -0.125));
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_] := N[(w0 * N[(1.0 + N[(N[(N[(D * N[(D * N[(N[(M / d), $MachinePrecision] * N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0 \cdot \left(1 + \frac{D \cdot \left(D \cdot \left(\frac{M}{d} \cdot \frac{h \cdot M}{d}\right)\right)}{\ell} \cdot -0.125\right)
\end{array}
Initial program 83.2%
times-frac83.2%
Simplified83.2%
Taylor expanded in M around 0 54.0%
associate-*r/54.0%
*-commutative54.0%
associate-*r/54.0%
*-commutative54.0%
times-frac55.2%
unpow255.2%
*-commutative55.2%
unpow255.2%
unpow255.2%
Simplified55.2%
associate-*l/56.8%
times-frac64.8%
Applied egg-rr64.8%
associate-*l*71.8%
Simplified71.8%
Taylor expanded in M around 0 63.9%
unpow263.9%
unpow263.9%
associate-*r*66.6%
times-frac75.7%
Simplified75.7%
Final simplification75.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 83.2%
times-frac83.2%
Simplified83.2%
Taylor expanded in M around 0 69.2%
Final simplification69.2%
herbie shell --seed 2023213
(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))))))