
(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: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))))
(if (<= t_0 2e+239)
(* w0 (sqrt t_0))
(*
w0
(sqrt (+ 1.0 (* -0.25 (* (/ D d) (* (* (/ D d) (/ M l)) (* M h))))))))))D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 2e+239) {
tmp = w0 * sqrt(t_0);
} else {
tmp = w0 * sqrt((1.0 + (-0.25 * ((D / d) * (((D / d) * (M / l)) * (M * h))))));
}
return tmp;
}
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))
if (t_0 <= 2d+239) then
tmp = w0 * sqrt(t_0)
else
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((d / d_1) * (((d / d_1) * (m / l)) * (m * h))))))
end if
code = tmp
end function
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 2e+239) {
tmp = w0 * Math.sqrt(t_0);
} else {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((D / d) * (((D / d) * (M / l)) * (M * h))))));
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): t_0 = 1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) tmp = 0 if t_0 <= 2e+239: tmp = w0 * math.sqrt(t_0) else: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((D / d) * (((D / d) * (M / l)) * (M * h)))))) return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) t_0 = Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))) tmp = 0.0 if (t_0 <= 2e+239) tmp = Float64(w0 * sqrt(t_0)); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(D / d) * Float64(Float64(Float64(D / d) * Float64(M / l)) * Float64(M * h))))))); end return tmp end
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
t_0 = 1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l));
tmp = 0.0;
if (t_0 <= 2e+239)
tmp = w0 * sqrt(t_0);
else
tmp = w0 * sqrt((1.0 + (-0.25 * ((D / d) * (((D / d) * (M / l)) * (M * h))))));
end
tmp_2 = tmp;
end
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e+239], N[(w0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(D / d), $MachinePrecision] * N[(N[(N[(D / d), $MachinePrecision] * N[(M / l), $MachinePrecision]), $MachinePrecision] * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := 1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{+239}:\\
\;\;\;\;w0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\frac{D}{d} \cdot \left(\left(\frac{D}{d} \cdot \frac{M}{\ell}\right) \cdot \left(M \cdot h\right)\right)\right)}\\
\end{array}
\end{array}
if (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < 1.99999999999999998e239Initial program 99.9%
if 1.99999999999999998e239 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) Initial program 44.0%
Taylor expanded in w0 around 0 45.7%
Simplified44.5%
*-un-lft-identity44.5%
*-commutative44.5%
times-frac51.2%
associate-/l*45.6%
associate-/r/52.4%
Applied egg-rr52.4%
*-lft-identity52.4%
*-commutative52.4%
associate-*l*55.0%
*-commutative55.0%
associate-/l*59.0%
Simplified59.0%
Taylor expanded in h around 0 53.8%
unpow253.8%
associate-*r*61.3%
associate-*l/63.9%
*-commutative63.9%
associate-/l*63.9%
Simplified63.9%
Taylor expanded in D around 0 55.8%
associate-/l*53.5%
unpow253.5%
associate-/l*55.8%
*-commutative55.8%
associate-/r*57.3%
associate-*l/57.3%
associate-*r*60.5%
associate-/l*58.3%
*-commutative58.3%
associate-*l/54.9%
associate-/r/47.0%
associate-*l*55.3%
associate-*l/63.9%
associate-*r/63.9%
*-commutative63.9%
associate-*r*64.7%
*-commutative64.7%
associate-*l*70.1%
Simplified70.1%
Final simplification89.9%
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= M 2e-155)
(* w0 (sqrt (- 1.0 (* h (/ (pow (* D (/ M (/ d 0.5))) 2.0) l)))))
(*
w0
(sqrt (+ 1.0 (* -0.25 (* (/ D d) (* (* (/ D d) (/ M l)) (* M h)))))))))D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2e-155) {
tmp = w0 * sqrt((1.0 - (h * (pow((D * (M / (d / 0.5))), 2.0) / l))));
} else {
tmp = w0 * sqrt((1.0 + (-0.25 * ((D / d) * (((D / d) * (M / l)) * (M * h))))));
}
return tmp;
}
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 2d-155) then
tmp = w0 * sqrt((1.0d0 - (h * (((d * (m / (d_1 / 0.5d0))) ** 2.0d0) / l))))
else
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((d / d_1) * (((d / d_1) * (m / l)) * (m * h))))))
end if
code = tmp
end function
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2e-155) {
tmp = w0 * Math.sqrt((1.0 - (h * (Math.pow((D * (M / (d / 0.5))), 2.0) / l))));
} else {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((D / d) * (((D / d) * (M / l)) * (M * h))))));
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 2e-155: tmp = w0 * math.sqrt((1.0 - (h * (math.pow((D * (M / (d / 0.5))), 2.0) / l)))) else: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((D / d) * (((D / d) * (M / l)) * (M * h)))))) return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 2e-155) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64((Float64(D * Float64(M / Float64(d / 0.5))) ^ 2.0) / l))))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(D / d) * Float64(Float64(Float64(D / d) * Float64(M / l)) * Float64(M * h))))))); end return tmp end
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 2e-155)
tmp = w0 * sqrt((1.0 - (h * (((D * (M / (d / 0.5))) ^ 2.0) / l))));
else
tmp = w0 * sqrt((1.0 + (-0.25 * ((D / d) * (((D / d) * (M / l)) * (M * h))))));
end
tmp_2 = tmp;
end
NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 2e-155], N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(N[Power[N[(D * N[(M / N[(d / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(D / d), $MachinePrecision] * N[(N[(N[(D / d), $MachinePrecision] * N[(M / l), $MachinePrecision]), $MachinePrecision] * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 2 \cdot 10^{-155}:\\
\;\;\;\;w0 \cdot \sqrt{1 - h \cdot \frac{{\left(D \cdot \frac{M}{\frac{d}{0.5}}\right)}^{2}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\frac{D}{d} \cdot \left(\left(\frac{D}{d} \cdot \frac{M}{\ell}\right) \cdot \left(M \cdot h\right)\right)\right)}\\
\end{array}
\end{array}
if M < 2.00000000000000003e-155Initial program 88.1%
clear-num88.1%
un-div-inv88.1%
div-inv88.0%
associate-*l*86.9%
associate-/r*86.9%
metadata-eval86.9%
Applied egg-rr86.9%
associate-/r/90.3%
*-commutative90.3%
*-commutative90.3%
associate-*r*91.5%
*-commutative91.5%
associate-*r/91.5%
associate-/l*91.5%
Simplified91.5%
if 2.00000000000000003e-155 < M Initial program 69.0%
Taylor expanded in w0 around 0 51.7%
Simplified49.5%
*-un-lft-identity49.5%
*-commutative49.5%
times-frac61.5%
associate-/l*62.2%
associate-/r/60.4%
Applied egg-rr60.4%
*-lft-identity60.4%
*-commutative60.4%
associate-*l*62.7%
*-commutative62.7%
associate-/l*65.8%
Simplified65.8%
Taylor expanded in h around 0 63.0%
unpow263.0%
associate-*r*67.3%
associate-*l/73.0%
*-commutative73.0%
associate-/l*71.9%
Simplified71.9%
Taylor expanded in D around 0 63.9%
associate-/l*63.6%
unpow263.6%
associate-/l*63.9%
*-commutative63.9%
associate-/r*65.2%
associate-*l/66.2%
associate-*r*70.1%
associate-/l*66.9%
*-commutative66.9%
associate-*l/63.7%
associate-/r/64.5%
associate-*l*71.9%
associate-*l/73.0%
associate-*r/71.9%
*-commutative71.9%
associate-*r*72.2%
*-commutative72.2%
associate-*l*77.4%
Simplified77.4%
Final simplification86.4%
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.5e+36) (* w0 (sqrt (+ 1.0 (* -0.25 (* h (* (/ D (/ l D)) (* (/ M d) (/ M d)))))))) (* w0 (+ 1.0 (* -0.125 (/ (* (* (/ D d) (/ D d)) (* M (* M h))) l))))))
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.5e+36) {
tmp = w0 * sqrt((1.0 + (-0.25 * (h * ((D / (l / D)) * ((M / d) * (M / d)))))));
} else {
tmp = w0 * (1.0 + (-0.125 * ((((D / d) * (D / d)) * (M * (M * h))) / l)));
}
return tmp;
}
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.5d+36) then
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * (h * ((d / (l / d)) * ((m / d_1) * (m / d_1)))))))
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((((d / d_1) * (d / d_1)) * (m * (m * h))) / l)))
end if
code = tmp
end function
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.5e+36) {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * (h * ((D / (l / D)) * ((M / d) * (M / d)))))));
} else {
tmp = w0 * (1.0 + (-0.125 * ((((D / d) * (D / d)) * (M * (M * h))) / l)));
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 4.5e+36: tmp = w0 * math.sqrt((1.0 + (-0.25 * (h * ((D / (l / D)) * ((M / d) * (M / d))))))) else: tmp = w0 * (1.0 + (-0.125 * ((((D / d) * (D / d)) * (M * (M * h))) / l))) return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 4.5e+36) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(h * Float64(Float64(D / Float64(l / D)) * Float64(Float64(M / d) * Float64(M / d)))))))); else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(M * Float64(M * h))) / l)))); end return tmp end
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.5e+36)
tmp = w0 * sqrt((1.0 + (-0.25 * (h * ((D / (l / D)) * ((M / d) * (M / d)))))));
else
tmp = w0 * (1.0 + (-0.125 * ((((D / d) * (D / d)) * (M * (M * h))) / l)));
end
tmp_2 = tmp;
end
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.5e+36], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(h * N[(N[(D / N[(l / D), $MachinePrecision]), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 4.5 \cdot 10^{+36}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(h \cdot \left(\frac{D}{\frac{\ell}{D}} \cdot \left(\frac{M}{d} \cdot \frac{M}{d}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(M \cdot h\right)\right)}{\ell}\right)\\
\end{array}
\end{array}
if d < 4.49999999999999997e36Initial program 79.7%
Taylor expanded in w0 around 0 53.1%
Simplified52.0%
Taylor expanded in D around 0 53.1%
unpow252.1%
*-commutative52.1%
times-frac51.0%
unpow251.0%
associate-*l/50.5%
unpow250.5%
times-frac61.6%
associate-*r*63.2%
*-commutative63.2%
times-frac52.1%
unpow252.1%
times-frac53.2%
*-commutative53.2%
times-frac54.8%
unpow254.8%
associate-/l*58.6%
times-frac72.1%
Simplified76.4%
if 4.49999999999999997e36 < d Initial program 85.3%
Taylor expanded in M around 0 65.9%
associate-/l*65.8%
*-commutative65.8%
*-commutative65.8%
associate-/l*65.9%
times-frac64.4%
unpow264.4%
unpow264.4%
*-commutative64.4%
unpow264.4%
Simplified64.4%
associate-*r/65.9%
times-frac76.6%
*-commutative76.6%
Applied egg-rr76.6%
Taylor expanded in h around 0 76.6%
*-commutative76.6%
unpow276.6%
associate-*r*81.0%
*-commutative81.0%
*-commutative81.0%
Simplified81.0%
Final simplification77.6%
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= d 3.15e+40)
(* w0 (sqrt (+ 1.0 (* -0.25 (* h (* (/ D (/ l D)) (* (/ M d) (/ M d))))))))
(*
w0
(sqrt (+ 1.0 (* -0.25 (* (* (/ D d) (/ D d)) (/ (* h (* M M)) l))))))))D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 3.15e+40) {
tmp = w0 * sqrt((1.0 + (-0.25 * (h * ((D / (l / D)) * ((M / d) * (M / d)))))));
} else {
tmp = w0 * sqrt((1.0 + (-0.25 * (((D / d) * (D / d)) * ((h * (M * M)) / l)))));
}
return tmp;
}
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 3.15d+40) then
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * (h * ((d / (l / d)) * ((m / d_1) * (m / d_1)))))))
else
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * (((d / d_1) * (d / d_1)) * ((h * (m * m)) / l)))))
end if
code = tmp
end function
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 3.15e+40) {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * (h * ((D / (l / D)) * ((M / d) * (M / d)))))));
} else {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * (((D / d) * (D / d)) * ((h * (M * M)) / l)))));
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 3.15e+40: tmp = w0 * math.sqrt((1.0 + (-0.25 * (h * ((D / (l / D)) * ((M / d) * (M / d))))))) else: tmp = w0 * math.sqrt((1.0 + (-0.25 * (((D / d) * (D / d)) * ((h * (M * M)) / l))))) return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 3.15e+40) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(h * Float64(Float64(D / Float64(l / D)) * Float64(Float64(M / d) * Float64(M / d)))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(h * Float64(M * M)) / l)))))); end return tmp end
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 3.15e+40)
tmp = w0 * sqrt((1.0 + (-0.25 * (h * ((D / (l / D)) * ((M / d) * (M / d)))))));
else
tmp = w0 * sqrt((1.0 + (-0.25 * (((D / d) * (D / d)) * ((h * (M * M)) / l)))));
end
tmp_2 = tmp;
end
NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 3.15e+40], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(h * N[(N[(D / N[(l / D), $MachinePrecision]), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 3.15 \cdot 10^{+40}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(h \cdot \left(\frac{D}{\frac{\ell}{D}} \cdot \left(\frac{M}{d} \cdot \frac{M}{d}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{h \cdot \left(M \cdot M\right)}{\ell}\right)}\\
\end{array}
\end{array}
if d < 3.15000000000000003e40Initial program 79.8%
Taylor expanded in w0 around 0 53.4%
Simplified52.3%
Taylor expanded in D around 0 53.4%
unpow252.4%
*-commutative52.4%
times-frac51.3%
unpow251.3%
associate-*l/50.8%
unpow250.8%
times-frac61.8%
associate-*r*63.4%
*-commutative63.4%
times-frac52.4%
unpow252.4%
times-frac53.4%
*-commutative53.4%
times-frac55.1%
unpow255.1%
associate-/l*58.8%
times-frac72.2%
Simplified76.5%
if 3.15000000000000003e40 < d Initial program 85.1%
Taylor expanded in w0 around 0 65.4%
Simplified63.8%
Taylor expanded in D around 0 63.8%
unpow263.9%
unpow263.9%
times-frac74.7%
Simplified77.5%
Final simplification76.8%
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.2e-100)
(* w0 (sqrt (+ 1.0 (* -0.25 (* h (* (/ D (/ l D)) (* (/ M d) (/ M d))))))))
(*
w0
(sqrt (+ 1.0 (* -0.25 (* (/ D d) (* (* M (/ M l)) (* h (/ D d))))))))))D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 4.2e-100) {
tmp = w0 * sqrt((1.0 + (-0.25 * (h * ((D / (l / D)) * ((M / d) * (M / d)))))));
} else {
tmp = w0 * sqrt((1.0 + (-0.25 * ((D / d) * ((M * (M / l)) * (h * (D / d)))))));
}
return tmp;
}
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.2d-100) then
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * (h * ((d / (l / d)) * ((m / d_1) * (m / d_1)))))))
else
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((d / d_1) * ((m * (m / l)) * (h * (d / d_1)))))))
end if
code = tmp
end function
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.2e-100) {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * (h * ((D / (l / D)) * ((M / d) * (M / d)))))));
} else {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((D / d) * ((M * (M / l)) * (h * (D / d)))))));
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 4.2e-100: tmp = w0 * math.sqrt((1.0 + (-0.25 * (h * ((D / (l / D)) * ((M / d) * (M / d))))))) else: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((D / d) * ((M * (M / l)) * (h * (D / d))))))) return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 4.2e-100) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(h * Float64(Float64(D / Float64(l / D)) * Float64(Float64(M / d) * Float64(M / d)))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(D / d) * Float64(Float64(M * Float64(M / l)) * Float64(h * Float64(D / d)))))))); end return tmp end
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.2e-100)
tmp = w0 * sqrt((1.0 + (-0.25 * (h * ((D / (l / D)) * ((M / d) * (M / d)))))));
else
tmp = w0 * sqrt((1.0 + (-0.25 * ((D / d) * ((M * (M / l)) * (h * (D / d)))))));
end
tmp_2 = tmp;
end
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.2e-100], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(h * N[(N[(D / N[(l / D), $MachinePrecision]), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(D / d), $MachinePrecision] * N[(N[(M * N[(M / l), $MachinePrecision]), $MachinePrecision] * N[(h * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 4.2 \cdot 10^{-100}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(h \cdot \left(\frac{D}{\frac{\ell}{D}} \cdot \left(\frac{M}{d} \cdot \frac{M}{d}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\frac{D}{d} \cdot \left(\left(M \cdot \frac{M}{\ell}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right)\right)}\\
\end{array}
\end{array}
if d < 4.20000000000000019e-100Initial program 81.1%
Taylor expanded in w0 around 0 53.5%
Simplified50.8%
Taylor expanded in D around 0 53.5%
unpow253.4%
*-commutative53.4%
times-frac50.8%
unpow250.8%
associate-*l/49.5%
unpow249.5%
times-frac63.2%
associate-*r*65.2%
*-commutative65.2%
times-frac51.5%
unpow251.5%
times-frac53.5%
*-commutative53.5%
times-frac54.9%
unpow254.9%
associate-/l*59.5%
times-frac76.1%
Simplified79.6%
if 4.20000000000000019e-100 < d Initial program 81.2%
Taylor expanded in w0 around 0 60.9%
Simplified61.8%
*-un-lft-identity61.8%
*-commutative61.8%
times-frac70.7%
associate-/l*69.6%
associate-/r/70.6%
Applied egg-rr70.6%
*-lft-identity70.6%
*-commutative70.6%
associate-*l*71.9%
*-commutative71.9%
associate-/l*74.7%
Simplified74.7%
Taylor expanded in D around 0 70.0%
*-commutative70.0%
*-commutative70.0%
associate-*r*70.7%
times-frac70.8%
associate-*l/71.8%
unpow271.8%
associate-/l*74.6%
*-commutative74.6%
associate-/r/74.6%
*-commutative74.6%
*-commutative74.6%
Simplified74.6%
Final simplification77.6%
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 6e-131)
(* w0 (sqrt (+ 1.0 (* -0.25 (* h (* (/ D (/ l D)) (* (/ M d) (/ M d))))))))
(*
w0
(sqrt (+ 1.0 (* -0.25 (* (/ D d) (* (* (/ D d) (/ M l)) (* M h)))))))))D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 6e-131) {
tmp = w0 * sqrt((1.0 + (-0.25 * (h * ((D / (l / D)) * ((M / d) * (M / d)))))));
} else {
tmp = w0 * sqrt((1.0 + (-0.25 * ((D / d) * (((D / d) * (M / l)) * (M * h))))));
}
return tmp;
}
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 <= 6d-131) then
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * (h * ((d / (l / d)) * ((m / d_1) * (m / d_1)))))))
else
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((d / d_1) * (((d / d_1) * (m / l)) * (m * h))))))
end if
code = tmp
end function
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 <= 6e-131) {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * (h * ((D / (l / D)) * ((M / d) * (M / d)))))));
} else {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((D / d) * (((D / d) * (M / l)) * (M * h))))));
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 6e-131: tmp = w0 * math.sqrt((1.0 + (-0.25 * (h * ((D / (l / D)) * ((M / d) * (M / d))))))) else: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((D / d) * (((D / d) * (M / l)) * (M * h)))))) return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 6e-131) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(h * Float64(Float64(D / Float64(l / D)) * Float64(Float64(M / d) * Float64(M / d)))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(D / d) * Float64(Float64(Float64(D / d) * Float64(M / l)) * Float64(M * h))))))); end return tmp end
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 6e-131)
tmp = w0 * sqrt((1.0 + (-0.25 * (h * ((D / (l / D)) * ((M / d) * (M / d)))))));
else
tmp = w0 * sqrt((1.0 + (-0.25 * ((D / d) * (((D / d) * (M / l)) * (M * h))))));
end
tmp_2 = tmp;
end
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, 6e-131], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(h * N[(N[(D / N[(l / D), $MachinePrecision]), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(D / d), $MachinePrecision] * N[(N[(N[(D / d), $MachinePrecision] * N[(M / l), $MachinePrecision]), $MachinePrecision] * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 6 \cdot 10^{-131}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(h \cdot \left(\frac{D}{\frac{\ell}{D}} \cdot \left(\frac{M}{d} \cdot \frac{M}{d}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\frac{D}{d} \cdot \left(\left(\frac{D}{d} \cdot \frac{M}{\ell}\right) \cdot \left(M \cdot h\right)\right)\right)}\\
\end{array}
\end{array}
if d < 5.99999999999999992e-131Initial program 83.1%
Taylor expanded in w0 around 0 53.3%
Simplified50.5%
Taylor expanded in D around 0 53.3%
unpow253.3%
*-commutative53.3%
times-frac50.5%
unpow250.5%
associate-*l/49.1%
unpow249.1%
times-frac63.8%
associate-*r*65.9%
*-commutative65.9%
times-frac51.3%
unpow251.3%
times-frac53.3%
*-commutative53.3%
times-frac54.2%
unpow254.2%
associate-/l*59.1%
times-frac77.0%
Simplified79.5%
if 5.99999999999999992e-131 < d Initial program 78.7%
Taylor expanded in w0 around 0 60.4%
Simplified61.1%
*-un-lft-identity61.1%
*-commutative61.1%
times-frac69.2%
associate-/l*67.1%
associate-/r/69.1%
Applied egg-rr69.1%
*-lft-identity69.1%
*-commutative69.1%
associate-*l*72.9%
*-commutative72.9%
associate-/l*75.4%
Simplified75.4%
Taylor expanded in h around 0 72.9%
unpow272.9%
associate-*r*79.7%
associate-*l/83.8%
*-commutative83.8%
associate-/l*83.8%
Simplified83.8%
Taylor expanded in D around 0 70.2%
associate-/l*69.9%
unpow269.9%
associate-/l*70.2%
*-commutative70.2%
associate-/r*72.9%
associate-*l/73.8%
associate-*r*75.3%
associate-/l*72.7%
*-commutative72.7%
associate-*l/73.7%
associate-/r/70.8%
associate-*l*79.5%
associate-*l/83.8%
associate-*r/83.8%
*-commutative83.8%
associate-*r*84.0%
*-commutative84.0%
associate-*l*86.5%
Simplified86.5%
Final simplification82.6%
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 8.4e+36) (* w0 (+ 1.0 (* -0.125 (* h (/ (* D (pow (/ M d) 2.0)) (/ l D)))))) (* w0 (+ 1.0 (* -0.125 (/ (* (* (/ D d) (/ D d)) (* M (* M h))) l))))))
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 8.4e+36) {
tmp = w0 * (1.0 + (-0.125 * (h * ((D * pow((M / d), 2.0)) / (l / D)))));
} else {
tmp = w0 * (1.0 + (-0.125 * ((((D / d) * (D / d)) * (M * (M * h))) / l)));
}
return tmp;
}
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 <= 8.4d+36) then
tmp = w0 * (1.0d0 + ((-0.125d0) * (h * ((d * ((m / d_1) ** 2.0d0)) / (l / d)))))
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((((d / d_1) * (d / d_1)) * (m * (m * h))) / l)))
end if
code = tmp
end function
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 <= 8.4e+36) {
tmp = w0 * (1.0 + (-0.125 * (h * ((D * Math.pow((M / d), 2.0)) / (l / D)))));
} else {
tmp = w0 * (1.0 + (-0.125 * ((((D / d) * (D / d)) * (M * (M * h))) / l)));
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 8.4e+36: tmp = w0 * (1.0 + (-0.125 * (h * ((D * math.pow((M / d), 2.0)) / (l / D))))) else: tmp = w0 * (1.0 + (-0.125 * ((((D / d) * (D / d)) * (M * (M * h))) / l))) return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 8.4e+36) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(h * Float64(Float64(D * (Float64(M / d) ^ 2.0)) / Float64(l / D)))))); else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(M * Float64(M * h))) / l)))); end return tmp end
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 8.4e+36)
tmp = w0 * (1.0 + (-0.125 * (h * ((D * ((M / d) ^ 2.0)) / (l / D)))));
else
tmp = w0 * (1.0 + (-0.125 * ((((D / d) * (D / d)) * (M * (M * h))) / l)));
end
tmp_2 = tmp;
end
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, 8.4e+36], N[(w0 * N[(1.0 + N[(-0.125 * N[(h * N[(N[(D * N[Power[N[(M / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(l / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 8.4 \cdot 10^{+36}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(h \cdot \frac{D \cdot {\left(\frac{M}{d}\right)}^{2}}{\frac{\ell}{D}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(M \cdot h\right)\right)}{\ell}\right)\\
\end{array}
\end{array}
if d < 8.40000000000000018e36Initial program 79.7%
Taylor expanded in M around 0 52.1%
associate-/l*51.6%
*-commutative51.6%
*-commutative51.6%
associate-/l*52.1%
times-frac51.0%
unpow251.0%
unpow251.0%
*-commutative51.0%
unpow251.0%
Simplified51.0%
Taylor expanded in D around 0 52.1%
unpow252.1%
*-commutative52.1%
times-frac51.0%
unpow251.0%
associate-*l/50.5%
unpow250.5%
times-frac61.6%
associate-*r*63.2%
*-commutative63.2%
times-frac52.1%
unpow252.1%
times-frac53.2%
*-commutative53.2%
times-frac54.8%
unpow254.8%
associate-/l*58.6%
times-frac72.1%
Simplified72.1%
associate-*l/73.8%
pow273.8%
Applied egg-rr73.8%
if 8.40000000000000018e36 < d Initial program 85.3%
Taylor expanded in M around 0 65.9%
associate-/l*65.8%
*-commutative65.8%
*-commutative65.8%
associate-/l*65.9%
times-frac64.4%
unpow264.4%
unpow264.4%
*-commutative64.4%
unpow264.4%
Simplified64.4%
associate-*r/65.9%
times-frac76.6%
*-commutative76.6%
Applied egg-rr76.6%
Taylor expanded in h around 0 76.6%
*-commutative76.6%
unpow276.6%
associate-*r*81.0%
*-commutative81.0%
*-commutative81.0%
Simplified81.0%
Final simplification75.7%
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.5e+57) (* w0 (+ 1.0 (* (* h (* (/ D (/ l D)) (* (/ M d) (/ M d)))) -0.125))) w0))
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.5e+57) {
tmp = w0 * (1.0 + ((h * ((D / (l / D)) * ((M / d) * (M / d)))) * -0.125));
} else {
tmp = w0;
}
return tmp;
}
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.5d+57) then
tmp = w0 * (1.0d0 + ((h * ((d / (l / d)) * ((m / d_1) * (m / d_1)))) * (-0.125d0)))
else
tmp = w0
end if
code = tmp
end function
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.5e+57) {
tmp = w0 * (1.0 + ((h * ((D / (l / D)) * ((M / d) * (M / d)))) * -0.125));
} else {
tmp = w0;
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 4.5e+57: tmp = w0 * (1.0 + ((h * ((D / (l / D)) * ((M / d) * (M / d)))) * -0.125)) else: tmp = w0 return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 4.5e+57) tmp = Float64(w0 * Float64(1.0 + Float64(Float64(h * Float64(Float64(D / Float64(l / D)) * Float64(Float64(M / d) * Float64(M / d)))) * -0.125))); else tmp = w0; end return tmp end
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.5e+57)
tmp = w0 * (1.0 + ((h * ((D / (l / D)) * ((M / d) * (M / d)))) * -0.125));
else
tmp = w0;
end
tmp_2 = tmp;
end
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.5e+57], N[(w0 * N[(1.0 + N[(N[(h * N[(N[(D / N[(l / D), $MachinePrecision]), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 4.5 \cdot 10^{+57}:\\
\;\;\;\;w0 \cdot \left(1 + \left(h \cdot \left(\frac{D}{\frac{\ell}{D}} \cdot \left(\frac{M}{d} \cdot \frac{M}{d}\right)\right)\right) \cdot -0.125\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 4.49999999999999996e57Initial program 80.3%
Taylor expanded in M around 0 53.1%
associate-/l*52.5%
*-commutative52.5%
*-commutative52.5%
associate-/l*53.1%
times-frac52.0%
unpow252.0%
unpow252.0%
*-commutative52.0%
unpow252.0%
Simplified52.0%
Taylor expanded in D around 0 53.1%
unpow253.1%
*-commutative53.1%
times-frac52.0%
unpow252.0%
associate-*l/51.5%
unpow251.5%
times-frac62.8%
associate-*r*64.3%
*-commutative64.3%
times-frac53.1%
unpow253.1%
times-frac54.1%
*-commutative54.1%
times-frac55.7%
unpow255.7%
associate-/l*59.4%
times-frac72.4%
Simplified72.4%
if 4.49999999999999996e57 < d Initial program 83.8%
Taylor expanded in M around 0 87.0%
Final simplification75.9%
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 6.7e+36) (* w0 (+ 1.0 (* (* h (* (/ D (/ l D)) (* (/ M d) (/ M d)))) -0.125))) (* w0 (+ 1.0 (* (* (* (/ D d) (/ D d)) (/ (* h (* M M)) l)) -0.125)))))
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 6.7e+36) {
tmp = w0 * (1.0 + ((h * ((D / (l / D)) * ((M / d) * (M / d)))) * -0.125));
} else {
tmp = w0 * (1.0 + ((((D / d) * (D / d)) * ((h * (M * M)) / l)) * -0.125));
}
return tmp;
}
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 <= 6.7d+36) then
tmp = w0 * (1.0d0 + ((h * ((d / (l / d)) * ((m / d_1) * (m / d_1)))) * (-0.125d0)))
else
tmp = w0 * (1.0d0 + ((((d / d_1) * (d / d_1)) * ((h * (m * m)) / l)) * (-0.125d0)))
end if
code = tmp
end function
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 <= 6.7e+36) {
tmp = w0 * (1.0 + ((h * ((D / (l / D)) * ((M / d) * (M / d)))) * -0.125));
} else {
tmp = w0 * (1.0 + ((((D / d) * (D / d)) * ((h * (M * M)) / l)) * -0.125));
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 6.7e+36: tmp = w0 * (1.0 + ((h * ((D / (l / D)) * ((M / d) * (M / d)))) * -0.125)) else: tmp = w0 * (1.0 + ((((D / d) * (D / d)) * ((h * (M * M)) / l)) * -0.125)) return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 6.7e+36) tmp = Float64(w0 * Float64(1.0 + Float64(Float64(h * Float64(Float64(D / Float64(l / D)) * Float64(Float64(M / d) * Float64(M / d)))) * -0.125))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(h * Float64(M * M)) / l)) * -0.125))); end return tmp end
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 6.7e+36)
tmp = w0 * (1.0 + ((h * ((D / (l / D)) * ((M / d) * (M / d)))) * -0.125));
else
tmp = w0 * (1.0 + ((((D / d) * (D / d)) * ((h * (M * M)) / l)) * -0.125));
end
tmp_2 = tmp;
end
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, 6.7e+36], N[(w0 * N[(1.0 + N[(N[(h * N[(N[(D / N[(l / D), $MachinePrecision]), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 6.7 \cdot 10^{+36}:\\
\;\;\;\;w0 \cdot \left(1 + \left(h \cdot \left(\frac{D}{\frac{\ell}{D}} \cdot \left(\frac{M}{d} \cdot \frac{M}{d}\right)\right)\right) \cdot -0.125\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{h \cdot \left(M \cdot M\right)}{\ell}\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if d < 6.6999999999999997e36Initial program 79.7%
Taylor expanded in M around 0 52.1%
associate-/l*51.6%
*-commutative51.6%
*-commutative51.6%
associate-/l*52.1%
times-frac51.0%
unpow251.0%
unpow251.0%
*-commutative51.0%
unpow251.0%
Simplified51.0%
Taylor expanded in D around 0 52.1%
unpow252.1%
*-commutative52.1%
times-frac51.0%
unpow251.0%
associate-*l/50.5%
unpow250.5%
times-frac61.6%
associate-*r*63.2%
*-commutative63.2%
times-frac52.1%
unpow252.1%
times-frac53.2%
*-commutative53.2%
times-frac54.8%
unpow254.8%
associate-/l*58.6%
times-frac72.1%
Simplified72.1%
if 6.6999999999999997e36 < d Initial program 85.3%
Taylor expanded in M around 0 65.9%
associate-/l*65.8%
*-commutative65.8%
*-commutative65.8%
associate-/l*65.9%
times-frac64.4%
unpow264.4%
unpow264.4%
*-commutative64.4%
unpow264.4%
Simplified64.4%
Taylor expanded in D around 0 64.4%
unpow264.4%
unpow264.4%
times-frac75.1%
Simplified75.1%
Final simplification72.9%
NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= d 5.4e+36) (* w0 (+ 1.0 (* (* h (* (/ D (/ l D)) (* (/ M d) (/ M d)))) -0.125))) (* w0 (+ 1.0 (* -0.125 (/ (* (* (/ D d) (/ D d)) (* M (* M h))) l))))))
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 5.4e+36) {
tmp = w0 * (1.0 + ((h * ((D / (l / D)) * ((M / d) * (M / d)))) * -0.125));
} else {
tmp = w0 * (1.0 + (-0.125 * ((((D / d) * (D / d)) * (M * (M * h))) / l)));
}
return tmp;
}
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 5.4d+36) then
tmp = w0 * (1.0d0 + ((h * ((d / (l / d)) * ((m / d_1) * (m / d_1)))) * (-0.125d0)))
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((((d / d_1) * (d / d_1)) * (m * (m * h))) / l)))
end if
code = tmp
end function
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 5.4e+36) {
tmp = w0 * (1.0 + ((h * ((D / (l / D)) * ((M / d) * (M / d)))) * -0.125));
} else {
tmp = w0 * (1.0 + (-0.125 * ((((D / d) * (D / d)) * (M * (M * h))) / l)));
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 5.4e+36: tmp = w0 * (1.0 + ((h * ((D / (l / D)) * ((M / d) * (M / d)))) * -0.125)) else: tmp = w0 * (1.0 + (-0.125 * ((((D / d) * (D / d)) * (M * (M * h))) / l))) return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 5.4e+36) tmp = Float64(w0 * Float64(1.0 + Float64(Float64(h * Float64(Float64(D / Float64(l / D)) * Float64(Float64(M / d) * Float64(M / d)))) * -0.125))); else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(M * Float64(M * h))) / l)))); end return tmp end
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 5.4e+36)
tmp = w0 * (1.0 + ((h * ((D / (l / D)) * ((M / d) * (M / d)))) * -0.125));
else
tmp = w0 * (1.0 + (-0.125 * ((((D / d) * (D / d)) * (M * (M * h))) / l)));
end
tmp_2 = tmp;
end
NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 5.4e+36], N[(w0 * N[(1.0 + N[(N[(h * N[(N[(D / N[(l / D), $MachinePrecision]), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 5.4 \cdot 10^{+36}:\\
\;\;\;\;w0 \cdot \left(1 + \left(h \cdot \left(\frac{D}{\frac{\ell}{D}} \cdot \left(\frac{M}{d} \cdot \frac{M}{d}\right)\right)\right) \cdot -0.125\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(M \cdot h\right)\right)}{\ell}\right)\\
\end{array}
\end{array}
if d < 5.4000000000000002e36Initial program 79.7%
Taylor expanded in M around 0 52.1%
associate-/l*51.6%
*-commutative51.6%
*-commutative51.6%
associate-/l*52.1%
times-frac51.0%
unpow251.0%
unpow251.0%
*-commutative51.0%
unpow251.0%
Simplified51.0%
Taylor expanded in D around 0 52.1%
unpow252.1%
*-commutative52.1%
times-frac51.0%
unpow251.0%
associate-*l/50.5%
unpow250.5%
times-frac61.6%
associate-*r*63.2%
*-commutative63.2%
times-frac52.1%
unpow252.1%
times-frac53.2%
*-commutative53.2%
times-frac54.8%
unpow254.8%
associate-/l*58.6%
times-frac72.1%
Simplified72.1%
if 5.4000000000000002e36 < d Initial program 85.3%
Taylor expanded in M around 0 65.9%
associate-/l*65.8%
*-commutative65.8%
*-commutative65.8%
associate-/l*65.9%
times-frac64.4%
unpow264.4%
unpow264.4%
*-commutative64.4%
unpow264.4%
Simplified64.4%
associate-*r/65.9%
times-frac76.6%
*-commutative76.6%
Applied egg-rr76.6%
Taylor expanded in h around 0 76.6%
*-commutative76.6%
unpow276.6%
associate-*r*81.0%
*-commutative81.0%
*-commutative81.0%
Simplified81.0%
Final simplification74.4%
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 0.000136) w0 (* -0.125 (* (* (/ D d) (/ D d)) (/ (* M (* M h)) (/ l w0))))))
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 0.000136) {
tmp = w0;
} else {
tmp = -0.125 * (((D / d) * (D / d)) * ((M * (M * h)) / (l / w0)));
}
return tmp;
}
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 <= 0.000136d0) then
tmp = w0
else
tmp = (-0.125d0) * (((d / d_1) * (d / d_1)) * ((m * (m * h)) / (l / w0)))
end if
code = tmp
end function
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 <= 0.000136) {
tmp = w0;
} else {
tmp = -0.125 * (((D / d) * (D / d)) * ((M * (M * h)) / (l / w0)));
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 0.000136: tmp = w0 else: tmp = -0.125 * (((D / d) * (D / d)) * ((M * (M * h)) / (l / w0))) return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 0.000136) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * Float64(M * h)) / Float64(l / w0)))); end return tmp end
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 0.000136)
tmp = w0;
else
tmp = -0.125 * (((D / d) * (D / d)) * ((M * (M * h)) / (l / w0)));
end
tmp_2 = tmp;
end
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, 0.000136], w0, N[(-0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision] / N[(l / w0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 0.000136:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\frac{\ell}{w0}}\right)\\
\end{array}
\end{array}
if M < 1.36e-4Initial program 86.7%
Taylor expanded in M around 0 72.8%
if 1.36e-4 < M Initial program 62.5%
Taylor expanded in M around 0 43.6%
associate-/l*43.6%
*-commutative43.6%
*-commutative43.6%
associate-/l*43.6%
times-frac40.3%
unpow240.3%
unpow240.3%
*-commutative40.3%
unpow240.3%
Simplified40.3%
Taylor expanded in D around 0 43.6%
unpow243.6%
*-commutative43.6%
times-frac40.3%
unpow240.3%
associate-*l/37.0%
unpow237.0%
times-frac45.7%
associate-*r*49.1%
*-commutative49.1%
times-frac40.3%
unpow240.3%
times-frac43.6%
*-commutative43.6%
times-frac42.2%
unpow242.2%
associate-/l*46.6%
times-frac57.2%
Simplified57.2%
Taylor expanded in h around inf 17.3%
associate-*r/17.3%
*-commutative17.3%
*-commutative17.3%
associate-*r/17.3%
times-frac17.5%
unpow217.5%
unpow217.5%
times-frac21.5%
unpow221.5%
*-commutative21.5%
associate-/l*21.3%
unpow221.3%
associate-*r*21.5%
*-commutative21.5%
*-commutative21.5%
Simplified21.5%
unpow221.5%
Applied egg-rr21.5%
Final simplification61.0%
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)
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
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
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;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return w0 end
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0;
end
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}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0
\end{array}
Initial program 81.1%
Taylor expanded in M around 0 67.6%
Final simplification67.6%
herbie shell --seed 2023279
(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))))))