
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* D M) (* d 2.0)) 2.0) (/ h l)) 1e-9) (* w0 (sqrt (- 1.0 (* (/ h l) (pow (/ (/ M d) (/ 2.0 D)) 2.0))))) (* w0 (sqrt (- 1.0 (/ (* 0.25 (* (/ M (/ d (* h M))) (/ (* 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 ((pow(((D * M) / (d * 2.0)), 2.0) * (h / l)) <= 1e-9) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((M / d) / (2.0 / D)), 2.0))));
} else {
tmp = w0 * sqrt((1.0 - ((0.25 * ((M / (d / (h * M))) * ((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 (((((d * m) / (d_1 * 2.0d0)) ** 2.0d0) * (h / l)) <= 1d-9) then
tmp = w0 * sqrt((1.0d0 - ((h / l) * (((m / d_1) / (2.0d0 / d)) ** 2.0d0))))
else
tmp = w0 * sqrt((1.0d0 - ((0.25d0 * ((m / (d_1 / (h * m))) * ((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 ((Math.pow(((D * M) / (d * 2.0)), 2.0) * (h / l)) <= 1e-9) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((M / d) / (2.0 / D)), 2.0))));
} else {
tmp = w0 * Math.sqrt((1.0 - ((0.25 * ((M / (d / (h * M))) * ((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 (math.pow(((D * M) / (d * 2.0)), 2.0) * (h / l)) <= 1e-9: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((M / d) / (2.0 / D)), 2.0)))) else: tmp = w0 * math.sqrt((1.0 - ((0.25 * ((M / (d / (h * M))) * ((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 (Float64((Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= 1e-9) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(M / d) / Float64(2.0 / D)) ^ 2.0))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.25 * Float64(Float64(M / Float64(d / Float64(h * M))) * Float64(Float64(D * D) / d))) / l)))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (((((D * M) / (d * 2.0)) ^ 2.0) * (h / l)) <= 1e-9)
tmp = w0 * sqrt((1.0 - ((h / l) * (((M / d) / (2.0 / D)) ^ 2.0))));
else
tmp = w0 * sqrt((1.0 - ((0.25 * ((M / (d / (h * M))) * ((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[N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], 1e-9], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / d), $MachinePrecision] / N[(2.0 / D), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.25 * N[(N[(M / N[(d / N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq 10^{-9}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{\frac{M}{d}}{\frac{2}{D}}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\frac{M}{\frac{d}{h \cdot M}} \cdot \frac{D \cdot D}{d}\right)}{\ell}}\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < 1.00000000000000006e-9Initial program 86.4%
times-frac86.1%
Simplified86.1%
associate-*l/86.1%
associate-*r/86.4%
associate-*l/86.5%
associate-/l*86.5%
Applied egg-rr86.5%
if 1.00000000000000006e-9 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 0.0%
times-frac0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
frac-times0.0%
associate-*r/64.4%
frac-times64.4%
unpow264.4%
unpow264.4%
frac-times64.4%
div-inv64.4%
associate-*l*64.4%
associate-/r*64.4%
metadata-eval64.4%
Applied egg-rr64.4%
Taylor expanded in M around 0 57.3%
unpow257.3%
*-commutative57.3%
*-commutative57.3%
unpow257.3%
associate-*l*57.3%
times-frac75.7%
*-commutative75.7%
associate-/l*75.7%
unpow275.7%
Simplified75.7%
Final simplification85.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 (<= (* (pow (/ (* D M) (* d 2.0)) 2.0) (/ h l)) 1e-9) (* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ M d) (/ D 2.0)) 2.0))))) (* w0 (sqrt (- 1.0 (/ (* 0.25 (* (/ M (/ d (* h M))) (/ (* 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 ((pow(((D * M) / (d * 2.0)), 2.0) * (h / l)) <= 1e-9) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((M / d) * (D / 2.0)), 2.0))));
} else {
tmp = w0 * sqrt((1.0 - ((0.25 * ((M / (d / (h * M))) * ((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 (((((d * m) / (d_1 * 2.0d0)) ** 2.0d0) * (h / l)) <= 1d-9) then
tmp = w0 * sqrt((1.0d0 - ((h / l) * (((m / d_1) * (d / 2.0d0)) ** 2.0d0))))
else
tmp = w0 * sqrt((1.0d0 - ((0.25d0 * ((m / (d_1 / (h * m))) * ((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 ((Math.pow(((D * M) / (d * 2.0)), 2.0) * (h / l)) <= 1e-9) {
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 * ((M / (d / (h * M))) * ((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 (math.pow(((D * M) / (d * 2.0)), 2.0) * (h / l)) <= 1e-9: 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 * ((M / (d / (h * M))) * ((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 (Float64((Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= 1e-9) 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(0.25 * Float64(Float64(M / Float64(d / Float64(h * M))) * Float64(Float64(D * D) / d))) / l)))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (((((D * M) / (d * 2.0)) ^ 2.0) * (h / l)) <= 1e-9)
tmp = w0 * sqrt((1.0 - ((h / l) * (((M / d) * (D / 2.0)) ^ 2.0))));
else
tmp = w0 * sqrt((1.0 - ((0.25 * ((M / (d / (h * M))) * ((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[N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], 1e-9], 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[(0.25 * N[(N[(M / N[(d / N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq 10^{-9}:\\
\;\;\;\;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{0.25 \cdot \left(\frac{M}{\frac{d}{h \cdot M}} \cdot \frac{D \cdot D}{d}\right)}{\ell}}\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < 1.00000000000000006e-9Initial program 86.4%
*-commutative86.4%
times-frac86.5%
Simplified86.5%
if 1.00000000000000006e-9 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 0.0%
times-frac0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
frac-times0.0%
associate-*r/64.4%
frac-times64.4%
unpow264.4%
unpow264.4%
frac-times64.4%
div-inv64.4%
associate-*l*64.4%
associate-/r*64.4%
metadata-eval64.4%
Applied egg-rr64.4%
Taylor expanded in M around 0 57.3%
unpow257.3%
*-commutative57.3%
*-commutative57.3%
unpow257.3%
associate-*l*57.3%
times-frac75.7%
*-commutative75.7%
associate-/l*75.7%
unpow275.7%
Simplified75.7%
Final simplification85.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 4e+113) (* w0 (sqrt (- 1.0 (/ (* 0.25 (/ (* D D) (* (/ d (* h M)) (/ d M)))) l)))) (* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ M 2.0) (/ D d)) 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 (D <= 4e+113) {
tmp = w0 * sqrt((1.0 - ((0.25 * ((D * D) / ((d / (h * M)) * (d / M)))) / l)));
} else {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((M / 2.0) * (D / d)), 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 (d <= 4d+113) then
tmp = w0 * sqrt((1.0d0 - ((0.25d0 * ((d * d) / ((d_1 / (h * m)) * (d_1 / m)))) / l)))
else
tmp = w0 * sqrt((1.0d0 - ((h / l) * (((m / 2.0d0) * (d / d_1)) ** 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 (D <= 4e+113) {
tmp = w0 * Math.sqrt((1.0 - ((0.25 * ((D * D) / ((d / (h * M)) * (d / M)))) / l)));
} else {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((M / 2.0) * (D / d)), 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 D <= 4e+113: tmp = w0 * math.sqrt((1.0 - ((0.25 * ((D * D) / ((d / (h * M)) * (d / M)))) / l))) else: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((M / 2.0) * (D / d)), 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 (D <= 4e+113) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d / Float64(h * M)) * Float64(d / M)))) / l)))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 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 (D <= 4e+113)
tmp = w0 * sqrt((1.0 - ((0.25 * ((D * D) / ((d / (h * M)) * (d / M)))) / l)));
else
tmp = w0 * sqrt((1.0 - ((h / l) * (((M / 2.0) * (D / d)) ^ 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[D, 4e+113], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d / N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $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}\;D \leq 4 \cdot 10^{+113}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25 \cdot \frac{D \cdot D}{\frac{d}{h \cdot M} \cdot \frac{d}{M}}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}}\\
\end{array}
\end{array}
if D < 4e113Initial program 81.3%
times-frac81.3%
Simplified81.3%
unpow281.3%
unpow281.3%
frac-times81.3%
associate-*r/85.9%
frac-times86.0%
unpow286.0%
unpow286.0%
frac-times85.9%
div-inv85.9%
associate-*l*86.0%
associate-/r*86.0%
metadata-eval86.0%
Applied egg-rr86.0%
Taylor expanded in M around 0 56.7%
associate-/l*56.7%
unpow256.7%
*-commutative56.7%
unpow256.7%
associate-*l*59.0%
unpow259.0%
times-frac69.1%
Simplified69.1%
if 4e113 < D Initial program 79.6%
times-frac77.0%
Simplified77.0%
Final simplification70.2%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (/ (* h (pow (* D (* M (/ 0.5 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) {
return w0 * sqrt((1.0 - ((h * pow((D * (M * (0.5 / d))), 2.0)) / l)));
}
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 * sqrt((1.0d0 - ((h * ((d * (m * (0.5d0 / d_1))) ** 2.0d0)) / l)))
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 * Math.sqrt((1.0 - ((h * Math.pow((D * (M * (0.5 / d))), 2.0)) / l)));
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - ((h * math.pow((D * (M * (0.5 / d))), 2.0)) / l)))
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0)) / l)))) end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0 * sqrt((1.0 - ((h * ((D * (M * (0.5 / d))) ^ 2.0)) / l)));
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(D * N[(M * N[(0.5 / 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])\\
\\
w0 \cdot \sqrt{1 - \frac{h \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}}
\end{array}
Initial program 81.0%
times-frac80.7%
Simplified80.7%
associate-*r/84.4%
clear-num84.4%
frac-times84.7%
div-inv84.7%
associate-*l*84.4%
associate-/r*84.4%
metadata-eval84.4%
Applied egg-rr84.4%
associate-/r/84.3%
*-commutative84.3%
associate-*r*84.6%
*-commutative84.6%
associate-*r*84.7%
Simplified84.7%
associate-*l/84.7%
*-un-lft-identity84.7%
Applied egg-rr84.7%
Final simplification84.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 3e+80)
(* w0 (sqrt (- 1.0 (/ (* 0.25 (/ (* D D) (* (/ d (* h M)) (/ d M)))) l))))
(*
w0
(pow (- 1.0 (/ 0.25 (/ l (* D (* D (* M (/ (* h M) (* d d)))))))) 0.5))))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 <= 3e+80) {
tmp = w0 * sqrt((1.0 - ((0.25 * ((D * D) / ((d / (h * M)) * (d / M)))) / l)));
} else {
tmp = w0 * pow((1.0 - (0.25 / (l / (D * (D * (M * ((h * M) / (d * d)))))))), 0.5);
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: 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 <= 3d+80) then
tmp = w0 * sqrt((1.0d0 - ((0.25d0 * ((d * d) / ((d_1 / (h * m)) * (d_1 / m)))) / l)))
else
tmp = w0 * ((1.0d0 - (0.25d0 / (l / (d * (d * (m * ((h * m) / (d_1 * d_1)))))))) ** 0.5d0)
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 <= 3e+80) {
tmp = w0 * Math.sqrt((1.0 - ((0.25 * ((D * D) / ((d / (h * M)) * (d / M)))) / l)));
} else {
tmp = w0 * Math.pow((1.0 - (0.25 / (l / (D * (D * (M * ((h * M) / (d * d)))))))), 0.5);
}
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 <= 3e+80: tmp = w0 * math.sqrt((1.0 - ((0.25 * ((D * D) / ((d / (h * M)) * (d / M)))) / l))) else: tmp = w0 * math.pow((1.0 - (0.25 / (l / (D * (D * (M * ((h * M) / (d * d)))))))), 0.5) 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 <= 3e+80) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d / Float64(h * M)) * Float64(d / M)))) / l)))); else tmp = Float64(w0 * (Float64(1.0 - Float64(0.25 / Float64(l / Float64(D * Float64(D * Float64(M * Float64(Float64(h * M) / Float64(d * d)))))))) ^ 0.5)); 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 <= 3e+80)
tmp = w0 * sqrt((1.0 - ((0.25 * ((D * D) / ((d / (h * M)) * (d / M)))) / l)));
else
tmp = w0 * ((1.0 - (0.25 / (l / (D * (D * (M * ((h * M) / (d * d)))))))) ^ 0.5);
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[D, 3e+80], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d / N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Power[N[(1.0 - N[(0.25 / N[(l / N[(D * N[(D * N[(M * N[(N[(h * M), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;D \leq 3 \cdot 10^{+80}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25 \cdot \frac{D \cdot D}{\frac{d}{h \cdot M} \cdot \frac{d}{M}}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot {\left(1 - \frac{0.25}{\frac{\ell}{D \cdot \left(D \cdot \left(M \cdot \frac{h \cdot M}{d \cdot d}\right)\right)}}\right)}^{0.5}\\
\end{array}
\end{array}
if D < 2.99999999999999987e80Initial program 81.4%
times-frac81.1%
Simplified81.1%
unpow281.1%
unpow281.1%
frac-times81.4%
associate-*r/86.2%
frac-times85.8%
unpow285.8%
unpow285.8%
frac-times86.2%
div-inv86.2%
associate-*l*85.8%
associate-/r*85.8%
metadata-eval85.8%
Applied egg-rr85.8%
Taylor expanded in M around 0 56.6%
associate-/l*56.6%
unpow256.6%
*-commutative56.6%
unpow256.6%
associate-*l*58.9%
unpow258.9%
times-frac68.7%
Simplified68.7%
if 2.99999999999999987e80 < D Initial program 78.7%
times-frac78.7%
Simplified78.7%
associate-*r/76.5%
clear-num76.5%
frac-times76.4%
div-inv76.4%
associate-*l*76.5%
associate-/r*76.5%
metadata-eval76.5%
Applied egg-rr76.5%
associate-/r/76.5%
*-commutative76.5%
associate-*r*76.4%
*-commutative76.4%
associate-*r*78.8%
Simplified78.8%
associate-*l/78.8%
*-un-lft-identity78.8%
Applied egg-rr78.8%
Taylor expanded in h around 0 33.3%
unpow233.3%
*-commutative33.3%
associate-*r*35.9%
unpow235.9%
times-frac33.7%
associate-*r/36.2%
associate-*r*33.9%
unpow233.9%
*-commutative33.9%
times-frac33.5%
unpow233.5%
associate-*r*33.5%
associate-/l*38.9%
unpow238.9%
Simplified38.9%
pow1/239.0%
associate-/l*39.0%
associate-*l*69.4%
associate-/r/69.4%
Applied egg-rr69.4%
Final simplification68.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.2e+148) (* w0 (+ 1.0 (* -0.125 (/ (* (/ D l) (* M (/ (* h M) d))) (/ d D))))) (* w0 (sqrt (- 1.0 (* 0.25 (* (* (/ D d) (/ D d)) (/ (* M M) (/ l h)))))))))
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.2e+148) {
tmp = w0 * (1.0 + (-0.125 * (((D / l) * (M * ((h * M) / d))) / (d / D))));
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / h))))));
}
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.2d+148) then
tmp = w0 * (1.0d0 + ((-0.125d0) * (((d / l) * (m * ((h * m) / d_1))) / (d_1 / d))))
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (((d / d_1) * (d / d_1)) * ((m * m) / (l / h))))))
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.2e+148) {
tmp = w0 * (1.0 + (-0.125 * (((D / l) * (M * ((h * M) / d))) / (d / D))));
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / h))))));
}
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.2e+148: tmp = w0 * (1.0 + (-0.125 * (((D / l) * (M * ((h * M) / d))) / (d / D)))) else: tmp = w0 * math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / h)))))) 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.2e+148) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(Float64(D / l) * Float64(M * Float64(Float64(h * M) / d))) / Float64(d / D))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * M) / Float64(l / h))))))); 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.2e+148)
tmp = w0 * (1.0 + (-0.125 * (((D / l) * (M * ((h * M) / d))) / (d / D))));
else
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / h))))));
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.2e+148], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(N[(D / l), $MachinePrecision] * N[(M * N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d / D), $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 * M), $MachinePrecision] / N[(l / h), $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}\;d \leq 1.2 \cdot 10^{+148}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{\frac{D}{\ell} \cdot \left(M \cdot \frac{h \cdot M}{d}\right)}{\frac{d}{D}}\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)}\\
\end{array}
\end{array}
if d < 1.19999999999999997e148Initial program 80.2%
times-frac79.4%
Simplified79.4%
Taylor expanded in M around 0 48.6%
associate-*r/48.6%
*-commutative48.6%
associate-*r/48.6%
*-commutative48.6%
times-frac50.4%
unpow250.4%
*-commutative50.4%
unpow250.4%
unpow250.4%
Simplified50.4%
associate-*r/50.9%
associate-/l*55.9%
*-commutative55.9%
Applied egg-rr55.9%
add-cbrt-cube55.9%
times-frac55.4%
associate-/r/55.4%
associate-*r*55.4%
times-frac55.4%
associate-/r/55.4%
associate-*r*55.4%
times-frac62.5%
Applied egg-rr65.6%
associate-*l*65.6%
*-commutative65.6%
associate-/l*65.2%
associate-/l*65.2%
associate-*l*65.2%
associate-/l*65.2%
associate-/l*65.2%
*-commutative65.2%
associate-/l*68.0%
associate-/l*71.7%
Simplified71.7%
*-commutative71.7%
associate-*r*71.7%
*-commutative71.7%
add-cbrt-cube71.8%
associate-*r/74.2%
associate-/r/74.2%
Applied egg-rr74.2%
if 1.19999999999999997e148 < d Initial program 86.1%
times-frac88.9%
Simplified88.9%
associate-*r/91.7%
clear-num91.7%
frac-times89.0%
div-inv89.0%
associate-*l*91.7%
associate-/r*91.7%
metadata-eval91.7%
Applied egg-rr91.7%
associate-/r/91.7%
*-commutative91.7%
associate-*r*89.0%
*-commutative89.0%
associate-*r*91.7%
Simplified91.7%
associate-*l/91.7%
*-un-lft-identity91.7%
Applied egg-rr91.7%
Taylor expanded in w0 around 0 51.0%
*-commutative51.0%
*-commutative51.0%
*-commutative51.0%
Simplified71.8%
Final simplification73.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.9e+152) (* w0 (sqrt (- 1.0 (/ (* 0.25 (/ (* D D) (* (/ d (* h M)) (/ d M)))) l)))) (* w0 (+ 1.0 (* (/ (* (* h M) (/ D l)) (* (/ d M) (/ d D))) -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 (D <= 1.9e+152) {
tmp = w0 * sqrt((1.0 - ((0.25 * ((D * D) / ((d / (h * M)) * (d / M)))) / l)));
} else {
tmp = w0 * (1.0 + ((((h * M) * (D / l)) / ((d / M) * (d / D))) * -0.125));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: 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.9d+152) then
tmp = w0 * sqrt((1.0d0 - ((0.25d0 * ((d * d) / ((d_1 / (h * m)) * (d_1 / m)))) / l)))
else
tmp = w0 * (1.0d0 + ((((h * m) * (d / l)) / ((d_1 / m) * (d_1 / d))) * (-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 (D <= 1.9e+152) {
tmp = w0 * Math.sqrt((1.0 - ((0.25 * ((D * D) / ((d / (h * M)) * (d / M)))) / l)));
} else {
tmp = w0 * (1.0 + ((((h * M) * (D / l)) / ((d / M) * (d / D))) * -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 D <= 1.9e+152: tmp = w0 * math.sqrt((1.0 - ((0.25 * ((D * D) / ((d / (h * M)) * (d / M)))) / l))) else: tmp = w0 * (1.0 + ((((h * M) * (D / l)) / ((d / M) * (d / D))) * -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 (D <= 1.9e+152) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d / Float64(h * M)) * Float64(d / M)))) / l)))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(Float64(h * M) * Float64(D / l)) / Float64(Float64(d / M) * Float64(d / D))) * -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 (D <= 1.9e+152)
tmp = w0 * sqrt((1.0 - ((0.25 * ((D * D) / ((d / (h * M)) * (d / M)))) / l)));
else
tmp = w0 * (1.0 + ((((h * M) * (D / l)) / ((d / M) * (d / D))) * -0.125));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[D, 1.9e+152], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d / N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(N[(N[(h * M), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] / N[(N[(d / M), $MachinePrecision] * N[(d / D), $MachinePrecision]), $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}\;D \leq 1.9 \cdot 10^{+152}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25 \cdot \frac{D \cdot D}{\frac{d}{h \cdot M} \cdot \frac{d}{M}}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \frac{\left(h \cdot M\right) \cdot \frac{D}{\ell}}{\frac{d}{M} \cdot \frac{d}{D}} \cdot -0.125\right)\\
\end{array}
\end{array}
if D < 1.9e152Initial program 80.8%
times-frac80.9%
Simplified80.9%
unpow280.9%
unpow280.9%
frac-times80.8%
associate-*r/85.4%
frac-times85.5%
unpow285.5%
unpow285.5%
frac-times85.4%
div-inv85.4%
associate-*l*85.5%
associate-/r*85.5%
metadata-eval85.5%
Applied egg-rr85.5%
Taylor expanded in M around 0 56.4%
associate-/l*56.8%
unpow256.8%
*-commutative56.8%
unpow256.8%
associate-*l*59.1%
unpow259.1%
times-frac68.9%
Simplified68.9%
if 1.9e152 < D Initial program 82.3%
times-frac79.3%
Simplified79.3%
Taylor expanded in M around 0 25.9%
associate-*r/25.9%
*-commutative25.9%
associate-*r/25.9%
*-commutative25.9%
times-frac25.6%
unpow225.6%
*-commutative25.6%
unpow225.6%
unpow225.6%
Simplified25.6%
associate-*r/25.9%
associate-/l*57.0%
*-commutative57.0%
Applied egg-rr57.0%
add-cbrt-cube57.0%
times-frac56.9%
associate-/r/56.9%
associate-*r*56.9%
times-frac56.9%
associate-/r/56.9%
associate-*r*56.9%
times-frac57.2%
Applied egg-rr57.2%
associate-*l*57.2%
*-commutative57.2%
associate-/l*57.2%
associate-/l*57.2%
associate-*l*57.2%
associate-/l*57.2%
associate-/l*57.2%
*-commutative57.2%
associate-/l*63.8%
associate-/l*66.9%
Simplified66.9%
*-commutative66.9%
associate-*r*66.9%
*-commutative66.9%
add-cbrt-cube67.0%
frac-times70.6%
Applied egg-rr70.6%
Final simplification69.2%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 4.5e-117) w0 (* w0 (+ 1.0 (* -0.125 (* (* (/ D d) (/ D d)) (/ (* M M) (/ l h))))))))
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.5e-117) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)))));
}
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.5d-117) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (((d / d_1) * (d / d_1)) * ((m * m) / (l / h)))))
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.5e-117) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)))));
}
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.5e-117: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h))))) 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.5e-117) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * M) / Float64(l / h)))))); 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.5e-117)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)))));
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.5e-117], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(l / h), $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.5 \cdot 10^{-117}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\
\end{array}
\end{array}
if M < 4.49999999999999969e-117Initial program 81.7%
times-frac81.3%
Simplified81.3%
Taylor expanded in M around 0 68.9%
if 4.49999999999999969e-117 < M Initial program 79.4%
times-frac79.4%
Simplified79.4%
Taylor expanded in M around 0 53.9%
associate-*r/53.9%
*-commutative53.9%
associate-*r/53.9%
*-commutative53.9%
times-frac49.9%
unpow249.9%
*-commutative49.9%
unpow249.9%
unpow249.9%
Simplified49.9%
associate-*r/50.1%
associate-/l*52.6%
*-commutative52.6%
Applied egg-rr52.6%
Taylor expanded in D around 0 53.9%
times-frac53.9%
*-commutative53.9%
unpow253.9%
unpow253.9%
times-frac65.9%
associate-/l*64.5%
unpow264.5%
Simplified64.5%
Final simplification67.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.02e+120) (* w0 (+ 1.0 (* (/ (* (* h M) (/ D l)) (* (/ d M) (/ d D))) -0.125))) w0))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 1.02e+120) {
tmp = w0 * (1.0 + ((((h * M) * (D / l)) / ((d / M) * (d / D))) * -0.125));
} else {
tmp = w0;
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 1.02d+120) then
tmp = w0 * (1.0d0 + ((((h * m) * (d / l)) / ((d_1 / m) * (d_1 / d))) * (-0.125d0)))
else
tmp = w0
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 1.02e+120) {
tmp = w0 * (1.0 + ((((h * M) * (D / l)) / ((d / M) * (d / D))) * -0.125));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 1.02e+120: tmp = w0 * (1.0 + ((((h * M) * (D / l)) / ((d / M) * (d / D))) * -0.125)) else: tmp = w0 return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 1.02e+120) tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(Float64(h * M) * Float64(D / l)) / Float64(Float64(d / M) * Float64(d / D))) * -0.125))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 1.02e+120)
tmp = w0 * (1.0 + ((((h * M) * (D / l)) / ((d / M) * (d / D))) * -0.125));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 1.02e+120], N[(w0 * N[(1.0 + N[(N[(N[(N[(h * M), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] / N[(N[(d / M), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.02 \cdot 10^{+120}:\\
\;\;\;\;w0 \cdot \left(1 + \frac{\left(h \cdot M\right) \cdot \frac{D}{\ell}}{\frac{d}{M} \cdot \frac{d}{D}} \cdot -0.125\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 1.01999999999999997e120Initial program 80.0%
times-frac79.2%
Simplified79.2%
Taylor expanded in M around 0 48.6%
associate-*r/48.6%
*-commutative48.6%
associate-*r/48.6%
*-commutative48.6%
times-frac50.4%
unpow250.4%
*-commutative50.4%
unpow250.4%
unpow250.4%
Simplified50.4%
associate-*r/51.0%
associate-/l*55.5%
*-commutative55.5%
Applied egg-rr55.5%
add-cbrt-cube55.5%
times-frac55.0%
associate-/r/55.0%
associate-*r*55.0%
times-frac55.0%
associate-/r/55.0%
associate-*r*55.0%
times-frac62.2%
Applied egg-rr65.3%
associate-*l*65.3%
*-commutative65.3%
associate-/l*64.8%
associate-/l*64.8%
associate-*l*64.8%
associate-/l*64.8%
associate-/l*64.8%
*-commutative64.8%
associate-/l*67.7%
associate-/l*71.4%
Simplified71.4%
*-commutative71.4%
associate-*r*71.5%
*-commutative71.5%
add-cbrt-cube71.5%
frac-times73.2%
Applied egg-rr73.2%
if 1.01999999999999997e120 < d Initial program 86.9%
times-frac89.5%
Simplified89.5%
Taylor expanded in M around 0 84.3%
Final simplification74.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 4.7e+119) (* w0 (+ 1.0 (* -0.125 (/ (* (/ D l) (* M (/ (* h M) d))) (/ d D))))) w0))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 4.7e+119) {
tmp = w0 * (1.0 + (-0.125 * (((D / l) * (M * ((h * M) / d))) / (d / D))));
} else {
tmp = w0;
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 4.7d+119) then
tmp = w0 * (1.0d0 + ((-0.125d0) * (((d / l) * (m * ((h * m) / d_1))) / (d_1 / d))))
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 <= 4.7e+119) {
tmp = w0 * (1.0 + (-0.125 * (((D / l) * (M * ((h * M) / d))) / (d / D))));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 4.7e+119: tmp = w0 * (1.0 + (-0.125 * (((D / l) * (M * ((h * M) / d))) / (d / D)))) else: tmp = w0 return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 4.7e+119) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(Float64(D / l) * Float64(M * Float64(Float64(h * M) / d))) / Float64(d / D))))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 4.7e+119)
tmp = w0 * (1.0 + (-0.125 * (((D / l) * (M * ((h * M) / d))) / (d / D))));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 4.7e+119], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(N[(D / l), $MachinePrecision] * N[(M * N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d / D), $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 4.7 \cdot 10^{+119}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{\frac{D}{\ell} \cdot \left(M \cdot \frac{h \cdot M}{d}\right)}{\frac{d}{D}}\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 4.70000000000000008e119Initial program 80.0%
times-frac79.2%
Simplified79.2%
Taylor expanded in M around 0 48.6%
associate-*r/48.6%
*-commutative48.6%
associate-*r/48.6%
*-commutative48.6%
times-frac50.4%
unpow250.4%
*-commutative50.4%
unpow250.4%
unpow250.4%
Simplified50.4%
associate-*r/51.0%
associate-/l*55.5%
*-commutative55.5%
Applied egg-rr55.5%
add-cbrt-cube55.5%
times-frac55.0%
associate-/r/55.0%
associate-*r*55.0%
times-frac55.0%
associate-/r/55.0%
associate-*r*55.0%
times-frac62.2%
Applied egg-rr65.3%
associate-*l*65.3%
*-commutative65.3%
associate-/l*64.8%
associate-/l*64.8%
associate-*l*64.8%
associate-/l*64.8%
associate-/l*64.8%
*-commutative64.8%
associate-/l*67.7%
associate-/l*71.4%
Simplified71.4%
*-commutative71.4%
associate-*r*71.5%
*-commutative71.5%
add-cbrt-cube71.5%
associate-*r/73.9%
associate-/r/73.9%
Applied egg-rr73.9%
if 4.70000000000000008e119 < d Initial program 86.9%
times-frac89.5%
Simplified89.5%
Taylor expanded in M around 0 84.3%
Final simplification75.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.02e+24) w0 (* -0.125 (* (* D (/ D l)) (/ w0 (* (/ d (* h M)) (/ d 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 <= 1.02e+24) {
tmp = w0;
} else {
tmp = -0.125 * ((D * (D / l)) * (w0 / ((d / (h * M)) * (d / 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 <= 1.02d+24) then
tmp = w0
else
tmp = (-0.125d0) * ((d * (d / l)) * (w0 / ((d_1 / (h * m)) * (d_1 / 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 <= 1.02e+24) {
tmp = w0;
} else {
tmp = -0.125 * ((D * (D / l)) * (w0 / ((d / (h * M)) * (d / 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 <= 1.02e+24: tmp = w0 else: tmp = -0.125 * ((D * (D / l)) * (w0 / ((d / (h * M)) * (d / 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 <= 1.02e+24) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(D * Float64(D / l)) * Float64(w0 / Float64(Float64(d / Float64(h * M)) * Float64(d / 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 <= 1.02e+24)
tmp = w0;
else
tmp = -0.125 * ((D * (D / l)) * (w0 / ((d / (h * M)) * (d / 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, 1.02e+24], w0, N[(-0.125 * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(w0 / N[(N[(d / N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(d / M), $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.02 \cdot 10^{+24}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot \frac{w0}{\frac{d}{h \cdot M} \cdot \frac{d}{M}}\right)\\
\end{array}
\end{array}
if M < 1.02000000000000004e24Initial program 82.9%
times-frac82.5%
Simplified82.5%
Taylor expanded in M around 0 70.0%
if 1.02000000000000004e24 < M Initial program 73.3%
times-frac73.3%
Simplified73.3%
Taylor expanded in M around 0 52.7%
+-commutative52.7%
associate-*r/52.7%
*-commutative52.7%
associate-*r/52.7%
*-commutative52.7%
fma-def52.7%
*-commutative52.7%
times-frac52.7%
unpow252.7%
unpow252.7%
times-frac55.5%
unpow255.5%
*-commutative55.5%
unpow255.5%
associate-*l*63.3%
Simplified63.3%
Taylor expanded in D around inf 29.8%
associate-*r/29.8%
unpow229.8%
*-commutative29.8%
unpow229.8%
*-commutative29.8%
associate-*r/29.8%
times-frac25.8%
unpow225.8%
unpow225.8%
unpow225.8%
Simplified25.8%
Taylor expanded in w0 around 0 25.8%
*-commutative25.8%
associate-/l*25.7%
unpow225.7%
*-commutative25.7%
unpow225.7%
associate-*l*25.7%
times-frac26.2%
Simplified26.2%
Taylor expanded in D around 0 26.2%
unpow226.2%
associate-*l/26.2%
Simplified26.2%
Final simplification61.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 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.0%
times-frac80.7%
Simplified80.7%
Taylor expanded in M around 0 65.9%
Final simplification65.9%
herbie shell --seed 2023234
(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))))))