
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}
NOTE: M should be positive before calling this function NOTE: 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 (<= (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))) 4e+229) (* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ M d) (/ D 2.0)) 2.0))))) (* w0 (sqrt (- 1.0 (/ (* h (pow (* M (* 0.5 (/ D d))) 2.0)) l))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= 4e+229) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((M / d) * (D / 2.0)), 2.0))));
} else {
tmp = w0 * sqrt((1.0 - ((h * pow((M * (0.5 * (D / d))), 2.0)) / l)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if ((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))) <= 4d+229) then
tmp = w0 * sqrt((1.0d0 - ((h / l) * (((m / d_1) * (d / 2.0d0)) ** 2.0d0))))
else
tmp = w0 * sqrt((1.0d0 - ((h * ((m * (0.5d0 * (d / d_1))) ** 2.0d0)) / l)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= 4e+229) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((M / d) * (D / 2.0)), 2.0))));
} else {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow((M * (0.5 * (D / d))), 2.0)) / l)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= 4e+229: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((M / d) * (D / 2.0)), 2.0)))) else: tmp = w0 * math.sqrt((1.0 - ((h * math.pow((M * (0.5 * (D / d))), 2.0)) / l))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))) <= 4e+229) 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(h * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0)) / l)))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if ((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l))) <= 4e+229)
tmp = w0 * sqrt((1.0 - ((h / l) * (((M / d) * (D / 2.0)) ^ 2.0))));
else
tmp = w0 * sqrt((1.0 - ((h * ((M * (0.5 * (D / d))) ^ 2.0)) / l)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(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], 4e+229], 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[(h * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq 4 \cdot 10^{+229}:\\
\;\;\;\;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{h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}}\\
\end{array}
\end{array}
if (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < 4e229Initial program 99.9%
*-commutative99.9%
times-frac98.3%
Simplified98.3%
if 4e229 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) Initial program 44.3%
*-commutative44.3%
times-frac48.2%
Simplified48.2%
unpow248.2%
associate-*l*50.5%
div-inv50.5%
associate-*l*50.4%
times-frac50.4%
*-un-lft-identity50.4%
*-commutative50.4%
clear-num50.4%
div-inv50.4%
div-inv50.4%
associate-*l*50.6%
times-frac50.6%
*-un-lft-identity50.6%
*-commutative50.6%
clear-num50.6%
div-inv50.6%
associate-*l*48.2%
Applied egg-rr72.1%
Final simplification90.4%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))) INFINITY) (* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ M d) (/ D 2.0)) 2.0))))) 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 ((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= ((double) INFINITY)) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((M / d) * (D / 2.0)), 2.0))));
} else {
tmp = w0;
}
return tmp;
}
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= Double.POSITIVE_INFINITY) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((M / d) * (D / 2.0)), 2.0))));
} 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 (1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= math.inf: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((M / d) * (D / 2.0)), 2.0)))) else: tmp = w0 return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))) <= Inf) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(M / d) * Float64(D / 2.0)) ^ 2.0))))); 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 ((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l))) <= Inf)
tmp = w0 * sqrt((1.0 - ((h / l) * (((M / d) * (D / 2.0)) ^ 2.0))));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], 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], w0]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq \infty:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{M}{d} \cdot \frac{D}{2}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < +inf.0Initial program 92.6%
*-commutative92.6%
times-frac91.3%
Simplified91.3%
if +inf.0 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) Initial program 0.0%
*-commutative0.0%
times-frac11.5%
Simplified11.5%
Taylor expanded in M around 0 74.7%
Final simplification89.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 D) (* 2.0 d)) 2e-19) (* w0 (sqrt (- 1.0 (/ (* h (pow (* 0.5 (/ (* M D) d)) 2.0)) l)))) (* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ M d) (/ D 2.0)) 2.0)))))))
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 * D) / (2.0 * d)) <= 2e-19) {
tmp = w0 * sqrt((1.0 - ((h * pow((0.5 * ((M * D) / d)), 2.0)) / 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: 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)) <= 2d-19) then
tmp = w0 * sqrt((1.0d0 - ((h * ((0.5d0 * ((m * d) / d_1)) ** 2.0d0)) / 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);
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)) <= 2e-19) {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow((0.5 * ((M * D) / d)), 2.0)) / 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) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if ((M * D) / (2.0 * d)) <= 2e-19: tmp = w0 * math.sqrt((1.0 - ((h * math.pow((0.5 * ((M * D) / d)), 2.0)) / 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) 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)) <= 2e-19) 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 * 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)
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)) <= 2e-19)
tmp = w0 * sqrt((1.0 - ((h * ((0.5 * ((M * D) / d)) ^ 2.0)) / 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: 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], 2e-19], 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[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|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 2 \cdot 10^{-19}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(0.5 \cdot \frac{M \cdot D}{d}\right)}^{2}}{\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 (/.f64 (*.f64 M D) (*.f64 2 d)) < 2e-19Initial program 83.1%
*-commutative83.1%
times-frac84.0%
Simplified84.0%
unpow284.0%
associate-*l*84.4%
div-inv84.4%
associate-*l*84.4%
times-frac84.4%
*-un-lft-identity84.4%
*-commutative84.4%
clear-num84.4%
div-inv84.4%
div-inv84.4%
associate-*l*84.9%
times-frac84.9%
*-un-lft-identity84.9%
*-commutative84.9%
clear-num84.9%
div-inv84.9%
associate-*l*84.5%
Applied egg-rr92.8%
Taylor expanded in M around 0 91.4%
if 2e-19 < (/.f64 (*.f64 M D) (*.f64 2 d)) Initial program 83.8%
*-commutative83.8%
times-frac79.6%
Simplified79.6%
Final simplification89.3%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= d 1.02e-132)
(* w0 (sqrt (- 1.0 (* (* (/ h (* (/ d M) (/ d M))) (* D (/ D l))) 0.25))))
(if (<= d 3.2e+70)
(* w0 (sqrt (- 1.0 (/ (* 0.25 (* h (* (* M D) (* M D)))) (* d (* d l))))))
w0)))M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 1.02e-132) {
tmp = w0 * sqrt((1.0 - (((h / ((d / M) * (d / M))) * (D * (D / l))) * 0.25)));
} else if (d <= 3.2e+70) {
tmp = w0 * sqrt((1.0 - ((0.25 * (h * ((M * D) * (M * 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: 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.02d-132) then
tmp = w0 * sqrt((1.0d0 - (((h / ((d_1 / m) * (d_1 / m))) * (d * (d / l))) * 0.25d0)))
else if (d_1 <= 3.2d+70) then
tmp = w0 * sqrt((1.0d0 - ((0.25d0 * (h * ((m * d) * (m * d)))) / (d_1 * (d_1 * l)))))
else
tmp = w0
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 1.02e-132) {
tmp = w0 * Math.sqrt((1.0 - (((h / ((d / M) * (d / M))) * (D * (D / l))) * 0.25)));
} else if (d <= 3.2e+70) {
tmp = w0 * Math.sqrt((1.0 - ((0.25 * (h * ((M * D) * (M * D)))) / (d * (d * l)))));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 1.02e-132: tmp = w0 * math.sqrt((1.0 - (((h / ((d / M) * (d / M))) * (D * (D / l))) * 0.25))) elif d <= 3.2e+70: tmp = w0 * math.sqrt((1.0 - ((0.25 * (h * ((M * D) * (M * D)))) / (d * (d * l))))) else: tmp = w0 return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 1.02e-132) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(h / Float64(Float64(d / M) * Float64(d / M))) * Float64(D * Float64(D / l))) * 0.25)))); elseif (d <= 3.2e+70) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.25 * Float64(h * Float64(Float64(M * D) * Float64(M * D)))) / Float64(d * Float64(d * l)))))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 1.02e-132)
tmp = w0 * sqrt((1.0 - (((h / ((d / M) * (d / M))) * (D * (D / l))) * 0.25)));
elseif (d <= 3.2e+70)
tmp = w0 * sqrt((1.0 - ((0.25 * (h * ((M * D) * (M * 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: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 1.02e-132], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(h / N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.2e+70], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.25 * N[(h * N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $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}\;d \leq 1.02 \cdot 10^{-132}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \left(\frac{h}{\frac{d}{M} \cdot \frac{d}{M}} \cdot \left(D \cdot \frac{D}{\ell}\right)\right) \cdot 0.25}\\
\mathbf{elif}\;d \leq 3.2 \cdot 10^{+70}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(h \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 1.01999999999999998e-132Initial program 83.7%
*-commutative83.7%
times-frac83.0%
Simplified83.0%
unpow283.0%
associate-*l*83.1%
div-inv83.1%
associate-*l*81.3%
times-frac81.3%
*-un-lft-identity81.3%
*-commutative81.3%
clear-num81.3%
div-inv81.3%
div-inv81.3%
associate-*l*83.2%
times-frac83.2%
*-un-lft-identity83.2%
*-commutative83.2%
clear-num83.2%
div-inv83.2%
associate-*l*83.1%
Applied egg-rr88.9%
Taylor expanded in M around 0 48.4%
*-commutative48.4%
times-frac49.7%
unpow249.7%
associate-*l/53.4%
unpow253.4%
associate-*r*59.0%
unpow259.0%
*-commutative59.0%
*-commutative59.0%
Simplified59.0%
Taylor expanded in M around 0 53.4%
*-commutative53.4%
associate-/l*55.3%
unpow255.3%
unpow255.3%
times-frac70.8%
Simplified70.8%
if 1.01999999999999998e-132 < d < 3.2000000000000002e70Initial program 78.8%
*-commutative78.8%
times-frac78.9%
Simplified78.9%
unpow278.9%
associate-*l*83.8%
div-inv83.8%
associate-*l*83.8%
times-frac83.8%
*-un-lft-identity83.8%
*-commutative83.8%
clear-num83.7%
div-inv83.8%
div-inv83.8%
associate-*l*83.8%
times-frac83.8%
*-un-lft-identity83.8%
*-commutative83.8%
clear-num83.7%
div-inv83.8%
associate-*l*78.9%
Applied egg-rr82.1%
Taylor expanded in M around 0 63.3%
associate-*r/63.3%
associate-*r*63.4%
unpow263.4%
unpow263.4%
unswap-sqr85.1%
unpow285.1%
associate-*r*84.9%
Simplified84.9%
if 3.2000000000000002e70 < d Initial program 84.2%
*-commutative84.2%
times-frac85.8%
Simplified85.8%
Taylor expanded in M around 0 92.6%
Final simplification77.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 (<= d 4e-135)
(* w0 (sqrt (- 1.0 (* (* (/ h (* (/ d M) (/ d M))) (* D (/ D l))) 0.25))))
(if (<= d 7.9e+68)
(* w0 (sqrt (- 1.0 (/ (* 0.25 (/ (* h (* (* M D) (* M D))) (* d d))) l))))
w0)))M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 4e-135) {
tmp = w0 * sqrt((1.0 - (((h / ((d / M) * (d / M))) * (D * (D / l))) * 0.25)));
} else if (d <= 7.9e+68) {
tmp = w0 * sqrt((1.0 - ((0.25 * ((h * ((M * D) * (M * 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: 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-135) then
tmp = w0 * sqrt((1.0d0 - (((h / ((d_1 / m) * (d_1 / m))) * (d * (d / l))) * 0.25d0)))
else if (d_1 <= 7.9d+68) then
tmp = w0 * sqrt((1.0d0 - ((0.25d0 * ((h * ((m * d) * (m * d))) / (d_1 * d_1))) / l)))
else
tmp = w0
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 4e-135) {
tmp = w0 * Math.sqrt((1.0 - (((h / ((d / M) * (d / M))) * (D * (D / l))) * 0.25)));
} else if (d <= 7.9e+68) {
tmp = w0 * Math.sqrt((1.0 - ((0.25 * ((h * ((M * D) * (M * D))) / (d * d))) / l)));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 4e-135: tmp = w0 * math.sqrt((1.0 - (((h / ((d / M) * (d / M))) * (D * (D / l))) * 0.25))) elif d <= 7.9e+68: tmp = w0 * math.sqrt((1.0 - ((0.25 * ((h * ((M * D) * (M * D))) / (d * d))) / l))) else: tmp = w0 return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 4e-135) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(h / Float64(Float64(d / M) * Float64(d / M))) * Float64(D * Float64(D / l))) * 0.25)))); elseif (d <= 7.9e+68) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.25 * Float64(Float64(h * Float64(Float64(M * D) * Float64(M * D))) / Float64(d * d))) / l)))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 4e-135)
tmp = w0 * sqrt((1.0 - (((h / ((d / M) * (d / M))) * (D * (D / l))) * 0.25)));
elseif (d <= 7.9e+68)
tmp = w0 * sqrt((1.0 - ((0.25 * ((h * ((M * D) * (M * 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: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 4e-135], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(h / N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7.9e+68], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.25 * N[(N[(h * N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 4 \cdot 10^{-135}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \left(\frac{h}{\frac{d}{M} \cdot \frac{d}{M}} \cdot \left(D \cdot \frac{D}{\ell}\right)\right) \cdot 0.25}\\
\mathbf{elif}\;d \leq 7.9 \cdot 10^{+68}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25 \cdot \frac{h \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right)}{d \cdot d}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 4.0000000000000002e-135Initial program 83.7%
*-commutative83.7%
times-frac83.0%
Simplified83.0%
unpow283.0%
associate-*l*83.1%
div-inv83.1%
associate-*l*81.3%
times-frac81.3%
*-un-lft-identity81.3%
*-commutative81.3%
clear-num81.3%
div-inv81.3%
div-inv81.3%
associate-*l*83.2%
times-frac83.2%
*-un-lft-identity83.2%
*-commutative83.2%
clear-num83.2%
div-inv83.2%
associate-*l*83.1%
Applied egg-rr88.9%
Taylor expanded in M around 0 48.4%
*-commutative48.4%
times-frac49.7%
unpow249.7%
associate-*l/53.4%
unpow253.4%
associate-*r*59.0%
unpow259.0%
*-commutative59.0%
*-commutative59.0%
Simplified59.0%
Taylor expanded in M around 0 53.4%
*-commutative53.4%
associate-/l*55.3%
unpow255.3%
unpow255.3%
times-frac70.8%
Simplified70.8%
if 4.0000000000000002e-135 < d < 7.9e68Initial program 78.8%
*-commutative78.8%
times-frac78.9%
Simplified78.9%
unpow278.9%
associate-*l*83.8%
div-inv83.8%
associate-*l*83.8%
times-frac83.8%
*-un-lft-identity83.8%
*-commutative83.8%
clear-num83.7%
div-inv83.8%
div-inv83.8%
associate-*l*83.8%
times-frac83.8%
*-un-lft-identity83.8%
*-commutative83.8%
clear-num83.7%
div-inv83.8%
associate-*l*78.9%
Applied egg-rr82.1%
Taylor expanded in M around 0 63.3%
associate-*r*63.4%
unpow263.4%
unpow263.4%
unswap-sqr85.1%
unpow285.1%
Simplified85.1%
if 7.9e68 < d Initial program 84.2%
*-commutative84.2%
times-frac85.8%
Simplified85.8%
Taylor expanded in M around 0 92.6%
Final simplification77.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 (<= d 2.4e+63) (* w0 (sqrt (- 1.0 (* 0.25 (* (* D (/ D l)) (* (/ M d) (/ (* M h) 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 (d <= 2.4e+63) {
tmp = w0 * sqrt((1.0 - (0.25 * ((D * (D / l)) * ((M / d) * ((M * h) / 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 (d_1 <= 2.4d+63) then
tmp = w0 * sqrt((1.0d0 - (0.25d0 * ((d * (d / l)) * ((m / d_1) * ((m * h) / 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 (d <= 2.4e+63) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * ((D * (D / l)) * ((M / d) * ((M * h) / 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 d <= 2.4e+63: tmp = w0 * math.sqrt((1.0 - (0.25 * ((D * (D / l)) * ((M / d) * ((M * h) / 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 (d <= 2.4e+63) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(D * Float64(D / l)) * Float64(Float64(M / d) * Float64(Float64(M * h) / 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 (d <= 2.4e+63)
tmp = w0 * sqrt((1.0 - (0.25 * ((D * (D / l)) * ((M / d) * ((M * h) / 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[d, 2.4e+63], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 2.4 \cdot 10^{+63}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot \left(\frac{M}{d} \cdot \frac{M \cdot h}{d}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 2.4e63Initial program 83.3%
*-commutative83.3%
times-frac82.8%
Simplified82.8%
unpow282.8%
associate-*l*83.7%
div-inv83.7%
associate-*l*82.1%
times-frac82.1%
*-un-lft-identity82.1%
*-commutative82.1%
clear-num82.1%
div-inv82.1%
div-inv82.1%
associate-*l*83.8%
times-frac83.7%
*-un-lft-identity83.7%
*-commutative83.7%
clear-num83.7%
div-inv83.7%
associate-*l*82.8%
Applied egg-rr88.2%
Taylor expanded in M around 0 51.2%
*-commutative51.2%
times-frac52.6%
unpow252.6%
associate-*l/56.3%
unpow256.3%
associate-*r*62.1%
unpow262.1%
*-commutative62.1%
*-commutative62.1%
Simplified62.1%
times-frac72.0%
Applied egg-rr72.0%
if 2.4e63 < d Initial program 82.9%
*-commutative82.9%
times-frac84.5%
Simplified84.5%
Taylor expanded in M around 0 91.2%
Final simplification76.8%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= d 1.35e+63) (* w0 (sqrt (- 1.0 (* (* (/ h (* (/ d M) (/ d M))) (* D (/ D l))) 0.25)))) w0))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 1.35e+63) {
tmp = w0 * sqrt((1.0 - (((h / ((d / M) * (d / M))) * (D * (D / l))) * 0.25)));
} else {
tmp = w0;
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 1.35d+63) then
tmp = w0 * sqrt((1.0d0 - (((h / ((d_1 / m) * (d_1 / m))) * (d * (d / l))) * 0.25d0)))
else
tmp = w0
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 1.35e+63) {
tmp = w0 * Math.sqrt((1.0 - (((h / ((d / M) * (d / M))) * (D * (D / l))) * 0.25)));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 1.35e+63: tmp = w0 * math.sqrt((1.0 - (((h / ((d / M) * (d / M))) * (D * (D / l))) * 0.25))) else: tmp = w0 return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 1.35e+63) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(h / Float64(Float64(d / M) * Float64(d / M))) * Float64(D * Float64(D / l))) * 0.25)))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 1.35e+63)
tmp = w0 * sqrt((1.0 - (((h / ((d / M) * (d / M))) * (D * (D / l))) * 0.25)));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 1.35e+63], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(h / N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.35 \cdot 10^{+63}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \left(\frac{h}{\frac{d}{M} \cdot \frac{d}{M}} \cdot \left(D \cdot \frac{D}{\ell}\right)\right) \cdot 0.25}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 1.35000000000000009e63Initial program 83.3%
*-commutative83.3%
times-frac82.8%
Simplified82.8%
unpow282.8%
associate-*l*83.7%
div-inv83.7%
associate-*l*82.1%
times-frac82.1%
*-un-lft-identity82.1%
*-commutative82.1%
clear-num82.1%
div-inv82.1%
div-inv82.1%
associate-*l*83.8%
times-frac83.7%
*-un-lft-identity83.7%
*-commutative83.7%
clear-num83.7%
div-inv83.7%
associate-*l*82.8%
Applied egg-rr88.2%
Taylor expanded in M around 0 51.2%
*-commutative51.2%
times-frac52.6%
unpow252.6%
associate-*l/56.3%
unpow256.3%
associate-*r*62.1%
unpow262.1%
*-commutative62.1%
*-commutative62.1%
Simplified62.1%
Taylor expanded in M around 0 56.3%
*-commutative56.3%
associate-/l*57.9%
unpow257.9%
unpow257.9%
times-frac70.9%
Simplified70.9%
if 1.35000000000000009e63 < d Initial program 82.9%
*-commutative82.9%
times-frac84.5%
Simplified84.5%
Taylor expanded in M around 0 91.2%
Final simplification76.0%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= d 5.2e+96) (fma -0.125 (/ (* D (* (/ (* M w0) (/ d M)) (/ h d))) (/ l D)) w0) w0))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 5.2e+96) {
tmp = fma(-0.125, ((D * (((M * w0) / (d / M)) * (h / d))) / (l / D)), w0);
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 5.2e+96) tmp = fma(-0.125, Float64(Float64(D * Float64(Float64(Float64(M * w0) / Float64(d / M)) * Float64(h / d))) / Float64(l / D)), w0); else tmp = w0; end return 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, 5.2e+96], N[(-0.125 * N[(N[(D * N[(N[(N[(M * w0), $MachinePrecision] / N[(d / M), $MachinePrecision]), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l / D), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision], w0]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 5.2 \cdot 10^{+96}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, \frac{D \cdot \left(\frac{M \cdot w0}{\frac{d}{M}} \cdot \frac{h}{d}\right)}{\frac{\ell}{D}}, w0\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 5.2e96Initial program 83.6%
*-commutative83.6%
times-frac83.1%
Simplified83.1%
Taylor expanded in M around 0 48.8%
fma-def48.8%
times-frac50.2%
unpow250.2%
associate-/l*53.7%
*-commutative53.7%
associate-*r*54.2%
unpow254.2%
times-frac58.9%
unpow258.9%
associate-*r*60.9%
*-commutative60.9%
Simplified60.9%
associate-*l/64.6%
associate-/l*68.6%
Applied egg-rr68.6%
if 5.2e96 < d Initial program 81.6%
*-commutative81.6%
times-frac83.5%
Simplified83.5%
Taylor expanded in M around 0 91.4%
Final simplification73.4%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 1.15e-11) w0 (* w0 (+ 1.0 (* -0.125 (* (* D (/ D l)) (/ (* M (* M h)) (* d d))))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.15e-11) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((D * (D / l)) * ((M * (M * h)) / (d * d)))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 1.15d-11) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d * (d / l)) * ((m * (m * h)) / (d_1 * d_1)))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.15e-11) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((D * (D / l)) * ((M * (M * h)) / (d * d)))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.15e-11: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * ((D * (D / l)) * ((M * (M * h)) / (d * d))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.15e-11) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D * Float64(D / l)) * Float64(Float64(M * Float64(M * h)) / Float64(d * d)))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 1.15e-11)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * ((D * (D / l)) * ((M * (M * h)) / (d * d)))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 1.15e-11], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision] / N[(d * 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 1.15 \cdot 10^{-11}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{d \cdot d}\right)\right)\\
\end{array}
\end{array}
if M < 1.15000000000000007e-11Initial program 84.1%
*-commutative84.1%
times-frac83.6%
Simplified83.6%
Taylor expanded in M around 0 77.8%
if 1.15000000000000007e-11 < M Initial program 80.1%
*-commutative80.1%
times-frac81.8%
Simplified81.8%
Taylor expanded in M around 0 39.5%
*-commutative39.5%
unpow239.5%
unpow239.5%
unpow239.5%
Simplified39.5%
Taylor expanded in D around 0 39.5%
times-frac36.1%
unpow236.1%
associate-*l/37.9%
unpow237.9%
associate-*r*54.8%
unpow254.8%
*-commutative54.8%
*-commutative54.8%
Simplified54.8%
Final simplification72.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 1.35e+68) (* w0 (+ 1.0 (* -0.125 (/ (* h (* (* M D) (* M D))) (* d (* d l)))))) w0))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 1.35e+68) {
tmp = w0 * (1.0 + (-0.125 * ((h * ((M * D) * (M * 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: 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.35d+68) then
tmp = w0 * (1.0d0 + ((-0.125d0) * ((h * ((m * d) * (m * d))) / (d_1 * (d_1 * l)))))
else
tmp = w0
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 1.35e+68) {
tmp = w0 * (1.0 + (-0.125 * ((h * ((M * D) * (M * D))) / (d * (d * l)))));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 1.35e+68: tmp = w0 * (1.0 + (-0.125 * ((h * ((M * D) * (M * D))) / (d * (d * l))))) else: tmp = w0 return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 1.35e+68) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(h * Float64(Float64(M * D) * Float64(M * D))) / Float64(d * Float64(d * l)))))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 1.35e+68)
tmp = w0 * (1.0 + (-0.125 * ((h * ((M * D) * (M * 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: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 1.35e+68], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(h * N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $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}\;d \leq 1.35 \cdot 10^{+68}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{h \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right)}{d \cdot \left(d \cdot \ell\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 1.34999999999999995e68Initial program 82.8%
*-commutative82.8%
times-frac82.3%
Simplified82.3%
Taylor expanded in M around 0 49.5%
*-commutative49.5%
unpow249.5%
unpow249.5%
unpow249.5%
Simplified49.5%
Taylor expanded in D around 0 49.5%
associate-*r*52.1%
unpow252.1%
unpow252.1%
unswap-sqr65.3%
unpow265.3%
associate-*r*70.2%
Simplified70.2%
if 1.34999999999999995e68 < d Initial program 84.2%
*-commutative84.2%
times-frac85.8%
Simplified85.8%
Taylor expanded in M around 0 92.6%
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 (if (<= d 2.25e+63) (+ w0 (* w0 (* (* (/ M d) (/ (* M h) d)) (* (* D (/ D l)) -0.125)))) w0))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 2.25e+63) {
tmp = w0 + (w0 * (((M / d) * ((M * h) / d)) * ((D * (D / l)) * -0.125)));
} else {
tmp = w0;
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 2.25d+63) then
tmp = w0 + (w0 * (((m / d_1) * ((m * h) / d_1)) * ((d * (d / l)) * (-0.125d0))))
else
tmp = w0
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 2.25e+63) {
tmp = w0 + (w0 * (((M / d) * ((M * h) / d)) * ((D * (D / l)) * -0.125)));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 2.25e+63: tmp = w0 + (w0 * (((M / d) * ((M * h) / d)) * ((D * (D / l)) * -0.125))) else: tmp = w0 return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 2.25e+63) tmp = Float64(w0 + Float64(w0 * Float64(Float64(Float64(M / d) * Float64(Float64(M * h) / d)) * Float64(Float64(D * Float64(D / l)) * -0.125)))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 2.25e+63)
tmp = w0 + (w0 * (((M / d) * ((M * h) / d)) * ((D * (D / l)) * -0.125)));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 2.25e+63], N[(w0 + N[(w0 * N[(N[(N[(M / d), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 2.25 \cdot 10^{+63}:\\
\;\;\;\;w0 + w0 \cdot \left(\left(\frac{M}{d} \cdot \frac{M \cdot h}{d}\right) \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot -0.125\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 2.25000000000000008e63Initial program 83.3%
*-commutative83.3%
times-frac82.8%
Simplified82.8%
Taylor expanded in M around 0 49.8%
*-commutative49.8%
unpow249.8%
unpow249.8%
unpow249.8%
Simplified49.8%
Taylor expanded in D around 0 49.8%
times-frac50.7%
unpow250.7%
associate-*l/54.4%
unpow254.4%
associate-*r*60.1%
unpow260.1%
*-commutative60.1%
*-commutative60.1%
Simplified60.1%
distribute-rgt-in60.1%
*-un-lft-identity60.1%
associate-*l*60.1%
times-frac68.8%
Applied egg-rr68.8%
if 2.25000000000000008e63 < d Initial program 82.9%
*-commutative82.9%
times-frac84.5%
Simplified84.5%
Taylor expanded in M around 0 91.2%
Final simplification74.4%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 9e+31) w0 (* -0.125 (* (* D (/ D l)) (* (/ (* h w0) d) (/ (* M M) d))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 9e+31) {
tmp = w0;
} else {
tmp = -0.125 * ((D * (D / l)) * (((h * w0) / d) * ((M * M) / d)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 9d+31) then
tmp = w0
else
tmp = (-0.125d0) * ((d * (d / l)) * (((h * w0) / d_1) * ((m * m) / d_1)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 9e+31) {
tmp = w0;
} else {
tmp = -0.125 * ((D * (D / l)) * (((h * w0) / d) * ((M * M) / 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 <= 9e+31: tmp = w0 else: tmp = -0.125 * ((D * (D / l)) * (((h * w0) / d) * ((M * M) / 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 <= 9e+31) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(D * Float64(D / l)) * Float64(Float64(Float64(h * w0) / d) * Float64(Float64(M * M) / d)))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 9e+31)
tmp = w0;
else
tmp = -0.125 * ((D * (D / l)) * (((h * w0) / d) * ((M * M) / d)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 9e+31], w0, N[(-0.125 * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(h * w0), $MachinePrecision] / d), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 9 \cdot 10^{+31}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot \left(\frac{h \cdot w0}{d} \cdot \frac{M \cdot M}{d}\right)\right)\\
\end{array}
\end{array}
if M < 8.9999999999999992e31Initial program 84.3%
*-commutative84.3%
times-frac83.9%
Simplified83.9%
Taylor expanded in M around 0 76.9%
if 8.9999999999999992e31 < M Initial program 78.4%
*-commutative78.4%
times-frac80.4%
Simplified80.4%
Taylor expanded in M around 0 36.6%
*-commutative36.6%
unpow236.6%
unpow236.6%
unpow236.6%
Simplified36.6%
Taylor expanded in D around 0 36.6%
times-frac32.5%
unpow232.5%
associate-*l/34.6%
unpow234.6%
associate-*r*54.5%
unpow254.5%
*-commutative54.5%
*-commutative54.5%
Simplified54.5%
Taylor expanded in M around inf 23.3%
*-commutative23.3%
*-commutative23.3%
*-commutative23.3%
times-frac21.1%
unpow221.1%
associate-*r/23.2%
*-commutative23.2%
associate-*r*23.2%
unpow223.2%
unpow223.2%
Simplified23.2%
times-frac25.6%
*-commutative25.6%
Applied egg-rr25.6%
Final simplification66.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 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%
*-commutative83.2%
times-frac83.2%
Simplified83.2%
Taylor expanded in M around 0 72.9%
Final simplification72.9%
herbie shell --seed 2023215
(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))))))