
(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 15 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}
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (fma (/ (/ (* M D) (* d -2.0)) l) (* (/ (* M D) (* d 2.0)) h) 1.0))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt(fma((((M * D) / (d * -2.0)) / l), (((M * D) / (d * 2.0)) * h), 1.0));
}
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(fma(Float64(Float64(Float64(M * D) / Float64(d * -2.0)) / l), Float64(Float64(Float64(M * D) / Float64(d * 2.0)) * h), 1.0))) end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * -2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{\mathsf{fma}\left(\frac{\frac{M \cdot D}{d \cdot -2}}{\ell}, \frac{M \cdot D}{d \cdot 2} \cdot h, 1\right)}
\end{array}
Initial program 79.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-pow.f64N/A
unpow2N/A
distribute-lft-neg-inN/A
div-invN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites89.2%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
lower-*.f6489.2
Applied rewrites89.2%
Final simplification89.2%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -20000000000.0) (* w0 (sqrt (* D (/ (* (/ (* M (* D -0.25)) (* d l)) (* M h)) d)))) (* w0 1.0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -20000000000.0) {
tmp = w0 * sqrt((D * ((((M * (D * -0.25)) / (d * l)) * (M * h)) / d)));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((m * d) / (d_1 * 2.0d0)) ** 2.0d0) * (h / l)) <= (-20000000000.0d0)) then
tmp = w0 * sqrt((d * ((((m * (d * (-0.25d0))) / (d_1 * l)) * (m * h)) / d_1)))
else
tmp = w0 * 1.0d0
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((Math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -20000000000.0) {
tmp = w0 * Math.sqrt((D * ((((M * (D * -0.25)) / (d * l)) * (M * h)) / d)));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -20000000000.0: tmp = w0 * math.sqrt((D * ((((M * (D * -0.25)) / (d * l)) * (M * h)) / d))) else: tmp = w0 * 1.0 return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -20000000000.0) tmp = Float64(w0 * sqrt(Float64(D * Float64(Float64(Float64(Float64(M * Float64(D * -0.25)) / Float64(d * l)) * Float64(M * h)) / d)))); else tmp = Float64(w0 * 1.0); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (((((M * D) / (d * 2.0)) ^ 2.0) * (h / l)) <= -20000000000.0) tmp = w0 * sqrt((D * ((((M * (D * -0.25)) / (d * l)) * (M * h)) / d))); else tmp = w0 * 1.0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -20000000000.0], N[(w0 * N[Sqrt[N[(D * N[(N[(N[(N[(M * N[(D * -0.25), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(M * h), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -20000000000:\\
\;\;\;\;w0 \cdot \sqrt{D \cdot \frac{\frac{M \cdot \left(D \cdot -0.25\right)}{d \cdot \ell} \cdot \left(M \cdot h\right)}{d}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot 1\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -2e10Initial program 64.2%
Taylor expanded in M around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6444.0
Applied rewrites44.0%
Applied rewrites48.3%
Applied rewrites58.9%
Applied rewrites62.7%
if -2e10 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 85.9%
Taylor expanded in M around 0
Applied rewrites96.4%
Final simplification86.9%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -20000000000.0) (* w0 (sqrt (* D (* (/ (* D -0.25) (* d l)) (* M (/ (* M h) d)))))) (* w0 1.0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -20000000000.0) {
tmp = w0 * sqrt((D * (((D * -0.25) / (d * l)) * (M * ((M * h) / d)))));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((m * d) / (d_1 * 2.0d0)) ** 2.0d0) * (h / l)) <= (-20000000000.0d0)) then
tmp = w0 * sqrt((d * (((d * (-0.25d0)) / (d_1 * l)) * (m * ((m * h) / d_1)))))
else
tmp = w0 * 1.0d0
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((Math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -20000000000.0) {
tmp = w0 * Math.sqrt((D * (((D * -0.25) / (d * l)) * (M * ((M * h) / d)))));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -20000000000.0: tmp = w0 * math.sqrt((D * (((D * -0.25) / (d * l)) * (M * ((M * h) / d))))) else: tmp = w0 * 1.0 return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -20000000000.0) tmp = Float64(w0 * sqrt(Float64(D * Float64(Float64(Float64(D * -0.25) / Float64(d * l)) * Float64(M * Float64(Float64(M * h) / d)))))); else tmp = Float64(w0 * 1.0); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (((((M * D) / (d * 2.0)) ^ 2.0) * (h / l)) <= -20000000000.0) tmp = w0 * sqrt((D * (((D * -0.25) / (d * l)) * (M * ((M * h) / d))))); else tmp = w0 * 1.0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -20000000000.0], N[(w0 * N[Sqrt[N[(D * N[(N[(N[(D * -0.25), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(M * N[(N[(M * h), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -20000000000:\\
\;\;\;\;w0 \cdot \sqrt{D \cdot \left(\frac{D \cdot -0.25}{d \cdot \ell} \cdot \left(M \cdot \frac{M \cdot h}{d}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot 1\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -2e10Initial program 64.2%
Taylor expanded in M around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6444.0
Applied rewrites44.0%
Applied rewrites48.3%
Applied rewrites58.9%
if -2e10 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 85.9%
Taylor expanded in M around 0
Applied rewrites96.4%
Final simplification85.9%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -5e+57) (* w0 (sqrt (/ (* (* D -0.25) (* M (* D (* M h)))) (* d (* d l))))) (* w0 1.0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+57) {
tmp = w0 * sqrt((((D * -0.25) * (M * (D * (M * h)))) / (d * (d * l))));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((m * d) / (d_1 * 2.0d0)) ** 2.0d0) * (h / l)) <= (-5d+57)) then
tmp = w0 * sqrt((((d * (-0.25d0)) * (m * (d * (m * h)))) / (d_1 * (d_1 * l))))
else
tmp = w0 * 1.0d0
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((Math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+57) {
tmp = w0 * Math.sqrt((((D * -0.25) * (M * (D * (M * h)))) / (d * (d * l))));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+57: tmp = w0 * math.sqrt((((D * -0.25) * (M * (D * (M * h)))) / (d * (d * l)))) else: tmp = w0 * 1.0 return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -5e+57) tmp = Float64(w0 * sqrt(Float64(Float64(Float64(D * -0.25) * Float64(M * Float64(D * Float64(M * h)))) / Float64(d * Float64(d * l))))); else tmp = Float64(w0 * 1.0); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (((((M * D) / (d * 2.0)) ^ 2.0) * (h / l)) <= -5e+57) tmp = w0 * sqrt((((D * -0.25) * (M * (D * (M * h)))) / (d * (d * l)))); else tmp = w0 * 1.0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+57], N[(w0 * N[Sqrt[N[(N[(N[(D * -0.25), $MachinePrecision] * N[(M * N[(D * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+57}:\\
\;\;\;\;w0 \cdot \sqrt{\frac{\left(D \cdot -0.25\right) \cdot \left(M \cdot \left(D \cdot \left(M \cdot h\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot 1\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -4.99999999999999972e57Initial program 62.7%
Taylor expanded in M around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6445.9
Applied rewrites45.9%
Applied rewrites50.4%
Applied rewrites59.4%
if -4.99999999999999972e57 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 86.1%
Taylor expanded in M around 0
Applied rewrites95.1%
Final simplification85.4%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -5e+57) (* w0 (sqrt (/ (* M (* D (* M (* h (* D -0.25))))) (* d (* d l))))) (* w0 1.0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+57) {
tmp = w0 * sqrt(((M * (D * (M * (h * (D * -0.25))))) / (d * (d * l))));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((m * d) / (d_1 * 2.0d0)) ** 2.0d0) * (h / l)) <= (-5d+57)) then
tmp = w0 * sqrt(((m * (d * (m * (h * (d * (-0.25d0)))))) / (d_1 * (d_1 * l))))
else
tmp = w0 * 1.0d0
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((Math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+57) {
tmp = w0 * Math.sqrt(((M * (D * (M * (h * (D * -0.25))))) / (d * (d * l))));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+57: tmp = w0 * math.sqrt(((M * (D * (M * (h * (D * -0.25))))) / (d * (d * l)))) else: tmp = w0 * 1.0 return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -5e+57) tmp = Float64(w0 * sqrt(Float64(Float64(M * Float64(D * Float64(M * Float64(h * Float64(D * -0.25))))) / Float64(d * Float64(d * l))))); else tmp = Float64(w0 * 1.0); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (((((M * D) / (d * 2.0)) ^ 2.0) * (h / l)) <= -5e+57) tmp = w0 * sqrt(((M * (D * (M * (h * (D * -0.25))))) / (d * (d * l)))); else tmp = w0 * 1.0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+57], N[(w0 * N[Sqrt[N[(N[(M * N[(D * N[(M * N[(h * N[(D * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+57}:\\
\;\;\;\;w0 \cdot \sqrt{\frac{M \cdot \left(D \cdot \left(M \cdot \left(h \cdot \left(D \cdot -0.25\right)\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot 1\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -4.99999999999999972e57Initial program 62.7%
Taylor expanded in M around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6445.9
Applied rewrites45.9%
Applied rewrites50.4%
Applied rewrites58.2%
if -4.99999999999999972e57 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 86.1%
Taylor expanded in M around 0
Applied rewrites95.1%
Final simplification85.1%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -5e+57) (* w0 (sqrt (* (/ (* D (* D -0.25)) (* d (* d l))) (* M (* M h))))) (* w0 1.0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+57) {
tmp = w0 * sqrt((((D * (D * -0.25)) / (d * (d * l))) * (M * (M * h))));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((m * d) / (d_1 * 2.0d0)) ** 2.0d0) * (h / l)) <= (-5d+57)) then
tmp = w0 * sqrt((((d * (d * (-0.25d0))) / (d_1 * (d_1 * l))) * (m * (m * h))))
else
tmp = w0 * 1.0d0
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((Math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+57) {
tmp = w0 * Math.sqrt((((D * (D * -0.25)) / (d * (d * l))) * (M * (M * h))));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+57: tmp = w0 * math.sqrt((((D * (D * -0.25)) / (d * (d * l))) * (M * (M * h)))) else: tmp = w0 * 1.0 return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -5e+57) tmp = Float64(w0 * sqrt(Float64(Float64(Float64(D * Float64(D * -0.25)) / Float64(d * Float64(d * l))) * Float64(M * Float64(M * h))))); else tmp = Float64(w0 * 1.0); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (((((M * D) / (d * 2.0)) ^ 2.0) * (h / l)) <= -5e+57) tmp = w0 * sqrt((((D * (D * -0.25)) / (d * (d * l))) * (M * (M * h)))); else tmp = w0 * 1.0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+57], N[(w0 * N[Sqrt[N[(N[(N[(D * N[(D * -0.25), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+57}:\\
\;\;\;\;w0 \cdot \sqrt{\frac{D \cdot \left(D \cdot -0.25\right)}{d \cdot \left(d \cdot \ell\right)} \cdot \left(M \cdot \left(M \cdot h\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot 1\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -4.99999999999999972e57Initial program 62.7%
Taylor expanded in M around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6445.9
Applied rewrites45.9%
Applied rewrites50.4%
Applied rewrites53.5%
if -4.99999999999999972e57 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 86.1%
Taylor expanded in M around 0
Applied rewrites95.1%
Final simplification83.8%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -20000000000.0) (fma (* D D) (* (/ (* h -0.125) d) (/ (* M (* w0 M)) (* d l))) w0) (* w0 1.0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -20000000000.0) {
tmp = fma((D * D), (((h * -0.125) / d) * ((M * (w0 * M)) / (d * l))), w0);
} else {
tmp = w0 * 1.0;
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -20000000000.0) tmp = fma(Float64(D * D), Float64(Float64(Float64(h * -0.125) / d) * Float64(Float64(M * Float64(w0 * M)) / Float64(d * l))), w0); else tmp = Float64(w0 * 1.0); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -20000000000.0], N[(N[(D * D), $MachinePrecision] * N[(N[(N[(h * -0.125), $MachinePrecision] / d), $MachinePrecision] * N[(N[(M * N[(w0 * M), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -20000000000:\\
\;\;\;\;\mathsf{fma}\left(D \cdot D, \frac{h \cdot -0.125}{d} \cdot \frac{M \cdot \left(w0 \cdot M\right)}{d \cdot \ell}, w0\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot 1\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -2e10Initial program 64.2%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites41.6%
Applied rewrites48.0%
if -2e10 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 85.9%
Taylor expanded in M around 0
Applied rewrites96.4%
Final simplification82.8%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -2e+110) (fma (* D D) (* (* h -0.125) (/ (* M (* w0 M)) (* d (* d l)))) w0) (* w0 1.0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -2e+110) {
tmp = fma((D * D), ((h * -0.125) * ((M * (w0 * M)) / (d * (d * l)))), w0);
} else {
tmp = w0 * 1.0;
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -2e+110) tmp = fma(Float64(D * D), Float64(Float64(h * -0.125) * Float64(Float64(M * Float64(w0 * M)) / Float64(d * Float64(d * l)))), w0); else tmp = Float64(w0 * 1.0); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e+110], N[(N[(D * D), $MachinePrecision] * N[(N[(h * -0.125), $MachinePrecision] * N[(N[(M * N[(w0 * M), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+110}:\\
\;\;\;\;\mathsf{fma}\left(D \cdot D, \left(h \cdot -0.125\right) \cdot \frac{M \cdot \left(w0 \cdot M\right)}{d \cdot \left(d \cdot \ell\right)}, w0\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot 1\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -2e110Initial program 61.0%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites45.0%
Applied rewrites48.6%
if -2e110 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 86.3%
Taylor expanded in M around 0
Applied rewrites93.7%
Final simplification82.0%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -4e+208) (/ (* (* D D) (* -0.125 (* w0 (* M (* M h))))) (* l (* d d))) (* w0 1.0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -4e+208) {
tmp = ((D * D) * (-0.125 * (w0 * (M * (M * h))))) / (l * (d * d));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((m * d) / (d_1 * 2.0d0)) ** 2.0d0) * (h / l)) <= (-4d+208)) then
tmp = ((d * d) * ((-0.125d0) * (w0 * (m * (m * h))))) / (l * (d_1 * d_1))
else
tmp = w0 * 1.0d0
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((Math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -4e+208) {
tmp = ((D * D) * (-0.125 * (w0 * (M * (M * h))))) / (l * (d * d));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -4e+208: tmp = ((D * D) * (-0.125 * (w0 * (M * (M * h))))) / (l * (d * d)) else: tmp = w0 * 1.0 return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -4e+208) tmp = Float64(Float64(Float64(D * D) * Float64(-0.125 * Float64(w0 * Float64(M * Float64(M * h))))) / Float64(l * Float64(d * d))); else tmp = Float64(w0 * 1.0); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (((((M * D) / (d * 2.0)) ^ 2.0) * (h / l)) <= -4e+208) tmp = ((D * D) * (-0.125 * (w0 * (M * (M * h))))) / (l * (d * d)); else tmp = w0 * 1.0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -4e+208], N[(N[(N[(D * D), $MachinePrecision] * N[(-0.125 * N[(w0 * N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -4 \cdot 10^{+208}:\\
\;\;\;\;\frac{\left(D \cdot D\right) \cdot \left(-0.125 \cdot \left(w0 \cdot \left(M \cdot \left(M \cdot h\right)\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot 1\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -3.9999999999999999e208Initial program 59.8%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites44.9%
Taylor expanded in D around inf
Applied rewrites44.9%
Applied rewrites48.2%
if -3.9999999999999999e208 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 86.4%
Taylor expanded in M around 0
Applied rewrites92.8%
Final simplification81.6%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -2e+228) (/ (* (* D D) (* -0.125 (* w0 (* h (* M M))))) (* d (* d l))) (* w0 1.0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -2e+228) {
tmp = ((D * D) * (-0.125 * (w0 * (h * (M * M))))) / (d * (d * l));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((m * d) / (d_1 * 2.0d0)) ** 2.0d0) * (h / l)) <= (-2d+228)) then
tmp = ((d * d) * ((-0.125d0) * (w0 * (h * (m * m))))) / (d_1 * (d_1 * l))
else
tmp = w0 * 1.0d0
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((Math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -2e+228) {
tmp = ((D * D) * (-0.125 * (w0 * (h * (M * M))))) / (d * (d * l));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -2e+228: tmp = ((D * D) * (-0.125 * (w0 * (h * (M * M))))) / (d * (d * l)) else: tmp = w0 * 1.0 return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -2e+228) tmp = Float64(Float64(Float64(D * D) * Float64(-0.125 * Float64(w0 * Float64(h * Float64(M * M))))) / Float64(d * Float64(d * l))); else tmp = Float64(w0 * 1.0); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (((((M * D) / (d * 2.0)) ^ 2.0) * (h / l)) <= -2e+228) tmp = ((D * D) * (-0.125 * (w0 * (h * (M * M))))) / (d * (d * l)); else tmp = w0 * 1.0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e+228], N[(N[(N[(D * D), $MachinePrecision] * N[(-0.125 * N[(w0 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+228}:\\
\;\;\;\;\frac{\left(D \cdot D\right) \cdot \left(-0.125 \cdot \left(w0 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot 1\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -1.9999999999999998e228Initial program 57.9%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites45.4%
Taylor expanded in D around inf
Applied rewrites47.0%
Applied rewrites50.6%
if -1.9999999999999998e228 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 86.6%
Taylor expanded in M around 0
Applied rewrites91.4%
Final simplification81.7%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -5e+225) (* D (/ (* -0.125 (* D (* w0 (* h (* M M))))) (* l (* d d)))) (* w0 1.0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+225) {
tmp = D * ((-0.125 * (D * (w0 * (h * (M * M))))) / (l * (d * d)));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((m * d) / (d_1 * 2.0d0)) ** 2.0d0) * (h / l)) <= (-5d+225)) then
tmp = d * (((-0.125d0) * (d * (w0 * (h * (m * m))))) / (l * (d_1 * d_1)))
else
tmp = w0 * 1.0d0
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((Math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+225) {
tmp = D * ((-0.125 * (D * (w0 * (h * (M * M))))) / (l * (d * d)));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+225: tmp = D * ((-0.125 * (D * (w0 * (h * (M * M))))) / (l * (d * d))) else: tmp = w0 * 1.0 return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -5e+225) tmp = Float64(D * Float64(Float64(-0.125 * Float64(D * Float64(w0 * Float64(h * Float64(M * M))))) / Float64(l * Float64(d * d)))); else tmp = Float64(w0 * 1.0); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (((((M * D) / (d * 2.0)) ^ 2.0) * (h / l)) <= -5e+225) tmp = D * ((-0.125 * (D * (w0 * (h * (M * M))))) / (l * (d * d))); else tmp = w0 * 1.0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+225], N[(D * N[(N[(-0.125 * N[(D * N[(w0 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+225}:\\
\;\;\;\;D \cdot \frac{-0.125 \cdot \left(D \cdot \left(w0 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot 1\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -4.99999999999999981e225Initial program 58.5%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites44.7%
Taylor expanded in D around inf
Applied rewrites46.3%
Applied rewrites48.1%
if -4.99999999999999981e225 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 86.6%
Taylor expanded in M around 0
Applied rewrites91.9%
Final simplification81.3%
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (* d 2.0) 5e+103)
(*
w0
(sqrt (fma (/ (* M D) (* d -2.0)) (/ (/ (* (* M D) h) (* d 2.0)) l) 1.0)))
(*
w0
(sqrt
(fma (/ (* M D) (* d 2.0)) (* h (/ (* M D) (* -2.0 (* d l)))) 1.0)))))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((d * 2.0) <= 5e+103) {
tmp = w0 * sqrt(fma(((M * D) / (d * -2.0)), ((((M * D) * h) / (d * 2.0)) / l), 1.0));
} else {
tmp = w0 * sqrt(fma(((M * D) / (d * 2.0)), (h * ((M * D) / (-2.0 * (d * l)))), 1.0));
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(d * 2.0) <= 5e+103) tmp = Float64(w0 * sqrt(fma(Float64(Float64(M * D) / Float64(d * -2.0)), Float64(Float64(Float64(Float64(M * D) * h) / Float64(d * 2.0)) / l), 1.0))); else tmp = Float64(w0 * sqrt(fma(Float64(Float64(M * D) / Float64(d * 2.0)), Float64(h * Float64(Float64(M * D) / Float64(-2.0 * Float64(d * l)))), 1.0))); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(d * 2.0), $MachinePrecision], 5e+103], N[(w0 * N[Sqrt[N[(N[(N[(M * D), $MachinePrecision] / N[(d * -2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] * h), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] * N[(h * N[(N[(M * D), $MachinePrecision] / N[(-2.0 * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \cdot 2 \leq 5 \cdot 10^{+103}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{d \cdot -2}, \frac{\frac{\left(M \cdot D\right) \cdot h}{d \cdot 2}}{\ell}, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{d \cdot 2}, h \cdot \frac{M \cdot D}{-2 \cdot \left(d \cdot \ell\right)}, 1\right)}\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) d) < 5e103Initial program 80.4%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites73.7%
Applied rewrites88.6%
if 5e103 < (*.f64 #s(literal 2 binary64) d) Initial program 77.2%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites77.2%
Applied rewrites85.6%
Final simplification88.0%
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (* M D) 2e-284)
(* w0 1.0)
(*
w0
(sqrt
(fma (/ (* M D) (* d 2.0)) (* h (/ (* M D) (* -2.0 (* d l)))) 1.0)))))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((M * D) <= 2e-284) {
tmp = w0 * 1.0;
} else {
tmp = w0 * sqrt(fma(((M * D) / (d * 2.0)), (h * ((M * D) / (-2.0 * (d * l)))), 1.0));
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(M * D) <= 2e-284) tmp = Float64(w0 * 1.0); else tmp = Float64(w0 * sqrt(fma(Float64(Float64(M * D) / Float64(d * 2.0)), Float64(h * Float64(Float64(M * D) / Float64(-2.0 * Float64(d * l)))), 1.0))); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(M * D), $MachinePrecision], 2e-284], N[(w0 * 1.0), $MachinePrecision], N[(w0 * N[Sqrt[N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] * N[(h * N[(N[(M * D), $MachinePrecision] / N[(-2.0 * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \cdot D \leq 2 \cdot 10^{-284}:\\
\;\;\;\;w0 \cdot 1\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{d \cdot 2}, h \cdot \frac{M \cdot D}{-2 \cdot \left(d \cdot \ell\right)}, 1\right)}\\
\end{array}
\end{array}
if (*.f64 M D) < 2.00000000000000007e-284Initial program 82.7%
Taylor expanded in M around 0
Applied rewrites78.7%
if 2.00000000000000007e-284 < (*.f64 M D) Initial program 74.9%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites62.4%
Applied rewrites82.1%
Final simplification80.0%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (/ (* M D) (* d 2.0)) 2e+34) (* w0 1.0) (fma (/ (* D (* -0.125 (* h (* M (* w0 M))))) (* d (* d l))) D w0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (d * 2.0)) <= 2e+34) {
tmp = w0 * 1.0;
} else {
tmp = fma(((D * (-0.125 * (h * (M * (w0 * M))))) / (d * (d * l))), D, w0);
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(Float64(M * D) / Float64(d * 2.0)) <= 2e+34) tmp = Float64(w0 * 1.0); else tmp = fma(Float64(Float64(D * Float64(-0.125 * Float64(h * Float64(M * Float64(w0 * M))))) / Float64(d * Float64(d * l))), D, w0); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2e+34], N[(w0 * 1.0), $MachinePrecision], N[(N[(N[(D * N[(-0.125 * N[(h * N[(M * N[(w0 * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * D + w0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{d \cdot 2} \leq 2 \cdot 10^{+34}:\\
\;\;\;\;w0 \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{D \cdot \left(-0.125 \cdot \left(h \cdot \left(M \cdot \left(w0 \cdot M\right)\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}, D, w0\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) < 1.99999999999999989e34Initial program 83.5%
Taylor expanded in M around 0
Applied rewrites80.4%
if 1.99999999999999989e34 < (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) Initial program 61.0%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites33.9%
Applied rewrites53.9%
Final simplification76.1%
(FPCore (w0 M D h l d) :precision binary64 (* w0 1.0))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * 1.0;
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * 1.0d0
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * 1.0;
}
def code(w0, M, D, h, l, d): return w0 * 1.0
function code(w0, M, D, h, l, d) return Float64(w0 * 1.0) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * 1.0; end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * 1.0), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot 1
\end{array}
Initial program 79.8%
Taylor expanded in M around 0
Applied rewrites70.7%
herbie shell --seed 2024237
(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))))))