
(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 11 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))) 5e+271) (* w0 (sqrt (- 1.0 (* (/ h l) (pow (/ D (/ 2.0 (/ M d))) 2.0))))) (* w0 (sqrt (- 1.0 (* 0.25 (* (* (/ D d) (/ D d)) (* M (/ (* M h) 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))) <= 5e+271) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow((D / (2.0 / (M / d))), 2.0))));
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * (M * ((M * h) / 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))) <= 5d+271) then
tmp = w0 * sqrt((1.0d0 - ((h / l) * ((d / (2.0d0 / (m / d_1))) ** 2.0d0))))
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (((d / d_1) * (d / d_1)) * (m * ((m * h) / 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))) <= 5e+271) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow((D / (2.0 / (M / d))), 2.0))));
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * (M * ((M * h) / 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))) <= 5e+271: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow((D / (2.0 / (M / d))), 2.0)))) else: tmp = w0 * math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * (M * ((M * h) / 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))) <= 5e+271) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(D / Float64(2.0 / Float64(M / d))) ^ 2.0))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(M * Float64(Float64(M * h) / 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))) <= 5e+271)
tmp = w0 * sqrt((1.0 - ((h / l) * ((D / (2.0 / (M / d))) ^ 2.0))));
else
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * (M * ((M * h) / 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], 5e+271], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(D / N[(2.0 / N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M * N[(N[(M * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq 5 \cdot 10^{+271}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{D}{\frac{2}{\frac{M}{d}}}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(M \cdot \frac{M \cdot h}{\ell}\right)\right)}\\
\end{array}
\end{array}
if (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < 5.0000000000000003e271Initial program 99.4%
Simplified96.5%
associate-*l/96.5%
associate-/l*96.5%
Applied egg-rr96.5%
if 5.0000000000000003e271 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) Initial program 43.6%
Simplified44.8%
Taylor expanded in D around 0 45.6%
times-frac49.1%
unpow249.1%
unpow249.1%
unpow249.1%
Simplified49.1%
times-frac58.8%
Applied egg-rr58.8%
Taylor expanded in M around 0 58.8%
associate-/l*48.9%
unpow248.9%
associate-/l*51.8%
associate-/r/51.8%
Simplified51.8%
Taylor expanded in M around 0 64.7%
Final simplification86.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 (<= d 1.7e-29) (* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ M d) (/ D 2.0)) 2.0))))) (* w0 (sqrt (- 1.0 (* 0.25 (* (* (/ D d) (/ D d)) (/ (* M (* M h)) 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 <= 1.7e-29) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((M / d) * (D / 2.0)), 2.0))));
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / 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 <= 1.7d-29) then
tmp = w0 * sqrt((1.0d0 - ((h / l) * (((m / d_1) * (d / 2.0d0)) ** 2.0d0))))
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (((d / d_1) * (d / d_1)) * ((m * (m * h)) / 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 <= 1.7e-29) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((M / d) * (D / 2.0)), 2.0))));
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / 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 <= 1.7e-29: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((M / d) * (D / 2.0)), 2.0)))) else: tmp = w0 * math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / 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 <= 1.7e-29) 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(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * Float64(M * h)) / 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 <= 1.7e-29)
tmp = w0 * sqrt((1.0 - ((h / l) * (((M / d) * (D / 2.0)) ^ 2.0))));
else
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / 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, 1.7e-29], 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[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision] / l), $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 1.7 \cdot 10^{-29}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{M}{d} \cdot \frac{D}{2}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell}\right)}\\
\end{array}
\end{array}
if d < 1.69999999999999986e-29Initial program 80.0%
Simplified77.8%
if 1.69999999999999986e-29 < d Initial program 83.6%
Simplified83.7%
Taylor expanded in D around 0 58.9%
times-frac58.8%
unpow258.8%
unpow258.8%
unpow258.8%
Simplified58.8%
times-frac68.1%
Applied egg-rr68.1%
Taylor expanded in M around 0 68.1%
unpow264.5%
associate-*l*67.3%
Simplified74.5%
Final simplification76.8%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 6.8e-151) w0 (* w0 (sqrt (- 1.0 (* 0.25 (* (* (/ D d) (/ D d)) (* h (* M (/ M l))))))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 6.8e-151) {
tmp = w0;
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * (h * (M * (M / l)))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 6.8d-151) then
tmp = w0
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (((d / d_1) * (d / d_1)) * (h * (m * (m / l)))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 6.8e-151) {
tmp = w0;
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * (h * (M * (M / l)))))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 6.8e-151: tmp = w0 else: tmp = w0 * math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * (h * (M * (M / l))))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 6.8e-151) tmp = w0; else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(h * Float64(M * Float64(M / l)))))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 6.8e-151)
tmp = w0;
else
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * (h * (M * (M / l)))))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 6.8e-151], w0, N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(h * N[(M * N[(M / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 6.8 \cdot 10^{-151}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(h \cdot \left(M \cdot \frac{M}{\ell}\right)\right)\right)}\\
\end{array}
\end{array}
if M < 6.8000000000000005e-151Initial program 82.2%
Simplified80.4%
Taylor expanded in D around 0 69.9%
if 6.8000000000000005e-151 < M Initial program 79.2%
Simplified78.1%
Taylor expanded in D around 0 48.6%
times-frac50.7%
unpow250.7%
unpow250.7%
unpow250.7%
Simplified50.7%
times-frac61.8%
Applied egg-rr61.8%
Taylor expanded in M around 0 61.8%
unpow261.8%
associate-*l*64.0%
Simplified65.0%
Taylor expanded in M around 0 61.8%
unpow261.8%
associate-/l*62.7%
associate-*l/67.2%
associate-/r/69.3%
*-commutative69.3%
associate-*l*67.1%
Simplified67.1%
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 9.2e-151) w0 (* w0 (sqrt (- 1.0 (* 0.25 (* (* (/ D d) (/ D d)) (* M (/ (* M h) l)))))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 9.2e-151) {
tmp = w0;
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * (M * ((M * h) / l))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 9.2d-151) then
tmp = w0
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (((d / d_1) * (d / d_1)) * (m * ((m * h) / l))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 9.2e-151) {
tmp = w0;
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * (M * ((M * h) / l))))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 9.2e-151: tmp = w0 else: tmp = w0 * math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * (M * ((M * h) / l)))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 9.2e-151) tmp = w0; else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(M * Float64(Float64(M * h) / l))))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 9.2e-151)
tmp = w0;
else
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * (M * ((M * h) / l))))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 9.2e-151], w0, N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M * N[(N[(M * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 9.2 \cdot 10^{-151}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(M \cdot \frac{M \cdot h}{\ell}\right)\right)}\\
\end{array}
\end{array}
if M < 9.19999999999999984e-151Initial program 82.2%
Simplified80.4%
Taylor expanded in D around 0 69.9%
if 9.19999999999999984e-151 < M Initial program 79.2%
Simplified78.1%
Taylor expanded in D around 0 48.6%
times-frac50.7%
unpow250.7%
unpow250.7%
unpow250.7%
Simplified50.7%
times-frac61.8%
Applied egg-rr61.8%
Taylor expanded in M around 0 61.8%
associate-/l*62.7%
unpow262.7%
associate-/l*67.2%
associate-/r/67.2%
Simplified67.2%
Taylor expanded in M around 0 67.2%
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 4.3e-150) w0 (* w0 (sqrt (- 1.0 (* 0.25 (* (* (/ D d) (/ D d)) (/ (* M (* M h)) 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 <= 4.3e-150) {
tmp = w0;
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / 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 <= 4.3d-150) then
tmp = w0
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (((d / d_1) * (d / d_1)) * ((m * (m * h)) / 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 <= 4.3e-150) {
tmp = w0;
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / 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 <= 4.3e-150: tmp = w0 else: tmp = w0 * math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / 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 <= 4.3e-150) tmp = w0; else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * Float64(M * h)) / 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 <= 4.3e-150)
tmp = w0;
else
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / 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, 4.3e-150], w0, N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision] / l), $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.3 \cdot 10^{-150}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell}\right)}\\
\end{array}
\end{array}
if M < 4.30000000000000004e-150Initial program 82.2%
Simplified80.4%
Taylor expanded in D around 0 69.9%
if 4.30000000000000004e-150 < M Initial program 79.2%
Simplified78.1%
Taylor expanded in D around 0 48.6%
times-frac50.7%
unpow250.7%
unpow250.7%
unpow250.7%
Simplified50.7%
times-frac61.8%
Applied egg-rr61.8%
Taylor expanded in M around 0 61.8%
unpow261.8%
associate-*l*64.0%
Simplified65.0%
Final simplification68.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 76.0) w0 (* w0 (+ 1.0 (* -0.125 (* h (* (* M (/ M d)) (/ (* D D) (* 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 (M <= 76.0) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (h * ((M * (M / d)) * ((D * D) / (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 (m <= 76.0d0) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (h * ((m * (m / d_1)) * ((d * d) / (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 (M <= 76.0) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (h * ((M * (M / d)) * ((D * D) / (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 M <= 76.0: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * (h * ((M * (M / d)) * ((D * D) / (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 (M <= 76.0) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(h * Float64(Float64(M * Float64(M / d)) * Float64(Float64(D * D) / Float64(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 (M <= 76.0)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * (h * ((M * (M / d)) * ((D * D) / (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[M, 76.0], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(h * N[(N[(M * N[(M / d), $MachinePrecision]), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 76:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(h \cdot \left(\left(M \cdot \frac{M}{d}\right) \cdot \frac{D \cdot D}{d \cdot \ell}\right)\right)\right)\\
\end{array}
\end{array}
if M < 76Initial program 82.8%
Simplified81.3%
Taylor expanded in D around 0 70.9%
if 76 < M Initial program 75.8%
Simplified74.2%
Taylor expanded in D around 0 40.5%
*-commutative40.5%
times-frac43.6%
unpow243.6%
unpow243.6%
unpow243.6%
Simplified43.6%
Taylor expanded in D around 0 40.5%
times-frac43.6%
unpow243.6%
unpow243.6%
times-frac50.3%
associate-/l*51.8%
associate-/r/50.4%
associate-*r*50.4%
times-frac43.7%
unpow243.7%
unpow243.7%
times-frac42.3%
*-commutative42.3%
unpow242.3%
associate-*l*44.1%
times-frac48.9%
unpow248.9%
unpow248.9%
Simplified48.9%
Taylor expanded in M around 0 48.9%
unpow248.9%
associate-*l/63.1%
*-commutative63.1%
Simplified63.1%
Final simplification69.0%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 1e-125) w0 (* w0 (+ 1.0 (* -0.125 (* (* (/ D d) (/ D d)) (/ M (/ (/ l h) M))))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1e-125) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / d)) * (M / ((l / h) / M)))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 1d-125) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (((d / d_1) * (d / d_1)) * (m / ((l / h) / m)))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1e-125) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / d)) * (M / ((l / h) / M)))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1e-125: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / d)) * (M / ((l / h) / M))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1e-125) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(M / Float64(Float64(l / h) / M)))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 1e-125)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / d)) * (M / ((l / h) / M)))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 1e-125], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M / N[(N[(l / h), $MachinePrecision] / M), $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 10^{-125}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M}{\frac{\frac{\ell}{h}}{M}}\right)\right)\\
\end{array}
\end{array}
if M < 1.00000000000000001e-125Initial program 81.9%
Simplified80.1%
Taylor expanded in D around 0 70.4%
if 1.00000000000000001e-125 < M Initial program 79.6%
Simplified78.5%
Taylor expanded in D around 0 46.8%
*-commutative46.8%
times-frac49.0%
unpow249.0%
unpow249.0%
unpow249.0%
Simplified49.0%
times-frac60.5%
Applied egg-rr60.5%
Taylor expanded in M around 0 60.5%
associate-/l*61.6%
unpow261.6%
associate-/l*66.1%
Simplified66.1%
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 6.2e-141) w0 (* w0 (+ 1.0 (* (* (* (/ D d) (/ D d)) (/ (* M (* M h)) 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 (M <= 6.2e-141) {
tmp = w0;
} else {
tmp = w0 * (1.0 + ((((D / d) * (D / d)) * ((M * (M * h)) / 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 (m <= 6.2d-141) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((((d / d_1) * (d / d_1)) * ((m * (m * h)) / 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 (M <= 6.2e-141) {
tmp = w0;
} else {
tmp = w0 * (1.0 + ((((D / d) * (D / d)) * ((M * (M * h)) / 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 M <= 6.2e-141: tmp = w0 else: tmp = w0 * (1.0 + ((((D / d) * (D / d)) * ((M * (M * h)) / 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 (M <= 6.2e-141) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * Float64(M * h)) / 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 (M <= 6.2e-141)
tmp = w0;
else
tmp = w0 * (1.0 + ((((D / d) * (D / d)) * ((M * (M * h)) / 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[M, 6.2e-141], w0, N[(w0 * N[(1.0 + N[(N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 6.2 \cdot 10^{-141}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell}\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if M < 6.20000000000000055e-141Initial program 81.7%
Simplified79.9%
Taylor expanded in D around 0 70.0%
if 6.20000000000000055e-141 < M Initial program 80.1%
Simplified79.0%
Taylor expanded in D around 0 48.0%
*-commutative48.0%
times-frac50.1%
unpow250.1%
unpow250.1%
unpow250.1%
Simplified50.1%
times-frac61.4%
Applied egg-rr61.4%
Taylor expanded in M around 0 61.4%
unpow261.4%
associate-*l*63.6%
Simplified63.6%
Final simplification67.8%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 2.1e+124) w0 (* (/ -0.125 (* d d)) (/ (* (* D D) (* M (* M (* h w0)))) 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 <= 2.1e+124) {
tmp = w0;
} else {
tmp = (-0.125 / (d * d)) * (((D * D) * (M * (M * (h * w0)))) / 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 <= 2.1d+124) then
tmp = w0
else
tmp = ((-0.125d0) / (d_1 * d_1)) * (((d * d) * (m * (m * (h * w0)))) / 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 <= 2.1e+124) {
tmp = w0;
} else {
tmp = (-0.125 / (d * d)) * (((D * D) * (M * (M * (h * w0)))) / 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 <= 2.1e+124: tmp = w0 else: tmp = (-0.125 / (d * d)) * (((D * D) * (M * (M * (h * w0)))) / 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 <= 2.1e+124) tmp = w0; else tmp = Float64(Float64(-0.125 / Float64(d * d)) * Float64(Float64(Float64(D * D) * Float64(M * Float64(M * Float64(h * w0)))) / 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 <= 2.1e+124)
tmp = w0;
else
tmp = (-0.125 / (d * d)) * (((D * D) * (M * (M * (h * w0)))) / 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, 2.1e+124], w0, N[(N[(-0.125 / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(D * D), $MachinePrecision] * N[(M * N[(M * N[(h * w0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 2.1 \cdot 10^{+124}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.125}{d \cdot d} \cdot \frac{\left(D \cdot D\right) \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)}{\ell}\\
\end{array}
\end{array}
if M < 2.10000000000000011e124Initial program 82.7%
Simplified81.8%
Taylor expanded in D around 0 70.5%
if 2.10000000000000011e124 < M Initial program 71.7%
Simplified66.3%
Taylor expanded in D around 0 30.7%
*-commutative30.7%
times-frac30.6%
unpow230.6%
unpow230.6%
unpow230.6%
Simplified30.6%
times-frac33.8%
Applied egg-rr33.8%
Taylor expanded in D around inf 22.8%
associate-*r/22.8%
associate-*r*22.3%
unpow222.3%
unpow222.3%
unpow222.3%
Simplified22.3%
times-frac22.3%
associate-*l*22.7%
associate-*l*23.6%
Applied egg-rr23.6%
Final simplification63.7%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 2.2e+124) w0 (/ (* -0.125 (* (* (* D D) (* M M)) (* h w0))) (* d (* 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 (M <= 2.2e+124) {
tmp = w0;
} else {
tmp = (-0.125 * (((D * D) * (M * M)) * (h * w0))) / (d * (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 (m <= 2.2d+124) then
tmp = w0
else
tmp = ((-0.125d0) * (((d * d) * (m * m)) * (h * w0))) / (d_1 * (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 (M <= 2.2e+124) {
tmp = w0;
} else {
tmp = (-0.125 * (((D * D) * (M * M)) * (h * w0))) / (d * (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 M <= 2.2e+124: tmp = w0 else: tmp = (-0.125 * (((D * D) * (M * M)) * (h * w0))) / (d * (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 (M <= 2.2e+124) tmp = w0; else tmp = Float64(Float64(-0.125 * Float64(Float64(Float64(D * D) * Float64(M * M)) * Float64(h * w0))) / Float64(d * Float64(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 (M <= 2.2e+124)
tmp = w0;
else
tmp = (-0.125 * (((D * D) * (M * M)) * (h * w0))) / (d * (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[M, 2.2e+124], w0, N[(N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision] * N[(h * w0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 2.2 \cdot 10^{+124}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.125 \cdot \left(\left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right) \cdot \left(h \cdot w0\right)\right)}{d \cdot \left(d \cdot \ell\right)}\\
\end{array}
\end{array}
if M < 2.2000000000000001e124Initial program 82.7%
Simplified81.8%
Taylor expanded in D around 0 70.5%
if 2.2000000000000001e124 < M Initial program 71.7%
Simplified66.3%
Taylor expanded in D around 0 30.7%
*-commutative30.7%
times-frac30.6%
unpow230.6%
unpow230.6%
unpow230.6%
Simplified30.6%
times-frac33.8%
Applied egg-rr33.8%
Taylor expanded in D around inf 22.8%
associate-*r/22.8%
associate-*r*22.3%
unpow222.3%
unpow222.3%
unpow222.3%
Simplified22.3%
Taylor expanded in d around 0 22.3%
unpow222.3%
associate-*r*25.3%
Simplified25.3%
Final simplification63.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 81.1%
Simplified79.6%
Taylor expanded in D around 0 67.6%
Final simplification67.6%
herbie shell --seed 2023271
(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))))))